1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-30 20:08:06 +11:00

recipes: add "make emul" targets where appropriate

This commit is contained in:
Virgil Dupras 2020-01-02 16:59:38 -05:00
parent 9216057db8
commit c7ef8bf915
7 changed files with 51 additions and 25 deletions

View File

@ -1,4 +1,13 @@
OBJS = acia.o classic.o ../../emul.o ../../libz80/libz80.o EXTOBJS = ../../emul.o ../../libz80/libz80.o
OBJS = acia.o classic.o
TARGET = classic
classic: $(OBJS) .PHONY: all
$(CC) $(OBJS) -o $@ all: $(TARGET)
$(TARGET): $(OBJS) $(EXTOBJS)
$(CC) $(OBJS) $(EXTOBJS) -o $@
.PHONY: clean
clean:
rm -f $(TARGET) $(OBJS)

View File

@ -1,6 +1,15 @@
OBJS = ti84.o t6a04.o kbd.o ../../emul.o ../../libz80/libz80.o EXTOBJS = ../../emul.o ../../libz80/libz80.o
OBJS = ti84.o t6a04.o kbd.o
TARGET = ti84
CFLAGS += `pkg-config --cflags xcb` CFLAGS += `pkg-config --cflags xcb`
ti84: $(OBJS) .PHONY: all
$(CC) `pkg-config --libs xcb` $(OBJS) -o $@ all: $(TARGET)
$(TARGET): $(OBJS) $(EXTOBJS)
$(CC) `pkg-config --libs xcb` $(OBJS) $(EXTOBJS) -o $@
.PHONY: clean
clean:
rm -f $(TARGET) $(OBJS)

View File

@ -223,10 +223,6 @@ void draw_pixels()
void event_loop() void event_loop()
{ {
if (!emul_step()) {
// We're done
return;
}
while (1) { while (1) {
emul_step(); emul_step();
if (lcd_changed) { if (lcd_changed) {

View File

@ -3,8 +3,17 @@ BASEDIR = ../..
ZASM = $(BASEDIR)/emul/zasm/zasm ZASM = $(BASEDIR)/emul/zasm/zasm
KERNEL = $(BASEDIR)/kernel KERNEL = $(BASEDIR)/kernel
APPS = $(BASEDIR)/apps APPS = $(BASEDIR)/apps
EMUL = $(BASEDIR)/emul/hw/rc2014/classic
.PHONY: all .PHONY: all
all: $(TARGET) all: $(TARGET)
$(TARGET): glue.asm $(TARGET): glue.asm
$(ZASM) $(KERNEL) $(APPS) < glue.asm > $@ $(ZASM) $(KERNEL) $(APPS) < glue.asm > $@
$(EMUL):
$(MAKE) -C ${@:%/classic=%}
.PHONY: emul
emul: $(EMUL) $(TARGET)
$(EMUL) $(TARGET)

View File

@ -81,6 +81,11 @@ We only have the shell to build, so it's rather straightforward:
Running `make` will also work. Running `make` will also work.
### Emulate
The Collapse OS project includes a RC2014 emulator suitable for this image.
You can invoke it with `make emul`. See `emul/hw/rc2014/README.md` for details.
### Write to the ROM ### Write to the ROM
Plug your romwrite atmega328 to your computer and identify the tty bound to it. Plug your romwrite atmega328 to your computer and identify the tty bound to it.

View File

@ -3,6 +3,7 @@ BASEDIR = ../..
ZASM = $(BASEDIR)/emul/zasm/zasm ZASM = $(BASEDIR)/emul/zasm/zasm
KERNEL = $(BASEDIR)/kernel KERNEL = $(BASEDIR)/kernel
APPS = $(BASEDIR)/apps APPS = $(BASEDIR)/apps
EMUL = $(BASEDIR)/emul/hw/ti/ti84
MKTIUPGRADE = mktiupgrade MKTIUPGRADE = mktiupgrade
.PHONY: all .PHONY: all
@ -10,6 +11,13 @@ all: $(TARGET)
$(TARGET): glue.asm $(TARGET): glue.asm
$(ZASM) $(KERNEL) $(APPS) < glue.asm > $@ $(ZASM) $(KERNEL) $(APPS) < glue.asm > $@
$(EMUL):
$(MAKE) -C ${@:%/ti84=%}
.PHONY: emul
emul: $(EMUL) $(TARGET)
$(EMUL) $(TARGET)
os.rom: $(TARGET) os.rom: $(TARGET)
cp $(TARGET) $@ cp $(TARGET) $@
truncate -s 1M $@ truncate -s 1M $@

View File

@ -22,27 +22,19 @@ screen as output and its builtin keyboard as input.
* A USB cable * A USB cable
* [tilp][tilp] * [tilp][tilp]
* [mktiupgrade][mktiupgrade] * [mktiupgrade][mktiupgrade]
* Optional: [z80e][z80e] to emulate
## Build the ROM ## Build the ROM
Running `make` will result in `os.rom` being created. Running `make` will result in `os.rom` being created.
## Emulate through z80e ## Emulate
[KnightOS][knightos] has a handy emulator, [z80e][z80e] for TI calculators and Collapse OS has a builtin TI-84+ emulator using XCB for display in `emul/hw/ti`.
it also emulates the screen. It is recommended to use this tool. You can invoke it with `make emul`.
Once z80e is installed (build it with SDL support) and `os.rom` is created,
you can run the emulator with:
z80e-sdl -d TI84p --no-rom-check os.rom
You will start with a blank screen, it's normal, you haven't pressed the "ON" You will start with a blank screen, it's normal, you haven't pressed the "ON"
key yet. This key is mapped to F12 in the emulator. Once you press it, the key yet. This key is mapped to tilde (~) in the emulator. Once you press it, the
Collapse OS prompt will appear. Collapse OS prompt will appear. See `emul/hw/ti/README.md` for details.
See z80e's `KEYBINDINGS.md` file for details.
## Upload to the calculator ## Upload to the calculator
@ -102,7 +94,5 @@ Keys that aren't a digit, a letter, a symbol that is part of 7-bit ASCII or one
of the two mode key have no effect. of the two mode key have no effect.
[zasm]: ../../tools/emul [zasm]: ../../tools/emul
[knightos]: https://knightos.org/
[z80e]: https://github.com/KnightOS/z80e
[mktiupgrade]: https://github.com/KnightOS/mktiupgrade [mktiupgrade]: https://github.com/KnightOS/mktiupgrade
[tilp]: http://lpg.ticalc.org/prj_tilp/ [tilp]: http://lpg.ticalc.org/prj_tilp/