Re: VIC Article

From: Hatch (
Date: 2005-02-10 14:44:20

----- Original Message ----- 
From: "Jim Yopat" <>
To: <>
Sent: Thursday, February 10, 2005 9:42 PM
Subject: Re: VIC Article

> The reason I'm asking is because I'm working on a C64 Emulator. I have my 6510 cpu core and drawing functions created, I just need to know how each raster line is drawn.
> So what your saying is the first 63 cycles that make up a raster line are not the start of the display screen? That there is a buffer (this must be the vblank and hblank?) were nothing is drawn because of the starting offset of the display screen in both the X and Y positions? What about the tables in section 3.6.1. The very last table says this: no Bad Line, sprites 2-7 active in this line, sprites 0-4 in the next line (abbreviated)
> Do you what he means when he says that sprites 2-7 are active this line and sprites 0-4 the next line? Looking at the table you can see sprite 3-7 are to the left of the screen (look at: Graph. in the table) while sprite 0-2 are to the right. I'm not seeing how he came up with this and what he even means by it. I would think all sprites are drawn each scanline the VIC is activated. Unless the screen is partly drawn within 2 sets of 63 cycles. Were the first 63 cycles draws part of the screen and the next 63 cycles draws the rest of it (like interlaced mode). I wonder if that's what he means.
> You wouldn't know the authors (Christian Bauer) email address by any chance would you? Or any of these guys associated with the article: Marko Mäkelä, Andreas Boose, Pasi Ojala and Wolfgang Lorenz 

As far as I know there are no schematics of the internals of the VIC II.  Most stuff known about the internals have come from
- THE 6567 DATA SHEET (very helpful but can't find a PAL version and page 20 missing)
- COMMODORE MANUALS (how to code it, registers etc)
- EXPERIENCE (coders have discovered features which point to the way some internals work)
- MEASUREMENTS (some people have measured output signals of VIC II
- EX COMMODORE ENGINEERS (very rare but you can find the odd comment by them, even in some very old documents)

This information used with some common sense (The Assumption that C= Engineers would have designed the cct in the most efficient/practical way) is what would have been used when writing the VIC Article.  The VIC Article is very good and as far as I know you won't find better info on the VIC II anywhere.  

The VIC II chip has two main counters an X and Y counter(I cant remember the real names for these counters), they are both 9 bit, the x counter resets at 504 and the y counter resets at 312.  The number in the counter is not the same as the physical number of the raster line or the pixel clock but are offset. e.g. When the X counter is 0 you would expect 0 to indicate the start of the PAL raster signal (around about the start of the front porch) but it's actually somewhere between the horizontal sync and that start of the display signal.  This actually makes things simpler for coding e.g. sprite positioning (it makes more sense). Anyway there's flip flops that control things like sync pulses, equ pulses, enabling boarders, enabling D RAM refresh, enabling data fetches, color burst, etc,  Pretty much all the timing stuff.  These two 9-bit counters keep track of the exact position of the raster and when these counters have a particular number it will set or clear a flip flop w!
 ith a specific function, for example on the NTSC VIC II when the x counter is 416 the Hsync pulse flip flop is set and when the counter is 452 the Hsync pulse flip flop is cleared.

Every 8 lines the VIC reads in character data (40 bytes which it stores in internal memory), this is known as a bad line because it steals cycles from cpu.

The sprite data for a line is read in at the end of the previous line and at the start of the present line.

One thing to watch out for (had me stumped for a while) is the revision of the NTSC Vic chip,  One of the X counts is stretched out for 9 pixel clock counts giving the extra 1micro second per raster line that they needed.

No I don't know any e-mail addresses.

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.