Banner
Views: 934,391,862
Time:
16 users online: beegemmo, chickaDEE Magazine, Diego, Golden Yoshi, Infinity, katun24, Lucca8182838,  MarioFanGamer, nicknicknick2020, OEO6, Phyll, Professor Parabeetle,  RussianMan, semiblind, StayAtHomeStegosaurus, Zeldara109 - Guests: 88 - Bots: 128 Users: 52,123 (2,118 active)
Latest: Tommy89
Tip: The music in SMW's default castle/ghost house intros and boss battles can be changed by hex editing. See $0584DB and $0584E2 in the ROM map.
Not logged in.
Cutscene engine
Forum Index - Non-SMW Hacking - Super Mario 64 Hacking - ASM & Data Repository - Cutscene engine
Pages: « 1 » Link
I thought this might deverse it's own thread. i wanted to make the source of it public, so that everyone can use it.




Format:
00 define object:
[1] command
[2] model ID
[3] Object ID
[4] params: (0x0180)
80: hold on ground?
40: rotate towards moving direction?
[5-8] animation index pointer
__________________________________________________________
01 next frame
[1] command
[2-4] amount of frames
_________________________________________________________
02 set obj speed params
[1] command
[2] OBJ ID
[3] speed (signed byte)
[4] Y movement rotation (leftshift by 100)
_________________________________________________________
03 set obj rotation params
[1] command
[2] OBJ ID
[3] Y rotation (leftshift by 100)
[4] Z rotation (leftshift by 100)
_______________________________________________________
04 warp OBJ
[1] command
[2] OBJ ID
[3-4] X position (0 to remain unchanged)
[5-6] Y position (0 to remain unchanged)
[7-8] Z position (0 to remain unchanged)
__________________________________________________________
05 set camera focus
[1] command
[2] empty
[3-4] x position to focus on
[5-6] Y position to focus on
[7-8] Z position to focus on
__________________________________________________________
06 set camera positions
[1] command
[2] Warp or fluent (1 or 0)
[3-4] x position
[5-6] Y position
[7-8] Z position
_______________________________________________________________
07 set obj params
[1] command
[2] OBJ ID
[3] Params from 00 command
[4] deactivate
______________________________________________________________
08 scale OBJ
[1] command
[2] OBJ ID
[3] scale (divide by 100)
[4] empty
_______________________________________________________________
09 set animation
[1] command
[2] OBJ ID
[3] empty
[4] animation ID
________________________________________________________________
0A play sound
[1] command
[2] bitwise:
80: sound layer (1 or 0)
everything below: set music (7f for none)
[3-4] sound ID (0 for none)
__________________________________________________________________________
0B Set mario (doesnt work yet)
[1] command
[2] animation (FF to remain unchanged)
[3-4] X position
[5-6] Y position
[7-8] Z position
[9-10] Y rotation
[11-12] empty
________________________________________________________________________
0C cutscene params
[1] command
[2] bitwise:
80: end cutscene
40: shake screen
20: grey out
10: make unskipable
08: make skipable
[3-4] daynight time
________________________________________________________________________
0D show text
[1] command
[2-3.5] X
[3.5-4] Y
[5-8]text pointer
________________________________________________________________________
0E spawn obj
[1] command
[2] model ID
[3-4] X
[5-6] Y
[7-8] Z
[9-12] behavior




120F1A0//8040F1A0 Cutscene commands pointer

8041F000: cutscene reader
8041f004: cutscene active?
8041F005: cutscene skipable?
8041f006: cutscene pause
OBJ struct in ram at 8041F010:
[1-4] Pointer of obj0
[5-8] seg.anim.Pointer of obj0
.....



;execute this in some main loop:
Addiu sp, sp, $ffe8
sw ra, $14 (SP)
//loop
Lui t0, $8042
LB T1, $F004 (T0)
or v0, r0, r0
beq t1, r0, $end
nop
lh t4, $f006 (T0)
beq t4, r0, $jump
nop
addiu t4, t4, $ffff
sh t4, $f006 (T0)
beq r0, r0, $end
nop
LW V1, $F000 (T0)
LB T0, $0000 (V1)
sll t0, t0, $2
lui t2, $8040
ori t2, t2, $f1A0
add t0, t0, t2
lw t0, $0000 (T0)
JALR RA, T0
nop
beq v0, r0, $loop
nop
//end
LW RA, $14 (SP)
jr ra
addiu sp, sp, $0018


//00 command 120f200
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
Lui a0, $8036
lw a0, $1160 (A0)
lbu a1, $0001 (T1)
jal $29edcc
lui a2, $1300

