1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-05-29 04:41:30 +00:00

Preliminary MSX support

This commit is contained in:
Karol Stasiak 2019-06-05 13:31:43 +02:00
parent b4b2e9b041
commit bc8ac1f696
11 changed files with 77 additions and 6 deletions

1
.gitignore vendored
View File

@ -37,6 +37,7 @@ examples/lunix/
*.d88
*.com
*.gb
*.rom
HELLO
HELLOCPC

View File

@ -4,6 +4,8 @@
* Preliminary experimental Game Boy support.
* Preliminary MSX support.
* Super experimental and very incomplete Intel 8086 support via 8080-to-8086 translation.
* Support for Intel 8085.

View File

@ -33,6 +33,8 @@ For binary releases, see: https://github.com/KarolS/millfork/releases
* Amstrad CPC
* MSX
* CP/M
* Atari 2600 (experimental)
@ -70,7 +72,7 @@ Therefore, no attribution is needed if you are developing and distributing Millf
* more 6502 targets: Oric computers, PC-Engine/Turbografx-16, Atari Lynx
* more Z80 targets: MSX, TI-83, Sega Master System
* more Z80 targets: TI-83, Sega Master System
* better support for 65816, Intel 8080, Sharp LR35902 and eZ80

View File

@ -22,6 +22,7 @@ Extension will be added automatically,
no extension for BBC micro program file,
`.inf` for BBC Micro metadata,
`.d88` for PC-88 disk images,
`.rom` for MSX cartridge images,
`.tap` for ZX-Spectrum tape images.
* `-s` Generate also the assembly output. It is not compatible with any assembler, but it serves purely informational purpose. The file has the same nam as the output file and the extension is `.asm`.

View File

@ -4,7 +4,7 @@
Currently, Millfork supports creating disk- or tape-based programs
for Commodore, Apple, BBC and Atari 8-bit computers, NEC PC-88, ZX Spectrum 48k, Amstrad CPC, CP/M,
and cartridge-based programs for Commodore 64, VIC-20, Famicom/NES and Atari 2600,
and cartridge-based programs for Commodore 64, VIC-20, MSX, Famicom/NES and Atari 2600,
but it may be expanded to support other 6502-based and Z80-based platforms in the future.
To add a custom platform yourself, see [the custom platform adding guide](./custom-platform.md).
@ -78,6 +78,8 @@ The compiler emits tape images.
* `zxspectrum_8080` Sinclair ZX Spectrum 48k, using only Intel 8080 instructions
* `msx_crt` MSX 16kB cartridge, using only 16kB RAM
* `gb_small` a tiny 32K Game Boy program. (experimental)
The compiler emits GB files.
Read [the Game Boy programming guide](./gb-programming-guide.md) for more info.

View File

@ -90,6 +90,8 @@ The following features are defined based on the chosen CPU and compilation optio
* `IBM_PC` 1 if the target is IBM PC, 0 otherwise
* `MSX` 1 if the target is MSX, 0 otherwise
* `NTSC` 1 if the target is NTSC, 0 otherwise
* `PAL` 1 if the target is PAL, 0 otherwise

View File

@ -24,6 +24,7 @@ The string is valid only until next read from the console.
Available for:
ZX Spectrum,
NEC PC-88,
MSX,
Commodore 64 with `c64_basic` module,
Commodore 16 or Plus/4 with `c264_basic` module.
@ -34,6 +35,7 @@ Reads a 16-bit unsigned integer from the console.
Available for:
ZX Spectrum,
NEC PC-88,
MSX,
Commodore 64 with `c64_basic` module,
Commodore 16 or Plus/4 with `c264_basic` module.

View File

@ -2,15 +2,15 @@
## Cross-platform examples
* [Hello world](crossplatform/hello_world.mfk) (C64/C16/PET/VIC-20/PET/Atari/Apple II/BBC Micro/ZX Spectrum/PC-88/Armstrad CPC) simple text output
* [Hello world](crossplatform/hello_world.mfk) (C64/C16/PET/VIC-20/PET/Atari/Apple II/BBC Micro/ZX Spectrum/PC-88/Armstrad CPC/MSX) simple text output
* [Text encodings](crossplatform/text_encodings.mfk) (C64/ZX Spectrum) examples of text encoding features
* [Echo](crossplatform/echo.mfk) (C64/C16/ZX Spectrum/PC-88) simple text input and output
* [Echo](crossplatform/echo.mfk) (C64/C16/ZX Spectrum/PC-88/MSX) simple text input and output
* [Calculator](crossplatform/calculator.mfk) (C64/C16/ZX Spectrum/PC-88) simple numeric input and output
* [Calculator](crossplatform/calculator.mfk) (C64/C16/ZX Spectrum/PC-88/MSX) simple numeric input and output
* [Guessing game](crossplatform/guess.mfk) (C64/C16/ZX Spectrum/PC-88) a guess-a-number game
* [Guessing game](crossplatform/guess.mfk) (C64/C16/ZX Spectrum/PC-88/MSX) a guess-a-number game
* [Fire effect](crossplatform/fire.mfk) (C64/C16/ZX Spectrum) a simple fire effect

22
include/msx.mfk Normal file
View File

@ -0,0 +1,22 @@
#if not(MSX)
#warn msx module should be only used on MSX-compatible targets
#endif
#pragma zilog_syntax
asm void putchar(byte a) @$00a2 extern
inline void new_line() {
putchar(13)
putchar(10)
}
const pointer readline_out = $F55E
asm pointer readline() {
? ld hl, $F55D
call $00b1
? ld hl, $F55E
? ret
}

32
include/msx_crt.ini Normal file
View File

@ -0,0 +1,32 @@
; MSX1 16kB RAM
; 16K cartridge
[compilation]
arch=z80
encoding=ascii
screen_encoding=ascii
modules=stdlib,msx1,default_panic,msx1_crt,default_readword
[allocation]
segments=default
default_code_segment=default
segment_default_start=$4000
segment_default_codeend=$8fff
segment_default_datastart=$8000
segment_default_end=$bfff
[define]
MSX=1
WIDESCREEN=1
KEYBOARD=1
; TODO: ?
JOYSTICKS=2
HAS_BITMAP_MODE=1
[output]
style=single
format=$4000:$7fff
extension=rom

5
include/msx_crt.mfk Normal file
View File

@ -0,0 +1,5 @@
array __header[16] @$4000 = [
"AB" ascii,
@word [main.addr, 0, 0, 0],
0,0, 0,0, 0,0
]