From 9425941db4eb9125813f63b9bb07a428b5af742b Mon Sep 17 00:00:00 2001 From: Dagen Brock Date: Wed, 23 Sep 2015 10:31:32 -0500 Subject: [PATCH] finally fixed int input (dirty buffer artifact) --- src/menu.s | 27 ++++++++++++++++++++++++++- src/mmt.s | 38 +++++++++++++++++--------------------- 2 files changed, 43 insertions(+), 22 deletions(-) diff --git a/src/menu.s b/src/menu.s index 5d0e61e..e569b8a 100644 --- a/src/menu.s +++ b/src/menu.s @@ -517,7 +517,32 @@ Menu_InputAction iny ;skip len byte * if down then next item / * if enter, done - when it gets back to menu loop, we should handle special logic there 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 * Pass desired length in A * x/y= storage area diff --git a/src/mmt.s b/src/mmt.s index d126eb9..a83960f 100644 --- a/src/mmt.s +++ b/src/mmt.s @@ -28,13 +28,15 @@ Init Main :menuLoop jsr DrawMenuBackground jsr DrawRomMessage - +:menuDrawOptionsLoop lda #MainMenuDefs + ldy #>MainMenuDefs + jsr Menu_DrawOptions :menuNoDrawLoop jsr MenuCheckKeyColor bcc :menuNoDrawLoop ;hmm? :keyHit cmp #KEY_ENTER ;8D bne :check1 :enter jsr Menu_HandleSelection - bra :menuLoop + bra :menuNoDrawLoop :check1 cmp #KEY_UPARROW ;8B beq :prevItem @@ -44,7 +46,7 @@ Main beq :nextItem cmp #KEY_RTARROW ;95 beq :nextItem -:unknownKey bra :menuLoop +:unknownKey bra :menuNoDrawLoop :prevItem jsr Menu_PrevItem bra :menuNoDrawLoop :nextItem jsr Menu_NextItem @@ -125,9 +127,6 @@ DrawMenuBackground jsr HOME ldy #>MainMenuStrs ldx #00 ; horiz pos jsr PrintStringsX - lda #MainMenuDefs - ldy #>MainMenuDefs - jsr Menu_DrawOptions rts @@ -587,13 +586,12 @@ _randomTrashByte db 0 * -* -* -* -* S E T T I N G S ! ! ! ! ! ! ! -* -* -* +* #### ###### ##### ##### # # # #### #### +* # # # # # ## # # # # +* #### ##### # # # # # # # #### +* # # # # # # # # # ### # +* # # # # # # # ## # # # # +* #### ###### # # # # # #### #### *@todo better defaults * 00 - Byte : Selected Value @@ -641,13 +639,12 @@ TestIterations dw #$00 ; int * -* -* -* -* M E N U ! ! ! ! ! ! ! -* -* -* +* # # ###### # # # # +* ## ## # ## # # # +* # ## # ##### # # # # # +* # # # # # # # # +* # # # # ## # # +* # # ###### # # #### MainMenuDefs :StartBank hex 19,05 ; x,y @@ -797,4 +794,3 @@ BorderColor db 0 ds \ _stash ds 255 ds \ -