//safe obj pointer+anim+params
Lui t2, $8042
lw t1, $f000 (T2)
lbu t0, $0003 (T1)
sb t0, $0180 (V0)
addiu t0, t1, $8
sw t0, $f000 (T2)
lbu t0, $0002 (T1)
sll t0, t0, $2
lui t2, $8042
add t2, t2, t0
sw v0, $f010 (T2)
lw t6, $0004 (T1)
sw t6, $f014 (T2)
sw r0, $00d0 (V0)
sw r0, $00d4 (V0)
sw r0, $00d8 (V0)
sw r0, $00c8 (V0)
addiu v0, r0, $0000
//end
lw ra, $0014 (SP)
jr ra
addiu sp, sp, $18
-----------------------------------------------
//01 command 120F280
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
jr ra
addiu v0, r0, $1
-----------------------------------------------
//02 command 120f2a0
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw t4, $f010 (T3)
//safe stuff
lb t5, $0002 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
swc1 f2, $00b8 (T4)
lb t5, $0003 (T1)
sll t5, t5, $8
sw t5, $00c8 (T4)
jr ra
addiu v0, r0, $0
-----------------------------------------------
//03 command 120f300
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw t4, $f010 (T3)
//safe stuff
lb t5, $0002 (T1)
sll t5, t5, $8
sw t5, $00d4 (T4)
lb t5, $0003 (T1)
sll t5, t5, $8
sw t5, $00D8 (T4)
jr ra
addiu v0, r0, $0
-----------------------------------------------
//04 command 12f360
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0008
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw t4, $f010 (T3)
//safe stuff
lh t5, $0002 (T1)
beq t5, r0, $skip
nop
mtc1 t5, f2
cvt.s.w f2, f2
swc1 f2, $00a0 (T4)
//skip
lh t5, $0004 (T1)
beq t5, r0, $skip
nop
mtc1 t5, f2
cvt.s.w f2, f2
swc1 f2, $00a4 (T4)
//skip
lh t5, $0006 (T1)
beq t5, r0, $skip
nop
mtc1 t5, f2
cvt.s.w f2, f2
swc1 f2, $00a8 (T4)
//skip
jr ra
addiu v0, r0, $0
-----------------------------------------------
//05 command 120f3f0
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0008
sw t0, $f000 (T2)
Lui t4, $8034
//safe stuff
lh t5, $0002 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
swc1 f2, $c524 (T4)
lh t5, $0004 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
swc1 f2, $c528 (T4)
lh t5, $0006 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
swc1 f2, $c52C (T4)
jr ra
addiu v0, r0, $0
-----------------------------------------------
//06 command 120f460
addiu sp, sp, $ffe8
sw ra, $0014 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0008
sw t0, $f000 (T2)
LB T3, $0001 (T1)
lh t5, $0002 (T1)
lh t6, $0004 (T1)
lh t7, $0006 (T1)
mtc1 t5, f2
mtc1 t6, f4
mtc1 t7, f6
cvt.s.w f2, f2
cvt.s.w f4, f4
cvt.s.w f6, f6
LUI A0, $8033
ori a0, a0, $c6a4
beq r0, t3, $fluent
nop
swc1 f2, $0000 (A0)
swc1 f4, $0004 (A0)
swc1 f6, $0008 (A0)
beq r0, r0, $end
nop
//fluent
addiu a1, sp, $0000
swc1 f2, $0000 (A1)
swc1 f4, $0004 (A1)
swc1 f6, $0008 (A1)
LUI A2, $3d4c
Lui A3, $3d4c
jal $80289684
sw a3, $0010 (SP)
//end
addiu v0, r0, $0
lw ra, $14 (SP)
jr ra
addiu sp, sp, $18
-----------------------------------------------
//07 command 120f500
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw t4, $f010 (T3)
//safe stuff
lb t5, $0002 (T1)
sb t5, $0180 (T4)
lb t5, $0003 (T1)
beq t5, r0, $skip
nop
sh r0, $0074 (T4)
//skip
jr ra
addiu v0, r0, $0
-----------------------------------------------
//08 command 120F55C
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw t4, $f010 (T3)
//safe stuff
lbu t5, $0002 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
lui at, $3B03
mtc1 at, f4
muls. f2, f2, f4
swc1 f2, $002c (T4)
swc1 f2, $0030 (T4)
swc1 f2, $0034 (T4)
//skip
jr ra
addiu v0, r0, $0
-----------------------------------------------
//09 command 120F5BC
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw a0, $f010 (T3)
lb a1, $0003 (T1)
sll a1, a1, $2
lw a2, $f014 (T3)
JAL $8037C658
add a1, a1, a2
addiu v0, r0, $0000
lw ra, $0014 (SP)
jr ra
addiu sp, sp, $18
-----------------------------------------------
//0A command 120F620
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t2, $0001 (T1)
lh t3, $0002 (T1)
beq t3, r0, $music
nop
andi t2, t2, $0080
sll a0, t3, $10
ori a0, a0, $0081
bne t2, r0, $skipme
nop
jal $2ca144
nop
beq r0, r0, $end
nop
//skipme
jal $2ca1e0
nop
beq r0, r0, $end
nop
//music
andi a1, t2, $7f
jal $320544
addiu a0, r0, $0000
//end
lw ra, $0014 (SP)
addiu v0, r0, $0
jr ra
addiu sp, sp, $18
-----------------------------------------------
//0B command 120f6B0
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $000C
sw t0, $f000 (T2)
//X
LUI T8, $8036
lw t8, $1158 (T8)
lh t2, $0002 (T1)
mtc1 t2, f2
cvt.s.w f2, f2
lui t0, $8034
swc1 f2, $b1ac (T0)
swc1 f2, $00a0 (T8)
//Y
lh t2, $0004 (T1)
mtc1 t2, f2
cvt.s.w f2, f2
swc1 f2, $b1b0 (T0)
swc1 f2, $00a4 (T8)
//Z
lh t2, $0006 (T1)
mtc1 t2, f2
cvt.s.w f2, f2
swc1 f2, $b1b4 (T0)
swc1 f2, $00a8 (T8)
//rotations
LH T2, $0008 (T1)
sh t2, $b19E (T0)
lbu a1, $0002 (T1)
addiu at, r0, $ff
beq a1, at, $end
nop
jal $802509B8
addiu a0, t0, $b170
//end
lw ra, $0014 (SP)
addiu v0, r0, $0
jr ra
addiu sp, sp, $18
-----------------------------------------------
//0C command 120F748
Lui t2, $8042
lw t1, $f000 (T2)
addiu t3, t1, $4
sw t3, $f000 (T2)
lb t0, $0001 (T1)
lh t6, $0002 (T1)
andi t3, t0, $0080
beq t3, r0, $skip
nop
sb r0, $f004 (T2)
addiu v0, r0, $001
//skip
andi t3, t0, $10
beq t3, r0, $skip
nop
sb r0, $f005 (T2)
//skip
andi t3, t0, $08
beq t3, r0, $skip
nop
addiu at, r0, $0001
sb at, $f005 (T2)
//skip
beq t6, r0, $skip
nop
lui t7, $8037
sw t6, $0008 (T7)
//skip
jr ra
nop
-----------------------------------------------
//0D command 120f800
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0008
sw t0, $f000 (T2)
lbu t4, $0001 (T1)
lbu t5, $0002 (T1)
srl t5, t5, $4
sll t4, t4, $4
or a0, t5, t4
lbu t5, $0002 (T1)
lbu t4, $0003 (T1)
andi t5, t5, $f
sll t5, t5, $4
or a1, t4, t5
jal $802D66C0
lw a2, $0004 (T1)
addiu v0, r0, $0000
lw ra, $14 (SP)
jr ra
addiu sp, sp, $0018
-----------------------------------------------
//0E command 120f970
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
lui a0, $8036
lw a0, $1160 (A0)
lbu a1, $0001 (T1)
jal $29edcc
lw a2, $0008 (T1)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $000C
sw t0, $f000 (T2)
lh t0, $0002 (T1)
mtc1 t0, f2
cvt.s.w f2, f2
swc1 f2, $00a0 (V0)
lh t0, $0004 (T1)
mtc1 t0, f2
cvt.s.w f2, f2
swc1 f2, $00a4 (V0)
lh t0, $0006 (T1)
mtc1 t0, f2
cvt.s.w f2, f2
swc1 f2, $00a8 (V0)
addiu v0, r0, $0000
lw ra, $14 (SP)
jr ra
addiu sp, sp, $0018
_____________________________________________________________________________________________________
;disable mario if cutscene
8029CA58: ADDIU SP, SP, 0xFFE0 ; Called from Mario's Behavior
8029CA5C: SW RA, 0x0014 (SP)
lb t0, $f004 (T0)
bne t0, r0, $END
NOP
8029CA64: LUI A0, 0x8036
8029CA68: JAL 0x80254830 ; mario movements
8029CA6C: LW A0, 0x1160 (A0)
8029CA70: SW V0, 0x001C (SP)
8029CA74: LUI T7, 0x8036
8029CA78: LW T7, 0x1160 (T7)
8029CA7C: LW T6, 0x001C (SP)
8029CA80: SW T6, 0x00F4 (T7)
8029CA84: JAL 0x8029C780 ; particles && spherical collision?
8029CA88: NOP

//JUMP
8029CA8C: SW R0, 0x0018 (SP)
8029CA90: LW T8, 0x0018 (SP)
8029CA94: LUI T0, 0x8033
8029CA98: SLL T9, T8, 0x4
8029CA9C: ADDU T0, T0, T9
8029CAA0: LW T0, 0xFECC (T0)
8029CAA4: BEQ T0, R0, $END
8029CAA8: NOP

//LOOP
8029CAAC: LW T1, 0x0018 (SP)
8029CAB0: LUI T3, 0x8033
8029CAB4: LW T4, 0x001C (SP)
8029CAB8: SLL T2, T1, 0x4
8029CABC: ADDU T3, T3, T2
8029CAC0: LW T3, 0xFECC (T3)
8029CAC4: AND T5, T3, T4
8029CAC8: BEQ T5, R0, $jumphere
8029CACC: NOP
8029CAD0: LW T6, 0x0018 (SP)
8029CAD4: LUI T8, 0x8033
8029CAD8: ADDIU T8, T8, 0xFECC
8029CADC: SLL T7, T6, 0x4
8029CAE0: ADDU T9, T7, T8
8029CAE4: LW A0, 0x0004 (T9)
8029CAE8: LBU A1, 0x0008 (T9)
8029CAEC: JAL 0x8029C9CC
8029CAF0: LW A2, 0x000C (T9)

//jumphere
8029CAF4: LW T0, 0x0018 (SP)
8029CAF8: ADDIU T1, T0, 0x0001
8029CAFC: SW T1, 0x0018 (SP)
8029CB00: LW T2, 0x0018 (SP)
8029CB04: LUI T4, 0x8033
8029CB08: SLL T3, T2, 0x4
8029CB0C: ADDU T4, T4, T3
8029CB10: LW T4, 0xFECC (T4)
8029CB14: BNEZ T4, $LOOP
8029CB18: NOP
$END
LW RA, 0x0014 (SP)
JR RA
ADDIU SP, SP, 0x0020




//disable random cam rotation (reverted, weird effects)
F5580:
lui t0, $8042
lb t0, $f004 (T0)
bne t0, r0, $END
NOP
SW A0, $0000 (SP)
LWC1 F4, $0000 (A1)
SWC1 F4, $0000 (a0)
LWC1 F6, $0004 (A1)
SWC1 F6, $0004 (a0)
LWC1 F8, $0008 (A1)
SWC1 F8, $0008 (a0)
//end
addiu v0, sp, $0000
jr ra
nop

