Re: VIC stuff

From: Laze Ristoski (
Date: 2003-09-18 21:26:12

> It looks to me as though the bit-map holds patterns for a "phantom"
> character-set.  In graphics mode, the VIC-II pretends that it is
> displaying
> a text-screen that has an ascending sequence of character-codes -- from
> $000 in the top, left corner to $3E7 in the bottom, right corner.  So, the
> graphics formula is an extension of the text formula.
> char_code = int(y / 8) * 40 + int(x / 8)

That's the most obvious answer, but strange things happened when I
played with VIC tricks. I guess I have misunderstood something.
VC is incremented after each G-access, not C-access. Maybe it's
correct that VIC skipped the first two charrows.

I was doing a combination of VSP and FLD.
Here's what happens: I generate badline at arbitrary cycle (14-53) of
rasterline $30. VC increments after each _G-access_ (!). Then, it sees
that RC=7, so VCBASE is loaded from VC (thus increased by a value
determined by 40-x, where x=the number of chars we want to
scroll. Since there's a badline condition, RC is increased, and it overflows
to 0. But in the next rasterline, there's no badline condition, so no
C-accesses are made.
In cycle 14 of this rasterline, VC is loader from VCBASE, and it's
increased after each G-access (40). If it were increased after each
C-access, it would mean that VC stays at the current value.
But in this case, it's increased to point to the next charrow.
I guess this was my problem. But there was another thing too: if the bitmap
has the first two charrows skipped, why the color memory has only the first
charrow skipped? The answer seems to be the following: in the line
where I generate VSP, RC=7 so VCBASE is loaded from VC.
VC points to the next charrow, but there're no C-accesses. So, VIC
still uses the first charrow of the color memory, but as no C-accesses
are needed for the bitmap, it reads the second charrow of the bitmap.
On the next charrow, VIC reads the third charrow for both, the bitmap
and the color memory.

There's only one way to learn the VIC in details: make your own
C64 emulator. Maybe... Some day. :)

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.