plus3: get things back into a compiling state
authorAlan Cox <alan@linux.intel.com>
Sat, 12 Aug 2017 19:01:44 +0000 (20:01 +0100)
committerAlan Cox <alan@linux.intel.com>
Sat, 12 Aug 2017 19:01:44 +0000 (20:01 +0100)
Kernel/platform-plus3/devtty.c
Kernel/platform-plus3/main.c
Kernel/platform-plus3/plus3.s

index ff99ef7..7f16026 100644 (file)
@@ -9,6 +9,10 @@
 
 char tbuf1[TTYSIZ];
 
+uint8_t vtattr_cap;
+struct vt_repeat keyrepeat;
+static uint8_t kbd_timer;
+
 /* buffer for port scan procedure */
 uint8_t keybuf[8];
 /* Previous state */
@@ -140,9 +144,16 @@ void tty_pollirq(void)
                }
                keymap[i] = keybuf[i];
        }
+       if (keysdown && keysdown < 3) {
+               if (newkey) {
+                       keydecode();
+                       kbd_timer = keyrepeat.first;
+               } else if (! --kbd_timer) {
+                       keydecode();
+                       kbd_timer = keyrepeat.continual;
+               }
+       }
 
-       if (keysdown < 3 && newkey)
-               keydecode();
 }
 
 static uint8_t cursor[4] = { KEY_LEFT, KEY_DOWN, KEY_UP, KEY_RIGHT };
index 37987a7..68fa4ef 100644 (file)
@@ -25,3 +25,9 @@ void platform_interrupt(void)
 void map_init(void)
 {
 }
+
+uint8_t platform_param(char *p)
+{
+    used(p);
+    return 0;
+}
index 61f75b9..36ac256 100644 (file)
@@ -1,5 +1,11 @@
 ;
 ;    ZX Spectrum Plus 2A and Plus 3 hardware support
+;
+
+;
+;      For the moment we just have a single user bank and simple swap. Once
+;      we have things running that will be changed and will need the map
+;      handlers here to be adjusted
 ;
 
         .module plus3
        .globl map_kernel_restore
        .globl map_video
        .globl unmap_video
+       .globl map_for_swap
 
+        .globl _need_resched
         .globl _kernel_flag
        .globl port_map
 
         ; exported debugging tools
         .globl _trap_monitor
+        .globl _trap_reboot
         .globl outchar
 
         ; imported symbols
@@ -216,6 +225,14 @@ map_restore:
        pop hl
        pop af
        ret
+
+;
+;      a is 1 for the first bank 2 for the second. Switch to that process
+;      bank
+;
+map_for_swap:
+       jp switch_user
+
 ;
 ;      We have no easy serial debug output instead just breakpoint this
 ;      address when debugging.
@@ -226,6 +243,8 @@ outchar:
        .area _COMMONDATA
 _kernel_flag:
         .db 1
+_need_resched:
+        .db 0
 port_map:                   ; place to store current map register values
         .db 0               ; because we have no ability to read 1ffd port
                             ; to detect what page is mapped currently