mirror of https://github.com/trudnai/Steve2.git
Fixes in Debug Mode + break on BRK, HLT, INV enabled
This commit is contained in:
parent
31d26228d8
commit
942511d71c
|
@ -48,7 +48,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">
|
||||
|
@ -66,7 +66,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>
|
||||
|
@ -166,7 +166,7 @@
|
|||
contextName = "closure #1 in ViewController.Update():ViewController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "MEMcfg.txt_page_2">
|
||||
value = "txtArr">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "self.shadowTxt">
|
||||
|
@ -175,10 +175,10 @@
|
|||
value = "txt">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "MEMcfg.is_80STORE">
|
||||
value = "MEMcfg.txt_page_2">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "txtArr">
|
||||
value = "MEMcfg.is_80STORE">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -225,9 +225,6 @@
|
|||
<PersistentString
|
||||
value = "textLines">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "video_fps_divider">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.PC">
|
||||
</PersistentString>
|
||||
|
@ -240,6 +237,9 @@
|
|||
<PersistentString
|
||||
value = "frameCounter">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.debugger.on">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "spkr_play_disk_motor_time">
|
||||
</PersistentString>
|
||||
|
@ -307,7 +307,7 @@
|
|||
contextName = "LoRes.Update():LoRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "UInt8( (block >> 4) & 0x0F )">
|
||||
value = "blockChanged[ screenIdx ]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "UInt8(block)">
|
||||
|
@ -316,7 +316,7 @@
|
|||
value = "UInt8(block & 4)">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "blockChanged[ screenIdx ]">
|
||||
value = "UInt8( (block >> 4) & 0x0F )">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -425,13 +425,13 @@
|
|||
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>
|
||||
|
@ -583,10 +583,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>
|
||||
|
@ -625,13 +625,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>
|
||||
|
@ -718,7 +718,7 @@
|
|||
value = "new">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZtmp.shift16">
|
||||
value = "WOZwrite.shift16">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZwrite.shift">
|
||||
|
@ -730,7 +730,7 @@
|
|||
value = "(1 << i) - 1">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "WOZwrite.shift16">
|
||||
value = "WOZtmp.shift16">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -898,10 +898,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>
|
||||
|
@ -935,10 +935,10 @@
|
|||
contextName = "HiRes.draw(_:):HiRes.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "ctx?.height">
|
||||
value = "linAddr">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.data">
|
||||
value = "HiRes.blockCols">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.width">
|
||||
|
@ -961,14 +961,14 @@
|
|||
<PersistentString
|
||||
value = "(blockH7 | ( block & bitMask ))">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.height">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "ctx?.bitsPerComponent">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "linAddr">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "HiRes.blockCols">
|
||||
value = "ctx?.data">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -1004,22 +1004,22 @@
|
|||
value = "m6502">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "Apple2_64K_AUX + 0x3600">
|
||||
value = "(void*)Apple2_64K_RAM">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.clkfrm">
|
||||
value = "Apple2_64K_RAM + 0x3600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.ecoSpindown">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "Apple2_64K_AUX + 0x3600">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "m6502.PC">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(void*)Apple2_64K_RAM">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "Apple2_64K_RAM + 0x3600">
|
||||
value = "m6502.clkfrm">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -1037,6 +1037,9 @@
|
|||
<PersistentString
|
||||
value = "textDisplay_height_diff">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textDisplay.frame">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textDisplay.bounds">
|
||||
</PersistentString>
|
||||
|
@ -1049,9 +1052,6 @@
|
|||
<PersistentString
|
||||
value = "textDisplay_width_diff">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "textDisplay.frame">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
|
@ -1139,6 +1139,14 @@
|
|||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "DebuggerWindowController.Continue():DebuggerWindowController.swift">
|
||||
<PersistentStrings>
|
||||
<PersistentString
|
||||
value = "m6502.debugger.on">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
<ContextState
|
||||
contextName = "pdl_read:paddle.h">
|
||||
<PersistentStrings>
|
||||
|
@ -1149,7 +1157,7 @@
|
|||
value = "pdl_value[pdl]">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "normalized_time">
|
||||
value = "normalized_time >= pdl_value[pdl] ? 255 : 0">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "(3300 * 255/3300)">
|
||||
|
@ -1161,7 +1169,7 @@
|
|||
value = "1 * 512 * (1 - ( 3300 / 3300.0 ))">
|
||||
</PersistentString>
|
||||
<PersistentString
|
||||
value = "normalized_time >= pdl_value[pdl] ? 255 : 0">
|
||||
value = "normalized_time">
|
||||
</PersistentString>
|
||||
</PersistentStrings>
|
||||
</ContextState>
|
||||
|
@ -1232,10 +1240,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,6 +63,8 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
enableAddressSanitizer = "YES"
|
||||
enableASanStackUseAfterReturn = "YES"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
@ -89,6 +91,13 @@
|
|||
ReferencedContainer = "container:A2Mac.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
<AdditionalOption
|
||||
key = "MallocScribble"
|
||||
value = ""
|
||||
isEnabled = "YES">
|
||||
</AdditionalOption>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Debug"
|
||||
|
|
|
@ -114,11 +114,6 @@ class DebuggerWindowController: NSWindowController, NSWindowDelegate {
|
|||
m6502.debugger.on = true
|
||||
|
||||
ViewController.current?.Resume()
|
||||
|
||||
m6502.debugger.wMask = 0
|
||||
m6502.debugger.on = false
|
||||
|
||||
PauseButtonUpdate()
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -335,6 +335,10 @@ void m6502_Run() {
|
|||
m6502.clktime += m6502.clkfrm;
|
||||
m6502.clkfrm = 0;
|
||||
m6502.lastIO = 0;
|
||||
// make sure we aare not debugging
|
||||
m6502.debugger.on = 0;
|
||||
m6502.debugger.wMask = 0;
|
||||
|
||||
|
||||
if( diskAccelerator_count ) {
|
||||
if( --diskAccelerator_count <= 0 ) {
|
||||
|
@ -416,7 +420,12 @@ void m6502_Debug(void) {
|
|||
m6502.clktime += m6502.clkfrm;
|
||||
m6502.clkfrm = 0;
|
||||
m6502.lastIO = 0;
|
||||
m6502.interrupt = NO_INT;
|
||||
m6502.interrupt = NO_INT; // TODO: This should be taken care by the interrupt handler
|
||||
|
||||
m6502.debugger.on = 1;
|
||||
m6502.debugger.mask.hlt = 1;
|
||||
m6502.debugger.mask.brk = 1;
|
||||
m6502.debugger.mask.inv = 1;
|
||||
|
||||
if( diskAccelerator_count ) {
|
||||
if( --diskAccelerator_count <= 0 ) {
|
||||
|
|
|
@ -78,7 +78,7 @@ typedef struct {
|
|||
|
||||
INLINE int m6502_Disass_1_Instr(void) {
|
||||
|
||||
disNewInstruction();
|
||||
_disNewInstruction();
|
||||
|
||||
switch ( _fetch_dbg() ) {
|
||||
#include "6502_std.h" // Standard 6502 instructions
|
||||
|
|
|
@ -70,10 +70,10 @@ void _disNewInstruction(void) {
|
|||
disassembly.clk = m6502.clktime + m6502.clkfrm;
|
||||
snprintf(disassembly.addr, 5, "%04X ", m6502.PC);
|
||||
disassembly.pOpcode = disassembly.opcode;
|
||||
// disassembly.opcode[0] = '\0';
|
||||
// disassembly.inst[0] = '\0';
|
||||
// disassembly.oper[0] = '\0';
|
||||
// disassembly.comment[0] = '\0';
|
||||
disassembly.opcode[0] = '\0';
|
||||
disassembly.inst[0] = '\0';
|
||||
disassembly.oper[0] = '\0';
|
||||
disassembly.comment[0] = '\0';
|
||||
// }
|
||||
|
||||
disassembly.op = memread8_low(m6502.PC);
|
||||
|
@ -83,7 +83,7 @@ void _disNewInstruction(void) {
|
|||
|
||||
#ifdef DISASSEMBLER
|
||||
void printDisassembly( FILE * f ) {
|
||||
if ( m6502.dbgLevel.trace && f ) {
|
||||
if ( m6502.debugger.mask.trace && f ) {
|
||||
// fprintf( f, "%s: %-14s%-6s%-14s%-16s A:%02X X:%02X Y:%02X S:%02X P:%02X (%c%c%c%c%c%c%c%c)\n",
|
||||
// disassembly.addr,
|
||||
// disassembly.opcode,
|
||||
|
|
Loading…
Reference in New Issue