mirror of https://github.com/zeldaret/mm.git
Transition table (#1210)
* transition_table.h * format * Update include/tables/transition_table.h Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * review * review * bss --------- Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
parent
fc3da8451a
commit
eaf682dc05
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef _INITVARS_H_
|
||||
#define _INITVARS_H_
|
||||
|
||||
extern TransitionInit TransitionFade_InitVars;
|
||||
extern TransitionInit TransitionTriforce_InitVars;
|
||||
extern TransitionInit TransitionWipe1_InitVars;
|
||||
extern TransitionInit TransitionWipe3_InitVars;
|
||||
extern TransitionInit TransitionWipe4_InitVars;
|
||||
extern TransitionInit TransitionCircle_InitVars;
|
||||
extern TransitionInit TransitionWipe5_InitVars;
|
||||
|
||||
#endif
|
||||
|
|
@ -88,12 +88,6 @@ DECLARE_OVERLAY_SEGMENT(player_actor)
|
|||
#undef DEFINE_ACTOR_INTERNAL
|
||||
#undef DEFINE_ACTOR_UNSET
|
||||
|
||||
DECLARE_OVERLAY_SEGMENT(fbdemo_triforce)
|
||||
DECLARE_OVERLAY_SEGMENT(fbdemo_wipe1)
|
||||
DECLARE_OVERLAY_SEGMENT(fbdemo_wipe3)
|
||||
DECLARE_OVERLAY_SEGMENT(fbdemo_wipe4)
|
||||
DECLARE_OVERLAY_SEGMENT(fbdemo_wipe5)
|
||||
|
||||
#define DEFINE_OBJECT(name, _enumValue) DECLARE_ROM_SEGMENT(name)
|
||||
#define DEFINE_OBJECT_UNSET(_enumValue)
|
||||
#define DEFINE_OBJECT_SIZE_ZERO(_name, _enumValue)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
* Transition Table
|
||||
*
|
||||
* DEFINE_TRANSITION should be used for normal transitions
|
||||
* - Argument 0: Enum value for this transition
|
||||
* - Argument 1: Name of the effect struct
|
||||
* - Argument 2: Instance name
|
||||
* - Argument 3: Name of the effect (without the ovl_ part)
|
||||
*
|
||||
* DEFINE_TRANSITION_INTERNAL should be used for transitions that aren't an overlay
|
||||
* - Argument 0: Enum value for this transition
|
||||
* - Argument 1: Name of the effect struct
|
||||
* - Argument 2: Instance name
|
||||
*/
|
||||
/* 0 */ DEFINE_TRANSITION_INTERNAL(FBDEMO_FADE, TransitionFade, fade)
|
||||
/* 1 */ DEFINE_TRANSITION(FBDEMO_TRIFORCE, TransitionTriforce, triforce, fbdemo_triforce)
|
||||
/* 2 */ DEFINE_TRANSITION(FBDEMO_WIPE1, TransitionWipe1, wipe1, fbdemo_wipe1)
|
||||
/* 3 */ DEFINE_TRANSITION(FBDEMO_WIPE3, TransitionWipe3, wipe3, fbdemo_wipe3)
|
||||
/* 4 */ DEFINE_TRANSITION(FBDEMO_WIPE4, TransitionWipe4, wipe4, fbdemo_wipe4)
|
||||
/* 5 */ DEFINE_TRANSITION_INTERNAL(FBDEMO_CIRCLE, TransitionCircle, circle)
|
||||
/* 6 */ DEFINE_TRANSITION(FBDEMO_WIPE5, TransitionWipe5, wipe5, fbdemo_wipe5)
|
||||
|
|
@ -746,7 +746,6 @@ extern char D_801D039C[];
|
|||
extern KaleidoMgrOverlay gKaleidoMgrOverlayTable[2];
|
||||
// extern UNK_TYPE1 D_801D0B8C;
|
||||
extern KaleidoMgrOverlay* gKaleidoMgrCurOvl;
|
||||
// extern UNK_TYPE4 D_801D0BB0;
|
||||
// extern UNK_TYPE1 D_801D0C80;
|
||||
// extern UNK_TYPE1 D_801D0CB0;
|
||||
extern s32 gDbgCamEnabled;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define Z64TRANSITION_H
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "libc/stdint.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_wipe1/z_fbdemo_wipe1.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_wipe3/z_fbdemo_wipe3.h"
|
||||
|
|
@ -164,31 +165,34 @@ typedef enum {
|
|||
/* 86 */ TRANS_TYPE_86 = 86
|
||||
} TransitionType;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ FBDEMO_FADE,
|
||||
/* 1 */ FBDEMO_TRIFORCE,
|
||||
/* 2 */ FBDEMO_WIPE1,
|
||||
/* 3 */ FBDEMO_WIPE3,
|
||||
/* 4 */ FBDEMO_WIPE4,
|
||||
/* 5 */ FBDEMO_CIRCLE,
|
||||
/* 6 */ FBDEMO_WIPE5
|
||||
#define DEFINE_TRANSITION(enumValue, _structName, _instanceName, _name) enumValue,
|
||||
#define DEFINE_TRANSITION_INTERNAL(enumValue, _structName, _instanceName) enumValue,
|
||||
|
||||
typedef enum FbDemoType {
|
||||
#include "tables/transition_table.h"
|
||||
/* 7 */ FBDEMO_MAX
|
||||
} FbDemoType;
|
||||
|
||||
#undef DEFINE_TRANSITION
|
||||
#undef DEFINE_TRANSITION_INTERNAL
|
||||
|
||||
#define TRANS_NEXT_TYPE_DEFAULT 0xFF
|
||||
|
||||
#define DEFINE_TRANSITION(_enumValue, structName, instanceName, _name) structName instanceName;
|
||||
#define DEFINE_TRANSITION_INTERNAL(_enumValue, structName, instanceName) structName instanceName;
|
||||
|
||||
typedef union TransitionInstance {
|
||||
#include "tables/transition_table.h"
|
||||
} TransitionInstance; // size = 0x218
|
||||
|
||||
#undef DEFINE_TRANSITION
|
||||
#undef DEFINE_TRANSITION_INTERNAL
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ s16 transitionType;
|
||||
/* 0x002 */ s8 fbdemoType;
|
||||
/* 0x003 */ char unk_003[0x5];
|
||||
/* 0x008 */ union {
|
||||
TransitionFade fade;
|
||||
TransitionCircle circle;
|
||||
TransitionTriforce triforce;
|
||||
TransitionWipe1 wipe1;
|
||||
TransitionWipe3 wipe3;
|
||||
TransitionWipe4 wipe4;
|
||||
TransitionWipe5 wipe5;
|
||||
} instanceData;
|
||||
/* 0x008 */ TransitionInstance instanceData;
|
||||
/* 0x220 */ char unk_220[0x10];
|
||||
/* 0x230 */ void* (*init)(void* transition);
|
||||
/* 0x234 */ void (*destroy)(void* transition);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "stackcheck.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,30 +1,38 @@
|
|||
#include "global.h"
|
||||
#include "initvars.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_triforce/z_fbdemo_triforce.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_wipe1/z_fbdemo_wipe1.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_wipe3/z_fbdemo_wipe3.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_wipe4/z_fbdemo_wipe4.h"
|
||||
#include "overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.h"
|
||||
|
||||
#define TRANSITION_OVERLAY(name, filename) \
|
||||
{ \
|
||||
{ 0, 0 }, SEGMENT_START(ovl_##filename), SEGMENT_END(ovl_##filename), SEGMENT_ROM_START(ovl_##filename), \
|
||||
SEGMENT_ROM_END(ovl_##filename), &name##_InitVars, sizeof(name) \
|
||||
}
|
||||
// InitVars and Linker symbol declarations (used in the table below)
|
||||
#define DEFINE_TRANSITION(_enumValue, structName, _instanceName, name) \
|
||||
extern TransitionInit structName##_InitVars; \
|
||||
DECLARE_OVERLAY_SEGMENT(name)
|
||||
|
||||
#define TRANSITION_OVERLAY_INTERNAL(name) \
|
||||
{ { 0, 0 }, NULL, NULL, 0, 0, &name##_InitVars, sizeof(name) }
|
||||
#define DEFINE_TRANSITION_INTERNAL(_enumValue, structName, _instanceName) extern TransitionInit structName##_InitVars;
|
||||
|
||||
#define TRANSITION_OVERLAY_UNSET \
|
||||
{ 0 }
|
||||
#include "tables/transition_table.h"
|
||||
|
||||
#undef DEFINE_TRANSITION
|
||||
#undef DEFINE_TRANSITION_INTERNAL
|
||||
|
||||
#define DEFINE_TRANSITION(_enumValue, structName, _instanceName, name) \
|
||||
{ \
|
||||
{ 0, 0 }, \
|
||||
SEGMENT_START(ovl_##name), \
|
||||
SEGMENT_END(ovl_##name), \
|
||||
SEGMENT_ROM_START(ovl_##name), \
|
||||
SEGMENT_ROM_END(ovl_##name), \
|
||||
&structName##_InitVars, \
|
||||
sizeof(structName), \
|
||||
},
|
||||
|
||||
#define DEFINE_TRANSITION_INTERNAL(_enumValue, structName, _instanceName) \
|
||||
{ { 0, 0 }, NULL, NULL, 0, 0, &structName##_InitVars, sizeof(structName) },
|
||||
|
||||
TransitionOverlay gTransitionOverlayTable[] = {
|
||||
TRANSITION_OVERLAY_INTERNAL(TransitionFade), TRANSITION_OVERLAY(TransitionTriforce, fbdemo_triforce),
|
||||
TRANSITION_OVERLAY(TransitionWipe1, fbdemo_wipe1), TRANSITION_OVERLAY(TransitionWipe3, fbdemo_wipe3),
|
||||
TRANSITION_OVERLAY(TransitionWipe4, fbdemo_wipe4), TRANSITION_OVERLAY_INTERNAL(TransitionCircle),
|
||||
TRANSITION_OVERLAY(TransitionWipe5, fbdemo_wipe5),
|
||||
#include "tables/transition_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_TRANSITION
|
||||
#undef DEFINE_TRANSITION_INTERNAL
|
||||
|
||||
void Transition_Init(TransitionContext* transitionCtx) {
|
||||
TransitionOverlay* overlayEntry;
|
||||
ptrdiff_t relocOffset;
|
||||
|
|
|
|||
|
|
@ -2126,7 +2126,7 @@
|
|||
0x801D0B70:("gKaleidoMgrOverlayTable","KaleidoMgrOverlay","",0x38),
|
||||
0x801D0BA8:("sKaleidoAreaPtr","void*","",0x4),
|
||||
0x801D0BAC:("gKaleidoMgrCurOvl","KaleidoMgrOverlay*","",0x4),
|
||||
0x801D0BB0:("D_801D0BB0","UNK_TYPE4","",0x4),
|
||||
0x801D0BB0:("gTransitionOverlayTable","UNK_TYPE4","",0x4),
|
||||
0x801D0C80:("D_801D0C80","UNK_TYPE1","",0x1),
|
||||
0x801D0CB0:("D_801D0CB0","UNK_TYPE1","",0x1),
|
||||
0x801D0CD8:("TransitionFade_InitVars","UNK_PTR","",0x4),
|
||||
|
|
|
|||
Loading…
Reference in New Issue