~ubuntu-branches/debian/sid/stella/sid

« back to all changes in this revision

Viewing changes to src/debugger/Debugger.cxx

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2013-06-28 09:53:13 UTC
  • mfrom: (1.3.6)
  • Revision ID: package-import@ubuntu.com-20130628095313-j8jkkgxpvx1t18ym
Tags: 3.9-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
// See the file "License.txt" for information on usage and redistribution of
15
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
16
//
17
 
// $Id: Debugger.cxx 2597 2013-02-03 00:13:08Z stephena $
 
17
// $Id: Debugger.cxx 2753 2013-06-21 12:15:32Z stephena $
18
18
//============================================================================
19
19
 
20
20
#include "bspf.hxx"
40
40
#include "TIA.hxx"
41
41
 
42
42
#include "CartDebug.hxx"
 
43
#include "CartDebugWidget.hxx"
43
44
#include "CpuDebug.hxx"
44
45
#include "RiotDebug.hxx"
45
46
#include "TIADebug.hxx"
121
122
    myBreakPoints(NULL),
122
123
    myReadTraps(NULL),
123
124
    myWriteTraps(NULL),
124
 
    myWidth(1050),
125
 
    myHeight(620),
 
125
    myWidth(1080),
 
126
    myHeight(720),
126
127
    myRewindManager(NULL)
127
128
{
128
129
  // Init parser
129
 
  myParser = new DebuggerParser(this);
 
130
  myParser = new DebuggerParser(*this);
130
131
 
131
132
  // Create debugger subsystems
132
133
  myCpuDebug  = new CpuDebug(*this, myConsole);
165
166
void Debugger::initialize()
166
167
{
167
168
  // Get the dialog size
168
 
  int w, h;
169
 
  myOSystem->settings().getSize("debuggerres", w, h);
170
 
  myWidth = BSPF_max(w, 0);
171
 
  myHeight = BSPF_max(h, 0);
172
 
  myWidth = BSPF_max(myWidth, 1050u);
173
 
  myHeight = BSPF_max(myHeight, 700u);
174
 
  myOSystem->settings().setSize("debuggerres", myWidth, myHeight);
 
169
  const GUI::Size& size = myOSystem->settings().getSize("debuggerres");
 
170
  myWidth = BSPF_max(size.w, 0);
 
171
  myHeight = BSPF_max(size.h, 0);
 
172
  myWidth = BSPF_max(myWidth, 1080u);
 
173
  myHeight = BSPF_max(myHeight, 720u);
 
174
  myOSystem->settings().setValue("debuggerres", GUI::Size(myWidth, myHeight));
175
175
 
176
176
  const GUI::Rect& r = getDialogBounds();
177
177
 
181
181
  myBaseDialog = myDialog;
182
182
 
183
183
  myRewindManager = new RewindManager(*myOSystem, myDialog->rewindButton());
 
184
  myCartDebug->setDebugWidget(&(myDialog->cartDebug()));
184
185
}
185
186
 
186
187
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
204
205
    if(address > -1)
205
206
      buf << valueToString(address);
206
207
 
207
 
    myDialog->message().setEditString(buf.str());
 
208
    myDialog->message().setText(buf.str());
208
209
    return true;
209
210
  }
210
211
  return false;
243
244
      << myParser->exec(autoexec) << endl;
244
245
 
245
246
  // Also, "romname.stella" if present
246
 
  string file = myOSystem->romFile();
247
 
  string::size_type pos;
248
 
  if( (pos = file.find_last_of('.')) != string::npos )
249
 
    file.replace(pos, file.size(), ".stella");
250
 
  else
251
 
    file += ".stella";
252
 
 
253
 
  FilesystemNode romname(file);
 
247
  FilesystemNode romname(myOSystem->romFile().getPathWithExt(".stella"));
254
248
  buf << myParser->exec(romname) << endl;
255
249
 
256
250
  // Init builtins
313
307
    case kBASE_16_4:  // base 16: 4 bytes wide
314
308
      BSPF_snprintf(vToS_buf, 5, "%04X", value);
315
309
      break;
 
310
    case kBASE_16_8:  // base 16: 8 bytes wide
 
311
      BSPF_snprintf(vToS_buf, 9, "%08X", value);
 
312
      break;
316
313
 
317
314
    case kBASE_16:    // base 16: 2, 4, 8 bytes (depending on value)
318
315
    default:
810
807
}
811
808
 
812
809
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
813
 
string Debugger::saveROM(const string& filename) const
814
 
{
815
 
  string path = FilesystemNode::createAbsolutePath(filename, "~", "a26");
816
 
  FilesystemNode node(path);
817
 
 
818
 
  ofstream out(node.getPath().c_str(), ios::out | ios::binary);
819
 
  if(out.is_open() && myConsole.cartridge().save(out))
820
 
    return node.getShortPath();
821
 
  else
822
 
    return "";
823
 
}
824
 
 
825
 
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
826
810
void Debugger::lockBankswitchState()
827
811
{
828
812
  mySystem.lockDataBus();