byuu wrote:
Oh okay, yeah. Line coincidence isn't, to me at least, hsync.
When I think hsync, I think something like SNES HDMA, where the goal is to fire during the horizontal blanking period of each line so you can write to registers before the next active display section.
Huh? Hsync.. when the sync pulse starts for the horizontal line (raising edge/end of pulse) -> if the line number matches the RCR reg, an interrupt is generated. Aka hsync interrupt. What else would it be??? The VDC generates this, not the VCE. The VCE might sync the VDC, but the VDC itself can be set to have multiple hsync interrupts triggered per line (VCE line/frame work).
Anyway, that's what it does. Fires during hsync so the cpu can update regs before the next scanline. The regs are buffered, so you can take as long as you need to write to them. Registers that affect the hozirontal display settings are updated on the next line (X/Y/width/offset/etc), and regs that affect the vertical display setting are updated on the next VDC "frame" (not necessarily per "VCE" frame).
Quote:
> (because the VDC start to draw the screen at line 64 and not 0)
That really doesn't make sense, either. I know to do the -64 thing when comparing against the actual scanline number, but still ...
If we really started on scanline 64, then we couldn't have 240-pixel height screens when there are only 262 or 263 scanlines per frame. 240+64=304.
It seems like the "we start at line 64" is just a hack to make the sprite clipping on the edges of the screen a little bit easier to handle (and that is certainly appreciated.)
64 is
not the 64th scanline. It's the
first visible scanline (however that is defined). Hsync interrupt can fire on any scanline, including those outside of active display (this is used to playback 15.7khz samples for demos).
Quote:
And if the PCE documentation is to be believed (and I don't fully believe it), it seems to suggest the PCE caches a lot of registers at the beginning of each frame, which makes raster effects kind of hopeless.
Raster effects outside of X,Y,(2bit/4bit color more for sprites or BG), sprites on/off, bg on/off, etc? Those are buffered per VDC line. The changes take place on the next "VDC" line. What other raster effects do you need? I say VDC line, because it's possible to have more than one VDC line inside of a VCE line. This should be obvious, because if the VDC is in h-pulse window mode, it's waiting for VCE to snap it to the next mode. If the VCE doesn't, then the VDC times out and continues on the next mode/phase by itself. But if the VCE asserts hysnc, it doesn't matter were the VDC is.. it will immediately snap to the phase that follows hsync pulse window (I forgot the official names of these).
VCE reg changes aren't like VDC reg changes. They take place immediately, including changing the resolution (can be done mid scanline).
You're in for a treat.
_________________
__________________________
http://pcedev.wordpress.com