mirror of
https://github.com/KarolS/millfork.git
synced 2026-04-21 09:16:34 +00:00
Move readkey to a separate module
This commit is contained in:
@@ -13,16 +13,6 @@ noinline asm void putchar(byte a) {
|
||||
rts
|
||||
}
|
||||
|
||||
noinline asm byte readkey() {
|
||||
lda #$C
|
||||
sta $2A
|
||||
lda $E425
|
||||
pha
|
||||
lda $E424
|
||||
pha
|
||||
rts
|
||||
}
|
||||
|
||||
inline void new_line() {
|
||||
putchar($9b)
|
||||
}
|
||||
|
||||
@@ -15,14 +15,6 @@ asm void putchar(byte a) {
|
||||
? RTS
|
||||
}
|
||||
|
||||
noinline asm byte readkey() {
|
||||
__read_key__start:
|
||||
LDA $D0
|
||||
BEQ __read_key__start
|
||||
LDX #0
|
||||
JMP $C244
|
||||
}
|
||||
|
||||
inline void new_line() {
|
||||
putchar(13)
|
||||
}
|
||||
|
||||
@@ -14,14 +14,6 @@ asm void putchar(byte a) {
|
||||
? RTS
|
||||
}
|
||||
|
||||
noinline asm byte readkey() {
|
||||
__read_key__start:
|
||||
LDA $EF
|
||||
BEQ __read_key__start
|
||||
LDX #0
|
||||
JMP $D8D5
|
||||
}
|
||||
|
||||
inline void new_line() {
|
||||
putchar(13)
|
||||
}
|
||||
|
||||
@@ -31,13 +31,6 @@ asm void putchar(byte a) {
|
||||
? RTS
|
||||
}
|
||||
|
||||
noinline asm byte readkey() {
|
||||
__read_key__start:
|
||||
LDA $C6
|
||||
BEQ __read_key__start
|
||||
JMP $E5B4
|
||||
}
|
||||
|
||||
inline void new_line() {
|
||||
chrout(13)
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
asm void putchar(byte a) @$BB5A extern
|
||||
|
||||
asm byte readkey() @$BB06 extern
|
||||
|
||||
inline void new_line() {
|
||||
putchar(13)
|
||||
putchar(10)
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
#if ATARI_8
|
||||
const byte KEY_ENTER = 155
|
||||
#else
|
||||
const byte KEY_ENTER = 13
|
||||
#endif
|
||||
|
||||
|
||||
#if CBM_64
|
||||
noinline asm byte readkey() {
|
||||
__read_key__start:
|
||||
LDA $C6
|
||||
BEQ __read_key__start
|
||||
JMP $E5B4
|
||||
}
|
||||
#define OK = 1
|
||||
#endif
|
||||
|
||||
|
||||
#if CBM_128
|
||||
noinline asm byte readkey() {
|
||||
__read_key__start:
|
||||
LDA $D0
|
||||
BEQ __read_key__start
|
||||
LDX #0
|
||||
JMP $C244
|
||||
}
|
||||
#define OK = 1
|
||||
#endif
|
||||
|
||||
|
||||
#if CBM_264
|
||||
noinline asm byte readkey() {
|
||||
__read_key__start:
|
||||
LDA $EF
|
||||
BEQ __read_key__start
|
||||
LDX #0
|
||||
JMP $D8D5
|
||||
}
|
||||
#define OK = 1
|
||||
#endif
|
||||
|
||||
|
||||
#if CBM_VIC
|
||||
noinline asm byte readkey() {
|
||||
__read_key__start:
|
||||
LDA $C6
|
||||
BEQ __read_key__start
|
||||
JMP $E5CF
|
||||
}
|
||||
#define OK = 1
|
||||
#endif
|
||||
|
||||
|
||||
#if ATARI_8
|
||||
noinline asm byte readkey() {
|
||||
lda #$C
|
||||
sta $2A
|
||||
lda $E425
|
||||
pha
|
||||
lda $E424
|
||||
pha
|
||||
rts
|
||||
}
|
||||
#define OK = 1
|
||||
#endif
|
||||
|
||||
|
||||
#if NEC_PC_88
|
||||
asm byte readkey() @$3583 extern
|
||||
#define OK = 1
|
||||
#endif
|
||||
|
||||
|
||||
#if AMSTRAD_CPC
|
||||
asm byte readkey() @$BB06 extern
|
||||
#define OK = 1
|
||||
#endif
|
||||
|
||||
|
||||
#if ZX_SPECTRUM
|
||||
#pragma zilog_syntax
|
||||
asm byte readkey() {
|
||||
ld hl,23560
|
||||
ld (hl),0
|
||||
__readkey__start:
|
||||
ld a,(hl)
|
||||
or a
|
||||
jr z,__readkey__start
|
||||
? ret
|
||||
}
|
||||
#define OK = 1
|
||||
#endif
|
||||
|
||||
|
||||
#if not(OK)
|
||||
#if KEYBOARD
|
||||
#warn keyboard module is not yet supported
|
||||
#else
|
||||
#warn keyboard module is not supported on targets without keyboard
|
||||
#endif
|
||||
#endif
|
||||
@@ -6,8 +6,6 @@
|
||||
|
||||
asm void putchar(byte a) @$3e0d extern
|
||||
|
||||
asm byte readkey() @$3583 extern
|
||||
|
||||
inline void new_line() {
|
||||
putchar(13)
|
||||
putchar(10)
|
||||
|
||||
@@ -15,13 +15,6 @@ asm void putchar(byte a) {
|
||||
? RTS
|
||||
}
|
||||
|
||||
noinline asm byte readkey() {
|
||||
__read_key__start:
|
||||
LDA $C6
|
||||
BEQ __read_key__start
|
||||
JMP $E5CF
|
||||
}
|
||||
|
||||
inline void new_line() {
|
||||
putchar(13)
|
||||
}
|
||||
|
||||
@@ -14,16 +14,6 @@ inline void new_line() {
|
||||
putchar(13)
|
||||
}
|
||||
|
||||
asm byte readkey() {
|
||||
ld hl,23560
|
||||
ld (hl),0
|
||||
__readkey__start:
|
||||
ld a,(hl)
|
||||
or a
|
||||
jr z,__readkey__start
|
||||
? ret
|
||||
}
|
||||
|
||||
inline asm void set_border(byte a) {
|
||||
out (254),a
|
||||
? ret
|
||||
|
||||
Reference in New Issue
Block a user