;---------------------------------------------------------------------------------------- ; Test - RegisterWriteBit13Masked ;-Description: ;---------------------------------------------------------------------------------------- TestRegisterWriteBit13MaskedText: dc.b 'Register Write Bit13 Masked ' TestRegisterWriteBit13MaskedTextEnd: TestRegisterWriteBit13MaskedExpectedResult: dc.w $1234, $5678, $9ABC, $FFFF, $FFFF, $FFFF, $FFFF, $FFFF, $1234, $FFFF, $5678, $FFFF, $9ABC, $FFFF, $FFFF, $FFFF TestRegisterWriteBit13Masked: ;Initialize the text result block move.w #(TestRegisterWriteBit13MaskedTextEnd-TestRegisterWriteBit13MaskedText),D7 move.w #2,(A0)+ ;Set the number of display lines move.w D7,(A0)+ ;Set the text length move.w #$0020,D6 ;Set the data length move.w D6,(A0)+ lea TestRegisterWriteBit13MaskedText,A1 sub.w #1,D7 TestRegisterWriteBit13MaskedWriteText: move.b (A1)+,(A0)+ dbf D7,TestRegisterWriteBit13MaskedWriteText move.w #1,(A0)+ ;Set the expected result data present flag lea TestRegisterWriteBit13MaskedExpectedResult,A1 ;Write the expected result data to the buffer sub.w #1,D6 TestRegisterWriteBit13MaskedWriteExpectedResultData: move.b (A1)+,(A0)+ dbf D6,TestRegisterWriteBit13MaskedWriteExpectedResultData ;Initialize VRAM data at 0x8000 move.l #$40000002,$C00004 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 ;Perform some writes to VRAM at 0x8000 move.l #$40000002,$C00004 move.w #$1234,$C00000 move.w #$5678,$C00000 move.w #$9ABC,$C00000 ;Read from VRAM at 0x8000 move.l #$00000002,$C00004 move.w $C00000,(A0)+ move.w $C00000,(A0)+ move.w $C00000,(A0)+ move.w $C00000,(A0)+ move.w $C00000,(A0)+ move.w $C00000,(A0)+ 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 VRAM data at 0x8000 move.l #$40000002,$C00004 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 move.w #$FFFF,$C00000 ;Set the address increment to 4 with bit 13 set move.w #$AF04,$C00004 ;Perform some writes to VRAM at 0x8000 move.l #$40000002,$C00004 move.w #$1234,$C00000 move.w #$5678,$C00000 move.w #$9ABC,$C00000 ;Restore the address increment move.w #$8F02,$C00004 ;Read from VRAM at 0x8000 move.l #$00000002,$C00004 move.w $C00000,(A0)+ move.w $C00000,(A0)+ move.w $C00000,(A0)+ move.w $C00000,(A0)+ move.w $C00000,(A0)+ move.w $C00000,(A0)+ 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