PETSCII on Nexty

Sorry for that. A few days ago a post on by Carlo Santagostino Spectrum For Everyone explained how he wanted to simulate the C64 PETSCII display on the ZX Spectrum. Carlo’s implementation is quite pleasing and can be found here :

For anyone who doesn’t know PETSCII is a charset that came with the C64, Carlos explains it a bit further so I am not going to repeat that info.

Anyway, the regular Spectrum version contains a look up table to convert the C64 colours in to ZX Spectrum colours, with this is mind we should be able to adapt this to work with the Enhanced ULA of the Next.

In Carlo’s code there is a simple method to pick the ZX colour depending on the colour block data

This works quite straight forward but to be able to get my colours in there I will simplify this bit of code to a array in memory.

db 0,255,137,150,138,117,74,217,141,104,177,109,146,190,143,182
end asm

The values above are the index values a the relevant C64 colour positions from 0-15. I’ve picked those colours based on looking at the C64 palette and reducing it to 9 bit Next format.

Now we have the colours we need a quick change to the code that looks up the colour, we will peek the value rather that use Boriel’s in built array access.

I also POKE screen attribute from 0-767 and this works much quicker, the overall change can be seen here :

And the final change looks like this :

Leave a Reply