| |||
Views: 88,312,885 |
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search | 03-28-24 11:07 AM |
|
Guest: Register | Login |
0 users currently in ROM Hacking | 3 guests | 1 bot |
Main - ROM Hacking - Hacking Super Mario Kart Music | New thread | New reply |
messiaen |
| ||
Cheep-cheep Level: 32 Posts: 145/193 EXP: 203941 Next: 2501 Since: 05-26-08 From: Porto Alegre, Brazil Last post: 4414 days Last view: 4742 days |
So, I'm trying to work on an addmusic-derived music importer for Super Mario Kart. I've got the basic stuff working however I'm having trouble on the insertion part.
Until now, I was relying on the offsets for the Select Player screen Dirtbag gave me to do a few tests. In this case, the data is compressed in the ROM at 0x61e28. Before the actual pattern pointers/music data, there are these 4 bytes: 2102 00D0 0x00D0 is a pointer to where the following data will be uploaded in the SPC-RAM. I'm not sure about what the first numbers do (perhaps the size of the data block to be uploaded to SPC-RAM?). Replacing the music data that follows works nicely, however sequences bigger than about 0x200 will crash the game. But what is puzzling me is that I can't replace other decompressed sequences in the game. For instance, the Ghost Valley music pattern pointers beggins at 0x339 in the unheadered ROM, but when I replace it the data gets uploaded to the SPC-RAM at 0xD000 however some of the data around that region is overwritten, causing the sequence not to work. Can someone offer some insight ? I know pretty much zero about SNES and SPC hacking, so this is new territory to me. Also, could someone explain how to work out the actual location of music data in the ROM from the pointers to music data in Stifu's SMK notes? So far what I have been doing is to dump the SPC RAM, go to $D000 (unheadered) and search for that in the ROM, however I don't understand how that pointer table in Stifu's note works. This is a small test I did a few days ago. Note that is only a really quick test, before I even got all the loop stuff to work: Thanks in advance. Edit: Found some good information in these old d4's notes. Seems like I missed the fact that most tracks are indeed compressed, which is probably why I couldn't replace other tracks. |
smkdan |
| ||
Ninji Level: 36 Posts: 218/238 EXP: 287972 Next: 20138 Since: 05-26-07 Last post: 4033 days Last view: 3982 days |
The standard format for the header is:
bytes 1-2: size of block bytes 3-4: ARAM address to start uploading to If size of block == 0000 then ARAM address is actually the jump address for the SPC700. Make sure you get this right or you will crash the SPC700 when it tries to jump to a bogus address and make the entire game hang eventually if not immediately. If size of block != 0000 then upload another block. so it looks like it fits, atleast for the address part. I am assuming it uses the boot ROM to upload like other first party games. If it is actually using this format then it's uploading 0x221 bytes to 0xD000. |
messiaen |
| ||
Cheep-cheep Level: 32 Posts: 146/193 EXP: 203941 Next: 2501 Since: 05-26-08 From: Porto Alegre, Brazil Last post: 4414 days Last view: 4742 days |
Thanks smkdan. Even after adjusting the block size in the header things weren't working right. I looked at the tracks from the game and after the music data there's always these 4 bytes: "00 00 00 08". Appending this after the music data mde things work. Is this usual in the N-SPC format or something specific to Mario Kart?
I've written a simple inserter using the Lunar Compress DLL, but what I need to do now is to repoint the music data to avoid corrupting the ROM when inserting data larger than the original. I have a question about SNES pointers. To read pointers, I just read them as little endian and them get rid of the first nibble in the third byte. Ie: 28 1E [C]6 = 0x61e28 01 98 [8]4 = 0x49801 Now I have read from a DataCrystal article Dirtbag pointed to me that the "C" before the address means it's a pointer to ROM data. But what about "8" (as in the second pointer above) ? What's the difference and should I worry about it when moving data around? |
smkdan |
| ||
Ninji Level: 36 Posts: 219/238 EXP: 287972 Next: 20138 Since: 05-26-07 Last post: 4033 days Last view: 3982 days |
The first 2 bytes mean size of block = 0 so stop uploading, the next two bytes are even used. the spc end will set it as the new destination in ARAM to start writing to, but it gets terminated so it's useless. The first two 00 00 bytes are the essential bits. The jump address in my above post is irrelevant because this game along with SMW uses a slightly modified copy of the bootrom code to handle the upload. This isn't 100% tied into N-SPC cause it's only upload code, not actual playback of the sequence data. This seems to be used all the way through to YI though, don't see why they'd change it up. for the hell of it, the location of this will be of interest if you want to trace the upload incase something goes wrong (see RHDN for latest bsnes that lets you trace SPC with ease):
$014 is the pointer used in upload. note YA = D000 which is where it is sending the data. This one is actually used.
this one is not, the 00 08 bytes you posted are used (see YA again) but the SNES told the SPC to stop uploading so it gets trashed and it returns to the main N-SPC code. For the SNES pointers the way this works for hirom is that both C+ and 8+ pointers can point to ROM but there are strings attached for the 8+ ones. Say if you had $8xxxxx then the bold 'x' letters must lie within $8000-$FFFF or it won't be accessing the ROM at all. it will get RAM, or other internal stuff, or even accidentally poke the DSP-1. With the C0+ pointers there isn't any such restriction, the entire range is ROM. It's like this so the snes can actually reset itself properly and that you can access some ROM, system control register and RAM in one bank. C0+ pointers are more flexible in this regard when repointing things. |
messiaen |
| ||
Cheep-cheep Level: 32 Posts: 151/193 EXP: 203941 Next: 2501 Since: 05-26-08 From: Porto Alegre, Brazil Last post: 4414 days Last view: 4742 days |
Haven't worked on this for a while, so I'll just release what I have for now: a MML importer almost fully compatible with SMW's addmusic (it's actually built from romi's addmusic) and a simple inserter (requires Lunar Compress.dll).
A warning, the inserter will corrupt your ROM if the inserted file is bigger than the original one. Right now the only option is to manually change the music pointer table at 0x1f47b so that it points to a free area of the ROM. Once I know more how SMK editors such as MAKE deal with extending the ROM and using the extra space I will make it automatically repoint stuff. Download. Here's a conversion of a .mml file from SMWCentral to SMK: A few differences from Romi's addmusic: intro command ('/') isn't supported, and you can only specify one string of musical data to each channel. For instance, this won't work: #0 v180 #1 v200 #2 v220 #0 c #1 d #2 e So change to this: #0 v180 c #1 v200 d #2 v220 e Instrument list can be found on d4s's notes. |
Stifu |
| ||
Cobrat Level: 56 Posts: 297/666 EXP: 1358148 Next: 40028 Since: 02-22-07 Last post: 656 days Last view: 278 days |
Hey messiaen,
You might want to use the compressor used in Epic Edit rather than Lunar Compress. It's open source, and has a higher compression rate. As for repointing stuff, having a look at our SMK notes (although I haven't uploaded the updated version yet) or at the Epic Edit sources should tell you how to remap data (it's in Rom/Game.cs, looking for "Offsets.TrackMaps" for example). Links: SMK notes (HTML, CHM) Epic Edit Google Code (latest sources) Hope that helps. |
roxahris |
| ||
Level: 52 Posts: 485/568 EXP: 1069953 Next: 13887 Since: 02-19-07 From: Here? Last post: 3894 days Last view: 3857 days |
Ugh, people still use that? You'd think people would have moved onto a better way of editing music by now. ____________________ Love your lawn. |
ScouB |
| ||
Newcomer Level: 7 Posts: 5/7 EXP: 1371 Next: 77 Since: 03-24-09 Last post: 4903 days Last view: 4698 days |
Very interesting thread !
Good job ! Please keep us informed of the evolution of your work |
messiaen |
| ||
Cheep-cheep Level: 32 Posts: 152/193 EXP: 203941 Next: 2501 Since: 05-26-08 From: Porto Alegre, Brazil Last post: 4414 days Last view: 4742 days |
Posted by Stifu Thanks, I may look at that. By the way, Dirtbag suggested I could perhaps use the original Track Layout/AI/Object Overlay Data space to put the new music data. Since MAKE expands the ROM and repoint stuff, the original data isn't used anymore. Does your editor do someting similar? Posted by roxahrisUgh, people still use that? You'd think people would have moved onto a better way of editing music by now. Still better than hex (by the way, Lilypond uses text-based files). But thinking about alternatives, one could write a plug-in for some of the music notation programs out there, such as Finale or Sibelius. I know Sibelius has some sort of script language, not sure if it could handle exporting to N-SPC or something along that lines. Or perhaps one could search for a open music notation software and work from that. |
Stifu |
| ||
Cobrat Level: 56 Posts: 298/666 EXP: 1358148 Next: 40028 Since: 02-22-07 Last post: 656 days Last view: 278 days |
Posted by messiaen Yes, Epic Edit does the same thing, basically. But not for data which has a fixed size, so it's not necessary to relocate it, like objects. |
Deathkiller90 |
| ||
Newcomer Level: 3 Posts: 1/1 EXP: 58 Next: 70 Since: 09-18-14 Last post: 3479 days Last view: 3479 days |
The addmusic is broken, I tried using it properly (With the dll and without, changing it,) I just get an error saying "Side by side Configuration is incorrect" I used the cmd prompt properly. And tried redownloading, Only the most important one is broken, not the nspc.
I know its not the file i'm using because the error also happends when I just click it. |
BLaBrake |
| ||
Goomba Level: 14 Posts: 25/34 EXP: 11831 Next: 1240 Since: 06-27-14 Last post: 2398 days Last view: 225 days |
You have to do a google search and find these .dlls from somewhere. I can't give them to you because of Microsoft licensing, blah, blah, blah. http://imgur.com/fMNIdpI They shouldn't be too hard to find.
Another option is if you know how to use lunar compress already. Just use Stifu's offset notes to locate where the music goes and then recompress your .bin music file into the correct slot. Hope this helps... |
MiniCompute |
| ||
Bubble Level: 66 Posts: 605/981 EXP: 2415811 Next: 46040 Since: 04-25-07 Last post: 460 days Last view: 669 days |
Posted by BLaBrake Would you mind recording yourself on screen and show us how to insert the music to smk ? I tried it myself and couldn't figure out what to do halfway into porting one song. I'm visual learner so I learn faster if I see it done correctly by someone else. |
BLaBrake |
| ||
Goomba Level: 14 Posts: 26/34 EXP: 11831 Next: 1240 Since: 06-27-14 Last post: 2398 days Last view: 225 days |
I don't have time to make a video right now. I can try to when time permits, but that may be a while. Where are you getting hung up in the process? I can try to walk you through it. |
MiniCompute |
| ||
Bubble Level: 66 Posts: 606/981 EXP: 2415811 Next: 46040 Since: 04-25-07 Last post: 460 days Last view: 669 days |
Posted by BLaBrake Log Name: Application Source: SideBySide Date: 9/19/2014 3:10:54 PM Event ID: 33 Task Category: None Level: Error Keywords: Classic User: N/A Computer: MS Description: Activation context generation failed for "C:\Users\MikeXPTechnology\Documents\Mario Kart hacking\smk.exe". Dependent Assembly Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis. Event Xml: Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" C:\Users\MikeXPTechnology\Documents\Mario Kart hacking\smk.exe This is the problem the original proogrammer for this app may have made a tiny mistake. http://blogs.msdn.com/b/cesardelatorre/archive/2011/03/27/the-application-has-failed-to-start-because-its-side-by-side-configuration-is-incorrect-error-related-to-mmc-exe-programs-and-weird-cause-amp-simple-solution.aspx http://codeketchup.blogspot.sg/2012/07/how-to-correct-side-by-side.html Can you look at the porgrams coding and see where it maybe erroring out ? |
BLaBrake |
| ||
Goomba Level: 14 Posts: 27/34 EXP: 11831 Next: 1240 Since: 06-27-14 Last post: 2398 days Last view: 225 days |
MikeTechno, I sent you a PM that should help... |
MiniCompute |
| ||
Bubble Level: 66 Posts: 609/981 EXP: 2415811 Next: 46040 Since: 04-25-07 Last post: 460 days Last view: 669 days |
Posted by BLaBrake Sweet jesus the program stopped erroring out, I refollow the directions and try it again later on today. I may look into those dll licenses closer next week thanks for the tidbit. |
MiniCompute |
| ||
Bubble Level: 66 Posts: 614/981 EXP: 2415811 Next: 46040 Since: 04-25-07 Last post: 460 days Last view: 669 days |
Alright with the dlls in the directory the program opens up and closes ?
Could I please get some instructions to make it open all the way up to inserting the music ? I have a 4kb mml ready to go I want to see it works out decently. |
BLaBrake |
| ||
Goomba Level: 14 Posts: 28/34 EXP: 11831 Next: 1240 Since: 06-27-14 Last post: 2398 days Last view: 225 days |
You have to run it in the command prompt (cmd.exe). Notes about how to use the commands are in my post a page or two back. |
MiniCompute |
| ||
Bubble Level: 66 Posts: 615/981 EXP: 2415811 Next: 46040 Since: 04-25-07 Last post: 460 days Last view: 669 days |
Posted by BLaBrake Success I got it to excute and it sounds abit like you mention... About your tutorial I'm going to copy everything into a word document and host it back up after you approve it. Also before I leave aren't you MVS from smwcentral ? o0 ~this music is too cheesy though~ Funny crap it is thanks for the help |
Main - ROM Hacking - Hacking Super Mario Kart Music | New thread | New reply |
© 2005-2023 Acmlm, blackhole89, Xkeeper et al. |
MySQL - queries: 127, rows: 167/167, time: 0.018 seconds. |