Adding more ORGs

Dec 4, 2009 at 8:00 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 6000
wedge of cheese said:
Well I don't think it's that simple. There's probably some list in the CS engine where it says like "song 0000 = XXXX, song 0001 = WANPAKU" etc (except not in plain english like that obviously). You would also have to modify that list, but as far as I know no one on the forums has ever found it.

That's because they never looked!

Code:
0048C838  58 58 58 58 00 00 00 00 57 41 4E 50 41 4B 55 00  XXXX....WANPAKU.
0048C848  41 4E 5A 45 4E 00 00 00 47 41 4D 45 4F 56 45 52  ANZEN...GAMEOVER
0048C858  00 00 00 00 47 52 41 56 49 54 59 00 57 45 45 44  ....GRAVITY.WEED
0048C868  00 00 00 00 4D 44 4F 57 4E 32 00 00 46 49 52 45  ....MDOWN2..FIRE
0048C878  45 59 45 00 56 49 56 49 00 00 00 00 4D 55 52 41  EYE.VIVI....MURA
0048C888  00 00 00 00 46 41 4E 46 41 4C 45 31 00 00 00 00  ....FANFALE1....
0048C898  47 49 4E 53 55 4B 45 00 43 45 4D 45 54 45 52 59  GINSUKE.CEMETERY
0048C8A8  00 00 00 00 50 4C 41 4E 54 00 00 00 4B 4F 44 4F  ....PLANT...KODO
0048C8B8  55 00 00 00 46 41 4E 46 41 4C 45 33 00 00 00 00  U...FANFALE3....
0048C8C8  46 41 4E 46 41 4C 45 32 00 00 00 00 44 52 00 00  FANFALE2....DR..
0048C8D8  45 53 43 41 50 45 00 00 4A 45 4E 4B 41 00 00 00  ESCAPE..JENKA...
0048C8E8  4D 41 5A 45 00 00 00 00 41 43 43 45 53 53 00 00  MAZE....ACCESS..
0048C8F8  49 52 4F 4E 48 00 00 00 47 52 41 4E 44 00 00 00  IRONH...GRAND...
0048C908  43 75 72 6C 79 00 00 00 4F 53 49 44 45 00 00 00  Curly...OSIDE...
0048C918  52 45 51 55 49 45 4D 00 57 41 4E 50 41 4B 32 00  REQUIEM.WANPAK2.
0048C928  51 55 49 45 54 00 00 00 4C 41 53 54 43 41 56 45  QUIET...LASTCAVE
0048C938  00 00 00 00 42 41 4C 43 4F 4E 59 00 4C 41 53 54  ....BALCONY.LAST
0048C948  42 54 4C 00 4C 41 53 54 42 54 33 00 45 4E 44 49  BTL.LASTBT3.ENDI
0048C958  4E 47 00 00 5A 4F 4E 42 49 45 00 00 42 44 4F 57  NG..ZONBIE..BDOW
0048C968  4E 00 00 00 48 45 4C 4C 00 00 00 00 4A 45 4E 4B  N...HELL....JENK
0048C978  41 32 00 00 4D 41 52 49 4E 45 00 00 42 41 4C 4C  A2..MARINE..BALL
0048C988  4F 53 00 00 54 4F 52 4F 4B 4F 00 00 57 48 49 54  OS..TOROKO..WHIT
0048C998  45 00 00 00                                      E...
That's where the names of the resources are stored.
Code:
00420F14  |. 8B0495 E881490>MOV EAX,DWORD PTR DS:[EDX*4+4981E8]
00420F1B  |. 50             PUSH EAX                                 ; /Arg1
00420F1C  |. E8 CFB7FFFF    CALL CS_ORG_e.0041C6F0                   ; \CS_ORG_e.0041C6F0

This is the line that tells which song to pick. EDX is the number from the TSC for the song ID. 4981E8 - 49828(C?) is a list of addresses that points to the various names. 41C6F0 finds and loads the resource ORG of name EAX.

