finally fixed int input (dirty buffer artifact)
This commit is contained in:
parent
13f5162eab
commit
9425941db4
27
src/menu.s
27
src/menu.s
|
@ -517,7 +517,32 @@ Menu_InputAction iny ;skip len byte
|
||||||
* if down then next item /
|
* if down then next item /
|
||||||
* if enter, done - when it gets back to menu loop, we should handle special logic there
|
* if enter, done - when it gets back to menu loop, we should handle special logic there
|
||||||
Menu_InputList
|
Menu_InputList
|
||||||
rts
|
tay
|
||||||
|
iny ;skip x
|
||||||
|
iny ;skip y
|
||||||
|
iny ;skip length
|
||||||
|
iny
|
||||||
|
|
||||||
|
lda ($F0),y ;get ptr to tbl
|
||||||
|
sta $F2 ; |
|
||||||
|
iny ;
|
||||||
|
lda ($F0),y ;
|
||||||
|
sta $F3 ;
|
||||||
|
|
||||||
|
|
||||||
|
ldy #$0
|
||||||
|
|
||||||
|
lda ($F2),y ;get new current value
|
||||||
|
inc ;selecteditem++
|
||||||
|
sta ($F2),y ;store new current value
|
||||||
|
iny
|
||||||
|
cmp ($F2),y ;compare to max
|
||||||
|
bcc :done ;current value < max
|
||||||
|
ldy #0 ;reset selected item to 0 (rollover)
|
||||||
|
tya
|
||||||
|
sta ($F2),y
|
||||||
|
:done rts
|
||||||
|
|
||||||
*** INPUT LIBRARY FOR MENU
|
*** INPUT LIBRARY FOR MENU
|
||||||
* Pass desired length in A
|
* Pass desired length in A
|
||||||
* x/y= storage area
|
* x/y= storage area
|
||||||
|
|
38
src/mmt.s
38
src/mmt.s
|
@ -28,13 +28,15 @@ Init
|
||||||
Main
|
Main
|
||||||
:menuLoop jsr DrawMenuBackground
|
:menuLoop jsr DrawMenuBackground
|
||||||
jsr DrawRomMessage
|
jsr DrawRomMessage
|
||||||
|
:menuDrawOptionsLoop lda #MainMenuDefs
|
||||||
|
ldy #>MainMenuDefs
|
||||||
|
jsr Menu_DrawOptions
|
||||||
:menuNoDrawLoop jsr MenuCheckKeyColor
|
:menuNoDrawLoop jsr MenuCheckKeyColor
|
||||||
bcc :menuNoDrawLoop ;hmm?
|
bcc :menuNoDrawLoop ;hmm?
|
||||||
:keyHit cmp #KEY_ENTER ;8D
|
:keyHit cmp #KEY_ENTER ;8D
|
||||||
bne :check1
|
bne :check1
|
||||||
:enter jsr Menu_HandleSelection
|
:enter jsr Menu_HandleSelection
|
||||||
bra :menuLoop
|
bra :menuNoDrawLoop
|
||||||
|
|
||||||
:check1 cmp #KEY_UPARROW ;8B
|
:check1 cmp #KEY_UPARROW ;8B
|
||||||
beq :prevItem
|
beq :prevItem
|
||||||
|
@ -44,7 +46,7 @@ Main
|
||||||
beq :nextItem
|
beq :nextItem
|
||||||
cmp #KEY_RTARROW ;95
|
cmp #KEY_RTARROW ;95
|
||||||
beq :nextItem
|
beq :nextItem
|
||||||
:unknownKey bra :menuLoop
|
:unknownKey bra :menuNoDrawLoop
|
||||||
:prevItem jsr Menu_PrevItem
|
:prevItem jsr Menu_PrevItem
|
||||||
bra :menuNoDrawLoop
|
bra :menuNoDrawLoop
|
||||||
:nextItem jsr Menu_NextItem
|
:nextItem jsr Menu_NextItem
|
||||||
|
@ -125,9 +127,6 @@ DrawMenuBackground jsr HOME
|
||||||
ldy #>MainMenuStrs
|
ldy #>MainMenuStrs
|
||||||
ldx #00 ; horiz pos
|
ldx #00 ; horiz pos
|
||||||
jsr PrintStringsX
|
jsr PrintStringsX
|
||||||
lda #MainMenuDefs
|
|
||||||
ldy #>MainMenuDefs
|
|
||||||
jsr Menu_DrawOptions
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
@ -587,13 +586,12 @@ _randomTrashByte db 0
|
||||||
|
|
||||||
|
|
||||||
*
|
*
|
||||||
*
|
* #### ###### ##### ##### # # # #### ####
|
||||||
*
|
* # # # # # ## # # # #
|
||||||
*
|
* #### ##### # # # # # # # ####
|
||||||
* S E T T I N G S ! ! ! ! ! ! !
|
* # # # # # # # # # ### #
|
||||||
*
|
* # # # # # # # ## # # # #
|
||||||
*
|
* #### ###### # # # # # #### ####
|
||||||
*
|
|
||||||
|
|
||||||
*@todo better defaults
|
*@todo better defaults
|
||||||
* 00 - Byte : Selected Value
|
* 00 - Byte : Selected Value
|
||||||
|
@ -641,13 +639,12 @@ TestIterations dw #$00 ; int
|
||||||
|
|
||||||
|
|
||||||
*
|
*
|
||||||
*
|
* # # ###### # # # #
|
||||||
*
|
* ## ## # ## # # #
|
||||||
*
|
* # ## # ##### # # # # #
|
||||||
* M E N U ! ! ! ! ! ! !
|
* # # # # # # # #
|
||||||
*
|
* # # # # ## # #
|
||||||
*
|
* # # ###### # # ####
|
||||||
*
|
|
||||||
|
|
||||||
MainMenuDefs
|
MainMenuDefs
|
||||||
:StartBank hex 19,05 ; x,y
|
:StartBank hex 19,05 ; x,y
|
||||||
|
@ -797,4 +794,3 @@ BorderColor db 0
|
||||||
ds \
|
ds \
|
||||||
_stash ds 255
|
_stash ds 255
|
||||||
ds \
|
ds \
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue