diff --git a/xmas_2018/Makefile b/xmas_2018/Makefile index e8507b96..853fba5b 100644 --- a/xmas_2018/Makefile +++ b/xmas_2018/Makefile @@ -15,7 +15,7 @@ xmas2018.dsk: HELLO XMAS2018 wreath.img.lz4 ball.img.lz4 merry.img.lz4 MUSIC.lz4 $(DOS33) -y xmas2018.dsk BSAVE -a 0xa000 merry.img.lz4 MERRY.LZ4 $(DOS33) -y xmas2018.dsk BSAVE -a 0x6000 MUSIC.lz4 MUSIC.LZ4 # $(DOS33) -y xmas2018.dsk BSAVE -a 0x2000 wreath.img WREATH.IMG -# $(DOS33) -y xmas2018.dsk BSAVE -a 0x2000 ball.img BALL.IMG + $(DOS33) -y xmas2018.dsk BSAVE -a 0x4000 ball.img BALL.IMG #### diff --git a/xmas_2018/ball.s b/xmas_2018/ball.s index 5ba525c7..2024f8c3 100644 --- a/xmas_2018/ball.s +++ b/xmas_2018/ball.s @@ -57,20 +57,21 @@ ball: ; now we have 322 left ; GR part -; bit HIRES ; 4 + bit HIRES ; 4 bit SET_GR ; 4 bit FULLGR ; 4 + bit PAGE1 ; 4 ; 9620 - ; -8 mode set + ; -16 mode set ; - 3 for jmp ;======= - ; 9609 + ; 9601 - ; Try X=239 Y=8 cycles=9609 + ; Try X=18 Y=100 cycles=9601 - ldy #8 ; 2 -baloopA:ldx #239 ; 2 + ldy #100 ; 2 +baloopA:ldx #18 ; 2 baloopB:dex ; 2 bne baloopB ; 2nt/3 dey ; 2 @@ -93,36 +94,37 @@ ball_begin_loop: ball_display_loop: - ; (40*65)-4 = 2596 + ; draw 160 lines of hires PAGE1 + bit HIRES ; 4 + bit PAGE1 ; 4 - ; 40 lines of LORES - bit LORES ; 4 + ; (160*65)-8 = 10392 - ; Try X=42 Y=12 cycles=2593 R3 + ; Try X=43 Y=47 cycles=10388 R4 - lda $0 ; nop ; 3 + nop + nop - ldy #12 ; 2 -baloopC:ldx #42 ; 2 + ldy #47 ; 2 +baloopC:ldx #43 ; 2 baloopD:dex ; 2 bne baloopD ; 2nt/3 dey ; 2 bne baloopC ; 2nt/3 - ; rest of screen is hires page0 - ; (152*65)-4 = 9876 + ; draw 32 (4) lines of lores PAGE0 + bit LORES ; 4 + bit PAGE0 ; 4 - bit HIRES ; 4 + ; (32*65)-8 = 2072 - ; Try X=13 Y=139 cycles=9870 R6 + ; Try X=1 Y=188 cycles=2069 - nop - nop - nop + lda $0 - ldy #139 ; 2 -baloopE:ldx #13 ; 2 + ldy #188 ; 2 +baloopE:ldx #1 ; 2 baloopF:dex ; 2 bne baloopF ; 2nt/3 dey ; 2 diff --git a/xmas_2018/xmas2018.s b/xmas_2018/xmas2018.s index a810e0c9..4424a5d1 100644 --- a/xmas_2018/xmas2018.s +++ b/xmas_2018/xmas2018.s @@ -102,8 +102,13 @@ apple_iie: jsr lz4_decode + ; load BALL.IMG to $4000 - + lda #ball_filename + sta namhi + jsr opendir ; open and read entire file into memory ;================== ; Init mockingboard @@ -204,6 +209,13 @@ wreath_filename: ;.byte "WREATH.LZ4 " .byte $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0 .byte $A0,$A0,$A0,$A0,$A0,$A0 +ball_filename: ;.byte "BALL.IMG " + .byte 'B'|$80,'A'|$80,'L'|$80,'L'|$80,'.'|$80,'I'|$80,'M'|$80,'G'|$80 + .byte $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0 + .byte $A0,$A0,$A0,$A0,$A0,$A0,$A0,$A0 + .byte $A0,$A0,$A0,$A0,$A0,$A0 + + music_filename: ;.byte "MUSIC.LZ4 " .byte 'M'|$80,'U'|$80,'S'|$80,'I'|$80,'C'|$80,'.'|$80,'L'|$80,'Z'|$80 .byte '4'|$80,$A0,$A0,$A0,$A0,$A0,$A0,$A0