summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/monitor.c34
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]);
+
}