Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e4d1b6ed9 | |||
| 9d16ed8ecb | |||
| 9d0845cdfd | |||
| 5b05f984f6 | |||
| 2fb63142d0 | |||
| be1bb585cd | |||
| cd6d736291 | |||
| b836d737e8 | |||
| 762ee8bc05 | |||
| 3dbaca7ab2 | |||
| 908b91a089 | |||
| 100aa7ddf4 | |||
| c8da511776 | |||
| ca17023731 | |||
| e1b64131c6 | |||
| c04c7c3ab3 | |||
| 4664d3938b | |||
| 928e8dd236 | |||
| 4557015e8a | |||
| d920cf5bcd | |||
| a57f29b422 | |||
| 616c53b8af | |||
| 68d95dff1f | |||
| d16d22bbb7 | |||
| c68737d8d8 | |||
| a741d48942 | |||
| 5071755194 | |||
| b324961640 | |||
| c050e06fde |
@@ -21,7 +21,7 @@
|
||||
|
||||
The following items are being tracked here because otherwise they'd be forgotten:
|
||||
|
||||
- [x] Add folders to project panel and support loading different file types (headers, etc.)
|
||||
- [X] Add folders to project panel and support loading different file types (headers, etc.)
|
||||
- [ ] Finish Code Editor lexer for syntax highlights.
|
||||
- It's still a bit buggy with highlighting numbers in label references.
|
||||
- It incorrectly comment-highlights ;'s in "'s.
|
||||
@@ -35,13 +35,13 @@ The following items are being tracked here because otherwise they'd be forgotten
|
||||
or because they were pulled in by the build.
|
||||
- [ ] Figure out how to adjust lines of errors, breakpoints, and symbol lookups...probably have to do background compilation.
|
||||
- [ ] Extend drag-drop capability to allow adding source files (use specified extensions to check) to a project.
|
||||
- [x] Project still does not get cleared out properly when a ROM is loaded after a project has been loaded. Saving the "project" overwrites it with crap.
|
||||
- [x] Execution Visualizer doesn't open file for address that's clicked on and doesn't bring that file to view in the project.
|
||||
- [x] Somehow tabs aren't being removed from the Window menu.
|
||||
- [X] Project still does not get cleared out properly when a ROM is loaded after a project has been loaded. Saving the "project" overwrites it with crap.
|
||||
- [X] Execution Visualizer doesn't open file for address that's clicked on and doesn't bring that file to view in the project.
|
||||
- [X] Somehow tabs aren't being removed from the Window menu.
|
||||
- [ ] Add option to automatically assign names of new elements added to a project based on what they are instead of asking all the time.
|
||||
- [x] Implement "modes" of the UI. "Coding" mode would close all opened debug windows and emulator windows, allowing most screen real-estate for coding. "Debugging". Alternatively this could just be a "remove clutter" button somewhere prominent in the UI that has the same effect.
|
||||
- [ ] Fix emulator window disappearing on project reload and debug mode switch.
|
||||
- [x] Limit symbol watch debug updates to only the symbols in the currently visible tab in the symbol watch window. Makes no sense to update the values of the RAM symbols if the watch tab is selected. Updating of symbols on a non-visible tab can be done in the tab change handler.
|
||||
- [X] Implement "modes" of the UI. "Coding" mode would close all opened debug windows and emulator windows, allowing most screen real-estate for coding. "Debugging". Alternatively this could just be a "remove clutter" button somewhere prominent in the UI that has the same effect.
|
||||
- [X] Fix emulator window disappearing on project reload and debug mode switch.
|
||||
- [X] Limit symbol watch debug updates to only the symbols in the currently visible tab in the symbol watch window. Makes no sense to update the values of the RAM symbols if the watch tab is selected. Updating of symbols on a non-visible tab can be done in the tab change handler.
|
||||
- [ ] Add OpenGL monospace font for overlays for Execution Visualizer, Code/Data Logger, maybe other viewers, and Emulator [with Lua capabilities?]
|
||||
- [ ] Rework CCC65Interface object so that it creates Symbol structures containing all of the relevant information for each symbol in easy-to-access means, rather than using individual CCC65Interface methods to retrieve different pieces of information about symbols all the time. The symbol structures can be built whenever a debug file is loaded, which is either when a project is loaded or when a compile is completed. CCC65Interface::captureDebugInfo.
|
||||
- [ ] Move linker config file into Project Browser folder. Project Properties can still specify the linker config file name, perhaps, but should not contain the linker config file content.
|
||||
@@ -55,7 +55,7 @@ or because they were pulled in by the build.
|
||||
- [ ] Editors should be detachable
|
||||
- [X] Some glitches in long term use, probably related to OpenGL misuse. Find an OpenGL debugger?
|
||||
This included some weird switching of contexts from one widget to another, such as from exevis to emu, etc.
|
||||
- [ ] Should have option to set both start/end of execution visualization markers with one command
|
||||
- [X] Should have option to set both start/end of execution visualization markers with one command
|
||||
- [X] Should have option to remove ALL breakpoints
|
||||
- [ ] Removing execution visualizer markers by line(s) of selected code only, not just ALL
|
||||
- [ ] Alpha-blend of execution markers on visual instead of replace
|
||||
|
||||
@@ -10,11 +10,15 @@ greaterThan(QT_MAJOR_VERSION,4) {
|
||||
QT += widgets
|
||||
}
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION,5) {
|
||||
QT += core5compat
|
||||
}
|
||||
|
||||
TOP = ../..
|
||||
|
||||
macx {
|
||||
QMAKE_MAC_SDK = macosx10.15
|
||||
}
|
||||
#macx {
|
||||
# QMAKE_MAC_SDK = macosx10.16
|
||||
#}
|
||||
|
||||
CONFIG(release, debug|release) {
|
||||
DESTDIR = release
|
||||
|
||||
@@ -11,11 +11,15 @@ greaterThan(QT_MAJOR_VERSION,4) {
|
||||
QT += widgets
|
||||
}
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION,5) {
|
||||
QT += core5compat
|
||||
}
|
||||
|
||||
TOP = ../..
|
||||
|
||||
macx {
|
||||
QMAKE_MAC_SDK = macosx10.15
|
||||
}
|
||||
#macx {
|
||||
# QMAKE_MAC_SDK = macosx10.16
|
||||
#}
|
||||
|
||||
CONFIG(release, debug|release) {
|
||||
DESTDIR = release
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<nesicideprojectaddon target="nes" version="0.3">
|
||||
<project>
|
||||
<primitives>
|
||||
<attributetables/>
|
||||
<tiles/>
|
||||
</primitives>
|
||||
<sources>
|
||||
<source path="famitone2.s" name="famitone2.s">
|
||||
<properties includeinbuild="0"/>
|
||||
</source>
|
||||
<source path="famitone2.inc" name="famitone2.inc">
|
||||
<properties includeinbuild="1"/>
|
||||
</source>
|
||||
</sources>
|
||||
<binaryfiles/>
|
||||
<graphicsbanks/>
|
||||
<sounds>
|
||||
<musics/>
|
||||
</sounds>
|
||||
</project>
|
||||
</nesicideprojectaddon>
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "appsettings.h"
|
||||
|
||||
AppSettings *AppSettings::_instance = NULL;
|
||||
|
||||
void AppSettings::setAppMode(AppMode mode)
|
||||
{
|
||||
m_appMode = mode;
|
||||
|
||||
+13
-2
@@ -7,7 +7,14 @@ class AppSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AppSettings(QObject* parent = 0) : QObject(parent) {};
|
||||
static AppSettings *instance()
|
||||
{
|
||||
if ( !_instance )
|
||||
{
|
||||
_instance = new AppSettings();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
virtual ~AppSettings() {};
|
||||
|
||||
// Accessors
|
||||
@@ -24,7 +31,11 @@ public:
|
||||
protected:
|
||||
// Settings data structures.
|
||||
AppMode m_appMode;
|
||||
|
||||
|
||||
private:
|
||||
static AppSettings *_instance;
|
||||
AppSettings(QObject* parent = 0) : QObject(parent) {};
|
||||
|
||||
signals:
|
||||
void appSettingsChanged();
|
||||
};
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "ccc65interface.h"
|
||||
#include "cnesicideproject.h"
|
||||
#include "main.h"
|
||||
|
||||
CMachineImageBuilder::CMachineImageBuilder()
|
||||
{
|
||||
@@ -41,7 +40,7 @@ bool CMachineImageBuilder::build()
|
||||
(CCC65Interface::instance()->getAssemblerSourcesFromProject().count()) ||
|
||||
(CCC65Interface::instance()->getCustomSourcesFromProject().count()) )
|
||||
{
|
||||
if ( !nesicideProject->getLinkerConfigFile().isEmpty() )
|
||||
if ( !CNesicideProject::instance()->getLinkerConfigFile().isEmpty() )
|
||||
{
|
||||
ok = sourceAssembler.assemble();
|
||||
if ( !ok )
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
|
||||
#include "ccc65interface.h"
|
||||
|
||||
#include "nes_emulator_core.h"
|
||||
#include "c64_emulator_core.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
C64EmulatorControl::C64EmulatorControl(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::C64EmulatorControl),
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
#include "emulatorprefsdialog.h"
|
||||
#include "cobjectregistry.h"
|
||||
#include "breakpointwatcherthread.h"
|
||||
#include "main.h"
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
#include "cbuildertextlogger.h"
|
||||
|
||||
static void breakpointHook ( void )
|
||||
{
|
||||
@@ -214,10 +216,10 @@ void C64EmulatorThread::resetEmulator()
|
||||
// Force hard-reset of the machine...
|
||||
c64EnableBreakpoints(false);
|
||||
|
||||
if ( nesicideProject->isInitialized() )
|
||||
if ( CNesicideProject::instance()->isInitialized() )
|
||||
{
|
||||
QDir dirProject(nesicideProject->getProjectOutputBasePath());
|
||||
QString fileName = dirProject.toNativeSeparators(dirProject.absoluteFilePath(nesicideProject->getProjectLinkerOutputName()));
|
||||
QDir dirProject(CNesicideProject::instance()->getProjectOutputBasePath());
|
||||
QString fileName = dirProject.toNativeSeparators(dirProject.absoluteFilePath(CNesicideProject::instance()->getProjectLinkerOutputName()));
|
||||
QString request;
|
||||
int addr;
|
||||
qDebug("C64EmulatorThread::resetEmulator ...%s...\n",fileName.toLatin1().data());
|
||||
|
||||
@@ -6,7 +6,7 @@ CDockWidgetRegistry *CDockWidgetRegistry::_instance = NULL;
|
||||
|
||||
CDockWidgetRegistry::CDockWidgetRegistry()
|
||||
{
|
||||
mutex = new QMutex(QMutex::Recursive);
|
||||
mutex = new QMutex(QMutex::NonRecursive);
|
||||
}
|
||||
|
||||
QWidget* CDockWidgetRegistry::getWidget(const QString& name)
|
||||
@@ -85,7 +85,10 @@ void CDockWidgetRegistry::restoreVisibility()
|
||||
{
|
||||
if ( settings.value(i.value()->widget->objectName()).toBool() )
|
||||
{
|
||||
// Widget show routines may try to access dock widget registry, so let them.
|
||||
mutex->unlock();
|
||||
i.value()->widget->show();
|
||||
mutex->lock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
#include "cdockwidgetregistry.h"
|
||||
#include "ccc65interface.h"
|
||||
|
||||
#include "cprojecttreeopenaction.h"
|
||||
#include "model/projectsearcher.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "environmentsettingsdialog.h"
|
||||
|
||||
#include <QToolButton>
|
||||
|
||||
@@ -18,6 +19,11 @@ CProjectTabWidget::CProjectTabWidget(QWidget *parent) :
|
||||
tabBar()->setVisible(EnvironmentSettingsDialog::useTabBarInEditorArea());
|
||||
}
|
||||
|
||||
void CProjectTabWidget::setProjectModel(CProjectModel *model)
|
||||
{
|
||||
m_pProjectModel = model;
|
||||
}
|
||||
|
||||
bool CProjectTabWidget::eventFilter(QObject *object, QEvent *event)
|
||||
{
|
||||
if ( object == tabBar() )
|
||||
@@ -51,11 +57,11 @@ void CProjectTabWidget::tabBar_contextMenuEvent(QContextMenuEvent *event)
|
||||
QMenu menu;
|
||||
|
||||
QString addToProjectText = "Add to ";
|
||||
addToProjectText += nesicideProject->getProjectTitle();
|
||||
addToProjectText += CNesicideProject::instance()->getProjectTitle();
|
||||
addToProjectText += " project...";
|
||||
|
||||
QString removeFromProjectText = "Remove from ";
|
||||
removeFromProjectText += nesicideProject->getProjectTitle();
|
||||
removeFromProjectText += CNesicideProject::instance()->getProjectTitle();
|
||||
removeFromProjectText += " project...";
|
||||
|
||||
QStringList extensions;
|
||||
@@ -84,7 +90,7 @@ void CProjectTabWidget::tabBar_contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
if ( fileName.endsWith(ext,Qt::CaseInsensitive) )
|
||||
{
|
||||
nesicideProject->getProject()->getSources()->addSourceFile(fileName);
|
||||
CNesicideProject::instance()->getProject()->getSources()->addSourceFile(fileName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -108,6 +114,8 @@ int CProjectTabWidget::addTab(QWidget *page, const QIcon &icon, const QString &l
|
||||
QObject::connect(editor,SIGNAL(markProjectDirty(bool)),this,SLOT(projectDirtied(bool)));
|
||||
QObject::connect(editor,SIGNAL(snapToTab(QString)),this,SLOT(snapToTab(QString)));
|
||||
QObject::connect(editor,SIGNAL(applyChanges(QString)),this,SLOT(applyChanges(QString)));
|
||||
QObject::connect(m_pProjectModel,SIGNAL(itemRemoved(QUuid)),editor,SLOT(itemRemoved(QUuid)));
|
||||
QObject::connect(m_pProjectModel,SIGNAL(itemAdded(QUuid)),editor,SLOT(itemAdded(QUuid)));
|
||||
QObject::connect(this,SIGNAL(snapTo(QString)),editor,SLOT(snapTo(QString)));
|
||||
QObject::connect(this,SIGNAL(applyChangesToTab(QString)),editor,SLOT(applyChangesToTab(QString)));
|
||||
QObject::connect(this,SIGNAL(applyProjectPropertiesToTab()),editor,SLOT(applyProjectPropertiesToTab()));
|
||||
@@ -242,7 +250,9 @@ void CProjectTabWidget::snapToTab(QString item)
|
||||
QStringList splits;
|
||||
uint32_t addr;
|
||||
uint32_t absAddr;
|
||||
QList<CSourceItem*> sources = ProjectSearcher::findItemsOfType<CSourceItem>(nesicideProject);
|
||||
QList<CSourceItem*> sources = ProjectSearcher::findItemsOfType<CSourceItem>(CNesicideProject::instance());
|
||||
QList<CGraphicsBank*> gfxBanks = ProjectSearcher::findItemsOfType<CGraphicsBank>(CNesicideProject::instance());
|
||||
QList<CTileStamp*> tileStamps = ProjectSearcher::findItemsOfType<CTileStamp>(CNesicideProject::instance());
|
||||
bool found = false;
|
||||
bool open = false;
|
||||
QDir dir;
|
||||
@@ -254,6 +264,7 @@ void CProjectTabWidget::snapToTab(QString item)
|
||||
QString symbol;
|
||||
CDesignerEditorBase* editor = NULL;
|
||||
|
||||
qDebug(item.toUtf8().data());
|
||||
// Make sure item is something we care about
|
||||
if ( item.startsWith("Address,") )
|
||||
{
|
||||
@@ -318,12 +329,8 @@ void CProjectTabWidget::snapToTab(QString item)
|
||||
// File is not open, search the project.
|
||||
if ( !found )
|
||||
{
|
||||
IProjectTreeViewItem* treeItem;
|
||||
treeItem = findProjectItem(uuid);
|
||||
if ( treeItem )
|
||||
{
|
||||
treeItem->openItemEvent(this);
|
||||
}
|
||||
CProjectTreeOpenAction action(this, m_pProjectModel);
|
||||
m_pProjectModel->visitDataItem(uuid, action);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,6 +372,32 @@ void CProjectTabWidget::snapToTab(QString item)
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( !found )
|
||||
{
|
||||
foreach ( CGraphicsBank* source, gfxBanks )
|
||||
{
|
||||
if ( source->caption() == file )
|
||||
{
|
||||
source->openItemEvent(this);
|
||||
found = true;
|
||||
open = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( !found )
|
||||
{
|
||||
foreach ( CTileStamp* source, tileStamps )
|
||||
{
|
||||
if ( source->caption() == file )
|
||||
{
|
||||
source->openItemEvent(this);
|
||||
found = true;
|
||||
open = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we got here we can't find the file in the project, search the project
|
||||
// directory.
|
||||
@@ -384,7 +417,7 @@ void CProjectTabWidget::snapToTab(QString item)
|
||||
// Search the source paths...
|
||||
if ( !found )
|
||||
{
|
||||
QStringList sourcePaths = nesicideProject->getSourceSearchPaths();
|
||||
QStringList sourcePaths = CNesicideProject::instance()->getSourceSearchPaths();
|
||||
|
||||
foreach ( QString searchDir, sourcePaths )
|
||||
{
|
||||
@@ -431,7 +464,7 @@ void CProjectTabWidget::snapToTab(QString item)
|
||||
{
|
||||
QFileInfo fileInfo(newDir);
|
||||
dir = projectDir.relativeFilePath(fileInfo.path());
|
||||
nesicideProject->addSourceSearchPath(dir.path());
|
||||
CNesicideProject::instance()->addSourceSearchPath(dir.path());
|
||||
filePath = dir.filePath(file);
|
||||
fileIn.setFileName(filePath);
|
||||
|
||||
@@ -489,6 +522,7 @@ void CProjectTabWidget::snapToTab(QString item)
|
||||
|
||||
void CProjectTabWidget::applyChanges(QString uuid)
|
||||
{
|
||||
qDebug("applyChanges: %s",uuid.toUtf8().data());
|
||||
emit applyChangesToTab(uuid);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <QToolBar>
|
||||
#include <QDockWidget>
|
||||
|
||||
#include "model/cprojectmodel.h"
|
||||
|
||||
// The IDE uses a system of signals named "snapTo" and "snapToTab" to
|
||||
// communicate information between various debuggers, IDE elements, or
|
||||
// designer forms when things change in the IDE environment that the
|
||||
@@ -36,7 +38,7 @@
|
||||
// As the snapTo usage is expanded I'll try to remember to document its usage
|
||||
// and formats here.
|
||||
//
|
||||
// snapTo formats: emit snapTo(<string>) where <string is one of:
|
||||
// snapTo formats: emit snapTo(<string>) where <string> is one of:
|
||||
// OutputPaneFile,<file>,<line>
|
||||
// Sent from the output pane in response to the user clicking on a line of
|
||||
// a search result or an error in a compile log. This tells the other IDE
|
||||
@@ -76,6 +78,8 @@ public:
|
||||
int addTab(QWidget *page, const QIcon &icon, const QString &label);
|
||||
void removeTab(int index);
|
||||
|
||||
void setProjectModel(CProjectModel* model);
|
||||
|
||||
protected:
|
||||
void tabBar_contextMenuEvent(QContextMenuEvent *event);
|
||||
void tabBar_mouseMoveEvent(QMouseEvent* event);
|
||||
@@ -113,7 +117,8 @@ public slots:
|
||||
void applyAppSettings();
|
||||
|
||||
protected:
|
||||
QMap<QString,QWidget*> tearOffs;
|
||||
QMap<QString,QWidget*> tearOffs;
|
||||
CProjectModel *m_pProjectModel;
|
||||
};
|
||||
|
||||
#endif // CPROJECTTABWIDGET_H
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "searcherthread.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "cbuildertextlogger.h"
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
SearcherWorker::SearcherWorker(QObject*)
|
||||
{
|
||||
@@ -25,7 +26,7 @@ void SearcherWorker::search(QDir dir, QString searchText, QString pattern, bool
|
||||
doSearch(m_dir,&m_found);
|
||||
if ( m_sourceSearchPaths )
|
||||
{
|
||||
foreach ( QString searchPath, nesicideProject->getSourceSearchPaths() )
|
||||
foreach ( QString searchPath, CNesicideProject::instance()->getSourceSearchPaths() )
|
||||
{
|
||||
m_dir = searchPath;
|
||||
doSearch(m_dir,&m_found);
|
||||
|
||||
@@ -3,12 +3,15 @@
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QCompleter>
|
||||
#include <QSettings>
|
||||
#include <QKeyEvent>
|
||||
#include <QLineEdit>
|
||||
|
||||
#include "searcherthread.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "cbuildertextlogger.h"
|
||||
|
||||
SearchWidget::SearchWidget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
|
||||
@@ -6,39 +6,45 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>758</width>
|
||||
<height>194</height>
|
||||
<width>675</width>
|
||||
<height>235</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>559</width>
|
||||
<height>155</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>524287</width>
|
||||
<height>524287</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="horizontalSpacing">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Search for:</string>
|
||||
</property>
|
||||
@@ -46,6 +52,12 @@
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="searchText">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -59,6 +71,12 @@
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Search in:</string>
|
||||
</property>
|
||||
@@ -69,7 +87,7 @@
|
||||
<item>
|
||||
<widget class="QComboBox" name="location">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -97,6 +115,12 @@
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Files of type:</string>
|
||||
</property>
|
||||
@@ -104,6 +128,12 @@
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="type">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@@ -116,6 +146,9 @@
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="spacing">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="find">
|
||||
<property name="text">
|
||||
@@ -150,13 +183,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="sourceSearchPaths">
|
||||
<property name="text">
|
||||
<string>Include Source Search Paths</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="subfolders">
|
||||
<property name="text">
|
||||
@@ -177,12 +203,21 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QCheckBox" name="sourceSearchPaths">
|
||||
<property name="text">
|
||||
<string>Include Source Search Paths</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../common/resource.qrc"/>
|
||||
<include location="../../../common/resource.qrc"/>
|
||||
<include location="../../../common/resource.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -35,12 +35,12 @@ SourceNavigator::~SourceNavigator()
|
||||
|
||||
void SourceNavigator::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
m_loadedTarget = target;
|
||||
|
||||
if ( emulator )
|
||||
if ( target.compare("none") )
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),this,SLOT(emulator_machineReady()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),this,SLOT(emulator_emulatorPaused(bool)));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),this,SLOT(emulator_emulatorPaused()));
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
|
||||
#include "model/projectsearcher.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "cbuildertextlogger.h"
|
||||
|
||||
#include "environmentsettingsdialog.h"
|
||||
|
||||
CCC65Interface *CCC65Interface::_instance = NULL;
|
||||
|
||||
@@ -62,7 +64,7 @@ QStringList CCC65Interface::getAssemblerSourcesFromProject()
|
||||
{
|
||||
QDir baseDir(QDir::currentPath());
|
||||
QStringList extensions = EnvironmentSettingsDialog::sourceExtensionsForAssembly().split(" ", QString::SkipEmptyParts);
|
||||
QList<CSourceItem*> projectSources = ProjectSearcher::findItemsOfType<CSourceItem>(nesicideProject);
|
||||
QList<CSourceItem*> projectSources = ProjectSearcher::findItemsOfType<CSourceItem>(CNesicideProject::instance());
|
||||
QStringList includedSources;
|
||||
|
||||
// For each source code object, compile it.
|
||||
@@ -87,7 +89,7 @@ QStringList CCC65Interface::getCLanguageSourcesFromProject()
|
||||
QStringList extensions = EnvironmentSettingsDialog::sourceExtensionsForC().split(" ", QString::SkipEmptyParts);
|
||||
QStringList headerExtensions = EnvironmentSettingsDialog::headerExtensions().split(" ", QString::SkipEmptyParts);
|
||||
bool add;
|
||||
QList<CSourceItem*> projectSources = ProjectSearcher::findItemsOfType<CSourceItem>(nesicideProject);
|
||||
QList<CSourceItem*> projectSources = ProjectSearcher::findItemsOfType<CSourceItem>(CNesicideProject::instance());
|
||||
QStringList includedSources;
|
||||
|
||||
// For each source code object, compile it.
|
||||
@@ -125,7 +127,7 @@ QStringList CCC65Interface::getCustomSourcesFromProject()
|
||||
QStringList extensions = EnvironmentSettingsDialog::customExtensions().split(" ", QString::SkipEmptyParts);
|
||||
QStringList headerExtensions = EnvironmentSettingsDialog::headerExtensions().split(" ", QString::SkipEmptyParts);
|
||||
bool add;
|
||||
QList<CSourceItem*> projectSources = ProjectSearcher::findItemsOfType<CSourceItem>(nesicideProject);
|
||||
QList<CSourceItem*> projectSources = ProjectSearcher::findItemsOfType<CSourceItem>(CNesicideProject::instance());
|
||||
QStringList includedSources;
|
||||
|
||||
// For each source code object, compile it.
|
||||
@@ -199,29 +201,29 @@ bool CCC65Interface::createMakefile()
|
||||
|
||||
// Replace stuff that needs to be replaced...
|
||||
makeFileContent.replace("<!target-machine!>",targetMachine);
|
||||
makeFileContent.replace("<!project-name!>",nesicideProject->getProjectOutputName());
|
||||
makeFileContent.replace("<!prg-rom-name!>",nesicideProject->getProjectLinkerOutputName());
|
||||
makeFileContent.replace("<!linker-config!>",nesicideProject->getLinkerConfigFile());
|
||||
makeFileContent.replace("<!compiler-flags!>",nesicideProject->getCompilerAdditionalOptions());
|
||||
makeFileContent.replace("<!compiler-include-paths!>",nesicideProject->getCompilerIncludePaths());
|
||||
makeFileContent.replace("<!compiler-defines!>",nesicideProject->getCompilerDefinedSymbols());
|
||||
makeFileContent.replace("<!assembler-flags!>",nesicideProject->getAssemblerAdditionalOptions());
|
||||
makeFileContent.replace("<!assembler-include-paths!>",nesicideProject->getAssemblerIncludePaths());
|
||||
makeFileContent.replace("<!assembler-defines!>",nesicideProject->getAssemblerDefinedSymbols());
|
||||
makeFileContent.replace("<!debug-file!>",nesicideProject->getProjectDebugInfoName());
|
||||
makeFileContent.replace("<!linker-flags!>",nesicideProject->getLinkerAdditionalOptions());
|
||||
makeFileContent.replace("<!project-name!>",CNesicideProject::instance()->getProjectOutputName());
|
||||
makeFileContent.replace("<!prg-rom-name!>",CNesicideProject::instance()->getProjectLinkerOutputName());
|
||||
makeFileContent.replace("<!linker-config!>",CNesicideProject::instance()->getLinkerConfigFile());
|
||||
makeFileContent.replace("<!compiler-flags!>",CNesicideProject::instance()->getCompilerAdditionalOptions());
|
||||
makeFileContent.replace("<!compiler-include-paths!>",CNesicideProject::instance()->getCompilerIncludePaths());
|
||||
makeFileContent.replace("<!compiler-defines!>",CNesicideProject::instance()->getCompilerDefinedSymbols());
|
||||
makeFileContent.replace("<!assembler-flags!>",CNesicideProject::instance()->getAssemblerAdditionalOptions());
|
||||
makeFileContent.replace("<!assembler-include-paths!>",CNesicideProject::instance()->getAssemblerIncludePaths());
|
||||
makeFileContent.replace("<!assembler-defines!>",CNesicideProject::instance()->getAssemblerDefinedSymbols());
|
||||
makeFileContent.replace("<!debug-file!>",CNesicideProject::instance()->getProjectDebugInfoName());
|
||||
makeFileContent.replace("<!linker-flags!>",CNesicideProject::instance()->getLinkerAdditionalOptions());
|
||||
makeFileContent.replace("<!source-dir!>",QDir::currentPath());
|
||||
makeFileContent.replace("<!object-dir!>",nesicideProject->getProjectOutputBasePath());
|
||||
makeFileContent.replace("<!prg-dir!>",nesicideProject->getProjectLinkerOutputBasePath());
|
||||
makeFileContent.replace("<!chr-dir!>",nesicideProject->getProjectCHRROMOutputBasePath());
|
||||
makeFileContent.replace("<!object-dir!>",CNesicideProject::instance()->getProjectOutputBasePath());
|
||||
makeFileContent.replace("<!prg-dir!>",CNesicideProject::instance()->getProjectLinkerOutputBasePath());
|
||||
makeFileContent.replace("<!chr-dir!>",CNesicideProject::instance()->getProjectCHRROMOutputBasePath());
|
||||
makeFileContent.replace("<!clang-sources!>",getCLanguageSourcesFromProject().join(" "));
|
||||
makeFileContent.replace("<!asm-sources!>",getAssemblerSourcesFromProject().join(" "));
|
||||
makeFileContent.replace("<!custom-sources!>",getCustomSourcesFromProject().join(" "));
|
||||
makeFileContent.replace("<!target-rules!>",targetRules);
|
||||
makeFileContent.replace("<!linker-dependencies!>",nesicideProject->getLinkerAdditionalDependencies());
|
||||
makeFileContent.replace("<!linker-dependencies!>",CNesicideProject::instance()->getLinkerAdditionalDependencies());
|
||||
|
||||
QString customRulesFiles;
|
||||
foreach ( QString customRuleFile,nesicideProject->getMakefileCustomRuleFiles() )
|
||||
foreach ( QString customRuleFile,CNesicideProject::instance()->getMakefileCustomRuleFiles() )
|
||||
{
|
||||
customRulesFiles += "-include "+customRuleFile+"\r\n";
|
||||
}
|
||||
@@ -371,7 +373,7 @@ bool CCC65Interface::assemble()
|
||||
QString invocationStr;
|
||||
QString stdioStr;
|
||||
QStringList stdioList;
|
||||
QDir outputDir(nesicideProject->getProjectLinkerOutputBasePath());
|
||||
QDir outputDir(CNesicideProject::instance()->getProjectLinkerOutputBasePath());
|
||||
QString outputName;
|
||||
int exitCode;
|
||||
bool ok = true;
|
||||
@@ -379,13 +381,13 @@ bool CCC65Interface::assemble()
|
||||
// Prevent overbuild
|
||||
protect.lock();
|
||||
|
||||
if ( nesicideProject->getProjectLinkerOutputName().isEmpty() )
|
||||
if ( CNesicideProject::instance()->getProjectLinkerOutputName().isEmpty() )
|
||||
{
|
||||
outputName = outputDir.fromNativeSeparators(outputDir.filePath(nesicideProject->getProjectOutputName()+".prg"));
|
||||
outputName = outputDir.fromNativeSeparators(outputDir.filePath(CNesicideProject::instance()->getProjectOutputName()+".prg"));
|
||||
}
|
||||
else
|
||||
{
|
||||
outputName = outputDir.fromNativeSeparators(outputDir.filePath(nesicideProject->getProjectLinkerOutputName()));
|
||||
outputName = outputDir.fromNativeSeparators(outputDir.filePath(CNesicideProject::instance()->getProjectLinkerOutputName()));
|
||||
}
|
||||
buildTextLogger->write("<b>Building: "+outputName+"</b>");
|
||||
|
||||
@@ -447,13 +449,13 @@ bool CCC65Interface::captureDebugInfo()
|
||||
QDir dir(QDir::currentPath());
|
||||
QString dbgInfoFile;
|
||||
|
||||
if ( nesicideProject->getProjectDebugInfoName().isEmpty() )
|
||||
if ( CNesicideProject::instance()->getProjectDebugInfoName().isEmpty() )
|
||||
{
|
||||
dbgInfoFile = dir.fromNativeSeparators(dir.relativeFilePath(nesicideProject->getProjectOutputName()+".dbg"));
|
||||
dbgInfoFile = dir.fromNativeSeparators(dir.relativeFilePath(CNesicideProject::instance()->getProjectOutputName()+".dbg"));
|
||||
}
|
||||
else
|
||||
{
|
||||
dbgInfoFile = dir.fromNativeSeparators(dir.relativeFilePath(nesicideProject->getProjectDebugInfoName()));
|
||||
dbgInfoFile = dir.fromNativeSeparators(dir.relativeFilePath(CNesicideProject::instance()->getProjectDebugInfoName()));
|
||||
}
|
||||
buildTextLogger->write("<font color='black'><b>Reading debug information from: "+dbgInfoFile+"</b></font>");
|
||||
|
||||
@@ -537,18 +539,18 @@ bool CCC65Interface::captureINESImage()
|
||||
QDir dir(QDir::currentPath());
|
||||
QString nesName;
|
||||
|
||||
if ( nesicideProject->getProjectCartridgeOutputName().isEmpty() )
|
||||
if ( CNesicideProject::instance()->getProjectCartridgeOutputName().isEmpty() )
|
||||
{
|
||||
nesName = dir.fromNativeSeparators(dir.relativeFilePath(nesicideProject->getProjectOutputName()+".nes"));
|
||||
nesName = dir.fromNativeSeparators(dir.relativeFilePath(CNesicideProject::instance()->getProjectOutputName()+".nes"));
|
||||
}
|
||||
else
|
||||
{
|
||||
nesName = dir.fromNativeSeparators(dir.relativeFilePath(nesicideProject->getProjectCartridgeOutputName()));
|
||||
nesName = dir.fromNativeSeparators(dir.relativeFilePath(CNesicideProject::instance()->getProjectCartridgeOutputName()));
|
||||
}
|
||||
|
||||
buildTextLogger->write("<font color='black'><b>Reading NES executable from: "+nesName+"</b></font>");
|
||||
|
||||
return nesicideProject->createProjectFromRom(nesName,true);
|
||||
return CNesicideProject::instance()->createProjectFromRom(nesName,true);
|
||||
}
|
||||
|
||||
QStringList CCC65Interface::getSourceFiles()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "ccartridgebuilder.h"
|
||||
#include "cmachineimagebuilder.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
CompilerWorker::CompilerWorker(QObject*)
|
||||
{
|
||||
@@ -20,11 +20,11 @@ void CompilerWorker::compile()
|
||||
CMachineImageBuilder machineImageBuilder;
|
||||
|
||||
emit compileStarted();
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
m_assembledOk = cartridgeBuilder.build();
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
m_assembledOk = machineImageBuilder.build();
|
||||
}
|
||||
@@ -37,11 +37,11 @@ void CompilerWorker::clean()
|
||||
CMachineImageBuilder machineImageBuilder;
|
||||
|
||||
emit cleanStarted();
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
cartridgeBuilder.clean();
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
machineImageBuilder.clean();
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
#include "ccc65interface.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
CSourceAssembler::CSourceAssembler()
|
||||
{
|
||||
}
|
||||
@@ -17,7 +15,7 @@ void CSourceAssembler::clean()
|
||||
|
||||
bool CSourceAssembler::assemble()
|
||||
{
|
||||
IProjectTreeViewItemIterator iter(nesicideProject);
|
||||
IProjectTreeViewItemIterator iter(CNesicideProject::instance());
|
||||
IProjectTreeViewItem* item;
|
||||
bool ok = true;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <QFileInfo>
|
||||
|
||||
#include "breakpointdialog.h"
|
||||
#include "ui_breakpointdialog.h"
|
||||
|
||||
@@ -8,12 +10,13 @@
|
||||
#include "dbg_cnesapu.h"
|
||||
|
||||
#include "compilerthread.h"
|
||||
#include "main.h"
|
||||
|
||||
#include "ccc65interface.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
BreakpointDialog::BreakpointDialog(CBreakpointInfo* pBreakpoints,int bp, QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::BreakpointDialog)
|
||||
@@ -27,7 +30,7 @@ BreakpointDialog::BreakpointDialog(CBreakpointInfo* pBreakpoints,int bp, QWidget
|
||||
ui->type->addItem("CPU Memory Read");
|
||||
ui->type->addItem("CPU Memory Write");
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
ui->type->addItem("CPU State");
|
||||
ui->type->addItem("CPU Event");
|
||||
@@ -54,14 +57,14 @@ BreakpointDialog::BreakpointDialog(CBreakpointInfo* pBreakpoints,int bp, QWidget
|
||||
|
||||
ui->enabled->setChecked(true);
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
ui->resolverWidget->setCurrentIndex(nesGetMapper()>0);
|
||||
ui->resolve->setChecked(false);
|
||||
ui->resolutions->addItem("N/A");
|
||||
ui->resolutions->setEnabled(false);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
ui->resolverWidget->setCurrentIndex(0);
|
||||
ui->resolve->setChecked(false);
|
||||
@@ -528,7 +531,7 @@ void BreakpointDialog::DisplayBreakpoint ( int idx )
|
||||
// Turn resolver on so it populates if the absolute address is known.
|
||||
// Only do this for NES platform until it is known whether it is needed
|
||||
// for other platforms.
|
||||
if ( (!nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive)) &&
|
||||
if ( (!CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive)) &&
|
||||
(pBreakpoint->item1Physical >= 0) )
|
||||
{
|
||||
ui->resolve->setChecked(true);
|
||||
@@ -694,7 +697,7 @@ void BreakpointDialog::on_addBreakpoint_clicked()
|
||||
else
|
||||
{
|
||||
// NES
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
// If the virtual address is in PRG-ROM space, convert it to physical for
|
||||
// the absolute address. Otherwise, the virtual *is* the physical address.
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
#include <QStandardItemModel>
|
||||
#include <QMenu>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QDragEnterEvent>
|
||||
#include <QDragMoveEvent>
|
||||
#include <QDropEvent>
|
||||
|
||||
#include "breakpointdockwidget.h"
|
||||
#include "ui_breakpointdockwidget.h"
|
||||
@@ -15,7 +20,7 @@
|
||||
|
||||
#include "ccc65interface.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "cnesicideproject.h"
|
||||
#include "cobjectregistry.h"
|
||||
|
||||
#include "nes_emulator_core.h"
|
||||
@@ -43,15 +48,15 @@ BreakpointDockWidget::~BreakpointDockWidget()
|
||||
delete model;
|
||||
}
|
||||
|
||||
void BreakpointDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void BreakpointDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),this,SLOT(updateData()) );
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),model,SLOT(update()));
|
||||
if ( emulator )
|
||||
if ( target.compare("none") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),this,SLOT(updateData()) );
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),model,SLOT(update()));
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),model,SLOT(update()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),model,SLOT(update()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),model,SLOT(update()));
|
||||
@@ -112,7 +117,7 @@ void BreakpointDockWidget::showEvent(QShowEvent*)
|
||||
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("CPU RAM Inspector"));
|
||||
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Cartridge EXRAM Memory Inspector"));
|
||||
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
|
||||
@@ -129,7 +134,7 @@ void BreakpointDockWidget::showEvent(QShowEvent*)
|
||||
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("CPU RAM Inspector"));
|
||||
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),emulator, SLOT(breakpointsChanged()) );
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Cartridge EXRAM Memory Inspector"));
|
||||
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),emulator, SLOT(breakpointsChanged()) );
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
#include "breakpointwatcherthread.h"
|
||||
|
||||
#include <QSemaphore>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "main.h"
|
||||
#include "cbreakpointinfo.h"
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
#include "nes_emulator_core.h"
|
||||
#include "c64_emulator_core.h"
|
||||
|
||||
#include "cbuildertextlogger.h"
|
||||
|
||||
#include "outputpanedockwidget.h"
|
||||
|
||||
BreakpointWatcherWorker::BreakpointWatcherWorker(QObject*)
|
||||
{
|
||||
@@ -19,11 +26,11 @@ void BreakpointWatcherWorker::breakpoint()
|
||||
int idx;
|
||||
char hitMsg [ 512 ];
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
pBreakpoints = nesGetBreakpointDatabase();
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
pBreakpoints = c64GetBreakpointDatabase();
|
||||
}
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
#include <QIcon>
|
||||
#include <QMimeData>
|
||||
|
||||
static char modelStringBuffer [ 2048 ];
|
||||
|
||||
static const char* CLICK_TO_ADD_OR_EDIT = "<click to add or edit>";
|
||||
|
||||
CBreakpointDisplayModel::CBreakpointDisplayModel(CBreakpointInfo* pBreakpoints,QObject*)
|
||||
{
|
||||
m_pBreakpoints = pBreakpoints;
|
||||
m_modelStringBuffer = new char[256];
|
||||
}
|
||||
|
||||
CBreakpointDisplayModel::~CBreakpointDisplayModel()
|
||||
{
|
||||
delete [] m_modelStringBuffer;
|
||||
}
|
||||
|
||||
Qt::ItemFlags CBreakpointDisplayModel::flags(const QModelIndex& /*index*/) const
|
||||
@@ -63,8 +63,8 @@ QVariant CBreakpointDisplayModel::data(const QModelIndex& index, int role) const
|
||||
return QVariant();
|
||||
break;
|
||||
case 1:
|
||||
m_pBreakpoints->GetPrintable(index.row(),modelStringBuffer);
|
||||
return QVariant(modelStringBuffer);
|
||||
m_pBreakpoints->GetPrintable(index.row(),m_modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@ public:
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
|
||||
private:
|
||||
CBreakpointInfo* m_pBreakpoints;
|
||||
CBreakpointInfo *m_pBreakpoints;
|
||||
char *m_modelStringBuffer;
|
||||
|
||||
public slots:
|
||||
void update();
|
||||
|
||||
@@ -14,22 +14,20 @@
|
||||
|
||||
#include "cmarker.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include "nes_emulator_core.h"
|
||||
#include "c64_emulator_core.h"
|
||||
|
||||
#include <QIcon>
|
||||
|
||||
static char modelStringBuffer [ 2048 ];
|
||||
|
||||
CCodeBrowserDisplayModel::CCodeBrowserDisplayModel(CBreakpointInfo* pBreakpoints,QObject*)
|
||||
{
|
||||
m_pBreakpoints = pBreakpoints;
|
||||
m_modelStringBuffer = new char[2048];
|
||||
}
|
||||
|
||||
CCodeBrowserDisplayModel::~CCodeBrowserDisplayModel()
|
||||
{
|
||||
delete [] m_modelStringBuffer;
|
||||
}
|
||||
|
||||
QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) const
|
||||
@@ -47,7 +45,7 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
|
||||
uint32_t operand2;
|
||||
uint32_t pc;
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
physAddr = nesGetPhysicalAddressFromAddress(addr);
|
||||
opcode = nesGetMemory(addr);
|
||||
@@ -55,7 +53,7 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
|
||||
operand2 = nesGetMemory(addr+2);
|
||||
pc = nesGetCPUProgramCounterOfLastSync();
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
physAddr = c64GetPhysicalAddressFromAddress(addr);
|
||||
opcode = c64GetMemory(addr);
|
||||
@@ -72,15 +70,15 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
|
||||
{
|
||||
if ( index.column() == CodeBrowserCol_Disassembly )
|
||||
{
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
CNESDBG::CODEBROWSERTOOLTIP(TOOLTIP_INFO,addr,modelStringBuffer);
|
||||
CNESDBG::CODEBROWSERTOOLTIP(TOOLTIP_INFO,addr,m_modelStringBuffer);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
CC64DBG::CODEBROWSERTOOLTIP(TOOLTIP_INFO,addr,modelStringBuffer);
|
||||
CC64DBG::CODEBROWSERTOOLTIP(TOOLTIP_INFO,addr,m_modelStringBuffer);
|
||||
}
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
else if ( index.column() > CodeBrowserCol_Address )
|
||||
{
|
||||
@@ -88,15 +86,15 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
|
||||
|
||||
if ( opSize > (index.column()-CodeBrowserCol_Opcode) )
|
||||
{
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
CNESDBG::CODEBROWSERTOOLTIP(TOOLTIP_BYTES,addr+(index.column()-CodeBrowserCol_Opcode),modelStringBuffer);
|
||||
CNESDBG::CODEBROWSERTOOLTIP(TOOLTIP_BYTES,addr+(index.column()-CodeBrowserCol_Opcode),m_modelStringBuffer);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
CC64DBG::CODEBROWSERTOOLTIP(TOOLTIP_BYTES,addr+(index.column()-CodeBrowserCol_Opcode),modelStringBuffer);
|
||||
CC64DBG::CODEBROWSERTOOLTIP(TOOLTIP_BYTES,addr+(index.column()-CodeBrowserCol_Opcode),m_modelStringBuffer);
|
||||
}
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,30 +178,30 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
|
||||
switch ( index.column() )
|
||||
{
|
||||
case CodeBrowserCol_Address:
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesGetPrintableAddress(modelStringBuffer,addr);
|
||||
nesGetPrintableAddress(m_modelStringBuffer,addr);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
c64GetPrintableAddress(modelStringBuffer,addr);
|
||||
c64GetPrintableAddress(m_modelStringBuffer,addr);
|
||||
}
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
break;
|
||||
case CodeBrowserCol_Decoration:
|
||||
return QVariant();
|
||||
break;
|
||||
case CodeBrowserCol_Opcode:
|
||||
sprintf ( modelStringBuffer, "%02X", opcode );
|
||||
return QVariant(modelStringBuffer);
|
||||
sprintf ( m_modelStringBuffer, "%02X", opcode );
|
||||
return QVariant(m_modelStringBuffer);
|
||||
break;
|
||||
case CodeBrowserCol_Operand1:
|
||||
opSize = OPCODESIZE ( opcode );
|
||||
|
||||
if ( 1 < opSize )
|
||||
{
|
||||
sprintf ( modelStringBuffer, "%02X", operand1 );
|
||||
return QVariant(modelStringBuffer);
|
||||
sprintf ( m_modelStringBuffer, "%02X", operand1 );
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -212,17 +210,17 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
|
||||
|
||||
if ( 2 < opSize )
|
||||
{
|
||||
sprintf ( modelStringBuffer, "%02X", operand2 );
|
||||
return QVariant(modelStringBuffer);
|
||||
sprintf ( m_modelStringBuffer, "%02X", operand2 );
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
|
||||
break;
|
||||
case CodeBrowserCol_Disassembly:
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
return nesGetDisassemblyAtAddress(addr);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
return c64GetDisassemblyAtAddress(addr);
|
||||
}
|
||||
@@ -249,11 +247,11 @@ QVariant CCodeBrowserDisplayModel::headerData(int section, Qt::Orientation orien
|
||||
switch ( section )
|
||||
{
|
||||
case CodeBrowserCol_Address:
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
return "Address in 6502 memory space and (Mapper Bank:Offset)";
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
return "Address in 6502 memory space";
|
||||
}
|
||||
@@ -314,11 +312,11 @@ QModelIndex CCodeBrowserDisplayModel::index(int row, int column, const QModelInd
|
||||
|
||||
if ( (row >= 0) && (column >= 0) )
|
||||
{
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
physAddr = nesGetVirtualAddressFromSLOC(row);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
physAddr = c64GetAddressFromSLOC(row);
|
||||
}
|
||||
@@ -333,12 +331,12 @@ int CCodeBrowserDisplayModel::rowCount(const QModelIndex&) const
|
||||
{
|
||||
unsigned int rows = 0;
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
// Get the source-lines-of-code count from RAM/SRAM/EXRAM/PRG-ROM that is currently visible to the CPU...
|
||||
rows = nesGetSLOC(nesGetCPUProgramCounterOfLastSync());
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
// Get the source-lines-of-code count from RAM/SRAM/EXRAM/PRG-ROM that is currently visible to the CPU...
|
||||
rows = c64GetSLOC(c64GetCPURegister(CPU_PC));
|
||||
@@ -360,11 +358,11 @@ int CCodeBrowserDisplayModel::columnCount(const QModelIndex& parent) const
|
||||
void CCodeBrowserDisplayModel::update()
|
||||
{
|
||||
// Update display...
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesDisassemble();
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
c64Disassemble();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,8 @@ public:
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
|
||||
private:
|
||||
CBreakpointInfo* m_pBreakpoints;
|
||||
CBreakpointInfo *m_pBreakpoints;
|
||||
char *m_modelStringBuffer;
|
||||
|
||||
public slots:
|
||||
void update(void);
|
||||
|
||||
@@ -21,6 +21,7 @@ signals:
|
||||
|
||||
public slots:
|
||||
void snapToHandler(QString item) {};
|
||||
void applyEnvironmentSettings() {};
|
||||
|
||||
protected:
|
||||
NesStateSnapshot m_nesState;
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
#include "cdebuggerbitfielddisplaymodel.h"
|
||||
|
||||
static char modelStringBuffer [ 2048 ];
|
||||
|
||||
CDebuggerBitfieldDisplayModel::CDebuggerBitfieldDisplayModel(regDBFunc regDB,QObject*)
|
||||
{
|
||||
m_regDB = regDB;
|
||||
m_register = 0;
|
||||
m_modelStringBuffer = new char[512];
|
||||
}
|
||||
|
||||
CDebuggerBitfieldDisplayModel::~CDebuggerBitfieldDisplayModel()
|
||||
{
|
||||
delete [] m_modelStringBuffer;
|
||||
}
|
||||
|
||||
QVariant CDebuggerBitfieldDisplayModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
char* pValues = modelStringBuffer;
|
||||
char* pValues = m_modelStringBuffer;
|
||||
int value;
|
||||
|
||||
if (!index.isValid())
|
||||
@@ -50,7 +50,7 @@ QVariant CDebuggerBitfieldDisplayModel::data(const QModelIndex& index, int role)
|
||||
}
|
||||
|
||||
pValues += sprintf ( pValues, "</pre>" );
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,19 +58,19 @@ QVariant CDebuggerBitfieldDisplayModel::data(const QModelIndex& index, int role)
|
||||
{
|
||||
if ( pBitfield->GetNumValues() )
|
||||
{
|
||||
sprintf ( modelStringBuffer, "%s", pBitfield->GetValue(regData) );
|
||||
sprintf ( m_modelStringBuffer, "%s", pBitfield->GetValue(regData) );
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf ( modelStringBuffer, pBitfield->GetDisplayFormat(), pBitfield->GetValueRaw(regData) );
|
||||
sprintf ( m_modelStringBuffer, pBitfield->GetDisplayFormat(), pBitfield->GetValueRaw(regData) );
|
||||
}
|
||||
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
else if ( role == Qt::EditRole )
|
||||
{
|
||||
sprintf ( modelStringBuffer, pBitfield->GetDisplayFormat(), regData );
|
||||
return QVariant(modelStringBuffer);
|
||||
sprintf ( m_modelStringBuffer, pBitfield->GetDisplayFormat(), regData );
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
@@ -91,7 +91,7 @@ QVariant CDebuggerBitfieldDisplayModel::headerData(int section, Qt::Orientation
|
||||
|
||||
if ( orientation == Qt::Horizontal )
|
||||
{
|
||||
sprintf ( modelStringBuffer, "Value" );
|
||||
sprintf ( m_modelStringBuffer, "Value" );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -101,16 +101,16 @@ QVariant CDebuggerBitfieldDisplayModel::headerData(int section, Qt::Orientation
|
||||
|
||||
if ( pBitfield->GetWidth() == 1 )
|
||||
{
|
||||
sprintf ( modelStringBuffer, "[%d] %s", pBitfield->GetLsb(), pBitfield->GetName() );
|
||||
sprintf ( m_modelStringBuffer, "[%d] %s", pBitfield->GetLsb(), pBitfield->GetName() );
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf ( modelStringBuffer, "[%d:%d] %s", pBitfield->GetMsb(), pBitfield->GetLsb(), pBitfield->GetName() );
|
||||
sprintf ( m_modelStringBuffer, "[%d:%d] %s", pBitfield->GetMsb(), pBitfield->GetLsb(), pBitfield->GetName() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
|
||||
bool CDebuggerBitfieldDisplayModel::setData ( const QModelIndex& index, const QVariant& value, int )
|
||||
|
||||
@@ -29,8 +29,9 @@ public slots:
|
||||
void update(void);
|
||||
|
||||
private:
|
||||
regDBFunc m_regDB;
|
||||
int m_register;
|
||||
regDBFunc m_regDB;
|
||||
int m_register;
|
||||
char *m_modelStringBuffer;
|
||||
};
|
||||
|
||||
#endif // CDEBUGGERBITFIELDDISPLAYMODEL_H
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
|
||||
#include "ccodedatalogger.h"
|
||||
|
||||
static char modelStringBuffer [ 2048 ];
|
||||
|
||||
CDebuggerCodeProfilerModel::CDebuggerCodeProfilerModel(QObject *parent) :
|
||||
QAbstractTableModel(parent)
|
||||
{
|
||||
m_currentSortColumn = CodeProfilerCol_Symbol;
|
||||
m_currentSortOrder = Qt::DescendingOrder;
|
||||
m_currentItemCount = 0;
|
||||
m_modelStringBuffer = new char[32];
|
||||
}
|
||||
|
||||
CDebuggerCodeProfilerModel::~CDebuggerCodeProfilerModel()
|
||||
{
|
||||
delete [] m_modelStringBuffer;
|
||||
}
|
||||
|
||||
Qt::ItemFlags CDebuggerCodeProfilerModel::flags(const QModelIndex& index) const
|
||||
@@ -174,8 +174,8 @@ void CDebuggerCodeProfilerModel::update()
|
||||
item.file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
|
||||
fileInfo.setFile(item.file);
|
||||
|
||||
nesGetPrintablePhysicalAddress(modelStringBuffer,addr,absAddr);
|
||||
item.address = modelStringBuffer;
|
||||
nesGetPrintablePhysicalAddress(m_modelStringBuffer,addr,absAddr);
|
||||
item.address = m_modelStringBuffer;
|
||||
item.count = pLogger->GetCount(addr&mask);
|
||||
if ( !m_items.contains(item) )
|
||||
{
|
||||
|
||||
@@ -57,10 +57,11 @@ public slots:
|
||||
void sort(int column, Qt::SortOrder order);
|
||||
|
||||
private:
|
||||
QList<ProfiledItem> m_items;
|
||||
int m_currentSortColumn;
|
||||
Qt::SortOrder m_currentSortOrder;
|
||||
int m_currentItemCount;
|
||||
QList<ProfiledItem> m_items;
|
||||
int m_currentSortColumn;
|
||||
Qt::SortOrder m_currentSortOrder;
|
||||
int m_currentItemCount;
|
||||
char *m_modelStringBuffer;
|
||||
};
|
||||
|
||||
#endif // CDEBUGGERCODEPROFILERMODEL_H
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#include "dbg_cnes.h"
|
||||
#include "dbg_cnes6502.h"
|
||||
|
||||
static char modelStringBuffer [ 2048 ];
|
||||
|
||||
void GetPrintable ( TracerInfo* pSample, int subItem, char* str );
|
||||
|
||||
CDebuggerExecutionTracerModel::CDebuggerExecutionTracerModel(QObject*)
|
||||
@@ -12,10 +10,12 @@ CDebuggerExecutionTracerModel::CDebuggerExecutionTracerModel(QObject*)
|
||||
m_pTracer = nesGetExecutionTracerDatabase();
|
||||
m_bShowCPU = true;
|
||||
m_bShowPPU = true;
|
||||
m_modelStringBuffer = new char[256];
|
||||
}
|
||||
|
||||
CDebuggerExecutionTracerModel::~CDebuggerExecutionTracerModel()
|
||||
{
|
||||
delete [] m_modelStringBuffer;
|
||||
}
|
||||
|
||||
QVariant CDebuggerExecutionTracerModel::data(const QModelIndex& index, int role) const
|
||||
@@ -30,9 +30,9 @@ QVariant CDebuggerExecutionTracerModel::data(const QModelIndex& index, int role)
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
GetPrintable((TracerInfo*)index.internalPointer(), index.column(), modelStringBuffer);
|
||||
GetPrintable((TracerInfo*)index.internalPointer(), index.column(), m_modelStringBuffer);
|
||||
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
|
||||
Qt::ItemFlags CDebuggerExecutionTracerModel::flags(const QModelIndex&) const
|
||||
|
||||
@@ -25,9 +25,10 @@ public slots:
|
||||
void update();
|
||||
|
||||
private:
|
||||
CTracer* m_pTracer;
|
||||
bool m_bShowCPU;
|
||||
bool m_bShowPPU;
|
||||
CTracer *m_pTracer;
|
||||
bool m_bShowCPU;
|
||||
bool m_bShowPPU;
|
||||
char *m_modelStringBuffer;
|
||||
};
|
||||
|
||||
#endif // CDEBUGGEREXECUTIONTRACERMODEL_H
|
||||
|
||||
@@ -3,16 +3,17 @@
|
||||
#include <QColor>
|
||||
#include <QBrush>
|
||||
|
||||
static char modelStringBuffer [ 2048 ];
|
||||
|
||||
CDebuggerMemoryDisplayModel::CDebuggerMemoryDisplayModel(memDBFunc memDB,QObject*)
|
||||
{
|
||||
m_modelStringBuffer = new char[256];
|
||||
|
||||
m_memDBFunc = memDB;
|
||||
m_memDB = memDB();
|
||||
}
|
||||
|
||||
CDebuggerMemoryDisplayModel::~CDebuggerMemoryDisplayModel()
|
||||
{
|
||||
delete [] m_modelStringBuffer;
|
||||
}
|
||||
|
||||
int CDebuggerMemoryDisplayModel::memoryType() const
|
||||
@@ -84,10 +85,10 @@ QVariant CDebuggerMemoryDisplayModel::data(const QModelIndex& index, int role) c
|
||||
|
||||
if ( m_memDB )
|
||||
{
|
||||
sprintf(modelStringBuffer,"%02X",m_memDB->Get((index.row()*m_memDB->GetNumColumns())+index.column()));
|
||||
sprintf(m_modelStringBuffer,"%02X",m_memDB->Get((index.row()*m_memDB->GetNumColumns())+index.column()));
|
||||
}
|
||||
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
|
||||
Qt::ItemFlags CDebuggerMemoryDisplayModel::flags(const QModelIndex& /*index*/) const
|
||||
@@ -118,17 +119,17 @@ QVariant CDebuggerMemoryDisplayModel::headerData(int section, Qt::Orientation or
|
||||
|
||||
if ( orientation == Qt::Horizontal )
|
||||
{
|
||||
sprintf ( modelStringBuffer, "x%1X", section );
|
||||
sprintf ( m_modelStringBuffer, "x%1X", section );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_memDB )
|
||||
{
|
||||
m_memDB->GetRowHeading(modelStringBuffer,m_memDB->GetBase()+(section*m_memDB->GetNumColumns()));
|
||||
m_memDB->GetRowHeading(m_modelStringBuffer,m_memDB->GetBase()+(section*m_memDB->GetNumColumns()));
|
||||
}
|
||||
}
|
||||
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
|
||||
bool CDebuggerMemoryDisplayModel::setData ( const QModelIndex& index, const QVariant& value, int )
|
||||
|
||||
@@ -30,7 +30,8 @@ public slots:
|
||||
|
||||
private:
|
||||
memDBFunc m_memDBFunc;
|
||||
CMemoryDatabase* m_memDB;
|
||||
CMemoryDatabase *m_memDB;
|
||||
char *m_modelStringBuffer;
|
||||
};
|
||||
|
||||
#endif // CDEBUGGERMEMORYDISPLAYMODEL_H
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#include "cdebuggerregisterdisplaymodel.h"
|
||||
|
||||
static char modelStringBuffer [ 2048 ];
|
||||
|
||||
CDebuggerRegisterDisplayModel::CDebuggerRegisterDisplayModel(regDBFunc regDB,QObject*)
|
||||
{
|
||||
m_regDBFunc = regDB;
|
||||
m_regDB = regDB();
|
||||
m_modelStringBuffer = new char[128];
|
||||
}
|
||||
|
||||
CDebuggerRegisterDisplayModel::~CDebuggerRegisterDisplayModel()
|
||||
{
|
||||
delete [] m_modelStringBuffer;
|
||||
}
|
||||
|
||||
int CDebuggerRegisterDisplayModel::memoryType() const
|
||||
@@ -54,10 +54,10 @@ QVariant CDebuggerRegisterDisplayModel::data(const QModelIndex& index, int role)
|
||||
|
||||
if ( pRegister )
|
||||
{
|
||||
sprintf ( modelStringBuffer, "%02X", (int)pRegister->Get() );
|
||||
sprintf ( m_modelStringBuffer, "%02X", (int)pRegister->Get() );
|
||||
}
|
||||
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
|
||||
Qt::ItemFlags CDebuggerRegisterDisplayModel::flags(const QModelIndex& /*index*/) const
|
||||
@@ -81,7 +81,7 @@ QVariant CDebuggerRegisterDisplayModel::headerData(int section, Qt::Orientation
|
||||
if ( (section >= 0) &&
|
||||
(section <m_regDB->GetNumColumns()) )
|
||||
{
|
||||
sprintf(modelStringBuffer,m_regDB->GetColumnHeading(section));
|
||||
sprintf(m_modelStringBuffer,m_regDB->GetColumnHeading(section));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -89,12 +89,12 @@ QVariant CDebuggerRegisterDisplayModel::headerData(int section, Qt::Orientation
|
||||
if ( (section >= 0) &&
|
||||
(section < m_regDB->GetNumRows()) )
|
||||
{
|
||||
sprintf(modelStringBuffer,m_regDB->GetRowHeading(section));
|
||||
sprintf(m_modelStringBuffer,m_regDB->GetRowHeading(section));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
|
||||
bool CDebuggerRegisterDisplayModel::setData ( const QModelIndex& index, const QVariant& value, int )
|
||||
|
||||
@@ -30,7 +30,8 @@ public slots:
|
||||
|
||||
private:
|
||||
regDBFunc m_regDBFunc;
|
||||
CRegisterDatabase* m_regDB;
|
||||
CRegisterDatabase *m_regDB;
|
||||
char *m_modelStringBuffer;
|
||||
};
|
||||
|
||||
#endif // CDEBUGGERREGISTERDISPLAYMODEL_H
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include "cmarker.h"
|
||||
#include "nes_emulator_core.h"
|
||||
|
||||
static char modelStringBuffer [ 2048 ];
|
||||
|
||||
static const char* MARKER_NOT_STARTED = "No start set";
|
||||
static const char* MARKER_NOT_COMPLETED = "No end set";
|
||||
static const char* MARKER_NO_DATA = "No data";
|
||||
@@ -14,10 +12,12 @@ static const char* MARKER_NO_DATA = "No data";
|
||||
CExecutionMarkerDisplayModel::CExecutionMarkerDisplayModel(QObject *parent) :
|
||||
QAbstractTableModel(parent)
|
||||
{
|
||||
m_modelStringBuffer = new char[32];
|
||||
}
|
||||
|
||||
CExecutionMarkerDisplayModel::~CExecutionMarkerDisplayModel()
|
||||
{
|
||||
delete [] m_modelStringBuffer;
|
||||
}
|
||||
|
||||
Qt::ItemFlags CExecutionMarkerDisplayModel::flags(const QModelIndex& index) const
|
||||
@@ -66,13 +66,13 @@ QVariant CExecutionMarkerDisplayModel::data(const QModelIndex& index, int role)
|
||||
if ( (pMarker->startCpuCycle != MARKER_NOT_MARKED) &&
|
||||
(pMarker->endCpuCycle == MARKER_NOT_MARKED) )
|
||||
{
|
||||
sprintf(modelStringBuffer,"%d",nesGetCPUCycle()-pMarker->startCpuCycle);
|
||||
sprintf(m_modelStringBuffer,"%d",nesGetCPUCycle()-pMarker->startCpuCycle);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(modelStringBuffer,"%d",pMarker->curCpuCycles);
|
||||
sprintf(m_modelStringBuffer,"%d",pMarker->curCpuCycles);
|
||||
}
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -84,13 +84,13 @@ QVariant CExecutionMarkerDisplayModel::data(const QModelIndex& index, int role)
|
||||
{
|
||||
if ( pMarker->minCpuCycles == 0xFFFFFFFF )
|
||||
{
|
||||
sprintf(modelStringBuffer,"N/A");
|
||||
sprintf(m_modelStringBuffer,"N/A");
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(modelStringBuffer,"%d",pMarker->minCpuCycles);
|
||||
sprintf(m_modelStringBuffer,"%d",pMarker->minCpuCycles);
|
||||
}
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -102,13 +102,13 @@ QVariant CExecutionMarkerDisplayModel::data(const QModelIndex& index, int role)
|
||||
{
|
||||
if ( pMarker->maxCpuCycles == 0 )
|
||||
{
|
||||
sprintf(modelStringBuffer,"N/A");
|
||||
sprintf(m_modelStringBuffer,"N/A");
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(modelStringBuffer,"%d",pMarker->maxCpuCycles);
|
||||
sprintf(m_modelStringBuffer,"%d",pMarker->maxCpuCycles);
|
||||
}
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -118,10 +118,10 @@ QVariant CExecutionMarkerDisplayModel::data(const QModelIndex& index, int role)
|
||||
case ExecutionVisualizerCol_StartAddr:
|
||||
if ( pMarker->state >= eMarkerSet_Started )
|
||||
{
|
||||
nesGetPrintablePhysicalAddress(modelStringBuffer,
|
||||
nesGetPrintablePhysicalAddress(m_modelStringBuffer,
|
||||
pMarker->startAddr,
|
||||
pMarker->startAbsAddr);
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -131,10 +131,10 @@ QVariant CExecutionMarkerDisplayModel::data(const QModelIndex& index, int role)
|
||||
case ExecutionVisualizerCol_EndAddr:
|
||||
if ( pMarker->state >= eMarkerSet_Complete )
|
||||
{
|
||||
nesGetPrintablePhysicalAddress(modelStringBuffer,
|
||||
nesGetPrintablePhysicalAddress(m_modelStringBuffer,
|
||||
pMarker->endAddr,
|
||||
pMarker->endAbsAddr);
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ public slots:
|
||||
void update();
|
||||
|
||||
private:
|
||||
char *m_modelStringBuffer;
|
||||
};
|
||||
|
||||
#endif // CEXECUTIONMARKERDISPLAYMODEL_H
|
||||
|
||||
@@ -50,16 +50,15 @@ CodeBrowserDockWidget::~CodeBrowserDockWidget()
|
||||
|
||||
void CodeBrowserDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), assemblyViewModel, SLOT(update()) );
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(breakpointHit()) );
|
||||
|
||||
m_loadedTarget = target;
|
||||
|
||||
if ( emulator )
|
||||
if ( target.compare("none") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), assemblyViewModel, SLOT(update()) );
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(breakpointHit()) );
|
||||
QObject::connect ( emulator, SIGNAL(machineReady()), assemblyViewModel, SLOT(update()));
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), assemblyViewModel, SLOT(update()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), assemblyViewModel, SLOT(update()) );
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "ccodedatalogger.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
CodeProfilerDockWidget::CodeProfilerDockWidget(QWidget *parent) :
|
||||
CDebuggerBase(parent),
|
||||
@@ -39,14 +38,14 @@ CodeProfilerDockWidget::~CodeProfilerDockWidget()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void CodeProfilerDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void CodeProfilerDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),model,SLOT(update()));
|
||||
if ( emulator )
|
||||
if ( target.compare("none") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),model,SLOT(update()));
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),this,SLOT(on_clear_clicked()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),model,SLOT(update()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),model,SLOT(update()));
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include "ccc65interface.h"
|
||||
#include "nes_emulator_core.h"
|
||||
|
||||
static char modelStringBuffer [ 2048 ];
|
||||
|
||||
static const char* CLICK_TO_ADD_OR_EDIT = "<click to add or edit>";
|
||||
|
||||
CSymbolWatchModel::CSymbolWatchModel(bool editable,QObject *parent) :
|
||||
@@ -16,10 +14,12 @@ CSymbolWatchModel::CSymbolWatchModel(bool editable,QObject *parent) :
|
||||
m_currentSortOrder = Qt::DescendingOrder;
|
||||
m_currentItemCount = 0;
|
||||
m_editable = editable;
|
||||
m_modelStringBuffer = new char[126];
|
||||
}
|
||||
|
||||
CSymbolWatchModel::~CSymbolWatchModel()
|
||||
{
|
||||
delete [] m_modelStringBuffer;
|
||||
}
|
||||
|
||||
Qt::ItemFlags CSymbolWatchModel::flags(const QModelIndex& index) const
|
||||
@@ -69,8 +69,8 @@ QVariant CSymbolWatchModel::data(const QModelIndex& index, int role) const
|
||||
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(m_items.at(index.row()).symbol,symbolIdx);
|
||||
if ( addr != -1 )
|
||||
{
|
||||
nesGetPrintablePhysicalAddress(modelStringBuffer,addr,absAddr);
|
||||
return QVariant(modelStringBuffer);
|
||||
nesGetPrintablePhysicalAddress(m_modelStringBuffer,addr,absAddr);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -92,7 +92,7 @@ QVariant CSymbolWatchModel::data(const QModelIndex& index, int role) const
|
||||
addr = CCC65Interface::instance()->getSymbolAddress(m_items.at(index.row()).symbol,symbolIdx);
|
||||
if ( addr != -1 )
|
||||
{
|
||||
char* bufferPtr = modelStringBuffer;
|
||||
char* bufferPtr = m_modelStringBuffer;
|
||||
unsigned int symbolSize = CCC65Interface::instance()->getSymbolSize(m_items.at(index.row()).symbol,symbolIdx);
|
||||
|
||||
// If symbol size <= 10 print values as an array, seperated by commas
|
||||
@@ -122,7 +122,7 @@ QVariant CSymbolWatchModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
return QVariant("?");
|
||||
}
|
||||
return QVariant(modelStringBuffer);
|
||||
return QVariant(m_modelStringBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -331,8 +331,8 @@ int CSymbolWatchModel::resolveSymbol(QString text,int addr)
|
||||
|
||||
symbol = text;
|
||||
symbol += " @";
|
||||
nesGetPrintablePhysicalAddress(modelStringBuffer,checkAddr,absAddr);
|
||||
symbol += modelStringBuffer;
|
||||
nesGetPrintablePhysicalAddress(m_modelStringBuffer,checkAddr,absAddr);
|
||||
symbol += m_modelStringBuffer;
|
||||
symbol += " in ";
|
||||
symbol += symbolFile;
|
||||
symbols.append(symbol);
|
||||
|
||||
@@ -48,11 +48,12 @@ public slots:
|
||||
void sort(int column, Qt::SortOrder order);
|
||||
|
||||
private:
|
||||
QList<WatchedItem> m_items;
|
||||
int m_currentSortColumn;
|
||||
Qt::SortOrder m_currentSortOrder;
|
||||
int m_currentItemCount;
|
||||
bool m_editable;
|
||||
QList<WatchedItem> m_items;
|
||||
int m_currentSortColumn;
|
||||
Qt::SortOrder m_currentSortOrder;
|
||||
int m_currentItemCount;
|
||||
bool m_editable;
|
||||
char *m_modelStringBuffer;
|
||||
};
|
||||
|
||||
#endif // CSYMBOLWATCHMODEL_H
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "dbg_cnesppu.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
QThread *DebuggerUpdateThread::pThread = NULL;
|
||||
int DebuggerUpdateThread::resourceCount = -1;
|
||||
QMutex *DebuggerUpdateThread::pMutex = NULL;
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#include <QMenu>
|
||||
#include <QContextMenuEvent>
|
||||
|
||||
#include "executioninspectordockwidget.h"
|
||||
#include "ui_executioninspectordockwidget.h"
|
||||
|
||||
#include "dbg_cnes.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
ExecutionInspectorDockWidget::ExecutionInspectorDockWidget(QWidget *parent) :
|
||||
CDebuggerBase(parent),
|
||||
@@ -35,15 +37,15 @@ ExecutionInspectorDockWidget::~ExecutionInspectorDockWidget()
|
||||
delete model;
|
||||
}
|
||||
|
||||
void ExecutionInspectorDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void ExecutionInspectorDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateTracer()) );
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), model, SLOT(update()) );
|
||||
if ( emulator )
|
||||
if ( target.compare("none") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateTracer()) );
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), model, SLOT(update()) );
|
||||
QObject::connect ( emulator, SIGNAL(machineReady()), model, SLOT(update()));
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), model, SLOT(update()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(updateTracer()) );
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
#include <QMessageBox>
|
||||
#include <QMenu>
|
||||
#include <QContextMenuEvent>
|
||||
|
||||
#include "memoryinspectordockwidget.h"
|
||||
#include "ui_memoryinspectordockwidget.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
#include "environmentsettingsdialog.h"
|
||||
|
||||
#include "nes_emulator_core.h"
|
||||
#include "c64_emulator_core.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
MemoryInspectorDockWidget::MemoryInspectorDockWidget(memDBFunc memDB,CBreakpointInfo* pBreakpoints,QWidget *parent) :
|
||||
CDebuggerBase(parent),
|
||||
ui(new Ui::MemoryInspectorDockWidget)
|
||||
@@ -32,8 +34,29 @@ MemoryInspectorDockWidget::MemoryInspectorDockWidget(memDBFunc memDB,CBreakpoint
|
||||
ui->tableView->setFont(QFont("Consolas", 11));
|
||||
#endif
|
||||
|
||||
ui->tableView->resizeRowsToContents();
|
||||
|
||||
m_memDBFunc = memDB;
|
||||
m_memDB = memDB();
|
||||
|
||||
m_editor = new QHexEdit();
|
||||
|
||||
m_editor->setAddressAreaBackgroundColor(EnvironmentSettingsDialog::marginBackgroundColor());
|
||||
m_editor->setAddressAreaForegroundColor(EnvironmentSettingsDialog::marginForegroundColor());
|
||||
m_editor->setHexCaps(true);
|
||||
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
|
||||
m_editor->setFont(QFont("Monaco", 11));
|
||||
#endif
|
||||
#ifdef Q_OS_LINUX
|
||||
m_editor->setFont(QFont("Monospace", 10));
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
m_editor->setFont(QFont("Consolas", 11));
|
||||
#endif
|
||||
m_editor->setAddressOffset(m_memDB->GetBase());
|
||||
|
||||
//ui->gridLayout->addWidget(m_editor);
|
||||
}
|
||||
|
||||
MemoryInspectorDockWidget::~MemoryInspectorDockWidget()
|
||||
@@ -43,14 +66,14 @@ MemoryInspectorDockWidget::~MemoryInspectorDockWidget()
|
||||
delete delegate;
|
||||
}
|
||||
|
||||
void MemoryInspectorDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void MemoryInspectorDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateMemory()) );
|
||||
if ( emulator )
|
||||
if ( target.compare("none") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateMemory()) );
|
||||
QObject::connect ( emulator, SIGNAL(machineReady()), this, SLOT(updateMemory()));
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), this, SLOT(updateMemory()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(updateMemory()) );
|
||||
@@ -126,6 +149,16 @@ void MemoryInspectorDockWidget::updateMemory ()
|
||||
|
||||
m_memDB = m_memDBFunc();
|
||||
|
||||
// m_snapshot.clear();
|
||||
// for ( idx = 0; idx < m_memDB->GetSize(); idx++ )
|
||||
// {
|
||||
// m_snapshot += m_memDB->Get(idx);
|
||||
// }
|
||||
// qint64 cp = m_editor->cursorPosition();
|
||||
// m_editor->setData(m_snapshot);
|
||||
// m_editor->setCursorPosition(cp);
|
||||
// m_editor->ensureVisible();
|
||||
|
||||
// Check breakpoints for hits and highlight if necessary...
|
||||
for ( idx = 0; idx < m_pBreakpoints->GetNumBreakpoints(); idx++ )
|
||||
{
|
||||
@@ -317,3 +350,10 @@ void MemoryInspectorDockWidget::snapToHandler(QString item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MemoryInspectorDockWidget::applyEnvironmentSettings()
|
||||
{
|
||||
m_editor->setAddressAreaBackgroundColor(EnvironmentSettingsDialog::marginBackgroundColor());
|
||||
m_editor->setAddressAreaForegroundColor(EnvironmentSettingsDialog::marginForegroundColor());
|
||||
m_editor->update();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "cbreakpointinfo.h"
|
||||
|
||||
#include "qhexedit.h"
|
||||
|
||||
namespace Ui {
|
||||
class MemoryInspectorDockWidget;
|
||||
}
|
||||
@@ -31,6 +33,7 @@ public slots:
|
||||
void updateMemory();
|
||||
void updateTargetMachine(QString target);
|
||||
void snapToHandler(QString item);
|
||||
void applyEnvironmentSettings();
|
||||
|
||||
signals:
|
||||
void breakpointsChanged();
|
||||
@@ -42,6 +45,8 @@ private:
|
||||
CBreakpointInfo* m_pBreakpoints;
|
||||
memDBFunc m_memDBFunc;
|
||||
CMemoryDatabase* m_memDB;
|
||||
QHexEdit *m_editor;
|
||||
QByteArray m_snapshot;
|
||||
|
||||
private slots:
|
||||
void on_actionBreak_on_CPU_write_here_triggered();
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "dbg_cnesmappers.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
RegisterInspectorDockWidget::RegisterInspectorDockWidget(regDBFunc regDB,CBreakpointInfo* pBreakpoints,QWidget *parent) :
|
||||
CDebuggerBase(parent),
|
||||
@@ -57,14 +56,14 @@ RegisterInspectorDockWidget::~RegisterInspectorDockWidget()
|
||||
delete bitfieldDelegate;
|
||||
}
|
||||
|
||||
void RegisterInspectorDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void RegisterInspectorDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateMemory()) );
|
||||
if ( emulator )
|
||||
if ( target.compare("none") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateMemory()) );
|
||||
QObject::connect ( emulator, SIGNAL(machineReady()), this, SLOT(updateMemory()));
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), this, SLOT(updateMemory()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(updateMemory()) );
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
#include <QMessageBox>
|
||||
#include <QMenu>
|
||||
#include <QKeyEvent>
|
||||
#include <QDragEnterEvent>
|
||||
#include <QDragMoveEvent>
|
||||
#include <QDropEvent>
|
||||
#include <QContextMenuEvent>
|
||||
|
||||
#include "symbolwatchdockwidget.h"
|
||||
#include "ui_symbolwatchdockwidget.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
#include "ccc65interface.h"
|
||||
|
||||
@@ -231,11 +238,11 @@ void SymbolWatchDockWidget::updateTargetMachine(QString target)
|
||||
createC64Ui();
|
||||
}
|
||||
|
||||
QObject::connect(compiler,SIGNAL(compileDone(bool)),this,SLOT(updateVariables()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),watchModel,SLOT(update()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),ramModel,SLOT(update()));
|
||||
if ( emulator )
|
||||
if ( target.compare("none") )
|
||||
{
|
||||
QObject::connect(compiler,SIGNAL(compileDone(bool)),this,SLOT(updateVariables()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),watchModel,SLOT(update()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),ramModel,SLOT(update()));
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),watchModel,SLOT(update()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),watchModel,SLOT(update()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),watchModel,SLOT(update()));
|
||||
@@ -244,7 +251,6 @@ void SymbolWatchDockWidget::updateTargetMachine(QString target)
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),ramModel,SLOT(update()));
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),this,SLOT(updateVariables()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SymbolWatchDockWidget::updateUi()
|
||||
|
||||
@@ -35,6 +35,8 @@ public slots:
|
||||
virtual void applyEnvironmentSettingsToTab() {}
|
||||
virtual void applyAppSettingsToTab() {}
|
||||
virtual void checkOpenFile(QDateTime /*lastActivationTime*/) {}
|
||||
virtual void itemAdded(QUuid /*uuid*/) {}
|
||||
virtual void itemRemoved(QUuid /*uuid*/) {}
|
||||
|
||||
signals:
|
||||
void editor_modified(bool m);
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
#include <QAction>
|
||||
#include <QPixmap>
|
||||
#include <QStringList>
|
||||
#include <QSettings>
|
||||
#include <QDir>
|
||||
|
||||
#include "Qsci/qsciscintillabase.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
#include "ccc65interface.h"
|
||||
|
||||
@@ -21,6 +22,14 @@
|
||||
#include "cbreakpointinfo.h"
|
||||
#include "cmarker.h"
|
||||
|
||||
#include "cnesicideproject.h"
|
||||
#include "csourceitem.h"
|
||||
|
||||
#include "nes_emulator_core.h"
|
||||
#include "c64_emulator_core.h"
|
||||
|
||||
#include "environmentsettingsdialog.h"
|
||||
|
||||
static char toolTipText [ 2048 ];
|
||||
static char annotationBuffer [ 2048 ];
|
||||
static char resolutionBuffer [ 2048 ];
|
||||
@@ -129,7 +138,7 @@ CodeEditorForm::CodeEditorForm(QString fileName,QString sourceCode,IProjectTreeV
|
||||
QObject::connect ( this, SIGNAL(breakpointsChanged()), breakpoints, SIGNAL(breakpointsChanged()) );
|
||||
QObject::connect ( breakpoints, SIGNAL(breakpointsChanged()), this, SLOT(external_breakpointsChanged()) );
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
QObject::connect ( executionVisualizer, SIGNAL(breakpointsChanged()), this, SLOT(external_breakpointsChanged()) );
|
||||
}
|
||||
@@ -180,11 +189,11 @@ void CodeEditorForm::customContextMenuRequested(const QPoint &pos)
|
||||
QString symbol = m_scintilla->wordAtPoint(pos);
|
||||
QAction* action;
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
m_pBreakpoints = nesGetBreakpointDatabase();
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
m_pBreakpoints = c64GetBreakpointDatabase();
|
||||
}
|
||||
@@ -429,11 +438,11 @@ void CodeEditorForm::external_breakpointsChanged()
|
||||
int asmcount;
|
||||
int asmline;
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
m_pBreakpoints = nesGetBreakpointDatabase();
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
m_pBreakpoints = c64GetBreakpointDatabase();
|
||||
}
|
||||
@@ -579,11 +588,11 @@ void CodeEditorForm::editor_marginClicked(int margin,int line,Qt::KeyboardModifi
|
||||
int addr = 0;
|
||||
int absAddr = 0;
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
m_pBreakpoints = nesGetBreakpointDatabase();
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
m_pBreakpoints = c64GetBreakpointDatabase();
|
||||
}
|
||||
@@ -710,11 +719,11 @@ void CodeEditorForm::updateToolTip(QString symbol)
|
||||
if ( addr != 0xFFFFFFFF )
|
||||
{
|
||||
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(symbol);
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesGetPrintablePhysicalAddress(address,addr,absAddr);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
c64GetPrintablePhysicalAddress(address,addr,absAddr);
|
||||
}
|
||||
@@ -722,11 +731,11 @@ void CodeEditorForm::updateToolTip(QString symbol)
|
||||
file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
|
||||
line = CCC65Interface::instance()->getSourceLineFromFileAndSymbol(file,symbol);
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
sprintf(toolTipText,TOOLTIP_LABEL,symbol.toLatin1().constData(),file.toLatin1().constData(),line,address,nesGetMemory(addr));
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
sprintf(toolTipText,TOOLTIP_LABEL,symbol.toLatin1().constData(),file.toLatin1().constData(),line,address,c64GetMemory(addr));
|
||||
}
|
||||
@@ -747,11 +756,11 @@ void CodeEditorForm::setBreakpoint(int line, int addr, int absAddr)
|
||||
{
|
||||
int bpIdx;
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
m_pBreakpoints = nesGetBreakpointDatabase();
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
m_pBreakpoints = c64GetBreakpointDatabase();
|
||||
}
|
||||
@@ -1023,12 +1032,12 @@ void CodeEditorForm::resolveLineAddress(int line, int *addr, int *absAddr)
|
||||
(*addr) = CCC65Interface::instance()->getAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
(*absAddr) = CCC65Interface::instance()->getPhysicalAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesGetPrintablePhysicalAddress(resolutionBuffer,(*addr),(*absAddr));
|
||||
nesGetDisassemblyAtPhysicalAddress((*absAddr),resolutionBuffer);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
c64GetPrintablePhysicalAddress(resolutionBuffer,(*addr),(*absAddr));
|
||||
c64GetDisassemblyAtPhysicalAddress((*absAddr),resolutionBuffer);
|
||||
@@ -1111,11 +1120,11 @@ void CodeEditorForm::annotateText()
|
||||
{
|
||||
if ( CCC65Interface::instance()->isPhysicalAddressAnOpcode(absAddr) )
|
||||
{
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesGetDisassemblyAtPhysicalAddress(absAddr,disassembly);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
c64GetDisassemblyAtPhysicalAddress(absAddr,disassembly);
|
||||
}
|
||||
@@ -1127,11 +1136,11 @@ void CodeEditorForm::annotateText()
|
||||
}
|
||||
first = false;
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesGetPrintablePhysicalAddress(address,addr,absAddr);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
c64GetPrintablePhysicalAddress(address,addr,absAddr);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#include "cpropertyenumlistmodel.h"
|
||||
#include "cpropertyitem.h"
|
||||
|
||||
static char modelStringBuffer [ 2048 ];
|
||||
|
||||
static const char* CLICK_TO_ADD_OR_EDIT = "<click to add or edit>";
|
||||
|
||||
CPropertyEnumListModel::CPropertyEnumListModel(bool editable,QObject *parent) :
|
||||
|
||||
@@ -37,8 +37,8 @@ public slots:
|
||||
void update();
|
||||
|
||||
private:
|
||||
QList<PropertyEnumItem> m_items;
|
||||
bool m_editable;
|
||||
QList<PropertyEnumItem> m_items;
|
||||
bool m_editable;
|
||||
};
|
||||
|
||||
#endif // CPROPERTYENUMLISTMODEL_H
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "cpropertylistmodel.h"
|
||||
|
||||
static char modelStringBuffer [ 2048 ];
|
||||
|
||||
static const char* ADD_MESSAGE = "<add new Tile Properties in Project Properties>";
|
||||
|
||||
CPropertyListModel::CPropertyListModel(bool editable,QObject *parent) :
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include "ui_newprojectdialog.h"
|
||||
|
||||
#include "projectpropertiesdialog.h"
|
||||
#include "main.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QSettings>
|
||||
@@ -43,7 +42,7 @@ NewProjectDialog::NewProjectDialog(QString windowTitle,QString defName,QString d
|
||||
QListWidgetItem *pItem = ui->addOnsList->item(idx);
|
||||
QString addon_uri = ":/addons/NES/"+pItem->text();
|
||||
pItem->setData(Qt::UserRole,addon_uri);
|
||||
if ( nesicideProject->getProjectAddOns().contains(addon_uri) )
|
||||
if ( CNesicideProject::instance()->getProjectAddOns().contains(addon_uri) )
|
||||
{
|
||||
pItem->setCheckState(Qt::Checked);
|
||||
}
|
||||
@@ -197,14 +196,14 @@ bool NewProjectDialog::checkValidity()
|
||||
void NewProjectDialog::on_buttonBox_accepted()
|
||||
{
|
||||
// If they hit Project Properties button then we're all set except for the project name may have changed.
|
||||
if ( !nesicideProject->isInitialized() )
|
||||
if ( !CNesicideProject::instance()->isInitialized() )
|
||||
{
|
||||
setupProject();
|
||||
}
|
||||
else
|
||||
{
|
||||
nesicideProject->setProjectTitle(getName());
|
||||
nesicideProject->setDirty(true);
|
||||
CNesicideProject::instance()->setProjectTitle(getName());
|
||||
CNesicideProject::instance()->setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,15 +221,15 @@ void NewProjectDialog::setupProject()
|
||||
// Set project target before initializing project...
|
||||
if ( getTarget() == "Commodore 64" )
|
||||
{
|
||||
nesicideProject->setProjectTarget("c64");
|
||||
CNesicideProject::instance()->setProjectTarget("c64");
|
||||
}
|
||||
else if ( getTarget() == "Nintendo Entertainment System" )
|
||||
{
|
||||
nesicideProject->setProjectTarget("nes");
|
||||
CNesicideProject::instance()->setProjectTarget("nes");
|
||||
}
|
||||
nesicideProject->initializeProject();
|
||||
nesicideProject->setDirty(true);
|
||||
nesicideProject->setProjectTitle(getName());
|
||||
CNesicideProject::instance()->initializeProject();
|
||||
CNesicideProject::instance()->setDirty(true);
|
||||
CNesicideProject::instance()->setProjectTitle(getName());
|
||||
}
|
||||
|
||||
void NewProjectDialog::on_target_currentIndexChanged(QString target)
|
||||
@@ -282,9 +281,9 @@ void NewProjectDialog::on_projectProperties_clicked()
|
||||
|
||||
if (dlg->exec() == QDialog::Accepted)
|
||||
{
|
||||
nesicideProject->setDirty(true);
|
||||
CNesicideProject::instance()->setDirty(true);
|
||||
// They might have changed the project name...
|
||||
ui->name->setText(nesicideProject->getProjectTitle());
|
||||
ui->name->setText(CNesicideProject::instance()->getProjectTitle());
|
||||
}
|
||||
|
||||
delete dlg;
|
||||
|
||||
@@ -11,15 +11,13 @@
|
||||
|
||||
#include <QStringListModel>
|
||||
|
||||
#include "main.h"
|
||||
|
||||
const char hexStr[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
|
||||
|
||||
ProjectPropertiesDialog::ProjectPropertiesDialog(QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ProjectPropertiesDialog)
|
||||
{
|
||||
QList<QColor> *pal = nesicideProject->getProjectPaletteEntries();
|
||||
QList<QColor> *pal = CNesicideProject::instance()->getProjectPaletteEntries();
|
||||
int i = 0;
|
||||
char mapperTag [ 64 ];
|
||||
|
||||
@@ -30,26 +28,26 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(QWidget* parent) :
|
||||
ui->setupUi(this);
|
||||
|
||||
// Common project properties.
|
||||
ui->projectNameLineEdit->setText(nesicideProject->getProjectTitle());
|
||||
ui->projectNameLineEdit->setText(CNesicideProject::instance()->getProjectTitle());
|
||||
ui->projectBasePath->setText(QDir::fromNativeSeparators(QDir::currentPath()));
|
||||
ui->projectOutputBasePath->setText(nesicideProject->getProjectOutputBasePath());
|
||||
ui->outputName->setText(nesicideProject->getProjectOutputName());
|
||||
ui->compilerDefinedSymbols->setText(nesicideProject->getCompilerDefinedSymbols());
|
||||
ui->compilerIncludePaths->setText(nesicideProject->getCompilerIncludePaths());
|
||||
ui->compilerAdditionalOptions->setText(nesicideProject->getCompilerAdditionalOptions());
|
||||
ui->assemblerDefinedSymbols->setText(nesicideProject->getAssemblerDefinedSymbols());
|
||||
ui->assemblerIncludePaths->setText(nesicideProject->getAssemblerIncludePaths());
|
||||
ui->assemblerAdditionalOptions->setText(nesicideProject->getAssemblerAdditionalOptions());
|
||||
ui->linkerOutputName->setText(nesicideProject->getProjectLinkerOutputName());
|
||||
ui->debugInfoName->setText(nesicideProject->getProjectDebugInfoName());
|
||||
ui->linkerAdditionalOptions->setText(nesicideProject->getLinkerAdditionalOptions());
|
||||
ui->linkerAdditionalDependencies->setText(nesicideProject->getLinkerAdditionalDependencies());
|
||||
ui->linkerConfigFile->setText(nesicideProject->getLinkerConfigFile());
|
||||
ui->projectOutputBasePath->setText(CNesicideProject::instance()->getProjectOutputBasePath());
|
||||
ui->outputName->setText(CNesicideProject::instance()->getProjectOutputName());
|
||||
ui->compilerDefinedSymbols->setText(CNesicideProject::instance()->getCompilerDefinedSymbols());
|
||||
ui->compilerIncludePaths->setText(CNesicideProject::instance()->getCompilerIncludePaths());
|
||||
ui->compilerAdditionalOptions->setText(CNesicideProject::instance()->getCompilerAdditionalOptions());
|
||||
ui->assemblerDefinedSymbols->setText(CNesicideProject::instance()->getAssemblerDefinedSymbols());
|
||||
ui->assemblerIncludePaths->setText(CNesicideProject::instance()->getAssemblerIncludePaths());
|
||||
ui->assemblerAdditionalOptions->setText(CNesicideProject::instance()->getAssemblerAdditionalOptions());
|
||||
ui->linkerOutputName->setText(CNesicideProject::instance()->getProjectLinkerOutputName());
|
||||
ui->debugInfoName->setText(CNesicideProject::instance()->getProjectDebugInfoName());
|
||||
ui->linkerAdditionalOptions->setText(CNesicideProject::instance()->getLinkerAdditionalOptions());
|
||||
ui->linkerAdditionalDependencies->setText(CNesicideProject::instance()->getLinkerAdditionalDependencies());
|
||||
ui->linkerConfigFile->setText(CNesicideProject::instance()->getLinkerConfigFile());
|
||||
deserializeLinkerConfig();
|
||||
ui->customRuleFiles->addItems(nesicideProject->getMakefileCustomRuleFiles());
|
||||
ui->customRuleFiles->addItems(CNesicideProject::instance()->getMakefileCustomRuleFiles());
|
||||
deserializeCustomRules();
|
||||
|
||||
ui->sourceSearchList->setModel(new QStringListModel(nesicideProject->getSourceSearchPaths()));
|
||||
ui->sourceSearchList->setModel(new QStringListModel(CNesicideProject::instance()->getSourceSearchPaths()));
|
||||
ui->addSearchPath->setEnabled(false);
|
||||
ui->removeSearchPath->setEnabled(false);
|
||||
|
||||
@@ -65,18 +63,18 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(QWidget* parent) :
|
||||
}
|
||||
|
||||
// NES-specific project properties.
|
||||
ui->projectHeaderName->setText(nesicideProject->getProjectHeaderFileName());
|
||||
ui->projectSourceName->setText(nesicideProject->getProjectSourceFileName());
|
||||
ui->prgromOutputBasePath->setText(nesicideProject->getProjectLinkerOutputBasePath());
|
||||
ui->chrromOutputBasePath->setText(nesicideProject->getProjectCHRROMOutputBasePath());
|
||||
ui->chrromOutputName->setText(nesicideProject->getProjectCHRROMOutputName());
|
||||
ui->chrRom->setChecked(nesicideProject->getProjectUsesCHRROM());
|
||||
ui->chrRam->setChecked(!nesicideProject->getProjectUsesCHRROM());
|
||||
ui->cartridgeOutputName->setText(nesicideProject->getProjectCartridgeOutputName());
|
||||
ui->cartridgeSaveStateName->setText(nesicideProject->getProjectCartridgeSaveStateName());
|
||||
ui->projectHeaderName->setText(CNesicideProject::instance()->getProjectHeaderFileName());
|
||||
ui->projectSourceName->setText(CNesicideProject::instance()->getProjectSourceFileName());
|
||||
ui->prgromOutputBasePath->setText(CNesicideProject::instance()->getProjectLinkerOutputBasePath());
|
||||
ui->chrromOutputBasePath->setText(CNesicideProject::instance()->getProjectCHRROMOutputBasePath());
|
||||
ui->chrromOutputName->setText(CNesicideProject::instance()->getProjectCHRROMOutputName());
|
||||
ui->chrRom->setChecked(CNesicideProject::instance()->getProjectUsesCHRROM());
|
||||
ui->chrRam->setChecked(!CNesicideProject::instance()->getProjectUsesCHRROM());
|
||||
ui->cartridgeOutputName->setText(CNesicideProject::instance()->getProjectCartridgeOutputName());
|
||||
ui->cartridgeSaveStateName->setText(CNesicideProject::instance()->getProjectCartridgeSaveStateName());
|
||||
ui->trainerPresent->setChecked(false);
|
||||
ui->saveRAMPresent->setChecked(nesicideProject->getCartridge()->isBatteryBackedRam());
|
||||
ui->extraVRAMPresent->setChecked(nesicideProject->getCartridge()->getFourScreen());
|
||||
ui->saveRAMPresent->setChecked(CNesicideProject::instance()->getCartridge()->isBatteryBackedRam());
|
||||
ui->extraVRAMPresent->setChecked(CNesicideProject::instance()->getCartridge()->getFourScreen());
|
||||
|
||||
// C64-specific project properties.
|
||||
|
||||
@@ -113,13 +111,13 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(QWidget* parent) :
|
||||
i++;
|
||||
}
|
||||
|
||||
CCartridge* pCartridge = nesicideProject->getCartridge();
|
||||
CCartridge* pCartridge = CNesicideProject::instance()->getCartridge();
|
||||
ui->mapperComboBox->setCurrentIndex(mapperIndexFromID(pCartridge->getMapperNumber()));
|
||||
ui->romTypeComboBox->setCurrentIndex(0);
|
||||
ui->mirroringComboBox->setCurrentIndex(pCartridge->getMirrorMode());
|
||||
|
||||
tilePropertyListModel = new CPropertyListModel(false);
|
||||
tilePropertyListModel->setItems(nesicideProject->getTileProperties());
|
||||
tilePropertyListModel->setItems(CNesicideProject::instance()->getTileProperties());
|
||||
ui->propertyTableView->setModel(tilePropertyListModel);
|
||||
|
||||
QObject::connect(ui->sourceSearchList->selectionModel(),SIGNAL(selectionChanged(QItemSelection,QItemSelection)),this,SLOT(sourceSearchList_selectionChanged(QItemSelection,QItemSelection)));
|
||||
@@ -137,7 +135,7 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(QWidget* parent) :
|
||||
pageMap.insert("System Palette",ui->nessystempalette);
|
||||
|
||||
ui->treeWidget->setCurrentItem(ui->treeWidget->findItems("Project",Qt::MatchExactly).at(0));
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
QList<QTreeWidgetItem*> items = ui->treeWidget->findItems("Commodore 64",Qt::MatchExactly);
|
||||
if ( items.count() )
|
||||
@@ -145,7 +143,7 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(QWidget* parent) :
|
||||
items.at(0)->setHidden(true);
|
||||
}
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
QList<QTreeWidgetItem*> items = ui->treeWidget->findItems("Nintendo Entertainment System",Qt::MatchExactly);
|
||||
if ( items.count() )
|
||||
@@ -497,29 +495,29 @@ void ProjectPropertiesDialog::on_assemblerIncludePathBrowse_clicked()
|
||||
|
||||
void ProjectPropertiesDialog::on_buttonBox_accepted()
|
||||
{
|
||||
nesicideProject->setProjectTitle(ui->projectNameLineEdit->text());
|
||||
nesicideProject->setProjectOutputBasePath(ui->projectOutputBasePath->text());
|
||||
nesicideProject->setProjectOutputName(ui->outputName->text());
|
||||
nesicideProject->setProjectHeaderFileName(ui->projectHeaderName->text());
|
||||
nesicideProject->setProjectSourceFileName(ui->projectSourceName->text());
|
||||
nesicideProject->setProjectLinkerOutputName(ui->linkerOutputName->text());
|
||||
nesicideProject->setProjectDebugInfoName(ui->debugInfoName->text());
|
||||
nesicideProject->setProjectCHRROMOutputBasePath(ui->chrromOutputBasePath->text());
|
||||
nesicideProject->setProjectCHRROMOutputName(ui->chrromOutputName->text());
|
||||
nesicideProject->setProjectUsesCHRROM(ui->chrRom->isChecked());
|
||||
nesicideProject->setProjectCartridgeOutputName(ui->cartridgeOutputName->text());
|
||||
nesicideProject->setProjectCartridgeSaveStateName(ui->cartridgeSaveStateName->text());
|
||||
nesicideProject->setCompilerDefinedSymbols(ui->compilerDefinedSymbols->text());
|
||||
nesicideProject->setCompilerIncludePaths(ui->compilerIncludePaths->text());
|
||||
nesicideProject->setCompilerAdditionalOptions(ui->compilerAdditionalOptions->text());
|
||||
nesicideProject->setAssemblerDefinedSymbols(ui->assemblerDefinedSymbols->text());
|
||||
nesicideProject->setAssemblerIncludePaths(ui->assemblerIncludePaths->text());
|
||||
nesicideProject->setAssemblerAdditionalOptions(ui->assemblerAdditionalOptions->text());
|
||||
nesicideProject->setProjectLinkerOutputBasePath(ui->prgromOutputBasePath->text());
|
||||
nesicideProject->setLinkerAdditionalOptions(ui->linkerAdditionalOptions->text());
|
||||
nesicideProject->setLinkerAdditionalDependencies(ui->linkerAdditionalDependencies->text());
|
||||
nesicideProject->setTileProperties(tilePropertyListModel->getItems());
|
||||
nesicideProject->setLinkerConfigFile(ui->linkerConfigFile->text());
|
||||
CNesicideProject::instance()->setProjectTitle(ui->projectNameLineEdit->text());
|
||||
CNesicideProject::instance()->setProjectOutputBasePath(ui->projectOutputBasePath->text());
|
||||
CNesicideProject::instance()->setProjectOutputName(ui->outputName->text());
|
||||
CNesicideProject::instance()->setProjectHeaderFileName(ui->projectHeaderName->text());
|
||||
CNesicideProject::instance()->setProjectSourceFileName(ui->projectSourceName->text());
|
||||
CNesicideProject::instance()->setProjectLinkerOutputName(ui->linkerOutputName->text());
|
||||
CNesicideProject::instance()->setProjectDebugInfoName(ui->debugInfoName->text());
|
||||
CNesicideProject::instance()->setProjectCHRROMOutputBasePath(ui->chrromOutputBasePath->text());
|
||||
CNesicideProject::instance()->setProjectCHRROMOutputName(ui->chrromOutputName->text());
|
||||
CNesicideProject::instance()->setProjectUsesCHRROM(ui->chrRom->isChecked());
|
||||
CNesicideProject::instance()->setProjectCartridgeOutputName(ui->cartridgeOutputName->text());
|
||||
CNesicideProject::instance()->setProjectCartridgeSaveStateName(ui->cartridgeSaveStateName->text());
|
||||
CNesicideProject::instance()->setCompilerDefinedSymbols(ui->compilerDefinedSymbols->text());
|
||||
CNesicideProject::instance()->setCompilerIncludePaths(ui->compilerIncludePaths->text());
|
||||
CNesicideProject::instance()->setCompilerAdditionalOptions(ui->compilerAdditionalOptions->text());
|
||||
CNesicideProject::instance()->setAssemblerDefinedSymbols(ui->assemblerDefinedSymbols->text());
|
||||
CNesicideProject::instance()->setAssemblerIncludePaths(ui->assemblerIncludePaths->text());
|
||||
CNesicideProject::instance()->setAssemblerAdditionalOptions(ui->assemblerAdditionalOptions->text());
|
||||
CNesicideProject::instance()->setProjectLinkerOutputBasePath(ui->prgromOutputBasePath->text());
|
||||
CNesicideProject::instance()->setLinkerAdditionalOptions(ui->linkerAdditionalOptions->text());
|
||||
CNesicideProject::instance()->setLinkerAdditionalDependencies(ui->linkerAdditionalDependencies->text());
|
||||
CNesicideProject::instance()->setTileProperties(tilePropertyListModel->getItems());
|
||||
CNesicideProject::instance()->setLinkerConfigFile(ui->linkerConfigFile->text());
|
||||
serializeLinkerConfig();
|
||||
QStringList customRuleFiles;
|
||||
int idx;
|
||||
@@ -527,19 +525,19 @@ void ProjectPropertiesDialog::on_buttonBox_accepted()
|
||||
{
|
||||
customRuleFiles += ui->customRuleFiles->itemText(idx);
|
||||
}
|
||||
nesicideProject->setMakefileCustomRuleFiles(customRuleFiles);
|
||||
CNesicideProject::instance()->setMakefileCustomRuleFiles(customRuleFiles);
|
||||
serializeCustomRules();
|
||||
|
||||
nesicideProject->getProjectPaletteEntries()->clear();
|
||||
CNesicideProject::instance()->getProjectPaletteEntries()->clear();
|
||||
|
||||
for (int paletteItemIndex=0; paletteItemIndex<currentPalette.count(); paletteItemIndex++)
|
||||
{
|
||||
nesicideProject->getProjectPaletteEntries()->append(currentPalette.at(paletteItemIndex));
|
||||
CNesicideProject::instance()->getProjectPaletteEntries()->append(currentPalette.at(paletteItemIndex));
|
||||
}
|
||||
|
||||
nesicideProject->getCartridge()->setMapperNumber(mapperIDFromIndex(ui->mapperComboBox->currentIndex()));
|
||||
nesicideProject->getCartridge()->setMirrorMode((eMirrorMode)ui->mirroringComboBox->currentIndex());
|
||||
nesicideProject->getCartridge()->setFourScreen(ui->extraVRAMPresent->isChecked());
|
||||
CNesicideProject::instance()->getCartridge()->setMapperNumber(mapperIDFromIndex(ui->mapperComboBox->currentIndex()));
|
||||
CNesicideProject::instance()->getCartridge()->setMirrorMode((eMirrorMode)ui->mirroringComboBox->currentIndex());
|
||||
CNesicideProject::instance()->getCartridge()->setFourScreen(ui->extraVRAMPresent->isChecked());
|
||||
}
|
||||
|
||||
void ProjectPropertiesDialog::on_projectOutputBasePathBrowse_clicked()
|
||||
@@ -757,12 +755,20 @@ void ProjectPropertiesDialog::on_editProperty_clicked()
|
||||
|
||||
void ProjectPropertiesDialog::on_treeWidget_itemSelectionChanged()
|
||||
{
|
||||
ui->treeWidget->expand(ui->treeWidget->currentIndex());
|
||||
if ( ui->treeWidget->currentItem()->childCount() )
|
||||
QModelIndexList indexes = ui->treeWidget->selectionModel()->selectedIndexes();
|
||||
QList<QTreeWidgetItem*> items = ui->treeWidget->selectedItems();
|
||||
if ( indexes.count() > 0 )
|
||||
{
|
||||
ui->treeWidget->setCurrentItem(ui->treeWidget->itemBelow(ui->treeWidget->currentItem()));
|
||||
// Single selection
|
||||
QModelIndex index = indexes.at(0);
|
||||
QTreeWidgetItem *pItem = items.at(0);
|
||||
ui->treeWidget->expand(index);
|
||||
if ( pItem->childCount() )
|
||||
{
|
||||
ui->treeWidget->setCurrentItem(ui->treeWidget->itemBelow(pItem));
|
||||
}
|
||||
ui->stackedWidget->setCurrentWidget(pageMap[pItem->text(0)]);
|
||||
}
|
||||
ui->stackedWidget->setCurrentWidget(pageMap[ui->treeWidget->currentItem()->text(0)]);
|
||||
}
|
||||
|
||||
void ProjectPropertiesDialog::serializeCustomRules(QString rulesFile)
|
||||
@@ -847,8 +853,8 @@ void ProjectPropertiesDialog::sourceSearchList_selectionChanged(QItemSelection,Q
|
||||
|
||||
void ProjectPropertiesDialog::on_addSearchPath_clicked()
|
||||
{
|
||||
nesicideProject->addSourceSearchPath(ui->sourceSearchPath->text());
|
||||
((QStringListModel*)ui->sourceSearchList->model())->setStringList(nesicideProject->getSourceSearchPaths());
|
||||
CNesicideProject::instance()->addSourceSearchPath(ui->sourceSearchPath->text());
|
||||
((QStringListModel*)ui->sourceSearchList->model())->setStringList(CNesicideProject::instance()->getSourceSearchPaths());
|
||||
}
|
||||
|
||||
void ProjectPropertiesDialog::on_removeSearchPath_clicked()
|
||||
@@ -856,9 +862,9 @@ void ProjectPropertiesDialog::on_removeSearchPath_clicked()
|
||||
QModelIndexList selections = ui->sourceSearchList->selectionModel()->selectedRows();
|
||||
foreach ( QModelIndex index, selections )
|
||||
{
|
||||
nesicideProject->removeSourceSearchPath(index.data().toString());
|
||||
CNesicideProject::instance()->removeSourceSearchPath(index.data().toString());
|
||||
}
|
||||
((QStringListModel*)ui->sourceSearchList->model())->setStringList(nesicideProject->getSourceSearchPaths());
|
||||
((QStringListModel*)ui->sourceSearchList->model())->setStringList(CNesicideProject::instance()->getSourceSearchPaths());
|
||||
}
|
||||
|
||||
void ProjectPropertiesDialog::on_sourceSearchPathBrowse_clicked()
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#include "environmentsettingsdialog.h"
|
||||
#include "ui_environmentsettingsdialog.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
#include "Qsci/qsciscintilla.h"
|
||||
#include "cgamedatabasehandler.h"
|
||||
|
||||
#include "codeeditorform.h"
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
@@ -120,7 +123,7 @@ EnvironmentSettingsDialog::EnvironmentSettingsDialog(QWidget* parent) :
|
||||
ui->GameDatabasePathButton->setEnabled(!m_useInternalGameDatabase);
|
||||
ui->GameDatabasePathEdit->setEnabled(!m_useInternalGameDatabase);
|
||||
|
||||
ui->GameDatabase->setText(gameDatabase.getGameDBAuthor()+", "+gameDatabase.getGameDBTimestamp());
|
||||
ui->GameDatabase->setText(CGameDatabaseHandler::instance()->getGameDBAuthor()+", "+CGameDatabaseHandler::instance()->getGameDBTimestamp());
|
||||
|
||||
ui->ROMPath->setText(m_romPath);
|
||||
ui->runRom->setChecked(m_runRomOnLoad);
|
||||
@@ -182,11 +185,11 @@ EnvironmentSettingsDialog::EnvironmentSettingsDialog(QWidget* parent) :
|
||||
pageMap.insert("C=64 Emulation",ui->c64emulator);
|
||||
|
||||
ui->treeWidget->setCurrentItem(ui->treeWidget->findItems("General",Qt::MatchExactly).at(0));
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
ui->treeWidget->findItems("Commodore 64",Qt::MatchExactly).at(0)->setHidden(true);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
ui->treeWidget->findItems("Nintendo Entertainment System",Qt::MatchExactly).at(0)->setHidden(true);
|
||||
}
|
||||
@@ -520,21 +523,21 @@ void EnvironmentSettingsDialog::on_useInternalDB_toggled(bool checked)
|
||||
|
||||
if ( (!checked) && (!ui->GameDatabasePathEdit->text().isEmpty()) )
|
||||
{
|
||||
bool openedOk = gameDatabase.initialize(ui->GameDatabasePathEdit->text());
|
||||
bool openedOk = CGameDatabaseHandler::instance()->initialize(ui->GameDatabasePathEdit->text());
|
||||
|
||||
ui->GameDatabasePathButton->setEnabled(openedOk);
|
||||
ui->GameDatabasePathEdit->setEnabled(openedOk);
|
||||
|
||||
ui->GameDatabase->setText(gameDatabase.getGameDBAuthor()+", "+gameDatabase.getGameDBTimestamp());
|
||||
ui->GameDatabase->setText(CGameDatabaseHandler::instance()->getGameDBAuthor()+", "+CGameDatabaseHandler::instance()->getGameDBTimestamp());
|
||||
}
|
||||
else if ( checked )
|
||||
{
|
||||
bool openedOk = gameDatabase.initialize(":GameDatabase");
|
||||
bool openedOk = CGameDatabaseHandler::instance()->initialize(":GameDatabase");
|
||||
|
||||
ui->GameDatabasePathButton->setEnabled(openedOk);
|
||||
ui->GameDatabasePathEdit->setEnabled(openedOk);
|
||||
|
||||
ui->GameDatabase->setText(gameDatabase.getGameDBAuthor()+", "+gameDatabase.getGameDBTimestamp());
|
||||
ui->GameDatabase->setText(CGameDatabaseHandler::instance()->getGameDBAuthor()+", "+CGameDatabaseHandler::instance()->getGameDBTimestamp());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -546,13 +549,13 @@ void EnvironmentSettingsDialog::on_GameDatabasePathButton_clicked()
|
||||
{
|
||||
ui->GameDatabasePathEdit->setText(value);
|
||||
|
||||
bool openedOk = gameDatabase.initialize(ui->GameDatabasePathEdit->text());
|
||||
bool openedOk = CGameDatabaseHandler::instance()->initialize(ui->GameDatabasePathEdit->text());
|
||||
|
||||
ui->useInternalDB->setChecked(!openedOk);
|
||||
ui->GameDatabasePathButton->setEnabled(openedOk);
|
||||
ui->GameDatabasePathEdit->setEnabled(openedOk);
|
||||
|
||||
ui->GameDatabase->setText(gameDatabase.getGameDBAuthor()+", "+gameDatabase.getGameDBTimestamp());
|
||||
ui->GameDatabase->setText(CGameDatabaseHandler::instance()->getGameDBAuthor()+", "+CGameDatabaseHandler::instance()->getGameDBTimestamp());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -897,12 +900,20 @@ void EnvironmentSettingsDialog::on_language_currentIndexChanged(int index)
|
||||
|
||||
void EnvironmentSettingsDialog::on_treeWidget_itemSelectionChanged()
|
||||
{
|
||||
ui->treeWidget->expand(ui->treeWidget->currentIndex());
|
||||
if ( ui->treeWidget->currentItem()->childCount() )
|
||||
QModelIndexList indexes = ui->treeWidget->selectionModel()->selectedIndexes();
|
||||
QList<QTreeWidgetItem*> items = ui->treeWidget->selectedItems();
|
||||
if ( indexes.count() > 0 )
|
||||
{
|
||||
ui->treeWidget->setCurrentItem(ui->treeWidget->itemBelow(ui->treeWidget->currentItem()));
|
||||
// Single selection
|
||||
QModelIndex index = indexes.at(0);
|
||||
QTreeWidgetItem *pItem = items.at(0);
|
||||
ui->treeWidget->expand(index);
|
||||
if ( pItem->childCount() )
|
||||
{
|
||||
ui->treeWidget->setCurrentItem(ui->treeWidget->itemBelow(pItem));
|
||||
}
|
||||
ui->stackedWidget->setCurrentWidget(pageMap[pItem->text(0)]);
|
||||
}
|
||||
ui->stackedWidget->setCurrentWidget(pageMap[ui->treeWidget->currentItem()->text(0)]);
|
||||
}
|
||||
|
||||
void EnvironmentSettingsDialog::on_buttonBox_accepted()
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
@@ -1203,6 +1206,8 @@
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../common/resource.qrc"/>
|
||||
<include location="../../common/resource.qrc"/>
|
||||
<include location="../../common/resource.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <QApplication>
|
||||
|
||||
#include "main.h"
|
||||
#include "mainwindow.h"
|
||||
#include "cpluginmanager.h"
|
||||
#include "startupsplashdialog.h"
|
||||
@@ -10,18 +9,6 @@
|
||||
|
||||
#include "model/cprojectmodel.h"
|
||||
|
||||
// Application [transient] settings.
|
||||
AppSettings* appSettings = NULL;
|
||||
|
||||
// Modeless dialog for Test Suite executive.
|
||||
TestSuiteExecutiveDialog* testSuiteExecutive = NULL;
|
||||
|
||||
// Database of all known games.
|
||||
CGameDatabaseHandler gameDatabase;
|
||||
|
||||
// The project container.
|
||||
CNesicideProject* nesicideProject = (CNesicideProject*)NULL;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
// Main window of application.
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "testsuiteexecutivedialog.h"
|
||||
|
||||
#include "cgamedatabasehandler.h"
|
||||
#include "cnesicideproject.h"
|
||||
#include "appsettings.h"
|
||||
|
||||
extern TestSuiteExecutiveDialog* testSuiteExecutive;
|
||||
|
||||
extern CGameDatabaseHandler gameDatabase;
|
||||
|
||||
extern CNesicideProject* nesicideProject;
|
||||
|
||||
extern AppSettings* appSettings;
|
||||
|
||||
#endif // MAIN_H
|
||||
+155
-130
@@ -6,8 +6,8 @@
|
||||
#include "cpluginmanager.h"
|
||||
|
||||
#include "testsuiteexecutivedialog.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "cgamedatabasehandler.h"
|
||||
#include "appsettings.h"
|
||||
|
||||
#include "compilerthread.h"
|
||||
#include "ccc65interface.h"
|
||||
@@ -244,9 +244,6 @@ MainWindow::MainWindow(CProjectModel *projectModel, QWidget* parent) :
|
||||
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
|
||||
|
||||
// Create application [transient] settings bucket.
|
||||
appSettings = new AppSettings();
|
||||
|
||||
// Initialize Environment settings.
|
||||
EnvironmentSettingsDialog::readSettings();
|
||||
|
||||
@@ -254,17 +251,14 @@ MainWindow::MainWindow(CProjectModel *projectModel, QWidget* parent) :
|
||||
if ( EnvironmentSettingsDialog::useInternalGameDatabase() )
|
||||
{
|
||||
// Use internal resource.
|
||||
gameDatabase.initialize(":GameDatabase");
|
||||
CGameDatabaseHandler::instance()->initialize(":GameDatabase");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use named file resource. Default to internal if it's not set.
|
||||
gameDatabase.initialize(EnvironmentSettingsDialog::getGameDatabase());
|
||||
CGameDatabaseHandler::instance()->initialize(EnvironmentSettingsDialog::getGameDatabase());
|
||||
}
|
||||
|
||||
// Initialize the plugin manager
|
||||
pluginManager = new CPluginManager();
|
||||
|
||||
// Create the search engine thread.
|
||||
SearcherThread* searcher = new SearcherThread();
|
||||
CObjectRegistry::instance()->addObject ( "Searcher", searcher );
|
||||
@@ -297,8 +291,7 @@ MainWindow::MainWindow(CProjectModel *projectModel, QWidget* parent) :
|
||||
|
||||
setupUi(this);
|
||||
|
||||
nesicideProject = new CNesicideProject();
|
||||
QObject::connect(nesicideProject,SIGNAL(createTarget(QString)),this,SLOT(createTarget(QString)));
|
||||
QObject::connect(CNesicideProject::instance(),SIGNAL(createTarget(QString)),this,SLOT(createTarget(QString)));
|
||||
|
||||
QObject::connect(tabWidget,SIGNAL(tabModified(int,bool)),this,SLOT(tabWidget_tabModified(int,bool)));
|
||||
QObject::connect(tabWidget,SIGNAL(tabAdded(int)),this,SLOT(tabWidget_tabAdded(int)));
|
||||
@@ -307,7 +300,7 @@ MainWindow::MainWindow(CProjectModel *projectModel, QWidget* parent) :
|
||||
QObject::connect(this,SIGNAL(applyProjectProperties()),tabWidget,SLOT(applyProjectProperties()));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),tabWidget,SLOT(applyEnvironmentSettings()));
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),tabWidget,SIGNAL(updateTargetMachine(QString)));
|
||||
QObject::connect(appSettings,SIGNAL(appSettingsChanged()),tabWidget,SLOT(applyAppSettings()));
|
||||
QObject::connect(AppSettings::instance(),SIGNAL(appSettingsChanged()),tabWidget,SLOT(applyAppSettings()));
|
||||
|
||||
QObject::connect(menuEdit,SIGNAL(aboutToShow()),this,SLOT(menuEdit_aboutToShow()));
|
||||
|
||||
@@ -336,6 +329,8 @@ MainWindow::MainWindow(CProjectModel *projectModel, QWidget* parent) :
|
||||
m_pProjectBrowser->hide();
|
||||
CDockWidgetRegistry::instance()->addWidget ( "Project Browser", m_pProjectBrowser );
|
||||
|
||||
tabWidget->setProjectModel(m_pProjectModel);
|
||||
|
||||
// expandableStatusBar = new CExpandableStatusBar();
|
||||
// appStatusBar->insertWidget(0, expandableStatusBar, 100); // Stretch is big to allow it to stretch across app pane.
|
||||
|
||||
@@ -364,7 +359,7 @@ MainWindow::MainWindow(CProjectModel *projectModel, QWidget* parent) :
|
||||
output->hide();
|
||||
|
||||
generalTextLogger->write("<strong>NESICIDE</strong> Alpha Release");
|
||||
generalTextLogger->write("<strong>Plugin Scripting Subsystem:</strong> " + pluginManager->getVersionInfo());
|
||||
generalTextLogger->write("<strong>Plugin Scripting Subsystem:</strong> " + CPluginManager::instance()->getVersionInfo());
|
||||
|
||||
m_pExecutionInspector = new ExecutionInspectorDockWidget();
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pExecutionInspector,SLOT(updateTargetMachine(QString)));
|
||||
@@ -412,14 +407,14 @@ MainWindow::MainWindow(CProjectModel *projectModel, QWidget* parent) :
|
||||
}
|
||||
|
||||
// Load all plugins.
|
||||
pluginManager->doInitScript();
|
||||
pluginManager->loadPlugins();
|
||||
CPluginManager::instance()->doInitScript();
|
||||
CPluginManager::instance()->loadPlugins();
|
||||
|
||||
// Instantiate music editor form single instance...
|
||||
MusicEditorForm::instance();
|
||||
|
||||
// Set up UI in "Coding" mode.
|
||||
appSettings->setAppMode(AppSettings::CodingMode);
|
||||
AppSettings::instance()->setAppMode(AppSettings::CodingMode);
|
||||
actionCoding_Mode->setChecked(true);
|
||||
if ( EnvironmentSettingsDialog::rememberWindowSettings() )
|
||||
{
|
||||
@@ -531,9 +526,6 @@ MainWindow::~MainWindow()
|
||||
delete debugTextLogger;
|
||||
delete searchTextLogger;
|
||||
|
||||
delete nesicideProject;
|
||||
delete pluginManager;
|
||||
|
||||
delete m_pNESEmulatorThread;
|
||||
delete m_pC64EmulatorThread;
|
||||
}
|
||||
@@ -609,13 +601,13 @@ void MainWindow::applicationActivationChanged(bool activated)
|
||||
if ( activated )
|
||||
{
|
||||
// Check whether the current open project file has changed.
|
||||
if ( m_lastActivationChangeTime.isValid() && nesicideProject->isInitialized() )
|
||||
if ( m_lastActivationChangeTime.isValid() && CNesicideProject::instance()->isInitialized() )
|
||||
{
|
||||
fileInfo.setFile(nesicideProject->getProjectFileName());
|
||||
fileInfo.setFile(CNesicideProject::instance()->getProjectFileName());
|
||||
if ( fileInfo.lastModified() > m_lastActivationChangeTime )
|
||||
{
|
||||
str = "The currently loaded project:\n\n";
|
||||
str += nesicideProject->getProjectFileName();
|
||||
str += CNesicideProject::instance()->getProjectFileName();
|
||||
str += "\n\nhas been modified outside of NESICIDE.\n\n";
|
||||
str += "Do you want to re-load the project?";
|
||||
result = QMessageBox::warning(this,"External interference detected!",str,QMessageBox::Yes,QMessageBox::No);
|
||||
@@ -623,11 +615,11 @@ void MainWindow::applicationActivationChanged(bool activated)
|
||||
if ( result == QMessageBox::Yes )
|
||||
{
|
||||
closeProject();
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
openNesProject(fileInfo.fileName());
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
openC64Project(fileInfo.fileName());
|
||||
}
|
||||
@@ -640,7 +632,7 @@ void MainWindow::applicationActivationChanged(bool activated)
|
||||
else
|
||||
{
|
||||
// Only embedded emulators pause when task switching...
|
||||
if ( nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) &&
|
||||
if ( CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) &&
|
||||
EmulatorPrefsDialog::getPauseOnTaskSwitch() )
|
||||
{
|
||||
emit pauseEmulation(false);
|
||||
@@ -992,6 +984,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBreakpointInspector = new BreakpointDockWidget(nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBreakpointInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBreakpointInspector,SLOT(applyEnvironmentSettings()));
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBreakpointInspector );
|
||||
m_pBreakpointInspector->hide();
|
||||
QObject::connect(m_pBreakpointInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
@@ -999,6 +992,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pAssemblyInspector = new CodeBrowserDockWidget(nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pAssemblyInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pAssemblyInspector,SLOT(applyEnvironmentSettings()));
|
||||
addDockWidget(Qt::RightDockWidgetArea, m_pAssemblyInspector );
|
||||
m_pAssemblyInspector->hide();
|
||||
QObject::connect(m_pAssemblyInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
@@ -1011,6 +1005,7 @@ void MainWindow::createNesUi()
|
||||
m_pGfxCHRMemoryInspector->setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pGfxCHRMemoryInspector );
|
||||
m_pGfxCHRMemoryInspector->hide();
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pGfxCHRMemoryInspector,SLOT(applyEnvironmentSettings()));
|
||||
QObject::connect(m_pGfxCHRMemoryInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
QObject::connect(m_pGfxCHRMemoryInspector,SIGNAL(setStatusBarMessage(QString)),this,SLOT(setStatusBarMessage(QString)));
|
||||
QObject::connect(m_pGfxCHRMemoryInspector,SIGNAL(addStatusBarWidget(QWidget*)),this,SLOT(addStatusBarWidget(QWidget*)));
|
||||
@@ -1019,6 +1014,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pGfxOAMMemoryInspector = new OAMVisualizerDockWidget ();
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pGfxOAMMemoryInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pGfxOAMMemoryInspector,SLOT(applyEnvironmentSettings()));
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pGfxOAMMemoryInspector );
|
||||
m_pGfxOAMMemoryInspector->hide();
|
||||
QObject::connect(m_pGfxOAMMemoryInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
@@ -1026,6 +1022,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pGfxNameTableMemoryInspector = new NameTableVisualizerDockWidget ();
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pGfxNameTableMemoryInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pGfxNameTableMemoryInspector,SLOT(applyEnvironmentSettings()));
|
||||
addDockWidget(Qt::RightDockWidgetArea, m_pGfxNameTableMemoryInspector );
|
||||
m_pGfxNameTableMemoryInspector->hide();
|
||||
QObject::connect(m_pGfxNameTableMemoryInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
@@ -1033,6 +1030,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pJoypadLoggerInspector = new JoypadLoggerDockWidget ();
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pJoypadLoggerInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pJoypadLoggerInspector,SLOT(applyEnvironmentSettings()));
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pJoypadLoggerInspector );
|
||||
m_pJoypadLoggerInspector->hide();
|
||||
QObject::connect(m_pJoypadLoggerInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
@@ -1040,6 +1038,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pExecutionVisualizer = new ExecutionVisualizerDockWidget();
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pExecutionVisualizer,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pExecutionVisualizer,SLOT(applyEnvironmentSettings()));
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pExecutionVisualizer );
|
||||
m_pExecutionVisualizer->hide();
|
||||
QObject::connect(m_pExecutionVisualizer,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
@@ -1047,6 +1046,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pCodeDataLoggerInspector = new CodeDataLoggerDockWidget();
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pCodeDataLoggerInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pCodeDataLoggerInspector,SLOT(applyEnvironmentSettings()));
|
||||
addDockWidget(Qt::RightDockWidgetArea, m_pCodeDataLoggerInspector );
|
||||
m_pCodeDataLoggerInspector->hide();
|
||||
QObject::connect(m_pCodeDataLoggerInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
@@ -1054,6 +1054,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinCPURegisterInspector = new RegisterInspectorDockWidget(nesGetCpuRegisterDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinCPURegisterInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinCPURegisterInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinCPURegisterInspector->setObjectName("cpuRegisterInspector");
|
||||
m_pBinCPURegisterInspector->setWindowTitle("CPU Register Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinCPURegisterInspector );
|
||||
@@ -1063,6 +1064,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinCPURAMInspector = new MemoryInspectorDockWidget(nesGetCpuMemoryDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinCPURAMInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinCPURAMInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinCPURAMInspector->setObjectName("cpuMemoryInspector");
|
||||
m_pBinCPURAMInspector->setWindowTitle("CPU RAM Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinCPURAMInspector );
|
||||
@@ -1072,6 +1074,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinROMInspector = new MemoryInspectorDockWidget(nesGetCartridgePRGROMMemoryDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinROMInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinROMInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinROMInspector->setObjectName("cartPRGROMMemoryInspector");
|
||||
m_pBinROMInspector->setWindowTitle("PRG-ROM Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinROMInspector );
|
||||
@@ -1081,6 +1084,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinCartVRAMMemoryInspector = new MemoryInspectorDockWidget(nesGetCartridgeVRAMMemoryDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinCartVRAMMemoryInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinCartVRAMMemoryInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinCartVRAMMemoryInspector->setObjectName("cartVRAMMemoryInspector");
|
||||
m_pBinCartVRAMMemoryInspector->setWindowTitle("Cartridge VRAM Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinCartVRAMMemoryInspector );
|
||||
@@ -1090,6 +1094,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinNameTableMemoryInspector = new MemoryInspectorDockWidget(nesGetPpuNameTableMemoryDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinNameTableMemoryInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinNameTableMemoryInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinNameTableMemoryInspector->setObjectName("ppuNameTableMemoryInspector");
|
||||
m_pBinNameTableMemoryInspector->setWindowTitle("NameTable Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinNameTableMemoryInspector );
|
||||
@@ -1099,6 +1104,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinPPURegisterInspector = new RegisterInspectorDockWidget(nesGetPpuRegisterDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinPPURegisterInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinPPURegisterInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinPPURegisterInspector->setObjectName("ppuRegisterInspector");
|
||||
m_pBinPPURegisterInspector->setWindowTitle("PPU Register Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinPPURegisterInspector );
|
||||
@@ -1108,6 +1114,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pPPUInformationInspector = new PPUInformationDockWidget();
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pPPUInformationInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pPPUInformationInspector,SLOT(applyEnvironmentSettings()));
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pPPUInformationInspector );
|
||||
m_pPPUInformationInspector->hide();
|
||||
QObject::connect(m_pPPUInformationInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
@@ -1115,6 +1122,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinAPURegisterInspector = new RegisterInspectorDockWidget(nesGetApuRegisterDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinAPURegisterInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinAPURegisterInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinAPURegisterInspector->setObjectName("apuRegisterInspector");
|
||||
m_pBinAPURegisterInspector->setWindowTitle("APU Register Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinAPURegisterInspector );
|
||||
@@ -1127,10 +1135,12 @@ void MainWindow::createNesUi()
|
||||
m_pAPUInformationInspector->hide();
|
||||
QObject::connect(m_pAPUInformationInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pAPUInformationInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pAPUInformationInspector,SLOT(applyEnvironmentSettings()));
|
||||
CDockWidgetRegistry::instance()->addWidget ( "APU Information", m_pAPUInformationInspector );
|
||||
|
||||
m_pBinCHRMemoryInspector = new MemoryInspectorDockWidget(nesGetCartridgeCHRMemoryDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinCHRMemoryInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinCHRMemoryInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinCHRMemoryInspector->setObjectName("chrMemoryInspector");
|
||||
m_pBinCHRMemoryInspector->setWindowTitle("CHR Memory Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinCHRMemoryInspector );
|
||||
@@ -1140,6 +1150,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinOAMMemoryInspector = new RegisterInspectorDockWidget(nesGetPpuOamRegisterDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinOAMMemoryInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinOAMMemoryInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinOAMMemoryInspector->setObjectName("oamMemoryInspector");
|
||||
m_pBinOAMMemoryInspector->setWindowTitle("OAM Memory Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinOAMMemoryInspector );
|
||||
@@ -1149,6 +1160,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinPaletteMemoryInspector = new MemoryInspectorDockWidget(nesGetPpuPaletteMemoryDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinPaletteMemoryInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinPaletteMemoryInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinPaletteMemoryInspector->setObjectName("ppuPaletteMemoryInspector");
|
||||
m_pBinPaletteMemoryInspector->setWindowTitle("Palette Memory Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinPaletteMemoryInspector );
|
||||
@@ -1158,6 +1170,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinSRAMMemoryInspector = new MemoryInspectorDockWidget(nesGetCartridgeSRAMMemoryDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinSRAMMemoryInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinSRAMMemoryInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinSRAMMemoryInspector->setObjectName("cartSRAMMemoryInspector");
|
||||
m_pBinSRAMMemoryInspector->setWindowTitle("Cartridge SRAM Memory Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinSRAMMemoryInspector );
|
||||
@@ -1167,6 +1180,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinEXRAMMemoryInspector = new MemoryInspectorDockWidget(nesGetCartridgeEXRAMMemoryDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinEXRAMMemoryInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinEXRAMMemoryInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinEXRAMMemoryInspector->setObjectName("cartEXRAMMemoryInspector");
|
||||
m_pBinEXRAMMemoryInspector->setWindowTitle("Cartridge EXRAM Memory Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinEXRAMMemoryInspector );
|
||||
@@ -1176,6 +1190,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pMapperInformationInspector = new MapperInformationDockWidget();
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pMapperInformationInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pMapperInformationInspector,SLOT(applyEnvironmentSettings()));
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pMapperInformationInspector );
|
||||
m_pMapperInformationInspector->hide();
|
||||
QObject::connect(m_pMapperInformationInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
@@ -1183,6 +1198,7 @@ void MainWindow::createNesUi()
|
||||
|
||||
m_pBinMapperMemoryInspector = new RegisterInspectorDockWidget(nesGetCartridgeRegisterDatabase,nesGetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinMapperMemoryInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinMapperMemoryInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinMapperMemoryInspector->setObjectName("cartMapperRegisterInspector");
|
||||
m_pBinMapperMemoryInspector->setWindowTitle("Cartridge Mapper Register Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinMapperMemoryInspector );
|
||||
@@ -1279,6 +1295,8 @@ void MainWindow::destroyNesUi()
|
||||
return;
|
||||
}
|
||||
|
||||
emit updateTargetMachine("none");
|
||||
|
||||
// Silence all debuggers.
|
||||
DebuggerUpdateThread::silence(true);
|
||||
|
||||
@@ -1551,6 +1569,7 @@ void MainWindow::createC64Ui()
|
||||
|
||||
m_pBreakpointInspector = new BreakpointDockWidget(c64GetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBreakpointInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBreakpointInspector,SLOT(applyEnvironmentSettings()));
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBreakpointInspector );
|
||||
m_pBreakpointInspector->hide();
|
||||
QObject::connect(m_pBreakpointInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
@@ -1558,6 +1577,7 @@ void MainWindow::createC64Ui()
|
||||
|
||||
m_pAssemblyInspector = new CodeBrowserDockWidget(c64GetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pAssemblyInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pAssemblyInspector,SLOT(applyEnvironmentSettings()));
|
||||
addDockWidget(Qt::RightDockWidgetArea, m_pAssemblyInspector );
|
||||
m_pAssemblyInspector->hide();
|
||||
QObject::connect(m_pAssemblyInspector,SIGNAL(markProjectDirty(bool)),this,SLOT(markProjectDirty(bool)));
|
||||
@@ -1565,6 +1585,7 @@ void MainWindow::createC64Ui()
|
||||
|
||||
m_pBinCPURegisterInspector = new RegisterInspectorDockWidget(c64GetCpuRegisterDatabase,c64GetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinCPURegisterInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinCPURegisterInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinCPURegisterInspector->setObjectName("cpuRegisterInspector");
|
||||
m_pBinCPURegisterInspector->setWindowTitle("CPU Register Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinCPURegisterInspector );
|
||||
@@ -1574,6 +1595,7 @@ void MainWindow::createC64Ui()
|
||||
|
||||
m_pBinCPURAMInspector = new MemoryInspectorDockWidget(c64GetCpuMemoryDatabase,c64GetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinCPURAMInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinCPURAMInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinCPURAMInspector->setObjectName("cpuMemoryInspector");
|
||||
m_pBinCPURAMInspector->setWindowTitle("CPU RAM Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinCPURAMInspector );
|
||||
@@ -1583,6 +1605,7 @@ void MainWindow::createC64Ui()
|
||||
|
||||
m_pBinSIDRegisterInspector = new RegisterInspectorDockWidget(c64GetSidRegisterDatabase,c64GetBreakpointDatabase());
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),m_pBinSIDRegisterInspector,SLOT(updateTargetMachine(QString)));
|
||||
QObject::connect(this,SIGNAL(applyEnvironmentSettings()),m_pBinSIDRegisterInspector,SLOT(applyEnvironmentSettings()));
|
||||
m_pBinSIDRegisterInspector->setObjectName("sidRegisterInspector");
|
||||
m_pBinSIDRegisterInspector->setWindowTitle("SID Register Inspector");
|
||||
addDockWidget(Qt::BottomDockWidgetArea, m_pBinSIDRegisterInspector );
|
||||
@@ -1617,6 +1640,8 @@ void MainWindow::destroyC64Ui()
|
||||
return;
|
||||
}
|
||||
|
||||
emit updateTargetMachine("none");
|
||||
|
||||
// Silence all debuggers.
|
||||
DebuggerUpdateThread::silence(true);
|
||||
|
||||
@@ -1697,7 +1722,7 @@ bool MainWindow::openAnyFile(QString fileName)
|
||||
|
||||
if ( !fileInfo.suffix().compare("nesproject",Qt::CaseInsensitive) )
|
||||
{
|
||||
if ( nesicideProject->isInitialized() )
|
||||
if ( CNesicideProject::instance()->isInitialized() )
|
||||
{
|
||||
closeProject();
|
||||
}
|
||||
@@ -1705,7 +1730,7 @@ bool MainWindow::openAnyFile(QString fileName)
|
||||
}
|
||||
else if ( !fileInfo.suffix().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
if ( nesicideProject->isInitialized() )
|
||||
if ( CNesicideProject::instance()->isInitialized() )
|
||||
{
|
||||
closeProject();
|
||||
}
|
||||
@@ -1713,7 +1738,7 @@ bool MainWindow::openAnyFile(QString fileName)
|
||||
}
|
||||
else if ( !fileInfo.suffix().compare("c64project",Qt::CaseInsensitive) )
|
||||
{
|
||||
if ( nesicideProject->isInitialized() )
|
||||
if ( CNesicideProject::instance()->isInitialized() )
|
||||
{
|
||||
closeProject();
|
||||
}
|
||||
@@ -1723,7 +1748,7 @@ bool MainWindow::openAnyFile(QString fileName)
|
||||
!fileInfo.suffix().compare("prg",Qt::CaseInsensitive) ||
|
||||
!fileInfo.suffix().compare("d64",Qt::CaseInsensitive) )
|
||||
{
|
||||
if ( nesicideProject->isInitialized() )
|
||||
if ( CNesicideProject::instance()->isInitialized() )
|
||||
{
|
||||
closeProject();
|
||||
}
|
||||
@@ -1788,21 +1813,21 @@ void MainWindow::showEvent(QShowEvent */*event*/)
|
||||
|
||||
void MainWindow::projectDataChangesEvent()
|
||||
{
|
||||
m_pProjectModel->setProject(nesicideProject);
|
||||
m_pProjectModel->setProject(CNesicideProject::instance());
|
||||
|
||||
m_pProjectBrowser->layoutChangedEvent();
|
||||
m_pProjectBrowser->setVisible(nesicideProject->isInitialized());
|
||||
m_pProjectBrowser->setVisible(CNesicideProject::instance()->isInitialized());
|
||||
|
||||
// Enabled/Disable actions based on if we have a project loaded or not
|
||||
actionProject_Properties->setEnabled(nesicideProject->isInitialized());
|
||||
action_Project_Browser->setEnabled(nesicideProject->isInitialized());
|
||||
action_Close_Project->setEnabled(nesicideProject->isInitialized());
|
||||
actionCompile_Project->setEnabled(nesicideProject->isInitialized());
|
||||
actionManage_Add_Ons->setEnabled(nesicideProject->isInitialized());
|
||||
actionSave_Project->setEnabled(nesicideProject->isInitialized());
|
||||
actionSave_Project_As->setEnabled(nesicideProject->isInitialized());
|
||||
actionClean_Project->setEnabled(nesicideProject->isInitialized());
|
||||
actionLoad_In_Emulator->setEnabled(nesicideProject->isInitialized());
|
||||
actionProject_Properties->setEnabled(CNesicideProject::instance()->isInitialized());
|
||||
action_Project_Browser->setEnabled(CNesicideProject::instance()->isInitialized());
|
||||
action_Close_Project->setEnabled(CNesicideProject::instance()->isInitialized());
|
||||
actionCompile_Project->setEnabled(CNesicideProject::instance()->isInitialized());
|
||||
actionManage_Add_Ons->setEnabled(CNesicideProject::instance()->isInitialized());
|
||||
actionSave_Project->setEnabled(CNesicideProject::instance()->isInitialized());
|
||||
actionSave_Project_As->setEnabled(CNesicideProject::instance()->isInitialized());
|
||||
actionClean_Project->setEnabled(CNesicideProject::instance()->isInitialized());
|
||||
actionLoad_In_Emulator->setEnabled(CNesicideProject::instance()->isInitialized());
|
||||
|
||||
if (tabWidget->currentIndex() >= 0)
|
||||
{
|
||||
@@ -1818,12 +1843,12 @@ void MainWindow::projectDataChangesEvent()
|
||||
}
|
||||
}
|
||||
|
||||
setWindowTitle(nesicideProject->getProjectTitle().append("[*] - NESICIDE"));
|
||||
setWindowTitle(CNesicideProject::instance()->getProjectTitle().append("[*] - NESICIDE"));
|
||||
}
|
||||
|
||||
void MainWindow::markProjectDirty(bool dirty)
|
||||
{
|
||||
nesicideProject->setDirty(dirty);
|
||||
CNesicideProject::instance()->setDirty(dirty);
|
||||
setWindowModified(dirty);
|
||||
}
|
||||
|
||||
@@ -1877,17 +1902,17 @@ void MainWindow::on_actionSave_Project_triggered()
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
|
||||
QString fileName;
|
||||
|
||||
fileName = nesicideProject->getProjectFileName();
|
||||
fileName = CNesicideProject::instance()->getProjectFileName();
|
||||
if ( !fileName.compare("(unset)",Qt::CaseInsensitive) )
|
||||
{
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
fileName = QFileDialog::getSaveFileName(this, "Save Project", QDir::currentPath()+QDir::separator()+nesicideProject->getProjectOutputName()+".nesproject",
|
||||
fileName = QFileDialog::getSaveFileName(this, "Save Project", QDir::currentPath()+QDir::separator()+CNesicideProject::instance()->getProjectOutputName()+".nesproject",
|
||||
"NES Project (*.nesproject)");
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
fileName = QFileDialog::getSaveFileName(this, "Save Project", QDir::currentPath()+QDir::separator()+nesicideProject->getProjectOutputName()+".c64project",
|
||||
fileName = QFileDialog::getSaveFileName(this, "Save Project", QDir::currentPath()+QDir::separator()+CNesicideProject::instance()->getProjectOutputName()+".c64project",
|
||||
"C64 Project (*.c64project)");
|
||||
}
|
||||
}
|
||||
@@ -1897,7 +1922,7 @@ void MainWindow::on_actionSave_Project_triggered()
|
||||
saveProject(fileName);
|
||||
}
|
||||
|
||||
nesicideProject->setDirty(false);
|
||||
CNesicideProject::instance()->setDirty(false);
|
||||
|
||||
settings.setValue("LastProject",fileName);
|
||||
}
|
||||
@@ -1950,7 +1975,7 @@ void MainWindow::saveProject(QString fileName)
|
||||
QFile file(fileName);
|
||||
|
||||
// Save the project file name in the project...
|
||||
nesicideProject->setProjectFileName(fileName);
|
||||
CNesicideProject::instance()->setProjectFileName(fileName);
|
||||
|
||||
if ( !file.open( QFile::WriteOnly) )
|
||||
{
|
||||
@@ -1962,7 +1987,7 @@ void MainWindow::saveProject(QString fileName)
|
||||
QDomProcessingInstruction instr = doc.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
|
||||
doc.appendChild(instr);
|
||||
|
||||
if (!nesicideProject->serialize(doc, doc))
|
||||
if (!CNesicideProject::instance()->serialize(doc, doc))
|
||||
{
|
||||
QMessageBox::critical(this, "Error", "An error occured while trying to serialize the project data.");
|
||||
file.close();
|
||||
@@ -1979,11 +2004,11 @@ void MainWindow::saveProject(QString fileName)
|
||||
file.close();
|
||||
|
||||
// Now save the emulator state if a save state file is specified.
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
if ( !nesicideProject->getProjectCartridgeSaveStateName().isEmpty() )
|
||||
if ( !CNesicideProject::instance()->getProjectCartridgeSaveStateName().isEmpty() )
|
||||
{
|
||||
saveEmulatorState(nesicideProject->getProjectCartridgeSaveStateName());
|
||||
saveEmulatorState(CNesicideProject::instance()->getProjectCartridgeSaveStateName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1997,12 +2022,12 @@ void MainWindow::on_actionSave_Project_As_triggered()
|
||||
// file dialog, while creating an instance of QFileDialog results in a non-native file dialog..
|
||||
QString fileName;
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
fileName = QFileDialog::getSaveFileName(this, "Save Project", QDir::currentPath(),
|
||||
"NES Project (*.nesproject)");
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
fileName = QFileDialog::getSaveFileName(this, "Save Project", QDir::currentPath(),
|
||||
"C64 Project (*.c64project)");
|
||||
@@ -2020,7 +2045,7 @@ void MainWindow::on_actionProject_Properties_triggered()
|
||||
|
||||
if (dlg.exec() == QDialog::Accepted)
|
||||
{
|
||||
nesicideProject->setDirty(true);
|
||||
CNesicideProject::instance()->setDirty(true);
|
||||
}
|
||||
|
||||
emit applyProjectProperties();
|
||||
@@ -2079,7 +2104,7 @@ void MainWindow::explodeAddOn(int level,QString projectName,QString addonDirName
|
||||
|
||||
if ( fileInfo.filePath().contains("Source Code") )
|
||||
{
|
||||
CSourceItem *source = nesicideProject->getProject()->getSources()->addSourceFile(projectDirPath);
|
||||
CSourceItem *source = CNesicideProject::instance()->getProject()->getSources()->addSourceFile(projectDirPath);
|
||||
if ( fileInfo.filePath().endsWith("_includeInBuild") )
|
||||
{
|
||||
source->setIncludeInBuild(false);
|
||||
@@ -2087,10 +2112,10 @@ void MainWindow::explodeAddOn(int level,QString projectName,QString addonDirName
|
||||
}
|
||||
else if ( fileInfo.filePath().contains("Custom Rules") )
|
||||
{
|
||||
QStringList customRuleFiles = nesicideProject->getMakefileCustomRuleFiles();
|
||||
QStringList customRuleFiles = CNesicideProject::instance()->getMakefileCustomRuleFiles();
|
||||
customRuleFiles += projectDirPath;
|
||||
customRuleFiles.removeDuplicates();
|
||||
nesicideProject->setMakefileCustomRuleFiles(customRuleFiles);
|
||||
CNesicideProject::instance()->setMakefileCustomRuleFiles(customRuleFiles);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2154,13 +2179,13 @@ void MainWindow::explodeTemplate(int level,QString templateName,QString projectN
|
||||
if ( !fileInfo.suffix().compare("nesproject_in",Qt::CaseInsensitive) )
|
||||
{
|
||||
templateFileContent.replace("<!project-title!>",projectName.toUtf8());
|
||||
templateFileContent.replace("<!project-mapper!>",QString::number(nesicideProject->getCartridge()->getMapperNumber()).toUtf8());
|
||||
templateFileContent.replace("<!project-mapper!>",QString::number(CNesicideProject::instance()->getCartridge()->getMapperNumber()).toUtf8());
|
||||
(*projectFileName) = localFile.fileName();
|
||||
}
|
||||
else if ( !fileInfo.suffix().compare("c64project_in",Qt::CaseInsensitive) )
|
||||
{
|
||||
templateFileContent.replace("<!project-title!>",projectName.toUtf8());
|
||||
templateFileContent.replace("<!project-mapper!>",QString::number(nesicideProject->getCartridge()->getMapperNumber()).toUtf8());
|
||||
templateFileContent.replace("<!project-mapper!>",QString::number(CNesicideProject::instance()->getCartridge()->getMapperNumber()).toUtf8());
|
||||
(*projectFileName) = localFile.fileName();
|
||||
}
|
||||
|
||||
@@ -2197,10 +2222,10 @@ void MainWindow::explodeINESHeaderTemplate(QString templateName,QString projectN
|
||||
{
|
||||
templateFileContent = templateFile.readAll();
|
||||
|
||||
templateFileContent.replace("<!prg-banks!>",QString::number(nesicideProject->getCartridge()->getPrgRomBanks()->childCount(),16));
|
||||
templateFileContent.replace("<!chr-banks!>",QString::number(nesicideProject->getCartridge()->getChrRomBanks()->childCount(),16));
|
||||
templateFileContent.replace("<!mapper-low!>",QString::number((nesicideProject->getCartridge()->getMapperNumber()&0x0F)<<4,16));
|
||||
templateFileContent.replace("<!mapper-high!>",QString::number(nesicideProject->getCartridge()->getMapperNumber()&0xF0,16));
|
||||
templateFileContent.replace("<!prg-banks!>",QString::number(CNesicideProject::instance()->getCartridge()->getPrgRomBanks()->childCount(),16));
|
||||
templateFileContent.replace("<!chr-banks!>",QString::number(CNesicideProject::instance()->getCartridge()->getChrRomBanks()->childCount(),16));
|
||||
templateFileContent.replace("<!mapper-low!>",QString::number((CNesicideProject::instance()->getCartridge()->getMapperNumber()&0x0F)<<4,16));
|
||||
templateFileContent.replace("<!mapper-high!>",QString::number(CNesicideProject::instance()->getCartridge()->getMapperNumber()&0xF0,16));
|
||||
|
||||
localFile.write(templateFileContent.toUtf8());
|
||||
}
|
||||
@@ -2213,7 +2238,7 @@ void MainWindow::on_actionNew_Project_triggered()
|
||||
{
|
||||
on_action_Close_Project_triggered();
|
||||
|
||||
if ( nesicideProject->isInitialized() )
|
||||
if ( CNesicideProject::instance()->isInitialized() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2241,7 +2266,7 @@ void MainWindow::on_actionNew_Project_triggered()
|
||||
}
|
||||
else
|
||||
{
|
||||
nesicideProject->terminateProject();
|
||||
CNesicideProject::instance()->terminateProject();
|
||||
|
||||
QString templateDirName = ":/templates/";
|
||||
QString projectFileName;
|
||||
@@ -2287,7 +2312,7 @@ void MainWindow::openNesROM(QString fileName,bool runRom)
|
||||
|
||||
// Remove any lingering project content
|
||||
m_pProjectBrowser->disableNavigation();
|
||||
nesicideProject->terminateProject();
|
||||
CNesicideProject::instance()->terminateProject();
|
||||
|
||||
if ( !fi.exists() ) return;
|
||||
|
||||
@@ -2303,34 +2328,34 @@ void MainWindow::openNesROM(QString fileName,bool runRom)
|
||||
|
||||
// Create new project from ROM
|
||||
// Set project target before initializing project.
|
||||
nesicideProject->setProjectTarget("nes");
|
||||
nesicideProject->initializeProject();
|
||||
nesicideProject->createProjectFromRom(fileName);
|
||||
CNesicideProject::instance()->setProjectTarget("nes");
|
||||
CNesicideProject::instance()->initializeProject();
|
||||
CNesicideProject::instance()->createProjectFromRom(fileName);
|
||||
|
||||
// Set up some default stuff guessing from the path...
|
||||
QFileInfo fileInfo(fileName);
|
||||
QDir::setCurrent(fileInfo.path());
|
||||
nesicideProject->setProjectTitle(fileInfo.completeBaseName());
|
||||
nesicideProject->setProjectLinkerOutputName(fileInfo.completeBaseName()+".prg");
|
||||
nesicideProject->setProjectCHRROMOutputName(fileInfo.completeBaseName()+".chr");
|
||||
nesicideProject->setProjectCartridgeOutputName(fileInfo.fileName());
|
||||
nesicideProject->setProjectCartridgeSaveStateName(fileInfo.completeBaseName()+".sav");
|
||||
nesicideProject->setProjectDebugInfoName(fileInfo.completeBaseName()+".dbg");
|
||||
CNesicideProject::instance()->setProjectTitle(fileInfo.completeBaseName());
|
||||
CNesicideProject::instance()->setProjectLinkerOutputName(fileInfo.completeBaseName()+".prg");
|
||||
CNesicideProject::instance()->setProjectCHRROMOutputName(fileInfo.completeBaseName()+".chr");
|
||||
CNesicideProject::instance()->setProjectCartridgeOutputName(fileInfo.fileName());
|
||||
CNesicideProject::instance()->setProjectCartridgeSaveStateName(fileInfo.completeBaseName()+".sav");
|
||||
CNesicideProject::instance()->setProjectDebugInfoName(fileInfo.completeBaseName()+".dbg");
|
||||
|
||||
// Load debugger info if we can find it.
|
||||
CCC65Interface::instance()->captureDebugInfo();
|
||||
|
||||
m_pProjectBrowser->enableNavigation();
|
||||
|
||||
if ( !nesicideProject->getProjectCartridgeSaveStateName().isEmpty() )
|
||||
if ( !CNesicideProject::instance()->getProjectCartridgeSaveStateName().isEmpty() )
|
||||
{
|
||||
QDomDocument saveDoc;
|
||||
QFile saveFile( nesicideProject->getProjectCartridgeSaveStateName() );
|
||||
QFile saveFile( CNesicideProject::instance()->getProjectCartridgeSaveStateName() );
|
||||
|
||||
if (saveFile.open(QFile::ReadOnly))
|
||||
{
|
||||
saveDoc.setContent(saveFile.readAll());
|
||||
nesicideProject->setSaveStateDoc(saveDoc);
|
||||
CNesicideProject::instance()->setSaveStateDoc(saveDoc);
|
||||
}
|
||||
saveFile.close();
|
||||
}
|
||||
@@ -2358,7 +2383,7 @@ void MainWindow::openC64File(QString fileName)
|
||||
|
||||
// Remove any lingering project content
|
||||
m_pProjectBrowser->disableNavigation();
|
||||
nesicideProject->terminateProject();
|
||||
CNesicideProject::instance()->terminateProject();
|
||||
|
||||
if ( !fi.exists() ) return;
|
||||
|
||||
@@ -2374,34 +2399,34 @@ void MainWindow::openC64File(QString fileName)
|
||||
|
||||
// Create new project from ROM
|
||||
// Set project target before initializing project.
|
||||
nesicideProject->setProjectTarget("c64");
|
||||
nesicideProject->initializeProject();
|
||||
// nesicideProject->createProjectFromRom(fileName);
|
||||
CNesicideProject::instance()->setProjectTarget("c64");
|
||||
CNesicideProject::instance()->initializeProject();
|
||||
// CNesicideProject::instance()->createProjectFromRom(fileName);
|
||||
|
||||
// Set up some default stuff guessing from the path...
|
||||
QFileInfo fileInfo(fileName);
|
||||
QDir::setCurrent(fileInfo.path());
|
||||
nesicideProject->setProjectTitle(fileInfo.completeBaseName());
|
||||
CNesicideProject::instance()->setProjectTitle(fileInfo.completeBaseName());
|
||||
|
||||
if ( !fileInfo.suffix().compare("c64",Qt::CaseInsensitive) ||
|
||||
!fileInfo.suffix().compare("prg",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesicideProject->setProjectOutputName(fileInfo.completeBaseName()+".c64");
|
||||
nesicideProject->setProjectLinkerOutputName(fileInfo.completeBaseName()+".c64");
|
||||
nesicideProject->setProjectDebugInfoName(fileInfo.completeBaseName()+".dbg");
|
||||
CNesicideProject::instance()->setProjectOutputName(fileInfo.completeBaseName()+".c64");
|
||||
CNesicideProject::instance()->setProjectLinkerOutputName(fileInfo.completeBaseName()+".c64");
|
||||
CNesicideProject::instance()->setProjectDebugInfoName(fileInfo.completeBaseName()+".dbg");
|
||||
|
||||
// Load debugger info if we can find it.
|
||||
CCC65Interface::instance()->captureDebugInfo();
|
||||
}
|
||||
else if ( !fileInfo.suffix().compare("d64",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesicideProject->setProjectOutputName(fileInfo.completeBaseName()+".d64");
|
||||
nesicideProject->setProjectLinkerOutputName(fileInfo.completeBaseName()+".d64");
|
||||
CNesicideProject::instance()->setProjectOutputName(fileInfo.completeBaseName()+".d64");
|
||||
CNesicideProject::instance()->setProjectLinkerOutputName(fileInfo.completeBaseName()+".d64");
|
||||
}
|
||||
|
||||
nesicideProject->setProjectCHRROMOutputName("");
|
||||
nesicideProject->setProjectCartridgeOutputName("");
|
||||
nesicideProject->setProjectCartridgeSaveStateName("");
|
||||
CNesicideProject::instance()->setProjectCHRROMOutputName("");
|
||||
CNesicideProject::instance()->setProjectCartridgeOutputName("");
|
||||
CNesicideProject::instance()->setProjectCartridgeSaveStateName("");
|
||||
|
||||
m_pProjectBrowser->enableNavigation();
|
||||
|
||||
@@ -2417,7 +2442,7 @@ void MainWindow::on_actionCreate_Project_from_File_triggered()
|
||||
{
|
||||
on_action_Close_Project_triggered();
|
||||
|
||||
if ( nesicideProject->isInitialized() )
|
||||
if ( CNesicideProject::instance()->isInitialized() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2570,7 +2595,7 @@ void MainWindow::closeEvent ( QCloseEvent* event )
|
||||
// can't synchronize to disk if we wait for that.
|
||||
settings.sync();
|
||||
|
||||
if (nesicideProject->isInitialized())
|
||||
if (CNesicideProject::instance()->isInitialized())
|
||||
{
|
||||
cancel = closeProject();
|
||||
|
||||
@@ -2629,9 +2654,9 @@ void MainWindow::openNesProject(QString fileName,bool runRom)
|
||||
m_pProjectBrowser->disableNavigation();
|
||||
|
||||
// Set project target before initializing project.
|
||||
nesicideProject->setProjectTarget("nes");
|
||||
nesicideProject->initializeProject();
|
||||
nesicideProject->setProjectFileName(fileName);
|
||||
CNesicideProject::instance()->setProjectTarget("nes");
|
||||
CNesicideProject::instance()->initializeProject();
|
||||
CNesicideProject::instance()->setProjectFileName(fileName);
|
||||
|
||||
// Clear output
|
||||
output->clearAllPanes();
|
||||
@@ -2641,35 +2666,35 @@ void MainWindow::openNesProject(QString fileName,bool runRom)
|
||||
QDir::setCurrent(fileInfo.path());
|
||||
|
||||
// Load new project content
|
||||
ok = nesicideProject->deserialize(doc,doc,errors);
|
||||
ok = CNesicideProject::instance()->deserialize(doc,doc,errors);
|
||||
if ( !ok )
|
||||
{
|
||||
QMessageBox::warning(this,"Project Load Error", "The project failed to load.\n\n"+errors);
|
||||
|
||||
nesicideProject->terminateProject();
|
||||
CNesicideProject::instance()->terminateProject();
|
||||
}
|
||||
|
||||
// Load ROM if it exists.
|
||||
if ( !nesicideProject->getProjectCartridgeOutputName().isEmpty() )
|
||||
if ( !CNesicideProject::instance()->getProjectCartridgeOutputName().isEmpty() )
|
||||
{
|
||||
QDir dir(QDir::currentPath());
|
||||
QString romName;
|
||||
romName = dir.fromNativeSeparators(dir.relativeFilePath(nesicideProject->getProjectCartridgeOutputName()));
|
||||
romName = dir.fromNativeSeparators(dir.relativeFilePath(CNesicideProject::instance()->getProjectCartridgeOutputName()));
|
||||
|
||||
nesicideProject->createProjectFromRom(romName,true);
|
||||
CNesicideProject::instance()->createProjectFromRom(romName,true);
|
||||
|
||||
// Load debugger info if we can find it.
|
||||
CCC65Interface::instance()->captureDebugInfo();
|
||||
|
||||
if ( !nesicideProject->getProjectCartridgeSaveStateName().isEmpty() )
|
||||
if ( !CNesicideProject::instance()->getProjectCartridgeSaveStateName().isEmpty() )
|
||||
{
|
||||
QDomDocument saveDoc;
|
||||
QFile saveFile( nesicideProject->getProjectCartridgeSaveStateName() );
|
||||
QFile saveFile( CNesicideProject::instance()->getProjectCartridgeSaveStateName() );
|
||||
|
||||
if (saveFile.open(QFile::ReadOnly))
|
||||
{
|
||||
saveDoc.setContent(saveFile.readAll());
|
||||
nesicideProject->setSaveStateDoc(saveDoc);
|
||||
CNesicideProject::instance()->setSaveStateDoc(saveDoc);
|
||||
}
|
||||
saveFile.close();
|
||||
}
|
||||
@@ -2691,7 +2716,7 @@ void MainWindow::openNesProject(QString fileName,bool runRom)
|
||||
}
|
||||
else
|
||||
{
|
||||
nesicideProject->terminateProject();
|
||||
CNesicideProject::instance()->terminateProject();
|
||||
|
||||
projectDataChangesEvent();
|
||||
}
|
||||
@@ -2729,9 +2754,9 @@ void MainWindow::openC64Project(QString fileName,bool run)
|
||||
m_pProjectBrowser->disableNavigation();
|
||||
|
||||
// Set project target before initializing project.
|
||||
nesicideProject->setProjectTarget("c64");
|
||||
nesicideProject->initializeProject();
|
||||
nesicideProject->setProjectFileName(fileName);
|
||||
CNesicideProject::instance()->setProjectTarget("c64");
|
||||
CNesicideProject::instance()->initializeProject();
|
||||
CNesicideProject::instance()->setProjectFileName(fileName);
|
||||
|
||||
// Clear output
|
||||
output->clearAllPanes();
|
||||
@@ -2741,20 +2766,20 @@ void MainWindow::openC64Project(QString fileName,bool run)
|
||||
QDir::setCurrent(fileInfo.path());
|
||||
|
||||
// Load new project content
|
||||
ok = nesicideProject->deserialize(doc,doc,errors);
|
||||
ok = CNesicideProject::instance()->deserialize(doc,doc,errors);
|
||||
if ( !ok )
|
||||
{
|
||||
QMessageBox::warning(this,"Project Load Error", "The project failed to load.\n\n"+errors);
|
||||
|
||||
nesicideProject->terminateProject();
|
||||
CNesicideProject::instance()->terminateProject();
|
||||
}
|
||||
|
||||
// Load C64 image if it exists.
|
||||
if ( !nesicideProject->getProjectLinkerOutputName().isEmpty() )
|
||||
if ( !CNesicideProject::instance()->getProjectLinkerOutputName().isEmpty() )
|
||||
{
|
||||
QDir dir(QDir::currentPath());
|
||||
QString c64Name;
|
||||
c64Name = dir.fromNativeSeparators(dir.relativeFilePath(nesicideProject->getProjectLinkerOutputName()));
|
||||
c64Name = dir.fromNativeSeparators(dir.relativeFilePath(CNesicideProject::instance()->getProjectLinkerOutputName()));
|
||||
|
||||
// Load debugger info if we can find it.
|
||||
CCC65Interface::instance()->captureDebugInfo();
|
||||
@@ -2770,7 +2795,7 @@ void MainWindow::openC64Project(QString fileName,bool run)
|
||||
}
|
||||
else
|
||||
{
|
||||
nesicideProject->terminateProject();
|
||||
CNesicideProject::instance()->terminateProject();
|
||||
|
||||
projectDataChangesEvent();
|
||||
}
|
||||
@@ -2780,7 +2805,7 @@ void MainWindow::on_actionOpen_Project_triggered()
|
||||
{
|
||||
on_action_Close_Project_triggered();
|
||||
|
||||
if ( nesicideProject->isInitialized() )
|
||||
if ( CNesicideProject::instance()->isInitialized() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -3056,7 +3081,7 @@ bool MainWindow::closeProject()
|
||||
}
|
||||
}
|
||||
|
||||
if (nesicideProject->isDirty())
|
||||
if (CNesicideProject::instance()->isDirty())
|
||||
{
|
||||
int result = QMessageBox::question(this,"Save Project?","Your project settings, project content, or debugger content has changed, would you like to save the project?",QMessageBox::Yes,QMessageBox::No,QMessageBox::Cancel);
|
||||
if ( result == QMessageBox::Yes )
|
||||
@@ -3081,11 +3106,11 @@ bool MainWindow::closeProject()
|
||||
emit pauseEmulation(false);
|
||||
|
||||
// Now save the emulator state if a save state file is specified.
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
if ( !nesicideProject->getProjectCartridgeSaveStateName().isEmpty() )
|
||||
if ( !CNesicideProject::instance()->getProjectCartridgeSaveStateName().isEmpty() )
|
||||
{
|
||||
saveEmulatorState(nesicideProject->getProjectCartridgeSaveStateName());
|
||||
saveEmulatorState(CNesicideProject::instance()->getProjectCartridgeSaveStateName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3101,7 +3126,7 @@ bool MainWindow::closeProject()
|
||||
|
||||
CCC65Interface::instance()->clear();
|
||||
|
||||
nesicideProject->terminateProject();
|
||||
CNesicideProject::instance()->terminateProject();
|
||||
|
||||
NESEmulatorThread* emulator = dynamic_cast<NESEmulatorThread*>(CObjectRegistry::instance()->getObject("Emulator"));
|
||||
|
||||
@@ -3731,11 +3756,11 @@ void MainWindow::updateFromEmulatorPrefs(bool initial)
|
||||
|
||||
void MainWindow::actionConfigure_triggered()
|
||||
{
|
||||
EmulatorPrefsDialog dlg(nesicideProject->getProjectTarget());
|
||||
EmulatorPrefsDialog dlg(CNesicideProject::instance()->getProjectTarget());
|
||||
|
||||
dlg.exec();
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
updateFromEmulatorPrefs(false);
|
||||
}
|
||||
@@ -3756,7 +3781,7 @@ void MainWindow::on_actionLoad_In_Emulator_triggered()
|
||||
{
|
||||
actionLoad_In_Emulator->setEnabled(false);
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
if ( !CNesicideProject::instance()->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
buildTextLogger->write("<b>Loading ROM...</b>");
|
||||
|
||||
@@ -3776,7 +3801,7 @@ void MainWindow::on_actionLoad_In_Emulator_triggered()
|
||||
|
||||
buildTextLogger->write("<b>Load complete.</b>");
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
else if ( !CNesicideProject::instance()->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
buildTextLogger->write("<b>Loading C64...</b>");
|
||||
|
||||
@@ -4040,7 +4065,7 @@ void MainWindow::on_actionCoding_Mode_triggered()
|
||||
|
||||
actionDebugging_Mode->setChecked(false);
|
||||
actionCoding_Mode->setChecked(true);
|
||||
appSettings->setAppMode(AppSettings::CodingMode);
|
||||
AppSettings::instance()->setAppMode(AppSettings::CodingMode);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionDebugging_Mode_triggered()
|
||||
@@ -4071,7 +4096,7 @@ void MainWindow::on_actionDebugging_Mode_triggered()
|
||||
|
||||
// Always show emulator
|
||||
CDockWidgetRegistry::instance()->getWidget("Emulator")->show();
|
||||
appSettings->setAppMode(AppSettings::DebuggingMode);
|
||||
AppSettings::instance()->setAppMode(AppSettings::DebuggingMode);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionExit_triggered()
|
||||
@@ -4086,7 +4111,7 @@ void MainWindow::applyAddOns(QStringList addOns)
|
||||
|
||||
foreach ( QString addon_uri, addOns )
|
||||
{
|
||||
explodeAddOn(0,nesicideProject->getProjectTitle(),addon_uri,QDir::currentPath());
|
||||
explodeAddOn(0,CNesicideProject::instance()->getProjectTitle(),addon_uri,QDir::currentPath());
|
||||
}
|
||||
|
||||
emit applyProjectProperties();
|
||||
@@ -4098,7 +4123,7 @@ void MainWindow::applyAddOns(QStringList addOns)
|
||||
void MainWindow::on_actionManage_Add_Ons_triggered()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
|
||||
NewProjectDialog dlg("Add-Ons",nesicideProject->getProjectTitle(),settings.value("LastProjectBasePath").toString(),true);
|
||||
NewProjectDialog dlg("Add-Ons",CNesicideProject::instance()->getProjectTitle(),settings.value("LastProjectBasePath").toString(),true);
|
||||
|
||||
if (dlg.exec() == QDialog::Accepted)
|
||||
{
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "c64emulatorthread.h"
|
||||
#include "c64emulatorcontrol.h"
|
||||
#include "cexpandablestatusbar.h"
|
||||
#include "testsuiteexecutivedialog.h"
|
||||
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
@@ -202,6 +203,9 @@ protected:
|
||||
// Project data wrappers
|
||||
CProjectModel* m_pProjectModel;
|
||||
|
||||
// Modeless dialog for Test Suite executive.
|
||||
TestSuiteExecutiveDialog* testSuiteExecutive;
|
||||
|
||||
private:
|
||||
bool openAnyFile(QString fileName);
|
||||
void openNesProject(QString fileName,bool runRom=true);
|
||||
|
||||
@@ -69,7 +69,7 @@ CDesignerEditorBase *CGraphicsBankModel::createEditorWidget(const QUuid &uuid) c
|
||||
if (bank == NULL)
|
||||
return NULL;
|
||||
// Data item needs to know its editor.
|
||||
bank->setEditor(new GraphicsBankEditorForm(bank->getGraphics(), bank));
|
||||
bank->setEditor(new GraphicsBankEditorForm(bank->getSize(),bank->getGraphics(), bank));
|
||||
return bank->editor();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "nes_emulator_core.h"
|
||||
|
||||
CGameDatabaseHandler *CGameDatabaseHandler::_instance = NULL;
|
||||
|
||||
CGameDatabaseHandler::CGameDatabaseHandler()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -13,7 +13,14 @@
|
||||
class CGameDatabaseHandler
|
||||
{
|
||||
public:
|
||||
CGameDatabaseHandler();
|
||||
static CGameDatabaseHandler *instance()
|
||||
{
|
||||
if ( !_instance )
|
||||
{
|
||||
_instance = new CGameDatabaseHandler();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
bool initialize(QString fileName);
|
||||
|
||||
// Database information.
|
||||
@@ -47,6 +54,9 @@ public:
|
||||
{
|
||||
CART_DATA("sha1").toUpper();
|
||||
}
|
||||
private:
|
||||
static CGameDatabaseHandler *_instance;
|
||||
CGameDatabaseHandler();
|
||||
|
||||
protected:
|
||||
QDomDocument m_db;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "ccc65interface.h"
|
||||
#include "cnesicideproject.h"
|
||||
#include "main.h"
|
||||
|
||||
CCartridgeBuilder::CCartridgeBuilder()
|
||||
{
|
||||
@@ -35,10 +34,10 @@ bool CCartridgeBuilder::build()
|
||||
{
|
||||
CSourceAssembler sourceAssembler;
|
||||
CGraphicsAssembler graphicsAssembler;
|
||||
CGraphicsBanks* gfxBanks = nesicideProject->getProject()->getGraphicsBanks();
|
||||
CGraphicsBanks* gfxBanks = CNesicideProject::instance()->getProject()->getGraphicsBanks();
|
||||
QDir baseDir(QDir::currentPath());
|
||||
QDir outputPRGDir(nesicideProject->getProjectLinkerOutputBasePath());
|
||||
QDir outputCHRDir(nesicideProject->getProjectCHRROMOutputBasePath());
|
||||
QDir outputPRGDir(CNesicideProject::instance()->getProjectLinkerOutputBasePath());
|
||||
QDir outputCHRDir(CNesicideProject::instance()->getProjectCHRROMOutputBasePath());
|
||||
QString prgName;
|
||||
QString chrName;
|
||||
QString nesName;
|
||||
@@ -47,29 +46,29 @@ bool CCartridgeBuilder::build()
|
||||
QFile nesFile;
|
||||
bool ok;
|
||||
|
||||
if ( nesicideProject->getProjectLinkerOutputName().isEmpty() )
|
||||
if ( CNesicideProject::instance()->getProjectLinkerOutputName().isEmpty() )
|
||||
{
|
||||
prgName = outputPRGDir.fromNativeSeparators(outputPRGDir.filePath(nesicideProject->getProjectOutputName()+".prg"));
|
||||
prgName = outputPRGDir.fromNativeSeparators(outputPRGDir.filePath(CNesicideProject::instance()->getProjectOutputName()+".prg"));
|
||||
}
|
||||
else
|
||||
{
|
||||
prgName = outputPRGDir.fromNativeSeparators(outputPRGDir.filePath(nesicideProject->getProjectLinkerOutputName()));
|
||||
prgName = outputPRGDir.fromNativeSeparators(outputPRGDir.filePath(CNesicideProject::instance()->getProjectLinkerOutputName()));
|
||||
}
|
||||
if ( nesicideProject->getProjectCHRROMOutputName().isEmpty() )
|
||||
if ( CNesicideProject::instance()->getProjectCHRROMOutputName().isEmpty() )
|
||||
{
|
||||
chrName = outputCHRDir.fromNativeSeparators(outputCHRDir.filePath(nesicideProject->getProjectOutputName()+".chr"));
|
||||
chrName = outputCHRDir.fromNativeSeparators(outputCHRDir.filePath(CNesicideProject::instance()->getProjectOutputName()+".chr"));
|
||||
}
|
||||
else
|
||||
{
|
||||
chrName = outputCHRDir.fromNativeSeparators(outputCHRDir.filePath(nesicideProject->getProjectCHRROMOutputName()));
|
||||
chrName = outputCHRDir.fromNativeSeparators(outputCHRDir.filePath(CNesicideProject::instance()->getProjectCHRROMOutputName()));
|
||||
}
|
||||
if ( nesicideProject->getProjectCartridgeOutputName().isEmpty() )
|
||||
if ( CNesicideProject::instance()->getProjectCartridgeOutputName().isEmpty() )
|
||||
{
|
||||
nesName = baseDir.fromNativeSeparators(baseDir.relativeFilePath(nesicideProject->getProjectOutputName()+".nes"));
|
||||
nesName = baseDir.fromNativeSeparators(baseDir.relativeFilePath(CNesicideProject::instance()->getProjectOutputName()+".nes"));
|
||||
}
|
||||
else
|
||||
{
|
||||
nesName = baseDir.fromNativeSeparators(baseDir.relativeFilePath(nesicideProject->getProjectCartridgeOutputName()));
|
||||
nesName = baseDir.fromNativeSeparators(baseDir.relativeFilePath(CNesicideProject::instance()->getProjectCartridgeOutputName()));
|
||||
}
|
||||
|
||||
prgFile.setFileName(prgName);
|
||||
@@ -86,7 +85,7 @@ bool CCartridgeBuilder::build()
|
||||
(CCC65Interface::instance()->getAssemblerSourcesFromProject().count()) ||
|
||||
(CCC65Interface::instance()->getCustomSourcesFromProject().count()) )
|
||||
{
|
||||
if ( !nesicideProject->getLinkerConfigFile().isEmpty() )
|
||||
if ( !CNesicideProject::instance()->getLinkerConfigFile().isEmpty() )
|
||||
{
|
||||
ok = graphicsAssembler.assemble();
|
||||
if ( ok )
|
||||
@@ -126,7 +125,7 @@ bool CCartridgeBuilder::build()
|
||||
|
||||
nesFile.write(prgBytes);
|
||||
|
||||
if ( (nesicideProject->getProjectUsesCHRROM()) &&
|
||||
if ( (CNesicideProject::instance()->getProjectUsesCHRROM()) &&
|
||||
(gfxBanks->getGraphicsBanks().count()) )
|
||||
{
|
||||
nesFile.write(chrBytes);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "cgraphicsassembler.h"
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
static const char emptyBank[MEM_8KB] = { 0, };
|
||||
|
||||
CGraphicsAssembler::CGraphicsAssembler()
|
||||
@@ -16,10 +14,14 @@ void CGraphicsAssembler::clean()
|
||||
|
||||
bool CGraphicsAssembler::assemble()
|
||||
{
|
||||
CGraphicsBanks* gfxBanks = nesicideProject->getProject()->getGraphicsBanks();
|
||||
QDir outputDir(nesicideProject->getProjectCHRROMOutputBasePath());
|
||||
CGraphicsBanks* gfxBanks = CNesicideProject::instance()->getProject()->getGraphicsBanks();
|
||||
CCHRROMBanks* chrBanks = CNesicideProject::instance()->getCartridge()->getChrRomBanks();
|
||||
QDir outputDir(CNesicideProject::instance()->getProjectCHRROMOutputBasePath());
|
||||
QString outputName;
|
||||
QFile chrRomFile;
|
||||
int gfxBankSize;
|
||||
int currentChrSize;
|
||||
int currentGfxSize;
|
||||
|
||||
// Make sure directory exists...
|
||||
if ( !outputDir.exists() )
|
||||
@@ -27,13 +29,13 @@ bool CGraphicsAssembler::assemble()
|
||||
outputDir.mkpath(outputDir.path());
|
||||
}
|
||||
|
||||
if ( nesicideProject->getProjectCHRROMOutputName().isEmpty() )
|
||||
if ( CNesicideProject::instance()->getProjectCHRROMOutputName().isEmpty() )
|
||||
{
|
||||
outputName = outputDir.fromNativeSeparators(outputDir.filePath(nesicideProject->getProjectOutputName()+".chr"));
|
||||
outputName = outputDir.fromNativeSeparators(outputDir.filePath(CNesicideProject::instance()->getProjectOutputName()+".chr"));
|
||||
}
|
||||
else
|
||||
{
|
||||
outputName = outputDir.fromNativeSeparators(outputDir.filePath(nesicideProject->getProjectCHRROMOutputName()));
|
||||
outputName = outputDir.fromNativeSeparators(outputDir.filePath(CNesicideProject::instance()->getProjectCHRROMOutputName()));
|
||||
}
|
||||
|
||||
if ( gfxBanks->getGraphicsBanks().count() )
|
||||
@@ -44,9 +46,16 @@ bool CGraphicsAssembler::assemble()
|
||||
chrRomFile.open(QIODevice::ReadWrite|QIODevice::Truncate);
|
||||
if ( chrRomFile.isOpen() )
|
||||
{
|
||||
for (int gfxBankIdx = 0; gfxBankIdx < gfxBanks->getGraphicsBanks().count(); gfxBankIdx++)
|
||||
currentChrSize = 0;
|
||||
|
||||
for (int chrBankIdx = 0, gfxBankIdx = 0; gfxBankIdx < gfxBanks->getGraphicsBanks().count(); gfxBankIdx++)
|
||||
{
|
||||
CGraphicsBank* curGfxBank = gfxBanks->getGraphicsBanks().at(gfxBankIdx);
|
||||
CGraphicsBank *curGfxBank = gfxBanks->getGraphicsBanks().at(gfxBankIdx);
|
||||
CCHRROMBank *curChrBank = chrBanks->getChrRomBanks().at(chrBankIdx);
|
||||
uint8_t *pChrBankData = curChrBank->getBankData()+currentChrSize;
|
||||
|
||||
gfxBankSize = curGfxBank->getSize();
|
||||
currentGfxSize = 0;
|
||||
|
||||
buildTextLogger->write("Constructing '" + curGfxBank->caption() + "':");
|
||||
|
||||
@@ -58,13 +67,42 @@ bool CGraphicsAssembler::assemble()
|
||||
IProjectTreeViewItem* ptvi = dynamic_cast<IProjectTreeViewItem*>(bankItem);
|
||||
buildTextLogger->write(" Adding: "+ptvi->caption()+"("+QString::number(bankItem->getChrRomBankItemSize())+" bytes)");
|
||||
|
||||
chrRomFile.write(bankItem->getChrRomBankItemData().data(), bankItem->getChrRomBankItemSize());
|
||||
QByteArray bankItemData = bankItem->getChrRomBankItemData();
|
||||
currentGfxSize += bankItemData.count();
|
||||
currentChrSize += bankItemData.count();
|
||||
if ( currentGfxSize > gfxBankSize )
|
||||
{
|
||||
buildTextLogger->write("<font color='red'>"+curGfxBank->caption()+"("+QString::number(gfxBankSize)+"): Warning: too much data for specified size</font>");
|
||||
bankItemData.truncate(gfxBankSize);
|
||||
}
|
||||
chrRomFile.write(bankItemData.data(), bankItemData.count());
|
||||
memcpy(pChrBankData,bankItemData.data(),bankItemData.count());
|
||||
pChrBankData += bankItemData.count();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 8KB of empty space
|
||||
chrRomFile.write(emptyBank,MEM_8KB);
|
||||
// 1,2,4, or 8KB of empty space
|
||||
chrRomFile.write(emptyBank,curGfxBank->getSize());
|
||||
memset(pChrBankData,0,curGfxBank->getSize());
|
||||
pChrBankData += curGfxBank->getSize();
|
||||
}
|
||||
|
||||
if ( (gfxBankIdx < gfxBanks->getGraphicsBanks().count()-1) &&
|
||||
(currentChrSize >= MEM_8KB) )
|
||||
{
|
||||
currentChrSize = 0;
|
||||
chrBankIdx++;
|
||||
|
||||
CCHRROMBanks *chrRomBanks = CNesicideProject::instance()->getCartridge()->getChrRomBanks();
|
||||
if ( chrBankIdx >= chrRomBanks->getChrRomBanks().count() )
|
||||
{
|
||||
CCHRROMBank *curBank = new CCHRROMBank(CNesicideProject::instance()->getCartridge()->getChrRomBanks());
|
||||
// This is a new bank
|
||||
curBank->setBankIndex(chrRomBanks->getChrRomBanks().count());
|
||||
chrRomBanks->appendChild(curBank);
|
||||
chrRomBanks->getChrRomBanks().append(curBank);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
APUInformationDockWidget::APUInformationDockWidget(QWidget *parent) :
|
||||
CDebuggerBase(parent),
|
||||
ui(new Ui::APUInformationDockWidget)
|
||||
@@ -19,14 +17,18 @@ APUInformationDockWidget::~APUInformationDockWidget()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void APUInformationDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void APUInformationDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
QObject::connect ( emulator, SIGNAL(machineReady()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(updateInformation()) );
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateInformation()) );
|
||||
if ( !target.compare("nes") )
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
|
||||
QObject::connect ( emulator, SIGNAL(machineReady()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateInformation()) );
|
||||
}
|
||||
}
|
||||
|
||||
void APUInformationDockWidget::changeEvent(QEvent* e)
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "iprojecttreeviewitem.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
CChrRomItemListDisplayModel::CChrRomItemListDisplayModel(QObject* parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
#include "iprojecttreeviewitem.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
static const char* CLICK_TO_ADD_OR_EDIT = "<click to add or edit>";
|
||||
static const char* CLICK_TO_ADD = "<click to add>";
|
||||
|
||||
CChrRomItemTableDisplayModel::CChrRomItemTableDisplayModel(bool editable,QObject* /*parent*/)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ QVariant CChrRomItemTableDisplayModel::data(const QModelIndex& index, int role)
|
||||
|
||||
if ( index.column() == ChrRomBankItemCol_Name )
|
||||
{
|
||||
return QVariant(CLICK_TO_ADD_OR_EDIT);
|
||||
return QVariant(CLICK_TO_ADD);
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
@@ -156,7 +156,7 @@ bool CChrRomItemTableDisplayModel::setData ( const QModelIndex& index, const QVa
|
||||
bool ok = false;
|
||||
IChrRomBankItem* item;
|
||||
|
||||
IProjectTreeViewItemIterator iter(nesicideProject->getProject());
|
||||
IProjectTreeViewItemIterator iter(CNesicideProject::instance()->getProject());
|
||||
do
|
||||
{
|
||||
item = dynamic_cast<IChrRomBankItem*>(iter.current());
|
||||
@@ -182,7 +182,7 @@ bool CChrRomItemTableDisplayModel::setData ( const QModelIndex& index, const QVa
|
||||
else
|
||||
{
|
||||
if ( (!value.toString().isEmpty()) &&
|
||||
(value != CLICK_TO_ADD_OR_EDIT) )
|
||||
(value != CLICK_TO_ADD) )
|
||||
{
|
||||
beginInsertRows(QModelIndex(),chrRomBankItems.count()+1,chrRomBankItems.count()+1);
|
||||
chrRomBankItems.append(item);
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
#include "dbg_cnesppu.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
#include "cdesignercommon.h"
|
||||
#include "cchrrombank.h"
|
||||
|
||||
CHRROMDisplayDialog::CHRROMDisplayDialog(bool usePPU,qint8* data,IProjectTreeViewItem* link,QWidget* parent) :
|
||||
CDesignerEditorBase(link,parent),
|
||||
@@ -17,6 +18,7 @@ CHRROMDisplayDialog::CHRROMDisplayDialog(bool usePPU,qint8* data,IProjectTreeVie
|
||||
info = new QLabel(this);
|
||||
|
||||
m_usePPU = usePPU;
|
||||
m_link = link;
|
||||
|
||||
imgData = new int8_t[256*128*4];
|
||||
memset(imgData,0,sizeof(imgData));
|
||||
@@ -51,6 +53,9 @@ CHRROMDisplayDialog::CHRROMDisplayDialog(bool usePPU,qint8* data,IProjectTreeVie
|
||||
renderer = new PanZoomRenderer(256,128,2000,imgData,true,ui->frame);
|
||||
renderData();
|
||||
|
||||
QObject* compiler = CObjectRegistry::instance()->getObject("Compiler");
|
||||
QObject::connect(compiler,SIGNAL(compileDone(bool)),this,SLOT(compiler_compileDone(bool)));
|
||||
|
||||
// No thread necessary.
|
||||
pThread = NULL;
|
||||
}
|
||||
@@ -83,17 +88,20 @@ CHRROMDisplayDialog::~CHRROMDisplayDialog()
|
||||
delete renderer;
|
||||
}
|
||||
|
||||
void CHRROMDisplayDialog::updateTargetMachine(QString /*target*/)
|
||||
void CHRROMDisplayDialog::updateTargetMachine(QString target)
|
||||
{
|
||||
if ( m_usePPU )
|
||||
if ( !target.compare("nes") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
if ( m_usePPU )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),pThread,SLOT(updateDebuggers()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,3 +326,29 @@ void CHRROMDisplayDialog::on_exportPushButton_clicked()
|
||||
void CHRROMDisplayDialog::applyProjectPropertiesToTab()
|
||||
{
|
||||
}
|
||||
|
||||
void CHRROMDisplayDialog::applyChangesToTab(QString /*uuid*/)
|
||||
{
|
||||
repaintNeeded();
|
||||
}
|
||||
|
||||
void CHRROMDisplayDialog::compiler_compileDone(bool bOk)
|
||||
{
|
||||
// On compile, pull my new bank data.
|
||||
if ( bOk )
|
||||
{
|
||||
if ( !m_usePPU )
|
||||
{
|
||||
if ( m_link )
|
||||
{
|
||||
IProjectTreeViewItem *ptvi = dynamic_cast<IProjectTreeViewItem*>(m_link);
|
||||
CCHRROMBank *pcrb = dynamic_cast<CCHRROMBank*>(ptvi);
|
||||
if ( pcrb )
|
||||
{
|
||||
memcpy(chrrom,pcrb->getBankData(),MEM_8KB);
|
||||
repaintNeeded();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ private:
|
||||
Ui::CHRROMDisplayDialog* ui;
|
||||
QLabel* info;
|
||||
int8_t* imgData;
|
||||
IProjectTreeViewItem *m_link;
|
||||
bool m_usePPU;
|
||||
DebuggerUpdateThread* pThread;
|
||||
PanZoomRenderer* renderer;
|
||||
@@ -49,11 +50,13 @@ public slots:
|
||||
void renderData();
|
||||
void repaintNeeded();
|
||||
void updateTargetMachine(QString target);
|
||||
void applyProjectPropertiesToTab();
|
||||
void applyChangesToTab(QString /*uuid*/);
|
||||
void compiler_compileDone(bool bOk);
|
||||
|
||||
private slots:
|
||||
void on_exportPushButton_clicked();
|
||||
void on_updateScanline_editingFinished();
|
||||
void applyProjectPropertiesToTab();
|
||||
};
|
||||
|
||||
#endif // CHRROMDISPLAYDIALOG_H
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#include <QFileDialog>
|
||||
#include <QDir>
|
||||
|
||||
#include "codedataloggerdockwidget.h"
|
||||
#include "ui_codedataloggerdockwidget.h"
|
||||
|
||||
@@ -5,7 +8,6 @@
|
||||
#include "dbg_cnesppu.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
CodeDataLoggerDockWidget::CodeDataLoggerDockWidget(QWidget *parent) :
|
||||
CDebuggerBase(parent),
|
||||
@@ -43,15 +45,18 @@ CodeDataLoggerDockWidget::~CodeDataLoggerDockWidget()
|
||||
delete renderer;
|
||||
}
|
||||
|
||||
void CodeDataLoggerDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void CodeDataLoggerDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
if ( target.compare("none") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),pThread,SLOT(updateDebuggers()));
|
||||
}
|
||||
}
|
||||
|
||||
void CodeDataLoggerDockWidget::changeEvent(QEvent* e)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <QMenu>
|
||||
|
||||
#include "executionvisualizerdockwidget.h"
|
||||
#include "ui_executionvisualizerdockwidget.h"
|
||||
|
||||
@@ -10,7 +12,6 @@
|
||||
#include "nes_emulator_core.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
ExecutionVisualizerDockWidget::ExecutionVisualizerDockWidget(QWidget *parent) :
|
||||
CDebuggerBase(parent),
|
||||
@@ -58,15 +59,18 @@ ExecutionVisualizerDockWidget::~ExecutionVisualizerDockWidget()
|
||||
delete model;
|
||||
}
|
||||
|
||||
void ExecutionVisualizerDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void ExecutionVisualizerDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
if ( target.compare("none") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),pThread,SLOT(updateDebuggers()));
|
||||
}
|
||||
}
|
||||
|
||||
void ExecutionVisualizerDockWidget::changeEvent(QEvent* event)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "nes_emulator_core.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
JoypadLoggerDockWidget::JoypadLoggerDockWidget(QWidget *parent) :
|
||||
CDebuggerBase(parent),
|
||||
@@ -47,8 +46,10 @@ JoypadLoggerDockWidget::~JoypadLoggerDockWidget()
|
||||
// delete renderer;
|
||||
}
|
||||
|
||||
void JoypadLoggerDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void JoypadLoggerDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
if ( !target.compare("nes") )
|
||||
{
|
||||
// QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
// QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
@@ -56,6 +57,7 @@ void JoypadLoggerDockWidget::updateTargetMachine(QString /*target*/)
|
||||
// QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
// QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),pThread,SLOT(updateDebuggers()));
|
||||
// QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),pThread,SLOT(updateDebuggers()));
|
||||
}
|
||||
}
|
||||
|
||||
void JoypadLoggerDockWidget::changeEvent(QEvent* e)
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "dbg_cnesmappers.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -55,15 +54,18 @@ MapperInformationDockWidget::~MapperInformationDockWidget()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MapperInformationDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void MapperInformationDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
if ( !target.compare("nes") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( emulator, SIGNAL(machineReady()), this, SLOT(machineReady()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(machineReady()), this, SLOT(machineReady()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateInformation()) );
|
||||
}
|
||||
}
|
||||
|
||||
void MapperInformationDockWidget::changeEvent(QEvent* e)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "dbg_cnesppu.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
#include "cdesignercommon.h"
|
||||
|
||||
NameTableVisualizerDockWidget::NameTableVisualizerDockWidget(QWidget *parent) :
|
||||
CDebuggerBase(parent),
|
||||
@@ -46,15 +46,18 @@ NameTableVisualizerDockWidget::~NameTableVisualizerDockWidget()
|
||||
delete renderer;
|
||||
}
|
||||
|
||||
void NameTableVisualizerDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void NameTableVisualizerDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
if ( !target.compare("nes") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),pThread,SLOT(updateDebuggers()));
|
||||
}
|
||||
}
|
||||
|
||||
void NameTableVisualizerDockWidget::showEvent(QShowEvent* /*event*/)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "nes_emulator_core.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
OAMVisualizerDockWidget::OAMVisualizerDockWidget(QWidget *parent) :
|
||||
CDebuggerBase(parent),
|
||||
@@ -35,15 +34,18 @@ OAMVisualizerDockWidget::~OAMVisualizerDockWidget()
|
||||
delete renderer;
|
||||
}
|
||||
|
||||
void OAMVisualizerDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void OAMVisualizerDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
if ( !target.compare("nes") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorPaused(bool)),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),pThread,SLOT(updateDebuggers()));
|
||||
}
|
||||
}
|
||||
|
||||
void OAMVisualizerDockWidget::changeEvent(QEvent* e)
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "dbg_cnesppu.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
PPUInformationDockWidget::PPUInformationDockWidget(QWidget *parent) :
|
||||
CDebuggerBase(parent),
|
||||
@@ -19,15 +18,18 @@ PPUInformationDockWidget::~PPUInformationDockWidget()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void PPUInformationDockWidget::updateTargetMachine(QString /*target*/)
|
||||
void PPUInformationDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
if ( !target.compare("nes") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( emulator, SIGNAL(machineReady()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(machineReady()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateInformation()) );
|
||||
}
|
||||
}
|
||||
|
||||
void PPUInformationDockWidget::changeEvent(QEvent* e)
|
||||
@@ -69,6 +71,24 @@ void PPUInformationDockWidget::updateInformation()
|
||||
|
||||
nesGetCurrentPixel(&x,&y);
|
||||
|
||||
// Check breakpoints for hits and highlight if necessary...
|
||||
for ( idx = 0; idx < pBreakpoints->GetNumBreakpoints(); idx++ )
|
||||
{
|
||||
BreakpointInfo* pBreakpoint = pBreakpoints->GetBreakpoint(idx);
|
||||
|
||||
if ( pBreakpoint->hit )
|
||||
{
|
||||
if ( (pBreakpoint->type == eBreakOnPPUEvent) ||
|
||||
(pBreakpoint->type == eBreakOnPPUPortalAccess) ||
|
||||
(pBreakpoint->type == eBreakOnPPUPortalRead) ||
|
||||
(pBreakpoint->type == eBreakOnPPUPortalWrite) )
|
||||
{
|
||||
// Update display...
|
||||
show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Only update the UI elements if the inspector is visible...
|
||||
if ( isVisible() )
|
||||
{
|
||||
@@ -108,22 +128,4 @@ void PPUInformationDockWidget::updateInformation()
|
||||
|
||||
ui->ppuFlipFlop->setText(ppuFlipFlopStr[nesGetPPUFlipFlop()]);
|
||||
}
|
||||
|
||||
// Check breakpoints for hits and highlight if necessary...
|
||||
for ( idx = 0; idx < pBreakpoints->GetNumBreakpoints(); idx++ )
|
||||
{
|
||||
BreakpointInfo* pBreakpoint = pBreakpoints->GetBreakpoint(idx);
|
||||
|
||||
if ( pBreakpoint->hit )
|
||||
{
|
||||
if ( (pBreakpoint->type == eBreakOnPPUEvent) ||
|
||||
(pBreakpoint->type == eBreakOnPPUPortalAccess) ||
|
||||
(pBreakpoint->type == eBreakOnPPUPortalRead) ||
|
||||
(pBreakpoint->type == eBreakOnPPUPortalWrite) )
|
||||
{
|
||||
// Update display...
|
||||
show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
|
||||
#include "qscilexerbin.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "environmentsettingsdialog.h"
|
||||
|
||||
#include "codeeditorform.h"
|
||||
#include "nes_emulator_core.h"
|
||||
|
||||
PRGROMDisplayDialog::PRGROMDisplayDialog(uint8_t* bankData,IProjectTreeViewItem* link,QWidget* parent) :
|
||||
CDesignerEditorBase(link,parent),
|
||||
@@ -14,91 +17,32 @@ PRGROMDisplayDialog::PRGROMDisplayDialog(uint8_t* bankData,IProjectTreeViewItem*
|
||||
|
||||
m_data = bankData;
|
||||
|
||||
QString text;
|
||||
if ( m_data )
|
||||
{
|
||||
char temp[4];
|
||||
m_editor = new QHexEdit();
|
||||
|
||||
for (int i=0; i<MEM_8KB; i++)
|
||||
{
|
||||
char l = (m_data[i]>>4)&0x0F;
|
||||
char r = m_data[i]&0x0F;
|
||||
if ( i && (!(i%16)) )
|
||||
text.append("\n");
|
||||
else if ( i )
|
||||
text.append(" " );
|
||||
sprintf(temp,"%01X%01X",l,r);
|
||||
text.append(temp);
|
||||
}
|
||||
}
|
||||
m_editor->setData(QByteArray((const char*)m_data,MEM_8KB));
|
||||
m_editor->setReadOnly(true);
|
||||
m_editor->setAddressAreaBackgroundColor(EnvironmentSettingsDialog::marginBackgroundColor());
|
||||
m_editor->setAddressAreaForegroundColor(EnvironmentSettingsDialog::marginForegroundColor());
|
||||
m_editor->setHexCaps(true);
|
||||
|
||||
m_scintilla = new QsciScintilla();
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
|
||||
m_editor->setFont(QFont("Monaco", 11));
|
||||
#endif
|
||||
#ifdef Q_OS_LINUX
|
||||
m_editor->setFont(QFont("Monospace", 10));
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
m_editor->setFont(QFont("Consolas", 11));
|
||||
#endif
|
||||
|
||||
QObject::connect(m_scintilla, SIGNAL(linesChanged()), this, SLOT(linesChanged()));
|
||||
|
||||
m_lexer = new QsciLexerBin(m_scintilla);
|
||||
|
||||
m_scintilla->setLexer(m_lexer);
|
||||
|
||||
m_scintilla->setFrameShape(QFrame::NoFrame);
|
||||
|
||||
m_scintilla->setText(text);
|
||||
m_scintilla->setReadOnly(true);
|
||||
|
||||
m_scintilla->setMarginsBackgroundColor(EnvironmentSettingsDialog::marginBackgroundColor());
|
||||
m_scintilla->setMarginsForegroundColor(EnvironmentSettingsDialog::marginForegroundColor());
|
||||
|
||||
m_scintilla->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
m_scintilla->setMarginWidth(3,0);
|
||||
m_scintilla->setMarginMarkerMask(3,0);
|
||||
m_scintilla->setMarginWidth(4,0);
|
||||
m_scintilla->setMarginMarkerMask(4,0);
|
||||
|
||||
m_scintilla->setMarginWidth(2,5);
|
||||
m_scintilla->setMarginType(2,QsciScintilla::SymbolMargin);
|
||||
m_scintilla->setMarginSensitivity(2,false);
|
||||
m_scintilla->setMarginMarkerMask(2,0x00000FF0);
|
||||
|
||||
m_scintilla->setMarginWidth(Margin_Decorations,22);
|
||||
m_scintilla->setMarginMarkerMask(Margin_Decorations,0x0000000F);
|
||||
m_scintilla->setMarginType(Margin_Decorations,QsciScintilla::SymbolMargin);
|
||||
m_scintilla->setMarginSensitivity(Margin_Decorations,false);
|
||||
|
||||
m_scintilla->setMarginLineNumbers(Margin_LineNumbers,true);
|
||||
m_scintilla->setMarginWidth(Margin_LineNumbers,0);
|
||||
m_scintilla->setMarginMarkerMask(Margin_LineNumbers,0x00000000);
|
||||
m_scintilla->setMarginType(Margin_LineNumbers,QsciScintilla::TextMargin);
|
||||
m_scintilla->setMarginSensitivity(Margin_LineNumbers,false);
|
||||
|
||||
m_scintilla->setSelectionBackgroundColor(QColor(215,215,215));
|
||||
m_scintilla->setSelectionToEol(true);
|
||||
|
||||
m_scintilla->markerDefine(QsciScintilla::Background,Marker_Highlight);
|
||||
if ( EnvironmentSettingsDialog::highlightBarEnabled() )
|
||||
{
|
||||
m_scintilla->setMarkerBackgroundColor(EnvironmentSettingsDialog::highlightBarColor(),Marker_Highlight);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the highlight bar color to background to hide it =]
|
||||
m_scintilla->setMarkerBackgroundColor(m_lexer->defaultPaper(),Marker_Highlight);
|
||||
}
|
||||
|
||||
QString maxLineNum;
|
||||
|
||||
maxLineNum.sprintf("%d",m_scintilla->lines()<<4);
|
||||
|
||||
m_scintilla->setMarginWidth(Margin_LineNumbers,maxLineNum);
|
||||
|
||||
setCentralWidget(m_scintilla);
|
||||
setCentralWidget(m_editor);
|
||||
}
|
||||
|
||||
PRGROMDisplayDialog::~PRGROMDisplayDialog()
|
||||
{
|
||||
delete ui;
|
||||
|
||||
delete m_lexer;
|
||||
delete m_scintilla;
|
||||
delete m_editor;
|
||||
}
|
||||
|
||||
void PRGROMDisplayDialog::changeEvent(QEvent* e)
|
||||
@@ -115,20 +59,15 @@ void PRGROMDisplayDialog::changeEvent(QEvent* e)
|
||||
}
|
||||
}
|
||||
|
||||
void PRGROMDisplayDialog::linesChanged()
|
||||
{
|
||||
int line;
|
||||
|
||||
for ( line = 0; line < m_scintilla->lines(); line++ )
|
||||
{
|
||||
m_scintilla->setMarginText(line,QString("%1").arg(line<<4,4,16,QChar('0')),QsciScintillaBase::STYLE_LINENUMBER);
|
||||
}
|
||||
}
|
||||
|
||||
void PRGROMDisplayDialog::showEvent(QShowEvent* /*e*/)
|
||||
{
|
||||
m_editor->setData(QByteArray((const char*)m_data,MEM_8KB));
|
||||
m_editor->update();
|
||||
}
|
||||
|
||||
void PRGROMDisplayDialog::applyProjectPropertiesToTab()
|
||||
void PRGROMDisplayDialog::applyEnvironmentSettingsToTab()
|
||||
{
|
||||
m_editor->setAddressAreaBackgroundColor(EnvironmentSettingsDialog::marginBackgroundColor());
|
||||
m_editor->setAddressAreaForegroundColor(EnvironmentSettingsDialog::marginForegroundColor());
|
||||
m_editor->update();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
#include <Qsci/qsciscintilla.h>
|
||||
#include <qhexedit.h>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@@ -32,13 +32,11 @@ protected:
|
||||
unsigned char* m_data;
|
||||
|
||||
private:
|
||||
Ui::PRGROMDisplayDialog* ui;
|
||||
QsciScintilla* m_scintilla;
|
||||
QsciLexer* m_lexer;
|
||||
Ui::PRGROMDisplayDialog *ui;
|
||||
QHexEdit *m_editor;
|
||||
|
||||
private slots:
|
||||
void linesChanged();
|
||||
void applyProjectPropertiesToTab();
|
||||
void applyEnvironmentSettingsToTab();
|
||||
void updateTargetMachine(QString /*target*/) {}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include "cchrrombankitemdelegate.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QCompleter>
|
||||
|
||||
#include "iprojecttreeviewitem.h"
|
||||
#include "cchrrombankitemdelegate.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "iprojecttreeviewitem.h"
|
||||
#include "ichrrombankitem.h"
|
||||
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
CChrRomBankItemDelegate::CChrRomBankItemDelegate(QObject *parent) :
|
||||
QStyledItemDelegate(parent)
|
||||
@@ -18,7 +19,9 @@ QWidget* CChrRomBankItemDelegate::createEditor(QWidget* parent,
|
||||
{
|
||||
QComboBox* editor = new QComboBox(parent);
|
||||
|
||||
editor->setEditable(true);
|
||||
//CP: I think originally I was going to let people type in objects but
|
||||
// that's just confusing as the drop-down disappears on double click.
|
||||
//editor->setEditable(true);
|
||||
|
||||
return editor;
|
||||
}
|
||||
@@ -27,14 +30,10 @@ void CChrRomBankItemDelegate::setEditorData(QWidget* editor,
|
||||
const QModelIndex& index) const
|
||||
{
|
||||
QComboBox* edit = static_cast<QComboBox*>(editor);
|
||||
IProjectTreeViewItemIterator iter(nesicideProject->getProject());
|
||||
IProjectTreeViewItemIterator iter(CNesicideProject::instance()->getProject());
|
||||
QStringList choices;
|
||||
choices.append("<<4KB break>>");
|
||||
edit->addItem("<<4KB break>>");
|
||||
choices.append("<<2KB break>>");
|
||||
edit->addItem("<<2KB break>>");
|
||||
choices.append("<<1KB break>>");
|
||||
edit->addItem("<<1KB break>>");
|
||||
choices.append("<click to add>");
|
||||
edit->addItem("<click to add>");
|
||||
do
|
||||
{
|
||||
IChrRomBankItem* item = dynamic_cast<IChrRomBankItem*>(iter.current());
|
||||
@@ -50,7 +49,7 @@ void CChrRomBankItemDelegate::setEditorData(QWidget* editor,
|
||||
completer->setCompletionPrefix(index.data(Qt::DisplayRole).toString());
|
||||
edit->setCompleter(completer);
|
||||
edit->showPopup();
|
||||
if ( index.data(Qt::DisplayRole).toString() == "<click to add or edit>" )
|
||||
if ( index.data(Qt::DisplayRole).toString() == "<click to add>" )
|
||||
{
|
||||
edit->setEditText("");
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "graphicsbankeditorform.h"
|
||||
#include "ui_graphicsbankeditorform.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "cdesignercommon.h"
|
||||
#include "ichrrombankitem.h"
|
||||
|
||||
#include "nes_emulator_core.h"
|
||||
#include "cnessystempalette.h"
|
||||
|
||||
GraphicsBankEditorForm::GraphicsBankEditorForm(QList<IChrRomBankItem*> bankItems,IProjectTreeViewItem* link,QWidget* parent) :
|
||||
GraphicsBankEditorForm::GraphicsBankEditorForm(uint32_t size, QList<IChrRomBankItem*> bankItems,IProjectTreeViewItem* link,QWidget* parent) :
|
||||
CDesignerEditorBase(link,parent),
|
||||
ui(new Ui::GraphicsBankEditorForm)
|
||||
{
|
||||
@@ -50,15 +51,25 @@ GraphicsBankEditorForm::GraphicsBankEditorForm(QList<IChrRomBankItem*> bankItems
|
||||
ui->tableView->setItemDelegateForColumn(ChrRomBankItemCol_Name,delegate);
|
||||
ui->tableView->setColumnWidth(ChrRomBankItemCol_Name,400);
|
||||
|
||||
ui->gauge->setMaximum(MEM_8KB);
|
||||
ui->gauge->setMaximum(size);
|
||||
|
||||
updateChrRomBankItemList(bankItems);
|
||||
|
||||
// Get mouse events from the renderer here!
|
||||
renderer->installEventFilter(this);
|
||||
|
||||
QObject::connect(model,SIGNAL(rowsInserted(QModelIndex,int,int)),this,SLOT(updateUi()));
|
||||
QObject::connect(model,SIGNAL(layoutChanged()),this,SLOT(updateUi()));
|
||||
ui->bankSize->setItemData(0,MEM_8KB);
|
||||
if ( size == MEM_8KB ) ui->bankSize->setCurrentIndex(0);
|
||||
ui->bankSize->setItemData(1,MEM_4KB);
|
||||
if ( size == MEM_4KB ) ui->bankSize->setCurrentIndex(1);
|
||||
ui->bankSize->setItemData(2,MEM_2KB);
|
||||
if ( size == MEM_2KB ) ui->bankSize->setCurrentIndex(2);
|
||||
ui->bankSize->setItemData(3,MEM_1KB);
|
||||
if ( size == MEM_1KB ) ui->bankSize->setCurrentIndex(3);
|
||||
|
||||
QObject::connect(model,SIGNAL(rowsInserted(QModelIndex,int,int)),this,SLOT(updateList()));
|
||||
QObject::connect(model,SIGNAL(layoutChanged()),this,SLOT(updateList()));
|
||||
QObject::connect(ui->tableView,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(tableView_doubleClicked(QModelIndex)));
|
||||
}
|
||||
|
||||
GraphicsBankEditorForm::~GraphicsBankEditorForm()
|
||||
@@ -80,6 +91,11 @@ QList<IChrRomBankItem*> GraphicsBankEditorForm::bankItems()
|
||||
return model->bankItems();
|
||||
}
|
||||
|
||||
uint32_t GraphicsBankEditorForm::bankSize()
|
||||
{
|
||||
return ui->bankSize->itemData(ui->bankSize->currentIndex()).toInt();
|
||||
}
|
||||
|
||||
bool GraphicsBankEditorForm::eventFilter(QObject* obj,QEvent* event)
|
||||
{
|
||||
if ( obj == renderer )
|
||||
@@ -103,6 +119,17 @@ bool GraphicsBankEditorForm::eventFilter(QObject* obj,QEvent* event)
|
||||
return false;
|
||||
}
|
||||
|
||||
void GraphicsBankEditorForm::tableView_doubleClicked(QModelIndex index)
|
||||
{
|
||||
if ( (index.row() >= 0) && (index.row() < bankItems().count()) )
|
||||
{
|
||||
IChrRomBankItem* pChrItem = bankItems().at(index.row());
|
||||
IProjectTreeViewItem* pProjItem = dynamic_cast<IProjectTreeViewItem*>(pChrItem);
|
||||
|
||||
emit snapToTab("Tile,"+pProjItem->uuid());
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsBankEditorForm::renderer_enterEvent(QEvent */*event*/)
|
||||
{
|
||||
int pixx;
|
||||
@@ -136,12 +163,21 @@ void GraphicsBankEditorForm::renderer_mouseMoveEvent(QMouseEvent */*event*/)
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsBankEditorForm::updateList()
|
||||
{
|
||||
updateUi();
|
||||
setModified(true);
|
||||
emit markProjectDirty(true);
|
||||
}
|
||||
|
||||
void GraphicsBankEditorForm::updateUi()
|
||||
{
|
||||
int idx;
|
||||
|
||||
ui->tableView->resizeRowsToContents();
|
||||
|
||||
ui->gauge->setMaximum(ui->bankSize->itemData(ui->bankSize->currentIndex()).toInt());
|
||||
|
||||
emit prepareToTilify();
|
||||
|
||||
for (idx = 0; idx < model->bankItems().count(); idx++ )
|
||||
@@ -150,9 +186,6 @@ void GraphicsBankEditorForm::updateUi()
|
||||
}
|
||||
|
||||
emit tilify();
|
||||
|
||||
setModified(true);
|
||||
emit markProjectDirty(true);
|
||||
}
|
||||
|
||||
void GraphicsBankEditorForm::changeEvent(QEvent* event)
|
||||
@@ -173,7 +206,7 @@ void GraphicsBankEditorForm::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
int idx;
|
||||
|
||||
if ( event->key() == Qt::Key_Delete )
|
||||
if ( event->key() == Qt::Key_Delete || event->key() == Qt::Key_Backspace )
|
||||
{
|
||||
if ( ui->tableView->hasFocus() )
|
||||
{
|
||||
@@ -209,33 +242,48 @@ void GraphicsBankEditorForm::updateChrRomBankItemList(QList<IChrRomBankItem*> ba
|
||||
{
|
||||
int idx;
|
||||
|
||||
model->setBankItems(bankItems);
|
||||
model->update();
|
||||
ui->tableView->resizeRowsToContents();
|
||||
|
||||
emit prepareToTilify();
|
||||
|
||||
for (idx = 0; idx < bankItems.count(); idx++ )
|
||||
if ( bankItems != model->bankItems() )
|
||||
{
|
||||
emit addToTilificator(bankItems.at(idx));
|
||||
}
|
||||
model->setBankItems(bankItems);
|
||||
model->update();
|
||||
ui->tableView->resizeRowsToContents();
|
||||
|
||||
emit tilify();
|
||||
emit prepareToTilify();
|
||||
|
||||
for (idx = 0; idx < bankItems.count(); idx++ )
|
||||
{
|
||||
emit addToTilificator(bankItems.at(idx));
|
||||
}
|
||||
|
||||
emit tilify();
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsBankEditorForm::renderData(QByteArray output)
|
||||
{
|
||||
int idx;
|
||||
int max = ui->bankSize->itemData(ui->bankSize->currentIndex()).toInt();
|
||||
|
||||
ui->gauge->setValue(output.count());
|
||||
QPalette p = ui->gauge->palette();
|
||||
if ( output.count() > max )
|
||||
{
|
||||
ui->gauge->setValue(max);
|
||||
ui->gauge->setStyleSheet("QProgressBar::chunk {background: #ff0000;border-top-right-radius: 5px;border-top-left-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;border: .px solid black;}");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->gauge->setStyleSheet("QProgressBar::chunk {background: #00ff00;border-top-right-radius: 5px;border-top-left-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;border: .px solid black;}");
|
||||
}
|
||||
ui->gauge->setPalette(p);
|
||||
|
||||
// Pad to 8KB.
|
||||
for ( idx = output.count(); idx < MEM_8KB; idx++ )
|
||||
// Pad to boundary-KB.
|
||||
for ( idx = output.count(); idx < max; idx++ )
|
||||
{
|
||||
output.append((char)0);
|
||||
}
|
||||
|
||||
tilifiedData.replace(0,MEM_8KB,output);
|
||||
tilifiedData.replace(0,max,output);
|
||||
|
||||
renderData();
|
||||
}
|
||||
@@ -249,16 +297,31 @@ void GraphicsBankEditorForm::renderData()
|
||||
unsigned char colorIdx;
|
||||
QColor color[4];
|
||||
IChrRomBankItem* item;
|
||||
int x, y, maxx, maxy;
|
||||
int max = ui->bankSize->itemData(ui->bankSize->currentIndex()).toInt();
|
||||
|
||||
color[0] = renderer->getColor(0);
|
||||
color[1] = renderer->getColor(1);
|
||||
color[2] = renderer->getColor(2);
|
||||
color[3] = renderer->getColor(3);
|
||||
|
||||
for (int y = 0; y < 128; y++)
|
||||
maxx = (max==MEM_8KB)?256:128;
|
||||
maxy = (max>=MEM_4KB)?128:(max==MEM_2KB)?64:32;
|
||||
|
||||
for (y = 0; y < 128; y++)
|
||||
{
|
||||
for (int x = 0; x < 256; x += 8)
|
||||
for (x = 0; x < 256; x += 8)
|
||||
{
|
||||
if ( (y >= maxy) || (x >= maxx) )
|
||||
{
|
||||
for ( int xf = 0; xf < 8; xf++ )
|
||||
{
|
||||
imgData[((y<<8)<<2) + (x<<2) + (xf<<2) + 0] = 0xaa;
|
||||
imgData[((y<<8)<<2) + (x<<2) + (xf<<2) + 1] = 0xaa;
|
||||
imgData[((y<<8)<<2) + (x<<2) + (xf<<2) + 2] = 0xaa;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
ppuAddr = ((y>>3)<<8)+((x&0x7F)<<1)+(y&0x7);
|
||||
|
||||
if ( x >= 128 )
|
||||
@@ -296,6 +359,29 @@ void GraphicsBankEditorForm::renderData()
|
||||
renderer->reloadData(imgData);
|
||||
}
|
||||
|
||||
void GraphicsBankEditorForm::itemRemoved(QUuid uuid)
|
||||
{
|
||||
QList<IChrRomBankItem*> newItems = bankItems();
|
||||
|
||||
foreach ( IChrRomBankItem* pChrItem, bankItems() )
|
||||
{
|
||||
IProjectTreeViewItem* pProjItem = dynamic_cast<IProjectTreeViewItem*>(pChrItem);
|
||||
|
||||
if ( pProjItem->uuid() == uuid.toString() )
|
||||
{
|
||||
newItems.removeAll(pChrItem);
|
||||
}
|
||||
}
|
||||
|
||||
if ( newItems != bankItems() )
|
||||
{
|
||||
model->setBankItems(newItems);
|
||||
model->update();
|
||||
setModified(true);
|
||||
emit markProjectDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsBankEditorForm::snapTo(QString item)
|
||||
{
|
||||
QStringList splits;
|
||||
@@ -372,3 +458,64 @@ void GraphicsBankEditorForm::applyChangesToTab(QString /*uuid*/)
|
||||
void GraphicsBankEditorForm::applyProjectPropertiesToTab()
|
||||
{
|
||||
}
|
||||
|
||||
void GraphicsBankEditorForm::on_moveUp_clicked()
|
||||
{
|
||||
QModelIndexList indexes = ui->tableView->selectionModel()->selectedIndexes();
|
||||
QList<IChrRomBankItem*> items = model->bankItems();
|
||||
if ( !indexes.isEmpty() )
|
||||
{
|
||||
foreach ( QModelIndex index, indexes )
|
||||
{
|
||||
if ( index.column() == 0 )
|
||||
{
|
||||
if ( index.row() > 0 )
|
||||
{
|
||||
items.swap(index.row()-1,index.row());
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
model->setBankItems(items);
|
||||
model->update();
|
||||
setModified(true);
|
||||
emit markProjectDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsBankEditorForm::on_moveDown_clicked()
|
||||
{
|
||||
QModelIndexList indexes = ui->tableView->selectionModel()->selectedIndexes();
|
||||
QList<IChrRomBankItem*> items = model->bankItems();
|
||||
if ( !indexes.isEmpty() )
|
||||
{
|
||||
foreach ( QModelIndex index, indexes )
|
||||
{
|
||||
if ( index.column() == 0 )
|
||||
{
|
||||
if ( index.row() < (items.count()-1) )
|
||||
{
|
||||
items.swap(index.row()+1,index.row());
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
model->setBankItems(items);
|
||||
model->update();
|
||||
setModified(true);
|
||||
emit markProjectDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
void GraphicsBankEditorForm::on_bankSize_currentIndexChanged(int index)
|
||||
{
|
||||
updateUi();
|
||||
setModified(true);
|
||||
emit markProjectDirty(true);
|
||||
}
|
||||
|
||||
@@ -22,12 +22,13 @@ class GraphicsBankEditorForm : public CDesignerEditorBase
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GraphicsBankEditorForm(QList<IChrRomBankItem*> bankItems,IProjectTreeViewItem* link = 0,QWidget* parent = 0);
|
||||
GraphicsBankEditorForm(uint32_t size, QList<IChrRomBankItem*> bankItems,IProjectTreeViewItem* link = 0,QWidget* parent = 0);
|
||||
virtual ~GraphicsBankEditorForm();
|
||||
void updateChrRomBankItemList(QList<IChrRomBankItem*> bankItems);
|
||||
|
||||
// Member getters.
|
||||
QList<IChrRomBankItem*> bankItems();
|
||||
uint32_t bankSize();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent* event);
|
||||
@@ -39,6 +40,7 @@ protected:
|
||||
void renderer_enterEvent(QEvent* event);
|
||||
void renderer_leaveEvent(QEvent* event);
|
||||
void renderer_mouseMoveEvent(QMouseEvent *event);
|
||||
void updateUi();
|
||||
|
||||
private:
|
||||
Ui::GraphicsBankEditorForm* ui;
|
||||
@@ -53,11 +55,19 @@ private:
|
||||
private slots:
|
||||
void renderData();
|
||||
void renderData(QByteArray output);
|
||||
void updateUi();
|
||||
void updateList();
|
||||
void snapTo(QString item);
|
||||
void applyChangesToTab(QString uuid);
|
||||
void itemRemoved(QUuid uuid);
|
||||
void applyProjectPropertiesToTab();
|
||||
void updateTargetMachine(QString /*target*/) {}
|
||||
void updateTargetMachine(QString target) {}
|
||||
|
||||
void on_moveUp_clicked();
|
||||
|
||||
void on_moveDown_clicked();
|
||||
|
||||
void on_bankSize_currentIndexChanged(int index);
|
||||
void tableView_doubleClicked(QModelIndex index);
|
||||
|
||||
signals:
|
||||
void prepareToTilify();
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>561</width>
|
||||
<height>481</height>
|
||||
<height>491</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
@@ -34,60 +34,127 @@
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QToolButton" name="toolButton_2">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="4">
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4" columnstretch="1,0,0">
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="2">
|
||||
<widget class="QToolButton" name="moveUp">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../common/resource.qrc">
|
||||
<normaloff>:/resources/icons8-sort_up.png</normaloff>:/resources/icons8-sort_up.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QToolButton" name="moveDown">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../../common/resource.qrc">
|
||||
<normaloff>:/resources/icons8-sort_down.png</normaloff>:/resources/icons8-sort_down.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QProgressBar" name="gauge">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>8192</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="invertedAppearance">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="bankSize">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>8KB</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>4KB</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>2KB</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>1KB</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" rowspan="3" colspan="2">
|
||||
<widget class="QTableView" name="tableView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
@@ -95,6 +162,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@@ -122,10 +192,10 @@
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<number>14</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<number>14</number>
|
||||
</attribute>
|
||||
</widget>
|
||||
@@ -160,6 +230,8 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../../../../common/resource.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "cqtmfc.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
#include "Source/FamiTrackerDoc.h"
|
||||
#include "Source/TextExporter.h"
|
||||
@@ -111,7 +111,7 @@ bool MusicEditorForm::exportData()
|
||||
{
|
||||
// AfxGetMainWnd()->SendMessage(ID_FILE_EXPORTTEXT);
|
||||
CFamiTrackerDoc *pDoc = static_cast<CFamiTrackerDoc*>(AfxGetMainWnd()->GetActiveDocument());
|
||||
QDir exportDir(nesicideProject->getProjectOutputBasePath());
|
||||
QDir exportDir(CNesicideProject::instance()->getProjectOutputBasePath());
|
||||
QString fileName = QString(pDoc->GetFileTitle().GetBuffer());
|
||||
fileName += ".ftxt";
|
||||
CString FileName(exportDir.absoluteFilePath(fileName));
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#include <QUndoView>
|
||||
#include <QClipboard>
|
||||
|
||||
#include "tilestampeditorform.h"
|
||||
#include "ui_tilestampeditorform.h"
|
||||
|
||||
@@ -7,10 +10,7 @@
|
||||
#include "cdesignercommon.h"
|
||||
#include "cimageconverters.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include <QUndoView>
|
||||
#include <QClipboard>
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
TileStampEditorForm::TileStampEditorForm(QByteArray data,QByteArray attr,QString attrTblUUID,QList<PropertyItem> tileProperties,int xSize,int ySize,bool grid,IProjectTreeViewItem* link,QWidget *parent) :
|
||||
CDesignerEditorBase(link,parent),
|
||||
@@ -47,7 +47,7 @@ TileStampEditorForm::TileStampEditorForm(QByteArray data,QByteArray attr,QString
|
||||
ui->pal0col1->setChecked(true);
|
||||
|
||||
QList<IChrRomBankItem*> tileListChrItem;
|
||||
iter.reset(nesicideProject->getProject());
|
||||
iter.reset(CNesicideProject::instance()->getProject());
|
||||
while ( iter.current() )
|
||||
{
|
||||
IChrRomBankItem* pChrItem = dynamic_cast<IChrRomBankItem*>(iter.current());
|
||||
@@ -70,7 +70,7 @@ TileStampEditorForm::TileStampEditorForm(QByteArray data,QByteArray attr,QString
|
||||
ui->propertyTableView->setItemDelegateForColumn(PropertyCol_Value,tilePropertyValueDelegate);
|
||||
|
||||
tilePropertyListModel = new CPropertyListModel(true);
|
||||
m_tileProperties = nesicideProject->getTileProperties();
|
||||
m_tileProperties = CNesicideProject::instance()->getTileProperties();
|
||||
|
||||
// Update local tile properties from saved tile info.
|
||||
idx = 0;
|
||||
@@ -322,7 +322,7 @@ TileStampEditorForm::TileStampEditorForm(QByteArray data,QByteArray attr,QString
|
||||
}
|
||||
|
||||
// Set up the attribute table list.
|
||||
iter.reset(nesicideProject->getProject()->getProjectPrimitives()->getAttributeTables());
|
||||
iter.reset(CNesicideProject::instance()->getProject()->getProjectPrimitives()->getAttributeTables());
|
||||
idx = 0;
|
||||
int selIdx = -1;
|
||||
while ( iter.current() )
|
||||
@@ -2252,7 +2252,7 @@ void TileStampEditorForm::applyChangesToTab(QString uuid)
|
||||
int idx;
|
||||
|
||||
// Set up the attribute table list.
|
||||
iter.reset(nesicideProject->getProject()->getProjectPrimitives()->getAttributeTables());
|
||||
iter.reset(CNesicideProject::instance()->getProject()->getProjectPrimitives()->getAttributeTables());
|
||||
idx = 0;
|
||||
int selIdx = -1;
|
||||
ui->attributeTable->blockSignals(true);
|
||||
@@ -2307,7 +2307,7 @@ void TileStampEditorForm::applyChangesToTab(QString uuid)
|
||||
|
||||
// Update tile list.
|
||||
QList<IChrRomBankItem*> tileListChrItem;
|
||||
iter.reset(nesicideProject->getProject());
|
||||
iter.reset(CNesicideProject::instance()->getProject());
|
||||
while ( iter.current() )
|
||||
{
|
||||
IChrRomBankItem* pChrItem = dynamic_cast<IChrRomBankItem*>(iter.current());
|
||||
@@ -2330,7 +2330,7 @@ void TileStampEditorForm::applyProjectPropertiesToTab()
|
||||
QList<PropertyItem> tileProperties = m_tileProperties;
|
||||
int idx = 0;
|
||||
|
||||
m_tileProperties = nesicideProject->getTileProperties();
|
||||
m_tileProperties = CNesicideProject::instance()->getTileProperties();
|
||||
|
||||
// Update local tile properties from saved tile info.
|
||||
foreach ( PropertyItem globalItem, m_tileProperties )
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
NESEmulatorControl::NESEmulatorControl(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::NESEmulatorControl),
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include "ui_nesemulatordockwidget.h"
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
|
||||
#include "emulatorprefsdialog.h"
|
||||
|
||||
@@ -84,15 +83,15 @@ void NESEmulatorDockWidget::setScalingFactor(float factor)
|
||||
|
||||
void NESEmulatorDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
if ( !target.compare("nes") )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(this,SIGNAL(controllerInput(uint32_t*)),emulator,SLOT(controllerInput(uint32_t*)));
|
||||
QObject::connect(emulator, SIGNAL(emulatedFrame()), this, SLOT(renderData()));
|
||||
QObject::connect(breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(renderData()));
|
||||
}
|
||||
QObject::connect(emulator, SIGNAL(emulatedFrame()), this, SLOT(renderData()));
|
||||
QObject::connect(breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(renderData()));
|
||||
}
|
||||
|
||||
void NESEmulatorDockWidget::changeEvent(QEvent* e)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "nesemulatorrenderer.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
CNESEmulatorRenderer::CNESEmulatorRenderer(QWidget* parent, char* imgData)
|
||||
: QOpenGLWidget(parent),
|
||||
initialized(false)
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
|
||||
#include "cobjectregistry.h"
|
||||
#include "breakpointwatcherthread.h"
|
||||
#include "main.h"
|
||||
|
||||
#include "environmentsettingsdialog.h"
|
||||
#include "emulatorprefsdialog.h"
|
||||
|
||||
#include "Source/DirectSound.h"
|
||||
|
||||
@@ -249,7 +251,7 @@ NESEmulatorWorker::NESEmulatorWorker(QObject*)
|
||||
|
||||
pTimer = new QTimer();
|
||||
QObject::connect(pTimer,SIGNAL(timeout()),this,SLOT(process()));
|
||||
pTimer->start(10);
|
||||
pTimer->start(1);
|
||||
}
|
||||
|
||||
NESEmulatorWorker::~NESEmulatorWorker()
|
||||
@@ -269,10 +271,10 @@ void NESEmulatorWorker::breakpointsChanged()
|
||||
|
||||
void NESEmulatorWorker::primeEmulator()
|
||||
{
|
||||
if ( (nesicideProject) &&
|
||||
(nesicideProject->getCartridge()) )
|
||||
if ( (CNesicideProject::instance()) &&
|
||||
(CNesicideProject::instance()->getCartridge()) )
|
||||
{
|
||||
m_pCartridge = nesicideProject->getCartridge();
|
||||
m_pCartridge = CNesicideProject::instance()->getCartridge();
|
||||
|
||||
nesClearOpcodeMasks();
|
||||
}
|
||||
@@ -553,9 +555,9 @@ void NESEmulatorWorker::loadCartridge()
|
||||
// Initialize NES...
|
||||
nesResetInitial();
|
||||
|
||||
if ( !nesicideProject->getProjectCartridgeSaveStateName().isEmpty() )
|
||||
if ( !CNesicideProject::instance()->getProjectCartridgeSaveStateName().isEmpty() )
|
||||
{
|
||||
saveState.setFileName(nesicideProject->getProjectCartridgeSaveStateName());
|
||||
saveState.setFileName(CNesicideProject::instance()->getProjectCartridgeSaveStateName());
|
||||
if ( saveState.open(QIODevice::ReadOnly) )
|
||||
{
|
||||
deserializeContent(saveState);
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
#include <QSettings>
|
||||
#include <QDomDocument>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QCryptographicHash>
|
||||
#include <QMessageBox>
|
||||
#include <QInputDialog>
|
||||
|
||||
#include "testsuiteexecutivedialog.h"
|
||||
#include "ui_testsuiteexecutivedialog.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include "nes_emulator_core.h"
|
||||
#include "cjoypadlogger.h"
|
||||
#include "cobjectregistry.h"
|
||||
#include "ixmlserializable.h"
|
||||
|
||||
TestSuiteExecutiveDialog::TestSuiteExecutiveDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
@@ -83,7 +91,7 @@ void TestSuiteExecutiveDialog::machineReady()
|
||||
doTestPhase();
|
||||
}
|
||||
|
||||
void TestSuiteExecutiveDialog::updateTargetMachine(QString machine)
|
||||
void TestSuiteExecutiveDialog::updateTargetMachine(QString target)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ private slots:
|
||||
void on_executeSelection_clicked();
|
||||
void on_abort_clicked();
|
||||
void updateProgress();
|
||||
void updateTargetMachine(QString machine);
|
||||
void updateTargetMachine(QString target);
|
||||
void machineReady();
|
||||
void emulatorPausedAfter();
|
||||
void on_clear_clicked();
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "cattributetable.h"
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
CAttributeTable::CAttributeTable(IProjectTreeViewItem* parent)
|
||||
{
|
||||
// Add node to tree
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "cattributetables.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
CAttributeTables::CAttributeTables(IProjectTreeViewItem* parent)
|
||||
{
|
||||
// Add node to tree
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
#include "ccartridge.h"
|
||||
#include "main.h"
|
||||
|
||||
CCartridge::CCartridge(IProjectTreeViewItem* parent)
|
||||
{
|
||||
@@ -55,7 +58,7 @@ void CCartridge::exportROM()
|
||||
|
||||
if ( !fileName.isEmpty() )
|
||||
{
|
||||
nesicideProject->createRomFromProject(fileName);
|
||||
CNesicideProject::instance()->createRomFromProject(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
#include "cchrrombank.h"
|
||||
#include "cimageconverters.h"
|
||||
#include "cobjectregistry.h"
|
||||
#include "main.h"
|
||||
#include "nesemulatorthread.h"
|
||||
#include "cchrrombanks.h"
|
||||
#include "cnesicideproject.h"
|
||||
|
||||
CCHRROMBank::CCHRROMBank(IProjectTreeViewItem* parent)
|
||||
{
|
||||
@@ -84,7 +86,7 @@ void CCHRROMBank::importFromPNG()
|
||||
QByteArray chrData;
|
||||
QByteArray imgData;
|
||||
QImage imgIn;
|
||||
CCHRROMBanks* chrRomBanks = nesicideProject->getCartridge()->getChrRomBanks();
|
||||
CCHRROMBanks* chrRomBanks = CNesicideProject::instance()->getCartridge()->getChrRomBanks();
|
||||
|
||||
if ( !fileName.isEmpty() )
|
||||
{
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
#include "cimageconverters.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
CGraphicsBank::CGraphicsBank(IProjectTreeViewItem* parent)
|
||||
{
|
||||
// Add node to tree
|
||||
@@ -14,6 +12,7 @@ CGraphicsBank::CGraphicsBank(IProjectTreeViewItem* parent)
|
||||
|
||||
// Allocate attributes
|
||||
m_bankItems.clear();
|
||||
m_bankSize = MEM_8KB;
|
||||
}
|
||||
|
||||
CGraphicsBank::~CGraphicsBank()
|
||||
@@ -25,11 +24,17 @@ QList<IChrRomBankItem*> CGraphicsBank::getGraphics()
|
||||
return m_bankItems;
|
||||
}
|
||||
|
||||
uint32_t CGraphicsBank::getSize()
|
||||
{
|
||||
return m_bankSize;
|
||||
}
|
||||
|
||||
bool CGraphicsBank::serialize(QDomDocument& doc, QDomNode& node)
|
||||
{
|
||||
QDomElement element = addElement( doc, node, "graphicsbank" );
|
||||
element.setAttribute("name", m_name);
|
||||
element.setAttribute("uuid", uuid());
|
||||
element.setAttribute("size", m_bankSize);
|
||||
|
||||
if ( m_editor && m_editor->isModified() )
|
||||
{
|
||||
@@ -91,6 +96,9 @@ bool CGraphicsBank::deserialize(QDomDocument& /*doc*/, QDomNode& node, QString&
|
||||
return false;
|
||||
}
|
||||
|
||||
// Default size is 8KB
|
||||
m_bankSize = element.attribute("size","8192").toInt();
|
||||
|
||||
m_name = element.attribute("name");
|
||||
|
||||
setUuid(element.attribute("uuid"));
|
||||
@@ -161,8 +169,8 @@ QString CGraphicsBank::caption() const
|
||||
// }
|
||||
|
||||
// // TODO: Fix this logic so the memory doesn't get lost.
|
||||
// nesicideProject->getProject()->getGraphicsBanks()->removeChild(this);
|
||||
// nesicideProject->getProject()->getGraphicsBanks()->getGraphicsBanks().removeAll(this);
|
||||
// CNesicideProject::instance()->getProject()->getGraphicsBanks()->removeChild(this);
|
||||
// CNesicideProject::instance()->getProject()->getGraphicsBanks()->getGraphicsBanks().removeAll(this);
|
||||
// //((CProjectTreeViewModel*)parent->model())->layoutChangedEvent();
|
||||
// }
|
||||
// else if (ret->text() == EXPORT_PNG_TEXT)
|
||||
@@ -180,7 +188,7 @@ void CGraphicsBank::openItemEvent(CProjectTabWidget* tabWidget)
|
||||
}
|
||||
else
|
||||
{
|
||||
m_editor = new GraphicsBankEditorForm(m_bankItems,this);
|
||||
m_editor = new GraphicsBankEditorForm(m_bankSize,m_bankItems,this);
|
||||
tabWidget->addTab(m_editor, this->caption());
|
||||
tabWidget->setCurrentWidget(m_editor);
|
||||
}
|
||||
@@ -189,6 +197,7 @@ void CGraphicsBank::openItemEvent(CProjectTabWidget* tabWidget)
|
||||
void CGraphicsBank::saveItemEvent()
|
||||
{
|
||||
m_bankItems = editor()->bankItems();
|
||||
m_bankSize = editor()->bankSize();
|
||||
|
||||
if ( m_editor )
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@ public:
|
||||
|
||||
// Member getters
|
||||
QList<IChrRomBankItem*> getGraphics();
|
||||
uint32_t getSize();
|
||||
|
||||
GraphicsBankEditorForm* editor() { return dynamic_cast<GraphicsBankEditorForm*>(m_editor); }
|
||||
void exportAsPNG();
|
||||
@@ -37,6 +38,7 @@ public:
|
||||
private:
|
||||
// Attributes
|
||||
QList<IChrRomBankItem*> m_bankItems;
|
||||
uint32_t m_bankSize;
|
||||
};
|
||||
|
||||
#endif // CGRAPHICSBANK_H
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user