RE: Adding more Orgs Tutorial

Jan 10, 2018 at 5:17 AM
Best Cow
"Life begins and ends with Nu."
Join Date: Jun 27, 2013
Location:
Posts: 2635
Age: 27
This is really a callback to this thread by Noxid, but I figured that we should revisit this.

Now you can add more than the max 43 songs the game can really hold with this patch:
Code:
0x494000
38 C8 48 00 40 C8 48 00 48 C8 48 00 50 C8 48 00
5C C8 48 00 64 C8 48 00 6C C8 48 00 74 C8 48 00
7C C8 48 00 84 C8 48 00 8C C8 48 00 98 C8 48 00
A0 C8 48 00 AC C8 48 00 B4 C8 48 00 BC C8 48 00
C8 C8 48 00 D4 C8 48 00 D8 C8 48 00 E0 C8 48 00
E8 C8 48 00 F0 C8 48 00 F8 C8 48 00 00 C9 48 00
08 C9 48 00 10 C9 48 00 18 C9 48 00 20 C9 48 00
28 C9 48 00 30 C9 48 00 3C C9 48 00 44 C9 48 00
4C C9 48 00 54 C9 48 00 5C C9 48 00 64 C9 48 00
6C C9 48 00 74 C9 48 00 7C C9 48 00 84 C9 48 00
8C C9 48 00 94 C9 48 00 00 00 00 00 00 00 00 00

0x420F14
8B 04 95 00 40 49 00

0x420F5D
8B 0C 85 00 40 49 00
It moves the RAM from 0x4981E8 to 0x494000, and I made sure the line at 0x420F14 reads off that new RAM location. Now, that's good, but how to add the orgs, is pretty easy. Each dword (or every 4 bytes) in the RAM contains the addresses to the resource names to the Orgs.

Let's take the first dword (4 bytes) from 0x494000: 38 C8 48 00
It points to the address 0x48C838, which has the resource name to XXXX.

For the first 41 dwords (164 bytes) following XXXX, we're going to leave those alone, since they're not the focus on the subject. Let's look at the last qword (8 bytes) in the RAM. Now really, since it's in a more free space than it used to be, you can keep on adding addresses after those 00's at the very end, but then this wouldn't be a tutorial if I didn't teach you guys how to plug in new addresses in that area.
Ever put in a new hack to whatever new TSC command, custom entity, or custom weapon and notice all the free space right after the retn/jmp 4252A7 in those hacks? Well, this one will help you be sure to fill all those extra gaps in.

Now, we're going to go with the extra space that is located after my <MSX command, which I put inside a hack. So the first thing to do is input the address right after the end of the custom TSC code into the RAM. Here's the 42nd org slot:

0x4940A8
00 00 00 00

Let's put the address 0x42370E in that slot:

0x4940A8
0E 37 42 00

Now let's input the resource name inside that address. If you noticed in Noxid's thread on it, you'll notice some sort of pattern in the resource names. Each name and the space in-between each name are based on intervals of 4 bytes, depending on the amount of characters used for the name. For XXXX, you would need 8 bytes, 4 for the name, and 4 for the 00's afterwards, so it'll be more like this:

XXXX - 58 58 58 58 00 00 00 00

The amount of 00's vary between each hex characters for the ASCII, but it should all add up to a multiple of 4. Here's a few more examples corresponding to example resource names:

WANPAKU - 57 41 4E 50 41 4B 55 00 (7 ascii characers, 8 bytes)
DR - 44 52 00 00 (2 ascii characters, 4 bytes)
BLU - 42 4C 55 00 (3 ascii characters, 4 bytes)
UNDERTALE - 55 4E 44 45 52 54 41 4C 45 00 00 00 (9 ascii characters, 12 bytes)

Now, for the sake of memes, let's make the new resource name RAVE, so at the address 0x42370E, put this hex in:

0x42370E
52 41 56 45 00 00 00 00

After you copy to executable to everything (do it for each change in the assembly you make if following the tutorial, for convenience's sake), create a copy of the Doukutsu.exe file you were editing (so you'll be having Doukutsu.exe and Doukutsu - Copy.exe), you're going to use this new copy to help import the org in. Now, really it can be any org you wish, but I went with the Carnival Night org by Tpcool, since that was the main org in Rave Story, hence the resource name RAVE.

Open the copy with Resource Hacker and replace any of the orgs with the org of your choice. Then, rename it to the resource name you've plugged in the main Doukutsu file. Save and close and open the main Doukutsu file with Resource Hacker. Go to the Action tab and click on this option:
3logbp.png

This will allow you to import the newly renamed file from the copy to the main file, adding the new org to the library. Save and close Resource Hacker, and be sure to test it via TSC with Booster's Lab. Because this is the 42nd org in the mod, just use <CMU0042 in the script.

And there you have it, your mod now has whatever amount of new orgs! If you've followed the tutorial and still feel a bit sketchy about the whole process, here's some pictures to help show you it works.
The resource names in the assembly for the 42nd and 43rd orgs I've put in (between my <MSX command, a TSC hack of mine, and the <CLO command), note the amount of characters plugged in between the 00's in the hex for the resource names (with an extra 3 bytes after the Terri resource name).
mkccs7.png

The addresses also correspond to the hex in the RAM (the mod I was testing on currently has 47 orgs)
y4kces.png

And here's a comparison between the vanilla game and the mod with the 42nd and 43rd orgs in it.
gp9flb.png

I hope this is all clear to understand, and don't forget to test after every time you add a new org! Thank you ^w^

UPDATE: It seems to be compatible with Clownacy's Ogg Loader, however, it works by adding more songs without the assistance of this patch, this means that this patch is for if you want only orgs in your mod!

(2021/06/17) The latest version of Clownacy's Mod Loader will disregard adding more than 41 songs, REGARDLESS of whether this method is used or not. This method is now restricted to only orgs.
 
Last edited:
Apr 25, 2018 at 3:39 PM
Best Cow
"Life begins and ends with Nu."
Join Date: Jun 27, 2013
Location:
Posts: 2635
Age: 27
Thanks to @EnlightenedOne, I realized that I left a crucial detail for the relocation to work, and that is the RAM update in the the RMU code, which probably explains a couple bugs in a level or two, for MaGCSL, which I will fix right away meaning now the hack is complete. Just don't forget to add this in too, if you already have that hack set up in your mod!
Code:
0x420F5D
8B 0C 85 00 40 49 00
 
Apr 27, 2018 at 4:12 PM
Senior Member
"Fly, Fly, Fly!"
Join Date: Jun 24, 2016
Location: Israel
Posts: 127
Here's a tool that can do this for you, and also allows you to easily add/remove/edit entries. You're welcome.
 
Top