Skip to content

Commit

Permalink
Fixed bug where combo saveram slot was written for non-base FPGA file…
Browse files Browse the repository at this point in the history
…s. The bug could cause problems with special chip games - known cases only happen on mk3.
  • Loading branch information
RedGuyyyy committed Jun 30, 2019
1 parent 572a83e commit 9043321
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/config-mk2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CONFIG_VERSION="1.10.3-usb-v10"
#CONFIG_FWVER = 0x810A030A
CONFIG_FWVER=0x44534E53
CONFIG_VERSION="1.10.3-usb-v11"
CONFIG_FWVER = 0x810A030B
#CONFIG_FWVER=0x44534E53
#CONFIG_FWVER=0x010A0300
CONFIG_MCU_FOSC = 12000000

Expand Down
6 changes: 3 additions & 3 deletions src/config-mk3
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CONFIG_VERSION="1.10.3-usb-v10"
#CONFIG_FWVER = 0x810A030A
CONFIG_FWVER=0x33534E53
CONFIG_VERSION="1.10.3-usb-v11"
CONFIG_FWVER = 0x810A030B
#CONFIG_FWVER=0x33534E53
#CONFIG_FWVER=0x010A0300
CONFIG_MCU_FOSC = 8000000

Expand Down
7 changes: 4 additions & 3 deletions src/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ uint32_t load_rom(uint8_t* filename, uint32_t base_addr, uint8_t flags) {
}
total_bytes_read += bytes_read;
// FIXME: can we do this in the general (non-combo) case?
// FIXME: what does the condition below do that doubles romsize_bytes until it hits the file limit do? Do some games
// FIXME: what does the condition below do that doubles romsize_bytes until it hits the file limit? Do some games
// misreport size? Or is this for BSX?
if((flags & LOADROM_WITH_COMBO) && total_bytes_read >= romprops.romsize_bytes) break;
if((flags & LOADROM_WITH_COMBO) && (total_bytes_read >= romprops.romsize_bytes)) break;
}
uart_putc('\n');
file_close();
Expand Down Expand Up @@ -402,7 +402,8 @@ uint32_t load_rom(uint8_t* filename, uint32_t base_addr, uint8_t flags) {

printf("ramsize=%x ramslot=%hx rammask=%lx\nromsize=%x rommask=%lx\n", romprops.header.ramsize, ramslot, rammask, romprops.header.romsize, rommask);
set_saveram_mask(rammask);
set_saveram_base(ramslot);
// don't set these for special chips as it may break from not supporting the feature
if (!romprops.fpga_conf || romprops.fpga_conf == FPGA_BASE) set_saveram_base(ramslot);
set_rom_mask(rommask);
readled(0);

Expand Down
1 change: 0 additions & 1 deletion src/snes.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ void snes_bootprint(void* msg) {
fpga_rompgm();
sram_writebyte(0, SRAM_CMD_ADDR);
load_bootrle(SRAM_MENU_ADDR);
set_saveram_base(0x0);
set_saveram_mask(0x1fff);
set_rom_mask(0x3fffff);
set_mapper(0x7);
Expand Down

0 comments on commit 9043321

Please sign in to comment.