Decided to collect the camera-related data in this thread and post some stuff I have, since this is currently a
pressing problem with custom levels. Of particular practical interest is Dudaw finding on those general camera
settings used on a per-level basis.
0x8033CBD0: Current camera pointer. There are multiple cameras for a level, this is the one which will be
processed.
0x8033C5A4: Camera distance pointer (32-bit float)
0x80290D90: Function to control camera using second player controller in the ending. (A0 is a pointer to the camera)
In Mario's struct, there is camera-related struct, however its mostly just copy of Mario's parameters that are used by other camera functions. Changing the "camera setting" will trigger a few camera actions.
typedef struct camera_data /* Mario->Camera (0x8033C520) */
{
u32 mario_action; /* copied from mario->action */
float x; /* also copied from Mario struct */
float y;
float z;
s16 _0x10_mario_0x2c; /* 0x10 */
u16 rotation; /* again copied from Mario struct */
s16 _0x14_mario_0x30;
s16 _0x16_mario_0x32;
u32 _0x18;
u16 _0x1c;
u16 camera_setting; /* 0x06 = door opening 0x09 = triggers initial peach animation */
/* incomplete, many other members left ?? */
} Camera;
If I'm not mistaken, after that data there's also some structs containing values such as camera x/y/z rotation and speed.
Originally posted by VL-Tone
First discovery using the checksum less ROM:
With good old ROM corruption, I was able to find a table that seems to contain camera animation pointers.
The table is found at 0xEA4D4 and ends at 0xEA804. Each item in the table is 8 bytes long, the first 4 bytes are a RAM address (0x80xxxx) and the last 4 bytes are some parameters.
The item I first stumbled upon is at 0xEA554, it's the camera settings for when Mario opens (or close) the double doors of the castle lobby (it applies to both inside and outside the castle). By swapping around this item with others found in the table I was able to identify most of them, though some may just not have worked as expected while being used on the door transition.
The most interesting ones are labeled with **, these camera modes follow Mario in unusual ways, and these modes will usually remain active until you enter a painting. The rest are mostly static cameras or non-interactive camera animations. The most interesting camera animations are labeled with %%. The unlabeled items didn't do anything particular, except maybe a few that provided a normal Lakitu camera in the Castle lobby instead of the "stuck in the corner" camera normally found in that room.
80 29 0F 8C 00 46 00 00 -- temporary top down view
80 29 0E 00 00 4B 00 00 -- Pointing somewhere else for a couple of seconds
80 29 0F 1C 01 82 00 00 -- Shows two other places with iris effect
80 29 11 08 00 8B 00 00 -- Crashes while pointing somewhere else
80 29 13 54 02 4E 00 00 -- Crashes while looking up to the sky
80 29 14 2C 00 5F 00 00 -- Shows somewhere else with iris effect
80 29 15 14 01 A9 00 00 -- Pointing somewhere else for a couple of seconds
80 29 15 D4 00 EC 00 00 -- Shows somewhere else with iris effect
80 29 17 74 00 F5 00 00 -- Pointing somewhere else for a couple of seconds
80 29 18 70 7F FF 00 00 -- Stuck 3/4 top down camera
80 29 19 24 00 00 00 00 -- Normal Lakitu cam?
80 29 1C D0 01 68 00 00 -- Zoom out and in on Mario animation
80 29 21 64 7F FF 00 00 -- ** Weird cam follows Mario from very high
80 29 0C 1C 00 01 00 00 -- Normal Lakitu cam?
80 29 0C 30 7F FF 00 00 -- Stuck and static
80 29 91 00 00 01 00 00 -- =======Double door opening======= (Hacked to make this list)
80 29 91 A8 7F FF 00 00 -- Normal Lakitu cam?
80 29 7B 84 7F FF 00 00 -- %% End camera zoom out castle animation with Lakitu flying around. (When everyone says goodbye at the end).
80 29 7C 40 7F FF 00 00 -- Static cam from way down, Mario controls not relative to cam
80 29 91 00 00 01 00 00 -- Double door opening
80 29 91 54 00 1E 00 00 --
80 29 91 F0 00 01 00 00 --
80 29 92 CC 00 32 00 00 --
80 29 93 60 00 00 00 00 --
80 29 91 00 00 01 00 00 --
80 29 91 54 00 14 00 00 -- Points somewhere else shortly
80 29 91 F0 00 01 00 00 -- Castle view when Mario first enters castle ( Bowser message 1?)
80 29 92 CC 00 32 00 00 -- Short zoom on Mario
80 29 93 60 00 00 00 00 --
80 29 91 00 00 01 00 00 -- Double door opening
80 29 91 54 00 1E 00 00 -- Points somewhere else shortly
80 29 94 04 7F FF 00 00 --
80 29 91 00 00 01 00 00 --
80 29 91 54 00 14 00 00 -- Points somewhere else shortly
80 29 94 04 7F FF 00 00 --
80 29 8F E8 00 01 00 00 --
80 29 8D 9C 00 79 00 00 -- Short zoom out animation
80 29 8D 44 00 00 00 00 -- ** Cannon POV cam! Walk slowly (backward) or crouching to move around, and don't jump!
80 29 3C 2C 7F FF 00 00 -- Stuck and static
80 29 3C B0 00 0F 00 00 -- Weird quick glitchy camera movement for a second
80 29 3D 5C 00 00 00 00 --
80 29 42 F0 7F FF 00 00 -- Crash
80 29 43 D4 00 00 00 00 -- Quick Zoom out
80 29 84 B4 7F FF 00 00 -- Zoom on Mario, then stuck and static
80 29 8A F8 00 76 00 00 -- Temporary view from down under
80 29 8C CC 00 00 00 00 --
80 29 8A F8 00 B4 00 00 -- Temporary view from down under
80 29 8C CC 00 00 00 00 --
80 29 8B A0 00 01 00 00 -- Close view from opening door
80 29 8C 2C 00 3C 00 00 --
80 29 8C CC 00 00 00 00 --
80 29 7A 64 7F FF 00 00 -- %% Peach letter!
80 29 7A 38 00 23 00 00 --
80 29 78 4C 03 34 00 00 -- %% Lakitu tour of the castle opening!!
80 29 79 08 01 0E 00 00 -- %% Ciao! Welcome message
80 29 76 2C 7F FF 00 00 --
80 29 4A 14 00 AA 00 00
80 29 4A 94 00 00 00 00 -- from under?
80 29 3E 7C 00 34 00 00 -- from far away for a second
80 29 3E D8 00 00 00 00 --
80 29 3F 70 00 49 00 00 -- from farther away
80 29 3E D8 00 00 00 00
80 29 59 30 00 5A 00 00 -- travels to top view for a second
80 29 3E D8 00 00 00 00 --
80 29 04 40 7F FF 00 00 -- Stuck on side view mario
80 29 57 C8 00 96 00 00 -- Weird fly over animation
80 29 58 94 00 00 00 00
80 29 4C 5C 7F FF 00 00 -- stuck wobbly lakitu cam POV
80 29 54 18 00 64 00 00 --
80 29 3E D8 00 00 00 00 --
80 29 4D B4 7F FF 00 00 -- stuck wobbly lakitu cam POV 2
80 29 4E E8 7F FF 00 00 -- stuck wobbly lakitu cam POV 3
80 29 4F EC 7F FF 00 00 -- **Drunk Lakitu cam follows mario from 3/4 top, controls not relative to cam
80 29 4F EC 7F FF 00 00 -- **same
80 29 52 70 7F FF 00 00 -- **Drunk Lakitu cam loosely follows mario from 3/4 top, controls not relative to cam
80 29 39 44 00 B4 00 00 -- static for a few seconds
80 29 38 6C 7F FF 00 00 -- Bowser message 2
80 29 38 C8 00 00 00 00 --
80 29 24 B8 7F FF 00 00 -- ** Camera circles around Mario
80 29 30 18 7F FF 00 00 -- Stuck drunk Lakitu cam cam from far away
80 29 2A 80 7F FF 00 00 -- **Fish-Eye Mario cam!
80 29 33 8C 7F FF 00 00 -- **Weird backward Mario cam, he always faces the camera, every joystick move will make him go forward in an absolute direction that is relative to the level.
80 29 6F A8 7F FF 00 00 -- Stepping on the wing cap switch message
80 29 83 B4 00 32 00 00 --
80 29 84 58 00 00 00 00 --
80 29 73 B0 00 C8 00 00 -- Goes behind mario for a second, then switches back to normal cam
80 29 84 58 00 00 00 00 --
80 29 67 10 00 BE 00 00 -- From far under when exiting the Castle
80 29 67 C4 00 00 00 00 --
80 29 69 F8 00 78 00 00 -- From far under when exiting the Castle 2
80 29 67 C4 00 00 00 00 --
80 29 68 A0 00 A3 00 00 -- From far under when exiting the Castle 3
80 29 67 C4 00 00 00 00 --
80 29 6B 30 00 78 00 00 -- From far under when exiting the Castle 3
80 29 67 C4 00 00 00 00 --
80 29 5E 8C 7F FF 00 00 -- crash from double door
80 29 5F B0 00 0C 00 00 --
80 29 5F D8 00 00 00 00 --
80 29 61 60 7F FF 00 00 -- stuck and static cam
80 29 62 C8 00 0F 00 00 --
80 29 62 F0 00 00 00 00 --
Originally posted by Dudaw
Hey, here's some good news.
I've found the solution to our camera problems!
@ 0x41C80 [0x80286C80] are some JAL instructions that load the hardcoded "paths" for each of the levels.
The search went exceptionally well; I was expecting something very similar to what I ended up finding.
When I was searching for the RAM offset to where the current camera option is stored, I was somehow led into finding the pointers to the paths.
I haven't checked yet, but I'm sure if we followed our way back from these instructions, we would probably find that camera paths are nothing more than a bunch of elaborate camera positions and rotations.
In case if you didn't notice, the Castle Grounds actually uses a different type of camera setting than every other level. Even when you import a new model into CG, you'll notice that it doesn't seem to follow a path, but instead smoothly rotates around any walls and slopes.
What I did was I took the instruction from 0x41D00 [0x80286D00] and replaced every other one with it.
Only problem I noticed is that the camera position is a little uncomfortable in levels other than CG.
It appears positions and a few other effects must be set somewhere else.
Not only that, but other camera settings such as when Mario comes out of water or goes through a door are in this function, too. Those ones are at 0x41D60.
Also, 0x41C00 [0x80286D00] seems to be for the different camera options that are set with the C and R buttons.
|