From 2c53d5fbc04d7a836608df7189d9384b03bb05bc Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Tue, 15 Dec 2015 20:30:26 +1100 Subject: [PATCH] Update to v095r12 release. byuu says: Got it. They broke in r05. Changelog: - fixed typo in sfc/cpu/timing.cpp that was breaking coprocessor games with clocks - updated sfc/coprocessor/hitachidsp to not access Bus directly --- emulator/emulator.hpp | 2 +- nall/windows/utf8.hpp | 2 ++ sfc/coprocessor/hitachidsp/hitachidsp.cpp | 3 +-- sfc/coprocessor/hitachidsp/memory.cpp | 30 ++++++++++++++++++----- sfc/cpu/timing/timing.cpp | 8 +++--- 5 files changed, 32 insertions(+), 13 deletions(-) diff --git a/emulator/emulator.hpp b/emulator/emulator.hpp index 3b956fbf..64c44562 100644 --- a/emulator/emulator.hpp +++ b/emulator/emulator.hpp @@ -7,7 +7,7 @@ using namespace nall; namespace Emulator { static const string Name = "higan"; - static const string Version = "095.11"; + static const string Version = "095.12"; static const string Author = "byuu"; static const string License = "GPLv3"; static const string Website = "http://byuu.org/"; diff --git a/nall/windows/utf8.hpp b/nall/windows/utf8.hpp index 40a2df4b..7416d861 100644 --- a/nall/windows/utf8.hpp +++ b/nall/windows/utf8.hpp @@ -18,6 +18,8 @@ #define PATH_MAX 260 #endif +using uint = unsigned; + namespace nall { //UTF-8 to UTF-16 struct utf16_t { diff --git a/sfc/coprocessor/hitachidsp/hitachidsp.cpp b/sfc/coprocessor/hitachidsp/hitachidsp.cpp index be36578a..0170e5d3 100644 --- a/sfc/coprocessor/hitachidsp/hitachidsp.cpp +++ b/sfc/coprocessor/hitachidsp/hitachidsp.cpp @@ -16,8 +16,7 @@ auto HitachiDSP::enter() -> void { if(mmio.dma) { for(auto n : range(mmio.dma_length)) { - //todo: access internally, not from Bus - bus.write(mmio.dma_target + n, bus.read(mmio.dma_source + n, 0)); + bus_write(mmio.dma_target + n, bus_read(mmio.dma_source + n)); step(2); } mmio.dma = false; diff --git a/sfc/coprocessor/hitachidsp/memory.cpp b/sfc/coprocessor/hitachidsp/memory.cpp index 018c7d54..d987d416 100644 --- a/sfc/coprocessor/hitachidsp/memory.cpp +++ b/sfc/coprocessor/hitachidsp/memory.cpp @@ -1,14 +1,32 @@ auto HitachiDSP::bus_read(uint24 addr) -> uint8 { - //todo: read internally, not from Bus - if((addr & 0x408000) == 0x008000) return bus.read(addr, 0); //$00-3f,80-bf:6000-7fff - if((addr & 0xf88000) == 0x700000) return bus.read(addr, 0); //$70-77:0000-7fff + if((addr & 0x40e000) == 0x006000) { //$00-3f,80-bf:6000-7fff + return dsp_read(addr, 0x00); + } + if((addr & 0x408000) == 0x008000) { //$00-3f,80-bf:8000-ffff + if(rom.size() == 0) return 0x00; + addr = ((addr & 0x3f0000) >> 1) | (addr & 0x7fff); + addr = bus.mirror(addr, rom.size()); + return rom.read(addr, 0); + } + if((addr & 0xf88000) == 0x700000) { //$70-77:0000-7fff + if(ram.size() == 0) return 0x00; + addr = ((addr & 0x070000) >> 1) | (addr & 0x7fff); + addr = Bus::mirror(addr, ram.size()); + return ram.read(addr); + } return 0x00; } auto HitachiDSP::bus_write(uint24 addr, uint8 data) -> void { - //todo: write internally, not to Bus - if((addr & 0x40e000) == 0x006000) return bus.write(addr, data); //$00-3f,80-bf:6000-7fff - if((addr & 0xf88000) == 0x700000) return bus.write(addr, data); //$70-77:0000-7fff + if((addr & 0x40e000) == 0x006000) { //$00-3f,80-bf:6000-7fff + return dsp_write(addr & 0x1fff, data); + } + if((addr & 0xf88000) == 0x700000) { //$70-77:0000-7fff + if(ram.size() == 0) return; + addr = ((addr & 0x070000) >> 1) | (addr & 0x7fff); + addr = Bus::mirror(addr, ram.size()); + return ram.write(addr, data); + } } auto HitachiDSP::rom_read(uint addr, uint8 data) -> uint8 { diff --git a/sfc/cpu/timing/timing.cpp b/sfc/cpu/timing/timing.cpp index 93f7e0ac..1706e766 100644 --- a/sfc/cpu/timing/timing.cpp +++ b/sfc/cpu/timing/timing.cpp @@ -27,9 +27,9 @@ auto CPU::add_clocks(uint clocks) -> void { } #if defined(DEBUGGER) - synchronize_smp(); - synchronize_ppu(); - synchronize_coprocessors(); + synchronizeSMP(); + synchronizePPU(); + synchronizeCoprocessors(); #endif } @@ -41,7 +41,7 @@ auto CPU::scanline() -> void { //forcefully sync S-CPU to other processors, in case chips are not communicating synchronizeSMP(); synchronizePPU(); - synchronizeDevices(); + synchronizeCoprocessors(); system.scanline(); if(vcounter() == 0) {