bsnes/higan/sfc/coprocessor/superfx/timing.cpp

50 lines
1.0 KiB
C++
Raw Normal View History

auto SuperFX::step(uint clocks) -> void {
if(regs.romcl) {
regs.romcl -= min(clocks, regs.romcl);
if(regs.romcl == 0) {
regs.sfr.r = 0;
regs.romdr = read((regs.rombr << 16) + regs.r[14]);
}
}
if(regs.ramcl) {
regs.ramcl -= min(clocks, regs.ramcl);
if(regs.ramcl == 0) {
write(0x700000 + (regs.rambr << 16) + regs.ramar, regs.ramdr);
}
}
Update to v098r01 release. byuu says: Changelog: - SFC: balanced profile removed - SFC: performance profile removed - SFC: code for handling non-threaded CPU, SMP, DSP, PPU removed - SFC: Coprocessor, Controller (and expansion port) shared Thread code merged to SFC::Cothread - Cothread here just means "Thread with CPU affinity" (couldn't think of a better name, sorry) - SFC: CPU now has vector<Thread*> coprocessors, peripherals; - this is the beginning of work to allow expansion port devices to be dynamically changed at run-time - ruby: all audio drivers default to 48000hz instead of 22050hz now if no frequency is assigned - note: the WASAPI driver can default to whatever the native frequency is; doesn't have to be 48000hz - tomoko: removed the ability to change the frequency from the UI (but it will display the frequency used) - tomoko: removed the timing settings panel - the goal is to work toward smooth video via adaptive sync - the model is broken by not being in control of the audio frequency anyway - it's further broken by PAL running at 50hz and WSC running at 75hz - it was always broken anyway by SNES interlace timing varying from progressive timing - higan: audio/ stub created (for now, it's just nall/dsp/ moved here and included as a header) - higan: video/ stub created - higan/GNUmakefile: now includes build rules for essential components (libco, emulator, audio, video) The audio changes are in preparation to merge wareya's awesome WASAPI work without the need for the nall/dsp resampler.
2016-04-09 03:40:12 +00:00
Cothread::step(clocks);
synchronizeCPU();
}
auto SuperFX::syncROMBuffer() -> void {
if(regs.romcl) step(regs.romcl);
}
auto SuperFX::readROMBuffer() -> uint8 {
syncROMBuffer();
return regs.romdr;
}
auto SuperFX::updateROMBuffer() -> void {
regs.sfr.r = 1;
regs.romcl = regs.clsr ? 5 : 6;
}
auto SuperFX::syncRAMBuffer() -> void {
if(regs.ramcl) step(regs.ramcl);
}
auto SuperFX::readRAMBuffer(uint16 addr) -> uint8 {
syncRAMBuffer();
return read(0x700000 + (regs.rambr << 16) + addr);
}
auto SuperFX::writeRAMBuffer(uint16 addr, uint8 data) -> void {
syncRAMBuffer();
regs.ramcl = regs.clsr ? 5 : 6;
regs.ramar = addr;
regs.ramdr = data;
}