Start of kraid rising cutscene

This commit is contained in:
YohannDR 2022-10-02 21:51:03 +02:00
parent 227870eb15
commit e56a616d92
13 changed files with 667 additions and 66 deletions

View File

@ -26881,7 +26881,7 @@ lbl_0806255c:
ldr r0, [r5]
add r0, r8
movs r1, #1
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r1, [r5]
movs r2, #0x80
lsls r2, r2, #5
@ -27045,7 +27045,7 @@ lbl_08062716:
adds r1, r1, r0
ldrb r1, [r1]
adds r0, r3, #0
bl sub_08068148
bl update_cutscene_oam_data_id
lbl_0806273a:
pop {r4}
pop {r1}
@ -27103,7 +27103,7 @@ lbl_08062760:
strh r7, [r5, #0x18]
adds r0, r5, #0
movs r1, #2
bl sub_08068148
bl update_cutscene_oam_data_id
b lbl_080627f8
.align 2, 0
lbl_080627ac: .4byte 0x0875feb4
@ -28331,7 +28331,7 @@ lbl_080631ac:
lsls r1, r1, #1
adds r0, r0, r1
movs r1, #6
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r1, [r4]
lbl_080631d2:
movs r0, #0
@ -28412,7 +28412,7 @@ lbl_08063260:
strh r0, [r4, #0x14]
adds r0, r4, #0
movs r1, #4
bl sub_08068148
bl update_cutscene_oam_data_id
ldrb r0, [r4, #0xd]
adds r0, #1
strb r0, [r4, #0xd]
@ -28586,7 +28586,7 @@ lbl_080633e0:
lsls r1, r1, #1
adds r0, r0, r1
movs r1, #3
bl sub_08068148
bl update_cutscene_oam_data_id
lbl_08063402:
ldr r1, [r4]
movs r0, #0
@ -29005,7 +29005,7 @@ lbl_0806370c:
adds r0, r0, r2
movs r1, #5
str r3, [sp]
bl sub_08068148
bl update_cutscene_oam_data_id
movs r0, #0xf0
lsls r0, r0, #1
strh r0, [r7, #0x22]
@ -29133,7 +29133,7 @@ lbl_0806381e:
adds r0, #0xf0
adds r0, r5, r0
movs r1, #1
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r2, [r7]
adds r2, r2, r4
adds r2, #0xfc
@ -29254,7 +29254,7 @@ lbl_080638cc:
ldr r0, [r4]
adds r0, r0, r3
movs r1, #4
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r2, [r4]
ldrh r0, [r5, #4]
movs r3, #0x80
@ -29325,7 +29325,7 @@ lbl_08063978:
beq lbl_08063a1c
adds r0, r5, r4
movs r1, #9
bl sub_08068148
bl update_cutscene_oam_data_id
b lbl_08063a24
.align 2, 0
lbl_080639e8: .4byte 0x0839dcd0
@ -29344,7 +29344,7 @@ lbl_08063a18: .4byte 0x0000027f
lbl_08063a1c:
adds r0, r5, r4
movs r1, #0xa
bl sub_08068148
bl update_cutscene_oam_data_id
lbl_08063a24:
adds r4, #0x20
adds r6, #1
@ -30513,15 +30513,15 @@ ridley_in_space_cutscene_init: @ 0x080642bc
adds r1, r3, r4
strh r2, [r1]
movs r1, #1
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r0, [r5]
adds r0, r0, r6
movs r1, #2
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r0, [r5]
adds r0, r0, r4
movs r1, #3
bl sub_08068148
bl update_cutscene_oam_data_id
movs r0, #0x10
movs r1, #0
bl MusicPlay
@ -30725,7 +30725,7 @@ lbl_0806454a:
ldr r0, [r2]
adds r0, r0, r1
movs r1, #6
bl sub_08068148
bl update_cutscene_oam_data_id
mov r3, r8
ldr r1, [r3]
ldrb r0, [r1, #6]
@ -30763,7 +30763,7 @@ lbl_08064582:
adds r0, r0, r5
lsls r1, r1, #0x18
lsrs r1, r1, #0x18
bl sub_08068148
bl update_cutscene_oam_data_id
lbl_080645aa:
ldr r1, [r7]
adds r0, r1, r4
@ -30774,7 +30774,7 @@ lbl_080645aa:
bne lbl_080645c0
adds r0, r1, r5
movs r1, #0
bl sub_08068148
bl update_cutscene_oam_data_id
lbl_080645c0:
adds r5, #0x20
adds r6, #1
@ -30969,7 +30969,7 @@ lbl_08064726:
adds r0, #0xf0
add r0, r8
adds r1, r3, #0
bl sub_08068148
bl update_cutscene_oam_data_id
b lbl_0806474a
.align 2, 0
lbl_08064734: .4byte 0x08754bc4
@ -31005,7 +31005,7 @@ lbl_08064752:
bne lbl_0806477e
adds r0, r1, r6
movs r1, #0
bl sub_08068148
bl update_cutscene_oam_data_id
lbl_0806477e:
adds r6, #0x20
adds r5, #1
@ -31139,7 +31139,7 @@ lbl_080647fa:
adds r1, #0x70
strh r1, [r0]
movs r1, #8
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r0, [r7]
adds r2, r0, #0
adds r2, #0xf2
@ -31150,7 +31150,7 @@ lbl_080647fa:
subs r1, #0xc0
strh r1, [r0]
movs r1, #9
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r1, [r7]
movs r2, #0x80
lsls r2, r2, #5
@ -31261,7 +31261,7 @@ lbl_08064972:
ldr r0, [r0]
adds r0, #0xf0
movs r1, #0xa
bl sub_08068148
bl update_cutscene_oam_data_id
lbl_08064984:
ldrb r1, [r4, #0xd]
movs r0, #2
@ -31491,19 +31491,19 @@ lbl_080649f8:
ldr r0, [r5]
add r0, sl
movs r1, #2
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r0, [r5]
movs r3, #0xe8
lsls r3, r3, #1
adds r0, r0, r3
movs r1, #3
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r0, [r5]
movs r1, #0xf8
lsls r1, r1, #1
adds r0, r0, r1
movs r1, #4
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r1, [r5]
movs r2, #0x80
lsls r2, r2, #5
@ -31964,7 +31964,7 @@ lbl_08064f7c:
ldr r0, [r4]
adds r0, #0xf0
movs r1, #5
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r2, [r4]
adds r3, r2, #0
adds r3, #0xf2
@ -31986,7 +31986,7 @@ lbl_08064fa4:
lsls r5, r5, #1
adds r0, r0, r5
movs r1, #5
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r2, [r4]
movs r1, #0x89
lsls r1, r1, #1
@ -32255,7 +32255,7 @@ ridley_landing_init: @ 0x080650e8
ldr r0, [r5]
adds r0, #0xf0
movs r1, #1
bl sub_08068148
bl update_cutscene_oam_data_id
movs r0, #0x11
movs r1, #0
bl MusicPlay
@ -32494,7 +32494,7 @@ lbl_08065336:
ldr r0, [r1]
adds r0, #0xf0
movs r1, #2
bl sub_08068148
bl update_cutscene_oam_data_id
mov r2, r8
ldr r1, [r2]
movs r2, #0x80
@ -32613,7 +32613,7 @@ lbl_080654e4:
bl SoundPlay
adds r0, r4, #0
movs r1, #3
bl sub_08068148
bl update_cutscene_oam_data_id
lbl_080654fe:
ldrb r2, [r4, #0xd]
movs r0, #2
@ -32722,7 +32722,7 @@ lbl_08065562:
ldr r0, [r6]
adds r0, #0xf0
movs r1, #1
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r2, [r6]
ldrh r0, [r4, #0xc]
ldrh r1, [r4, #0x14]
@ -33019,7 +33019,7 @@ lbl_0806572e:
ldr r0, [r4]
adds r0, #0xf0
movs r1, #4
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r1, [r4]
movs r7, #0x80
lsls r7, r7, #5
@ -33164,7 +33164,7 @@ lbl_08065974:
ldr r0, [r4]
adds r0, #0xf0
movs r1, #2
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r1, [r4]
b lbl_080659f4
.align 2, 0
@ -33193,7 +33193,7 @@ lbl_080659a8:
lsls r1, r1, #1
adds r0, r0, r1
movs r1, #4
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r1, [r4]
b lbl_080659f4
lbl_080659ca:
@ -33331,7 +33331,7 @@ mecha_ridley_sees_samus_init: @ 0x08065a24
ldr r0, [r6]
adds r0, #0xf0
movs r1, #1
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r1, [r6]
movs r2, #0x89
lsls r2, r2, #1
@ -33354,7 +33354,7 @@ mecha_ridley_sees_samus_init: @ 0x08065a24
ldr r0, [r6]
adds r0, r0, r2
movs r1, #3
bl sub_08068148
bl update_cutscene_oam_data_id
movs r0, #2
bl sub_08061fa0
ldr r1, [r6]
@ -33846,7 +33846,7 @@ lbl_08065eee:
beq lbl_08065f10
adds r0, r4, #0
movs r1, #3
bl sub_08068148
bl update_cutscene_oam_data_id
b lbl_08065f18
.align 2, 0
lbl_08065f08: .4byte 0x0808c99c
@ -33854,7 +33854,7 @@ lbl_08065f0c: .4byte 0x03000c77
lbl_08065f10:
adds r0, r4, #0
movs r1, #2
bl sub_08068148
bl update_cutscene_oam_data_id
lbl_08065f18:
movs r0, #2
lbl_08065f1a:
@ -34153,7 +34153,7 @@ getting_fully_powered_suit_init: @ 0x08066020
ldr r0, [r6]
add r0, r8
movs r1, #4
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r0, [r6]
movs r3, #0xa4
lsls r3, r3, #2
@ -34182,7 +34182,7 @@ getting_fully_powered_suit_init: @ 0x08066020
ldr r0, [r6]
adds r0, r0, r3
movs r1, #5
bl sub_08068148
bl update_cutscene_oam_data_id
movs r7, #0
adds r5, r4, #0
mov r8, sb
@ -34254,7 +34254,7 @@ lbl_080661bc:
strh r1, [r2]
add r0, sb
movs r1, #1
bl sub_08068148
bl update_cutscene_oam_data_id
movs r7, #8
mov r4, r8
ldr r5, lbl_08066314 @ =0x083ca1e4
@ -35501,7 +35501,7 @@ lbl_08066cb0:
adds r0, r1, #0
adds r0, #0xf0
movs r1, #2
bl sub_08068148
bl update_cutscene_oam_data_id
b lbl_08066ce0
.align 2, 0
lbl_08066ccc: .4byte 0x03000054
@ -35512,7 +35512,7 @@ lbl_08066cd0:
lsls r2, r2, #1
adds r0, r1, r2
movs r1, #6
bl sub_08068148
bl update_cutscene_oam_data_id
lbl_08066ce0:
ldr r0, lbl_08066cf8 @ =0x00000231
bl SoundPlay
@ -36385,7 +36385,7 @@ sub_080673e0: @ 0x080673e0
beq lbl_0806741c
adds r0, r4, #0
movs r1, #3
bl sub_08068148
bl update_cutscene_oam_data_id
ldrb r1, [r4, #0xd]
movs r0, #0xfe
ands r0, r1
@ -37398,7 +37398,7 @@ lbl_08067ba2:
lsls r4, r4, #1
adds r0, r0, r4
movs r1, #1
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r1, [r7]
movs r0, #0xfe
lsls r0, r0, #1
@ -37767,7 +37767,7 @@ lbl_08067ee8: @ jump table
lbl_08067efc:
adds r0, r4, #0
movs r1, #2
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r0, lbl_08067f18 @ =0x00000253
bl SoundPlay
ldr r1, lbl_08067f1c @ =0x030013b0
@ -37911,7 +37911,7 @@ samus_in_blue_ship_init: @ 0x08067f90
ldr r0, [r4]
adds r0, #0xf0
movs r1, #1
bl sub_08068148
bl update_cutscene_oam_data_id
ldr r2, [r4]
adds r1, r2, #0
adds r1, #0xf2
@ -38041,8 +38041,8 @@ sub_08068128: @ 0x08068128
bx lr
.align 2, 0
thumb_func_start sub_08068148
sub_08068148: @ 0x08068148
thumb_func_start update_cutscene_oam_data_id
update_cutscene_oam_data_id: @ 0x08068148
lsls r1, r1, #0x18
lsrs r1, r1, #0x18
strb r1, [r0, #0xa]

View File

@ -13,7 +13,7 @@ u8 CutsceneEndFunction(void);
void CutsceneVBlank(void);
void CutsceneLoadingVBlank(void);
void CutsceneInit(void);
void unk_6141c(u32 value, u16 bg);
void unk_6141c(struct CutsceneUnk param_1);
void CutsceneSetBGCNT(u16 value, u16 bg);
void CutsceneUpdateBGPosition(u8 type, u16 bg, u16 value);
u16* CutsceneGetBGHOFSPointer(u16 bg);

View File

@ -0,0 +1,27 @@
#ifndef KRAID_RISING_CUTSCENE
#define KRAID_RISING_CUTSCENE
#include "types.h"
#include "structs/cutscene.h"
#define KRAID_RISING_OAM_ID_SAMUS 1
#define KRAID_RISING_OAM_ID_DEBRIS 2
#define KRAID_RISING_OAM_ID_SMALL_PUFF 3
#define KRAID_RISING_OAM_ID_BIG_PUFF 4
struct KraidRisingPuffData {
u16 xPosition;
u16 yPosition;
u8 oamID;
u16 timer;
};
u8 KraidRisingRising(void);
struct CutsceneOamData* KraidRisingUpdatePuff(struct CutsceneOamData* pOam, u8 puffID);
struct CutsceneOamData* KraidRisingUpdateDebris(struct CutsceneOamData* pOam, u8 debrisID);
u8 KraidRisingOpeningEyes(void);
u8 KraidRisingInit(void);
u8 KraidRisingSubroutine(void);
void KraidRisingProcessOAM(void);
#endif

View File

@ -0,0 +1,235 @@
#include "macros.h"
#include "types.h"
#include "cutscenes/kraid_rising.h"
#include "constants/cutscene.h"
#include "constants/event.h"
#include "structs/cutscene.h"
static const struct CutsceneInfo sCutsceneData[15] = {
[CUTSCENE_NONE] = {
.unk_0 = 0,
.type = 1,
.storyText = 0,
.pFunction = CutsceneDefaultRoutine,
.unk_8 = 4,
.fadingTimer = 0,
.bgFading = 2,
.event = EVENT_NONE
},
[CUTSCENE_INTRO_TEXT] = {
},
[CUTSCENE_MOTHERSHIP_MONOLOGUE] = {
},
[CUTSCENE_COULD_I_SURVIVE] = {
},
[CUTSCENE_MOTHER_BRAIN_CLOSE_UP] = {
},
[CUTSCENE_KRAID_RISING] = {
.unk_0 = 1,
.type = 0,
.storyText = 0,
.pFunction = KraidRisingSubroutine,
.unk_8 = 4,
.fadingTimer = 0,
.bgFading = 2,
.event = EVENT_NONE
},
[CUTSCENE_STATUE_OPENING] = {
},
[CUTSCENE_RIDLEY_IN_SPACE] = {
},
[CUTSCENE_RIDLEY_LANDING] = {
},
[CUTSCENE_RIDLEY_SPAWNING] = {
},
[CUTSCENE_ENTER_TOURIAN] = {
},
[CUTSCENE_BEFORE_CHARLIE] = {
},
[CUTSCENE_GETTING_FULLY_POWERED] = {
},
[CUTSCENE_MECHA_RIDLEY_SEES_SAMUS] = {
},
[CUTSCENE_SAMUS_IN_BLUE_SHIP] = {
}
};
// Kraid rising
static const struct CutsceneUnk sKraidRisingBehaviorData[4] = {
};
// More ...
static const struct OamArray sKraidRisingCutsceneOAM[5] = {
[0] = {
.pOam = sKraidRisingOAM_Samus,
.preAction = OAM_ARRAY_PRE_ACTION_NONE
},
[KRAID_RISING_OAM_ID_SAMUS] = {
.pOam = sKraidRisingOAM_Samus,
.preAction = OAM_ARRAY_PRE_ACTION_CHANGE_FRAME
},
[KRAID_RISING_OAM_ID_DEBRIS] = {
.pOam = sKraidRisingOAM_Debris,
.preAction = OAM_ARRAY_PRE_ACTION_LOOP_ON_LAST_FRAME
},
[KRAID_RISING_OAM_ID_SMALL_PUFF] = {
.pOam = sKraidRisingOAM_SmallPuff,
.preAction = OAM_ARRAY_PRE_ACTION_KILL_AFTER_END
},
[KRAID_RISING_OAM_ID_BIG_PUFF] = {
.pOam = sKraidRisingOAM_BigPuff,
.preAction = OAM_ARRAY_PRE_ACTION_KILL_AFTER_END
}
};
static const u16 sKraidRisingOAM_Samus_Frame0[4] = {
0x1,
0xd0, OBJ_SIZE_64x64 | 0x1e0, 0x0
};
static const u16 sKraidRisingOAM_Samus_Frame1[4] = {
0x1,
0xcf, OBJ_SIZE_64x64 | 0x1e0, 0x0
};
static const u16 sKraidRisingOAM_Debris_Frame0[4] = {
0x1,
0xf8, 0x1f8, 0x1008
};
static const u16 sKraidRisingOAM_Debris_Frame1[4] = {
0x1,
0xf8, 0x1f8, 0x1009
};
static const u16 sKraidRisingOAM_Debris_Frame2[4] = {
0x1,
0xf8, 0x1f8, 0x100a
};
static const u16 sKraidRisingOAM_Debris_Frame3[4] = {
0x1,
0xf8, 0x1f8, 0x100b
};
static const u16 sKraidRisingOAM_SmallPuff_Frame0[4] = {
0x1,
0xf8, OBJ_SIZE_16x16 | 0x1f8, 0x1028
};
static const u16 sKraidRisingOAM_SmallPuff_Frame1[4] = {
0x1,
0xf8, OBJ_SIZE_16x16 | 0x1f8, 0x102a
};
static const u16 sKraidRisingOAM_SmallPuff_Frame2[4] = {
0x1,
0xf8, OBJ_SIZE_16x16 | 0x1f8, 0x102c
};
static const u16 sKraidRisingOAM_SmallPuff_Frame3[4] = {
0x1,
0xf8, OBJ_SIZE_16x16 | 0x1f8, 0x102e
};
static const u16 sKraidRisingOAM_BigPuff_Frame0[4] = {
0x1,
0xf0, OBJ_SIZE_32x32 | 0x1f0, 0x1068
};
static const u16 sKraidRisingOAM_BigPuff_Frame1[4] = {
0x1,
0xf0, OBJ_SIZE_32x32 | 0x1f0, 0x106c
};
static const u16 sKraidRisingOAM_BigPuff_Frame2[4] = {
0x1,
0xf0, OBJ_SIZE_32x32 | 0x1f0, 0x1070
};
static const u16 sKraidRisingOAM_BigPuff_Frame3[4] = {
0x1,
0xf0, OBJ_SIZE_32x32 | 0x1f0, 0x1074
};
static const struct FrameData sKraidRisingOAM_Samus[3] = {
sKraidRisingOAM_Samus_Frame0,
4,
sKraidRisingOAM_Samus_Frame1,
4,
NULL,
0
};
static const struct FrameData sKraidRisingOAM_Debris[5] = {
sKraidRisingOAM_Debris_Frame0,
4,
sKraidRisingOAM_Debris_Frame1,
4,
sKraidRisingOAM_Debris_Frame2,
4,
sKraidRisingOAM_Debris_Frame3,
4,
NULL,
0
};
static const struct FrameData sKraidRisingOAM_SmallPuff[5] = {
sKraidRisingOAM_SmallPuff_Frame0,
4,
sKraidRisingOAM_SmallPuff_Frame1,
4,
sKraidRisingOAM_SmallPuff_Frame2,
4,
sKraidRisingOAM_SmallPuff_Frame3,
4,
NULL,
0
};
static const struct FrameData sKraidRisingOAM_BigPuff[5] = {
sKraidRisingOAM_BigPuff_Frame0,
4,
sKraidRisingOAM_BigPuff_Frame1,
4,
sKraidRisingOAM_BigPuff_Frame2,
4,
sKraidRisingOAM_BigPuff_Frame3,
4,
NULL,
0
};
static const u16 sKraidRisingCloseUpPAL[80] = INCBIN_U16("data/cutscenes/KraidRisingCloseUp.pal");
static const u16 sKraidRisingSamusPAL[16] = INCBIN_U16("data/cutscenes/KraidRisingSamus.pal");
static const u16 sKraidRisingParticlesPAL[16] = INCBIN_U16("data/cutscenes/KraidRisingParticles.pal");
static const u16 sKraidRisingSamusVaria[16] = INCBIN_U16("data/cutscenes/KraidRisingSamusVaria.pal");
static const u16 sKraidRisingRisingPAL[80] = INCBIN_U16("data/cutscenes/KraidRisingRising.pal");
static const u8 sKraidRisingKraidCloseUpGFX[12348] = INCBIN_U8("data/cutscenes/KraidRisingCloseUp.gfx.lz");
static const u8 sKraidRisingOAMGFX[3012] = INCBIN_U8("data/cutscenes/KraidRisingOAM.gfx.lz");
static const u8 sKraidRisingKraidRisingGFX[6436] = INCBIN_U8("data/cutscenes/KraidRisingKraidRising.gfx.lz");
static const u8 sKraidRisingCaveBackroundGFX[5308] = INCBIN_U8("data/cutscenes/KraidRisingCaveBackround.gfx.lz");
static const u8 sKraidRisingKraidCloseUpEyesClosedTileTable[1472] = INCBIN_U8("data/cutscenes/KraidRisingKraidCloseUpEyesClosed.tt");
static const u8 sKraidRisingKraidCloseUpEyesBarelyOpenedTileTable[1472] = INCBIN_U8("data/cutscenes/KraidRisingKraidCloseUpEyesBarelyOpened.tt");
static const u8 sKraidRisingKraidCloseUpEyesALittleOpenedTileTable[1472] = INCBIN_U8("data/cutscenes/KraidRisingKraidCloseUpEyesALittleOpened.tt");
static const u8 sKraidRisingKraidCloseUpEyesOpenedTileTable[1472] = INCBIN_U8("data/cutscenes/KraidRisingKraidCloseUpEyesOpened.tt");
static const u8 sKraidRisingKraidRisingTileTable[1180] = INCBIN_U8("data/cutscenes/KraidRisingKraidRising.tt");
static const u8 sKraidRisingCaveBackgroundTileTable[1180] = INCBIN_U8("data/cutscenes/KraidRisingCaveBackground.tt");

View File

@ -0,0 +1,103 @@
#include "types.h"
#include "cutscenes/cutscene_utils.h"
#include "cutscenes/kraid_rising.h"
#include "structs/cutscene.h"
// 75fe5c
static const struct KraidRisingPuffData sKraidRisingPuffData[11] = {
{
.xPosition = BLOCK_SIZE,
.yPosition = BLOCK_SIZE * 7,
.oamID = KRAID_RISING_OAM_ID_SMALL_PUFF,
.timer = 1
},
{
.xPosition = HALF_BLOCK_SIZE,
.yPosition = BLOCK_SIZE * 9 + HALF_BLOCK_SIZE,
.oamID = KRAID_RISING_OAM_ID_SMALL_PUFF,
.timer = 3
},
{
.xPosition = BLOCK_SIZE * 2 + HALF_BLOCK_SIZE,
.yPosition = BLOCK_SIZE * 9,
.oamID = KRAID_RISING_OAM_ID_BIG_PUFF,
.timer = 8
},
{
.xPosition = BLOCK_SIZE * 3 + HALF_BLOCK_SIZE,
.yPosition = BLOCK_SIZE * 7 + HALF_BLOCK_SIZE,
.oamID = KRAID_RISING_OAM_ID_SMALL_PUFF,
.timer = 5
},
{
.xPosition = BLOCK_SIZE * 5,
.yPosition = BLOCK_SIZE * 8 + HALF_BLOCK_SIZE,
.oamID = KRAID_RISING_OAM_ID_BIG_PUFF,
.timer = 7
},
{
.xPosition = BLOCK_SIZE * 9,
.yPosition = BLOCK_SIZE * 7 + HALF_BLOCK_SIZE,
.oamID = KRAID_RISING_OAM_ID_SMALL_PUFF,
.timer = 7
},
{
.xPosition = BLOCK_SIZE * 10 + HALF_BLOCK_SIZE,
.yPosition = BLOCK_SIZE * 9,
.oamID = KRAID_RISING_OAM_ID_BIG_PUFF,
.timer = 10
},
{
.xPosition = BLOCK_SIZE * 11 + HALF_BLOCK_SIZE,
.yPosition = BLOCK_SIZE * 7,
.oamID = KRAID_RISING_OAM_ID_SMALL_PUFF,
.timer = 6
},
{
.xPosition = BLOCK_SIZE * 13,
.yPosition = BLOCK_SIZE * 8 + HALF_BLOCK_SIZE,
.oamID = KRAID_RISING_OAM_ID_BIG_PUFF,
.timer = 12
},
{
.xPosition = BLOCK_SIZE * 14 + HALF_BLOCK_SIZE,
.yPosition = BLOCK_SIZE * 7 + HALF_BLOCK_SIZE,
.oamID = KRAID_RISING_OAM_ID_SMALL_PUFF,
.timer = 4
},
{
.xPosition = BLOCK_SIZE * 14 + HALF_BLOCK_SIZE,
.yPosition = BLOCK_SIZE * 9 + HALF_BLOCK_SIZE,
.oamID = KRAID_RISING_OAM_ID_SMALL_PUFF,
.timer = 2
}
};
static const u16 sKraidRisingDebrisSpawnXPosition[6] = {
BLOCK_SIZE + HALF_BLOCK_SIZE, BLOCK_SIZE * 3 + HALF_BLOCK_SIZE,
BLOCK_SIZE * 5 + HALF_BLOCK_SIZE, BLOCK_SIZE * 9, BLOCK_SIZE * 11,
BLOCK_SIZE * 13 + HALF_BLOCK_SIZE
};
static const struct CutsceneSubroutineData sKraidRisingSubroutineData[4] = {
{
.pFunction = KraidRisingInit,
.oamLength = 12
},
{
.pFunction = KraidRisingOpeningEyes,
.oamLength = 18
},
{
.pFunction = KraidRisingRising,
.oamLength = 18
},
{
.pFunction = CutsceneEndFunction,
.oamLength = 18
}
};
// 75fee0

View File

@ -1,12 +1,12 @@
#ifndef GBA_MEMORY_H
#define GBA_MEMORY_H
#define IWRAM_BASE (void *)0x02000000
#define IWRAM_SIZE (32 * 0x400)
#define EWRAM_BASE (void *)0x03000000
#define EWRAM_BASE (void *)0x02000000
#define EWRAM_SIZE (256 * 0x400)
#define IWRAM_BASE (void *)0x03000000
#define IWRAM_SIZE (32 * 0x400)
#define REG_BASE (void *)0x04000000
#define PALRAM_BASE (void *)0x05000000

View File

@ -2,6 +2,34 @@
#define CUTSCENE_STRUCT_H
#include "types.h"
#include "oam.h"
// Temp place
struct OamArray {
const struct FrameData* pOam;
u8 preAction;
};
#define OAM_ARRAY_PRE_ACTION_NONE 0
#define OAM_ARRAY_PRE_ACTION_CHANGE_FRAME 1
#define OAM_ARRAY_PRE_ACTION_RESET_FRAME 2
#define OAM_ARRAY_PRE_ACTION_LOOP_ON_LAST_FRAME 3
#define OAM_ARRAY_PRE_ACTION_KILL_AFTER_END 4
#define OAM_ARRAY_PRE_ACTION_INCREMENT_ID_AFTER_END 5
#define OAM_ARRAY_PRE_ACTION_DECREMENT_ID_AFTER_END 7
#define OAM_ARRAY_PRE_ACTION_SWITCH_TO_PREVIOUS_FRAME 8
#define OAM_ARRAY_PRE_ACTION_DECREMENT_ID_AT_BEGINNING 9
struct CutsceneUnk {
u8 unk_0;
u8 dstPage;
u8 unk_2;
u8 unk_3;
u16 bg;
u8 unk_6;
u8 unk_7;
};
struct CutsceneInfo {
u8 unk_0;
@ -60,8 +88,8 @@ struct CutsceneSpecialEffect {
};
struct CutsceneOamData {
u16 yPosition;
u16 xPosition;
i16 yPosition;
i16 xPosition;
u8 unk_2;
u8 padding_5[3];
u8 animationDurationCounter;
@ -115,7 +143,7 @@ struct CutsceneData {
u8 unk_BD;
u8 unk_BE;
u8 unk_BF;
struct CutsceneGraphicsData graphicsData2;
struct CutsceneGraphicsData graphicsData2[3];
struct CutsceneOamData oam[30];
};

View File

@ -1,13 +1,20 @@
#ifndef TEMP_GLOBALS_H
#define TEMP_GLOBALS_H
#include "gba.h"
#include "types.h"
#include "structs/cutscene.h"
union NonGameplayRAM {
struct CutsceneData cutscene;
u8 inGame[640];
};
extern u16 unk_02035400;
extern u8 gUnk_03004fc9;
extern u8 gNonGameplayRAM[640]; // Weird type, subject to change
extern union NonGameplayRAM gNonGameplayRAM;
extern u16 gWrittenToBLDALPHA_H;
extern u16 gWrittenToBLDALPHA_L;
@ -22,8 +29,9 @@ extern u16 gBG2VOFS_NonGameplay;
extern u16 gBG3HOFS_NonGameplay;
extern u16 gBG3VOFS_NonGameplay;
union NonGameplayRAM {
struct CutsceneData cutscene;
void* const sMemoryPointers[] = {
EWRAM_BASE
};
union NonGameplayRAM* const sNonGameplayRAMPointer;

View File

@ -0,0 +1,200 @@
#include "oam.h"
#include "temp_globals.h"
#include "cutscenes/kraid_rising.h"
#include "data/cutscenes/cutscenes_data.h"
#include "data/cutscenes/kraid_rising.h"
#include "data/generic_data.h"
#include "constants/audio.h"
#include "constants/cutscene.h"
#include "structs/game_state.h"
u8 KraidRisingRising(void)
{
}
/**
* @brief 626f8 | 54 | Updates a puff
*
* @param pOam Cutscene OAM Data Pointer
* @param puffID Puff ID
* @return struct CutsceneOamData* First param
*/
struct CutsceneOamData* KraidRisingUpdatePuff(struct CutsceneOamData* pOam, u8 puffID)
{
u8* data;
i32 offset;
if (!(pOam->status & 0xC0))
{
if (pOam->timer != 0)
pOam->timer--;
else
{
// Update timer
pOam->timer = (sRandomNumberTable[gFrameCounter8Bit + puffID] & 0xF) + 1;
// Why
data = (u8*)(sKraidRisingPuffData);
offset = puffID * 8;
// OAM ID field
data += 4;
// Reset animation
update_cutscene_oam_data_id(pOam, data[offset]); // Undefined
}
}
// Implicit return
}
/**
* @brief 6274c | c0 | Updates a debris
*
* @param pOam Cutscene OAM Data Pointer
* @param puffID Debris ID
* @return struct CutsceneOamData* First param
*/
struct CutsceneOamData* KraidRisingUpdateDebris(struct CutsceneOamData* pOam, u8 debrisID)
{
if (pOam->timer != 0)
pOam->timer--;
else
{
if (!(pOam->status & 0xC0))
{
// Set spawn X (base + [0-0x3F])
pOam->xPosition = sKraidRisingDebrisSpawnXPosition[debrisID] + (sRandomNumberTable[~((gFrameCounter8Bit + debrisID) & 0xFF)] & 0x3F);
// Start above ceiling
pOam->yPosition = -HALF_BLOCK_SIZE;
// Set random velocity
pOam->unk_10 = ((gFrameCounter8Bit + debrisID) & ((debrisID & 1) + 3)) - 2;
pOam->unk_18 = 0;
// Reset anim
update_cutscene_oam_data_id(pOam, KRAID_RISING_OAM_ID_DEBRIS);
}
else
{
// Gradually increment velocity
if (pOam->unk_10 < 32)
pOam->unk_10++;
// Apply velocity
pOam->yPosition += pOam->unk_10;
if (pOam->yPosition > 0x2DF)
{
pOam->status &= 0x3F;
// Set random timer
pOam->timer = (sRandomNumberTable[(gFrameCounter8Bit + debrisID) & 0xFF] & 0xF) + 1;
}
}
}
}
u8 KraidRisingOpeningEyes(void)
{
// https://decomp.me/scratch/uSyVv
switch (CUTSCENE_DATA.subStage)
{
case 0:
if (CUTSCENE_DATA.timer > 8)
{
CutsceneStartSpriteEffect(CUTSCENE_DATA.bldcnt, 0, 0, 16);
CUTSCENE_DATA.subStage++;
CUTSCENE_DATA.timer = 0;
}
break;
case 1:
if (CUTSCENE_DATA.timer > 0x1E)
{
SoundPlay(0x22C);
DMATransfer(3, sMemoryPointers[0] + 0x1000, VRAM_BASE + sKraidRisingBehaviorData[1].dstPage * 0x800, 0x800, 0x10);
unk_6141c(sKraidRisingBehaviorData[1]);
CUTSCENE_DATA.subStage++;
CUTSCENE_DATA.timer = 0;
}
break;
case 2:
if (CUTSCENE_DATA.timer > 6)
{
DMATransfer(3, sMemoryPointers[0] + 0x1800, VRAM_BASE + sKraidRisingBehaviorData[0].dstPage * 0x800, 0x800, 0x10);
unk_6141c(sKraidRisingBehaviorData[0]);
CUTSCENE_DATA.subStage++;
CUTSCENE_DATA.timer = 0;
}
break;
case 3:
if (CUTSCENE_DATA.timer > 6)
{
MusicPlay(MUSIC_KRAID_BATTLE_WITH_INTRO, 0);
DMATransfer(3, sMemoryPointers[0] + 0x2000, VRAM_BASE + sKraidRisingBehaviorData[1].dstPage * 0x800, 0x800, 0x10);
unk_6141c(sKraidRisingBehaviorData[1]);
CUTSCENE_DATA.subStage++;
CUTSCENE_DATA.timer = 0;
}
break;
case 4:
if (CUTSCENE_DATA.timer > 0x3C)
CUTSCENE_DATA.subStage++;
break;
case 5:
unk_61f0c();
CUTSCENE_DATA.stage++;
CUTSCENE_DATA.subStage = 0;
CUTSCENE_DATA.timer = 0;
break;
}
return FALSE;
}
u8 KraidRisingInit(void)
{
}
/**
* @brief 62b24 | 37 | Kraid rising cutscene subroutine
*
* @return u8 1 if ended, 0 otherwise
*/
u8 KraidRisingSubroutine(void)
{
u8 ended;
ended = sKraidRisingSubroutineData[CUTSCENE_DATA.stage].pFunction();
CutsceneUpdateBackgroundsPosition(TRUE);
KraidRisingProcessOAM();
return ended;
}
/**
* @brief 62b58 | 38 | Processes the OAM for the cutscene
*
*/
void KraidRisingProcessOAM(void)
{
gNextOAMSlot = 0;
process_cutscene_oam(sKraidRisingSubroutineData[CUTSCENE_DATA.stage].oamLength, CUTSCENE_DATA.oam, sKraidRisingCutsceneOAM); // Undefined
ResetFreeOAM();
}

View File

@ -17,8 +17,8 @@ void InitializeGame(void)
write16(REG_IME, 0);
write16(REG_DISPSTAT, 0);
dma_fill32(3, 0, IWRAM_BASE, 0x40000);
dma_fill32(3, 0, EWRAM_BASE, 0x7e00);
dma_fill32(3, 0, EWRAM_BASE, 0x40000);
dma_fill32(3, 0, IWRAM_BASE, 0x7e00);
ClearGFXRAM();
LoadInterruptCode();

View File

@ -228,7 +228,7 @@ void PowerBombExplosionBegin(void)
{
gCurrentPowerBomb.animationState = 0x3;
gCurrentPowerBomb.powerBombPlaced = FALSE;
dma_set(3, PALRAM_BASE, IWRAM_BASE + (0x9000), DMA_ENABLE << 0x10 | 0x100);
dma_set(3, PALRAM_BASE, EWRAM_BASE + (0x9000), DMA_ENABLE << 0x10 | 0x100);
unk_02035400 = 0x0;
// TODO defines
SetupHazeCode(0x7); // Undefined | Power bomb expanding

View File

@ -38,8 +38,8 @@ void Softreset(void)
write16(REG_BLDY, 0x10);
write16(REG_BLDCNT, 0xff);
dma_fill32(3, 0, IWRAM_BASE, 0x40000);
dma_fill32(3, 0, EWRAM_BASE, 0x7e00);
dma_fill32(3, 0, EWRAM_BASE, 0x40000);
dma_fill32(3, 0, IWRAM_BASE, 0x7e00);
ClearGFXRAM();
LoadInterruptCode();

View File

@ -88,7 +88,7 @@ def ParsePart2(value):
return result
file = open("../baserom_us.gba", "rb")
file = open("../mzm_us_baserom.gba", "rb")
def Func():
inputValue = input("Address : ")