Skip to content

Commit

Permalink
Further improve ROM loading ability.
Browse files Browse the repository at this point in the history
Add fixme for why it might be broken.
  • Loading branch information
networkfusion committed Oct 10, 2023
1 parent 7de97a4 commit 13756a9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/flashcart/ed64/ed64.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ static flashcart_err_t ed64_load_rom (char *rom_path, flashcart_progress_callbac

size_t rom_size = f_size(&fil);

// FIXME: if the cart is not V3 or X5 or X7, we need probably need to - 128KiB
// FIXME: if the cart is not V3 or X5 or X7, we need probably need to - 128KiB for save compatibility.
// Or somehow warn that certain ROM's will have corruption due to the address space being used for saves.
if (rom_size > MiB(64)) {
f_close(&fil);
return FLASHCART_ERR_LOAD;
Expand Down Expand Up @@ -97,8 +98,9 @@ static flashcart_err_t ed64_load_file (char *file_path, uint32_t rom_offset, uin

size_t file_size = f_size(&fil) - file_offset;

// FIXME: if the cart is not V3 or X5 or X7, we need to - 128KiB
if (file_size > (MiB(64) - KiB(128) - rom_offset)) {
// FIXME: if the cart is not V3 or X5 or X7, we need probably need to - 128KiB for save compatibility.
// Or somehow warn that certain ROM's will have corruption due to the address space being used for saves.
if (file_size > (MiB(64) - rom_offset)) {
f_close(&fil);
return FLASHCART_ERR_ARGS;
}
Expand Down

0 comments on commit 13756a9

Please sign in to comment.