This may look underwhelming but it took a while to get here and I count it as a big win.
Obviously I could have typed a few lines of BASIC to do this. Now that I can save to cassette or, more conveniently, my phone (see the last log), development in BASIC is sorted and that has its place.
But how about working in Z80 assembly and making a cartridge ROM or .cas file? I haven't yet investigated what tools are available for assembling directly on the machine, but for practical reasons I'd like to use my favourite text editor and assembler on my modern machine. But how about transferring that to the real hardware?
One option is to make a .cas file. I don't know how to make a .cas image yet, but I've been using a tool called MCP to convert downloaded .cas images to .wav. It's easy to drop that onto my phone and load that into the computer via the tape interface. I do have a tzxduino, which I've upgraded to maxduino firmware, which can play .cas files from SD card - very convenient. I believe that will work, but it seems to be playing at the wrong baud rate and I'm having trouble accessing the menus on my particular device to alter it.
Another option is to assemble my code to .rom, burn to a rom chip and slip it into the zif socket on my 'cartridge module', which is what you can see in the picture above.
This may sound clunky but it works very well indeed, you can see the procedure in the video below. A particularly nice aspect is that you can simply drag and drop the built image onto an emulator while developing/testing before going to the trouble of burning to the eeprom.
It took a while to get to the point of building that rom image. There are a few things to know. I'd sussed most of them out before finding this video which explains everything and filled in the odd gap for me.
Here are a few pointers in case you're doing this:
- at $4000 there should be a 16-byte header, as described here. There's an id at the start and then a pair of bytes gives the 'main' address of your program, often $4010
- it's necessary to pad your program to a total of $C000 for emulators to recognise the binary as a cartridge rom. an 'org $C000' at the end of your code should do it
- The BIOS contains some useful stuff, eg setting screen mode and outputting characters.
If you're interested in getting started, my 'hello world' is here
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.