This commit is contained in:
Reonu
2021-07-16 02:48:49 +01:00
9 changed files with 60 additions and 23 deletions

View File

@@ -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.

View File

@@ -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(),

View File

@@ -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

View File

@@ -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

View File

@@ -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];

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;
}
}