Speed improvements to 1300MHz

This commit is contained in:
tudnai 2020-05-08 19:47:19 -07:00
parent c6a7f211dc
commit bfb226d415
3 changed files with 8 additions and 11 deletions

View File

@ -710,7 +710,7 @@ class ViewController: NSViewController {
@IBAction func speedSelected(_ sender: NSButton) {
if ( sender.title == "MAX" ) {
setCPUClockSpeed(freq: 1280)
setCPUClockSpeed(freq: 1600)
}
else if let freq = Double( sender.title ) {
setCPUClockSpeed(freq: freq)

View File

@ -711,21 +711,18 @@ void softReset() {
}
void m6502_Run() {
static unsigned int clk = 0;
// init time
//#ifdef CLK_WAIT
// unsigned long long elpased = (unsigned long long)-1LL;
//#endif
// we will also use this to pause the simulation if not finished by the end of the frame
clk_6502_per_frm_max = clk_6502_per_frm;
#ifdef SPEEDTEST
for ( inst_cnt = 0; inst_cnt < iterations ; inst_cnt++ )
#elif defined( CLK_WAIT )
// we clear the clkfrm from ViewController Update()
for ( ; clkfrm < clk_6502_per_frm_max ; clkfrm += clk )
// we will also use this to pause the simulation if not finished by the end of the frame
for ( clk_6502_per_frm_max = clk_6502_per_frm; clkfrm < clk_6502_per_frm_max ; clkfrm += m6502_Step() )
#else
// this is for max speed only -- WARNING! It works only if simulation runs in a completely different thread from the Update()
for ( ; ; )
@ -763,10 +760,10 @@ void m6502_Run() {
}
#endif // INTERRUPT_CHECK_PER_STEP
m6502.clktime += ( clk = m6502_Step() );
printDisassembly( outdev );
}
m6502.clktime += clk_6502_per_frm;
if( diskAccelerator_count ) {
if( --diskAccelerator_count <= 0 ) {
// make sure we only adjust clock once to get back to normal

View File

@ -251,11 +251,11 @@ uint8_t woz_read() {
#else // WOZ_REAL_SPIN
clkelpased = m6502.clktime - m6502.clklast;
m6502.clklast = m6502.clktime;
clkelpased = m6502.clktime + clkfrm - m6502.clklast;
m6502.clklast = m6502.clktime + clkfrm;
const int clkBeforeAdjusting = 250;
const int magicShiftOffset = 90;
const int magicShiftOffset = 80;
uint16_t usedBytes = woz_trks[track].bytes_used < WOZ_TRACK_BYTE_COUNT ? woz_trks[track].bytes_used : WOZ_TRACK_BYTE_COUNT;
if ( usedBytes ) {