mirror of
https://github.com/trudnai/Steve2.git
synced 2024-06-13 09:29:36 +00:00
RealTime debugger update CPU & Stack
This commit is contained in:
parent
e3c872d23c
commit
eeabd853f6
|
@ -220,7 +220,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="Display" customClass="DisplayView" customModule="A2MacTests" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="113" width="288" height="1270"/>
|
||||
<rect key="frame" x="0.0" y="113" width="288" height="1271"/>
|
||||
<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"/>
|
||||
|
@ -451,7 +451,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="Display" customClass="DisplayView" customModule="A2MacTests" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="-43" width="349" height="182"/>
|
||||
<rect key="frame" x="0.0" y="-42" width="349" 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"/>
|
||||
|
@ -765,6 +765,7 @@ C20D: 4C C5 FE JMP $FEC5
|
|||
</view>
|
||||
<connections>
|
||||
<outlet property="CPU_Display" destination="Wrs-Qt-Kmd" id="SUW-Lc-Zv4"/>
|
||||
<outlet property="Stack_Display" destination="BHr-Q4-rBI" id="qlA-JC-xkW"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<customObject id="DyX-eh-3mW" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
|
|
|
@ -24,13 +24,20 @@
|
|||
import Cocoa
|
||||
|
||||
class DebuggerViewController: NSViewController {
|
||||
static var shared : DebuggerViewController? = nil
|
||||
|
||||
@IBOutlet var CPU_Display: DisplayView!
|
||||
@IBOutlet var Stack_Display: DisplayView!
|
||||
|
||||
// required init?(coder: NSCoder) {
|
||||
// super.init(coder: coder)
|
||||
// DebuggerViewController.shared = self
|
||||
// }
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
self.preferredContentSize = NSMakeSize(self.view.frame.size.width, self.view.frame.size.height)
|
||||
DebuggerViewController.shared = self
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,7 +47,7 @@ class DebuggerViewController: NSViewController {
|
|||
// // Update window title with the active TableView Title
|
||||
// self.parent?.view.window?.title = self.title!
|
||||
|
||||
DisplayRegisters()
|
||||
Update()
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,8 +96,27 @@ N V - B D I Z C
|
|||
m6502.N > 0, m6502.V > 0, m6502.res > 0, m6502.B > 0, m6502.D > 0, m6502.I > 0, m6502.Z > 0, m6502.C > 0
|
||||
)
|
||||
|
||||
CPU_Display.string = registers
|
||||
DispatchQueue.main.async {
|
||||
self.CPU_Display.string = registers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func DisplayStack() {
|
||||
var stack = ""
|
||||
for i : UInt16 in (0x100...0x1FF).reversed() {
|
||||
stack += String(format:"%03X: %02X\n", i, getMEM(i))
|
||||
}
|
||||
|
||||
DispatchQueue.main.async {
|
||||
self.Stack_Display.string = stack
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func Update() {
|
||||
DisplayRegisters()
|
||||
DisplayStack()
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -384,9 +384,12 @@ class ToolBarController: NSWindowController, NSWindowDelegate {
|
|||
}
|
||||
|
||||
@IBAction func Debugger(_ sender: Any) {
|
||||
let debuggerStoryboard = NSStoryboard.init(name: NSStoryboard.Name("Debugger"), bundle: nil)
|
||||
let debuggerControler = debuggerStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("debuggerWindowController")) as! NSWindowController
|
||||
debuggerControler.showWindow(self)
|
||||
if DebuggerToolBarController.current == nil {
|
||||
let debuggerStoryboard = NSStoryboard.init(name: NSStoryboard.Name("Debugger"), bundle: nil)
|
||||
let debuggerControler = debuggerStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("debuggerWindowController")) as! NSWindowController
|
||||
// debuggerControler.showWindow(self)
|
||||
}
|
||||
|
||||
DebuggerToolBarController.current?.showWindow(self)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1242,6 +1242,11 @@ class ViewController: NSViewController {
|
|||
if ( frameCounter % video_fps_divider == 0 ) {
|
||||
self.Render()
|
||||
}
|
||||
|
||||
// TODO: This should be in Debugger!
|
||||
if let debugger = DebuggerViewController.shared {
|
||||
debugger.Update()
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user