diff --git a/core/hw/naomi/naomi_cart.cpp b/core/hw/naomi/naomi_cart.cpp index 8333856cd..4a05dc780 100644 --- a/core/hw/naomi/naomi_cart.cpp +++ b/core/hw/naomi/naomi_cart.cpp @@ -681,7 +681,7 @@ void naomi_cart_LoadRom(const std::string& path, const std::string& fileName, Lo } if (gameId == " TOUCH DE UNOH -------------" || gameId == " TOUCH DE UNOH 2 -----------" - || (gameId == "F355 CHALLENGE JAPAN" && config::MultiboardSlaves == 2)) + || (gameId == "F355 CHALLENGE JAPAN" && (config::MultiboardSlaves == 2 || romName == "f355"))) { printer::init(); } diff --git a/core/hw/naomi/printer.cpp b/core/hw/naomi/printer.cpp index 25552193f..b7b31cf29 100644 --- a/core/hw/naomi/printer.cpp +++ b/core/hw/naomi/printer.cpp @@ -30,7 +30,9 @@ #undef INFO_LOG #define INFO_LOG(t, s, ...) printf(s "\n", __VA_ARGS__) #undef NOTICE_LOG -#define NOTICE_LOG(t, s, ...) printf(s "\n", __VA_ARGS__) +#define NOTICE_LOG INFO_LOG +#undef ERROR_LOG +#define ERROR_LOG INFO_LOG #else #include CMRC_DECLARE(flycast); @@ -329,7 +331,7 @@ public: ERROR_LOG(NAOMI, "Failed to load the printer template: %s", e.what()); } #else - FILE *f = fopen("../resources/picture/f355_print_template.png", "rb"); + FILE *f = fopen("f355_print_template.png", "rb"); if (f != nullptr) { data = stbi_load_from_file(f, &x, &y, &comp, STBI_rgb_alpha); @@ -338,8 +340,23 @@ public: else fprintf(stderr, "Can't open template file %d\n", errno); #endif + if (data != nullptr && (x != printerWidth || comp != STBI_rgb_alpha)) + { + ERROR_LOG(NAOMI, "Invalid printer template: width %d comp %d", x, comp); + stbi_image_free(data); + data = nullptr; + } if (data != nullptr) { + if (lines > y) + { + u8 *newData = (u8 *)malloc(printerWidth * 4 * lines); + const u8 *end = newData + printerWidth * 4 * lines; + for (u8 *p = newData; p < end; p += printerWidth * 4 * y) + memcpy(p, data, std::min(printerWidth * 4 * y, (int)(end - p))); + stbi_image_free(data); + data = newData; + } u32 *p = (u32 *)data; for (u8 b : page) { diff --git a/core/network/naomi_network.cpp b/core/network/naomi_network.cpp index bfdf79090..758cea437 100644 --- a/core/network/naomi_network.cpp +++ b/core/network/naomi_network.cpp @@ -370,7 +370,7 @@ void SetNaomiNetworkConfig(int node) { configure_maxspeed_flash(node != -1, node == 0); } - else if (gameId == "F355 CHALLENGE JAPAN") + else if (gameId == "F355 CHALLENGE JAPAN" && settings.content.fileName != "f355") { write_naomi_flash(0x230, node == -1 ? 0 : node == 0 ? 1 : 2); if (node != -1) @@ -394,8 +394,8 @@ bool NaomiNetworkSupported() }; if (!config::NetworkEnable) return false; - if (settings.content.fileName.substr(0, 6) == "clubkp") - // Club Kart Prize doesn't support networking + if (settings.content.fileName.substr(0, 6) == "clubkp" || settings.content.fileName == "f355") + // Club Kart Prize and F355 (vanilla) don't support networking return false; for (auto game : games) if (settings.content.gameId == game) diff --git a/resources/picture/f355_print_template.png b/resources/picture/f355_print_template.png index 4e7b7b9e0..39189edef 100644 Binary files a/resources/picture/f355_print_template.png and b/resources/picture/f355_print_template.png differ