From 58bd996bdf6001983fec63b0200bc3b25822efba Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 24 Jan 2023 23:00:15 -0500 Subject: [PATCH] gears: even smaller --- demos/lovebyte2023/TODO | 11 +- graphics/hgr/shape_table/gears.s | 133 +++++++++--------- graphics/hgr/shape_table/gears_tiny.s | 189 ++++++++++++++++++++++++++ utils/dos33fs-utils/dos33.c | 2 +- 4 files changed, 265 insertions(+), 70 deletions(-) create mode 100644 graphics/hgr/shape_table/gears_tiny.s diff --git a/demos/lovebyte2023/TODO b/demos/lovebyte2023/TODO index accef418..5f47be9a 100644 --- a/demos/lovebyte2023/TODO +++ b/demos/lovebyte2023/TODO @@ -32,16 +32,16 @@ Apple II: 128: hgr/transitions/rectangle 139-byte (??) gr/parallax/large 111-byte dir-switching parallax - gr/parallax/par 127-byte parallax scrolling +* gr/parallax/par 127-byte parallax scrolling hgr/parallax/par 139-byte hires-parallax (boring) hgr/parallax/wierd2 118-byte oddly compelling hgr/parallax/sier 120-bytes sierpinski parallax hgr/shape_table/pattern_logo.s 125-bytes (so-so) - hgr/shape_table/gear.s 138-byte gears (cool, good with music?) +* hgr/shape_table/gears.s 138-byte gears (cool, good with music?) gr/sprite/stars_128.s 133-byte bouncing stars (cool) (heart?) 256 - aiibot/lemm.bas 251-byte (cool) lemming animation +* aiibot/lemm.bas 251-byte (cool) lemming animation @@ -57,6 +57,10 @@ Apple II: 256 -- procedural graphics planet_lores? +1k -- keep working on budge3d + + moon over water effect + TODO: image stuff but raw hex bytes instead of text @@ -67,5 +71,6 @@ ARM/Linux: Atari 2600: parallax scroll? game? + apple II logo. Maybe with apple ii forever music? diff --git a/graphics/hgr/shape_table/gears.s b/graphics/hgr/shape_table/gears.s index 741563b5..10bbf1d5 100644 --- a/graphics/hgr/shape_table/gears.s +++ b/graphics/hgr/shape_table/gears.s @@ -1,10 +1,12 @@ ; Rotating Gears +; by Vince `deater` Weaver + ; 138 bytes -- original for Apple II bot ; 134 bytes -- only set SCALE once ; 131 bytes -- unecessary var set, change jmp to bra +; 110 bytes -- move draw_scene to a function -; by Vince `deater` Weaver ; zero page locations HGR_SHAPE = $1A @@ -32,14 +34,10 @@ HGR_SCALE = $E7 HGR_SHAPE_TABLE = $E8 HGR_SHAPE_TABLE2= $E9 HGR_COLLISIONS = $EA -HGR_ROTATION = $F9 + ROTATION = $FA SMALLER = $FB -FRAME = $FC -FRAMEH = $FD -XPOS = $FE -YPOS = $FF - +CURRENT_ROT = $FF ; Soft Switches PAGE1 = $C054 ; Page1 @@ -59,19 +57,62 @@ RESTORE = $FF3F gears: + ;============================ + ; scene 1 + ;============================ jsr HGR ; Hi-res, full screen ; 3 ; Y=0, A=0 after this call lda #8 sta HGR_SCALE - sty SMALLER + + lda #1 + sta CURRENT_ROT + + sty SMALLER ; init to 0 + + jsr draw_scene + + ;=================== + ; scene2 + ;=================== + + jsr HGR2 ; set to hires PAGE2, full screen + ; Y=0, A=0 after - ;============================ - ; scene 1 + lda #gear1_table ; point to top byte of shape address + + ; ROT in A + + ; this will be 0 2nd time through loop, arbitrary otherwise +rot_smc: + lda #1 ; ROT=1 at first + + jsr XDRAW0 ; XDRAW 1 AT X,Y + ; Both A and X are 0 at exit + ; Z flag set on exit + ; Y varies + + dec ROTATION + bne gear1_loop + rts + + +gear1_table: +.byte $25,$35,$00 ; 37,53,0 +gear2_table: +.byte $2c,$2e,$00 ; 44,46,0 + diff --git a/utils/dos33fs-utils/dos33.c b/utils/dos33fs-utils/dos33.c index 53b3da3f..79ff1434 100644 --- a/utils/dos33fs-utils/dos33.c +++ b/utils/dos33fs-utils/dos33.c @@ -1161,7 +1161,7 @@ int main(int argc, char **argv) { truncate_filename(apple_filename,argv[optind]); - if (debug) printf("\tAhpple filename: %s\n",apple_filename); + if (debug) printf("\tApple filename: %s\n",apple_filename); /* get output filename */ optind++;