Earthbound MSU

Page 3 of 3 Previous  1, 2, 3

Go down

Re: Earthbound MSU

Post by Conn on Wed 6 Jun 2018 - 18:47

I can implement a quick fade 02 and the fade half 09 as well. But for fade full I'd need the command code. I couldn't find it.

As for the tracks beyond bf, the new fade code surely isn't responsible that it does not work anymore... But 191 tracks should be enough.... right?
avatar
Conn



Since : 2013-06-30

Back to top Go down

Re: Earthbound MSU

Post by ShadowOne333 on Wed 6 Jun 2018 - 18:49

To me 191 is more than enough Razz
I'm still going through the PCM pack, I'm up to 140 tracks now and still 51 more to go, so yeah xD
More than enough haha.

Thanks for taking the time to make these little fixes, Conn Smile
avatar
ShadowOne333
Snap Dragon
Snap Dragon

Since : 2016-04-06

Back to top Go down

Re: Earthbound MSU

Post by Conn on Wed 6 Jun 2018 - 19:17

My opinion Razz
I already coded 02, 03 and 09 to fade slow/fast/half. I wait whether we find a fade full command (worst case: I need a Geiger savestate (bsnes would also work) before the fade up occurs.
avatar
Conn



Since : 2013-06-30

Back to top Go down

Re: Earthbound MSU

Post by Conn on Wed 6 Jun 2018 - 19:23

*gosh. It seems that from 07 until 0e or something all fade to half... but sometimes only left or right speaker.

I think we I definitely need a savestate, better two: one before it fades half, one before it fades full again. Best Geiger, bsnes latest version should also work.
avatar
Conn



Since : 2013-06-30

Back to top Go down

Re: Earthbound MSU

Post by Ari3s on Wed 6 Jun 2018 - 19:43

Okay, so I've got a Geiger ready for the effects of a partial fade, and fade to full. All you have to do is enter the house that you'll find yourself standing directly in front of to get the game to perform the partial fade, and exit it to get the fade to full effect. I also have a list that documents all sound/music effects in Earthbound. So if we need to implement more effects into the MSU code, that second debug menu will be our friend.

0 (Load effect number from argument register)
1 Play normally
2 Quick fade out
3 Fade out
4 (No effect?)
5 Increase playback speed for one second
6 (No effect?)
7 Decrease volume slightly
8 Restore original volume
9 - 14 Disable sound channel 0 - 5
15 - 20 Emphasize sound channel 0 - 5
21 Increase overall pitch
22 (No effect?)
23 Decrease volume substantially

So to specify, 7 is what Dalaam uses to achieve the effect in question

Also, I managed to fix the issue with the extra tracks causing a lock up, I'll attach the chunk of code, where I've added two lines from a previous version that aren't in v9, as that's what fixed it.

Code:
LDA_al (0x002000)
 AND_8 (0x40)
 BNE_a (loop) // (loop) Branch to loop
 LDA_al (0x002000)
 AND_8 (0x08)
 BNE_a (playspc) // Branch to playspc, error bit set?
 LDA_xl (track_table) // LDA_xl (0xEFFF00)
 STA_al (0x002007)
 LDA_8 (0xFF)
 STA_al (0x002006)
 STA_al (0x7FFFF2) // Volume flag
 LDA_8 (0x01)
 STA_al (0x7FFFF0) // Set new track introduced flag
 LDA_8 (0x00)
 STA_al (0x7FFFF3) // Erase fade flag
 PLP // Restore processor status
 PLA // Get track number from stack
 LDX_i (0x0004) //One of these lines specifically seems to make tracks 192-255 function.
 STX_a (0xB53B) //One of these lines specifically seems to make tracks 192-255 function.
 RTL
Attachments
Geiger Savestate- Dalaam.zip You don't have permission to download attachments.(95 Kb) Downloaded 1 times
avatar
Ari3s
Bee
Bee

Since : 2018-06-04

Back to top Go down

Re: Earthbound MSU

Post by Conn on Thu 7 Jun 2018 - 6:10

Alright, thanks Very Happy

v10:
http://bszelda.zeldalegends.net/stuff/Con/eb_msu_patch.zip
!Apply on fresh rom!

implemented are:
02: fade fast
03: fade slow
07: fade low
08: fade up
if others are needed as well (23?), let me know, also if you think the fades are too slow/fast/low, the current settings are:
fast: 4 decrements per nmi
slow: 2 decrements per nmi
half: final value 40 with 3 decrements per nmi
full: final value FF with 3 increments per nmi

Also, I managed to fix the issue with the extra tracks causing a lock up, I'll attach the chunk of code, where I've added two lines from a previous version that aren't in v9, as that's what fixed it.
Ah, this was already fixed in v7, because vince reported this trouble:
You see, if you re-add these 2 lines, these sfx distortions will re-appear. That is because each track has it's own set of instruments for the SFX. If you mute it at that time I had it, the specific track's instruments aren't loaded (but obviously you can play tracks beyond 191 then). So better stick to the 191 tracks we have.
avatar
Conn



Since : 2013-06-30

Back to top Go down

Re: Earthbound MSU

Post by Ari3s on Fri 8 Jun 2018 - 0:01

Oh cool! Well I can confirm that both versions of v10 (patch and CCS) function as they should. I even took the liberty of creating some proof of concept footage to show it in action using my own hack that I've been working on for a bit.

avatar
Ari3s
Bee
Bee

Since : 2018-06-04

Back to top Go down

Re: Earthbound MSU

Post by ShadowOne333 on Mon 11 Jun 2018 - 11:14

Given how Aries mentioned that tracks 192 and onwards were no longer working due to those two lines disabling the instrument loading for certain songs working properly with SFX, I decided to give it a stab and see if with my noobish ASM knowledge I could come up with a workaround to make both things working properly.

So in the end, and with the help of PK Hack user @d-man, this is the code we ended up with (only modifies the "loop" label):

Code:

loop:
lda $002000
AND #$40
BNE loop
lda $002000
AND #$08
BNE playspc ; error bit set?
LDA $EFFF00,x
STA $002007
LDA #$ff
STA $002006
STA $7FFFF2 ; volume flag
LDA #$01
STA $7FFFF0 ; set new track introduced flag
LDA #$00
STA $7FFFF3 ; erase fade flag
PLP ;restore processor status
PLA ;get track number from stack
CMP #$00C0
BCC $06
LDX $0004
STX $B53B
RTL

From the test Aries has done so far, everything seems to work properly with those 4 lines added in near the end.
All 192-255 seem to play fine from MSU, while the 0-191 tracks load their instruments and SFX properly as well.

The CMP could be CMP #$C0, but since I am transcribing it all to CCS, CMP #$00C0 seems to do the same too.

So I think this works as perhaps a v11 patch?
I'm not sure, but let me know what do you think of the inclusion to the code, if it is coded fine (since I am making baby steps in ASM 6502 and 65816) or if it might need changes Very Happy

Thanks for all your help, Conn, even more given that you are now retired, your help is greatly appreciated!
avatar
ShadowOne333
Snap Dragon
Snap Dragon

Since : 2016-04-06

Back to top Go down

Re: Earthbound MSU

Post by Conn on Mon 11 Jun 2018 - 14:23

I corrected the code:

CMP #$00C0
-> CPX #$00C0 (track is on X, after pla you restore some other stack value)

LDX $0004
-> LDX #$0004 we need value 04 not ram address 04

This is no harm to the code, so I added the snippet and hope it works and we eventually can close the coding chapter. I give no guarantee that it works and also be aware that the wrong sfx instruments can be loaded when using tracks beyond BF and you thus experience similar sfx distortions as Vince reported.

v11:
http://bszelda.zeldalegends.net/stuff/Con/eb_msu_patch.zip
avatar
Conn



Since : 2013-06-30

Back to top Go down

Re: Earthbound MSU

Post by Sponsored content


Sponsored content


Back to top Go down

Page 3 of 3 Previous  1, 2, 3

Back to top


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