From 4215f84611050687bca2e692828c2dfea92a1c4f Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Thu, 2 Nov 2023 11:38:10 -0400 Subject: [PATCH] second: work on lens code this is mostly just moving things around and trying not to break it --- .../part10_lens_rotozoom/graphics/Makefile | 10 +- .../graphics/lens_sprites.png | Bin 0 -> 4476 bytes demos/second/part10_lens_rotozoom/lens.s | 98 +++++++++++++++-- demos/second/part10_lens_rotozoom/roto.s | 102 ++---------------- 4 files changed, 105 insertions(+), 105 deletions(-) create mode 100644 demos/second/part10_lens_rotozoom/graphics/lens_sprites.png diff --git a/demos/second/part10_lens_rotozoom/graphics/Makefile b/demos/second/part10_lens_rotozoom/graphics/Makefile index f7b823b1..74e27d9f 100644 --- a/demos/second/part10_lens_rotozoom/graphics/Makefile +++ b/demos/second/part10_lens_rotozoom/graphics/Makefile @@ -3,8 +3,9 @@ include ../../../../Makefile.inc ZX02 = ~/research/6502_compression/zx02.git/build/zx02 PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr PNG2GR = ../../../../utils/gr-utils/png2gr +PNG2SPRITES = ../../../../utils/gr-utils/png2sprites -all: lenspic.gr.zx02 +all: lenspic.gr.zx02 lens_sprites.inc #### @@ -14,6 +15,13 @@ lenspic.gr.zx02: lenspic.gr lenspic.gr: lenspic.png $(PNG2GR) lenspic.png lenspic.gr +#### + +lens_sprites.inc: lens_sprites.png + $(PNG2SPRITES) lens_sprites.png lens_sprite 0 0 11 24 > lens_sprites.inc + $(PNG2SPRITES) lens_sprites.png lens_mask 13 0 11 24 >> lens_sprites.inc + + #### diff --git a/demos/second/part10_lens_rotozoom/graphics/lens_sprites.png b/demos/second/part10_lens_rotozoom/graphics/lens_sprites.png new file mode 100644 index 0000000000000000000000000000000000000000..26f085f95786daca4efe9c958e8e1ba78b76a68d GIT binary patch literal 4476 zcmeHKdsGuw8jm1?;U%YRwLW^rRJ-6h$t0PCWSa13f)GkDk|yjakM44BS@cqd=F{T-hQ&do zX3?wL28XV6y%(G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PG{UBfHN2#SWkhCd4#|58E_|DqsBYB&WK=?1hvPRKQEqVh>w z9)P>YNV$&oGe1%a6egi@Qih{Ij#*$yS>jMd9BD?y77|D>49EaRO=fr5Ev$!hf}}jC zBh(6(r(Y{1#y?T9lhK}hz|8^_3>Ayfalzyxf{8{F7IAyVXvQkh4>VEv0TVVE=r`O4 zH!rvsipDm>5zV-5=O?^I=He$D0a8y7G9`Vd<(igjN(xK~JY8MWa!pBrDS@Y}>;EPf zfBbg}*x)J11Amr4cUCz3(UKa{P06sm^<-{tM!Qe@i1*vvy1KgP^N;$ve7Vj*-!E15 z_4U5JebL{j`mXMD`uco6AH>&JY*TI&)9U2hMd zGpcHkIq#N-6DfPmJr$j`ztG(bsaq1RTCl0+``KS)7Hm28{=$(CA|=_%up3} z|6%Q{GHHKlCGy_7rP;Q(=9`+YR4w<&t3oo){XD58U|ulens_zx02 + sta zx_src_h+1 + + lda #$40 + + jsr zx02_full_decomp + + ;================================= + ; copy to both pages + + jsr gr_copy_to_current + jsr page_flip + jsr gr_copy_to_current + + ; wait + ; TODO: draw lens + + lda #15 + jsr wait_seconds + + + ;================================= + ;================================= + ; do rotozoom + ;================================= + ;================================= jsr do_rotozoom - lens_end: rts +;=============================================== +; External modules +;=============================================== + +.include "roto.s" +.include "rotozoom.s" + +.include "../gr_pageflip.s" +;.include "../gr_fast_clear.s" +.include "../gr_copy.s" + +.include "../gr_offsets.s" +.include "../c00_scrn_offsets.s" + +.include "../multiply_fast.s" + .include "../wait_keypress.s" .include "../zx02_optim.s" .include "../irq_wait.s" - .include "roto.s" +;=============================================== +; Data +;=============================================== + +lens_zx02: + .incbin "graphics/lenspic.gr.zx02" diff --git a/demos/second/part10_lens_rotozoom/roto.s b/demos/second/part10_lens_rotozoom/roto.s index ca573bcd..5d3bfb92 100644 --- a/demos/second/part10_lens_rotozoom/roto.s +++ b/demos/second/part10_lens_rotozoom/roto.s @@ -1,76 +1,6 @@ -; do a (hopefully fast) roto-zoom - do_rotozoom: - ;================================ - ; Clear screen and setup graphics - ;================================ - - bit PAGE1 ; set page 1 - bit LORES ; Lo-res graphics - - lda #0 - sta DISP_PAGE - lda #4 - sta DRAW_PAGE - - ;=================================== - ; Clear top/bottom of page 0 and 1 - ;=================================== - - jsr clear_screens - - ;=================================== - ; init the multiply tables - ;=================================== - - jsr init_multiply_tables - - ;====================== - ; show the title screen - ;====================== - - ; Title Screen - - - -title_screen: - -load_background: - - ;=========================== - ; Clear both bottoms - -; jsr clear_bottoms - - ;============================= - ; Load title - - lda #lens_zx02 - sta zx_src_h+1 - - lda #$40 - - jsr zx02_full_decomp - - ;================================= - ; copy to both pages - - jsr gr_copy_to_current - jsr page_flip - jsr gr_copy_to_current - - ; wait - ; TODO: draw lens - - lda #15 - jsr wait_seconds - - - ;================================= ; main loop @@ -88,7 +18,9 @@ main_loop: jsr page_flip + ;============================ ; wait for end + ;============================ lda #47 jsr wait_for_pattern @@ -97,6 +29,10 @@ main_loop: rts + + + + no_keypress: clc @@ -170,29 +106,3 @@ scaleaddl: .byte $10 scaleaddh: .byte $00 - - - -;=============================================== -; External modules -;=============================================== - -.include "rotozoom.s" - -.include "../gr_pageflip.s" -;.include "../gr_fast_clear.s" -.include "../gr_copy.s" - -.include "../gr_offsets.s" -.include "../c00_scrn_offsets.s" - - -.include "../multiply_fast.s" - -;=============================================== -; Data -;=============================================== - -lens_zx02: - .incbin "graphics/lenspic.gr.zx02" -