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

View File

@ -7,23 +7,10 @@
; assume reading from $c00 ; assume reading from $c00
scrn: scrn:
lda YPOS ; 2 lda YPOS ; 3
; lsr ; shift bottom bit into carry ; 2 and #$fe ; make even ; 2
tay ; 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
lda gr_offsets,Y ; lookup low-res memory address ; 4 lda gr_offsets,Y ; lookup low-res memory address ; 4
clc ; 2 clc ; 2
@ -34,26 +21,26 @@ scrn:
adc #$8 ; assume reading from $c0 ; 3 adc #$8 ; assume reading from $c0 ; 3
sta GBASH ; 3 sta GBASH ; 3
ldy #0 ldy #0 ; 2
lda YPOS lda YPOS ; 3
lsr lsr ; 2
bcs scrn_adjust_even bcs scrn_adjust_even ;2nt/3t
scrn_adjust_odd: scrn_adjust_odd:
lda (GBASL),Y ; top/bottom color lda (GBASL),Y ; top/bottom color ; 5+
jmp scrn_done jmp scrn_done ; 3
scrn_adjust_even: scrn_adjust_even:
lda (GBASL),Y ; top/bottom color lda (GBASL),Y ; top/bottom color ; 5+
lsr lsr ; 2
lsr lsr ; 2
lsr lsr ; 2
lsr lsr ; 2
scrn_done: scrn_done:
and #$f and #$f ; 2
rts rts ; 6

View File

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

View File

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