;------------------------------------------------------------------------------------ ;Test - Register Writes and Code Reg ;------------------------------------------------------------------------------------ TestRegisterWritesAffectCodeRegisterText: dc.b 'Register Writes and Code Reg ' TestRegisterWritesAffectCodeRegisterTextEnd: TestRegisterWritesAffectCodeRegisterExpectedResult: dc.w $0123, $4567, $FFFF, $FFFF, $FFFF, $FFFF, $F923, $FD67, $FFFF, $FFFF, $F923, $FD67 TestRegisterWritesAffectCodeRegister: ;Initialize the text result block move.w #(TestRegisterWritesAffectCodeRegisterTextEnd-TestRegisterWritesAffectCodeRegisterText),D7 move.w #2,(A0)+ ;Set the number of display lines move.w D7,(A0)+ ;Set the text length move.w #$0018,D6 ;Set the data length move.w D6,(A0)+ lea TestRegisterWritesAffectCodeRegisterText,A1 sub.w #1,D7 TestRegisterWritesAffectCodeRegisterWriteText: move.b (A1)+,(A0)+ dbf D7,TestRegisterWritesAffectCodeRegisterWriteText move.w #1,(A0)+ ;Set the expected result data present flag lea TestRegisterWritesAffectCodeRegisterExpectedResult,A1 ;Write the expected result data to the buffer sub.w #1,D6 TestRegisterWritesAffectCodeRegisterWriteExpectedResultData: move.b (A1)+,(A0)+ dbf D6,TestRegisterWritesAffectCodeRegisterWriteExpectedResultData ;Initialize target memory move.l #$40000002,$C00004 ;Write to VRAM at 0x8000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.l #$40000002,$C00004 ;Write to VRAM at 0x8000 move.w #$0123,$C00000 move.w #$4567,$C00000 move.l #$00000002,$C00004 ;Read from VRAM at 0x8000 move.w $C00000,(A0)+ move.w $C00000,(A0)+ nop ;Wait for a few cycles after a read before modifying any VDP settings. On the nop ;real hardware, if a control port write occurs immediately after a data port nop ;read, the VDP can lock up. Most likely, this occurs due to the read target nop ;being modified to an invalid target before a read pre-cache is complete. nop nop nop nop nop nop ;Initialize target memory move.l #$40000002,$C00004 ;Write to VRAM at 0x8000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.l #$40000002,$C00004 ;Write to VRAM at 0x8000 move.w #$8F02,$C00004 ;Perform a register write move.w #$0123,$C00000 move.w #$4567,$C00000 move.l #$00000002,$C00004 ;Read from VRAM at 0x8000 move.w $C00000,(A0)+ move.w $C00000,(A0)+ nop ;Wait for a few cycles after a read before modifying any VDP settings. On the nop ;real hardware, if a control port write occurs immediately after a data port nop ;read, the VDP can lock up. Most likely, this occurs due to the read target nop ;being modified to an invalid target before a read pre-cache is complete. nop nop nop nop nop nop ;Initialize target memory move.l #$40000002,$C00004 ;Write to VRAM at 0x8000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.l #$40000012,$C00004 ;Write to VSRAM at 0x8000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.l #$40000012,$C00004 ;Write to VSRAM at 0x8000 move.w #$0123,$C00000 move.w #$4567,$C00000 move.l #$00000002,$C00004 ;Read from VRAM at 0x8000 move.w $C00000,(A0)+ move.w $C00000,(A0)+ nop ;Wait for a few cycles after a read before modifying any VDP settings. On the nop ;real hardware, if a control port write occurs immediately after a data port nop ;read, the VDP can lock up. Most likely, this occurs due to the read target nop ;being modified to an invalid target before a read pre-cache is complete. nop nop nop nop nop nop move.l #$00000012,$C00004 ;Read from VSRAM at 0x8000 move.w $C00000,(A0)+ move.w $C00000,(A0)+ nop ;Wait for a few cycles after a read before modifying any VDP settings. On the nop ;real hardware, if a control port write occurs immediately after a data port nop ;read, the VDP can lock up. Most likely, this occurs due to the read target nop ;being modified to an invalid target before a read pre-cache is complete. nop nop nop nop nop nop ;Initialize target memory move.l #$40000002,$C00004 ;Write to VRAM at 0x8000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.l #$40000012,$C00004 ;Write to VSRAM at 0x8000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.l #$40000012,$C00004 ;Write to VSRAM at 0x8000 move.w #$8F02,$C00004 ;Perform a register write move.w #$4000,$C00004 ;Partial CP, write to VSRAM at 0x8000 move.w #$0123,$C00000 move.w #$4567,$C00000 move.l #$00000002,$C00004 ;Read from VRAM at 0x8000 move.w $C00000,(A0)+ move.w $C00000,(A0)+ nop ;Wait for a few cycles after a read before modifying any VDP settings. On the nop ;real hardware, if a control port write occurs immediately after a data port nop ;read, the VDP can lock up. Most likely, this occurs due to the read target nop ;being modified to an invalid target before a read pre-cache is complete. nop nop nop nop nop nop move.l #$00000012,$C00004 ;Read from VSRAM at 0x8000 move.w $C00000,(A0)+ move.w $C00000,(A0)+ nop ;Wait for a few cycles after a read before modifying any VDP settings. On the nop ;real hardware, if a control port write occurs immediately after a data port nop ;read, the VDP can lock up. Most likely, this occurs due to the read target nop ;being modified to an invalid target before a read pre-cache is complete. nop nop nop nop nop nop rts