Language…
4 users online: Ashura4126,  Daizo Dee Von,  MarioFanGamer, ShirleyVAga - Guests: 64 - Bots: 315
Users: 69,784 (2,507 active)
Latest user: Kidd005

Music restarting

When using custom music in a ROM, I've noticed that if you exit one level and enter another level with the same music (or exit and enter the same level) the music restarts rather than continues.
I know that in SMW there are levels where the music continues in this case, so it should be possible to fix this.

Is there a hex edit that would take care of this?
If you set the next level's music to none in the bypass, the first level's music will carry over - however, if you then use a Star or P-Switch in that second level, the special music will loop once it is completed, even if you have the fix in place.

[?] Miscellaneous Helpful Hints
If I moderated your hack, there was apparently a 90 percent chance it was rejected.
Originally posted by andy_k_250
If you set the next level's music to none in the bypass, the first level's music will carry over - however, if you then use a Star or P-Switch in that second level, the special music will loop once it is completed, even if you have the fix in place.


Yes. This is why it's a horrible temporary fix. It's causing me some annoyance. I also have one level where multiple pipes lead to other parts of the same level and every time you do so, the music restarts. If there's any way to fix this, I really want to know so I can take care of it before we release a demo.
How about you make a room with a miniboss in between the two (one that has different music) and change the second half's music to what it was before to mask the glitch? It's not completely efficient, but it's worth a shot! ...right?

As for the pipe problem, you could make a copy of the same room but without music, using each alternatively for when you need it. Executed superbly, it'd be like they were the exact same room and nobody would tell the difference!
It's not even close to Halloween, and already Christmas Sales are starting early!
Originally posted by scratch799
How about you make a room with a miniboss in between the two (one that has different music) and change the second half's music to what it was before to mask the glitch? It's not completely efficient, but it's worth a shot! ...right?


Except that putting a miniboss in the middle of some random level kind of goes against the design.

Quote
As for the pipe problem, you could make a copy of the same room but without music, using each alternatively for when you need it. Executed superbly, it'd be like they were the exact same room and nobody would tell the difference!


Then I'd have to make each room have no music, which means that when someone hits the P-switch or gets a starman the music continues forever. Also, the room requires you to return to the first section and every time you do that, the music would restart anyway.

Our project actually does have a few levels where there are no music just so that the music doesn't restart, but this is bad because we plan to make it so that a player can get a starman in the item box, and that would mean that any level can be very problematic.

There has to be an easy hex edit or something that can fix this, isn't there?
Originally posted by Heisanevilgenius

Our project actually does have a few levels where there are no music just so that the music doesn't restart, but this is bad because we plan to make it so that a player can get a starman in the item box, and that would mean that any level can be very problematic.


I know what you mean... I sooo wanted to use the item box star in my hack too, but along with this music issue, there's really no chance to use it if you want a somewhat glitchless game. :(

In addition, with smkdan's no music-sample utility, music restarts no matter what and if you choose "No music" you just get silence. This is obviously even worse. I doubt we'll see a fix for that, but I would definetely love to see a "basic" fix for this problem, too, because the restarting music is indeed annoying in many ways. It just decreases the level-design possibilities, and I really hate it when all the advanced stuff screws up the basics that much.


Since AddMusic's main code will rewrite the music number even if the music number was same between two levels, the music will restart. I made a new code to fix this problem. (Use xkas to insert.)
But, if you have a plan to use smkdan's Sample Utility for your current hack, I suppose this code will be meaningless. I haven't tried that tool out, though, if his tool won't reupload same data when the sample-bank-numbers between levels are same, this might work with his tool...

Code
lorom
header

!FreeRAM		= $7EC100	;Check out it that you have used this RAM for something else...


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $009740
			JSL CustomMusicMain
org $00A1C7
			JSL ClearRAM
org $00A64A
			JSL HackingRoutine
			NOP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

org $108000		; !!! This must be changed to the SNES address, where the free space is. !!!

CustomMusicMain:	STZ $0DAE
			STZ $0DAF
			LDA $0DDA
			CMP #$20
			BCC Return

IsCustomMusic:		CMP !FreeRAM
			CLC
			BEQ ActualNumber
			STA !FreeRAM
			PHA
			AND #$0C
			ASL A
			ASL A
			ASL A
			ORA #$80
			STA $01
			PLA
			AND #$70
			SEC
			SBC #$20
			LSR A
			LSR A
			LSR A
			LSR A
			ADC #$14
			STA $02
			LDA #$08
			STA $00
			PHK
			PER $0006
			PEA $804C
			JML $80811D

			SEC
ActualNumber:		LDA $0DDA
			AND #$03
			INC A
			ORA #$20
			STA $0DDA
			BCS StoreTo1DFB
			LDA #$00
StoreTo1DFB:		STA $1DFB
Return:			RTL

HackingRoutine:		LDA $0DDA
			STA !FreeRAM
			AND #$7F
			RTL

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

ClearRAM:		LDA #$FF
			STA !FreeRAM
			JML $848241
The same happens when you go into a secondary exit which leads to the same level. It restarts. The other option seems to be worse than this, though. But this ^ look promising, even though I haven't tried it.
--------> Don't follow "Find Roy's Dignity", my hack. Because it's pretty outdated. <--------