2005-07-14 23:47:17 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
//
|
2010-01-10 02:58:28 +00:00
|
|
|
// Copyright (c) 1995-2010 by Bradford W. Mott and the Stella team
|
2005-07-14 23:47:17 +00:00
|
|
|
//
|
|
|
|
// See the file "license" for information on usage and redistribution of
|
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
2009-05-13 13:55:40 +00:00
|
|
|
// $Id$
|
2005-07-14 23:47:17 +00:00
|
|
|
//
|
|
|
|
// Based on code from ScummVM - Scumm Interpreter
|
|
|
|
// Copyright (C) 2002-2004 The ScummVM project
|
|
|
|
//============================================================================
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
#ifndef ROM_WIDGET_HXX
|
|
|
|
#define ROM_WIDGET_HXX
|
2005-07-14 23:47:17 +00:00
|
|
|
|
|
|
|
class GuiObject;
|
2005-10-13 18:53:07 +00:00
|
|
|
class DataGridWidget;
|
|
|
|
class EditTextWidget;
|
2005-10-06 17:28:55 +00:00
|
|
|
class InputTextDialog;
|
2005-08-30 17:51:26 +00:00
|
|
|
class RomListWidget;
|
|
|
|
class StringList;
|
2005-07-14 23:47:17 +00:00
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include "Array.hxx"
|
2005-07-14 23:47:17 +00:00
|
|
|
#include "Widget.hxx"
|
|
|
|
#include "Command.hxx"
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
typedef map<int,int> AddrToLine;
|
2005-07-14 23:47:17 +00:00
|
|
|
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
class RomWidget : public Widget, public CommandSender
|
|
|
|
{
|
2005-07-14 23:47:17 +00:00
|
|
|
public:
|
2005-08-30 17:51:26 +00:00
|
|
|
RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y);
|
|
|
|
virtual ~RomWidget();
|
|
|
|
|
2005-09-15 19:43:36 +00:00
|
|
|
void invalidate() { myListIsDirty = true; }
|
2005-08-30 17:51:26 +00:00
|
|
|
|
2005-09-15 19:43:36 +00:00
|
|
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
2005-08-30 17:51:26 +00:00
|
|
|
void loadConfig();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void initialUpdate();
|
2005-09-13 18:27:42 +00:00
|
|
|
void incrementalUpdate(int line, int rows);
|
2005-08-30 17:51:26 +00:00
|
|
|
|
2005-09-07 18:34:52 +00:00
|
|
|
void setBreak(int data);
|
|
|
|
void setPC(int data);
|
|
|
|
void patchROM(int data, const string& bytes);
|
2005-10-06 17:28:55 +00:00
|
|
|
void saveROM(const string& rom);
|
2005-09-07 18:34:52 +00:00
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
private:
|
2009-06-03 14:49:42 +00:00
|
|
|
enum {
|
|
|
|
kRomNameEntered = 'RWrn'
|
|
|
|
};
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
RomListWidget* myRomList;
|
|
|
|
|
|
|
|
/** List of addresses indexed by line number */
|
|
|
|
IntArray myAddrList;
|
|
|
|
|
|
|
|
/** List of line numbers indexed by address */
|
|
|
|
AddrToLine myLineList;
|
|
|
|
|
2005-10-13 18:53:07 +00:00
|
|
|
DataGridWidget* myBank;
|
|
|
|
EditTextWidget* myBankCount;
|
2005-10-06 17:28:55 +00:00
|
|
|
InputTextDialog* mySaveRom;
|
|
|
|
|
2005-09-15 19:43:36 +00:00
|
|
|
bool myListIsDirty;
|
2005-08-30 17:51:26 +00:00
|
|
|
bool mySourceAvailable;
|
|
|
|
int myCurrentBank;
|
2005-07-14 23:47:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|