Dr Jefyll wrote:
I am not a VIC or C64 guy, and I suspect some our best expertise is presently on vacation! Anyway, I had a quick look at the data sheet for the
6567 VIC-II and also that for the
6560 VIC. To me it seems the dual-port RAM idea leaves a few important issues unresolved, including the question of how the CPU can access the VIC registers (given that the CPU address and data buses don't attach to those for the VIC -- AIUI, the VIC buses attach only to the dual-port RAM). Yes, the VIC would be able to take control and access the dual-port RAM and read video data from it. (BTW I notice the video data is 12 bits wide, not 8, so that needs to be accommodated somehow.) But the VIC also has a passive role where it responds to accesses from the host CPU. If you made provision for this then I overlooked it.
The VIC can read data from anywhere in a 64k area. But it also has fixed registers mapped to permanent locations located in the same block as the IO space. So the same solution that can access the 1MHz bus will also take care of the fixed registers. That's what the extra 4 data bits are for, they access the fixed color RAM. So the VIC chip actively reads from RAM to access things like character data, sprites, bitmaps, etc. the remaining registers are written to by the CPU just like RAM.
[quote=] I can think of two alternatives to the dual-port RAM approach.
- have one address bus and one data bus, to which the VIC and the CPU both connect. During the first half of each cycle the CPU would pause while the VIC fetches video data from the RAM. The second half of the cycle would belong to the CPU. According to what the program dictates, the CPU would either access a VIC register or, at the faster rate of its own 14 MHz clock, do as many as seven RAM accesses.
- have two address buses and two data buses, thus allowing independent and concurrent operation of the VIC and the CPU (there would be two RAM's). Tristate buffers -- and some moderately complex synchronizing logic -- would tie the two separate systems together when it's necessary for the CPU to access VIC registers or the VIC RAM.
[/quote]
I have been looking at that already. And it is a viable option. However I find the dual port ram has many advantages. One, no CPU stealing. See the problem is that as you state, according to what the program dictates, most C64 software doesn't dictate, it was designed around the 1 MHz speed. The VIC2 needs more than just stealing the first half of a cycle. In the stock form, it also steals 40 cycles every 8th scan line while it fetches the next 40 characters of data (more if sprites are being displayed). In my dual port ram, the VIC can do its thing without stealing any cycles. The only loss I can see is when the CPU writes to or reads from the fixed registers located in IO space. But this has to happen anyway.
I have been laying out my rough schematic, which is where these questions are coming from. The C64 is among the harder 8 bit systems to run at a higher clock speed. I have tried looking at what the SuperCPU and other accelerators do, but their solutions are somewhat secret. It appears the SuperCPU users some Altera chip to interface to the C64s 1 MHz bus speed.