Conker SPC

Go down

Conker SPC Empty Conker SPC

Post by Euclid Sat 23 Feb 2019 - 5:27

Too much discussion in other threads, here's the rundown of how music works in lttp

Take bank 2 as an example (D8000 is where it starts)

D8000 - 76 2E - data is 0x2E76 long (note, it cannot go above 0x3000 as that's how much space the APU programmed in lttp has)
D8002 - 00 D0 - address in APU to copy to (D000)
D8004 - 00 00 - Track 01
D8006 - 00 00 - Track 02
D8008 - 00 00 - Track 03
D800A - 00 00 - Track 04
D800C - 00 00 - Track 05
D800E - 00 00 - Track 06
D8010 - 00 00 - Track 07
D8012 - 00 00 - Track 08
D8014 - 00 00 - Track 09
D8016 - 00 00 - Track 0A
D8018 - 80 28 - Track 0B
D801A - 00 00 - Track 0C
D801C - 00 00 - Track 0D
D801E - 00 00 - Track 0E
D8020 - 00 00 - Track 0F
D8022 - 46 D0 - Track 10 - Castle
D8024 - F2 DB - Track 11
... etc

D046 points to D046 AFTER the data is copied, and the actual data being copied starts from D8004

To calculate where the track pointer is in the file
from where the track number is D046 + 4 - D000 = 4A - from this address add the current rom bank data location 0xD8000 = 0xD804A

Track 11 (forgot which track it is) starts at DBF2 +4 - D000 = BF6 = 0xD8BF6

So basically if you're creating your bank of data of spc songs, after you copied in your song, the next song you can just append to it and fix the track numbers table with the pointers and it'll work.
Euclid
Euclid

Conker SPC Image212

Since : 2012-06-21

Back to top Go down

Conker SPC Empty Re: Conker SPC

Post by Floki Sat 23 Feb 2019 - 12:29

So I'm assuming it would possible to copy directly all the data from the music bin files directly in bank4 and point to the start of each song?

That's because the songs that output in zarby editor can vary in lenght, that first one I made wasn't very long but that frank sinatra one took like 1D27 in hex lenght.

Floki

Conker SPC Image212

Since : 2012-06-19

Back to top Go down

Conker SPC Empty Re: Conker SPC

Post by Euclid Sat 23 Feb 2019 - 15:48

In short, yes you can do that, but do note that music bank swapping causes a lag (you would've noticed if you keep changing tracks in the menu)

In order for me to fix music transitions normally (eg/ when boss fight starts) - I'll need to cause that lag to boot the music back to the correct bank.

Alternatively if you're in the wrong bank I'll fiddle the code so it doesn't switch the music back which could be easier.

If bank 4 isn't enough I can make bank 5/6/7 etc - as the data size is 3000 max it's very easy to squeeze them between the code gaps that we have in the rom.

The hardest part is making it so if you want to replace the dungeon music with it, but let me know and I'll code up some special requests (per entrance)

Edit: after having a thought about it - what I'll do is dedicate an area so you can paste in songs yourself. I'll make like 16 song slots available for you to paste in songs when I have the chance to code it. I'll jiggle the menu for them to show up as tracks 100-115 and some flags to turn them on/off.
Euclid
Euclid

Conker SPC Image212

Since : 2012-06-21

Back to top Go down

Conker SPC Empty Re: Conker SPC

Post by Floki Sat 23 Feb 2019 - 16:48

If bank 4 isn't enough I can make bank 5/6/7 etc - as the data size is 3000 max it's very easy to squeeze them between the code gaps that we have in the rom.
So each bank limit is 3000 just like the original bank? What about a bank for overworld songs and the other one for the dungeons, could that work?

The hardest part is making it so if you want to replace the dungeon music with it, but let me know and I'll code up some special requests (per entrance)

If there's 16 slots, I could probably reserve 10 of them for the new dungeons and 6 for the overworld areas. Is it 16 new songs per bank that you'd add? or 16 for them all?

Floki

Conker SPC Image212

Since : 2012-06-19

Back to top Go down

Conker SPC Empty Re: Conker SPC

Post by Euclid Sat 23 Feb 2019 - 17:09

I say bank limit, a single song in a bank cannot exceed ~2F00 bytes. If you can fit 2 songs in a bank, nice otherwise meh. It doesn't matter what song goes where aside from the lag I need to load the song in the APU when i do need to switch.

Went through the rom just then to look for for free space - without imposing on other banks (like using half of another bank) - we have... at least 11 free banks (there are some suspiciously empty around the 1xxxxx area but I'll leave them alone). Since we don't use monologue switch anymore I'm sure there's a few more banks lying around.

each bank can fit 2 banks of songs, so that's 22 songs minimum. More than you could possibly need... maybe.

hex addresses:

; 172000 - 174FFF
; 175000 - 177FFF

; 1B9000 - 1BBFFF
; 1BC000 - 1BEFFF

; 1D1000 - 1D3FFF
; 1D4000 - 1D6FFF

; 1D9000 - 1DBFFF
; 1DC000 - 1DEFFF

; 1E9000 - 1EBFFF
; 1EC000 - 1EEFFF

; 201000 - 203FFF
; 204000 - 206FFF

; 209000 - 20BFFF
; 20C000 - 20EFFF

; 231000 - 233FFF
; 234000 - 236FFF

; 239000 - 23BFFF
; 23C000 - 23EFFF

; 241000 - 243FFF
; 244000 - 246FFF

; 249000 - 24BFFF
; 24C000 - 24EFFF
Euclid
Euclid

Conker SPC Image212

Since : 2012-06-21

Back to top Go down

Conker SPC Empty Re: Conker SPC

Post by Floki Sat 23 Feb 2019 - 18:17

I think it would be fine enough like that and don't think I'd need more songs. The reason there's more space at the end of the rom is because I removed many character sprites that were loaded when you changed overworlds and these took much space.

I'll send you my latest rom, just before you proceed, to make sure I didn't used any of those freespace since last version I posted :-P

Floki

Conker SPC Image212

Since : 2012-06-19

Back to top Go down

Conker SPC Empty Re: Conker SPC

Post by Floki Sat 23 Feb 2019 - 23:35






I don't think I'll keep any of these, they were just practice for fun. Some sound better then others, but its definately hard to make a music track accurate if you dont have the proper instruments!

Very Happy

Floki

Conker SPC Image212

Since : 2012-06-19

Back to top Go down

Conker SPC Empty Re: Conker SPC

Post by Floki Wed 12 Feb 2020 - 8:42

Hello Euclid I've tried expending the number of spc tracks, but with little success. You can find the music asm in this post:

https://www.zeldix.net/t1676p150-project-phoenix#30290

Basically I've allocated new 3000 data banks, then modified the smartphone tracklist but it doesnt seem to go beyond track 47...unless theres a pointer in the file that tells track 47 is the last one?

Floki

Conker SPC Image212

Since : 2012-06-19

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum