119 |
|
mode.depth = VDEPTH_8BIT; |
120 |
|
break; |
121 |
|
case 15: |
122 |
– |
mode.depth = VDEPTH_16BIT; |
123 |
– |
break; |
122 |
|
case 16: |
123 |
|
mode.depth = VDEPTH_16BIT; |
124 |
|
break; |
154 |
|
TAG_END |
155 |
|
); |
156 |
|
if (the_win == NULL) { |
157 |
< |
ErrorAlert(GetString(STR_OPEN_WINDOW_ERR)); |
157 |
> |
ErrorAlert(STR_OPEN_WINDOW_ERR); |
158 |
|
return false; |
159 |
|
} |
160 |
|
|
161 |
|
// Create bitmap ("height + 2" for safety) |
162 |
|
the_bitmap = AllocBitMap(width, height + 2, 1, BMF_CLEAR, NULL); |
163 |
|
if (the_bitmap == NULL) { |
164 |
< |
ErrorAlert(GetString(STR_NO_MEM_ERR)); |
164 |
> |
ErrorAlert(STR_NO_MEM_ERR); |
165 |
|
return false; |
166 |
|
} |
167 |
|
|
206 |
|
TAG_END |
207 |
|
); |
208 |
|
if (the_win == NULL || error) { |
209 |
< |
ErrorAlert(GetString(STR_OPEN_WINDOW_ERR)); |
209 |
> |
ErrorAlert(STR_OPEN_WINDOW_ERR); |
210 |
|
return false; |
211 |
|
} |
212 |
|
|
214 |
|
p96PIP_GetTags(the_win, P96PIP_SourceBitMap, (ULONG)&the_bitmap, TAG_END); |
215 |
|
|
216 |
|
// Add resolution and set VideoMonitor |
219 |
– |
set_video_monitor(width, height, p96GetBitMapAttr(the_bitmap, P96BMA_BYTESPERROW), 16); |
217 |
|
VideoMonitor.mac_frame_base = p96GetBitMapAttr(the_bitmap, P96BMA_MEMORY); |
218 |
+ |
set_video_monitor(width, height, p96GetBitMapAttr(the_bitmap, P96BMA_BYTESPERROW), 16); |
219 |
|
return true; |
220 |
|
} |
221 |
|
|
235 |
|
case 15: |
236 |
|
case 16: |
237 |
|
if (format != RGBFB_R5G5B5) { |
238 |
< |
ErrorAlert(GetString(STR_WRONG_SCREEN_FORMAT_ERR)); |
238 |
> |
ErrorAlert(STR_WRONG_SCREEN_FORMAT_ERR); |
239 |
|
return false; |
240 |
|
} |
241 |
|
break; |
242 |
|
case 24: |
243 |
|
case 32: |
244 |
|
if (format != RGBFB_A8R8G8B8) { |
245 |
< |
ErrorAlert(GetString(STR_WRONG_SCREEN_FORMAT_ERR)); |
245 |
> |
ErrorAlert(STR_WRONG_SCREEN_FORMAT_ERR); |
246 |
|
return false; |
247 |
|
} |
248 |
|
break; |
249 |
|
default: |
250 |
< |
ErrorAlert(GetString(STR_WRONG_SCREEN_DEPTH_ERR)); |
250 |
> |
ErrorAlert(STR_WRONG_SCREEN_DEPTH_ERR); |
251 |
|
return false; |
252 |
|
} |
253 |
|
|
266 |
|
TAG_END |
267 |
|
); |
268 |
|
if (the_screen == NULL) { |
269 |
< |
ErrorAlert(GetString(STR_OPEN_SCREEN_ERR)); |
269 |
> |
ErrorAlert(STR_OPEN_SCREEN_ERR); |
270 |
|
return false; |
271 |
|
} |
272 |
|
|
283 |
|
TAG_END |
284 |
|
); |
285 |
|
if (the_win == NULL) { |
286 |
< |
ErrorAlert(GetString(STR_OPEN_WINDOW_ERR)); |
286 |
> |
ErrorAlert(STR_OPEN_WINDOW_ERR); |
287 |
|
return false; |
288 |
|
} |
289 |
|
|
312 |
|
case 16: |
313 |
|
// !!! PIXFMT_RGB15 is correct !!! |
314 |
|
if (format != PIXFMT_RGB15) { |
315 |
< |
ErrorAlert(GetString(STR_WRONG_SCREEN_FORMAT_ERR)); |
315 |
> |
ErrorAlert(STR_WRONG_SCREEN_FORMAT_ERR); |
316 |
|
return false; |
317 |
|
} |
318 |
|
break; |
319 |
|
case 24: |
320 |
|
case 32: |
321 |
|
if (format != PIXFMT_ARGB32) { |
322 |
< |
ErrorAlert(GetString(STR_WRONG_SCREEN_FORMAT_ERR)); |
322 |
> |
ErrorAlert(STR_WRONG_SCREEN_FORMAT_ERR); |
323 |
|
return false; |
324 |
|
} |
325 |
|
break; |
326 |
|
default: |
327 |
< |
ErrorAlert(GetString(STR_WRONG_SCREEN_DEPTH_ERR)); |
327 |
> |
ErrorAlert(STR_WRONG_SCREEN_DEPTH_ERR); |
328 |
|
return false; |
329 |
|
} |
330 |
|
|
341 |
|
TAG_END |
342 |
|
); |
343 |
|
if (the_screen == NULL) { |
344 |
< |
ErrorAlert(GetString(STR_OPEN_SCREEN_ERR)); |
344 |
> |
ErrorAlert(STR_OPEN_SCREEN_ERR); |
345 |
|
return false; |
346 |
|
} |
347 |
|
|
358 |
|
TAG_END |
359 |
|
); |
360 |
|
if (the_win == NULL) { |
361 |
< |
ErrorAlert(GetString(STR_OPEN_WINDOW_ERR)); |
361 |
> |
ErrorAlert(STR_OPEN_WINDOW_ERR); |
362 |
|
return false; |
363 |
|
} |
364 |
|
|
383 |
|
// Allocate blank mouse pointer data |
384 |
|
null_pointer = (UWORD *)AllocMem(12, MEMF_PUBLIC | MEMF_CHIP | MEMF_CLEAR); |
385 |
|
if (null_pointer == NULL) { |
386 |
< |
ErrorAlert(GetString(STR_NO_MEM_ERR)); |
386 |
> |
ErrorAlert(STR_NO_MEM_ERR); |
387 |
|
return false; |
388 |
|
} |
389 |
|
|
414 |
|
else if (CyberGfxBase && IsCyberModeID(mode_id)) |
415 |
|
display_type = DISPLAY_SCREEN_CGFX; |
416 |
|
else { |
417 |
< |
ErrorAlert(GetString(STR_NO_P96_MODE_ERR)); |
417 |
> |
ErrorAlert(STR_NO_P96_MODE_ERR); |
418 |
|
return false; |
419 |
|
} |
420 |
|
} |
451 |
|
TAG_END |
452 |
|
); |
453 |
|
if (periodic_proc == NULL) { |
454 |
< |
ErrorAlert(GetString(STR_NO_MEM_ERR)); |
454 |
> |
ErrorAlert(STR_NO_MEM_ERR); |
455 |
|
return false; |
456 |
|
} |
457 |
|
return true; |
536 |
|
* Set palette |
537 |
|
*/ |
538 |
|
|
539 |
< |
void video_set_palette(uint8 *pal) |
539 |
> |
void video_set_palette(uint8 *pal, in num) |
540 |
|
{ |
541 |
< |
if (display_type == DISPLAY_SCREEN_P96 || display_type == DISPLAY_SCREEN_CGFX) { |
541 |
> |
if ((display_type == DISPLAY_SCREEN_P96 || display_type == DISPLAY_SCREEN_CGFX) |
542 |
> |
&& !IsDirectMode(VideoMonitor.mode)) { |
543 |
|
|
544 |
|
// Convert palette to 32 bits |
545 |
|
ULONG table[2 + 256 * 3]; |
546 |
< |
table[0] = 256 << 16; |
547 |
< |
table[256 * 3 + 1] = 0; |
548 |
< |
for (int i=0; i<256; i++) { |
546 |
> |
table[0] = num << 16; |
547 |
> |
table[num * 3 + 1] = 0; |
548 |
> |
for (int i=0; i<num; i++) { |
549 |
|
table[i*3+1] = pal[i*3] * 0x01010101; |
550 |
|
table[i*3+2] = pal[i*3+1] * 0x01010101; |
551 |
|
table[i*3+3] = pal[i*3+2] * 0x01010101; |