diff --git a/BizHawk.MultiClient/output/libsneshawk.dll b/BizHawk.MultiClient/output/libsneshawk.dll index 55f4bff4a7..7210d782f8 100644 Binary files a/BizHawk.MultiClient/output/libsneshawk.dll and b/BizHawk.MultiClient/output/libsneshawk.dll differ diff --git a/libsnes/bsnes/snes/cpu/mmio/mmio.cpp b/libsnes/bsnes/snes/cpu/mmio/mmio.cpp index f6b4c06b23..708379629e 100644 --- a/libsnes/bsnes/snes/cpu/mmio/mmio.cpp +++ b/libsnes/bsnes/snes/cpu/mmio/mmio.cpp @@ -43,7 +43,7 @@ void CPU::mmio_w4016(uint8 data) { uint8 CPU::mmio_r4016() { uint8 r = regs.mdr & 0xfc; r |= input.port1->data(); - if (!status.auto_joypad_poll) interface->inputNotify(0); + if (!status.auto_joypad_poll) interface->inputNotify(0x4016); return r; } @@ -54,7 +54,7 @@ uint8 CPU::mmio_r4016() { uint8 CPU::mmio_r4017() { uint8 r = (regs.mdr & 0xe0) | 0x1c; r |= input.port2->data(); - if (!status.auto_joypad_poll) interface->inputNotify(1); + if (!status.auto_joypad_poll) interface->inputNotify(0x4017); return r; } @@ -183,6 +183,7 @@ uint8 CPU::mmio_r4212() { //RDIO uint8 CPU::mmio_r4213() { + // interface->inputNotify(0x4213); // if there are lag counter issues with super scope, uncomment this return status.pio; } @@ -206,14 +207,14 @@ uint8 CPU::mmio_r4217() { return status.rdmpy >> 8; } -uint8 CPU::mmio_r4218() { interface->inputNotify(8); return status.joy1 >> 0; } //JOY1L -uint8 CPU::mmio_r4219() { interface->inputNotify(9); return status.joy1 >> 8; } //JOY1H -uint8 CPU::mmio_r421a() { interface->inputNotify(10); return status.joy2 >> 0; } //JOY2L -uint8 CPU::mmio_r421b() { interface->inputNotify(11); return status.joy2 >> 8; } //JOY2H -uint8 CPU::mmio_r421c() { interface->inputNotify(12); return status.joy3 >> 0; } //JOY3L -uint8 CPU::mmio_r421d() { interface->inputNotify(13); return status.joy3 >> 8; } //JOY3H -uint8 CPU::mmio_r421e() { interface->inputNotify(14); return status.joy4 >> 0; } //JOY4L -uint8 CPU::mmio_r421f() { interface->inputNotify(15); return status.joy4 >> 8; } //JOY4H +uint8 CPU::mmio_r4218() { interface->inputNotify(0x4218); return status.joy1 >> 0; } //JOY1L +uint8 CPU::mmio_r4219() { interface->inputNotify(0x4219); return status.joy1 >> 8; } //JOY1H +uint8 CPU::mmio_r421a() { interface->inputNotify(0x421a); return status.joy2 >> 0; } //JOY2L +uint8 CPU::mmio_r421b() { interface->inputNotify(0x421b); return status.joy2 >> 8; } //JOY2H +uint8 CPU::mmio_r421c() { interface->inputNotify(0x421c); return status.joy3 >> 0; } //JOY3L +uint8 CPU::mmio_r421d() { interface->inputNotify(0x421d); return status.joy3 >> 8; } //JOY3H +uint8 CPU::mmio_r421e() { interface->inputNotify(0x421e); return status.joy4 >> 0; } //JOY4L +uint8 CPU::mmio_r421f() { interface->inputNotify(0x421f); return status.joy4 >> 8; } //JOY4H //DMAPx uint8 CPU::mmio_r43x0(uint8 i) { @@ -406,7 +407,7 @@ void CPU::mmio_reset() { uint8 CPU::mmio_read(unsigned addr) { addr &= 0xffff; - + //APU if((addr & 0xffc0) == 0x2140) { //$2140-$217f synchronize_smp(); diff --git a/libsnes/bsnes/snes/system/system.cpp b/libsnes/bsnes/snes/system/system.cpp index 1f863a4a7d..2141748dd4 100644 --- a/libsnes/bsnes/snes/system/system.cpp +++ b/libsnes/bsnes/snes/system/system.cpp @@ -235,7 +235,19 @@ void System::reset() { void System::scanline() { video.scanline(); - if(cpu.vcounter() == 241) scheduler.exit(Scheduler::ExitReason::FrameEvent); + /* + * the idea is to have the frame boundary (for framestep tasing) come as soon as possible + * after the end of a visible frame, so it comes before the input poll. + * the old number was constant 241, which is at a very odd time for NTSC. + * the new numbers are the minimum possible to still capture a full frame; any lower, + * and the last scanline(s) of the frame are still from the old frame. + */ + int stopline; + if (ppu.overscan()) // (region != Region::NTSC) + stopline = 240; + else + stopline = 225; + if(cpu.vcounter() == stopline) scheduler.exit(Scheduler::ExitReason::FrameEvent); } void System::frame() {