diff --git a/scorch.xex b/scorch.xex index 656eae3..9c4fcd4 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/textproc.asm b/textproc.asm index 939ee1e..5154f0b 100644 --- a/textproc.asm +++ b/textproc.asm @@ -168,77 +168,64 @@ OptionsFinished rts + .endp ;-------- ; inversing selected option (cursor) ;-------- -OptionsInversion - ;clean options loop - ;TODO: (optionally) - convert to single byte loop if no new options - mwa #OptionsHere temp - ldy #0 -OptionsInversionLoop1 - lda (temp),y - and #$7F - sta (temp),y - 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 +.proc OptionsInversion +YPos = temp2 +XPos = temp2+1 +optionWidth = 6 +nameWidth = 10 + mwa #OptionsHere temp ; offset of the first option=11 + mva #0 YPos ;option number pointer + mva #0 Xpos ;X position in the menu + tay ; Y is zero here... OptionsSetMainLoop - ldx temp2 - 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 - + ldx YPos ; Y position in the menu ;inversing the first few chars of the selected line (OptionsY) - mva OptionsY temp - mva #0 temp+1 - asl temp - rol temp+1 - asl temp - rol temp+1 - asl temp - rol temp+1 - mwa temp temp2 ;here is OptionsY*8 - asl temp - rol temp+1 - asl temp - rol temp+1 - ;here is 32*OptionsY - adw temp temp2 - ;in temp is 40*OptionsY - adw temp #OptionsHere - ;now in temp is adres of the line to be inversed - ldy #8 ;9 letters to invers -OptionsYLoop - lda (temp),y - ora #$80 + cpx OptionsY + jsr _inverter + cpy #nameWidth-1 + bne OptionsSetMainLoop + adw temp #nameWidth + ldy #0 + +OptionsLoop + lda XPos + cmp OptionsTable,x + jsr _inverter + cpy #optionWidth ; width of the option highlight + bne OptionsLoop + ldy #0 + ; next X position of the + adw temp #optionWidth ; width of the option highlight + inc:lda XPos + cmp #5 ; number of options in a row + bne OptionsLoop + ; next line + ;adw temp #nameWidth ; beginning of the next line + 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 - dey - bpl OptionsYLoop - - + bpl @+ ; JMP +invertme + lda (temp),y + ora #$80 ; set the top bit + sta (temp),y +@ + ; next character in an option + iny rts .endp diff --git a/weapons.asm b/weapons.asm index 7aafbf7..8e12e4c 100644 --- a/weapons.asm +++ b/weapons.asm @@ -2428,9 +2428,9 @@ InverseScreenByte ; ------------------------------------------------- ; Let's designate the flight altitude. 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 - sbc #12 ; tank witch shield high correction + sbc #12 ; tank with shield high correction bne StoreMaxAlt IsToHigh lda #18