I sent this to the mailing list but the official forums is probably a better place.
To recap:
I checked out z88dk a while ago (3-4 months) and decided since it wasn't super fleshed out that I would just start my own. (I didn't delve in too deeply, and I'm not super familiar with z88dk as a whole, but I didn't see methods for drawing in V2 or disk loading, and it didn't seem like anyone was working on it at the time.)
I started using SDCC, and now it's in a stable, but feature-wanting state:
https://github.com/bferguson3/pc88-c
In src/pc88-c.h I have fully documented all of the hardware registers in English. There is a hardware vsync, and and a hardware key-reading routine - I actually didn't have a resource for the BASIC disassembly and hadn't investigated it on my own, so I went ahead and wrote one. The sprite example is rock-solid on hardware, and there is also a proper fast-handshake disk loading routine (save routine and a tilemap example are WIP).
I researched and translated this all on my own, so I'm pretty well-versed in the graphic functionality now. I can certainly help contribute in this regard.
(Mansplaining a bit, but this is pretty important for PC-88 dev and should be explicit:)
When a PC-8801 boots, it checks dipswitch status. If "boot from floppy" is enabled, it does the following:
1. Initialize ROM BASIC. Stack pointer is around $e4xx depending on the model.
2. Copy the first 256 bytes from drive 1, track 0, sector 1 to RAM at address $c000, then jumps to $c000. <- This is called the IPL, and should take the place of crt0. This usually sets up the stack and software environment and loads in the main program.
My toolchain adds the compiled main.bin to sector 2 and the IPL copies the whole thing into RAM. By default it's set to full color graphic mode with ROM basic bankswapped out for 64k ram mode. It mostly uses python and does some brute-force stuff to match the IPL bytes to the compiled binary.
The makefile looks like this:
Code: Select all
# Very simple makefile for PC88-C.
# Please use official GNU make installer 3.81!
# i.e. do not use the one distributed with SGDK etc.
CC=sdcc
CFLAGS=-Isrc
PY=python3
DEL=rm
## USED SECTORS ON DISC ##
USEDSEC=0x5f
# If this number isn't correct,
# the app won't load right!
# Make sure it's big enough!
## PROJECT FOLDER ##
PROJECT=examples/helloworld
# This can also be explicit on the commandline i.e.
# $ make PROJECT=myproj
## MEMORY LOCATIONS ##
STACK=0x80
DATA=0x100
CODE=0x4000
# Stack should stay in ZP.
# This is due to VRAM being in C000~.
88FLAGS=-mz80 --stack-loc $(STACK) --data-loc $(DATA) --code-loc $(CODE) --fomit-frame-pointer --no-std-crt0
## DISC FILE NAME ##
APPNAME=app.d88
## EMULATOR EXECUTABLE ##
EMUEXE=C:\Users\Bent\Downloads\m88\m88x5.exe
default: $(PROJECT)
$(PY) tools/maked88.py $(APPNAME)
$(PY) tools/hexer.py src/ipl.bin 0x2f $(USEDSEC)
$(CC) $(88FLAGS) $(CFLAGS) $(PROJECT)/main.c
$(PY) tools/fixboot.py src/ipl.bin
$(PY) tools/hex2bin.py main.ihx main.bin
$(PY) tools/maked88.py $(APPNAME) src/ipl.bin 0 0 1
$(PY) tools/maked88.py $(APPNAME) main.bin 0 0 2
$(DEL) *.ihx
$(DEL) *.lk
$(DEL) *.lst
$(DEL) *.map
$(DEL) *.noi
$(DEL) *.rel
$(DEL) *.sym
$(EMUEXE)
Obviously I don't want to step on any toes here, but it seemed like nobody was working on this part of the chain. I would love to integrate what I can that will help out and please feel free to use all of my documentation and tooling to help out.
If anyone is interested please reach out!
