From 9962c261ed9442ecc5652b557de1c4542b414692 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Mon, 10 May 2021 01:49:01 -0400 Subject: [PATCH] demo: more work-in-progress --- demos/outline2021/128b/Makefile | 2 +- demos/outline2021/demo/Makefile | 1 + demos/outline2021/demo/NOTES | 4 +- demos/outline2021/demo/a2_inside.s | 248 ++++++- demos/outline2021/demo/credits.s | 3 +- demos/outline2021/demo/flying_mode7.s | 90 ++- demos/outline2021/demo/gr_copy.s | 221 ++++++ demos/outline2021/demo/hardware.inc | 1 + .../demo/mAZE_-_Apple_snapple_Outline.pt3 | Bin 0 -> 2935 bytes demos/outline2021/demo/outline.s | 19 +- demos/outline2021/demo/plasma.s | 171 +++++ demos/outline2021/demo/rotoplasma_tiny.s | 180 +++++ demos/outline2021/demo/rotozoom.s | 630 ++++++++++++++++++ demos/outline2021/demo/rotozoom_texture.s | 599 +++++++++++++++++ demos/outline2021/demo/tfv_flying.s | 40 +- demos/outline2021/demo/wires.s | 2 +- demos/outline2021/demo/zp.inc | 5 +- graphics/gr/boxes/Makefile | 12 +- graphics/gr/boxes/nyan.data | 10 +- graphics/hgr/xdraw/NOTES | 21 +- graphics/hgr/xdraw/xdraw_test.s | 5 +- textmode/textscroll/matrix.bas | 17 +- 22 files changed, 2198 insertions(+), 83 deletions(-) create mode 100644 demos/outline2021/demo/gr_copy.s create mode 100644 demos/outline2021/demo/mAZE_-_Apple_snapple_Outline.pt3 create mode 100644 demos/outline2021/demo/plasma.s create mode 100644 demos/outline2021/demo/rotoplasma_tiny.s create mode 100644 demos/outline2021/demo/rotozoom.s create mode 100644 demos/outline2021/demo/rotozoom_texture.s diff --git a/demos/outline2021/128b/Makefile b/demos/outline2021/128b/Makefile index 8e21f441..bbeee88a 100644 --- a/demos/outline2021/128b/Makefile +++ b/demos/outline2021/128b/Makefile @@ -7,7 +7,7 @@ EMPTY_DISK = ../../../empty_disk/empty.dsk all: xdraw.dsk xdraw128.dsk -submit: xdraw128.zip +submit: xdraw128_submit.zip xdraw128_submit.zip: XDRAW128 xdraw128.s file_id.diz xdraw128.dsk mkdir -p outline2021_xdraw128 diff --git a/demos/outline2021/demo/Makefile b/demos/outline2021/demo/Makefile index 28e27c16..4f717882 100644 --- a/demos/outline2021/demo/Makefile +++ b/demos/outline2021/demo/Makefile @@ -54,6 +54,7 @@ OUTLINE: outline.o outline.o: outline.s zp.inc \ shimmer.s a2_inside.s drops.s wires.s \ + rotoplasma_tiny.s \ flying_dir.inc tfv_flying.s flying_mode7.s credits.s ca65 -o outline.o outline.s -l outline.lst diff --git a/demos/outline2021/demo/NOTES b/demos/outline2021/demo/NOTES index 34f68250..8a82fc3f 100644 --- a/demos/outline2021/demo/NOTES +++ b/demos/outline2021/demo/NOTES @@ -1,7 +1,9 @@ Memory Usage: $200 -$1000-$10FF wires_lookup +$1000-$10FF wires_lookup/plasma_lookup +$1100-$11FF plasma lookup +$1200-$12FF plasma lookup $2000-$3FFF hires page 1 $4000-$6000 hires page 2 (24k) $6000-????? code diff --git a/demos/outline2021/demo/a2_inside.s b/demos/outline2021/demo/a2_inside.s index c9c428f3..a1bc3983 100644 --- a/demos/outline2021/demo/a2_inside.s +++ b/demos/outline2021/demo/a2_inside.s @@ -10,6 +10,15 @@ a2_inside: bit LORES bit FULLGR ; make it 40x48 + + ;============================= + ; init wires + + jsr wires_create_lookup + + ;============================= + ; draw the computer + draw_box_loop: ; get color/Y0 @@ -18,7 +27,7 @@ draw_box_loop: tya ; check for end - bmi end + bmi done_computer jsr load_byte ; Y1 @@ -64,15 +73,16 @@ inner_loop: bcc inner_loop bcs draw_box_loop +done_computer: - ;========================= - ; draw the demo - ;========================= + ;==================================== + ; draw the demo, sierpinski at first + ;==================================== ; screen is from (11,6) - (20,23) ; so size is 9,17? -end: - lda #128 + + lda #200 sta FRAME @@ -137,8 +147,234 @@ black: lda FRAME bne sier_loop +; rts + + + + ;==================================== + ; draw the demo, wires + ;==================================== + ; screen is from (11,6) - (20,23) + ; so size is 9,17? + + + lda #200 + sta FRAME + + + ; pause a bit at beginning + jsr WAIT + +a2_wire_loop: + + jsr wires_cycle_colors + + lda #100 ; Wait a bit, we're too fast + jsr WAIT + + inc FRAME ; increment frame + + ldx #17 ; YY + +a2_wire_yloop: + + lda #9 ; XX + sta XX + +a2_wire_xloop: + + txa + and #$f + + asl + asl + asl + asl + ora XX + tay + + lda wires_lookup,Y ; load from array ; 4 + + cmp #11 + bcs acolor_notblue ; if < 11, blue + +acolor_blue: + lda #$11 ; blue offset + +acolor_notblue: + tay + lda wires_colorlookup-11,Y ; lookup color + +acolor_notblack: + + + + + jsr SETCOL ; set top/bottom nibble same color + + lda XX ; offset XX to tiny screen + clc + adc #11 + tay ; put into Y + + txa ; offset YY to tiny screen + clc + adc #6 ; put into A + + jsr PLOT ; PLOT AT Y,A + + dec XX + bpl a2_wire_xloop + + dex + bpl a2_wire_yloop + + lda FRAME + bne a2_wire_loop + + + + ;======================================= + ; copy to $c00 + ;======================================= + + lda #0 + sta DRAW_PAGE + jsr gr_copy_from_current + + lda #4 + sta DISP_PAGE + + ;============================ + ; rotozoom + ;============================ + + ; do a (hopefully fast) roto-zoom + +; jsr clear_screens +; jsr init_multiply_tables + + jsr gr_copy_to_current + jsr page_flip + jsr gr_copy_to_current + + ;================================= + ; main loop + + lda #0 + sta ANGLE + sta SCALE_F + sta FRAME + + lda #1 + sta direction + lda #$10 + sta scaleaddl + lda #$00 + sta scaleaddh + + lda #1 + sta SCALE_I + +rz_main_loop: + + jsr rotozoom_c00 + + jsr page_flip + +;wait_for_keypress: +; lda KEYPRESS +; bpl wait_for_keypress +; bit KEYRESET + + + clc + lda FRAME + adc direction + sta FRAME + + cmp #$f8 + beq rback_at_zero + cmp #33 + beq rat_far_end + bne rdone_reverse + +rback_at_zero: +; inc which_image +; lda which_image +; cmp #3 +; bne refresh_image +; lda #0 +; sta which_image +;refresh_image: +; jsr load_background + +rat_far_end: + rts + ; change bg color +; lda roto_color_even_smc+1 +; clc +; adc #$01 +; and #$0f +; sta roto_color_even_smc+1 + +; lda roto_color_odd_smc+1 +; clc +; adc #$10 +; and #$f0 +; sta roto_color_odd_smc+1 + + + + ; reverse direction +;; lda direction +; eor #$ff +; clc +; adc #1 +; sta direction + +; lda scaleaddl +; eor #$ff +; clc +; adc #1 +; sta scaleaddl + +; lda scaleaddh +; eor #$ff +; adc #0 +; sta scaleaddh + +rdone_reverse: + clc + lda ANGLE + adc direction + and #$1f + sta ANGLE + + clc + lda SCALE_F + adc scaleaddl + sta SCALE_F + lda SCALE_I + adc scaleaddh + sta SCALE_I + + jmp rz_main_loop + + +;direction: .byte $01 +;scaleaddl: .byte $10 +;scaleaddh: .byte $00 + + + + rts + + + + ;========================= ; load byte routine ;========================= diff --git a/demos/outline2021/demo/credits.s b/demos/outline2021/demo/credits.s index 0db2b9cc..5e502412 100644 --- a/demos/outline2021/demo/credits.s +++ b/demos/outline2021/demo/credits.s @@ -27,10 +27,11 @@ credits: + jsr clear_bottom + jsr HGR ; Hi-res graphics, no text at bottom ; Y=0, A=0 after this call - jsr clear_bottom sta LOGO_OFFSET sta FRAME diff --git a/demos/outline2021/demo/flying_mode7.s b/demos/outline2021/demo/flying_mode7.s index 0db5a6d4..52835a09 100644 --- a/demos/outline2021/demo/flying_mode7.s +++ b/demos/outline2021/demo/flying_mode7.s @@ -373,12 +373,13 @@ nomatch: lda SPACEY_I ; 3 sta spacey_label+1 ; self modifying code, LAST_SPACEY_I ; 4 - and #CONST_MAP_MASK_Y ; wrap to 64x64 grid ; 2 + and #CONST_MAP_MASK_Y ; wrap to 16x16 grid ; 2 sta SPACEY_I ; 3 asl ; 2 asl ; 2 - asl ; multiply by 8 ; 2 + asl ; multiply by 16 ; 2 + asl clc ; 2 adc SPACEX_I ; add in X value ; 3 ; only valid if x<8 and y<8 @@ -387,11 +388,11 @@ nomatch: ; 37 ; SPACEX_I is n y - cpy #$8 ; 2 - bcs ocean_color ; bge 8 ; 2nt/3 - ldy SPACEY_I ; 3 - cpy #$8 ; 2 - bcs ocean_color ; bge 8 ; 2nt/3 +; cpy #$8 ; 2 +; bcs ocean_color ; bge 8 ; 2nt/3 +; ldy SPACEY_I ; 3 +; cpy #$8 ; 2 +; bcs ocean_color ; bge 8 ; 2nt/3 ;============= ; ?? @@ -400,18 +401,36 @@ nomatch: ; A is spacey<<3+spacex island_color: tay ; 2 - lda flying_map,Y ; load from array ; 4 - jmp update_cache ; 3 + lda wires_lookup,Y ; load from array ; 4 + + cmp #11 + bcs mcolor_notblue ; if < 11, blue + +mcolor_blue: + lda #$11 ; blue offset + +mcolor_notblue: + tay + lda wires_colorlookup-11,Y ; lookup color + +mcolor_notblack: + + + + +; lda #$bb + +; jmp update_cache ; 3 ;============ ; 11 ;============= ; lookup ocean ; A is spacey<<3+spacex -ocean_color: - and #$1f ; 2 - tay ; 2 - lda water_map,Y ; the color of the sea ; 4 +;ocean_color: +; and #$1f ; 2 +; tay ; 2 +; lda water_map,Y ; the color of the sea ; 4 ;=========== ; 8 @@ -509,10 +528,17 @@ done_screenx_loop: lda SCREEN_Y ; 3 cmp #40 ; LOWRES height ; 2 beq done_screeny ; 2nt/3 + jmp screeny_loop ; too far to branch ; 3 ;============= ; 15 done_screeny: + + + jsr wires_cycle_colors + + + rts ; 6 @@ -523,8 +549,7 @@ done_screeny: - - +.if 0 ;==================== ; lookup_map @@ -541,40 +566,43 @@ lookup_map: tay ; 2 lda SPACEY_I ; 3 - and #CONST_MAP_MASK_Y ; wrap to 64x64 grid ; 2 + and #CONST_MAP_MASK_Y ; wrap to 16x16 grid ; 2 sta SPACEY_I ; 3 asl ; 2 asl ; 2 - asl ; multiply by 8 ; 2 + asl ; multiply by 16 ; 2 + asl clc ; 2 adc SPACEX_I ; add in X value ; 3 ; only valid if x<8 and y<8 ; SPACEX_I is in y - cpy #$8 ; 2 +; cpy #$8 ; 2 ;============ ; 31 - bcs ocean_color_outline ; bgt 8 ;^2nt/3 - ldy SPACEY_I ; 3 - cpy #$8 ; 2 - bcs ocean_color_outline ; bgt 8 ; 2nt/3 +; bcs ocean_color_outline ; bgt 8 ;^2nt/3 +; ldy SPACEY_I ; 3 +; cpy #$8 ; 2 +; bcs ocean_color_outline ; bgt 8 ; 2nt/3 tay ; 2 - lda flying_map,Y ; load from array ; 4 + lda wires_lookup,Y ; load from array ; 4 + tay + lda wires_colorlookup,Y - bcc update_cache_outline ; 3 +; bcc update_cache_outline ; 3 -ocean_color_outline: - and #$1f ; 2 - tay ; 2 - lda water_map,Y ; the color of the sea ; 4 +;ocean_color_outline: +; and #$1f ; 2 +; tay ; 2 +; lda water_map,Y ; the color of the sea ; 4 update_cache_outline: rts ; 6 - +.endif ;====================================== ; draw sky @@ -587,7 +615,7 @@ draw_sky: ; lines 0..6 - lda #COLOR_BOTH_MEDIUMBLUE ; MEDIUMBLUE color ; 2 + lda #COLOR_BOTH_BLACK ; MEDIUMBLUE color ; 2 ldx #39 sky_loop: ; draw line across screen @@ -603,7 +631,7 @@ sky_loop: ; draw line across screen ; Draw Hazy Horizon - lda #$56 ; Horizon is blue/grey ; 2 + lda #$50 ; Horizon is black/grey ; 2 ldx #39 horizon_loop: ; draw line across screen sta $580,X diff --git a/demos/outline2021/demo/gr_copy.s b/demos/outline2021/demo/gr_copy.s new file mode 100644 index 00000000..07e834de --- /dev/null +++ b/demos/outline2021/demo/gr_copy.s @@ -0,0 +1,221 @@ + ;========================================================= + ; gr_copy_from_current, 40x48 version + ;========================================================= + ; copy DRAW_PAGE to $C00 + ; + ; 45 + 2 + 120*(8*9 + 5) -1 + 6 = 9292 + +gr_copy_from_current: + + lda DRAW_PAGE ; 3 + clc ; 2 + adc #$4 ; 2 + sta gr_copy_fline+2 ; 4 + sta gr_copy_fline+8 ; 4 + adc #$1 ; 2 + sta gr_copy_fline+14 ; 4 + sta gr_copy_fline+20 ; 4 + adc #$1 ; 2 + sta gr_copy_fline+26 ; 4 + sta gr_copy_fline+32 ; 4 + adc #$1 ; 2 + sta gr_copy_fline+38 ; 4 + sta gr_copy_fline+44 ; 4 + ;=========== + ; 45 + + ldy #119 ; for early ones, copy 120 bytes ; 2 + +gr_copy_fline: + lda $400,Y ; load a byte (self modified) ; 4 + sta $C00,Y ; store a byte (self modified) ; 5 + + lda $480,Y ; load a byte (self modified) ; 4 + sta $C80,Y ; store a byte (self modified) ; 5 + + lda $500,Y ; load a byte (self modified) ; 4 + sta $D00,Y ; store a byte (self modified) ; 5 + + lda $580,Y ; load a byte (self modified) ; 4 + sta $D80,Y ; store a byte (self modified) ; 5 + + lda $600,Y ; load a byte (self modified) ; 4 + sta $E00,Y ; store a byte (self modified) ; 5 + + lda $680,Y ; load a byte (self modified) ; 4 + sta $E80,Y ; store a byte (self modified) ; 5 + + lda $700,Y ; load a byte (self modified) ; 4 + sta $F00,Y ; store a byte (self modified) ; 5 + + lda $780,Y ; load a byte (self modified) ; 4 + sta $F80,Y ; store a byte (self modified) ; 5 + + dey ; decrement pointer ; 2 + bpl gr_copy_fline ; ; 2nt/3 + + rts ; 6 + + + + ;========================================================= + ; gr_copy_to_current, 40x48 version + ;========================================================= + ; copy 0xc00 to DRAW_PAGE + ; + ; 45 + 2 + 120*(8*9 + 5) -1 + 6 = 9292 +;.align $100 +gr_copy_to_current: + + lda DRAW_PAGE ; 3 + clc ; 2 + adc #$4 ; 2 + sta gr_copy_line+5 ; 4 + sta gr_copy_line+11 ; 4 + adc #$1 ; 2 + sta gr_copy_line+17 ; 4 + sta gr_copy_line+23 ; 4 + adc #$1 ; 2 + sta gr_copy_line+29 ; 4 + sta gr_copy_line+35 ; 4 + adc #$1 ; 2 + sta gr_copy_line+41 ; 4 + sta gr_copy_line+47 ; 4 + ;=========== + ; 45 + + ldy #119 ; for early ones, copy 120 bytes ; 2 + +gr_copy_line: + lda $C00,Y ; load a byte (self modified) ; 4 + sta $400,Y ; store a byte (self modified) ; 5 + + lda $C80,Y ; load a byte (self modified) ; 4 + sta $480,Y ; store a byte (self modified) ; 5 + + lda $D00,Y ; load a byte (self modified) ; 4 + sta $500,Y ; store a byte (self modified) ; 5 + + lda $D80,Y ; load a byte (self modified) ; 4 + sta $580,Y ; store a byte (self modified) ; 5 + + lda $E00,Y ; load a byte (self modified) ; 4 + sta $600,Y ; store a byte (self modified) ; 5 + + lda $E80,Y ; load a byte (self modified) ; 4 + sta $680,Y ; store a byte (self modified) ; 5 + + lda $F00,Y ; load a byte (self modified) ; 4 + sta $700,Y ; store a byte (self modified) ; 5 + + lda $F80,Y ; load a byte (self modified) ; 4 + sta $780,Y ; store a byte (self modified) ; 5 + + dey ; decrement pointer ; 2 + bpl gr_copy_line ; ; 2nt/3 + + rts ; 6 + + + + ;========================================================= + ; gr_copy_to_current, 40x48 version + ;========================================================= + ; copy 0x1000 to DRAW_PAGE + +gr_copy_to_current_1000: + + lda DRAW_PAGE ; 3 + clc ; 2 + adc #$4 ; 2 + sta gr_copy_line_40+5 ; 4 + sta gr_copy_line_40+11 ; 4 + adc #$1 ; 2 + sta gr_copy_line_40+17 ; 4 + sta gr_copy_line_40+23 ; 4 + adc #$1 ; 2 + sta gr_copy_line_40+29 ; 4 + sta gr_copy_line_40+35 ; 4 + adc #$1 ; 2 + sta gr_copy_line_40+41 ; 4 + sta gr_copy_line_40+47 ; 4 + ;=========== + ; 45 + + ldy #119 ; for early ones, copy 120 bytes ; 2 + +gr_copy_line_40: + lda $1000,Y ; load a byte (self modified) ; 4 + sta $400,Y ; store a byte (self modified) ; 5 + + lda $1080,Y ; load a byte (self modified) ; 4 + sta $480,Y ; store a byte (self modified) ; 5 + + lda $1100,Y ; load a byte (self modified) ; 4 + sta $500,Y ; store a byte (self modified) ; 5 + + lda $1180,Y ; load a byte (self modified) ; 4 + sta $580,Y ; store a byte (self modified) ; 5 + + lda $1200,Y ; load a byte (self modified) ; 4 + sta $600,Y ; store a byte (self modified) ; 5 + + lda $1280,Y ; load a byte (self modified) ; 4 + sta $680,Y ; store a byte (self modified) ; 5 + + lda $1300,Y ; load a byte (self modified) ; 4 + sta $700,Y ; store a byte (self modified) ; 5 + + lda $1380,Y ; load a byte (self modified) ; 4 + sta $780,Y ; store a byte (self modified) ; 5 + + dey ; decrement pointer ; 2 + bpl gr_copy_line_40 ; ; 2nt/3 + + rts ; 6 + + + + ;========================================================= + ; gr_copy_to_current_40x40 + ;========================================================= + ; Take image in 0xc00 + ; Copy to DRAW_PAGE + ; Actually copy lines 0..39 + ; Don't over-write bottom 4 lines of text +gr_copy_to_current_40x40: + + ldx #0 +gc_40x40_loop: + lda gr_offsets,x + sta OUTL + sta INL + lda gr_offsets+1,x + clc + adc DRAW_PAGE + sta OUTH + + lda gr_offsets+1,x + clc + adc #$8 + sta INH + + ldy #39 +gc_40x40_inner: + lda (INL),Y + sta (OUTL),Y + + dey + bpl gc_40x40_inner + + inx + inx + + cpx #40 + bne gc_40x40_loop + + rts ; 6 + + + + diff --git a/demos/outline2021/demo/hardware.inc b/demos/outline2021/demo/hardware.inc index 6e5d846b..0ea6d65f 100644 --- a/demos/outline2021/demo/hardware.inc +++ b/demos/outline2021/demo/hardware.inc @@ -40,6 +40,7 @@ HLINE = $F819 ; HLINE Y,$2C at A VLINE = $F828 ; VLINE A,$2D at Y CLRSCR = $F832 ; Clear low-res screen CLRTOP = $F836 ; clear only top of low-res screen +GBASCALC = $F847 ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) SETGR = $FB40 ; GR SETCOL = $F864 ; COLOR=A TEXT = $FB36 diff --git a/demos/outline2021/demo/mAZE_-_Apple_snapple_Outline.pt3 b/demos/outline2021/demo/mAZE_-_Apple_snapple_Outline.pt3 new file mode 100644 index 0000000000000000000000000000000000000000..d8fc5bceba684cc1a27e0e8b0c9854016aa4363d GIT binary patch literal 2935 zcmb_eU2hvj6rGt}d+j(R{oo^^P__~hec?k?hzFk12E-dtn#i&gwHRYaN*c#eSlL=R zT`VVV+BBu=18+z?Ao0lj1k)ze(n>ptB}ecZc;OeAbH{6YqeN{XSbKJ6uJ2s$Idkt_ zPpuSYR-#0KA^s2-4YE{>rty~P znvcylV#_hQ{~T+_-izOg@5F7ZVA1_oYcG)Tj1-yl?93FC3DwRqIjmYuDRM!M;ahWB zifc{Pf}gu5d8VlX7;bb;CQKrmlV%$J+DTh-lBeO9QBvf4Tk#Hu)0MI-o<*PF`6RztOq4+EDwaDm$nezXAwiDI~Iy=Ob2emE9iHPtSOZ@NDC z2JXppb9FrEy+`W0hh_Wkq#e>Jki3NO5JM|j#`7xV4|k+dmZBt0=Riv&K#A-nSlt6@ zuJs(BA)C{w=(&!%09x~EvxhG`5cHsGR zj~_bPm;}a{|>jI}<5UU42ua3BPGn-!;jn^_FX4^-+LB)z>efu&Pjy z+7#wTzxtf8`kYCpSAE(v0U4bzkGk2Vf;t@@Qg&UBHIf>0kb-Yb#;ZQ6b5}j;=E+(& z#RFLNCQpyBVpD}SJ%YXMqmoZmwIb+N`9VLz6j3vI^rgNcX=(PIv?3YF$!`vd%y-4X zq~%gOqCN#t28mD%i54e|y>`?$^}3N1mC&m)S?PIcla?*a0ki|5R+}J;CoHZ?Qzvy; z$|@-NuBIr5bUA=4+`wMD*Q(yFZUQ{B{mz2!9QX_b2swsyy9#B)1USOC-+l+=j+idv z!9v2`z%62;gAwIY862GMLG!W;m0V&4OMv6Y3#0}`JdjqT%&vNj90+Rb_4S(f)Bu~< zyrl!wrAaZcx9vND9C2Dwtm>@z-(#@`*ny%1X%|1JDZhiP!e{3tpd4*T#ZyYF#8;Fk<` z&okIvX0lDsWVZ<{#_9ww#x^>D7iSyH!U(X$*m!J|acjim$q^<}=NTjL9$v@1hu1KV z;vCkm0^`6K@CxuU@FH*)I0KvpUwq<2XGcG0e339)) color=0; + ; else if ((yp<0) || (yp>39)) color=0; + ; else color=scrn_page(xp,yp,PAGE2); + + ; we know it's never going to go *that* far out of bounds + ; so we could avoid the Y check by just having "0" + ; on the edges of the screen? Tricky due to Apple II + ; interlacing + +croto_color_even_smc: + lda #0 ; default color ; 2 + + ldy XPH ; 3 + bmi crplot ; 2nt/3 + cpy #40 ; 2 + bcs crplot ; 2nt/3 + + ldy YPH ; 3 + bmi crplot ; 2nt/3 + cpy #40 ; 2 + bcs crplot ; 2nt/3 + + + +;================================================== + + ; scrn(xp,yp) + + tya ; YPH ; 2 + + lsr ; divide to get index, also low bit in carry ; 2 + tay ; 2 + + ; TODO: put these in zero page? + ; also we can share low bytes with other lookup + + lda common_offsets_l,Y ; lookup low-res memory address ; 4 + sta BASL ; 3 + lda scrn_c00_offsets_h,Y ; 4 + sta BASH ; 3 + + + ldy XPH ; 3 + lda (BASL),Y ; top/bottom color ; 5+ + + ; carry was set a bit before to low bit of YPH + ; hopefully nothing has cleared it + + bcc crscrn_adjust_even ; 2nt/3 + +crscrn_adjust_odd: + ; YP was odd so want top nibble + lsr ; 2 + lsr ; 2 + lsr ; 2 + lsr ; 2 + + ; fall through + +crscrn_adjust_even: + + ; YP was even so want bottom nibble + and #$f ; 2 + +crscrn_done: + + + +;============================================= + + +; always even, want A in bottom of nibble +; so we are all set + +crotozoom_set_color: + ; want same color in top and bottom nibbles + ;========== + ; 0 + +;================================================= + +crplot: + + ; plot(xx,yy); (color is in A) + + ; we are in loop unroll0 so always even line here + + ; meaning we want to load old color, save top nibble, and over-write + ; bottom nibble with our value + + ; but! we don't need to save old as we are re-drawing whole screen! + +crplot_even: + +crplot2_smc: + sta $400,X ; 5 + ;============ + ; 5 + +;======================= + + ; xp=xp+ca; fixed point 8.8 + + clc ; 2 + lda CAL ; 3 + adc XPL ; 3 + sta XPL ; 3 + lda CAH ; 3 + adc XPH ; 3 + sta XPH ; 3 + + ; yp=yp-sa; fixed point 8.8 + + sec ; 2 + lda YPL ; 3 + sbc SAL ; 3 + sta YPL ; 3 + lda YPH ; 3 + sbc SAH ; 3 + sta YPH ; 3 + +crotozoom_end_xloop: + inx ; 2 + cpx #40 ; 2 + bne crotozoom_xloop ; 2nt/3 +crotozoom_xloop_done: + + + + ; yca+=ca; 8.8 fixed point + + clc ; 2 + lda YCAL ; 3 + adc CAL ; 3 + sta YCAL ; 3 + lda YCAH ; 3 + adc CAH ; 3 + sta YCAH ; 3 + ;=========== + ; 20 + + ; ysa+=sa; 8.8 fixed point + + clc ; 2 + lda YSAL ; 3 + adc SAL ; 3 + sta YSAL ; 3 + lda YSAH ; 3 + adc SAH ; 3 + sta YSAH ; 3 + ;========== + ; 20 + + +;=============== +; loop unroll 1 +;=============== + +;rotozoom_yloop: + + ; xp=cca+ysa; 8.8 fixed point + clc ; 2 + lda YSAL ; 3 + adc CCAL ; 3 + sta XPL ; 3 + lda YSAH ; 3 + adc CCAH ; 3 + sta XPH ; 3 + ;========== + ; 20 + + ; yp=yca-csa; 8.8 fixed point + + sec ; 2 + lda YCAL ; 3 + sbc CSAL ; 3 + sta YPL ; 3 + lda YCAH ; 3 + sbc CSAH ; 3 + sta YPH ; 3 + ;=========== + ; 20 + + ; for(xx=0;xx<40;xx++) { + ldx #0 ; 2 +crotozoom_xloop2: + + + + ;=================================================================== + ;=================================================================== + ; note: every cycle saved below here + ; saves 1600 cycles + ;=================================================================== + ;=================================================================== + + ; if ((xp<0) || (xp>39)) color=0; + ; else if ((yp<0) || (yp>39)) color=0; + ; else color=scrn_page(xp,yp,PAGE2); + + ; we know it's never going to go *that* far out of bounds + ; so we could avoid the Y check by just having "0" + ; on the edges of the screen? Tricky due to Apple II + ; interlacing + +croto_color_odd_smc: + lda #0 ; default color ; 2 + + ldy XPH ; 3 + bmi crplot2 ; 2nt/3 + cpy #40 ; 2 + bcs crplot2 ; 2nt/3 + + ldy YPH ; 3 + bmi crplot2 ; 2nt/3 + cpy #40 ; 2 + bcs crplot2 ; 2nt/3 + + + +;================================================== + + ; scrn(xp,yp) + + tya ; YPH ; 2 + + lsr ; divide to get index, also low bit in carry ; 2 + tay ; 2 + + ; TODO: put these in zero page? + ; also we can share low bytes with other lookup + + lda common_offsets_l,Y ; lookup low-res memory address ; 4 + sta BASL ; 3 + lda scrn_c00_offsets_h,Y ; 4 + sta BASH ; 3 + + + ldy XPH ; 3 + lda (BASL),Y ; top/bottom color ; 5+ + + ; carry was set a bit before to low bit of YPH + ; hopefully nothing has cleared it + + bcs crscrn_adjust_odd2 ; 3 + +crscrn_adjust_even2: + + ; want bottom color, but put it in top of A + asl ; 2 + asl ; 2 + asl ; 2 + asl ; 2 + + jmp crscrn_done2 ; 3 + +crscrn_adjust_odd2: + ; want top color alone + + and #$f0 ; 2 + +crscrn_done2: + + + +;============================================= + + +crotozoom_set_color2: + ; always odd + ; want color in top, which it is from above + ;========== + ; 0 + +;================================================= + +crplot2: + + ; plot(xx,yy); (color is in A) + + ; always odd, so place color in top + + ; note! since we are drawing whole screen, we know the top of + ; the value is already clear from loop=0 so we don't have to mask + +crplot_odd: +crplot12_smc: + ora $400,X ; 4 +crplot22_smc: + sta $400,X ; 5 + + ;============ + ; 9 + +;======================= + + ; xp=xp+ca; 8.8 fixed point + + clc ; 2 + lda CAL ; 3 + adc XPL ; 3 + sta XPL ; 3 + lda CAH ; 3 + adc XPH ; 3 + sta XPH ; 3 + + ; yp=yp-sa; 8.8 fixed point + + sec ; 2 + lda YPL ; 3 + sbc SAL ; 3 + sta YPL ; 3 + lda YPH ; 3 + sbc SAH ; 3 + sta YPH ; 3 + +crotozoom_end_xloop2: + inx ; 2 + cpx #40 ; 2 + bne crotozoom_xloop2 ; 3 +crotozoom_xloop_done2: + + ; yca+=ca; 8.8 fixed point + + clc ; 2 + lda YCAL ; 3 + adc CAL ; 3 + sta YCAL ; 3 + lda YCAH ; 3 + adc CAH ; 3 + sta YCAH ; 3 + ;=========== + ; 20 + + ; ysa+=sa; 8.8 fixed point + + clc ; 2 + lda YSAL ; 3 + adc SAL ; 3 + sta YSAL ; 3 + lda YSAH ; 3 + adc SAH ; 3 + sta YSAH ; 3 + ;========== + ; 20 + +crotozoom_end_yloop: + inc YY ; 5 + ldy YY ; 3 + cpy #24 ; 2 + beq cdone_rotozoom ; 2nt/3 + jmp crotozoom_yloop ; too far ; 3 + +cdone_rotozoom: + rts ; 6 + + +fixed_sin32: +; .byte $00,$00 ; 0.000000=00.00 +; .byte $00,$61 ; 0.382683=00.61 +; .byte $00,$b5 ; 0.707107=00.b5 +; .byte $00,$ec ; 0.923880=00.ec +; .byte $01,$00 ; 1.000000=01.00 +; .byte $00,$ec ; 0.923880=00.ec +; .byte $00,$b5 ; 0.707107=00.b5 +; .byte $00,$61 ; 0.382683=00.61 +; .byte $00,$00 ; 0.000000=00.00 +; .byte $ff,$9f ; -0.382683=ff.9f +; .byte $ff,$4b ; -0.707107=ff.4b +; .byte $ff,$14 ; -0.923880=ff.14 +; .byte $ff,$00 ; -1.000000=ff.00 +; .byte $ff,$14 ; -0.923880=ff.14 +; .byte $ff,$4b ; -0.707107=ff.4b +; .byte $ff,$9f ; -0.382683=ff.9f + + .byte $00,$00 ; 0.000000 + .byte $00,$31 ; 0.195090 + .byte $00,$61 ; 0.382683 + .byte $00,$8E ; 0.555570 + .byte $00,$B5 ; 0.707107 + .byte $00,$D4 ; 0.831470 + .byte $00,$EC ; 0.923880 + .byte $00,$FB ; 0.980785 + .byte $01,$00 ; 1.000000 + .byte $00,$FB ; 0.980785 + .byte $00,$EC ; 0.923880 + .byte $00,$D4 ; 0.831470 + .byte $00,$B5 ; 0.707107 + .byte $00,$8E ; 0.555570 + .byte $00,$61 ; 0.382683 + .byte $00,$31 ; 0.195090 + .byte $00,$00 ; 0.000000 + .byte $FF,$CF ; -0.195090 + .byte $FF,$9F ; -0.382683 + .byte $FF,$72 ; -0.555570 + .byte $FF,$4B ; -0.707107 + .byte $FF,$2C ; -0.831470 + .byte $FF,$14 ; -0.923880 + .byte $FF,$05 ; -0.980785 + .byte $FF,$00 ; -1.000000 + .byte $FF,$05 ; -0.980785 + .byte $FF,$14 ; -0.923880 + .byte $FF,$2C ; -0.831470 + .byte $FF,$4B ; -0.707107 + .byte $FF,$72 ; -0.555570 + .byte $FF,$9F ; -0.382683 + .byte $FF,$CF ; -0.195090 + diff --git a/demos/outline2021/demo/rotozoom_texture.s b/demos/outline2021/demo/rotozoom_texture.s new file mode 100644 index 00000000..aefcb132 --- /dev/null +++ b/demos/outline2021/demo/rotozoom_texture.s @@ -0,0 +1,599 @@ + + ; rotozoomer! + ; with 16x16 texture + + ; takes a lores-formatted image in $c00 and rotozooms it + ; by ANGLE and SCALE_I/SCALE_F and draws it to the + ; lo-res page in DRAW_PAGE + + ; ANGLE in our case is 0..31 + ; SCALE_I/SCALE_F is 8.8 fixed point scale multiplier + + +; $2E7CF = 190,415 = 5.25fps first merging +; $2D8CF = 186,575 = 5.35fps move mask to rotate not draw +; $29CCF = 171,215 = 5.84fps do color conversion outside of loop +; $28DCF = 167,375 = 5.97fps two lookup tables for hi/low +; $26FCF = 159,695 = 6.26fps remove carry set/clear for fixed point adds + +CAL = $B0 +CAH = $B1 +SAL = $B2 +SAH = $B3 +YPL = $B4 +YPH = $B5 +XPL = $B6 +XPH = $B7 +;YY +;XX +CCAL = $B8 +CCAH = $B9 +CSAL = $BA +CSAH = $BB +YCAL = $BC +YCAH = $BD +YSAL = $BE +YSAH = $BF + +rotozoom: + + ; setup scale for multiply + + lda SCALE_I ; 3 + sta NUM1H ; 3 + lda SCALE_F ; 3 + sta NUM1L ; 3 + + ; ca = cos(theta)*scale; + ; (we use equiv ca=fixed_sin[(theta+8)&0xf] ) + + lda ANGLE ; 3 + clc ; 2 + adc #16 ; 2 + and #$3f ; 2 + asl ; 2 + tay ; 2 + lda fixed_sin64,Y ; load integer half ; 4 + sta NUM2H ; 3 + lda fixed_sin64+1,Y ; load float half ; 4 + sta NUM2L ; 3 + ;=========== + ; 27 + + sec ; reload NUM1H/NUM1L ; 2 + jsr multiply ; 6+??? + stx CAH ; 3 + sta CAL ; 3 + + + ; sa = sin(theta)*scale; + + lda ANGLE ; 3 + asl ; 2 + tay ; 2 + lda fixed_sin64,Y ; load integer half ; 4 + sta NUM2H ; 3 + lda fixed_sin64+1,Y ; load integer half ; 4 + sta NUM2L ; 3 + ;========== + ; 21 + + + clc ; NUM1H/NUM1L same as last time ; 2 + jsr multiply ; 6+??? + + stx SAH ; 3 + sta SAL ; 3 + + + ; cca = -20*ca; + + lda #-20 ; 2 + sta NUM1H ; 3 + lda #0 ; 2 + sta NUM1L ; 3 + + lda CAL ; 3 + sta NUM2L ; 3 + lda CAH ; 3 + sta NUM2H ; 3 + + sec ; reload NUM1H/NUM1L ; 2 + jsr multiply ; 6+??? + stx CCAH ; 3 + sta CCAL ; 3 + + + ; csa = -20*sa; + + lda SAL ; 3 + sta NUM2L ; 3 + lda SAH ; 3 + sta NUM2H ; 3 + + clc ; same NUM1H/NUM1L as las time ; 2 + jsr multiply ; 6+??? + + stx CSAH ; 3 + sta CSAL ; 3 + + + ; yca=cca+ycenter; + + lda CCAL ; 3 + sta YCAL ; 3 + clc ; 2 + lda CCAH ; 3 + adc #20 ; 2 + sta YCAH ; 3 + ;=========== + ; 16 + ; ysa=csa+xcenter; + + lda CSAL ; 3 + sta YSAL ; 3 + clc ; 2 + lda CSAH ; 3 + adc #20 ; 2 + sta YSAH ; 3 + ;=========== + ; 16 + + ; yloop, unrolled once + ;=================================================================== + ; for(yy=0;yy<40;yy++) { + ;=================================================================== + + ldy #0 ; 2 + sty YY ; 3 + +rotozoom_yloop: + + ; setup self-modifying code for plot + ; YY already in Y from end of loop +; ldy YY ; 3 + + lda common_offsets_l,Y ; lookup low-res memory address ; 4 + sta rplot2_smc+1 ; 4 + sta rplot12_smc+1 ; 4 + sta rplot22_smc+1 ; 4 + + clc ; 2 + lda gr_400_offsets_h,Y ; 4 + adc DRAW_PAGE ; add in draw page offset ; 3 + sta rplot2_smc+2 ; 4 + sta rplot12_smc+2 ; 4 + sta rplot22_smc+2 ; 4 + + + +;===================== +; unroll 0, even line +;===================== + + + ; xp=cca+ysa; 8.8 fixed point + clc ; 2 + lda YSAL ; 3 + adc CCAL ; 3 + sta XPL ; 3 + lda YSAH ; 3 + adc CCAH ; 3 + sta XPH ; 3 + ;========== + ; 20 + + ; yp=yca-csa; 8.8 fixed point + + sec ; 2 + lda YCAL ; 3 + sbc CSAL ; 3 + sta YPL ; 3 + lda YCAH ; 3 + sbc CSAH ; 3 + sta YPH ; 3 + ;=========== + ; 20 + + + + ; for(xx=0;xx<40;xx++) { + ldx #0 ; 2 +rotozoom_xloop: + + + + ;=================================================================== + ;=================================================================== + ; note: every cycle saved below here + ; saves 1600 cycles + ;=================================================================== + ;=================================================================== + + + lda XPH ; 3 + and #$f ; 2 + sta CTEMP ; 3 + + lda YPH ; 3 + asl ; 2 + asl ; 2 + asl ; 2 + asl ; 2 + clc ; 2 + adc CTEMP ; 3 + tay ; 2 + + lda low_lookup,Y ; 4 + + ;============ + ; 30 +rscrn_done: + + + +;============================================= + + +; always even, want A in bottom of nibble +; so we are all set + +rotozoom_set_color: + ; want same color in top and bottom nibbles + ;========== + ; 0 + +;================================================= + +rplot: + + ; plot(xx,yy); (color is in A) + + ; we are in loop unroll0 so always even line here + + ; meaning we want to load old color, save top nibble, and over-write + ; bottom nibble with our value + + ; but! we don't need to save old as we are re-drawing whole screen! + +rplot_even: + +rplot2_smc: + sta $400,X ; 5 + ;============ + ; 5 + +;======================= + + ; xp=xp+ca; fixed point 8.8 + +; always set? also low importance LSB +; clc ; 2 + lda CAL ; 3 + adc XPL ; 3 + sta XPL ; 3 + lda CAH ; 3 + adc XPH ; 3 + sta XPH ; 3 + + ; yp=yp-sa; fixed point 8.8 + +; low importance LSB? +; sec ; 2 + lda YPL ; 3 + sbc SAL ; 3 + sta YPL ; 3 + lda YPH ; 3 + sbc SAH ; 3 + sta YPH ; 3 + +rotozoom_end_xloop: + inx ; 2 + cpx #40 ; 2 + bne rotozoom_xloop ; 2nt/3 +rotozoom_xloop_done: + + + + ; yca+=ca; 8.8 fixed point + + clc ; 2 + lda YCAL ; 3 + adc CAL ; 3 + sta YCAL ; 3 + lda YCAH ; 3 + adc CAH ; 3 + sta YCAH ; 3 + ;=========== + ; 20 + + ; ysa+=sa; 8.8 fixed point + + clc ; 2 + lda YSAL ; 3 + adc SAL ; 3 + sta YSAL ; 3 + lda YSAH ; 3 + adc SAH ; 3 + sta YSAH ; 3 + ;========== + ; 20 + + +;=============== +; loop unroll 1 +;=============== + +;rotozoom_yloop: + + ; xp=cca+ysa; 8.8 fixed point + clc ; 2 + lda YSAL ; 3 + adc CCAL ; 3 + sta XPL ; 3 + lda YSAH ; 3 + adc CCAH ; 3 + sta XPH ; 3 + ;========== + ; 20 + + ; yp=yca-csa; 8.8 fixed point + + sec ; 2 + lda YCAL ; 3 + sbc CSAL ; 3 + sta YPL ; 3 + lda YCAH ; 3 + sbc CSAH ; 3 + sta YPH ; 3 + ;=========== + ; 20 + + ; for(xx=0;xx<40;xx++) { + ldx #0 ; 2 +rotozoom_xloop2: + + + + ;=================================================================== + ;=================================================================== + ; note: every cycle saved below here + ; saves 1600 cycles + ;=================================================================== + ;=================================================================== + + ; if ((xp<0) || (xp>39)) color=0; + ; else if ((yp<0) || (yp>39)) color=0; + ; else color=scrn_page(xp,yp,PAGE2); + + ; we know it's never going to go *that* far out of bounds + ; so we could avoid the Y check by just having "0" + ; on the edges of the screen? Tricky due to Apple II + ; interlacing + + lda XPH + and #$f + sta CTEMP + + lda YPH + asl + asl + asl + asl + clc + adc CTEMP + tay + + lda high_lookup,Y +; and #$f0 + +;============================================= + + +rotozoom_set_color2: + ; always odd + ; want color in top, which it is from above + ;========== + ; 0 + +;================================================= + +rplot2: + + ; plot(xx,yy); (color is in A) + + ; always odd, so place color in top + + ; note! since we are drawing whole screen, we know the top of + ; the value is already clear from loop=0 so we don't have to mask + +rplot_odd: +rplot12_smc: + ora $400,X ; 4 +rplot22_smc: + sta $400,X ; 5 + + ;============ + ; 9 + +;======================= + + ; xp=xp+ca; 8.8 fixed point + +; clc ; 2 + lda CAL ; 3 + adc XPL ; 3 + sta XPL ; 3 + lda CAH ; 3 + adc XPH ; 3 + sta XPH ; 3 + + ; yp=yp-sa; 8.8 fixed point + +; sec ; 2 + lda YPL ; 3 + sbc SAL ; 3 + sta YPL ; 3 + lda YPH ; 3 + sbc SAH ; 3 + sta YPH ; 3 + +rotozoom_end_xloop2: + inx ; 2 + cpx #40 ; 2 + bne rotozoom_xloop2 ; 3 +rotozoom_xloop_done2: + + ; yca+=ca; 8.8 fixed point + + clc ; 2 + lda YCAL ; 3 + adc CAL ; 3 + sta YCAL ; 3 + lda YCAH ; 3 + adc CAH ; 3 + sta YCAH ; 3 + ;=========== + ; 20 + + ; ysa+=sa; 8.8 fixed point + + clc ; 2 + lda YSAL ; 3 + adc SAL ; 3 + sta YSAL ; 3 + lda YSAH ; 3 + adc SAH ; 3 + sta YSAH ; 3 + ;========== + ; 20 + +rotozoom_end_yloop: + inc YY ; 5 + ldy YY ; 3 + cpy #24 ; 2 + beq done_rotozoom ; 2nt/3 + jmp rotozoom_yloop ; too far ; 3 + +done_rotozoom: + rts ; 6 + + + +fixed_sin64: +; .byte $00,$00 ; 0.000000=00.00 +; .byte $00,$61 ; 0.382683=00.61 +; .byte $00,$b5 ; 0.707107=00.b5 +; .byte $00,$ec ; 0.923880=00.ec +; .byte $01,$00 ; 1.000000=01.00 +; .byte $00,$ec ; 0.923880=00.ec +; .byte $00,$b5 ; 0.707107=00.b5 +; .byte $00,$61 ; 0.382683=00.61 +; .byte $00,$00 ; 0.000000=00.00 +; .byte $ff,$9f ; -0.382683=ff.9f +; .byte $ff,$4b ; -0.707107=ff.4b +; .byte $ff,$14 ; -0.923880=ff.14 +; .byte $ff,$00 ; -1.000000=ff.00 +; .byte $ff,$14 ; -0.923880=ff.14 +; .byte $ff,$4b ; -0.707107=ff.4b +; .byte $ff,$9f ; -0.382683=ff.9f + +.if 0 + .byte $00,$00 ; 0.000000 + .byte $00,$31 ; 0.195090 + .byte $00,$61 ; 0.382683 + .byte $00,$8E ; 0.555570 + .byte $00,$B5 ; 0.707107 + .byte $00,$D4 ; 0.831470 + .byte $00,$EC ; 0.923880 + .byte $00,$FB ; 0.980785 + .byte $01,$00 ; 1.000000 + .byte $00,$FB ; 0.980785 + .byte $00,$EC ; 0.923880 + .byte $00,$D4 ; 0.831470 + .byte $00,$B5 ; 0.707107 + .byte $00,$8E ; 0.555570 + .byte $00,$61 ; 0.382683 + .byte $00,$31 ; 0.195090 + .byte $00,$00 ; 0.000000 + .byte $FF,$CF ; -0.195090 + .byte $FF,$9F ; -0.382683 + .byte $FF,$72 ; -0.555570 + .byte $FF,$4B ; -0.707107 + .byte $FF,$2C ; -0.831470 + .byte $FF,$14 ; -0.923880 + .byte $FF,$05 ; -0.980785 + .byte $FF,$00 ; -1.000000 + .byte $FF,$05 ; -0.980785 + .byte $FF,$14 ; -0.923880 + .byte $FF,$2C ; -0.831470 + .byte $FF,$4B ; -0.707107 + .byte $FF,$72 ; -0.555570 + .byte $FF,$9F ; -0.382683 + .byte $FF,$CF ; -0.195090 +.endif + + .byte $00,$00 ; 0.000000 + .byte $00,$19 ; 0.098017 + .byte $00,$31 ; 0.195090 + .byte $00,$4A ; 0.290285 + .byte $00,$61 ; 0.382683 + .byte $00,$78 ; 0.471397 + .byte $00,$8E ; 0.555570 + .byte $00,$A2 ; 0.634393 + .byte $00,$B5 ; 0.707107 + .byte $00,$C5 ; 0.773010 + .byte $00,$D4 ; 0.831470 + .byte $00,$E1 ; 0.881921 + .byte $00,$EC ; 0.923880 + .byte $00,$F4 ; 0.956940 + .byte $00,$FB ; 0.980785 + .byte $00,$FE ; 0.995185 + .byte $01,$00 ; 1.000000 + .byte $00,$FE ; 0.995185 + .byte $00,$FB ; 0.980785 + .byte $00,$F4 ; 0.956940 + .byte $00,$EC ; 0.923880 + .byte $00,$E1 ; 0.881921 + .byte $00,$D4 ; 0.831470 + .byte $00,$C5 ; 0.773010 + .byte $00,$B5 ; 0.707107 + .byte $00,$A2 ; 0.634393 + .byte $00,$8E ; 0.555570 + .byte $00,$78 ; 0.471397 + .byte $00,$61 ; 0.382683 + .byte $00,$4A ; 0.290285 + .byte $00,$31 ; 0.195090 + .byte $00,$19 ; 0.098017 + .byte $00,$00 ; 0.000000 + .byte $FF,$E7 ; -0.098017 + .byte $FF,$CF ; -0.195090 + .byte $FF,$B6 ; -0.290285 + .byte $FF,$9F ; -0.382683 + .byte $FF,$88 ; -0.471397 + .byte $FF,$72 ; -0.555570 + .byte $FF,$5E ; -0.634393 + .byte $FF,$4B ; -0.707107 + .byte $FF,$3B ; -0.773010 + .byte $FF,$2C ; -0.831470 + .byte $FF,$1F ; -0.881921 + .byte $FF,$14 ; -0.923880 + .byte $FF,$0C ; -0.956940 + .byte $FF,$05 ; -0.980785 + .byte $FF,$02 ; -0.995185 + .byte $FF,$00 ; -1.000000 + .byte $FF,$02 ; -0.995185 + .byte $FF,$05 ; -0.980785 + .byte $FF,$0C ; -0.956940 + .byte $FF,$14 ; -0.923880 + .byte $FF,$1F ; -0.881921 + .byte $FF,$2C ; -0.831470 + .byte $FF,$3B ; -0.773010 + .byte $FF,$4B ; -0.707107 + .byte $FF,$5E ; -0.634393 + .byte $FF,$72 ; -0.555570 + .byte $FF,$88 ; -0.471397 + .byte $FF,$9F ; -0.382683 + .byte $FF,$B6 ; -0.290285 + .byte $FF,$CF ; -0.195090 + .byte $FF,$E7 ; -0.098017 diff --git a/demos/outline2021/demo/tfv_flying.s b/demos/outline2021/demo/tfv_flying.s index 06be9ee2..0c9c11ff 100644 --- a/demos/outline2021/demo/tfv_flying.s +++ b/demos/outline2021/demo/tfv_flying.s @@ -5,8 +5,8 @@ ; CONSTANTS ;=========== CONST_SHIPX = 15 -CONST_TILE_W = 64 -CONST_TILE_H = 64 +CONST_TILE_W = 16 +CONST_TILE_H = 16 CONST_MAP_MASK_X = (CONST_TILE_W - 1) CONST_MAP_MASK_Y = (CONST_TILE_H - 1) CONST_LOWRES_W = 40 @@ -36,6 +36,12 @@ mode7_flying: lda #4 sta DRAW_PAGE + ;=============== + ; Init texture + ;=============== + + jsr wires_create_lookup + ;=============== ; Init Variables ;=============== @@ -238,6 +244,7 @@ check_land: cmp #13 bne check_help +.if 0 ;===== ; LAND ;===== @@ -298,7 +305,7 @@ done_flying: rts ; finish flying must_land_on_grass: - +.endif check_help: cmp #('H') @@ -382,6 +389,7 @@ speed_loop: draw_background: jsr draw_background_mode7 ; 6 +.if 0 check_over_water: ; See if we are over water lda CX_I ; 3 @@ -424,7 +432,7 @@ no_turning_splash: lda #1 ; 2 sta DRAW_SPLASH ; 3 - +.endif no_splash: ;============== @@ -627,22 +635,18 @@ update_z_factor: -flying_map: - .byte $22,$ff,$ff,$ff, $ff,$ff,$ff,$22 - .byte $dd,$cc,$cc,$88, $44,$44,$00,$dd - .byte $dd,$cc,$cc,$cc, $88,$44,$44,$dd - .byte $dd,$cc,$cc,$88, $44,$44,$44,$dd - .byte $dd,$cc,$99,$99, $88,$44,$44,$dd - .byte $dd,$cc,$99,$88, $44,$44,$44,$dd - .byte $dd,$cc,$99,$99, $11,$44,$44,$dd - .byte $22,$dd,$dd,$dd, $dd,$dd,$dd,$22 +;flying_map: +; .byte $22,$ff,$ff,$ff, $ff,$ff,$ff,$22 +; .byte $dd,$cc,$cc,$88, $44,$44,$00,$dd +; .byte $dd,$cc,$cc,$cc, $88,$44,$44,$dd +; .byte $dd,$cc,$cc,$88, $44,$44,$44,$dd +; .byte $dd,$cc,$99,$99, $88,$44,$44,$dd +; .byte $dd,$cc,$99,$88, $44,$44,$44,$dd +; .byte $dd,$cc,$99,$99, $11,$44,$44,$dd +; .byte $22,$dd,$dd,$dd, $dd,$dd,$dd,$22 + -water_map: - .byte $22,$22,$22,$22, $22,$22,$22,$22 - .byte $ee,$22,$22,$22, $22,$22,$22,$22 - .byte $22,$22,$22,$22, $22,$22,$22,$22 - .byte $22,$22,$22,$22, $ee,$22,$22,$22 ;=============================================== diff --git a/demos/outline2021/demo/wires.s b/demos/outline2021/demo/wires.s index be613ce4..7d49987a 100644 --- a/demos/outline2021/demo/wires.s +++ b/demos/outline2021/demo/wires.s @@ -123,7 +123,7 @@ color_notblack: inc FRAME lda FRAME - cmp #$40 + cmp #$32 bne wires_forever_loop rts diff --git a/demos/outline2021/demo/zp.inc b/demos/outline2021/demo/zp.inc index d169c2c8..2392d5c9 100644 --- a/demos/outline2021/demo/zp.inc +++ b/demos/outline2021/demo/zp.inc @@ -107,6 +107,8 @@ LOAD_WORLD = $A8 LASTKEY = $A9 KEY_OFFSET = $AA KEY_COUNT = $AB +SCALE_I = $AC +SCALE_F = $AD SHIPY = $E4 ; mode7 @@ -126,6 +128,7 @@ TINH = $F1 YPOS = $F1 ; shimmer XHIGH = $F1 ; credits X0 = $F1 ; a2 +YY = $F1 ; plasma BINL = $F2 DIRECTION = $F2 ; shimmer @@ -133,7 +136,7 @@ Y1 = $F2 ; a2 LOGO_OFFSET = $F2 ; credits BINH = $F3 - +REV_COUNT = $F4 ; plasma SCROLL_COUNT = $F9 diff --git a/graphics/gr/boxes/Makefile b/graphics/gr/boxes/Makefile index ca74a436..be54ac24 100644 --- a/graphics/gr/boxes/Makefile +++ b/graphics/gr/boxes/Makefile @@ -7,12 +7,13 @@ EMPTYDISK = ../../../empty_disk/empty.dsk all: boxes.dsk make_boxes -boxes.dsk: HELLO A2_BOXES BOXES RR +boxes.dsk: HELLO A2_BOXES BOXES RR NYAN cp $(EMPTYDISK) boxes.dsk $(DOS33) -y boxes.dsk SAVE A HELLO $(DOS33) -y boxes.dsk BSAVE -a 0x300 BOXES $(DOS33) -y boxes.dsk BSAVE -a 0xC00 A2_BOXES $(DOS33) -y boxes.dsk BSAVE -a 0xC00 RR + $(DOS33) -y boxes.dsk BSAVE -a 0xC00 NYAN ### @@ -35,6 +36,15 @@ RR: rr.o rr.o: rr.s ca65 -o rr.o rr.s -l rr.lst +### + +NYAN: nyan.o + ld65 -o NYAN nyan.o -C $(LINKERSCRIPTS)/apple2_c00.inc + +nyan.o: nyan.s + ca65 -o nyan.o nyan.s -l nyan.lst + + ### diff --git a/graphics/gr/boxes/nyan.data b/graphics/gr/boxes/nyan.data index cf714d86..3e5394e3 100644 --- a/graphics/gr/boxes/nyan.data +++ b/graphics/gr/boxes/nyan.data @@ -1,19 +1,19 @@ -0 0 39 0 47 ; background (x1 x2 y1 y2) +2 0 39 0 47 ; background (x1 x2 y1 y2) 8 15 25 20 30 ; pastry -3 16 24 20 28 ; frosting +11 16 24 20 28 ; frosting 1 0 14 19 20 ; red 9 0 14 21 22 ; orange 13 0 14 23 24 ; yellow 12 0 14 25 26 ; l. green 6 0 14 27 28 ; l. blue -2 0 14 29 30 ; purple +3 0 14 29 30 ; purple 1 6 9 18 19 ; red 9 6 9 20 21 ; orange 13 6 9 22 23 ; yellow 12 6 9 24 25 ; l. green 6 6 9 26 27 ; l. blue -2 6 9 28 29 ; purple -0 6 9 30 31 ; bg +3 6 9 28 29 ; purple +2 6 9 30 31 ; bg 5 21 27 23 29 ; head 5 21 21 22 31 ; ear/foot 5 27 27 21 28 ; ear diff --git a/graphics/hgr/xdraw/NOTES b/graphics/hgr/xdraw/NOTES index d784f17c..6b7db284 100644 --- a/graphics/hgr/xdraw/NOTES +++ b/graphics/hgr/xdraw/NOTES @@ -1,12 +1,31 @@ Xdraw testing: - Size $20 +Note: try them with various ROT as well + + Size $20, ROT=$0 D02A D07D-D083 interesting D23C D251-D25D (D256 highlight) + D300 not bad + D32D? D336? + D33D is nice + D347 is OK + **** D34D **** + D34E + D34F + D350 + D351 + **** D352 **** + (a few that are soso) + D357 + D35A they end? + D35E is good though... + D3D6 ok + + *** stopped at D4 for now To try: Cycle colors (clear background, offset X by 1) diff --git a/graphics/hgr/xdraw/xdraw_test.s b/graphics/hgr/xdraw/xdraw_test.s index 6a019660..226c8fc9 100644 --- a/graphics/hgr/xdraw/xdraw_test.s +++ b/graphics/hgr/xdraw/xdraw_test.s @@ -96,7 +96,8 @@ tiny_loop: ; F0 01 = cool, let's go with it smc2: - ldy #$d0 ; point to top byte of shape address +; ldy #$d0 ; point to top byte of shape address + ldy #$d3 ; point to top byte of shape address smc1: ldx #$00 ; point to bottom byte of shape address @@ -105,7 +106,7 @@ smc1: ; ROT in A ; this will be 0 2nd time through loop, arbitrary otherwise -; lda #0 ; ROT=0 + lda #0 ; ROT=0 jsr XDRAW0 ; XDRAW 1 AT X,Y ; Both A and X are 0 at exit ; Z flag set on exit diff --git a/textmode/textscroll/matrix.bas b/textmode/textscroll/matrix.bas index f5ac4ba0..d8b1c06e 100644 --- a/textmode/textscroll/matrix.bas +++ b/textmode/textscroll/matrix.bas @@ -1,8 +1,9 @@ -0 T=INT(RND(1)*20)+1 -1 B=T+8: IF B>23 THEN B=23 -2 L=INT(RND(1)*35) -3 POKE 32,L:POKE 33,1:POKE 34,T:POKE 35,B -4 VTAB T -5 LIST 7 -6 GOTO 0 -7 "-!/\*+^% +0 PR#3 +1 T=INT(RND(1)*20)+1 +2 B=T+8: IF B>23 THEN B=23 +3 L=INT(RND(1)*35) +4 POKE 32,L:POKE 33,1:POKE 34,T:POKE 35,B +5 VTAB T +6 LIST 8 +7 GOTO 1 +8 "-!/\*+^%