33 |
|
#include <proto/cybergraphics.h> |
34 |
|
|
35 |
|
#include "sysdeps.h" |
36 |
+ |
#include "cpu_emulation.h" |
37 |
|
#include "main.h" |
38 |
|
#include "adb.h" |
39 |
|
#include "prefs.h" |
58 |
|
static struct Screen *the_screen = NULL; |
59 |
|
static struct Window *the_win = NULL; |
60 |
|
static struct BitMap *the_bitmap = NULL; |
61 |
+ |
static UWORD *null_pointer = NULL; // Blank mouse pointer data |
62 |
+ |
static UWORD *current_pointer = (UWORD *)-1; // Currently visible mouse pointer data |
63 |
|
static LONG black_pen = -1, white_pen = -1; |
64 |
|
static struct Process *periodic_proc = NULL; // Periodic process |
65 |
|
|
285 |
|
break; |
286 |
|
case 15: |
287 |
|
case 16: |
288 |
< |
if (format != PIXFMT_RGB16) { |
288 |
> |
// !!! PIXFMT_RGB15 is correct !!! |
289 |
> |
if (format != PIXFMT_RGB15) { |
290 |
|
ErrorAlert(GetString(STR_WRONG_SCREEN_FORMAT_ERR)); |
291 |
|
return false; |
292 |
|
} |
356 |
|
|
357 |
|
bool VideoInit(bool classic) |
358 |
|
{ |
359 |
+ |
// Allocate blank mouse pointer data |
360 |
+ |
null_pointer = (UWORD *)AllocMem(12, MEMF_PUBLIC | MEMF_CHIP | MEMF_CLEAR); |
361 |
+ |
if (null_pointer == NULL) { |
362 |
+ |
ErrorAlert(GetString(STR_NO_MEM_ERR)); |
363 |
+ |
return false; |
364 |
+ |
} |
365 |
+ |
|
366 |
|
// Read frame skip prefs |
367 |
|
frame_skip = PrefsFindInt32("frameskip"); |
368 |
|
if (frame_skip == 0) |
499 |
|
} |
500 |
|
break; |
501 |
|
} |
502 |
+ |
|
503 |
+ |
// Free mouse pointer |
504 |
+ |
if (null_pointer) { |
505 |
+ |
FreeMem(null_pointer, 12); |
506 |
+ |
null_pointer = NULL; |
507 |
+ |
} |
508 |
|
} |
509 |
|
|
510 |
|
|
617 |
|
case IDCMP_MOUSEMOVE: |
618 |
|
if (display_type == DISPLAY_SCREEN_P96 || display_type == DISPLAY_SCREEN_CGFX) |
619 |
|
ADBMouseMoved(mx, my); |
620 |
< |
else |
620 |
> |
else { |
621 |
|
ADBMouseMoved(mx - the_win->BorderLeft, my - the_win->BorderTop); |
622 |
+ |
if (mx < the_win->BorderLeft |
623 |
+ |
|| my < the_win->BorderTop |
624 |
+ |
|| mx >= the_win->BorderLeft + VideoMonitor.x |
625 |
+ |
|| my >= the_win->BorderTop + VideoMonitor.y) { |
626 |
+ |
if (current_pointer) { |
627 |
+ |
ClearPointer(the_win); |
628 |
+ |
current_pointer = NULL; |
629 |
+ |
} |
630 |
+ |
} else { |
631 |
+ |
if (current_pointer != null_pointer) { |
632 |
+ |
// Hide mouse pointer inside window |
633 |
+ |
SetPointer(the_win, null_pointer, 1, 16, 0, 0); |
634 |
+ |
current_pointer = null_pointer; |
635 |
+ |
} |
636 |
+ |
} |
637 |
+ |
} |
638 |
|
break; |
639 |
|
|
640 |
|
case IDCMP_MOUSEBUTTONS: |
655 |
|
case IDCMP_RAWKEY: |
656 |
|
if (qualifier & IEQUALIFIER_REPEAT) // Keyboard repeat is done by MacOS |
657 |
|
break; |
658 |
+ |
if ((qualifier & (IEQUALIFIER_LALT | IEQUALIFIER_LSHIFT | IEQUALIFIER_CONTROL)) == |
659 |
+ |
(IEQUALIFIER_LALT | IEQUALIFIER_LSHIFT | IEQUALIFIER_CONTROL)) |
660 |
+ |
&& code == 0x5f) { |
661 |
+ |
SetInterruptFlag(INTFLAG_NMI); |
662 |
+ |
TriggerInterrupt(); |
663 |
+ |
break; |
664 |
+ |
} |
665 |
+ |
|
666 |
|
if (code & IECODE_UP_PREFIX) |
667 |
|
ADBKeyUp(keycode2mac[code & 0x7f]); |
668 |
|
else |