diff --git a/demos/demosplash2022/Makefile b/demos/demosplash2022/Makefile index e87f2445..5962cc26 100644 --- a/demos/demosplash2022/Makefile +++ b/demos/demosplash2022/Makefile @@ -40,7 +40,7 @@ ESCAPE: escape.o ld65 -o ESCAPE escape.o -C $(LINKER_SCRIPTS)/apple2_c00.inc escape.o: escape.s \ - logo_intro.s \ + logo_intro.s zp.inc \ ay3_write_regs.s escape.s interrupt_handler.s \ play_frame.s \ mA2E_4.s mockingboard_constants.s mockingboard_init.s tracker_init.s diff --git a/demos/demosplash2022/play_frame.s b/demos/demosplash2022/play_frame.s index 8b82088e..24c665a3 100644 --- a/demos/demosplash2022/play_frame.s +++ b/demos/demosplash2022/play_frame.s @@ -13,9 +13,9 @@ set_notes_loop: ;================== ; load next byte - ldy SONG_OFFSET ; Y = offset into song +; ldy SONG_OFFSET ; Y = offset into song track_smc: - lda track4,Y ; get next byte into A + lda track4;,Y ; get next byte into A ;================== ; see if hit end @@ -45,10 +45,10 @@ no_wrap: ; lda bamps_h,Y ; enforce in same page ; sta bamp_smc+2 - lda #0 ; reset song offset - sta SONG_OFFSET +; lda #0 ; reset song offset +; sta SONG_OFFSET - beq set_notes_loop ; bra ; try again in new track + jmp set_notes_loop ; bra ; try again in new track not_end: @@ -78,24 +78,18 @@ not_end: tay ; lookup in table - lda frequencies_high,Y - sta AY_REGS+1,X -; sta $500,X + lda frequencies_high,Y ; get high frequency + sta AY_REGS+1,X ; put in AY register - lda frequencies_low,Y - sta AY_REGS,X ; set proper register value - - ; visualization -;blah_urgh: -; sta $400,Y -; inc blah_urgh+1 + lda frequencies_low,Y ; get low frequency + sta AY_REGS,X ; also put in AY register ;============================ ; point to next ; assume less than 256 bytes - inc SONG_OFFSET + inc track_smc+1 ; SONG_OFFSET done_update_song: @@ -104,7 +98,9 @@ done_update_song: ;================================= ; coundown song - dec SONG_COUNTDOWN + dec SONG_COUNTDOWN ; if length was 0, means there + ; was another note starting at same + ; time, so go back and play that too bmi set_notes_loop @@ -135,28 +131,28 @@ chanb: tya bne bamps_skip - lda BAMP_COUNTDOWN + lda BAMP_COUNTDOWN ; b-amp conutdown bne bamps_good bamp_smc: - lda bamps4 + lda bamps4 ; get new value pha - and #$f - sta AY_REGS+9 ; B volume + and #$f ; bottom 4 its is ampllitude + sta AY_REGS+9 ; B volume pla + lsr ; top 4 bits are length lsr lsr lsr - lsr -; clc -; adc #1 sta BAMP_COUNTDOWN - inc bamp_smc+1 - + inc bamp_smc+1 ; increment to next location + ; assumes on same page + ; and less than 256 bamps_good: - dec BAMP_COUNTDOWN + dec BAMP_COUNTDOWN ; countdown + bamps_skip: ;================================= diff --git a/demos/demosplash2022/zp.inc b/demos/demosplash2022/zp.inc index f793c344..1cb87916 100644 --- a/demos/demosplash2022/zp.inc +++ b/demos/demosplash2022/zp.inc @@ -13,7 +13,7 @@ AY_REGS = $70 SONG_L = $80 SONG_H = $81 -SONG_OFFSET = $82 +;SONG_OFFSET = $82 SONG_COUNTDOWN = $83 OCTAVE = $84 REGISTER = $85