If I recall correctly, it's because the registers can't be read from the hardware.
Or at least not all of them can.
+1. I know the read data can't be (ie,vdc register 2.) Think about how it works.
Yep, that's true ... but do you actually read these register values?
The only reason that the __vdc array exists is to support reading VDC registers with ...
int a;
a = vdc[4];BUT the contents of the array aren't consistently updated when you actually use functions like disp_on()/disp_off()/set_screen_size()/scroll().
It *feels* like it's all left-over from an early version of HuC that was created before the guys started working with the CDROM and making things compatible with how the System Card does things.
So ...
Do you *read* values from the vdc[] array in HuC?
If so, why? What are you trying to achieve?
Do you *write* values to the vdc[] array in HuC?
If so, why? What are you trying to achieve?
Do you use vreg(reg,val) to *write* values to the VDC in HuC?
If so, why? What are you trying to achieve?
BTW ... those questions are for ALL HuC programmers ... I need to know what is important to keep from a compatibility POV, and what I can ditch during spring-cleaning.
And why-oh-why are the register numbers that are passed into these functions double the 16-bit VDC register number (i.e. address in bytes vs. address in words) ... but the VRAM address numbers that are passed into the vram[] array are given (sensibly) as the address-in-words???
Are there #defines for the VDC register names anywhere in HuC ... I can't seem to find them?