//disable even more sounds
46E68 to branch to 47028
46F1C:
lui t0, $8042
lb t0, $f004 (T0)
bne t0, r0, $END
NOP
8028BF1C: LUI T7, 0x8033
8028BF20: LW T7, 0xD5E4 (T7)
8028BF24: LH T8, 0x0012 (T7)
8028BF28: ANDI T9, T8, 0x0001
8028BF2C: BEQ T9, R0, 0xTEST OTHER
8028BF30: NOP
8028BF34: LUI T0, 0x8034
8028BF38: LH T0, 0xC848 (T0)
8028BF3C: ANDI T1, T0, 0x0008
8028BF40: BEQ T1, R0, SKIP1
8028BF44: NOP
8028BF48: LUI T2, 0x8034
8028BF4C: LH T4, 0xC848 (T2)
8028BF50: ADDIU AT, R0, 0xFFF7
8028BF54: AND T3, T4, AT
8028BF5C: BEQ R0, R0, $TEST OTHER
8028BF60: SH T3, 0xC848 (t2)

//SKIP1
8028BF64: LUI T4, 0x8034
8028BF68: LH T4, 0xC848 (T4)
8028BF6C: LUI AT, 0x8034
8028BF70: ORI T5, T4, 0x0004
8028BF74: SH T5, 0xC848 (AT)
8028BF78: LUI T6, 0x8034
8028BF7C: LH T6, 0xC768 (T6)
8028BF80: BNEZ T6, $JUMP1
8028BF84: NOP
8028BF88: JAL 0x8028B8B8
8028BF8C: NOP

//JUMP1
8028BF90: LH T7, 0x001E (SP)
8028BF94: LUI AT, 0x8034
8028BF98: SUBU T8, R0, T7
8028BF9C: SH T8, 0xC768 (AT)

//TEST OTHER
8028BFA0: LUI T9, 0x8033
8028BFA4: LW T9, 0xD5E4 (T9)
8028BFA8: LH T0, 0x0012 (T9)
8028BFAC: ANDI T1, T0, 0x0002
8028BFB0: BEQ T1, R0, $END
8028BFB4: NOP
8028BFB8: LUI T2, 0x8034
8028BFBC: LH T2, 0xC848 (T2)
8028BFC0: ANDI T3, T2, 0x0004
8028BFC4: BEQ T3, R0, JUMP2
8028BFC8: NOP
8028BFCC: LUI T4, 0x8034
8028BFD0: LH T6, 0xC848 (T4)
8028BFD4: ADDIU AT, R0, 0xFFFB
8028BFD8: AND T5, T6, AT
8028BFE0: BEQ R0, R0, END
8028BFE4: SH T5, 0xC848 (t4)

//JUMP2
8028BFE8: LUI T6, 0x8034
8028BFEC: LH T6, 0xC848 (T6)
8028BFF0: LUI AT, 0x8034
8028BFF4: ORI T7, T6, 0x0008
8028BFF8: SH T7, 0xC848 (AT)
8028BFFC: LUI T8, 0x8034
8028C000: LH T8, 0xC768 (T8)
8028C004: BNEZ T8, SKIPSOUND2
8028C008: NOP
8028C00C: JAL 0x8028B8B8
8028C010: NOP

//SKIPSOUND2
8028C014: LH T9, 0x001E (SP)
8028C018: LUI AT, 0x8034
8028C01C: SH T9, 0xC768 (AT)
//END








disable c left/right buttons with camera 0x0E:
80281588: ADDIU SP, SP, 0xFFD0
8028158C: SW RA, 0x0014 (SP)
80281590: SW A0, 0x0030 (SP)
80281594: LUI T6, 0x8034
80281598: LH T6, 0xC75A (T6)
8028159C: SH T6, 0x001A (SP)
802815A0: LW A0, 0x0030 (SP)
802815A4: JAL 0x8028B9C4
802815A8: ADDIU A1, R0, 0x0000
LUI T0, $8042
lb t0, $F004 (T0)
bne t0, r0, $NOSOUND2
NOP
802815AC: LUI T7, 0x8033
802815B0: LW T7, 0xD5E4 (T7)
802815B4: LH T8, 0x0012 (T7)
802815B8: ANDI T9, T8, 0x0001
802815BC: BEQ T9, R0, 0xNOSOUND
802815C0: NOP
802815C4: LUI T0, 0x8034
802815C8: LH AT, 0xC778 (T0)
802815D0: ADDIU T1, AT, 0x2000
802815D8: JAL 0x8028B8B8
802815D4: SH T1, 0xC778 (T0)

//NOSOUND
802815E0: LUI T2, 0x8033
802815E4: LW T2, 0xD5E4 (T2)
802815E8: LH T3, 0x0012 (T2)
802815EC: ANDI T4, T3, 0x0002
802815F0: BEQ T4, R0, NOSOUND2
802815F4: NOP
802815F8: LUI T5, 0x8034
802815FC: LH AT, 0xC778 (T5)
80281604: ADDIU T6, AT, 0xE000
8028160C: JAL 0x8028B8B8
80281608: SH T6, 0xC778 (T5)

//NOSOUND2
80281614: LUI AT, 0x43C8
80281618: MTC1 AT, F12
8028161C: JAL 0x80281188
80281620: ADDIU A1, R0, 0x0900
80281624: LW T7, 0x0030 (SP)
80281628: ADDIU A2, SP, 0x0024
8028162C: OR A0, T7, R0
80281630: JAL 0x80280970
80281634: ADDIU A1, T7, 0x0004
80281638: LW T8, 0x0030 (SP)
8028163C: SH V0, 0x003A (T8)
80281640: ADDIU T9, SP, 0x0024
80281644: LWC1 F4, 0x0000 (T9)
80281648: LW T0, 0x0030 (SP)
8028164C: SWC1 F4, 0x0010 (T0)
80281650: ADDIU T1, SP, 0x0024
80281654: LWC1 F6, 0x0008 (T1)
80281658: LW T2, 0x0030 (SP)
8028165C: SWC1 F6, 0x0018 (T2)
80281660: LUI T3, 0x8034
80281664: LH T3, 0xC75A (T3)
80281668: LH T4, 0x001A (SP)
8028166C: LUI AT, 0x8034
80281670: SUBU T5, T3, T4
80281674: SH T5, 0xC75C (AT)
80281678: ADDIU T6, SP, 0x0024
8028167C: LW A1, 0x0004 (T6)
80281680: JAL 0x8027FFF8
80281684: LW A0, 0x0030 (SP)
80281690: LW RA, 0x0014 (SP)
80281698: JR RA
80281694: ADDIU SP, SP, 0x0030







