From 6d284d446190da796b635c9c922b5b1bd2b2270e Mon Sep 17 00:00:00 2001 From: Mark Street <22226349+mkst@users.noreply.github.com> Date: Fri, 22 Mar 2024 22:30:18 +0000 Subject: [PATCH 1/2] Update link to gc/wii compilers (#72) --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e890bce..2d19f32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,8 +32,8 @@ jobs: shell: bash run: | mv build_debug/wibo build/wibo_debug - wget -q https://cdn.discordapp.com/attachments/727918646525165659/1129759991696457728/GC_WII_COMPILERS.zip - unzip -q GC_WII_COMPILERS.zip + wget -q https://files.decomp.dev/compilers_latest.zip + unzip -q compilers_latest.zip set -x build/wibo_debug Wii/1.7/mwcceppc.exe -nodefaults -c test/test.c -Itest -o test_debug.o file test_debug.o From 0fbe87751fe0ed4c7ecd89f0831ce4272fa020ae Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 23 Mar 2024 01:44:53 -0300 Subject: [PATCH 2/2] Fix `FindFirstFileA` failing due to an empty parent and add locale `LCType` stubs (#71) * Fix sn cpp.exe not finding the include paths * str_for_LCType stubs for sn gcc as.exe --- dll/kernel32.cpp | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/dll/kernel32.cpp b/dll/kernel32.cpp index aa37e0a..07e9989 100644 --- a/dll/kernel32.cpp +++ b/dll/kernel32.cpp @@ -724,15 +724,20 @@ namespace kernel32 { return (void *) 1; } - auto *handle = new FindFirstFileHandle(); + // If the parent path is empty then we assume the parent path is the current directory. + auto parent_path = path.parent_path(); + if (parent_path == "") { + parent_path = "."; + } - if (!std::filesystem::exists(path.parent_path())) { + if (!std::filesystem::exists(parent_path)) { wibo::lastError = ERROR_PATH_NOT_FOUND; - delete handle; return INVALID_HANDLE_VALUE; } - std::filesystem::directory_iterator it(path.parent_path()); + auto *handle = new FindFirstFileHandle(); + + std::filesystem::directory_iterator it(parent_path); handle->it = it; handle->pattern = path.filename().string(); @@ -1912,7 +1917,39 @@ namespace kernel32 { if (LCType == 4098) { // LOCALE_SENGCOUNTRY return "Country"; } - assert(false); + if (LCType == 0x1) { // LOCALE_ILANGUAGE + return "0001"; + } + if (LCType == 0x15) { // LOCALE_SINTLSYMBOL + return "Currency"; + } + if (LCType == 0x14) { // LOCALE_SCURRENCY + return "sCurrency"; + } + if (LCType == 0x16) { // LOCALE_SMONDECIMALSEP + return "."; + } + if (LCType == 0x17) { // LOCALE_SMONTHOUSANDSEP + return ","; + } + if (LCType == 0x18) { // LOCALE_SMONGROUPING + return ";"; + } + if (LCType == 0x50) { // LOCALE_SPOSITIVESIGN + return ""; + } + if (LCType == 0x51) { // LOCALE_SNEGATIVESIGN + return "-"; + } + if (LCType == 0x1A) { // LOCALE_IINTLCURRDIGITS + return "2"; + } + if (LCType == 0x19) { // LOCALE_ICURRDIGITS + return "2"; + } + + DEBUG_LOG("STUB: LCType 0x%X not implemented\n", LCType); + return ""; } int WIN_FUNC GetLocaleInfoA(unsigned int Locale, int LCType, LPSTR lpLCData, int cchData) {