5.) HV Counter
The HV counter returns the vertical and horizontal position of the television's raster beam.
Reading the HV counter will return the following data:
VC7 VC6 VC5 VC4 VC3 VC2 VC1 VC0 (D15-D08)
HC8 HC7 HC6 HC5 HC4 HC3 HC2 HC1 (D07-D00)
VCx = Vertical position in lines.
HCx = Horizontal position in pixels.
According to the manual, VC0 is replaced with VC8 when in interlace mode 2.
For 8-bit reads, the even byte (e.g. C00008h) returns the V counter, and the odd byte (e.g. C00009h)
returns the H counter.
The V counter counts up from 00h to EAh, then it jumps back to E5h and continues counting up to
FFh. This allows it to cover the entire 262 line display.
The H counter counts up from 00h to E9h, then it jumps back to 93h and continues counting up to
FFh. This allows it to cover an entire 342 pixel line.
The H counter description is based upon known information about the SMS VDP's H counter. The
SMS has a 256x192 display, and each line consists of 342 pixels. (that includes blanking, retrace, etc.)
The description *could* be accurate for the Genesis' 32-cell display mode. This is not the case for the
40-cell display, where I would assume the H counter jumps back farther at a later point in the count-up.
TileSet internal data
Moderator: Stef
-
- Very interested
- Posts: 2968
- Joined: Fri Aug 17, 2007 9:33 pm
Re: TileSet internal data
The HV counters are at 0xC00008.
Re: TileSet internal data
Great thanks, will try !
There a test without, hard to sync tried multiple things with map update... And tested just on/off each frame, but maybe I may just go with gameplay on/off later, will see.
https://youtu.be/O34y6uDcK0I
There a test without, hard to sync tried multiple things with map update... And tested just on/off each frame, but maybe I may just go with gameplay on/off later, will see.
https://youtu.be/O34y6uDcK0I
Re: TileSet internal data
Thanks it works, and no need bothering with counting back since just need parity : *(u8*)0xC00008) & 1