Decoding confusing VDP control data

Discussion in 'Technical Discussion' started by Orangy Tang, Apr 4, 2018.

  1. Orangy Tang

    Orangy Tang

    Member
    15
    0
    0
    I'm trying to decipher these vdp commands from a commercial rom:

    Code (Text):
    1.  
    2. MOVE.w  $FFFFF7E4.w, VDP_controlPort
    3. MOVE.w  $FFFFF7D0.w, VDP_controlPort
    4.  
    Using the reference guide here: http://info.sonicretro.org/SCHG:VDP_Documentation/General/Ports

    Since they're moving words to the control port, I thought it was writing to registers, but that doesn't make sense since F7E4 has the top two bits set, which is apparently wrong for writing to a register.
    If I assume the first MOVE is actually writing a long (and therefore setting a VDP address) then the CD0/1/2/3 decodes to 1011, which isn't in the access type table.
    If I assume both MOVEs combine to write one long of F7E4F7D0, then CD0/1/2/3 decodes as 0111, which also isn't in the access type table.

    Clearly I'm interpreting this incorrectly - can anyone tell me where I'm reading it wrong?

    Thanks.
     
  2. Natsumi

    Natsumi

    the cute one here Tech Member
    It's reading from RAM addresses from the looks of it. See what's in RAM addresses $F7E4 and $F7D0, those are probably gonna be edited dynamically depending on what's going on in the game.
     
  3. MarkeyJester

    MarkeyJester

    ♡ ! Resident Jester
    Are you sure you are decoding this correctly?

    You stated that CD0/1/2/3 decodes to 1011, but if the top two bits are set in RAM F7E4 as you suggest, then CD0 and CD1 will be set, as the two most significant bits in the word are assigned to them. If this is the case, then it's likely going to be a CRAM write address.

    If the highest bit of RAM byte $FFFFF7D1.w is set, then this will be assigned to CD5, and it'll be treated as a DMA related transfer into CRAM.
     
  4. Orangy Tang

    Orangy Tang

    Member
    15
    0
    0
    Nope! That's why I asked. :)

    I think my mistake was misreading the actual instructions - I thought it was moving literal $F7E4, not the actual contents of ram at $F7E4. It's starting to make more sense now, thanks both!

    Btw MarkeyJester your 68k guide is super useful, so thanks for that. :)