GoGoJJTech
(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
- 2,475
- Posts
- 12
- Years
- Age 26
- Earth
- Seen Dec 9, 2016
This is a custom routine (currently only for FR) that switches music based on DNS's seasons. If the player doesn't have RTC or seasons enabled, the music defaults to spring music.
Here's an example of the ASM in action:
Neat, isn't it?
This is based off of Jambo51's hooks into the music loader. Once you add this routine in, all music changes as soon as the game begins, and in real time. If it changes from February to March as the player is playing the game, the next song they load will have spring music in it. Cool, isn't it?
Here's the ASM:
Fire Red
Yes, you will need to have 4 songtables to point to. BW/B2W2 have the songs for each season saved in the header, but that's not going to happen on gen 3 anytime soon, so having 4 songtables is easiest way to go.
To insert this into your FR hack, assemble the ASM above and place it at any free offset. Note down its location.
Navigate to 0x1DD0F8, 0x1DD124, 0x1DD170, 0x1DD1C4 and 0x1DD1F8 and change the code at ALL of the locations to:
The XX is there so you know not to overwrite the byte that's already there. Now, replace all previously existing pointers to 0x4A32CC with a pointer to the THUMB routine, remembering to add 1 for thumb of course.
Emerald
Yes, you will need to have 4 songtables to point to. BW/B2W2 have the songs for each season saved in the header, but that's not going to happen on gen 3 anytime soon, so having 4 songtables is easiest way to go.
To insert this into your Em hack, assemble the ASM above and place it at any free offset. Note down its location.
Navigate to 0x2E0134, 0x2E0160, 0x2E01AC, 0x2E0200 and 0x2E0234 and change the code at ALL of the locations to:
The XX is there so you know not to overwrite the byte that's already there. Now, replace all previously existing pointers to 0x6B49F0 with a pointer to the THUMB routine, remembering to add 1 for thumb of course.
To have the music work out, you just place the same songs in the same slots in each table. For example, you'd place all 4 of the same route in slot 293 in Sappy, however, they'd all be from the different seasons. For songs that don't switch between seasons such as the trainer battle theme, just keep them all the exact same.
Once you insert, your music should automatically begin to switch on its own without you doing anything. You will have to restart all save states, not save files. And now you're done!
Here's an example of the ASM in action:
Neat, isn't it?
This is based off of Jambo51's hooks into the music loader. Once you add this routine in, all music changes as soon as the game begins, and in real time. If it changes from February to March as the player is playing the game, the next song they load will have spring music in it. Cool, isn't it?
Here's the ASM:
Fire Red
Spoiler:
Code:
.thumb
main:
add r3, r2, #0x4
ldr r1, DNS /*Check if DNS is installed*/
ldrh r2, [r1]
cmp r2, #0x0 /*If not, default to "spring" music*/
beq spring
ldrb r1, [r1, #3]
cmp r1, #0xC /*December*/
beq winter
cmp r1, #0x9 /*September-November*/
bge autumn
cmp r1, #0x6 /*June-August*/
bge summer
cmp r1, #0x3 /*March-May*/
bge spring /*If it doesn't go to spring, it covers the rest of the months as winter, AKA January and February*/
winter:
ldr r1, wintertable
b exit
autumn:
ldr r1, autumntable
b exit
summer:
ldr r1, summertable
b exit
spring:
ldr r1, normaltable
exit:
lsr r0, #0xD
add r0, r1
ldr r2, ramtable
mov pc, r3
.align 2
DNS: .word 0x0300553C
ramtable: .word 0x084A329C
normaltable: .word 0x0_______ /*Point this to the Spring songtable*/
summertable: .word 0x0_______ /*Point this to the Summer songtable*/
wintertable: .word 0x0_______ /*Point this to the Winter songtable*/
autumntable: .word 0x0_______ /*Point this to the Autumn songtable*/
Yes, you will need to have 4 songtables to point to. BW/B2W2 have the songs for each season saved in the header, but that's not going to happen on gen 3 anytime soon, so having 4 songtables is easiest way to go.
To insert this into your FR hack, assemble the ASM above and place it at any free offset. Note down its location.
Navigate to 0x1DD0F8, 0x1DD124, 0x1DD170, 0x1DD1C4 and 0x1DD1F8 and change the code at ALL of the locations to:
Code:
7A 46 XX 49 08 47
Emerald
Spoiler:
Code:
.thumb
main:
add r3, r2, #0x4
ldr r1, DNS /*Check if DNS is installed*/
ldrh r2, [r1]
cmp r2, #0x0 /*If not, default to "spring" music*/
beq spring
ldrb r1, [r1, #3]
cmp r1, #0xC /*December*/
beq winter
cmp r1, #0x9 /*September-November*/
bge autumn
cmp r1, #0x6 /*June-August*/
bge summer
cmp r1, #0x3 /*March-May*/
bge spring /*If it doesn't go to spring, it covers the rest of the months as winter, AKA January and February*/
winter:
ldr r1, wintertable
b exit
autumn:
ldr r1, autumntable
b exit
summer:
ldr r1, summertable
b exit
spring:
ldr r1, normaltable
exit:
lsr r0, #0xD
add r0, r1
ldr r2, ramtable
mov pc, r3
.align 2
DNS: .word 0x0300553C
ramtable: .word 0x086B49C0
normaltable: .word 0x0_______ /*Point this to the Spring songtable*/
summertable: .word 0x0_______ /*Point this to the Summer songtable*/
wintertable: .word 0x0_______ /*Point this to the Winter songtable*/
autumntable: .word 0x0_______ /*Point this to the Autumn songtable*/
Yes, you will need to have 4 songtables to point to. BW/B2W2 have the songs for each season saved in the header, but that's not going to happen on gen 3 anytime soon, so having 4 songtables is easiest way to go.
To insert this into your Em hack, assemble the ASM above and place it at any free offset. Note down its location.
Navigate to 0x2E0134, 0x2E0160, 0x2E01AC, 0x2E0200 and 0x2E0234 and change the code at ALL of the locations to:
Code:
7A 46 XX 49 08 47
To have the music work out, you just place the same songs in the same slots in each table. For example, you'd place all 4 of the same route in slot 293 in Sappy, however, they'd all be from the different seasons. For songs that don't switch between seasons such as the trainer battle theme, just keep them all the exact same.
Once you insert, your music should automatically begin to switch on its own without you doing anything. You will have to restart all save states, not save files. And now you're done!
Last edited: