From ccbad613116de30fae16ac455d4f7bb12c478de4 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Thu, 24 Oct 2024 01:21:15 -0400 Subject: [PATCH] driven: add in dni counting currently broken for some reason --- demos/driven/Makefile | 5 + demos/driven/NOTES | 30 ++ demos/driven/hardware.inc | 1 + demos/driven/part01_dni/Makefile | 22 + demos/driven/part01_dni/dni.s | 476 ++++++++++++++++++++ demos/driven/part01_dni/inc_base5.s | 43 ++ demos/driven/part01_dni/number_sprites.inc | 141 ++++++ demos/driven/part01_dni/page_flip.s | 21 + demos/driven/part01_dni/print_dni_numbers.s | 180 ++++++++ demos/driven/part01_dni/sin.c | 13 + demos/driven/part01_dni/tables | Bin 0 -> 768 bytes demos/driven/qload.s | 14 +- demos/driven/start.s | 31 +- demos/driven/zp.inc | 28 +- 14 files changed, 983 insertions(+), 22 deletions(-) create mode 100644 demos/driven/NOTES create mode 100644 demos/driven/part01_dni/Makefile create mode 100644 demos/driven/part01_dni/dni.s create mode 100644 demos/driven/part01_dni/inc_base5.s create mode 100644 demos/driven/part01_dni/number_sprites.inc create mode 100644 demos/driven/part01_dni/page_flip.s create mode 100644 demos/driven/part01_dni/print_dni_numbers.s create mode 100644 demos/driven/part01_dni/sin.c create mode 100644 demos/driven/part01_dni/tables diff --git a/demos/driven/Makefile b/demos/driven/Makefile index 46d8506a..4e28c6f6 100644 --- a/demos/driven/Makefile +++ b/demos/driven/Makefile @@ -12,6 +12,7 @@ driven.dsk: QBOOT QLOAD \ MUSIC \ music.inc qload.inc \ ./part00_intro/INTRO \ + ./part01_dni/DNI \ ./part20_credits/CREDITS cp $(EMPTY_DISK) driven.dsk $(DOS33_RAW) driven.dsk 0 0 QBOOT 0 1 @@ -21,6 +22,7 @@ driven.dsk: QBOOT QLOAD \ $(DOS33_RAW) driven.dsk 4 0 MUSIC 0 0 $(DOS33_RAW) driven.dsk 9 0 ./part00_intro/INTRO 0 0 $(DOS33_RAW) driven.dsk 13 0 ./part20_credits/CREDITS 0 0 + $(DOS33_RAW) driven.dsk 17 0 ./part01_dni/DNI 0 0 #second_d1.dsk: QBOOT QLOAD \ # music.inc qload.inc \ @@ -66,6 +68,9 @@ driven.dsk: QBOOT QLOAD \ part00_intro/INTRO: cd part00_intro && make +part01_dni/DNI: + cd part01_dni && make + part20_credits/CREDITS: cd part20_credits && make diff --git a/demos/driven/NOTES b/demos/driven/NOTES new file mode 100644 index 00000000..02480493 --- /dev/null +++ b/demos/driven/NOTES @@ -0,0 +1,30 @@ +Disk Usage: + +Disk1 Map (disk has 35 tracks, each 4k in size) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +T 0 = Qboot / SAVES +T 1 = QLOAD 1244 bytes 3T (?) 3k free +T 4 = MUSIC 4803 bytes 5T (?) 0k free +T 9 = INTRO ? bytes 4T (16384) 3k free +T 13 = CREDITS ? bytes 4T (16384) 1k free + + + +note: below is not accurate + +RAM usage: + MAIN AUX + ---- --- +$00 ZP ZP +$01 Stack Stack +$02-$03 Disk Code +$04-$07 Lores page1 ??? 1k +$08-$0B Lores page2 ??? 1k +$0C-$0F ?? ??? 1k +$10-$1F library code ??? 4k +$20-$3F hires page1 ??? 8k +$40-$5F hires page2 ??? 8k +$60-$BF current code ??? 24k +$C0-$CF I/O I/O +$D0-$FF music ??? 12k +$D0-$DF ?? ??? 4k diff --git a/demos/driven/hardware.inc b/demos/driven/hardware.inc index 1cf29d20..8eb76396 100644 --- a/demos/driven/hardware.inc +++ b/demos/driven/hardware.inc @@ -46,6 +46,7 @@ HLINE = $F819 ; HLINE Y,$2C at A VLINE = $F828 ; VLINE A,$2D at Y CLRSCR = $F832 ; Clear low-res screen CLRTOP = $F836 ; clear only top of low-res screen +GBASCALC= $F847 SETCOL = $F864 ; COLOR=A ROM_TEXT2COPY = $F962 ; iigs TEXT = $FB36 diff --git a/demos/driven/part01_dni/Makefile b/demos/driven/part01_dni/Makefile new file mode 100644 index 00000000..7460aeca --- /dev/null +++ b/demos/driven/part01_dni/Makefile @@ -0,0 +1,22 @@ +include ../../../Makefile.inc + +PNG_TO_40x48D = ../../utils/gr-utils/png_to_40x48d +PNG_TO_40x96 = ../../utils/gr-utils/png_to_40x96 +LINKERSCRIPTS = ../../../linker_scripts/ + + +all: DNI + +### + +DNI: dni.o + ld65 -o DNI dni.o -C $(LINKERSCRIPTS)/apple2_4000.inc + +dni.o: dni.s \ + ../zp.inc ../hardware.inc + ca65 -o dni.o dni.s -l dni.lst + +#### + +clean: + rm -f *~ *.o *.lst DNI diff --git a/demos/driven/part01_dni/dni.s b/demos/driven/part01_dni/dni.s new file mode 100644 index 00000000..3c56712e --- /dev/null +++ b/demos/driven/part01_dni/dni.s @@ -0,0 +1,476 @@ +; Plasma D'ni Numbers + +; by Vince `deater` Weaver / Dsr + +; originally based on Plasmagoria (GPL3) code by French Touch + +.include "../hardware.inc" +.include "../zp.inc" + +lores_colors_fine=$8000 + + + ;====================================== + ; start of code + ;====================================== + +plasma_mask: + + bit LORES ; set lo-res + bit FULLGR + + lda #0 + sta DRAW_PAGE + sta NUMBER_HIGH + sta NUMBER_LOW + sta WHICH_TRACK +goopy: + + + lda #$4 + clc + adc DRAW_PAGE + tax + lda #$0 ; black + + jsr clear_1k + + lda #$4 + sta XPOS + lda #$5 + sta YPOS + + jsr draw_full_dni_number + + jsr inc_base5 + + jsr flip_page + + lda #200 + jsr wait + + lda NUMBER_HIGH + cmp #$02 + beq next_scene + + jmp goopy + +next_scene: + + lda #$0 + sta DRAW_PAGE + bit PAGE1 + + ldx #$20 ; ??? + lda #$FF ; white + + jsr clear_1k + + +; ============================================================================ +; init lores colors (inline) +; ============================================================================ + + lda #lores_colors_fine + sta INH +multiple_init_lores_colors: + + +init_lores_colors: + ldx #0 + ldy #0 + +init_lores_colors_loop: + +lcl_smc1: + lda lores_colors_lookup,X + sta (INL),Y + iny + sta (INL),Y + iny + sta (INL),Y + iny + sta (INL),Y + iny + beq done_init_lores_colors + + inx + txa + and #$f + tax + jmp init_lores_colors_loop + +done_init_lores_colors: + lda lcl_smc1+1 + clc + adc #$10 + sta lcl_smc1+1 + + inc INH + lda INH + cmp #$84 + bne multiple_init_lores_colors + + ;==================================== + ; do plasma + ;==================================== + +do_plasma: + ; init + + + +BP3: + + ;============================= + ; adjust color palette +; lda WHICH_TRACK +; clc +; adc #$80 +; sta display_lookup_smc+2 + +; ============================================================================ +; Precalculate some values (inlined) +; ============================================================================ + +precalc: + lda PARAM1 ; self modify various parts + sta pc_off1+1 + lda PARAM2 + sta pc_off2+1 + lda PARAM3 + sta pc_off3+1 + lda PARAM4 + sta pc_off4+1 + + ; Table1(X) = sin1(PARAM1+X)+sin2(PARAM1+X) + ; Table2(X) = sin3(PARAM3+X)+sin1(PARAM4+X) + + ldx #$28 ; 40 +pc_b1: +pc_off1: + lda sin1 +pc_off2: + adc sin2 + sta Table1,X +pc_off3: + lda sin3 +pc_off4: + adc sin1 + sta Table2,X + + inc pc_off1+1 + inc pc_off2+1 + inc pc_off3+1 + inc pc_off4+1 + + dex + bpl pc_b1 + + inc PARAM1 + inc PARAM1 + dec PARAM2 + inc PARAM3 + dec PARAM4 + +; ============================================================================ +; Display Routines +; ============================================================================ + + +display_normal: + + ldx #23 ; lines 0-23 lignes 0-23 + +display_line_loop: + + txa + asl + tay + + lda gr_offsets,Y + sta GBASL + lda gr_offsets+1,Y + sta GBASH + +; jsr GBASCALC + + ; set up pointer for mask + + ldy WHICH_TRACK ; CURRENT_EFFECT + + lda GBASL + sta INL + lda GBASH + + clc + adc #$1c ; load from $2000 + +; adc graphics_loc,Y + sta INH + + lda GBASH + clc + adc DRAW_PAGE + sta GBASH + + ldy #39 ; col 0-39 + + lda Table2,X ; setup base sine value for row + sta display_row_sin_smc+1 +display_col_loop: + lda Table1,Y ; load in column sine value +display_row_sin_smc: + adc #00 ; add in row value + + ; MASKING happens HERE + and (INL),Y + + sta display_lookup_smc+1 ; patch in low byte of lookup +display_lookup_smc: + lda lores_colors_fine ; attention: must be aligned + sta (GBASL),Y + dey + bpl display_col_loop + dex + bpl display_line_loop + +; ============================================================================ + + lda #4 + sta XPOS + lda #5 + sta YPOS + + lda NUMBER_HIGH + and #$3 + + clc + adc #$80 + sta display_lookup_smc+2 + + lda NUMBER_HIGH + and #$f + + cmp #0 + beq effect3 + + cmp #1 + beq effect4 + + cmp #2 + beq effect0 + + cmp #3 + beq effect1 + + cmp #4 + beq effect2 + +effect2: + + ldx #$20 + lda #$00 ; black + sta SIN_COUNT + jsr clear_1k + + lda DRAW_PAGE + pha + + lda #$1c + sta DRAW_PAGE + jsr draw_full_dni_number + + pla + sta DRAW_PAGE + + ldx #$20 + jsr invert_1k + + inc FRAMEL + lda FRAMEL + and #$3 + bne no_inc_effect2 + + jsr inc_base5 +no_inc_effect2: + jmp done_effect + + +effect0: + + ; full mask, so full plasma + + ldx #$20 + lda #$FF ; white + jsr clear_1k + + ; overlay with number + + jsr draw_full_dni_number + + ; increment each 8th frame + + inc FRAMEL + lda FRAMEL + and #$3 + bne no_inc_effect0 + + jsr inc_base5 + +no_inc_effect0: + jmp done_effect + +effect3: + ldx SIN_COUNT + lda sine_table,X + sta YPOS + +effect4: +effect1: + ldx #$20 + lda #$0 ; black + jsr clear_1k + + lda DRAW_PAGE + pha + + lda #$1c + sta DRAW_PAGE + jsr draw_full_dni_number + + pla + sta DRAW_PAGE + + inc SIN_COUNT + lda SIN_COUNT + cmp #25 + bne sin_ok + lda #0 + sta SIN_COUNT +sin_ok: + + inc FRAMEL + lda FRAMEL + and #$3 + bne no_inc_effect1 + + jsr inc_base5 +no_inc_effect1: + + +done_effect: + + + jsr flip_page + + inc COMPT1 + beq zoop +; bne BP3 + jmp BP3 +zoop: + + dec COMPT2 + beq zoop2 +; bne BP3 + jmp BP3 +zoop2: + + + +; beq do_plasma ; bra + jmp do_plasma ; bra + + + +.align $100 + +lores_colors_lookup: + +; dark +.byte $00,$88,$55,$99,$ff,$bb,$33,$22,$66,$77,$44,$cc,$ee,$dd,$99,$11 +; pink +.byte $00,$11,$33,$BB,$FF,$BB,$33,$11,$00,$11,$33,$BB,$FF,$BB,$33,$11 +; blue +.byte $00,$22,$66,$77,$FF,$77,$66,$22,$00,$22,$66,$77,$FF,$77,$66,$22 +; green +.byte $00,$44,$CC,$DD,$FF,$DD,$CC,$44,$00,$44,$CC,$DD,$FF,$DD,$CC,$44 + + +;.include "make_tables.s" + + +.align $100 +sin1: +.incbin "tables" +sin2=sin1+$100 +sin3=sin1+$200 + +.include "print_dni_numbers.s" +.include "number_sprites.inc" +.include "../gr_offsets.s" +.include "inc_base5.s" +.include "../wait.s" + +.include "page_flip.s" + + + ;====================== + ; + ;====================== + ; X = page + ; A = value +clear_1k: + stx OUTH + ldx #0 + stx OUTL + + ldx #4 + +; lda #0 + ldy #0 +inner_loop: + sta (OUTL),Y + iny + bne inner_loop + + inc OUTH + dex + bne inner_loop + + rts + + ;====================== + ; + ;====================== + ; X = page +invert_1k: + stx OUTH + ldx #0 + stx OUTL + + ldx #4 + + ldy #0 +invert_inner_loop: + lda (OUTL),Y + eor #$FF + sta (OUTL),Y + iny + bne invert_inner_loop + + inc OUTH + dex + bne invert_inner_loop + + rts + +sine_table: + .byte 5,6,7,8,9 + .byte 10,10,10,10,9 + .byte 8,7,6,5,4 + .byte 3,2,1,0,0 + .byte 0,1,2,3,4 + diff --git a/demos/driven/part01_dni/inc_base5.s b/demos/driven/part01_dni/inc_base5.s new file mode 100644 index 00000000..27aba5b4 --- /dev/null +++ b/demos/driven/part01_dni/inc_base5.s @@ -0,0 +1,43 @@ + + ; four-digit base 5 increment +inc_base5: + + inc NUMBER_LOW + lda NUMBER_LOW + and #$f + cmp #5 + bne inc_base5_done + + clc + lda NUMBER_LOW + adc #$b + sta NUMBER_LOW + + lda NUMBER_LOW + cmp #$50 + bne inc_base5_done + + ; if here, overflow to top byte + lda #0 + sta NUMBER_LOW + + inc NUMBER_HIGH + lda NUMBER_HIGH + and #$f + cmp #5 + bne inc_base5_done + + clc + lda NUMBER_HIGH + adc #$b + sta NUMBER_HIGH + + lda NUMBER_HIGH + cmp #$50 + bne inc_base5_done + + lda #$0 + sta NUMBER_HIGH + +inc_base5_done: + rts diff --git a/demos/driven/part01_dni/number_sprites.inc b/demos/driven/part01_dni/number_sprites.inc new file mode 100644 index 00000000..57b5105c --- /dev/null +++ b/demos/driven/part01_dni/number_sprites.inc @@ -0,0 +1,141 @@ +; 18x13 + +; frame + +frame_sprite: + +.byte 3,41 ; 3*13, ((3*13)+2) +.byte $FF,$FF,$C0 +.byte $60,$01,$80 +.byte $60,$01,$80 +.byte $60,$01,$80 +.byte $60,$01,$80 +.byte $60,$01,$80 +.byte $60,$01,$80 +.byte $60,$01,$80 +.byte $60,$01,$80 +.byte $60,$01,$80 +.byte $60,$01,$80 +.byte $60,$01,$80 +.byte $FF,$FF,$C0 + + +zero_sprite: +.byte 1,8 ; 1*6 +.byte $00 +.byte $00 +.byte $00 +.byte $00 +.byte $00 +.byte $06 + +one_sprite: +.byte 1,13 ; 11+2 +.byte $06 +.byte $06 +.byte $06 +.byte $06 +.byte $06 +.byte $06 +.byte $06 +.byte $06 +.byte $06 +.byte $06 +.byte $06 + +two_sprite: +.byte 1,13 ; 11+2 +.byte $80 +.byte $C0 +.byte $60 +.byte $60 +.byte $60 +.byte $60 +.byte $60 +.byte $60 +.byte $60 +.byte $C0 +.byte $80 + +three_sprite: +.byte 1,13 ; 11+2 +.byte $06 +.byte $0C +.byte $18 +.byte $30 +.byte $60 +.byte $C0 +.byte $60 +.byte $30 +.byte $18 +.byte $0c +.byte $06 + +four_sprite: +.byte 2,24 ; 11*2+2 +.byte $00,$00 +.byte $00,$00 +.byte $07,$F0 +.byte $06,$00 +.byte $06,$00 +.byte $06,$00 +.byte $06,$00 +.byte $06,$00 +.byte $06,$00 +.byte $06,$00 +.byte $06,$00 + + + +empty_sprite: +.byte 1,3 +.byte $00 + +five_sprite: +.byte 2,14 ; 2*6 +.byte $00,$00 +.byte $00,$00 +.byte $00,$00 +.byte $00,$00 +.byte $00,$00 +.byte $FF,$F0 + +ten_sprite: +.byte 2,24 ; 2*11 +.byte $00,$00 +.byte $00,$00 +.byte $00,$00 +.byte $00,$00 +.byte $00,$00 +.byte $00,$00 +.byte $00,$00 +.byte $00,$00 +.byte $3F,$c0 +.byte $40,$20 +.byte $80,$10 + +fifteen_sprite: +.byte 2,24 ; 2*11 +.byte $00,$00 +.byte $00,$00 +.byte $00,$00 +.byte $00,$00 +.byte $80,$10 +.byte $C0,$30 +.byte $60,$60 +.byte $30,$c0 +.byte $19,$80 +.byte $0f,$00 +.byte $06,$10 + +twenty_sprite: +.byte 2,14 ; 2*6 +.byte $30,$00 +.byte $30,$00 +.byte $30,$00 +.byte $30,$00 +.byte $30,$00 +.byte $3f,$f0 + + + diff --git a/demos/driven/part01_dni/page_flip.s b/demos/driven/part01_dni/page_flip.s new file mode 100644 index 00000000..94b7c080 --- /dev/null +++ b/demos/driven/part01_dni/page_flip.s @@ -0,0 +1,21 @@ + ;========== + ; flip page + ;========== +flip_page: + lda DRAW_PAGE + beq draw_page2 +draw_page1: + bit PAGE2 + lda #0 + + beq done_flip + +draw_page2: + bit PAGE1 + lda #$4 + +done_flip: + sta DRAW_PAGE + + rts + diff --git a/demos/driven/part01_dni/print_dni_numbers.s b/demos/driven/part01_dni/print_dni_numbers.s new file mode 100644 index 00000000..2c630df3 --- /dev/null +++ b/demos/driven/part01_dni/print_dni_numbers.s @@ -0,0 +1,180 @@ + ;===================== + +draw_full_dni_number: + + + lda NUMBER_HIGH + beq draw_only_low_dni_number + + ; drawing high number + + jsr draw_dni_number + + ; adjust for right number + lda #14 + bne draw_low_dni_number ; bra + +draw_only_low_dni_number: + + lda #7 +draw_low_dni_number: + clc + adc XPOS + sta XPOS + + lda NUMBER_LOW + + + + ;===================== + ; number in A + +draw_dni_number: + + sta DRAW_NUMBER + + ; draw frame + + lda #frame_sprite + sta INH + + jsr put_number_sprite + + ; adjust to be inside frame + + inc YPOS + inc XPOS + inc XPOS + inc XPOS + + ; draw ones values + + lda DRAW_NUMBER + bne regular_number + +; lda LEADING_ZERO ; if 0 then regular +; beq regular_number + + ; if all zeros, then draw special zero char + + lda #zero_sprite + jmp finally_draw + + +regular_number: + and #$f + tax + + lda ones_sprites_l,X + sta INL + lda ones_sprites_h,X +finally_draw: + sta INH + + jsr put_number_sprite + + lda DRAW_NUMBER + lsr + lsr + lsr + lsr + tax + + lda fives_sprite_l,X + sta INL + lda fives_sprite_h,X + sta INH + + jsr put_number_sprite + + + ; restore + + dec YPOS + dec XPOS + dec XPOS + dec XPOS + + rts + + + + ;===================== + +put_number_sprite: + + ldy #0 + lda (INL),Y + sta pns_xsize_smc+1 + iny + lda (INL),Y + sta pns_ysize_smc+1 + iny + + lda #0 + sta SPRITEY +pns_yloop: + + lda SPRITEY + clc + adc YPOS + asl + tax + lda gr_offsets,X +; clc + adc XPOS + sta pns_out_smc+1 + + lda gr_offsets+1,X +; clc + adc DRAW_PAGE + sta pns_out_smc+2 + + lda #0 + sta SPRITEX +pns_xloop: + + ldx #8 ; rotate through 8 bits + lda (INL),Y + sta COLOR +pns_inner_loop: + asl COLOR + bcc pns_transparent + lda #$FF +pns_out_smc: + sta $400 +pns_transparent: + inc pns_out_smc+1 + dex + bne pns_inner_loop + + iny + + inc SPRITEX + lda SPRITEX +pns_xsize_smc: + cmp #3 + bne pns_xloop + + inc SPRITEY +pns_ysize_smc: + cpy #39 + bcc pns_yloop ; blt + + rts + +ones_sprites_l: + .byte empty_sprite,>one_sprite,>two_sprite,>three_sprite,>four_sprite + +fives_sprite_l: + .byte empty_sprite,>five_sprite,>ten_sprite,>fifteen_sprite,>twenty_sprite + + diff --git a/demos/driven/part01_dni/sin.c b/demos/driven/part01_dni/sin.c new file mode 100644 index 00000000..1f9889eb --- /dev/null +++ b/demos/driven/part01_dni/sin.c @@ -0,0 +1,13 @@ +#include +#include + +int main(int argc, char **argv) { + double x; + + for(x=0;x<25;x++) { + + printf("%.2lf %.2lf\n",x,5.0+5.0*sin(x*6.28/25)); + + } + return 0; +} diff --git a/demos/driven/part01_dni/tables b/demos/driven/part01_dni/tables new file mode 100644 index 0000000000000000000000000000000000000000..2449117f4372a2dd37952432c64a3c844fb10154 GIT binary patch literal 768 zcmZ9K*><8p6h+mvib|YNL_rV?4xpgmfPfPyiY6N8ba(9k|B9q>-BcKy?q0V>-BoMoKL6Y;qbcO?OvX@ zn~lF-dCP_CIP=+bG9KHOX^sqII2iQ%y`HXXS{LX5>i;PJ(FR(8EK5?e*=W@3HBo%3 zRt3IN;n*@m)1@L+AoDqb$Y#>1RPqtW6Y+Qq!=lk>BoYaK1B+-B!(#D70)I@V(wQug zBMVfCW>}6Fp2T`XlH002w5INAyE~k(Z@=E}_doah`|qE(%W?ngFP(`w&=jdAur!s= zrXCY<^a|V>OW?^gK~gj)hz(iQ`i3>0ISX&K_BRNW$HJLSY;)MxJ4#Dx)Sh4h7y!X? zm9Gyp<+jq%dSCI6C({`M;QFc^9WWAS7rS12)DML_Tz z%OE`zRfIi3Y%1CS()E036x77`+^KE!I&G;gf=`|os>ni90@IKW&(Z}Vg=67R;Pd0- zGY|@6csgG!3$JF^X4l|;T=B#8_(1C$ea Zk}5G}mPO4e7IMg83^~N&c$z3M{9oF+hk^hA literal 0 HcmV?d00001 diff --git a/demos/driven/qload.s b/demos/driven/qload.s index ed3f508f..63f1f969 100644 --- a/demos/driven/qload.s +++ b/demos/driven/qload.s @@ -164,43 +164,43 @@ error_string: which_disk_array: .byte 1,1,1,1 ; MUSIC_INTRO, MUSIC_MAIN, INTRO, CREDITS - .byte 1,1,1,1 ; + .byte 1,1,1,1 ; DNI .byte 1,1,1,1 ; .byte 1,1 ; load_address_array: .byte $D0,$D0,$80,$80 ; MUSIC_INTRO, MUSIC_MAIN, INTRO, CREDITS - .byte $60,$60,$60,$60 ; + .byte $40,$60,$60,$60 ; DNI .byte $60,$60,$60,$60 ; .byte $60,$80 ; start_address: .byte $D0,$D0,$80,$80 ; MUSIC_INTRO, MUSIC_MAIN, INTRO, CREDITS - .byte $60,$60,$60,$80 ; + .byte $40,$60,$60,$80 ; DNI .byte $80,$80,$80,$60 ; .byte $80,$80 ; aux_dest: .byte $D0,$D0,$A0,$A0 ; MUSIC_INTRO, MUSIC_MAIN, INTRO, CREDITS - .byte $70,$50,$40,$30 ; + .byte $70,$50,$40,$30 ; DNI .byte $20,$10,$80,$20 ; .byte $10,$A0 ; track_array: .byte 2,4,9,13 ; MUSIC_INTRO, MUSIC_MAIN, INTRO, CREDITS - .byte 19,21,23,24 ; + .byte 17,21,23,24 ; DNI .byte 25,26,27,28 ; .byte 34,9 ; sector_array: .byte 0,0,0,0 ; MUSIC_INTRO, MUSIC_MAIN, INTRO, CREDITS - .byte 0,0,0,0 ; + .byte 0,0,0,0 ; DNI .byte 0,0,0,0 ; .byte 0,0 ; length_array: .byte 32,48,48,64 ; MUSIC_INTRO, MUSIC_MAIN, INTRO, CREDITS - .byte 32,32,16,16 ; + .byte 32,32,16,16 ; DNI .byte 16,16,16,96 ; .byte 16,16 ; diff --git a/demos/driven/start.s b/demos/driven/start.s index 7abf136f..f13568dc 100644 --- a/demos/driven/start.s +++ b/demos/driven/start.s @@ -165,7 +165,36 @@ load_program_loop: ;======================= ;======================= - ; Load music / chess + ; Load dni + ;======================= + ;======================= + + sei ; stop music interrupts + jsr mute_ay_both + jsr clear_ay_both ; stop from making noise + + ; load dni + + lda #4 ; DNI + sta WHICH_LOAD + jsr load_file + + + ; restart music + + cli ; start interrupts (music) + + ;======================= + ;======================= + ; Run Dni + ;======================= + ;======================= + + jsr $4000 + + ;======================= + ;======================= + ; Load Credits ;======================= ;======================= diff --git a/demos/driven/zp.inc b/demos/driven/zp.inc index 9c88fc81..5258c457 100644 --- a/demos/driven/zp.inc +++ b/demos/driven/zp.inc @@ -33,6 +33,8 @@ MASK = $2E COLOR = $30 ;INVFLG = $32 +WHICH_TRACK = $54 + ;========================== ; $60-$6F unused currently ;========================== @@ -94,6 +96,9 @@ TOTAL_RAM = $8F ; $90-$CF currently free ;============================= +Table1 = $A0 ; 40 bytes ($28) A0-C7 +Table2 = $C8 ; 40 bytes ($28) C8-EF + ;============================= ; $D0-$D9 = hgr move ;============================= @@ -131,26 +136,21 @@ MASKH = $ED ; $F0-$FB can re-use in each file ;============================================== -; tunnel -XX = $F2 -MINUSXX = $F3 -YY = $F4 -MINUSYY = $F5 -D = $F6 -R = $F7 -CX = $F8 -CY = $F9 -RR = $FA +; D'NI + +SPRITEY = $F2 +SPRITEX = $F3 +SPRITE_XSIZE = $F4 +SIN_COUNT = $F5 +NUMBER_HIGH = $F6 +NUMBER_LOW = $F7 +DRAW_NUMBER = $F8 ; Credits BACKUP_OUTL = $F2 BACKUP_OUTH = $F3 -; Nuts/ opener -SPRITE_Y = $F2 -SPRITE_X = $F3 -CURRENT_ROW = $F4 ; PLASMACUBE OUT1 = $F0