collapseos/doc/emulate.md

36 lines
1.0 KiB
Markdown
Raw Normal View History

2019-05-10 02:58:41 +10:00
# Running Collapse OS on an emulator
2019-04-17 01:35:15 +10:00
2019-05-10 02:58:41 +10:00
The quickest way to give Collapse OS a whirl is to use `tools/emul` which is
built around [libz80][libz80]. Everything is set up, you just have to run
2019-05-21 02:11:45 +10:00
`make`, then `shell/shell`.
2019-05-10 02:58:41 +10:00
To emulate something at a lower level, I recommend using Alan Cox's [RC2014
emulator][rc2014-emul]. It runs Collapse OS fine but you have to write the
glue code yourself. One caveat, also, is that it requires a ROM image bigger
than 8K, so you have to pad the binary.
2019-04-17 01:35:15 +10:00
A working Makefile for a project with a glue code being called `main.asm` could
look like:
TARGET = os.bin
2019-05-21 02:11:45 +10:00
ZASM = ~/collapseos/tools/emul/zasm/zasm
2019-04-17 01:35:15 +10:00
ROM = os.rom
.PHONY: all
all: $(ROM)
$(TARGET): main.asm
2019-05-21 02:11:45 +10:00
$(ZASM) < $< > $@
2019-04-17 01:35:15 +10:00
$(ROM): $(TARGET)
cp $< $@
dd if=/dev/null of=$@ bs=1 count=1 seek=8192
.PHONY: run
run: $(ROM)
~/RC2014/rc2014 -r $(ROM)
`CTRL+\` stops the emulation.
2019-05-10 02:58:41 +10:00
[libz80]: https://github.com/ggambetta/libz80
2019-04-17 01:35:15 +10:00
[rc2014-emul]: https://github.com/EtchedPixels/RC2014