mirror of https://github.com/trudnai/Steve2.git
- Optimized Text Rendering
- Optimized HiRes screen hiding
This commit is contained in:
parent
803ce37b0a
commit
cb5339e01f
|
@ -81,7 +81,7 @@
|
|||
</BuildableProductRunnable>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
buildConfiguration = "Debug"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
|
|
|
@ -353,8 +353,8 @@
|
|||
timestampString = "590831455.181416"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "162"
|
||||
endingLineNumber = "162"
|
||||
startingLineNumber = "168"
|
||||
endingLineNumber = "168"
|
||||
landmarkName = "HiRes"
|
||||
landmarkType = "3">
|
||||
</BreakpointContent>
|
||||
|
@ -369,8 +369,8 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "879"
|
||||
endingLineNumber = "879"
|
||||
startingLineNumber = "885"
|
||||
endingLineNumber = "885"
|
||||
landmarkName = "draw(_:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -385,8 +385,8 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "910"
|
||||
endingLineNumber = "910"
|
||||
startingLineNumber = "916"
|
||||
endingLineNumber = "916"
|
||||
landmarkName = "draw(_:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -401,8 +401,8 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "907"
|
||||
endingLineNumber = "907"
|
||||
startingLineNumber = "913"
|
||||
endingLineNumber = "913"
|
||||
landmarkName = "draw(_:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -417,8 +417,8 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "884"
|
||||
endingLineNumber = "884"
|
||||
startingLineNumber = "890"
|
||||
endingLineNumber = "890"
|
||||
landmarkName = "draw(_:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -433,8 +433,8 @@
|
|||
filePath = "A2Mac/ViewController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "344"
|
||||
endingLineNumber = "344"
|
||||
startingLineNumber = "348"
|
||||
endingLineNumber = "348"
|
||||
landmarkName = "ViewController"
|
||||
landmarkType = "3">
|
||||
</BreakpointContent>
|
||||
|
@ -481,10 +481,10 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "190"
|
||||
endingLineNumber = "190"
|
||||
landmarkName = "compute()"
|
||||
landmarkType = "7">
|
||||
startingLineNumber = "196"
|
||||
endingLineNumber = "196"
|
||||
landmarkName = "HiRes"
|
||||
landmarkType = "3">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
|
@ -497,9 +497,9 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "165"
|
||||
endingLineNumber = "165"
|
||||
landmarkName = "init(frame:)"
|
||||
startingLineNumber = "171"
|
||||
endingLineNumber = "171"
|
||||
landmarkName = "compute()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
|
@ -657,8 +657,8 @@
|
|||
filePath = "A2Mac/ViewController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "611"
|
||||
endingLineNumber = "611"
|
||||
startingLineNumber = "628"
|
||||
endingLineNumber = "628"
|
||||
landmarkName = "viewDidLoad()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -875,8 +875,8 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "201"
|
||||
endingLineNumber = "201"
|
||||
startingLineNumber = "207"
|
||||
endingLineNumber = "207"
|
||||
landmarkName = "render()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -939,8 +939,8 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "893"
|
||||
endingLineNumber = "893"
|
||||
startingLineNumber = "899"
|
||||
endingLineNumber = "899"
|
||||
landmarkName = "draw(_:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -955,8 +955,8 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "906"
|
||||
endingLineNumber = "906"
|
||||
startingLineNumber = "912"
|
||||
endingLineNumber = "912"
|
||||
landmarkName = "draw(_:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -971,8 +971,8 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "916"
|
||||
endingLineNumber = "916"
|
||||
startingLineNumber = "922"
|
||||
endingLineNumber = "922"
|
||||
landmarkName = "draw(_:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -987,8 +987,8 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "585"
|
||||
endingLineNumber = "585"
|
||||
startingLineNumber = "591"
|
||||
endingLineNumber = "591"
|
||||
landmarkName = "hiresColorPixel(pixelAddr:pixel:prev:)"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -1275,24 +1275,8 @@
|
|||
filePath = "A2Mac/ViewController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "410"
|
||||
endingLineNumber = "410"
|
||||
landmarkName = "Update()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "C07F6B68-6A7A-4B09-837E-DBFA14DFF068"
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "A2Mac/ViewController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "575"
|
||||
endingLineNumber = "575"
|
||||
startingLineNumber = "414"
|
||||
endingLineNumber = "414"
|
||||
landmarkName = "Update()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -1307,24 +1291,8 @@
|
|||
filePath = "A2Mac/ViewController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "519"
|
||||
endingLineNumber = "519"
|
||||
landmarkName = "Update()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "86A35A38-C08C-4F86-B3CF-45B86C2579DC"
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "A2Mac/ViewController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "480"
|
||||
endingLineNumber = "480"
|
||||
startingLineNumber = "523"
|
||||
endingLineNumber = "523"
|
||||
landmarkName = "Update()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -1962,8 +1930,8 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "643"
|
||||
endingLineNumber = "643"
|
||||
startingLineNumber = "649"
|
||||
endingLineNumber = "649"
|
||||
landmarkName = "Update()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
@ -1978,8 +1946,72 @@
|
|||
filePath = "A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "626"
|
||||
endingLineNumber = "626"
|
||||
startingLineNumber = "632"
|
||||
endingLineNumber = "632"
|
||||
landmarkName = "Update()"
|
||||
landmarkType = "7">
|
||||
<Locations>
|
||||
<Location
|
||||
uuid = "ADF25D90-51C8-4D88-BD9B-352BC4E00C20 - 6be15f36516fdb02"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "A2Mac.HiRes.Update() -> ()"
|
||||
moduleName = "A2Mac"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/trudnai/Dropbox/Projects/A2Mac/A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "632"
|
||||
endingLineNumber = "632"
|
||||
offsetFromSymbolStart = "2114">
|
||||
</Location>
|
||||
<Location
|
||||
uuid = "ADF25D90-51C8-4D88-BD9B-352BC4E00C20 - 6be15f36516fdb02"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "A2Mac.HiRes.Update() -> ()"
|
||||
moduleName = "A2Mac"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/trudnai/Dropbox/Projects/A2Mac/A2Mac/HiRes.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "632"
|
||||
endingLineNumber = "632"
|
||||
offsetFromSymbolStart = "2147">
|
||||
</Location>
|
||||
</Locations>
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "CD92D488-6E98-41AA-BBBB-B977CB87A11C"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "A2Mac/ViewController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "576"
|
||||
endingLineNumber = "576"
|
||||
landmarkName = "Update()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
uuid = "75D38E45-0220-498F-A4A7-C87991F329A1"
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "A2Mac/ViewController.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "491"
|
||||
endingLineNumber = "491"
|
||||
landmarkName = "Update()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
|
|
|
@ -811,7 +811,7 @@
|
|||
<constraint firstAttribute="width" constant="1120" id="uez-Mi-0Sh"/>
|
||||
<constraint firstAttribute="height" constant="768" id="zl6-au-oZj"/>
|
||||
</constraints>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" refusesFirstResponder="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" state="on" baseWritingDirection="leftToRight" id="pIk-RC-s5g">
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" allowsUndo="NO" sendsActionOnEndEditing="YES" state="on" baseWritingDirection="leftToRight" id="pIk-RC-s5g">
|
||||
<font key="font" size="32" name="PrintChar21"/>
|
||||
<string key="title">1234567890123456789012345678901234567890
|
||||
@@@@@@@@@1@@@@@@@@@2@@@@@@@@@3@@@@@@@@@4
|
||||
|
|
|
@ -383,8 +383,9 @@ class ViewController: NSViewController {
|
|||
|
||||
var currentVideoMode = videoMode
|
||||
var lastFrameTime = CACurrentMediaTime() as Double
|
||||
var frameCounter : UInt = 0
|
||||
var frameCounter : UInt32 = 0
|
||||
var clkCounter : Double = 0
|
||||
let fpsHalf = fps / 2
|
||||
|
||||
var halted = true;
|
||||
|
||||
|
@ -397,7 +398,7 @@ class ViewController: NSViewController {
|
|||
|
||||
frameCounter += 1
|
||||
|
||||
if ( frameCounter % UInt(fps) == 0 ) {
|
||||
if ( frameCounter % fps == 0 ) {
|
||||
let currentTime = CACurrentMediaTime() as Double
|
||||
let elpasedTime = currentTime - lastFrameTime
|
||||
lastFrameTime = currentTime
|
||||
|
@ -413,7 +414,7 @@ class ViewController: NSViewController {
|
|||
|
||||
frameCnt += 1
|
||||
|
||||
if ( frameCnt == fps / 2 ) {
|
||||
if ( frameCnt == fpsHalf ) {
|
||||
// flashingSpace = blockChar
|
||||
ViewController.charConvTbl = ViewController.charConvTblFlashOn
|
||||
}
|
||||
|
@ -445,44 +446,50 @@ class ViewController: NSViewController {
|
|||
self.txtArr = self.txtClear
|
||||
|
||||
// render an empty space to eiminate displaying text portion of the screen covered by graphics
|
||||
let charDisposition = videoMode.col80 == 0 ? 1 : 2
|
||||
for y in 0 ..< fromLines {
|
||||
if videoMode.col80 == 0 {
|
||||
self.txtArr[ y * (self.textCols + self.lineEndChars) + self.textCols ] = "\n"
|
||||
}
|
||||
else {
|
||||
self.txtArr[ y * (self.textCols * 2 + self.lineEndChars) + self.textCols * 2] = "\n"
|
||||
}
|
||||
self.txtArr[ y * (self.textCols * 2 + self.lineEndChars) + self.textCols * charDisposition] = "\n"
|
||||
}
|
||||
|
||||
// render the rest of the text screen
|
||||
for y in fromLines ..< toLines {
|
||||
for x in 0 ..< self.textCols {
|
||||
let byte = self.textBufferPointer[ self.textLineOfs[y] + x ]
|
||||
let idx = Int(byte);
|
||||
let chr = ViewController.charConvTbl[idx]
|
||||
|
||||
if videoMode.col80 == 0 {
|
||||
self.txtArr[ y * (self.textCols + self.lineEndChars) + x ] = chr
|
||||
}
|
||||
else {
|
||||
self.txtArr[ y * (self.textCols * 2 + self.lineEndChars) + x * 2 + 1] = chr
|
||||
|
||||
let byte = self.textAuxBufferPointer[ self.textLineOfs[y] + x ]
|
||||
// 40 col
|
||||
if videoMode.col80 == 0 {
|
||||
// render the rest of the text screen
|
||||
for y in fromLines ..< toLines {
|
||||
for x in 0 ..< self.textCols {
|
||||
let byte = self.textBufferPointer[ self.textLineOfs[y] + x ]
|
||||
let idx = Int(byte);
|
||||
let chr = ViewController.charConvTbl[idx]
|
||||
|
||||
self.txtArr[ y * (self.textCols * 2 + self.lineEndChars) + x * 2] = chr
|
||||
self.txtArr[ y * (self.textCols + self.lineEndChars) + x ] = chr
|
||||
}
|
||||
}
|
||||
|
||||
if videoMode.col80 == 0 {
|
||||
|
||||
self.txtArr[ y * (self.textCols + self.lineEndChars) + self.textCols ] = "\n"
|
||||
}
|
||||
else {
|
||||
}
|
||||
// 80 col
|
||||
else {
|
||||
// render the rest of the text screen
|
||||
for y in fromLines ..< toLines {
|
||||
for x in 0 ..< self.textCols {
|
||||
let byte = self.textBufferPointer[ self.textLineOfs[y] + x ]
|
||||
let idx = Int(byte);
|
||||
let chr = ViewController.charConvTbl[idx]
|
||||
|
||||
self.txtArr[ y * (self.textCols * 2 + self.lineEndChars) + x * 2 + 1] = chr
|
||||
|
||||
let byte2 = self.textAuxBufferPointer[ self.textLineOfs[y] + x ]
|
||||
let idx2 = Int(byte2);
|
||||
let chr2 = ViewController.charConvTbl[idx2]
|
||||
|
||||
self.txtArr[ y * (self.textCols * 2 + self.lineEndChars) + x * 2] = chr2
|
||||
}
|
||||
|
||||
self.txtArr[ y * (self.textCols * 2 + self.lineEndChars) + self.textCols * 2] = "\n"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
txt = String(self.txtArr)
|
||||
|
||||
if videoMode.col80 != self.currentVideoMode.col80 {
|
||||
|
@ -570,8 +577,15 @@ class ViewController: NSViewController {
|
|||
|
||||
if self.savedVideoMode.text != videoMode.text {
|
||||
self.savedVideoMode.text = videoMode.text
|
||||
|
||||
self.hires.clearScreen()
|
||||
|
||||
// self.hires.clearScreen()
|
||||
|
||||
if ( videoMode.text == 0 ) {
|
||||
self.hires.isHidden = false
|
||||
}
|
||||
else {
|
||||
self.hires.isHidden = true
|
||||
}
|
||||
}
|
||||
|
||||
// only refresh graphics view when needed (aka not in text mode)
|
||||
|
|
Loading…
Reference in New Issue