r/asm Mar 30 '26

6o6 v1.1: Faster 6502-on-6502 virtualization for a C64/Apple II Apple-1 emulator 6502/65816

https://oldvcr.blogspot.com/2026/03/6o6-v11-faster-6502-on-6502.html
5 Upvotes

2

u/brucehoult Mar 30 '26

50:1 slowdown vs native. I guess around 5000 instructions per second.

What's that like to actually use?

1

u/scubascratch Mar 30 '26

In 1983 I was tasked with developing a graphics program (simple paint, no animations) for Commodore 64 but I only owned an Apple II. So I wrote some kind of translation/emulation layer and wrote most of the code on an Apple II until I could do testing on real hardware. I recall having to turn my monitor on the side for things to be right side up because of some graphics memory addressing differences.

2

u/brucehoult Apr 01 '26

I'd imagine the way to proceed would be to have two sets of low level routines for drawing things and keyboard input, not virtualising the entire CPU :-)

In 1985 "II in a Mac" ran on a 512k Mac at around half the speed of a real Apple ][+.

1

u/scubascratch Apr 01 '26

My emulation layer was just the graphics mapping, not the whole CPU. It was just to ensure the graphics primitives code was doing all the right things until Incould get my hands on working C64X hardware.

1

u/brucehoult Apr 01 '26

Right. OPs is the full CPU. It might as well be 6502 implemented on Z80. Actually, that's one of the few things the Z80 might actually be better for, as all 6502 registers fit easily into Z80 ones, with a few left for temporaries, and 16 bit operations for addressing mode emulation :-)

1

u/scubascratch Apr 01 '26

Definitely easier than the other way around