the cutting room mirror

LEGO Star Wars: The Video Game (PlayStation 2, Xbox, GameCube, Windows)

This article has a talk page!
view on tcrf.net

This page contains notes for the game LEGO Star Wars: The Video Game (PlayStation 2, Xbox, GameCube, Windows).

Disassembly Notes

Notes from my reverse engineering efforts looking into the disassembled PS2 version of LEGO Star Wars. Will be organized better as more progress is made. All information is from the US release unless otherwise specified.

Text Section#

  • 0x00106988 returns the length of a string, a0.
  • 0x00106898 concatenates two strings together. The string at address a1 will be appended to the string at address a0.
  • 0x001068f0 copies a string to another location in memory and returns the number of bytes copied over in v0. a0 is the destination address and a1 is the source address.
  • 0x0010a3d8 is a 3D vector subtraction function. a0 is the address of the destination, a1 and a2 are the addresses of the operands. The vector components are floats, and the subtraction order is MEM[a1] - MEM[a2] = MEM[a0].
  • 0x0010a3d8 calculates the length of a 3D vector at address a0 and returns the result as a float in register f0.
  • 0x0017a98 loads the following PlayStation 2 BIOS modules: SNProfil, sio2man, padman, mcman, mcserv, libsd, sdrdrv. Explanations of these BIOS modules can be found here.
  • 0x001dbed8 takes an array of music and cutscene audio information and stores the number of files/elements and stores it in memory address 0x00345578.

Data Section#

  • 0x00342fe8 is a boolean flag that indicates if reverb has been initialized or not.
  • 0x00343010 is a boolean flag that indicates if surround sound is enabled or not.
  • 0x00343014 is a boolean flag that indicates if sound services are enabled or not.
  • 0x00345464 is Dpad Mode (whatever that means...). 0 = Emit Rotate; 1 = Grav Rotate; 2 = Offset (offset value is as a float); 3 = Reflections.
  • 0x00347ce8 is a boolean flag that toggles the FPS display.
  • 0x0035e190 is the start of what looks to be character and vehicle information. The first two words are pointers to strings, and the third word is a pointer to that character/vehicles struct which appears to have information on their animations and/or properties and abilities. Most characters have approximately 96 bytes (24 words) of data, but some entities have more, such as Grievous, or less, such as Dexter.
  • 0x00361890 is a boolean flag that toggles the debug menu.
  • 0x00549f1c stores the overall stud total.
  • 0x0055bb80 stores the stud total for the current level.

Struct Notes#

Bridge#

Bridge structs have a size of 44 bytes. (Note that these quantities are in hexadecimal.) The fields are as follows, and any missing byte offsets in the table mean that information has not been determined yet. Any fields marked with TBD means that the offset itself has been identified, but the purpose and/or type of data is unknown.

Offset

Type/size

Description

c

float

TBD

10

float

TBD

18

half word

TBD

1a

half word

TBD

1c

byte

TBD

1d

byte

Plank count

1e

byte

Post interval

20

TBD

Plank instance

24

TBD

Post instance

28

float

Tension

2c

float

Damp

30

float

Gravity

34

float

Plrweight (meaning unknown)

38

float

Rope height

3c

float

Stability

40

byte

Likely related to rope color, perhaps value for a color or transparency channel, but exact purpose is TBD.

41

byte

Same as above.

42

byte

Same as above.

43

byte

Same as above.

Particle#

Particle structs have a size of 70.

Offset

Type/size

Description

0

float

X position

4

float

Y position

8

float

Z position

c

TBD

Related to particle type. Exact purpose (such as if it is a pointer or simply an integer) is TBD.

10

byte

Current list. (meaning unknown)

20

float

TBD

24

float

TBD

28

float

TBD

2c

half word

EmitRotZ

2e

half word

EmitRotY

30

half word

TBD

32

byte

TBD

33

byte

TBD

34

word

TBD

3c

byte

TBD

40

float

TBD

48

half word

RotZ

4a

half word

RotY

4c

float

TBD

60

float

TBD

(Source: Lizzyd710)

Unusual Logger Text

Figure out if any of these are worth documenting or just something I find fun.

  • 0x003b29f8: B-Spline runtime evaluation not implented yet - ask ChrisP nicely :)
  • 0x003b34b0: NuSpecialGetOriginRadius: New system does not work with this yet, see Alistair.
  • 0x003b3710: TexAnimBuffer overflow while reading %s - you're gonna need a bigger buffer!
  • 0x003b3ca8 & 0x4e40: Off end of map guvnor
  • 0x003b4828: Could not find tid - lawks a lordy!
  • 0x4850: Could not find material - lawks a lordy!
  • 0x54f8: Doh
  • 0x5908: dont call this
  • 0x77b8: StateAnimEvaluate problem, see Glyn
  • 0x78e0: + I've just nicked 256K off you 'cos you're using .raw files
    + You can avoid this by;
    + 1. Convert your .raws to .pnt files
    + 2. Call SetBalls and tell it where it can temporarily get the memory from
    + Remember - that's 256K you wont be seing again unless you heed this warning!
  • a7c0: ERROR: SOUND_SetMemHooks() - Things are probably going to go bang - !\n
  • f7c0: Ralph Controls
  • f7d0: Steve Controls
  • 0x003c0428: Not enough memory to create SOCK system. Eejit.
  • 0x003c11f0: Should never reach here
  • 0x003d4040: Not enough memory to create Turret system. Eejit.