diff --git a/Makefile.psp.mk b/Makefile.psp.mk index 86af05cc4..fe110781e 100644 --- a/Makefile.psp.mk +++ b/Makefile.psp.mk @@ -81,9 +81,11 @@ $(BUILD_DIR)/%.s.o: %.s @mkdir -p $(dir $@) $(AS) $(AS_FLAGS) -o $@ $< -FILES_WITH_O4 = 624DC.c.o 61F30.c.o 63C90.c.o -OPT_HIGH = -O4,p #need this because otherwise the comma breaks the filter statement -OPTIMIZATION = $(if $(filter $(notdir $@),$(FILES_WITH_O4)), $(OPT_HIGH), -Op) +# DRA appears to be compiled with -O4,p. This will control that flag. +# May need to modify if other -O4,p functions are found in other overlays. +# Works for now. Look in git history for a different approach which filters by individual .o file. +OPT_HIGH = -O4,p #need this because otherwise the comma breaks the if-statement +OPTIMIZATION = $(if $(findstring dra, $@), $(OPT_HIGH), -Op) $(BUILD_DIR)/%.c.o: %.c $(MWCCPSP) $(MWCCGAP_APP) @mkdir -p $(dir $@) diff --git a/config/splat.pspeu.dra.yaml b/config/splat.pspeu.dra.yaml index 9f02ffafb..6ca5db9b3 100644 --- a/config/splat.pspeu.dra.yaml +++ b/config/splat.pspeu.dra.yaml @@ -184,6 +184,8 @@ segments: - [0x67E90, c, dra_psp/67E90] - [0x680C0, c, dra_psp/680C0] - [0x68D80, data] + - [0x6DDE8, .data, dra_psp/18210] # "\no\n" + - [0x6DDF0, data] - [0xEE380, .rodata, dra_psp/80] - [0xEE3A0, .rodata, dra/624DC] - [0xEE3C0, .rodata, dra_psp/60F8] diff --git a/config/symbols.pspeu.dra.txt b/config/symbols.pspeu.dra.txt index 1f7bfe088..39b0deffd 100644 --- a/config/symbols.pspeu.dra.txt +++ b/config/symbols.pspeu.dra.txt @@ -17,6 +17,7 @@ func_80102CD8 = 0x090E2EC8; SetNextRoomToLoad = 0x090E73D0; func_800F0CD8 = 0x090E74E8; func_800F298C = 0x090e9018; +DebugShowWaitInfo = 0x090f5068; DebugUpdate = 0x090f5180; MainGame = 0x090f5b58; HandleTitle = 0x090f6800; @@ -105,6 +106,7 @@ D_8013799C = 0x091CDC70; D_801379A0 = 0x091CDC74; D_801379A4 = 0x091CDC78; D_801379A8 = 0x091CDC7C; +g_DebugWaitInfoTimer = 0x091CE268; D_80097420 = 0x091CE620; g_MenuNavigation = 0x091cefd0; D_80097C98 = 0x091ed280; diff --git a/config/symbols.pspeu.txt b/config/symbols.pspeu.txt index 14f4f946c..c981e3e7a 100644 --- a/config/symbols.pspeu.txt +++ b/config/symbols.pspeu.txt @@ -1,9 +1,13 @@ abs = 0x08906AF0; memcpy = 0x08909F84; rand = 0x0890B954; +DrawSync = 0x0891B448; +VSync = 0x0891B5BC; LoadImage = 0x0891BFE4; ClearImage = 0x0891CA60; ClearOTag = 0x0891D0E0; +PutDrawEnv = 0x0891D484; +PutDispEnv = 0x0891D68C; FntPrint = 0x08925e98; SsSetMVol = 0x89261B4; SsUtSetReverbDepth = 0x89261D4; @@ -61,5 +65,6 @@ g_Clut = 0x091F5DF8; g_Clut_2800 = 0x091F85F8; g_Clut_2860 = 0x091F8658; g_GameTimer = 0x091FC460; +g_CurrentBuffer = 0x091FC4E0; g_CastleFlags = 0x09234730; g_ItemIconSlots = 0x0924BC20; diff --git a/include/psxsdk/libgpu.h b/include/psxsdk/libgpu.h index 3e84aaa14..f6d348dfa 100644 --- a/include/psxsdk/libgpu.h +++ b/include/psxsdk/libgpu.h @@ -1,6 +1,11 @@ #ifndef LIBGPU_H #define LIBGPU_H +#ifndef VERSION_PSP +#define DR_ENV_CODE_SIZE 15 +#else +#define DR_ENV_CODE_SIZE 8 +#endif /* * Set Primitive Attributes */ @@ -171,7 +176,7 @@ typedef struct { typedef struct { O_TAG; - /* 0x4 */ u_long code[15]; + /* 0x4 */ u_long code[DR_ENV_CODE_SIZE]; } DR_ENV; /* Packed Drawing Environment, size = 0x40 */ typedef struct { diff --git a/src/dra/42398.c b/src/dra/42398.c index 42143c614..f4d90c446 100644 --- a/src/dra/42398.c +++ b/src/dra/42398.c @@ -58,7 +58,9 @@ void DebugShowWaitInfo(const char* msg) { VSync(0); PutDrawEnv(&g_CurrentBuffer->draw); PutDispEnv(&g_CurrentBuffer->disp); +#if !defined(VERSION_PSP) FntFlush(-1); +#endif } void DebugInputWait(const char* msg) { diff --git a/src/dra_psp/18210.c b/src/dra_psp/18210.c index b5ff41280..5305fd195 100644 --- a/src/dra_psp/18210.c +++ b/src/dra_psp/18210.c @@ -5,6 +5,21 @@ INCLUDE_ASM("dra_psp/psp/dra_psp/18210", func_psp_090F4B90); INCLUDE_ASM("dra_psp/psp/dra_psp/18210", func_psp_090F4FC8); -INCLUDE_ASM("dra_psp/psp/dra_psp/18210", func_psp_090F5068); +extern s32 g_DebugWaitInfoTimer; + +void DebugShowWaitInfo(const char* msg) { + g_CurrentBuffer = g_CurrentBuffer->next; + FntPrint(msg); + if (g_DebugWaitInfoTimer++ & 4) { + FntPrint("\no\n"); + } + DrawSync(0); + VSync(0); + PutDrawEnv(&g_CurrentBuffer->draw); + PutDispEnv(&g_CurrentBuffer->disp); +#if !defined(VERSION_PSP) + FntFlush(-1); +#endif +} INCLUDE_ASM("dra_psp/psp/dra_psp/18210", func_psp_090F50F8);