Fix: Disassembly view scroll

This commit is contained in:
tudnai 2022-11-05 16:26:52 -07:00
parent 942511d71c
commit cc6c05064d
6 changed files with 49 additions and 30 deletions

View File

@ -13,6 +13,17 @@
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState
contextName = "_fetch_dbg:mmio.c">
<PersistentStrings>
<PersistentString
value = "memread8_low(m6502.PC)">
</PersistentString>
<PersistentString
value = "disassembly.pOpcode">
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState
contextName = "addr_ind_Y:Apple2_mmio.h">
</ContextState>
@ -1147,6 +1158,17 @@
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState
contextName = "_disHexB:disassembler.c">
<PersistentStrings>
<PersistentString
value = "(*s)[4]">
</PersistentString>
<PersistentString
value = "s">
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState
contextName = "pdl_read:paddle.h">
<PersistentStrings>

View File

@ -63,8 +63,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableAddressSanitizer = "YES"
enableASanStackUseAfterReturn = "YES"
disableMainThreadChecker = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@ -91,13 +90,6 @@
ReferencedContainer = "container:A2Mac.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
<AdditionalOption
key = "MallocScribble"
value = ""
isEnabled = "YES">
</AdditionalOption>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Debug"

View File

@ -197,8 +197,8 @@
<scene sceneID="TCG-Cv-QBI">
<objects>
<viewController title="Debugger Controller Scene" id="R5e-co-cXs" customClass="DebuggerViewController" customModule="A2MacTests" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" identifier="Monitor View" wantsLayer="YES" focusRingType="none" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" misplaced="YES" id="Myj-W6-YvY" userLabel="Debugger View">
<rect key="frame" x="0.0" y="0.0" width="1100" height="622"/>
<view key="view" identifier="Monitor View" wantsLayer="YES" focusRingType="none" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" id="Myj-W6-YvY" userLabel="Debugger View">
<rect key="frame" x="0.0" y="0.0" width="1100" height="616"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<stackView focusRingType="none" distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jY7-ZU-I4z" userLabel="Disassebler">
@ -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="Display" customClass="DisplayView" customModule="A2MacTests" customModuleProvider="target">
<rect key="frame" x="0.0" y="-47" width="349" height="1271"/>
<rect key="frame" x="0.0" y="-87" width="349" 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"/>
@ -454,7 +454,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="-94" width="334" height="181"/>
<rect key="frame" x="0.0" y="-140" 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"/>

View File

@ -197,7 +197,7 @@ N V - B D I Z C
let disass_addr_min : UInt16 = 320
let disass_addr_max : UInt16 = 170
let disass_addr_max : UInt16 = 512
var disass_addr : UInt16 = 0
var line_number = 0
var current_line_number = 0

View File

@ -1095,8 +1095,8 @@ class ViewController: NSViewController {
}
// display.stringValue = "testing\nit\nout"
}
func UpdateCPUspeed() {
// under ~1.5 MHz -- 3 decimals to be able to display 1.023 MHz
if ( (mhz < 1.4) && (mhz != floor(mhz)) ) {
@ -1620,15 +1620,15 @@ class ViewController: NSViewController {
newUpdateTimer( timeInterval: 1 / Double(fps) )
#endif
soundGapSlider.integerValue = Int(spkr_extra_buf)
ledingInitEdgeLabel.title = "ILE: " + String( SPKR_INITIAL_LEADING_EDGE )
initialLeadEdgeSlider.floatValue = SPKR_INITIAL_LEADING_EDGE
leadingEdgeLabel.title = "LE: " + String( SPKR_FADE_LEADING_EDGE )
leadEdgeSlider.floatValue = SPKR_FADE_LEADING_EDGE
trailingInitEdgeLabel.title = "ITE: " + String( SPKR_INITIAL_TRAILING_EDGE )
initialTailEdgeSlider.floatValue = SPKR_INITIAL_TRAILING_EDGE
trailingEdgeLabel.title = "TE: " + String( SPKR_FADE_TRAILING_EDGE )
tailEdgeSlider.floatValue = SPKR_FADE_TRAILING_EDGE
// soundGapSlider.integerValue = Int(spkr_extra_buf)
// ledingInitEdgeLabel.title = "ILE: " + String( SPKR_INITIAL_LEADING_EDGE )
// initialLeadEdgeSlider.floatValue = SPKR_INITIAL_LEADING_EDGE
// leadingEdgeLabel.title = "LE: " + String( SPKR_FADE_LEADING_EDGE )
// leadEdgeSlider.floatValue = SPKR_FADE_LEADING_EDGE
// trailingInitEdgeLabel.title = "ITE: " + String( SPKR_INITIAL_TRAILING_EDGE )
// initialTailEdgeSlider.floatValue = SPKR_INITIAL_TRAILING_EDGE
// trailingEdgeLabel.title = "TE: " + String( SPKR_FADE_TRAILING_EDGE )
// tailEdgeSlider.floatValue = SPKR_FADE_TRAILING_EDGE
// // BUGFIX: I am not sure why but if I do not adjust the frame and bounds size

View File

@ -27,16 +27,21 @@
#include "common.h"
#define DISASS_ADDR_LEN 5 // 4 digits + \0
#define DISASS_OPCODE_LEN (4 * 3 + 1) // max 4 bytes * (2 digits + 1 space) + \0
#define DISASS_INST_LEN (6 + 1) // 3 char (unknown instr? -- give it 6 chars) + \0
#define DISASS_OPER_LEN (14 + 2 + 1 + 1 + 1) // 4 digits + 2 brackets + 1 comma + 1 index + \0
#define DISASS_COMM_LEN 256 // 255 char + \0
typedef struct disassembly_s {
uint64_t clk; // clock time
uint8_t op; // opcode
char addr[5]; // 4 digits + \0
char opcode[4 * 3 + 1]; // max 4 bytes * (2 digits + 1 space) + \0
char addr[DISASS_ADDR_LEN]; // 4 digits + \0
char opcode[DISASS_OPCODE_LEN]; // max 4 bytes * (2 digits + 1 space) + \0
char * pOpcode; // pointer for opcode string builder
char inst[6 + 1]; // 3 char (unknown instr? -- give it 6 chars) + \0
char oper[14 + 2 + 1 + 1 + 1]; // 4 digits + 2 brackets + 1 comma + 1 index + \0
char comment[256]; // to be able to add some comments
char inst[DISASS_INST_LEN]; // 3 char (unknown instr? -- give it 6 chars) + \0
char oper[DISASS_OPER_LEN]; // 4 digits + 2 brackets + 1 comma + 1 index + \0
char comment[DISASS_COMM_LEN]; // to be able to add some comments
} disassembly_t;
extern disassembly_t disassembly;