mirror of
https://github.com/trudnai/Steve2.git
synced 2024-06-12 18:45:22 +00:00
More preciser CPU clock calculation
This commit is contained in:
parent
f3b8cbda3e
commit
8f6ada5b5a
|
@ -45,7 +45,7 @@
|
|||
contextName = "spkr_toggle:speaker.c">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "( (spkr_clk + m6502.clkfrm) / ( 1024000 / spkr_sample_rate ) ) * 2">
|
||||
value = "spkr_samples[spkr_sample_last_idx]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(int16_t)28000 + (int16_t)-32768">
|
||||
|
@ -53,6 +53,9 @@
|
|||
<PersistentString
|
||||
value = "(spkr_clk + m6502.clkfrm)">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "( (spkr_clk + m6502.clkfrm) / ( 1024000 / spkr_sample_rate ) ) * 2">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "default_MHz_6502 * 1000 * 1000 / spkr_sample_rate">
|
||||
</PersistentString>
|
||||
|
@ -62,9 +65,6 @@
|
|||
<PersistentString
|
||||
value = "( (spkr_clk + m6502.clkfrm) / ( default_MHz_6502 * 1000 * 1000 / spkr_sample_rate)) * 2">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "spkr_samples[spkr_sample_last_idx]">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
|
@ -152,7 +152,7 @@
|
|||
contextName = "closure #1 in ViewController.Update():ViewController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "txtArr">
|
||||
value = "MEMcfg.txt_page_2">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "self.shadowTxt">
|
||||
|
@ -164,7 +164,7 @@
|
|||
value = "MEMcfg.is_80STORE">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "MEMcfg.txt_page_2">
|
||||
value = "txtArr">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -270,7 +270,7 @@
|
|||
contextName = "LoRes.Update():LoRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "blockChanged[ screenIdx ]">
|
||||
value = "UInt8( (block >> 4) & 0x0F )">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "UInt8(block)">
|
||||
|
@ -279,7 +279,7 @@
|
|||
value = "UInt8(block & 4)">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "UInt8( (block >> 4) & 0x0F )">
|
||||
value = "blockChanged[ screenIdx ]">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -349,6 +349,17 @@
|
|||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "spkr_downsample:speaker.c">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "spkr_stream_rate * 2 / 60 * 1 *sizeof(spkr_sample_t)">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "spkr_stream_rate">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "closure #1 in AppDelegate.saveFile(_:):AppDelegate.swift">
|
||||
<PersistentStrings>
|
||||
|
@ -443,6 +454,14 @@
|
|||
<ContextState
|
||||
contextName = "softReset:6502.c">
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "ViewController.Pause(_:):ViewController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "upd">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "m6502_step:6502.c">
|
||||
<PersistentStrings>
|
||||
|
@ -460,14 +479,6 @@
|
|||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "ViewController.Pause(_:):ViewController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "upd">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "spkr_playUpd:speaker.c">
|
||||
</ContextState>
|
||||
|
@ -536,13 +547,13 @@
|
|||
contextName = "HiRes.compute():HiRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "computePipelineState.maxTotalThreadsPerThreadgroup">
|
||||
value = "UnsafeRawBufferPointer(result)">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "result[2]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "UnsafeRawBufferPointer(result)">
|
||||
value = "computePipelineState.maxTotalThreadsPerThreadgroup">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -601,7 +612,7 @@
|
|||
value = "new">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZwrite.shift16">
|
||||
value = "WOZtmp.shift16">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZwrite.shift">
|
||||
|
@ -613,7 +624,7 @@
|
|||
value = "(1 << i) - 1">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZtmp.shift16">
|
||||
value = "WOZwrite.shift16">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -762,10 +773,10 @@
|
|||
contextName = "set_flags_NZC:common.h">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "(unsigned)test ">
|
||||
value = "(unsigned)0xFF">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(unsigned)0xFF">
|
||||
value = "(unsigned)test ">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -773,14 +784,17 @@
|
|||
contextName = "HiRes.draw(_:):HiRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "linAddr">
|
||||
value = "HiRes.blockCols">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.height">
|
||||
value = "ctx?.data">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.width">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.bitmapInfo">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.bytesPerRow">
|
||||
</PersistentString>
|
||||
|
@ -790,24 +804,21 @@
|
|||
<PersistentString
|
||||
value = "HiResLineAddrTbl">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.bitmapInfo">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "shadowScreen">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(blockH7 | ( block & bitMask ))">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.height">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "linAddr">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.bitsPerComponent">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "HiRes.blockCols">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.data">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
|
@ -831,7 +842,7 @@
|
|||
value = "textDisplay_height_diff">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textDisplay.frame">
|
||||
value = "frame.size">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textDisplay.bounds">
|
||||
|
@ -843,7 +854,7 @@
|
|||
value = "textDisplay_width_diff">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "frame.size">
|
||||
value = "textDisplay.frame">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -854,16 +865,16 @@
|
|||
value = "m6502">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(void*)Apple2_64K_RAM">
|
||||
value = "Apple2_64K_RAM + 0x3600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "Apple2_64K_AUX + 0x3600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.PC">
|
||||
value = "(void*)Apple2_64K_RAM">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "Apple2_64K_RAM + 0x3600">
|
||||
value = "m6502.PC">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -977,7 +988,7 @@
|
|||
value = "pdl_value[pdl]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "normalized_time >= pdl_value[pdl] ? 255 : 0">
|
||||
value = "normalized_time">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(3300 * 255/3300)">
|
||||
|
@ -989,7 +1000,7 @@
|
|||
value = "1 * 512 * (1 - ( 3300 / 3300.0 ))">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "normalized_time">
|
||||
value = "normalized_time >= pdl_value[pdl] ? 255 : 0">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -1060,10 +1071,10 @@
|
|||
value = "Apple2_64K_AUX + 0xC600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(void*)rom">
|
||||
value = "Apple2_64K_RAM + 0xC600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "Apple2_64K_RAM + 0xC600">
|
||||
value = "(void*)rom">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "strlen(fullPath)">
|
||||
|
|
|
@ -1413,7 +1413,7 @@
|
|||
<popUpButton key="view" id="Ktw-L6-kEz">
|
||||
<rect key="frame" x="0.0" y="14" width="43" height="30"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="A4p-LJ-svz">
|
||||
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="Joystick" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="A4p-LJ-svz">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" id="q8R-kX-3jc">
|
||||
|
@ -1439,7 +1439,7 @@
|
|||
<popUpButton key="view" id="rfS-6q-EKe">
|
||||
<rect key="frame" x="0.0" y="14" width="43" height="30"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="8bV-Aa-zHf">
|
||||
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:8bV-Aa-zHf:image" imagePosition="only" alignment="right" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" id="8bV-Aa-zHf">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" id="7Vp-Rc-UbT">
|
||||
|
@ -1853,7 +1853,7 @@
|
|||
<subviews>
|
||||
<popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="49f-8R-QCc">
|
||||
<rect key="frame" x="0.0" y="83" width="120" height="103"/>
|
||||
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" id="CNs-lh-urM">
|
||||
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:8bV-Aa-zHf:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" id="CNs-lh-urM">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" id="N33-K0-nba">
|
||||
|
@ -1887,7 +1887,7 @@
|
|||
</popUpButton>
|
||||
<popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="QDr-Cp-9QQ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="120" height="103"/>
|
||||
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:A4p-LJ-svz:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" selectedItem="28N-X8-n7Q" id="8FA-1D-k8p">
|
||||
<popUpButtonCell key="cell" type="bevel" bezelStyle="regularSquare" image="popUpButtonCell:8bV-Aa-zHf:image" imagePosition="only" alignment="left" lineBreakMode="truncatingTail" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" inset="2" pullsDown="YES" arrowPosition="noArrow" altersStateOfSelectedItem="NO" selectedItem="28N-X8-n7Q" id="8FA-1D-k8p">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" id="8He-mk-LVI">
|
||||
|
@ -138916,7 +138916,7 @@ BQB9EQcAfREJAH0RCwB9ERQAfREZAH0RHwB9EScAfREpAH0RKwB9ES0AfREvAH0imwB9IqAAfSKtAH0i
|
|||
sAB9Ir0AfSLCAH0iygB9Is0AfSLSAH0i2gAAAAAAAAQBAAAAAAAAAFAAAAAAAAAAAAAAAAAAfSLdA
|
||||
</mutableData>
|
||||
</image>
|
||||
<image name="popUpButtonCell:A4p-LJ-svz:image" width="1" height="1">
|
||||
<image name="popUpButtonCell:8bV-Aa-zHf:image" width="1" height="1">
|
||||
<mutableData key="keyedArchiveRepresentation">
|
||||
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05T
|
||||
S2V5ZWRBcmNoaXZlctEICVRyb290gAGvEBcLDBkaIRQmKisyNTo9PkNGR0pUXF1hZFUkbnVsbNYNDg8Q
|
||||
|
|
|
@ -1023,7 +1023,7 @@ class ViewController: NSViewController {
|
|||
case cpuState_running:
|
||||
clkCounter += Double(m6502.clkfrm)
|
||||
// we start a new frame from here, so CPU is running even while rendering
|
||||
m6502.clkfrm = 0
|
||||
// m6502.clkfrm = 0
|
||||
|
||||
frameCounter += 1
|
||||
|
||||
|
@ -1354,7 +1354,7 @@ class ViewController: NSViewController {
|
|||
spkr_stopAll();
|
||||
|
||||
MHz_6502 = freq
|
||||
clk_6502_per_frm = UInt64( MHz_6502 * M / Double(fps) )
|
||||
clk_6502_per_frm = UInt32( MHz_6502 * M / Double(fps) )
|
||||
clk_6502_per_frm_set = clk_6502_per_frm
|
||||
|
||||
// TODO: Probably this is not the best way to deal with the problem: To make sound continous independent of FPS and Freq
|
||||
|
|
Loading…
Reference in New Issue
Block a user