- Startup speed is set by ColdReset, so it will work always

- HiRes screen is being cleared when switched back to text mode
- Turned off Debug app for Release mode
This commit is contained in:
tudnai 2020-05-05 23:03:36 -07:00
parent 2eead2f4ad
commit 803ce37b0a
5 changed files with 28 additions and 41 deletions

View File

@ -61,8 +61,8 @@
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@ -483,8 +483,8 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "190"
endingLineNumber = "190"
landmarkName = "HiRes"
landmarkType = "3">
landmarkName = "compute()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
@ -499,7 +499,7 @@
endingColumnNumber = "9223372036854775807"
startingLineNumber = "165"
endingLineNumber = "165"
landmarkName = "compute()"
landmarkName = "init(frame:)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
@ -1982,38 +1982,6 @@
endingLineNumber = "626"
landmarkName = "Update()"
landmarkType = "7">
<Locations>
<Location
uuid = "ADF25D90-51C8-4D88-BD9B-352BC4E00C20 - 6be15f36516fdb02"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "A2Mac.HiRes.Update() -&gt; ()"
moduleName = "A2Mac"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/trudnai/Dropbox/Projects/A2Mac/A2Mac/HiRes.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "626"
endingLineNumber = "626"
offsetFromSymbolStart = "2114">
</Location>
<Location
uuid = "ADF25D90-51C8-4D88-BD9B-352BC4E00C20 - 6be15f36516fdb02"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "A2Mac.HiRes.Update() -&gt; ()"
moduleName = "A2Mac"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/trudnai/Dropbox/Projects/A2Mac/A2Mac/HiRes.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "626"
endingLineNumber = "626"
offsetFromSymbolStart = "2147">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>

View File

@ -129,12 +129,18 @@ class HiRes: NSView {
}
}
}
func clearScreen() {
HiRes.context?.clear( CGRect(x: 0, y: 0, width: frame.width, height: frame.height) )
needsDisplay = true
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
initHiResLineAddresses()
HiRes.context?.clear( CGRect(x: 0, y: 0, width: frame.width, height: frame.height) )
clearScreen()
// currentContext?.setShouldAntialias(false)
// currentContext?.interpolationQuality = CGInterpolationQuality.none

View File

@ -288,6 +288,10 @@ class ViewController: NSViewController {
}
var savedVideoMode = videoMode_t.init()
override func keyUp(with event: NSEvent) {
print("KBD Event")
// switch event.modifierFlags.intersection(.deviceIndependentFlagsMask) {
@ -564,6 +568,12 @@ class ViewController: NSViewController {
// self.hires.setNeedsDisplay( CGRect(x: 400, y: 600, width: 50, height: 50) )
// self.hires.setNeedsDisplay( CGRect(x: 500, y: 600, width: 50, height: 50) )
if self.savedVideoMode.text != videoMode.text {
self.savedVideoMode.text = videoMode.text
self.hires.clearScreen()
}
// only refresh graphics view when needed (aka not in text mode)
if ( videoMode.text == 0 ) {
// self.hires.needsDisplay = true

View File

@ -841,7 +841,9 @@ void m6502_ColdReset( const char * bundlePath, const char * romFileName ) {
mhz = (double)MHz_6502 / M;
unsigned long long saved_frm_set = clk_6502_per_frm_set;
clk_6502_per_frm_max = clk_6502_per_frm_set = 0;
clk_6502_per_frm =
clk_6502_per_frm_max =
clk_6502_per_frm_set = 0;
// wait 100ms to be sure simulation has been halted
usleep(100000);
@ -1005,8 +1007,9 @@ void m6502_ColdReset( const char * bundlePath, const char * romFileName ) {
// memcpy( RAM + 0x1000, counter_fast, sizeof(counter));
// m6502.PC = 0x1000;
clk_6502_per_frm_set = saved_frm_set;
clk_6502_per_frm_set = saved_frm_set;
clk_6502_per_frm = startup_MHz_6502 / fps;
diskAccelerator_count = 15;
}