From 18 Jan, 2021 0:00 UTC: All services will be temporary unavailable for maintenance
  • R/O
  • SSH
  • HTTPS

oricsdk: Commit


Commit MetaInfo

Revision1540 (tree)
Time2020-09-05 19:48:27
Authordbug

Log Message

Added the support for < and > keys.
See article on https://osdk.org/index.php?page=articles&ref=ART16

Change Summary

Incremental Difference

--- public/oric/routines/single_row_keyboard_read/defines.h (revision 1539)
+++ public/oric/routines/single_row_keyboard_read/defines.h (revision 1540)
@@ -5,12 +5,12 @@
55 // If you want other values, then you need to modify the keyboard
66 // reading code.
77
8-#define SPACE 1
9-#define UNUSED_1 2
10-#define UNUSED_2 4
11-#define UP_ARROW 8
12-#define LEFT_SHIFT 16
13-#define LEFT_ARROW 32
14-#define DOWN_ARROW 64
15-#define RIGHT_ARROW 128
8+#define KEY_SPACE 1
9+#define KEY_LESS_THAN 2
10+#define KEY_GREATER_THAN 4
11+#define KEY_UP_ARROW 8
12+#define KEY_LEFT_SHIFT 16
13+#define KEY_LEFT_ARROW 32
14+#define KEY_DOWN_ARROW 64
15+#define KEY_RIGHT_ARROW 128
1616
--- public/oric/routines/single_row_keyboard_read/keyboard.s (revision 1539)
+++ public/oric/routines/single_row_keyboard_read/keyboard.s (revision 1540)
@@ -92,7 +92,7 @@
9292 .)
9393
9494
95-values_code .byt $df,$7f,$f7,$bf,$fe,$ef
95+values_code .byt $df,$7f,$f7,$bf,$fe,$ef,$fd,$fb
9696
9797 ReadKeyboard
9898 .(
@@ -103,7 +103,7 @@
103103 ldy #04
104104 sty via_portb
105105
106- ldx #5
106+ ldx #7
107107 loop_read
108108
109109 ; Write Column Register Number to PortA
--- public/oric/routines/single_row_keyboard_read/main.c (revision 1539)
+++ public/oric/routines/single_row_keyboard_read/main.c (revision 1540)
@@ -35,18 +35,22 @@
3535 printf("Down Arrow\n");
3636 printf("Space\n");
3737 printf("Left Shift\n");
38+ printf("< ,\n");
39+ printf("> .\n");
3840
3941 InitIRQ();
4042 while (1)
4143 {
42- poke(0xbb80+40*2,(gKey & LEFT_ARROW)?16+1:16+2);
43- poke(0xbb80+40*3,(gKey & RIGHT_ARROW)?16+1:16+2);
44- poke(0xbb80+40*4,(gKey & UP_ARROW)?16+1:16+2);
45- poke(0xbb80+40*5,(gKey & DOWN_ARROW)?16+1:16+2);
46- poke(0xbb80+40*6,(gKey & SPACE)?16+1:16+2);
47- poke(0xbb80+40*7,(gKey & LEFT_SHIFT)?16+1:16+2);
44+ poke(0xbb80+40*2,(gKey & KEY_LEFT_ARROW)?16+1:16+2);
45+ poke(0xbb80+40*3,(gKey & KEY_RIGHT_ARROW)?16+1:16+2);
46+ poke(0xbb80+40*4,(gKey & KEY_UP_ARROW)?16+1:16+2);
47+ poke(0xbb80+40*5,(gKey & KEY_DOWN_ARROW)?16+1:16+2);
48+ poke(0xbb80+40*6,(gKey & KEY_SPACE)?16+1:16+2);
49+ poke(0xbb80+40*7,(gKey & KEY_LEFT_SHIFT)?16+1:16+2);
50+ poke(0xbb80+40*8,(gKey & KEY_LESS_THAN)?16+1:16+2);
51+ poke(0xbb80+40*9,(gKey & KEY_GREATER_THAN)?16+1:16+2);
4852
49- sprintf((char *)(0xbb80+40*8),"%c gKey=%u ",16+4,gKey);
53+ sprintf((char *)(0xbb80+40*10),"%c gKey=%u ",16+4,gKey);
5054 }
5155 }
5256
Show on old repository browser