pouët.net

Go to bottom

C64 external hardware acceleration of scrolling?

category: code [glöplog]
 
(This is more hardware than code, but the reasons why it was maybe never done might come down to the fact that good code only solutions exist, so I put it in that category. :) )

After seeing the release of a port of Sega Master System Sonic game to C64 I started thinking about background layer scrolling on the C64. The game requires a REU (RAM Expansion Unit) and features smooth 4 way scrolling.

Looking at the hardware, $D011/$D016 can be used for fine scroll adjustment up to a tile in X/Y, but any more than that and you need to shuffle data around. You can also set the BG layer base address using $D018 so you can double/triple+++ buffer, so you don't need shuffle a full screen of data in a single frame.

But, you could relatively easily (if you know how to design logic circuits) make a circuit that adds an offset to the address that the VIC is trying to access, to create a larger virtual BG map that can be scrolled freely in tile increments, plus the VIC's fine scroll. There's some more caveats, like detecting when a line ends, but it seems like a doable project overall. This would free up a lot of CPU cycles, but the downside would of course be reliance on external hardware.

Has anyone ever done anything like this for the C64? Either commercially back in the day, or as a one-off proof of concept.
added on the 2021-12-16 17:45:37 by nitro2k01 nitro2k01
Wow.... that's a question for extreme wizards. What do you need it for?
added on the 2021-12-18 18:40:14 by w00t! w00t!
It's not so much that I need or think it would be a good idea to invent today but more that it seemed like low enough hanging fruit that someone, some where must have tried it. For example, nearing the end of the commercial lifespan of the C64, some publisher might have produced this kind of expansion chip as a selling point for why one should use them to publish your games. (Easier programming/cooler visual effects.) Or someone might have made it as a FPGA project just playing around.

Since posting the question I've learned a couple of things:

  • The VIC can't read from external (cartridge) memory so the idea wouldn't work right off the bat. So that explains why no one could have tried it even if they wanted to. OH WELL! :)
  • The Sonic port linked above probably doesn't use the REU mainly for it's massive memory capacity, but due to its DMA controller. The DMA lets you copy at essentially the would be clock speed of the CPU, so much faster than even optimized ASM could ever do. 1541 Ultimate does support REU emulation, so this seems like a possible way forward if anyone actually wants to code for the REU.
  • Techniques like Flexible Line Distance and Variable Screen Placement exist. Although they're more of hacks and probably work best in a demo setting where the code sequence is pretty much deterministic.
added on the 2021-12-19 00:41:15 by nitro2k01 nitro2k01
Quote:
that explains why no one could have tried it even if they wanted to.


...which they probably wouldn't because c64 people are notoriously allergic to expansions.
added on the 2021-12-19 19:56:48 by lynn lynn
You can take a look at the beamracer extension:

https://beamracer.net/
added on the 2021-12-19 20:25:45 by neoman neoman
There's no need for such humbug. Proper C64 users choose themselves not to expand, new features and powers must be found from within.
Quote:
Techniques like Flexible Line Distance and Variable Screen Placement exist. Although they're more of hacks and probably work best in a demo setting where the code sequence is pretty much deterministic.


There are games like Fred's Back that use AGSP for scrolling.
added on the 2021-12-22 00:00:19 by hollowman hollowman

login

Go to top