disable camera movement:
80286420: ADDIU SP, SP, 0xFFA0
80286424: SW RA, 0x0024 (SP)
80286428: SW A0, 0x0060 (SP)
8028642C: SW R0, 0x005C (SP)
80286430: LUI T6, 0x8034
80286434: LH T6, 0xC848 (T6)
80286438: ANDI T7, T6, 0x8000
8028643C: Bne T7, R0, 0x418a4
80286440: NOP
8028645C: LW T0, 0x0060 (SP)
80286450: LBU T9, 0x0030 (T0)
80286460: LUI T1, 0x8034
80286468: ADDIU T2, T1, 0xC578
8028646C: ADDIU T1, T1, 0xC568
80286470: SW T1, 0x0010 (SP)
80286474: SW T2, 0x0014 (SP)
80286478: LH T3, 0x003A (T0)
8028647C: ADDIU A0, SP, 0x0050
80286480: ADDIU A1, SP, 0x0044
80286484: ADDIU A2, T0, 0x0010
80286488: ADDIU A3, T0, 0x0004
8028648C: JAL 0x8028CE24
80286490: SW T3, 0x0018 (SP)
80286494: SH V0, 0x0032 (SP)
80286498: LW A0, 0x0060 (SP)
8028649C: LUI A2, 0x8033
802864A0: LH A2, 0xDF34 (A2)
802864A4: LH A1, 0x0032 (SP)
802864A8: JAL 0x8028993C
802864AC: ADDIU A0, A0, 0x0002
802864B0: LUI T4, 0x8034
802864B4: LH T4, 0xC84A (T4)
802864B8: ADDIU AT, R0, 0xBFFF
802864BC: AND T5, T4, AT
802864C0: LUI AT, 0x8034
802864C4: BEQ R0, R0, 0x802864EC
802864C8: SH T5, 0xC84A (AT)
802864CC: LW A1, 0x0060 (SP)
802864D0: ADDIU A0, SP, 0x0050
802864D4: JAL 0x80378800 ; camera-related (change position?)
802864D8: ADDIU A1, A1, 0x0010
802864DC: LW A1, 0x0060 (SP)
802864E0: ADDIU A0, SP, 0x0044
802864E4: JAL 0x80378800 ; camera-related (change position?)
802864E8: ADDIU A1, A1, 0x0004
802864EC: LUI A0, 0x8034
802864F0: ADDIU A0, A0, 0xC568
802864F4: JAL 0x80378800 ; camera-related (change position?)
802864F8: ADDIU A1, SP, 0x0050
802864FC: LUI A0, 0x8034
80286500: ADDIU A0, A0, 0xC578
80286504: JAL 0x80378800 ; camera-related (change position?)
80286508: ADDIU A1, SP, 0x0044
8028650C: LW T6, 0x0060 (SP)
80286510: LUI AT, 0x8034
80286514: LH T7, 0x0002 (T6)
80286518: SH T7, 0xC714 (AT)
8028651C: LW T8, 0x0060 (SP)
80286520: LUI AT, 0x8034
80286524: LH T9, 0x003A (T8)
80286528: SH T9, 0xC716 (AT)
8028652C: LW A1, 0x0060 (SP)
80286530: LUI A0, 0x8034
80286534: ADDIU A0, A0, 0xC698
80286538: ADDIU A0, A0, 0x0024
8028653C: JAL 0x80378800 ; camera-related (change position?)
80286540: ADDIU A1, A1, 0x0010
80286544: LW A1, 0x0060 (SP)
80286548: LUI A0, 0x8034
8028654C: ADDIU A0, A0, 0xC698
80286550: ADDIU A0, A0, 0x0018
80286554: JAL 0x80378800 ; camera-related (change position?)
80286558: ADDIU A1, A1, 0x0004
8028655C: LUI AT, 0x8034
80286560: LWC1 F4, 0xC744 (AT)
80286564: LUI A0, 0x8034
80286568: ADDIU A0, A0, 0xC698
8028656C: LUI A3, 0x8034
80286570: MFC1 A2, F4
80286574: LW A3, 0xC748 (A3)
80286578: ADDIU A0, A0, 0x000C
lui t0, $8042
lb t0, $f004 (T0)
bne t0, r0, $skip
nop
8028657C: ADDIU A1, SP, 0x0050
80286580: JAL 0x80289684
80286584: SWC1 F4, 0x0010 (SP)
//skip










_________________________________________________________________________________________________

219E00//13000000
OBJ behaviors:
00 04 00 00
11 01 00 01
0E 45 4B FF
08 00 00 00
0c 00 00 00 80 40 f8 74
09 00 00 00



xx xx xx - 1200000:
addiu sp, sp, $ffe8
sw ra, $14(SP)

//main
jal $2a1308
nop
jal $29f070
nop
jal $2A2BC4
nop
lui v1, $8036
lw v1, $1160 (V1)
LB T0, $0180 (V1)
andi t0, t0, $80
beq t0, r0, $DONTDROP
NOP
LWC1 F12, $00A0 (V1)
LWC1 F10, $00A4 (V1)
LW A2, $00A8 (V1)
LUI AT, $4348
MTC1 AT, F16
JAL $80381794
ADD.S F14, F10, F16
LUI V1, $8036
LW V1, $1160 (V1)
SWC1 F0, $00A4 (V1)
LW T1, $00EC (V1)
ORI T2, T1, $0002
SW T2, $00EC (V1)
//DONTDROP
LB T0, $0180 (V1)
andi t0, t0, $40
beq t0, r0, $END
NOP
LW V0, $00c8 (V1)
sw v0, $00d4 (V1)


//END
lw ra, $14 (SP)
jr ra
addiu sp, sp, $18
Originally posted by Frike The Dragon
Nice stuff here! Why not make a tutorial now? Or maybe even a cutscene editor program.

Damn, I wish I knew some hex/ASM...


the first few lines are pretty much a tutorial. i dont like coding in any regular programming language, but maybe someone else wants to write an editor for it.
Cutscenes in SM64 ?! Wow, the intro was pretty much the only cutscene in the original game.

--------------------
Projects :

Ztar Attack 2 A Blast to the Past

Overworlds : 2/3 done
World 1 : 4/4 levels done
World 2 : 4/4 levels done
World 3 : 4/4 levels done
World 4 : 4/4 imported, 3/4 with objects
World 5 : 1/4 level done
World 6 (extra) : 2/3 levels imported, 0/3 with objectss

Youtube -
http://www.youtube.com/channel/UCiD6DYZSuu7N2302h83pLeQ

Allons, enfants de la paaaatrie ! :D
What's all this gibberish?
Originally posted by Mr. GreenThunder
What's all this gibberish?

ascii
Originally posted by TheGael95
Cutscenes in SM64 ?! Wow, the intro was pretty much the only cutscene in the original game.


Did you forget the end of the game when Mario collects the big star and flies to the castle?
Yeah, there was the ending also, but that's all ^^

--------------------
Projects :

Ztar Attack 2 A Blast to the Past

Overworlds : 2/3 done
World 1 : 4/4 levels done
World 2 : 4/4 levels done
World 3 : 4/4 levels done
World 4 : 4/4 imported, 3/4 with objects
World 5 : 1/4 level done
World 6 (extra) : 2/3 levels imported, 0/3 with objectss

Youtube -
http://www.youtube.com/channel/UCiD6DYZSuu7N2302h83pLeQ

Allons, enfants de la paaaatrie ! :D
Originally posted by Frike The Dragon
Originally posted by Mr. GreenThunder
What's all this gibberish?

I have no idea, but Kaze calls it "a tutorial"...


anyone who'd be able to call a cutscene would be able to understand this. theres no tool for those, so the only way to create cutscenes is writing them in pure hex, like i did. oviously, this is kinda complicated if you are not familar with a hex editor. i dont see any difficulties though, im quite sure if you had the cutscene engine and a trigger, you'd figure out how to make those scenes quite fast.
Meh, fuck all this cutscene complicated shit, i'll insert an .avi file in SM64.
Imagine having a automatically-engineered SM64 cutscene game playing itself than you do on your controller. I bet machinimists would go on that over romhacks.

--------------------
SUPER CRASH TIME YEAH!
i updated it a bit. camera is now more fluent, cutscene sripts are smaller, warping while a cutscene is active will kill the cutscene, also, put some new cutscene related functions in.


Call cutscne:
;120F910
JAL $8040F910 (A0: segmented cutscne pointer)
addiu sp, sp, $ffe8
sw ra, $14 (SP)
jal $277f50
nop
lui t2, $8042
sw V0, $f000 (T2)
addiu at, r0, $0001
sb at, $f004 (T2)
lui t8, $8034
lb t7, $b26b (T8)
sb t7, $effd (T2)
sh r0, $b26a (T8)
lw ra, $14 (SP)
jr ra
addiu sp, sp, $18


