2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::step(unsigned clocks) -> void {
|
2010-08-09 13:28:56 +00:00
|
|
|
if(regs.romcl) {
|
|
|
|
regs.romcl -= min(clocks, regs.romcl);
|
|
|
|
if(regs.romcl == 0) {
|
|
|
|
regs.sfr.r = 0;
|
2011-01-16 13:17:45 +00:00
|
|
|
regs.romdr = bus_read((regs.rombr << 16) + regs.r[14]);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(regs.ramcl) {
|
|
|
|
regs.ramcl -= min(clocks, regs.ramcl);
|
|
|
|
if(regs.ramcl == 0) {
|
2011-01-16 13:17:45 +00:00
|
|
|
bus_write(0x700000 + (regs.rambr << 16) + regs.ramar, regs.ramdr);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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);
|
2015-12-14 09:41:06 +00:00
|
|
|
synchronizeCPU();
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::rombuffer_sync() -> void {
|
2012-04-29 06:16:44 +00:00
|
|
|
if(regs.romcl) step(regs.romcl);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::rombuffer_update() -> void {
|
2010-08-09 13:28:56 +00:00
|
|
|
regs.sfr.r = 1;
|
2015-06-28 08:44:56 +00:00
|
|
|
regs.romcl = regs.clsr ? 5 : 6;
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::rombuffer_read() -> uint8 {
|
2010-08-09 13:28:56 +00:00
|
|
|
rombuffer_sync();
|
|
|
|
return regs.romdr;
|
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::rambuffer_sync() -> void {
|
2012-04-29 06:16:44 +00:00
|
|
|
if(regs.ramcl) step(regs.ramcl);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::rambuffer_read(uint16 addr) -> uint8 {
|
2010-08-09 13:28:56 +00:00
|
|
|
rambuffer_sync();
|
2011-01-16 13:17:45 +00:00
|
|
|
return bus_read(0x700000 + (regs.rambr << 16) + addr);
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::rambuffer_write(uint16 addr, uint8 data) -> void {
|
2010-08-09 13:28:56 +00:00
|
|
|
rambuffer_sync();
|
2015-06-28 08:44:56 +00:00
|
|
|
regs.ramcl = regs.clsr ? 5 : 6;
|
2010-08-09 13:28:56 +00:00
|
|
|
regs.ramar = addr;
|
|
|
|
regs.ramdr = data;
|
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::r14_modify(uint16 data) -> void {
|
2010-08-09 13:28:56 +00:00
|
|
|
regs.r[14].data = data;
|
|
|
|
rombuffer_update();
|
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::r15_modify(uint16 data) -> void {
|
2010-08-09 13:28:56 +00:00
|
|
|
regs.r[15].data = data;
|
|
|
|
r15_modified = true;
|
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::timing_reset() -> void {
|
2010-08-09 13:28:56 +00:00
|
|
|
r15_modified = false;
|
|
|
|
|
|
|
|
regs.romcl = 0;
|
|
|
|
regs.romdr = 0;
|
|
|
|
|
|
|
|
regs.ramcl = 0;
|
|
|
|
regs.ramar = 0;
|
|
|
|
regs.ramdr = 0;
|
|
|
|
}
|