Today I discovered an excellent Z80 Reference app on the iOS App Store. It’s a complete & searchable reference to the Z80 CPU instruction set and even includes sample code! This is a free download so go get it now if you have an iPhone or iPad. #Z80 #8bit

A New Coleco ADAM Book!

I recently got a new book called “Programming Games For The ColecoVision and ADAM in Assembler” by Tony Cruise. Yes, it is still 2020 and yes, there is a new book about ADAM programming! Of course I preordered this book as soon as I heard about it and it was released at the end of August as a digital Kindle book. You can get it on Amazon now or if you prefer a printed physical version you can preorder it here.

I’m already nine chapters into it and I’ve been enjoying it so far. The only unfortunate thing (for me) is that the workflow described in the book is Windows-centric and these days I use a Mac (when I’m not using my ADAM 🙂). This didn’t slow me down too much though as I already had a working virtualized Windows 10 installation on my Mac using VirtualBox before I started the book.

If you’re interested in creating games for ColecoVision or ADAM or maybe just interested in learning some Z-80 Assembler then I highly recommend checking out Tony’s book! There is a thread on the AtariAge forum where the author is active so you can discuss the book and ask any questions you may have.

Cover for Programming Games For The ColecoVision and ADAM in Assembler book.

BASIC SmartWriter File Viewer

I’m happy to announce that this weekend I was able to complete and release my SmartWriter File Viewer BASIC program.

This has been a really fun project and the end result is a utility that I will personally get a lot of use from. One of the main reasons this project was so fun was that it involved disassembling SmartBASIC’s BLOAD routine and modifying it to do what I needed. I haven’t had much experience with assembly language so this gave me a chance to dig in and learn. I used the disassembler included with the legendary Hacker’s Guide To The ADAM. The Hacker’s Guide Volume 2 was also incredibly helpful as a reference for this project. Without its section on Tape Routines I don’t think I would’ve been able to do this at all. Huge shout-out to Peter and Ben Hinkle for writing these awesome guides back in 1985/86. The other book I used as a reference was “Programming the Z80” by Rodney Zaks which I’m sure I’ll be returning to again and again.

As I mentioned in a previous post the main thing I needed to do was get the BLOAD routine to accept SmartWriter files. After reading through the assembly code I found what I was looking for here at 21083:

21083 525B  3A9641  LD   A,(nn)    4196
21086 525E  FE02    CP   n
21088 5260  C2255F  JP   NZ,nn    5F25

Just before these instructions the routine loads the file header into memory location $4194. So the first line above is looking at the 3rd byte of the header (the file type) and the second line is comparing it to the value 02. If it doesn’t equal 2, the third line jumps to an error display routine (File Type Mismatch). In ADAM’s EOS, binary files have a file type of 2 whereas SmartWriter files have a file type of 1. Therefore all I had to do was modify memory location 21087 to contain the value of 1 like this:

POKE 21087, 1

Eureka! That was enough to get BLOAD to accept SmartWriter files. As a bonus, the routine would now neatly reject other binary files that would obviously be incompatible with my viewer program. Once I had this in place I started to figure out more of the routine and how it worked. There are some other modifications I had to make before I was done but this one was definitely the key. You can check out the rest of the changes and the entire code if you’d like by downloading the disk image over at the ADAM Archive.