Format:
00 define object:
[1] command
[2] model ID
[3] Object ID
[4] params: (0x0180)
80: hold on ground?
40: rotate towards moving direction?
[5-8] animation index pointer
__________________________________________________________
01 next frame
[1] command
[2-4] amount of frames
_________________________________________________________
02 set obj speed params
[1] command
[2] OBJ ID
[3] speed (signed byte)
[4] Y movement rotation speed (leftshift by 10)
_________________________________________________________
03 set obj rotation params
[1] command
[2] OBJ ID
[3] Y rotation (leftshift by 100)
[4] Z rotation (leftshift by 100)
_______________________________________________________
04 warp OBJ
[1] command
[2] OBJ ID
[3-4] X position (0 to remain unchanged)
[5-6] Y position (0 to remain unchanged)
[7-8] Z position (0 to remain unchanged)
__________________________________________________________
05 set camera focus
[1] command
[2] frames to get there
[3-4] x position to focus on
[5-6] Y position to focus on
[7-8] Z position to focus on
__________________________________________________________
06 set camera positions
[1] command
[2] frames to get there
[3-4] x position
[5-6] Y position
[7-8] Z position
_______________________________________________________________
07 set obj params
[1] command
[2] OBJ ID
[3] Params from 00 command
[4] deactivate
______________________________________________________________
08 scale OBJ
[1] command
[2] OBJ ID
[3] scale (divide by 100)
[4] empty
_______________________________________________________________
09 set animation
[1] command
[2] OBJ ID
[3] empty
[4] animation ID
________________________________________________________________
0A play sound
[1] command
[2] bitwise:
80: sound layer (1 or 0)
everything below: set music (7f for none)
[3-4] sound ID (0 for none)
__________________________________________________________________________
0B Set mario (dont use yet)
[1] command
[2] animation (FF to remain unchanged)
[3-4] X position
[5-6] Y position
[7-8] Z position
[9-10] Y rotation
[11-12] empty
________________________________________________________________________
0C cutscene params
[1] command
[2] bitwise:
80: end cutscene
40: shake screen
20: grey out
10: make unskipable
08: make skipable
04: show HUD
[3-4] daynight time
________________________________________________________________________
0D show text
[1] command
[2-3.5] X
[3.5-4] Y
[5-8]text pointer
________________________________________________________________________
0E spawn obj
[1] command
[2] model ID
[3-4] X
[5-6] Y
[7-8] Z
[9-12] behavior




120F1A0//8040F1A0 Cutscene commands pointer

8041EFE0: focus speed x
8041EFE4: focus speed y
8041EFE8: focus speed z
8041EFF0: position speed x
8041EFF4: position speed y
8041EFF8: position speed z
8041EFFD: previous HUD byte
8041F000: cutscene reader
8041f004: cutscene active? <-disables HUD
8041F005: cutscene skipable?
8041f006: cutscene pause
8041F008: camera position move time
8041F00A: camera focus move time
OBJ struct in ram at 8041F010:
[1-4] Pointer of obj0
[5-8] seg.anim.Pointer of obj0
.....


Mario main loop:
Addiu sp, sp, $ffe8
sw ra, $14 (SP)
//loop
Lui t0, $8042
LB T1, $F004 (T0)
or v0, r0, r0
beq t1, r0, $end
nop
lh t4, $f006 (T0)
beq t4, r0, $jump
nop
addiu t4, t4, $ffff
sh t4, $f006 (T0)
beq r0, r0, $end
nop
LW V1, $F000 (T0)
LB T0, $0000 (V1)
sll t0, t0, $2
lui t2, $8040
ori t2, t2, $f1A0
add t0, t0, t2
lw t0, $0000 (T0)
JALR RA, T0
nop
beq v0, r0, $loop
nop
//end

//camera movements
lui t4, $8034
lui t2, $8042
lh t1, $F008 (T2)
beq t1, r0, $skip
nop
addiu t1, t1, $ffff
sh t1, $f008 (T2)
lwc1 f2, $c6A4 (T4)
lwc1 f4, $EFF0 (T2)
add.s f2, f2, f4
swc1 f2, $c6a4 (T4)

lwc1 f2, $c6A8 (T4)
lwc1 f4, $EFF4 (T2)
add.s f2, f2, f4
swc1 f2, $c6a8 (T4)

lwc1 f2, $c6AC (T4)
lwc1 f4, $EFF8 (T2)
add.s f2, f2, f4
swc1 f2, $c6aC (T4)
//skip
lh t1, $f00a (T2)
beq t1, r0, $skip
nop
addiu t1, t1, $ffff
sh t1, $f00a (T2)
lwc1 f2, $c524 (T4)
lwc1 f4, $EFE0 (T2)
add.s f2, f2, f4
swc1 f2, $c524 (T4)

lwc1 f2, $c528 (T4)
lwc1 f4, $EFE4 (T2)
add.s f2, f2, f4
swc1 f2, $c528 (T4)

lwc1 f2, $c52C (T4)
lwc1 f4, $EFE8 (T2)
add.s f2, f2, f4
swc1 f2, $c52C (T4)
//skip
LW RA, $14 (SP)
jr ra
addiu sp, sp, $0018

//00 command 120f200
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
Lui a0, $8036
lw a0, $1160 (A0)
lbu a1, $0001 (T1)
jal $29edcc
lui a2, $1300

