Banner
Views: 837,998,088
Time:
36 users online:  Anorakun, autisticsceptile1993, Bensalot, BlackJack21, brickblock369, Brolencho, Brutapode89, Coolmario, CosmicTiff, cyphermur9t,  Deeke, Digital Entertainment, DPBOX,  E-man38, Fermín Acosta Jr., Fern4nDitto, Gartore, h.carrell, HD_DankBaron, josee_544, KatMakes, KiloMinimo, Knucklesfan,  Koopster, Mr. MS, Nicoke42, Nowieso, Pat, PMH, Sancles, SansTheSkeleton, Slash Chen,  Slash Man, Smibbix, Soonstar, Zenomalous - Guests: 65 - Bots: 46 Users: 45,833 (3,404 active)
Latest: Zenomalous
Summer C3 2020 Content Spotlight
WhiteYoshiEgg's "Midway Point Timer Reset"!
Not logged in.
Switch between 2 songs with custom samples without game pause.
Forum Index - SMW Hacking - SMW Hacking Help - Custom Music - Switch between 2 songs with custom samples without game pause.
Pages: « 1 »
Hello everyone.

Music stuff is still too tough for me so I'm asking here for something that is probably very simple.

I have a level where I want to switch between two songs on the fly, but both use different samples.
Using them as global songs didn't work for me, because the samples are not reloaded.
But it may be because I did something wrong.
If this way works, could someone please provide a step by step instruction?

I'm using SA-1, so maybe some heavy lifting can be outsourced to that chip, but as I said, I really have no clue when it comes to custom music asm.

Is there any way to switch mulitple times between both songs without the sample loading pausing the game or is it simply not possible to do?

--------------------
My Youtube channel

Currently working on:
Project C

Finished project:
Originally posted by NGB
Music stuff is still too tough for me so I'm asking here for something that is probably very simple.

Short answer: It's very complicated, don't bother.

The problem here lies with a fundamental flaw with the way how the SNES handles music: By a separate processor which can only access its own RAM. Your only solution to change the music is to write to ARAM. In the best case scenario, you'd just upload data directly to ARAM similar how you can write directly to SRAM and WRAM. Alternatively, it could have been like VRAM in which you would have used registers. But that isn't the case. The SPC700 including ARAM is isolated from the SNES and the interface between the CPU and APU are four 8-bit APU ports. Uploading data requires a difficult and slow loop on both sides which is why a small pause is necessary to switch between songs.

Don't worry, though: Even official games such as Super Metroid had this issue. One example in the final escape sequence in which the game stops for a bit after Mother Brain's death. That's where the escape music has been loaded. Other games do the same if they use many samples.
The pause is much smaller, though, because Super Metroid doesn't upload as much data as AMK does. In fact, I'd say it replaces only local samples and the music or even just the song. Something similar can be done here: As long as both songs aren't too big, you can just make it so that both songs have loaded the samples and you set !NoUploadSamples (by default $7FB001, see patch.asm) to 1. You do have to use #pad inside the smaller song as AMK won't correct the samples and echo buffer start if it doesn't replace samples but that's an easy step to do.

Originally posted by NGB
I'm using SA-1, so maybe some heavy lifting can be outsourced to that chip, but as I said, I really have no clue when it comes to custom music asm.

Any enhancement chip is isolated from the SNES, the SA-1 is no exception. Outsourcing is just impossible.

Originally posted by NGB
Is there any way to switch mulitple times between both songs without the sample loading pausing the game or is it simply not possible to do?

One possible solution is to have both songs loaded at the same time but that requires changes to the music engine i.e. it's impossible in the way it's currently set up.

--------------------
Okay, my layout looks ugly.
Welp this is a little bit more complicated than I thought.
You are probably right when you say I shouldn't bother #tb{XD}

Thanks for the detailed explanation!

--------------------
My Youtube channel

Currently working on:
Project C

Finished project:
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - Custom Music - Switch between 2 songs with custom samples without game pause.

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2020 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy