diff options
author | Ian C <ianc@noddybox.co.uk> | 2007-03-16 00:52:01 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2007-03-16 00:52:01 +0000 |
commit | 4118ca0c9af0e0b50ca4ad3ed414e4a5254e4e92 (patch) | |
tree | ca01ea65d49420710526d0e4ea37ee99611ac26a | |
parent | e6351a008d4c8a1ac5d6d424c06df21e98e6036c (diff) |
Monitor now working properly.
-rw-r--r-- | source/monitor.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/source/monitor.c b/source/monitor.c index 20c9722..14df3bb 100644 --- a/source/monitor.c +++ b/source/monitor.c @@ -28,6 +28,7 @@ #include "textmode.h" #include "framebuffer.h" #include "zx81.h" +#include "config.h" /* ---------------------------------------- PRIVATE DATA AND TYPES */ @@ -238,10 +239,16 @@ void MachineCodeMonitor(Z80 *cpu) int running = FALSE; int cpu_display = TRUE; int key; + SoftKey soft_key; SK_DisplayKeyboard(); SK_SetDisplayBrightness(TRUE); + for(soft_key = SK_1; soft_key <= SK_SPACE; soft_key++) + { + SK_SetSticky(soft_key,TRUE); + } + while(!done) { TM_Cls(); @@ -258,9 +265,23 @@ void MachineCodeMonitor(Z80 *cpu) do { + SoftKeyEvent ev; + swiWaitForVBlank(); - key = keysDownRepeat(); - } while (!running && !key); + + while(SK_GetBareEvent(&ev)) + { + ZX81HandleKey(ev.key,ev.pressed); + + if (ev.key == SK_CONFIG && ev.pressed) + { + done = TRUE; + } + } + + key = (keysDownRepeat() & ~KEY_TOUCH); + + } while (!done && !running && !key); if (key & KEY_START) { @@ -314,4 +335,13 @@ void MachineCodeMonitor(Z80 *cpu) SK_SetDisplayBrightness(FALSE); TM_Cls(); + + for(soft_key = SK_1; soft_key <= SK_SPACE; soft_key++) + { + SK_SetSticky(soft_key,FALSE); + ZX81HandleKey(soft_key,FALSE); + } + + SK_SetSticky(SK_SHIFT,DS81_Config[DS81_STICKY_SHIFT]); + } |