19-03-2016, 07:03 AM
|
Posts: 177
Threads: 14
Joined: Feb 2015
|
SM64 Cutscene Engine Notes
In case it is of use to anyone, below are the notes on the cutscene engine used in Super Mario 64. Through trial and error, I've managed to figure out what most of the cut scene IDs are, but some of them remain a mystery. I could use help decoding the ones marked "TODO" in the table below.
cut scene state stored in 8033CA5A
cut scene counter stored in 8033CA5C
handling function: 802994E8
Each cut scene has a table with each entry containing two words: a function pointer and the number of frames to run before advancing to the next entry.
Table of function pointers for each cut scene
Idx| Table Address | Count | Description
---+----------------+-------+--------------------------------------------------
00 | 8032F574/EA574 | 5 | door from room to main (basement, BBH)
01 | 8032F59C/EA59C | 5 | door with closeup after opening
02 | unused | |
03 | 8032F5F4/EA5F4 | 3 | enter cannon
04 | 8032F634/EA634 | 1 | jump into painting
05 | 8032F63C/EA63C | 2 | exit painting after death
06 | unused | |
07 | unused | |
08 | unused | |
09 | 8032F554/EA554 | 2 | door open to warp to another level
0A | 8032F5C4/EA5C4 | 3 | door inside door to main
0B | 8032F5DC/EA5DC | 3 | door BBH inside to lobby
0C | 8032F674/EA674 | 5 | intro peach, lakitu, mario from pipe
0D | 8032F74C/EA74C | 1 | star grab dance 1 (same as 2D)
0E | 8032F734/EA734 | 3 | enter Bowser platform
0F | 8032F544/EA544 | 2 | TODO: unknown
10 | unused | |
11 | 8032F65C/EA65C | 3 | TODO: unknown
12 | unused | |
13 | 8032F774/EA774 | 2 | sliding star door open
14 | 8032F69C/EA69C | 2 | prepare cannon
15 | 8032F784/EA784 | 2 | unlock key door
16 | 8032F6F4/EA6F4 | 1 | death scene 1 (BitS platform, fire)
17 | 8032F70C/EA70C | 1 | death scene 2
18 | 8032F714/EA714 | 1 | BBH,HMC death
19 | 8032F71C/EA71C | 2 | quicksand death animation
1A | 8032F72C/EA72C | 1 | TODO: unknown
1B | 8032F794/EA794 | 2 | exit Bowser stage after getting key
1C | 8032F7A4/EA7A4 | 2 | TODO: unknown
1D | unused | |
1E | 8032F64C/EA64C | 2 | exit painting after getting star
1F | 8032F76C/EA76C | 1 | cap switch button press
20 | 8032F7D4/EA7D4 | 3 | dialog with character (same as 21)
21 | 8032F7D4/EA7D4 | 3 | dialog with Koopa the Quick, penguin before race (same as 20)
22 | 8032F6CC/EA6CC | 2 | enter top of pyramid
23 | 8032F754/EA754 | 1 | star grab dance 2
24 | 8032F75C/EA75C | 1 | star grab dance 3
25 | 8032F764/EA764 | 1 | key grab dance
26 | 8032F6DC/EA6DC | 3 | TODO: unknown
27 | 8032F7B4/EA7B4 | 2 | BBH/invis cap exit (success)
28 | 8032F7C4/EA7C4 | 2 | non-painting (BiDW,HMC,BBH,RR) death exit
29 | 8032F7EC/EA7EC | 3 | read sign post/sign on wall message
2A | 8032F4D4/EA4D4 | 12 | end celebration on bridge with peach (before credits)
2B | 8032F60C/EA60C | 3 | star spawn, yoshi after getting lives
2C | 8032F534/EA534 | 2 | grand star grab, triple jump, fly
2D | 8032F74C/EA74C | 1 | special star grab dance (same as 0D)
2E | 8032F624/EA624 | 2 | special star spawn (red coin/secrets)
2F | 8032F564/EA564 | 1 | end scene everyone waving (after credits)
30 | 8032F56C/EA56C | 1 | end credits
31 | 8032F6AC/EA6AC | 2 | exit waterfall from metal cap
32 | 8032F6BC/EA6BC | 2 | fall to castle grounds from rainbow bonus
33 | 8032F6FC/EA6FC | 2 | enter pool (HMC, metal cap)
For each case, something like the following pseudo-code runs:
Code:
t1 = *0x8033ca5a
frames = table[t1].frames
func = table[t1].func
func(a0)
if (frames != 0 && (cutscene_frame & 0x8000) == 0) {
if (cutscene_frame < 0x3fff) {
cutscene_frame++;
}
if (cutscene_frame == frames) {
cutscene_step++;
cutscene_frame = 0;
}
} else {
0x8032df60->u16_1e = 0;
cutscene_step = 0;
cutscene_frame = 0;
}
*(u16*)0x8033c75c = 0;
// sp_1f is old value of a0[0x30]
if (a0[0x30] == 0 && sp_1f != 0) {
*(u8*)0x8032df54 = sp_1f;
}
|