;----------------------------------------------------------------------------------------- ;-Description: ; This test checks how VSRAM responds to reads and writes to and from odd addresses. ;##NOTE## Interestingly, we don't need any wait states here for stability, when either ;CRAM or VSRAM read targets are used to read the FIFO. We did need to add wait states ;after the VSRAM reads in the CRAMByteswapping test in order to avoid lockups and CRAM ;read errors however. ;----------------------------------------------------------------------------------------- TestVSRAMByteswappingText: dc.b 'VSRAM Byteswapping ' TestVSRAMByteswappingTextEnd: TestVSRAMByteswappingExpectedResult: dc.w $5122, $5344, $5100, $5100, $5122, $5344, $5100, $5100, $5122, $5344, $5100, $5100, $5122, $5344, $5100, $5100 TestVSRAMByteswapping: ;Initialize the text result block move.w #(TestVSRAMByteswappingTextEnd-TestVSRAMByteswappingText),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 TestVSRAMByteswappingText,A1 sub.w #1,D7 TestVSRAMByteswappingWriteText: move.b (A1)+,(A0)+ dbf D7,TestVSRAMByteswappingWriteText move.w #1,(A0)+ ;Set the expected result data present flag lea TestVSRAMByteswappingExpectedResult,A1 ;Write the expected result data to the buffer sub.w #1,D6 TestVSRAMByteswappingWriteExpectedResultData: move.b (A1)+,(A0)+ dbf D6,TestVSRAMByteswappingWriteExpectedResultData ;Fill the FIFO buffer with some writes to VSRAM at 0x20 move.l #$40200010,$C00004 move.w #$1122,$C00000 move.w #$3344,$C00000 move.w #$5566,$C00000 move.w #$7788,$C00000 move.w #$99AA,$C00000 move.w #$BBCC,$C00000 move.l #$00200010,$C00004 ;Read from VSRAM at 0x20 move.w $C00000,(A0)+ move.w $C00000,(A0)+ ; move.l #$00000010,$C00004 ;Read from VSRAM move.l #$00600020,$C00004 ;Read from CRAM at 0x60 move.w $C00000,(A0)+ move.w $C00000,(A0)+ move.l #$00210010,$C00004 ;Read from VSRAM at 0x21 move.w $C00000,(A0)+ move.w $C00000,(A0)+ ; move.l #$00000010,$C00004 ;Read from VSRAM move.l #$00600020,$C00004 ;Read from CRAM at 0x60 move.w $C00000,(A0)+ move.w $C00000,(A0)+ ;Fill the FIFO buffer with some writes to VSRAM at 0x21 move.l #$40210010,$C00004 move.w #$1122,$C00000 move.w #$3344,$C00000 move.w #$5566,$C00000 move.w #$7788,$C00000 move.w #$99AA,$C00000 move.w #$BBCC,$C00000 move.l #$00200010,$C00004 ;Read from VSRAM at 0x20 move.w $C00000,(A0)+ move.w $C00000,(A0)+ ; move.l #$00000010,$C00004 ;Read from VSRAM move.l #$00600020,$C00004 ;Read from CRAM at 0x60 move.w $C00000,(A0)+ move.w $C00000,(A0)+ move.l #$00210010,$C00004 ;Read from VSRAM at 0x21 move.w $C00000,(A0)+ move.w $C00000,(A0)+ ; move.l #$00000010,$C00004 ;Read from VSRAM move.l #$00600020,$C00004 ;Read from CRAM at 0x60 move.w $C00000,(A0)+ move.w $C00000,(A0)+ rts