diff --git a/demos/hellmood_memories/Makefile b/demos/hellmood_memories/Makefile index 3056b8a4..2fd82016 100644 --- a/demos/hellmood_memories/Makefile +++ b/demos/hellmood_memories/Makefile @@ -6,13 +6,13 @@ PNG_TO_40x48D = ../../utils/gr-utils/png_to_40x48d PNG2RLE = ../../utils/gr-utils/png2rle B2D = ../../utils/bmp2dhr/b2d TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft - +EMPTY = ../../empty_disk/ all: memories.dsk memories.dsk: HELLO CIRCLES.BAS CIRCLES CHECKERS CHECKERS_SMALL PLANE \ SIER TUNNEL TNM CIRCLES_NORMAL - cp empty.dsk memories.dsk + cp $(EMPTY)empty.dsk memories.dsk $(DOS33) -y memories.dsk SAVE A HELLO $(DOS33) -y memories.dsk SAVE A CIRCLES.BAS $(DOS33) -y memories.dsk BSAVE -a 0x070 CIRCLES diff --git a/demos/hellmood_memories/empty.dsk b/demos/hellmood_memories/empty.dsk deleted file mode 100644 index b34eb519..00000000 Binary files a/demos/hellmood_memories/empty.dsk and /dev/null differ diff --git a/demos/second/gr_plot.s b/demos/second/gr_plot.s index c60c8a22..002a545a 100644 --- a/demos/second/gr_plot.s +++ b/demos/second/gr_plot.s @@ -1,3 +1,9 @@ + + ; monitor, horizontal=Y vert=a +plot_compat: + sty XPOS + sta YPOS + ;================================ ; plot routine ;================================ diff --git a/demos/second/part01_intropan/horiz_scroll.s b/demos/second/part01_intropan/horiz_scroll.s index f9a5ab6a..21ca10ad 100644 --- a/demos/second/part01_intropan/horiz_scroll.s +++ b/demos/second/part01_intropan/horiz_scroll.s @@ -72,7 +72,8 @@ pil_smc2: cpx #$ff bne pan_outer_loop -; jsr wait_until_keypress + lda KEYPRESS + bmi done_pan inc COUNT lda COUNT @@ -80,6 +81,9 @@ pil_smc2: bne pan_outer_outer_loop +done_pan: + bit KEYRESET + rts .include "scroll_tables.s" diff --git a/demos/second/part04_chess_shapes/Makefile b/demos/second/part04_chess_shapes/Makefile index e4b86018..57b57406 100644 --- a/demos/second/part04_chess_shapes/Makefile +++ b/demos/second/part04_chess_shapes/Makefile @@ -18,6 +18,7 @@ chess.o: chess.s \ ../zx02_optim.s \ ../hgr_copy_fast.s \ interference.s \ + circles.s \ ../zp.inc ../hardware.inc ../qload.inc \ graphics/chess_object2.hgr.zx02 ca65 -o chess.o chess.s -l chess.lst diff --git a/demos/second/part04_chess_shapes/chess.s b/demos/second/part04_chess_shapes/chess.s index 9addeebd..52655328 100644 --- a/demos/second/part04_chess_shapes/chess.s +++ b/demos/second/part04_chess_shapes/chess.s @@ -263,6 +263,18 @@ tunnel_loop: main_tunnel_done: bit KEYRESET + ;================== + ;================== + ;================== + ; DO circles HERE + ;================== + ;================== + ;================== + + jsr zooming_circles + + ; todo, fade to white + ;================== ;================== ;================== @@ -271,6 +283,7 @@ main_tunnel_done: ;================== ;================== + jsr interference @@ -289,6 +302,7 @@ main_interference_done: .include "../hgr_sprite_big.s" .include "interference.s" + .include "circles.s" .include "../hgr_page_flip.s" ; wait A * 1/50s diff --git a/demos/second/part04_chess_shapes/circles.s b/demos/second/part04_chess_shapes/circles.s new file mode 100644 index 00000000..a7c8c050 --- /dev/null +++ b/demos/second/part04_chess_shapes/circles.s @@ -0,0 +1,106 @@ +; Zooming Circles, based on the code in Hellmood's Memories + +; by deater (Vince Weaver) + +; 103 bytes + +;.globalzp squares_table_y +;.globalzp color_lookup +;.globalzp smc1,smc2,smc3,smc4 + + +zooming_circles: + + ;=================== + ; init screen + bit LORES + bit FULLGR + bit PAGE1 + lda #0 + sta DRAW_PAGE + ; 3 + ;==== + ; 6 +circle_forever: + + inc FRAME ; 2 + + ldx #24 ; 2 + stx Y2 ; 2 + dex ; 1 + +yloop: + ldy #20 ; 2 + sty X2 ; 2 + dey ; 1 + +xloop: + + clc ; 1 + lda squares_table_y+4,y ; 3 + asl ; 1 + asl ; 1 + adc squares_table_y,x ; 2 + + lsr ; 1 + adc FRAME ; 2 + and #$1f ; 2 + +; and #$18 +; 00, 10 = black +; 01 = grey 55 or aa +; 11 = light blue 77 + + lsr ; 1 + lsr ; 1 + lsr ; 1 + sty TEMPY ; 2 + tay ; 1 + lda color_lookup,Y ; 3 + sta COLOR ; 2 + + ldy X2 ; Y==X2 ; 2 + txa ; A==Y1 ; 1 + jsr plot_compat ; (X2,Y1) ; 3 + lda Y2 ; A==Y2 ; 2 + jsr plot_compat ; (X2,Y2) ; 3 + + ldy TEMPY ; Y==X1 ; 2 + txa ; A==Y1 ; 1 + jsr plot_compat ; (X1,Y1) ; 3 + lda Y2 ; A==Y2 ; 2 + jsr plot_compat ; (X1,Y2) ; 3 + + inc X2 ; 2 + + dey ; 1 + bpl xloop ; 2 + + inc Y2 ; 2 + + dex ; 1 + bpl yloop ; 2 + + lda KEYPRESS + bmi done_circles + + bpl circle_forever ; bra + +done_circles: + bit KEYRESET + rts + + + +; 24 bytes +squares_table_y: +.byte $24,$21,$1e,$1b,$19,$16,$14,$12 +.byte $10,$0e,$0c,$0a,$09,$07,$06,$05 +.byte $04,$03,$02,$01,$01,$00,$00 + +color_lookup: +.byte $00 ; also last byte of squares table +.byte $55,$00,$77 + +.include "../gr_plot.s" +.include "../gr_offsets.s" diff --git a/demos/second/part04_chess_shapes/interference.s b/demos/second/part04_chess_shapes/interference.s index bdb3d725..7ceebe47 100644 --- a/demos/second/part04_chess_shapes/interference.s +++ b/demos/second/part04_chess_shapes/interference.s @@ -39,13 +39,13 @@ plot_setup: lsr ; shift bottom bit into carry ; 2 tay - bcc plot_even ; 2nt/3 -plot_odd: + bcc do_plot_even ; 2nt/3 +do_plot_odd: lda #$f0 ; 2 - bcs plot_c_done ; 2nt/3 -plot_even: + bcs do_plot_c_done ; 2nt/3 +do_plot_even: lda #$0f ; 2 -plot_c_done: +do_plot_c_done: sta mask_smc2+1 ; eor #$FF ; 2 sta mask_invert_smc1+1 ;