You are not logged in.
Hello! I've seen a similar question asked but it didn't quite fit the issue I'm having.
I'm using the full color repo (dannye/pokered-gbc/tree/crysaudio) and I have been able to add a few of the existing tracks in for various scenarios such as giving the rival his own battle theme along with Team Rocket. However, after I go over a certain amount of songs in a list, then I have a funky problem that happens.
When I get engaged in a battle, either with a trainer or in the wild, it sounds as though that not all channels are playing. Once a sound effect or cry is played, then it returns to normal. Since it's a weird issue to explain, I have recorded it to better understand what is going on.
Also, the actual data/engine.asm has been unmodified and trying any of the suggestions I found on here for other similar issues didn't help and sometimes removed the music with just some clicking in the background.
I think I have about 50 active tracks from what I counted.
Last edited by tbreece (2021-04-03 16:54:39)
Hi tbreece. I believe that issue most often happens because the value of "NUM_SONGS" isn't updated correctly. Double check that its value matches the number of song constants: https://github.com/dannye/pokered-gbc/b … ts.asm#L58
If that isn't the issue, then I would need to take a closer look.
Also, I've updated pokered-gbc/crysaudio in the last couple days fixing a lot of bugs and other small improvements (sound effects work better in a lot of scenarios, the sound engine no longer abuses your SRAM, link trading is no longer broken, etc). Depending on how many changes you've already made, merging might be difficult, but I recommend that you try merging to get all the improvements. I don't mind helping with this if you'd like.
Edit: After looking at this a bit more, I found the oversight that led to this bug. You can refer to the fix here.
Last edited by Danny-E 33 (2021-04-11 17:18:09)
Hi Danny, thank you for your reply! It's actually Viper Jay 5 from PokeCommunity but I felt this forum would be a bit more helpful with PokeRed.
So I applied your fix and it seems to work just fine, since I'm using the GBC repository so the only difference was audio.asm was in the home directory and that was the one that needed to be changed from PlayMusic to PlaySound.
I played with this a bit more after I had posted this and I had found what seemed to also work, or at least I never noticed any ill effects. I have them commented out on here but it was adding two more channel commands at the end to expand from 4 to 6.
;ret nc ; sfx
; load music
ld hl, wMusicID
ld [hl], e ; song number
ld [hl], d ; (always 0)
ld hl, Music
add hl, de ; three
add hl, de ; byte
add hl, de ; pointer
ld a, [hli]
ld [wMusicBank], a
ld e, [hl]
ld d, [hl] ; music header address
; pre-emptively disable all channels. for some reason, this
; does not happen.
ld [wChannel1 + CHANNEL_FLAGS1], a
ld [wChannel2 + CHANNEL_FLAGS1], a
ld [wChannel3 + CHANNEL_FLAGS1], a
ld [wChannel4 + CHANNEL_FLAGS1], a
;ld [wChannel5 + CHANNEL_FLAGS1], a
;ld [wChannel6 + CHANNEL_FLAGS1], a
call LoadMusicByte ; store first byte of music header in a