Skip to content

Commit

Permalink
Fixed the initialization of save slots and rewind when the disk is ch…
Browse files Browse the repository at this point in the history
…anged.

I also disabled the 0xF46E routine skipping.
  • Loading branch information
punesemu committed Jan 3, 2024
1 parent 111941e commit 6358116
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/core/fds.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "patcher.h"
#include "conf.h"
#include "emu.h"
#include "rewind.h"
#include "save_slot.h"
#include "../../c++/crc/crc.h"

#define BIOSFILE "disksys.rom"
Expand Down Expand Up @@ -467,6 +469,12 @@ BYTE fds_change_disk(uTCHAR *file) {
memcpy(&fds.info, &finfo, sizeof(_fds_info));
fds_info();

if (rewind_init()) {
return (EXIT_ERROR);
}

save_slot_count_load();

fds.side.change.new_side = 0;
fds.side.change.delay = fds.info.cycles_dummy_delay;
fds_disk_op(FDS_DISK_EJECT, 0, FALSE);
Expand Down
14 changes: 7 additions & 7 deletions src/core/mappers/mapper_FDS.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ BYTE extcl_cpu_rd_mem_FDS(BYTE nidx, WORD address, UNUSED(BYTE openbus)) {
address = nes[nidx].c.cpu.PC.w - 1;
}
break;
case 0xF46E:
// License check
if (cfg->fds_fast_forward) {
nes[nidx].c.cpu.PC.w += 2;
address = nes[nidx].c.cpu.PC.w - 1;
}
break;
// case 0xF46E:
// // License check
// if (cfg->fds_fast_forward) {
// nes[nidx].c.cpu.PC.w += 2;
// address = nes[nidx].c.cpu.PC.w - 1;
// }
// break;
}
return (prgrom_rd(nidx, address));
}
Expand Down

0 comments on commit 6358116

Please sign in to comment.