Scenes: Difference between revisions
From LMHack
More actions
Add Scene ID docs |
More documentation |
||
| Line 3: | Line 3: | ||
== Definitions == | == Definitions == | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ Scene Structure | |+ Scene Structure | ||
| Line 16: | Line 17: | ||
|- | |- | ||
| _10 | | _10 | ||
| <code>s16 (signed | | <code>s16 (signed short)</code> | ||
| <code>0x10</code> | | <code>0x10</code> | ||
| Currently unknown, but could be some sort of id. | | Currently unknown, but could be some sort of id. | ||
| Line 42: | Line 43: | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ Scene | |+ SceneID Enum | ||
|- | |||
! ID !! Enum Name !! Description | |||
|- | |||
| <code>0</code> || SCENE_BOOT !! Scene when booting up the game. | |||
|- | |||
| <code>1</code> || SCENE_TITLE !! Title screen Scene. | |||
|- | |||
| <code>2</code> || SCENE_MAIN_GAME !! Scene for the main game. | |||
|- | |- | ||
! | | <code>3</code> || SCENE_SELECT !! File select scene. | ||
|- | |- | ||
| <code> | | <code>4</code> || SCENE_OPENING !! The scene for the opening that plays when idling on the title screen. | ||
|- | |- | ||
| <code> | | <code>5</code> || SCENE_STUFF_ROLL (Staff Roll) !! Staff roll scene | ||
|- | |- | ||
| <code> | | <code>6</code> || SCENE_ENDING !! Ending scene. | ||
|- | |- | ||
| <code> | | <code>7</code> || SCENE_MOVIE !! Scene used for the Pikmin movie. | ||
|} | |||
{| class="wikitable" | |||
|+ External variables | |||
|- | |- | ||
! Name !! Type !! Address (USA) !! Description | |||
|- | |- | ||
| | | sCurScene || Scene* || 0x804CFF98 || A pointer to the current scene loaded into memory. | ||
|- | |- | ||
| | | sCurSceneId || SceneID || 0x804D80A0 || The current scene's id, mainly used for indexing sSceneTable. | ||
|- | |- | ||
| | | sSceneTable || Scene*[8] || 0x8021DB20 || A table consisting of all of the scenes, with the indexes corresponding to SceneID. | ||
|} | |} | ||
== References == | == References == | ||
[https://github.com/ThePlayerRolo/lm-decomp | [https://github.com/ThePlayerRolo/lm-decomp Luigi's Mansion Decompilation] | ||
Revision as of 19:54, 15 July 2026
Description
This page has documentation on the "Scene" system seen in Luigi's Mansion, which handles the most basic game states (Title Screen, Boot, Main Game, etc).
Definitions
| Member Name | Member Type | Member Offset | Member Description |
|---|---|---|---|
| mName | char[16]
|
0x00
|
The name of the scene. |
| _10 | s16 (signed short)
|
0x10
|
Currently unknown, but could be some sort of id. |
| mInitFn | void (*SceneInitFunc)()
|
0x14
|
A pointer to the scene's function used for initializing the scene. |
| mUpdateFn | u32 (*SceneUpdateFunc)()
|
0x18
|
A pointer to the scene's function used for updating the scene every frame. |
| mDrawFn | void (*SceneDrawFunc)()
|
0x1C
|
A pointer to the scene's function used for drawing the scene every frame. |
| mDestroyFn | void (*SceneDestroyFunc)()
|
0x20
|
A pointer to the scene's function used for destroying the scene and it's resources. |
| ID | Enum Name | Description |
|---|---|---|
0 |
SCENE_BOOT !! Scene when booting up the game. | |
1 |
SCENE_TITLE !! Title screen Scene. | |
2 |
SCENE_MAIN_GAME !! Scene for the main game. | |
3 |
SCENE_SELECT !! File select scene. | |
4 |
SCENE_OPENING !! The scene for the opening that plays when idling on the title screen. | |
5 |
SCENE_STUFF_ROLL (Staff Roll) !! Staff roll scene | |
6 |
SCENE_ENDING !! Ending scene. | |
7 |
SCENE_MOVIE !! Scene used for the Pikmin movie. |
| Name | Type | Address (USA) | Description |
|---|---|---|---|
| sCurScene | Scene* | 0x804CFF98 | A pointer to the current scene loaded into memory. |
| sCurSceneId | SceneID | 0x804D80A0 | The current scene's id, mainly used for indexing sSceneTable. |
| sSceneTable | Scene*[8] | 0x8021DB20 | A table consisting of all of the scenes, with the indexes corresponding to SceneID. |