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

Preliminary CPC support

This commit is contained in:
Karol Stasiak 2018-12-19 19:02:29 +01:00
parent 05884f2c7b
commit 9f16311aff
6 changed files with 77 additions and 9 deletions

2
.gitignore vendored
View File

@ -37,5 +37,7 @@ examples/lunix/
*.d88
*.com
HELLO
HELLOCPC

View File

@ -0,0 +1,18 @@
[< back to index](../index.md)
### A note about Armstrad CPC
The compiler output is a raw machine code file, which then has to be put on a disk.
You can do it using [CPCDiskXP](http://www.cpcwiki.eu/index.php/CPCDiskXP),
[ManageDsk](http://www.cpcwiki.eu/index.php/ManageDsk),
[iDSK](http://www.cpcwiki.eu/index.php/IDSK),
or some other tool.
The file has to be loaded from $0400. An example how to put such file onto a disk using CPCDiskXP:
CPCDiskXP -File FILENAME -AddAmsdosHeader 0400 -AddToNewDsk disk_image.dsk
After putting it on a disk, the file can be run with:
RUN "!FILENAME"

View File

@ -3,7 +3,7 @@
# Target platforms
Currently, Millfork supports creating disk- or tape-based programs
for Commodore, Apple, BBC and Atari 8-bit computers, NEC PC-88, ZX Spectrum 48k, CP/M,
for Commodore, Apple, BBC and Atari 8-bit computers, NEC PC-88, ZX Spectrum 48k, Armstrad CPC, CP/M,
and cartridge-based programs for Commodore 64, VIC-20, Famicom/NES and Atari 2600,
but it may be expanded to support other 6502-based and Z80-based platforms in the future.
@ -13,7 +13,8 @@ To add a custom platform yourself, see [the custom platform adding guide](./cust
The following platforms are currently supported:
* `c64` Commodore 64
* `c64` Commodore 64.
The compiler emits PRG files, not disk or tape images.
* `c64_crt8k` Commodore 64, 8K ROM cartridge
@ -43,7 +44,8 @@ Read [the LUnix programming guide](./lunix-programming-guide.md) for more info.
* `pet` Commodore PET
* `nes_small` a tiny 32K PRGROM + 8K CHRROM Famicom/NES program, using iNES mapper 0 (NROM)
* `nes_small` a tiny 32K PRGROM + 8K CHRROM Famicom/NES program, using iNES mapper 0 (NROM).
The compiler emits NES files.
* `nes_mcc4` a 128K PRGROM + 128K CHRROM + extra 8KRAM Famicom/NES program, using iNES mapper 10 (MMC4)
For more complex programs, you need to create your own "platform" definition.
@ -51,9 +53,10 @@ Read [the NES programming guide](./famicom-programming-guide.md) for more info.
* `vcs` Atari VCS (also known as Atari 2600), 4K cartridge (experimental)
* `a8` Atari 8-bit computers
* `a8` Atari 8-bit computers.
The compiler emits XEX files, not disk or tape images.
* `bbcmicro` BBC Micro model B (32k RAM)
* `bbcmicro` BBC Micro model B (32k RAM).
The compiler only emits raw binaries, not disk images.
Read [the BBC Micro programming guide](./bbcmicro-programming-guide.md) for more info.
@ -61,13 +64,20 @@ Read [the BBC Micro programming guide](./bbcmicro-programming-guide.md) for more
The compiler only emits raw binaries, not disk images.
Read [the Apple 2 programming guide](./apple2-programming-guide.md) for more info.
* `pc88` NEC PC-88
* `pc88` NEC PC-88.
The compiler emits bootable disk images.
* `zxspectrum` Sinclair ZX Spectrum 48k
* `cpc464` Armstrad CPC 464.
The compiler only emits raw binaries, not disk images.
Read [the Armstrad CPC programming guide](./cpc-programming-guide.md) for more info.
* `zxspectrum` Sinclair ZX Spectrum 48k.
The compiler emits tape images.
* `zxspectrum_8080` Sinclair ZX Spectrum 48k, using only Intel 8080 instructions
* `cpm` CP/M on Intel 8080
* `cpm` CP/M on Intel 8080.
The compiler emits COM files.
* `cpm_z80` CP/M on Z80

View File

@ -2,7 +2,7 @@
## Cross-platform examples
* [Hello world](hello_world/hello_world.mfk) (C64/C16/PET/VIC-20/Atari/Apple II/BBC Micro/PC-88) simple text output
* [Hello world](hello_world/hello_world.mfk) (C64/C16/PET/VIC-20/Atari/Apple II/BBC Micro/PC-88/Armstrad CPC) simple text output
* [Text encodings](c64/text_encodings.mfk) (C64/ZX Spectrum) examples of text encoding features

11
include/cpc.mfk Normal file
View File

@ -0,0 +1,11 @@
#if not(ARMSTRAD_CPC)
#warn cpc module should be only used on Armstrad CPC-compatible targets
#endif
asm void putchar(byte a) @$BB5A extern
inline void new_line() {
putchar(13)
putchar(10)
}

27
include/cpc464.ini Normal file
View File

@ -0,0 +1,27 @@
;a single-load Armstrad CPC 464 program
[compilation]
arch=z80
encoding=ascii
modules=default_panic,cpc,stdlib
[allocation]
segments=default
segment_default_start=$400
segment_default_datastart=after_code
; ???
segment_default_end=$b0ff
[define]
ARMSTRAD_CPC=1
WIDESCREEN=1
KEYBOARD=1
; TODO: ?
JOYSTICKS=1
HAS_BITMAP_MODE=1
[output]
style=single
format=allocated
extension=