2015-11-10 11:02:29 +00:00
|
|
|
auto SMP::addClocks(uint clocks) -> void {
|
2010-08-09 13:28:56 +00:00
|
|
|
step(clocks);
|
2015-11-10 11:02:29 +00:00
|
|
|
synchronizeDSP();
|
2010-08-09 13:28:56 +00:00
|
|
|
|
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)
|
2015-11-10 11:02:29 +00:00
|
|
|
synchronizeCPU();
|
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
|
|
|
#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
|
2015-11-10 11:02:29 +00:00
|
|
|
if(clock > +(768 * 24 * (int64)24000000)) synchronizeCPU();
|
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
|
|
|
}
|
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
auto SMP::cycleEdge() -> void {
|
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
|
2015-11-10 11:02:29 +00:00
|
|
|
switch(status.clockSpeed) {
|
|
|
|
case 0: break; //100% speed
|
|
|
|
case 1: addClocks(24); break; // 50% speed
|
|
|
|
case 2: while(true) addClocks(24); // 0% speed -- locks S-SMP
|
|
|
|
case 3: addClocks(24 * 9); break; // 10% speed
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
template<unsigned Frequency>
|
|
|
|
auto SMP::Timer<Frequency>::tick() -> void {
|
2010-08-09 13:28:56 +00:00
|
|
|
//stage 0 increment
|
2015-11-10 11:02:29 +00:00
|
|
|
stage0 += smp.status.timerStep;
|
|
|
|
if(stage0 < Frequency) return;
|
|
|
|
stage0 -= Frequency;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
//stage 1 increment
|
2015-11-10 11:02:29 +00:00
|
|
|
stage1 ^= 1;
|
|
|
|
synchronizeStage1();
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
template<unsigned Frequency>
|
|
|
|
auto SMP::Timer<Frequency>::synchronizeStage1() -> void {
|
|
|
|
bool newLine = stage1;
|
|
|
|
if(smp.status.timersEnable == false) newLine = false;
|
|
|
|
if(smp.status.timersDisable == true) newLine = false;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
bool oldLine = line;
|
|
|
|
line = newLine;
|
|
|
|
if(oldLine != 1 || newLine != 0) return; //only pulse on 1->0 transition
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
//stage 2 increment
|
2011-05-05 11:37:46 +00:00
|
|
|
if(enable == false) return;
|
2015-11-10 11:02:29 +00:00
|
|
|
if(++stage2 != target) return;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
//stage 3 increment
|
2015-11-10 11:02:29 +00:00
|
|
|
stage2 = 0;
|
|
|
|
stage3++;
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|