2010-08-09 13:28:56 +00:00
|
|
|
#ifdef SMP_CPP
|
|
|
|
|
|
|
|
void SMP::add_clocks(unsigned clocks) {
|
|
|
|
step(clocks);
|
|
|
|
synchronize_dsp();
|
|
|
|
|
Update to v085r09 release.
byuu says:
Added VRAM viewer (mouse over to get tile# and VRAM address), CPU+SMP
register editors, settings.cfg to cache path+sync audio+mute audio
settings (Windows Vista+ ignore my request for the default folder
because they are fucking stupid, so they always default to your home
folder. I'm going to have to recommend using a batch file to start
laevateinn there. Sorry, blame Microsoft for being fuck-ups),
geometry.cfg to remember where you placed windows and what size you made
them (a bug in Qt prevents me from making some windows fixed-size for
now, but that'll change when I can work around the Qt issue), usage map
invalidation if the ROM was modified after the usage files, that empty
line insertion thing creaothceann wanted on emulation resume, all chips
now synchronize immediately rather than just-in-time, which is important
for a debugger.
Going to postpone the properties viewer until after v086.
So this is pretty much ready for release. Please bug-test. I don't care
so much about little frills like "oh the memory editor window should
default to a little bigger", you can work around that by resizing it.
I care about things like, "VRAM write breakpoints don't work at all."
If we miss any bugs and it gets released, not the end of the world, but
you'll be waiting a while for the next release to address any missed
bugs now.
2012-02-12 09:58:04 +00:00
|
|
|
#if defined(DEBUGGER)
|
|
|
|
synchronize_cpu();
|
|
|
|
#else
|
2010-08-09 13:28:56 +00:00
|
|
|
//forcefully sync S-SMP to S-CPU in case chips are not communicating
|
|
|
|
//sync if S-SMP is more than 24 samples ahead of S-CPU
|
|
|
|
if(clock > +(768 * 24 * (int64)24000000)) synchronize_cpu();
|
Update to v085r09 release.
byuu says:
Added VRAM viewer (mouse over to get tile# and VRAM address), CPU+SMP
register editors, settings.cfg to cache path+sync audio+mute audio
settings (Windows Vista+ ignore my request for the default folder
because they are fucking stupid, so they always default to your home
folder. I'm going to have to recommend using a batch file to start
laevateinn there. Sorry, blame Microsoft for being fuck-ups),
geometry.cfg to remember where you placed windows and what size you made
them (a bug in Qt prevents me from making some windows fixed-size for
now, but that'll change when I can work around the Qt issue), usage map
invalidation if the ROM was modified after the usage files, that empty
line insertion thing creaothceann wanted on emulation resume, all chips
now synchronize immediately rather than just-in-time, which is important
for a debugger.
Going to postpone the properties viewer until after v086.
So this is pretty much ready for release. Please bug-test. I don't care
so much about little frills like "oh the memory editor window should
default to a little bigger", you can work around that by resizing it.
I care about things like, "VRAM write breakpoints don't work at all."
If we miss any bugs and it gets released, not the end of the world, but
you'll be waiting a while for the next release to address any missed
bugs now.
2012-02-12 09:58:04 +00:00
|
|
|
#endif
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SMP::cycle_edge() {
|
2011-05-05 11:37:46 +00:00
|
|
|
timer0.tick();
|
|
|
|
timer1.tick();
|
|
|
|
timer2.tick();
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
//TEST register S-SMP speed control
|
|
|
|
//24 clocks have already been added for this cycle at this point
|
|
|
|
switch(status.clock_speed) {
|
2013-05-05 09:21:30 +00:00
|
|
|
case 0: break; //100% speed
|
|
|
|
case 1: add_clocks(24); break; // 50% speed
|
|
|
|
case 2: while(true) add_clocks(24); // 0% speed -- locks S-SMP
|
|
|
|
case 3: add_clocks(24 * 9); break; // 10% speed
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template<unsigned timer_frequency>
|
2011-05-05 11:40:22 +00:00
|
|
|
void SMP::Timer<timer_frequency>::tick() {
|
2010-08-09 13:28:56 +00:00
|
|
|
//stage 0 increment
|
|
|
|
stage0_ticks += smp.status.timer_step;
|
|
|
|
if(stage0_ticks < timer_frequency) return;
|
|
|
|
stage0_ticks -= timer_frequency;
|
|
|
|
|
|
|
|
//stage 1 increment
|
|
|
|
stage1_ticks ^= 1;
|
2011-05-05 11:40:22 +00:00
|
|
|
synchronize_stage1();
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2011-05-05 11:40:22 +00:00
|
|
|
template<unsigned timer_frequency>
|
|
|
|
void SMP::Timer<timer_frequency>::synchronize_stage1() {
|
2010-08-09 13:28:56 +00:00
|
|
|
bool new_line = stage1_ticks;
|
2011-05-02 13:53:16 +00:00
|
|
|
if(smp.status.timers_enable == false) new_line = false;
|
|
|
|
if(smp.status.timers_disable == true) new_line = false;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
bool old_line = current_line;
|
|
|
|
current_line = new_line;
|
|
|
|
if(old_line != 1 || new_line != 0) return; //only pulse on 1->0 transition
|
|
|
|
|
|
|
|
//stage 2 increment
|
2011-05-05 11:37:46 +00:00
|
|
|
if(enable == false) return;
|
2011-05-05 11:40:22 +00:00
|
|
|
if(++stage2_ticks != target) return;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
//stage 3 increment
|
|
|
|
stage2_ticks = 0;
|
|
|
|
stage3_ticks++;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|