//safe obj pointer+anim+params
Lui t2, $8042
lw t1, $f000 (T2)
lbu t0, $0003 (T1)
sb t0, $0180 (V0)
addiu t0, t1, $8
sw t0, $f000 (T2)
lbu t0, $0002 (T1)
sll t0, t0, $2
lui t2, $8042
add t2, t2, t0
sw v0, $f010 (T2)
lw t6, $0004 (T1)
sw t6, $f014 (T2)
sw r0, $00d0 (V0)
sw r0, $00d4 (V0)
sw r0, $00d8 (V0)
sw r0, $00c8 (V0)
addiu v0, r0, $0000
//end
lw ra, $0014 (SP)
jr ra
addiu sp, sp, $18
-----------------------------------------------
//01 command 120F280
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
jr ra
addiu v0, r0, $1
-----------------------------------------------
//02 command 120f2a0
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw t4, $f010 (T3)
//safe stuff
lb t5, $0002 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
swc1 f2, $00b8 (T4)
lb t5, $0003 (T1)
sll t5, t5, $4
sw t5, $0118 (T4)
jr ra
addiu v0, r0, $0
-----------------------------------------------
//03 command 120f300
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw t4, $f010 (T3)
//safe stuff
lb t5, $0002 (T1)
sll t5, t5, $8
sw t5, $00d4 (T4)
lb t5, $0003 (T1)
sll t5, t5, $8
sw t5, $00D8 (T4)
jr ra
addiu v0, r0, $0
-----------------------------------------------
//04 command 12f360
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0008
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw t4, $f010 (T3)
//safe stuff
lh t5, $0002 (T1)
beq t5, r0, $skip
nop
mtc1 t5, f2
cvt.s.w f2, f2
swc1 f2, $00a0 (T4)
//skip
lh t5, $0004 (T1)
beq t5, r0, $skip
nop
mtc1 t5, f2
cvt.s.w f2, f2
swc1 f2, $00a4 (T4)
//skip
lh t5, $0006 (T1)
beq t5, r0, $skip
nop
mtc1 t5, f2
cvt.s.w f2, f2
swc1 f2, $00a8 (T4)
//skip
jr ra
addiu v0, r0, $0
-----------------------------------------------
//05 command 120F3D4
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0008
sw t0, $f000 (T2)
LBU T7, $0001 (T1)
mtc1 t7, f10
sh t7, $f00A (T2)
cvt.s.w f10, f10
//safe stuff
lui t4, $8034
lh t5, $0002 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
lwc1 f4, $c524 (T4)
neg.s f4, f4
add.s f2, f2, f4
div.s f2, f2, f10
swc1 f2, $EFE0 (T2)
lh t5, $0004 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
lwc1 f4, $c528 (T4)
neg.s f4, f4
add.s f2, f2, f4
div.s f2, f2, f10
swc1 f2, $EFE4 (T2)
lh t5, $0006 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
lwc1 f4, $c52C (T4)
neg.s f4, f4
add.s f2, f2, f4
div.s f2, f2, f10
swc1 f2, $EFE8 (T2)
jr ra
addiu v0, r0, $0
-----------------------------------------------
//06 command 120f460
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0008
sw t0, $f000 (T2)
LBU T7, $0001 (T1)
mtc1 t7, f10
sh t7, $f008 (T2)
cvt.s.w f10, f10
//safe stuff
Lui t4, $8034
lh t5, $0002 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
lwc1 f4, $c6A4 (T4)
neg.s f4, f4
add.s f2, f2, f4
div.s f2, f2, f10
swc1 f2, $EFF0 (T2)
lh t5, $0004 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
lwc1 f4, $c6A8 (T4)
neg.s f4, f4
add.s f2, f2, f4
div.s f2, f2, f10
swc1 f2, $EFF4 (T2)
lh t5, $0006 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
lwc1 f4, $c6AC (T4)
neg.s f4, f4
add.s f2, f2, f4
div.s f2, f2, f10
swc1 f2, $EFF8 (T2)
jr ra
addiu v0, r0, $0
-----------------------------------------------
//07 command 120f500
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw t4, $f010 (T3)
//safe stuff
lb t5, $0002 (T1)
sb t5, $0180 (T4)
lb t5, $0003 (T1)
beq t5, r0, $skip
nop
sh r0, $0074 (T4)
//skip
jr ra
addiu v0, r0, $0
-----------------------------------------------
//08 command 120F55C
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw t4, $f010 (T3)
//safe stuff
lbu t5, $0002 (T1)
mtc1 t5, f2
cvt.s.w f2, f2
lui at, $3B03
mtc1 at, f4
muls. f2, f2, f4
swc1 f2, $002c (T4)
swc1 f2, $0030 (T4)
swc1 f2, $0034 (T4)
//skip
jr ra
addiu v0, r0, $0
-----------------------------------------------
//09 command 120F5BC
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t0, $0001 (T1)
sll t0, t0, $2
lui t3, $8042
add t3, t3, t0
lw a0, $f010 (T3)
lb a1, $0003 (T1)
sll a1, a1, $2
lw a2, $f014 (T3)
JAL $8037C658
add a1, a1, a2
addiu v0, r0, $0000
lw ra, $0014 (SP)
jr ra
addiu sp, sp, $18
-----------------------------------------------
//0A command 120F620
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0004
sw t0, $f000 (T2)
lbu t2, $0001 (T1)
lh t3, $0002 (T1)
beq t3, r0, $music
nop
andi t2, t2, $0080
sll a0, t3, $10
ori a0, a0, $0081
bne t2, r0, $skipme
nop
jal $2ca144
nop
beq r0, r0, $end
nop
//skipme
jal $2ca1e0
nop
beq r0, r0, $end
nop
//music
andi a1, t2, $7f
jal $320544
addiu a0, r0, $0000
//end
lw ra, $0014 (SP)
addiu v0, r0, $0
jr ra
addiu sp, sp, $18
-----------------------------------------------
//0B command 120f6B0
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $000C
sw t0, $f000 (T2)
//X
LUI T8, $8036
lw t8, $1158 (T8)
lh t2, $0002 (T1)
mtc1 t2, f2
cvt.s.w f2, f2
lui t0, $8034
swc1 f2, $b1ac (T0)
swc1 f2, $00a0 (T8)
//Y
lh t2, $0004 (T1)
mtc1 t2, f2
cvt.s.w f2, f2
swc1 f2, $b1b0 (T0)
swc1 f2, $00a4 (T8)
//Z
lh t2, $0006 (T1)
mtc1 t2, f2
cvt.s.w f2, f2
swc1 f2, $b1b4 (T0)
swc1 f2, $00a8 (T8)
//rotations
LH T2, $0008 (T1)
sh t2, $b19E (T0)
lbu a1, $0002 (T1)
addiu at, r0, $ff
beq a1, at, $end
nop
jal $802509B8
addiu a0, t0, $b170
//end
lw ra, $0014 (SP)
addiu v0, r0, $0
jr ra
addiu sp, sp, $18
-----------------------------------------------
//0C command 120F748
Lui t2, $8042
lw t1, $f000 (T2)
addiu t3, t1, $4
sw t3, $f000 (T2)
lb t0, $0001 (T1)
lh t6, $0002 (T1)
andi t3, t0, $0080
beq t3, r0, $skip
nop
sb r0, $f004 (T2)
addiu v0, r0, $001
BEQ R0, R0, $enable HUD
nop
//skip
andi t3, t0, $10
beq t3, r0, $skip
nop
sb r0, $f005 (T2)
//skip
andi t3, t0, $08
beq t3, r0, $skip
nop
addiu at, r0, $0001
sb at, $f005 (T2)
//skip
beq t6, r0, $skip
nop
lui t7, $8037
sw t6, $0008 (T7)
//skip
andi t3, t0, $0004
beq t3, r0, $skip
nop
//enable HUD
lui t4, $8034
lb at, $effd (t2)
sb at, $b26B (T4)
//skip
jr ra
nop
-----------------------------------------------
//0D command 120f800
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $0008
sw t0, $f000 (T2)
lbu t4, $0001 (T1)
lbu t5, $0002 (T1)
srl t5, t5, $4
sll t4, t4, $4
or a0, t5, t4
lbu t5, $0002 (T1)
lbu t4, $0003 (T1)
andi t5, t5, $f
sll t5, t5, $4
or a1, t4, t5
jal $802D77DC
lw a2, $0004 (T1)
addiu v0, r0, $0000
lw ra, $14 (SP)
jr ra
addiu sp, sp, $0018
-----------------------------------------------
//0E command 120f970
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
lui a0, $8036
lw a0, $1160 (A0)
lbu a1, $0001 (T1)
jal $29edcc
lw a2, $0008 (T1)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $000C
sw t0, $f000 (T2)
lh t0, $0002 (T1)
mtc1 t0, f2
cvt.s.w f2, f2
swc1 f2, $00a0 (V0)
lh t0, $0004 (T1)
mtc1 t0, f2
cvt.s.w f2, f2
swc1 f2, $00a4 (V0)
lh t0, $0006 (T1)
mtc1 t0, f2
cvt.s.w f2, f2
swc1 f2, $00a8 (V0)
addiu v0, r0, $0000
lw ra, $14 (SP)
jr ra
addiu sp, sp, $0018
_____________________________________________________________________________________________________
;disable mario if cutscene
8029CA58: ADDIU SP, SP, 0xFFE0 ; Called from Mario's Behavior
8029CA5C: SW RA, 0x0014 (SP)
lb t0, $f004 (T0)
bne t0, r0, $END
NOP
8029CA64: LUI A0, 0x8036
8029CA68: JAL 0x80254830 ; mario movements
8029CA6C: LW A0, 0x1160 (A0)
8029CA70: SW V0, 0x001C (SP)
8029CA74: LUI T7, 0x8036
8029CA78: LW T7, 0x1160 (T7)
8029CA7C: LW T6, 0x001C (SP)
8029CA80: SW T6, 0x00F4 (T7)
8029CA84: JAL 0x8029C780 ; particles && spherical collision?
8029CA88: NOP

//JUMP
8029CA8C: SW R0, 0x0018 (SP)
8029CA90: LW T8, 0x0018 (SP)
8029CA94: LUI T0, 0x8033
8029CA98: SLL T9, T8, 0x4
8029CA9C: ADDU T0, T0, T9
8029CAA0: LW T0, 0xFECC (T0)
8029CAA4: BEQ T0, R0, $END
8029CAA8: NOP

//LOOP
8029CAAC: LW T1, 0x0018 (SP)
8029CAB0: LUI T3, 0x8033
8029CAB4: LW T4, 0x001C (SP)
8029CAB8: SLL T2, T1, 0x4
8029CABC: ADDU T3, T3, T2
8029CAC0: LW T3, 0xFECC (T3)
8029CAC4: AND T5, T3, T4
8029CAC8: BEQ T5, R0, $jumphere
8029CACC: NOP
8029CAD0: LW T6, 0x0018 (SP)
8029CAD4: LUI T8, 0x8033
8029CAD8: ADDIU T8, T8, 0xFECC
8029CADC: SLL T7, T6, 0x4
8029CAE0: ADDU T9, T7, T8
8029CAE4: LW A0, 0x0004 (T9)
8029CAE8: LBU A1, 0x0008 (T9)
8029CAEC: JAL 0x8029C9CC
8029CAF0: LW A2, 0x000C (T9)

//jumphere
8029CAF4: LW T0, 0x0018 (SP)
8029CAF8: ADDIU T1, T0, 0x0001
8029CAFC: SW T1, 0x0018 (SP)
8029CB00: LW T2, 0x0018 (SP)
8029CB04: LUI T4, 0x8033
8029CB08: SLL T3, T2, 0x4
8029CB0C: ADDU T4, T4, T3
8029CB10: LW T4, 0xFECC (T4)
8029CB14: BNEZ T4, $LOOP
8029CB18: NOP
$END
LW RA, 0x0014 (SP)
JR RA
ADDIU SP, SP, 0x0020


