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
|
||||
:menuLoop jsr DrawMenuBackground
|
||||
jsr DrawRomMessage
|
||||
:menuDrawOptionsLoop lda #MainMenuDefs
|
||||
:menuDrawOptionsLoop jsr MenuUpdateWordSize ;always update this before draw in case of change
|
||||
lda #MainMenuDefs
|
||||
ldy #>MainMenuDefs
|
||||
jsr Menu_DrawOptions
|
||||
:menuNoDrawLoop jsr MenuCheckKeyColor
|
||||
|
@ -36,7 +37,7 @@ Main
|
|||
:keyHit cmp #KEY_ENTER ;8D
|
||||
bne :check1
|
||||
:enter jsr Menu_HandleSelection
|
||||
bra :menuNoDrawLoop
|
||||
bra :menuDrawOptionsLoop ;because an option might have changed
|
||||
|
||||
:check1 cmp #KEY_UPARROW ;8B
|
||||
beq :prevItem
|
||||
|
@ -611,7 +612,8 @@ TestDirectionTbl db 0
|
|||
_testDirectionUp asc "up",$00
|
||||
_testDirectionDown asc "dn",$00
|
||||
|
||||
TestSizeTbl db 00
|
||||
TestSizeTbl
|
||||
TestSize16Bit db 01 ;0=no ... 8bit, 1=yes ... 16 bit
|
||||
db 02
|
||||
da _TestSize_0,_TestSize_1
|
||||
_TestSize_0 asc " 8-bit",$00
|
||||
|
@ -631,10 +633,11 @@ HexPattern dw #$0000
|
|||
TestDirection dw #0 ; list
|
||||
TestParallel 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
|
||||
TestWriteRepeat dw #$01 ; int
|
||||
TestIterations dw #$00 ; int
|
||||
TestErrorPause dw #0 ;bool
|
||||
|
||||
|
||||
|
||||
|
@ -674,11 +677,11 @@ MainMenuDefs
|
|||
|
||||
:HexPattern hex 19,08 ; x,y
|
||||
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
|
||||
:BinPattern hex 19,09 ; x,y
|
||||
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
|
||||
:Direction hex 12,0B
|
||||
db Menu_TypeList
|
||||
|
@ -692,10 +695,10 @@ MainMenuDefs
|
|||
db Menu_TypeBool ; 1=hex input
|
||||
db 01 ; memory size (bytes)
|
||||
da TestAdjacentWrite ; variable storage
|
||||
:TestRefreshPause hex 28,0C ; x,y
|
||||
db Menu_TypeInt ; 1=hex input
|
||||
db 03 ; display/entry width. ints are 16-bit internally
|
||||
da TestRefreshPause ; variable storage
|
||||
:TestErrorPause hex 28,0C ; x,y
|
||||
db Menu_TypeBool ; 1=hex input
|
||||
db 2 ; could be 8-bit or 16-bit bool
|
||||
da TestErrorPause ; variable storage
|
||||
:ReadRepeat hex 12,0D ; x,y
|
||||
db Menu_TypeInt ; 1=hex input
|
||||
db 03 ; display/entry width. ints are 16-bit internally
|
||||
|
@ -708,6 +711,10 @@ MainMenuDefs
|
|||
db Menu_TypeInt ; 1=hex input
|
||||
db 03 ; display/entry width. ints are 16-bit internally
|
||||
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
|
||||
db Menu_TypeAction ; 2=action
|
||||
db MenuStr_BeginTestL ; menu string length
|
||||
|
@ -717,8 +724,25 @@ MainMenuItems equ MainMenuLen/6
|
|||
MainMenuEnd dw 0000
|
||||
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
|
||||
asc " ______________________________________________________________________________",$8D,$00
|
||||
|
@ -726,16 +750,16 @@ MainMenuStrs
|
|||
asc $1B,'ZLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL_',$18,00
|
||||
asc $1B,'ZZ \GGGGGGGGGGGGG_',"Test Settings",'ZGGGGGGGGGGGGG\ _'," ",'Z \GGGGGGGG_',"Info",'ZGGGGGGGG\ _'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Start/End Bank : [ ] / [ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Start/End Address : [ ]/[ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Test Type : [ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Hex Pattern : [ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Bin Pattern : [ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Start/End Bank : / ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Start/End Address : / ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Test Type : ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Hex Pattern : ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Bin Pattern : ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," ",'_'," ",'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'," Read Repeat [000] Write Repeat [000] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Iterations [ ] ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Direction Parallel R/W ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Adjacent Wr. Wait on Error ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Read Repeat Write Repeat ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," Iterations Refresh Pause ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZZ'," ( ) ",'_'," ",'Z'," ",'_'," ",'_',$18,00
|
||||
asc $1B,'ZLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL_',$18,00
|
||||
asc $1B,'Z'," ",'_',$18,00
|
||||
|
@ -794,3 +818,4 @@ BorderColor db 0
|
|||
ds \
|
||||
_stash ds 255
|
||||
ds \
|
||||
|
||||
|
|
Loading…
Reference in New Issue