From 75d19cc6ee63a155c862f500630545e50cea8881 Mon Sep 17 00:00:00 2001 From: weirdbeardgame Date: Mon, 17 Aug 2026 22:09:59 -0500 Subject: [PATCH] Wip: Added game. Added several headers for Game --- src/cs4/Seimei/src/Drama.h | 10 + src/cs4/Seimei/src/Filter.h | 15 ++ src/cs4/Seimei/src/Game.c | 376 +++++++++++++++++++++++++++++++++++- src/cs4/Seimei/src/Game.h | 8 +- src/cs4/Seimei/src/Map.h | 11 +- src/cs4/Seimei/src/Mirror.h | 6 + src/cs4/Seimei/src/Model.h | 229 +++++++++++----------- src/cs4/Seimei/src/Pad.h | 7 +- 8 files changed, 537 insertions(+), 125 deletions(-) create mode 100644 src/cs4/Seimei/src/Drama.h create mode 100644 src/cs4/Seimei/src/Filter.h create mode 100644 src/cs4/Seimei/src/Mirror.h diff --git a/src/cs4/Seimei/src/Drama.h b/src/cs4/Seimei/src/Drama.h new file mode 100644 index 0000000..b1a69ad --- /dev/null +++ b/src/cs4/Seimei/src/Drama.h @@ -0,0 +1,10 @@ +#ifndef DRAMA_H +#define DRAMA_H + void PlayDrama(); + void CheckDramaFreeFlag(); + int CheckDramaGameOver(); + void CheckFreeDramaData(); + int GetDramaFreeFlag(); + void SetDramaData(); + void InitDramaMng(); +#endif // DRAMA_H \ No newline at end of file diff --git a/src/cs4/Seimei/src/Filter.h b/src/cs4/Seimei/src/Filter.h new file mode 100644 index 0000000..f382020 --- /dev/null +++ b/src/cs4/Seimei/src/Filter.h @@ -0,0 +1,15 @@ +#ifndef FILTER_H +#define FILTER_H + void SetPcrtc(); + void CheckTVEffect(); + void DrawBlurFilter(); + void DrawBrightnessFilter(); + void DrawFadedFilter(); + void DrawFrameFilter(); + void DrawGlareFilter(); + void DrawNegaPosiFilter(); + void DrawTVEffect(); + void MakeFadedFilter(); + void InitGlareFilter(); + void InitTVEffect(); +#endif // FILTER_H \ No newline at end of file diff --git a/src/cs4/Seimei/src/Game.c b/src/cs4/Seimei/src/Game.c index 2560156..d8272ef 100644 --- a/src/cs4/Seimei/src/Game.c +++ b/src/cs4/Seimei/src/Game.c @@ -1,15 +1,377 @@ +#include "Game.h" +#include "Drama.h" +#include "Event.h" +#include "Filter.h" +#include "Main.h" +#include "Pad.h" #include "common.h" -INCLUDE_ASM("config/asm/nonmatchings/cs4/Seimei/src/Game", DrawGamePause); +void InitGameData() { + SetObjFunc(); + InitLightMat(); + DssInit(); + InitDamageMng(); + InitPointLight(); + InitEneSave(); + InitDramaMng(); + SfxPostEffect_Initialize(); + InitHitLine(); + InitMovePath(); + InitSpiritMng(); +} -INCLUDE_ASM("config/asm/nonmatchings/cs4/Seimei/src/Game", GetGameTexList); +void InitGameDataAfterLoad(void) { + FECard_Initialize(); + SetLoadCamReserve(0xFFFF); +} -INCLUDE_ASM("config/asm/nonmatchings/cs4/Seimei/src/Game", GameLoop); +void LoadGameTexture(void) { + ReadTexList("tex/game.tex", &lpGameTexList, 7, 0); +} -INCLUDE_ASM("config/asm/nonmatchings/cs4/Seimei/src/Game", ResetGameData); +inline void ScreenClear() { + int color_array[4] = {}; + SetFadeMng(0, (int *)&color_array, 0x3C, 0, 0, 0, 0); +} -INCLUDE_ASM("config/asm/nonmatchings/cs4/Seimei/src/Game", LoadGameTexture); +void ResetGameData(void) { -INCLUDE_ASM("config/asm/nonmatchings/cs4/Seimei/src/Game", InitGameDataAfterLoad); + GameSt.ControlMode = 0; + GameSt.Pause = 0; -INCLUDE_ASM("config/asm/nonmatchings/cs4/Seimei/src/Game", InitGameData); + ResetDebug(); + InitPointLight(); + InitTextureScroll(); + SetMapModel(); + SND_SqPlay(HSYN_PORT_SQBGM, 0); + SND_SqFadeStart(HSYN_PORT_SQBGM, SND_SQSONG_FADE_IN); + SND_SqPlay(HSYN_PORT_SQBGM1, 1); + SND_SqFadeStart(HSYN_PORT_SQBGM1, SND_SQSONG_FADE_IN); + SND_SqPlay(HSYN_PORT_SQBGM2, 2); + SND_SqFadeStart(HSYN_PORT_SQBGM2, SND_SQSONG_FADE_IN); + SND_SqPlay(HSYN_PORT_SQBGM3, 3); + SND_SqFadeStart(HSYN_PORT_SQBGM3, SND_SQSONG_FADE_IN); + + GameSt.LastLanguage = GameSt.VoiceLanguage; + + InitMirror(); + InitCamera(); + InitSandEffect(); + MyReset(&MdlMng[160]); + StabilizeMyCloth(); + InitObjFunc(); + InitBlast(); + InitDizzyFilter(); + InitGlareFilter(); + InitTVEffect(); + KnMsgMng_MsgAllClear(); + TmpMenuMng_SetUDBlackDraw(&g_TmpMenuMng, TMP_MENU__UDDRAW_ORDER__OFF_FORCE); + KnMenuMng_Crean(); + Menu_TD_Init(); + ScreenClear(); + + GameSt.EnePause = 0; + GameSt.PeepMask = 0; + + if ((GameSt.sceneNo == 9) && (CheckEventFlag(0x45F) == 0)) { + SetDramaData(); + SetEventFlag(0x45F); + } else if ((GameSt.sceneNo == 23) && (CheckEventFlag(0xD8) == 0)) { + SetDramaData(); + SetEventFlag(0xD8); + } else if ((GameSt.PlayerId == 0) && (GameSt.sceneNo == 33) && + (CheckEventFlag(0x440) == 0)) { + SetDramaData(); + SetEventFlag(0x440); + } else if (GameSt.sceneNo == 36 && CheckEventFlag(0x3EF) == 0) { + SetDramaData(); + SetEventFlag(0x3EF); + } else if (GameSt.sceneNo == 37) { + SetDramaData(GameSt.sceneNo); + } else if (GameSt.sceneNo == 71 && CheckEventFlag(0x110) != 0) { + SetDramaData(); + } else if ((GameSt.sceneNo == 78) && (CheckEventFlag(0x144) == 0)) { + SetDramaData(); + SetEventFlag(0x144); + } else if ((GameSt.sceneNo == 82) && (CheckEventFlag(0x143) == 0)) { + SetDramaData(); + SetEventFlag(0x143); + } else if ((GameSt.PlayerId == 2) && (GameSt.sceneNo == 87) && + (CheckEventFlag(0x1E4) == 0)) { + SetDramaData(); + SetEventFlag(0x1E4); + } else if (GameSt.sceneNo == 0x5A) { + SetDramaData(GameSt.sceneNo); + SetEventFlag(0x45F); + } +} + +int GameLoop() { + int i; + CAMINFO *lpCamInfo; // v0 + int GameLoopRet = 0; // s0 + struct _mdlmng *lpMdlMng; // s1 + while (true) { + ClearTime(); + GameSt.SystemCounter += 1; + + GameSt.GameModePrev = GameSt.GameMode; + + SetPcrtc(); + KickMdlPacket(); + PadControl(); + FileBackReadControl(); + CheckMyEquipUpdate(); + UpdateTextureScroll(); + ClearDrawOT(); + CheckTVEffect(); + + switch (GameSt.GameMode) { + case 0: + + UpdateCamera(); + DrawCalcView(); + DamageProc(); + MyPlay(&MdlMng[0xa0]); + EnePlayAll(); + ObjPlayAll(); + ScriptProc(); + PlayEventFunc(); + CheckSaveEvent(); + KnMsgMng_Update(); + KnMenuMng_Update(1); + Menu_TD_Update(); + CsMngUpdate(); + TmpMenuMng_Update(&g_TmpMenuMng); + + lpMdlMng = (struct _mdlmng *)&MdlMng; + + do { + if (lpMdlMng->bUse == 0) + continue; + + PlayMi3(lpMdlMng); + SetDrawOTModel(lpMdlMng, lpMdlMng->Pos, lpMdlMng->Priority); + } while (++lpMdlMng != &MdlMng[770]); + + UpdateMapSfx(); + + if ((GameSt.Pause == 0) && (Menu_TD_IsPlay() == 0)) + SFX_Action(0.0166666f); + + SfxPostEffect_Action(0.0166666f); + EtcEventMng_EneExtGeneEvent_Update(&g_EtcEventMng); + CsMngDraw(); + UpdatePointLight(); + break; + case 1: + PlayDrama(); + ObjPlayAll(); + ScriptProc(); + if (GetDramaFreeFlag() != 0) { + lpCamInfo = GetGameCamInfo(); + SetCamEnv(lpCamInfo, lpCamInfo->nowIndex); + UpdateCamera(); + } + + DrawCalcView(); + KnMsgMng_Update(); + KnMenuMng_Update(1); + + lpMdlMng = (struct _mdlmng *)&MdlMng; + + do { + if (lpMdlMng->bUse == 0) + continue; + + if ((CheckDramaDrawModel(lpMdlMng) == 0)) + continue; + + if (CheckDramaGameOver() == 0) + PlayMi3(lpMdlMng); + + SetDrawOTModel(lpMdlMng, lpMdlMng->Pos, lpMdlMng->Priority); + } while (++lpMdlMng != &MdlMng[770]); + + UpdateMapSfx(); + if ((GameSt.Pause == 0) && (Menu_TD_IsPlay() == 0)) + SFX_Action(0.0166666f); + + SfxPostEffect_Action(0.0166666f); + break; + + case 2: + KnMenuMng_Update(1); + Menu_TD_Update(); + CsMngUpdate(); + break; + + case 3: + UpdateCamera(); + DrawCalcView(); + KnMsgMng_Update(); + Menu_TD_Update(); + PlayRiddle(); + + lpMdlMng = (struct _mdlmng *)&MdlMng; + + do { + if ((lpMdlMng->bUse == 0)) + continue; + + if ((CheckRiddleDrawModel(lpMdlMng) == 0)) + continue; + + PlayMi3(lpMdlMng); + SetDrawOTModel(lpMdlMng, lpMdlMng->Pos, lpMdlMng->Priority); + } while (++lpMdlMng != &MdlMng[770]); + break; + } + + switch (GameSt.GameMode) { + case 2: + UpdateMapSe(); + SND_Update(); + KnMenuMng_Draw(); + Menu_TD_Draw(); + DrawBrightnessFilter(); + UpdateFadeMng(); + break; + + default: + if ((GameSt.Pause == 0) && (Menu_TD_IsPlay() == 0)) + FECard_Action(0.0166666f); + + UpdateMapSe(); + SND_Update(); + SFX_Draw(); + DrawByOT(); + SFX_DrawAfterOT(); + DrawGlareFilter(); + DrawBrightnessFilter(); + DrawFrameFilter(); + DrawDizzyFilter(); + DrawGameOver(); + DrawPhantomFilter(); + DrawBlurFilter(); + SfxPostEffect_Draw(); + DrawPeepHole(); + + if (GameSt.NegaPosi != 0) + DrawNegaPosiFilter(); + if (GameSt.FadedTest != 0) + MakeFadedFilter(); + + FECard_Draw(); + DrawDizzyMask(); + + if (GameSt.FadedTest != 0) + DrawFadedFilter(); + + TmpMenuMng_Draw(&g_TmpMenuMng); + KnMenuMng_Draw(); + Menu_TD_Draw(); + KnMsgMng_Draw(); + UpdateBlast(); + UpdateFadeMng(); + DrawGamePause(); + + if (GameSt.DepthTest != 0) + DrawDepthOfField(); + + break; + } + + while ((*D1_CHCR & D_CHCR_STR_M) != 0 || (*D2_CHCR & D_CHCR_STR_M) != 0) { + } + + DrawTVEffect(); + DrawSynch(); + lpDrawMng->frameTime = GetTime(); + FlushCache(0); + CheckDramaFreeFlag(); + CheckRiddleFree(); + + if (CheckSceneLoad() != 0) { + + if (GameSt.LoadStart != 0) + GameLoopRet = 2; + break; + } + + else if ((GameLoopRet = CheckResetPad()) != 0) { + GameLoopRet = 1; + break; + } + + else if (CheckGoToTitleFlag() != 0) { + GameLoopRet = 1; + break; + } + + else if (!!CheckGoToEndingFlag()) { + GameLoopRet = 3; + break; + } + } + + PadVibAllClear(); + PadUpdate(); + SetVagStmFade(0, 1, 0x1E); + SetVagStmFade(1, 1, 0x1E); + SetVagStmFade(2, 1, 0x1E); + SetVagStmFade(3, 1, 0x1E); + SetVagStmFade(4, 1, 0x1E); + SetVagStmFade(5, 1, 0x1E); + CheckFreeDramaData(); + CheckFreeRiddleData(); + EtcEventMng_EneExtGeneEvent_End(&g_EtcEventMng); + FECard_Enable_Draw(1); + FreeSandEffect(); + Menu_TD_Init(); + + return GameLoopRet; +} + +void *GetGameTexList() { return lpGameTexList; } + +COLOR g_col = {127, 127, 127, 127}; + +static void DrawGamePause(void) { + u_short *lpMsg; + + volatile char padding[16]; + + SPDATA SpData; + + int Col[4] = {0, 0, 0, 64}; + + float w; + float h; + float w2; + float h2; + + volatile char *p = padding; + + if (GameSt.Pause == 1) { + SetSprite((LPSP *)&SpData, -256, -224, 512, 448, Col, 0, 0); + lpMdlPacketMem = MakeSpritePacketUseSpr((LPSP *)&SpData, lpMdlPacketMem); + + FontDrawBegin(0); + SetFontColor(g_col); + FsFontSetScale(1.5f, 1.5f); + + if ((lpMsg = (u_short *)KnMsgMng_GetMapNameMsg()) != NULL) { + FsFontGetSize(&w, &h, lpMsg, 0); + FontPrintXY(0.5f * (512.0f - w), 150.0f, (char *)lpMsg); + } + + FsFontSetScale(0.8f, 0.8f); + if ((lpMsg = KnMsgMng_GetMsgStr(0x1d4e2)) != NULL) { + + FsFontGetSize(&w2, &h2, lpMsg, 0); + FontPrintXY(0.5f * (512.0f - w2), 210.0f, (char *)lpMsg); + } + FontDrawEnd(); + } +} diff --git a/src/cs4/Seimei/src/Game.h b/src/cs4/Seimei/src/Game.h index 53bbef6..46d8ce9 100644 --- a/src/cs4/Seimei/src/Game.h +++ b/src/cs4/Seimei/src/Game.h @@ -46,11 +46,13 @@ typedef struct { u_char unused[2]; // offset 0x2E, size 0x2 } GameState; -extern GameState GameSt; // size: 0x30, address: 0x3A5E10 +extern GameState GameSt; // size: 0x30, address: 0x3A5E10 +extern void * lpGameTexList; - -int GameLoop(); +int GameLoop(); void InitGameData(); void InitGameDataAfterLoad(); void * GetGameTexList(); +static void DrawGamePause(); + #endif // GAME_H diff --git a/src/cs4/Seimei/src/Map.h b/src/cs4/Seimei/src/Map.h index cad9cb3..3b0502c 100644 --- a/src/cs4/Seimei/src/Map.h +++ b/src/cs4/Seimei/src/Map.h @@ -1,9 +1,8 @@ #ifndef MAP_H #define MAP_H -#include "typedefs.h" +#include "common.h" -// total size: 0x50 typedef struct _PARTS { // Members sceVu0FVECTOR Pos; // offset 0x0, size 0x10 @@ -18,7 +17,11 @@ typedef struct _PARTS { int GetMdlDataIndexFromMapMdlInfo(int Type, int MdlId); PARTS* GetMapPartsInfoByCtrlId(int Type, int CtrlId); - -int GetMdlMngIndexByCtrlId(int Type, int CtrlId); + +int GetMdlMngIndexByCtrlId(int Type, int CtrlId); +void CheckSaveEvent(); +void UpdateMapSfx(); +void UpdateMapSe(); +void SetMapModel(); #endif // MAP_H diff --git a/src/cs4/Seimei/src/Mirror.h b/src/cs4/Seimei/src/Mirror.h new file mode 100644 index 0000000..b1ab34f --- /dev/null +++ b/src/cs4/Seimei/src/Mirror.h @@ -0,0 +1,6 @@ +#include "common.h" + +#ifndef MIRROR_H +#define MIRROR_H + void InitMirror(); +#endif // MIRROR_H \ No newline at end of file diff --git a/src/cs4/Seimei/src/Model.h b/src/cs4/Seimei/src/Model.h index f8697df..45d74ec 100644 --- a/src/cs4/Seimei/src/Model.h +++ b/src/cs4/Seimei/src/Model.h @@ -3,67 +3,101 @@ #include "typedefs.h" -// total size: 0x1C0 +typedef struct /* @anon17 */ +{ + // Members + float Pos[4]; // offset 0x0, size 0x10 + float Nrm[4]; // offset 0x10, size 0x10 + short ObjectId; // offset 0x20, size 0x2 + u_char Type; // offset 0x22, size 0x1 + u_char Id; // offset 0x23, size 0x1 + u_int unused[3]; // offset 0x24, size 0xC +} DMYPOLY; // offset 0x80, size 0x600 + +typedef struct /* @anon19 */ { + // Members + int MaxAnimParam; // offset 0x0, size 0x4 + u_int TexInVmd; // offset 0x4, size 0x4 + u_short MdlNo; // offset 0x8, size 0x2 + u_short MdlType; // offset 0xA, size 0x2 + u_char bMultiDraw; // offset 0xC, size 0x1 + u_char DmyPolyNum; // offset 0xD, size 0x1 + u_char DropShadow; // offset 0xE, size 0x1 + char unused0; // offset 0xF, size 0x1 + void * lpVmdHead; // offset 0x10, size 0x4 + void * lpAniHead; // offset 0x14, size 0x4 + void * lpHmdHead; // offset 0x18, size 0x4 + void * lpSmdHead; // offset 0x1C, size 0x4 + void * lpMicHead; // offset 0x20, size 0x4 + void * lpMi3Index; // offset 0x24, size 0x4 + void * lpJcnFileHead; // offset 0x28, size 0x4 + void * lpAnimParam; // offset 0x2C, size 0x4 + void * lpBndFile; // offset 0x30, size 0x4 + void * lpMdlFile; // offset 0x34, size 0x4 + void * lpAniFile; // offset 0x38, size 0x4 + void * lpHdlFile; // offset 0x3C, size 0x4 + void * lpSdlFile; // offset 0x40, size 0x4 + void * lpTexList; // offset 0x44, size 0x4 + void * lpDss; // offset 0x48, size 0x4 + void * lpPrm; // offset 0x4C, size 0x4 + u_int * lpObjGroupID; // offset 0x50, size 0x4 + u_int * lpPacket; // offset 0x54, size 0x4 + u_int * lpCurrent; // offset 0x58, size 0x4 + u_int * lpTexPacket; // offset 0x5C, size 0x4 + u_int * lpTexCurrent; // offset 0x60, size 0x4 + u_int MdlPacketSize; // offset 0x64, size 0x4 + u_int TexPacketSize; // offset 0x68, size 0x4 + float aMorphRate[3]; // offset 0x6C, size 0xC + u_int unused[2]; // offset 0x78, size 0x8 + DMYPOLY DmyPoly[32]; // offset 0x80, size 0x600 +} LPMDLDATA; // offset 0xC, size 0x4 + +typedef struct /* @anon15 */ +{ + // Members + u_int TEST : 19; // offset 0x0, size 0x4 + u_int unused1 : 5; // offset 0x0, size 0x4 + u_int ZMSK : 1; // offset 0x0, size 0x4 + u_int unused2 : 7; // offset 0x0, size 0x4 +} DRAWREGS; // offset 0x150, size 0x4 + + // total size: 0x1 + +typedef struct /* @anon11 */ +{ + // Members + u_char inhibit_mirror_sfx : 1; // offset 0x0, size 0x1 + u_char dmy : 7; // offset 0x0, size 0x1 +} FLAGS; // offset 0x194, size 0x1 + +// total size: 0x20 +typedef struct /* @anon10 */ +{ + // Members + float angY; // offset 0x0, size 0x4 + float distXZ; // offset 0x4, size 0x4 + float angStep; // offset 0x8, size 0x4 + u_short stayAnim; // offset 0xC, size 0x2 + u_short walkAnim; // offset 0xE, size 0x2 + u_short prevAnim; // offset 0x10, size 0x2 + short unused[5]; // offset 0x12, size 0xA + struct _mdlmng * lpMdl; // offset 0x1C, size 0x4 +} TARGET; // offset 0x198, size 0x20 + typedef struct _mdlmng { // Members - unsigned char bUse; // offset 0x0, size 0x1 - unsigned char bMultiDraw; // offset 0x1, size 0x1 - unsigned char bErase; // offset 0x2, size 0x1 - unsigned char bEraseByMapDraw; // offset 0x3, size 0x1 - unsigned char bPresetMatrix; // offset 0x4, size 0x1 - unsigned char FadeType; // offset 0x5, size 0x1 - unsigned char Priority; // offset 0x6, size 0x1 - unsigned char bUseMdlLight; // offset 0x7, size 0x1 - unsigned char bUseMdlAmbient; // offset 0x8, size 0x1 + u_char bUse; // offset 0x0, size 0x1 + u_char bMultiDraw; // offset 0x1, size 0x1 + u_char bErase; // offset 0x2, size 0x1 + u_char bEraseByMapDraw; // offset 0x3, size 0x1 + u_char bPresetMatrix; // offset 0x4, size 0x1 + u_char FadeType; // offset 0x5, size 0x1 + u_char Priority; // offset 0x6, size 0x1 + u_char bUseMdlLight; // offset 0x7, size 0x1 + u_char bUseMdlAmbient; // offset 0x8, size 0x1 unsigned char bUseWorldMat; // offset 0x9, size 0x1 unsigned char unused0[2]; // offset 0xA, size 0x2 - // total size: 0x680 - struct /* @anon11 */ { - // Members - signed int MaxAnimParam; // offset 0x0, size 0x4 - unsigned int TexInVmd; // offset 0x4, size 0x4 - unsigned short MdlNo; // offset 0x8, size 0x2 - unsigned short MdlType; // offset 0xA, size 0x2 - unsigned char bMultiDraw; // offset 0xC, size 0x1 - unsigned char DmyPolyNum; // offset 0xD, size 0x1 - unsigned char DropShadow; // offset 0xE, size 0x1 - char unused0; // offset 0xF, size 0x1 - void * lpVmdHead; // offset 0x10, size 0x4 - void * lpAniHead; // offset 0x14, size 0x4 - void * lpHmdHead; // offset 0x18, size 0x4 - void * lpSmdHead; // offset 0x1C, size 0x4 - void * lpMicHead; // offset 0x20, size 0x4 - void * lpMi3Index; // offset 0x24, size 0x4 - void * lpJcnFileHead; // offset 0x28, size 0x4 - void * lpAnimParam; // offset 0x2C, size 0x4 - void * lpBndFile; // offset 0x30, size 0x4 - void * lpMdlFile; // offset 0x34, size 0x4 - void * lpAniFile; // offset 0x38, size 0x4 - void * lpHdlFile; // offset 0x3C, size 0x4 - void * lpSdlFile; // offset 0x40, size 0x4 - void * lpTexList; // offset 0x44, size 0x4 - void * lpDss; // offset 0x48, size 0x4 - void * lpPrm; // offset 0x4C, size 0x4 - unsigned int * lpObjGroupID; // offset 0x50, size 0x4 - unsigned int * lpPacket; // offset 0x54, size 0x4 - unsigned int * lpCurrent; // offset 0x58, size 0x4 - unsigned int * lpTexPacket; // offset 0x5C, size 0x4 - unsigned int * lpTexCurrent; // offset 0x60, size 0x4 - unsigned int MdlPacketSize; // offset 0x64, size 0x4 - unsigned int TexPacketSize; // offset 0x68, size 0x4 - float aMorphRate[3]; // offset 0x6C, size 0xC - unsigned int unused[2]; // offset 0x78, size 0x8 - // total size: 0x30 - struct /* @anon52 */ { - // Members - float Pos[4]; // offset 0x0, size 0x10 - float Nrm[4]; // offset 0x10, size 0x10 - signed short ObjectId; // offset 0x20, size 0x2 - unsigned char Type; // offset 0x22, size 0x1 - unsigned char Id; // offset 0x23, size 0x1 - unsigned int unused[3]; // offset 0x24, size 0xC - } DmyPoly[32]; // offset 0x80, size 0x600 - } * lpMdlData; // offset 0xC, size 0x4 + LPMDLDATA * lpMdlData; float (* lpObjMat)[4][4]; // offset 0x10, size 0x4 float (* lpShadowMat)[4][4]; // offset 0x14, size 0x4 float (* lpLocalMat)[4][4]; // offset 0x18, size 0x4 @@ -80,74 +114,51 @@ typedef struct _mdlmng { float AmbientCol[4]; // offset 0xB0, size 0x10 float WorldMat[4][4]; // offset 0xC0, size 0x40 void * lpAnimCtrl; // offset 0x100, size 0x4 - signed short IndexAnim; // offset 0x104, size 0x2 - signed short AnimState; // offset 0x106, size 0x2 + short IndexAnim; // offset 0x104, size 0x2 + short AnimState; // offset 0x106, size 0x2 float AnimSpeed; // offset 0x108, size 0x4 float Alpha; // offset 0x10C, size 0x4 float HitSize; // offset 0x110, size 0x4 float HitHigh; // offset 0x114, size 0x4 float ShadowSize; // offset 0x118, size 0x4 float ShadowHigh; // offset 0x11C, size 0x4 - signed int Hp; // offset 0x120, size 0x4 - unsigned int timer; // offset 0x124, size 0x4 - unsigned char TeamNo; // offset 0x128, size 0x1 - unsigned char TeamNoBase; // offset 0x129, size 0x1 - unsigned char AttackNo; // offset 0x12A, size 0x1 - unsigned char Flags; // offset 0x12B, size 0x1 - signed short DmgCnt; // offset 0x12C, size 0x2 - signed short NoSearched; // offset 0x12E, size 0x2 - unsigned char HitOff; // offset 0x130, size 0x1 - unsigned char GravOff; // offset 0x131, size 0x1 - unsigned char MapHitOff; // offset 0x132, size 0x1 - unsigned char CharHitOutOff; // offset 0x133, size 0x1 - unsigned int HitFlag; // offset 0x134, size 0x4 + int Hp; // offset 0x120, size 0x4 + u_int timer; // offset 0x124, size 0x4 + u_char TeamNo; // offset 0x128, size 0x1 + u_char TeamNoBase; // offset 0x129, size 0x1 + u_char AttackNo; // offset 0x12A, size 0x1 + u_char Flags; // offset 0x12B, size 0x1 + short DmgCnt; // offset 0x12C, size 0x2 + short NoSearched; // offset 0x12E, size 0x2 + u_char HitOff; // offset 0x130, size 0x1 + u_char GravOff; // offset 0x131, size 0x1 + u_char MapHitOff; // offset 0x132, size 0x1 + u_char CharHitOutOff; // offset 0x133, size 0x1 + u_int HitFlag; // offset 0x134, size 0x4 struct _mdlmng * lpHitMap[2]; // offset 0x138, size 0x8 void * lpParts; // offset 0x140, size 0x4 void * lpEventData; // offset 0x144, size 0x4 void * lpCtrlSt; // offset 0x148, size 0x4 float FadeStep; // offset 0x14C, size 0x4 - // total size: 0x4 - struct /* @anon51 */ { - // Members - unsigned int TEST : 19; // offset 0x0, size 0x4 - unsigned int unused1 : 5; // offset 0x0, size 0x4 - unsigned int ZMSK : 1; // offset 0x0, size 0x4 - unsigned int unused2 : 7; // offset 0x0, size 0x4 - } DrawRegs; // offset 0x150, size 0x4 - signed int State[10]; // offset 0x154, size 0x28 + DRAWREGS DrawRegs; // offset 0x150, size 0x4 + int State[10]; // offset 0x154, size 0x28 void * lpPathMng; // offset 0x17C, size 0x4 - signed int PLightIndex; // offset 0x180, size 0x4 + int PLightIndex; // offset 0x180, size 0x4 float Z_Offset; // offset 0x184, size 0x4 - signed short DebugAnimState; // offset 0x188, size 0x2 - unsigned char CtrlMode; // offset 0x18A, size 0x1 - unsigned char CtrlModeB; // offset 0x18B, size 0x1 - unsigned int * lpShiftTexPacket; // offset 0x18C, size 0x4 - unsigned char sceneNo; // offset 0x190, size 0x1 - unsigned short hSfxPLight; // offset 0x192, size 0x2 - // total size: 0x1 - struct /* @anon41 */ { - // Members - unsigned char inhibit_mirror_sfx : 1; // offset 0x0, size 0x1 - unsigned char dmy : 7; // offset 0x0, size 0x1 - } flags; // offset 0x194, size 0x1 - // total size: 0x20 - struct /* @anon39 */ { - // Members - float angY; // offset 0x0, size 0x4 - float distXZ; // offset 0x4, size 0x4 - float angStep; // offset 0x8, size 0x4 - unsigned short stayAnim; // offset 0xC, size 0x2 - unsigned short walkAnim; // offset 0xE, size 0x2 - unsigned short prevAnim; // offset 0x10, size 0x2 - signed short unused[5]; // offset 0x12, size 0xA - struct _mdlmng * lpMdl; // offset 0x1C, size 0x4 - } Target; // offset 0x198, size 0x20 - signed int remnant_HP; // offset 0x1B8, size 0x4 - unsigned short blood_pool_sfx_idx; // offset 0x1BC, size 0x2 + short DebugAnimState; // offset 0x188, size 0x2 + u_char CtrlMode; // offset 0x18A, size 0x1 + u_char CtrlModeB; // offset 0x18B, size 0x1 + u_int * lpShiftTexPacket; // offset 0x18C, size 0x4 + u_char sceneNo; // offset 0x190, size 0x1 + u_short hSfxPLight; // offset 0x192, size 0x2 + FLAGS flags; // offset 0x194, size 0x1 + TARGET Target; // offset 0x198, size 0x20 + int remnant_HP; // offset 0x1B8, size 0x4 + u_short blood_pool_sfx_idx; // offset 0x1BC, size 0x2 } MDLMNG; extern MDLMNG MdlMng[770]; // size: 0x54380, address: 0x6A0E50 - +void KickMdlPacket(); void SetMdlBndFile(signed int Index /* r17 */); #endif // MODEL_H diff --git a/src/cs4/Seimei/src/Pad.h b/src/cs4/Seimei/src/Pad.h index d71d865..716076a 100644 --- a/src/cs4/Seimei/src/Pad.h +++ b/src/cs4/Seimei/src/Pad.h @@ -1,6 +1,9 @@ #ifndef PAD_H #define PAD_H - -void SetPadVibFlag(unsigned char bFlag /* r2 */); + void PadControl(); + int CheckResetPad(); + void PadUpdate(); + void PadVibAllClear(); + void SetPadVibFlag(unsigned char bFlag /* r2 */); #endif // PAD_H