//destroy cutscene when warping
FBC10:
lui t0, $8042
sh r0, $F004 (T0)


//disable random cam rotation (reverted, weird effects)
F5580:
lui t0, $8042
lb t0, $f004 (T0)
bne t0, r0, $END
NOP
SW A0, $0000 (SP)
LWC1 F4, $0000 (A1)
SWC1 F4, $0000 (a0)
LWC1 F6, $0004 (A1)
SWC1 F6, $0004 (a0)
LWC1 F8, $0008 (A1)
SWC1 F8, $0008 (a0)
//end
addiu v0, sp, $0000
jr ra
nop

//disable even more sounds
46E68 to branch to 47028
46F1C:
lui t0, $8042
lb t0, $f004 (T0)
bne t0, r0, $END
NOP
8028BF1C: LUI T7, 0x8033
8028BF20: LW T7, 0xD5E4 (T7)
8028BF24: LH T8, 0x0012 (T7)
8028BF28: ANDI T9, T8, 0x0001
8028BF2C: BEQ T9, R0, 0xTEST OTHER
8028BF30: NOP
8028BF34: LUI T0, 0x8034
8028BF38: LH T0, 0xC848 (T0)
8028BF3C: ANDI T1, T0, 0x0008
8028BF40: BEQ T1, R0, SKIP1
8028BF44: NOP
8028BF48: LUI T2, 0x8034
8028BF4C: LH T4, 0xC848 (T2)
8028BF50: ADDIU AT, R0, 0xFFF7
8028BF54: AND T3, T4, AT
8028BF5C: BEQ R0, R0, $TEST OTHER
8028BF60: SH T3, 0xC848 (t2)

//SKIP1
8028BF64: LUI T4, 0x8034
8028BF68: LH T4, 0xC848 (T4)
8028BF6C: LUI AT, 0x8034
8028BF70: ORI T5, T4, 0x0004
8028BF74: SH T5, 0xC848 (AT)
8028BF78: LUI T6, 0x8034
8028BF7C: LH T6, 0xC768 (T6)
8028BF80: BNEZ T6, $JUMP1
8028BF84: NOP
8028BF88: JAL 0x8028B8B8
8028BF8C: NOP

//JUMP1
8028BF90: LH T7, 0x001E (SP)
8028BF94: LUI AT, 0x8034
8028BF98: SUBU T8, R0, T7
8028BF9C: SH T8, 0xC768 (AT)

//TEST OTHER
8028BFA0: LUI T9, 0x8033
8028BFA4: LW T9, 0xD5E4 (T9)
8028BFA8: LH T0, 0x0012 (T9)
8028BFAC: ANDI T1, T0, 0x0002
8028BFB0: BEQ T1, R0, $END
8028BFB4: NOP
8028BFB8: LUI T2, 0x8034
8028BFBC: LH T2, 0xC848 (T2)
8028BFC0: ANDI T3, T2, 0x0004
8028BFC4: BEQ T3, R0, JUMP2
8028BFC8: NOP
8028BFCC: LUI T4, 0x8034
8028BFD0: LH T6, 0xC848 (T4)
8028BFD4: ADDIU AT, R0, 0xFFFB
8028BFD8: AND T5, T6, AT
8028BFE0: BEQ R0, R0, END
8028BFE4: SH T5, 0xC848 (t4)

//JUMP2
8028BFE8: LUI T6, 0x8034
8028BFEC: LH T6, 0xC848 (T6)
8028BFF0: LUI AT, 0x8034
8028BFF4: ORI T7, T6, 0x0008
8028BFF8: SH T7, 0xC848 (AT)
8028BFFC: LUI T8, 0x8034
8028C000: LH T8, 0xC768 (T8)
8028C004: BNEZ T8, SKIPSOUND2
8028C008: NOP
8028C00C: JAL 0x8028B8B8
8028C010: NOP

//SKIPSOUND2
8028C014: LH T9, 0x001E (SP)
8028C018: LUI AT, 0x8034
8028C01C: SH T9, 0xC768 (AT)
//END








disable c left/right buttons with camera 0x0E:
80281588: ADDIU SP, SP, 0xFFD0
8028158C: SW RA, 0x0014 (SP)
80281590: SW A0, 0x0030 (SP)
80281594: LUI T6, 0x8034
80281598: LH T6, 0xC75A (T6)
8028159C: SH T6, 0x001A (SP)
802815A0: LW A0, 0x0030 (SP)
802815A4: JAL 0x8028B9C4
802815A8: ADDIU A1, R0, 0x0000
LUI T0, $8042
lb t0, $F004 (T0)
bne t0, r0, $NOSOUND2
NOP
802815AC: LUI T7, 0x8033
802815B0: LW T7, 0xD5E4 (T7)
802815B4: LH T8, 0x0012 (T7)
802815B8: ANDI T9, T8, 0x0001
802815BC: BEQ T9, R0, 0xNOSOUND
802815C0: NOP
802815C4: LUI T0, 0x8034
802815C8: LH AT, 0xC778 (T0)
802815D0: ADDIU T1, AT, 0x2000
802815D8: JAL 0x8028B8B8
802815D4: SH T1, 0xC778 (T0)

//NOSOUND
802815E0: LUI T2, 0x8033
802815E4: LW T2, 0xD5E4 (T2)
802815E8: LH T3, 0x0012 (T2)
802815EC: ANDI T4, T3, 0x0002
802815F0: BEQ T4, R0, NOSOUND2
802815F4: NOP
802815F8: LUI T5, 0x8034
802815FC: LH AT, 0xC778 (T5)
80281604: ADDIU T6, AT, 0xE000
8028160C: JAL 0x8028B8B8
80281608: SH T6, 0xC778 (T5)

//NOSOUND2
80281614: LUI AT, 0x43C8
80281618: MTC1 AT, F12
8028161C: JAL 0x80281188
80281620: ADDIU A1, R0, 0x0900
80281624: LW T7, 0x0030 (SP)
80281628: ADDIU A2, SP, 0x0024
8028162C: OR A0, T7, R0
80281630: JAL 0x80280970
80281634: ADDIU A1, T7, 0x0004
80281638: LW T8, 0x0030 (SP)
8028163C: SH V0, 0x003A (T8)
80281640: ADDIU T9, SP, 0x0024
80281644: LWC1 F4, 0x0000 (T9)
80281648: LW T0, 0x0030 (SP)
8028164C: SWC1 F4, 0x0010 (T0)
80281650: ADDIU T1, SP, 0x0024
80281654: LWC1 F6, 0x0008 (T1)
80281658: LW T2, 0x0030 (SP)
8028165C: SWC1 F6, 0x0018 (T2)
80281660: LUI T3, 0x8034
80281664: LH T3, 0xC75A (T3)
80281668: LH T4, 0x001A (SP)
8028166C: LUI AT, 0x8034
80281670: SUBU T5, T3, T4
80281674: SH T5, 0xC75C (AT)
80281678: ADDIU T6, SP, 0x0024
8028167C: LW A1, 0x0004 (T6)
80281680: JAL 0x8027FFF8
80281684: LW A0, 0x0030 (SP)
80281690: LW RA, 0x0014 (SP)
80281698: JR RA
80281694: ADDIU SP, SP, 0x0030







