diff --git a/demos/outline2021/demo/Makefile b/demos/outline2021/demo/Makefile index 4f717882..71aaa748 100644 --- a/demos/outline2021/demo/Makefile +++ b/demos/outline2021/demo/Makefile @@ -54,7 +54,7 @@ OUTLINE: outline.o outline.o: outline.s zp.inc \ shimmer.s a2_inside.s drops.s wires.s \ - rotoplasma_tiny.s \ + rotoplasma_tiny.s rocket_away.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/drops.s b/demos/outline2021/demo/drops.s index 8a03dc73..532b4c71 100644 --- a/demos/outline2021/demo/drops.s +++ b/demos/outline2021/demo/drops.s @@ -13,37 +13,6 @@ ; then flip buffers -.if 0 - - -; zero page - -GBASH = $27 -MASK = $2E -COLOR = $30 -SEEDL = $4E - -FRAME = $F8 -XX = $F9 -DROPL = $FA -DROPH = $FB -BUF1L = $FC -BUF1H = $FD -BUF2L = $FE -BUF2H = $FF - -; soft switches -FULLGR = $C052 -LORES = $C056 ; Enable LORES graphics - - -; ROM routines -HGR = $F3E2 -HGR2 = $F3D8 -PLOT = $F800 ;; PLOT AT Y,A -PLOT1 = $F80E ;; PLOT at (GBASL),Y (need MASK to be $0f or $f0) - -.endif ;================================ ; Clear screen and setup graphics @@ -53,6 +22,8 @@ drops: ; A is $00 after this ; Y is $00 + sta FRAME + bit FULLGR ; full page bit LORES ; switch to LORES @@ -193,7 +164,15 @@ no_oflo: weird_outer: - bmi drops_outer ; small enough now! +; bmi drops_outer ; small enough now! + + lda FRAME + cmp #64 + beq drops_done + jmp drops_outer +drops_done: + rts + colors: .byte $22,$66,$77,$ff diff --git a/demos/outline2021/demo/graphics/Makefile b/demos/outline2021/demo/graphics/Makefile new file mode 100644 index 00000000..b54e0dff --- /dev/null +++ b/demos/outline2021/demo/graphics/Makefile @@ -0,0 +1,29 @@ + +PNG2RLE = ../../../../utils/gr-utils/png2rle +PNG2GR = ../../../../utils/gr-utils/png2gr +PNG2HGR = ../../../../utils/hgr-utils/png2hgr +LZSA = ~/research/lzsa/lzsa/lzsa +B2D = ../../../../utils/bmp2dhr/b2d + +all: outline.inc + + +outline.inc: \ + outline_space.lzsa + echo "outline_space_lzsa: .incbin \"outline_space.lzsa\"" > outline.inc + + +### + +outline_space.lzsa: outline_space.hgr + $(LZSA) -r -f2 outline_space.hgr outline_space.lzsa + +outline_space.hgr: outline_space.png + $(PNG2HGR) outline_space.png > outline_space.hgr + +### + + +clean: + rm -f *~ outline.inc *.lzsa *.gr *.hgr + diff --git a/demos/outline2021/demo/graphics/outline_space.png b/demos/outline2021/demo/graphics/outline_space.png new file mode 100644 index 00000000..f8fedbff Binary files /dev/null and b/demos/outline2021/demo/graphics/outline_space.png differ diff --git a/demos/outline2021/demo/graphics/pixel_shifter.c b/demos/outline2021/demo/graphics/pixel_shifter.c new file mode 100644 index 00000000..48e3901c --- /dev/null +++ b/demos/outline2021/demo/graphics/pixel_shifter.c @@ -0,0 +1,44 @@ +#include + +unsigned char pixels[12][8]= +{ +{ 0x00,0x00,0x00,0x00,0xAA,0x81,0x00,0x00 }, +{ 0x00,0x00,0x00,0xC0,0x8A,0x00,0x00,0x00 }, +{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, +{ 0xA0,0xC5,0xAA,0xD5,0x8A,0x00,0x00,0x00 }, +{ 0x88,0xD5,0xAA,0x95,0xAA,0x55,0x2A,0x00 }, +{ 0xAA,0xD1,0x80,0xD5,0xAA,0xD5,0xAA,0x00 }, +{ 0xAA,0xD5,0xAA,0xD5,0xAA,0x55,0x2A,0x00 }, +{ 0xA8,0xD1,0x88,0x95,0xAA,0x00,0x00,0x00 }, +{ 0xA0,0xC5,0xAA,0xD5,0x8A,0x00,0x00,0x00 }, +{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, +{ 0x00,0x00,0x00,0xC0,0x8A,0x00,0x00,0x00 }, +{ 0x00,0x00,0x00,0x00,0xAA,0x81,0x00,0x00 }, +}; + +int main(int argc, char **argv) { + + int x,y; + int temp,next,high,nextnext; + + for(y=0;y<12;y++) { + printf(".byte "); + nextnext=0; + for(x=0;x<8;x++) { + temp=pixels[y][x]; + high=temp&0x80; + next=!!(temp&0x40); + temp=temp<<1; + temp=temp&0x7f; + temp|=high; + temp|=nextnext; + nextnext=next; + printf("$%02X,",temp); + } + printf("\n"); + } + + return 0; +} + + diff --git a/demos/outline2021/demo/hgr_pageflip.s b/demos/outline2021/demo/hgr_pageflip.s new file mode 100644 index 00000000..8c1ff4fd --- /dev/null +++ b/demos/outline2021/demo/hgr_pageflip.s @@ -0,0 +1,21 @@ + ;============== + ; hgr_page_flip + ;============== + +hgr_page_flip: + lda DISP_PAGE ; + beq hgr_page_flip_show_1 ; +hgr_page_flip_show_0: + bit PAGE0 ; + lda #$40 ; + sta HGR_PAGE ; HGR_PAGE=$40 ; + lda #0 ; + sta DISP_PAGE ; DISP_PAGE=0 ; + rts ; +hgr_page_flip_show_1: + bit PAGE1 ; + lda #$20 + sta HGR_PAGE ; DRAW_PAGE=$20 ; + lda #1 ; + sta DISP_PAGE ; DISP_PAGE=1 ; + rts ; diff --git a/demos/outline2021/demo/outline.s b/demos/outline2021/demo/outline.s index 7d98c77f..a30b171c 100644 --- a/demos/outline2021/demo/outline.s +++ b/demos/outline2021/demo/outline.s @@ -63,6 +63,8 @@ mockingboard_not_found: ;============================= + jsr rocket_away + jsr a2_inside jsr wires @@ -114,6 +116,11 @@ forever: .include "long_wait.s" .include "random16.s" +.include "decompress_fast_v2.s" +.include "rocket_away.s" +.include "graphics/outline.inc" +.include "hgr_pageflip.s" + PT3_LOC = song .align $100 song: diff --git a/demos/outline2021/demo/zp.inc b/demos/outline2021/demo/zp.inc index 2392d5c9..5769b3be 100644 --- a/demos/outline2021/demo/zp.inc +++ b/demos/outline2021/demo/zp.inc @@ -10,7 +10,7 @@ COUNT = $06 MENU_BASE = $06 MENU_HIGHLIGHT = $07 DELTA = $08 - +NIBCOUNT = $09 ; Zero page monitor routines addresses @@ -112,6 +112,7 @@ SCALE_F = $AD SHIPY = $E4 ; mode7 +HGR_PAGE = $E6 HGR_SCALE = $E7 DISP_PAGE = $ED