1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-06-09 01:29:31 +00:00

Preliminary CoCo support

This commit is contained in:
Karol Stasiak 2020-07-31 01:58:40 +02:00
parent 8ec82ef520
commit cad6f27185
12 changed files with 102 additions and 1 deletions

View File

@ -4,6 +4,8 @@
* Support for Motorola 6809 (complete, but still experimental).
* Preliminary support for Tandy Color Computer running RS-DOS.
* Added support for modifying large variables via pointers.
* Added the ability to declare structure alignment.
@ -22,6 +24,7 @@ There are no built-in encodings now, the include path needs to contain the neces
* Added encodings:
`apple2c`, `apple2e`, `apple2gs`,
`coco`, `cocoscr`,
`cpc_da`, `cpc_en`, `cpc_es`, `cpc_fr`,
`cp437`, `cp850`, `cp851`, `cp852`, `cp855`, `cp858`, `cp866`,
`cp1250`, `cp1251`, `cp1252`,

View File

@ -0,0 +1,15 @@
[< back to index](../doc_index.md)
### A note about Color Computer
The `coco_rsdos` target creates binary files that can run on Tandy Color Computer running RS-DOS.
The compiler output is a raw machine code file with the `.bin` extension, which then has to be put on a disk.
You can do it using `imgtool` from the [MAME project](https://www.mamedev.org/):
imgtool create coco_jvc_rsdos disk_image.dsk
imgtool put coco_jvc_rsdos disk_image.dsk compiler_output.bin CO.BIN
The resulting file can then be loaded and ran using the following commands:
LOADM"CO":EXEC

View File

@ -99,6 +99,9 @@ The compiler emits COM files.
* `cpm_z80` CP/M on Z80
* `coco_rsdos` Tandy Color Computer running RS-DOS. (very experimental)
Read [the Color Computer programming guide](./coco-programming-guide.md) for more info.
* `dos_com` a COM file for DOS on IBM PC. (very experimental)
* `x16_experimental` Commander X16; very experimental,

View File

@ -108,6 +108,10 @@ English, Japanese, Spanish/Italian and French/German respectively
* `galaksija` text encoding used on Galaksija computers
* `coco` text encoding used on Tandy Color Computer
* `cocoscr` Tandy Color Computer screencodes
* `ebcdic` EBCDIC codepage 037 (partial coverage)
* `utf8` UTF-8
@ -208,6 +212,7 @@ Encoding | lowercase letters | backslash | currencies | intl | card suits
`cpc_fr` | yes | no | £ | French⁷ | yes
`cpc_da` | yes | no | £ | Nor/Dan. | yes
`vectrex` | no | yes | | none | no
`coco`,`cocoscr` | no | yes | | none | no
`pokemon1jp` | no | no | | both kana | no
`pokemon1en` | yes | no | | none | no
`pokemon1fr` | yes | no | | Ger/Fre. | no
@ -264,5 +269,7 @@ Encoding | new line | braces | backspace | cursor movement | text colour | rever
`koi7n2` | yes | no | yes | no | no | no | no
`koi8*` | yes | yes | yes | no | no | no | no
`vectrex` | no | no | no | no | no | no | no
`coco` | yes | no | yes | no | no | no | no
`cocoscr` | no | no | no | no | no | no | no
`utf*` | yes | yes | yes | no | no | no | no
all the rest | yes | yes | no | no | no | no | no

View File

@ -27,7 +27,8 @@ VIC 20 (requires KERNAL),
Atari,
Amstrad CPC,
ZX Spectrum,
NEC PC-88.
NEC PC-88,
Tandy Color Computer.
#### `const byte KEY_ENTER`

7
include/coco/kernal.mfk Normal file
View File

@ -0,0 +1,7 @@
noinline asm void putchar(byte register(a) character) {
clr <$6f
jsr [$a002]
rts
}

View File

@ -0,0 +1,7 @@
noinline asm byte readkey() {
clr <$6f
jsr [$A000]
tfr b,a
rts
}

12
include/encoding/coco.tbl Normal file
View File

@ -0,0 +1,12 @@
NAME=Color-Computer
EOT=00
20=U+0020
21-3f=!"#$%&'()*+,-./0123456789:;<=>?
40-5f=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]↑←
{b}=08
{n}=0d
{q}=22
{apos}=27
^=5E

View File

@ -0,0 +1,11 @@
NAME=Color-Computer-Screen
EOT=D0
60=U+0020
61-7f=!"#$%&'()*+,-./0123456789:;<=>?
40-5f=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]↑←
{b}=08
{q}=62
{apos}=67
^=5E

View File

@ -144,6 +144,10 @@ __readkey__start:
#define OK = 1
#endif
#if COCO
import coco/keyboard
#define OK = 1
#endif
#if not(OK)
#if KEYBOARD

View File

@ -0,0 +1,30 @@
; a single-load program for Tandy Color Computer running RSDOS
; VERY EXPERIMENTAL
[compilation]
arch=6809
; todo: is it ascii?
encoding=coco
screen_encoding=cocoscr
modules=default_panic,stdlib,coco/kernal
u_stack=true
[allocation]
segments=default
segment_default_start=$3f00
segment_default_datastart=after_code
segment_default_end=$7fff
[define]
COCO=1
WIDESCREEN=0
KEYBOARD=1
; TODO: ?
JOYSTICKS=1
HAS_BITMAP_MODE=1
[output]
style=single
format=0,length_be,startaddr_be,allocated,$ff,0,0,startaddr_be
extension=.bin

View File

@ -18,6 +18,7 @@ nav:
- BBC Micro: api/bbcmicro-programming-guide.md
- Game Boy: api/gb-programming-guide.md
- NES/Famicom: api/famicom-programming-guide.md
- Color Computer: api/coco-programming-guide.md
- Language reference:
- Preprocessor: lang/preprocessor.md
- Modules: lang/modules.md