mirror of https://github.com/zeldaret/mm.git
ovl_fbdemo_wipe5 OK (#1015)
* ovl_fbdemo_wipe5 OK * format * add trailing newline * bring over gbi.h * review Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * format * review Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * minor clenaups * review Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * Update src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: Chloe <> Co-authored-by: angie <angheloalf95@gmail.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
This commit is contained in:
parent
6842a065f0
commit
f8c167384e
|
|
@ -2599,11 +2599,11 @@ _DW({ \
|
||||||
gsSPLoadUcodeEx((uc_start), (uc_dstart), SP_UCODE_DATA_SIZE)
|
gsSPLoadUcodeEx((uc_start), (uc_dstart), SP_UCODE_DATA_SIZE)
|
||||||
|
|
||||||
#define gSPLoadUcodeL(pkt, ucode) \
|
#define gSPLoadUcodeL(pkt, ucode) \
|
||||||
gSPLoadUcode((pkt), OS_K0_TO_PHYSICAL(&##ucode##TextStart), \
|
gSPLoadUcode((pkt), OS_K0_TO_PHYSICAL(&ucode##TextStart), \
|
||||||
OS_K0_TO_PHYSICAL(&##ucode##DataStart))
|
OS_K0_TO_PHYSICAL(&ucode##DataStart))
|
||||||
#define gsSPLoadUcodeL(ucode) \
|
#define gsSPLoadUcodeL(ucode) \
|
||||||
gsSPLoadUcode(OS_K0_TO_PHYSICAL(&##ucode##TextStart), \
|
gsSPLoadUcode(OS_K0_TO_PHYSICAL(&ucode##TextStart), \
|
||||||
OS_K0_TO_PHYSICAL(&##ucode##DataStart))
|
OS_K0_TO_PHYSICAL(&ucode##DataStart))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef F3DEX_GBI_2
|
#ifdef F3DEX_GBI_2
|
||||||
|
|
|
||||||
|
|
@ -51,4 +51,6 @@ typedef union {
|
||||||
u16 rgba;
|
u16 rgba;
|
||||||
} Color_RGBA16;
|
} Color_RGBA16;
|
||||||
|
|
||||||
|
#define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -2168,7 +2168,7 @@ void func_80140E80(void* param_1);
|
||||||
// void func_80140EA0(void);
|
// void func_80140EA0(void);
|
||||||
// void func_80140EAC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
// void func_80140EAC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
||||||
// void func_80141008(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10);
|
// void func_80141008(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10);
|
||||||
// void func_8014116C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
void func_8014116C(Gfx** gfxP, u16* arg1, u16* arg2, s32 width, s32 height, s32 arg5);
|
||||||
// void func_801411B4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10);
|
// void func_801411B4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10);
|
||||||
// void func_80141200(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
// void func_80141200(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
||||||
// void func_8014151C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
// void func_8014151C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
#include "ultra64/rdp.h"
|
#include "ultra64/rdp.h"
|
||||||
#include "ultra64/rsp.h"
|
#include "ultra64/rsp.h"
|
||||||
#include "ultra64/r4300.h"
|
#include "ultra64/r4300.h"
|
||||||
|
#include "ultra64/ucode.h"
|
||||||
#include "ultra64/vi.h"
|
#include "ultra64/vi.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
#ifndef ULTRA64_UCODE_H
|
||||||
|
#define ULTRA64_UCODE_H
|
||||||
|
|
||||||
|
#include "PR/ultratypes.h"
|
||||||
|
|
||||||
|
#define SP_DRAM_STACK_SIZE8 0x400
|
||||||
|
#define SP_DRAM_STACK_SIZE64 (SP_DRAM_STACK_SIZE8 >> 3)
|
||||||
|
|
||||||
|
#define SP_UCODE_SIZE 0x1000
|
||||||
|
|
||||||
|
#define SP_UCODE_DATA_SIZE 0x800
|
||||||
|
|
||||||
|
extern u64 rspbootTextStart[];
|
||||||
|
extern u64 rspbootTextEnd[];
|
||||||
|
|
||||||
|
extern u64 aspMainTextStart[];
|
||||||
|
extern u64 aspMainTextEnd[];
|
||||||
|
extern u64 aspMainDataStart[];
|
||||||
|
extern u64 aspMainDataEnd[];
|
||||||
|
|
||||||
|
extern u64 gspF3DZEX2_NoN_PosLight_fifoTextStart[];
|
||||||
|
extern u64 gspF3DZEX2_NoN_PosLight_fifoTextEnd[];
|
||||||
|
extern u64 gspF3DZEX2_NoN_PosLight_fifoDataStart[];
|
||||||
|
extern u64 gspF3DZEX2_NoN_PosLight_fifoDataEnd[];
|
||||||
|
|
||||||
|
extern u64 gspS2DEX2_fifoTextStart[];
|
||||||
|
extern u64 gspS2DEX2_fifoTextEnd[];
|
||||||
|
extern u64 gspS2DEX2_fifoDataStart[];
|
||||||
|
extern u64 gspS2DEX2_fifoDataEnd[];
|
||||||
|
|
||||||
|
#endif
|
||||||
3
spec
3
spec
|
|
@ -3237,8 +3237,7 @@ beginseg
|
||||||
name "ovl_fbdemo_wipe5"
|
name "ovl_fbdemo_wipe5"
|
||||||
compress
|
compress
|
||||||
include "build/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.o"
|
include "build/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.o"
|
||||||
include "build/data/ovl_fbdemo_wipe5/ovl_fbdemo_wipe5.data.o"
|
include "build/src/overlays/fbdemos/ovl_fbdemo_wipe5/ovl_fbdemo_wipe5_reloc.o"
|
||||||
include "build/data/ovl_fbdemo_wipe5/ovl_fbdemo_wipe5.reloc.o"
|
|
||||||
endseg
|
endseg
|
||||||
|
|
||||||
beginseg
|
beginseg
|
||||||
|
|
|
||||||
|
|
@ -174,8 +174,8 @@ retry:
|
||||||
task->ucodeBootSize = SysUcode_GetUCodeBootSize();
|
task->ucodeBootSize = SysUcode_GetUCodeBootSize();
|
||||||
task->ucode = SysUcode_GetUCode();
|
task->ucode = SysUcode_GetUCode();
|
||||||
task->ucodeData = SysUcode_GetUCodeData();
|
task->ucodeData = SysUcode_GetUCodeData();
|
||||||
task->ucodeSize = 0x1000;
|
task->ucodeSize = SP_UCODE_SIZE;
|
||||||
task->ucodeDataSize = 0x800;
|
task->ucodeDataSize = SP_UCODE_DATA_SIZE;
|
||||||
task->dramStack = (u64*)gGfxSPTaskStack;
|
task->dramStack = (u64*)gGfxSPTaskStack;
|
||||||
task->dramStackSize = sizeof(gGfxSPTaskStack);
|
task->dramStackSize = sizeof(gGfxSPTaskStack);
|
||||||
task->outputBuff = gGfxSPTaskOutputBufferPtr;
|
task->outputBuff = gGfxSPTaskOutputBufferPtr;
|
||||||
|
|
|
||||||
|
|
@ -24,22 +24,22 @@ extern u64 njpgdspMainDataStart[];
|
||||||
*/
|
*/
|
||||||
void Jpeg_ScheduleDecoderTask(JpegContext* jpegCtx) {
|
void Jpeg_ScheduleDecoderTask(JpegContext* jpegCtx) {
|
||||||
static OSTask_t sJpegTask = {
|
static OSTask_t sJpegTask = {
|
||||||
M_NJPEGTASK, // type
|
M_NJPEGTASK, // type
|
||||||
0, // flags
|
0, // flags
|
||||||
NULL, // ucode_boot
|
NULL, // ucode_boot
|
||||||
0, // ucode_boot_size
|
0, // ucode_boot_size
|
||||||
njpgdspMainTextStart, // ucode
|
njpgdspMainTextStart, // ucode
|
||||||
0x1000, // ucode_size
|
SP_UCODE_SIZE, // ucode_size
|
||||||
njpgdspMainDataStart, // ucode_data
|
njpgdspMainDataStart, // ucode_data
|
||||||
0x800, // ucode_data_size
|
SP_UCODE_DATA_SIZE, // ucode_data_size
|
||||||
NULL, // dram_stack
|
NULL, // dram_stack
|
||||||
0, // dram_stack_size
|
0, // dram_stack_size
|
||||||
NULL, // output_buff
|
NULL, // output_buff
|
||||||
NULL, // output_buff_size
|
NULL, // output_buff_size
|
||||||
NULL, // data_ptr
|
NULL, // data_ptr
|
||||||
sizeof(JpegTaskData), // data_size
|
sizeof(JpegTaskData), // data_size
|
||||||
NULL, // yield_data_ptr
|
NULL, // yield_data_ptr
|
||||||
0x200, // yield_data_size
|
sizeof(jpegCtx->workBuf->yieldData), // yield_data_size
|
||||||
};
|
};
|
||||||
|
|
||||||
JpegWork* workBuf = jpegCtx->workBuf;
|
JpegWork* workBuf = jpegCtx->workBuf;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include "z_fbdemo_wipe5.h"
|
#include "z_fbdemo_wipe5.h"
|
||||||
|
|
||||||
|
#define THIS ((TransitionWipe5*)thisx)
|
||||||
|
|
||||||
void* TransitionWipe5_Init(void* thisx);
|
void* TransitionWipe5_Init(void* thisx);
|
||||||
void TransitionWipe5_Destroy(void* thisx);
|
void TransitionWipe5_Destroy(void* thisx);
|
||||||
void TransitionWipe5_Update(void* thisx, s32 updateRate);
|
void TransitionWipe5_Update(void* thisx, s32 updateRate);
|
||||||
|
|
@ -16,37 +18,129 @@ void TransitionWipe5_SetColor(void* thisx, u32 color);
|
||||||
void TransitionWipe5_SetEnvColor(void* thisx, u32 color);
|
void TransitionWipe5_SetEnvColor(void* thisx, u32 color);
|
||||||
s32 TransitionWipe5_IsDone(void* thisx);
|
s32 TransitionWipe5_IsDone(void* thisx);
|
||||||
|
|
||||||
#if 0
|
|
||||||
TransitionInit TransitionWipe5_InitVars = {
|
TransitionInit TransitionWipe5_InitVars = {
|
||||||
TransitionWipe5_Init,
|
TransitionWipe5_Init, TransitionWipe5_Destroy, TransitionWipe5_Update,
|
||||||
TransitionWipe5_Destroy,
|
TransitionWipe5_Draw, TransitionWipe5_Start, TransitionWipe5_SetType,
|
||||||
TransitionWipe5_Update,
|
TransitionWipe5_SetColor, TransitionWipe5_SetEnvColor, TransitionWipe5_IsDone,
|
||||||
TransitionWipe5_Draw,
|
|
||||||
TransitionWipe5_Start,
|
|
||||||
TransitionWipe5_SetType,
|
|
||||||
TransitionWipe5_SetColor,
|
|
||||||
TransitionWipe5_SetEnvColor,
|
|
||||||
TransitionWipe5_IsDone,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
void TransitionWipe5_Start(void* thisx) {
|
||||||
|
TransitionWipe5* this = THIS;
|
||||||
|
|
||||||
extern u16 D_0F000000[];
|
this->isDone = false;
|
||||||
|
switch (this->unk_12) {
|
||||||
|
case 0:
|
||||||
|
this->unk_08 = 0.02f;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this->unk_08 = 0.05f;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this->unk_08 = 0.2f;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (this->unk_11) {
|
||||||
|
case 0:
|
||||||
|
this->primColor.rgba = RGBA8(0, 0, 0, 255);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this->primColor.rgba = RGBA8(160, 160, 160, 255);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this->primColor.rgba = RGBA8(160, 160, 160, 255);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_Start.s")
|
void* TransitionWipe5_Init(void* thisx) {
|
||||||
|
TransitionWipe5* this = THIS;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_Init.s")
|
bzero(this, sizeof(TransitionWipe5));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_Destroy.s")
|
void TransitionWipe5_Destroy(void* thisx) {
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_Update.s")
|
void TransitionWipe5_Update(void* thisx, s32 updateRate) {
|
||||||
|
TransitionWipe5* this = THIS;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_Draw.s")
|
if (this->unk_10 == 0) {
|
||||||
|
this->isDone = true;
|
||||||
|
} else {
|
||||||
|
this->unk_0C += (this->unk_08 * 3.0f) / updateRate;
|
||||||
|
if (this->unk_0C >= 1.0f) {
|
||||||
|
this->unk_0C = 1.0f;
|
||||||
|
this->isDone = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_IsDone.s")
|
void TransitionWipe5_Draw(void* thisx, Gfx** gfxP) {
|
||||||
|
Gfx* gfx = *gfxP;
|
||||||
|
s32 width = gScreenWidth;
|
||||||
|
s32 height = gScreenHeight;
|
||||||
|
s32 sp50 = D_801FBB90;
|
||||||
|
TransitionWipe5* this = THIS;
|
||||||
|
s32 alpha = (1.0f - this->unk_0C) * 255.0f;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_SetType.s")
|
gDPPipeSync(gfx++);
|
||||||
|
gSPLoadUcodeL(gfx++, gspS2DEX2_fifo);
|
||||||
|
if (this->unk_10 == 0) {
|
||||||
|
gDPSetOtherMode(gfx++,
|
||||||
|
G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||||
|
G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE,
|
||||||
|
G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2);
|
||||||
|
func_8014116C(&gfx, D_0F000000, sp50, width, height, 1);
|
||||||
|
} else {
|
||||||
|
if (alpha == 255) {
|
||||||
|
gDPSetOtherMode(gfx++,
|
||||||
|
G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||||
|
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||||
|
G_AC_NONE | G_ZS_PRIM | G_RM_OPA_SURF | G_RM_OPA_SURF2);
|
||||||
|
} else {
|
||||||
|
gDPSetOtherMode(gfx++,
|
||||||
|
G_AD_NOISE | G_CD_NOISE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | G_TL_TILE |
|
||||||
|
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||||
|
G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2);
|
||||||
|
}
|
||||||
|
gDPSetEnvColor(gfx++, 255, 255, 255, alpha);
|
||||||
|
gDPSetCombineLERP(gfx++, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0,
|
||||||
|
ENVIRONMENT);
|
||||||
|
func_8014116C(&gfx, sp50, D_0F000000, width, height, 0);
|
||||||
|
}
|
||||||
|
gDPPipeSync(gfx++);
|
||||||
|
gSPLoadUcode(gfx++, SysUcode_GetUCode(), SysUcode_GetUCodeData());
|
||||||
|
*gfxP = gfx;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_SetColor.s")
|
s32 TransitionWipe5_IsDone(void* thisx) {
|
||||||
|
TransitionWipe5* this = THIS;
|
||||||
|
|
||||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_fbdemo_wipe5/TransitionWipe5_SetEnvColor.s")
|
return this->isDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TransitionWipe5_SetType(void* thisx, s32 type) {
|
||||||
|
TransitionWipe5* this = THIS;
|
||||||
|
|
||||||
|
if (type & 0x80) {
|
||||||
|
this->unk_11 = 0;
|
||||||
|
this->unk_12 = type & 1;
|
||||||
|
} else if (type == 1) {
|
||||||
|
this->unk_10 = 1;
|
||||||
|
} else {
|
||||||
|
this->unk_10 = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TransitionWipe5_SetColor(void* thisx, u32 color) {
|
||||||
|
TransitionWipe5* this = THIS;
|
||||||
|
|
||||||
|
this->primColor.rgba = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TransitionWipe5_SetEnvColor(void* thisx, u32 color) {
|
||||||
|
TransitionWipe5* this = THIS;
|
||||||
|
|
||||||
|
this->envColor.rgba = color;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,14 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0x0000 */ char unk_0[0x14];
|
/* 0x00 */ Color_RGBA8_u32 primColor;
|
||||||
|
/* 0x04 */ Color_RGBA8_u32 envColor;
|
||||||
|
/* 0x08 */ f32 unk_08;
|
||||||
|
/* 0x0C */ f32 unk_0C;
|
||||||
|
/* 0x10 */ u8 unk_10;
|
||||||
|
/* 0x11 */ u8 unk_11;
|
||||||
|
/* 0x12 */ u8 unk_12;
|
||||||
|
/* 0x13 */ u8 isDone;
|
||||||
} TransitionWipe5; // size = 0x14
|
} TransitionWipe5; // size = 0x14
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue