mirror of https://github.com/trudnai/Steve2.git
BugFix: Possible Race Condition in Update()
This commit is contained in:
parent
a283668a8a
commit
e338d7fd89
|
@ -17,10 +17,10 @@
|
|||
contextName = "_fetch_dbg:mmio.c">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "disassembly.pOpcode">
|
||||
value = "memread8_low(m6502.PC)">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "memread8_low(m6502.PC)">
|
||||
value = "disassembly.pOpcode">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -59,7 +59,7 @@
|
|||
value = "default_MHz_6502 * 1000 * 1000 / spkr_sample_rate">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "( (spkr_clk + m6502.clkfrm) / ( default_MHz_6502 * 1000 * 1000 / spkr_sample_rate)) * 2">
|
||||
value = "( (spkr_clk + m6502.clkfrm) / ( 1024000 / spkr_sample_rate ) ) * 2">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(int16_t)28000 + (int16_t)-32768">
|
||||
|
@ -77,7 +77,7 @@
|
|||
value = "(spkr_clk + m6502.clkfrm)">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "( (spkr_clk + m6502.clkfrm) / ( 1024000 / spkr_sample_rate ) ) * 2">
|
||||
value = "( (spkr_clk + m6502.clkfrm) / ( default_MHz_6502 * 1000 * 1000 / spkr_sample_rate)) * 2">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -123,6 +123,14 @@
|
|||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "_src_zp_X_dbg:mmio.c">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "sizeof(disassembly.oper)">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "rel_addr:Apple2_mmio.h">
|
||||
</ContextState>
|
||||
|
@ -151,6 +159,14 @@
|
|||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "m6502_Disass_1_Instr:6502_C.h">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "disassembly">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "AppDelegate.Disk1_Selected(_:):AppDelegate.swift">
|
||||
<PersistentStrings>
|
||||
|
@ -177,7 +193,7 @@
|
|||
contextName = "closure #1 in ViewController.Update():ViewController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "MEMcfg.is_80STORE">
|
||||
value = "txtArr">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "self.shadowTxt">
|
||||
|
@ -186,10 +202,18 @@
|
|||
value = "txt">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "MEMcfg.txt_page_2">
|
||||
value = "MEMcfg.is_80STORE">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "txtArr">
|
||||
value = "MEMcfg.txt_page_2">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "_fetch16_dbg:mmio.c">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "disassembly.pOpcode">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -240,7 +264,7 @@
|
|||
value = "m6502.PC">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.debugger.on">
|
||||
value = "m6502.clkfrm">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textLines * (textCols+1) + textCols">
|
||||
|
@ -249,7 +273,7 @@
|
|||
value = "frameCounter">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.clkfrm">
|
||||
value = "m6502.debugger.on">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "spkr_play_disk_motor_time">
|
||||
|
@ -318,7 +342,7 @@
|
|||
contextName = "LoRes.Update():LoRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "UInt8( (block >> 4) & 0x0F )">
|
||||
value = "blockChanged[ screenIdx ]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "UInt8(block)">
|
||||
|
@ -327,7 +351,7 @@
|
|||
value = "UInt8(block & 4)">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "blockChanged[ screenIdx ]">
|
||||
value = "UInt8( (block >> 4) & 0x0F )">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -436,16 +460,19 @@
|
|||
contextName = "m6502_Debug:6502.c">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "m6502.debugger.SP">
|
||||
value = "m6502.SP">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.debugger.mask.ret">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.SP">
|
||||
value = "m6502.debugger.SP">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "_addr_zp_X_dbg:mmio.c">
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "BRA:6502_instr_branch.h">
|
||||
<PersistentStrings>
|
||||
|
@ -557,6 +584,14 @@
|
|||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "m6502_Disass_1_Instr:6502_std.h">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "disassembly">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "spkr_playUpd:speaker.c">
|
||||
</ContextState>
|
||||
|
@ -594,10 +629,10 @@
|
|||
contextName = "ToolBarController.GamePort(_:):ToolBarController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "ViewController.current?.mouseCursorHidden">
|
||||
value = "ViewController.current?.mouseCursorJoystickEmulation">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ViewController.current?.mouseCursorJoystickEmulation">
|
||||
value = "ViewController.current?.mouseCursorHidden">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -636,13 +671,13 @@
|
|||
contextName = "HiRes.compute():HiRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "UnsafeRawBufferPointer(result)">
|
||||
value = "computePipelineState.maxTotalThreadsPerThreadgroup">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "result[2]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "computePipelineState.maxTotalThreadsPerThreadgroup">
|
||||
value = "UnsafeRawBufferPointer(result)">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -650,7 +685,7 @@
|
|||
contextName = "DebuggerViewController.DisplayDisassembly():DebuggerViewController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "disass_addr_min">
|
||||
value = "line_number">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "disass_addr">
|
||||
|
@ -659,7 +694,7 @@
|
|||
value = "m6502.PC">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "line_number">
|
||||
value = "disass_addr_min">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -732,7 +767,7 @@
|
|||
value = "new">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZtmp.shift16">
|
||||
value = "WOZwrite.shift16">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZwrite.shift">
|
||||
|
@ -744,7 +779,7 @@
|
|||
value = "(1 << i) - 1">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZwrite.shift16">
|
||||
value = "WOZtmp.shift16">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -912,10 +947,10 @@
|
|||
contextName = "set_flags_NZC:common.h">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "(unsigned)0xFF">
|
||||
value = "(unsigned)test ">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(unsigned)test ">
|
||||
value = "(unsigned)0xFF">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -949,17 +984,14 @@
|
|||
contextName = "HiRes.draw(_:):HiRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "ctx?.bitsPerComponent">
|
||||
value = "linAddr">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.data">
|
||||
value = "ctx?.height">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.width">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.bitmapInfo">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.bytesPerRow">
|
||||
</PersistentString>
|
||||
|
@ -969,20 +1001,23 @@
|
|||
<PersistentString
|
||||
value = "HiResLineAddrTbl">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.bitmapInfo">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "HiRes.blockCols">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "shadowScreen">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.bitsPerComponent">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(blockH7 | ( block & bitMask ))">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "linAddr">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.height">
|
||||
value = "ctx?.data">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -1018,22 +1053,22 @@
|
|||
value = "m6502">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.PC">
|
||||
value = "(void*)Apple2_64K_RAM">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.clkfrm">
|
||||
value = "Apple2_64K_RAM + 0x3600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.ecoSpindown">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.PC">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "Apple2_64K_AUX + 0x3600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(void*)Apple2_64K_RAM">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "Apple2_64K_RAM + 0x3600">
|
||||
value = "m6502.clkfrm">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -1052,7 +1087,7 @@
|
|||
value = "textDisplay_height_diff">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textDisplay_width_diff">
|
||||
value = "textDisplay.frame">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textDisplay.bounds">
|
||||
|
@ -1061,10 +1096,10 @@
|
|||
value = "MonitorView.textViewBounds">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "frame.size">
|
||||
value = "textDisplay_width_diff">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textDisplay.frame">
|
||||
value = "frame.size">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -1170,6 +1205,9 @@
|
|||
<PersistentString
|
||||
value = "s">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "*s">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
|
@ -1182,7 +1220,7 @@
|
|||
value = "pdl_value[pdl]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "normalized_time">
|
||||
value = "normalized_time >= pdl_value[pdl] ? 255 : 0">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(3300 * 255/3300)">
|
||||
|
@ -1194,7 +1232,7 @@
|
|||
value = "1 * 512 * (1 - ( 3300 / 3300.0 ))">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "normalized_time >= pdl_value[pdl] ? 255 : 0">
|
||||
value = "normalized_time">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -1265,10 +1303,10 @@
|
|||
value = "Apple2_64K_AUX + 0xC600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "Apple2_64K_RAM + 0xC600">
|
||||
value = "(void*)rom">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(void*)rom">
|
||||
value = "Apple2_64K_RAM + 0xC600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "strlen(fullPath)">
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
disableMainThreadChecker = "YES"
|
||||
enableASanStackUseAfterReturn = "YES"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -222,7 +222,7 @@
|
|||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView editable="NO" selectable="NO" drawsBackground="NO" importsGraphics="NO" richText="NO" horizontallyResizable="YES" verticallyResizable="YES" baseWritingDirection="leftToRight" findStyle="bar" allowsCharacterPickerTouchBarItem="NO" textCompletion="NO" id="Hwx-Gd-XW1" userLabel="Disass Display" customClass="DisplayView" customModule="A2MacTests" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="-94" width="349" height="1270"/>
|
||||
<rect key="frame" x="0.0" y="-111" width="349" height="1270"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" red="0.12549019610000001" green="0.12549019610000001" blue="0.12549019610000001" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
|
@ -329,7 +329,7 @@ C20D: 4C C5 FE JMP $FEC5
|
|||
<rect key="frame" x="-100" y="-100" width="225" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="0.0012626262626262627" horizontal="NO" id="8wE-fn-MQK">
|
||||
<scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="8wE-fn-MQK">
|
||||
<rect key="frame" x="350" y="1" width="15" height="478"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
|
@ -448,7 +448,7 @@ C20D: 4C C5 FE JMP $FEC5
|
|||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView editable="NO" selectable="NO" drawsBackground="NO" importsGraphics="NO" richText="NO" horizontallyResizable="YES" verticallyResizable="YES" baseWritingDirection="leftToRight" findStyle="bar" allowsCharacterPickerTouchBarItem="NO" textCompletion="NO" id="BHr-Q4-rBI" userLabel="Stack Display" customClass="DisplayView" customModule="A2MacTests" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="-164" width="334" height="182"/>
|
||||
<rect key="frame" x="0.0" y="-187" width="334" height="181"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="windowBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
|
@ -472,7 +472,7 @@ C20D: 4C C5 FE JMP $FEC5
|
|||
<rect key="frame" x="-100" y="-100" width="349" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="0.020833333333333332" horizontal="NO" id="dcm-z5-VNG">
|
||||
<scroller key="verticalScroller" verticalHuggingPriority="750" horizontal="NO" id="dcm-z5-VNG">
|
||||
<rect key="frame" x="335" y="1" width="15" height="158"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
|
|
|
@ -293,13 +293,16 @@ N V - B D I Z C
|
|||
}
|
||||
|
||||
|
||||
let UpdateSemaphore = DispatchSemaphore(value: 1)
|
||||
func Update() {
|
||||
UpdateSemaphore.wait()
|
||||
|
||||
DisplayRegisters()
|
||||
DisplayStack()
|
||||
DisplayMemory()
|
||||
DisplayDisassembly()
|
||||
|
||||
UpdateSemaphore.signal()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -54,6 +54,10 @@ class DebuggerWindowController: NSWindowController, NSWindowDelegate {
|
|||
isKey = false
|
||||
}
|
||||
|
||||
func windowWillClose(_ notification: Notification) {
|
||||
DebuggerWindowController.current = nil
|
||||
}
|
||||
|
||||
|
||||
// TODO: Probably there is a better way to achieve this
|
||||
// fill non-break spaces to provide uniform button width
|
||||
|
|
|
@ -1265,7 +1265,14 @@ class ViewController: NSViewController {
|
|||
}
|
||||
|
||||
|
||||
let UpdateSemaphore = DispatchSemaphore(value: 1)
|
||||
func Update() {
|
||||
if UpdateSemaphore.wait(timeout: DispatchTime.now() + 0.001) == .timedOut {
|
||||
// get back here next time...
|
||||
print("UpdateSemaphore.wait")
|
||||
return
|
||||
}
|
||||
|
||||
diskButtonUpdate()
|
||||
|
||||
switch cpuState {
|
||||
|
@ -1363,6 +1370,8 @@ class ViewController: NSViewController {
|
|||
break
|
||||
}
|
||||
|
||||
// ok, from now you can update again
|
||||
UpdateSemaphore.signal()
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue