Add Robotron Z1013 support

This commit is contained in:
Karol Stasiak 2020-09-29 22:50:46 +02:00
parent 889a4f94be
commit d45fe42d17
8 changed files with 111 additions and 0 deletions

1
.gitignore vendored
View File

@ -51,6 +51,7 @@ issue*.mfk
*.ssd
*.o
*.cmd
*.z80
HELLO
HELLOCPC
FIZZBUZZ

View File

@ -99,6 +99,8 @@ The compiler emits COM files.
* `cpm_z80` CP/M on Z80
* `z1013` Robotron Z1013. The compiler emits Z80 files.
* `trs80m1cmd` TRS-80 Model 1 running TRS-DOS. The compiler emits CMD files.
* `trs80m3cmd` TRS-80 Model 3 running TRS-DOS. The compiler emits CMD files.

View File

@ -124,6 +124,8 @@ English, Japanese, Spanish/Italian and French/German respectively
* `cocoscr` Tandy Color Computer screencodes
* `z1013` text encodind used on Robotron Z1013
* `ebcdic` EBCDIC codepage 037 (partial coverage)
* `utf8` UTF-8
@ -214,6 +216,7 @@ Encoding | lowercase letters | backslash | currencies | intl | card suits
`apple2` | no | yes | | none | no
`atascii` | yes | yes | | none | yes
`atasciiscr` | yes | yes | | none | yes
`z1013` | yes | yes | | none | yes
`jis` | yes | no | ¥ | both kana | no
`dmcs`,`lics` | yes | yes | ¢£¥ | Western | no
`brascii`,`macroman`| yes | yes | ¢£¥ | Western | no

View File

@ -0,0 +1,21 @@
NAME=Z1013
EOT=00
20=U+0020
21-3f=!"#$%&'()*+,-./0123456789:;<=>?
40-5f=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
60-7e=`abcdefghijklmnopqrstuvwxyz{|}~
{b}=08
{t}=09
{n}=0d0a
{q}=22
{apos}=27
{lbrace}=7b
{rbrace}=7d
♥=CB
♡=CB
♠=CC
♣=CA
♢=C9

View File

@ -154,6 +154,11 @@ import trs80/keyboard
#define OK = 1
#endif
#if Z1013
import z1013/keyboard
#define OK = 1
#endif
#if not(OK)
#if KEYBOARD
#warn keyboard module is not yet supported

View File

@ -0,0 +1,27 @@
;Robotron Z1013 with 64K of RAM
[compilation]
arch=z80
encoding=z1013
modules=default_panic,z1013/kernal,stdlib
[allocation]
segments=default
segment_default_start=$0100
segment_default_datastart=after_code
segment_default_end=$ebff
segment_default_layout=__init,main,*
[define]
Z1013=1
WIDESCREEN=0
KEYBOARD=1
; TODO: ?
JOYSTICKS=1
HAS_BITMAP_MODE=0
[output]
style=single
format=startaddr,endaddr,startaddr,"DDRDDR",$43,$d3,$d3,$d3,programname-16,allocated
extension=z80

45
include/z1013/kernal.mfk Normal file
View File

@ -0,0 +1,45 @@
#pragma zilog_syntax
import default_readword
array __readline_out[33]
const pointer readline_out = __readline_out.addr
asm pointer readline() {
rst $20
[$10]
ld hl, ($16)
ld de, readline_out
ld bc, $20
ldir
ld b, $20
ld hl, readline_out+31
ld a, 32
.loop:
cp (hl)
jr nz, .found
dec hl
djnz .loop
.found:
inc hl
ld (hl), nullchar
ld hl, readline_out
ret
}
inline asm void putchar(byte register(a) char) {
rst $20
[0]
? ret
}
inline void new_line() {
putchar(13)
}
asm void __init() {
// printing $0c clears the screen
ld a,$c
rst $20
[0]
}

View File

@ -0,0 +1,7 @@
inline asm byte readkey() {
rst $20
[1]
? ret
}