More Videx code cleanup/improvement.

This commit is contained in:
Bobbi Webber-Manners
2024-08-05 17:55:17 -04:00
parent 1560720c5b
commit 2eea66deae

View File

@@ -1250,39 +1250,29 @@ VidexSetVec
lsr ; .. lsr ; ..
sta xVector+1 ; Store MSByte sta xVector+1 ; Store MSByte
pla ; Recover row * 5 + start pla ; Recover row * 5 + start
asl ; Mult*15 - for LSbyte asl ; Mult*16 - for LSbyte
asl ; .. asl ; ..
asl ; .. asl ; ..
asl ; .. asl ; ..
sta xVector ; Store LSByte sta xVector ; Store LSByte
VSV2 clc clc
txa ; Column -> A txa ; Column -> A
adc xVector adc xVector
sta xVector sta xVector
sta BASL sta BASL ; Store LSByte
lda xVector+1 lda xVector+1
adc #00 adc #00 ; Now xVector has start + row * 80 + col
sta xVector+1 ; Now xVector has start + row * 80 + col pha
lsr ; Discard LSbit of MSbyte and #$06 ; Mask to get bits 9,10
and #$03 ; Mask to get bits 9,10 asl ; Multiply by 2
tay ; Videx page 0,1,2,3
asl ; Multiply by 4
asl ; ..
tax ; Will return page*4 in X tax ; Will return page*4 in X
beq VSV4 ; Page zero -> skip over loop pla ; Recover MSByte
VSV3 lda xVector+1 ; MSB and #$01 ; Mask out all except LSbit
sec
sbc #$02 ; Subtract 2 from MSB -> sub 512 from value
sta xVector+1 sta xVector+1
dey sta BASH ; Store MSByte
bne VSV3
VSV4 lda xVector+1
sta BASH
rts rts
VSVTmp .res 1
; ------------------------------------- ; -------------------------------------
; VidexPage - Page in the 512 byte page videxpage ; VidexPage - Page in the 512 byte page videxpage
; ;