Reverted Kishin Douji Zenki fix, as it seems to have been incorrect.
Disabled supersampling when EXTBG mode is active.
Fixed MSU1 and SGB audio when using run-ahead and overclocking.
macOS: fixed a serious issue with the IOKit joypad driver [kode54]
This commit is contained in:
byuu 2019-10-27 13:13:59 +09:00
parent 4f32551430
commit f2978247c1
8 changed files with 17 additions and 9 deletions

View File

@ -29,7 +29,7 @@ using namespace nall;
namespace Emulator {
static const string Name = "bsnes";
static const string Version = "112.3";
static const string Version = "112.4";
static const string Author = "byuu";
static const string License = "GPLv3";
static const string Website = "https://byuu.org";

View File

@ -250,7 +250,7 @@ auto SPC700::instructionDirectDirectCompare(fpb op) -> void {
uint8 target = fetch();
uint8 lhs = load(target);
lhs = alu(lhs, rhs);
load(target);
idle();
}
auto SPC700::instructionDirectDirectModify(fpb op) -> void {
@ -274,7 +274,7 @@ auto SPC700::instructionDirectImmediateCompare(fpb op) -> void {
uint8 address = fetch();
uint8 data = load(address);
data = alu(data, immediate);
load(address);
idle();
}
auto SPC700::instructionDirectImmediateModify(fpb op) -> void {
@ -469,7 +469,7 @@ auto SPC700::instructionIndirectXCompareIndirectY(fpb op) -> void {
uint8 rhs = load(Y);
uint8 lhs = load(X);
lhs = alu(lhs, rhs);
load(X);
idle();
}
auto SPC700::instructionIndirectXWriteIndirectY(fpb op) -> void {

View File

@ -21,7 +21,7 @@ auto ICD::ppuWrite(uint2 color) -> void {
auto ICD::apuWrite(float left, float right) -> void {
float samples[] = {left, right};
stream->write(samples);
if(!system.runAhead) stream->write(samples);
}
auto ICD::joypWrite(bool p14, bool p15) -> void {

View File

@ -42,7 +42,7 @@ auto MSU1::main() -> void {
}
}
stream->sample(float(left), float(right));
if(!system.runAhead) stream->sample(float(left), float(right));
step(1);
synchronizeCPU();
}

View File

@ -20,6 +20,7 @@ auto CPU::step() -> void {
static_assert(Clocks == 2 || Clocks == 4 || Clocks == 6 || Clocks == 8 || Clocks == 10 || Clocks == 12);
for(auto coprocessor : coprocessors) {
if(coprocessor == &icd || coprocessor == &msu1) continue;
coprocessor->clock -= Clocks * (uint64)coprocessor->frequency;
}
@ -43,6 +44,10 @@ auto CPU::step() -> void {
smp.clock -= Clocks * (uint64)smp.frequency;
ppu.clock -= Clocks;
for(auto coprocessor : coprocessors) {
if(coprocessor != &icd && coprocessor != &msu1) continue;
coprocessor->clock -= Clocks * (uint64)coprocessor->frequency;
}
if(!status.dramRefresh && hcounter() >= status.dramRefreshPosition) {
//note: pattern should technically be 5-3, 5-3, 5-3, 5-3, 5-3 per logic analyzer

View File

@ -106,8 +106,9 @@ auto PPU::scanline() -> void {
if(vcounter() > 0 && vcounter() < vdisp()) {
latch.hires |= io.pseudoHires || io.bgMode == 5 || io.bgMode == 6;
latch.hd |= io.bgMode == 7 && hdScale() > 1 && hdSupersample() == 0;
latch.ss |= io.bgMode == 7 && hdScale() > 1 && hdSupersample() == 1;
//supersampling and EXTBG mode are not compatible, so disable supersampling in EXTBG mode
latch.hd |= io.bgMode == 7 && hdScale() > 1 && (hdSupersample() == 0 || io.extbg == 1);
latch.ss |= io.bgMode == 7 && hdScale() > 1 && (hdSupersample() == 1 && io.extbg == 0);
}
if(vcounter() == vdisp()) {

View File

@ -14,9 +14,9 @@ auto SMP::idle() -> void {
}
auto SMP::read(uint16 address) -> uint8 {
wait(address);
uint8 data = readRAM(address);
if((address & 0xfff0) == 0x00f0) data = readIO(address);
wait(address);
return data;
}

View File

@ -14,6 +14,7 @@ struct InputJoypadIOKit {
for(uint n : range(CFArrayGetCount(elements))) {
IOHIDElementRef element = (IOHIDElementRef)CFArrayGetValueAtIndex(elements, n);
IOHIDElementType type = IOHIDElementGetType(element);
uint32_t page = IOHIDElementGetUsagePage(element);
uint32_t usage = IOHIDElementGetUsage(element);
switch(type) {
case kIOHIDElementTypeInput_Button:
@ -21,6 +22,7 @@ struct InputJoypadIOKit {
break;
case kIOHIDElementTypeInput_Axis:
case kIOHIDElementTypeInput_Misc:
if(page != kHIDPage_GenericDesktop && page != kHIDPage_Simulation) break;
if(usage == kHIDUsage_Sim_Accelerator || usage == kHIDUsage_Sim_Brake
|| usage == kHIDUsage_Sim_Rudder || usage == kHIDUsage_Sim_Throttle
|| usage == kHIDUsage_GD_X || usage == kHIDUsage_GD_Y || usage == kHIDUsage_GD_Z