OpenSWE1R / swe1r-re

Reverse Engineering and documenting "Star Wars Episode 1: Racer"
https://openswe1r.github.io/
12 stars 3 forks source link

N64 cheat characters #18

Open JayFoxRox opened 6 years ago

JayFoxRox commented 6 years ago

These are re-enabled by _sub_44B530_enable_jinn_reeso and _sub_44B5E0_enable_cy_yunga in the patched US version. Should be documented in detail.

Also see hotkey.c which calls these functions

JayFoxRox commented 6 years ago

Related, interesting stuff:

set *(uint32_t*)Memory(0x50C048) |= 0x2000000 seems to enable the N64 dual controller control scheme set *(uint32_t*)Memory(0xE996DC) = 16 draws using checkerboard textures (broken in OpenSWE1R? untextured maybe?)

set *(int*)Memory(0xE996DC) = 8192*2 Mirrored mode.

JayFoxRox commented 6 years ago

Looked into all values for Cy Yunga:

.text:0044B5E0 _sub_44B5E0_enable_cy_yunga proc near   ; CODE XREF: sub_4104F0+88↑p

// Switch podracer model
.text:0044B5E0                 mov     podracerData.pod_model+478h, 301
.text:0044B5EA                 mov     podracerData.pod_model_lod1+478h, 300
.text:0044B5F4                 mov     podracerData.pod_model_lod2+478h, 303

// Switch name
.text:0044B5FE                 mov     podracerData.first_name+478h, offset aCy ; "Cy"
.text:0044B608                 mov     podracerData.last_name+478h, offset aYunga ; "Yunga"

// Switch character model
.text:0044B612                 mov     podracerData.character_model+478h, 305

// magbeam left/right position (further apart = larger)
.text:0044B61C                 mov     dword_4C7A0C, 1.04

// magbeam forward/backwards position
.text:0044B626                 mov     dword_4C7A10, 2.0799999

// magbeam vertical position
.text:0044B630                 mov     dword_4C7A14, -1.08

// Change left/right where wires connect to engine
.text:0044B63A                 mov     dword_4C7A00, -0.079999998

// Change forward/backwards position where wires connect to engines
.text:0044B644                 mov     dword_4C7A04, -1.66

// Change vertical position where the wires connect to engines
.text:0044B64E                 mov     dword_4C7A08, 2.1500001

.text:0044B658                 retn
.text:0044B658 _sub_44B5E0_enable_cy_yunga endp
JayFoxRox commented 6 years ago

And here's Jinn Reeso:

.text:0044B530 _sub_44B530_enable_jinn_reeso proc near ; CODE XREF: sub_4104F0+ED↑p

// Switch podracer model
.text:0044B530                 mov     podracerData.pod_model+1A0h, 299
.text:0044B53A                 mov     podracerData.pod_model_lod1+1A0h, 298
.text:0044B544                 mov     podracerData.pod_model_lod2+1A0h, 302

// Switch name
.text:0044B54E                 mov     podracerData.first_name+1A0h, offset aJinn ; "Jinn"
.text:0044B558                 mov     podracerData.last_name+1A0h, offset aReeso ; "Reeso"

// Switch character model
.text:0044B562                 mov     podracerData.character_model+1A0h, 304

// Engine left / right position
.text:0044B56C                 mov     dword_4C73F4, 4.4299998
// dword_4C73F8 is forward position

// magbeam position
.text:0044B576                 mov     dword_4C7424, 2.22
.text:0044B580                 mov     dword_4C7428, 2.78
.text:0044B58A                 mov     dword_4C742C, 0.0

// wire on pod position
.text:0044B594                 mov     dword_4C740C, 1.26
.text:0044B59E                 mov     dword_4C7410, 0.23999999
.text:0044B5A8                 mov     dword_4C7414, -0.46000001

// wire on engine position
.text:0044B5B2                 mov     dword_4C7418, 0.25999999
.text:0044B5BC                 mov     dword_4C741C, -3.6400001
.text:0044B5C6                 mov     dword_4C7420, -0.31

.text:0044B5D0                 retn
.text:0044B5D0 _sub_44B530_enable_jinn_reeso endp