Commit 7f49f77 1 parent ae5021f commit 7f49f77 Copy full SHA for 7f49f77
File tree 4 files changed +36
-5
lines changed
4 files changed +36
-5
lines changed Original file line number Diff line number Diff line change @@ -101,9 +101,9 @@ void DebugLog(const char* message)
101
101
#ifndef Q_OS_WIN32
102
102
QString dirname = QDir::homePath () + " /.QtUkncBtl/" ;
103
103
QDir tracedir (dirname);
104
- if (!tracedir.exists ())
104
+ if (!tracedir.exists ())
105
105
{
106
- if (!tracedir.mkdir (dirname))
106
+ if (!tracedir.mkdir (dirname))
107
107
{
108
108
::perror (" Operation failed" );
109
109
return ;
@@ -113,7 +113,7 @@ void DebugLog(const char* message)
113
113
#endif
114
114
#endif
115
115
Common_LogFile = ::fopen (fullpathfile.c_str (), " a+b" );
116
- if (!Common_LogFile)
116
+ if (!Common_LogFile)
117
117
{
118
118
::perror (" Tracefile opening failed" );
119
119
return ;
Original file line number Diff line number Diff line change @@ -71,8 +71,12 @@ bool Emulator_Init()
71
71
m_wEmulatorCPUBpsCount = m_wEmulatorPPUBpsCount = 0 ;
72
72
for (int i = 0 ; i <= MAX_BREAKPOINTCOUNT; i++)
73
73
{
74
- m_EmulatorCPUBps[i] = 0177777 ;
75
- m_EmulatorPPUBps[i] = 0177777 ;
74
+ uint16_t address = Settings_GetDebugBreakpoint (i, true );
75
+ m_EmulatorCPUBps[i] = address;
76
+ if (address != 0177777 ) m_wEmulatorCPUBpsCount = i + 1 ;
77
+ address = Settings_GetDebugBreakpoint (i, false );
78
+ m_EmulatorPPUBps[i] = address;
79
+ if (address != 0177777 ) m_wEmulatorPPUBpsCount = i + 1 ;
76
80
}
77
81
78
82
g_pBoard = new CMotherboard ();
@@ -126,6 +130,12 @@ void Emulator_Done()
126
130
{
127
131
ASSERT (g_pBoard != nullptr );
128
132
133
+ // Save breakpoints
134
+ for (int i = 0 ; i < MAX_BREAKPOINTCOUNT; i++)
135
+ Settings_SetDebugBreakpoint (i, true , i < m_wEmulatorCPUBpsCount ? m_EmulatorCPUBps[i] : 0177777 );
136
+ for (int i = 0 ; i < MAX_BREAKPOINTCOUNT; i++)
137
+ Settings_SetDebugBreakpoint (i, false , i < m_wEmulatorPPUBpsCount ? m_EmulatorPPUBps[i] : 0177777 );
138
+
129
139
CProcessor::Done ();
130
140
131
141
g_pBoard->SetSoundGenCallback (nullptr );
Original file line number Diff line number Diff line change @@ -105,6 +105,25 @@ quint16 Settings_GetDebugMemoryMode()
105
105
return (quint16)value.toUInt ();
106
106
}
107
107
108
+ void Settings_SetDebugBreakpoint (int bpno, bool okCpuPpu, quint16 address)
109
+ {
110
+ char bufValueName[] = " DebugBreakptCpu0" ;
111
+ bufValueName[12 ] = okCpuPpu ? ' C' : ' P' ;
112
+ bufValueName[15 ] = bpno < 10 ? ' 0' + (char )bpno : ' A' + (char )(bpno - 10 );
113
+ if (address == 0177777 )
114
+ Global_getSettings ()->remove (bufValueName);
115
+ else
116
+ Global_getSettings ()->setValue (bufValueName, address);
117
+ }
118
+ quint16 Settings_GetDebugBreakpoint (int bpno, bool okCpuPpu)
119
+ {
120
+ char bufValueName[] = " DebugBreakptCpu0" ;
121
+ bufValueName[12 ] = okCpuPpu ? ' C' : ' P' ;
122
+ bufValueName[15 ] = bpno < 10 ? ' 0' + (char )bpno : ' A' + (char )(bpno - 10 );
123
+ QVariant value = Global_getSettings ()->value (bufValueName, 0177777 );
124
+ return (quint16)value.toUInt ();
125
+ }
126
+
108
127
void Settings_SetDebugMemoryAddress (quint16 mode)
109
128
{
110
129
Global_getSettings ()->setValue (" DebugMemoryAddress" , mode);
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ void Settings_SetSoundAY(bool flag);
41
41
bool Settings_GetSoundAY ();
42
42
bool Settings_GetDebugCpuPpu ();
43
43
void Settings_SetDebugCpuPpu (bool flag);
44
+ void Settings_SetDebugBreakpoint (int bpno, bool okCpuPpu, quint16 address);
45
+ quint16 Settings_GetDebugBreakpoint (int bpno, bool okCpuPpu);
44
46
void Settings_SetDebugMemoryMode (quint16 mode);
45
47
quint16 Settings_GetDebugMemoryMode ();
46
48
void Settings_SetDebugMemoryAddress (quint16 address);
You can’t perform that action at this time.
0 commit comments