add byte order hex entry for 6502 addressing

This commit is contained in:
Dagen Brock 2015-10-12 21:22:32 -05:00
parent 770d666d28
commit 5f1909a25b
3 changed files with 895 additions and 777 deletions

1543
src/menu.s

File diff suppressed because it is too large Load Diff

View File

@ -22,12 +22,12 @@ CheckKey lda KEY
:noKey clc :noKey clc
rts rts
ToLower cmp #"Z" ToLower cmp #"Z"
bcs :notUpper bcs :notUpper
cmp #"A" cmp #"A"
bcc :notUpper bcc :notUpper
clc clc
adc #$20 ;add 32 to get lower char adc #$20 ;add 32 to get lower char
:notUpper rts :notUpper rts
@ -109,19 +109,29 @@ WaitSCB sta :val+1
; the problem is we can get the LAST ; the problem is we can get the LAST
; horizcnt even/odd right as it changes ; horizcnt even/odd right as it changes
; and start early or something? ; and start early or something?
rts rts
MAXSCB db 0 MAXSCB db 0
Full16 MAC
clc
xce
rep #$30
<<<
ShortMX MAC
sep #$30
<<<
PushAll MAC
pha
phx
phy
<<<
PopAll MAC
ply
plx
pla
<<<
PushAll MAC
pha
phx
phy
<<<
PopAll MAC
ply
plx
pla
<<<

View File

