Compare commits

...

3 Commits

Author SHA1 Message Date
Rafael Kitover
eb7c50017d Revert "SDL PixelArt test fix"
This reverts commit e0e639a02e.
2025-09-28 08:54:42 +00:00
Rafael Kitover
df66c6ff4a Revert "Check file size for GBA ROM and reduce memory footprint"
This reverts commit 56ea6456f5.
2025-09-28 08:54:26 +00:00
Squall Leonhart
e0e639a02e SDL PixelArt test fix 2025-09-28 15:29:17 +10:00
3 changed files with 7 additions and 23 deletions

View File

@@ -1675,31 +1675,16 @@ void GBAMatrixWrite16(GBAMatrix_t *matrix, uint32_t address, uint16_t value)
}
}
static size_t get_gba_rom_size(const char* szFile)
{
size_t size = 0;
FILE *f = fopen(szFile, "rb");
if (f == NULL)
return 0;
fseek(f, 0, SEEK_END);
size = ftell(f);
fclose(f);
return size;
}
int CPULoadRom(const char* szFile)
{
romSize = get_gba_rom_size(szFile);
romSize = SIZE_ROM * 4;
if (g_rom != NULL) {
CPUCleanUp();
}
systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
g_rom = (uint8_t*)malloc(romSize);
g_rom = (uint8_t*)malloc(SIZE_ROM * 4);
if (g_rom == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"ROM");
@@ -1844,14 +1829,14 @@ int CPULoadRom(const char* szFile)
int CPULoadRomData(const char* data, int size)
{
romSize = size % 2 == 0 ? size : size + 1;
romSize = SIZE_ROM * 4;
if (g_rom != NULL) {
CPUCleanUp();
}
systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
g_rom = (uint8_t*)malloc(romSize);
g_rom = (uint8_t*)malloc(SIZE_ROM * 4);
if (g_rom == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"ROM");
@@ -1884,7 +1869,7 @@ int CPULoadRomData(const char* data, int size)
memcpy(&ident, &g_rom[0xAC], 1);
if (ident == 'M') {
g_rom2 = (uint8_t *)malloc(romSize);
g_rom2 = (uint8_t *)malloc(SIZE_ROM * 4);
memcpy(g_rom2, data, size);
romSize = 0x01000000;

View File

@@ -1802,9 +1802,9 @@ bool retro_load_game(const struct retro_game_info *game)
return emulating;
}
bool retro_load_game_special(unsigned, const struct retro_game_info *game, size_t)
bool retro_load_game_special(unsigned, const struct retro_game_info *, size_t)
{
return retro_load_game(game);
return false;
}
void retro_unload_game(void)

View File

@@ -21,4 +21,3 @@ firmware2_desc = "gbc_bios.bin (Game Boy Color BIOS)"
firmware2_path = "gbc_bios.bin"
firmware2_opt = "true"
notes = "(!) gba_bios.bin (md5): a860e8c0b6d573d191e4ec7db1b1e4f6|(!) gb_bios.bin (md5): 32fbbd84168d3482956eb3c5051637f5|(!) gbc_bios.bin (md5): dbfce9db9deaa2567f6a84fde55f9680"