Spectrum Next Viewer

This is a whole project for you to digest and get your teeth into, and will probably be useful too.

The whole project consists of multiple files so the project including the “dotCommand.code-workspace” visual studio code file is zipped below.

So what is it?

It is a Spectrum Next register and memory viewer that fits in a dot command, let me show you what I mean.

Basically this dot command takes a snapshot of the system memory when its invoked and then displays the sprites memory, the system register settings and the palettes and the palettes can be cycled through using the keyboard either on the palette view and on the sprite viewer.

I think its useful.

Rather than give you all the listings I have uploaded a zip of the whole project so you can look at the code and play with it.

Firstly I have an “//define OUTPUT_DOT_COMMAND 1” at the top of the main file this is so it compiles at two different locations, with that line commented out it will compile and run from $8000 this is so you can test it as dot commands cant be run from the debugger (I think). otherwise it will compile to $2000 and be less than 8k as that’s the requirement for dot commands.

Below that you have a define for “//define    USING_STRINGS” which is also commented out, the reason for this is to reduce the amount of memory as I did not have enough memory to hold the whole font, so I converted my strings into data and generated the font using just the characters that were used in the project. But if you are debugging in $8000 then you can uncomment this to use the real strings.

If you are debugging then may I suggest that you put the breakpoint at the NOP (line 1133) in main, as this will enable you to press “Symbol Shift” to break into the program for debugging.

The program mostly happens in main.asm which is commented so it should be easy to follow.

Here is the code!

For those not familiar with Assembly I have included the compiled nex file “main.nex” and the dot command “dump” in the builds folder. Also the PSD for the commodore font “c64Font.psd” is included in the sources folder.