port: partially unfuck menus

This commit is contained in:
fgsfds 2023-08-04 01:11:19 +02:00
parent 952d23de08
commit 05889b54cb
4 changed files with 30 additions and 5 deletions

View File

@ -58,7 +58,7 @@ using namespace std;
#define MAX_BUFFERED 256
// #define MAX_LIGHTS 2
#define MAX_LIGHTS 32
#define MAX_VERTICES 250
#define MAX_VERTICES 240
#define MAX_VERTEX_COLORS 64
#define TEXTURE_CACHE_MAX_SIZE 1024
@ -730,7 +730,7 @@ static void import_texture_i8(int tile, bool importReplacement) {
// SUPPORT_CHECK(full_image_line_size_bytes == line_size_bytes);
for (uint32_t i = 0; i < size_bytes; i++) {
uint8_t intensity = addr[i];
const uint8_t intensity = addr[i];
tex_upload_buffer[4 * i + 0] = intensity;
tex_upload_buffer[4 * i + 1] = intensity;
tex_upload_buffer[4 * i + 2] = intensity;
@ -861,7 +861,8 @@ static void import_texture(int i, int tile, bool importReplacement) {
} else if (siz == G_IM_SIZ_32b) {
import_texture_rgba32(tile, importReplacement);
} else {
abort();
// abort(); // OTRTODO: Sometimes, seemingly randomly, we end up here. Could be a bad dlist, could be
// something F3D does not have supported. Further investigation is needed.
}
} else if (fmt == G_IM_FMT_IA) {
if (siz == G_IM_SIZ_4b) {

View File

@ -266,11 +266,19 @@ void schedEndFrame(OSSched *sc)
}
inputUpdate();
joysHandleRetrace();
joyStartReadData(&g_PiMesgQueue);
joyReadData();
joy00014238();
sndHandleRetrace();
schedRenderCrashPeriodically(sc->frameCount);
videoEndFrame();
if (g_MainIsBooting == 0) {
schedConsiderScreenshot();
}
// check for vid mode changes
__scUpdateViMode();
}
@ -374,5 +382,16 @@ void schedUpdatePendingArtifacts(void)
void schedConsiderScreenshot(void)
{
if (g_MenuData.screenshottimer == 1) {
// TODO
// if (IS8MB()) {
// menugfxCreateBlur();
// }
g_MenuData.screenshottimer = 0;
}
if (g_MenuData.screenshottimer >= 2) {
g_MenuData.screenshottimer--;
}
}

View File

@ -466,12 +466,14 @@ char *menuResolveText(uintptr_t thing, void *dialogoritem)
return langGet((u32)thing);
}
#ifdef PLATFORM_N64 // unreliable otherwise, the above check should be enough?
if (thing > (uintptr_t)func0f1a78b0) {
#if VERSION < VERSION_NTSC_1_0
CRASH();
#endif
return NULL;
}
#endif
// Function pointer
if (handler) {

View File

@ -124,7 +124,10 @@ Gfx *menugfxRenderBgBlur(Gfx *gdl, u32 colour, s16 arg2, s16 arg3)
s32 height;
#endif
if (IS4MB()) {
#ifdef PLATFORM_N64 // TODO
if (IS4MB())
#endif
{
return menugfxRenderGradient(gdl, 0, 0, viGetWidth(), viGetHeight(), 0xff, 0xff, 0xff);
}