roto: almost there

This commit is contained in:
Vince Weaver 2021-01-06 14:21:51 -05:00
parent 424af605e1
commit 17620f3fe1
4 changed files with 50 additions and 45 deletions

View File

@ -5,7 +5,7 @@
; Ycoord in YPOS
; color in COLOR
plot:
lda YPOS ; 2
lda YPOS ; 3
lsr ; shift bottom bit into carry ; 2
@ -19,15 +19,14 @@ plot_c_done:
stx MASK ; 3
asl ; shift back (now even) ; 2
tay
tay ; 2
lda gr_offsets,Y ; lookup low-res memory address ; 4
clc ; 2
adc XPOS ; 3
sta GBASL ; 3
iny ; 2
lda gr_offsets,Y ; 4
lda gr_offsets+1,Y ; 4
adc DRAW_PAGE ; add in draw page offset ; 3
sta GBASH ; 3

View File

@ -7,23 +7,10 @@
; assume reading from $c00
scrn:
lda YPOS ; 2
lda YPOS ; 3
; lsr ; shift bottom bit into carry ; 2
; bcc scrn_even ; 2nt/3
;scrn_odd:
; ldx #$f0 ; 2
; bcs scrn_c_done ; 2nt/3
;scrn_even:
; ldx #$0f ; 2
;scrn_c_done:
; stx MASK ; 3
; asl ; shift back (now even) ; 2
and #$fe ; make even
tay
and #$fe ; make even ; 2
tay ; 2
lda gr_offsets,Y ; lookup low-res memory address ; 4
clc ; 2
@ -34,26 +21,26 @@ scrn:
adc #$8 ; assume reading from $c0 ; 3
sta GBASH ; 3
ldy #0
ldy #0 ; 2
lda YPOS
lsr
bcs scrn_adjust_even
lda YPOS ; 3
lsr ; 2
bcs scrn_adjust_even ;2nt/3t
scrn_adjust_odd:
lda (GBASL),Y ; top/bottom color
jmp scrn_done
lda (GBASL),Y ; top/bottom color ; 5+
jmp scrn_done ; 3
scrn_adjust_even:
lda (GBASL),Y ; top/bottom color
lda (GBASL),Y ; top/bottom color ; 5+
lsr
lsr
lsr
lsr
lsr ; 2
lsr ; 2
lsr ; 2
lsr ; 2
scrn_done:
and #$f
and #$f ; 2
rts
rts ; 6

View File

@ -75,6 +75,9 @@ wait_for_keypress:
bit KEYRESET
inc ANGLE
lda ANGLE
and #$f
sta ANGLE
jmp main_loop

View File

@ -49,6 +49,22 @@ rotozoom:
; cca = -20*ca;
; csa = -20*sa;
lda #0
sta CCAL
sta CCAH
sta CSAL
sta CSAH
ldx #20
mul20_loop:
dex
bne mul20_loop
; yca=cca+ycenter;
lda CCAL
@ -101,21 +117,21 @@ rotozoom_xloop:
; else if ((yp<0) || (yp>39)) color=0;
; else color=scrn_page(xp,yp,PAGE2);
; lda #0
; ldx XPH
; bmi rotozoom_set_color
; cpx #40
; bcs rotozoom_set_color
; ldx YPH
; bmi rotozoom_set_color
; cpx #40
; bcs rotozoom_set_color
lda #0
ldx XPH
bmi rotozoom_set_color
cpx #40
bcs rotozoom_set_color
ldx YPH
bmi rotozoom_set_color
cpx #40
bcs rotozoom_set_color
; scrn()
; scrn(xp,yp)
lda XX
lda XPH
sta XPOS
lda YY
lda YPH
sta YPOS
jsr scrn