diff --git a/include/config.h b/include/config.h index f724b8907..0b4e40214 100644 --- a/include/config.h +++ b/include/config.h @@ -29,6 +29,8 @@ #define BUGFIX_BOWSER_FALLEN_OFF_STAGE (0 || VERSION_US || VERSION_EU || VERSION_SH) /// Fixes bug where Bowser would look weird while fading out #define BUGFIX_BOWSER_FADING_OUT (0 || VERSION_US || VERSION_EU || VERSION_SH) +/// Removes multi-language cake screen +#define EU_CUSTOM_CAKE_FIX 1 // Support Rumble Pak // Currently not recommended, as it may cause random crashes. diff --git a/levels/ending/geo.c b/levels/ending/geo.c index b8e2711ad..867bebb56 100644 --- a/levels/ending/geo.c +++ b/levels/ending/geo.c @@ -21,7 +21,9 @@ const GeoLayout ending_geo_000050[] = { GEO_OPEN_NODE(), GEO_NODE_ORTHO(100), GEO_OPEN_NODE(), +#ifdef VERSION_EU GEO_BACKGROUND_COLOR(0x0001), +#endif GEO_ASM(0, geo_exec_cake_end_screen), GEO_CLOSE_NODE(), GEO_CLOSE_NODE(), diff --git a/levels/ending/header.h b/levels/ending/header.h index 2bf34c029..30bee900d 100644 --- a/levels/ending/header.h +++ b/levels/ending/header.h @@ -8,9 +8,13 @@ extern const GeoLayout ending_geo_000050[]; // leveldata extern const Gfx dl_cake_end_screen[]; +#ifndef EU_CUSTOM_CAKE_FIX extern const Gfx dl_cake_end_screen_eu_070296F8[]; extern const Gfx dl_cake_end_screen_eu_07029768[]; extern const Gfx dl_cake_end_screen_eu_070297D8[]; +#else +extern const Gfx dl_cake_end_screen_eu_fix[]; +#endif extern const Gfx dl_cake_end_screen[]; // script diff --git a/levels/ending/leveldata.c b/levels/ending/leveldata.c index f28605e60..84b953f4d 100644 --- a/levels/ending/leveldata.c +++ b/levels/ending/leveldata.c @@ -200,6 +200,7 @@ static const Gfx dl_cake_end_eu_070296D8[] = { gsSPEndDisplayList(), }; +#ifndef EU_CUSTOM_CAKE_FIX // 0x070296F8 - 0x07029768 const Gfx dl_cake_end_screen_eu_070296F8[] = { gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, cake_end_texture_eu_38), @@ -242,6 +243,13 @@ const Gfx dl_cake_end_screen_eu_070297D8[] = { gsSPEndDisplayList(), }; +#else +const Gfx dl_cake_end_screen_eu_fix[] = { + gsSPDisplayList(dl_cake_end_eu_070296D8), + gsSPEndDisplayList(), +}; +#endif + // VERSION_EU #else diff --git a/src/buffers/buffers.c b/src/buffers/buffers.c index 770c31175..1a2c2bc71 100644 --- a/src/buffers/buffers.c +++ b/src/buffers/buffers.c @@ -29,6 +29,6 @@ ALIGNED8 u8 gGfxSPTaskStack[SP_DRAM_STACK_SIZE8]; // 0xc00 bytes for f3dex, 0x900 otherwise ALIGNED8 u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE]; // 0x200 bytes -ALIGNED8 struct SaveBuffer gSaveBuffer; +struct SaveBuffer __attribute__ ((aligned (8))) gSaveBuffer; // 0x190a0 bytes struct GfxPool gGfxPools[2]; diff --git a/src/game/geo_misc.c b/src/game/geo_misc.c index 2fb8c5efa..61d7a8c02 100644 --- a/src/game/geo_misc.c +++ b/src/game/geo_misc.c @@ -209,7 +209,10 @@ Gfx *geo_exec_cake_end_screen(s32 callContext, struct GraphNode *node, UNUSED f3 gSPDisplayList(displayListHead++, dl_proj_mtx_fullscreen); #endif #ifdef VERSION_EU - switch (eu_get_language()) { +#ifdef EU_CUSTOM_CAKE_FIX + gSPDisplayList(displayListHead++, dl_cake_end_screen_eu_fix); +#else + switch (eu_get_language()) { case LANGUAGE_ENGLISH: gSPDisplayList(displayListHead++, dl_cake_end_screen_eu_070296F8); break; @@ -220,6 +223,7 @@ Gfx *geo_exec_cake_end_screen(s32 callContext, struct GraphNode *node, UNUSED f3 gSPDisplayList(displayListHead++, dl_cake_end_screen_eu_070297D8); break; } +#endif #else gSPDisplayList(displayListHead++, dl_cake_end_screen); #endif diff --git a/src/game/save_file.c b/src/game/save_file.c index 21d419acd..51ada8245 100644 --- a/src/game/save_file.c +++ b/src/game/save_file.c @@ -21,7 +21,7 @@ #define MENU_DATA_MAGIC 0x4849 #define SAVE_FILE_MAGIC 0x4441 -STATIC_ASSERT(sizeof(struct SaveBuffer) == EEPROM_SIZE, "eeprom buffer size must match"); +//STATIC_ASSERT(sizeof(struct SaveBuffer) == EEPROM_SIZE, "eeprom buffer size must match"); extern struct SaveBuffer gSaveBuffer; diff --git a/src/game/save_file.h b/src/game/save_file.h index ae6fcf35d..5cd6cd136 100644 --- a/src/game/save_file.h +++ b/src/game/save_file.h @@ -8,7 +8,14 @@ #include "course_table.h" -#define EEPROM_SIZE 0x200 +#if defined(SRAM) + #define EEPROM_SIZE 0x8000 +#elif defined(EEP16K) + #define EEPROM_SIZE 0x800 +#else + #define EEPROM_SIZE 0x200 +#endif + #define NUM_SAVE_FILES 4 struct SaveBlockSignature @@ -61,7 +68,7 @@ struct MainMenuSaveData #endif // Pad to match the EEPROM size of 0x200 (10 bytes on JP/US, 8 bytes on EU) - u8 filler[EEPROM_SIZE / 2 - SUBTRAHEND - NUM_SAVE_FILES * (4 + sizeof(struct SaveFile))]; + //u8 filler[EEPROM_SIZE / 2 - SUBTRAHEND - NUM_SAVE_FILES * (4 + sizeof(struct SaveFile))]; struct SaveBlockSignature signature; }; @@ -74,6 +81,8 @@ struct SaveBuffer struct MainMenuSaveData menuData[2]; }; +STATIC_ASSERT(sizeof(struct SaveBuffer) <= EEPROM_SIZE, "ERROR: Save struct too big for specified save type"); + extern u8 gLastCompletedCourseNum; extern u8 gLastCompletedStarNum; extern s8 sUnusedGotGlobalCoinHiScore; diff --git a/tools/skyconv.c b/tools/skyconv.c index f4634ead0..5db4419e2 100644 --- a/tools/skyconv.c +++ b/tools/skyconv.c @@ -118,15 +118,18 @@ static void split_tile(int col, int row, rgba *image, bool expanded) { for (int x = 0; x < tileWidth; x++) { int ny = row * tileHeight + y; int nx = col * tileWidth + x; - if (nx < imageWidth && ny < imageHeight) - { + if(type == CakeEU) { tiles[row * numCols + col].px[y * expandedWidth + x] = image[(ny * imageWidth + nx)]; + } else { + if (nx < imageWidth && ny < imageHeight) + { + tiles[row * numCols + col].px[y * expandedWidth + x] = image[(ny * imageWidth + nx)]; + } + else + { + tiles[row * numCols + col].px[y * expandedWidth + x] = black; + } } - else - { - tiles[row * numCols + col].px[y * expandedWidth + x] = black; - } - } } } @@ -345,19 +348,24 @@ static void write_cake_c() { FILE *cFile = fopen(buffer, "w"); - const char *euSuffx = ""; + int numTiles = TABLE_DIMENSIONS[type].cols * TABLE_DIMENSIONS[type].rows; + if (type == CakeEU) { - euSuffx = "eu_"; + for (int i = 0; i < numTiles; ++i) { + fprintf(cFile, "ALIGNED8 static const Texture cake_end_texture_eu_%d[] = {\n", i); + print_raw_data(cFile, &tiles[i]); + fputs("};\n\n", cFile); + } + } else { + fprintf(cFile, "ALIGNED8 static const u8 cake_end_texture_data[] = {\n"); + for (int i = 0; i < numTiles; ++i) { + print_raw_data(cFile, &tiles[i]); + fputc(',', cFile); + fputc('\n', cFile); + } + fputs("};\n\n", cFile); } - int numTiles = TABLE_DIMENSIONS[type].cols * TABLE_DIMENSIONS[type].rows; - fprintf(cFile, "ALIGNED8 static const Texture cake_end_texture_%sdata[] = {\n", euSuffx); - for (int i = 0; i < numTiles; ++i) { - print_raw_data(cFile, &tiles[i]); - fputc(',', cFile); - fputc('\n', cFile); - } - fputs("};\n\n", cFile); fclose(cFile); } @@ -669,4 +677,4 @@ int main(int argc, char *argv[]) { return EXIT_SUCCESS; -} +} \ No newline at end of file