;----------------------------------------------------------------------------------------- ;Things to do: ;----------------------------------------------------------------------------------------- dc.l $00000000, EntryPoint, ErrorTrap, ErrorTrap ;00 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;10 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;20 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;30 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;40 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;50 dc.l ErrorTrap, ErrorTrap, EXInt, ErrorTrap ;60 dc.l HInt, ErrorTrap, VInt, ErrorTrap ;70 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;80 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;90 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;A0 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;B0 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;C0 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;D0 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;E0 dc.l ErrorTrap, ErrorTrap, ErrorTrap, ErrorTrap ;F0 check_sum equ $0000 ;------------------------------------------------------------------------ dc.b 'SEGA GENESIS ' ;100 dc.b '(C)T-xx 2011.11 ' ;110 release year.month dc.b 'VDP Port Access ' ;120 Japan title dc.b 'Test ROM ' ;130 dc.b ' ' ;140 dc.b 'VDP Port Access ' ;150 US title dc.b 'Test ROM ' ;160 dc.b ' ' ;170 dc.b 'GM T-XXXXXX XX' ;180 product #, version dc.w check_sum ;18E check sum dc.b 'J ' ;190 controller dc.l $00000000,$0007ffff,$00ff0000,$00ffffff ;1A0 dc.b ' ' ;1B0 dc.b ' ' ;1C0 dc.b ' ' ;1D0 dc.b ' ' ;1E0 dc.b 'JUE ' ;1F0 ErrorTrap: jmp ErrorTrap EXInt: HInt: VInt: rte EntryPoint: ;TMSS security code move.b $a10001,d0 andi.b #$0f,d0 beq.b TMSSJump move.l #'SEGA',$a14000 TMSSJump: ;Initialize RAM move.l #$FF0000,A0 move.w #$7FFF,D0 RAMLoop: move.w #$0000,(A0)+ dbf D0,RAMLoop ;Set the initial VDP register state move.w #$8004,$C00004 ;Enable the palette move.w #$8144,$C00004 ;Enable the display/mode 5 move.w #$9001,$C00004 ;Set the scroll size to V32 H64 move.w #$8F02,$C00004 ;Set the auto-increment data to 2 move.w #$8228,$C00004 ;Set the scroll A name table base to 0xA000 move.w #$832C,$C00004 ;Set the window name table base to 0xB000 move.w #$8406,$C00004 ;Set the scroll B name table base to 0xC000 move.w #$8568,$C00004 ;Set the sprite table base to 0xD000 move.w #$8D38,$C00004 ;Set the hscroll base to 0xE000 move.w #$8C81,$C00004 ;Set the screen size to H40 ;Initialize VRAM move.l #$40000000,$C00004 move.w #$7FFF,D0 VRAMLoop: move.w #$0000,$C00000 dbf D0,VRAMLoop ;Initialize CRAM move.l #$C0000000,$C00004 move.w #$3F,D0 CRAMLoop: move.w #$0000,$C00000 dbf D0,CRAMLoop ;Initialize VSRAM move.l #$40000010,$C00004 move.w #$3F,D0 VSRAMLoop: move.w #$0000,$C00000 dbf D0,VSRAMLoop bsr InitializeProgressiveResultsScreenVRAM ;------------------------------------------------------------------------------------ ;Run our tests ;------------------------------------------------------------------------------------ move.w #$0000,$FFFF02 RunTests: move.l #0,D3 move.l #$FF0000,A0 move.l #$FF0000,A6 move.w #1,$FFFF00 move.w #0,$FFFF08 move.w #0,$FFFF0A move.w #0,$FFFF0C ;##DEBUG## ;jsr TestFIFOBufferSize ;bsr DisplayProgressiveResultsScreen ;move.w #$8000,(A0)+ ;bsr DisplayProgressiveResultsScreen ;jsr TestVSRAMDataCache ;bsr DisplayProgressiveResultsScreen ;move.w #$FFFF,(A0)+ ;bsr InitializeProgressiveResultsScreenVRAM ;bsr DisplayProgressiveResultsScreen ;bra RunTests ;Results screen 1 jsr TestFIFOBufferSize bsr DisplayProgressiveResultsScreen jsr TestSeparateFIFOReadWriteBuffer bsr DisplayProgressiveResultsScreen jsr TestDMATransferUsingFIFO bsr DisplayProgressiveResultsScreen jsr TestDMAFillFIFOUsage bsr DisplayProgressiveResultsScreen jsr TestFIFOWriteToInvalidTarget bsr DisplayProgressiveResultsScreen jsr TestReadTarget01100 bsr DisplayProgressiveResultsScreen jsr TestVRAMByteswapping bsr DisplayProgressiveResultsScreen jsr TestCRAMByteswapping bsr DisplayProgressiveResultsScreen jsr TestVSRAMByteswapping bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 2 jsr TestPartialCPWrites bsr DisplayProgressiveResultsScreen jsr TestRegisterWriteBit13Masked bsr DisplayProgressiveResultsScreen ;Note that this test seems to lock up the current version of Regen (0.972) jsr TestMode4RegisterMask bsr DisplayProgressiveResultsScreen jsr TestRegisterWritesAffectCodeRegister bsr DisplayProgressiveResultsScreen ;Note that this test crashes the current version of RetroCopy (0.960) jsr TestCPWritePendingReset bsr DisplayProgressiveResultsScreen jsr TestReadTargetSwitching bsr DisplayProgressiveResultsScreen jsr TestFIFOWaitStates bsr DisplayProgressiveResultsScreen ;jsr TestCodeAndAddressRegisters ;bsr InitializeProgressiveResultsScreenVRAM ;bsr DisplayProgressiveResultsScreen ; jsr TestReadWriteOrder ; bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;##DEBUG## ; bra RunTests ;Results screen 2 jsr TestHVCounterLatch bsr DisplayProgressiveResultsScreen jsr TestBlankingFlags bsr DisplayProgressiveResultsScreen jsr TestDMATransferBusLock bsr DisplayProgressiveResultsScreen ;##TODO## Re-enable this test once we have it working the way we want ;jsr TestVSRAMDataCache ;bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 2 jsr TestDMATransferSourceAddressWrapping bsr DisplayProgressiveResultsScreen jsr TestDMATransferToVRAMWrapping bsr InitializeProgressiveResultsScreenVRAM bsr DisplayProgressiveResultsScreen jsr TestDMATransferToCRAMWrapping bsr DisplayProgressiveResultsScreen jsr TestDMATransferToVSRAMWrapping bsr DisplayProgressiveResultsScreen jsr TestDMATransferLengthRegUpdate bsr DisplayProgressiveResultsScreen jsr TestDMAFillLengthRegUpdate bsr DisplayProgressiveResultsScreen jsr TestDMACopyLengthRegUpdate bsr DisplayProgressiveResultsScreen jsr TestDMATransferSourceRegUpdate bsr DisplayProgressiveResultsScreen jsr TestDMAFillSourceRegUpdate bsr DisplayProgressiveResultsScreen jsr TestDMACopySourceRegUpdate bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 2 jsr TestFIFOFullDMATransfer bsr DisplayProgressiveResultsScreen jsr TestDMAFillDataPortWritesVRAM bsr DisplayProgressiveResultsScreen jsr TestDMAFillDataPortWritesCRAM bsr DisplayProgressiveResultsScreen jsr TestDMAFillDataPortWritesVSRAM bsr DisplayProgressiveResultsScreen jsr TestDMAFillControlPortWrites bsr InitializeProgressiveResultsScreenVRAM bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 2 jsr TestDMABusyFlagDMATransfer bsr DisplayProgressiveResultsScreen jsr TestDMABusyFlagDMAFill bsr DisplayProgressiveResultsScreen jsr TestDMABusyFlagDMACopy bsr DisplayProgressiveResultsScreen jsr TestDMABusyFlagDMAEnableToggleFill ;This is done for the benefit of Kega Fusion, which currently goes a bit crazy and ;does a DMA fill at the start of VRAM in the DMA Enable Toggle Fill test. ;bsr InitializeProgressiveResultsScreenVRAM bsr DisplayProgressiveResultsScreen jsr TestDMABusyFlagDMAEnableToggleCopy bsr DisplayProgressiveResultsScreen jsr TestDMABusyFlagDMADisabledFill bsr DisplayProgressiveResultsScreen jsr TestDMABusyFlagDMADisabledCopy bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 2 move.b #$00,D1 move.b #$06,D2 move.w #0,D3 jsr TestDMATransferToVRAM bsr DisplayProgressiveResultsScreen move.b #$00,D1 move.b #$06,D2 move.w #0,D3 jsr TestDMATransferToCRAM bsr DisplayProgressiveResultsScreen move.b #$00,D1 move.b #$06,D2 move.w #0,D3 jsr TestDMATransferToVSRAM bsr DisplayProgressiveResultsScreen move.b #$01,D1 move.b #$06,D2 move.w #1,D3 jsr TestDMATransferToVRAM bsr DisplayProgressiveResultsScreen move.b #$01,D1 move.b #$06,D2 move.w #1,D3 jsr TestDMATransferToCRAM bsr DisplayProgressiveResultsScreen move.b #$01,D1 move.b #$06,D2 move.w #1,D3 jsr TestDMATransferToVSRAM bsr DisplayProgressiveResultsScreen move.b #$02,D1 move.b #$06,D2 move.w #2,D3 jsr TestDMATransferToVRAM bsr DisplayProgressiveResultsScreen move.b #$02,D1 move.b #$06,D2 move.w #2,D3 jsr TestDMATransferToCRAM bsr DisplayProgressiveResultsScreen move.b #$02,D1 move.b #$06,D2 move.w #2,D3 jsr TestDMATransferToVSRAM move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 2 bsr DisplayProgressiveResultsScreen move.b #$03,D1 move.b #$06,D2 move.w #3,D3 jsr TestDMATransferToVRAM bsr DisplayProgressiveResultsScreen move.b #$03,D1 move.b #$06,D2 move.w #3,D3 jsr TestDMATransferToCRAM bsr DisplayProgressiveResultsScreen move.b #$03,D1 move.b #$06,D2 move.w #3,D3 jsr TestDMATransferToVSRAM bsr DisplayProgressiveResultsScreen move.b #$04,D1 move.b #$06,D2 move.w #4,D3 jsr TestDMATransferToVRAM bsr DisplayProgressiveResultsScreen move.b #$04,D1 move.b #$06,D2 move.w #4,D3 jsr TestDMATransferToCRAM bsr DisplayProgressiveResultsScreen move.b #$04,D1 move.b #$06,D2 move.w #4,D3 jsr TestDMATransferToVSRAM bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 2 move.b #$00,D1 move.b #$06,D2 move.w #5,D3 jsr TestDMATransferToVRAM bsr DisplayProgressiveResultsScreen move.b #$00,D1 move.b #$06,D2 move.w #5,D3 jsr TestDMATransferToCRAM bsr DisplayProgressiveResultsScreen move.b #$00,D1 move.b #$06,D2 move.w #5,D3 jsr TestDMATransferToVSRAM bsr DisplayProgressiveResultsScreen move.b #$01,D1 move.b #$06,D2 move.w #6,D3 jsr TestDMATransferToVRAM bsr DisplayProgressiveResultsScreen move.b #$01,D1 move.b #$06,D2 move.w #6,D3 jsr TestDMATransferToCRAM bsr DisplayProgressiveResultsScreen move.b #$01,D1 move.b #$06,D2 move.w #6,D3 jsr TestDMATransferToVSRAM bsr DisplayProgressiveResultsScreen move.b #$02,D1 move.b #$06,D2 move.w #7,D3 jsr TestDMATransferToVRAM bsr DisplayProgressiveResultsScreen move.b #$02,D1 move.b #$06,D2 move.w #7,D3 jsr TestDMATransferToCRAM bsr DisplayProgressiveResultsScreen move.b #$02,D1 move.b #$06,D2 move.w #7,D3 jsr TestDMATransferToVSRAM bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 2 move.b #$03,D1 move.b #$06,D2 move.w #8,D3 jsr TestDMATransferToVRAM bsr DisplayProgressiveResultsScreen move.b #$03,D1 move.b #$06,D2 move.w #8,D3 jsr TestDMATransferToCRAM bsr DisplayProgressiveResultsScreen move.b #$03,D1 move.b #$06,D2 move.w #8,D3 jsr TestDMATransferToVSRAM bsr DisplayProgressiveResultsScreen move.b #$04,D1 move.b #$06,D2 move.w #9,D3 jsr TestDMATransferToVRAM bsr DisplayProgressiveResultsScreen move.b #$04,D1 move.b #$06,D2 move.w #9,D3 jsr TestDMATransferToCRAM bsr DisplayProgressiveResultsScreen move.b #$04,D1 move.b #$06,D2 move.w #9,D3 jsr TestDMATransferToVSRAM bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;##TODO## Decide what we're going to do with these tests ; ;Results screen 3 ; bsr TestDMAFillToVRAM ; bsr DisplayProgressiveResultsScreen ; ;##TODO## Update these tests below, now that we have new information on how DMA fill ; ;operations work within CRAM and VSRAM. ; bsr TestDMAFillToCRAM ; bsr DisplayProgressiveResultsScreen ; bsr TestDMAFillToVSRAM ; bsr DisplayProgressiveResultsScreen ; move.w #$8000,(A0)+ ; bsr DisplayProgressiveResultsScreen ;Results screen 5 move.b #$00,D3 move.b #$80,D5 move.w #0,D4 jsr TestDMAFillToVRAMV2 bsr DisplayProgressiveResultsScreen move.b #$00,D3 move.b #$80,D5 move.w #0,D4 jsr TestDMAFillToCRAMV2 bsr DisplayProgressiveResultsScreen move.b #$00,D3 move.b #$80,D5 move.w #0,D4 jsr TestDMAFillToVSRAMV2 bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 5 move.b #$01,D3 move.b #$80,D5 move.w #1,D4 jsr TestDMAFillToVRAMV2 bsr DisplayProgressiveResultsScreen move.b #$01,D3 move.b #$80,D5 move.w #1,D4 jsr TestDMAFillToCRAMV2 bsr DisplayProgressiveResultsScreen move.b #$01,D3 move.b #$80,D5 move.w #1,D4 jsr TestDMAFillToVSRAMV2 bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 6 move.b #$02,D3 move.b #$80,D5 move.w #2,D4 jsr TestDMAFillToVRAMV2 bsr DisplayProgressiveResultsScreen move.b #$02,D3 move.b #$80,D5 move.w #2,D4 jsr TestDMAFillToCRAMV2 bsr DisplayProgressiveResultsScreen move.b #$02,D3 move.b #$80,D5 move.w #2,D4 jsr TestDMAFillToVSRAMV2 bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 7 move.b #$04,D3 move.b #$80,D5 move.w #3,D4 jsr TestDMAFillToVRAMV2 bsr DisplayProgressiveResultsScreen move.b #$04,D3 move.b #$80,D5 move.w #3,D4 jsr TestDMAFillToCRAMV2 bsr DisplayProgressiveResultsScreen move.b #$04,D3 move.b #$80,D5 move.w #3,D4 jsr TestDMAFillToVSRAMV2 bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 8 move.b #$00,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #4,D4 jsr TestDMAFillToVRAMV2 bsr DisplayProgressiveResultsScreen move.b #$00,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #4,D4 jsr TestDMAFillToCRAMV2 bsr DisplayProgressiveResultsScreen move.b #$00,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #4,D4 jsr TestDMAFillToVSRAMV2 bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 8 move.b #$01,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #5,D4 jsr TestDMAFillToVRAMV2 bsr DisplayProgressiveResultsScreen move.b #$01,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #5,D4 jsr TestDMAFillToCRAMV2 bsr DisplayProgressiveResultsScreen move.b #$01,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #5,D4 jsr TestDMAFillToVSRAMV2 bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 9 move.b #$02,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #6,D4 jsr TestDMAFillToVRAMV2 bsr DisplayProgressiveResultsScreen move.b #$02,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #6,D4 jsr TestDMAFillToCRAMV2 bsr DisplayProgressiveResultsScreen move.b #$02,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #6,D4 jsr TestDMAFillToVSRAMV2 bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 10 move.b #$04,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #7,D4 jsr TestDMAFillToVRAMV2 bsr DisplayProgressiveResultsScreen move.b #$04,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #7,D4 jsr TestDMAFillToCRAMV2 bsr DisplayProgressiveResultsScreen move.b #$04,D3 ; move.b #$C0,D5 move.b #$80,D5 move.w #7,D4 jsr TestDMAFillToVSRAMV2 bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 2 move.w #$9000,D0 move.w #$8000,D1 move.w #$0003,D2 move.w #0,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0003,D2 move.w #1,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0003,D2 move.w #2,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0003,D2 move.w #3,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen ;Test DMA copy with overlapped source and destination addresses separated by 1 word move.w #$8000,D0 move.w #$8002,D1 move.w #$000A,D2 move.w #4,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen ;Test DMA copy with overlapped source and destination addresses separated by 1 byte move.w #$8000,D0 move.w #$8001,D1 move.w #$000A,D2 move.w #5,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen ;Test the overlapped source and destination with odd source and target addresses move.w #$8001,D0 move.w #$8003,D1 move.w #$000A,D2 move.w #6,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 2 move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #7,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8001,D1 move.w #$0009,D2 move.w #8,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9001,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #9,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9001,D0 move.w #$8001,D1 move.w #$0009,D2 move.w #10,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$000A,D2 move.w #11,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8001,D1 move.w #$000A,D2 move.w #12,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9001,D0 move.w #$8000,D1 move.w #$000A,D2 move.w #13,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9001,D0 move.w #$8001,D1 move.w #$000A,D2 move.w #14,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 3 move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #15,D3 move.l #$000000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #16,D3 move.l #$400000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #17,D3 move.l #$C00000C0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #18,D3 move.l #$000000D0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #19,D3 move.l #$400000D0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #20,D3 move.l #$C00000D0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$8000,(A0)+ bsr DisplayProgressiveResultsScreen ;Results screen 4 move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #21,D3 move.l #$000000E0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #22,D3 move.l #$400000E0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #23,D3 move.l #$C00000E0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #24,D3 move.l #$000000F0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #25,D3 move.l #$400000F0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen move.w #$9000,D0 move.w #$8000,D1 move.w #$0009,D2 move.w #26,D3 move.l #$C00000F0,D4 jsr TestDMACopy bsr DisplayProgressiveResultsScreen ;Terminate the results list move.w #$FFFF,(A0)+ ;Do a final initialize of the display, so we can ensure the results screen displays ;correctly even if an emulator stuffs up badly along the way. bsr InitializeProgressiveResultsScreenVRAM bsr DisplayProgressiveResultsScreen ;##TODO## Build the following tests ;-Add a test to observe the behaviour of the HV counter latch enable setting ;-Expand the FIFOWaitStates test to pick a particular simple wait state test, and run it ;several times over testing a variety of possible VDP register flags which potentially ;disable the display. We want to verify which register settings do allow free VRAM access, ;and which ones don't. ;##FIX## Regen and Kega both behave as if VBLANK is asserted forever when the disable ;display register is set, which would make sense. Perform hardware tests to verify if ;this is the case. I don't think we emulate this currently. ;##NOTE## If CD4 really is set when a partial control port write is made, we should test ;this theory. I suggest attempting a register write while a DMA fill operation is setup ;and waiting for a data port write to trigger it. The register write should switch the ;DMA mode to a DMA copy operation. See if we can successfully trigger a DMA copy in this ;case, and if we can, check both with and without CD4 set on the initial DMA fill setup, ;and see if it works both ways. Also note that it is possible a partial control port ;write clears CD5. Check with a DMA fill first and see if this is the case, by simply ;changing the increment register and see if the DMA in progress bit is still set in the ;status register afterwards. ;-Write tests which verify the correct behaviour of the hv counter and status register. ;Specifically: ; -Verify all HV counter boundaries under all screen modes ; -Verify sprite collision flag is implemented correctly ; -Verify sprite overflow flag is implemented correctly ; -Verify hblank and vblank flags are implemented, and have correct timing with HV counter ; -Verify vint occurrance flag is implemented correctly ; -Verify interrupt behaviour when enabling vint when it has been disabled ; -Verify interrupt behaviour when enabling hint when it has been disabled ; -Test hint behaviour ;-Write tests which examine various aspects of VDP behaviour when any of the 10 undefined bits ;in an upper command word write are set. ;-Since we now know that control port writes don't wait for the FIFO to be empty, perform ;tests on DMA operations, in particular DMA transfers, and try and figure out what order ;DMA operations are performed in relative to pending writes in the FIFO. In particular, test ;DMA transfers. Make the DMA transfer and pending writes target the same memory, and see which ;set of data writes make it in. ;-Construct timing-based tests, which can check if the write slots during active scan are ;implemented correctly. Use the HV counter to synchronize with a line, then move some writes ;through the FIFO, and test when they clear the FIFO. Do this in both H32 and H40 modes. Also ;test VRAM writes, and make sure they consume two access slots. Also check reads from CRAM, ;VRAM, and VSRAM, and confirm they also use access slots, and again, that a VRAM read consumes ;two slots. ;-Perform specific tests on the upper 0x30 bytes of VSRAM. Construct tests to verify there is ;an actual read buffer, by doing sequential reads in hblank or vblank and ensure that our read ;value from, say, 0x20, remains in the buffer. Also test that reads during active scan alternate ;between the first two entries. Also test that during vblank, the second entry is returned. Also ;test that disabling the display prevents the VDP from latching any VSRAM data itself. Also test ;with 2-column vscroll mode, and verify it affects the way the data is read. Also test against ;the undocumented bit in reg 0 which disables all output. Also test if writes to VSRAM overwrite ;the contents of the VSRAM read buffer. ;-Test that control port writes are ignored while DMA copy and fill operations are in progress. ;Note that as part of this, we need to determine if the control port writes actually update the ;cached code and address register data, its just that that data doesn't get applied immediately. ;I suspect this is the case, which should mean, it should be possible to do a long-word control ;port write during a DMA fill operation which sets the upper control word, then perform a partial ;control port write after the DMA fill operation is complete, and have it combined and applied ;with the upper word that was written during the DMA fill operation, not before it began. This ;needs to be tested on hardware. We also need to confirm whether it is possible to do a partial ;control port write during a DMA fill operation, and have the write pending state still set after ;the DMA fill operation completes, so that a following control port write goes to the upper ;command word rather than the lower command word. This all needs to be tested in hardware. It ;may be that all control port writes during a DMA fill get written to the lower command word, ;but don't get applied. It's also possible it's just register writes that don't work during a ;DMA fill operation, but that control port writes do successfully update the target. It's also ;possible all writes go to the lower command word, but that the lower command word is applied, ;in which case a long-word write during a DMA fill would result in the lower command word set to ;the state of the last word that was written. This definitely needs a comprehensive test suite ;written, and to be tested on the hardware. ;-Test that initiating a DMA fill when the FIFO isn't empty will trigger the fill operation to ;trigger immediately, with whatever data is on the FIFO at the time the fill command word state ;is written. ;-Test the result of a data port write during a DMA copy operation ;-Do a test to check if the DMA source and transfer count registers are advanced if CD5 is set ;by a control port write, but DMA is disabled. I suspect it will not, since a DMA fill doesn't ;affect the length or source registers while it is waiting for the fill data to be written to ;the data port. We want to do this test to confirm how and when CD5 is masked when DMA is ;disabled however. ;-Do a test which verifies the bit masking on CRAM and VSRAM. Do two tests to each one, one ;attempting to set all bits and reading it back with an empty FIFO, and one with it attempting ;to clear all bits and reading it back with a full FIFO. ;-Do some comprehensive tests on the boundaries for CRAM and VSRAM, doing manual reads and ;writes to addresses far above the 0x80 byte limit. ;-What happens if we have more than one pending entry in the FIFO when we setup a DMA fill ;operation, such that the fill operation triggers immediately when the command port is written ;to? Does the FIFO still read as empty during the fill operation? Do the writes all get processed? ;Which order do the writes and the fill get processed in? If the fill is processed first, do the ;writes go to the address they would have been written to without the fill, or do they get written ;after the fill? If the writes are processed first, does the fill trigger at the address it was ;targetted at, or does it continue on after the address of the last write? ;-Test for the read behaviour when reading from odd VRAM addresses ;-Write a test which confirms that if the first word of a long-word write to the VDP control ;port initiates a DMA transfer operation, the second word is not processed until after the ;DMA transfer is complete. I would suggest using pre-decrement mode to write to the control ;port followed by the data port for a long-word write, then checking which order the DMA ;transfer and data port write occur in. Our emulator will fail this currently. ;##TODO## Perform hardware analysis on the following: ;-Do more hardware testing around the write which triggers a DMA transfer operation. Try ;and cause the apparent lockup that can occur if the triggering word write doesn't come ;from RAM, and try and determine the cause. ;-Run tests to confirm that the triggering write for a DMA fill or copy operation can safely ;come from ROM without any lockups. ;-Run more tests around the strange behaviour with a DMA fill triggering immediately if we ;don't add a delay before the initiating control port write. ;-Do more tests surrounding the apparent lockup that can occur if a read from a valid target ;follows an attempt to write to that target. We now suspect the issue with the read data being ;combined with the write rather than the FIFO happens because the read is in progress as the ;write is made. Test another read after this phenomenon has occurred and see if we can still ;read at all. I think the answer is no, and we'll get a lockup, no matter how long a read ;follows an invalid write. It only works once if the read is in the process of being pre-cached, ;or possibly has already been pre-cached, when the write occurs. Once we have this all figured ;out, try and get our read write order test working on the hardware, so that we can reliably ;verify this behaviour can actually be seen to occur in an emulator. bra RunTests ;---------------------------------------------------------------------------------------- InitializeProgressiveResultsScreenVRAM: ;Initialize VRAM move.l #$40000000,$C00004 move.w #$7FFF,D0 move.l #VRAMData,A5 InitializeProgressiveResultsScreenVRAMLoop1: move.w (A5)+,$C00000 dbf D0,InitializeProgressiveResultsScreenVRAMLoop1 rts ;---------------------------------------------------------------------------------------- ;In: ; A6.l = Source address of first result record ;Out: ; A6.l = Source address of first result record on next screen to display ;---------------------------------------------------------------------------------------- DisplayProgressiveResultsScreen: move.l A6,A3 move.l A0,A5 move.w #$0000,(A0)+ move.w $FFFF00,D5 move.w $FFFF08,D0 move.w D0,$FFFF10 move.w $FFFF0A,D0 move.w D0,$FFFF12 ;Initialize VRAM ; move.l #$40000000,$C00004 ; move.w #$7FFF,D0 ; move.l #VRAMData,A0 ; DisplayProgressiveResultsScreenVRAMLoop2: ; move.w (A0)+,$C00000 ; dbf D0,DisplayProgressiveResultsScreenVRAMLoop2 ;Initialize CRAM move.l #$C0000000,$C00004 move.w #$3F,D0 move.l #CRAMData,A0 DisplayProgressiveResultsScreenCRAMLoop1: move.w (A0)+,$C00000 dbf D0,DisplayProgressiveResultsScreenCRAMLoop1 ;Initialize VSRAM move.l #$40000010,$C00004 move.w #$3F,D0 DisplayProgressiveResultsScreenVSRAMLoop1: move.w #$0000,$C00000 dbf D0,DisplayProgressiveResultsScreenVSRAMLoop1 bsr ClearScreen ;Header text moveq #((TitleHeaderTextEnd-TitleHeaderText)-1), D0 lea TitleHeaderText,A0 move.w #$A080,D1 bsr WriteTextToVRAM ;Display all the result records that we can fit on this screen move.w #0,D6 DisplayProgressiveResultsScreenEntry: move.w (A3),D7 ;Read the screen line count for the next record beq DisplayProgressiveResultsScreenEntriesFinished ;Abort if this record shows no lines cmp.w #$8000,D7 ;Handle a manual page break marker beq DisplayProgressiveResultsScreenEntriesPageBreak cmp.w #$FFFF,D7 ;Handle a specified end of results list beq DisplayProgressiveResultsScreenEntriesEndOfResults add.w D6,D7 ;Abort if this record has too many lines to fit on the screen cmp.w #21,D7 bgt DisplayProgressiveResultsScreenEntriesNoRoom ;Load this result record from the array move.w D6,D1 ;Set the display row move.w D7,D6 ;Advance the stored display position move.w (A3)+,D7 ;Advance past the screen line count move.w (A3)+,D0 ;Load the text length move.w (A3)+,D3 ;Load the data length move.l A3,A0 ;Set the text pointer move.l A3,A1 ;Calculate the position of the data block add.l D0,A1 move.w (A1)+,D4 ;Load the result data present flag move.l A1,A2 tst.w D4 beq DisplayProgressiveResultsScreenResultDataNotPresent add.l D3,A1 DisplayProgressiveResultsScreenResultDataNotPresent: swap.w D4 move.w D5,D4 ;Load the test number ;Update the result data array pointer to move past this record move.l A1,A3 add.l D3,A3 ;Write the result record bsr WriteResult add.w #1,D5 bra DisplayProgressiveResultsScreenEntry DisplayProgressiveResultsScreenEntriesEndOfResults: move.w (A3)+,D7 ;Advance past the end of results marker move.w $FFFF02,D7 btst #0,D7 beq DisplayProgressiveResultsScreenEntriesNoRoom bclr #0,D7 move.w D7, $FFFF02 bra DisplayProgressiveResultsScreenEntriesNoRoom DisplayProgressiveResultsScreenEntriesPageBreak: move.w (A3)+,D7 ;Advance past the page break marker bra DisplayProgressiveResultsScreenEntriesNoRoom DisplayProgressiveResultsScreenEntriesNoRoom: move.l A3,A6 ;Set the record data pointer for the next screen move.w D5,$FFFF00 move.w $FFFF10,D0 move.w D0,$FFFF08 move.w $FFFF12,D0 move.w D0,$FFFF0A ;Result counter text moveq #((ResultsTextEnd-ResultsText)-1), D0 lea ResultsText,A0 move.w #$AC00,D1 bsr WriteTextToVRAM ;Write the pass test number to VRAM move.w $FFFF08,D0 lsl.w #2,D0 lea ThreeCharNumberArray,A0 lea (A0,D0.w),A0 moveq #2, D0 move.w #$AC00,D1 add.w (ResultsTextPassNumberPos),D1 bsr WriteTextToVRAM ;Write the fail test number to VRAM move.w $FFFF0A,D0 lsl.w #2,D0 lea ThreeCharNumberArray,A0 lea (A0,D0.w),A0 moveq #2, D0 move.w #$AC00,D1 add.w (ResultsTextFailNumberPos),D1 bsr WriteTextToVRAM ;Write the total test number to VRAM move.w $FFFF00,D0 sub.w #1,D0 lsl.w #2,D0 lea ThreeCharNumberArray,A0 lea (A0,D0.w),A0 moveq #2, D0 move.w #$AC00,D1 add.w (ResultsTextTotalNumberPos),D1 bsr WriteTextToVRAM ;Press start button text moveq #((ScreenBottomTextEnd-ScreenBottomText)-1), D0 lea ScreenBottomText,A0 move.w #$AD00,D1 bsr WriteTextToVRAM move.w $FFFF02, D0 btst #0,D0 bne DisplayProgressiveResultsScreenEntriesFinished btst #1,D0 beq DisplayProgressiveResultsScreenWaitForInput move.w $FFFF0A,D0 move.w $FFFF0C,D1 cmp.w D0,D1 beq DisplayProgressiveResultsScreenEntriesFinished DisplayProgressiveResultsScreenWaitForInput: bsr WaitButtonPressAndRelease btst #5, D0 ;Start button pressed bne DisplayProgressiveResultsScreenEntriesFinished btst #4, D0 ;A button pressed bne DisplayProgressiveResultsScreenSkipToResults btst #12, D0 ;B button pressed bne DisplayProgressiveResultsScreenSkipToError bra DisplayProgressiveResultsScreenWaitForInput DisplayProgressiveResultsScreenSkipToResults: move.w $FFFF02, D0 bset #0,D0 move.w D0, $FFFF02 bra DisplayProgressiveResultsScreenEntriesFinished DisplayProgressiveResultsScreenSkipToError: move.w $FFFF02, D0 bset #1,D0 move.w D0, $FFFF02 move.w $FFFF0A,D0 move.w D0,$FFFF0C bra DisplayProgressiveResultsScreenEntriesFinished DisplayProgressiveResultsScreenEntriesFinished: move.l A5,A0 rts ;---------------------------------------------------------------------------------------- ; Writes one of our test results to the screen ;In: ; D0.w = Text string length ; D1.b = Display position ; D3.w = Data length ; D4.lw = Test number ; D4.uw = Result data present flag ; A0.l = Text string address ; A1.l = Result data address ; A2.l = Expected result data address ;Out: ; D2 = Invalid ; D4 = Invalid ; D7 = Invalid ; A0 = Invalid ; A1 = Invalid ;---------------------------------------------------------------------------------------- WriteResult: move.w #$0080,D7 ;Increment between rows in the name table mulu.w D1,D7 add.w #$0180,D7 ;We want three full rows of space at the top of the screen for a header add.w #$A004,D7 ;Start position for layer A name table, with a two column indent ;Add a four column indent to the text position add.w #8,D7 ;Write the text to VRAM sub.w #1,D0 move.w D7,D1 bsr WriteTextToVRAM ;Remove our four column indent from the text position sub.w #8,D7 ;Write the test number to VRAM lsl.w #2,D4 move.w #3,D0 move.w D7,D1 lea TestNumberArray,A0 lea (A0,D4.w),A0 bsr WriteTextToVRAM lsr.w #2,D4 lsr.w #8,D4 lsr.w #8,D4 ;Retrieve the expected result data present flag movea.l A1,A0 swap.w D4 tst.w D4 beq WriteResultExpectedResultDataNotPresent move.l A2,A1 WriteResultExpectedResultDataNotPresent: ;Output all the result data for this test move.w #$0000,D4 WriteResultDataLoop: ;Exit the data write loop if we've written all the data tst.w D3 beq WriteResultDataLoopExit bmi WriteResultDataLoopExit ;Calculate the number of bytes to write in this data line cmp.w #$0020,D3 bge WriteResultFullDataLine move.w D3,D0 sub.w #1,D0 and.w #$001F,D0 move.w #0,D3 bra WriteResultDataLineLengthCalculated WriteResultFullDataLine: sub.w #$0020,D3 move.w #$001F,D0 WriteResultDataLineLengthCalculated: ;Advance to the next display row add.w #$0080,D7 ;Increment between rows in the name table ;Write the data to VRAM move.w D7,D1 bsr WriteDataToVRAM bra WriteResultDataLoop WriteResultDataLoopExit: ;Record whether the data matched the expected result or not tst.w D4 bne WriteDataToVRAMDifferentResult add.w #1,$FFFF10 bra WriteDataToVRAMMatchedResultTestComplete WriteDataToVRAMDifferentResult: add.w #1,$FFFF12 WriteDataToVRAMMatchedResultTestComplete: rts ;---------------------------------------------------------------------------------------- ; Clears the contents of the screen ;Out: ; D0 = Invalid ;---------------------------------------------------------------------------------------- ClearScreen: ;Clear data in VRAM at 0xA000-0xB000 move.l #$60000002,$C00004 move.w #$07FF,D0 ClearScreenLoop: move.w #$0000,$C00000 dbf D0,ClearScreenLoop rts ;---------------------------------------------------------------------------------------- ; Writes text to the display ;In: ; D0.w = Length ; D1.w = VRAM address ; A0.l = Source address ;Out: ; D0 = Invalid ; D1 = Invalid ; D2 = Invalid ; A0 = Invalid ;---------------------------------------------------------------------------------------- WriteTextToVRAM: tst.w D0 beq WriteTextToVRAMExit ;Convert the VRAM address into the form needed for the control port writes move.w D1,D2 lsl.l #8,D2 lsl.l #8,D2 lsr.w #8,D1 lsr.w #6,D1 move.w D1,D2 and.l #$3FFF0003,D2 ;Combine the VRAM write mask with the build address or.l #$40000000,D2 ;Write the request to the control port move.l D2,$C00004 ;Transfer the data to the VRAM move.w #$0000,D1 WriteTextToVRAMLoop: move.b (A0)+,D1 move.w D1,$C00000 dbf D0,WriteTextToVRAMLoop WriteTextToVRAMExit: rts ;---------------------------------------------------------------------------------------- ; Writes hex data to the display ;In: ; D0.w = Length ; D1.w = VRAM address ; A0.l = Source address ; A1.l = Compare data address ;Out: ; D4.w = Data different to expected data (not initialized, can be examined after successive calls) ; D0 = Invalid ; D1 = Invalid ; D2 = Invalid ; A0 = Invalid ; A1 = Invalid ;---------------------------------------------------------------------------------------- WriteDataToVRAM: ;Convert the VRAM address into the form needed for the control port writes move.w D1,D2 lsl.l #8,D2 lsl.l #8,D2 lsr.w #8,D1 lsr.w #6,D1 move.w D1,D2 and.l #$3FFF0003,D2 ;Combine the VRAM write mask with the build address or.l #$40000000,D2 ;Write the request to the control port move.l D2,$C00004 ;Transfer the data to VRAM WriteDataToVRAMLoop: move.w #$0100,D1 ;No expected result data cmp.l A0,A1 bne WriteDataToVRAMLoopPerformCompare move.b (A0)+,D2 cmp.b (A1)+,D2 bra WriteDataToVRAMLoopWriteDataValue WriteDataToVRAMLoopPerformCompare: move.b (A0)+,D2 cmp.b (A1)+,D2 beq WriteDataToVRAMLoopCompareSucceeded move.w #$4100,D1 ;Compare failed move.w #$0001,D4 bra WriteDataToVRAMLoopWriteDataValue WriteDataToVRAMLoopCompareSucceeded: move.w #$2100,D1 ;Compare succeeded WriteDataToVRAMLoopWriteDataValue: move.b D2,D1 move.w D1,$C00000 dbf D0,WriteDataToVRAMLoop rts ;---------------------------------------------------------------------------------------- ; Returns D0 indicating which button was pressed, with the state: '00CBRLDU 00SA0000' ;---------------------------------------------------------------------------------------- WaitButtonPressAndRelease: move.l D1, -(A7) WaitButtonPressAndReleaseWaitForNotPressed: bsr GetButtonStateCP1 tst.w D0 bne WaitButtonPressAndReleaseWaitForNotPressed WaitButtonPressAndReleaseWaitForPress: bsr GetButtonStateCP1 tst.w D0 beq WaitButtonPressAndReleaseWaitForPress move.w D0,D1 ;Add a slight delay loop now that a button press has been registered. This is ;necessary in order for this test to work properly on the real hardware, as when the ;button is being pressed on a real controller, it often flickers between pressed and ;not pressed very rapidly for a few milliseconds. This delay loop should give the ;button time to be fully depressed before checking for release. move.w #$1000,D0 WaitButtonPressAndReleaseWaitLoop: nop nop nop nop nop dbf D0,WaitButtonPressAndReleaseWaitLoop WaitButtonPressAndReleaseWaitForRelease: bsr GetButtonStateCP1 tst.w D0 bne WaitButtonPressAndReleaseWaitForRelease move.w D1,D0 move.l (A7)+, D1 rts ;---------------------------------------------------------------------------------------- ; Returns D0 indicating pressed buttons, with the state: '00CBRLDU 00SA0000' ;---------------------------------------------------------------------------------------- GetButtonStateCP1: move.b #$40, $A10009 ;Set TH line to output, all others to input nop nop nop nop move.b #$40, $A10003 ;Set TH line to output, all others to input. nop ;Add some delay to allow for TH latency nop nop nop move.b $A10003, D0 lsl.w #8, D0 move.b #$00, $A10003 ;Negate the TH line, to switch the buttons which are visible. nop ;Add some delay to allow for TH latency nop nop nop move.b $A10003, D0 eori.w #$FFFF, D0 andi.w #$3F30, D0 rts ;---------------------------------------------------------------------------------------- ;Waits for the start button to be pressed and released again ;Out: ; D0 = Invalid ;---------------------------------------------------------------------------------------- WaitForStart: move.b #$40, $A10009 ;Set TH line to output, all others to input move.b #0, $A10003 ;Negate the TH line, to make the start button state visible ;Add some delay to allow for TH latency nop nop nop nop ;Ensure the start button is currently released WaitForStartButtonRelease: btst.b #5, $A10003 beq WaitForStartButtonRelease ;Wait for the start button to be pressed WaitForStartButtonPress: btst.b #5, $A10003 bne WaitForStartButtonPress ;Add a slight delay loop now that a button press has been registered. This is ;necessary in order for this test to work properly on the real hardware, as when the ;button is being pressed on a real controller, it often flickers between pressed and ;not pressed very rapidly for a few milliseconds. This delay loop should give the ;button time to be fully depressed before checking for release. move.w #$1000,D0 WaitForStartLoop: nop nop nop nop nop dbf D0,WaitForStartLoop WaitForStartButtonRelease1: btst.b #5, $A10003 beq WaitForStartButtonRelease1 rts ;---------------------------------------------------------------------------------------- ; Include our test subroutines ;---------------------------------------------------------------------------------------- include "TestFIFOBufferSize.asm" include "TestSeparateFIFOReadWriteBuffer.asm" include "TestCodeAndAddressRegisters.asm" include "TestRegisterWriteBit13Masked.asm" include "TestMode4RegisterMask.asm" include "TestRegisterWritesAffectCodeRegister.asm" include "TestHVCounterLatch.asm" include "TestBlankingFlags.asm" include "TestDMAFillDataPortWritesVRAM.asm" include "TestDMAFillDataPortWritesCRAM.asm" include "TestDMAFillDataPortWritesVSRAM.asm" include "TestDMAFillControlPortWrites.asm" include "TestDMATransferToVRAM.asm" include "TestDMATransferToCRAM.asm" include "TestDMATransferToVSRAM.asm" include "TestDMATransferUsingFIFO.asm" include "TestDMATransferSourceAddressWrapping.asm" include "TestDMATransferToVRAMWrapping.asm" include "TestDMATransferToCRAMWrapping.asm" include "TestDMATransferToVSRAMWrapping.asm" include "TestDMATransferLengthRegUpdate.asm" include "TestDMATransferBusLock.asm" include "TestVSRAMDataCache.asm" include "TestDMAFillLengthRegUpdate.asm" include "TestDMACopyLengthRegUpdate.asm" include "TestDMATransferSourceRegUpdate.asm" include "TestDMAFillSourceRegUpdate.asm" include "TestDMACopySourceRegUpdate.asm" include "TestDMABusyFlagDMATransfer.asm" include "TestDMABusyFlagDMAFill.asm" include "TestDMABusyFlagDMACopy.asm" include "TestDMABusyFlagDMADisabledFill.asm" include "TestDMABusyFlagDMADisabledCopy.asm" include "TestDMABusyFlagDMAEnableToggleFill.asm" include "TestDMABusyFlagDMAEnableToggleCopy.asm" include "TestFIFOWriteToInvalidTarget.asm" include "TestFIFOFullDMATransfer.asm" include "TestReadTargetSwitching.asm" include "TestVRAMByteswapping.asm" include "TestCRAMByteswapping.asm" include "TestVSRAMByteswapping.asm" include "TestDMAFillFIFOUsage.asm" include "TestReadTarget01100.asm" include "TestDMACopy.asm" include "TestFIFOWaitStates.asm" include "TestPartialCPWrites.asm" include "TestCPWritePendingReset.asm" include "TestReadWriteOrder.asm" include "TestDMAFillToVRAM.asm" include "TestDMAFillToCRAM.asm" include "TestDMAFillToVSRAM.asm" include "TestDMAFillToVRAMV2.asm" include "TestDMAFillToCRAMV2.asm" include "TestDMAFillToVSRAMV2.asm" include "TestDMACopyToCRAMV2.asm" include "TestDMACopyToVSRAMV2.asm" ;---------------------------------------------------------------------------------------- CRAMData: incbin "cram.bin" VRAMData: incbin "vram.bin" ;---------------------------------------------------------------------------------------- TitleHeaderText: dc.b ' VDP Port Access Test ROM (11-12-19) ' TitleHeaderTextEnd: ResultsTextPassNumberPos: dc.w $0026 ResultsTextFailNumberPos: dc.w $002E ResultsTextTotalNumberPos: dc.w $0036 ResultsText: ; 02468ACE02468ACE02468ACE02468ACE02468ACE dc.b ' Results: ( 0/ 0/ 0) ' ResultsTextEnd: ScreenBottomText: dc.b ' Start=NextPage,A=Results,B=NextFail ' ScreenBottomTextEnd: ThreeCharNumberArray: dc.b ' 0 ' dc.b ' 1 ' dc.b ' 2 ' dc.b ' 3 ' dc.b ' 4 ' dc.b ' 5 ' dc.b ' 6 ' dc.b ' 7 ' dc.b ' 8 ' dc.b ' 9 ' dc.b ' 10 ' dc.b ' 11 ' dc.b ' 12 ' dc.b ' 13 ' dc.b ' 14 ' dc.b ' 15 ' dc.b ' 16 ' dc.b ' 17 ' dc.b ' 18 ' dc.b ' 19 ' dc.b ' 20 ' dc.b ' 21 ' dc.b ' 22 ' dc.b ' 23 ' dc.b ' 24 ' dc.b ' 25 ' dc.b ' 26 ' dc.b ' 27 ' dc.b ' 28 ' dc.b ' 29 ' dc.b ' 30 ' dc.b ' 31 ' dc.b ' 32 ' dc.b ' 33 ' dc.b ' 34 ' dc.b ' 35 ' dc.b ' 36 ' dc.b ' 37 ' dc.b ' 38 ' dc.b ' 39 ' dc.b ' 40 ' dc.b ' 41 ' dc.b ' 42 ' dc.b ' 43 ' dc.b ' 44 ' dc.b ' 45 ' dc.b ' 46 ' dc.b ' 47 ' dc.b ' 48 ' dc.b ' 49 ' dc.b ' 50 ' dc.b ' 51 ' dc.b ' 52 ' dc.b ' 53 ' dc.b ' 54 ' dc.b ' 55 ' dc.b ' 56 ' dc.b ' 57 ' dc.b ' 58 ' dc.b ' 59 ' dc.b ' 60 ' dc.b ' 61 ' dc.b ' 62 ' dc.b ' 63 ' dc.b ' 64 ' dc.b ' 65 ' dc.b ' 66 ' dc.b ' 67 ' dc.b ' 68 ' dc.b ' 69 ' dc.b ' 70 ' dc.b ' 71 ' dc.b ' 72 ' dc.b ' 73 ' dc.b ' 74 ' dc.b ' 75 ' dc.b ' 76 ' dc.b ' 77 ' dc.b ' 78 ' dc.b ' 79 ' dc.b ' 80 ' dc.b ' 81 ' dc.b ' 82 ' dc.b ' 83 ' dc.b ' 84 ' dc.b ' 85 ' dc.b ' 86 ' dc.b ' 87 ' dc.b ' 88 ' dc.b ' 89 ' dc.b ' 90 ' dc.b ' 91 ' dc.b ' 92 ' dc.b ' 93 ' dc.b ' 94 ' dc.b ' 95 ' dc.b ' 96 ' dc.b ' 97 ' dc.b ' 98 ' dc.b ' 99 ' dc.b '100 ' dc.b '101 ' dc.b '102 ' dc.b '103 ' dc.b '104 ' dc.b '105 ' dc.b '106 ' dc.b '107 ' dc.b '108 ' dc.b '109 ' dc.b '110 ' dc.b '111 ' dc.b '112 ' dc.b '113 ' dc.b '114 ' dc.b '115 ' dc.b '116 ' dc.b '117 ' dc.b '118 ' dc.b '119 ' dc.b '120 ' dc.b '121 ' dc.b '122 ' dc.b '123 ' dc.b '124 ' dc.b '125 ' dc.b '126 ' dc.b '127 ' dc.b '128 ' dc.b '129 ' dc.b '130 ' dc.b '131 ' dc.b '132 ' dc.b '133 ' dc.b '134 ' dc.b '135 ' dc.b '136 ' dc.b '137 ' dc.b '138 ' dc.b '139 ' dc.b '140 ' dc.b '141 ' dc.b '142 ' dc.b '143 ' dc.b '144 ' dc.b '145 ' dc.b '146 ' dc.b '147 ' dc.b '148 ' dc.b '149 ' dc.b '150 ' dc.b '151 ' dc.b '152 ' dc.b '153 ' dc.b '154 ' dc.b '155 ' dc.b '156 ' dc.b '157 ' dc.b '158 ' dc.b '159 ' dc.b '160 ' dc.b '161 ' dc.b '162 ' dc.b '163 ' dc.b '164 ' dc.b '165 ' dc.b '166 ' dc.b '167 ' dc.b '168 ' dc.b '169 ' dc.b '170 ' dc.b '171 ' dc.b '172 ' dc.b '173 ' dc.b '174 ' dc.b '175 ' dc.b '176 ' dc.b '177 ' dc.b '178 ' dc.b '179 ' dc.b '180 ' dc.b '181 ' dc.b '182 ' dc.b '183 ' dc.b '184 ' dc.b '185 ' dc.b '186 ' dc.b '187 ' dc.b '188 ' dc.b '189 ' dc.b '190 ' dc.b '191 ' dc.b '192 ' dc.b '193 ' dc.b '194 ' dc.b '195 ' dc.b '196 ' dc.b '197 ' dc.b '198 ' dc.b '199 ' dc.b '200 ' TestNumberArray: dc.b ' 0. ' dc.b ' 1. ' dc.b ' 2. ' dc.b ' 3. ' dc.b ' 4. ' dc.b ' 5. ' dc.b ' 6. ' dc.b ' 7. ' dc.b ' 8. ' dc.b ' 9. ' dc.b '10. ' dc.b '11. ' dc.b '12. ' dc.b '13. ' dc.b '14. ' dc.b '15. ' dc.b '16. ' dc.b '17. ' dc.b '18. ' dc.b '19. ' dc.b '20. ' dc.b '21. ' dc.b '22. ' dc.b '23. ' dc.b '24. ' dc.b '25. ' dc.b '26. ' dc.b '27. ' dc.b '28. ' dc.b '29. ' dc.b '30. ' dc.b '31. ' dc.b '32. ' dc.b '33. ' dc.b '34. ' dc.b '35. ' dc.b '36. ' dc.b '37. ' dc.b '38. ' dc.b '39. ' dc.b '40. ' dc.b '41. ' dc.b '42. ' dc.b '43. ' dc.b '44. ' dc.b '45. ' dc.b '46. ' dc.b '47. ' dc.b '48. ' dc.b '49. ' dc.b '50. ' dc.b '51. ' dc.b '52. ' dc.b '53. ' dc.b '54. ' dc.b '55. ' dc.b '56. ' dc.b '57. ' dc.b '58. ' dc.b '59. ' dc.b '60. ' dc.b '61. ' dc.b '62. ' dc.b '63. ' dc.b '64. ' dc.b '65. ' dc.b '66. ' dc.b '67. ' dc.b '68. ' dc.b '69. ' dc.b '70. ' dc.b '71. ' dc.b '72. ' dc.b '73. ' dc.b '74. ' dc.b '75. ' dc.b '76. ' dc.b '77. ' dc.b '78. ' dc.b '79. ' dc.b '80. ' dc.b '81. ' dc.b '82. ' dc.b '83. ' dc.b '84. ' dc.b '85. ' dc.b '86. ' dc.b '87. ' dc.b '88. ' dc.b '89. ' dc.b '90. ' dc.b '91. ' dc.b '92. ' dc.b '93. ' dc.b '94. ' dc.b '95. ' dc.b '96. ' dc.b '97. ' dc.b '98. ' dc.b '99. ' dc.b '100.' dc.b '101.' dc.b '102.' dc.b '103.' dc.b '104.' dc.b '105.' dc.b '106.' dc.b '107.' dc.b '108.' dc.b '109.' dc.b '110.' dc.b '111.' dc.b '112.' dc.b '113.' dc.b '114.' dc.b '115.' dc.b '116.' dc.b '117.' dc.b '118.' dc.b '119.' dc.b '120.' dc.b '121.' dc.b '122.' dc.b '123.' dc.b '124.' dc.b '125.' dc.b '126.' dc.b '127.' dc.b '128.' dc.b '129.' dc.b '130.' dc.b '131.' dc.b '132.' dc.b '133.' dc.b '134.' dc.b '135.' dc.b '136.' dc.b '137.' dc.b '138.' dc.b '139.' dc.b '140.' dc.b '141.' dc.b '142.' dc.b '143.' dc.b '144.' dc.b '145.' dc.b '146.' dc.b '147.' dc.b '148.' dc.b '149.' dc.b '150.' dc.b '151.' dc.b '152.' dc.b '153.' dc.b '154.' dc.b '155.' dc.b '156.' dc.b '157.' dc.b '158.' dc.b '159.' dc.b '160.' dc.b '161.' dc.b '162.' dc.b '163.' dc.b '164.' dc.b '165.' dc.b '166.' dc.b '167.' dc.b '168.' dc.b '169.' dc.b '170.' dc.b '171.' dc.b '172.' dc.b '173.' dc.b '174.' dc.b '175.' dc.b '176.' dc.b '177.' dc.b '178.' dc.b '179.' dc.b '180.' dc.b '181.' dc.b '182.' dc.b '183.' dc.b '184.' dc.b '185.' dc.b '186.' dc.b '187.' dc.b '188.' dc.b '189.' dc.b '190.' dc.b '191.' dc.b '192.' dc.b '193.' dc.b '194.' dc.b '195.' dc.b '196.' dc.b '197.' dc.b '198.' dc.b '199.' dc.b '200.' ;---------------------------------------------------------------------------------------- ;Align the following data to 0x20000 byte boundary dcb.b $20000-(*%$20000),$00 VRAMTestDataBlockAligned: incbin "VRAMTestDataBlock.bin" VRAMTestDataBlockOverflowRegion: dcb.l $4000,$DEADC0DE ;---------------------------------------------------------------------------------------- ;Pad the file to a 0x20000 byte boundary dcb.b $20000-(*%$20000),$FF