Worlds Worst Videocard BadApple Demo. I want more FPS!
Posted: Sun Nov 19, 2023 4:16 pm
Hello everyone!
I've got a Ben Eater 6502 and Video card kit setup that I'm doing a Bad Apple demo for:
https://github.com/Fifty1Ford/Ben-Eater-Bad-Apple
I'm getting 16 frames a second on average right now. Nothing to even the framerate, no vsync in use, just pushing pixels as fast as I can.
The only change from the stock kit is extra bypass caps and power wires so I can clock the CPU at 5Mhz.
Since the VGA halts the CPU while it draws that means I get 1.3Mhz effective CPU speed.
The video setup is straight bitmapped video. 1 byte per pixel. 100x64 pixels. (6,400 bytes)
This is stored in a 8k area starting at $2000. 28 bytes of each row are cut off (128 byte alignment)
My encoder does Differential Run Length Encoding.
1 Byte holds the data, 1 byte holds the run length.
Because it is a 6bit/64 color video setup I use value 65 to mean 'Skip' for unchanged pixels.
I also just added an optimization for the Bad Apple source video.
Since it is Black, White, and two Greys in the source I now use a lookup table of all possible combinations of 3 pixels.
It means that I write 3 pixels even if only 1 or 2 changed but it reduced my file size by over a megabyte to just over 3 megabytes for the entire video.
Encoding is now at an average of 507 bytes a frame. 12.6 to 1 compression.
With this setup currently at 16 FPS with my unrolled decoder......
I'm looking for any suggestions for what to look at next for increases in framerate??
If I change my SD card initialization routine /hardware to use the CA2 handshake on port reads I should save 99 cycles per byte read VRS 184 cycles. Or 43,095 cycles a frame if my math is right?
That should help quite a bit I think. But what next?
With these limitations what else should I be looking into?
Any other fast decompression resources out there?
Lots of 6502 related compression is tape or disk 'FAST LOADER' based and is not really concerned with filling the screen as smoothly and quickly as possible but instead speeding up slow disk loads. Both move lots of data but I need to spend so much time updating bytes/pixels there is not much left for decoding.
Any guess as to the maximum FPS updating a 6k screen buffer with a 1.3mhz 6502?
Any helps greatly appreciated!
I've got a Ben Eater 6502 and Video card kit setup that I'm doing a Bad Apple demo for:
https://github.com/Fifty1Ford/Ben-Eater-Bad-Apple
I'm getting 16 frames a second on average right now. Nothing to even the framerate, no vsync in use, just pushing pixels as fast as I can.
The only change from the stock kit is extra bypass caps and power wires so I can clock the CPU at 5Mhz.
Since the VGA halts the CPU while it draws that means I get 1.3Mhz effective CPU speed.
The video setup is straight bitmapped video. 1 byte per pixel. 100x64 pixels. (6,400 bytes)
This is stored in a 8k area starting at $2000. 28 bytes of each row are cut off (128 byte alignment)
My encoder does Differential Run Length Encoding.
1 Byte holds the data, 1 byte holds the run length.
Because it is a 6bit/64 color video setup I use value 65 to mean 'Skip' for unchanged pixels.
I also just added an optimization for the Bad Apple source video.
Since it is Black, White, and two Greys in the source I now use a lookup table of all possible combinations of 3 pixels.
It means that I write 3 pixels even if only 1 or 2 changed but it reduced my file size by over a megabyte to just over 3 megabytes for the entire video.
Encoding is now at an average of 507 bytes a frame. 12.6 to 1 compression.
With this setup currently at 16 FPS with my unrolled decoder......
I'm looking for any suggestions for what to look at next for increases in framerate??
If I change my SD card initialization routine /hardware to use the CA2 handshake on port reads I should save 99 cycles per byte read VRS 184 cycles. Or 43,095 cycles a frame if my math is right?
That should help quite a bit I think. But what next?
With these limitations what else should I be looking into?
Any other fast decompression resources out there?
Lots of 6502 related compression is tape or disk 'FAST LOADER' based and is not really concerned with filling the screen as smoothly and quickly as possible but instead speeding up slow disk loads. Both move lots of data but I need to spend so much time updating bytes/pixels there is not much left for decoding.
Any guess as to the maximum FPS updating a 6k screen buffer with a 1.3mhz 6502?
Any helps greatly appreciated!