There's enough room past 4981E8 for a 42 and 43 (You'd have to find some empty space somewhere else to put the name of the resource). If you wanted, say, a hundred new songs, you'd have to find a larger empty space than there is room for at 4981E8, because at 498238 there's stuff, and I don't know what it does.

After all that, you use your resource hacker to add the ORG and give it the appropriate name. The machine will find it for you, if you did things the normal way then it will be song 42. (probably)

Um, does that make sense?

EDIT: On a side note, I don't know what effects actually ADDING the resources (ORGS) themselves will have, or if it's anything more than just inflating the .exe Also, if you wanted to play with this stuff, the U for <CMU is at 00424313, the second call is the one you're interested in.

EDIT2: some other interesting tidbits I discovered: [4A4B00] is your position in the current song (measured in beats I would imagine?) and [4A57F8] seems to be the position in the last song played (stored for <RMU, like how [004a57fc] is last song ID)
 
Dec 4, 2009 at 8:55 PM
graters gonna grate
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jul 2, 2008
Location: &
Posts: 1886
Age: 29
Oooh, nice find there Nox! Those offsets might prove useful for me, because...

In the Paradise Project, I was gonna do some major hax to the in game organya player and TSC commands so that you had much more control over the music with new TSC commands (for example, you could change the repeat points, tempo, volume, track voice, or track volume on the fly with a TSC command or you could synchronize cutscenes with music using things like <MUJxxxx:yyyy:xxxx (jump to event x if song is between points y and z) or <WMUxxxx (wait for the song to pass point x) or <SKMxxxx (skip to point x in the music))

In any case, good job!
 
Dec 4, 2009 at 9:34 PM
Senior Member
"Huzzah!"
Join Date: Nov 23, 2009
Location: Outside of the core, not willing to progress.
Posts: 205
maaan, wish I knew more about assembly..
 
Dec 4, 2009 at 9:39 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
you could learn.
it's not that hard, ya know.
 
Dec 4, 2009 at 9:46 PM
Creating A Legacy...
Bobomb says: "I need a hug!"
Join Date: Sep 6, 2009
Location: The Balcony
Posts: 852
Age: 27
Hey lace you know ive got sonic;s story on thw way (New demos been released :rolleyes: ) i would like to learn assembely. Any top tips?
 
Dec 4, 2009 at 10:00 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 6000
JetHawk95 said:
Hey lace you know ive got sonic;s story on thw way (New demos been released :rolleyes: ) i would like to learn assembely. Any top tips?

ProTip: Get >>This<<.

Makes a handy reference, and comes with the un-advanced tutorial! Other than that, just go around reading all the old Haxxing threads by RuneLancer and folks, these forums are a veritable goldmine of information
 
Last edited by a moderator:
Nov 13, 2012 at 9:48 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
comes with the un-advanced tutorial!
oh, you mean the one I wrote? :D

yeah, that has all of the basic commands, but the best thing you can do is to just open your exe up in olly and start screwing around with the code.
you could try the tsc parser as a start, it's pretty easy to understand.

here's some offsets for that:
Code:
General:
0x422510 - Parser Start
0x4225d5 - Galloping Triplets
0x425770 - End of Parser
0x421900 - ASCII to number

Command Ini:
0x4242dA - CMU
0x422666 - LI+
0x4227a3 - IT+
0x422821 - IT-
0x422893 - EQ+
0x422907 - EQ-
0x422c93 - UNI
0x42314F - KEY
0x424e28 - FAC
0x424eaf - FAC(2)
0x4251fc - ESC

Command Subs:
0x420ee0 - CMU
0x419c60 - LI+
0x419cb0 - ML+
0x4012d0 - IT+
0x401330 - IT-
0x416c70 - EQ+
*

*(fac, esc, key, and others don't have subroutines)

testing for bump
 
Top