mirror of
https://github.com/digarok/MiniMemoryTester.git
synced 2024-06-20 12:29:28 +00:00
menu done
This commit is contained in:
parent
9425941db4
commit
bbfc1a7a76
65
src/mmt.s
65
src/mmt.s
|
@ -28,7 +28,8 @@ Init
|
||||||
Main
|
Main
|
||||||
:menuLoop jsr DrawMenuBackground
|
:menuLoop jsr DrawMenuBackground
|
||||||
jsr DrawRomMessage
|
jsr DrawRomMessage
|
||||||
:menuDrawOptionsLoop lda #MainMenuDefs
|
:menuDrawOptionsLoop jsr MenuUpdateWordSize ;always update this before draw in case of change
|
||||||
|
lda #MainMenuDefs
|
||||||
ldy #>MainMenuDefs
|
ldy #>MainMenuDefs
|
||||||
jsr Menu_DrawOptions
|
jsr Menu_DrawOptions
|
||||||
:menuNoDrawLoop jsr MenuCheckKeyColor
|
:menuNoDrawLoop jsr MenuCheckKeyColor
|
||||||
|
@ -36,7 +37,7 @@ Main
|
||||||
:keyHit cmp #KEY_ENTER ;8D
|
:keyHit cmp #KEY_ENTER ;8D
|
||||||
bne :check1
|
bne :check1
|
||||||
:enter jsr Menu_HandleSelection
|
:enter jsr Menu_HandleSelection
|
||||||
bra :menuNoDrawLoop
|
bra :menuDrawOptionsLoop ;because an option might have changed
|
||||||
|
|
||||||
:check1 cmp #KEY_UPARROW ;8B
|
:check1 cmp #KEY_UPARROW ;8B
|
||||||
beq :prevItem
|
beq :prevItem
|
||||||
|
@ -611,7 +612,8 @@ TestDirectionTbl db 0
|
||||||
_testDirectionUp asc "up",$00
|
_testDirectionUp asc "up",$00
|
||||||
_testDirectionDown asc "dn",$00
|
_testDirectionDown asc "dn",$00
|
||||||
|
|
||||||
TestSizeTbl db 00
|
TestSizeTbl
|
||||||
|
TestSize16Bit db 01 ;0=no ... 8bit, 1=yes ... 16 bit
|
||||||
db 02
|
db 02
|
||||||
da _TestSize_0,_TestSize_1
|
da _TestSize_0,_TestSize_1
|
||||||
_TestSize_0 asc " 8-bit",$00
|
_TestSize_0 asc " 8-bit",$00
|
||||||
|
@ -631,10 +633,11 @@ HexPattern dw #$0000
|
||||||
TestDirection dw #0 ; list
|
TestDirection dw #0 ; list
|
||||||
TestParallel dw #0 ; bool is byte, but might change in future? :P
|
TestParallel dw #0 ; bool is byte, but might change in future? :P
|
||||||
TestAdjacentWrite dw #0 ; bool is byte, but might change in future? :P
|
TestAdjacentWrite dw #0 ; bool is byte, but might change in future? :P
|
||||||
TestRefreshPause dw #$03e7 ; int
|
TestRefreshPause dw #$00 ; int
|
||||||
TestReadRepeat dw #$01 ; int
|
TestReadRepeat dw #$01 ; int
|
||||||
TestWriteRepeat dw #$01 ; int
|
TestWriteRepeat dw #$01 ; int
|
||||||
TestIterations dw #$00 ; int
|
TestIterations dw #$00 ; int
|
||||||
|
TestErrorPause dw #0 ;bool
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -674,11 +677,11 @@ MainMenuDefs
|
||||||
|
|
||||||
:HexPattern hex 19,08 ; x,y
|
:HexPattern hex 19,08 ; x,y
|
||||||
db Menu_TypeHex ; 3=list input
|
db Menu_TypeHex ; 3=list input
|
||||||
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??
|
||||||
da HexPattern ; params definition & storage
|
da HexPattern ; params definition & storage
|
||||||
:BinPattern hex 19,09 ; x,y
|
:BinPattern hex 19,09 ; x,y
|
||||||
db Menu_TypeBin ; 5?=bin
|
db Menu_TypeBin ; 5?=bin
|
||||||
db 02 ; max len size (bytes), 3=option list <- can change when 8 bit??
|
_binpatternsize db 02 ; max len size (bytes), 3=option list <- can change when 8 bit??
|
||||||
da HexPattern ; params definition & storage <- uses same space as above!! just different representation
|
da HexPattern ; params definition & storage <- uses same space as above!! just different representation
|
||||||
:Direction hex 12,0B
|
:Direction hex 12,0B
|
||||||
db Menu_TypeList
|
db Menu_TypeList
|
||||||
|
@ -692,10 +695,10 @@ MainMenuDefs
|
||||||
db Menu_TypeBool ; 1=hex input
|
db Menu_TypeBool ; 1=hex input
|
||||||
db 01 ; memory size (bytes)
|
db 01 ; memory size (bytes)
|
||||||
da TestAdjacentWrite ; variable storage
|
da TestAdjacentWrite ; variable storage
|
||||||
:TestRefreshPause hex 28,0C ; x,y
|
:TestErrorPause hex 28,0C ; x,y
|
||||||
db Menu_TypeInt ; 1=hex input
|
db Menu_TypeBool ; 1=hex input
|
||||||
db 03 ; display/entry width. ints are 16-bit internally
|
db 2 ; could be 8-bit or 16-bit bool
|
||||||
da TestRefreshPause ; variable storage
|
da TestErrorPause ; variable storage
|
||||||
:ReadRepeat hex 12,0D ; x,y
|
:ReadRepeat hex 12,0D ; x,y
|
||||||
db Menu_TypeInt ; 1=hex input
|
db Menu_TypeInt ; 1=hex input
|
||||||
db 03 ; display/entry width. ints are 16-bit internally
|
db 03 ; display/entry width. ints are 16-bit internally
|
||||||
|
@ -708,6 +711,10 @@ MainMenuDefs
|
||||||
db Menu_TypeInt ; 1=hex input
|
db Menu_TypeInt ; 1=hex input
|
||||||
db 03 ; display/entry width. ints are 16-bit internally
|
db 03 ; display/entry width. ints are 16-bit internally
|
||||||
da TestIterations ; variable storage
|
da TestIterations ; variable storage
|
||||||
|
:TestRefreshPause hex 28,0E ; x,y
|
||||||
|
db Menu_TypeInt ; 1=hex input
|
||||||
|
db 03 ; display/entry width. ints are 16-bit internally
|
||||||
|
da TestRefreshPause ; variable storage
|
||||||
:BeginTest hex 1C,0F ; x,y
|
:BeginTest hex 1C,0F ; x,y
|
||||||
db Menu_TypeAction ; 2=action
|
db Menu_TypeAction ; 2=action
|
||||||
db MenuStr_BeginTestL ; menu string length
|
db MenuStr_BeginTestL ; menu string length
|
||||||
|
@ -717,8 +724,25 @@ MainMenuItems equ MainMenuLen/6
|
||||||
MainMenuEnd dw 0000
|
MainMenuEnd dw 0000
|
||||||
Menu_ItemSelected db 0
|
Menu_ItemSelected db 0
|
||||||
|
|
||||||
|
* special helper functions to update some input sizes when
|
||||||
|
* the user switches between 8 and 16 bit testing modes
|
||||||
|
MenuUpdateWordSize lda TestSize16Bit
|
||||||
|
bne :is16bit
|
||||||
|
:is8bit jmp MenuSet8Bit
|
||||||
|
:is16bit jmp MenuSet16Bit
|
||||||
|
MenuSet16Bit lda #2
|
||||||
|
bra MenuSetBits
|
||||||
|
MenuSet8Bit jsr MenuClearPatterns ;clear leftover chars because strings are shorter now
|
||||||
|
lda #1
|
||||||
|
MenuSetBits sta _hexpatternsize
|
||||||
|
sta _binpatternsize
|
||||||
|
rts
|
||||||
|
* hack to allow for smaller portion of screen to update
|
||||||
|
|
||||||
|
MenuClearPatterns PRINTXY #$17;#$8;_clearstring
|
||||||
|
PRINTXY #$17;#$9;_clearstring
|
||||||
|
rts
|
||||||
|
_clearstring asc " ",$00
|
||||||
|
|
||||||
MainMenuStrs
|
MainMenuStrs
|
||||||
asc " ______________________________________________________________________________",$8D,$00
|
asc " ______________________________________________________________________________",$8D,$00
|
||||||
|
@ -726,16 +750,16 @@ MainMenuStrs
|
||||||
asc $1B,'ZLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL_',$18,00
|
asc $1B,'ZLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL_',$18,00
|
||||||
asc $1B,'ZZ \GGGGGGGGGGGGG_',"Test Settings",'ZGGGGGGGGGGGGG\ _'," ",'Z \GGGGGGGG_',"Info",'ZGGGGGGGG\ _'," ",'_',$18,00
|
asc $1B,'ZZ \GGGGGGGGGGGGG_',"Test Settings",'ZGGGGGGGGGGGGG\ _'," ",'Z \GGGGGGGG_',"Info",'ZGGGGGGGG\ _'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," Start/End Bank : [ ] / [ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," Start/End Bank : / ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," Start/End Address : [ ]/[ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," Start/End Address : / ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," Test Type : [ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," Test Type : ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," Hex Pattern : [ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," Hex Pattern : ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," Bin Pattern : [ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," Bin Pattern : ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," Direction [ ] Parallel R/W [ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," Direction Parallel R/W ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," Adjacent Wr. [ ] Refresh Pause [000] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," Adjacent Wr. Wait on Error ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," Read Repeat [000] Write Repeat [000] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," Read Repeat Write Repeat ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," Iterations [ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," Iterations Refresh Pause ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZZ'," ( ) ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
asc $1B,'ZZ'," ( ) ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||||
asc $1B,'ZLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL_',$18,00
|
asc $1B,'ZLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL_',$18,00
|
||||||
asc $1B,'Z'," ",'_',$18,00
|
asc $1B,'Z'," ",'_',$18,00
|
||||||
|
@ -794,3 +818,4 @@ BorderColor db 0
|
||||||
ds \
|
ds \
|
||||||
_stash ds 255
|
_stash ds 255
|
||||||
ds \
|
ds \
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user