PDA

View Full Version : Research: What is up with the fanfare command?


Diegoisawesome
July 8th, 2010, 7:21 AM
I'm sure that most of you have realized that, when a non-fanfare song is given in a parameter to a fanfare command, it will just revert back to the Level Up sound. I was wondering if anybody here could either tell me the offset of the command table (which points to the ASM used for scripting commands) and maybe I could try fixing it, or maybe somebody else could help.

Shiny Quagsire
July 9th, 2010, 10:38 AM
try using the sound command. It works so much better.
sound 0xsound number

Diegoisawesome
July 9th, 2010, 10:42 AM
Fanfare- temporarily interrupts music and plays sound effect.
Sound- plays sound effect while music also plays.

I want the fanfare effect, and strangely enough, sound screws up my script...

Also, for both, there's some table that determines the length for checksound and waitfanfare, and changing the sound effect doesn't change the length in the table.

AmineX
December 18th, 2010, 1:44 AM
I tried that but unfortunately (http://www.google.com/search?hl=fr&client=firefox-a&hs=bXE&rls=org.mozilla:fr:official&&sa=X&ei=vH4MTbHzL4jOswbMmt3TDA&ved=0CCcQBSgA&q=unfortunately&spell=1) the music won't resume after new fanfare added to the table.
maybe somthing gone wrong give it a try:

BPED:

Table : 5248BC
Pointer : EC655308
Offset 1: 0A30A8
Offset 2: 0A30FC
Offset 3: 0A3120
Amount : 0A3128


BPEE:

Table : 5248BC
Pointer : A8975208
Offset 1: 0A308C
Offset 2: 0A3104
Offset 3: 0A30E0
Amount : 0A310C


BPEF:

Table : 5297A8
Pointer : A8975208
Offset 1: 0A30A0
Offset 2: 0A30F4
Offset 3: 0A3118
Amount : 0A3120


BPRE:

Table : 3Ac990
Pointer : 90c93A08
Offset 1: 071C08
Offset 2: 071C5C
Offset 3: 071C80
Amount : 071C88


BPRF:

Table : 3A6D08
Pointer : 086D3A08
Offset 1: 071C2C
Offset 2: 071C80
Offset 3: 071CA4
Amount : 071CAC

BPRD:

Table : 3AC7DC
Pointer : DCC73A08
Offset 1: 071B6C
Offset 2: 071BC0
Offset 3: 071BE4
Amount : 071BECWell i dont remember what are these stuff but it's easy to fugure out.
here also dump of table from emerald if i remember well.
58126

I have so much things to do i didnt got time for it anyway if you find a solution please contact me

Shiny Quagsire
December 18th, 2010, 8:02 AM
I checked for any useage of that table, and all that I came up with was a random function, and the actual play fanfare.



08071C60 fanfare_play: @ CODE XREF: sub_080333D4+1Ap
08071C60 @ sub_08038BE0+1Ap ...
08071C60 000 PUSH {LR}
08071C62 004 LSLS R0, R0, #0x10
08071C64 004 LSRS R3, R0, #0x10
08071C66 004 MOVS R1, #0
08071C68 004 LDR R2, =unk_083AC990
08071C6A
08071C6A loc_08071C6A: @ CODE XREF: fanfare_play+2Aj
08071C6A 004 LDRH R0, [R2]
08071C6C 004 CMP R0, R3
08071C6E 004 BNE loc_08071C84
08071C70 004 LSLS R0, R1, #0x18
08071C72 004 LSRS R0, R0, #0x18
08071C74 004 BL sub_08071BC4
08071C78 004 BL sub_08071CEC
08071C7C 004 B loc_08071C96
08071C7C @ ---------------------------------------------------------------------------
08071C7E 004 .byte 0
08071C7F 004 .byte 0
08071C80 004 off_08071C80: .long unk_083AC990 @ DATA XREF: fanfare_play+8r
08071C84 @ ---------------------------------------------------------------------------
08071C84
08071C84 loc_08071C84: @ CODE XREF: fanfare_play+Ej
08071C84 004 ADDS R2, #4
08071C86 004 ADDS R1, #1
08071C88 004 CMP R1, #0xD
08071C8A 004 BLS loc_08071C6A
08071C8C 004 MOVS R0, #0
08071C8E 004 BL sub_08071BC4
08071C92 004 BL sub_08071CEC
08071C96
08071C96 loc_08071C96: @ CODE XREF: fanfare_play+1Cj
08071C96 004 POP {R0}
08071C98 000 BX R0

Diegoisawesome
December 18th, 2010, 8:29 AM
Wow, I did not expect to see this after such a long hiatus.
Thanks a lot, AmineX and shiny quagsire! This will really help, as I can now insert custom fanfares without the sound and music overlapping!

Jambo51
December 20th, 2010, 4:36 AM
Is there any way we could adapt this so that rather than restarting the music on the route after a battle, that it simply resumes like in HG/SS/D/P/PT? I'm sure it'd be complicated, but it'd be a worthwhile little hack if we got it to work.

Diegoisawesome
December 20th, 2010, 10:31 AM
Is there any way we could adapt this so that rather than restarting the music on the route after a battle, that it simply resumes like in HG/SS/D/P/PT? I'm sure it'd be complicated, but it'd be a worthwhile little hack if we got it to work.
That would be interesting, but there's not really that much point to it.
I mean, I never even really noticed how it resumed anyways, and I doubt anyone will if we do it in the 3rd gen, either.

Jambo51
December 26th, 2010, 12:58 PM
That would be interesting, but there's not really that much point to it.
I mean, I never even really noticed how it resumed anyways, and I doubt anyone will if we do it in the 3rd gen, either.

Yeah, you're probably right. I'm good at noticing these little things tbh. Always have been, but I get the feeling you're right on this one.

Useful hack, nonetheless, as I too was looking to use different fanfares on FR.