diff --git a/src/platform/test/perf-main.c b/src/platform/test/perf-main.c index 97066fb36..ccedf267b 100644 --- a/src/platform/test/perf-main.c +++ b/src/platform/test/perf-main.c @@ -22,6 +22,14 @@ #ifdef __SWITCH__ #include #endif +#ifdef GEKKO +#include +#include +#ifdef FIXED_ROM_BUFFER +uint32_t* romBuffer; +size_t romBufferSize; +#endif +#endif #include #include @@ -83,6 +91,29 @@ int main(int argc, char** argv) { #elif defined(__SWITCH__) UNUSED(_mPerfShutdown); consoleInit(NULL); +#elif defined(GEKKO) + VIDEO_Init(); + VIDEO_SetBlack(true); + VIDEO_Flush(); + VIDEO_WaitVSync(); + + GXRModeObj* vmode = VIDEO_GetPreferredMode(0); + void* xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(vmode)); + console_init(xfb, 20, 20, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth * VI_DISPLAY_PIX_SZ); + + VIDEO_Configure(vmode); + VIDEO_SetNextFramebuffer(xfb); + VIDEO_SetBlack(false); + VIDEO_Flush(); + VIDEO_WaitVSync(); + VIDEO_WaitVSync(); + fatInitDefault(); + +#ifdef FIXED_ROM_BUFFER + romBufferSize = 0x02000000; + romBuffer = SYS_GetArena2Lo(); + SYS_SetArena2Lo((void*)((intptr_t) romBuffer + romBufferSize)); +#endif #else signal(SIGINT, _mPerfShutdown); #endif @@ -125,6 +156,8 @@ int main(int argc, char** argv) { puts("game_code,frames,duration,renderer"); #ifdef __SWITCH__ consoleUpdate(NULL); +#elif defined(GEKKO) + VIDEO_WaitVSync(); #endif } if (perfOpts.server) { @@ -145,6 +178,11 @@ int main(int argc, char** argv) { acExit(); #elif defined(__SWITCH__) consoleExit(NULL); +#elif defined(GEKKO) + VIDEO_SetBlack(true); + VIDEO_Flush(); + VIDEO_WaitVSync(); + VIDEO_WaitVSync(); #endif return didFail; diff --git a/src/platform/wii/CMakeLists.txt b/src/platform/wii/CMakeLists.txt index 4caf73d10..d0a1a7821 100644 --- a/src/platform/wii/CMakeLists.txt +++ b/src/platform/wii/CMakeLists.txt @@ -11,6 +11,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/wii/wii-*.c) list(APPEND OS_LIB wiiuse bte fat ogc) set(OS_SRC ${OS_SRC} PARENT_SCOPE) +set(OS_LIB ${OS_LIB} PARENT_SCOPE) source_group("Wii-specific code" FILES ${OS_SRC}) set(CORE_VFS_SRC ${CORE_VFS_SRC} PARENT_SCOPE) set(OS_DEFINES ${OS_DEFINES} PARENT_SCOPE) @@ -39,6 +40,16 @@ add_custom_target(${BINARY_NAME}.dol ALL add_custom_target(run ${WIILOAD} ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.dol DEPENDS ${BINARY_NAME}.dol) +if(BUILD_PERF) + add_custom_target(${BINARY_NAME}-perf.dol ALL + ${ELF2DOL} ../${BINARY_NAME}-perf ${BINARY_NAME}-perf.dol + DEPENDS ${BINARY_NAME}-perf) + + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}-perf.dol + DESTINATION . COMPONENT ${BINARY_NAME}-perf) +endif() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta.xml.in ${CMAKE_CURRENT_BINARY_DIR}/meta.xml) install(TARGETS ${BINARY_NAME}.elf DESTINATION . COMPONENT ${BINARY_NAME}-dbg) diff --git a/src/platform/wii/main.c b/src/platform/wii/main.c index 63d48214b..769469b43 100644 --- a/src/platform/wii/main.c +++ b/src/platform/wii/main.c @@ -262,7 +262,7 @@ int main(int argc, char* argv[]) { #ifdef FIXED_ROM_BUFFER romBufferSize = SIZE_CART0; romBuffer = SYS_GetArena2Lo(); - SYS_SetArena2Lo((void*)((intptr_t) romBuffer + SIZE_CART0)); + SYS_SetArena2Lo((void*)((intptr_t) romBuffer + romBufferSize)); #endif #if !defined(COLOR_16_BIT) && !defined(COLOR_5_6_5)