Added beginning of CheatWidget, which will be used for searching a memory

location for a certain value (ie, finding out which location holds # of lives).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@486 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-06-12 20:12:10 +00:00
parent fd82d749ec
commit 58ef675a78
6 changed files with 129 additions and 50 deletions

View File

@ -13,7 +13,7 @@
## See the file "license" for information on usage and redistribution of
## this file, and for a DISCLAIMER OF ALL WARRANTIES.
##
## $Id: makefile,v 1.92 2005-06-12 18:18:42 stephena Exp $
## $Id: makefile,v 1.93 2005-06-12 20:12:10 stephena Exp $
##============================================================================
##============================================================================
@ -161,7 +161,7 @@ GUI_OBJS = Font.o Menu.o Launcher.o \
EventMappingDialog.o GameInfoDialog.o HelpDialog.o AboutDialog.o \
LauncherDialog.o LauncherOptionsDialog.o BrowserDialog.o GameList.o \
ProgressDialog.o \
DebuggerDialog.o PromptWidget.o
DebuggerDialog.o PromptWidget.o CheatWidget.o
DBG_OBJS = Debugger.o DebuggerParser.o
@ -455,6 +455,9 @@ DebuggerDialog.o: $(GUI)/DebuggerDialog.cxx $(GUI)/DebuggerDialog.hxx
PromptWidget.o: $(GUI)/PromptWidget.cxx $(GUI)/PromptWidget.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(GUI)/PromptWidget.cxx
CheatWidget.o: $(GUI)/CheatWidget.cxx $(GUI)/CheatWidget.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(GUI)/CheatWidget.cxx
Debugger.o: $(DBG)/Debugger.cxx $(DBG)/Debugger.hxx
$(CXX) -c $(FLAGS) $(OPTIONS) $(LDFLAGS) $(DBG)/Debugger.cxx

View File

@ -0,0 +1,69 @@
//============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
// SS tttttt eeee ll ll aaaa
// SSSS tt ee ee ll ll aa
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
// SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa
//
// Copyright (c) 1995-2005 by Bradford W. Mott
//
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: CheatWidget.cxx,v 1.1 2005-06-12 20:12:10 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
//============================================================================
#include "OSystem.hxx"
#include "FrameBuffer.hxx"
#include "GuiUtils.hxx"
#include "GuiObject.hxx"
#include "Widget.hxx"
#include "ListWidget.hxx"
#include "CheatWidget.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CheatWidget::CheatWidget(GuiObject* boss, int x, int y, int w, int h)
: Widget(boss, x, y, w, h),
CommandSender(boss)
{
ListWidget* myList = new ListWidget(boss, 10, 24, 100, h - 50);
myList->setTarget(this);
myList->setEditable(false);
myList->setNumberingMode(kListNumberingOff);
myActiveWidget = myList;
StringList l;
for (int i = 0; i < 10; ++i)
l.push_back("TESTING!!!");
myList->setList(l);
ListWidget* myList2 = new ListWidget(boss, 150, 24, 100, h - 70);
myList2->setTarget(this);
myList2->setEditable(false);
myList2->setNumberingMode(kListNumberingOff);
StringList l2;
for (int i = 0; i < 10; ++i)
l2.push_back("TESTING AGAIN!!!");
myList2->setList(l2);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CheatWidget::~CheatWidget()
{
cerr << "CheatWidget::~CheatWidget()\n";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CheatWidget::handleCommand(CommandSender* sender, int cmd, int data)
{
}

View File

@ -0,0 +1,44 @@
//============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
// SS tttttt eeee ll ll aaaa
// SSSS tt ee ee ll ll aa
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
// SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa
//
// Copyright (c) 1995-2005 by Bradford W. Mott
//
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: CheatWidget.hxx,v 1.1 2005-06-12 20:12:10 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
//============================================================================
#ifndef CHEAT_WIDGET_HXX
#define CHEAT_WIDGET_HXX
class GuiObject;
#include "Widget.hxx"
#include "Command.hxx"
class CheatWidget : public Widget, public CommandSender
{
public:
CheatWidget(GuiObject *boss, int x, int y, int w, int h);
virtual ~CheatWidget();
Widget* activeWidget() { return myActiveWidget; }
void handleCommand(CommandSender* sender, int cmd, int data);
private:
Widget* myActiveWidget;
};
#endif

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: DebuggerDialog.cxx,v 1.7 2005-06-10 17:46:06 stephena Exp $
// $Id: DebuggerDialog.cxx,v 1.8 2005-06-12 20:12:10 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -22,6 +22,8 @@
#include "TabWidget.hxx"
#include "ListWidget.hxx"
#include "PromptWidget.hxx"
#include "CheatWidget.hxx"
#include "DebuggerDialog.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -31,75 +33,37 @@ DebuggerDialog::DebuggerDialog(OSystem* osystem, DialogContainer* parent,
myTab(NULL)
{
const int vBorder = 4;
int yoffset;
// The tab widget
myTab = new TabWidget(this, 0, vBorder, _w, _h - vBorder - 1);
// 1) The Prompt/console tab
myTab->addTab("Prompt");
yoffset = vBorder;
PromptWidget* prompt = new PromptWidget(myTab, 2, 2,
_w - vBorder, _h - 25);
myTab->setActiveWidget(0, prompt);
// 2) The CPU tab
myTab->addTab("CPU");
yoffset = vBorder;
///////////////////// FIXME - just testing, will be removed
ListWidget* myList = new ListWidget(myTab, 10, 24, 100, _h - 24 - 26 - 10 - 10);
myList->setEditable(false);
myList->setNumberingMode(kListNumberingOff);
StringList l;
for (int i = 0; i < 10; ++i)
l.push_back("TESTING!!!");
myList->setList(l);
ListWidget* myList2 = new ListWidget(myTab, 150, 24, 100, _h - 24 - 26 - 10 - 10);
myList2->setEditable(false);
myList2->setNumberingMode(kListNumberingOff);
StringList l2;
for (int i = 0; i < 10; ++i)
l2.push_back("TESTING AGAIN!!!");
myList2->setList(l2);
ListWidget* myList3 = new ListWidget(myTab, 300, 24, 100, _h - 24 - 26 - 10 - 10);
myList3->setEditable(false);
myList3->setNumberingMode(kListNumberingOff);
StringList l3;
for (int i = 0; i < 10; ++i)
l3.push_back("CPU_TESTING!!!");
myList3->setList(l3);
myTab->setActiveWidget(1, myList);
/////////////////////////////
// 3) The RAM tab
myTab->addTab("RAM");
yoffset = vBorder;
// 4) The ROM tab
myTab->addTab("ROM");
yoffset = vBorder;
// 5) The TIA tab
myTab->addTab("TIA");
yoffset = vBorder;
// 6) The RAM tab
myTab->addTab("Code");
yoffset = vBorder;
// 6) The Cheat tab
myTab->addTab("Cheat");
CheatWidget* cheat = new CheatWidget(myTab, 2, 2,
_w - vBorder, _h - 25);
myTab->setActiveWidget(5, cheat->activeWidget());
// Set active tab to prompt
myTab->setActiveTab(0);

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: DebuggerDialog.hxx,v 1.5 2005-06-10 17:46:06 stephena Exp $
// $Id: DebuggerDialog.hxx,v 1.6 2005-06-12 20:12:10 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -39,7 +39,7 @@ class DebuggerDialog : public Dialog
virtual void handleKeyDown(int ascii, int keycode, int modifiers);
protected:
TabWidget* myTab;
TabWidget* myTab;
};
#endif

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: TabWidget.cxx,v 1.4 2005-06-10 17:46:06 stephena Exp $
// $Id: TabWidget.cxx,v 1.5 2005-06-12 20:12:10 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -35,7 +35,6 @@ enum {
kTabPadding = 3
};
//
Widget* GuiObject::_activeWidget;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -