LEGO Star Wars II: The Original Trilogy DS

All information in this document is true for version USA 1.1 of the game (LEGOSW2_AL7E64_01.nds)

SHA1 checksum of ROM: 96aa30decea732eb03f7da01e489c6ce576536a5

Addresses

Object Info

Offsets in blue are only known to apply specifically to the player and might not apply to other objects.

Offset Size Description
0x0 u32 The base.
Known base values:
  • 0x020FBCE8 (the character floating in the character customization tank)
  • 0x020FBF48 (the player and party members)
0x8 u32 The "visibility address". Editing its value makes objects invisible and/or intangible.
Known visibility values:
  • 0x80100005 (e.g. Escape from Echo Base box puzzle forcefield, object IDControl_C3P0)
  • 0x801243A5 (the player and party members)
  • 0x80300001 (e.g. the current level)
  • 0x81100005 (e.g. object DSCrate, found in Death Star Escape)
  • 0x81100125 (e.g. object Plug, found in Escape from Bespin)
  • 0x829203A5 (e.g. object Human_Model)
0x40 u8 Airborne/Grounded state. 0 = airborne, 1 = grounded.
0x50 u32 Pointer to the floor triangle the player is currently standing on/interacting with.
0x60 s32 X speed.
0x64 s32 Y speed.
0x68 s32 Z speed.
0xB0 s32 X position.
0xB4 s32 Y position.
0xB8 s32 Z position.
0xBC Unknown Model X scale.
0xC0 Unknown Model Y scale.
0xC4 Unknown Model Z scale.
0xCA u16 Yaw.
0xD8 u32 Pointer to the object's model data. More specifically, it points to the BMD0 header.
0xDC u32 Pointer to the MDL0 header.
0xE0 u32 Pointer to texture data? Going to the address being pointed to and editing its value affects the texture.
0xE4 u32 Pointer to TEX0 header.
0xEC u32 If value mod 2 = 1, then player 1 will keep their body parts. If value mod 2 = 0, then player 1's face, torso, and pants will match player 2's. Seemingly does nothing in the character customizer.
0xF8 u32 Pointer to data that is 0x10 ahead of the model's name (i.e. 0x30 ahead of MDL0 header). Replacing this with a pointer to a piece of data that is 0x10 ahead of a different model's name will replace the model, do nothing, or CRASH the game.
0x104 u32 Pointer to data that is 0x1A0 ahead of the BCA0 header (i.e 0x18C ahead of JNT0 header)
0x148 u32 Same pointer as +0x104.
0x17C Unknown Freezing this to certain values changes the way animations look.
0x180 Unknown Animation thing.
0x1A8 u8 For the character in the Cantina customizer tank:
  • 0x0-0x7: Character is visible.
  • 0x8-0xF: Character is invisible.

(this pattern repeats all the way up to 0xFF)
0x1A9 u8 For the character in the Cantina customizer tank:
  • 0x0-0x3: Character wears no accessories.
  • 0x4-0x7: Character wears a moustache.
  • 0x8-0xB: Character wears sunglasses.
  • 0xC-0xF: Character wears a moustache and sunglasses.

(this pattern repeats all the way up to 0xFF)
0x2DC u32 Pointer to hitbox data?
0x684 s32 Only seems to apply to player 2 (P2), and probably player 3 (P3) and player 4 (P4) as well. Related to X position. Only updates when the player jumps or stops walking.
0x688 s32 Only seems to apply to P2, and probably P3 and P4 as well. Related to Y position. Only updates when the player jumps or stops walking.
0x68C s32 Only seems to apply to P2, and probably P3 and P4 as well. Related to Z position. Only updates when the player jumps or stops walking.
0x6F8 u32 Pointer to the object that player 1 (P1) is the closest to.
0x6FC u32 P1's distance from that object.
This pattern repeats for however many objects are currently in the level. For example, base + 0x700 is a pointer to the next closest object, base + 0x704 is P1's distance from that object, etc. The pointers and distance values are sorted from closest to farthest in memory. In other words, the first pointer that appears in this section of memory will indicate the object P1 is currently the closest to, and the last pointer will indicate the object P1 is currently the farthest from.

Other

Address Size Description
0x021019A8 u8 Current event? Determines which event is currently happening. Here are some values with notable effects:
  • 0x4: Your party to respawn in the current area.
  • 0x6: Plays the title screen sequence.
  • 0x9: Corrupts the top screen. Results in a CRASH. Under normal circumstances, this value changing to 0x9 means you're entering the character customizer.
  • 0xA: Corrupts the bottom screen. Results in a CRASH.
  • 0xB: Loads the character customizer's "Select character" menu.
  • 0xC: Loads the character customizer's "Save character" menu.
  • 0x11: Loads a glitched version of the title screen.
  • 0x13: Loads the "Save Game" menu.
  • 0x1C: Plays the opening sequence of The Trench Run.
  • 0x1F: Replaces the top screen with the scrolling star background found on the bottom screen.
  • 0x20: Loads the multiplayer "Arena Mode Select" menu.
  • 0x21: Loads the multiplayer "Hosting Wireless Game" menu.
  • 0x22: Loads the multiplayer "Browsing Wireless Game" menu.
  • 0x23: Loads a multiplayer menu with text saying is trying to connect. Do you want to let them join your game? Results in a CRASH.
  • 0x24: Loads the multiplayer "Hosting Single-Card Game" menu.
  • 0x26: Loads a menu with text saying Press A to Continue.
  • 0x27: Loads the multiplayer "Waiting for Host" menu. Results in a CRASH.
  • 0x28: Slightly corrupts the bottom screen. Results in a CRASH.
  • 0x29: Loads a "Select Character" menu. Results in a CRASH.
  • 0x2A: Changes the bottom screen to the screen shown during a multiplayer game.
  • 0x2B: Loads the multiplayer "Scores" menu.
  • 0x2C: The bottom screen "Party Members" text and player icons disappear. Results in a CRASH.
  • 0x2E: The top screen goes black and the bottom screen changes to the camera scroll menu.
  • 0x31: Loads the Cantina shop.
  • 0x33: Loads a glitched version of the level results screen. The bottom screen is corrupted while two 4-LOM character icons (one on each screen) continuously move left. Results in a SOFTLOCK.
  • 0x34: The icons for the camera scroll, party members, and character customization menus disappear. Results in a CRASH.
  • 0x35: Loads a glitched version of the pause menu.
  • 0x36: Loads a "Game Settings" menu where the top screen is corrupted. Results in a CRASH.
  • 0x37: Both screens go black. Seemingly results in a SOFTLOCK.
  • 0x38: The top screen goes black and the scrolling star background on the bottom screen gets slightly corrupted.
  • 0x39: The top screen gets replaced with the static star background. The character icons on the bottom screen disappear.
0x021019AC u8? Unknown. Default value is 0x4, but freezing to 0xE and entering a loading zone causes you to spawn in the next intended area, but at whatever XYZ position you had when touching the loading zone, which makes it easy to spawn out of bounds.
Freezing to 0xF and entering a loading zone causes you and your party member(s) to spawn in the next intended area, but with an unintended yaw value.
Freezing to 0x10 and entering a loading zone causes all four party members to spawn in as 4-LOM, but you can't move and the camera is frozen in place.
0x021019B0 u8 Next map number. Determines which map you will spawn in the next time you enter a loading zone.
0x021019B4 u8 Next exit number. Determines which exit you will spawn at the next time you enter a loading zone.
0x021019C4 u8 Unknown. Freezing its value to 0 and entering a loading zone makes the top screen fade to black instead of temporarily freezing, then wiping.
0x021019C8 u8 Current bottom screen menu. Determines which menu/screen the bottom screen is displaying.
0x021019E4 u8 Unknown. Freezing its value to 0 and entering a loading zone makes the bottom screen fade to black instead of temporarily freezing, then wiping. You also seem to maintain some control over your character during the transition.
0x021019F0 u16 Unknown. Its default value seems to be 0x303, but changes when going through a loading zone. Freezing it to 0x303 and going through a loading zone keeps both screens frozen.
0x021083BC s32 Pointer to player 1's base.
0x021083C0 s32 Pointer to player 2's base.
0x021083C4 s32 Pointer to player 3's base.
0x021083C8 s32 Pointer to player 4's base.
0x021083D0 s32? Changing this value causes characters and objects to get shaded in different colors. Default value 0x7ED477BD?
0x021083D4 Unknown Similar to previous
0x02108C94 u8 (bool) Determines whether the main level object is visible or not. 1 (default) = visible, 0 = invisible.
0x02108C9E u8 Determines what character P1 is.
0x02108C9F u8 Determines what character P2 is.
0x02108CA0 u8 Determines what character P3 is.
0x02108CA1 u8 Determines what character P4 is.
0x02108CD0 u32? 0x0 by default. Freezing to 0xFFFFFFFF makes both P1 and P2 completely black. Changing to 0xFF makes both P1 and P2 rapidly flash different colors.
0x02108D14 s32 Camera X position.
0x02108D18 s32 Camera Y position.
0x02108D1C s32 Camera Z position.
0x02108D2C Unknown Camera pitch.
0x02108D2E Unknown Camera yaw.
0x02108EBC u32 Pointer to the thing the camera is focusing on? Its value is the P1 base, and substituting the value for P2's base does change what the camera looks at in a way, but it doesn't look at P2 the same way it does for P1.
0x02108EF0 u32 Pointer to a pointer to the player's X position. Changing the pointer to the player's X position to the player's Y or Z position has weird effects.
0x02108EF4 u8 Camera mode.
0x02108FF8 u8 Camera effect.

How To Search For Objects

  1. In RAM Search, search for a specific hexadecimal value equal to 30444D42. This will search for the BMD0 file header in the game's memory.
  2. Pick an address from the list of results and go to that address in the memory viewer.
  3. Models in memory will start with a BMD0 header, then have a MDL0 header not far after it, then there will be the name of the model not far after the MDL0 header.
  4. Go to the address that is 0x10 ahead of the beginning of the model name. Then, in RAM Search, search for a specific hexadecimal value equal to that address.
  5. After clicking the search button, subtract 0xF8 from the hex value in step 4 to find the object's base.

Camera Modes

Mode # Description
0x0 Camera freezes in place.
0x1 Default behavior? Behaves like it does in the Cantina starting room.
0x2 Free mode. Camera freezes in place, but pressing Up/Down tilts it up/down, pressing Left/Right tilts it left/right, and pressing L/R moves it forward/backward
0x3 360 mode. Pressing L/R rotates it left and right in a circle around your character.
0x4 Camera moves relative to P1 but is stuck at one angle.
0x5 This one is weird. Pressing different directions makes it rotate differently, except for Up-Right, which makes it behave similarly to Mode 0x4.
0x6 X and Z are frozen at coordinates nearing (0,0). Y is frozen at Y = 61440. Camera yaw changes as it follows P1's horizontal movement, but pitch is frozen.
0x7 Appears to be the same as 0x3, just 360 mode again.
0x8 Appears to be the same as 0x4.
0x9 Sandbox cam. Camera is positioned directly behind P1. D-pad Left/Right rotates it left/right and you can press Down to walk backwards.
0xA Similar to Mode 0x5. Holding any direction on the D-pad causes P1 to walk in circles and the camera to quickly spin in circles.
0xB Camera freezes in place.
0xC Camera gradually moves to the origin (0,0,0), where it remains frozen in place. Pitch and yaw are frozen.
0xD-0xFF Camera freezes in place.

Camera Effects

Effect # Description
0x0 Camera moves to the origin (0,0,0), where it remains frozen in place.
0x1 Camera roll slowly sways back and forth. In other words, the camera roll gradually alternates between -700 and 700 (s16).
0x2 Camera rapidly shakes. Used in Escape from Echo Base.
0x3 No effect.
0x4-0xFF Camera moves to the origin (0,0,0), where it remains frozen in place.