mirror of
https://github.com/digarok/MiniMemoryTester.git
synced 2024-06-20 12:29:28 +00:00
test routines are starting to work again
This commit is contained in:
parent
b99f751c32
commit
30e5493343
197
src/mmt.s
197
src/mmt.s
|
@ -30,7 +30,7 @@ Init
|
||||||
jsr Menu_InitMenu
|
jsr Menu_InitMenu
|
||||||
|
|
||||||
*
|
*
|
||||||
* Main Menu loop begin
|
* Main Menu loop begin2
|
||||||
*
|
*
|
||||||
Main
|
Main
|
||||||
:menuLoop jsr DrawMenuBackground
|
:menuLoop jsr DrawMenuBackground
|
||||||
|
@ -162,6 +162,7 @@ TestMasterLoop clc
|
||||||
jsr TestPrintErrors ;just to get it drawn
|
jsr TestPrintErrors ;just to get it drawn
|
||||||
:NextBank jsr TestSetState ;sets read/write/both
|
:NextBank jsr TestSetState ;sets read/write/both
|
||||||
jsr TestGetNextBank ;sets initial bank when CurBank = 0
|
jsr TestGetNextBank ;sets initial bank when CurBank = 0
|
||||||
|
jsr TestPatchBanks ;patches code for whatever CurBank is set to
|
||||||
jsr TestPastFinalBank
|
jsr TestPastFinalBank
|
||||||
bcs :NextIteration
|
bcs :NextIteration
|
||||||
|
|
||||||
|
@ -274,6 +275,101 @@ TestPrintErrors PushAll
|
||||||
PopAll
|
PopAll
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
TestLogError PushAll
|
||||||
|
php
|
||||||
|
sta _stash+12 ;8 or 16 bit? YES!
|
||||||
|
sty _stash+10 ;ReadRepeat
|
||||||
|
stx _stash+2 ;address - legacy
|
||||||
|
rep #$30 ;need longA
|
||||||
|
lda TestReadRepeat
|
||||||
|
inc ;n++
|
||||||
|
sec
|
||||||
|
sbc _stash+10 ;-Y
|
||||||
|
sta _stash+10 ;ReadRepeat+1-(ReadRepeat-TestPass)=TestPass
|
||||||
|
sep #$30
|
||||||
|
inc _testErrors
|
||||||
|
bne :noRoll
|
||||||
|
inc _testErrors+1
|
||||||
|
:noRoll ;jsr TestPrintErrors
|
||||||
|
|
||||||
|
jsr WinConsole
|
||||||
|
LOG Mesg_F1 ;Error Count
|
||||||
|
ldx #_testErrors
|
||||||
|
ldy #>_testErrors
|
||||||
|
jsr PrintInt
|
||||||
|
|
||||||
|
PRINTSTRING Mesg_F2 ;Test Pass
|
||||||
|
ldx #_testIteration
|
||||||
|
ldy #>_testIteration
|
||||||
|
jsr PrintInt
|
||||||
|
|
||||||
|
PRINTSTRING Mesg_F3 ;Read Pass
|
||||||
|
ldx #_stash+10
|
||||||
|
ldy #>_stash+10
|
||||||
|
jsr PrintInt
|
||||||
|
|
||||||
|
PRINTSTRING Mesg_F4 ;Address
|
||||||
|
lda CurBank
|
||||||
|
jsr PRBYTE
|
||||||
|
lda #"/"
|
||||||
|
jsr COUT
|
||||||
|
lda _stash+3
|
||||||
|
ldx _stash+2
|
||||||
|
jsr PRNTAX
|
||||||
|
|
||||||
|
|
||||||
|
PRINTSTRING Mesg_F5 ;Wrote
|
||||||
|
lda TestSize16Bit
|
||||||
|
bne :16bitwrote
|
||||||
|
:8bitwrote lda HexPattern
|
||||||
|
jsr PRBYTE
|
||||||
|
bra :printread
|
||||||
|
:16bitwrote lda HexPattern
|
||||||
|
ldx HexPattern+1
|
||||||
|
jsr PRNTAX
|
||||||
|
:printread PRINTSTRING Mesg_F6 ;Read
|
||||||
|
lda TestSize16Bit
|
||||||
|
bne :16bitread
|
||||||
|
:8bitread lda _stash+12
|
||||||
|
jsr PRBYTE
|
||||||
|
bra :nextline
|
||||||
|
:16bitread lda _stash+12
|
||||||
|
ldx _stash+12+1
|
||||||
|
jsr PRNTAX
|
||||||
|
|
||||||
|
|
||||||
|
:nextline bra :skipit
|
||||||
|
LOG Mesg_E3
|
||||||
|
lda _stash+1
|
||||||
|
jsr PRBYTE
|
||||||
|
lda #" "
|
||||||
|
jsr COUT
|
||||||
|
lda #"%"
|
||||||
|
jsr COUT
|
||||||
|
lda _stash+1
|
||||||
|
jsr PRBIN
|
||||||
|
PRINTSTRING Mesg_E4
|
||||||
|
lda _stash
|
||||||
|
jsr PRBYTE
|
||||||
|
lda #" "
|
||||||
|
jsr COUT
|
||||||
|
lda #"%"
|
||||||
|
jsr COUT
|
||||||
|
lda _stash
|
||||||
|
jsr PRBIN
|
||||||
|
:skipit
|
||||||
|
jsr WinFull
|
||||||
|
clc
|
||||||
|
xce
|
||||||
|
rep $10 ;take me out? but make sure to mx%
|
||||||
|
plp ;M can be 0 or 1 depending on test size
|
||||||
|
PopAll
|
||||||
|
rts
|
||||||
|
|
||||||
|
*Mesg_Error0 asc "Error: Bad Read Pass 0000 Location: 00/1234"
|
||||||
|
*Mesg_Error0 asc "Wrote: $00 %12345678 Read: $00 %12345678"
|
||||||
|
|
||||||
|
|
||||||
TestForceUpdateStatus PushAll
|
TestForceUpdateStatus PushAll
|
||||||
stx _stash
|
stx _stash
|
||||||
bra :print
|
bra :print
|
||||||
|
@ -298,7 +394,69 @@ TestUpdateStatus PushAll
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TestMemoryLocation rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
TestMemoryLocation
|
||||||
|
lda _testState
|
||||||
|
cmp #TESTSTATE_BOTH
|
||||||
|
bne TestMemoryLocationTwoPass
|
||||||
|
|
||||||
|
lda TestSize16Bit
|
||||||
|
bne :test16
|
||||||
|
:test8 lda TestType
|
||||||
|
cmp #TT_BITPATTERN
|
||||||
|
bne :UNHANDLED
|
||||||
|
|
||||||
|
ldy TestWriteRepeat
|
||||||
|
:test8bitpattern lda HexPattern
|
||||||
|
stal $020000,x
|
||||||
|
BANKPATCH01 = *-1
|
||||||
|
lda TestAdjacentWrite
|
||||||
|
beq :noAdjacentWrite
|
||||||
|
stal $02FFFF,x ;-1
|
||||||
|
BANKPATCH02 = *-1
|
||||||
|
stal $020001,x ;+1
|
||||||
|
BANKPATCH03 = *-1
|
||||||
|
|
||||||
|
:noAdjacentWrite
|
||||||
|
dey
|
||||||
|
bne :test8bitpattern
|
||||||
|
|
||||||
|
lda $C000
|
||||||
|
bpl _nokey
|
||||||
|
sta $C010
|
||||||
|
cmp #"c"
|
||||||
|
bne _nokey
|
||||||
|
lda #$55
|
||||||
|
stal $020000,x
|
||||||
|
BANKPATCHXX = *-1
|
||||||
|
_nokey nop
|
||||||
|
|
||||||
|
|
||||||
|
ldy TestReadRepeat
|
||||||
|
:test8bitpatternrdlp ldal $020000,x
|
||||||
|
BANKPATCH04 = *-1
|
||||||
|
cmp HexPattern
|
||||||
|
bne :READERR8BP
|
||||||
|
dey
|
||||||
|
bne :test8bitpatternrdlp
|
||||||
|
rts
|
||||||
|
:READERR8BP jsr TestLogError
|
||||||
|
:test16
|
||||||
|
:UNHANDLED
|
||||||
|
rts
|
||||||
|
|
||||||
|
TestMemoryLocationTwoPass rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TestAdvanceLocation lda TestDirection
|
TestAdvanceLocation lda TestDirection
|
||||||
bne :dn
|
bne :dn
|
||||||
:up lda TestSize16Bit
|
:up lda TestSize16Bit
|
||||||
|
@ -375,7 +533,13 @@ TestGetNextBank lda TestTwoPass ;see if we are
|
||||||
:notInitialBank2 dec CurBank
|
:notInitialBank2 dec CurBank
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
TestPatchBanks lda CurBank
|
||||||
|
sta BANKPATCH01
|
||||||
|
sta BANKPATCH02
|
||||||
|
sta BANKPATCH03
|
||||||
|
sta BANKPATCH04
|
||||||
|
sta BANKPATCHXX
|
||||||
|
rts
|
||||||
mx %11
|
mx %11
|
||||||
|
|
||||||
|
|
||||||
|
@ -540,6 +704,14 @@ Mesg_E3 asc "Wrote: $",00
|
||||||
Mesg_E4 asc " ",$1B,'SU',$18," Read: $",00
|
Mesg_E4 asc " ",$1B,'SU',$18," Read: $",00
|
||||||
Mesg_Arrow asc $1B,'SU',$18,00
|
Mesg_Arrow asc $1B,'SU',$18,00
|
||||||
|
|
||||||
|
Mesg_F1 asc "ERR #",00
|
||||||
|
Mesg_F2 asc " Pass #",00
|
||||||
|
Mesg_F3 asc " Rep #",00
|
||||||
|
Mesg_F4 asc " Addr. $",00
|
||||||
|
Mesg_F5 asc " Wrote $",00
|
||||||
|
Mesg_F6 asc " ",$1B,'U',$18," Read $",00
|
||||||
|
|
||||||
|
|
||||||
mx %10 ;i think?
|
mx %10 ;i think?
|
||||||
* called with short M, long X
|
* called with short M, long X
|
||||||
PrintTestError
|
PrintTestError
|
||||||
|
@ -750,13 +922,18 @@ _randomTrashByte db 0
|
||||||
* 00 - Byte : Selected Value
|
* 00 - Byte : Selected Value
|
||||||
* 01 - Byte : Number of values
|
* 01 - Byte : Number of values
|
||||||
* 02... - Words : Table of Addresses of possible values
|
* 02... - Words : Table of Addresses of possible values
|
||||||
TestTypeTbl db 00 ; actual CONST val
|
TestTypeTbl
|
||||||
|
TestType db 00 ; actual CONST val
|
||||||
db 04 ; number of possible values
|
db 04 ; number of possible values
|
||||||
da _TestType_0,_TestType_1,_TestType_2,_TestType_3,00,00
|
da TestType_BitPattern,TestType_BitWalk1,TestType_BitWalk0,TestType_Random,00,00
|
||||||
_TestType_0 asc "bit pattern",$00
|
TestType_BitPattern asc "bit pattern",$00
|
||||||
_TestType_1 asc " bit walk 1",$00
|
TestType_BitWalk1 asc " bit walk 1",$00
|
||||||
_TestType_2 asc " bit walk 0",$00
|
TestType_BitWalk0 asc " bit walk 0",$00
|
||||||
_TestType_3 asc " random ",$00
|
TestType_Random asc " random ",$00
|
||||||
|
TT_BITPATTERN = 0
|
||||||
|
TT_BITWALK1 = 1
|
||||||
|
TT_BITWALK2 = 2
|
||||||
|
TT_RANDOM = 3
|
||||||
|
|
||||||
TestDirectionTbl db 0
|
TestDirectionTbl db 0
|
||||||
db 2
|
db 2
|
||||||
|
@ -1121,5 +1298,3 @@ BankExpansionHighest ds 1
|
||||||
BankMap ds 256 ;page-align maps just to make them easier to see
|
BankMap ds 256 ;page-align maps just to make them easier to see
|
||||||
_stash ds 256
|
_stash ds 256
|
||||||
ds \
|
ds \
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user