two pass 8 bit random working

This commit is contained in:
Dagen Brock 2015-10-13 21:53:13 -05:00
parent e20d477192
commit da20f80628

View File

@ -195,6 +195,7 @@ KeyHandled
bcc :testComplete bcc :testComplete
:infiniteIterations lda TestTwoPass :infiniteIterations lda TestTwoPass
beq :notwopass beq :notwopass
stz _testState ;hack to reset for two pass, will switch it back to write when it sees zero. i hope. (update: WORKS! BOOM!) stz _testState ;hack to reset for two pass, will switch it back to write when it sees zero. i hope. (update: WORKS! BOOM!)
:notwopass jmp TestMasterLoop :notwopass jmp TestMasterLoop
@ -548,13 +549,21 @@ TestMemoryLocationTwoPass
mx %10 mx %10
Test_8BitWalk1TP Test_8BitWalk1TP
Test_8BitWalk0TP Test_8BitWalk0TP
Test_8RandomTP
Test_16RandomTP Test_16RandomTP
Test_16BitWalk1TP Test_16BitWalk1TP
Test_16BitWalk0TP Test_16BitWalk0TP
Test_16BitPatternTP Test_16BitPatternTP
rts rts
Test_8RandomTP jsr GetRandByte ;should match with seeds?
sta HexPattern
jmp Test_8BitPatternTP
TwoPassSeed dw #$0000 ;we store the pass at the beginning of each write round, and restore it for the read round
Test_8BitPatternTP lda _testState Test_8BitPatternTP lda _testState
cmp #TESTSTATE_READ cmp #TESTSTATE_READ
beq :read beq :read
@ -569,9 +578,6 @@ BANKPATCH10 = *-1
rts rts
:read :read
ldy TestReadRepeat ldy TestReadRepeat
_readloop3 ldal $020000,x _readloop3 ldal $020000,x
@ -913,13 +919,39 @@ TestPastFinalBank lda TestDirection
rts rts
TestTwoPassRestoreSeed
lda TwoPassSeed+1 ;if we are on a read pass, restore our seed
sta _seed16a
lda TwoPassSeed
sta _seed16b
sta _seed
rts
TestTwoPassMakeSeed
;jsr GetRandByte ;update our two-pass seed (even if we aren't in random mode. too lazy to check.)
sta TwoPassSeed ;
sta _seed16b
sta _seed
;jsr GetRandByte ;
sta TwoPassSeed+1 ;
sta _seed16a
rts
TestGetNextBank lda TestTwoPass ;see if we are doing two-passes of the bank TestGetNextBank lda TestTwoPass ;see if we are doing two-passes of the bank
beq :notTwoPass ;nope, no additional logic needed beq :notTwoPass ;nope, no additional logic needed
lda _testState lda _testState
cmp #TESTSTATE_READ ;don't change bank on read pass of two-pass cmp #TESTSTATE_READ ;don't change bank on read pass of two-pass
bne :twoPassNextBank bne :twoPassNextBank
jsr TestTwoPassRestoreSeed
rts rts
:twoPassNextBank
:twoPassNextBank jsr TestTwoPassMakeSeed
:notTwoPass lda TestDirection :notTwoPass lda TestDirection
bne :descending bne :descending
:ascending lda CurBank :ascending lda CurBank
@ -1228,11 +1260,13 @@ GetRandByte16 PushAll
rts rts
_seed16a db 03 _seed16a db 03
_seed16b db 40 _seed16b db 40
mx %11 mx %11
GetRandByte ; USE ONLY WITH CORRUPTOR GetRandByte ; USE ONLY WITH CORRUPTOR
lda _seed lda _seed
beq :doEor beq :doEor