Skip to content

Commit

Permalink
Disable song loading
Browse files Browse the repository at this point in the history
Disabled the loading of the demo song, but not the engine itself.
  • Loading branch information
zorchenhimer committed Jun 22, 2019
1 parent 6d5c6f1 commit ea1acec
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,3 @@ bin/$(NAME).nes: bin/$(NAME).o $(NESCFG)
credits_data.i: $(GENCRED)
./$(GENCRED) -x zorchenhimer -o credits_data.i -i subscriber-list.csv

music_data.asm: music-convert/music-convert.exe
#-music-convert/music-convert.exe RunnJumper_music.txt > music_data.asm

music-convert/music-convert.exe: music-convert/*.go
#-cd music-convert && go build
28 changes: 21 additions & 7 deletions sound.asm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Sound_Init:
sta Noise_Period
sta Noise_Length

sta SndBeatCount
sta SndBeatCount+1

; DMC channel. Unused, just turn everything off.
sta $4010
sta $4011
Expand Down Expand Up @@ -156,10 +159,14 @@ Sound_WriteBuffers:

Sound_RunFrame:
; TODO: remove this
jmp @topOfBeat
lda #BUTTON_SELECT
jsr ButtonPressedP1
beq @topOfBeat

lda #$FF
sta SndSongRunning

jsr LoadSong

@topOfBeat:
Expand Down Expand Up @@ -193,6 +200,13 @@ RunBeat:
ldy #0
sty TmpY

bit SndSongRunning
bpl :+
inc SndBeatCount
bne :+
inc SndBeatCount+1
:

@seqDecodeLoop:
lda SndSeq_Active, y
beq @notActive
Expand Down Expand Up @@ -556,13 +570,13 @@ DecodeWait:
ldx TmpChanOffset
lda (SndPointer_Sequence, X)
and #$0F
sec
sbc #1

; Check for underflow
bpl :+
lda #0
:
; sec
; sbc #1
;
; ; Check for underflow
; bpl :+
; lda #0
;:
ldy TmpChanId
sta SndSeq_Waiting, y
jmp IncrSequencePointer
Expand Down
2 changes: 2 additions & 0 deletions sound_bss.asm
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ SndSeq_Waiting: .res 5 ; Wait command countdown (noting between notes)
SndOrder_Index: .res 4

SndRerunBeat: .res 1
SndBeatCount: .res 2
SndSongRunning: .res 1

0 comments on commit ea1acec

Please sign in to comment.