disable camera movement:
80286420: ADDIU SP, SP, 0xFFA0
80286424: SW RA, 0x0024 (SP)
80286428: SW A0, 0x0060 (SP)
8028642C: SW R0, 0x005C (SP)
80286430: LUI T6, 0x8034
80286434: LH T6, 0xC848 (T6)
80286438: ANDI T7, T6, 0x8000
8028643C: Bne T7, R0, 0x418a4
80286440: NOP
8028645C: LW T0, 0x0060 (SP)
80286450: LBU T9, 0x0030 (T0)
80286460: LUI T1, 0x8034
80286468: ADDIU T2, T1, 0xC578
8028646C: ADDIU T1, T1, 0xC568
80286470: SW T1, 0x0010 (SP)
80286474: SW T2, 0x0014 (SP)
80286478: LH T3, 0x003A (T0)
8028647C: ADDIU A0, SP, 0x0050
80286480: ADDIU A1, SP, 0x0044
80286484: ADDIU A2, T0, 0x0010
80286488: ADDIU A3, T0, 0x0004
8028648C: JAL 0x8028CE24
80286490: SW T3, 0x0018 (SP)
80286494: SH V0, 0x0032 (SP)
80286498: LW A0, 0x0060 (SP)
8028649C: LUI A2, 0x8033
802864A0: LH A2, 0xDF34 (A2)
802864A4: LH A1, 0x0032 (SP)
802864A8: JAL 0x8028993C
802864AC: ADDIU A0, A0, 0x0002
802864B0: LUI T4, 0x8034
802864B4: LH T4, 0xC84A (T4)
802864B8: ADDIU AT, R0, 0xBFFF
802864BC: AND T5, T4, AT
802864C0: LUI AT, 0x8034
802864C4: BEQ R0, R0, 0x802864EC
802864C8: SH T5, 0xC84A (AT)
802864CC: LW A1, 0x0060 (SP)
802864D0: ADDIU A0, SP, 0x0050
802864D4: JAL 0x80378800 ; camera-related (change position?)
802864D8: ADDIU A1, A1, 0x0010
802864DC: LW A1, 0x0060 (SP)
802864E0: ADDIU A0, SP, 0x0044
802864E4: JAL 0x80378800 ; camera-related (change position?)
802864E8: ADDIU A1, A1, 0x0004
802864EC: LUI A0, 0x8034
802864F0: ADDIU A0, A0, 0xC568
802864F4: JAL 0x80378800 ; camera-related (change position?)
802864F8: ADDIU A1, SP, 0x0050
802864FC: LUI A0, 0x8034
80286500: ADDIU A0, A0, 0xC578
80286504: JAL 0x80378800 ; camera-related (change position?)
80286508: ADDIU A1, SP, 0x0044
8028650C: LW T6, 0x0060 (SP)
80286510: LUI AT, 0x8034
80286514: LH T7, 0x0002 (T6)
80286518: SH T7, 0xC714 (AT)
8028651C: LW T8, 0x0060 (SP)
80286520: LUI AT, 0x8034
80286524: LH T9, 0x003A (T8)
80286528: SH T9, 0xC716 (AT)
8028652C: LW A1, 0x0060 (SP)
80286530: LUI A0, 0x8034
80286534: ADDIU A0, A0, 0xC698
80286538: ADDIU A0, A0, 0x0024
8028653C: JAL 0x80378800 ; camera-related (change position?)
80286540: ADDIU A1, A1, 0x0010
80286544: LW A1, 0x0060 (SP)
80286548: LUI A0, 0x8034
8028654C: ADDIU A0, A0, 0xC698
80286550: ADDIU A0, A0, 0x0018
80286554: JAL 0x80378800 ; camera-related (change position?)
80286558: ADDIU A1, A1, 0x0004
8028655C: LUI AT, 0x8034
80286560: LWC1 F4, 0xC744 (AT)
80286564: LUI A0, 0x8034
80286568: ADDIU A0, A0, 0xC698
8028656C: LUI A3, 0x8034
80286570: MFC1 A2, F4
80286574: LW A3, 0xC748 (A3)
80286578: ADDIU A0, A0, 0x000C
lui t0, $8042
lb t0, $f004 (T0)
bne t0, r0, $skip
nop
8028657C: ADDIU A1, SP, 0x0050
80286580: JAL 0x80289684
80286584: SWC1 F4, 0x0010 (SP)
//skip










_________________________________________________________________________________________________

219E00//13000000
OBJ behaviors:
00 04 00 00
11 01 00 01
0E 45 4B FF
08 00 00 00
0c 00 00 00 80 40 f8 74
09 00 00 00



xx xx xx - 1200000:
addiu sp, sp, $ffe8
sw ra, $14(SP)

//main
jal $2a1308
nop
jal $29f070
nop
jal $2A2BC4
nop
lui v1, $8036
lw v1, $1160 (V1)
LB T0, $0180 (V1)
andi t0, t0, $80
beq t0, r0, $DONTDROP
NOP
LWC1 F12, $00A0 (V1)
LWC1 F10, $00A4 (V1)
LW A2, $00A8 (V1)
LUI AT, $4348
MTC1 AT, F16
JAL $80381794
ADD.S F14, F10, F16
LUI V1, $8036
LW V1, $1160 (V1)
SWC1 F0, $00A4 (V1)
LW T1, $00EC (V1)
ORI T2, T1, $0002
SW T2, $00EC (V1)
//DONTDROP
LB T0, $0180 (V1)
andi t0, t0, $40
beq t0, r0, $DONT COPY ROTATION
NOP
LW V0, $00c8 (V1)
sw v0, $00d4 (V1)


//END
lw ra, $14 (SP)
jr ra
addiu sp, sp, $18
update to get mario working properly:

0B Set mario
[1] command
[2] FF to skip animating
[3-4] X position
[5-6] Y position
[7-8] Z position
[9-10] Y rotation
[11-12] animation data size
[13-16] animation data start

__________________________________________________________________


//0B command 120f6B0
addiu sp, sp, $ffe8
sw ra, $14 (SP)
Lui t2, $8042
lw t1, $f000 (T2)
addiu t0, t1, $000C
sw t0, $f000 (T2)
//X
LUI T8, $8036
lw t8, $1158 (T8)
lh t2, $0002 (T1)
mtc1 t2, f2
cvt.s.w f2, f2
swc1 f2, $0024 (T8)
//Y
lh t2, $0004 (T1)
mtc1 t2, f2
cvt.s.w f2, f2
swc1 f2, $0028 (T8)
//Z
lh t2, $0006 (T1)
mtc1 t2, f2
cvt.s.w f2, f2
swc1 f2, $002C (T8)
//rotations
LH T2, $0008 (T1)
sh t2, $001C (T8)
lbu a1, $0002 (T1)
addiu at, r0, $ff
beq a1, at, $end
nop
lui a0, $8006
lw a1, $000C (T1)
lh a2, $000A (T1)
add a2, a2, a1
!loop:
lw t0, $0000 (a1)
sw t0, $0030 (a0)
addiu a1, a1, $4
bne a1, a2, !loop
addiu a0, a0, $4

//end
lw ra, $0014 (SP)
addiu v0, r0, $0
jr ra
addiu sp, sp, $18
update! zoom in/out sounds while in cutscene are now also disabled.

.org 0x12150
!main:
lui t2, $8042
lb t2, $f004 (T2)
sll t2, t2, $4
add ra, ra, t2
jr ra
nop





8028B850:
.org 0x46850
!sound1:
ADDIU SP, SP, 0xFFE8
SW RA, 0x0014 (SP)
JAL $257150
nop
LUI A0, 0x7006
LUI A1, 0x8033
ADDIU A1, A1, 0x31F0
JAL 0x8031eb00
ORI A0, A0, 0x0081
LW RA, 0x0014 (SP)
JR RA
ADDIU SP, SP, 0x0018



.org 0x46884
!sound2:
ADDIU SP, SP, 0xFFE8
SW RA, 0x0014 (SP)
JAL $257150
nop
LUI A0, 0x7007
LUI A1, 0x8033
ADDIU A1, A1, 0x31F0
JAL 0x8031eb00
ORI A0, A0, 0x0081
LW RA, 0x0014 (SP)
JR RA
ADDIU SP, SP, 0x0018


.org 0x468EC
!sound3:
ADDIU SP, SP, 0xFFE8
SW RA, 0x0014 (SP)
JAL $257150
nop
LUI A0, 0x700E
LUI A1, 0x8033
ADDIU A1, A1, 0x31F0
JAL 0x8031eb00
ORI A0, A0, 0x0081
LW RA, 0x0014 (SP)
JR RA
ADDIU SP, SP, 0x0018
Pages: « 1 » Link
Forum Index - Non-SMW Hacking - Super Mario 64 Hacking - ASM & Data Repository - Cutscene engine

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2021 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks