Blitz BASIC VIC 20 emulation By Lee Davison.

Introduction.

I recently debugged a Commodore 64 emulator and then improved it just a little.

It got me thinking about just how hard it would be to make it look like a VIC 20 and run the VIC 20 ROMs.

It turns out to be not very hard at all. Mostly a case of changing the memory map to that of the VIC 20 and changing the screen emulation to a 22 by 23 screen. The hardest part was making the new character image as it needed to be 24 by 16 pixels, instead of 16 by 16 pixels as for the C64 emulator, for each character.

What does it do?

It does just enough 6502 emulation to run the VIC 20 ROMs, it doesn't do decimal mode yet and there are some incorrect cycle counts for instructions. It also emulates the VIC 20 memory map, a fixed address character screen mode and jams key codes into the keyboard buffer while the emulated 6502 isn't looking.

What's been changed.

The cycle counter has been corrected for a PAL CPU.

Added a virtual i/o area so that upper case and lower case characters can be displayed. It's a bit crap but POKE 36869,242 will change a whole screen of characters to lower case and POKE 36869,240 will change them back to upper case.

Corrected the remaining address,{X|Y} cycle timings.

Maped the cursor, backspace, delete, insert and home keys to CBM keycodes.

The code.

V0.67 is here and includes the character set image needed to make it work.

To get it to run you will also need Blitz3D and images of the kernal, basic and character ROMs and will need to call them kernal.rom, basic.rom and char.rom respectively. The images are readily available online.

This includes the details of the author of the original C64 emulator PASCAL source, Marc Dendooven.

What's left to do?

Just about everything apart from the CPU and some pretend I/O. There's no colour, no colour RAM, no graphics, no sound. No joystick port, no user port, no cartridge port, no memory switching, no VIC memory mapping, no storage devices. There's not even a fully working keyboard, yet.


Last page update: 13th June, 2011. e-mail me