VDP Mirrors

Hi,

I was just wondering what the VDP port mirrors are and why they may be used? For example, why is there an address $C00002 that is the VDP Data Port (Mirror). The same goes for the VDP Control (Mirror), H/V Counter (Mirror) etc.

Thank you!
 

Knight0fDragon

Patron Supporter
They are for efficiency purposes on the 68000 mostly. The CPU writes long as high, increment addr, low. If you mirror, then you get to cheat and get a free increment with a write. Otherwise you would have to do 2 word writes instead, which eats up a few more cycles.
 
OK. So setting the VDP state to write to VRAM address 0 like this:

MOVE.W #$4000,$C00004
MOVE.W #$0000,$C00004

is less efficient than:

MOVE.L #$40000000,$C00004

In the second example, $0000 will be placed in the VDP_CONTROL MIRROR ($C00006)?

Also, does this write high word, increment, write low word apply to all 68000 memory writes of longwords? Or is this specific to VDP ports?
 
Last edited:

Knight0fDragon

Patron Supporter
OK. So setting the VDP state to write to VRAM address 0 like this:

MOVE.W #$4000,$C00004
MOVE.W #$0000,$C00004

is less efficient than:

MOVE.L #$40000000,$C00004

In the second example, $0000 will be placed in the VDP_CONTROL MIRROR ($C00006)?

Also, does this write high word, increment, write low word apply to all 68000 memory writes of longwords? Or is this specific to VDP ports?
That pertains to all long word writes, but I am not familiar enough with the Genesis architecture to tell you if it is effective with non mirrored addressing.
 

Ponut

Gear Supporter
Basically, all memory access on 68000 series processors has an effective address calculation time.
If you use one memory accessing instruction instead of two, you've only done that calculation once and saved the processor some cycles.
For example, if you know your data is 0xAEEACAAC, writing that as four bytes is technically less work for the CPU than writing it as 0xAEEA and then 0xCAAC. Does not matter if the upper and lower bits are the same or different.

Also keep in mind the effective address calculation applies for source and destination, as long as its memory. So in the case of pointer-to-pointer data movement, calculation time is taken for both ends.

The only case where this does not apply is when moving data to an internal register, as there is no effective address calculation. The time taken is the same for one, two, or four bytes in the case of moving between CPU registers.


As for the mirrors, no idea. Just chimed in to state the above.
 
Top