MCPcopy Create free account
hub / github.com/TASEmulators/fceux / updateText

Method updateText

src/drivers/Qt/ConsoleDebugger.cpp:7163–7223  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

7161}
7162//----------------------------------------------------------------------------
7163void DebuggerStackDisplay::updateText(void)
7164{
7165 char stmp[128];
7166 int stackPtr = X.S | 0x0100;
7167 std::string stackLine;
7168
7169 stackPtr++;
7170
7171 if ( stackPtr <= 0x01FF )
7172 {
7173 if ( showAddrs || (stackBytesPerLine <= 1) )
7174 {
7175 sprintf( stmp, "%03X: %02X", stackPtr, GetMem(stackPtr) );
7176 }
7177 else
7178 {
7179 sprintf( stmp, "%02X", GetMem(stackPtr) );
7180 }
7181
7182 stackLine.assign( stmp );
7183
7184 for (int i = 1; i < 128; i++)
7185 {
7186 //tmp = ((tmp+1)|0x0100)&0x01FF; //increment and fix pointer to $0100-$01FF range
7187 stackPtr++;
7188 if (stackPtr > 0x1FF)
7189 break;
7190
7191 if ( stackBytesPerLine > 1 )
7192 {
7193 if ((i % stackBytesPerLine) == 0)
7194 {
7195 if ( showAddrs )
7196 {
7197 sprintf( stmp, "\n%03X: %02X", stackPtr, GetMem(stackPtr) );
7198 }
7199 else
7200 {
7201 sprintf( stmp, "\n%02X", GetMem(stackPtr) );
7202 }
7203 }
7204 else
7205 {
7206 sprintf( stmp, ",%02X", GetMem(stackPtr) );
7207 }
7208 }
7209 else
7210 {
7211 sprintf( stmp, "\n%03X: %02X", stackPtr, GetMem(stackPtr) );
7212 }
7213 stackLine.append( stmp );
7214
7215 //printf("Stack $%X: %s\n", stackPtr, stmp );
7216 }
7217 }
7218
7219 setPlainText( tr(stackLine.c_str()) );
7220

Callers 1

updateRegisterViewMethod · 0.80

Calls 2

GetMemFunction · 0.85
trFunction · 0.50

Tested by

no test coverage detected