Replace setjmp with libco, update aurora
This commit is contained in:
parent
b05b70d6b7
commit
824af61fbb
38 changed files with 601 additions and 805 deletions
6
.gitmodules
vendored
6
.gitmodules
vendored
|
|
@ -4,6 +4,6 @@
|
|||
[submodule "extern/aurora"]
|
||||
path = extern/aurora
|
||||
url = https://github.com/dbalatoni13/aurora.git
|
||||
[submodule "extern/longjmp_win64"]
|
||||
path = extern/longjmp_win64
|
||||
url = https://github.com/GlinkieGamesInc/longjmp_win64.git
|
||||
[submodule "extern/libco"]
|
||||
path = extern/libco
|
||||
url = https://github.com/higan-emu/libco.git
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ elseif (MSVC)
|
|||
add_compile_options(/bigobj)
|
||||
endif ()
|
||||
|
||||
add_compile_options(-fsanitize=address)
|
||||
# add_compile_options(-fsanitize=address)
|
||||
|
||||
add_subdirectory(extern/aurora EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(extern/musyx EXCLUDE_FROM_ALL)
|
||||
|
|
@ -146,17 +146,12 @@ if (NOT MSVC)
|
|||
endforeach ()
|
||||
endif ()
|
||||
|
||||
|
||||
add_library(dol SHARED ${DOLPHIN_FILES} ${GAME_FILES} ${PORT_FILES})
|
||||
add_library(dol SHARED ${DOLPHIN_FILES} ${GAME_FILES} ${PORT_FILES} extern/libco/libco.c)
|
||||
target_compile_definitions(dol PRIVATE TARGET_PC NON_MATCHING TARGET_DOL VERSION=${VERSION} MUSY_VERSION_MAJOR=1 MUSY_VERSION_MINOR=5 MUSY_VERSION_PATCH=4)
|
||||
target_include_directories(dol PRIVATE include build/GMPE01_00/include)
|
||||
target_include_directories(dol PRIVATE include build/GMPE01_00/include extern/libco)
|
||||
target_link_libraries(dol PRIVATE aurora::core aurora::gx aurora::si aurora::vi aurora::pad musyx)
|
||||
set_source_files_properties(${DOLPHIN_FILES} ${GAME_FILES} PROPERTIES COMPILE_OPTIONS "-fsanitize=address")
|
||||
if (MSVC)
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
enable_language(ASM_MASM)
|
||||
target_sources(dol PRIVATE extern/longjmp_win64/longjmp_win64.asm)
|
||||
set_source_files_properties(extern/longjmp_win64/longjmp_win64.asm PROPERTIES LANGUAGE ASM_MASM)
|
||||
endif ()
|
||||
target_link_options(dol PRIVATE "/DEF:${CMAKE_SOURCE_DIR}/dol.def")
|
||||
target_compile_options(dol PRIVATE "/Zi")
|
||||
target_compile_options(dol PRIVATE "/Ob0")
|
||||
|
|
@ -184,11 +179,12 @@ foreach (dir ${REL_DIRS})
|
|||
|
||||
if (REL_FILES)
|
||||
add_library(${dir} SHARED ${REL_FILES})
|
||||
set_source_files_properties(${REL_FILES} PROPERTIES COMPILE_OPTIONS "-fsanitize=address")
|
||||
if (dir MATCHES "^w..Dll")
|
||||
target_sources(${dir} PRIVATE src/REL/board_executor.c)
|
||||
endif()
|
||||
target_compile_definitions(${dir} PRIVATE TARGET_PC NON_MATCHING VERSION=${VERSION})
|
||||
target_include_directories(${dir} PRIVATE include build/GMPE01_00/include)
|
||||
target_include_directories(${dir} PRIVATE include build/GMPE01_00/include extern/libco)
|
||||
if (MSVC)
|
||||
set_target_properties(${dir} PROPERTIES LINK_FLAGS "/EXPORT:ObjectSetup")
|
||||
target_compile_options(${dir} PRIVATE "/Zi")
|
||||
|
|
|
|||
2
extern/aurora
vendored
2
extern/aurora
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit cd349a9d85600c01b54c430afa9a1f794695d048
|
||||
Subproject commit 23522538e13f67957d62a7119bc617700fa0c6ab
|
||||
1
extern/libco
vendored
Submodule
1
extern/libco
vendored
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit e18e09d634d612a01781168ad4d76be10a7e3bad
|
||||
1
extern/longjmp_win64
vendored
1
extern/longjmp_win64
vendored
|
|
@ -1 +0,0 @@
|
|||
Subproject commit d04c5b7b486dbd2b80610fe2a5880e833933807f
|
||||
|
|
@ -8,9 +8,9 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#ifdef AURORA
|
||||
#define GXCALLDISPLAYLISTLE GXCallDisplayListLE
|
||||
#define GXCallDisplayListNative GXCallDisplayListLE
|
||||
#else
|
||||
#define GXCALLDISPLAYLISTLE GXCallDisplayList
|
||||
#define GXCallDisplayListNative GXCallDisplayList
|
||||
#endif
|
||||
|
||||
void GXBeginDisplayList(void* list, u32 size);
|
||||
|
|
|
|||
|
|
@ -1,159 +1,9 @@
|
|||
#ifndef _GAME_JMP_H
|
||||
#define _GAME_JMP_H
|
||||
|
||||
#ifdef TARGET_PC
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef _M_X64
|
||||
#include "../extern/longjmp_win64/longjmp_win64.h"
|
||||
#define SETJMP setjmp_win64
|
||||
#define LONGJMP longjmp_win64
|
||||
#define JMPBUF JMP_BUF_WIN64
|
||||
#else
|
||||
#include <setjmp.h>
|
||||
#define SETJMP setjmp
|
||||
#define LONGJMP longjmp
|
||||
#define JMPBUF jmp_buf
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef _JMP_BUF_DEFINED
|
||||
#if defined(_M_IX86)
|
||||
typedef struct __JUMP_BUFFER {
|
||||
uint32_t Ebp;
|
||||
uint32_t Ebx;
|
||||
uint32_t Edi;
|
||||
uint32_t Esi;
|
||||
uint32_t Esp;
|
||||
uint32_t Eip;
|
||||
uint32_t Registration;
|
||||
uint32_t TryLevel;
|
||||
uint32_t Cookie;
|
||||
uint32_t UnwindFunc;
|
||||
uint32_t UnwindData[6];
|
||||
} _JUMP_BUFFER;
|
||||
#elif defined(__i386__)
|
||||
typedef struct __JUMP_BUFFER {
|
||||
uint32_t Bx;
|
||||
uint32_t Si;
|
||||
uint32_t Di;
|
||||
uint32_t Bp;
|
||||
uint32_t Sp;
|
||||
uint32_t Pc;
|
||||
} _JUMP_BUFFER;
|
||||
#elif defined(__x86_64__)
|
||||
typedef struct __JUMP_BUFFER {
|
||||
uint64_t Rbx;
|
||||
uint64_t Rbp;
|
||||
uint64_t R12;
|
||||
uint64_t R13;
|
||||
uint64_t R14;
|
||||
uint64_t R15;
|
||||
uint64_t Rsp;
|
||||
uint64_t Pc;
|
||||
} _JUMP_BUFFER;
|
||||
#elif defined(_M_ARM)
|
||||
typedef struct _JUMP_BUFFER {
|
||||
uint32_t Frame;
|
||||
|
||||
uint32_t R4;
|
||||
uint32_t R5;
|
||||
uint32_t R6;
|
||||
uint32_t R7;
|
||||
uint32_t R8;
|
||||
uint32_t R9;
|
||||
uint32_t R10;
|
||||
uint32_t R11;
|
||||
|
||||
uint32_t Sp;
|
||||
uint32_t Pc;
|
||||
uint32_t Fpscr;
|
||||
uint32_t long D[8]; // D8-D15 VFP/NEON regs
|
||||
} _JUMP_BUFFER;
|
||||
#elif defined(_M_ARM64)
|
||||
typedef struct _JUMP_BUFFER {
|
||||
uint64_t Frame;
|
||||
uint64_t Reserved;
|
||||
uint64_t X19; // x19 -- x28: callee saved registers
|
||||
uint64_t X20;
|
||||
uint64_t X21;
|
||||
uint64_t X22;
|
||||
uint64_t X23;
|
||||
uint64_t X24;
|
||||
uint64_t X25;
|
||||
uint64_t X26;
|
||||
uint64_t X27;
|
||||
uint64_t X28;
|
||||
uint64_t Fp; // x29 frame pointer
|
||||
uint64_t Lr; // x30 link register
|
||||
uint64_t Sp; // x31 stack pointer
|
||||
uint32_t Fpcr; // fp control register
|
||||
uint32_t Fpsr; // fp status register
|
||||
|
||||
double D[8]; // D8-D15 FP regs
|
||||
} _JUMP_BUFFER;
|
||||
#elif defined(__riscv)
|
||||
typedef struct _JUMP_BUFFER {
|
||||
uint32_t ra;
|
||||
uint32_t sp;
|
||||
uint32_t s0;
|
||||
uint32_t s1;
|
||||
uint32_t s2;
|
||||
uint32_t s3;
|
||||
uint32_t s4;
|
||||
uint32_t s5;
|
||||
uint32_t s6;
|
||||
uint32_t s7;
|
||||
uint32_t s8;
|
||||
uint32_t s9;
|
||||
uint32_t s10;
|
||||
uint32_t s11;
|
||||
|
||||
#if __riscv_xlen == 64
|
||||
uint64_t fs0;
|
||||
uint64_t fs1;
|
||||
uint64_t fs2;
|
||||
uint64_t fs3;
|
||||
uint64_t fs4;
|
||||
uint64_t fs5;
|
||||
uint64_t fs6;
|
||||
uint64_t fs7;
|
||||
uint64_t fs8;
|
||||
uint64_t fs9;
|
||||
uint64_t fs10;
|
||||
uint64_t fs11;
|
||||
#endif
|
||||
} _JUMP_BUFFER;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_M_IX86)
|
||||
#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Eip = (uintptr_t)func
|
||||
#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Esp = (uintptr_t)sp
|
||||
#elif defined(__i386__)
|
||||
#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Pc = (uintptr_t)func
|
||||
#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Sp = (uintptr_t)sp
|
||||
#elif defined(__x86_64__)
|
||||
#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Pc = (uintptr_t)func
|
||||
#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Rsp = (uintptr_t)sp
|
||||
#elif defined(_M_X64)
|
||||
#define SETJMP_SET_IP(jump, func) (jump)->rip_getjmp = (uintptr_t)func
|
||||
#define SETJMP_SET_SP(jump, sp) (jump)->rsp_getjmp = (uintptr_t)sp
|
||||
#elif defined(_M_ARM) || defined(__arm__)
|
||||
#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Pc = (uintptr_t)func
|
||||
#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Sp = (uintptr_t)sp
|
||||
#elif defined(_M_ARM64) || defined(__aarch64__)
|
||||
#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Lr = (uintptr_t)func
|
||||
#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Sp = (uintptr_t)sp
|
||||
#elif defined(__riscv)
|
||||
#define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->ra = (uintptr_t)func
|
||||
#define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->sp = (uintptr_t)sp
|
||||
#endif
|
||||
|
||||
#else
|
||||
#include "dolphin.h"
|
||||
|
||||
typedef struct jmp_buf {
|
||||
typedef struct jump_buf {
|
||||
u32 lr;
|
||||
u32 cr;
|
||||
u32 sp;
|
||||
|
|
@ -166,12 +16,4 @@ typedef struct jmp_buf {
|
|||
s32 gcsetjmp(jmp_buf *jump);
|
||||
s32 gclongjmp(jmp_buf *jump, s32 status);
|
||||
|
||||
#define JMPBUF jmp_buf
|
||||
#define SETJMP(jump) gcsetjmp(&(jump))
|
||||
#define LONGJMP(jump, status) gclongjmp(&(jump), (status))
|
||||
|
||||
#define SETJMP_SET_IP(jump, func) jump.lr = (u32)func
|
||||
#define SETJMP_SET_SP(jump, stack_ptr) jump.sp = (u32)stack_ptr
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -3,10 +3,11 @@
|
|||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#include "game/jmp.h"
|
||||
|
||||
#ifdef TARGET_PC
|
||||
#include <stdio.h>
|
||||
#include "libco.h"
|
||||
#else
|
||||
#include "game/jmp.h"
|
||||
#endif
|
||||
|
||||
#define PROCESS_STAT_PAUSE 0x1
|
||||
|
|
@ -26,8 +27,12 @@ typedef struct process {
|
|||
u16 stat;
|
||||
u16 prio;
|
||||
s32 sleep_time;
|
||||
#ifdef TARGET_PC
|
||||
cothread_t thread;
|
||||
#else
|
||||
uintptr_t base_sp;
|
||||
JMPBUF jump;
|
||||
jmp_buf jump;
|
||||
#endif
|
||||
void (*dtor)(void);
|
||||
void *user_data;
|
||||
} Process;
|
||||
|
|
|
|||
|
|
@ -1300,7 +1300,7 @@ void fn_1_58E4(ModelData *modelData, Mtx arg1)
|
|||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
|
||||
GXSetCullMode(GX_CULL_BACK);
|
||||
GXCallDisplayList(var_r31->unk_44, var_r31->unk_48);
|
||||
GXCallDisplayListNative(var_r31->unk_44, var_r31->unk_48);
|
||||
GXInitTexObj(&sp3C, var_r31->unk_4C->bmp->data, var_r31->unk_4C->bmp->sizeX, var_r31->unk_4C->bmp->sizeY, 1, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||
GXLoadTexObj(&sp3C, GX_TEXMAP0);
|
||||
GXSetNumTevStages(1);
|
||||
|
|
@ -1311,7 +1311,7 @@ void fn_1_58E4(ModelData *modelData, Mtx arg1)
|
|||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
|
||||
GXSetTevColor(GX_TEVREG0, sp14);
|
||||
GXCallDisplayList(var_r31->unk_44, var_r31->unk_48);
|
||||
GXCallDisplayListNative(var_r31->unk_44, var_r31->unk_48);
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
GXDestroyTexObj(&sp3C);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#include "game/gamework_data.h"
|
||||
#include "game/hsfanim.h"
|
||||
#include "game/hsfdraw.h"
|
||||
#include <game/hsfex.h>
|
||||
#include "game/hsfman.h"
|
||||
#include "game/hsfmotion.h"
|
||||
#include "game/memory.h"
|
||||
|
|
@ -20,11 +19,12 @@
|
|||
#include "game/process.h"
|
||||
#include "game/sprite.h"
|
||||
#include "game/wipe.h"
|
||||
#include <game/hsfex.h>
|
||||
|
||||
|
||||
#include "dolphin.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
|
||||
#ifndef __MWERKS__
|
||||
#include "game/audio.h"
|
||||
#endif
|
||||
|
|
@ -1010,7 +1010,7 @@ void fn_1_37A4(ModelData *arg0, Mtx arg1)
|
|||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_RGBA6, 0);
|
||||
GXSETARRAY(GX_VA_POS, lbl_1_bss_5AC.unk14, 900 * sizeof(Vec), sizeof(Vec));
|
||||
GXSetCullMode(GX_CULL_BACK);
|
||||
GXCallDisplayList(lbl_1_bss_5AC.unk24, lbl_1_bss_5AC.unk28);
|
||||
GXCallDisplayListNative(lbl_1_bss_5AC.unk24, lbl_1_bss_5AC.unk28);
|
||||
GXSetNumIndStages(0);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
GXSetTevDirect(GX_TEVSTAGE1);
|
||||
|
|
|
|||
|
|
@ -1122,13 +1122,13 @@ void fn_1_45BC(ModelData *arg0, Mtx arg1)
|
|||
GXSetVtxDesc(GX_VA_CLR0, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
GXSETARRAY(GX_VA_CLR0, var_r31->unk_90, var_r31->unk_80 * sizeof(GXColor), sizeof(GXColor));
|
||||
GXCallDisplayList(var_r31->unk_A4, var_r31->unk_A0);
|
||||
GXCallDisplayListNative(var_r31->unk_A4, var_r31->unk_A0);
|
||||
for (var_r30 = 1; var_r30 < 29; var_r30++) {
|
||||
var_r29 = var_r30 * 35;
|
||||
GXSETARRAY(GX_VA_POS, &var_r31->unk_84[var_r29], 35 * sizeof(Vec), sizeof(Vec));
|
||||
GXSETARRAY(GX_VA_NRM, &var_r31->unk_88[var_r29], 35 * sizeof(Vec), sizeof(Vec));
|
||||
GXSETARRAY(GX_VA_CLR0, &var_r31->unk_90[var_r29], 35 * sizeof(GXColor), sizeof(GXColor));
|
||||
GXCallDisplayList(var_r31->unk_A4, var_r31->unk_A0);
|
||||
GXCallDisplayListNative(var_r31->unk_A4, var_r31->unk_A0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3034,7 +3034,7 @@ void fn_1_BC18(ModelData *arg0, float (*arg1)[4])
|
|||
DCFlushRangeNoSync(var_r31->unk_44, var_r31->unk_26 * 8 * 4);
|
||||
DCFlushRangeNoSync(var_r31->unk_3C, var_r31->unk_26 * 0x44);
|
||||
PPCSync();
|
||||
GXCallDisplayList(var_r31->unk_48, var_r31->unk_34);
|
||||
GXCallDisplayListNative(var_r31->unk_48, var_r31->unk_34);
|
||||
if (!shadowModelDrawF) {
|
||||
if ((var_r31->unk_21 & 2) == 0) {
|
||||
var_r31->unk_28++;
|
||||
|
|
@ -3213,7 +3213,7 @@ void fn_1_C86C(ModelData *arg0, Mtx arg1)
|
|||
DCFlushRangeNoSync(var_r31->unk_40, var_r31->unk_26 * 0xC * 4);
|
||||
DCFlushRangeNoSync(var_r31->unk_3C, var_r31->unk_26 * 0x44);
|
||||
PPCSync();
|
||||
GXCallDisplayList(var_r31->unk_48, var_r31->unk_34);
|
||||
GXCallDisplayListNative(var_r31->unk_48, var_r31->unk_34);
|
||||
if (!shadowModelDrawF) {
|
||||
if ((var_r31->unk_21 & 2) == 0) {
|
||||
var_r31->unk_28++;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#include "ext_math.h"
|
||||
#include "game/audio.h"
|
||||
#include "game/chrman.h"
|
||||
#include "game/hsfanim.h"
|
||||
|
|
@ -8,7 +9,7 @@
|
|||
#include "game/objsub.h"
|
||||
#include "game/sprite.h"
|
||||
#include "game/wipe.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
|
||||
#include "REL/m408Dll.h"
|
||||
|
||||
|
|
@ -1070,7 +1071,7 @@ void fn_1_10484(UnkFn10484 *arg0, HsfFace *arg1, HsfDrawData *arg2, GXColor *arg
|
|||
}
|
||||
fn_1_10B60(arg0, temp_r31);
|
||||
temp_r20 = (void *)(arg2->dlOfs + ((u32)lbl_1_bss_120[0]));
|
||||
GXCallDisplayList(temp_r20, arg2->dlSize);
|
||||
GXCallDisplayListNative(temp_r20, arg2->dlSize);
|
||||
}
|
||||
|
||||
void fn_1_10830(ModelData *arg0, HsfBitmap *arg1, HsfAttribute *arg2, s16 arg3)
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ void fn_1_C164(unkStruct8 *arg0)
|
|||
GXSetVtxDesc(GX_VA_NRM, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_NRM, var_r31->unk48, sizeof(Vec), sizeof(Vec));
|
||||
GXCallDisplayList(var_r31->unk3C, var_r31->unk38);
|
||||
GXCallDisplayListNative(var_r31->unk3C, var_r31->unk38);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1412,7 +1412,7 @@ void fn_1_602C(ModelData *arg0, f32 (*arg1)[4])
|
|||
DCFlushRangeNoSync(temp_r30->unk1C, temp_r30->unk0 * 0xC * 4);
|
||||
DCFlushRangeNoSync(temp_r30->unk20, temp_r30->unk0 * 8 * 4);
|
||||
PPCSync();
|
||||
GXCallDisplayList(temp_r30->unk28, temp_r30->unk4);
|
||||
GXCallDisplayListNative(temp_r30->unk28, temp_r30->unk4);
|
||||
}
|
||||
|
||||
void fn_1_6608(HsfVector2f *arg0, s16 arg1, s16 arg2, f32 arg3, f32 arg4)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#include "ext_math.h"
|
||||
#include "game/audio.h"
|
||||
#include "game/chrman.h"
|
||||
#include "game/gamework_data.h"
|
||||
|
|
@ -8,7 +9,7 @@
|
|||
#include "game/object.h"
|
||||
#include "game/pad.h"
|
||||
#include "game/sprite.h"
|
||||
#include "ext_math.h"
|
||||
|
||||
|
||||
#include "REL/m410Dll.h"
|
||||
|
||||
|
|
@ -1125,7 +1126,7 @@ void fn_1_B140(ModelData *arg0, Mtx arg1)
|
|||
GXLoadTexMtxImm(spF4, 30, GX_MTX3x4);
|
||||
MTXRotRad(sp124, 90, 0.017453292f * -var_r31->unk_08);
|
||||
GXLoadTexMtxImm(sp124, 33, GX_MTX2x4);
|
||||
GXCallDisplayList(var_r30->unk_120.unk_E5C, var_r30->unk_120.unk_E58);
|
||||
GXCallDisplayListNative(var_r30->unk_120.unk_E5C, var_r30->unk_120.unk_E58);
|
||||
}
|
||||
}
|
||||
GXSetNumIndStages(0);
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ void fn_1_88B8(unkSubStruct2 *arg0)
|
|||
GXSetVtxDesc(GX_VA_NRM, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_NRM, var_r31->unk48, sizeof(Vec), sizeof(Vec));
|
||||
GXCallDisplayList(var_r31->unk3C, var_r31->unk38);
|
||||
GXCallDisplayListNative(var_r31->unk3C, var_r31->unk38);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -859,7 +859,7 @@ void fn_1_604C(ModelData *arg0, Mtx arg1)
|
|||
GXSETARRAY(GX_VA_NRM, lbl_1_bss_178.unk_6C4[lbl_1_bss_178.unk_6B4], 30 * 36 * sizeof(Vec), sizeof(Vec));
|
||||
GXSETARRAY(GX_VA_CLR0, lbl_1_bss_178.unk_6CC[lbl_1_bss_178.unk_6B4], 30 * 36 * sizeof(GXColor), sizeof(GXColor));
|
||||
GXSETARRAY(GX_VA_TEX0, lbl_1_bss_178.unk_6D4[lbl_1_bss_178.unk_6B4], 30 * 36 * sizeof(Vec2f), sizeof(Vec2f));
|
||||
GXCallDisplayList(lbl_1_bss_178.unk_6E0[0], lbl_1_bss_178.unk_6E8[0]);
|
||||
GXCallDisplayListNative(lbl_1_bss_178.unk_6E0[0], lbl_1_bss_178.unk_6E8[0]);
|
||||
GXSetNumIndStages(0);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
GXSetTevDirect(GX_TEVSTAGE1);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
#include "ext_math.h"
|
||||
|
||||
|
||||
#ifndef __MWERKS__
|
||||
#include "game/frand.h"
|
||||
#endif
|
||||
|
|
@ -1262,7 +1261,7 @@ void fn_1_29BC(ModelData *arg0, Mtx arg1)
|
|||
PPCSync();
|
||||
GXSETARRAY(GX_VA_POS, temp_r31->unk14, temp_r31->unk00 * sizeof(*temp_r31->unk14), sizeof(*temp_r31->unk14));
|
||||
GXSETARRAY(GX_VA_CLR0, temp_r31->unk1C, temp_r31->unk00 * sizeof(*temp_r31->unk1C), sizeof(*temp_r31->unk1C));
|
||||
GXCallDisplayList(temp_r31->unk38, temp_r31->unk34);
|
||||
GXCallDisplayListNative(temp_r31->unk38, temp_r31->unk34);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4498,7 +4497,7 @@ void fn_1_EF44(ModelData *arg0, Mtx arg1)
|
|||
GXLoadTexMtxImm(spF4, GX_TEXMTX0, GX_MTX3x4);
|
||||
MTXRotRad(sp124, 'Z', MTXDegToRad(-var_r31->unk0C));
|
||||
GXLoadTexMtxImm(sp124, GX_TEXMTX1, GX_MTX2x4);
|
||||
GXCallDisplayList(temp_r30->unk220, temp_r30->unk21C);
|
||||
GXCallDisplayListNative(temp_r30->unk220, temp_r30->unk21C);
|
||||
}
|
||||
GXSetNumIndStages(0);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
|
|
@ -5238,7 +5237,7 @@ void fn_1_11900(ModelData *arg0, Mtx arg1)
|
|||
GXSetVtxDesc(GX_VA_TEX0, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_TEX0, temp_r31->unk44, temp_r31->unk26 * sizeof(Vec2f) * 4, sizeof(Vec2f));
|
||||
GXCallDisplayList(temp_r31->unk48, temp_r31->unk34);
|
||||
GXCallDisplayListNative(temp_r31->unk48, temp_r31->unk34);
|
||||
if (shadowModelDrawF == 0) {
|
||||
if (!(temp_r31->unk21 & 2)) {
|
||||
temp_r31->unk28++;
|
||||
|
|
|
|||
|
|
@ -1636,7 +1636,7 @@ void fn_1_5C20(ModelData *var_r27, Mtx sp8)
|
|||
GXSetVtxDesc(GX_VA_NRM, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_NRM, var_r31->unk_1C, var_r31->unk_2A * (4 * sizeof(Vec)), sizeof(Vec));
|
||||
GXCallDisplayList(var_r31->unk_10, var_r31->unk_0C);
|
||||
GXCallDisplayListNative(var_r31->unk_10, var_r31->unk_0C);
|
||||
}
|
||||
|
||||
u32 lbl_1_data_114 = 0x41C64E6D;
|
||||
|
|
|
|||
|
|
@ -2139,7 +2139,7 @@ void fn_1_101C4(ModelData *var_r29, Mtx var_r28)
|
|||
GXSETARRAY(GX_VA_TEX0, var_r31->unk_184, var_r31->unk_110 * sizeof(Vec2f), sizeof(Vec2f));
|
||||
for (var_r30 = 0; var_r30 < var_r31->unk_240; var_r30++) {
|
||||
if (var_r31->unk_2A8[var_r30] && var_r31->unk_244[var_r30] != 0 && var_r30 != 1) {
|
||||
GXCallDisplayList(var_r31->unk_2A8[var_r30], var_r31->unk_244[var_r30]);
|
||||
GXCallDisplayListNative(var_r31->unk_2A8[var_r30], var_r31->unk_244[var_r30]);
|
||||
}
|
||||
}
|
||||
GXSetNumTevStages(2);
|
||||
|
|
@ -2184,7 +2184,7 @@ void fn_1_101C4(ModelData *var_r29, Mtx var_r28)
|
|||
GXSetVtxDesc(GX_VA_TEX0, GX_INDEX16);
|
||||
GXSETARRAY(GX_VA_TEX0, var_r31->unk_184, var_r31->unk_110 * sizeof(Vec2f), sizeof(Vec2f));
|
||||
if (var_r31->unk_2A8[1] && (var_r31->unk_244[1] != 0)) {
|
||||
GXCallDisplayList(var_r31->unk_2A8[1], var_r31->unk_244[1]);
|
||||
GXCallDisplayListNative(var_r31->unk_2A8[1], var_r31->unk_244[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2743,7 +2743,7 @@ void fn_1_11EE0(ModelData *var_r24, Mtx var_r21)
|
|||
DCFlushRangeNoSync(var_r31->unk_40, var_r31->unk_24 * sizeof(Vec) * 4);
|
||||
DCFlushRangeNoSync(var_r31->unk_44, var_r31->unk_24 * sizeof(Vec2f) * 4);
|
||||
PPCSync();
|
||||
GXCallDisplayList(var_r31->unk_48, var_r31->unk_34);
|
||||
GXCallDisplayListNative(var_r31->unk_48, var_r31->unk_34);
|
||||
if (shadowModelDrawF == 0) {
|
||||
if ((var_r31->unk_21 & 2) == 0) {
|
||||
var_r31->unk_28++;
|
||||
|
|
|
|||
|
|
@ -3103,7 +3103,7 @@ void fn_1_80DC(ModelData *arg0, Mtx arg1)
|
|||
DCFlushRangeNoSync(var_r31->unk_40, var_r31->unk_24 * sizeof(Vec) * 4);
|
||||
DCFlushRangeNoSync(var_r31->unk_44, var_r31->unk_24 * sizeof(Vec2f) * 4);
|
||||
PPCSync();
|
||||
GXCallDisplayList(var_r31->unk_48, var_r31->unk_34);
|
||||
GXCallDisplayListNative(var_r31->unk_48, var_r31->unk_34);
|
||||
if (!shadowModelDrawF) {
|
||||
if ((var_r31->unk_21 & 2) == 0) {
|
||||
var_r31->unk_28++;
|
||||
|
|
|
|||
|
|
@ -1063,7 +1063,7 @@ void fn_1_618C(ModelData *arg0, Mtx arg1)
|
|||
GXSetAlphaCompare(GX_GEQUAL, 1, GX_AOP_AND, GX_GEQUAL, 1);
|
||||
GXSetZCompLoc(0);
|
||||
GXSetBlendMode(GX_BM_NONE, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_NOOP);
|
||||
GXCallDisplayList(var_r31->unk20, var_r31->unk24);
|
||||
GXCallDisplayListNative(var_r31->unk20, var_r31->unk24);
|
||||
GXSetNumIndStages(0);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
GXSetTevDirect(GX_TEVSTAGE1);
|
||||
|
|
@ -2010,7 +2010,7 @@ void fn_1_9B88(ModelData *model, Mtx matrix)
|
|||
GXSetAlphaCompare(GX_GEQUAL, 1, GX_AOP_AND, GX_GEQUAL, 1);
|
||||
GXSetZCompLoc(0);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_ONE, GX_LO_NOOP);
|
||||
GXCallDisplayList(var_r31->unk80, var_r31->unk84);
|
||||
GXCallDisplayListNative(var_r31->unk80, var_r31->unk84);
|
||||
GXSetNumIndStages(0);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
GXSetTevDirect(GX_TEVSTAGE1);
|
||||
|
|
@ -2431,7 +2431,7 @@ void fn_1_B3CC(ModelData *model, Mtx matrix)
|
|||
GXSetAlphaCompare(GX_GEQUAL, 1, GX_AOP_AND, GX_GEQUAL, 1);
|
||||
GXSetZCompLoc(0);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_ONE, GX_LO_NOOP);
|
||||
GXCallDisplayList(var_r31->unk_40, var_r31->unk_44);
|
||||
GXCallDisplayListNative(var_r31->unk_40, var_r31->unk_44);
|
||||
GXSetNumIndStages(0);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
GXSetTevDirect(GX_TEVSTAGE1);
|
||||
|
|
@ -3068,7 +3068,7 @@ void fn_1_DCD4(ModelData *model, Mtx matrix)
|
|||
DCFlushRangeNoSync(var_r30->unk_1C, var_r30->unk_00 * sizeof(Vec) * 4);
|
||||
DCFlushRangeNoSync(var_r30->unk_20, var_r30->unk_00 * sizeof(Vec2f) * 4);
|
||||
PPCSync();
|
||||
GXCallDisplayList(var_r30->unk_28, var_r30->unk_04);
|
||||
GXCallDisplayListNative(var_r30->unk_28, var_r30->unk_04);
|
||||
}
|
||||
|
||||
void fn_1_E2B0(Vec2f *arg0, s16 arg1, s16 arg2, float arg8, float arg9)
|
||||
|
|
|
|||
|
|
@ -3183,7 +3183,7 @@ void fn_1_134C0(ModelData *var_r23, Mtx var_r22)
|
|||
GXSetVtxDesc(GX_VA_TEX0, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_TEX0, var_r31->unk_44, var_r31->unk_26 * sizeof(Vec2f) * 4, sizeof(Vec2f));
|
||||
GXCallDisplayList(var_r31->unk_48, var_r31->unk_34);
|
||||
GXCallDisplayListNative(var_r31->unk_48, var_r31->unk_34);
|
||||
if (shadowModelDrawF == 0) {
|
||||
if ((var_r31->unk_21 & 2) == 0) {
|
||||
var_r31->unk_28++;
|
||||
|
|
|
|||
|
|
@ -1625,7 +1625,7 @@ void fn_1_10948(ModelData *var_r29, Mtx var_r30)
|
|||
GXSetVtxDesc(GX_VA_TEX0, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_TEX0, var_r31->unk_54, 16 * sizeof(Vec2f), sizeof(Vec2f));
|
||||
GXCallDisplayList(var_r31->unk_60, var_r31->unk_5C);
|
||||
GXCallDisplayListNative(var_r31->unk_60, var_r31->unk_5C);
|
||||
}
|
||||
|
||||
void fn_1_10B88(void)
|
||||
|
|
|
|||
|
|
@ -1270,7 +1270,7 @@ void fn_1_8CE0(ModelData *model, Mtx matrix)
|
|||
GXSETARRAY(GX_VA_POS, var_r31->unk_44[var_r31->unk_40], 0x1B8 * sizeof(Vec), sizeof(Vec));
|
||||
GXSETARRAY(GX_VA_CLR0, var_r31->unk_54[var_r31->unk_40], 0x1B8 * sizeof(GXColor), sizeof(GXColor));
|
||||
GXSetCullMode(GX_CULL_NONE);
|
||||
GXCallDisplayList(var_r31->unk_60, var_r31->unk_64);
|
||||
GXCallDisplayListNative(var_r31->unk_60, var_r31->unk_64);
|
||||
GXSetCullMode(GX_CULL_BACK);
|
||||
GXSetNumIndStages(0);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
|
|
|
|||
|
|
@ -2143,7 +2143,7 @@ void fn_1_72B4(ModelData *model, Mtx mtx)
|
|||
DCFlushRangeNoSync(temp_r30->unk1C, (temp_r30->unk0 * sizeof(Vec)) * 4);
|
||||
DCFlushRangeNoSync(temp_r30->unk20, (temp_r30->unk0 * sizeof(HsfVector2f)) * 4);
|
||||
PPCSync();
|
||||
GXCallDisplayList(temp_r30->unk28, temp_r30->unk4);
|
||||
GXCallDisplayListNative(temp_r30->unk28, temp_r30->unk4);
|
||||
}
|
||||
|
||||
void fn_1_7824(HsfVector2f *arg0, s16 arg1, s16 arg2, float arg3, float arg4)
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ void fn_1_2978(ModelData *model, Mtx mtx)
|
|||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_POS, lbl_1_bss_2868, sizeof(lbl_1_bss_2868), sizeof(Vec));
|
||||
GXSetCullMode(GX_CULL_BACK);
|
||||
GXCallDisplayList(lbl_1_bss_450.unk0, lbl_1_bss_450.unk4);
|
||||
GXCallDisplayListNative(lbl_1_bss_450.unk0, lbl_1_bss_450.unk4);
|
||||
GXSetNumIndStages(0);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
GXSetTevDirect(GX_TEVSTAGE1);
|
||||
|
|
@ -539,7 +539,7 @@ void fn_1_3CC8(ModelData *model, Mtx mtx)
|
|||
MTXScale(sp14, 0.5f * temp_f31, 0.5f * temp_f31, 1.0f);
|
||||
mtxTransCat(sp14, (200.0f * (600.0f + temp_r31->unk0.x)) / 1200.0f, (200.0f * (600.0f + temp_r31->unk0.z)) / 1200.0f, 0);
|
||||
GXLoadPosMtxImm(sp14, GX_PNMTX0);
|
||||
GXCallDisplayList(lbl_1_bss_440.unk0, lbl_1_bss_440.unk4);
|
||||
GXCallDisplayListNative(lbl_1_bss_440.unk0, lbl_1_bss_440.unk4);
|
||||
}
|
||||
fn_1_32DC(&lbl_1_bss_3F0[0], GX_TRUE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ void fn_1_E790(M438UnkStruct2 *arg0)
|
|||
GXSetVtxDesc(GX_VA_NRM, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0U);
|
||||
GXSETARRAY(GX_VA_NRM, var_r31->unk_4C, sizeof(Vec), sizeof(Vec));
|
||||
GXCallDisplayList(var_r31->unk_40, var_r31->unk_3C);
|
||||
GXCallDisplayListNative(var_r31->unk_40, var_r31->unk_3C);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1908,7 +1908,7 @@ void fn_1_806C(ModelData *arg0, Mtx arg1)
|
|||
GXSetAlphaCompare(GX_GEQUAL, 1, GX_AOP_AND, GX_GEQUAL, 1);
|
||||
GXSetZCompLoc(GX_FALSE);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_NOOP);
|
||||
GXCallDisplayList(temp_r31->unk30, temp_r31->unk34);
|
||||
GXCallDisplayListNative(temp_r31->unk30, temp_r31->unk34);
|
||||
}
|
||||
|
||||
void fn_1_8470(unkStruct12 *arg0, unkStruct13 *arg1)
|
||||
|
|
@ -2512,7 +2512,7 @@ void fn_1_9C04(ModelData *arg0, Mtx arg1)
|
|||
}
|
||||
DCFlushRangeNoSync(temp_r30->unk1C, temp_r30->unk0 * sizeof(Vec) * 4);
|
||||
DCFlushRangeNoSync(temp_r30->unk20, temp_r30->unk0 * sizeof(Vec2f) * 4);
|
||||
GXCallDisplayList(temp_r30->unk28, temp_r30->unk4);
|
||||
GXCallDisplayListNative(temp_r30->unk28, temp_r30->unk4);
|
||||
}
|
||||
|
||||
void fn_1_A1B8(HsfVector2f *arg0, s16 arg1, s16 arg2, f32 arg8, f32 arg9)
|
||||
|
|
|
|||
|
|
@ -1653,7 +1653,7 @@ void fn_1_56C4(ModelData *arg0, Mtx arg1)
|
|||
}
|
||||
DCFlushRangeNoSync(var_r31->unk_14, var_r31->unk_64 * sizeof(Vec) * 4);
|
||||
DCFlushRangeNoSync(var_r31->unk_18, var_r31->unk_64 * sizeof(Vec2f) * 4);
|
||||
GXCallDisplayList(var_r31->unk_24, var_r31->unk_58);
|
||||
GXCallDisplayListNative(var_r31->unk_24, var_r31->unk_58);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
#include "game/hsfanim.h"
|
||||
#include "game/hsfdraw.h"
|
||||
#include "game/hsfman.h"
|
||||
#include "game/object.h"
|
||||
#include "game/objsub.h"
|
||||
#include "game/hsfman.h"
|
||||
#include "game/hsfdraw.h"
|
||||
#include "game/hsfanim.h"
|
||||
|
||||
|
||||
#include "game/hsfmotion.h"
|
||||
|
||||
|
|
@ -303,147 +304,31 @@ void fn_1_4104(omObjData *object)
|
|||
GXColor lbl_1_data_26A = { 255, 255, 255, 32 };
|
||||
GXColor lbl_1_data_26E = { 255, 255, 255, 10 };
|
||||
GXColor lbl_1_data_272 = { 0, 126, 126, 255 };
|
||||
Vec lbl_1_data_278[4] = {
|
||||
-1000, 50, 1000,
|
||||
-1000, 50, -1000,
|
||||
1000, 50, -1000,
|
||||
1000, 50, 1000
|
||||
};
|
||||
Vec lbl_1_data_278[4] = { -1000, 50, 1000, -1000, 50, -1000, 1000, 50, -1000, 1000, 50, 1000 };
|
||||
|
||||
Vec lbl_1_data_2A8[26] = {
|
||||
-1500, 0, 1000,
|
||||
-1400, 0, 1000,
|
||||
0, 0, 1000,
|
||||
1400, 0, 1000,
|
||||
1500, 0, 1000,
|
||||
-1500, 0, -500,
|
||||
-1400, 0, -500,
|
||||
0, 0, -500,
|
||||
1400, 0, -500,
|
||||
1500, 0, -500,
|
||||
-1500, 0, -2000,
|
||||
-1400, 0, -2000,
|
||||
0, 0, -2000,
|
||||
1400, 0, -2000,
|
||||
1500, 0, -2000,
|
||||
-1500, 0, -5000,
|
||||
-1400, 0, -5000,
|
||||
0, 0, -5000,
|
||||
1400, 0, -5000,
|
||||
1500, 0, -5000,
|
||||
-2000, 0, -500,
|
||||
-2500, 0, -2000,
|
||||
-3000, 0, -5000,
|
||||
2000, 0, -500,
|
||||
2500, 0, -2000,
|
||||
3000, 0, -5000
|
||||
};
|
||||
Vec lbl_1_data_2A8[26] = { -1500, 0, 1000, -1400, 0, 1000, 0, 0, 1000, 1400, 0, 1000, 1500, 0, 1000, -1500, 0, -500, -1400, 0, -500, 0, 0, -500, 1400,
|
||||
0, -500, 1500, 0, -500, -1500, 0, -2000, -1400, 0, -2000, 0, 0, -2000, 1400, 0, -2000, 1500, 0, -2000, -1500, 0, -5000, -1400, 0, -5000, 0, 0,
|
||||
-5000, 1400, 0, -5000, 1500, 0, -5000, -2000, 0, -500, -2500, 0, -2000, -3000, 0, -5000, 2000, 0, -500, 2500, 0, -2000, 3000, 0, -5000 };
|
||||
|
||||
GXColor lbl_1_data_3E0[26] = {
|
||||
{ 96, 128, 255, 255 },
|
||||
{ 128, 160, 255, 32 },
|
||||
{ 128, 160, 255, 32 },
|
||||
{ 128, 160, 255, 32 },
|
||||
{ 96, 128, 255, 255 },
|
||||
{ 24, 48, 255, 255 },
|
||||
{ 96, 128, 255, 32 },
|
||||
{ 128, 160, 255, 32 },
|
||||
{ 96, 128, 255, 32 },
|
||||
{ 24, 48, 255, 255 },
|
||||
{ 24, 48, 255, 255 },
|
||||
{ 24, 48, 255, 255 },
|
||||
{ 96, 128, 255, 255 },
|
||||
{ 24, 48, 255, 255 },
|
||||
{ 24, 48, 255, 255 },
|
||||
{ 8, 24, 143, 255 },
|
||||
{ 8, 24, 143, 255 },
|
||||
{ 8, 24, 143, 255 },
|
||||
{ 8, 24, 143, 255 },
|
||||
{ 8, 24, 143, 255 },
|
||||
{ 24, 48, 255, 255 },
|
||||
{ 24, 48, 255, 255 },
|
||||
{ 24, 48, 255, 255 },
|
||||
{ 24, 48, 255, 255 },
|
||||
{ 24, 48, 255, 255 },
|
||||
{ 24, 48, 255, 255 }
|
||||
};
|
||||
GXColor lbl_1_data_3E0[26] = { { 96, 128, 255, 255 }, { 128, 160, 255, 32 }, { 128, 160, 255, 32 }, { 128, 160, 255, 32 }, { 96, 128, 255, 255 },
|
||||
{ 24, 48, 255, 255 }, { 96, 128, 255, 32 }, { 128, 160, 255, 32 }, { 96, 128, 255, 32 }, { 24, 48, 255, 255 }, { 24, 48, 255, 255 },
|
||||
{ 24, 48, 255, 255 }, { 96, 128, 255, 255 }, { 24, 48, 255, 255 }, { 24, 48, 255, 255 }, { 8, 24, 143, 255 }, { 8, 24, 143, 255 },
|
||||
{ 8, 24, 143, 255 }, { 8, 24, 143, 255 }, { 8, 24, 143, 255 }, { 24, 48, 255, 255 }, { 24, 48, 255, 255 }, { 24, 48, 255, 255 },
|
||||
{ 24, 48, 255, 255 }, { 24, 48, 255, 255 }, { 24, 48, 255, 255 } };
|
||||
|
||||
float lbl_1_data_448[26][2] = {
|
||||
0, 1,
|
||||
0.033333335, 1,
|
||||
0.5, 1,
|
||||
0.96666664, 1,
|
||||
1, 1,
|
||||
0, 0.5,
|
||||
0.033333335, 0.5,
|
||||
0.5, 0.5,
|
||||
0.96666664, 0.5,
|
||||
1, 0.5,
|
||||
0, 0,
|
||||
0.033333335, 0,
|
||||
0.5, 0,
|
||||
0.96666664, 0,
|
||||
1, 0,
|
||||
0, 0,
|
||||
0.033333335, 0,
|
||||
0.5, 0,
|
||||
0.96666664, 0,
|
||||
1, 0,
|
||||
-0.15, 0.5,
|
||||
-0.33, 0,
|
||||
-0.49, 0,
|
||||
1.15, 0.5,
|
||||
1.33, 0,
|
||||
1.49, 0
|
||||
};
|
||||
float lbl_1_data_448[26][2]
|
||||
= { 0, 1, 0.033333335, 1, 0.5, 1, 0.96666664, 1, 1, 1, 0, 0.5, 0.033333335, 0.5, 0.5, 0.5, 0.96666664, 0.5, 1, 0.5, 0, 0, 0.033333335, 0, 0.5, 0,
|
||||
0.96666664, 0, 1, 0, 0, 0, 0.033333335, 0, 0.5, 0, 0.96666664, 0, 1, 0, -0.15, 0.5, -0.33, 0, -0.49, 0, 1.15, 0.5, 1.33, 0, 1.49, 0 };
|
||||
|
||||
float lbl_1_data_518[26][2] = {
|
||||
0, 30,
|
||||
0.5, 30,
|
||||
7.5, 30,
|
||||
14.5, 30,
|
||||
15, 30,
|
||||
0, 15,
|
||||
0.5, 15,
|
||||
7.5, 15,
|
||||
14.5, 15,
|
||||
15, 15,
|
||||
0, 7.5,
|
||||
0.5, 7.5,
|
||||
7.5, 7.5,
|
||||
14.5, 7.5,
|
||||
15, 7.5,
|
||||
0, 0,
|
||||
0.5, 0,
|
||||
7.5, 0,
|
||||
14.5, 0,
|
||||
15, 0,
|
||||
-2.25, 15,
|
||||
-4.9500003, 7.5,
|
||||
-7.3500004, 0,
|
||||
17.25, 15,
|
||||
19.95, 7.5,
|
||||
22.35, 0
|
||||
};
|
||||
float lbl_1_data_518[26][2] = { 0, 30, 0.5, 30, 7.5, 30, 14.5, 30, 15, 30, 0, 15, 0.5, 15, 7.5, 15, 14.5, 15, 15, 15, 0, 7.5, 0.5, 7.5, 7.5, 7.5,
|
||||
14.5, 7.5, 15, 7.5, 0, 0, 0.5, 0, 7.5, 0, 14.5, 0, 15, 0, -2.25, 15, -4.9500003, 7.5, -7.3500004, 0, 17.25, 15, 19.95, 7.5, 22.35, 0 };
|
||||
|
||||
float lbl_1_data_5E8[2][3] = {
|
||||
0, 0, 0.5,
|
||||
0, 0.5, 0
|
||||
};
|
||||
float lbl_1_data_5E8[2][3] = { 0, 0, 0.5, 0, 0.5, 0 };
|
||||
|
||||
GXColor lbl_1_data_600 = { 80, 80, 80, 80 };
|
||||
|
||||
Vec lbl_1_data_604[9] = {
|
||||
-1500, 0, -5000,
|
||||
0, 0, -5000,
|
||||
1500, 0, -5000,
|
||||
-1500, 0, -3000,
|
||||
0, 0, -3000,
|
||||
1500, 0, -3000,
|
||||
-1500, 0, 1000,
|
||||
0, 0, 1000,
|
||||
1500, 0, 1000
|
||||
};
|
||||
Vec lbl_1_data_604[9]
|
||||
= { -1500, 0, -5000, 0, 0, -5000, 1500, 0, -5000, -1500, 0, -3000, 0, 0, -3000, 1500, 0, -3000, -1500, 0, 1000, 0, 0, 1000, 1500, 0, 1000 };
|
||||
|
||||
GXColor lbl_1_data_670[9] = {
|
||||
{ 255, 255, 255, 0 },
|
||||
|
|
@ -540,7 +425,7 @@ void fn_1_4180(ModelData *model, Mtx matrix)
|
|||
mtxRotCat(modelview, 0, 0, workUnk74->unkC.y);
|
||||
mtxTransCat(modelview, 400 * (workUnk74->unk0.x + 1500) / 3000, 400 * (workUnk74->unk0.z - -2000) / 3000, 0);
|
||||
GXLoadPosMtxImm(modelview, GX_PNMTX0);
|
||||
GXCallDisplayList(work2->unkA14, work2->unkA18);
|
||||
GXCallDisplayListNative(work2->unkA14, work2->unkA18);
|
||||
if (!omPauseChk()) {
|
||||
workUnk74->unk1E--;
|
||||
}
|
||||
|
|
@ -730,9 +615,11 @@ void fn_1_4E64(ModelData *model, Mtx matrix)
|
|||
s16 index;
|
||||
if (i == 4) {
|
||||
index = 12;
|
||||
} else if(i == 9) {
|
||||
}
|
||||
else if (i == 9) {
|
||||
index = 13;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
index = i;
|
||||
}
|
||||
GXPosition1x16(index + 0);
|
||||
|
|
@ -918,7 +805,6 @@ void fn_1_6088(Work347CUnk4 *arg0, s32 arg1)
|
|||
GXSetTexCopyDst(arg0->unk14, arg0->unk18, GX_TF_RGB565, arg0->unk8);
|
||||
GXSetCopyClear(lbl_1_data_69C, GX_MAX_Z24);
|
||||
GXCopyTex(arg0->unk0, arg1);
|
||||
|
||||
}
|
||||
|
||||
void fn_1_6144(Work347CUnk4 *fbWork, float x1, float y1, float scale)
|
||||
|
|
@ -973,7 +859,8 @@ void fn_1_6594(s16 arg0, Work347CUnk4 *arg1, GXTexWrapMode arg2, s32 arg3, BOOL
|
|||
GXInitTexObj(&texObj, arg1->unk0, arg1->unk14, arg1->unk18, GX_TF_RGB565, arg2, arg2, FALSE);
|
||||
if (arg4) {
|
||||
GXInitTexObjLOD(&texObj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
GXInitTexObjLOD(&texObj, GX_NEAR, GX_NEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
|
||||
}
|
||||
GXLoadTexObj(&texObj, arg0);
|
||||
|
|
@ -1005,17 +892,20 @@ s32 fn_1_6698(Vec *arg0, float arg1, float arg2, s32 arg3)
|
|||
workUnk74->unk0 = *arg0;
|
||||
if (arg1 < 0.0f) {
|
||||
workUnk74->unkC.x = 1;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
workUnk74->unkC.x = arg1;
|
||||
}
|
||||
if (arg2 < 0.0f) {
|
||||
workUnk74->unkC.z = 1;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
workUnk74->unkC.z = arg2;
|
||||
}
|
||||
if (arg3 < 0) {
|
||||
workUnk74->unk1C = 60;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
workUnk74->unk1C = arg3;
|
||||
}
|
||||
workUnk74->unkC.y = (s32)frand() % 360;
|
||||
|
|
@ -1028,7 +918,8 @@ float fn_1_687C(void)
|
|||
{
|
||||
if (!lbl_1_bss_6C) {
|
||||
return 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Work347C *work = lbl_1_bss_6C->data;
|
||||
return work->unkA44;
|
||||
}
|
||||
|
|
@ -1038,7 +929,8 @@ float fn_1_68C8(void)
|
|||
{
|
||||
if (!lbl_1_bss_6C) {
|
||||
return 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Work347C *work = lbl_1_bss_6C->data;
|
||||
return work->unkA40;
|
||||
}
|
||||
|
|
@ -1100,7 +992,8 @@ void fn_1_6A6C(omObjData *object)
|
|||
s32 alpha = data->unk40.a - 1;
|
||||
if (alpha < 0) {
|
||||
data->unk2C = 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
data->unk40.a = alpha;
|
||||
}
|
||||
}
|
||||
|
|
@ -1114,7 +1007,8 @@ void fn_1_6A6C(omObjData *object)
|
|||
if (++work->unkC > 90.0f) {
|
||||
Hu3DModelAttrSet(work->unk4, HU3D_ATTR_DISPOFF);
|
||||
work->unk8 = 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Hu3DModelPosSet(work->unk4, work->unk14.x, work->unk14.y, work->unk14.z);
|
||||
Hu3DModelRotSet(work->unk4, work->unk20.x, work->unk20.y, work->unk20.z);
|
||||
Hu3DModelScaleSet(work->unk4, work->unk2C.x, work->unk2C.y, work->unk2C.z);
|
||||
|
|
@ -1195,13 +1089,13 @@ void fn_1_7280(omObjData *object)
|
|||
for (i = 0; i < object->mdlcnt; i++) {
|
||||
if (i == 0) {
|
||||
object->model[i] = Hu3DModelCreateFile(DATA_MAKE_NUM(DATADIR_M455, 9));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
object->model[i] = Hu3DModelLink(object->model[0]);
|
||||
}
|
||||
Hu3DModelCameraSet(object->model[i], HU3D_CAM0);
|
||||
Hu3DModelLayerSet(object->model[i], 6);
|
||||
Hu3DModelAttrSet(object->model[i], HU3D_ATTR_DISPOFF);
|
||||
|
||||
}
|
||||
object->stat |= 0x100;
|
||||
object->func = fn_1_7368;
|
||||
|
|
@ -1220,10 +1114,7 @@ void fn_1_7368(omObjData *object)
|
|||
}
|
||||
}
|
||||
|
||||
void fn_1_7430(omObjData *object)
|
||||
{
|
||||
|
||||
}
|
||||
void fn_1_7430(omObjData *object) { }
|
||||
|
||||
s32 fn_1_7434(Vec *pos, float scale)
|
||||
{
|
||||
|
|
@ -1289,7 +1180,6 @@ void fn_1_76B0(omObjData *object)
|
|||
fn_1_6698(&temp_r30->unk34, 0.00625f * temp_r30->unk2C, 1, 15);
|
||||
temp_r30->unk2C = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1327,7 +1217,6 @@ s32 fn_1_79C8(Vec *pos, float scale)
|
|||
return i;
|
||||
}
|
||||
|
||||
|
||||
typedef struct work7C48 {
|
||||
s32 unk0;
|
||||
s32 unk4;
|
||||
|
|
@ -1359,7 +1248,8 @@ void fn_1_7C48(omObjData *object)
|
|||
default:
|
||||
if (i & 0x1) {
|
||||
workP->unk0 = Hu3DModelLink(workBase[0].unk0);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
workP->unk0 = Hu3DModelLink(workBase[1].unk0);
|
||||
}
|
||||
break;
|
||||
|
|
@ -1396,7 +1286,8 @@ void fn_1_8050(omObjData *object)
|
|||
float angle;
|
||||
if (workP->unk4 == 0) {
|
||||
vel = 1 + (0.5 * sind((workP->unk8 * 5) % 180));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
vel = 3;
|
||||
}
|
||||
workP->unk14.x += vel * (workP->unkC * sind(workP->unk10));
|
||||
|
|
@ -1410,10 +1301,12 @@ void fn_1_8050(omObjData *object)
|
|||
workP->unk20.x = 2000 * ((0.007874016f * ((s32)frand() & 0x7F)) - 0.5f);
|
||||
workP->unk20.z = 700 * ((0.007874016f * ((s32)frand() & 0x7F)) - 0.5f);
|
||||
workP->unk20.y = workP->unk14.y;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (workP->unk14.x < 0.0f) {
|
||||
workP->unk20.x = -2500;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
workP->unk20.x = 2500;
|
||||
}
|
||||
workP->unk20.z = 500 * ((0.007874016f * ((s32)frand() & 0x7F)) - 0.5f);
|
||||
|
|
@ -1426,10 +1319,7 @@ void fn_1_8050(omObjData *object)
|
|||
}
|
||||
}
|
||||
|
||||
void fn_1_8474(omObjData *object)
|
||||
{
|
||||
|
||||
}
|
||||
void fn_1_8474(omObjData *object) { }
|
||||
|
||||
void fn_1_8478(void)
|
||||
{
|
||||
|
|
@ -1439,7 +1329,8 @@ void fn_1_8478(void)
|
|||
workP->unk4 = 1;
|
||||
if (workP->unk14.x < 0.0f) {
|
||||
workP->unk20.x = -2500;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
workP->unk20.x = 2500;
|
||||
}
|
||||
workP->unk20.z = 500 * ((0.007874016f * ((s32)frand() & 0x7F)) - 0.5f);
|
||||
|
|
@ -1500,7 +1391,6 @@ void fn_1_867C(omObjData *object)
|
|||
workP->unk30 += workP->unk20 * 0.016666668f;
|
||||
}
|
||||
fn_1_8578(object, object->data);
|
||||
|
||||
}
|
||||
|
||||
void fn_1_891C(omObjData *object)
|
||||
|
|
@ -1628,19 +1518,9 @@ void fn_1_9168(void)
|
|||
HuSprAnimKill(workP->unk0[3]);
|
||||
}
|
||||
|
||||
float lbl_1_data_6A0[4] = {
|
||||
1000,
|
||||
200,
|
||||
600,
|
||||
1200
|
||||
};
|
||||
float lbl_1_data_6A0[4] = { 1000, 200, 600, 1200 };
|
||||
|
||||
float lbl_1_data_6B0[4] = {
|
||||
1,
|
||||
0.6,
|
||||
0.3,
|
||||
0.425
|
||||
};
|
||||
float lbl_1_data_6B0[4] = { 1, 0.6, 0.3, 0.425 };
|
||||
|
||||
void fn_1_91B8(ModelData *model, ParticleData *particle, Mtx matrix)
|
||||
{
|
||||
|
|
@ -1680,15 +1560,18 @@ void fn_1_91B8(ModelData *model, ParticleData *particle, Mtx matrix)
|
|||
temp_r31->unk34.x = 1000 + (temp_f26 * sp18.x);
|
||||
temp_r31->unk34.y = 4800 + (temp_f26 * sp18.y);
|
||||
temp_r31->unk34.z = -3500 + (temp_f26 * sp18.z);
|
||||
temp_r31->unk2C = ((0.7f*(temp_f25*temp_f25))+0.3f)*(lbl_1_data_6A0[newWorkP[1]]*(0.7f+(0.3f*((float)((s32)frand() & 0xFFFF)*0.0000152587890625))));
|
||||
temp_r31->unk2C = ((0.7f * (temp_f25 * temp_f25)) + 0.3f)
|
||||
* (lbl_1_data_6A0[newWorkP[1]] * (0.7f + (0.3f * ((float)((s32)frand() & 0xFFFF) * 0.0000152587890625))));
|
||||
temp_r31->unk40.r = (s32)(((float)((s32)frand() & 0xFFFF) * 0.0000152587890625) * 160.0) + 32;
|
||||
temp_r31->unk40.g = (s32)(((float)((s32)frand() & 0xFFFF) * 0.0000152587890625) * 96.0) + 32;
|
||||
temp_r31->unk40.b = (s32)(((float)((s32)frand() & 0xFFFF) * 0.0000152587890625) * 128.0) + 32;
|
||||
temp_r31->unk40.a = (255*lbl_1_data_6B0[newWorkP[1]]*(1.0-(0.4*temp_f25)))-(s32)(((float)((s32)frand() & 0xFFFF)*0.0000152587890625)*16.0);
|
||||
temp_r31->unk40.a = (255 * lbl_1_data_6B0[newWorkP[1]] * (1.0 - (0.4 * temp_f25)))
|
||||
- (s32)(((float)((s32)frand() & 0xFFFF) * 0.0000152587890625) * 16.0);
|
||||
temp_r31->unk14.z = temp_r31->unk40.a;
|
||||
}
|
||||
newWorkP[2]++;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
temp_r31->unk34.x = 1000;
|
||||
temp_r31->unk34.y = 4800;
|
||||
temp_r31->unk34.z = -3500;
|
||||
|
|
@ -1721,7 +1604,6 @@ void fn_1_91B8(ModelData *model, ParticleData *particle, Mtx matrix)
|
|||
break;
|
||||
}
|
||||
DCFlushRange(particle->unk_48, particle->unk_30 * sizeof(HsfanimStruct01));
|
||||
|
||||
}
|
||||
|
||||
void fn_1_9CFC(float arg0)
|
||||
|
|
@ -1736,7 +1618,8 @@ void fn_1_9CFC(float arg0)
|
|||
Hu3DModelAttrSet(workP->unk10[1], HU3D_ATTR_DISPOFF);
|
||||
Hu3DModelAttrSet(workP->unk10[2], HU3D_ATTR_DISPOFF);
|
||||
Hu3DModelAttrSet(workP->unk10[3], HU3D_ATTR_DISPOFF);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Hu3DModelAttrReset(workP->unk10[0], HU3D_ATTR_DISPOFF);
|
||||
Hu3DModelAttrReset(workP->unk10[1], HU3D_ATTR_DISPOFF);
|
||||
Hu3DModelAttrReset(workP->unk10[2], HU3D_ATTR_DISPOFF);
|
||||
|
|
@ -1749,18 +1632,21 @@ float fn_1_9E00(float start, float end)
|
|||
float angleDiff;
|
||||
if (start >= 360.0f) {
|
||||
start -= 360.0f;
|
||||
} else if(start < 0.0f) {
|
||||
}
|
||||
else if (start < 0.0f) {
|
||||
start += 360.0f;
|
||||
}
|
||||
if (end >= 360.0f) {
|
||||
end -= 360.0f;
|
||||
} else if(end < 0.0f) {
|
||||
}
|
||||
else if (end < 0.0f) {
|
||||
end += 360.0f;
|
||||
}
|
||||
angleDiff = start - end;
|
||||
if (angleDiff <= -180.0f) {
|
||||
angleDiff += 360.0f;
|
||||
} else if(angleDiff >= 180.0f) {
|
||||
}
|
||||
else if (angleDiff >= 180.0f) {
|
||||
angleDiff -= 360.0f;
|
||||
}
|
||||
return angleDiff;
|
||||
|
|
@ -1773,12 +1659,14 @@ float fn_1_9F18(float start, float end, float max)
|
|||
|
||||
if (start >= 360.0) {
|
||||
start -= 360.0;
|
||||
} else if(start < 0.0) {
|
||||
}
|
||||
else if (start < 0.0) {
|
||||
start += 360.0;
|
||||
}
|
||||
if (end >= 360.0) {
|
||||
end -= 360.0;
|
||||
} else if(end < 0.0) {
|
||||
}
|
||||
else if (end < 0.0) {
|
||||
end += 360.0;
|
||||
}
|
||||
diff = 360.0 + (start - end);
|
||||
|
|
@ -1788,18 +1676,22 @@ float fn_1_9F18(float start, float end, float max)
|
|||
if (diff < 180.0) {
|
||||
if (diff <= max) {
|
||||
angle = diff;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
angle = max;
|
||||
}
|
||||
} else if(360.0-diff <= max) {
|
||||
}
|
||||
else if (360.0 - diff <= max) {
|
||||
angle = -(360.0 - diff);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
angle = -max;
|
||||
}
|
||||
angle += end;
|
||||
if (angle >= 360.0) {
|
||||
angle -= 360.0;
|
||||
} else if(angle < 0.0) {
|
||||
}
|
||||
else if (angle < 0.0) {
|
||||
angle += 360.0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
#include "game/hsfanim.h"
|
||||
#include "game/hsfdraw.h"
|
||||
#include "game/hsfmotion.h"
|
||||
#include "game/hsfman.h"
|
||||
#include "game/hsfmotion.h"
|
||||
#include "game/object.h"
|
||||
#include "game/objsub.h"
|
||||
#include "game/sprite.h"
|
||||
|
||||
|
||||
#include "REL/m456Dll.h"
|
||||
|
||||
#include "ext_math.h"
|
||||
|
|
@ -425,7 +426,7 @@ void fn_1_3CB0(ModelData *model, Mtx matrix)
|
|||
mtxRotCat(modelview, 0, 0, workUnk74->unkC.y);
|
||||
mtxTransCat(modelview, 400 * (workUnk74->unk0.x + 1500) / 3000, 400 * (workUnk74->unk0.z - -2000) / 3000, 0);
|
||||
GXLoadPosMtxImm(modelview, GX_PNMTX0);
|
||||
GXCallDisplayList(work2->unkA14, work2->unkA18);
|
||||
GXCallDisplayListNative(work2->unkA14, work2->unkA18);
|
||||
if (!omPauseChk()) {
|
||||
workUnk74->unk1E--;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ u32 HuAR_DVDtoARAM(u32 dir) {
|
|||
block = HuARInfoGet(amemptr);
|
||||
block->dir = (dir >> 16);
|
||||
arqCnt++;
|
||||
ARQPostRequest(&arqReq, 0x1234, 0, 0, (u32) stat->dir, amemptr, DirDataSize, ArqCallBack);
|
||||
ARQPostRequest(&arqReq, 0x1234, 0, 0, (uintptr_t) stat->dir, amemptr, DirDataSize, ArqCallBack);
|
||||
OSReport("ARAM Trans %x\n", amemptr);
|
||||
while (HuARDMACheck());
|
||||
HuDataDirClose(dir);
|
||||
|
|
@ -289,7 +289,7 @@ void *HuAR_ARAMtoMRAMNum(u32 src, s32 num) {
|
|||
return dst;
|
||||
}
|
||||
|
||||
static void ArqCallBackAM(u32 pointerToARQRequest) {
|
||||
static void ArqCallBackAM(uintptr_t pointerToARQRequest) {
|
||||
ARQueReq *req_ptr = (ARQueReq*) pointerToARQRequest;
|
||||
|
||||
arqCnt--;
|
||||
|
|
|
|||
|
|
@ -836,7 +836,7 @@ static void particleFunc(ModelData *arg0, Mtx arg1) {
|
|||
GXSetVtxDesc(GX_VA_TEX0, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_TEX0, baseST, sizeof(baseST), 8);
|
||||
GXCallDisplayList(temp_r31->unk_50, temp_r31->unk_40);
|
||||
GXCallDisplayListNative(temp_r31->unk_50, temp_r31->unk_40);
|
||||
}
|
||||
if (shadowModelDrawF == 0) {
|
||||
if (!(temp_r31->unk_2D & 2) && Hu3DPauseF == 0) {
|
||||
|
|
|
|||
|
|
@ -512,16 +512,16 @@ static void FaceDraw(HsfDrawObject *arg0, HsfFace *arg1)
|
|||
GXSetVtxDesc(GX_VA_NRM, GX_INDEX16);
|
||||
if (temp_r29->hsfData->cenvCnt == 0) {
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_S8, 0);
|
||||
GXSETARRAY(GX_VA_NRM, temp_r28->data.normal->data, temp_r28->data.vertex->count * 3, 3);
|
||||
GXSETARRAY(GX_VA_NRM, temp_r28->data.normal->data, temp_r28->data.normal->count * 3, 3);
|
||||
}
|
||||
else {
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_NRM, temp_r28->data.normal->data, temp_r28->data.vertex->count * sizeof(Vec), sizeof(Vec));
|
||||
GXSETARRAY(GX_VA_NRM, temp_r28->data.normal->data, temp_r28->data.normal->count * sizeof(Vec), sizeof(Vec));
|
||||
}
|
||||
if (var_r22 & 4) {
|
||||
GXSetVtxDesc(GX_VA_CLR0, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
GXSETARRAY(GX_VA_CLR0, temp_r28->data.color->data, temp_r28->data.vertex->count * sizeof(GXColor), sizeof(GXColor));
|
||||
GXSETARRAY(GX_VA_CLR0, temp_r28->data.color->data, temp_r28->data.color->count * sizeof(GXColor), sizeof(GXColor));
|
||||
}
|
||||
GXSetZCompLoc(1);
|
||||
}
|
||||
|
|
@ -748,11 +748,11 @@ static void FaceDraw(HsfDrawObject *arg0, HsfFace *arg1)
|
|||
SetTevStageTex(arg0, temp_r30);
|
||||
}
|
||||
sp28 = (u8 *)DLBufStartP + DrawData[drawCnt].dlOfs;
|
||||
GXCALLDISPLAYLISTLE(sp28, DrawData[drawCnt].dlSize);
|
||||
GXCallDisplayListNative(sp28, DrawData[drawCnt].dlSize);
|
||||
}
|
||||
else {
|
||||
sp28 = (u8 *)DLBufStartP + DrawData[drawCnt].dlOfs;
|
||||
GXCALLDISPLAYLISTLE(sp28, DrawData[drawCnt].dlSize);
|
||||
GXCallDisplayListNative(sp28, DrawData[drawCnt].dlSize);
|
||||
}
|
||||
drawCnt++;
|
||||
}
|
||||
|
|
@ -1734,16 +1734,16 @@ static void FaceDrawShadow(HsfDrawObject *arg0, HsfFace *arg1)
|
|||
GXSetVtxDesc(GX_VA_NRM, GX_INDEX16);
|
||||
if (temp_r28->hsfData->cenvCnt == 0) {
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_S8, 0);
|
||||
GXSETARRAY(GX_VA_NRM, temp_r31->data.normal->data, temp_r31->data.vertex->count * 3, 3);
|
||||
GXSETARRAY(GX_VA_NRM, temp_r31->data.normal->data, temp_r31->data.normal->count * 3, 3);
|
||||
}
|
||||
else {
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_NRM, temp_r31->data.normal->data, temp_r31->data.vertex->count * sizeof(Vec), sizeof(Vec));
|
||||
GXSETARRAY(GX_VA_NRM, temp_r31->data.normal->data, temp_r31->data.normal->count * sizeof(Vec), sizeof(Vec));
|
||||
}
|
||||
if (var_r30 & 4) {
|
||||
GXSetVtxDesc(GX_VA_CLR0, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
GXSETARRAY(GX_VA_CLR0, temp_r31->data.color->data, temp_r31->data.vertex->count * sizeof(GXColor), sizeof(GXColor));
|
||||
GXSETARRAY(GX_VA_CLR0, temp_r31->data.color->data, temp_r31->data.color->count * sizeof(GXColor), sizeof(GXColor));
|
||||
}
|
||||
GXSetZCompLoc(1);
|
||||
}
|
||||
|
|
@ -1774,20 +1774,20 @@ static void FaceDrawShadow(HsfDrawObject *arg0, HsfFace *arg1)
|
|||
GXSetVtxDesc(GX_VA_NRM, GX_INDEX16);
|
||||
if (temp_r28->hsfData->cenvCnt == 0) {
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_S8, 0);
|
||||
GXSETARRAY(GX_VA_NRM, temp_r31->data.normal->data, temp_r31->data.vertex->count * 3, 3);
|
||||
GXSETARRAY(GX_VA_NRM, temp_r31->data.normal->data, temp_r31->data.normal->count * 3, 3);
|
||||
}
|
||||
else {
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_NRM, temp_r31->data.normal->data, temp_r31->data.vertex->count * sizeof(Vec), sizeof(Vec));
|
||||
GXSETARRAY(GX_VA_NRM, temp_r31->data.normal->data, temp_r31->data.normal->count * sizeof(Vec), sizeof(Vec));
|
||||
}
|
||||
}
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
|
||||
GXSETARRAY(GX_VA_TEX0, temp_r31->data.st->data, temp_r31->data.vertex->count * sizeof(Vec2f), sizeof(Vec2f));
|
||||
GXSETARRAY(GX_VA_TEX0, temp_r31->data.st->data, temp_r31->data.st->count * sizeof(Vec2f), sizeof(Vec2f));
|
||||
if (var_r30 & 4) {
|
||||
GXSetVtxDesc(GX_VA_CLR0, GX_INDEX16);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
GXSETARRAY(GX_VA_CLR0, temp_r31->data.color->data, temp_r31->data.vertex->count * sizeof(GXColor), sizeof(GXColor));
|
||||
GXSETARRAY(GX_VA_CLR0, temp_r31->data.color->data, temp_r31->data.color->count * sizeof(GXColor), sizeof(GXColor));
|
||||
}
|
||||
GXSetZCompLoc(0);
|
||||
}
|
||||
|
|
@ -1802,7 +1802,7 @@ static void FaceDrawShadow(HsfDrawObject *arg0, HsfFace *arg1)
|
|||
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE);
|
||||
GXSetChanCtrl(GX_COLOR1A1, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE);
|
||||
var_r26 = (u8 *)DLBufStartP + DrawData[drawCnt].dlOfs;
|
||||
// GXCALLDISPLAYLISTLE(var_r26, DrawData[drawCnt].dlSize);
|
||||
//GXCallDisplayListNative(var_r26, DrawData[drawCnt].dlSize);
|
||||
}
|
||||
else {
|
||||
if (!(temp_r27->flags & 0x400)) {
|
||||
|
|
@ -1810,7 +1810,7 @@ static void FaceDrawShadow(HsfDrawObject *arg0, HsfFace *arg1)
|
|||
return;
|
||||
}
|
||||
var_r26 = (u8 *)DLBufStartP + DrawData[drawCnt].dlOfs;
|
||||
// GXCALLDISPLAYLISTLE(var_r26, DrawData[drawCnt].dlSize);
|
||||
//GXCallDisplayListNative(var_r26, DrawData[drawCnt].dlSize);
|
||||
}
|
||||
drawCnt++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1902,60 +1902,60 @@ static char *GetMotionString(u16 *str_ofs)
|
|||
void KillHSF(HsfData *data)
|
||||
{
|
||||
s32 i, j;
|
||||
if (data->attributeCnt)
|
||||
HuMemDirectFree(data->attribute);
|
||||
if (data->bitmapCnt)
|
||||
HuMemDirectFree(data->bitmap);
|
||||
if (data->skeletonCnt)
|
||||
HuMemDirectFree(data->skeleton);
|
||||
if (data->faceCnt) {
|
||||
for (i = 0; i < data->faceCnt; i++) {
|
||||
HuMemDirectFree(data->face[i].data);
|
||||
}
|
||||
HuMemDirectFree(data->face);
|
||||
}
|
||||
if (data->materialCnt)
|
||||
HuMemDirectFree(data->material);
|
||||
if (data->motionCnt) {
|
||||
HsfMotion *motion = data->motion;
|
||||
for (j = 0; j < motion->numTracks; j++) {
|
||||
HsfTrack *track = motion->track;
|
||||
if (track->type == HSF_TRACK_ATTRIBUTE && track->curveType == HSF_CURVE_BITMAP) {
|
||||
// in this case we needed to allocate space for HsfBitmapKey structs
|
||||
HuMemDirectFree(track->dataTop);
|
||||
}
|
||||
}
|
||||
HuMemDirectFree(motion->track);
|
||||
HuMemDirectFree(data->motion);
|
||||
}
|
||||
if (data->normalCnt)
|
||||
HuMemDirectFree(data->normal);
|
||||
if (data->objectCnt)
|
||||
HuMemDirectFree(data->object);
|
||||
if (data->matrixCnt)
|
||||
HuMemDirectFree(data->matrix);
|
||||
if (data->paletteCnt)
|
||||
HuMemDirectFree(data->palette);
|
||||
if (data->stCnt)
|
||||
HuMemDirectFree(data->st);
|
||||
if (data->vertexCnt)
|
||||
HuMemDirectFree(data->vertex);
|
||||
if (data->cenvCnt) {
|
||||
for (i = 0; i < data->cenvCnt; i++) {
|
||||
HsfCenv *cenv = &data->cenv[i];
|
||||
HuMemDirectFree(cenv->dualData);
|
||||
HuMemDirectFree(cenv->multiData);
|
||||
}
|
||||
HuMemDirectFree(data->cenv);
|
||||
}
|
||||
if (data->clusterCnt)
|
||||
HuMemDirectFree(data->cluster);
|
||||
if (data->partCnt)
|
||||
HuMemDirectFree(data->part);
|
||||
if (data->shapeCnt)
|
||||
HuMemDirectFree(data->shape);
|
||||
if (data->mapAttrCnt)
|
||||
HuMemDirectFree(data->mapAttr);
|
||||
HuMemDirectFree(data->symbol);
|
||||
// if (data->attributeCnt)
|
||||
// HuMemDirectFree(data->attribute);
|
||||
// if (data->bitmapCnt)
|
||||
// HuMemDirectFree(data->bitmap);
|
||||
// if (data->skeletonCnt)
|
||||
// HuMemDirectFree(data->skeleton);
|
||||
// if (data->faceCnt) {
|
||||
// for (i = 0; i < data->faceCnt; i++) {
|
||||
// HuMemDirectFree(data->face[i].data);
|
||||
// }
|
||||
// HuMemDirectFree(data->face);
|
||||
// }
|
||||
// if (data->materialCnt)
|
||||
// HuMemDirectFree(data->material);
|
||||
// if (data->motionCnt) {
|
||||
// HsfMotion *motion = data->motion;
|
||||
// for (j = 0; j < motion->numTracks; j++) {
|
||||
// HsfTrack *track = motion->track;
|
||||
// if (track->type == HSF_TRACK_ATTRIBUTE && track->curveType == HSF_CURVE_BITMAP) {
|
||||
// // in this case we needed to allocate space for HsfBitmapKey structs
|
||||
// HuMemDirectFree(track->dataTop);
|
||||
// }
|
||||
// }
|
||||
// HuMemDirectFree(motion->track);
|
||||
// HuMemDirectFree(data->motion);
|
||||
// }
|
||||
// if (data->normalCnt)
|
||||
// HuMemDirectFree(data->normal);
|
||||
// if (data->objectCnt)
|
||||
// HuMemDirectFree(data->object);
|
||||
// if (data->matrixCnt)
|
||||
// HuMemDirectFree(data->matrix);
|
||||
// if (data->paletteCnt)
|
||||
// HuMemDirectFree(data->palette);
|
||||
// if (data->stCnt)
|
||||
// HuMemDirectFree(data->st);
|
||||
// if (data->vertexCnt)
|
||||
// HuMemDirectFree(data->vertex);
|
||||
// if (data->cenvCnt) {
|
||||
// for (i = 0; i < data->cenvCnt; i++) {
|
||||
// HsfCenv *cenv = &data->cenv[i];
|
||||
// HuMemDirectFree(cenv->dualData);
|
||||
// HuMemDirectFree(cenv->multiData);
|
||||
// }
|
||||
// HuMemDirectFree(data->cenv);
|
||||
// }
|
||||
// if (data->clusterCnt)
|
||||
// HuMemDirectFree(data->cluster);
|
||||
// if (data->partCnt)
|
||||
// HuMemDirectFree(data->part);
|
||||
// if (data->shapeCnt)
|
||||
// HuMemDirectFree(data->shape);
|
||||
// if (data->mapAttrCnt)
|
||||
// HuMemDirectFree(data->mapAttr);
|
||||
// HuMemDirectFree(data->symbol);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,20 +1,24 @@
|
|||
#include "game/process.h"
|
||||
#include "dolphin/os.h"
|
||||
#include "game/jmp.h"
|
||||
#include "game/memory.h"
|
||||
|
||||
#define FAKE_RETADDR 0xA5A5A5A5
|
||||
|
||||
#ifdef TARGET_PC
|
||||
#include <stdio.h>
|
||||
#ifdef __MWERKS__
|
||||
#include "game/jmp.h"
|
||||
#endif
|
||||
|
||||
#define FAKE_RETADDR 0xA5A5A5A5
|
||||
|
||||
#define EXEC_NORMAL 0
|
||||
#define EXEC_SLEEP 1
|
||||
#define EXEC_CHILDWATCH 2
|
||||
#define EXEC_KILLED 3
|
||||
|
||||
static JMPBUF processjmpbuf;
|
||||
#ifdef TARGET_PC
|
||||
static cothread_t processthread;
|
||||
static u8 thread_arg;
|
||||
#else
|
||||
static jmp_buf processjmpbuf;
|
||||
#endif
|
||||
static Process *processtop;
|
||||
static Process *processcur;
|
||||
static u16 processcnt;
|
||||
|
|
@ -74,8 +78,10 @@ Process *HuPrcCreate(void (*func)(void), u16 prio, u32 stack_size, s32 extra_siz
|
|||
}
|
||||
#ifdef TARGET_PC
|
||||
stack_size *= 2;
|
||||
#endif
|
||||
alloc_size = HuMemMemoryAllocSizeGet(sizeof(Process)) + HuMemMemoryAllocSizeGet(extra_size);
|
||||
#else
|
||||
alloc_size = HuMemMemoryAllocSizeGet(sizeof(Process)) + HuMemMemoryAllocSizeGet(stack_size) + HuMemMemoryAllocSizeGet(extra_size);
|
||||
#endif
|
||||
if (!(heap = HuMemDirectMalloc(HEAP_SYSTEM, alloc_size))) {
|
||||
OSReport("process> malloc error size %d\n", alloc_size);
|
||||
return NULL;
|
||||
|
|
@ -87,10 +93,14 @@ Process *HuPrcCreate(void (*func)(void), u16 prio, u32 stack_size, s32 extra_siz
|
|||
process->stat = 0;
|
||||
process->prio = prio;
|
||||
process->sleep_time = 0;
|
||||
#ifdef TARGET_PC
|
||||
process->thread = co_create(stack_size, func);
|
||||
#else
|
||||
process->base_sp = ((uintptr_t)HuMemMemoryAlloc(heap, stack_size, FAKE_RETADDR)) + stack_size - 8;
|
||||
SETJMP(process->jump);
|
||||
SETJMP_SET_IP(process->jump, func);
|
||||
SETJMP_SET_SP(process->jump, process->base_sp);
|
||||
gcsetjmp(&process->jump);
|
||||
process->jump.lr = (u32)func;
|
||||
process->jump.sp = process->base_sp;
|
||||
#endif
|
||||
process->dtor = NULL;
|
||||
process->user_data = NULL;
|
||||
LinkProcess(&processtop, process);
|
||||
|
|
@ -140,10 +150,16 @@ void HuPrcChildWatch()
|
|||
Process *curr = HuPrcCurrentGet();
|
||||
if (curr->child) {
|
||||
curr->exec = EXEC_CHILDWATCH;
|
||||
if (SETJMP(curr->jump) == 0)
|
||||
|
||||
#ifdef TARGET_PC
|
||||
thread_arg = 1;
|
||||
co_switch(processthread);
|
||||
#else
|
||||
if (gcsetjmp(&curr->jump) == 0)
|
||||
{
|
||||
LONGJMP(processjmpbuf, 1);
|
||||
gclongjmp(&processjmpbuf, 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -194,7 +210,11 @@ static void gcTerminateProcess(Process *process)
|
|||
}
|
||||
UnlinkProcess(&processtop, process);
|
||||
processcnt--;
|
||||
LONGJMP(processjmpbuf, 2);
|
||||
#ifdef TARGET_PC
|
||||
thread_arg = 2;
|
||||
#else
|
||||
gclongjmp(&processjmpbuf, 2);
|
||||
#endif
|
||||
}
|
||||
|
||||
void HuPrcEnd()
|
||||
|
|
@ -212,9 +232,14 @@ void HuPrcSleep(s32 time)
|
|||
process->exec = EXEC_SLEEP;
|
||||
process->sleep_time = time;
|
||||
}
|
||||
if (SETJMP(process->jump) == 0) {
|
||||
LONGJMP(processjmpbuf, 1);
|
||||
#ifdef TARGET_PC
|
||||
thread_arg = 1;
|
||||
co_switch(processthread);
|
||||
#else
|
||||
if (gcsetjmp(&process->jump) == 0) {
|
||||
gclongjmp(&processjmpbuf, 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void HuPrcVSleep()
|
||||
|
|
@ -243,15 +268,29 @@ void HuPrcCall(s32 tick)
|
|||
Process *process;
|
||||
s32 ret;
|
||||
processcur = processtop;
|
||||
ret = SETJMP(processjmpbuf);
|
||||
#ifdef TARGET_PC
|
||||
thread_arg = ret = 0;
|
||||
processthread = co_active();
|
||||
while (1) {
|
||||
ret = thread_arg;
|
||||
switch (ret) {
|
||||
case 2:
|
||||
co_delete(processcur->thread);
|
||||
#else
|
||||
ret = gcsetjmp(&processjmpbuf);
|
||||
while (1) {
|
||||
switch (ret) {
|
||||
case 2:
|
||||
#endif
|
||||
HuMemDirectFree(processcur->heap);
|
||||
case 1:
|
||||
#ifdef TARGET_PC
|
||||
processcur = processcur->next;
|
||||
#else
|
||||
#ifdef NON_MATCHING
|
||||
// avoid dereferencing NULL
|
||||
if (!processcur) {
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
// memory_block->magic
|
||||
if (((u8 *)(processcur->heap))[4] != 165) {
|
||||
printf("stack overlap error.(process pointer %x)\n", processcur);
|
||||
while (1)
|
||||
|
|
@ -260,7 +299,6 @@ void HuPrcCall(s32 tick)
|
|||
else {
|
||||
processcur = processcur->next;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
process = processcur;
|
||||
|
|
@ -272,6 +310,9 @@ void HuPrcCall(s32 tick)
|
|||
procfunc = process->jump.lr;
|
||||
#endif
|
||||
if ((process->stat & (PROCESS_STAT_PAUSE | PROCESS_STAT_UPAUSE)) && process->exec != EXEC_KILLED) {
|
||||
#ifdef TARGET_PC
|
||||
thread_arg = 1;
|
||||
#endif
|
||||
ret = 1;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -284,23 +325,41 @@ void HuPrcCall(s32 tick)
|
|||
process->exec = EXEC_NORMAL;
|
||||
}
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
thread_arg = 1;
|
||||
#endif
|
||||
ret = 1;
|
||||
break;
|
||||
|
||||
case EXEC_CHILDWATCH:
|
||||
if (process->child) {
|
||||
#ifdef TARGET_PC
|
||||
thread_arg = 1;
|
||||
#endif
|
||||
ret = 1;
|
||||
}
|
||||
else {
|
||||
process->exec = EXEC_NORMAL;
|
||||
#ifdef TARGET_PC
|
||||
thread_arg = 0;
|
||||
#endif
|
||||
ret = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case EXEC_KILLED:
|
||||
SETJMP_SET_IP(process->jump, HuPrcEnd);
|
||||
#ifdef TARGET_PC
|
||||
HuPrcEnd();
|
||||
break;
|
||||
#else
|
||||
process->jump.lr = (u32)HuPrcEnd;
|
||||
#endif
|
||||
case EXEC_NORMAL:
|
||||
LONGJMP(process->jump, 1);
|
||||
#ifdef TARGET_PC
|
||||
co_switch(process->thread);
|
||||
#else
|
||||
gclongjmp(&process->jump, 1);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue