This article is an absolute treasure - a work of art, in itself.
I never dived into the C64 video architecture much back in the day when C64 was fresh - I instead had an Oric-1/Atmos and thus had other thorns to deal with - but I have always respected the levels to which the C64 has been pushed.
In the Oric-1/Atmos world, we too have strange attributes to exploit and derive new tricks, never once considered feasible, for the platform.
I have often thought of what it'd take to add a camera to the Oric, and thought to just glom an ESP32 with a realtime libpipi [1] or Pictconv [2] implementation, generating LDA/STA's for the Orics very humble HIRES mode straight into its DATA lines.
There is a great deal of satisfaction in seeing such insane optimisations being developed with 21st century optimism for the 'retro' computers. Making them do insane new things makes them new again.
Love how this chronicles the instruction count at 301 million and then for each optimization and compromise it cuts xx million instructions of the runtime.
I think the 6502 final would need to be run in an emulator to get the retired instruction count. On 586+ cpu such a function is baked into the hardware.
Thanks :)
I do time the 6502 code using the MAME emulator, its debugger's trace feature, and a profiler I made. It's far from perfect (gets very confused by tricks like pha/pha/rts in the IIe ROM) but works under IIc emulation and allows me to precisely count cycles in my code: https://www.colino.net/wordpress/en/a2trace-debug-and-profil.../
My preference was to work in cycles. Many systems have a timer one can use to get the cycle counts. There isn't one on a stock Apple 2. Many cards have the PIA chip, 6522, which does have two timers, though they are only 16 bit.
Or, a quick hand timing gets fairly close. On that, the only real difficulty is finding a task that scales well with our perceptual slowness.
Today I was thinking about this more. Yes. The optimization is cool. But the original 70 minutes runtime. 70 minuets to know if your code works. On average this is about 73 pixels a second. Like watching paint dry.
No chance this ran correct the first time. How many times it ran before it was like oh crap. Try again. That’s some serious dedication.
I never dived into the C64 video architecture much back in the day when C64 was fresh - I instead had an Oric-1/Atmos and thus had other thorns to deal with - but I have always respected the levels to which the C64 has been pushed.
In the Oric-1/Atmos world, we too have strange attributes to exploit and derive new tricks, never once considered feasible, for the platform.
I have often thought of what it'd take to add a camera to the Oric, and thought to just glom an ESP32 with a realtime libpipi [1] or Pictconv [2] implementation, generating LDA/STA's for the Orics very humble HIRES mode straight into its DATA lines.
There is a great deal of satisfaction in seeing such insane optimisations being developed with 21st century optimism for the 'retro' computers. Making them do insane new things makes them new again.
[1] - http://caca.zoy.org/wiki/libpipi/oric [2] - https://www.osdk.org/index.php?page=documentation&subpag...
I think the 6502 final would need to be run in an emulator to get the retired instruction count. On 586+ cpu such a function is baked into the hardware.
My preference was to work in cycles. Many systems have a timer one can use to get the cycle counts. There isn't one on a stock Apple 2. Many cards have the PIA chip, 6522, which does have two timers, though they are only 16 bit.
Or, a quick hand timing gets fairly close. On that, the only real difficulty is finding a task that scales well with our perceptual slowness.
No chance this ran correct the first time. How many times it ran before it was like oh crap. Try again. That’s some serious dedication.