Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,484,726
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-26-24 02:37 AM
Guest: Register | Login

0 users currently in ROM Hacking | 2 guests

Main - ROM Hacking - Super Mario Kart - How to change the static music New thread | New reply


dirtbag
Posted on 08-04-15 10:05 PM (rev. 2 of 08-04-15 10:06 PM) Link | Quote | ID: 160552


Red Koopa
Level: 27

Posts: 128/128
EXP: 114674
Next: 1485

Since: 02-24-07

Last post: 3187 days
Last view: 3100 days
For Super Baldy Kart I changed all the music, not just the race tracks, I did say I'd share how I did it.

There is a warning with this - it's not for beginners, you need to understand your way around a hex editor and understand SNES pointers. For the music there is no simple way, I did a lot manual work to build my tracks.

All the location of all of the tracks for the racers and others I found and changed for SBK I've updated to Stifu's note's. To update them what you will need to do overwrite them with your own NSPC code and then update the pointers. There are two pointer types, one for the location of the tracks that are towards the start of the music data, the other pointers are for any loops in your music tracks. If you don't want to update the loops, don't put any in yout music, in MML loops are denoted with square brackets [] with a number after to indicate the number of loops e.g. [xxxxx]2 would loop twice.

What I did was to use the N-SPC tool messiaen created to compile the MML to N-SPC code, then manually copying the tracks and updating the pointers for the tracks (8 sound channels) as well as any loops in the compiled NSPC code - $EF is used for loop pointers.

Why do the pointers need to be updated? Well the music used for the races are loaded dynamically (with each track theme), this is why all the pointers start at an offset of 0. There is only ever one race music loaded in APU-RAM at one time. The others, victory tunes etc., are static in the APU-RAM so that they are always loaded in memory.

I started simple - one track, just played the notes ABCDEF with no loops, I used this to get the offsets right. Overwrite the data for the first track, from there I could count back and workout the offset. So for example for Luigi's music you notice that the pointers are have a offset of +$37 and Mario's you need to add $3B to the pointers.

To speed up testing you can make the changes and test how they work with the following cheat code:
7E0E14xx:

01: Race Start
02: Signal
03: Signal2
05: Final Lap
08: Star
09: Win
0A: Time Trial Goal
0B: Lose
0C: Mario
0D: Luigi
0E: Bowser
0F: Princess
10: D.K.JR
11: Koopa
12: Toad
13: Yoshi
14: Game Over

I can't recall where I found this data sheet for N-SPC op codes so I can't credit whoever wrote it, but it's very helpful.

VCMD Description Arguments

$00 End / Return
$01-7F Note Parameters xy
$80-C7 Notes
$C8 Tie
$C9 Rest
$CA-DF Percussion Note
$E0 Set Instrument xx
$E1 Pan xx
$E2 Pan Fade xx yy
$E3 Vibrato On xx yy zz
$E4 Vibrato Off
$E5 Master Volume xx
$E6 Master Volume Fade xx yy
$E7 Tempo xx
$E8 Tempo Fade xx yy
$E9 Global Transpose xx
$EA Per-Voice Transpose xx
$EB Tremolo On xx yy zz
$EC Tremolo Off
$ED Volume xx
$EE Volume Fade xx yy
$EF Call Subroutine xx yy zz
$F0 Vibrato Fade xx
$F1 Pitch Envelope To xx yy zz
$F2 Pitch Envelope From xx yy zz
$F3 Pitch Envelope Off
$F4 Tuning xx
$F5 Echo VBits / Volume xx yy zz
$F6 Echo Off
$F7 Echo Parameters xx yy zz
$F8 Echo Volume Fade xx yy zz
$F9 Pitch Slide xx yy zz
$FA Percussion Patch Base xx
$FB-FF Undefined (Out of Table)


Main - ROM Hacking - Super Mario Kart - How to change the static music New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.048 seconds. (347KB of memory used)
MySQL - queries: 37, rows: 57/58, time: 0.042 seconds.