@ -150,7 +150,7 @@ TestInit
sei ; disable interrupts sei ; disable interrupts
stz _testErrors stz _testErrors
stz _testIteration stz _testIteration
inc _testIteration ;actually, set to 1. let test passes be indicated in natural numbers. see, i'm not such a bad guy. inc _testIteration ;actually, set to 1. let test passes be indicated in natural numbers. see, i'm not such a bad guy.
stz _testIteration+1 stz _testIteration+1
stz _testState stz _testState
@ -158,7 +158,11 @@ TestInit
TestMasterLoop clc TestMasterLoop clc
xce xce
rep #$10 ;long x/y rep #$10 ;long x/y
ldy StartAddr
ldx EndAddr
stz CurBank stz CurBank
lda _updateInterval ;@todo ?
sta _updateTick ;this hack makes bank loops consistent. might not be the best thing
jsr TestPrintIteration jsr TestPrintIteration
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
@ -191,8 +195,8 @@ KeyHandled
bcc :testComplete bcc :testComplete
:infiniteIterations jmp TestMasterLoop :infiniteIterations jmp TestMasterLoop
TestAbort TestAbort
:testComplete jsr TestForceUpdateStatus :testComplete jsr TestForceUpdateStatus
sep #$10 sep #$10
jsr LogTestDone jsr LogTestDone
rts rts
Mesg_Done asc "DONE WITH TEST",$8D,00 Mesg_Done asc "DONE WITH TEST",$8D,00
@ -392,27 +396,27 @@ TestLogError PushAll
TestRollBack TestRollBack
lda TestDirection lda TestDirection
eor #$01 eor #$01
sta TestDirection sta TestDirection
jsr TestAdvanceLocation jsr TestAdvanceLocation
lda TestDirection lda TestDirection
eor #$01 eor #$01
sta TestDirection sta TestDirection
rts rts
TestForceUpdateStatus PushAll TestForceUpdateStatus PushAll
stx _stash stx _stash
bra :print bra :print
TestUpdateStatus PushAll TestUpdateStatus PushAll
stx _stash ; save real X stx _stash ; save real X
ldy _updateTick ldy _updateTick
dey dey
sty _updateTick sty _updateTick
bne :noprint bne :noprint
ldy #_updateInterval ldy #_updateInterval
sty _updateTick sty _updateTick
:print sep #$10 ;in case? there was a sec xce combo here :print sep #$10 ;in case? there was a sec xce combo here
GOXY #66;#12 GOXY #66;#12
@ -429,8 +433,8 @@ TestUpdateStatus PushAll
:noprint PopAll :noprint PopAll
rts rts
_updateTick dw #_updateInterval _updateTick dw #_updateInterval
_updateInterval = #$0100 _updateInterval = #$0100
@ -486,7 +490,7 @@ TestMemoryLocation
TestMemoryLocationTwoPass rts TestMemoryLocationTwoPass rts
mx %10 ;still shortM longX mx %10 ;still shortM longX
* 8-bit R/W TESTS * 8-bit R/W TESTS
Test_8BitWalk0RW Test_8BitWalk0RW
lda #%01111111 lda #%01111111
@ -742,7 +746,7 @@ _readerror16 sep #$20
TestAdvanceLocation TestAdvanceLocation
lda TestDirection lda TestDirection
bne :dn bne :dn
@ -759,16 +763,16 @@ TestAdvanceLocation
beq :dn8 beq :dn8
:dn16 cpx #0 :dn16 cpx #0
beq :hitBankBoundry beq :hitBankBoundry
dex ; dex ;
cpx #0 cpx #0
beq :hitBankBoundryTest ;we still need to test in this case. side effect of odd start/ends beq :hitBankBoundryTest ;we still need to test in this case. side effect of odd start/ends
bra :testStartAddr bra :testStartAddr
:dn8 cpx #0 :dn8 cpx #0
beq :hitBankBoundry beq :hitBankBoundry
dex dex
:testStartAddr cpx StartAddr :testStartAddr cpx StartAddr
bcc :done bcc :done
:hitBankBoundryTest clc :hitBankBoundryTest clc
rts rts
:done :done
:hitBankBoundry sec :hitBankBoundry sec
@ -1087,7 +1091,7 @@ PrintTimerVal
*$cf (207) *$cf (207)
*$e7 (231) *$e7 (231)
*$f5 (245) *$f5 (245)
mx $00 mx $00
GetRandByte16 sec GetRandByte16 sec
xce xce
sep #$30 sep #$30
@ -1113,7 +1117,7 @@ GetRandByte16 sec
rts rts
_seed16a db 03 _seed16a db 03
_seed16b db 40 _seed16b db 40
mx %11 mx %11
@ -1231,11 +1235,11 @@ MainMenuDefs
db 01 ; memory size (bytes) db 01 ; memory size (bytes)
da EndBank ; variable storage da EndBank ; variable storage
:StartAddr hex 19,06 ; x,y :StartAddr hex 19,06 ; x,y
db Menu_TypeHex ; 1=hex input db Menu_TypeHexByteOrder ; 1=hex input
db 02 ; memory size (bytes) db 02 ; memory size (bytes)
da StartAddr ; variable storage da StartAddr ; variable storage
:EndAddr hex 20,06 ; x,y :EndAddr hex 20,06 ; x,y
db Menu_TypeHex ; 1=hex input db Menu_TypeHexByteOrder ; 1=hex input
db 02 ; memory size (bytes) db 02 ; memory size (bytes)
da EndAddr ; variable storage da EndAddr ; variable storage
:TestType hex 19,07 ; x,y :TestType hex 19,07 ; x,y
@ -1246,7 +1250,6 @@ MainMenuDefs
db Menu_TypeList ; 3=list input db Menu_TypeList ; 3=list input
db 6 ; max len size (bytes), 3=option list db 6 ; max len size (bytes), 3=option list
da TestSizeTbl ; params definition & storage da TestSizeTbl ; params definition & storage
:HexPattern hex 19,08 ; x,y :HexPattern hex 19,08 ; x,y
db Menu_TypeHex ; 3=list input db Menu_TypeHex ; 3=list input
_hexpatternsize db 02 ; max len size (bytes), 3=option list <- can change when 8 bit?? _hexpatternsize db 02 ; max len size (bytes), 3=option list <- can change when 8 bit??
@ -1302,8 +1305,10 @@ Menu_ItemSelected db 0
* ... also disable AdjacentWrite if TwoPass * ... also disable AdjacentWrite if TwoPass
MenuUpdateConfig lda TestSize16Bit MenuUpdateConfig lda TestSize16Bit
bne :is16bit bne :is16bit
:is8bit jmp MenuSet8Bit :is8bit jsr MenuFixMax8
:is16bit jmp MenuSet16Bit jmp MenuSet8Bit
:is16bit jsr MenuFixMax16
jmp MenuSet16Bit
MenuSet16Bit lda #2 MenuSet16Bit lda #2
bra MenuSetBits bra MenuSetBits
MenuSet8Bit jsr MenuClearPatterns ;clear leftover chars because strings are shorter now MenuSet8Bit jsr MenuClearPatterns ;clear leftover chars because strings are shorter now
@ -1322,12 +1327,29 @@ MenuSetBits sta _hexpatternsize
cmp _lastAdjacentWrite cmp _lastAdjacentWrite
beq :done beq :done
sta _lastAdjacentWrite sta _lastAdjacentWrite
stz TestTwoPass stz TestTwoPass
stz _lastTwoPass stz _lastTwoPass
:done rts :done rts
_lastTwoPass db 0 _lastTwoPass db 0
_lastAdjacentWrite db 0 _lastAdjacentWrite db 0
MenuFixMax16 Full16
lda EndAddr
cmp #$FFFF
bne :noneed
dec EndAddr
:noneed ShortMX
rts
MenuFixMax8 Full16
lda EndAddr
cmp #$FFFE
bne :noneed
inc EndAddr
:noneed ShortMX
rts
* hack to allow for smaller portion of screen to update * hack to allow for smaller portion of screen to update
MenuClearPatterns PRINTXY #$17;#$8;_clearstring MenuClearPatterns PRINTXY #$17;#$8;_clearstring
PRINTXY #$17;#$9;_clearstring PRINTXY #$17;#$9;_clearstring
@ -1540,3 +1562,4 @@ 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 \