Would a "true" PET emulator be possible for the c64/+4?
Posted: Sun Jan 18, 2026 11:44 pm
I was thinking, would a "true" PET emulator be possible for the c64/+4? I wrote a simple Basic one back when i got the 64, that sets the screen to $8000 and Basic to $0401, etc, so most old PET programs could run with just the odd mod.
But what I mean is switching to 64k Ram mode, then loading an adapted Pet3032 Kernal+Basic 2.0 ROM at $C000 up, with the code altered to run with the 64. The USR vector at 0,1,2 would clash with the c64 mem control regs, you could trap peek/poke for that. Some emulation of PET hardware at $E800, via the IRQ would be needed for the common pokes for sound, keyboard, lower case. The original char set can be put at $8800, and A000-BFFF would be available for extra support code. I would guess the IEEE and tape would be a lot of work, but a simple hack to just get Basic running might not be too hard.
Thinking about it, it might be possible to "swap" kernel mem below 1k between the 64 and Pet mode, so that the 64 routines are called for loading files etc.
This is my "simple" emulator..
A little extra code can be added to load the real PET charset to $8800.
The ultimate aim of a "true" emulator would be to run at least some Pet asm apps without alterations.
I wonder if its possible to do? Has anyone tried?
But what I mean is switching to 64k Ram mode, then loading an adapted Pet3032 Kernal+Basic 2.0 ROM at $C000 up, with the code altered to run with the 64. The USR vector at 0,1,2 would clash with the c64 mem control regs, you could trap peek/poke for that. Some emulation of PET hardware at $E800, via the IRQ would be needed for the common pokes for sound, keyboard, lower case. The original char set can be put at $8800, and A000-BFFF would be available for extra support code. I would guess the IEEE and tape would be a lot of work, but a simple hack to just get Basic running might not be too hard.
Thinking about it, it might be possible to "swap" kernel mem below 1k between the 64 and Pet mode, so that the 64 routines are called for loading files etc.
This is my "simple" emulator..
Code: Select all
100 rem pet simulator for c64, (c)1983 orac81,freeware.
110 rem make sure bits 0&1 are output
120 poke56578,peek(56578)or3
130 rem change banks:-
140 rem 0 -> $0000 to $3fff, default
150 rem 1 -> $4000 to $7fff
160 rem 2 -> $8000 to $bfff, new val.
170 rem 3 -> $c000 to $ffff
175 poke56576,(peek(56576)and 252)or1
177 poke53272,peek(53272)and15
180 rem tell kernal where screen is
182 poke648,128
185 rem move top & bot pointer1s
190 poke55,0:poke56,128
200 poke1024,0:poke43,1:poke44,4
300 rem reset
310 poke53280,0:poke53281,0
320 print chr$(147)chr$(30)"### commodore basic ###"
330 print:print" 31743 bytes free"
340 new
The ultimate aim of a "true" emulator would be to run at least some Pet asm apps without alterations.
I wonder if its possible to do? Has anyone tried?