mirror of
https://github.com/Xeeynamo/sotn-decomp.git
synced 2025-02-17 11:37:37 +00:00
Allow main roundtrip across different states (#804)
The most prominent change is the new macro which replaces the `DEBUGF` for each stub, but that is the least interesting part. This allows to go through the different steps `Game_Init`, `Game_NowLoading` and once it finally lands into `Game_Play` it calls `func_800F298C`, which is our new `main` function for testing stuff.
This commit is contained in:
parent
347c478516
commit
1169fdc32a
@ -9,7 +9,8 @@ LD_FLAGS_PC := -fsanitize=address -lc -lm -lSDL2
|
||||
|
||||
C_FILES_PC := main.c log.c stubs.c sotn.c
|
||||
C_FILES_PSX_SDK := libapi.c libetc.c libgpu.c libgte.c libgs.c libcd.c libcard.c libspu.c libsnd.c cdc.c
|
||||
C_FILES_DRA := 42398.c 91EBC.c 92F60.c 93290.c 93BDC.c 94F50.c 953A0.c
|
||||
C_FILES_DRA := 42398.c play.c gameover.c loading.c 46FD4.c
|
||||
C_FILES_DRA += 91EBC.c 92F60.c 93290.c 93BDC.c 94F50.c 953A0.c
|
||||
|
||||
OBJS := $(C_FILES_PC:%.c=$(PC_BUILD_DIR)/src/pc/%.o)
|
||||
OBJS += $(C_FILES_PSX_SDK:%.c=$(PC_BUILD_DIR)/src/pc/psxsdk/%.o)
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef GAME_H
|
||||
#define GAME_H
|
||||
#include "common.h"
|
||||
#include "log.h"
|
||||
#include <psxsdk/kernel.h>
|
||||
|
||||
// lseek etc. conflicts
|
||||
|
@ -11,6 +11,7 @@ typedef enum {
|
||||
} LOG_LEVEL;
|
||||
|
||||
#define NAMEOF(var) #var
|
||||
#define NOT_IMPLEMENTED DEBUGF("not implemented")
|
||||
|
||||
#ifndef NO_LOGS
|
||||
|
||||
|
@ -29,16 +29,9 @@ void RenderEntities(void);
|
||||
void InitRenderer(void);
|
||||
void RenderTilemap(void);
|
||||
void RenderPrimitives(void);
|
||||
void func_800FADC0(void);
|
||||
void func_801026BC(s32);
|
||||
void DrawEntitiesHitbox(s32 blendMode);
|
||||
void UpdateCd(void);
|
||||
s32 func_8010E27C(void);
|
||||
void SetSpeedX(s32);
|
||||
void SetCdVolume(s8 s_num, s16 arg1, s16 arg2);
|
||||
void SoundInit(void);
|
||||
void ExecCdSoundCommands(void);
|
||||
s32 func_80136010(void);
|
||||
|
||||
void DebugShowWaitInfo(const char* msg) {
|
||||
g_CurrentBuffer = g_CurrentBuffer->next;
|
||||
|
@ -12,6 +12,7 @@
|
||||
SDL_Window* g_Window;
|
||||
SDL_Renderer* g_Renderer;
|
||||
|
||||
void InitGame(void);
|
||||
void MainGame(void);
|
||||
|
||||
void SDLAudioCallback(void* data, Uint8* buffer, int length) {
|
||||
@ -38,6 +39,7 @@ void SDLAudioCallback(void* data, Uint8* buffer, int length) {
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
const char* filename;
|
||||
int ret;
|
||||
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
|
||||
@ -46,11 +48,12 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
if (argc < 2) {
|
||||
ERRORF("Specify a filename");
|
||||
exit(1);
|
||||
filename = "disks/sotn.us.bin";
|
||||
} else {
|
||||
filename = argv[1];
|
||||
}
|
||||
|
||||
OpenCd(argv[1]);
|
||||
OpenCd(filename);
|
||||
|
||||
SDL_AudioSpec spec;
|
||||
|
||||
@ -80,6 +83,7 @@ int main(int argc, char* argv[]) {
|
||||
ERRORF("SDL_CreateRenderer: %s", SDL_GetError());
|
||||
ret = 1;
|
||||
} else {
|
||||
InitGame();
|
||||
MainGame();
|
||||
SDL_DestroyRenderer(g_Renderer);
|
||||
}
|
||||
|
@ -7,8 +7,8 @@ int VSync(int mode) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
long SetRCnt(unsigned long, unsigned short, long) { DEBUGF("not implemented"); }
|
||||
long SetRCnt(unsigned long, unsigned short, long) { NOT_IMPLEMENTED; }
|
||||
|
||||
void ChangeClearPAD(long) { DEBUGF("not implemented"); }
|
||||
void ChangeClearPAD(long) { NOT_IMPLEMENTED; }
|
||||
|
||||
void _bu_init(void) { DEBUGF("not implemented"); }
|
||||
void _bu_init(void) { NOT_IMPLEMENTED; }
|
||||
|
@ -3,6 +3,6 @@
|
||||
#include <psxsdk/libcard.h>
|
||||
#include <log.h>
|
||||
|
||||
void InitCARD(long val) { DEBUGF("not implemented"); }
|
||||
void InitCARD(long val) { NOT_IMPLEMENTED; }
|
||||
|
||||
long StartCARD(void) { DEBUGF("not implemented"); }
|
||||
long StartCARD(void) { NOT_IMPLEMENTED; }
|
||||
|
@ -23,7 +23,7 @@ void OpenCd(char* filename) {
|
||||
int CdReading() { return reading; }
|
||||
|
||||
CdlCB CdReadyCallback(CdlCB func) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
return func;
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ int CdSync(int mode, u_char* result) {
|
||||
}
|
||||
|
||||
int CdMix(CdlATV* vol) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,8 @@ u_long PadRead(int id) {
|
||||
return pressed;
|
||||
}
|
||||
|
||||
int VSyncCallback(void (*f)()) { DEBUGF("not implemented"); }
|
||||
int VSyncCallback(void (*f)()) { NOT_IMPLEMENTED; }
|
||||
|
||||
int VSyncCallbacks(int ch, void (*f)()) { DEBUGF("not implemented"); }
|
||||
int VSyncCallbacks(int ch, void (*f)()) { NOT_IMPLEMENTED; }
|
||||
|
||||
long SetVideoMode(long mode) { DEBUGF("not implemented"); }
|
||||
long SetVideoMode(long mode) { NOT_IMPLEMENTED; }
|
||||
|
@ -4,11 +4,9 @@
|
||||
#include <stdio.h>
|
||||
#include <log.h>
|
||||
|
||||
int FntOpen(int x, int y, int w, int h, int isbg, int n) {
|
||||
DEBUGF("not implemented");
|
||||
}
|
||||
int FntOpen(int x, int y, int w, int h, int isbg, int n) { NOT_IMPLEMENTED; }
|
||||
|
||||
void FntLoad(int tx, int ty) { DEBUGF("not implemented"); }
|
||||
void FntLoad(int tx, int ty) { NOT_IMPLEMENTED; }
|
||||
|
||||
int FntPrint(const char* fmt, ...) {
|
||||
va_list args;
|
||||
@ -23,43 +21,45 @@ int FntPrint(const char* fmt, ...) {
|
||||
|
||||
u_long* FntFlush(int) { fflush(stderr); }
|
||||
|
||||
void SetDumpFnt(int id) { DEBUGF("not implemented"); }
|
||||
void SetDumpFnt(int id) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SetDispMask(int mask) { DEBUGF("not implemented"); }
|
||||
void SetDispMask(int mask) { NOT_IMPLEMENTED; }
|
||||
|
||||
DISPENV* SetDefDispEnv(DISPENV* env, int x, int y, int w, int h) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
}
|
||||
DRAWENV* SetDefDrawEnv(DRAWENV* env, int x, int y, int w, int h) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int ClearImage(RECT* rect, u_char r, u_char g, u_char b) {
|
||||
DEBUGF("not implemented");
|
||||
}
|
||||
int LoadImage(RECT* rect, u_long* p) { DEBUGF("not implemented"); }
|
||||
int StoreImage(RECT* rect, u_long* p) { DEBUGF("not implemented"); }
|
||||
int ClearImage(RECT* rect, u_char r, u_char g, u_char b) { NOT_IMPLEMENTED; }
|
||||
int LoadImage(RECT* rect, u_long* p) { NOT_IMPLEMENTED; }
|
||||
int StoreImage(RECT* rect, u_long* p) { NOT_IMPLEMENTED; }
|
||||
int MoveImage(RECT* rect, int x, int y) { NOT_IMPLEMENTED; }
|
||||
|
||||
int DrawSync(int mode) { DEBUGF("not implemented"); }
|
||||
int DrawSync(int mode);
|
||||
int DrawSync(int mode) { return MyDrawSync(mode); }
|
||||
|
||||
DRAWENV* PutDrawEnv(DRAWENV* env) { DEBUGF("not implemented"); }
|
||||
DRAWENV* PutDrawEnv(DRAWENV* env) { NOT_IMPLEMENTED; }
|
||||
|
||||
DISPENV* PutDispEnv(DISPENV* env) { DEBUGF("not implemented"); }
|
||||
DISPENV* PutDispEnv(DISPENV* env) { NOT_IMPLEMENTED; }
|
||||
|
||||
void DrawOTag(u_long* p) { DEBUGF("not implemented"); }
|
||||
void DrawOTag(u_long* p) { NOT_IMPLEMENTED; }
|
||||
|
||||
void AddPrim(void* ot, void* p) { DEBUGF("not implemented"); }
|
||||
void AddPrim(void* ot, void* p) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SetShadeTex(void* p, int tge) { DEBUGF("not implemented"); }
|
||||
void SetShadeTex(void* p, int tge) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SetSemiTrans(void* p, int abe) { DEBUGF("not implemented"); }
|
||||
void SetSemiTrans(void* p, int abe) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SetDrawMode(DR_MODE* p, int dfe, int dtd, int tpage, RECT* tw) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int ResetGraph(int mode) { DEBUGF("not implemented"); }
|
||||
int ResetGraph(int mode) { NOT_IMPLEMENTED; }
|
||||
|
||||
int SetGraphDebug(int level) { DEBUGF("not implemented"); }
|
||||
int SetGraphDebug(int level) { NOT_IMPLEMENTED; }
|
||||
|
||||
u_long* ClearOTag(u_long* ot, int n) { DEBUGF("not implemented"); }
|
||||
u_long* ClearOTag(u_long* ot, int n) { NOT_IMPLEMENTED; }
|
||||
|
||||
u_short LoadClut2(u_long* clut, int x, int y) { NOT_IMPLEMENTED; }
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include <psxsdk/libgs.h>
|
||||
#include <log.h>
|
||||
|
||||
void GsClearVcount(void) { DEBUGF("not implemented"); }
|
||||
void GsClearVcount(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
long GsGetVcount() { DEBUGF("not implemented"); }
|
||||
long GsGetVcount() { NOT_IMPLEMENTED; }
|
||||
|
||||
void GsInitVcount() { DEBUGF("not implemented"); }
|
||||
void GsInitVcount() { NOT_IMPLEMENTED; }
|
||||
|
@ -2,4 +2,8 @@
|
||||
#include <psxsdk/libgte.h>
|
||||
#include <log.h>
|
||||
|
||||
void InitGeom() { DEBUGF("not implemented"); }
|
||||
void InitGeom() { NOT_IMPLEMENTED; }
|
||||
|
||||
int rsin(int x) { NOT_IMPLEMENTED; }
|
||||
|
||||
int rcos(int x) { NOT_IMPLEMENTED; }
|
||||
|
@ -8,42 +8,38 @@ short SsUtSetVVol(short vc, short voll, short volr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SsSetSerialAttr(char s_num, char attr, char mode) {
|
||||
DEBUGF("not implemented");
|
||||
}
|
||||
void SsSetSerialAttr(char s_num, char attr, char mode) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SsSeqPlay(s16 seq_access_num, s8 play_mode, s16 l_count) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void SsSetMVol(short voll, short volr) { DEBUGF("not implemented"); }
|
||||
void SsSetMVol(short voll, short volr) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SsSeqSetVol(s16 arg0, s32 arg1, s32 arg2) { DEBUGF("not implemented"); }
|
||||
void SsSeqSetVol(s16 arg0, s32 arg1, s32 arg2) { NOT_IMPLEMENTED; }
|
||||
|
||||
short SsSeqOpen(u_long* addr, short vab_id) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SsSeqClose(short seq_access_num) { DEBUGF("not implemented"); }
|
||||
void SsSeqClose(short seq_access_num) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SsSeqStop(short seq_access_num) { DEBUGF("not implemented"); }
|
||||
void SsSeqStop(short seq_access_num) { NOT_IMPLEMENTED; }
|
||||
|
||||
short SsUtKeyOnV(short voice, short vabId, short prog, short tone, short note,
|
||||
short fine, short voll, short volr) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SsUtReverbOn(void) { DEBUGF("not implemented"); }
|
||||
void SsUtReverbOn(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SsUtSetReverbType(short type) { DEBUGF("not implemented"); }
|
||||
void SsUtSetReverbType(short type) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SsSetTableSize(char* table, short s_max, short t_max) {
|
||||
DEBUGF("not implemented");
|
||||
}
|
||||
void SsSetTableSize(char* table, short s_max, short t_max) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SsStart(void) { DEBUGF("not implemented"); }
|
||||
void SsStart(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
char SsSetReservedVoice(char voices) {
|
||||
DEBUGF("%d", voices);
|
||||
@ -52,11 +48,11 @@ char SsSetReservedVoice(char voices) {
|
||||
|
||||
void SsSetTickMode(long tick_mode) { DEBUGF("%d", tick_mode); }
|
||||
|
||||
void SsInitHot(void) { DEBUGF("not implemented"); }
|
||||
void SsInitHot(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SsSetStereo(void) { DEBUGF("not implemented"); }
|
||||
void SsSetStereo(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SsSetMono(void) { DEBUGF("not implemented"); }
|
||||
void SsSetMono(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SsSetSerialVol(short s_num, short voll, short volr) {
|
||||
DEBUGF("s_num %d voll %d volr %d", s_num, voll, volr);
|
||||
@ -67,16 +63,16 @@ void SsUtSetReverbDepth(short ldepth, short rdepth) {
|
||||
}
|
||||
|
||||
s32 SsVabTransCompleted(short immediateFlag) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 SsVabOpenHeadSticky(u_char* addr, u_long vabid, u_long sbaddr) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
s32 SsVabTransBodyPartly(u_char* addr, u_long bufsize, u_long vabid) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void SsVabClose(short vab_id) { DEBUGF("not implemented"); }
|
||||
void SsVabClose(short vab_id) { NOT_IMPLEMENTED; }
|
||||
|
@ -4,22 +4,20 @@
|
||||
|
||||
void SpuSetVoiceAttr(SpuVoiceAttr* arg) { DEBUGF("SpuSetVoiceAttr"); }
|
||||
|
||||
long SpuMallocWithStartAddr(unsigned long addr, long size) {
|
||||
DEBUGF("not implemented");
|
||||
}
|
||||
long SpuMallocWithStartAddr(unsigned long addr, long size) { NOT_IMPLEMENTED; }
|
||||
|
||||
SpuIRQCallbackProc SpuSetIRQCallback(SpuIRQCallbackProc in) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
return in;
|
||||
}
|
||||
|
||||
long SpuSetTransferMode(long mode) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
long SpuClearReverbWorkArea(long rev_mode) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
135
src/pc/sotn.c
135
src/pc/sotn.c
@ -1,5 +1,6 @@
|
||||
#include "pc.h"
|
||||
#include "dra.h"
|
||||
#include "servant.h"
|
||||
#include "sfx.h"
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
@ -8,7 +9,40 @@ extern SDL_Renderer* g_Renderer;
|
||||
bool g_IsQuitRequested;
|
||||
int g_Frame = 0;
|
||||
|
||||
void UpdateGame() {
|
||||
void HandleTitle();
|
||||
void HandlePlay();
|
||||
|
||||
GameApi g_ApiInit = {0};
|
||||
Equipment g_EquipDefs[0x100] = {0};
|
||||
Accessory g_AccessoryDefs[0x100] = {0};
|
||||
RelicDesc g_RelicDefs[0x100] = {0};
|
||||
void (*D_80170000)(s32 arg0); // ServantDesc D_80170000 = {0};
|
||||
Weapon D_8017A000 = {0};
|
||||
Weapon D_8017D000 = {0};
|
||||
|
||||
void StageOvlCb() {
|
||||
SetGameState(Game_NowLoading);
|
||||
g_GameStep = NowLoading_2;
|
||||
}
|
||||
|
||||
void WeaponLoadPaletteStub(s32 arg0) { NOT_IMPLEMENTED; }
|
||||
|
||||
// list of exposed API
|
||||
void FreePrimitives(s32 index);
|
||||
s32 AllocPrimitives(u8 primType, s32 count);
|
||||
s32 func_800EA5E4(u32);
|
||||
void LoadGfxAsync(s32 gfxId);
|
||||
void func_800EA538(s32 arg0);
|
||||
void func_8010DFF0(s32 arg0, s32 arg1);
|
||||
void DebugInputWait(const char* msg);
|
||||
|
||||
// stub to the original UpdateGame
|
||||
void func_800F298C() { PlaySfx(MU_REQUIEM_FOR_THE_GODS); }
|
||||
|
||||
int MyDrawSync(int mode) {
|
||||
SDL_RenderPresent(g_Renderer);
|
||||
SDL_RenderSetScale(g_Renderer, SCREEN_SCALE, SCREEN_SCALE);
|
||||
|
||||
// SDL event handling
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
@ -23,13 +57,98 @@ void UpdateGame() {
|
||||
SDL_RenderClear(g_Renderer);
|
||||
|
||||
DEBUGF("-------------------- frame %d --------------------", g_Frame);
|
||||
if (g_Frame == 0) {
|
||||
INFOF("now playing '%s'", "MU_LOST_PAINTING");
|
||||
PlaySfx(MU_LOST_PAINTING);
|
||||
}
|
||||
DEBUGF("state: %d, game step: %d", g_GameState, g_GameStep);
|
||||
|
||||
// Update the renderer
|
||||
SDL_RenderPresent(g_Renderer);
|
||||
SDL_RenderSetScale(g_Renderer, SCREEN_SCALE, SCREEN_SCALE);
|
||||
g_Frame++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// called before MainGame
|
||||
void InitGame() {
|
||||
// These two are necessary to make HandleTitle working
|
||||
GameApi api;
|
||||
api.FreePrimitives = FreePrimitives;
|
||||
api.AllocPrimitives = AllocPrimitives;
|
||||
api.CheckCollision = NULL;
|
||||
api.func_80102CD8 = NULL;
|
||||
api.UpdateAnim = NULL;
|
||||
api.SetSpeedX = NULL;
|
||||
api.GetFreeDraEntity = NULL;
|
||||
api.GetEquipProperties = NULL;
|
||||
api.func_800EA5E4 = func_800EA5E4;
|
||||
api.LoadGfxAsync = LoadGfxAsync;
|
||||
api.PlaySfx = NULL;
|
||||
api.func_800EDB58 = NULL;
|
||||
api.func_800EA538 = func_800EA538;
|
||||
api.g_pfn_800EA5AC = NULL;
|
||||
api.func_801027C4 = NULL;
|
||||
api.func_800EB758 = NULL;
|
||||
api.CreateEntFactoryFromEntity = NULL;
|
||||
api.func_80131F68 = NULL;
|
||||
api.func_800EDB08 = NULL;
|
||||
api.func_80106A28 = NULL;
|
||||
api.func_80118894 = NULL;
|
||||
api.enemyDefs = NULL;
|
||||
api.func_80118970 = NULL;
|
||||
api.func_80118B18 = NULL;
|
||||
api.UpdateUnarmedAnim = NULL;
|
||||
api.func_8010DBFC = NULL;
|
||||
api.func_80118C28 = NULL;
|
||||
api.func_8010E168 = NULL;
|
||||
api.func_8010DFF0 = func_8010DFF0;
|
||||
api.DealDamage = NULL;
|
||||
api.LoadEquipIcon = NULL;
|
||||
api.equipDefs = g_EquipDefs;
|
||||
api.accessoryDefs = g_AccessoryDefs;
|
||||
api.AddHearts = NULL;
|
||||
api.LoadMonsterLibrarianPreview = NULL;
|
||||
api.TimeAttackController = NULL;
|
||||
api.func_8010E0A8 = NULL;
|
||||
api.func_800FE044 = NULL;
|
||||
api.AddToInventory = NULL;
|
||||
api.relicDefs = g_RelicDefs;
|
||||
api.InitStatsAndGear = NULL;
|
||||
api.func_80134714 = NULL;
|
||||
api.func_80134678 = NULL;
|
||||
api.func_800F53A4 = NULL;
|
||||
api.CheckEquipmentItemCount = NULL;
|
||||
api.func_8010BF64 = NULL;
|
||||
api.func_800F1FC4 = NULL;
|
||||
api.func_800F2288 = NULL;
|
||||
api.func_8011A3AC = NULL;
|
||||
api.func_800FF460 = NULL;
|
||||
api.func_800FF494 = NULL;
|
||||
api.CdSoundCommandQueueEmpty = NULL;
|
||||
api.func_80133950 = NULL;
|
||||
api.func_800F27F4 = NULL;
|
||||
api.func_800FF110 = NULL;
|
||||
api.func_800FD664 = NULL;
|
||||
api.func_800FD5BC = NULL;
|
||||
api.LearnSpell = NULL;
|
||||
api.DebugInputWait = DebugInputWait;
|
||||
api.unused12C = NULL;
|
||||
api.unused130 = NULL;
|
||||
api.unused134 = NULL;
|
||||
api.unused138 = NULL;
|
||||
api.unused13C = NULL;
|
||||
api.o.Update = NULL;
|
||||
api.o.TestCollisions = StageOvlCb;
|
||||
api.o.unk08 = NULL;
|
||||
api.o.InitRoomEntities = StageOvlCb;
|
||||
api.o.rooms = NULL;
|
||||
api.o.spriteBanks = NULL;
|
||||
api.o.cluts = NULL;
|
||||
api.o.unk1C = NULL;
|
||||
api.o.tileLayers = NULL;
|
||||
api.o.gfxBanks = NULL;
|
||||
api.o.unk28 = NULL;
|
||||
api.o.unk2c = NULL;
|
||||
api.o.unk30 = NULL;
|
||||
api.o.unk34 = NULL;
|
||||
api.o.unk38 = NULL;
|
||||
api.o.unk3C = NULL;
|
||||
memcpy(&g_ApiInit, &api, sizeof(g_ApiInit));
|
||||
|
||||
D_8017A000.LoadWeaponPalette = WeaponLoadPaletteStub;
|
||||
D_8017D000.LoadWeaponPalette = WeaponLoadPaletteStub;
|
||||
}
|
||||
|
129
src/pc/stubs.c
129
src/pc/stubs.c
@ -14,6 +14,8 @@ s32 g_LoadFile;
|
||||
u32 g_CdStep;
|
||||
GameState g_GameState;
|
||||
Entity g_Entities[TOTAL_ENTITY_COUNT];
|
||||
Primitive g_PrimBuf[MAX_PRIM_COUNT];
|
||||
Lba g_StagesLba[0x50];
|
||||
FgLayer D_8003C708;
|
||||
s16 D_8003C710;
|
||||
s16 D_8003C712;
|
||||
@ -57,15 +59,26 @@ s16 D_80136308[];
|
||||
u16 g_Clut[];
|
||||
s32 D_8006C384;
|
||||
s32 D_8006C388;
|
||||
MenuNavigation g_MenuNavigation;
|
||||
GameSettings g_Settings;
|
||||
s32 D_8006C384;
|
||||
s32 D_8006C388;
|
||||
s32 D_8006C38C;
|
||||
s32 D_8006C390;
|
||||
u16 D_8003C104[];
|
||||
s32 D_8003C738;
|
||||
u8 g_CastleFlags[0x300];
|
||||
s32 D_8006C374;
|
||||
u16 D_8003C3C2[];
|
||||
u32 D_80070BCC;
|
||||
s32 g_Servant;
|
||||
s32 g_ServantLoaded;
|
||||
s32 g_IsTimeAttackUnlocked;
|
||||
Unkstruct_8003C908 D_8003C908;
|
||||
s32 D_8003C100;
|
||||
s32 D_800978B4;
|
||||
|
||||
// dra.h
|
||||
void* g_ApiInit[sizeof(GameApi) / sizeof(void*)] = {0};
|
||||
GpuUsage g_GpuMaxUsage;
|
||||
GpuBuffer* g_BackBuffer;
|
||||
s32 g_DebugFreeze;
|
||||
@ -104,6 +117,8 @@ s32 D_800A2438;
|
||||
s32 D_801362D0[];
|
||||
s32 D_800987B4;
|
||||
u8 g_PadsRepeatTimer[BUTTON_COUNT * PAD_COUNT];
|
||||
s32 D_80136410;
|
||||
s32 D_80136414[];
|
||||
|
||||
// sound bss
|
||||
s16 g_SoundCommandRingBufferReadPos;
|
||||
@ -209,71 +224,125 @@ s32 D_800C1ECC[];
|
||||
// sound stubs
|
||||
void func_801327B4(int arg0, int arg1, int vabId, int prog, int tone, int note,
|
||||
int g_VolL, int g_VolR) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void func_80133FCC(void) { DEBUGF("not implemented"); }
|
||||
void func_80133FCC(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_80135D8C() { DEBUGF("not implemented"); }
|
||||
void func_80135D8C() { NOT_IMPLEMENTED; }
|
||||
|
||||
s32 func_80136010(void) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void func_8013572C(int sndId, int unk02, int unk04) {
|
||||
DEBUGF("not implemented");
|
||||
}
|
||||
void func_8013572C(int sndId, int unk02, int unk04) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_801073C0(void) { DEBUGF("not implemented"); }
|
||||
void func_801073C0(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_800EAD7C(void) { DEBUGF("not implemented"); }
|
||||
void func_800EAD7C(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void HideAllBackgroundLayers(void) { DEBUGF("not implemented"); }
|
||||
void HideAllBackgroundLayers(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void DestroyAllPrimitives(void) { DEBUGF("not implemented"); }
|
||||
void DestroyAllPrimitives(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void DestroyEntities(s16 startIndex) { DEBUGF("not implemented"); }
|
||||
void DestroyEntities(s16 startIndex) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SetupEvents(void) { DEBUGF("not implemented"); }
|
||||
void SetupEvents(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
s32 LoadFileSim(s32 fileId, SimFileType type) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ResetPendingGfxLoad(void) { DEBUGF("not implemented"); }
|
||||
void ResetPendingGfxLoad(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_800EA538(s32 arg0) { DEBUGF("not implemented"); }
|
||||
void func_800EA538(s32 arg0) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_800EA7CC(void) { DEBUGF("not implemented"); }
|
||||
void func_800EA7CC(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_800EDAE4(void) { DEBUGF("not implemented"); }
|
||||
void func_800EDAE4(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void VSyncHandler(void) { DEBUGF("not implemented"); }
|
||||
void VSyncHandler(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void InitRenderer(void) { DEBUGF("not implemented"); }
|
||||
void InitRenderer(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void RenderEntities(void) { DEBUGF("not implemented"); }
|
||||
void RenderEntities(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void RenderTilemap(void) { DEBUGF("not implemented"); }
|
||||
void RenderTilemap(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void RenderPrimitives(void) { DEBUGF("not implemented"); }
|
||||
void RenderPrimitives(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void DrawEntitiesHitbox(s32 blendMode) { DEBUGF("not implemented"); }
|
||||
void DrawEntitiesHitbox(s32 blendMode) { NOT_IMPLEMENTED; }
|
||||
|
||||
void UpdateCd(void) { DEBUGF("not implemented"); }
|
||||
void UpdateCd(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void LoadPendingGfx(void) { DEBUGF("not implemented"); }
|
||||
void LoadPendingGfx(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
int CdInit(void) {
|
||||
DEBUGF("not implemented");
|
||||
NOT_IMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void func_8010DFF0(s32 arg0, s32 arg1) { DEBUGF("not implemented"); }
|
||||
void func_8010DFF0(s32 arg0, s32 arg1) { NOT_IMPLEMENTED; }
|
||||
|
||||
void ResetEntityArray(void) { DEBUGF("not implemented"); }
|
||||
void ResetEntityArray(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_800F2120(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_800FF0B8(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void ApplyJosephsCloakPalette(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void LoadGfxAsync(s32 gfxId) {
|
||||
NOT_IMPLEMENTED;
|
||||
DEBUGF("gfxId: %d", gfxId);
|
||||
}
|
||||
|
||||
void func_800FDE00(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
s32 func_800EAD0C(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
s32 func_800EA5E4(u32) { NOT_IMPLEMENTED; }
|
||||
|
||||
s32 func_800F16D0(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
bool func_800EB720(void) { return false; }
|
||||
|
||||
void DemoInit(s32) { NOT_IMPLEMENTED; }
|
||||
|
||||
void DemoUpdate(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_801024DC(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
s32 AllocPrimitives(u8 primType, s32 count) { NOT_IMPLEMENTED; }
|
||||
|
||||
void FreePrimitives(s32 index) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_800EA5AC(u16 arg0, u8 arg1, u8 arg2, u8 arg3) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_80107250(POLY_GT4* poly, s32 colorIntensity) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_801072BC(POLY_GT4* poly) { NOT_IMPLEMENTED; }
|
||||
|
||||
void func_801072DC(POLY_GT4* poly) { NOT_IMPLEMENTED; }
|
||||
|
||||
void SetTexturedPrimRect(
|
||||
Primitive* poly, s32 x, s32 y, s32 width, s32 height, s32 u, s32 v) {
|
||||
NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void SetPrimRect(Primitive* poly, s32 x, s32 y, s32 width, s32 height) {
|
||||
NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void func_800E5D30(void* arg0, u16 arg1, u16 arg2, s32 arg3) {
|
||||
NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void InitStatsAndGear(bool isDeathTakingItems) { NOT_IMPLEMENTED; }
|
||||
|
||||
void CheckWeaponCombo(void) { NOT_IMPLEMENTED; }
|
||||
|
||||
void ResetPadsRepeat(void) {
|
||||
s8* ptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user