King Omega
Smash Journeyman
- Joined
- Apr 15, 2009
- Messages
- 388
The ASL thread is filled with an endless stream of identical questions/complaints about the code, so I figured a help thread was in order. I originally made this post there, but of course it's a couple pages back now and no one reads it.
We're going to build the Alternate Stage Loader Data code (one of two required; the other doesn't need any editing) step by step. Let's say we want three button-activated textures for Final Destination and two random ones.
This is always the same.
Once we have the entire remainder of the code completed, we will return and enter the byte count for LLLL.
All the following codes up to (obviously not including) the line with FADEDEAD are what Dantarion labeled DATADATA DATADATA in the original post.
46494E41 is the stage ID for Final Destination, taken from the nice big list at the end of this post and entered for SSSSSSSS. BB is the number of button-activated stages, so it will be 03. RR is the number of random stages, so it will be 02.
This is the button avtivation line, repeated three times because we want three button-activated stages. 0100 is the code for GameCube A button and 0001 is the code for GameCube Left button, so 0101 is the code for Left+A. Likewise, 0102 is Right+A and 0104 is Down+A. 00 at the end of the first segment of the first line is what corresponds to STGname_A, 01 below that is _B, and 02 below that is _C. So, the stages we want to be button activated will be named STGFINAL_A, STGFINAL_B, and STGFINAL_C. The two random stages will be named STGFINAL_D and STGFINAL_E, and require no code other than the 02 we already entered for RR.
Values for button activators (as well as examples of how to add them to get combinations' values) are also at the end of this post.
This is always the same.
Now we count the number of code lines between the line with LLLL and the line with FADEDEAD. We could count in hexadecimal or count "normally" and convert the number with an online resource, Windows Calculator, etc.
Since there are 4, LLLL becomes 0005 (4 + 1 = 5). In this case, the "normal"/decimal number (4) is the same as the hexadecimal number (4).
The code is now complete. Files are named and moved to [partition]/stage/melee. If we wanted another stage, the stage ID would go after the block for Final Destination (after 01040002 00000000) and the process would begin again. Being non-idiots, we would of course enter correct values for number of button-activated and number of random stages, label the button code lines to match the filenames, and update our byte count.
Understand now? I made that as idiot-proof as possible.
For those of you who missed it, there's a link in the text to a handy converter in the section on counting the number of lines. Lastly, to use Windows Calculator, simply switch to Programming mode, enter the decimal number, and select Hex.
EDIT1: How do you make the original Brawl stage load?
Several simple ways.
Only the last method will work if you have any random stages set up.
And now, the one thing I am unsure of.
I'm not positive of the exact method to have the code load a stage both randomly and by button activators, however, I can make a well-educated guess. Here's how I imagine it works (yeah, I'll test this sometime or other):
If anyone wants to test the button/random method for me, feel free. It *might* just add the original Brawl stage (or extension-less STGname.pac if you have it) to the random lineup.
LISTS FROM DANT'S OP
Stage IDs/ASCII Data
Button Activators
Wiimote - is ignored entirely by Brawl. Home, obviously, is not supported.
I'm not sure about Nunchuk analog, Z, or C. The analogs are likely the same values as the GC/CC directions if they exist.
Here's a quick example of how button combinations are set up in case you missed it in the section above. On the GameCube/GCN/GC Controller, 0100 is A, and 0001 is left. Simply add them--
--and you get the value for Left+A, 0101. Now, a quick hexadecimal example. Let's say I want A+X+Y (GCN) as my button combination. 0100 is A, 0400 is X, and 0800 is Y.
I recommend most if not all button combinations should involve A or Start, as it's tricky (impossible?) to release the button you use to select a stage and press your desired button combination before the code goes into action. I don't recommend you use A or Start (or any single button, really) by themselves, as this may cause freezes/errors etc.
We're going to build the Alternate Stage Loader Data code (one of two required; the other doesn't need any editing) step by step. Let's say we want three button-activated textures for Final Destination and two random ones.
Code:
46000010 00000000
44000000 005A7D00
Code:
6620[COLOR="darkorange"]LLLL[/COLOR] 00000000
All the following codes up to (obviously not including) the line with FADEDEAD are what Dantarion labeled DATADATA DATADATA in the original post.
Code:
[COLOR="Yellow"]SSSSSSSS[/COLOR] [COLOR="Red"]BB[/COLOR][COLOR="Magenta"]RR[/COLOR]0000
v
[COLOR="yellow"]46494E41[/COLOR] [COLOR="Red"]03[/COLOR][COLOR="Magenta"]02[/COLOR]0000
Code:
[COLOR="Lime"]JJJJ[/COLOR]00[COLOR="Cyan"]II[/COLOR] 00000000
v
[COLOR="lime"]0101[/COLOR]00[COLOR="cyan"]00[/COLOR] 00000000
[COLOR="lime"]0102[/COLOR]00[COLOR="cyan"]01[/COLOR] 00000000
[COLOR="lime"]0104[/COLOR]00[COLOR="cyan"]02[/COLOR] 00000000
Values for button activators (as well as examples of how to add them to get combinations' values) are also at the end of this post.
Code:
00000DED FADEDEAD
E0000000 80008000
Now we count the number of code lines between the line with LLLL and the line with FADEDEAD. We could count in hexadecimal or count "normally" and convert the number with an online resource, Windows Calculator, etc.
Code:
[COLOR="Silver"]46000010 00000000
44000000 005A7D00
6620[/COLOR][COLOR="darkorange"]LLLL[/COLOR] [COLOR="silver"]00000000[/COLOR]
46494E41 03020000 < 1
01010000 00000000 < 2
01020001 00000000 < 3
01040002 00000000 < 4
[COLOR="silver"]00000DED FADEDEAD
E0000000 80008000[/COLOR]
v
46000010 00000000
44000000 005A7D00
6620[COLOR="darkorange"]0005[/COLOR] 00000000
46494E41 03020000
01010000 00000000
01020001 00000000
01040002 00000000
00000DED FADEDEAD
E0000000 80008000
The code is now complete. Files are named and moved to [partition]/stage/melee. If we wanted another stage, the stage ID would go after the block for Final Destination (after 01040002 00000000) and the process would begin again. Being non-idiots, we would of course enter correct values for number of button-activated and number of random stages, label the button code lines to match the filenames, and update our byte count.
Understand now? I made that as idiot-proof as possible.
For those of you who missed it, there's a link in the text to a handy converter in the section on counting the number of lines. Lastly, to use Windows Calculator, simply switch to Programming mode, enter the decimal number, and select Hex.
EDIT1: How do you make the original Brawl stage load?
Several simple ways.
- Use a button activator to make the code load a file extension (example _Z) that isn't on your SD card
- Load the stage without holding any buttons (won't work if you have a stage set to load this way)
- Load the stage with a button activator not set up in the code (there are more than 26 combinations of activators, so this is always possible)
Only the last method will work if you have any random stages set up.
And now, the one thing I am unsure of.
I'm not positive of the exact method to have the code load a stage both randomly and by button activators, however, I can make a well-educated guess. Here's how I imagine it works (yeah, I'll test this sometime or other):
- Make sure the stage you want to be dually loaded has the last letter extension of all the button-activated stages (ex. if you have three, it should be _C)
- Set RR to the number of stages left on the SD that aren't set in the button activator code (so if _D and _E left over and we want _C to be dual, this is 3)
- *I THINK* the code will now load it both with the set button activator and randomly
- If you want multiple dually loaded stages (assuming my method is right), just make sure they are all the last letter extensions (_C and _D in a set of four), then set RR to number of remaining stages plus 2
If anyone wants to test the button/random method for me, feel free. It *might* just add the original Brawl stage (or extension-less STGname.pac if you have it) to the random lineup.
LISTS FROM DANT'S OP
Stage IDs/ASCII Data
Code:
STGBATTLEFIELD.PAC (BATT)
42415454
STGCHARAROLL.PAC (CHAR)
43484152
STGCONFIGTEST.PAC (CONF)
434f4e46
STGCRAYON.PAC (CRAY)
43524159
STGDOLPIC.PAC (DOLP)
444f4c50
STGDONKEY.PAC (DONK)
444f4e4b
STGDXBIGBLUE.PAC (DXBI)
44584249
STGDXCORNERIA.PAC (DXCO)
4458434f
STGDXGARDEN.PAC (DXGA)
44584741
STGDXGREENS.PAC (DXGR)
44584752
STGDXONETT.PAC (DXON)
44584f4e
STGDXONETT_en.PAC (DXON)
44584f4e
STGDXPSTADIUM_en.PAC (DXPS)
44585053
STGDXRCRUISE.PAC (DXRC)
44585243
STGDXSHRINE.PAC (DXSH)
44585348
STGDXYORSTER.PAC (DXYO)
4458594f
STGDXZEBES.PAC (DXZE)
44585a45
STGEARTH.PAC (EART)
45415254
STGEDIT_0.PAC (EDIT)
45444954
STGEDIT_1.PAC (EDIT)
45444954
STGEDIT_2.PAC (EDIT)
45444954
STGEMBLEM.PAC (EMBL)
454d424c
STGEMBLEM_00.PAC (EMBL)
454d424c
STGEMBLEM_01.PAC (EMBL)
454d424c
STGEMBLEM_02.PAC (EMBL)
454d424c
STGFAMICOM.PAC (FAMI)
46414d49
STGFINAL.PAC (FINA)
46494e41
STGFZERO.PAC (FZER)
465a4552
STGGREENHILL.PAC (GREE)
47524545
STGGW.PAC (GW.P)
47572e50
STGGW_en.PAC (GW_e)
47575f65
STGHALBERD.PAC (HALB)
48414c42
STGHEAL.PAC (HEAL)
4845414c
STGHOMERUN.PAC (HOME)
484f4d45
STGHOMERUN_en.PAC (HOME)
484f4d45
STGICE.PAC (ICE.)
4943452e
STGJUNGLE.PAC (JUNG)
4a554e47
STGKART.PAC (KART)
4b415254
STGMADEIN_en.PAC (MADE)
4d414445
STGMANSION.PAC (MANS)
4d414e53
STGMARIOPAST_00.PAC (MARI)
4d415249
STGMARIOPAST_01.PAC (MARI)
4d415249
STGMETALGEAR_00.PAC (META)
4d455441
STGMETALGEAR_01.PAC (META)
4d455441
STGMETALGEAR_02.PAC (META)
4d455441
STGNEWPORK_en.PAC (NEWP)
4e455750
STGNORFAIR.PAC (NORF)
4e4f5246
STGOLDIN.PAC (OLDI)
4f4c4449
STGONLINETRAINING.PAC (ONLI)
4f4e4c49
STGORPHEON.PAC (ORPH)
4f525048
STGPALUTENA.PAC (PALU)
50414c55
STGPICTCHAT_en.PAC (PICT)
50494354
STGPIRATES.PAC (PIRA)
50495241
STGPLANKTON.PAC (PLAN)
504c414e
STGRESULT_en.PAC (RESU)
52455355
STGSTADIUM_en.PAC (STAD)
53544144
STGSTARFOX_ASTEROID.PAC (STAR)
53544152
STGSTARFOX_BATTLESHIP.PAC (STAR)
53544152
STGSTARFOX_CORNERIA.PAC (STAR)
53544152
STGSTARFOX_GDIFF.PAC (STAR)
53544152
STGSTARFOX_SPACE.PAC (STAR)
53544152
STGTARGETLV1.PAC (TARG)
54415247
STGTARGETLV2.PAC (TARG)
54415247
STGTARGETLv3.PAC (TARG)
54415247
STGTARGETLv4.PAC (TARG)
54415247
STGTARGETLv5.PAC (TARG)
54415247
STGTENGAN_1.PAC (TENG)
54454e47
STGTENGAN_2.PAC (TENG)
54454e47
STGTENGAN_3.PAC (TENG)
54454e47
STGVILLAGE_00_en.PAC (VILL)
56494c4c
STGVILLAGE_01_en.PAC (VILL)
56494c4c
STGVILLAGE_02_en.PAC (VILL)
56494c4c
STGVILLAGE_03_en.PAC (VILL)
56494c4c
STGVILLAGE_04_en.PAC (VILL)
56494c4c
Code:
GC = GameCube/GCN Controller
CC = Classic Controller
Wiimote = Wiimote/Wii Remote
0000 = No Buttons Held
0001 = Left (GC,CC,Wiimote D-Pad / GC,CC Analog)
0002 = Right (GC,CC,Wiimote D-Pad / GC,CC Analog)
0004 = Down (GC,CC,Wiimote D-Pad / GC,CC Analog)
0008 = Up (GC,CC,Wiimote D-Pad / GC,CC Analog)
0010 = (GC Z)(CC ZL)(CC ZR)
0020 = (GC R)(CC R)
0040 = (GC L)(Wiimote B)(CC L)
0100 = (GC,CC A)
0200 = (GC,CC B)(Wiimote 1)
0400 = (GC,CC X)
0800 = (GC,CC Y)
1000 = (GC Start)(Wiimote +)
4000 = (CC ZL)
8000 = (CC ZR)
I'm not sure about Nunchuk analog, Z, or C. The analogs are likely the same values as the GC/CC directions if they exist.
Here's a quick example of how button combinations are set up in case you missed it in the section above. On the GameCube/GCN/GC Controller, 0100 is A, and 0001 is left. Simply add them--
0 1 0 0
0 0 0 1
_______
0 1 0 1
0 0 0 1
_______
0 1 0 1
--and you get the value for Left+A, 0101. Now, a quick hexadecimal example. Let's say I want A+X+Y (GCN) as my button combination. 0100 is A, 0400 is X, and 0800 is Y.
0 1 0 0
0 4 0 0
0 8 0 0
_______
0 D 0 0
The values cannot add up to more than F.0 4 0 0
0 8 0 0
_______
0 D 0 0
I recommend most if not all button combinations should involve A or Start, as it's tricky (impossible?) to release the button you use to select a stage and press your desired button combination before the code goes into action. I don't recommend you use A or Start (or any single button, really) by themselves, as this may cause freezes/errors etc.