Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 11, 2008 18:30:58 GMT -5
In the initialization of graphics, the code is similar to this:
register uint *pw;
pw = (uint *) GFXCNTL; /*P1*/
*pw = 0x8016; /*P2*/ *pw = 0x8174; *pw = 0x8230; *pw = 0x832C; /*P3*/
In P1, it is pointing to the control port of VDP, it is right.
From P2 to P3, it is setting the VDP. Why the value changes, instead of just using bitwise operators (&, |, ^, ~)?
|
|
|
Post by pmjobin on Aug 11, 2008 19:10:51 GMT -5
I don't know the exact details of the code your talking about but I guess it has to do with the fact that the operators you mentionned hide an implicit read of the register (I'm referring to the assignement form of those operators: &=, |=, ^=, etc).
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 11, 2008 19:23:46 GMT -5
Why it changes the value of *pw? Why is just one value not enough?
I saw other detail, that looks clearer:
pw = (uint *) GFXDATA; *pw = 0; /* color 0 - black */ *pw = 0x0eee; /* color 1 - white */
Why are the while and black colors being set in the same place?
|
|
|
Post by jlf65 on Aug 16, 2008 2:02:06 GMT -5
You really need to read the hardware manual. Under certain circumstances, writes to the port auto-increment the destination - like when writing to the palette.
|
|