main menu does not blink

This commit is contained in:
2022-11-07 01:13:37 -05:00
parent ef4612f3a4
commit 096bce6e88
3 changed files with 54 additions and 67 deletions
BIN
View File
Binary file not shown.
+52 -65
View File
@@ -168,77 +168,64 @@ OptionsFinished
rts rts
.endp
;-------- ;--------
; inversing selected option (cursor) ; inversing selected option (cursor)
;-------- ;--------
OptionsInversion .proc OptionsInversion
;clean options loop YPos = temp2
;TODO: (optionally) - convert to single byte loop if no new options XPos = temp2+1
mwa #OptionsHere temp optionWidth = 6
ldy #0 nameWidth = 10
OptionsInversionLoop1 mwa #OptionsHere temp ; offset of the first option=11
lda (temp),y mva #0 YPos ;option number pointer
and #$7F mva #0 Xpos ;X position in the menu
sta (temp),y tay ; Y is zero here...
inw temp
cpw temp #OptionsScreenEnd
bne OptionsInversionLoop1
;here all past inversions are gone...
mwa #OptionsHere temp
mva #0 temp2 ;option number pointer
adw temp #10 ;offset of the first option=11
OptionsSetMainLoop OptionsSetMainLoop
ldx temp2 ldx YPos ; Y position in the menu
lda OptionsTable,x
asl
asl
adc OptionsTable,x ;OptionsTable value * 5
adc OptionsTable,x ;OptionsTable value * 6
tay
ldx #6-1 ; width of the highlight bar (6 chars)
OptionSetLoop
lda (temp),y
ora #$80
sta (temp),y
iny
dex
bpl OptionSetLoop ;here option is highlighted
;
; next option
adw temp #40 ;jump to next line
inc:lda temp2
cmp #maxOptions ;number of options
bne OptionsSetMainLoop
;inversing the first few chars of the selected line (OptionsY) ;inversing the first few chars of the selected line (OptionsY)
mva OptionsY temp cpx OptionsY
mva #0 temp+1 jsr _inverter
asl temp cpy #nameWidth-1
rol temp+1 bne OptionsSetMainLoop
asl temp adw temp #nameWidth
rol temp+1 ldy #0
asl temp
rol temp+1 OptionsLoop
mwa temp temp2 ;here is OptionsY*8 lda XPos
asl temp cmp OptionsTable,x
rol temp+1 jsr _inverter
asl temp cpy #optionWidth ; width of the option highlight
rol temp+1 bne OptionsLoop
;here is 32*OptionsY ldy #0
adw temp temp2 ; next X position of the
;in temp is 40*OptionsY adw temp #optionWidth ; width of the option highlight
adw temp #OptionsHere inc:lda XPos
;now in temp is adres of the line to be inversed cmp #5 ; number of options in a row
ldy #8 ;9 letters to invers bne OptionsLoop
OptionsYLoop ; next line
lda (temp),y ;adw temp #nameWidth ; beginning of the next line
ora #$80 mva #0 Xpos
tay
inc:lda Ypos
cmp #maxOptions
bne OptionsSetMainLoop
rts
_inverter
beq invertme
; clean inversion otherwise
lda (temp),y
and #$7f ; clear the top bit
sta (temp),y sta (temp),y
dey bpl @+ ; JMP
bpl OptionsYLoop invertme
lda (temp),y
ora #$80 ; set the top bit
sta (temp),y
@
; next character in an option
iny
rts rts
.endp .endp
+2 -2
View File
@@ -2428,9 +2428,9 @@ InverseScreenByte
; ------------------------------------------------- ; -------------------------------------------------
; Let's designate the flight altitude. ; Let's designate the flight altitude.
jsr CheckMaxMountain jsr CheckMaxMountain
cmp #(12+18) ; tank witch shield (12) and max alt (18) check cmp #(12+18) ; tank with shield (12) and max alt (18) check
bcc IsToHigh bcc IsToHigh
sbc #12 ; tank witch shield high correction sbc #12 ; tank with shield high correction
bne StoreMaxAlt bne StoreMaxAlt
IsToHigh IsToHigh
lda #18 lda #18