Development Environment

When I first started coding I used z88dk but I switched to SDCC after a short while. For building I used GNU Make and I wrote my own linker. Python and C++ was used for tools such as converters and code generators. All the header files and libraries needed for interfacing the hardware and TIKO also had to be written.

With the toolchain up and running it was very easy to write C and assembly program which can read/write files, write text to the console and so on.


The linker was written from scratch. It may have been easier to use the linker in SDCC, but I knew it was quite easy to write my own. The linker has some features that made the demo development easier:
  • Sections can be aligned at 256 byte addresses
  • Fine tuning of section ordering
  • Linking to other pieces of code already in memory
  • Custom size and address space restrictions 


I used Asbjørn Djupdal's emulator for a while, but I needed an emulator which supported my hardware modification. I also wanted sound support and to use SDL instead of X11.

I ended up writing my own emulator. For Z80 emulation I used the emulator by Marat Fayzyllin (the same as in Asbjørn's emulator), but a newer version. The AY-emulator was was taken from the MAME project.

Timing-wise the emulator is fairly accurate, but not 100% cycle-exact:
  • All instructions use the same number of cycles as on real hardware, even the undocumented ones.
  • The graphics system emulator not 100% cycle-exact but it supports changing the palette on HSYNC and setting the scroll anywhere on a scanline.
  • The floppy emulator has reasonable correct timing. The emulated floppy spins at 300 RPM. It only supports 400k disks though, and has no write support.
The emulator also has a lot of features which can be controlled from within the emulated code by writing to I/O ports:
  • Cycle counter
  • Print the current raster line
  • Toggle log levels for several subsystems
  • Breakpoints
  • Write text to the host console
To speed up testing, the emulator can load code directly into memory and jump to it instead of loading from disk.

Demo effect prototyping

To make it easier to prototype effects, I wrote a small C++ library which contains a framebuffer with the same properties as the real one. It also supports changing the scroll register and the palette on every scanline.

Ingen kommentarer:

Legg inn en kommentar