Help: CC65 Compiled Code Locking Up??

You need an actual VIC.

Moderator: Moderators

User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

From the view of the VIC chip, the colour RAM is everywhere.

The colour RAM is connected over an extra 4-bit data bus to the VIC chip, and shares the lower 10 address pins with the 14-bit VIC address bus.

That is the reason the colour RAM changes its base address along with the screen RAM base address. Take a look at the lower 10 address bits:

Code: Select all

4096 = %000100|0000000000    37888 = %100101|0000000000
7680 = %000111|1000000000    38400 = %100101|1000000000
In the first line, the lower 10 bits are both %0000000000, in the second line %1000000000. That pattern still holds, when the screen memory is shifted to another address, the colour RAM has always the same base address MOD 1024.

Furthermore, the following correspondence holds:

Code: Select all

VIC address range    CPU address range

 $0000 ... $1FFF      $8000 ... $9FFF, i.e. BLK4
 $2000 ... $3FFF      $0000 ... $1FFF, i.e. BLK0
Anything outside BLK0 or BLK4 is not accessible to VIC.

It is also not able to access the colour RAM as text or character generator data, as an analog switch separates the normal data bus and the colour RAM bus during VIC access.

Even though an external +3K RAM expansion maps into BLK0, it is not accessible by VIC either, as it is on the 'wrong' side of the data bus and address bus buffers, which also separate the VIC and CPU side of both busses during VIC access. They're necessary, because the 6502 cannot tri-state its address bus.

An internal +3K expansion, as done in parts 1 and 2 of my VFLI mod, fills the hole between $0400 and $0FFF on the VIC side, making the complete BLK0 available for graphics data.
Post Reply