1
0
mirror of https://github.com/KarolS/millfork.git synced 2025-08-15 19:27:22 +00:00

NEC PC-88: readline

This commit is contained in:
Karol Stasiak
2018-12-20 00:47:42 +01:00
parent e90483f381
commit 62575263c2
6 changed files with 22 additions and 5 deletions

View File

@@ -23,8 +23,9 @@ The string is valid only until next read from the console.
Available for: Available for:
ZX Spectrum, ZX Spectrum,
NEC PC-88,
Commodore 64 with `c64_basic` module, Commodore 64 with `c64_basic` module,
Commodore 16 or Plus/4 with `c264_basic`. Commodore 16 or Plus/4 with `c264_basic` module.
#### `word readword()` #### `word readword()`
@@ -32,8 +33,9 @@ Reads a 16-bit unsigned integer from the console.
Available for: Available for:
ZX Spectrum, ZX Spectrum,
NEC PC-88,
Commodore 64 with `c64_basic` module, Commodore 64 with `c64_basic` module,
Commodore 16 or Plus/4 with `c264_basic`. Commodore 16 or Plus/4 with `c264_basic` module.
#### `void bell()` #### `void bell()`

View File

@@ -8,7 +8,7 @@
* [Echo](crossplatform/echo.mfk) (C64/C16/ZX Spectrum) simple text input and output * [Echo](crossplatform/echo.mfk) (C64/C16/ZX Spectrum) simple text input and output
* [Calculator](crossplatform/calculator.mfk) (C64/C16/ZX Spectrum) simple numeric input and output * [Calculator](crossplatform/calculator.mfk) (C64/C16/ZX Spectrum/PC-88) simple numeric input and output
* [Bell](crossplatform/bell.mfk) (Apple II/ZX Spectrum) a program that goes \*ding!\* * [Bell](crossplatform/bell.mfk) (Apple II/ZX Spectrum) a program that goes \*ding!\*

View File

@@ -4,7 +4,7 @@ import stdio
import c64_basic import c64_basic
#elseif CBM_264 #elseif CBM_264
import c264_basic import c264_basic
#elseif ZX_SPECTRUM #elseif ZX_SPECTRUM || NEC_PC_88
// no imports needed // no imports needed
#else #else
#error Unsupported platform #error Unsupported platform

View File

@@ -3,7 +3,7 @@
[compilation] [compilation]
arch=z80 arch=z80
encoding=jisx encoding=jisx
modules=default_panic,stdlib,pc88 modules=default_panic,stdlib,pc88,default_readword
[allocation] [allocation]
; TODO: find a more optimal start address ; TODO: find a more optimal start address

View File

@@ -1,3 +1,4 @@
#pragma zilog_syntax
#if not(NEC_PC_88) #if not(NEC_PC_88)
#warn pc88 module should be only used on PC-88 targets #warn pc88 module should be only used on PC-88 targets
@@ -9,3 +10,10 @@ inline void new_line() {
putchar(13) putchar(13)
putchar(10) putchar(10)
} }
asm pointer readline() {
call $5f92
// TODO: if carry set, then STOP was pressed; should we care?
? inc hl
? ret
}

View File

@@ -16,6 +16,13 @@ void putstr(pointer str, byte len) {
index += 1 index += 1
} }
} }
#endif
#if NEC_PC_88
asm void putstrz(pointer hl) @$5550 extern
#endif
#if not(ZX_SPECTRUM) && not(NEC_PC_88)
void putstrz(pointer str) { void putstrz(pointer str) {
byte index byte index
index = 0 index = 0