6 Commits

Author SHA1 Message Date
Christopher Pow 969efe9a51 Appveyor. 2019-06-26 12:08:03 -05:00
Christopher Pow a233ebd331 Appveyor. 2019-06-26 10:48:09 -05:00
Christopher Pow d90b0ee4f6 Appveyor. 2019-06-26 09:37:24 -05:00
Christopher Pow 88b84a4cbc Appveyor. 2019-06-26 08:27:43 -05:00
Christopher Pow 88159f990f Appveyor. 2019-06-25 13:12:46 -05:00
Christopher Pow 1326554b76 Appveyor. 2019-06-25 13:06:14 -05:00
465 changed files with 10619 additions and 28664 deletions
+17 -18
View File
@@ -1,13 +1,16 @@
version: 1.0.{build}
image: Visual Studio 2017
platform: x64
branches:
only:
- master
skip_tags: true
- appveyor
environment:
QTDIR: C:\Qt\5.11\mingw53_32
skip_tags: true
hosts:
phrenetic: 162.243.126.83
@@ -25,19 +28,15 @@ build_script:
bash ./build/windows-deploy.sh local
test: off
artifacts:
- path: nesicide-win-x86-*.tar.bz2
name: nesicide
deploy:
- provider: BinTray
username: christopherpow
api_key:
secure: /fEZkCdGFMVIrc9weubw2n9CqZmSW6Ezt44sTtadO4yf+pyCOV2tHR1Fk4FZled3
subject: christopherpow
repo: nesicide
package: nesicide
artifact: nesicide
publish: true
override: true
on:
branch: master
deploy_script:
- cmd: >-
bash ./build/windows-deploy.sh remote
# openssl aes-256-cbc -K $encrypted_c3ea658420f4_key -iv $encrypted_c3ea658420f4_iv -in deploy_rsa.enc -out deploy_rsa -d
#
# eval "$(ssh-agent -s)"
#
# chmod 600 deploy_rsa
#
# ssh-add deploy_rsa
#
+6 -1
View File
@@ -12,7 +12,9 @@ moc_*
*.moc
qrc_*
*.exe
**/Makefile*
Makefile.Debug
Makefile
Makefile.Release
*/.directory
deps/
compiler/lex.asm.c
@@ -37,3 +39,6 @@ rcParser*
rcVisitor*
rcListener*
/build/nesicide-deps.tar.bz2
/apps/famitracker/Makefile*
/libs/famitracker/Makefile*
+1 -6
View File
@@ -1,21 +1,16 @@
os:
- linux
- osx
osx_image: xcode11.3
osx_image: xcode10.1
dist: xenial
language: cpp
branches:
only:
- master
before_install:
- ./build/spinner.sh start
- travis_wait 60 ./build/${TRAVIS_OS_NAME}-travis-setup.sh before_install
install:
- travis_wait 60 ./build/${TRAVIS_OS_NAME}-travis-setup.sh install
script:
- travis_wait 60 ./build/${TRAVIS_OS_NAME}-build.sh
- travis_wait 60 ./build/${TRAVIS_OS_NAME}-deploy.sh local
- ./build/spinner.sh stop
addons:
ssh_known_hosts: 162.243.126.83
before_deploy:
+1 -1
View File
@@ -1 +1 @@
0
256
+16 -38
View File
@@ -2,9 +2,7 @@
nesicide is an Integrated Development Environment (IDE) for the 8-bit Nintendo Entertainment System (NES).
## Products in Project
This project contains the following products:
This project contains:
* NESICIDE (the IDE itself)
* A NES emulator (standalone package of the emulator used in the IDE)
@@ -16,19 +14,12 @@ This project contains the following products:
The following steps are required prior to building this project on any platform.
0. Install `git`
1. Install [Qt 5.12.6](http://download.qt.io/archive/qt/5.12/5.12.6/) as it was the latest kit to be verified to build NESICIDE properly without errors. Please do not use a kit later than this, or if you do, please create a pull request with necessary changes.
2. Make sure qmake and your Qt installation is in your PATH.
At the time of writing this Mac OS Homewbrew contains Qt 5.14.1 and NESICIDE can also be built with that version of Qt. So, alternatively, you can install Qt using
```
brew intall qt5
```
1. Install [Qt 5.6.2](https://download.qt.io/official_releases/qt/5.6/5.6.2/) as it was the latest kit to be verified to build NESICIDE properly with not errors. Please do not use a kit later than this, or if you do, please create a pull request with necessary changes.
### Debian prerequisites
```sh
sudo apt-get install qtchooser build-essential libasound2-dev liblua5.1-dev libsdl1.2-dev libgl1-mesa-dev
sudo apt-get install build-essential libasound2-dev liblua5.1-dev libsdl1.2-dev libgl1-mesa-dev wine-dev
```
### Arch Linux prerequisites
@@ -45,45 +36,32 @@ Install [GnuWin32](https://sourceforge.net/projects/getgnuwin32/) and [wget](htt
This project builds for Linux, macOS, and Windows. To perform a build for any supported platform follow the instructions for the platform below.
`NOTE: The build process takes a while, so grab a snack while you wait. ;)`
> NOTE: The build process takes a while, so grab a snack while you wait. ;)
### Linux
0. `./build/linux-build.sh`
1. `./build/linux-deploy.sh local`
0. `cd build`
1. `./build.sh`
2. Once the build process is complete run: `./linux-deploy.sh`
### macOS
If you installed Qt from Homebrew you need to set the following environment variable so that the build process can find qmake (the qt5 Homebrew formula is keg-only):
```
PATH="/usr/local/opt/qt/bin:$PATH"
```
0. `./build/osx-build.sh`
1. `./build/osx-deploy.sh local`
0. `cd build`
1. `./build.sh`
2. Once the build process is complete run: `./osx-deploy.sh`
### Windows
0. `cd build`
NOTE: The build process uses GnuWin32 tools and MinGW tools. Install these and make sure that `mingw32-make` and `wget` are on your path.
0. `./build/windows-build.sh`
1. `./build/windows-deploy.sh local`
1. `./win-build.sh`
2. Once the build process is complete run: `./win-deploy.sh`
## Running
The `deploy.sh` creates artifacts of the following form.
### Linux
Separate AppImage executables for each product of the project. See https://appimage.org/ for information on AppImage containers.
### macOS
Separate Apple Disk Images (DMGs) for each product of the project.
### Windows
Monolithic bzipped tarball containing all products of the project, extractable to anywhere.
The `deploy.sh` creates a tarball containing all of the executables and dependent libraries. Extract the tarball to your location of choice and execute.
Enjoy!
+4 -19
View File
@@ -22,41 +22,26 @@
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.)
- [ ] Finish Code Editor lexer for syntax highlights.
- [x] 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.
- Comic Sans font in C file comments is ridiculous
- [ ] VIM, perhaps.
- [ ] Add operator highlighting to Code Editor lexer.
- [ ] Arbitrary expressions in the Symbol Watch window.
- [ ] Interactive Lua console for debugging.
- [x] Figure out why Code Browser doesn't snap to reset vector when project is loaded at application startup, but does when project is loaded after startup.
- [ ] Make clean does not remove .nes or .chr files.
- [ ] Add icons to source navigator and add files to list from project so that files can be shown whether or not they are in the list because they were in the project
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.
- [x] Figure out how to adjust lines of errors, breakpoints, and symbol lookups...probably have to do background compilation.
(This is done because the IDE now puts up a message if a file is newer than the running ROM).
- [ ] 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.
- [ ] 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.
- [ ] 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.
## NESICIDE UX NOTES FROM GGJ2020
- [ ] Make mixed-mode checkbox accessible via keyboard shortcut, toolbar item, or etc.
- [ ] Mixed-mode assembly in side-bar
- [ ] Mixed-mode assembly updates in real-time (requires background quiet compilation)
- [ ] Attribute Table and Tile/Stamp data should *not* be in project file as they are thus inaccessible to the project source to reference
- [ ] 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 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
- [X] Fix linker config file browser -- shouldn't be looking to SAVE a file
Executable → Regular
+7 -6
View File
@@ -13,7 +13,7 @@ greaterThan(QT_MAJOR_VERSION,4) {
TOP = ../..
macx {
QMAKE_MAC_SDK = macosx10.15
QMAKE_MAC_SDK = macosx10.14
}
CONFIG(release, debug|release) {
@@ -55,11 +55,12 @@ FAMITRACKER_CXXFLAGS = -I$$TOP/libs/famitracker
RTMIDI_LIBS = -L$$DEPENDENCYROOTPATH/rtmidi/$$DESTDIR -lrtmidi
win32 {
contains(QT_ARCH, i386) {
arch = x86
} else {
arch = x64
}
# contains(QT_ARCH, i386) {
# arch = x86
# } else {
# arch = x64
# }
arch = x86
SDL_CXXFLAGS = -I$$DEPENDENCYPATH/SDL
SDL_LIBS = -L$$DEPENDENCYPATH/SDL/$$arch -lsdl
+9 -8
View File
@@ -14,7 +14,7 @@ greaterThan(QT_MAJOR_VERSION,4) {
TOP = ../..
macx {
QMAKE_MAC_SDK = macosx10.15
QMAKE_MAC_SDK = macosx10.14
}
CONFIG(release, debug|release) {
@@ -57,11 +57,12 @@ RTMIDI_LIBS = -L$$DEPENDENCYROOTPATH/rtmidi/$$DESTDIR -lrtmidi
# fixme duplication (https://wiki.qt.io/Including_.pro_Files)
win32 {
contains(QT_ARCH, i386) {
arch = x86
} else {
arch = x64
}
# contains(QT_ARCH, i386) {
# arch = x86
# } else {
# arch = x64
# }
arch = x86
SDL_CXXFLAGS = -I$$DEPENDENCYPATH/SDL
SDL_LIBS = -L$$DEPENDENCYPATH/SDL/$$arch -lsdl
@@ -134,8 +135,8 @@ LIBS += $$FAMITRACKER_LIBS \
$$RTMIDI_LIBS
unix {
QMAKE_CFLAGS += -I $$DEPENDENCYROOTPATH/wine/include -DWINE_UNICODE_NATIVE
QMAKE_CXXFLAGS += -I $$DEPENDENCYROOTPATH/wine/include -DWINE_UNICODE_NATIVE
QMAKE_CFLAGS += -I $$DEPENDENCYROOTPATH/wine/include -DWINE_UNICODE_NATIVE
QMAKE_CXXFLAGS += -I $$DEPENDENCYROOTPATH/wine/include -DWINE_UNICODE_NATIVE
}
INCLUDEPATH += \
+1 -1
View File
@@ -27,7 +27,7 @@ private:
Ui::MainWindow *ui;
bool _initialized;
public slots:
private slots:
void addToolBarWidget(QToolBar* toolBar);
void removeToolBarWidget(QToolBar* toolBar);
void editor_modificationChanged(bool m);
-8
View File
@@ -1,8 +0,0 @@
<RCC>
<qresource prefix="/">
<file>addons/NES/FamiTone2/Source Code/famitone2.inc</file>
<file>addons/NES/FamiTone2/README.HTM</file>
<file>addons/NES/FamiTone2/Source Code/famitone2.s_includeInBuild</file>
<file>addons/NES/FamiTone2/Custom Rules/famitone2.mk</file>
</qresource>
</RCC>
@@ -1,18 +0,0 @@
FTMSOURCES = $(shell find $(OBJDIR) -name *.ftxt)
FTMOBJECTS = $(FTMSOURCES:%.ftxt=%.o)
# Find exported FTMs
vpath %ftxt $(foreach ftxt,$(FTMSOURCES),$(dir $ftxt))
# Add FamiTone2 sources to project make rules
SOURCES += $(FTMSOURCES)
OBJECTS += $(FTMOBJECTS)
# Build a FamiTone2 object file
%.o : %.ftxt
text2data -ca65 $^
$(ASSEMBLE) $(ASFLAGS) -o $@ $(^:%.ftxt=%.s)
# Add FamiTone2 debris to project clean rules
REMOVES += $(FTMSOURCES) $(FTMSOURCES:%.ftxt=%.s)
REMOVES += $(OBJDIR)/famitone2.o
-5
View File
@@ -1,5 +0,0 @@
<h2>FamiTone2</h2>
This add-on provides NES assembly language routines for playing FamiTracker music and sound effects in your project.
<h3>Files:</h3>
famitone2.s<br>
famitone2.inc
@@ -1,10 +0,0 @@
;this CA65 file automatically reserves RAM for FamiTone2 variables and includes the code
.segment "ZEROPAGE"
FT_TEMP: .res FT_TEMP_SIZE
.segment "FAMITONE"
FT_BASE_ADR: .res FT_BASE_SIZE
.segment "CODE"
.include "famitone2.s"
File diff suppressed because it is too large Load Diff
@@ -15,9 +15,9 @@ void CMachineImageBuilder::clean()
buildTextLogger->erase();
buildTextLogger->write("<b>Project build started.</b>");
if ( (CCC65Interface::instance()->getCLanguageSourcesFromProject().count()) ||
(CCC65Interface::instance()->getAssemblerSourcesFromProject().count()) ||
(CCC65Interface::instance()->getCustomSourcesFromProject().count()) )
if ( (CCC65Interface::getCLanguageSourcesFromProject().count()) ||
(CCC65Interface::getAssemblerSourcesFromProject().count()) ||
(CCC65Interface::getCustomSourcesFromProject().count()) )
{
sourceAssembler.clean();
}
@@ -37,9 +37,9 @@ bool CMachineImageBuilder::build()
buildTextLogger->erase();
buildTextLogger->write("<b>Project build started.</b>");
if ( (CCC65Interface::instance()->getCLanguageSourcesFromProject().count()) ||
(CCC65Interface::instance()->getAssemblerSourcesFromProject().count()) ||
(CCC65Interface::instance()->getCustomSourcesFromProject().count()) )
if ( (CCC65Interface::getCLanguageSourcesFromProject().count()) ||
(CCC65Interface::getAssemblerSourcesFromProject().count()) ||
(CCC65Interface::getCustomSourcesFromProject().count()) )
{
if ( !nesicideProject->getLinkerConfigFile().isEmpty() )
{
+7 -7
View File
@@ -16,8 +16,8 @@ C64EmulatorControl::C64EmulatorControl(QWidget *parent) :
{
ui->setupUi(this);
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject::connect(breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(internalPause()));
QObject::connect(emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(internalPause()));
@@ -98,7 +98,7 @@ void C64EmulatorControl::internalPause()
void C64EmulatorControl::on_playButton_clicked()
{
CCC65Interface::instance()->isBuildUpToDate();
CCC65Interface::isBuildUpToDate();
emit startEmulation();
}
@@ -110,28 +110,28 @@ void C64EmulatorControl::on_pauseButton_clicked()
void C64EmulatorControl::on_stepCPUButton_clicked()
{
CCC65Interface::instance()->isBuildUpToDate();
CCC65Interface::isBuildUpToDate();
emit stepCPUEmulation();
}
void C64EmulatorControl::on_resetButton_clicked()
{
CCC65Interface::instance()->isBuildUpToDate();
CCC65Interface::isBuildUpToDate();
emit resetEmulator();
}
void C64EmulatorControl::on_stepOverButton_clicked()
{
CCC65Interface::instance()->isBuildUpToDate();
CCC65Interface::isBuildUpToDate();
emit stepOverCPUEmulation();
}
void C64EmulatorControl::on_stepOutButton_clicked()
{
CCC65Interface::instance()->isBuildUpToDate();
CCC65Interface::isBuildUpToDate();
emit stepOutCPUEmulation();
}
+11 -11
View File
@@ -34,7 +34,7 @@
static void breakpointHook ( void )
{
// Tell the world.
C64EmulatorThread* emulator = dynamic_cast<C64EmulatorThread*>(CObjectRegistry::instance()->getObject("Emulator"));
C64EmulatorThread* emulator = dynamic_cast<C64EmulatorThread*>(CObjectRegistry::getObject("Emulator"));
emulator->_breakpointHook();
}
@@ -59,7 +59,7 @@ C64EmulatorThread::C64EmulatorThread(QObject*)
// Enable breakpoint callbacks from the external emulator library.
c64SetBreakpointHook(breakpointHook);
BreakpointWatcherThread* breakpointWatcher = dynamic_cast<BreakpointWatcherThread*>(CObjectRegistry::instance()->getObject("Breakpoint Watcher"));
BreakpointWatcherThread* breakpointWatcher = dynamic_cast<BreakpointWatcherThread*>(CObjectRegistry::getObject("Breakpoint Watcher"));
QObject::connect(this,SIGNAL(breakpoint()),breakpointWatcher,SLOT(breakpoint()));
m_requestMutex = new QMutex();
@@ -225,7 +225,7 @@ void C64EmulatorThread::resetEmulator()
if ( fileName.endsWith(".c64",Qt::CaseInsensitive) ||
fileName.endsWith(".prg",Qt::CaseInsensitive) )
{
addr = CCC65Interface::instance()->getSegmentBase("STARTUP");
addr = CCC65Interface::getSegmentBase("STARTUP");
lockRequestQueue();
clearRequestQueue();
@@ -285,15 +285,15 @@ void C64EmulatorThread::stepCPUEmulation ()
// Check if we have an end address to stop at from a debug information file.
// If we do, it'll be the valid end of a C statement or an assembly instruction.
addr = c64GetCPURegister(CPU_PC);
absAddr = c64GetPhysicalAddressFromAddress(addr);
endAddr = CCC65Interface::instance()->getEndAddressFromPhysicalAddress(addr,absAddr);
absAddr = c64GetAbsoluteAddressFromAddress(addr);
endAddr = CCC65Interface::getEndAddressFromAbsoluteAddress(addr,absAddr);
if ( endAddr != 0xFFFFFFFF )
{
// Find the last opcode in the C-statement.
for ( ; endAddr > absAddr; endAddr-- )
{
if ( CCC65Interface::instance()->isPhysicalAddressAnOpcode(endAddr) )
if ( CCC65Interface::isAbsoluteAddressAnOpcode(endAddr) )
{
break;
}
@@ -346,8 +346,8 @@ void C64EmulatorThread::stepOverCPUEmulation ()
// Check if we have an end address to stop at from a debug information file.
// If we do, it'll be the valid end of a C statement or an assembly instruction.
addr = c64GetCPURegister(CPU_PC);
absAddr = c64GetPhysicalAddressFromAddress(addr);
endAddr = CCC65Interface::instance()->getEndAddressFromPhysicalAddress(addr,absAddr);
absAddr = c64GetAbsoluteAddressFromAddress(addr);
endAddr = CCC65Interface::getEndAddressFromAbsoluteAddress(addr,absAddr);
if ( endAddr != 0xFFFFFFFF )
{
@@ -357,8 +357,8 @@ void C64EmulatorThread::stepOverCPUEmulation ()
// Check if last instruction on line is JSR...
// This is fairly typical of if conditions with function calls on the same line.
instr = c64GetMemory(endAddr-2);
instAbsAddr = c64GetPhysicalAddressFromAddress(endAddr-2);
isInstr = CCC65Interface::instance()->isPhysicalAddressAnOpcode(instAbsAddr);
instAbsAddr = c64GetAbsoluteAddressFromAddress(endAddr-2);
isInstr = CCC65Interface::isAbsoluteAddressAnOpcode(instAbsAddr);
if ( !isInstr )
{
instr = c64GetMemory(addr);
@@ -634,7 +634,7 @@ void C64EmulatorThread::processResponses(QStringList requests,QStringList respon
// Update opcode masks to show proper disassembly...
for ( a = 0; a < MEM_64KB; a++ )
{
if ( CCC65Interface::instance()->isPhysicalAddressAnOpcode(a) )
if ( CCC65Interface::isAbsoluteAddressAnOpcode(a) )
{
c64SetOpcodeMask(a,1);
}
+6 -39
View File
@@ -1,25 +1,15 @@
#include "cdockwidgetregistry.h"
#include <QSettings>
CDockWidgetRegistry *CDockWidgetRegistry::_instance = NULL;
CDockWidgetRegistry::CDockWidgetRegistry()
{
mutex = new QMutex(QMutex::Recursive);
}
QHash<QString,CDockWidgetRegistry::CDockWidgetManager*> CDockWidgetRegistry::widgets;
QWidget* CDockWidgetRegistry::getWidget(const QString& name)
{
QWidget* widget = NULL;
mutex->lock();
if ( widgets.contains(name) )
{
widget = widgets[name]->widget;
return widgets[name]->widget;
}
mutex->unlock();
return widget;
return 0;
}
void CDockWidgetRegistry::addWidget(const QString& name, QWidget* widget, bool visible, bool permanent)
@@ -30,23 +20,18 @@ void CDockWidgetRegistry::addWidget(const QString& name, QWidget* widget, bool v
pDockWidgetManager->enabled = false;
pDockWidgetManager->permanent = permanent;
mutex->lock();
widgets.insert ( name, pDockWidgetManager );
mutex->unlock();
}
void CDockWidgetRegistry::removeWidget(const QString &name)
{
mutex->lock();
widgets.remove(name);
mutex->unlock();
}
void CDockWidgetRegistry::hideAll()
{
QHash<QString,CDockWidgetManager*>::const_iterator i;
mutex->lock();
for (i = widgets.begin(); i != widgets.end(); ++i)
{
if ( !i.value()->permanent )
@@ -55,50 +40,32 @@ void CDockWidgetRegistry::hideAll()
i.value()->visible = false;
}
}
mutex->unlock();
}
void CDockWidgetRegistry::saveVisibility()
{
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
mutex->lock();
QHash<QString,CDockWidgetManager*>::const_iterator i;
for (i = widgets.begin(); i != widgets.end(); ++i)
{
settings.setValue(i.value()->widget->objectName(),i.value()->widget->isVisible());
i.value()->visible = i.value()->widget->isVisible();
}
mutex->unlock();
}
void CDockWidgetRegistry::restoreVisibility()
{
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
mutex->lock();
QHash<QString,CDockWidgetManager*>::const_iterator i;
for (i = widgets.begin(); i != widgets.end(); ++i)
{
if ( settings.value(i.value()->widget->objectName()).toBool() )
if ( i.value()->visible )
{
i.value()->widget->show();
}
}
mutex->unlock();
}
bool CDockWidgetRegistry::visible(const QString& name)
{
bool visible = false;
mutex->lock();
visible = widgets.find(name).value()->visible;
mutex->unlock();
return visible;
return widgets.find(name).value()->visible;
}
+9 -20
View File
@@ -4,20 +4,10 @@
#include <QHash>
#include <QString>
#include <QDockWidget>
#include <QMutex>
class CDockWidgetRegistry
{
public:
static CDockWidgetRegistry *_instance;
static CDockWidgetRegistry *instance()
{
if ( !_instance )
{
_instance = new CDockWidgetRegistry();
}
return _instance;
}
typedef struct
{
QWidget* widget;
@@ -25,21 +15,20 @@ public:
bool enabled;
bool permanent;
} CDockWidgetManager;
QWidget* getWidget(const QString& name);
void addWidget(const QString& name,
CDockWidgetRegistry() {};
static QWidget* getWidget(const QString& name);
static void addWidget(const QString& name,
QWidget* widget,
bool visible = false,
bool permanent = false);
void removeWidget(const QString& name);
void hideAll();
void saveVisibility();
bool visible(const QString& name);
void restoreVisibility();
static void removeWidget(const QString& name);
static void hideAll();
static void saveVisibility();
static bool visible(const QString& name);
static void restoreVisibility();
private:
CDockWidgetRegistry();
QHash<QString,CDockWidgetManager*> widgets;
QMutex *mutex;
static QHash<QString,CDockWidgetManager*> widgets;
};
#endif // CDOCKWIDGETREGISTRY_H
+33 -110
View File
@@ -4,8 +4,6 @@
#include "cdockwidgetregistry.h"
#include "ccc65interface.h"
#include "model/projectsearcher.h"
#include "main.h"
#include <QToolButton>
@@ -15,7 +13,6 @@ CProjectTabWidget::CProjectTabWidget(QWidget *parent) :
{
tabBar()->installEventFilter(this);
tabBar()->setMouseTracking(true);
tabBar()->setVisible(EnvironmentSettingsDialog::useTabBarInEditorArea());
}
bool CProjectTabWidget::eventFilter(QObject *object, QEvent *event)
@@ -94,10 +91,10 @@ void CProjectTabWidget::tabBar_contextMenuEvent(QContextMenuEvent *event)
}
}
int CProjectTabWidget::addTab(QWidget *page, const QIcon &icon, const QString &label)
int CProjectTabWidget::addTab(QWidget *widget, const QIcon &/*icon*/, const QString &label)
{
CDesignerEditorBase* editor = dynamic_cast<CDesignerEditorBase*>(page);
QDockWidget* codeBrowser = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Assembly Browser"));
CDesignerEditorBase* editor = dynamic_cast<CDesignerEditorBase*>(widget);
QDockWidget* codeBrowser = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Assembly Browser"));
QIcon myIcon;
int tabIdx;
@@ -122,23 +119,15 @@ int CProjectTabWidget::addTab(QWidget *page, const QIcon &icon, const QString &l
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),editor,SLOT(updateTargetMachine(QString)));
}
myIcon = icon;
// Having a custom icon causes unnecessary and weird text eliding.
// if ( editor && editor->treeLink() )
// {
// myIcon = editor->treeLink()->icon();
// }
// else
// {
// myIcon = QIcon(":/resources/icons8-file.png");
// }
tabIdx = QTabWidget::addTab(page,myIcon,label);
// QToolButton *pButton = new QToolButton();
// pButton->setObjectName(label);
// pButton->setMaximumSize(16,16);
// pButton->setIcon(QIcon(":/resources/icons8-pin.png"));
// QObject::connect(pButton,SIGNAL(pressed()),this,SLOT(unDockTab()));
// tabBar()->setTabButton(tabIdx,QTabBar::RightSide,pButton);
if ( editor && editor->treeLink() )
{
myIcon = editor->treeLink()->icon();
}
else
{
myIcon = QIcon(":/resources/add_file.png");
}
tabIdx = QTabWidget::addTab(widget,myIcon,label);
// QToolButton* closeButton = new QToolButton;
// QStyle* closeButtonStyle = closeButton->style();
@@ -153,48 +142,9 @@ int CProjectTabWidget::addTab(QWidget *page, const QIcon &icon, const QString &l
return tabIdx;
}
void CProjectTabWidget::unDockTab()
int CProjectTabWidget::addTab(QWidget *widget, const QString &label)
{
// QToolButton *pButton = dynamic_cast<QToolButton*>(sender());
// QString name = pButton->objectName();
// int tab;
// for ( tab = 0; tab < count(); tab++ )
// {
// if ( tabBar()->tabText(tab) == name )
// {
// QWidget *detach = new QWidget(nullptr);
// detach->setWindowTitle(name);
// detach->setGeometry(widget(tab)->geometry());
// blockSignals(true);
// QGridLayout *layout = new QGridLayout();
// layout->addWidget(widget(tab));
// detach->setLayout(layout);
// blockSignals(false);
// detach->show();
// tearOffs.insert(name,detach);
// break;
// }
// }
}
void CProjectTabWidget::reDockTab()
{
// QWidget *attach = dynamic_cast<QWidget*>(sender());
// if ( attach )
// {
// tearOffs.remove(attach->windowTitle());
// blockSignals(true);
// int tab = addTab(attach,attach->windowTitle());
// blockSignals(false);
// attach->close();
// attach->deleteLater();
// }
}
int CProjectTabWidget::addTab(QWidget *page, const QString &label)
{
return addTab(page,QIcon(),label);
return addTab(widget,QIcon(),label);
}
void CProjectTabWidget::removeTab(int index)
@@ -242,7 +192,9 @@ void CProjectTabWidget::snapToTab(QString item)
QStringList splits;
uint32_t addr;
uint32_t absAddr;
QList<CSourceItem*> sources = ProjectSearcher::findItemsOfType<CSourceItem>(nesicideProject);
IProjectTreeViewItemIterator iter;
IProjectTreeViewItem* treeItem;
CSourceItem* pSource;
bool found = false;
bool open = false;
QDir dir;
@@ -273,17 +225,17 @@ void CProjectTabWidget::snapToTab(QString item)
addr = splits.at(3).toInt(NULL,16);
absAddr = (splits.at(1).toInt(NULL,16)*MEM_8KB)+splits.at(2).toInt(NULL,16);
}
file = QDir::cleanPath(CCC65Interface::instance()->getSourceFileFromPhysicalAddress(addr,absAddr));
file = CCC65Interface::getSourceFileFromAbsoluteAddress(addr,absAddr);
}
else if ( item.startsWith("SourceNavigatorFile,") )
{
splits = item.split(QRegExp("[,]"));
file = QDir::cleanPath(splits.at(1));
file = splits.at(1);
}
else if ( item.startsWith("OutputPaneFile,") )
{
splits = item.split(QRegExp("[,]"));
file = QDir::cleanPath(splits.at(1));
file = splits.at(1);
}
else if ( item.startsWith("Tile,") )
{
@@ -304,21 +256,9 @@ void CProjectTabWidget::snapToTab(QString item)
}
}
for ( tab = 0; tab < tearOffs.count(); tab++ )
{
if ( file == tearOffs.keys().at(tab) )
{
tearOffs.values().at(tab)->show();
found = true;
open = true;
break;
}
}
// File is not open, search the project.
if ( !found )
{
IProjectTreeViewItem* treeItem;
treeItem = findProjectItem(uuid);
if ( treeItem )
{
@@ -340,29 +280,24 @@ void CProjectTabWidget::snapToTab(QString item)
}
}
for ( tab = 0; tab < tearOffs.count(); tab++ )
{
if ( file == tearOffs.keys().at(tab) )
{
tearOffs.values().at(tab)->show();
found = true;
open = true;
break;
}
}
// File is not open, search the project.
if ( !found )
{
foreach ( CSourceItem* source, sources )
iter.reset(nesicideProject->getProject()->getSources());
while ( iter.current() )
{
if ( source->path() == file )
pSource = dynamic_cast<CSourceItem*>(iter.current());
if ( pSource )
{
source->openItemEvent(this);
found = true;
open = true;
break;
if ( pSource->path() == file )
{
pSource->openItemEvent(this);
found = true;
open = true;
break;
}
}
iter.next();
}
}
@@ -402,17 +337,6 @@ void CProjectTabWidget::snapToTab(QString item)
}
}
for ( int tab = 0; tab < tearOffs.count(); tab++ )
{
if ( filePath == tearOffs.keys().at(tab) )
{
tearOffs.values().at(tab)->show();
found = true;
open = true;
break;
}
}
if ( fileIn.exists() )
{
found = true;
@@ -426,7 +350,7 @@ void CProjectTabWidget::snapToTab(QString item)
{
QString str;
str.sprintf("Locate %s...",file.toLatin1().constData());
QString newDir = QFileDialog::getOpenFileName(0,str,QDir::currentPath(),QString(),NULL,QFileDialog::DontUseNativeDialog);
QString newDir = QFileDialog::getOpenFileName(0,str,QDir::currentPath());
if ( !newDir.isEmpty() )
{
QFileInfo fileInfo(newDir);
@@ -499,7 +423,6 @@ void CProjectTabWidget::applyProjectProperties()
void CProjectTabWidget::applyEnvironmentSettings()
{
tabBar()->setVisible(EnvironmentSettingsDialog::useTabBarInEditorArea());
emit applyEnvironmentSettingsToTab();
}
+2 -8
View File
@@ -4,7 +4,6 @@
#include <QTabWidget>
#include <QDateTime>
#include <QToolBar>
#include <QDockWidget>
// The IDE uses a system of signals named "snapTo" and "snapToTab" to
// communicate information between various debuggers, IDE elements, or
@@ -72,8 +71,8 @@ class CProjectTabWidget : public QTabWidget
public:
explicit CProjectTabWidget(QWidget *parent = 0);
int addTab(QWidget *page, const QString &label);
int addTab(QWidget *page, const QIcon &icon, const QString &label);
int addTab(QWidget *widget, const QIcon &icon, const QString &label);
int addTab(QWidget *widget, const QString &label);
void removeTab(int index);
protected:
@@ -101,8 +100,6 @@ signals:
void checkOpenFile(QDateTime lastActivationTime);
public slots:
void unDockTab();
void reDockTab();
void checkOpenFiles(QDateTime lastActivationTime);
void tabModified(bool modified);
void projectDirtied(bool dirtied);
@@ -111,9 +108,6 @@ public slots:
void applyProjectProperties();
void applyEnvironmentSettings();
void applyAppSettings();
protected:
QMap<QString,QWidget*> tearOffs;
};
#endif // CPROJECTTABWIDGET_H
+38 -47
View File
@@ -1,62 +1,56 @@
#include "crendererbase.h"
CRendererBase::CRendererBase(int sizeX,int sizeY,int textureSizeXY,int maxZoom,int8_t* imageData,QWidget *parent) :
QOpenGLWidget(parent),
CRendererBase::CRendererBase(int sizeX,int sizeY,int textureSizeXY,int maxZoom,char* imageData,QWidget *parent) :
QGLWidget(parent),
_sizeX(sizeX),
_trueSizeX(textureSizeXY),
_sizeY(sizeY),
_scrollX(0),
_scrollY(0),
_textureSizeXY(textureSizeXY),
_imageData(imageData),
_zoomFactor(100),
_maxZoom(maxZoom),
_initialized(false)
_maxZoom(maxZoom)
{
setBackgroundRole(QPalette::Dark);
setCursor(QCursor(Qt::CrossCursor));
_imageData = imageData;
setCursor(QCursor(Qt::CrossCursor));
}
CRendererBase::CRendererBase(int sizeX,int sizeY,int maxZoom,int8_t* imageData,QWidget *parent) :
QOpenGLWidget(parent),
CRendererBase::CRendererBase(int sizeX,int sizeY,int maxZoom,char* imageData,QWidget *parent) :
QGLWidget(parent),
_sizeX(sizeX),
_trueSizeX(sizeX),
_sizeY(sizeY),
_scrollX(0),
_scrollY(0),
_imageData(imageData),
_zoomFactor(100),
_maxZoom(maxZoom),
_initialized(false)
_maxZoom(maxZoom)
{
setBackgroundRole(QPalette::Dark);
setCursor(QCursor(Qt::CrossCursor));
_imageData = imageData;
if ( _sizeX > sizeY )
{
_textureSizeXY = _sizeX;
}
else if ( _sizeY > sizeX )
{
_textureSizeXY = _sizeY;
}
else
{
_textureSizeXY = _sizeX;
}
}
CRendererBase::~CRendererBase()
{
if ( _initialized )
{
glDeleteTextures(1,(GLuint*)&_textureID);
}
DeleteFunctions();
glDeleteTextures(1,(GLuint*)&_textureID);
}
void CRendererBase::initializeGL()
{
QOpenGLWidget::initializeGL();
connect(context(), &QOpenGLContext::aboutToBeDestroyed, this, &CRendererBase::DeleteFunctions);
m_pFunctions = new QOpenGLFunctions();
m_pFunctions->initializeOpenGLFunctions();
if ( _initialized )
{
glDeleteTextures(1,(GLuint*)&_textureID);
}
glGenTextures(1,(GLuint*)&_textureID);
// Enable flat shading
@@ -84,14 +78,16 @@ void CRendererBase::initializeGL()
// Enable textures
glEnable(GL_TEXTURE_2D);
resizeGL(width(),height());
// Create the texture we will be rendering onto
glBindTexture(GL_TEXTURE_2D, _textureID);
// We want it to be RGBA formatted
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glPixelStorei(GL_PACK_ALIGNMENT, 4);
glPixelStorei(GL_UNPACK_ROW_LENGTH, _trueSizeX);
glPixelStorei(GL_PACK_ROW_LENGTH, _trueSizeX);
glPixelStorei(GL_UNPACK_ROW_LENGTH, _textureSizeXY);
glPixelStorei(GL_PACK_ROW_LENGTH, _textureSizeXY);
// Set our texture parameters
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
@@ -101,12 +97,10 @@ void CRendererBase::initializeGL()
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
// Load the actual texture
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, _sizeX, _sizeY, 0, GL_RGBA, GL_UNSIGNED_BYTE, _imageData);
_initialized = true;
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, _textureSizeXY, _textureSizeXY, 0, GL_RGBA, GL_UNSIGNED_BYTE, _imageData);
}
void CRendererBase::reloadData(int8_t* imageData)
void CRendererBase::reloadData(char* imageData)
{
_imageData = imageData;
@@ -122,8 +116,6 @@ void CRendererBase::resizeGL(int width, int height)
{
QSize actualSize;
QOpenGLWidget::resizeGL(width,height);
// Force integral scaling factors. TODO: Add to environment settings.
int zf = _zoomFactor / 100;
@@ -156,25 +148,25 @@ void CRendererBase::resizeGL(int width, int height)
glScalef( actualSize.width() / float( width )/_sizeX, actualSize.height() / float( height )/_sizeY, 1 );
// Slightly offset the view to ensure proper pixel alignment
//glTranslatef(0.5,0.5,0);
// glTranslatef(0.5,0.5,0);
}
void CRendererBase::paintGL()
{
QOpenGLWidget::paintGL();
glBindTexture (GL_TEXTURE_2D, _textureID);
float scaleX = (float)_sizeX/(float)_textureSizeXY;
float scaleY = (float)_sizeY/(float)_textureSizeXY;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _sizeX, _sizeY, GL_RGBA, GL_UNSIGNED_BYTE, _imageData);
glBindTexture (GL_TEXTURE_2D, _textureID);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _textureSizeXY, _textureSizeXY, GL_RGBA, GL_UNSIGNED_BYTE, _imageData);
glBegin(GL_QUADS);
glTexCoord2f (0.0, 0.0);
glVertex3f(000.0f - _scrollX, 000.0f - _scrollY, 0.0f);
glTexCoord2f (1.0, 0.0);
glTexCoord2f (scaleX, 0.0);
glVertex3f(_sizeX - _scrollX, 000.0f - _scrollY, 0.0f);
glTexCoord2f (1.0, 1.0);
glTexCoord2f (scaleX, scaleY);
glVertex3f(_sizeX - _scrollX, _sizeY - _scrollY, 0.0f);
glTexCoord2f (0.0, 1.0);
glTexCoord2f (0.0, scaleY);
glVertex3f(000.0f - _scrollX, _sizeY - _scrollY, 0.0f);
glEnd();
}
@@ -184,7 +176,6 @@ void CRendererBase::changeZoom(int newZoom)
makeCurrent();
_zoomFactor = newZoom;
resizeGL(width(),height());
doneCurrent();
update();
}
+14 -12
View File
@@ -2,39 +2,41 @@
#define CRENDERERBASE_H
#include <QWidget>
#include <QOpenGLWidget>
#include <QOpenGLFunctions>
#include <QMouseEvent>
#include <QGLWidget>
#if defined ( __APPLE__ )
#include <OpenGL/glext.h>
#else
#include <GL/glext.h>
#endif
class CRendererBase : public QOpenGLWidget
class CRendererBase : public QGLWidget
{
Q_OBJECT
public:
CRendererBase(int sizeX,int sizeY,int textureSizeXY,int maxZoom,int8_t* imageData,QWidget *parent = 0);
CRendererBase(int sizeX,int sizeY,int maxZoom,int8_t* imageData,QWidget *parent = 0);
CRendererBase(int sizeX,int sizeY,int textureSizeXY,int maxZoom,char* imageData,QWidget *parent = 0);
CRendererBase(int sizeX,int sizeY,int maxZoom,char* imageData,QWidget *parent = 0);
virtual ~CRendererBase();
void initializeGL();
void resizeGL(int width, int height);
void paintGL();
void changeZoom(int newZoom);
void reloadData(int8_t* imageData);
void reloadData(char* imageData);
void setBGColor(QColor clr);
void setScrollX(int scrollX) { _scrollX = scrollX; }
void setScrollY(int scrollY) { _scrollY = scrollY; }
bool pointToPixel(int ptx,int pty,int* pixx,int* pixy);
protected:
void DeleteFunctions() {delete(m_pFunctions); m_pFunctions = nullptr;}
public slots:
QOpenGLFunctions * m_pFunctions = nullptr;
protected:
int _sizeX;
int _trueSizeX;
int _sizeY;
int _scrollX;
int _scrollY;
bool _initialized;
int8_t* _imageData;
int _textureSizeXY;
char* _imageData;
int _zoomFactor;
int _maxZoom;
GLuint _textureID;
+2 -2
View File
@@ -3,7 +3,7 @@
#include "nes_emulator_core.h"
PanZoomRenderer::PanZoomRenderer(int sizeX,int sizeY,int textureSizeXY,int maxZoom,int8_t* imageData,bool showPalette,QWidget *parent) :
PanZoomRenderer::PanZoomRenderer(int sizeX,int sizeY,int textureSizeXY,int maxZoom,char* imageData,bool showPalette,QWidget *parent) :
QWidget(parent),
_sizeX(sizeX),
_sizeY(sizeY),
@@ -19,7 +19,7 @@ PanZoomRenderer::PanZoomRenderer(int sizeX,int sizeY,int textureSizeXY,int maxZo
commonConstructor(showPalette);
}
PanZoomRenderer::PanZoomRenderer(int sizeX,int sizeY,int maxZoom,int8_t* imageData,bool showPalette,QWidget *parent) :
PanZoomRenderer::PanZoomRenderer(int sizeX,int sizeY,int maxZoom,char* imageData,bool showPalette,QWidget *parent) :
QWidget(parent),
_sizeX(sizeX),
_sizeY(sizeY),
+3 -3
View File
@@ -14,11 +14,11 @@ class PanZoomRenderer : public QWidget
{
Q_OBJECT
public:
PanZoomRenderer(int sizeX,int sizeY,int maxZoom,int8_t* imageData,bool showPalette,QWidget *parent = 0);
PanZoomRenderer(int sizeX,int sizeY,int textureSizeXY,int maxZoom,int8_t* imageData,bool showPalette,QWidget *parent = 0);
PanZoomRenderer(int sizeX,int sizeY,int maxZoom,char* imageData,bool showPalette,QWidget *parent = 0);
PanZoomRenderer(int sizeX,int sizeY,int textureSizeXY,int maxZoom,char* imageData,bool showPalette,QWidget *parent = 0);
void commonConstructor(bool showPalette);
virtual ~PanZoomRenderer();
void reloadData(int8_t* imageData) { renderer->reloadData(imageData); }
void reloadData(char* imageData) { renderer->reloadData(imageData); }
QColor getColor(int idx);
void showPalette(bool show);
bool pointToPixel(int ptx,int pty,int* pixx,int* pixy) { return renderer->pointToPixel(ptx,pty,pixx,pixy); }
+23 -50
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>782</width>
<height>312</height>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="mouseTracking">
@@ -19,49 +19,34 @@
<property name="widgetResizable" stdset="0">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout" rowstretch="0,1">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,1,0">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="paletteLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Palette:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QHBoxLayout" name="paletteLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="paletteLabel">
<property name="text">
<string>Palette:</string>
</property>
</widget>
</item>
<item>
<widget class="QtColorPicker" name="col0PushButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -80,7 +65,7 @@
<item>
<widget class="QtColorPicker" name="col1PushButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -99,7 +84,7 @@
<item>
<widget class="QtColorPicker" name="col2PushButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -118,7 +103,7 @@
<item>
<widget class="QtColorPicker" name="col3PushButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -217,8 +202,8 @@
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_3" rowstretch="1,0" columnstretch="1,0">
<item row="3" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_3">
<property name="spacing">
<number>0</number>
</property>
@@ -236,9 +221,6 @@
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
@@ -249,16 +231,7 @@
<number>1</number>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
+13 -25
View File
@@ -2,16 +2,25 @@
#include "main.h"
SearcherWorker::SearcherWorker(QObject*)
SearcherThread::SearcherThread(QObject*)
{
m_found = 0;
pThread = new QThread();
moveToThread(pThread);
pThread->start();
}
SearcherWorker::~SearcherWorker()
SearcherThread::~SearcherThread()
{
pThread->exit(0);
pThread->wait();
delete pThread;
}
void SearcherWorker::search(QDir dir, QString searchText, QString pattern, bool subfolders, bool sourceSearchPaths, bool useRegex, bool caseSensitive)
void SearcherThread::search(QDir dir, QString searchText, QString pattern, bool subfolders, bool sourceSearchPaths, bool useRegex, bool caseSensitive)
{
m_dir = dir;
m_searchText = searchText;
@@ -34,7 +43,7 @@ void SearcherWorker::search(QDir dir, QString searchText, QString pattern, bool
emit searchDone(m_found);
}
void SearcherWorker::doSearch(QDir dir,int* finds)
void SearcherThread::doSearch(QDir dir,int* finds)
{
QDir base(QDir::currentPath());
QFileInfoList entries = dir.entryInfoList(QDir::AllDirs|QDir::NoDotAndDotDot|QDir::NoSymLinks|QDir::Files);
@@ -89,24 +98,3 @@ void SearcherWorker::doSearch(QDir dir,int* finds)
}
}
}
SearcherThread::SearcherThread(QObject*)
{
pWorker = new SearcherWorker();
QObject::connect(pWorker,SIGNAL(searchDone(int)),this,SIGNAL(searchDone(int)));
pThread = new QThread();
pWorker->moveToThread(pThread);
pThread->start();
}
SearcherThread::~SearcherThread()
{
pThread->exit(0);
pThread->wait();
delete pThread;
delete pWorker;
}
+6 -24
View File
@@ -5,19 +5,22 @@
#include <QDir>
#include <QSemaphore>
class SearcherWorker : public QObject
class SearcherThread : public QObject
{
Q_OBJECT
public:
SearcherWorker ( QObject* parent = 0 );
virtual ~SearcherWorker ();
SearcherThread ( QObject* parent = 0 );
virtual ~SearcherThread ();
public slots:
void search(QDir dir, QString searchText, QString pattern, bool subfolders, bool sourceSearchPaths, bool useRegex, bool caseSensitive);
signals:
void searchDone(int found);
protected:
QThread* pThread;
void doSearch(QDir dir,int* finds);
bool m_isTerminating;
QDir m_dir;
@@ -30,25 +33,4 @@ protected:
int m_found;
};
class SearcherThread : public QObject
{
Q_OBJECT
public:
SearcherThread ( QObject* parent = 0 );
virtual ~SearcherThread ();
public slots:
void search(QDir dir, QString searchText, QString pattern, bool subfolders, bool sourceSearchPaths, bool useRegex, bool caseSensitive)
{
pWorker->search(dir,searchText,pattern,subfolders,sourceSearchPaths,useRegex,caseSensitive);
}
signals:
void searchDone(int found);
protected:
SearcherWorker *pWorker;
QThread *pThread;
};
#endif // SEARCHERTHREAD_H
+2 -2
View File
@@ -35,7 +35,7 @@ SearchWidget::SearchWidget(QWidget *parent) :
ui->location->completer()->setCompletionMode(QCompleter::PopupCompletion);
ui->type->completer()->setCompletionMode(QCompleter::PopupCompletion);
QObject* searcher = CObjectRegistry::instance()->getObject("Searcher");
QObject* searcher = CObjectRegistry::getObject("Searcher");
qRegisterMetaType<QDir>("QDir");
QObject::connect(this,SIGNAL(search(QDir,QString,QString,bool,bool,bool,bool)),searcher,SLOT(search(QDir,QString,QString,bool,bool,bool,bool)));
QObject::connect(searcher,SIGNAL(searchDone(int)),this,SLOT(searcher_searchDone(int)));
@@ -95,7 +95,7 @@ void SearchWidget::on_find_clicked()
{
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
QStringList items;
SearcherThread* searcher = dynamic_cast<SearcherThread*>(CObjectRegistry::instance()->getObject("Searcher"));
SearcherThread* searcher = dynamic_cast<SearcherThread*>(CObjectRegistry::getObject("Searcher"));
if ( !ui->searchText->currentText().isEmpty() )
{
+20 -20
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>758</width>
<height>194</height>
<width>559</width>
<height>155</height>
</rect>
</property>
<property name="sizePolicy">
@@ -116,16 +116,17 @@
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="3">
<widget class="QPushButton" name="find">
<item row="0" column="0">
<widget class="QCheckBox" name="projectFolder">
<property name="text">
<string>Find...</string>
<string>Limit search to Project folders</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="subfolders">
<property name="text">
<string>Include Subfolders</string>
</property>
</widget>
</item>
@@ -143,13 +144,6 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="projectFolder">
<property name="text">
<string>Limit search to Project folders</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="sourceSearchPaths">
<property name="text">
@@ -157,10 +151,16 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="subfolders">
<item row="1" column="3">
<widget class="QPushButton" name="find">
<property name="text">
<string>Include Subfolders</string>
<string>Find...</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
+10 -10
View File
@@ -22,8 +22,8 @@ SourceNavigator::SourceNavigator(QWidget *parent) :
m_loadedTarget = "none";
QObject* compiler = CObjectRegistry::instance()->getObject("Compiler");
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* compiler = CObjectRegistry::getObject("Compiler");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject::connect(compiler,SIGNAL(compileDone(bool)),this,SLOT(compiler_compileDone(bool)));
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),this,SLOT(emulator_emulatorPaused()));
}
@@ -35,7 +35,7 @@ SourceNavigator::~SourceNavigator()
void SourceNavigator::updateTargetMachine(QString target)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
m_loadedTarget = target;
@@ -60,7 +60,7 @@ void SourceNavigator::updateFiles(bool doIt)
ui->files->clear();
ui->symbols->clear();
QStringList files = CCC65Interface::instance()->getSourceFiles();
QStringList files = CCC65Interface::getSourceFiles();
ui->files->addItems(files);
if ( doIt )
@@ -86,7 +86,7 @@ void SourceNavigator::updateSymbolsForFile(QString file)
blockSignals(true);
ui->symbols->clear();
symbols = CCC65Interface::instance()->getSymbolsForSourceFile(file);
symbols = CCC65Interface::getSymbolsForSourceFile(file);
ui->symbols->addItems(symbols);
blockSignals(false);
@@ -111,18 +111,18 @@ void SourceNavigator::emulator_emulatorPaused(bool show)
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
{
addr = nesGetCPUProgramCounterOfLastSync();
absAddr = nesGetPhysicalAddressFromAddress(addr);
absAddr = nesGetAbsoluteAddressFromAddress(addr);
}
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
{
addr = c64GetCPURegister(CPU_PC);
absAddr = c64GetPhysicalAddressFromAddress(addr);
absAddr = c64GetAbsoluteAddressFromAddress(addr);
}
file = CCC65Interface::instance()->getSourceFileFromPhysicalAddress(addr,absAddr);
file = CCC65Interface::getSourceFileFromAbsoluteAddress(addr,absAddr);
if ( !file.isEmpty() )
{
linenumber = CCC65Interface::instance()->getSourceLineFromPhysicalAddress(addr,absAddr);
linenumber = CCC65Interface::getSourceLineFromAbsoluteAddress(addr,absAddr);
emit snapTo("SourceNavigatorFile,"+file+","+QString::number(linenumber));
}
}
@@ -142,7 +142,7 @@ void SourceNavigator::on_files_activated(QString file)
void SourceNavigator::on_symbols_activated(QString symbol)
{
QString file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
QString file = CCC65Interface::getSourceFileFromSymbol(symbol);
emit snapTo("SourceNavigatorFile,"+file);
emit snapTo("SourceNavigatorSymbol,"+symbol);
}
+122 -225
View File
@@ -5,11 +5,11 @@
#include "dbg_cnes6502.h"
#include "model/projectsearcher.h"
#include "main.h"
CCC65Interface *CCC65Interface::_instance = NULL;
cc65_dbginfo CCC65Interface::dbgInfo = NULL;
QStringList CCC65Interface::errors;
QString CCC65Interface::targetMachine = "none";
// This utility compares two file paths regardless of original slashery.
bool fileNamesAreIdentical(QString file1, QString file2)
@@ -33,13 +33,7 @@ static const char* asmTargetRuleFmt =
;
CCC65Interface::CCC65Interface()
: dbgInfo(NULL),
targetMachine("none"),
process(NULL)
{
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
qRegisterMetaType<QProcess::ProcessState>("QProcess::ProcessState");
}
CCC65Interface::~CCC65Interface()
@@ -60,44 +54,47 @@ void CCC65Interface::clear()
QStringList CCC65Interface::getAssemblerSourcesFromProject()
{
QDir baseDir(QDir::currentPath());
QStringList extensions = EnvironmentSettingsDialog::sourceExtensionsForAssembly().split(" ", QString::SkipEmptyParts);
QList<CSourceItem*> projectSources = ProjectSearcher::findItemsOfType<CSourceItem>(nesicideProject);
QStringList includedSources;
IProjectTreeViewItemIterator iter(nesicideProject->getProject()->getSources());
QDir baseDir(QDir::currentPath());
CSourceItem* source;
QStringList sources;
QStringList extensions = EnvironmentSettingsDialog::sourceExtensionsForAssembly().split(" ", QString::SkipEmptyParts);
// For each source code object, compile it.
foreach ( CSourceItem* source, projectSources )
while ( iter.current() )
{
source = dynamic_cast<CSourceItem*>(iter.current());
foreach ( QString extension, extensions )
{
if ( source->includeInBuild() &&
source->path().endsWith(extension,Qt::CaseInsensitive) )
if ( source && source->path().endsWith(extension,Qt::CaseInsensitive) )
{
includedSources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
sources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
}
}
iter.next();
}
return includedSources;
return sources;
}
QStringList CCC65Interface::getCLanguageSourcesFromProject()
{
QDir baseDir(QDir::currentPath());
QStringList extensions = EnvironmentSettingsDialog::sourceExtensionsForC().split(" ", QString::SkipEmptyParts);
QStringList headerExtensions = EnvironmentSettingsDialog::headerExtensions().split(" ", QString::SkipEmptyParts);
bool add;
QList<CSourceItem*> projectSources = ProjectSearcher::findItemsOfType<CSourceItem>(nesicideProject);
QStringList includedSources;
IProjectTreeViewItemIterator iter(nesicideProject->getProject()->getSources());
QDir baseDir(QDir::currentPath());
CSourceItem* source;
QStringList sources;
QStringList extensions = EnvironmentSettingsDialog::sourceExtensionsForC().split(" ", QString::SkipEmptyParts);
QStringList headerExtensions = EnvironmentSettingsDialog::headerExtensions().split(" ", QString::SkipEmptyParts);
bool add;
// For each source code object, compile it.
foreach ( CSourceItem* source, projectSources )
while ( iter.current() )
{
source = dynamic_cast<CSourceItem*>(iter.current());
add = true;
foreach ( QString extension, extensions )
{
if ( source->includeInBuild() &&
source->path().endsWith(extension,Qt::CaseInsensitive) )
if ( source && source->path().endsWith(extension,Qt::CaseInsensitive) )
{
foreach ( QString headerExtension, headerExtensions )
{
@@ -110,32 +107,34 @@ QStringList CCC65Interface::getCLanguageSourcesFromProject()
if ( add )
{
includedSources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
sources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
}
}
}
iter.next();
}
return includedSources;
return sources;
}
QStringList CCC65Interface::getCustomSourcesFromProject()
{
QDir baseDir(QDir::currentPath());
QStringList extensions = EnvironmentSettingsDialog::customExtensions().split(" ", QString::SkipEmptyParts);
QStringList headerExtensions = EnvironmentSettingsDialog::headerExtensions().split(" ", QString::SkipEmptyParts);
bool add;
QList<CSourceItem*> projectSources = ProjectSearcher::findItemsOfType<CSourceItem>(nesicideProject);
QStringList includedSources;
IProjectTreeViewItemIterator iter(nesicideProject->getProject()->getSources());
QDir baseDir(QDir::currentPath());
CSourceItem* source;
QStringList sources;
QStringList extensions = EnvironmentSettingsDialog::customExtensions().split(" ", QString::SkipEmptyParts);
QStringList headerExtensions = EnvironmentSettingsDialog::headerExtensions().split(" ", QString::SkipEmptyParts);
bool add;
// For each source code object, compile it.
foreach ( CSourceItem* source, projectSources )
while ( iter.current() )
{
source = dynamic_cast<CSourceItem*>(iter.current());
add = true;
foreach ( QString extension, extensions )
{
if ( source->includeInBuild() &&
source->path().endsWith(extension,Qt::CaseInsensitive) )
if ( source && source->path().endsWith(extension,Qt::CaseInsensitive) )
{
foreach ( QString headerExtension, headerExtensions )
{
@@ -148,13 +147,14 @@ QStringList CCC65Interface::getCustomSourcesFromProject()
if ( add )
{
includedSources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
sources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
}
}
}
iter.next();
}
return includedSources;
return sources;
}
bool CCC65Interface::createMakefile()
@@ -220,12 +220,14 @@ bool CCC65Interface::createMakefile()
makeFileContent.replace("<!target-rules!>",targetRules);
makeFileContent.replace("<!linker-dependencies!>",nesicideProject->getLinkerAdditionalDependencies());
QString customRulesFiles;
foreach ( QString customRuleFile,nesicideProject->getMakefileCustomRuleFiles() )
if ( !nesicideProject->getMakefileCustomRulesFile().isEmpty() )
{
customRulesFiles += "-include "+customRuleFile+"\r\n";
makeFileContent.replace("<!custom-rules!>",QString("-include ")+nesicideProject->getMakefileCustomRulesFile());
}
else
{
makeFileContent.replace("<!custom-rules!>","");
}
makeFileContent.replace("<!custom-rules!>",customRulesFiles);
// Write the file to disk.
makeFile.write(makeFileContent.toLatin1());
@@ -239,106 +241,18 @@ bool CCC65Interface::createMakefile()
return false;
}
void CCC65Interface::process_errorOccurred(QProcess::ProcessError error)
{
//buildTextLogger->write("<b><font color='gray' style='bold'>ENV::ERROR: "+QString::number(error)+"</font></b>");
}
void CCC65Interface::process_finished(int exitCode, QProcess::ExitStatus exitStatus)
{
QString stdioStr;
QStringList stdioList;
//buildTextLogger->write("<b><font color='gray' style='bold'>ENV::EXIT "+QString::number(exitCode)+", "+QString::number(exitStatus)+"</font></b>");
stdioStr = QString(process.readAllStandardError());
stdioList = stdioStr.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
errors.append(stdioList);
foreach ( const QString& str, stdioList )
{
buildTextLogger->write("<font color='red'>"+str+"</font>");
}
}
void CCC65Interface::process_readyReadStandardError()
{
QString stdioStr;
QStringList stdioList;
if ( process.state() == QProcess::ProcessState::Running )
{
//buildTextLogger->write("<b><font color='gray' style='bold'>ENV::READ STDERR</font></b>");
stdioStr = QString(process.readAllStandardError());
stdioList = stdioStr.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
errors.append(stdioList);
foreach ( const QString& str, stdioList )
{
buildTextLogger->write("<font color='red'>"+str+"</font>");
}
}
}
void CCC65Interface::process_readyReadStandardOutput()
{
QString stdioStr;
QStringList stdioList;
if ( process.state() == QProcess::ProcessState::Running )
{
//buildTextLogger->write("<b><font color='gray' style='bold'>ENV::READ STDOUT</font></b>");
stdioStr = QString(process.readAllStandardOutput());
stdioList = stdioStr.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
foreach ( const QString& str, stdioList )
{
buildTextLogger->write("<font color='blue'>"+str+"</font>");
}
}
}
void CCC65Interface::process_started()
{
QString stdioStr;
QStringList stdioList;
//buildTextLogger->write("<b><font color='gray' style='bold'>ENV::STARTED</font></b>");
stdioStr = QString(process.readAllStandardOutput());
stdioList = stdioStr.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
foreach ( const QString& str, stdioList )
{
buildTextLogger->write("<font color='blue'>"+str+"</font>");
}
}
void CCC65Interface::process_stateChanged(QProcess::ProcessState newState)
{
//buildTextLogger->write("<b><font color='gray' style='bold'>ENV::STATE: "+QString::number(newState)+"</font></b>");
}
void CCC65Interface::clean()
{
QProcess make;
QStringList env = QProcess::systemEnvironment();
QString invocationStr;
QString stdioStr;
QStringList stdioList;
int exitCode;
// Prevent overbuild
protect.lock();
process.moveToThread(QThread::currentThread());
// Copy the system environment to the child process.
process.setEnvironment(env);
process.setWorkingDirectory(QDir::currentPath());
QObject::connect(&process,SIGNAL(started()),this,SLOT(process_started()));
QObject::connect(&process,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(process_finished(int,QProcess::ExitStatus)));
QObject::connect(&process,SIGNAL(errorOccurred(QProcess::ProcessError)),this,SLOT(process_errorOccurred(QProcess::ProcessError)));
QObject::connect(&process,SIGNAL(readyReadStandardError()),this,SLOT(process_readyReadStandardError()));
QObject::connect(&process,SIGNAL(readyReadStandardOutput()),this,SLOT(process_readyReadStandardOutput()));
QObject::connect(&process,SIGNAL(stateChanged(QProcess::ProcessState)),this,SLOT(process_stateChanged(QProcess::ProcessState)));
make.setEnvironment(env);
make.setWorkingDirectory(QDir::currentPath());
// Clear the error storage.
errors.clear();
@@ -349,24 +263,30 @@ void CCC65Interface::clean()
buildTextLogger->write(invocationStr);
process.start(invocationStr);
process.waitForFinished();
QObject::disconnect(&process,SIGNAL(started()),this,SLOT(process_started()));
QObject::disconnect(&process,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(process_finished(int,QProcess::ExitStatus)));
QObject::disconnect(&process,SIGNAL(errorOccurred(QProcess::ProcessError)),this,SLOT(process_errorOccurred(QProcess::ProcessError)));
QObject::disconnect(&process,SIGNAL(readyReadStandardError()),this,SLOT(process_readyReadStandardError()));
QObject::disconnect(&process,SIGNAL(readyReadStandardOutput()),this,SLOT(process_readyReadStandardOutput()));
QObject::disconnect(&process,SIGNAL(stateChanged(QProcess::ProcessState)),this,SLOT(process_stateChanged(QProcess::ProcessState)));
// Prevent overbuild
protect.unlock();
make.start(invocationStr);
make.waitForFinished();
make.waitForReadyRead();
exitCode = make.exitCode();
stdioStr = QString(make.readAllStandardOutput());
stdioList = stdioStr.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
foreach ( const QString& str, stdioList )
{
buildTextLogger->write("<font color='blue'>"+str+"</font>");
}
stdioStr = QString(make.readAllStandardError());
stdioList = stdioStr.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
errors.append(stdioList);
foreach ( const QString& str, stdioList )
{
buildTextLogger->write("<font color='red'>"+str+"</font>");
}
return;
}
bool CCC65Interface::assemble()
{
QProcess make;
QStringList env = QProcess::systemEnvironment();
QString invocationStr;
QString stdioStr;
@@ -376,9 +296,6 @@ bool CCC65Interface::assemble()
int exitCode;
bool ok = true;
// Prevent overbuild
protect.lock();
if ( nesicideProject->getProjectLinkerOutputName().isEmpty() )
{
outputName = outputDir.fromNativeSeparators(outputDir.filePath(nesicideProject->getProjectOutputName()+".prg"));
@@ -390,14 +307,8 @@ bool CCC65Interface::assemble()
buildTextLogger->write("<b>Building: "+outputName+"</b>");
// Copy the system environment to the child process.
process.setEnvironment(env);
process.setWorkingDirectory(QDir::currentPath());
QObject::connect(&process,SIGNAL(started()),this,SLOT(process_started()));
QObject::connect(&process,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(process_finished(int,QProcess::ExitStatus)));
QObject::connect(&process,SIGNAL(errorOccurred(QProcess::ProcessError)),this,SLOT(process_errorOccurred(QProcess::ProcessError)));
QObject::connect(&process,SIGNAL(readyReadStandardError()),this,SLOT(process_readyReadStandardError()));
QObject::connect(&process,SIGNAL(readyReadStandardOutput()),this,SLOT(process_readyReadStandardOutput()));
QObject::connect(&process,SIGNAL(stateChanged(QProcess::ProcessState)),this,SLOT(process_stateChanged(QProcess::ProcessState)));
make.setEnvironment(env);
make.setWorkingDirectory(QDir::currentPath());
// Clear the error storage.
errors.clear();
@@ -408,24 +319,28 @@ bool CCC65Interface::assemble()
buildTextLogger->write(invocationStr);
process.start(invocationStr);
process.waitForFinished();
exitCode = process.exitCode();
make.start(invocationStr);
make.waitForFinished();
make.waitForReadyRead();
exitCode = make.exitCode();
stdioStr = QString(make.readAllStandardOutput());
stdioList = stdioStr.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
foreach ( const QString& str, stdioList )
{
buildTextLogger->write("<font color='blue'>"+str+"</font>");
}
stdioStr = QString(make.readAllStandardError());
stdioList = stdioStr.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
errors.append(stdioList);
foreach ( const QString& str, stdioList )
{
buildTextLogger->write("<font color='red'>"+str+"</font>");
}
if ( exitCode )
{
ok = false;
}
QObject::disconnect(&process,SIGNAL(started()),this,SLOT(process_started()));
QObject::disconnect(&process,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(process_finished(int,QProcess::ExitStatus)));
QObject::disconnect(&process,SIGNAL(errorOccurred(QProcess::ProcessError)),this,SLOT(process_errorOccurred(QProcess::ProcessError)));
QObject::disconnect(&process,SIGNAL(readyReadStandardError()),this,SLOT(process_readyReadStandardError()));
QObject::disconnect(&process,SIGNAL(readyReadStandardOutput()),this,SLOT(process_readyReadStandardOutput()));
QObject::disconnect(&process,SIGNAL(stateChanged(QProcess::ProcessState)),this,SLOT(process_stateChanged(QProcess::ProcessState)));
// Prevent overbuild
protect.unlock();
return ok;
}
@@ -474,6 +389,7 @@ bool CCC65Interface::captureDebugInfo()
bool CCC65Interface::isBuildUpToDate()
{
QProcess make;
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QString invocationStr;
QString stdioStr;
@@ -484,22 +400,13 @@ bool CCC65Interface::isBuildUpToDate()
"is rebuilt.\n\n";
bool ok = true;
// Prevent overbuild
protect.lock();
// 'Build' is up-to-date if no sources present.
if ( (getCLanguageSourcesFromProject().count() ||
(getAssemblerSourcesFromProject().count())) )
{
// Copy the system environment to the child process.
process.setProcessEnvironment(env);
process.setWorkingDirectory(QDir::currentPath());
QObject::connect(&process,SIGNAL(started()),this,SLOT(process_started()));
QObject::connect(&process,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(process_finished(int,QProcess::ExitStatus)));
QObject::connect(&process,SIGNAL(errorOccurred(QProcess::ProcessError)),this,SLOT(process_errorOccurred(QProcess::ProcessError)));
QObject::connect(&process,SIGNAL(readyReadStandardError()),this,SLOT(process_readyReadStandardError()));
QObject::connect(&process,SIGNAL(readyReadStandardOutput()),this,SLOT(process_readyReadStandardOutput()));
QObject::connect(&process,SIGNAL(stateChanged(QProcess::ProcessState)),this,SLOT(process_stateChanged(QProcess::ProcessState)));
make.setProcessEnvironment(env);
make.setWorkingDirectory(QDir::currentPath());
// Clear the error storage.
errors.clear();
@@ -508,27 +415,17 @@ bool CCC65Interface::isBuildUpToDate()
invocationStr = "make -f nesicide.mk -q all";
process.start(invocationStr);
process.waitForFinished();
exitCode = process.exitCode();
make.start(invocationStr);
make.waitForFinished();
exitCode = make.exitCode();
if ( exitCode == 1 )
{
QMessageBox::warning(NULL,"Consistency problem!",outdated);
ok = false;
}
QObject::disconnect(&process,SIGNAL(started()),this,SLOT(process_started()));
QObject::disconnect(&process,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(process_finished(int,QProcess::ExitStatus)));
QObject::disconnect(&process,SIGNAL(errorOccurred(QProcess::ProcessError)),this,SLOT(process_errorOccurred(QProcess::ProcessError)));
QObject::disconnect(&process,SIGNAL(readyReadStandardError()),this,SLOT(process_readyReadStandardError()));
QObject::disconnect(&process,SIGNAL(readyReadStandardOutput()),this,SLOT(process_readyReadStandardOutput()));
QObject::disconnect(&process,SIGNAL(stateChanged(QProcess::ProcessState)),this,SLOT(process_stateChanged(QProcess::ProcessState)));
}
// Prevent overbuild
protect.unlock();
return ok;
}
@@ -712,20 +609,20 @@ unsigned int CCC65Interface::getSymbolAddress(QString symbol, int index)
return addr;
}
unsigned int CCC65Interface::getSymbolPhysicalAddress(QString symbol, int index)
unsigned int CCC65Interface::getSymbolAbsoluteAddress(QString symbol, int index)
{
// Dispatch to appropriate target machine handler.
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
{
return nesGetSymbolPhysicalAddress(symbol,index);
return nesGetSymbolAbsoluteAddress(symbol,index);
}
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
{
return c64GetSymbolPhysicalAddress(symbol,index);
return c64GetSymbolAbsoluteAddress(symbol,index);
}
}
unsigned int CCC65Interface::nesGetSymbolPhysicalAddress(QString symbol, int index)
unsigned int CCC65Interface::nesGetSymbolAbsoluteAddress(QString symbol, int index)
{
const cc65_symbolinfo* dbgSymbols;
const cc65_segmentinfo* dbgSegments;
@@ -782,7 +679,7 @@ unsigned int CCC65Interface::nesGetSymbolPhysicalAddress(QString symbol, int ind
return absAddr;
}
unsigned int CCC65Interface::c64GetSymbolPhysicalAddress(QString symbol, int index)
unsigned int CCC65Interface::c64GetSymbolAbsoluteAddress(QString symbol, int index)
{
const cc65_symbolinfo* dbgSymbols;
const cc65_segmentinfo* dbgSegments;
@@ -1014,20 +911,20 @@ int CCC65Interface::getSymbolMatchCount(QString symbol)
return count;
}
QString CCC65Interface::getSourceFileFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
QString CCC65Interface::getSourceFileFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
{
// Dispatch to appropriate target machine handler.
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
{
return QDir::fromNativeSeparators(nesGetSourceFileFromPhysicalAddress(addr,absAddr));
return QDir::fromNativeSeparators(nesGetSourceFileFromAbsoluteAddress(addr,absAddr));
}
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
{
return QDir::fromNativeSeparators(c64GetSourceFileFromPhysicalAddress(addr,absAddr));
return QDir::fromNativeSeparators(c64GetSourceFileFromAbsoluteAddress(addr,absAddr));
}
}
QString CCC65Interface::nesGetSourceFileFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
QString CCC65Interface::nesGetSourceFileFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
{
const cc65_spaninfo* dbgSpans;
const cc65_segmentinfo* dbgSegments;
@@ -1120,7 +1017,7 @@ QString CCC65Interface::nesGetSourceFileFromPhysicalAddress(uint32_t addr,uint32
return QDir::fromNativeSeparators(file);
}
QString CCC65Interface::c64GetSourceFileFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
QString CCC65Interface::c64GetSourceFileFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
{
const cc65_spaninfo* dbgSpans;
const cc65_segmentinfo* dbgSegments;
@@ -1195,20 +1092,20 @@ QString CCC65Interface::c64GetSourceFileFromPhysicalAddress(uint32_t addr,uint32
return QDir::fromNativeSeparators(file);
}
int CCC65Interface::getSourceLineFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
int CCC65Interface::getSourceLineFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
{
// Dispatch to appropriate target machine handler.
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
{
return nesGetSourceLineFromPhysicalAddress(addr,absAddr);
return nesGetSourceLineFromAbsoluteAddress(addr,absAddr);
}
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
{
return c64GetSourceLineFromPhysicalAddress(addr,absAddr);
return c64GetSourceLineFromAbsoluteAddress(addr,absAddr);
}
}
int CCC65Interface::nesGetSourceLineFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
int CCC65Interface::nesGetSourceLineFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
{
const cc65_spaninfo* dbgSpans;
const cc65_lineinfo* dbgLines;
@@ -1294,7 +1191,7 @@ int CCC65Interface::nesGetSourceLineFromPhysicalAddress(uint32_t addr,uint32_t a
return source_line;
}
int CCC65Interface::c64GetSourceLineFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
int CCC65Interface::c64GetSourceLineFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
{
const cc65_spaninfo* dbgSpans;
const cc65_lineinfo* dbgLines;
@@ -1606,20 +1503,20 @@ unsigned int CCC65Interface::getAddressFromFileAndLine(QString file,int source_l
return addr;
}
unsigned int CCC65Interface::getPhysicalAddressFromFileAndLine(QString file,int source_line,int entry)
unsigned int CCC65Interface::getAbsoluteAddressFromFileAndLine(QString file,int source_line,int entry)
{
// Dispatch to appropriate target machine handler.
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
{
return nesGetPhysicalAddressFromFileAndLine(file,source_line,entry);
return nesGetAbsoluteAddressFromFileAndLine(file,source_line,entry);
}
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
{
return c64GetPhysicalAddressFromFileAndLine(file,source_line,entry);
return c64GetAbsoluteAddressFromFileAndLine(file,source_line,entry);
}
}
unsigned int CCC65Interface::nesGetPhysicalAddressFromFileAndLine(QString file,int source_line,int entry)
unsigned int CCC65Interface::nesGetAbsoluteAddressFromFileAndLine(QString file,int source_line,int entry)
{
const cc65_sourceinfo* dbgSources;
const cc65_lineinfo* dbgLines;
@@ -1712,7 +1609,7 @@ unsigned int CCC65Interface::nesGetPhysicalAddressFromFileAndLine(QString file,i
return absAddr;
}
unsigned int CCC65Interface::c64GetPhysicalAddressFromFileAndLine(QString file,int source_line,int entry)
unsigned int CCC65Interface::c64GetAbsoluteAddressFromFileAndLine(QString file,int source_line,int entry)
{
const cc65_sourceinfo* dbgSources;
const cc65_lineinfo* dbgLines;
@@ -1798,20 +1695,20 @@ unsigned int CCC65Interface::c64GetPhysicalAddressFromFileAndLine(QString file,i
return absAddr;
}
unsigned int CCC65Interface::getEndAddressFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
unsigned int CCC65Interface::getEndAddressFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
{
// Dispatch to appropriate target machine handler.
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
{
return nesGetEndAddressFromPhysicalAddress(addr,absAddr);
return nesGetEndAddressFromAbsoluteAddress(addr,absAddr);
}
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
{
return c64GetEndAddressFromPhysicalAddress(addr,absAddr);
return c64GetEndAddressFromAbsoluteAddress(addr,absAddr);
}
}
unsigned int CCC65Interface::nesGetEndAddressFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
unsigned int CCC65Interface::nesGetEndAddressFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
{
const cc65_lineinfo* dbgLines;
const cc65_spaninfo* dbgSpans;
@@ -1895,7 +1792,7 @@ unsigned int CCC65Interface::nesGetEndAddressFromPhysicalAddress(uint32_t addr,u
return endAddr;
}
unsigned int CCC65Interface::c64GetEndAddressFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
unsigned int CCC65Interface::c64GetEndAddressFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
{
const cc65_lineinfo* dbgLines;
const cc65_spaninfo* dbgSpans;
@@ -1961,21 +1858,21 @@ unsigned int CCC65Interface::c64GetEndAddressFromPhysicalAddress(uint32_t addr,u
return endAddr;
}
bool CCC65Interface::isPhysicalAddressAnOpcode(uint32_t absAddr)
bool CCC65Interface::isAbsoluteAddressAnOpcode(uint32_t absAddr)
{
// Dispatch to appropriate target machine handler.
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
{
return nesIsPhysicalAddressAnOpcode(absAddr);
return nesIsAbsoluteAddressAnOpcode(absAddr);
}
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
{
return c64IsPhysicalAddressAnOpcode(absAddr);
return c64IsAbsoluteAddressAnOpcode(absAddr);
}
return false;
}
bool CCC65Interface::nesIsPhysicalAddressAnOpcode(uint32_t absAddr)
bool CCC65Interface::nesIsAbsoluteAddressAnOpcode(uint32_t absAddr)
{
const cc65_spaninfo* dbgSpans;
const cc65_segmentinfo* dbgSegments;
@@ -2029,7 +1926,7 @@ bool CCC65Interface::nesIsPhysicalAddressAnOpcode(uint32_t absAddr)
return opcode;
}
bool CCC65Interface::c64IsPhysicalAddressAnOpcode(uint32_t absAddr)
bool CCC65Interface::c64IsAbsoluteAddressAnOpcode(uint32_t absAddr)
{
const cc65_spaninfo* dbgSpans;
const cc65_segmentinfo* dbgSegments;
+53 -74
View File
@@ -2,7 +2,6 @@
#define CCC65INTERFACE_H
#include <QProcess>
#include <QMutex>
#include "stdint.h"
@@ -12,91 +11,71 @@ class CCC65Interface : public QObject
{
Q_OBJECT
public:
static CCC65Interface *_instance;
static CCC65Interface *instance()
{
if ( !_instance )
{
_instance = new CCC65Interface();
}
return _instance;
}
// Class maintenance.
CCC65Interface();
virtual ~CCC65Interface();
void clear();
static void clear();
// Makefile and target image APIs.
bool createMakefile();
void clean();
bool assemble();
bool captureDebugInfo();
bool isBuildUpToDate();
bool captureINESImage();
QStringList getCLanguageSourcesFromProject();
QStringList getAssemblerSourcesFromProject();
QStringList getCustomSourcesFromProject();
void updateTargetMachine(QString target);
static bool createMakefile();
static void clean();
static bool assemble();
static bool captureDebugInfo();
static bool isBuildUpToDate();
static bool captureINESImage();
static QStringList getCLanguageSourcesFromProject();
static QStringList getAssemblerSourcesFromProject();
static QStringList getCustomSourcesFromProject();
static void updateTargetMachine(QString target);
// Debug information parsing/extending APIs.
QStringList getSourceFiles();
uint32_t getSegmentBase(QString segment);
unsigned int getSourceFileModificationTime(QString sourceFile);
QStringList getSymbolsForSourceFile(QString sourceFile);
int getSymbolMatchCount(QString symbol);
cc65_symbol_type getSymbolType(QString symbol,int index = 0);
unsigned int getSymbolAddress(QString symbol,int index = 0);
unsigned int getSymbolSegment(QString symbol,int index = 0);
QString getSymbolSegmentName(QString symbol, int index = 0);
unsigned int getSymbolIndexFromSegment(QString symbol,int segment);
unsigned int getSymbolSize(QString symbol,int index = 0);
int getSourceLineFromFileAndSymbol(QString file,QString symbol);
QString getSourceFileFromSymbol(QString symbol);
int getLineMatchCount(QString file,int source_line);
unsigned int getAddressFromFileAndLine(QString file,int source_line,int entry = -1);
QStringList getErrors() { return errors; }
bool isErrorOnLineOfFile(QString file,int source_line);
bool isStringASymbol(QString string);
static QStringList getSourceFiles();
static uint32_t getSegmentBase(QString segment);
static unsigned int getSourceFileModificationTime(QString sourceFile);
static QStringList getSymbolsForSourceFile(QString sourceFile);
static int getSymbolMatchCount(QString symbol);
static cc65_symbol_type getSymbolType(QString symbol,int index = 0);
static unsigned int getSymbolAddress(QString symbol,int index = 0);
static unsigned int getSymbolSegment(QString symbol,int index = 0);
static QString getSymbolSegmentName(QString symbol, int index = 0);
static unsigned int getSymbolIndexFromSegment(QString symbol,int segment);
static unsigned int getSymbolSize(QString symbol,int index = 0);
static int getSourceLineFromFileAndSymbol(QString file,QString symbol);
static QString getSourceFileFromSymbol(QString symbol);
static int getLineMatchCount(QString file,int source_line);
static unsigned int getAddressFromFileAndLine(QString file,int source_line,int entry = -1);
static QStringList getErrors() { return errors; }
static bool isErrorOnLineOfFile(QString file,int source_line);
static bool isStringASymbol(QString string);
// Target-independent launchpads.
QString getSourceFileFromPhysicalAddress(uint32_t addr,uint32_t absAddr);
int getSourceLineFromPhysicalAddress(uint32_t addr,uint32_t absAddr);
unsigned int getPhysicalAddressFromFileAndLine(QString file,int source_line,int entry = -1);
unsigned int getEndAddressFromPhysicalAddress(uint32_t addr,uint32_t absAddr);
bool isPhysicalAddressAnOpcode(uint32_t absAddr);
unsigned int getSymbolPhysicalAddress(QString symbol,int index = 0);
// Target-dependent launchpads.
static QString getSourceFileFromAbsoluteAddress(uint32_t addr,uint32_t absAddr);
static int getSourceLineFromAbsoluteAddress(uint32_t addr,uint32_t absAddr);
static unsigned int getAbsoluteAddressFromFileAndLine(QString file,int source_line,int entry = -1);
static unsigned int getEndAddressFromAbsoluteAddress(uint32_t addr,uint32_t absAddr);
static bool isAbsoluteAddressAnOpcode(uint32_t absAddr);
static unsigned int getSymbolAbsoluteAddress(QString symbol,int index = 0);
// NES target-dependent APIs.
QString nesGetSourceFileFromPhysicalAddress(uint32_t addr,uint32_t absAddr);
int nesGetSourceLineFromPhysicalAddress(uint32_t addr,uint32_t absAddr);
unsigned int nesGetPhysicalAddressFromFileAndLine(QString file,int source_line,int entry = -1);
unsigned int nesGetEndAddressFromPhysicalAddress(uint32_t addr,uint32_t absAddr);
bool nesIsPhysicalAddressAnOpcode(uint32_t absAddr);
unsigned int nesGetSymbolPhysicalAddress(QString symbol,int index = 0);
static QString nesGetSourceFileFromAbsoluteAddress(uint32_t addr,uint32_t absAddr);
static int nesGetSourceLineFromAbsoluteAddress(uint32_t addr,uint32_t absAddr);
static unsigned int nesGetAbsoluteAddressFromFileAndLine(QString file,int source_line,int entry = -1);
static unsigned int nesGetEndAddressFromAbsoluteAddress(uint32_t addr,uint32_t absAddr);
static bool nesIsAbsoluteAddressAnOpcode(uint32_t absAddr);
static unsigned int nesGetSymbolAbsoluteAddress(QString symbol,int index = 0);
// C64 target-dependent APIs.
QString c64GetSourceFileFromPhysicalAddress(uint32_t addr,uint32_t absAddr);
int c64GetSourceLineFromPhysicalAddress(uint32_t addr,uint32_t absAddr);
unsigned int c64GetPhysicalAddressFromFileAndLine(QString file,int source_line,int entry = -1);
unsigned int c64GetEndAddressFromPhysicalAddress(uint32_t addr,uint32_t absAddr);
bool c64IsPhysicalAddressAnOpcode(uint32_t absAddr);
unsigned int c64GetSymbolPhysicalAddress(QString symbol,int index = 0);
public slots:
void process_errorOccurred(QProcess::ProcessError error);
void process_finished(int exitCode, QProcess::ExitStatus exitStatus);
void process_readyReadStandardError();
void process_readyReadStandardOutput();
void process_started();
void process_stateChanged(QProcess::ProcessState newState);
static QString c64GetSourceFileFromAbsoluteAddress(uint32_t addr,uint32_t absAddr);
static int c64GetSourceLineFromAbsoluteAddress(uint32_t addr,uint32_t absAddr);
static unsigned int c64GetAbsoluteAddressFromFileAndLine(QString file,int source_line,int entry = -1);
static unsigned int c64GetEndAddressFromAbsoluteAddress(uint32_t addr,uint32_t absAddr);
static bool c64IsAbsoluteAddressAnOpcode(uint32_t absAddr);
static unsigned int c64GetSymbolAbsoluteAddress(QString symbol,int index = 0);
protected:
cc65_dbginfo dbgInfo;
QStringList errors;
QString targetMachine;
QMutex protect;
QProcess process;
private:
CCC65Interface();
static cc65_dbginfo dbgInfo;
static QStringList errors;
static QString targetMachine;
};
#endif // CCC65INTERFACE_H
+13 -28
View File
@@ -5,16 +5,25 @@
#include "main.h"
CompilerWorker::CompilerWorker(QObject*)
CompilerThread::CompilerThread(QObject*)
{
m_assembledOk = false;
pThread = new QThread();
moveToThread(pThread);
pThread->start();
}
CompilerWorker::~CompilerWorker()
CompilerThread::~CompilerThread()
{
pThread->exit(0);
pThread->wait();
delete pThread;
}
void CompilerWorker::compile()
void CompilerThread::compile()
{
CCartridgeBuilder cartridgeBuilder;
CMachineImageBuilder machineImageBuilder;
@@ -31,7 +40,7 @@ void CompilerWorker::compile()
emit compileDone(m_assembledOk);
}
void CompilerWorker::clean()
void CompilerThread::clean()
{
CCartridgeBuilder cartridgeBuilder;
CMachineImageBuilder machineImageBuilder;
@@ -47,27 +56,3 @@ void CompilerWorker::clean()
}
emit cleanDone(true);
}
CompilerThread::CompilerThread(QObject*)
{
pWorker = new CompilerWorker();
QObject::connect(pWorker,SIGNAL(cleanDone(bool)),this,SIGNAL(cleanDone(bool)));
QObject::connect(pWorker,SIGNAL(cleanStarted()),this,SIGNAL(cleanStarted()));
QObject::connect(pWorker,SIGNAL(compileDone(bool)),this,SIGNAL(compileDone(bool)));
QObject::connect(pWorker,SIGNAL(compileStarted()),this,SIGNAL(compileStarted()));
pThread = new QThread();
pWorker->moveToThread(pThread);
pThread->start();
}
CompilerThread::~CompilerThread()
{
pThread->exit(0);
pThread->wait();
delete pThread;
delete pWorker;
}
+5 -27
View File
@@ -10,16 +10,17 @@ enum
DoClean
};
class CompilerWorker : public QObject
class CompilerThread : public QObject
{
Q_OBJECT
public:
CompilerWorker ( QObject* parent = 0 );
virtual ~CompilerWorker ();
CompilerThread ( QObject* parent = 0 );
virtual ~CompilerThread ();
bool assembledOk() { return m_assembledOk; }
void reset() { m_assembledOk = false; }
public slots:
void compile();
void clean();
@@ -32,31 +33,8 @@ signals:
protected:
bool m_assembledOk;
int m_operation;
};
class CompilerThread : public QObject
{
Q_OBJECT
public:
CompilerThread ( QObject* parent = 0 );
virtual ~CompilerThread ();
bool assembledOk() { return pWorker->assembledOk(); }
void reset() { pWorker->reset(); }
public slots:
void compile() { pWorker->compile(); }
void clean() { pWorker->clean(); }
signals:
void compileStarted();
void compileDone(bool bOk);
void cleanStarted();
void cleanDone(bool bOk);
protected:
CompilerWorker *pWorker;
QThread *pThread;
QThread* pThread;
};
#endif // COMPILERTHREAD_H
+2 -2
View File
@@ -12,7 +12,7 @@ CSourceAssembler::CSourceAssembler()
void CSourceAssembler::clean()
{
CCC65Interface::instance()->clean();
return CCC65Interface::clean();
}
bool CSourceAssembler::assemble()
@@ -40,7 +40,7 @@ bool CSourceAssembler::assemble()
if ( ok )
{
ok = CCC65Interface::instance()->assemble();
ok = CCC65Interface::assemble();
}
return ok;
+14 -14
View File
@@ -447,7 +447,7 @@ void BreakpointDialog::DisplayResolutions(BreakpointInfo* pBreakpoint)
QString text;
QStringList textSplit;
QFileInfo fileInfo;
CompilerThread* compiler = dynamic_cast<CompilerThread*>(CObjectRegistry::instance()->getObject("Compiler"));
CompilerThread* compiler = dynamic_cast<CompilerThread*>(CObjectRegistry::getObject("Compiler"));
// Get address from UI
originalAddr = ui->addr1->text().toInt(0,16);
@@ -468,14 +468,14 @@ void BreakpointDialog::DisplayResolutions(BreakpointInfo* pBreakpoint)
{
if ( compiler->assembledOk() )
{
source = CCC65Interface::instance()->getSourceFileFromPhysicalAddress(originalAddr,maskedAddr);
source = CCC65Interface::getSourceFileFromAbsoluteAddress(originalAddr,maskedAddr);
if ( !source.isEmpty() )
{
fileInfo.setFile(source);
source = fileInfo.fileName();
text = "put something";//pasm_get_source_file_text_by_addr(maskedAddr);
linenum = CCC65Interface::instance()->getSourceLineFromPhysicalAddress(originalAddr,maskedAddr);
linenum = CCC65Interface::getSourceLineFromAbsoluteAddress(originalAddr,maskedAddr);
// textSplit = text.split(QRegExp("[\r\n]"));
// text = textSplit.at(linenum-1);
item.sprintf("%s:%d:",
@@ -488,13 +488,13 @@ void BreakpointDialog::DisplayResolutions(BreakpointInfo* pBreakpoint)
}
else
{
nesGetDisassemblyAtPhysicalAddress(maskedAddr,disassembly);
nesGetPrintablePhysicalAddress(address,originalAddr,maskedAddr);
nesGetDisassemblyAtAbsoluteAddress(maskedAddr,disassembly);
nesGetPrintableAddressWithAbsolute(address,originalAddr,maskedAddr);
item.sprintf("%s:%s",address,disassembly);
ui->resolutions->addItem(item);
ui->resolutions->setItemData(ui->resolutions->count()-1,maskedAddr);
}
if ( pBreakpoint && pBreakpoint->item1Physical == maskedAddr )
if ( pBreakpoint && pBreakpoint->item1Absolute == maskedAddr )
{
ui->resolutions->setCurrentIndex(ui->resolutions->count()-1);
}
@@ -529,7 +529,7 @@ void BreakpointDialog::DisplayBreakpoint ( int idx )
// Only do this for NES platform until it is known whether it is needed
// for other platforms.
if ( (!nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive)) &&
(pBreakpoint->item1Physical >= 0) )
(pBreakpoint->item1Absolute >= 0) )
{
ui->resolve->setChecked(true);
}
@@ -629,7 +629,7 @@ void BreakpointDialog::on_cancel_clicked()
void BreakpointDialog::on_addBreakpoint_clicked()
{
int item1 = 0;
int item1Physical = 0;
int item1Absolute = 0;
int item2 = 0;
int mask = 0;
int data = 0;
@@ -689,7 +689,7 @@ void BreakpointDialog::on_addBreakpoint_clicked()
if ( ui->resolve->isChecked() )
{
item1Physical = ui->resolutions->itemData(ui->resolutions->currentIndex()).toInt();
item1Absolute = ui->resolutions->itemData(ui->resolutions->currentIndex()).toInt();
}
else
{
@@ -704,23 +704,23 @@ void BreakpointDialog::on_addBreakpoint_clicked()
{
// If there's more than 16KB of PRG-ROM then the
// physical address is simply the offset into the PRG-ROM.
item1Physical = (item1-MEM_32KB)%nesGetPRGROMSize();
item1Absolute = (item1-MEM_32KB)%nesGetPRGROMSize();
}
else if ( item1 >= 0x6000 )
{
// CPTODO: For now assume identity mapped SRAM.
item1Physical = (item1-0x6000);
item1Absolute = (item1-0x6000);
}
else
{
// Virtual is physical if address is less than $8000.
item1Physical = item1;
item1Absolute = item1;
}
}
else
{
// Virtual is physical for now. Might need to revisit.
item1Physical = item1;
item1Absolute = item1;
}
}
@@ -729,7 +729,7 @@ void BreakpointDialog::on_addBreakpoint_clicked()
(eBreakpointItemType)ui->itemWidget->currentIndex(),
event,
item1,
item1Physical,
item1Absolute,
item2,
mask,
maskExclusive,
+184 -624
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>541</width>
<height>320</height>
<width>330</width>
<height>222</height>
</rect>
</property>
<property name="sizePolicy">
@@ -18,35 +18,20 @@
</property>
<property name="minimumSize">
<size>
<width>416</width>
<height>292</height>
<width>330</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" colspan="2">
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="labelAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="formAlignment">
<set>Qt::AlignJustify|Qt::AlignTop</set>
</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="Fixed" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -61,12 +46,6 @@
</item>
<item row="0" 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="maxVisibleItems">
<number>20</number>
</property>
@@ -74,225 +53,86 @@
</item>
</layout>
</item>
<item>
<item row="1" column="0" colspan="2">
<widget class="QStackedWidget" name="itemWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="addrpage">
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<property name="margin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="2" column="0">
<layout class="QFormLayout" name="formLayout_8">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
<item row="0" column="0">
<widget class="QLabel" name="addr1label">
<property name="text">
<string>Address 1:</string>
</property>
<property name="labelAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="formAlignment">
<set>Qt::AlignJustify|Qt::AlignTop</set>
</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_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Mask:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="mask">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<layout class="QFormLayout" name="formLayout_7">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
<item row="0" column="3">
<widget class="QLabel" name="addr2label">
<property name="text">
<string>Address 2:</string>
</property>
<property name="labelAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="formAlignment">
<set>Qt::AlignJustify|Qt::AlignTop</set>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="addr2label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Address 2:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="addr2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maxLength">
<number>4</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="itemMaskScope">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="4">
<widget class="QLineEdit" name="addr2">
<property name="maxLength">
<number>4</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="addr1">
<property name="maxLength">
<number>4</number>
</property>
<item>
<property name="text">
<string>Exclusive (unmasked bits 0)</string>
</property>
</item>
<item>
<property name="text">
<string>Inclusive (unmasked bits X)</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<layout class="QFormLayout" name="formLayout_6">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Mask:</string>
</property>
<property name="labelAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="formAlignment">
<set>Qt::AlignJustify|Qt::AlignTop</set>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="addr1label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Address 1:</string>
</property>
</widget>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="mask"/>
</item>
<item row="1" column="3" colspan="2">
<widget class="QComboBox" name="itemMaskScope">
<item>
<property name="text">
<string>Exclusive (unmasked bits must be zero)</string>
</property>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="addr1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maxLength">
<number>4</number>
</property>
</widget>
<item>
<property name="text">
<string>Inclusive (unmasked bits are ignored)</string>
</property>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="regpage">
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<property name="labelAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="registerlabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Register:</string>
</property>
@@ -300,73 +140,30 @@
</item>
<item row="0" column="1">
<widget class="QComboBox" name="reg">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maxVisibleItems">
<number>25</number>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="bitfieldlabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Bitfield:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="bitfield">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
</property>
</widget>
<widget class="QComboBox" name="bitfield"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="eventpage">
<layout class="QGridLayout" name="gridLayout_4">
<property name="leftMargin">
<property name="margin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Event:</string>
</property>
@@ -374,12 +171,6 @@
</item>
<item row="0" column="1" colspan="3">
<widget class="QComboBox" name="event">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maxVisibleItems">
<number>100</number>
</property>
@@ -387,339 +178,33 @@
</item>
<item row="1" column="0">
<widget class="QLabel" name="item1label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Data1:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="eventData1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<widget class="QLineEdit" name="eventData1"/>
</item>
<item row="1" column="2">
<widget class="QLabel" name="item2label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Data2:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="eventData2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<widget class="QLineEdit" name="eventData2"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="emptypage">
<layout class="QGridLayout" name="gridLayout_10">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
</layout>
</widget>
<widget class="QWidget" name="emptypage"/>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_8">
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QStackedWidget" name="conditionWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="emptyCondition">
<layout class="QGridLayout" name="gridLayout_9">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
</layout>
</widget>
<widget class="QWidget" name="addrCondition">
<layout class="QFormLayout" name="formLayout_3">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="conditionlabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Break if:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="condition">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToMinimumContentsLength</enum>
</property>
<item>
<property name="text">
<string>Anything</string>
</property>
</item>
<item>
<property name="text">
<string>Equals</string>
</property>
</item>
<item>
<property name="text">
<string>Does Not Equal</string>
</property>
</item>
<item>
<property name="text">
<string>Is Greater Than</string>
</property>
</item>
<item>
<property name="text">
<string>Is Less Than</string>
</property>
</item>
<item>
<property name="text">
<string>Exclusive Mask (unmasked bits 0)</string>
</property>
</item>
<item>
<property name="text">
<string>Inclusive Mask (unmasked bits X)</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="0" column="1">
<widget class="QStackedWidget" name="dataWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="emptyData">
<layout class="QGridLayout" name="gridLayout_7">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
</layout>
</widget>
<widget class="QWidget" name="editData">
<layout class="QFormLayout" name="formLayout_5">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="data1label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Condition:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="data1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="comboData">
<layout class="QFormLayout" name="formLayout_4">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="data2label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Condition:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="data2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QStackedWidget" name="resolverWidget">
<item row="2" column="0">
<widget class="QStackedWidget" name="conditionWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -727,69 +212,121 @@
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="emptyMap">
<layout class="QGridLayout" name="gridLayout_11">
<property name="spacing">
<number>6</number>
</property>
</layout>
</widget>
<widget class="QWidget" name="useMap">
<layout class="QFormLayout" name="formLayout_9">
<widget class="QWidget" name="emptyCondition"/>
<widget class="QWidget" name="addrCondition">
<layout class="QFormLayout" name="formLayout_3">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>6</number>
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QCheckBox" name="resolve">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QLabel" name="conditionlabel">
<property name="text">
<string>Resolve using Mapper</string>
<string>Break if:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="resolutions">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QComboBox" name="condition">
<item>
<property name="text">
<string>Anything</string>
</property>
</item>
<item>
<property name="text">
<string>Equals</string>
</property>
</item>
<item>
<property name="text">
<string>Does Not Equal</string>
</property>
</item>
<item>
<property name="text">
<string>Is Greater Than</string>
</property>
</item>
<item>
<property name="text">
<string>Is Less Than</string>
</property>
</item>
<item>
<property name="text">
<string>Exclusive Mask (unmasked bits must be zero)</string>
</property>
</item>
<item>
<property name="text">
<string>Inclusive Mask (unmasked bits are ignored)</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="2" column="1">
<widget class="QStackedWidget" name="dataWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<property name="currentIndex">
<number>2</number>
</property>
</spacer>
<widget class="QWidget" name="emptyData">
<layout class="QGridLayout" name="gridLayout_7">
<property name="margin">
<number>0</number>
</property>
</layout>
</widget>
<widget class="QWidget" name="editData">
<layout class="QFormLayout" name="formLayout_5">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="data1label">
<property name="text">
<string>Condition:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="data1"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="comboData">
<layout class="QFormLayout" name="formLayout_4">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="data2label">
<property name="text">
<string>Condition:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="data2"/>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0">
<property name="spacing">
<number>6</number>
</property>
<item row="5" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="cancel">
<property name="text">
@@ -802,9 +339,6 @@
</item>
<item>
<widget class="QCheckBox" name="enabled">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Enabled</string>
</property>
@@ -822,10 +356,35 @@
</item>
</layout>
</item>
<item row="4" column="0" colspan="2">
<widget class="QStackedWidget" name="resolverWidget">
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="emptyMap"/>
<widget class="QWidget" name="useMap">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<widget class="QComboBox" name="resolutions"/>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="resolve">
<property name="text">
<string>Resolve using Mapper</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>type</tabstop>
<tabstop>addr1</tabstop>
<tabstop>addr2</tabstop>
<tabstop>mask</tabstop>
<tabstop>bitfield</tabstop>
<tabstop>event</tabstop>
<tabstop>eventData1</tabstop>
@@ -836,6 +395,7 @@
<tabstop>cancel</tabstop>
<tabstop>enabled</tabstop>
<tabstop>addBreakpoint</tabstop>
<tabstop>resolutions</tabstop>
<tabstop>resolve</tabstop>
<tabstop>reg</tabstop>
</tabstops>
+17 -29
View File
@@ -45,8 +45,8 @@ BreakpointDockWidget::~BreakpointDockWidget()
void BreakpointDockWidget::updateTargetMachine(QString /*target*/)
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),this,SLOT(updateData()) );
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),model,SLOT(update()));
@@ -102,23 +102,23 @@ void BreakpointDockWidget::changeEvent(QEvent* e)
void BreakpointDockWidget::showEvent(QShowEvent*)
{
QDockWidget* codeBrowser = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Assembly Browser"));
QDockWidget* symbolInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Symbol Inspector"));
QDockWidget* codeBrowser = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Assembly Browser"));
QDockWidget* symbolInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Symbol Inspector"));
QDockWidget* memoryInspector;
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::connect(codeBrowser,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
QObject::connect(symbolInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("CPU RAM Inspector"));
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("CPU RAM Inspector"));
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
{
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Cartridge EXRAM Memory Inspector"));
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Cartridge EXRAM Memory Inspector"));
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Cartridge SRAM Memory Inspector"));
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Cartridge SRAM Memory Inspector"));
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("PRG-ROM Inspector"));
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("PRG-ROM Inspector"));
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
}
@@ -127,15 +127,15 @@ void BreakpointDockWidget::showEvent(QShowEvent*)
QObject::connect(codeBrowser,SIGNAL(breakpointsChanged()),emulator, SLOT(breakpointsChanged()) );
QObject::connect(symbolInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("CPU RAM Inspector"));
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("CPU RAM Inspector"));
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),emulator, SLOT(breakpointsChanged()) );
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
{
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Cartridge EXRAM Memory Inspector"));
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Cartridge EXRAM Memory Inspector"));
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),emulator, SLOT(breakpointsChanged()) );
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Cartridge SRAM Memory Inspector"));
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Cartridge SRAM Memory Inspector"));
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),emulator, SLOT(breakpointsChanged()) );
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("PRG-ROM Inspector"));
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("PRG-ROM Inspector"));
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),emulator, SLOT(breakpointsChanged()) );
}
}
@@ -170,7 +170,6 @@ void BreakpointDockWidget::contextMenuEvent(QContextMenuEvent *e)
if ( m_pBreakpoints->GetNumBreakpoints() > 0 )
{
menu.addAction(ui->actionRemove_Breakpoint);
menu.addAction(ui->actionRemove_All_Breakpoints);
menu.addAction(ui->actionEnable_All_Breakpoints);
menu.addAction(ui->actionDisable_All_Breakpoints);
}
@@ -225,7 +224,7 @@ void BreakpointDockWidget::dropEvent(QDropEvent *event)
if ( event->isAccepted() )
{
addr = CCC65Interface::instance()->getSymbolAddress(text);
addr = CCC65Interface::getSymbolAddress(text);
if ( addr != 0xFFFFFFFF )
{
bpIdx = m_pBreakpoints->AddBreakpoint ( eBreakOnCPUMemoryAccess,
@@ -293,7 +292,7 @@ void BreakpointDockWidget::on_tableView_pressed(QModelIndex index)
if ( (index.row() < m_pBreakpoints->GetNumBreakpoints()) &&
(m_pBreakpoints->GetBreakpoint(index.row())->type == eBreakOnCPUExecution) )
{
nesGetPrintablePhysicalAddress(buffer,m_pBreakpoints->GetBreakpoint(index.row())->item1,m_pBreakpoints->GetBreakpoint(index.row())->item1Physical);
nesGetPrintableAddressWithAbsolute(buffer,m_pBreakpoints->GetBreakpoint(index.row())->item1,m_pBreakpoints->GetBreakpoint(index.row())->item1Absolute);
emit snapTo(QString("Address,")+QString(buffer));
}
@@ -367,17 +366,6 @@ void BreakpointDockWidget::on_actionRemove_Breakpoint_triggered()
}
}
void BreakpointDockWidget::on_actionRemove_All_Breakpoints_triggered()
{
int idx = m_pBreakpoints->GetNumBreakpoints()-1;
for ( ; idx >= 0; idx-- )
{
m_pBreakpoints->RemoveBreakpoint(idx);
}
emit breakpointsChanged();
emit markProjectDirty(true);
}
void BreakpointDockWidget::on_actionEdit_Breakpoint_triggered()
{
int result;
@@ -454,7 +442,7 @@ bool BreakpointDockWidget::serialize(QDomDocument& doc, QDomNode& node)
breakpointElement.setAttribute("itemtype",pBreakpoint->itemType);
breakpointElement.setAttribute("event",pBreakpoint->event);
breakpointElement.setAttribute("item1",pBreakpoint->item1);
breakpointElement.setAttribute("item1absolute",pBreakpoint->item1Physical);
breakpointElement.setAttribute("item1absolute",pBreakpoint->item1Absolute);
breakpointElement.setAttribute("item2",pBreakpoint->item2);
breakpointElement.setAttribute("itemMask",pBreakpoint->itemMask);
breakpointElement.setAttribute("itemMaskExclusive",pBreakpoint->itemMaskExclusive);
@@ -500,7 +488,7 @@ bool BreakpointDockWidget::deserialize(QDomDocument& /*doc*/, QDomNode& node, QS
breakpoint.itemType = (eBreakpointItemType)element.attribute("itemtype").toInt();
breakpoint.event = element.attribute("event").toInt();
breakpoint.item1 = element.attribute("item1").toInt();
breakpoint.item1Physical = element.attribute("item1absolute").toInt();
breakpoint.item1Absolute = element.attribute("item1absolute").toInt();
breakpoint.item2 = element.attribute("item2").toInt();
breakpoint.itemMask = element.attribute("itemMask").toInt();
breakpoint.itemMaskExclusive = element.attribute("itemMaskExclusive").toInt();
@@ -56,7 +56,6 @@ private slots:
void on_actionEnable_Breakpoint_triggered();
void on_actionEdit_Breakpoint_triggered();
void on_actionRemove_Breakpoint_triggered();
void on_actionRemove_All_Breakpoints_triggered();
void on_actionAdd_Breakpoint_triggered();
};
+5 -19
View File
@@ -30,17 +30,11 @@
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<property name="margin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QTableView" name="tableView">
@@ -92,10 +86,10 @@
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<attribute name="verticalHeaderDefaultSectionSize">
<number>23</number>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<attribute name="verticalHeaderMinimumSectionSize">
<number>23</number>
</attribute>
</widget>
@@ -140,14 +134,6 @@
<string>Disable All Breakpoints</string>
</property>
</action>
<action name="actionRemove_All_Breakpoints">
<property name="text">
<string>Remove All Breakpoints</string>
</property>
<property name="toolTip">
<string>Remove All Breakpoints</string>
</property>
</action>
</widget>
<resources/>
<connections/>
+11 -25
View File
@@ -5,15 +5,23 @@
#include "main.h"
BreakpointWatcherWorker::BreakpointWatcherWorker(QObject*)
BreakpointWatcherThread::BreakpointWatcherThread(QObject*)
{
pThread = new QThread();
moveToThread(pThread);
pThread->start();
}
BreakpointWatcherWorker::~BreakpointWatcherWorker()
BreakpointWatcherThread::~BreakpointWatcherThread()
{
pThread->exit(0);
pThread->wait();
delete pThread;
}
void BreakpointWatcherWorker::breakpoint()
void BreakpointWatcherThread::breakpoint()
{
CBreakpointInfo* pBreakpoints = NULL;
int idx;
@@ -48,25 +56,3 @@ void BreakpointWatcherWorker::breakpoint()
// A breakpoint has occurred...
emit breakpointHit();
}
BreakpointWatcherThread::BreakpointWatcherThread(QObject*)
{
pWorker = new BreakpointWatcherWorker();
QObject::connect(pWorker,SIGNAL(breakpointHit()),this,SIGNAL(breakpointHit()));
QObject::connect(pWorker,SIGNAL(showPane(int)),this,SIGNAL(showPane(int)));
pThread = new QThread();
pWorker->moveToThread(pThread);
pThread->start();
}
BreakpointWatcherThread::~BreakpointWatcherThread()
{
pThread->exit(0);
pThread->wait();
delete pThread;
delete pWorker;
}
+2 -17
View File
@@ -4,20 +4,6 @@
#include <QThread>
#include <QSemaphore>
class BreakpointWatcherWorker : public QObject
{
Q_OBJECT
public:
BreakpointWatcherWorker ( QObject* parent = 0 );
virtual ~BreakpointWatcherWorker ();
void breakpoint();
signals:
void breakpointHit();
void showPane(int pane);
};
class BreakpointWatcherThread : public QObject
{
Q_OBJECT
@@ -30,11 +16,10 @@ signals:
void showPane(int pane);
public slots:
void breakpoint() { pWorker->breakpoint(); }
void breakpoint();
protected:
BreakpointWatcherWorker *pWorker;
QThread *pThread;
QThread* pThread;
};
#endif // BREAKPOINTWATCHERTHREAD_H
+11 -11
View File
@@ -36,7 +36,7 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
{
// FIXME: 64-bit support
int32_t addr = (long)index.internalPointer();
int32_t physAddr;
int32_t absAddr;
//uint32_t addr = (uint32_t)index.internalPointer();
unsigned char opSize;
CMarker* markers = nesGetExecutionMarkerDatabase();
@@ -49,7 +49,7 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
{
physAddr = nesGetPhysicalAddressFromAddress(addr);
absAddr = nesGetAbsoluteAddressFromAddress(addr);
opcode = nesGetMemory(addr);
operand1 = nesGetMemory(addr+1);
operand2 = nesGetMemory(addr+2);
@@ -57,7 +57,7 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
}
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
{
physAddr = c64GetPhysicalAddressFromAddress(addr);
absAddr = c64GetAbsoluteAddressFromAddress(addr);
opcode = c64GetMemory(addr);
operand1 = c64GetMemory(addr+1);
operand2 = c64GetMemory(addr+2);
@@ -112,8 +112,8 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
if ( (pMarker->state == eMarkerSet_Started) ||
(pMarker->state == eMarkerSet_Complete) )
{
if ( (physAddr >= pMarker->startAbsAddr) &&
(physAddr <= pMarker->endAbsAddr) )
if ( (absAddr >= pMarker->startAbsAddr) &&
(absAddr <= pMarker->endAbsAddr) )
{
return QColor(pMarker->red,pMarker->green,pMarker->blue);
}
@@ -132,7 +132,7 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
if ( (pBreakpoint->enabled) &&
(pBreakpoint->type == eBreakOnCPUExecution) &&
(pBreakpoint->item1 <= addr) &&
((physAddr == -1) || (physAddr == pBreakpoint->item1Physical)) &&
((absAddr == -1) || (absAddr == pBreakpoint->item1Absolute)) &&
(pBreakpoint->item2 >= addr) )
{
if ( addr == pc )
@@ -147,7 +147,7 @@ QVariant CCodeBrowserDisplayModel::data(const QModelIndex& index, int role) cons
else if ( (!pBreakpoint->enabled) &&
(pBreakpoint->type == eBreakOnCPUExecution) &&
(pBreakpoint->item1 <= addr) &&
((physAddr == -1) || (physAddr == pBreakpoint->item1Physical)) &&
((absAddr == -1) || (absAddr == pBreakpoint->item1Absolute)) &&
(pBreakpoint->item2 >= addr) )
{
if ( addr == pc )
@@ -310,20 +310,20 @@ QVariant CCodeBrowserDisplayModel::headerData(int section, Qt::Orientation orien
QModelIndex CCodeBrowserDisplayModel::index(int row, int column, const QModelIndex&) const
{
int physAddr;
int addr;
if ( (row >= 0) && (column >= 0) )
{
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
{
physAddr = nesGetVirtualAddressFromSLOC(row);
addr = nesGetAddressFromSLOC(row);
}
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
{
physAddr = c64GetAddressFromSLOC(row);
addr = c64GetAddressFromSLOC(row);
}
return createIndex(row, column, physAddr);
return createIndex(row, column, addr);
}
return QModelIndex();
@@ -39,8 +39,8 @@ QModelIndex CDebuggerCodeProfilerModel::index(int row, int column, const QModelI
unsigned int addr;
unsigned int absAddr;
addr = CCC65Interface::instance()->getSymbolAddress(m_items.at(row).symbol);
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(m_items.at(row).symbol);
addr = CCC65Interface::getSymbolAddress(m_items.at(row).symbol);
absAddr = CCC65Interface::getSymbolAbsoluteAddress(m_items.at(row).symbol);
if ( addr >= MEM_32KB )
{
@@ -128,7 +128,7 @@ int CDebuggerCodeProfilerModel::columnCount(const QModelIndex&) const
void CDebuggerCodeProfilerModel::update()
{
QStringList symbols = CCC65Interface::instance()->getSymbolsForSourceFile(""); // CPTODO: File doesn't matter (yet).
QStringList symbols = CCC65Interface::getSymbolsForSourceFile(""); // CPTODO: File doesn't matter (yet).
CCodeDataLogger* pLogger;
unsigned int addr;
unsigned int absAddr;
@@ -141,8 +141,8 @@ void CDebuggerCodeProfilerModel::update()
// CPTODO: Temporary hack to get around temporary labels.
if ( !symbol.startsWith('@') )
{
addr = CCC65Interface::instance()->getSymbolAddress(symbol);
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(symbol);
addr = CCC65Interface::getSymbolAddress(symbol);
absAddr = CCC65Interface::getSymbolAbsoluteAddress(symbol);
if ( absAddr != -1 )
{
@@ -170,11 +170,11 @@ void CDebuggerCodeProfilerModel::update()
(pLogger->GetType(addr&mask) == eLogger_InstructionFetch) )
{
item.symbol = symbol;
item.size = CCC65Interface::instance()->getSymbolSize(symbol);
item.file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
item.size = CCC65Interface::getSymbolSize(symbol);
item.file = CCC65Interface::getSourceFileFromSymbol(symbol);
fileInfo.setFile(item.file);
nesGetPrintablePhysicalAddress(modelStringBuffer,addr,absAddr);
nesGetPrintableAddressWithAbsolute(modelStringBuffer,addr,absAddr);
item.address = modelStringBuffer;
item.count = pLogger->GetCount(addr&mask);
if ( !m_items.contains(item) )
@@ -7,8 +7,7 @@ static char modelStringBuffer [ 2048 ];
CDebuggerMemoryDisplayModel::CDebuggerMemoryDisplayModel(memDBFunc memDB,QObject*)
{
m_memDBFunc = memDB;
m_memDB = memDB();
m_memDB = memDB;
}
CDebuggerMemoryDisplayModel::~CDebuggerMemoryDisplayModel()
@@ -17,52 +16,60 @@ CDebuggerMemoryDisplayModel::~CDebuggerMemoryDisplayModel()
int CDebuggerMemoryDisplayModel::memoryType() const
{
if ( m_memDB )
CMemoryDatabase* memDB = m_memDB();
if ( memDB )
{
return m_memDB->GetType();
return memDB->GetType();
}
return 0;
}
int CDebuggerMemoryDisplayModel::memoryBottom() const
{
if ( m_memDB )
CMemoryDatabase* memDB = m_memDB();
if ( memDB )
{
return m_memDB->GetBase();
return memDB->GetBase();
}
return 0;
}
int CDebuggerMemoryDisplayModel::memoryTop() const
{
if ( m_memDB )
CMemoryDatabase* memDB = m_memDB();
if ( memDB )
{
return m_memDB->GetBase()+m_memDB->GetSize()-1;
return memDB->GetBase()+memDB->GetSize()-1;
}
return 0;
}
QVariant CDebuggerMemoryDisplayModel::data(const QModelIndex& index, int role) const
{
CMemoryDatabase* memDB = m_memDB();
if (!index.isValid())
{
return QVariant();
}
if ( m_memDB )
if ( memDB )
{
if (role == Qt::BackgroundRole)
{
return QBrush(QColor(m_memDB->GetCellRedComponent(m_memDB->Get((index.row()*m_memDB->GetNumColumns())+index.column())),
m_memDB->GetCellGreenComponent(m_memDB->Get((index.row()*m_memDB->GetNumColumns())+index.column())),
m_memDB->GetCellBlueComponent(m_memDB->Get((index.row()*m_memDB->GetNumColumns())+index.column()))));
return QBrush(QColor(memDB->GetCellRedComponent(memDB->Get((index.row()*memDB->GetNumColumns())+index.column())),
memDB->GetCellGreenComponent(memDB->Get((index.row()*memDB->GetNumColumns())+index.column())),
memDB->GetCellBlueComponent(memDB->Get((index.row()*memDB->GetNumColumns())+index.column()))));
}
if (role == Qt::ForegroundRole)
{
QColor col = QColor(m_memDB->GetCellRedComponent(m_memDB->Get((index.row()*m_memDB->GetNumColumns())+index.column())),
m_memDB->GetCellGreenComponent(m_memDB->Get((index.row()*m_memDB->GetNumColumns())+index.column())),
m_memDB->GetCellBlueComponent(m_memDB->Get((index.row()*m_memDB->GetNumColumns())+index.column())));
QColor col = QColor(memDB->GetCellRedComponent(memDB->Get((index.row()*memDB->GetNumColumns())+index.column())),
memDB->GetCellGreenComponent(memDB->Get((index.row()*memDB->GetNumColumns())+index.column())),
memDB->GetCellBlueComponent(memDB->Get((index.row()*memDB->GetNumColumns())+index.column())));
if ((((double)col.red() +
(double)col.green() +
@@ -82,9 +89,9 @@ QVariant CDebuggerMemoryDisplayModel::data(const QModelIndex& index, int role) c
return QVariant();
}
if ( m_memDB )
if ( memDB )
{
sprintf(modelStringBuffer,"%02X",m_memDB->Get((index.row()*m_memDB->GetNumColumns())+index.column()));
sprintf(modelStringBuffer,"%02X",memDB->Get((index.row()*memDB->GetNumColumns())+index.column()));
}
return QVariant(modelStringBuffer);
@@ -94,13 +101,13 @@ Qt::ItemFlags CDebuggerMemoryDisplayModel::flags(const QModelIndex& /*index*/) c
{
Qt::ItemFlags flags = Qt::ItemIsEnabled;
if ( m_memDB )
if ( m_memDB() )
{
if ( m_memDB->GetCellsEditable() )
if ( m_memDB()->GetCellsEditable() )
{
flags |= Qt::ItemIsEditable;
}
if ( m_memDB->GetCellsSelectable() )
if ( m_memDB()->GetCellsSelectable() )
{
flags |= Qt::ItemIsSelectable;
}
@@ -122,9 +129,9 @@ QVariant CDebuggerMemoryDisplayModel::headerData(int section, Qt::Orientation or
}
else
{
if ( m_memDB )
if ( m_memDB() )
{
m_memDB->GetRowHeading(modelStringBuffer,m_memDB->GetBase()+(section*m_memDB->GetNumColumns()));
m_memDB()->GetRowHeading(modelStringBuffer,m_memDB()->GetBase()+(section*m_memDB()->GetNumColumns()));
}
}
@@ -136,13 +143,13 @@ bool CDebuggerMemoryDisplayModel::setData ( const QModelIndex& index, const QVar
unsigned int data;
bool ok = false;
if ( m_memDB )
if ( m_memDB() )
{
data = value.toString().toInt(&ok,16);
if ( ok )
{
m_memDB->Set((index.row()*m_memDB->GetNumColumns())+index.column(),data);
m_memDB()->Set((index.row()*m_memDB()->GetNumColumns())+index.column(),data);
emit dataChanged(index,index);
}
}
@@ -152,11 +159,11 @@ bool CDebuggerMemoryDisplayModel::setData ( const QModelIndex& index, const QVar
QModelIndex CDebuggerMemoryDisplayModel::index(int row, int column, const QModelIndex&) const
{
if ( m_memDB )
if ( m_memDB() )
{
if ( (row >= 0) && (column >= 0) )
{
return createIndex(row,column,m_memDB);
return createIndex(row,column,m_memDB());
}
}
@@ -165,9 +172,9 @@ QModelIndex CDebuggerMemoryDisplayModel::index(int row, int column, const QModel
int CDebuggerMemoryDisplayModel::rowCount(const QModelIndex&) const
{
if ( m_memDB )
if ( m_memDB() )
{
return m_memDB->GetNumRows();
return m_memDB()->GetNumRows();
}
return 0;
@@ -175,9 +182,9 @@ int CDebuggerMemoryDisplayModel::rowCount(const QModelIndex&) const
int CDebuggerMemoryDisplayModel::columnCount(const QModelIndex& /*parent*/) const
{
if ( m_memDB )
if ( m_memDB() )
{
return m_memDB->GetNumColumns();
return m_memDB()->GetNumColumns();
}
return 0;
@@ -185,6 +192,5 @@ int CDebuggerMemoryDisplayModel::columnCount(const QModelIndex& /*parent*/) cons
void CDebuggerMemoryDisplayModel::update()
{
m_memDB = m_memDBFunc();
emit dataChanged(QModelIndex(),QModelIndex());
}
@@ -29,8 +29,7 @@ public slots:
void update(void);
private:
memDBFunc m_memDBFunc;
CMemoryDatabase* m_memDB;
memDBFunc m_memDB;
};
#endif // CDEBUGGERMEMORYDISPLAYMODEL_H
@@ -4,8 +4,7 @@ static char modelStringBuffer [ 2048 ];
CDebuggerRegisterDisplayModel::CDebuggerRegisterDisplayModel(regDBFunc regDB,QObject*)
{
m_regDBFunc = regDB;
m_regDB = regDB();
m_regDB = regDB;
}
CDebuggerRegisterDisplayModel::~CDebuggerRegisterDisplayModel()
@@ -14,27 +13,33 @@ CDebuggerRegisterDisplayModel::~CDebuggerRegisterDisplayModel()
int CDebuggerRegisterDisplayModel::memoryType() const
{
if ( m_regDB )
CRegisterDatabase* regDB = m_regDB();
if ( regDB )
{
return m_regDB->GetType();
return regDB->GetType();
}
return 0;
}
bool CDebuggerRegisterDisplayModel::memoryContains(uint32_t addr) const
{
if ( m_regDB )
CRegisterDatabase* regDB = m_regDB();
if ( regDB )
{
return m_regDB->Contains(addr);
return regDB->Contains(addr);
}
return false;
}
int CDebuggerRegisterDisplayModel::memoryBottom() const
{
if ( m_regDB )
CRegisterDatabase* regDB = m_regDB();
if ( regDB )
{
return m_regDB->GetRegister(0)->GetAddr();
return regDB->GetRegister(0)->GetAddr();
}
return 0;
}
@@ -74,22 +79,22 @@ QVariant CDebuggerRegisterDisplayModel::headerData(int section, Qt::Orientation
return QVariant();
}
if (m_regDB )
if ( m_regDB() )
{
if ( orientation == Qt::Horizontal )
{
if ( (section >= 0) &&
(section <m_regDB->GetNumColumns()) )
(section < m_regDB()->GetNumColumns()) )
{
sprintf(modelStringBuffer,m_regDB->GetColumnHeading(section));
sprintf(modelStringBuffer,m_regDB()->GetColumnHeading(section));
}
}
else
{
if ( (section >= 0) &&
(section < m_regDB->GetNumRows()) )
(section < m_regDB()->GetNumRows()) )
{
sprintf(modelStringBuffer,m_regDB->GetRowHeading(section));
sprintf(modelStringBuffer,m_regDB()->GetRowHeading(section));
}
}
}
@@ -102,13 +107,13 @@ bool CDebuggerRegisterDisplayModel::setData ( const QModelIndex& index, const QV
unsigned int data;
bool ok = false;
if ( m_regDB )
if ( m_regDB() )
{
data = value.toString().toInt(&ok,16);
if ( ok )
{
m_regDB->GetRegister((index.row()*m_regDB->GetNumColumns())+index.column())->Set(data);
m_regDB()->GetRegister((index.row()*m_regDB()->GetNumColumns())+index.column())->Set(data);
emit dataChanged(index,index);
}
}
@@ -118,12 +123,12 @@ bool CDebuggerRegisterDisplayModel::setData ( const QModelIndex& index, const QV
QModelIndex CDebuggerRegisterDisplayModel::index(int row, int column, const QModelIndex&) const
{
if ( m_regDB )
if ( m_regDB() )
{
if ( (row >= 0) && (column >= 0) &&
(row < m_regDB->GetNumRows()) && (column < m_regDB->GetNumColumns()) )
(row < m_regDB()->GetNumRows()) && (column < m_regDB()->GetNumColumns()) )
{
return createIndex(row,column,m_regDB->GetRegister((row*m_regDB->GetNumColumns())+column));
return createIndex(row,column,m_regDB()->GetRegister((row*m_regDB()->GetNumColumns())+column));
}
}
@@ -132,9 +137,9 @@ QModelIndex CDebuggerRegisterDisplayModel::index(int row, int column, const QMod
int CDebuggerRegisterDisplayModel::rowCount(const QModelIndex& /*parent*/) const
{
if ( m_regDB )
if ( m_regDB() )
{
return m_regDB->GetNumRows();
return m_regDB()->GetNumRows();
}
return 0;
@@ -142,9 +147,9 @@ int CDebuggerRegisterDisplayModel::rowCount(const QModelIndex& /*parent*/) const
int CDebuggerRegisterDisplayModel::columnCount(const QModelIndex& /*parent*/) const
{
if ( m_regDB )
if ( m_regDB() )
{
return m_regDB->GetNumColumns();
return m_regDB()->GetNumColumns();
}
return 0;
@@ -152,6 +157,5 @@ int CDebuggerRegisterDisplayModel::columnCount(const QModelIndex& /*parent*/) co
void CDebuggerRegisterDisplayModel::update()
{
m_regDB = m_regDBFunc();
emit layoutChanged();
}
@@ -29,8 +29,7 @@ public slots:
void update(void);
private:
regDBFunc m_regDBFunc;
CRegisterDatabase* m_regDB;
regDBFunc m_regDB;
};
#endif // CDEBUGGERREGISTERDISPLAYMODEL_H
@@ -23,7 +23,7 @@ void CDebuggerSymbolDelegate::setEditorData(QWidget* editor,
const QModelIndex& index) const
{
QLineEdit* edit = static_cast<QLineEdit*>(editor);
QStringList symbols = CCC65Interface::instance()->getSymbolsForSourceFile("<CPTODO:fixme>");
QStringList symbols = CCC65Interface::getSymbolsForSourceFile("<CPTODO:fixme>");
QCompleter* completer = new QCompleter(symbols);
completer->setCompletionMode(QCompleter::PopupCompletion);
completer->setCompletionPrefix(index.data(Qt::DisplayRole).toString());
@@ -118,7 +118,7 @@ QVariant CExecutionMarkerDisplayModel::data(const QModelIndex& index, int role)
case ExecutionVisualizerCol_StartAddr:
if ( pMarker->state >= eMarkerSet_Started )
{
nesGetPrintablePhysicalAddress(modelStringBuffer,
nesGetPrintableAddressWithAbsolute(modelStringBuffer,
pMarker->startAddr,
pMarker->startAbsAddr);
return QVariant(modelStringBuffer);
@@ -131,7 +131,7 @@ QVariant CExecutionMarkerDisplayModel::data(const QModelIndex& index, int role)
case ExecutionVisualizerCol_EndAddr:
if ( pMarker->state >= eMarkerSet_Complete )
{
nesGetPrintablePhysicalAddress(modelStringBuffer,
nesGetPrintableAddressWithAbsolute(modelStringBuffer,
pMarker->endAddr,
pMarker->endAbsAddr);
return QVariant(modelStringBuffer);
+35 -89
View File
@@ -29,16 +29,6 @@ CodeBrowserDockWidget::CodeBrowserDockWidget(CBreakpointInfo* pBreakpoints,QWidg
assemblyViewModel = new CCodeBrowserDisplayModel(pBreakpoints,this);
ui->tableView->setModel(assemblyViewModel);
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
setFont(QFont("Monaco", 11));
#endif
#ifdef Q_OS_LINUX
setFont(QFont("Monospace", 10));
#endif
#ifdef Q_OS_WIN
setFont(QFont("Consolas", 11));
#endif
QObject::connect ( this, SIGNAL(breakpointsChanged()), assemblyViewModel, SLOT(update()) );
}
@@ -50,8 +40,8 @@ CodeBrowserDockWidget::~CodeBrowserDockWidget()
void CodeBrowserDockWidget::updateTargetMachine(QString target)
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), assemblyViewModel, SLOT(update()) );
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(breakpointHit()) );
@@ -70,15 +60,15 @@ void CodeBrowserDockWidget::updateTargetMachine(QString target)
void CodeBrowserDockWidget::showEvent(QShowEvent* /*e*/)
{
QDockWidget* breakpointInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Breakpoints"));
QDockWidget* executionVisualizer = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Execution Visualizer"));
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QDockWidget* breakpointInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Breakpoints"));
QDockWidget* executionVisualizer = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Execution Visualizer"));
QObject* emulator = CObjectRegistry::getObject("Emulator");
// Specifically not connecting to updateDebuggers signal here since it doesn't make much sense to
// update the code position until a pause/breakpoint.
if ( emulator )
{
// QObject::connect ( emulator, SIGNAL(updateDebuggers()), this, SLOT(updateDebuggers()) );
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(emulatorPaused(bool)) );
}
QObject::connect ( breakpointInspector, SIGNAL(breakpointsChanged()), assemblyViewModel, SLOT(update()) );
QObject::connect ( breakpointInspector, SIGNAL(snapTo(QString)), this, SLOT(snapTo(QString)) );
@@ -101,11 +91,11 @@ void CodeBrowserDockWidget::showEvent(QShowEvent* /*e*/)
void CodeBrowserDockWidget::hideEvent(QHideEvent* /*e*/)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
// QObject::disconnect ( emulator, SIGNAL(updateDebuggers()), this, SLOT(updateDebuggers()) );
QObject::disconnect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(emulatorPaused(bool)) );
}
}
@@ -114,18 +104,18 @@ void CodeBrowserDockWidget::contextMenuEvent(QContextMenuEvent* e)
QMenu menu;
int bp;
int addr = 0;
int physAddr = 0;
int absAddr = 0;
QModelIndex index = ui->tableView->currentIndex();
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
{
addr = nesGetVirtualAddressFromSLOC(index.row());
physAddr = nesGetPhysicalAddressFromAddress(addr);
addr = nesGetAddressFromSLOC(index.row());
absAddr = nesGetAbsoluteAddressFromAddress(addr);
}
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
{
addr = c64GetAddressFromSLOC(index.row());
physAddr = c64GetPhysicalAddressFromAddress(addr);
absAddr = c64GetAbsoluteAddressFromAddress(addr);
}
if ( addr != -1 )
@@ -137,7 +127,7 @@ void CodeBrowserDockWidget::contextMenuEvent(QContextMenuEvent* e)
eBreakpointItemAddress,
0,
addr,
physAddr,
absAddr,
addr,
0xFFFF,
true,
@@ -176,8 +166,6 @@ void CodeBrowserDockWidget::contextMenuEvent(QContextMenuEvent* e)
menu.addAction(ui->actionStart_marker_here);
menu.addAction(ui->actionEnd_marker_here);
menu.addAction(ui->actionStart_End_marker_here);
// Run the context menu...
// CPTODO: Hokey trick to provide the breakpoint-of-interest to action handlers...
m_breakpointIndex = bp;
@@ -234,7 +222,7 @@ void CodeBrowserDockWidget::snapTo(QString item)
{
ui->tableView->setCurrentIndex(assemblyViewModel->index(c64GetSLOCFromAddress(addr),0));
}
ui->tableView->scrollTo(ui->tableView->currentIndex(),QAbstractItemView::PositionAtTop);
ui->tableView->scrollTo(ui->tableView->currentIndex());
ui->tableView->resizeColumnsToContents();
}
}
@@ -298,17 +286,17 @@ void CodeBrowserDockWidget::on_actionBreak_on_CPU_execution_here_triggered()
QModelIndex index = ui->tableView->currentIndex();
int bpIdx;
int addr = 0;
int physAddr = 0;
int absAddr = 0;
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
{
addr = nesGetVirtualAddressFromSLOC(index.row());
physAddr = nesGetPhysicalAddressFromAddress(addr);
addr = nesGetAddressFromSLOC(index.row());
absAddr = nesGetAbsoluteAddressFromAddress(addr);
}
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
{
addr = c64GetAddressFromSLOC(index.row());
physAddr = c64GetPhysicalAddressFromAddress(addr);
absAddr = c64GetAbsoluteAddressFromAddress(addr);
}
if ( addr != -1 )
@@ -317,10 +305,10 @@ void CodeBrowserDockWidget::on_actionBreak_on_CPU_execution_here_triggered()
eBreakpointItemAddress,
0,
addr,
physAddr,
absAddr,
addr,
0xFFFF,
true,
false,
eBreakpointConditionNone,
0,
eBreakpointDataNone,
@@ -345,12 +333,12 @@ void CodeBrowserDockWidget::on_actionRun_to_here_triggered()
{
QModelIndex index = ui->tableView->currentIndex();
int addr = 0;
int physAddr = 0;
int absAddr = 0;
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
{
addr = nesGetVirtualAddressFromSLOC(index.row());
physAddr = nesGetPhysicalAddressFromAddress(addr);
addr = nesGetAddressFromSLOC(index.row());
absAddr = nesGetAbsoluteAddressFromAddress(addr);
if ( addr != -1 )
{
nesSetGotoAddress(addr);
@@ -359,7 +347,7 @@ void CodeBrowserDockWidget::on_actionRun_to_here_triggered()
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
{
addr = c64GetAddressFromSLOC(index.row());
physAddr = c64GetPhysicalAddressFromAddress(addr);
absAddr = c64GetAbsoluteAddressFromAddress(addr);
if ( addr != -1 )
{
c64SetGotoAddress(addr);
@@ -400,48 +388,6 @@ void CodeBrowserDockWidget::on_actionEnable_breakpoint_triggered()
}
}
void CodeBrowserDockWidget::on_actionStart_End_marker_here_triggered()
{
CMarker* markers = nesGetExecutionMarkerDatabase();
QModelIndexList indexes = ui->tableView->selectionModel()->selectedRows();
int marker = -1;
int line, lineFrom, lineTo, indexFrom, indexTo;
int addr = 0;
int absAddr = 0;
lineFrom = indexes[0].row();
lineTo = indexes[indexes.count()-1].row();
if ( lineFrom != -1 )
{
// nesGetAddrFromSLOC(lineFrom);
// if ( addr != -1 )
// {
// // Find unused Marker entry...
// marker = markers->AddMarker(addr,absAddr);
// emit breakpointsChanged();
// emit markProjectDirty(true);
// }
}
if ( lineTo != -1 )
{
// if ( marker >= 0 )
// {
// resolveLineAddress(lineTo,&addr,&absAddr);
// if ( addr != -1 )
// {
// markers->CompleteMarker(marker,addr,absAddr);
// emit breakpointsChanged();
// emit markProjectDirty(true);
// }
// }
}
}
void CodeBrowserDockWidget::on_actionStart_marker_here_triggered()
{
CMarker* markers = nesGetExecutionMarkerDatabase();
@@ -453,7 +399,7 @@ void CodeBrowserDockWidget::on_actionStart_marker_here_triggered()
{
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
{
addr = nesGetVirtualAddressFromSLOC(index.row());
addr = nesGetAddressFromSLOC(index.row());
}
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
{
@@ -465,11 +411,11 @@ void CodeBrowserDockWidget::on_actionStart_marker_here_triggered()
// Find unused Marker entry...
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
{
marker = markers->AddMarker(addr,nesGetPhysicalAddressFromAddress(addr));
marker = markers->AddMarker(addr,nesGetAbsoluteAddressFromAddress(addr));
}
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
{
marker = markers->AddMarker(addr,c64GetPhysicalAddressFromAddress(addr));
marker = markers->AddMarker(addr,c64GetAbsoluteAddressFromAddress(addr));
}
emit breakpointsChanged();
@@ -489,7 +435,7 @@ void CodeBrowserDockWidget::on_actionEnd_marker_here_triggered()
{
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
{
addr = nesGetVirtualAddressFromSLOC(index.row());
addr = nesGetAddressFromSLOC(index.row());
}
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
{
@@ -500,11 +446,11 @@ void CodeBrowserDockWidget::on_actionEnd_marker_here_triggered()
{
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
{
markers->CompleteMarker(marker,addr,nesGetPhysicalAddressFromAddress(addr));
markers->CompleteMarker(marker,addr,nesGetAbsoluteAddressFromAddress(addr));
}
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
{
markers->CompleteMarker(marker,addr,c64GetPhysicalAddressFromAddress(addr));
markers->CompleteMarker(marker,addr,c64GetAbsoluteAddressFromAddress(addr));
}
emit breakpointsChanged();
@@ -526,7 +472,7 @@ void CodeBrowserDockWidget::on_tableView_pressed(QModelIndex index)
{
int bp;
int addr = 0;
int physAddr = 0;
int absAddr = 0;
if ( QApplication::mouseButtons() == Qt::LeftButton )
{
@@ -534,13 +480,13 @@ void CodeBrowserDockWidget::on_tableView_pressed(QModelIndex index)
{
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
{
addr = nesGetVirtualAddressFromSLOC(index.row());
physAddr = nesGetPhysicalAddressFromAddress(addr);
addr = nesGetAddressFromSLOC(index.row());
absAddr = nesGetAbsoluteAddressFromAddress(addr);
}
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
{
addr = c64GetAddressFromSLOC(index.row());
physAddr = c64GetPhysicalAddressFromAddress(addr);
absAddr = c64GetAbsoluteAddressFromAddress(addr);
}
if ( addr != -1 )
@@ -549,7 +495,7 @@ void CodeBrowserDockWidget::on_tableView_pressed(QModelIndex index)
eBreakpointItemAddress,
0,
addr,
physAddr,
absAddr,
addr,
0xFFFF,
true,
@@ -55,7 +55,6 @@ private slots:
void on_actionRun_to_here_triggered();
void on_actionBreak_on_CPU_execution_here_triggered();
void on_actionStart_marker_here_triggered();
void on_actionStart_End_marker_here_triggered();
void on_actionEnd_marker_here_triggered();
void on_actionClear_marker_triggered();
};
+7 -24
View File
@@ -24,16 +24,7 @@
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
@@ -60,7 +51,7 @@
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ContiguousSelection</enum>
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
@@ -92,12 +83,12 @@
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>26</number>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>50</number>
</attribute>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>26</number>
</attribute>
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
@@ -107,10 +98,10 @@
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<attribute name="verticalHeaderDefaultSectionSize">
<number>23</number>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<attribute name="verticalHeaderMinimumSectionSize">
<number>23</number>
</attribute>
</widget>
@@ -189,14 +180,6 @@
<string>Go to Source</string>
</property>
</action>
<action name="actionStart_End_marker_here">
<property name="text">
<string>Set Visualization Marker on selected region</string>
</property>
<property name="toolTip">
<string>Set Visualization Marker on selected region</string>
</property>
</action>
</widget>
<resources/>
<connections/>
+5 -14
View File
@@ -20,17 +20,8 @@ CodeProfilerDockWidget::CodeProfilerDockWidget(QWidget *parent) :
ui->tableView->sortByColumn(CodeProfilerCol_Calls,Qt::DescendingOrder);
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
ui->tableView->setFont(QFont("Monaco", 11));
#endif
#ifdef Q_OS_LINUX
ui->tableView->setFont(QFont("Monospace", 10));
#endif
#ifdef Q_OS_WIN
ui->tableView->setFont(QFont("Consolas", 11));
#endif
QObject::connect(ui->tableView->horizontalHeader(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),model,SLOT(sort(int,Qt::SortOrder)));
QObject::connect(model,SIGNAL(layoutChanged()),this,SLOT(updateUi()));
}
@@ -41,8 +32,8 @@ CodeProfilerDockWidget::~CodeProfilerDockWidget()
void CodeProfilerDockWidget::updateTargetMachine(QString /*target*/)
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),model,SLOT(update()));
if ( emulator )
@@ -55,7 +46,7 @@ void CodeProfilerDockWidget::updateTargetMachine(QString /*target*/)
void CodeProfilerDockWidget::showEvent(QShowEvent */*event*/)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
@@ -66,7 +57,7 @@ void CodeProfilerDockWidget::showEvent(QShowEvent */*event*/)
void CodeProfilerDockWidget::hideEvent(QHideEvent */*event*/)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
+4 -6
View File
@@ -69,7 +69,7 @@
<bool>false</bool>
</property>
<attribute name="horizontalHeaderVisible">
<bool>false</bool>
<bool>true</bool>
</attribute>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
@@ -86,19 +86,16 @@
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<attribute name="verticalHeaderDefaultSectionSize">
<number>23</number>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<attribute name="verticalHeaderMinimumSectionSize">
<number>23</number>
</attribute>
</widget>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<property name="horizontalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
@@ -137,6 +134,7 @@
</widget>
<resources>
<include location="../../../common/resource.qrc"/>
<include location="../../../common/resource.qrc"/>
</resources>
<connections/>
</ui>
+16 -16
View File
@@ -56,7 +56,7 @@ QVariant CSymbolWatchModel::data(const QModelIndex& index, int role) const
if ( index.row() < m_items.count() )
{
// Get symbol's index in debug information from its segment.
symbolIdx = CCC65Interface::instance()->getSymbolIndexFromSegment(m_items.at(index.row()).symbol,m_items.at(index.row()).segment);
symbolIdx = CCC65Interface::getSymbolIndexFromSegment(m_items.at(index.row()).symbol,m_items.at(index.row()).segment);
switch ( index.column() )
{
@@ -65,11 +65,11 @@ QVariant CSymbolWatchModel::data(const QModelIndex& index, int role) const
break;
case SymbolWatchCol_Address:
// Get symbol's information based on its name and index.
addr = CCC65Interface::instance()->getSymbolAddress(m_items.at(index.row()).symbol,symbolIdx);
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(m_items.at(index.row()).symbol,symbolIdx);
addr = CCC65Interface::getSymbolAddress(m_items.at(index.row()).symbol,symbolIdx);
absAddr = CCC65Interface::getSymbolAbsoluteAddress(m_items.at(index.row()).symbol,symbolIdx);
if ( addr != -1 )
{
nesGetPrintablePhysicalAddress(modelStringBuffer,addr,absAddr);
nesGetPrintableAddressWithAbsolute(modelStringBuffer,addr,absAddr);
return QVariant(modelStringBuffer);
}
else
@@ -78,7 +78,7 @@ QVariant CSymbolWatchModel::data(const QModelIndex& index, int role) const
}
break;
case SymbolWatchCol_Size:
size = CCC65Interface::instance()->getSymbolSize(m_items.at(index.row()).symbol,symbolIdx);
size = CCC65Interface::getSymbolSize(m_items.at(index.row()).symbol,symbolIdx);
if ( size )
{
return QVariant(size);
@@ -89,11 +89,11 @@ QVariant CSymbolWatchModel::data(const QModelIndex& index, int role) const
}
break;
case SymbolWatchCol_Value:
addr = CCC65Interface::instance()->getSymbolAddress(m_items.at(index.row()).symbol,symbolIdx);
addr = CCC65Interface::getSymbolAddress(m_items.at(index.row()).symbol,symbolIdx);
if ( addr != -1 )
{
char* bufferPtr = modelStringBuffer;
unsigned int symbolSize = CCC65Interface::instance()->getSymbolSize(m_items.at(index.row()).symbol,symbolIdx);
unsigned int symbolSize = CCC65Interface::getSymbolSize(m_items.at(index.row()).symbol,symbolIdx);
// If symbol size <= 10 print values as an array, seperated by commas
if ((symbolSize > 0) && (symbolSize <= 10))
@@ -130,10 +130,10 @@ QVariant CSymbolWatchModel::data(const QModelIndex& index, int role) const
}
break;
case SymbolWatchCol_Segment:
return CCC65Interface::instance()->getSymbolSegmentName(m_items.at(index.row()).symbol,symbolIdx);
return CCC65Interface::getSymbolSegmentName(m_items.at(index.row()).symbol,symbolIdx);
break;
case SymbolWatchCol_File:
return CCC65Interface::instance()->getSourceFileFromSymbol(m_items.at(index.row()).symbol);
return CCC65Interface::getSourceFileFromSymbol(m_items.at(index.row()).symbol);
break;
}
}
@@ -195,7 +195,7 @@ bool CSymbolWatchModel::setData(const QModelIndex &index, const QVariant &value,
case SymbolWatchCol_Value:
if ( index.row() < m_items.count() )
{
addr = CCC65Interface::instance()->getSymbolAddress(m_items.at(index.row()).symbol,CCC65Interface::instance()->getSymbolIndexFromSegment(value.toString(),m_items.at(index.row()).segment));
addr = CCC65Interface::getSymbolAddress(m_items.at(index.row()).symbol,CCC65Interface::getSymbolIndexFromSegment(value.toString(),m_items.at(index.row()).segment));
if ( addr != 0xFFFFFFFF )
{
nesSetCPUMemory(addr,value.toString().toInt(&ok,16));
@@ -315,23 +315,23 @@ int CSymbolWatchModel::resolveSymbol(QString text,int addr)
int selIdx = -1;
bool ok;
count = CCC65Interface::instance()->getSymbolMatchCount(text);
count = CCC65Interface::getSymbolMatchCount(text);
if ( count > 1 )
{
for ( idx = 0; idx < count; idx++ )
{
checkAddr = CCC65Interface::instance()->getSymbolAddress(text,idx);
checkAddr = CCC65Interface::getSymbolAddress(text,idx);
if ( checkAddr == addr )
{
selIdx = idx;
break;
}
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(text,idx);
symbolFile = CCC65Interface::instance()->getSourceFileFromSymbol(text);
absAddr = CCC65Interface::getSymbolAbsoluteAddress(text,idx);
symbolFile = CCC65Interface::getSourceFileFromSymbol(text);
symbol = text;
symbol += " @";
nesGetPrintablePhysicalAddress(modelStringBuffer,checkAddr,absAddr);
nesGetPrintableAddressWithAbsolute(modelStringBuffer,checkAddr,absAddr);
symbol += modelStringBuffer;
symbol += " in ";
symbol += symbolFile;
@@ -356,7 +356,7 @@ int CSymbolWatchModel::resolveSymbol(QString text,int addr)
}
}
}
return CCC65Interface::instance()->getSymbolSegment(text,selIdx);
return CCC65Interface::getSymbolSegment(text,selIdx);
}
void CSymbolWatchModel::sort(int column, Qt::SortOrder order)
+13 -60
View File
@@ -4,75 +4,28 @@
#include "main.h"
QThread *DebuggerUpdateThread::pThread = NULL;
int DebuggerUpdateThread::resourceCount = -1;
QMutex *DebuggerUpdateThread::pMutex = NULL;
bool DebuggerUpdateThread::silenced = true;
DebuggerUpdateWorker::DebuggerUpdateWorker(void (*func)(),QObject */*parent*/) :
_func(func)
DebuggerUpdateThread::DebuggerUpdateThread(void (*func)(),QObject */*parent*/) :
QObject(),_func(func)
{
}
pThread = new QThread();
DebuggerUpdateWorker::~DebuggerUpdateWorker()
{
}
moveToThread(pThread);
void DebuggerUpdateWorker::updateDebuggers()
{
if ( _func )
{
_func();
emit updateComplete();
}
}
DebuggerUpdateThread::DebuggerUpdateThread(void (*func)(),QObject */*parent*/)
{
if ( resourceCount == -1 )
{
pThread = new QThread();
pThread->start();
pMutex = new QMutex();
pMutex->lock();
resourceCount = 1;
pMutex->unlock();
}
else
{
pMutex->lock();
resourceCount++;
pMutex->unlock();
}
pWorker = new DebuggerUpdateWorker(func);
QObject::connect(pWorker,SIGNAL(updateComplete()),this,SIGNAL(updateComplete()));
pWorker->moveToThread(pThread);
pThread->start();
}
DebuggerUpdateThread::~DebuggerUpdateThread()
{
delete pWorker;
pWorker = NULL;
pMutex->lock();
resourceCount--;
if ( resourceCount == 0 )
{
resourceCount = -1;
pThread->exit(0);
pThread->wait();
delete pThread;
}
pMutex->unlock();
_func = NULL;
pThread->exit(0);
pThread->wait();
delete pThread;
}
void DebuggerUpdateThread::updateDebuggers()
{
if ( !silenced )
{
pWorker->updateDebuggers();
}
if ( _func )
_func();
emit updateComplete();
}
+6 -30
View File
@@ -2,24 +2,6 @@
#define DEBUGGERUPDATETHREAD_H
#include <QThread>
#include <QMutex>
class DebuggerUpdateWorker : public QObject
{
Q_OBJECT
public:
explicit DebuggerUpdateWorker(void (*func)(),QObject *parent = 0);
~DebuggerUpdateWorker();
void changeFunction(void (*func)()) { _func = func; }
void updateDebuggers();
signals:
void updateComplete();
private:
void (*_func)();
};
class DebuggerUpdateThread : public QObject
{
@@ -28,23 +10,17 @@ public:
explicit DebuggerUpdateThread(void (*func)(),QObject *parent = 0);
~DebuggerUpdateThread();
void changeFunction(void (*func)()) { pWorker->changeFunction(func); }
static void silence(bool silence) { silenced = silence; }
static bool isSilenced() { return silenced; }
public slots:
void updateDebuggers();
void changeFunction(void (*func)()) { _func = func; }
signals:
void updateComplete();
public slots:
void updateDebuggers();
private:
DebuggerUpdateWorker *pWorker;
static QThread *pThread;
static QMutex *pMutex;
static int resourceCount;
static bool silenced;
void (*_func)();
QThread* pThread;
};
#endif // DEBUGGERUPDATETHREAD_H
@@ -17,16 +17,6 @@ ExecutionInspectorDockWidget::ExecutionInspectorDockWidget(QWidget *parent) :
ui->showCPU->setChecked(true);
ui->showPPU->setChecked(true);
ui->tableView->setModel(model);
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
ui->tableView->setFont(QFont("Monaco", 11));
#endif
#ifdef Q_OS_LINUX
ui->tableView->setFont(QFont("Monospace", 10));
#endif
#ifdef Q_OS_WIN
ui->tableView->setFont(QFont("Consolas", 11));
#endif
}
ExecutionInspectorDockWidget::~ExecutionInspectorDockWidget()
@@ -37,8 +27,8 @@ ExecutionInspectorDockWidget::~ExecutionInspectorDockWidget()
void ExecutionInspectorDockWidget::updateTargetMachine(QString /*target*/)
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateTracer()) );
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), model, SLOT(update()) );
@@ -46,14 +36,13 @@ void ExecutionInspectorDockWidget::updateTargetMachine(QString /*target*/)
{
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()) );
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), model, SLOT(update()) );
}
}
void ExecutionInspectorDockWidget::showEvent(QShowEvent* /*e*/)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
@@ -65,7 +54,7 @@ void ExecutionInspectorDockWidget::showEvent(QShowEvent* /*e*/)
void ExecutionInspectorDockWidget::hideEvent(QHideEvent* /*e*/)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
@@ -110,6 +99,7 @@ void ExecutionInspectorDockWidget::updateTracer ()
{
// Update display...
show();
ui->tableView->resizeColumnsToContents();
ui->tableView->setCurrentIndex(model->index(0,0));
}
else if ( (pBreakpoint->type == eBreakOnPPUFetch) &&
@@ -117,24 +107,22 @@ void ExecutionInspectorDockWidget::updateTracer ()
{
// Update display...
show();
ui->tableView->resizeColumnsToContents();
ui->tableView->setCurrentIndex(model->index(0,0));
}
}
ui->tableView->resizeColumnsToContents();
}
void ExecutionInspectorDockWidget::on_showCPU_toggled(bool checked)
{
model->showCPU ( checked );
model->update();
ui->tableView->resizeColumnsToContents();
}
void ExecutionInspectorDockWidget::on_showPPU_toggled(bool checked)
{
model->showPPU ( checked );
model->update();
ui->tableView->resizeColumnsToContents();
}
void ExecutionInspectorDockWidget::on_actionBreak_on_CPU_execution_here_triggered()
@@ -22,18 +22,7 @@ MemoryInspectorDockWidget::MemoryInspectorDockWidget(memDBFunc memDB,CBreakpoint
ui->tableView->setModel(model);
ui->tableView->setItemDelegate(delegate);
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
ui->tableView->setFont(QFont("Monaco", 11));
#endif
#ifdef Q_OS_LINUX
ui->tableView->setFont(QFont("Monospace", 10));
#endif
#ifdef Q_OS_WIN
ui->tableView->setFont(QFont("Consolas", 11));
#endif
m_memDBFunc = memDB;
m_memDB = memDB();
m_memDB = memDB;
}
MemoryInspectorDockWidget::~MemoryInspectorDockWidget()
@@ -45,29 +34,25 @@ MemoryInspectorDockWidget::~MemoryInspectorDockWidget()
void MemoryInspectorDockWidget::updateTargetMachine(QString /*target*/)
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateMemory()) );
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), model, SLOT(update()) );
if ( emulator )
{
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()) );
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()) );
}
}
void MemoryInspectorDockWidget::showEvent(QShowEvent* /*e*/)
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
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()) );
QObject::connect ( emulator, SIGNAL(updateDebuggers()), model, SLOT(update()));
}
model->update();
@@ -76,15 +61,10 @@ void MemoryInspectorDockWidget::showEvent(QShowEvent* /*e*/)
void MemoryInspectorDockWidget::hideEvent(QHideEvent* /*e*/)
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
QObject::disconnect ( breakpointWatcher, SIGNAL(breakpointHit()), model, SLOT(update()) );
QObject::disconnect ( emulator, SIGNAL(machineReady()), model, SLOT(update()));
QObject::disconnect ( emulator, SIGNAL(emulatorReset()), model, SLOT(update()) );
QObject::disconnect ( emulator, SIGNAL(emulatorPaused(bool)), model, SLOT(update()) );
QObject::disconnect ( emulator, SIGNAL(updateDebuggers()), model, SLOT(update()));
}
}
@@ -124,8 +104,6 @@ void MemoryInspectorDockWidget::updateMemory ()
int low = 0, high = 0;
int itemActual;
m_memDB = m_memDBFunc();
// Check breakpoints for hits and highlight if necessary...
for ( idx = 0; idx < m_pBreakpoints->GetNumBreakpoints(); idx++ )
{
@@ -155,8 +133,7 @@ void MemoryInspectorDockWidget::updateMemory ()
((pBreakpoint->target == eBreakInPPU) &&
((memoryType == eMemory_PPU) ||
(memoryType == eMemory_PPUpalette) ||
(memoryType == eMemory_cartCHRMEM) ||
(memoryType == eMemory_cartVRAM))) )
(memoryType == eMemory_cartCHRMEM))) )
{
// Change memory address into row/column of display...
itemActual = pBreakpoint->itemActual - model->memoryBottom();
@@ -179,7 +156,7 @@ void MemoryInspectorDockWidget::on_actionBreak_on_CPU_access_here_triggered()
QModelIndex index = ui->tableView->currentIndex();
int row = index.row();
int col = index.column();
int addr = m_memDB->GetBase()+(row*m_memDB->GetNumColumns())+col;
int addr = m_memDB()->GetBase()+(row*m_memDB()->GetNumColumns())+col;
int bpIdx;
bpIdx = m_pBreakpoints->AddBreakpoint ( eBreakOnCPUMemoryAccess,
@@ -209,7 +186,7 @@ void MemoryInspectorDockWidget::on_actionBreak_on_CPU_read_here_triggered()
QModelIndex index = ui->tableView->currentIndex();
int row = index.row();
int col = index.column();
int addr = m_memDB->GetBase()+(row*m_memDB->GetNumColumns())+col;
int addr = m_memDB()->GetBase()+(row*m_memDB()->GetNumColumns())+col;
int bpIdx;
bpIdx = m_pBreakpoints->AddBreakpoint ( eBreakOnCPUMemoryRead,
@@ -239,7 +216,7 @@ void MemoryInspectorDockWidget::on_actionBreak_on_CPU_write_here_triggered()
QModelIndex index = ui->tableView->currentIndex();
int row = index.row();
int col = index.column();
int addr = m_memDB->GetBase()+(row*m_memDB->GetNumColumns())+col;
int addr = m_memDB()->GetBase()+(row*m_memDB()->GetNumColumns())+col;
int bpIdx;
bpIdx = m_pBreakpoints->AddBreakpoint ( eBreakOnCPUMemoryWrite,
@@ -40,8 +40,7 @@ private:
CDebuggerMemoryDisplayModel* model;
CDebuggerNumericItemDelegate* delegate;
CBreakpointInfo* m_pBreakpoints;
memDBFunc m_memDBFunc;
CMemoryDatabase* m_memDB;
memDBFunc m_memDB;
private slots:
void on_actionBreak_on_CPU_write_here_triggered();
@@ -22,26 +22,12 @@ RegisterInspectorDockWidget::RegisterInspectorDockWidget(regDBFunc regDB,CBreakp
ui->bitfieldView->setModel(bitfieldModel);
ui->bitfieldView->setItemDelegate(bitfieldDelegate);
m_regDBFunc = regDB;
m_regDB = regDB();
m_regDB = regDB;
m_register = 0;
m_pBreakpoints = pBreakpoints;
ui->label->setText ( "" );
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
ui->binaryView->setFont(QFont("Monaco", 11));
ui->bitfieldView->setFont(QFont("Monaco", 11));
#endif
#ifdef Q_OS_LINUX
ui->binaryView->setFont(QFont("Monospace", 10));
ui->bitfieldView->setFont(QFont("Monospace", 10));
#endif
#ifdef Q_OS_WIN
ui->binaryView->setFont(QFont("Monospace", 10));
ui->bitfieldView->setFont(QFont("Monospace", 10));
#endif
// Connect inter-model signals so the models can update each other.
QObject::connect ( bitfieldModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), binaryModel, SLOT(update()) );
QObject::connect ( binaryModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), bitfieldModel, SLOT(update()) );
@@ -59,33 +45,31 @@ RegisterInspectorDockWidget::~RegisterInspectorDockWidget()
void RegisterInspectorDockWidget::updateTargetMachine(QString /*target*/)
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateMemory()) );
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), binaryModel, SLOT(update()) );
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), bitfieldModel, SLOT(update()) );
if ( emulator )
{
QObject::connect ( emulator, SIGNAL(machineReady()), this, SLOT(updateMemory()));
QObject::connect ( emulator, SIGNAL(emulatorReset()), this, SLOT(updateMemory()) );
QObject::connect ( emulator, SIGNAL(machineReady()), this, SLOT(updateMemory()) );
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(updateMemory()) );
}
}
void RegisterInspectorDockWidget::showEvent(QShowEvent* /*e*/)
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
if ( emulator )
{
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), binaryModel, SLOT(update()) );
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), bitfieldModel, SLOT(update()) );
QObject::connect ( emulator, SIGNAL(machineReady()), binaryModel, SLOT(update()));
QObject::connect ( emulator, SIGNAL(emulatorReset()), binaryModel, SLOT(update()) );
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), binaryModel, SLOT(update()) );
QObject::connect ( emulator, SIGNAL(machineReady()), bitfieldModel, SLOT(update()));
QObject::connect ( emulator, SIGNAL(emulatorReset()), bitfieldModel, SLOT(update()) );
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), bitfieldModel, SLOT(update()) );
}
}
void RegisterInspectorDockWidget::showEvent(QShowEvent* /*e*/)
{
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
QObject::connect ( emulator, SIGNAL(updateDebuggers()), binaryModel, SLOT(update()));
QObject::connect ( emulator, SIGNAL(updateDebuggers()), bitfieldModel, SLOT(update()));
}
@@ -95,19 +79,10 @@ void RegisterInspectorDockWidget::showEvent(QShowEvent* /*e*/)
void RegisterInspectorDockWidget::hideEvent(QHideEvent* /*e*/)
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
QObject::disconnect ( breakpointWatcher, SIGNAL(breakpointHit()), binaryModel, SLOT(update()) );
QObject::disconnect ( breakpointWatcher, SIGNAL(breakpointHit()), bitfieldModel, SLOT(update()) );
QObject::disconnect ( emulator, SIGNAL(machineReady()), binaryModel, SLOT(update()));
QObject::disconnect ( emulator, SIGNAL(emulatorReset()), binaryModel, SLOT(update()) );
QObject::disconnect ( emulator, SIGNAL(emulatorPaused(bool)), binaryModel, SLOT(update()) );
QObject::disconnect ( emulator, SIGNAL(machineReady()), bitfieldModel, SLOT(update()));
QObject::disconnect ( emulator, SIGNAL(emulatorReset()), bitfieldModel, SLOT(update()) );
QObject::disconnect ( emulator, SIGNAL(emulatorPaused(bool)), bitfieldModel, SLOT(update()) );
QObject::disconnect ( emulator, SIGNAL(updateDebuggers()), binaryModel, SLOT(update()));
QObject::disconnect ( emulator, SIGNAL(updateDebuggers()), bitfieldModel, SLOT(update()));
}
@@ -140,17 +115,15 @@ void RegisterInspectorDockWidget::updateMemory ()
int itemActual;
char buffer [ 128 ];
m_regDB = m_regDBFunc();
ui->binaryView->resizeColumnsToContents();
if ( m_regDB )
if ( m_regDB() )
{
sprintf ( buffer, "%04X: %s", m_regDB->GetRegister(m_register)->GetAddr(), m_regDB->GetRegister(m_register)->GetName() );
sprintf ( buffer, "%04X: %s", m_regDB()->GetRegister(m_register)->GetAddr(), m_regDB()->GetRegister(m_register)->GetName() );
ui->label->setText ( buffer );
}
if ( m_regDBFunc == nesGetCartridgeRegisterDatabase )
if ( m_regDB == nesGetCartridgeRegisterDatabase )
{
sprintf ( buffer, "Mapper %d: %s Register Inspector", nesGetMapper(), mapperNameFromID(nesGetMapper()) );
setWindowTitle ( buffer );
@@ -220,9 +193,9 @@ void RegisterInspectorDockWidget::updateMemory ()
(pBreakpoint->type == eBreakOnCPUMemoryWrite) )
{
// Change register into row/column of display...
if ( m_regDB )
if ( m_regDB() )
{
reg = m_regDB->GetRegisterAt(pBreakpoint->itemActual);
reg = m_regDB()->GetRegisterAt(pBreakpoint->itemActual);
if ( reg >= 0 )
{
row = reg/binaryModel->columnCount();
@@ -252,9 +225,9 @@ void RegisterInspectorDockWidget::binaryView_currentChanged(QModelIndex index, Q
int cols = index.model()->columnCount();
m_register = (index.row()*cols)+index.column();
if ( m_regDB )
if ( m_regDB() )
{
sprintf ( buffer, "%04X: %s", m_regDB->GetRegister(m_register)->GetAddr(), m_regDB->GetRegister(m_register)->GetName() );
sprintf ( buffer, "%04X: %s", m_regDB()->GetRegister(m_register)->GetAddr(), m_regDB()->GetRegister(m_register)->GetName() );
ui->label->setText ( buffer );
}
@@ -268,9 +241,9 @@ void RegisterInspectorDockWidget::on_binaryView_clicked(QModelIndex index)
int cols = index.model()->columnCount();
m_register = (index.row()*cols)+index.column();
if ( m_regDB )
if ( m_regDB() )
{
sprintf ( buffer, "%04X: %s", m_regDB->GetRegister(m_register)->GetAddr(), m_regDB->GetRegister(m_register)->GetName() );
sprintf ( buffer, "%04X: %s", m_regDB()->GetRegister(m_register)->GetAddr(), m_regDB()->GetRegister(m_register)->GetName() );
ui->label->setText ( buffer );
}
@@ -284,9 +257,9 @@ void RegisterInspectorDockWidget::on_binaryView_doubleClicked(QModelIndex index)
int cols = index.model()->columnCount();
m_register = (index.row()*cols)+index.column();
if ( m_regDB )
if ( m_regDB() )
{
sprintf ( buffer, "%04X: %s", m_regDB->GetRegister(m_register)->GetAddr(), m_regDB->GetRegister(m_register)->GetName() );
sprintf ( buffer, "%04X: %s", m_regDB()->GetRegister(m_register)->GetAddr(), m_regDB()->GetRegister(m_register)->GetName() );
ui->label->setText ( buffer );
}
@@ -300,9 +273,9 @@ void RegisterInspectorDockWidget::on_binaryView_pressed(QModelIndex index)
int cols = index.model()->columnCount();
m_register = (index.row()*cols)+index.column();
if ( m_regDB )
if ( m_regDB() )
{
sprintf ( buffer, "%04X: %s", m_regDB->GetRegister(m_register)->GetAddr(), m_regDB->GetRegister(m_register)->GetName() );
sprintf ( buffer, "%04X: %s", m_regDB()->GetRegister(m_register)->GetAddr(), m_regDB()->GetRegister(m_register)->GetName() );
ui->label->setText ( buffer );
}
@@ -316,9 +289,9 @@ void RegisterInspectorDockWidget::on_binaryView_activated(QModelIndex index)
int cols = index.model()->columnCount();
m_register = (index.row()*cols)+index.column();
if ( m_regDB )
if ( m_regDB() )
{
sprintf ( buffer, "%04X: %s", m_regDB->GetRegister(m_register)->GetAddr(), m_regDB->GetRegister(m_register)->GetName() );
sprintf ( buffer, "%04X: %s", m_regDB()->GetRegister(m_register)->GetAddr(), m_regDB()->GetRegister(m_register)->GetName() );
ui->label->setText ( buffer );
}
@@ -332,9 +305,9 @@ void RegisterInspectorDockWidget::on_binaryView_entered(QModelIndex index)
int cols = index.model()->columnCount();
m_register = (index.row()*cols)+index.column();
if ( m_regDB )
if ( m_regDB() )
{
sprintf ( buffer, "%04X: %s", m_regDB->GetRegister(m_register)->GetAddr(), m_regDB->GetRegister(m_register)->GetName() );
sprintf ( buffer, "%04X: %s", m_regDB()->GetRegister(m_register)->GetAddr(), m_regDB()->GetRegister(m_register)->GetName() );
ui->label->setText ( buffer );
}
@@ -344,18 +317,12 @@ void RegisterInspectorDockWidget::on_binaryView_entered(QModelIndex index)
void RegisterInspectorDockWidget::on_bitfieldView_clicked(QModelIndex index)
{
if ( m_regDB )
{
bitfieldDelegate->setBitfield ( m_regDB->GetRegister(m_register)->GetBitfield(index.row()) );
binaryModel->update();
}
bitfieldDelegate->setBitfield ( m_regDB()->GetRegister(m_register)->GetBitfield(index.row()) );
binaryModel->update();
}
void RegisterInspectorDockWidget::on_bitfieldView_doubleClicked(QModelIndex index)
{
if ( m_regDB )
{
bitfieldDelegate->setBitfield ( m_regDB->GetRegister(m_register)->GetBitfield(index.row()) );
binaryModel->update();
}
bitfieldDelegate->setBitfield ( m_regDB()->GetRegister(m_register)->GetBitfield(index.row()) );
binaryModel->update();
}
@@ -38,8 +38,7 @@ private:
CDebuggerBitfieldComboBoxDelegate* bitfieldDelegate;
CDebuggerNumericItemDelegate* binaryDelegate;
CBreakpointInfo* m_pBreakpoints;
regDBFunc m_regDBFunc;
CRegisterDatabase* m_regDB;
regDBFunc m_regDB;
int m_register;
private slots:
+12 -38
View File
@@ -35,19 +35,6 @@ SymbolWatchDockWidget::SymbolWatchDockWidget(QWidget *parent) :
ram->setItemDelegateForColumn(SymbolWatchCol_Value,ramValueDelegate);
ram->resizeColumnsToContents();
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
watch->setFont(QFont("Monaco", 11));
ram->setFont(QFont("Monaco", 11));
#endif
#ifdef Q_OS_LINUX
watch->setFont(QFont("Monospace", 10));
ram->setFont(QFont("Monospace", 10));
#endif
#ifdef Q_OS_WIN
watch->setFont(QFont("Consolas", 11));
ram->setFont(QFont("Consolas", 11));
#endif
QObject::connect(watch->horizontalHeader(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),watchModel,SLOT(sort(int,Qt::SortOrder)));
QObject::connect(watchModel,SIGNAL(rowsInserted(QModelIndex,int,int)),this,SLOT(updateUi()));
QObject::connect(ram->horizontalHeader(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),ramModel,SLOT(sort(int,Qt::SortOrder)));
@@ -71,8 +58,8 @@ void SymbolWatchDockWidget::createNesUi()
return;
}
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::getObject("Emulator");
sramTab = new QWidget();
sramTab->setObjectName(QString::fromUtf8("sramTab"));
@@ -141,19 +128,6 @@ void SymbolWatchDockWidget::createNesUi()
exram->setItemDelegateForColumn(SymbolWatchCol_Value,exramValueDelegate);
exram->resizeColumnsToContents();
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
sram->setFont(QFont("Monaco", 11));
exram->setFont(QFont("Monaco", 11));
#endif
#ifdef Q_OS_LINUX
sram->setFont(QFont("Monospace", 10));
exram->setFont(QFont("Monospace", 10));
#endif
#ifdef Q_OS_WIN
sram->setFont(QFont("Consolas", 11));
exram->setFont(QFont("Consolas", 11));
#endif
QObject::connect(sram->horizontalHeader(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),sramModel,SLOT(sort(int,Qt::SortOrder)));
QObject::connect(exram->horizontalHeader(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),exramModel,SLOT(sort(int,Qt::SortOrder)));
@@ -210,9 +184,9 @@ void SymbolWatchDockWidget::destroyC64Ui()
void SymbolWatchDockWidget::updateTargetMachine(QString target)
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* compiler = CObjectRegistry::instance()->getObject("Compiler");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject* compiler = CObjectRegistry::getObject("Compiler");
if ( !target.compare("nes",Qt::CaseInsensitive) )
{
@@ -254,7 +228,7 @@ void SymbolWatchDockWidget::updateUi()
void SymbolWatchDockWidget::updateVariables()
{
QStringList symbols = CCC65Interface::instance()->getSymbolsForSourceFile("");
QStringList symbols = CCC65Interface::getSymbolsForSourceFile("");
int addr;
if ( !m_targetLoaded.compare("nes",Qt::CaseInsensitive) )
@@ -264,7 +238,7 @@ void SymbolWatchDockWidget::updateVariables()
exramModel->removeRows(0,exramModel->rowCount());
foreach ( QString symbol,symbols )
{
addr = CCC65Interface::instance()->getSymbolAddress(symbol);
addr = CCC65Interface::getSymbolAddress(symbol);
if ( addr < MEM_2KB )
{
// Symbol is in RAM...
@@ -290,7 +264,7 @@ void SymbolWatchDockWidget::updateVariables()
ramModel->removeRows(0,ramModel->rowCount());
foreach ( QString symbol,symbols )
{
addr = CCC65Interface::instance()->getSymbolAddress(symbol);
addr = CCC65Interface::getSymbolAddress(symbol);
// Symbol is in RAM...
ramModel->insertRow(symbol,addr);
@@ -406,7 +380,7 @@ void SymbolWatchDockWidget::contextMenuEvent(QContextMenuEvent *event)
void SymbolWatchDockWidget::showEvent(QShowEvent*)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
@@ -441,7 +415,7 @@ void SymbolWatchDockWidget::showEvent(QShowEvent*)
void SymbolWatchDockWidget::hideEvent(QHideEvent */*event*/)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
@@ -743,7 +717,7 @@ void SymbolWatchDockWidget::on_actionGo_to_Definition_triggered()
}
symbol = index.data(Qt::DisplayRole).toString();
file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
file = CCC65Interface::getSourceFileFromSymbol(symbol);
emit snapTo("SourceNavigatorFile,"+file);
emit snapTo("SourceNavigatorSymbol,"+symbol);
@@ -787,7 +761,7 @@ void SymbolWatchDockWidget::exram_doubleClicked(const QModelIndex &index)
void SymbolWatchDockWidget::on_tabWidget_currentChanged(int index)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
if ( emulator )
{
+2 -2
View File
@@ -6,8 +6,8 @@
CDesignerEditorBase::CDesignerEditorBase(IProjectTreeViewItem* link,QWidget *parent) :
QMainWindow(parent)
{
QWidget* searchBar = CDockWidgetRegistry::instance()->getWidget("Search Bar");
QWidget* search = CDockWidgetRegistry::instance()->getWidget("Search");
QWidget* searchBar = CDockWidgetRegistry::getWidget("Search Bar");
QWidget* search = CDockWidgetRegistry::getWidget("Search");
InitTabItem(link);
+96 -139
View File
@@ -5,7 +5,6 @@
#include <QMenu>
#include <QAction>
#include <QPixmap>
#include <QStringList>
#include "Qsci/qsciscintillabase.h"
@@ -32,10 +31,10 @@ CodeEditorForm::CodeEditorForm(QString fileName,QString sourceCode,IProjectTreeV
m_scintilla(NULL),
m_apis(NULL)
{
QDockWidget* codeBrowser = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Assembly Browser"));
QDockWidget* breakpoints = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Breakpoints"));
QDockWidget* symbolWatch = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Symbol Inspector"));
QDockWidget* executionVisualizer = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Execution Visualizer"));
QDockWidget* codeBrowser = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Assembly Browser"));
QDockWidget* breakpoints = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Breakpoints"));
QDockWidget* symbolWatch = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Symbol Inspector"));
QDockWidget* executionVisualizer = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Execution Visualizer"));
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
CMarker* markers = nesGetExecutionMarkerDatabase();
MarkerSetInfo* pMarker;
@@ -71,7 +70,7 @@ CodeEditorForm::CodeEditorForm(QString fileName,QString sourceCode,IProjectTreeV
m_scintilla->setAutoCompletionThreshold(2);
m_scintilla->setAutoCompletionCaseSensitivity(false);
m_scintilla->setAutoCompletionReplaceWord(false);
m_scintilla->setAutoCompletionUseSingle(QsciScintilla::AcusNever);
m_scintilla->setAutoCompletionUseSingle(QsciScintilla::AcusAlways);
m_scintilla->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
m_scintilla->setMarginWidth(4,0);
@@ -134,9 +133,9 @@ CodeEditorForm::CodeEditorForm(QString fileName,QString sourceCode,IProjectTreeV
QObject::connect ( executionVisualizer, SIGNAL(breakpointsChanged()), this, SLOT(external_breakpointsChanged()) );
}
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* compiler = CObjectRegistry::instance()->getObject("Compiler");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject* compiler = CObjectRegistry::getObject("Compiler");
QObject::connect ( compiler, SIGNAL(compileStarted()), this, SLOT(compiler_compileStarted()) );
QObject::connect ( compiler, SIGNAL(compileDone(bool)), this, SLOT(compiler_compileDone(bool)) );
@@ -241,7 +240,6 @@ void CodeEditorForm::customContextMenuRequested(const QPoint &pos)
menu.addAction(ui->actionStart_marker_here);
menu.addAction(ui->actionEnd_marker_here);
menu.addAction(ui->actionStart_End_marker_here);
menu.addSeparator();
m_breakpointIndex = bp;
@@ -249,7 +247,7 @@ void CodeEditorForm::customContextMenuRequested(const QPoint &pos)
}
if ( (!symbol.isEmpty()) &&
(CCC65Interface::instance()->isStringASymbol(symbol)) )
(CCC65Interface::isStringASymbol(symbol)) )
{
QString str = GO_TO_DEFINITION_TEXT;
str += symbol;
@@ -264,7 +262,7 @@ void CodeEditorForm::customContextMenuRequested(const QPoint &pos)
if ( (action) && (action->text().startsWith(GO_TO_DEFINITION_TEXT)) )
{
QString file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
QString file = CCC65Interface::getSourceFileFromSymbol(symbol);
emit snapToTab("SourceNavigatorFile,"+file);
emit snapToTab("SourceNavigatorSymbol,"+symbol);
}
@@ -400,7 +398,7 @@ void CodeEditorForm::compiler_compileDone(bool ok)
for ( line = 0; line < m_scintilla->lines(); line++ )
{
if ( CCC65Interface::instance()->isErrorOnLineOfFile(m_fileName,line+1) )
if ( CCC65Interface::isErrorOnLineOfFile(m_fileName,line+1) )
{
m_scintilla->markerAdd(line,Marker_Error);
}
@@ -447,11 +445,11 @@ void CodeEditorForm::external_breakpointsChanged()
for ( line = 0; line < m_scintilla->lines(); line++ )
{
asmcount = CCC65Interface::instance()->getLineMatchCount(m_fileName,line+1);
asmcount = CCC65Interface::getLineMatchCount(m_fileName,line+1);
for ( asmline = 0; asmline < asmcount; asmline++ )
{
addr = CCC65Interface::instance()->getAddressFromFileAndLine(m_fileName,line+1,asmline);
absAddr = CCC65Interface::instance()->getPhysicalAddressFromFileAndLine(m_fileName,line+1,asmline);
addr = CCC65Interface::getAddressFromFileAndLine(m_fileName,line+1,asmline);
absAddr = CCC65Interface::getAbsoluteAddressFromFileAndLine(m_fileName,line+1,asmline);
if ( addr != (unsigned int)-1 )
{
@@ -479,14 +477,14 @@ void CodeEditorForm::external_breakpointsChanged()
if ( (pBreakpoint->enabled) &&
(pBreakpoint->type == eBreakOnCPUExecution) &&
(pBreakpoint->item1 <= addr) &&
((absAddr == (unsigned int)-1) || (absAddr == pBreakpoint->item1Physical)) )
((absAddr == (unsigned int)-1) || (absAddr == pBreakpoint->item1Absolute)) )
{
m_scintilla->markerAdd(line,Marker_Breakpoint);
}
else if ( (!pBreakpoint->enabled) &&
(pBreakpoint->type == eBreakOnCPUExecution) &&
(pBreakpoint->item1 <= addr) &&
((absAddr == (unsigned int)-1) || (absAddr == pBreakpoint->item1Physical)) )
((absAddr == (unsigned int)-1) || (absAddr == pBreakpoint->item1Absolute)) )
{
m_scintilla->markerAdd(line,Marker_BreakpointDisabled);
}
@@ -697,30 +695,30 @@ void CodeEditorForm::updateToolTip(QString symbol)
if ( EnvironmentSettingsDialog::showSymbolTips() )
{
// Look for C-language emitted symbols [prepended with underscore]...
if ( (CCC65Interface::instance()->getSymbolType(clangSymbol) == CC65_SYM_LABEL) ||
(CCC65Interface::instance()->getSymbolType(clangSymbol) == CC65_SYM_IMPORT) )
if ( (CCC65Interface::getSymbolType(clangSymbol) == CC65_SYM_LABEL) ||
(CCC65Interface::getSymbolType(clangSymbol) == CC65_SYM_IMPORT) )
{
symbol = clangSymbol;
}
if ( (CCC65Interface::instance()->getSymbolType(symbol) == CC65_SYM_LABEL) ||
(CCC65Interface::instance()->getSymbolType(symbol) == CC65_SYM_IMPORT) )
if ( (CCC65Interface::getSymbolType(symbol) == CC65_SYM_LABEL) ||
(CCC65Interface::getSymbolType(symbol) == CC65_SYM_IMPORT) )
{
addr = CCC65Interface::instance()->getSymbolAddress(symbol);
addr = CCC65Interface::getSymbolAddress(symbol);
if ( addr != 0xFFFFFFFF )
{
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(symbol);
absAddr = CCC65Interface::getSymbolAbsoluteAddress(symbol);
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
{
nesGetPrintablePhysicalAddress(address,addr,absAddr);
nesGetPrintableAddressWithAbsolute(address,addr,absAddr);
}
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
{
c64GetPrintablePhysicalAddress(address,addr,absAddr);
c64GetPrintableAddressWithAbsolute(address,addr,absAddr);
}
file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
line = CCC65Interface::instance()->getSourceLineFromFileAndSymbol(file,symbol);
file = CCC65Interface::getSourceFileFromSymbol(symbol);
line = CCC65Interface::getSourceLineFromFileAndSymbol(file,symbol);
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
{
@@ -733,9 +731,9 @@ void CodeEditorForm::updateToolTip(QString symbol)
setToolTip(toolTipText);
}
}
else if ( CCC65Interface::instance()->getSymbolType(symbol) == CC65_SYM_EQUATE )
else if ( CCC65Interface::getSymbolType(symbol) == CC65_SYM_EQUATE )
{
addr = CCC65Interface::instance()->getSymbolAddress(symbol);
addr = CCC65Interface::getSymbolAddress(symbol);
sprintf(toolTipText,TOOLTIP_EQUATE,symbol.toLatin1().constData(),addr);
setToolTip(toolTipText);
@@ -846,45 +844,6 @@ void CodeEditorForm::on_actionEnable_breakpoint_triggered()
}
}
void CodeEditorForm::on_actionStart_End_marker_here_triggered()
{
CMarker* markers = nesGetExecutionMarkerDatabase();
int marker = -1;
int line, lineFrom, lineTo, indexFrom, indexTo;
int addr = 0;
int absAddr = 0;
m_scintilla->getSelection(&lineFrom,&indexFrom,&lineTo,&indexTo);
if ( lineFrom != -1 )
{
resolveLineAddress(lineFrom,&addr,&absAddr);
if ( addr != -1 )
{
// Find unused Marker entry...
marker = markers->AddMarker(addr,absAddr);
emit breakpointsChanged();
emit markProjectDirty(true);
}
}
if ( lineTo != -1 )
{
if ( marker >= 0 )
{
resolveLineAddress(lineTo,&addr,&absAddr);
if ( addr != -1 )
{
markers->CompleteMarker(marker,addr,absAddr);
emit breakpointsChanged();
emit markProjectDirty(true);
}
}
}
}
void CodeEditorForm::on_actionStart_marker_here_triggered()
{
CMarker* markers = nesGetExecutionMarkerDatabase();
@@ -961,7 +920,14 @@ void CodeEditorForm::setSourceCode(QString source)
// Force EOL conversion if desired.
if ( EnvironmentSettingsDialog::eolForceConsistent() )
{
m_scintilla->convertEols((QsciScintilla::EolMode)EnvironmentSettingsDialog::eolMode());
// Convert first to Unix to get rid of CR+LF.
m_scintilla->convertEols(QsciScintilla::EolUnix);
// Then if mode is not Unix, convert to it.
if ( EnvironmentSettingsDialog::eolMode() != QsciScintilla::EolUnix )
{
m_scintilla->convertEols((QsciScintilla::EolMode)EnvironmentSettingsDialog::eolMode());
}
}
// Force repaint of error tags.
@@ -1015,23 +981,23 @@ void CodeEditorForm::resolveLineAddress(int line, int *addr, int *absAddr)
int asmline;
bool ok;
asmcount = CCC65Interface::instance()->getLineMatchCount(m_fileName,line+1);
asmcount = CCC65Interface::getLineMatchCount(m_fileName,line+1);
if ( asmcount > 1 )
{
for ( asmline = 0; asmline < asmcount; asmline++ )
{
(*addr) = CCC65Interface::instance()->getAddressFromFileAndLine(m_fileName,line+1,asmline);
(*absAddr) = CCC65Interface::instance()->getPhysicalAddressFromFileAndLine(m_fileName,line+1,asmline);
(*addr) = CCC65Interface::getAddressFromFileAndLine(m_fileName,line+1,asmline);
(*absAddr) = CCC65Interface::getAbsoluteAddressFromFileAndLine(m_fileName,line+1,asmline);
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
{
nesGetPrintablePhysicalAddress(resolutionBuffer,(*addr),(*absAddr));
nesGetDisassemblyAtPhysicalAddress((*absAddr),resolutionBuffer);
nesGetPrintableAddressWithAbsolute(resolutionBuffer,(*addr),(*absAddr));
nesGetDisassemblyAtAbsoluteAddress((*absAddr),resolutionBuffer);
}
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
{
c64GetPrintablePhysicalAddress(resolutionBuffer,(*addr),(*absAddr));
c64GetDisassemblyAtPhysicalAddress((*absAddr),resolutionBuffer);
c64GetPrintableAddressWithAbsolute(resolutionBuffer,(*addr),(*absAddr));
c64GetDisassemblyAtAbsoluteAddress((*absAddr),resolutionBuffer);
}
asmChunk = resolutionBuffer;
asmChunk += ":";
@@ -1060,8 +1026,8 @@ void CodeEditorForm::resolveLineAddress(int line, int *addr, int *absAddr)
}
else
{
(*addr) = CCC65Interface::instance()->getAddressFromFileAndLine(m_fileName,line+1);
(*absAddr) = CCC65Interface::instance()->getPhysicalAddressFromFileAndLine(m_fileName,line+1);
(*addr) = CCC65Interface::getAddressFromFileAndLine(m_fileName,line+1);
(*absAddr) = CCC65Interface::getAbsoluteAddressFromFileAndLine(m_fileName,line+1);
}
}
@@ -1092,12 +1058,12 @@ void CodeEditorForm::annotateText()
first = true;
firstBlock = true;
asmcount = CCC65Interface::instance()->getLineMatchCount(m_fileName,line+1);
asmcount = CCC65Interface::getLineMatchCount(m_fileName,line+1);
for ( asmline = 0; asmline < asmcount; asmline++ )
{
addr = CCC65Interface::instance()->getAddressFromFileAndLine(m_fileName,line+1,asmline);
absAddr = CCC65Interface::instance()->getPhysicalAddressFromFileAndLine(m_fileName,line+1,asmline);
endAddr = CCC65Interface::instance()->getEndAddressFromPhysicalAddress(addr,absAddr);
addr = CCC65Interface::getAddressFromFileAndLine(m_fileName,line+1,asmline);
absAddr = CCC65Interface::getAbsoluteAddressFromFileAndLine(m_fileName,line+1,asmline);
endAddr = CCC65Interface::getEndAddressFromAbsoluteAddress(addr,absAddr);
if ( (addr != -1) && (absAddr != -1) && (endAddr != -1) )
{
@@ -1109,15 +1075,15 @@ void CodeEditorForm::annotateText()
for ( ; addr <= endAddr; addr++, absAddr++ )
{
if ( CCC65Interface::instance()->isPhysicalAddressAnOpcode(absAddr) )
if ( CCC65Interface::isAbsoluteAddressAnOpcode(absAddr) )
{
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
{
nesGetDisassemblyAtPhysicalAddress(absAddr,disassembly);
nesGetDisassemblyAtAbsoluteAddress(absAddr,disassembly);
}
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
{
c64GetDisassemblyAtPhysicalAddress(absAddr,disassembly);
c64GetDisassemblyAtAbsoluteAddress(absAddr,disassembly);
}
if ( disassembly[0] )
{
@@ -1129,11 +1095,11 @@ void CodeEditorForm::annotateText()
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
{
nesGetPrintablePhysicalAddress(address,addr,absAddr);
nesGetPrintableAddressWithAbsolute(address,addr,absAddr);
}
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
{
c64GetPrintablePhysicalAddress(address,addr,absAddr);
c64GetPrintableAddressWithAbsolute(address,addr,absAddr);
}
pAnnotationBuffer += sprintf(pAnnotationBuffer,"%s:",address);
pAnnotationBuffer += sprintf(pAnnotationBuffer,disassembly);
@@ -1261,10 +1227,10 @@ void CodeEditorForm::snapTo(QString item)
addr = splits.at(3).toInt(NULL,16);
absAddr = (splits.at(1).toInt(NULL,16)*MEM_8KB)+splits.at(2).toInt(NULL,16);
}
fileName = QDir::cleanPath(CCC65Interface::instance()->getSourceFileFromPhysicalAddress(addr,absAddr));
fileName = CCC65Interface::getSourceFileFromAbsoluteAddress(addr,absAddr);
if ( fileName == m_fileName )
{
line = CCC65Interface::instance()->getSourceLineFromPhysicalAddress(addr,absAddr);
line = CCC65Interface::getSourceLineFromAbsoluteAddress(addr,absAddr);
highlightLine(line);
}
}
@@ -1302,8 +1268,7 @@ void CodeEditorForm::snapTo(QString item)
else if ( item.startsWith("SourceNavigatorFile,") )
{
splits = item.split(QRegExp("[,]"));
QString cleanPath = QDir::cleanPath(splits.at(1));
if ( m_fileName.endsWith(cleanPath,Qt::CaseInsensitive) )
if ( m_fileName.endsWith(splits.at(1),Qt::CaseInsensitive) )
{
if ( splits.count() == 3 )
{
@@ -1322,8 +1287,7 @@ void CodeEditorForm::snapTo(QString item)
else if ( item.startsWith("OutputPaneFile,") )
{
splits = item.split(QRegExp("[,]"));
QString cleanPath = QDir::cleanPath(splits.at(1));
if ( cleanPath == m_fileName )
if ( splits.at(1) == m_fileName )
{
if ( splits.count() == 3 )
{
@@ -1343,7 +1307,7 @@ void CodeEditorForm::snapTo(QString item)
else if ( item.startsWith("SourceNavigatorSymbol,") )
{
splits = item.split(QRegExp("[,]"));
line = CCC65Interface::instance()->getSourceLineFromFileAndSymbol(m_fileName,splits.at(1));
line = CCC65Interface::getSourceLineFromFileAndSymbol(m_fileName,splits.at(1));
if ( line >= 0 )
{
highlightLine(line);
@@ -1393,7 +1357,7 @@ void CodeEditorForm::applyEnvironmentSettingsToTab()
{
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
int op;
if ( EnvironmentSettingsDialog::foldSource() )
{
m_scintilla->setMarginType(Margin_Folding,QsciScintilla::SymbolMargin);
@@ -1406,8 +1370,6 @@ void CodeEditorForm::applyEnvironmentSettingsToTab()
m_scintilla->setFolding(QsciScintilla::NoFoldStyle,Margin_Folding);
}
m_scintilla->setUtf8(EnvironmentSettingsDialog::textEncodingIsUtf8());
m_scintilla->setEolMode((QsciScintilla::EolMode)EnvironmentSettingsDialog::eolMode());
m_scintilla->setMarginsBackgroundColor(EnvironmentSettingsDialog::marginBackgroundColor());
@@ -1423,58 +1385,53 @@ void CodeEditorForm::applyEnvironmentSettingsToTab()
m_scintilla->setMarkerBackgroundColor(m_lexer->defaultPaper(),Marker_Highlight);
}
if ( m_lexer == NULL )
m_language = Language_Default;
m_scintilla->setLexer();
if ( m_lexer )
{
m_language = Language_Default;
m_scintilla->setLexer();
delete m_lexer;
}
foreach ( QString ext, EnvironmentSettingsDialog::highlightAsC().split(" ") )
foreach ( QString ext, EnvironmentSettingsDialog::highlightAsC().split(" ") )
{
if ( m_fileName.endsWith(ext,Qt::CaseInsensitive) )
{
m_language = Language_C;
}
}
if ( m_language == Language_Default )
{
foreach ( QString ext, EnvironmentSettingsDialog::highlightAsASM().split(" ") )
{
if ( m_fileName.endsWith(ext,Qt::CaseInsensitive) )
{
m_language = Language_C;
}
}
if ( m_language == Language_Default )
{
foreach ( QString ext, EnvironmentSettingsDialog::highlightAsASM().split(" ") )
{
if ( m_fileName.endsWith(ext,Qt::CaseInsensitive) )
{
m_language = Language_Assembly;
}
m_language = Language_Assembly;
}
}
}
if ( m_language == Language_C )
{
m_lexer = new QsciLexerCC65(m_scintilla);
}
else if ( m_language == Language_Assembly )
{
m_lexer = new QsciLexerCA65(m_scintilla);
m_apis = new QsciAPIsCA65(m_lexer);
if ( m_language == Language_C )
{
m_lexer = new QsciLexerCC65(m_scintilla);
}
else if ( m_language == Language_Assembly )
{
m_lexer = new QsciLexerCA65(m_scintilla);
QStringList opcodes;
for ( op = 0; op < 256; op++ )
{
QString opcodeTooltipText = OPCODEINFO(op);
opcodeTooltipText = opcodeTooltipText.split(":")[0];
if ( !(opcodeTooltipText.isEmpty() || opcodes.contains(opcodeTooltipText)) )
{
opcodes += opcodeTooltipText;
}
}
foreach ( QString opcode, opcodes )
{
m_apis->add(opcode);
}
m_apis->prepare();
}
else
if ( m_apis )
delete m_apis;
m_apis = new QsciAPIsCA65(m_lexer);
for ( op = 0; op < 256; op++ )
{
m_lexer = new QsciLexerDefault(m_scintilla);
QString opcodeTooltipText = OPCODEINFO(op);
opcodeTooltipText = opcodeTooltipText.split(":")[0];
m_apis->add(opcodeTooltipText);
}
m_apis->prepare();
}
else
{
m_lexer = new QsciLexerDefault(m_scintilla);
}
m_scintilla->setLexer(m_lexer);
+1 -2
View File
@@ -90,7 +90,7 @@ private:
CBreakpointInfo* m_pBreakpoints;
QsciScintilla* m_scintilla;
QsciLexer* m_lexer;
QsciAPIs* m_apis;
QsciAPIsCA65* m_apis;
int m_breakpointIndex;
int m_contextMenuLine;
int m_toolTipTimer;
@@ -126,7 +126,6 @@ public slots:
void on_actionClear_marker_triggered();
void on_actionEnd_marker_here_triggered();
void on_actionStart_marker_here_triggered();
void on_actionStart_End_marker_here_triggered();
void on_actionEnable_breakpoint_triggered();
void on_actionRemove_breakpoint_triggered();
void on_actionDisable_breakpoint_triggered();
-8
View File
@@ -86,14 +86,6 @@
<string>Clear Visualization Markers</string>
</property>
</action>
<action name="actionStart_End_marker_here">
<property name="text">
<string>Set Visualization Marker on selected region</string>
</property>
<property name="toolTip">
<string>Set Visualization Marker on selected region</string>
</property>
</action>
</widget>
<resources/>
<connections/>
@@ -1,30 +0,0 @@
#include "filepropertiesdialog.h"
#include "ui_filepropertiesdialog.h"
FilePropertiesDialog::FilePropertiesDialog(CProjectBase *base, QWidget *parent) :
QDialog(parent),
ui(new Ui::FilePropertiesDialog)
{
ui->setupUi(this);
_base = base;
setWindowTitle(base->caption());
ui->includeInBuild->setChecked(base->includeInBuild());
}
FilePropertiesDialog::~FilePropertiesDialog()
{
delete ui;
}
void FilePropertiesDialog::on_buttonBox_accepted()
{
_base->setIncludeInBuild(ui->includeInBuild->isChecked());
accept();
}
void FilePropertiesDialog::on_buttonBox_rejected()
{
reject();
}
-33
View File
@@ -1,33 +0,0 @@
#ifndef FILEPROPERTIESDIALOG_H
#define FILEPROPERTIESDIALOG_H
#include <QDialog>
#include <QUuid>
#include "cprojectbase.h"
namespace Ui {
class FilePropertiesDialog;
}
class FilePropertiesDialog : public QDialog
{
Q_OBJECT
public:
explicit FilePropertiesDialog(CProjectBase *base, QWidget *parent = nullptr);
~FilePropertiesDialog();
protected:
CProjectBase *_base;
private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
private:
Ui::FilePropertiesDialog *ui;
};
#endif // FILEPROPERTIESDIALOG_H
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FilePropertiesDialog</class>
<widget class="QDialog" name="FilePropertiesDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="includeInBuild">
<property name="text">
<string>Include in Build</string>
</property>
</widget>
</item>
<item row="1" column="0">
<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="2" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
+18 -144
View File
@@ -7,7 +7,7 @@
#include <QFileDialog>
#include <QSettings>
NewProjectDialog::NewProjectDialog(QString windowTitle,QString defName,QString defPath,bool addOnsOnly,QWidget* parent) :
NewProjectDialog::NewProjectDialog(QString windowTitle,QString defName,QString defPath, QWidget* parent) :
QDialog(parent),
ui(new Ui::NewProjectDialog)
{
@@ -18,42 +18,12 @@ NewProjectDialog::NewProjectDialog(QString windowTitle,QString defName,QString d
setWindowTitle(windowTitle);
ui->name->setFocus();
ui->target->setItemData(0,"NES",Qt::UserRole);
ui->target->setItemData(1,"C64",Qt::UserRole);
ui->tabWidget->setCurrentIndex(0);
if ( addOnsOnly )
{
ui->tabWidget->setTabEnabled(0,false);
}
QDir templatesDir(":/templates/NES");
QStringList templates = templatesDir.entryList();
templates.removeAll("header.s_in");
ui->templateProject->addItem("Empty Project");
ui->templateProject->addItems(templates);
QDir addonsDir(":/addons/NES");
QStringList addons = addonsDir.entryList();
ui->addOnsList->addItems(addons);
int idx;
for ( idx = 0; idx < ui->addOnsList->count(); idx++ )
{
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) )
{
pItem->setCheckState(Qt::Checked);
}
else
{
pItem->setCheckState(Qt::Unchecked);
}
}
ui->addOnsList->installEventFilter(this);
}
NewProjectDialog::~NewProjectDialog()
@@ -75,35 +45,6 @@ void NewProjectDialog::changeEvent(QEvent* e)
}
}
bool NewProjectDialog::eventFilter(QObject *obj, QEvent *event)
{
int checkedCount = 0;
if ( obj == ui->addOnsList )
{
if ( event->type() == QEvent::Enter ||
event->type() == QEvent::Leave )
{
int idx;
for ( idx = 0; idx < ui->addOnsList->count(); idx++ )
{
QListWidgetItem* item = ui->addOnsList->item(idx);
item->setBackgroundColor(QColor(255,255,255,255));
if ( item->checkState() == Qt::Checked )
{
checkedCount++;
}
}
if ( !((checkedCount > 0) ||
(ui->addOnsList->selectedItems().count() > 0)) )
{
ui->addOnReadme->setHtml("");
}
}
}
}
QString NewProjectDialog::getName()
{
return ui->name->text();
@@ -119,11 +60,6 @@ QString NewProjectDialog::getTarget()
return ui->target->currentText();
}
QString NewProjectDialog::getTargetShort()
{
return ui->target->itemData(ui->target->currentIndex(),Qt::UserRole).toString();
}
QString NewProjectDialog::getTemplate()
{
return ui->templateProject->currentText();
@@ -134,24 +70,6 @@ int NewProjectDialog::getTemplateIndex()
return ui->templateProject->currentIndex();
}
QStringList NewProjectDialog::getAddOns()
{
QStringList addons;
int idx;
for ( idx = 0; idx < ui->addOnsList->count(); idx++ )
{
QListWidgetItem *pItem = ui->addOnsList->item(idx);
QString addon_uri = ":/addons/NES/"+pItem->text();
if ( pItem->checkState() == Qt::Checked )
{
addons << addon_uri;
}
}
return addons;
}
void NewProjectDialog::on_pathBrowse_clicked()
{
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
@@ -182,15 +100,24 @@ void NewProjectDialog::on_name_textChanged(QString /*text*/)
bool NewProjectDialog::checkValidity()
{
QDir check(ui->path->text());
if ( !ui->path->text().isEmpty() && !ui->name->text().isEmpty() )
// Hackety hack (but then again so is using "new project dialog" for adding
// source files)
if( windowTitle() == "New Source" )
{
return true;
return !ui->name->text().isEmpty();
}
else
{
return false;
QDir check(ui->path->text());
if ( !ui->path->text().isEmpty() && !ui->name->text().isEmpty() )
{
return true;
}
else
{
return false;
}
}
}
@@ -204,7 +131,6 @@ void NewProjectDialog::on_buttonBox_accepted()
else
{
nesicideProject->setProjectTitle(getName());
nesicideProject->setDirty(true);
}
}
@@ -236,40 +162,21 @@ void NewProjectDialog::setupProject()
void NewProjectDialog::on_target_currentIndexChanged(QString target)
{
QStringList templates;
QStringList addons;
QString addonsLoc;
ui->templateProject->clear();
ui->templateProject->addItem("Empty Project");
ui->addOnsList->clear();
if ( target == "Nintendo Entertainment System" )
{
QDir templatesDir(":/templates/NES");
templates = templatesDir.entryList();
QDir addonsDir(":/addons/NES");
addonsLoc = ":/addons/NES";
addons = addonsDir.entryList();
templates.removeAll("header.s_in");
}
else if ( target == "Commodore 64" )
{
QDir templatesDir(":/templates/C64");
templates = templatesDir.entryList();
QDir addonsDir(":/addons/C64");
addonsLoc = ":/addons/C64";
addons = addonsDir.entryList();
templates.removeAll("header.s_in");
}
ui->templateProject->addItems(templates);
ui->addOnsList->addItems(addons);
int idx;
for ( idx = 0; idx < ui->addOnsList->count(); idx++ )
{
QListWidgetItem *pItem = ui->addOnsList->item(idx);
pItem->setCheckState(Qt::Unchecked);
pItem->setData(Qt::UserRole,addonsLoc+pItem->text());
}
}
void NewProjectDialog::on_projectProperties_clicked()
@@ -289,36 +196,3 @@ void NewProjectDialog::on_projectProperties_clicked()
delete dlg;
}
void NewProjectDialog::on_addOnsList_itemClicked(QListWidgetItem *item)
{
QString readmeFileName = ":/addons/";
readmeFileName += getTargetShort();
readmeFileName += "/";
readmeFileName += item->text();
readmeFileName += "/README.HTM";
item->setBackgroundColor(QColor(248,248,248,255));
QFileInfo fi(readmeFileName);
if ( fi.exists() )
{
QFile f(readmeFileName);
if ( f.open(QIODevice::ReadOnly) )
{
QByteArray b = f.readAll();
ui->addOnReadme->setHtml(b);
}
}
else
{
ui->addOnReadme->setHtml("");
}
}
void NewProjectDialog::on_addOnsList_itemEntered(QListWidgetItem *item)
{
on_addOnsList_itemClicked(item);
}
+1 -7
View File
@@ -2,7 +2,6 @@
#define NEWPROJECTDIALOG_H
#include <QDialog>
#include <QListWidgetItem>
namespace Ui
{
@@ -13,20 +12,17 @@ class NewProjectDialog : public QDialog
{
Q_OBJECT
public:
NewProjectDialog(QString windowTitle = "New",QString defName = "", QString defPath = "", bool addOnsOnly = false, QWidget* parent = 0);
NewProjectDialog(QString windowTitle = "New",QString defName = "", QString defPath = "", QWidget* parent = 0);
virtual ~NewProjectDialog();
QString getName();
QString getPath();
QString getTarget();
QString getTargetShort();
QString getTemplate();
int getTemplateIndex();
QStringList getAddOns();
protected:
void changeEvent(QEvent* e);
bool checkValidity();
bool eventFilter(QObject *obj, QEvent *event);
private:
Ui::NewProjectDialog* ui;
@@ -39,8 +35,6 @@ private slots:
void on_path_textChanged(QString text);
void on_pathBrowse_clicked();
void on_projectProperties_clicked();
void on_addOnsList_itemClicked(QListWidgetItem *item);
void on_addOnsList_itemEntered(QListWidgetItem *item);
};
#endif // NEWPROJECTDIALOG_H
+72 -152
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>598</width>
<height>402</height>
<width>433</width>
<height>317</height>
</rect>
</property>
<property name="windowTitle">
@@ -41,45 +41,75 @@
<string>General</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>12</number>
</property>
<property name="topMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0">
<property name="spacing">
<number>6</number>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name:</string>
</property>
<item>
<widget class="QLineEdit" name="path">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pathBrowse">
<property name="text">
<string>Browse...</string>
</property>
<property name="icon">
<iconset resource="../../../common/resource.qrc">
<normaloff>:/resources/document-open.png</normaloff>:/resources/document-open.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="name">
<property name="inputMethodHints">
<set>Qt::ImhNone</set>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="pathGroup">
<property name="title">
<string>Path</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="path">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pathBrowse">
<property name="text">
<string>Browse...</string>
</property>
<property name="icon">
<iconset resource="../../../common/resource.qrc">
<normaloff>:/resources/document-open.png</normaloff>:/resources/document-open.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QGroupBox" name="templateGroup">
<property name="title">
<string>Template Project</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Template:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="templateProject"/>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Target Machine:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="target">
@@ -95,118 +125,6 @@
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="name">
<property name="inputMethodHints">
<set>Qt::ImhNone</set>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="templateProject">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="5" column="0" colspan="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="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Template Project:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Project Path:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Target Machine:</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="addOns">
<attribute name="title">
<string>Add-Ons</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>12</number>
</property>
<property name="topMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QListWidget" name="addOnsList">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="uniformItemSizes">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QTextEdit" name="addOnReadme">
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustIgnored</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="acceptRichText">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
@@ -215,6 +133,8 @@
</widget>
<resources>
<include location="../../../common/resource.qrc"/>
<include location="../../../common/resource.qrc"/>
<include location="../../../common/resource.qrc"/>
</resources>
<connections>
<connection>
+13 -56
View File
@@ -46,7 +46,7 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(QWidget* parent) :
ui->linkerAdditionalDependencies->setText(nesicideProject->getLinkerAdditionalDependencies());
ui->linkerConfigFile->setText(nesicideProject->getLinkerConfigFile());
deserializeLinkerConfig();
ui->customRuleFiles->addItems(nesicideProject->getMakefileCustomRuleFiles());
ui->customRuleFile->setText(nesicideProject->getMakefileCustomRulesFile());
deserializeCustomRules();
ui->sourceSearchList->setModel(new QStringListModel(nesicideProject->getSourceSearchPaths()));
@@ -58,7 +58,7 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(QWidget* parent) :
ui->linkerConfig->setText("Select a file to store linker configuration in, then modify it here.");
ui->linkerConfig->setEnabled(false);
}
if ( ui->customRuleFiles->currentText().isEmpty() )
if ( ui->customRuleFile->text().isEmpty() )
{
ui->customRules->setText("Select a file to store custom makefile rules in, then modify it here.");
ui->customRules->setEnabled(false);
@@ -521,13 +521,7 @@ void ProjectPropertiesDialog::on_buttonBox_accepted()
nesicideProject->setTileProperties(tilePropertyListModel->getItems());
nesicideProject->setLinkerConfigFile(ui->linkerConfigFile->text());
serializeLinkerConfig();
QStringList customRuleFiles;
int idx;
for ( idx = 0; idx < ui->customRuleFiles->count(); idx++ )
{
customRuleFiles += ui->customRuleFiles->itemText(idx);
}
nesicideProject->setMakefileCustomRuleFiles(customRuleFiles);
nesicideProject->setMakefileCustomRulesFile(ui->customRuleFile->text());
serializeCustomRules();
nesicideProject->getProjectPaletteEntries()->clear();
@@ -577,7 +571,7 @@ void ProjectPropertiesDialog::on_projectNameLineEdit_textEdited(QString )
void ProjectPropertiesDialog::on_linkerConfigFileBrowse_clicked()
{
QString value = QFileDialog::getOpenFileName(this,"Linker Config File",QDir::currentPath());
QString value = QFileDialog::getSaveFileName(this,"Linker Config File",QDir::currentPath());
QDir dir(QDir::currentPath());
if ( !value.isEmpty() )
@@ -765,18 +759,14 @@ void ProjectPropertiesDialog::on_treeWidget_itemSelectionChanged()
ui->stackedWidget->setCurrentWidget(pageMap[ui->treeWidget->currentItem()->text(0)]);
}
void ProjectPropertiesDialog::serializeCustomRules(QString rulesFile)
void ProjectPropertiesDialog::serializeCustomRules()
{
if ( rulesFile.isEmpty() )
{
rulesFile = ui->customRuleFiles->currentText();
}
if ( !rulesFile.isEmpty() )
if ( !ui->customRuleFile->text().isEmpty() )
{
if ( customRulesChanged )
{
QDir dir(QDir::currentPath());
QFile fileOut(dir.filePath(ui->customRuleFiles->currentText()));
QFile fileOut(dir.filePath(ui->customRuleFile->text()));
fileOut.open(QIODevice::ReadWrite|QIODevice::Truncate|QIODevice::Text);
if ( fileOut.isOpen() )
@@ -786,7 +776,7 @@ void ProjectPropertiesDialog::serializeCustomRules(QString rulesFile)
}
else
{
QMessageBox::critical(0,"File I/O Error", "Could not write custom rules file:\n"+rulesFile);
QMessageBox::critical(0,"File I/O Error", "Could not write custom rules file:\n"+ui->customRuleFile->text());
}
}
@@ -798,9 +788,9 @@ void ProjectPropertiesDialog::deserializeCustomRules()
{
QDir dir(QDir::currentPath());
if ( !ui->customRuleFiles->currentText().isEmpty() )
if ( !ui->customRuleFile->text().isEmpty() )
{
QFile fileIn(dir.filePath(ui->customRuleFiles->currentText()));
QFile fileIn(dir.filePath(ui->customRuleFile->text()));
if ( fileIn.exists() )
{
@@ -812,7 +802,7 @@ void ProjectPropertiesDialog::deserializeCustomRules()
}
else
{
QMessageBox::critical(0,"File I/O Error", "Could not read custom rules file:\n"+ui->customRuleFiles->currentText());
QMessageBox::critical(0,"File I/O Error", "Could not read custom rules file:\n"+ui->customRuleFile->text());
}
}
@@ -828,12 +818,12 @@ void ProjectPropertiesDialog::on_customRules_textChanged()
void ProjectPropertiesDialog::on_customRuleFileBrowse_clicked()
{
QString value = QFileDialog::getOpenFileName(this,"Custom Rule File",QDir::currentPath());
QString value = QFileDialog::getSaveFileName(this,"Custom Rule File",QDir::currentPath());
QDir dir(QDir::currentPath());
if ( !value.isEmpty() )
{
ui->customRuleFiles->addItem(dir.fromNativeSeparators(dir.relativeFilePath(value)));
ui->customRuleFile->setText(dir.fromNativeSeparators(dir.relativeFilePath(value)));
ui->customRules->setEnabled(true);
ui->customRules->setText("");
}
@@ -868,36 +858,3 @@ void ProjectPropertiesDialog::on_sourceSearchPathBrowse_clicked()
ui->sourceSearchPath->setText(value);
ui->addSearchPath->setEnabled(!value.isEmpty());
}
void ProjectPropertiesDialog::on_linkerConfigFileNew_clicked()
{
QString value = QFileDialog::getSaveFileName(this,"Linker Config File",QDir::currentPath());
QDir dir(QDir::currentPath());
if ( !value.isEmpty() )
{
ui->linkerConfigFile->setText(dir.fromNativeSeparators(dir.relativeFilePath(value)));
ui->linkerConfig->setEnabled(true);
ui->linkerConfig->setText("");
}
deserializeLinkerConfig();
}
void ProjectPropertiesDialog::on_customRuleFiles_currentTextChanged(const QString &arg1)
{
if ( customRulesChanged )
{
serializeCustomRules(currentCustomRulesFile);
}
currentCustomRulesFile = arg1;
deserializeCustomRules();
}
void ProjectPropertiesDialog::on_customRuleFileRemove_clicked()
{
if ( ui->customRuleFiles->currentIndex() >= 0 )
{
ui->customRuleFiles->removeItem(ui->customRuleFiles->currentIndex());
}
}
+1 -5
View File
@@ -28,7 +28,7 @@ protected:
void changeEvent(QEvent* e);
void serializeLinkerConfig();
void deserializeLinkerConfig();
void serializeCustomRules(QString rulesFile = QString());
void serializeCustomRules();
void deserializeCustomRules();
private:
@@ -37,7 +37,6 @@ private:
QList<QColor> currentPalette;
bool linkerConfigChanged;
bool customRulesChanged;
QString currentCustomRulesFile;
CPropertyListModel* tilePropertyListModel;
QMap<QString,QWidget*> pageMap;
@@ -70,9 +69,6 @@ private slots:
void on_addSearchPath_clicked();
void on_removeSearchPath_clicked();
void on_sourceSearchPathBrowse_clicked();
void on_linkerConfigFileNew_clicked();
void on_customRuleFiles_currentTextChanged(const QString &arg1);
void on_customRuleFileRemove_clicked();
};
#endif // PROJECTPROPERTIESDIALOG_H
+52 -94
View File
@@ -111,7 +111,7 @@
<enum>QFrame::NoFrame</enum>
</property>
<property name="currentIndex">
<number>5</number>
<number>7</number>
</property>
<widget class="QWidget" name="project">
<layout class="QGridLayout" name="gridLayout_8">
@@ -476,17 +476,6 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="linkerConfigFileNew">
<property name="text">
<string>New</string>
</property>
<property name="icon">
<iconset resource="../../../common/resource.qrc">
<normaloff>:/resources/22_document-new.png</normaloff>:/resources/22_document-new.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="linkerConfigFileBrowse">
<property name="text">
@@ -620,78 +609,45 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="3" column="0" colspan="2">
<widget class="QTextEdit" name="customRules"/>
</item>
<item row="2" column="0" colspan="2">
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Build rules entered here will appear verbatim in the specified file.</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<layout class="QFormLayout" name="formLayout_6">
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_32">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Custom rule file:</string>
<item row="2" column="0" colspan="2">
<widget class="QTextEdit" name="customRules"/>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLineEdit" name="customRuleFile">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_9" stretch="1,0,0">
<property name="spacing">
<number>6</number>
<item>
<widget class="QPushButton" name="customRuleFileBrowse">
<property name="text">
<string>Browse...</string>
</property>
<item>
<widget class="QComboBox" name="customRuleFiles">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="customRuleFileBrowse">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../common/resource.qrc">
<normaloff>:/resources/RR_page_white_add.png</normaloff>:/resources/RR_page_white_add.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="customRuleFileRemove">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../common/resource.qrc">
<normaloff>:/resources/RR_page_white_delete.png</normaloff>:/resources/RR_page_white_delete.png</iconset>
</property>
</widget>
</item>
</layout>
<property name="icon">
<iconset resource="../../../common/resource.qrc">
<normaloff>:/resources/document-open.png</normaloff>:/resources/document-open.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_32">
<property name="text">
<string>Custom rule file:</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="nesgraphicsbuilder">
@@ -745,6 +701,29 @@
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>CHR Data Location</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QRadioButton" name="chrRom">
<property name="text">
<string>CHR Data in CHR-ROM</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="chrRam">
<property name="text">
<string>CHR Data in CHR-RAM</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
@@ -758,29 +737,6 @@
</property>
</spacer>
</item>
<item row="2" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>CHR Data Location</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QRadioButton" name="chrRam">
<property name="text">
<string>CHR Data in CHR-RAM</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="chrRom">
<property name="text">
<string>CHR Data in CHR-ROM</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="nescartridge">
@@ -1349,6 +1305,8 @@
</widget>
<resources>
<include location="../../../common/resource.qrc"/>
<include location="../../../common/resource.qrc"/>
<include location="../../../common/resource.qrc"/>
</resources>
<connections>
<connection>
+11 -5
View File
@@ -6,16 +6,22 @@ QsciAPIsCA65::QsciAPIsCA65(QsciLexer *lexer)
}
QsciAPIsCA65::~QsciAPIsCA65()
{
}
//! \reimp
void QsciAPIsCA65::updateAutoCompletionList(const QStringList &context,
QStringList &list)
{
QsciAPIs::updateAutoCompletionList(context,list);
qDebug("updateAutoCompletionList: context=[");
foreach ( QString str, context )
{
qDebug(str.toUtf8().data());
}
qDebug("], list=[");
foreach ( QString str, list )
{
qDebug(str.toUtf8().data());
}
qDebug("]");
}
//! \reimp
+2 -1
View File
@@ -7,9 +7,10 @@
class QsciAPIsCA65 : public QsciAPIs
{
Q_OBJECT
public:
QsciAPIsCA65(QsciLexer *lexer);
virtual ~QsciAPIsCA65();
//! \reimp
virtual void updateAutoCompletionList(const QStringList &context,
-39
View File
@@ -20,42 +20,3 @@ QsciLexerCC65::QsciLexerCC65(QObject */*parent*/)
QsciLexerCC65::~QsciLexerCC65()
{
}
QFont QsciLexerCC65::defaultFont() const
{
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
return QFont("Monaco", 11);
#endif
#ifdef Q_OS_LINUX
return QFont("Monospace", 10);
#endif
#ifdef Q_OS_WIN
return QFont("Consolas", 11);
#endif
}
QFont QsciLexerCC65::defaultFont(int style) const
{
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
return QFont("Monaco", 11);
#endif
#ifdef Q_OS_LINUX
return QFont("Monospace", 10);
#endif
#ifdef Q_OS_WIN
return QFont("Consolas", 11);
#endif
}
QFont QsciLexerCC65::font(int style) const
{
#if defined(Q_OS_MAC) || defined(Q_OS_MACX) || defined(Q_OS_MAC64)
return QFont("Monaco", 11);
#endif
#ifdef Q_OS_LINUX
return QFont("Monospace", 10);
#endif
#ifdef Q_OS_WIN
return QFont("Consolas", 11);
#endif
}
-5
View File
@@ -13,11 +13,6 @@ class QsciLexerCC65 : public QsciLexerCPP
public:
QsciLexerCC65(QObject *parent = 0);
virtual ~QsciLexerCC65();
virtual QFont defaultFont() const;
virtual QFont defaultFont(int style) const;
virtual QFont font(int style) const;
};
#endif // QSCILEXERCC65_H
+3 -31
View File
@@ -17,7 +17,6 @@ bool EnvironmentSettingsDialog::m_rememberWindowSettings;
bool EnvironmentSettingsDialog::m_trackRecentProjects;
QString EnvironmentSettingsDialog::m_romPath;
bool EnvironmentSettingsDialog::m_runRomOnLoad;
bool EnvironmentSettingsDialog::m_useTabBarInEditorArea;
bool EnvironmentSettingsDialog::m_followExecution;
int EnvironmentSettingsDialog::m_debuggerUpdateRate;
int EnvironmentSettingsDialog::m_soundBufferDepth;
@@ -33,7 +32,6 @@ bool EnvironmentSettingsDialog::m_tabReplacementEnabled;
int EnvironmentSettingsDialog::m_spacesForTabs;
bool EnvironmentSettingsDialog::m_annotateSource;
bool EnvironmentSettingsDialog::m_foldSource;
bool EnvironmentSettingsDialog::m_textEncodingIsUtf8;
QString EnvironmentSettingsDialog::m_cSourceExtensions;
QString EnvironmentSettingsDialog::m_asmSourceExtensions;
QString EnvironmentSettingsDialog::m_headerExtensions;
@@ -91,14 +89,14 @@ EnvironmentSettingsDialog::EnvironmentSettingsDialog(QWidget* parent) :
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
ui->settingsLocation->setText(QString("Currently reading settings from: ")+settings.fileName());
QFileInfo toolchainInfo(qgetenv("CC65_HOME"));
if ( toolchainInfo.exists() &&
toolchainInfo.isDir() )
{
ui->toolchainLocation->setText(qgetenv("CC65_HOME"));
}
m_scintilla = new QsciScintilla();
m_defaultLexer = new QsciLexerDefault();
m_cc65Lexer = new QsciLexerCC65();
@@ -125,7 +123,6 @@ EnvironmentSettingsDialog::EnvironmentSettingsDialog(QWidget* parent) :
ui->ROMPath->setText(m_romPath);
ui->runRom->setChecked(m_runRomOnLoad);
ui->followExecution->setChecked(m_followExecution);
ui->useTabBarInEditorArea->setChecked(m_useTabBarInEditorArea);
switch ( m_debuggerUpdateRate )
{
@@ -155,9 +152,8 @@ EnvironmentSettingsDialog::EnvironmentSettingsDialog(QWidget* parent) :
ui->spacesForTab->setValue(m_spacesForTabs);
ui->annotate->setChecked(m_annotateSource);
ui->fold->setChecked(m_foldSource);
ui->textEncoding->setCurrentIndex(m_textEncodingIsUtf8);
ui->showSymbolTips->setChecked(m_showSymbolTips);
ui->showOpcodeTips->setChecked(m_showOpcodeTips);
@@ -216,7 +212,6 @@ void EnvironmentSettingsDialog::readSettings()
m_trackRecentProjects = settings.value("trackRecentProjects",QVariant(true)).toBool();
m_romPath = settings.value("romPath").toString();
m_runRomOnLoad = settings.value("runRomOnLoad",QVariant(false)).toBool();
m_useTabBarInEditorArea = settings.value("useTabBarInEditorArea",QVariant(false)).toBool();
m_followExecution = settings.value("followExecution",QVariant(true)).toBool();
m_debuggerUpdateRate = settings.value("debuggerUpdateRate",QVariant(0)).toInt();
m_soundBufferDepth = settings.value("soundBufferDepth",QVariant(1024)).toInt();
@@ -253,7 +248,6 @@ void EnvironmentSettingsDialog::readSettings()
m_spacesForTabs = settings.value("spacesPerTab",QVariant(3)).toInt();
m_annotateSource = settings.value("annotateSource",QVariant(true)).toBool();
m_foldSource = settings.value("foldSource",QVariant(true)).toBool();
m_textEncodingIsUtf8 = settings.value("textEncodingIsUtf8",QVariant(false)).toBool();
m_cSourceExtensions = settings.value("SourceExtensionsC",QVariant(sourceExtensionListC)).toString();
m_asmSourceExtensions = settings.value("SourceExtensionsAsm",QVariant(sourceExtensionListAsm)).toString();
m_headerExtensions = settings.value("HeaderExtensions",QVariant(headerExtensionList)).toString();
@@ -298,7 +292,6 @@ void EnvironmentSettingsDialog::writeSettings()
m_trackRecentProjects = ui->trackRecentProjects->isChecked();
m_romPath = ui->ROMPath->text();
m_runRomOnLoad = ui->runRom->isChecked();
m_useTabBarInEditorArea = ui->useTabBarInEditorArea->isChecked();
m_followExecution = ui->followExecution->isChecked();
switch ( ui->debuggerUpdateRate->value() )
{
@@ -322,7 +315,6 @@ void EnvironmentSettingsDialog::writeSettings()
m_spacesForTabs = ui->spacesForTab->value();
m_annotateSource = ui->annotate->isChecked();
m_foldSource = ui->fold->isChecked();
m_textEncodingIsUtf8 = ui->textEncoding->currentIndex();
m_cSourceExtensions = ui->sourceExtensionsC->text();
m_asmSourceExtensions = ui->sourceExtensionsAsm->text();
m_headerExtensions = ui->headerExtensions->text();
@@ -348,7 +340,6 @@ void EnvironmentSettingsDialog::writeSettings()
settings.setValue("runRomOnLoad",m_runRomOnLoad);
settings.setValue("followExecution",m_followExecution);
settings.setValue("useTabBarInEditorArea",m_useTabBarInEditorArea);
settings.setValue("debuggerUpdateRate",m_debuggerUpdateRate);
@@ -366,7 +357,6 @@ void EnvironmentSettingsDialog::writeSettings()
settings.setValue("spacesPerTab",m_spacesForTabs);
settings.setValue("annotateSource",m_annotateSource);
settings.setValue("foldSource",m_foldSource);
settings.setValue("textEncodingIsUtf8",m_textEncodingIsUtf8);
settings.setValue("SourceExtensionsC",m_cSourceExtensions);
settings.setValue("SourceExtensionsAsm",m_asmSourceExtensions);
@@ -453,7 +443,6 @@ void EnvironmentSettingsDialog::setupCodeEditor(int index)
{
m_scintilla->setMarginWidth(Margin_LineNumbers,0);
}
m_scintilla->setUtf8(m_textEncodingIsUtf8);
m_scintilla->setSelectionBackgroundColor(QColor(215,215,215));
m_scintilla->setSelectionToEol(true);
@@ -909,20 +898,3 @@ void EnvironmentSettingsDialog::on_buttonBox_accepted()
{
writeSettings();
}
void EnvironmentSettingsDialog::on_textEncoding_currentIndexChanged(int index)
{
m_scintilla->setUtf8(index);
}
QString EnvironmentSettingsDialog::textEncodingString()
{
if ( m_textEncodingIsUtf8 )
{
return "UTF-8";
}
else
{
return "ISO 8859";
}
}
-6
View File
@@ -35,7 +35,6 @@ public:
static QString romPath() { return m_romPath; }
static bool runRomOnLoad() { return m_runRomOnLoad; }
static bool followExecution() { return m_followExecution; }
static bool useTabBarInEditorArea() { return m_useTabBarInEditorArea; }
static int debuggerUpdateRate() { return m_debuggerUpdateRate; }
static int soundBufferDepth() { return m_soundBufferDepth; }
static QColor marginBackgroundColor() { return m_marginBackgroundColor; }
@@ -50,8 +49,6 @@ public:
static int spacesPerTab() { return m_spacesForTabs; }
static bool annotateSource() { return m_annotateSource; }
static bool foldSource() { return m_foldSource; }
static bool textEncodingIsUtf8() { return m_textEncodingIsUtf8; }
static QString textEncodingString();
static QString sourceExtensionsForC() { return m_cSourceExtensions; }
static QString sourceExtensionsForAssembly() { return m_asmSourceExtensions; }
static QString headerExtensions() { return m_headerExtensions; }
@@ -92,7 +89,6 @@ private:
static bool m_trackRecentProjects;
static QString m_romPath;
static bool m_runRomOnLoad;
static bool m_useTabBarInEditorArea;
static bool m_followExecution;
static int m_debuggerUpdateRate;
static int m_soundBufferDepth;
@@ -108,7 +104,6 @@ private:
static int m_spacesForTabs;
static bool m_annotateSource;
static bool m_foldSource;
static bool m_textEncodingIsUtf8;
static QString m_cSourceExtensions;
static QString m_asmSourceExtensions;
static QString m_headerExtensions;
@@ -145,7 +140,6 @@ private slots:
void on_useInternalDB_toggled(bool checked);
void on_PluginPathButton_clicked();
void on_caretColor_clicked();
void on_textEncoding_currentIndexChanged(int index);
};
#endif // ENVIRONMENTSETTINGSDIALOG_H
+112 -256
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>801</width>
<height>527</height>
<width>802</width>
<height>535</height>
</rect>
</property>
<property name="windowTitle">
@@ -91,7 +91,7 @@
<item row="1" column="1">
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="general">
<layout class="QGridLayout" name="gridLayout_14">
@@ -107,22 +107,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="7" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>291</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="rememberWindowSettings">
<property name="text">
@@ -137,7 +121,31 @@
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<item row="1" column="0">
<widget class="QCheckBox" name="showWelcomeOnStart">
<property name="text">
<string>Show welcome page on startup</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="saveAllOnCompile">
<property name="text">
<string>Save all documents on compile</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="label_12">
<property name="text">
<string>NESICIDE uses a portable installation paradigm. All settings are stored in an .INI file located in the installation folder.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Plugin Path</string>
@@ -164,7 +172,20 @@
</layout>
</widget>
</item>
<item row="9" column="0" colspan="2">
<item row="6" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>291</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0" colspan="2">
<widget class="QLabel" name="settingsLocation">
<property name="text">
<string>TextLabel</string>
@@ -174,37 +195,6 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="showWelcomeOnStart">
<property name="text">
<string>Show welcome page on startup</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="saveAllOnCompile">
<property name="text">
<string>Save all documents on compile</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<widget class="QLabel" name="label_12">
<property name="text">
<string>NESICIDE uses a portable installation paradigm. All settings are stored in an .INI file located in the installation folder.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="useTabBarInEditorArea">
<property name="text">
<string>Use tab bar in editor area</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="codeeditor">
@@ -221,9 +211,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget_2">
<property name="currentIndex">
@@ -234,14 +221,31 @@
<string>General</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_20">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_7">
<property name="title">
<string>Tips</string>
</property>
<layout class="QGridLayout" name="gridLayout_11">
<item row="0" column="0">
<widget class="QCheckBox" name="showSymbolTips">
<property name="text">
<string>Symbols</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="showOpcodeTips">
<property name="text">
<string>Opcodes</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_10">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Mixed-mode debug annotations (C/assembly)</string>
</property>
@@ -256,61 +260,7 @@
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QGroupBox" name="groupBox_14">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Folding</string>
</property>
<layout class="QGridLayout" name="gridLayout_19">
<item row="0" column="0">
<widget class="QCheckBox" name="fold">
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="QGroupBox" name="groupBox_15">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Encoding</string>
</property>
<layout class="QGridLayout" name="gridLayout_21">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item row="0" column="0">
<widget class="QComboBox" name="textEncoding">
<item>
<property name="text">
<string>Latin-1</string>
</property>
</item>
<item>
<property name="text">
<string>UTF-8</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2">
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox_13">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -370,29 +320,16 @@
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item row="3" column="0">
<widget class="QGroupBox" name="groupBox_14">
<property name="title">
<string>Tips</string>
<string>Folding</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="showOpcodeTips">
<layout class="QGridLayout" name="gridLayout_19">
<item row="0" column="0">
<widget class="QCheckBox" name="fold">
<property name="text">
<string>Opcodes</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showSymbolTips">
<property name="text">
<string>Symbols</string>
<string>Enabled</string>
</property>
</widget>
</item>
@@ -752,22 +689,43 @@
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_8">
<property name="title">
<string>File Extensions</string>
</property>
<layout class="QGridLayout" name="gridLayout_11" columnstretch="0,1">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="1">
<layout class="QFormLayout" name="formLayout_2">
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>C:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="sourceExtensionsC"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Assembly:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="sourceExtensionsAsm"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Headers:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="headerExtensions"/>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_10">
<property name="text">
<string>File extensions in these lists should each be preceded by a period and separated by spaces. These values are used by the Makefile generator to determine what source files to include in a build.</string>
@@ -777,85 +735,14 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item row="6" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>C:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string>Custom:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="sourceExtensionsC">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Assembly:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="sourceExtensionsAsm">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_13">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Headers:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="headerExtensions">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Note: Include file extensions in Custom for all file types that are processed by custom rules specified in your project configuration.</string>
@@ -868,31 +755,8 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_18">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Custom:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="customExtensions">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<item row="6" column="1">
<widget class="QLineEdit" name="customExtensions"/>
</item>
</layout>
</widget>
@@ -946,9 +810,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_6">
<property name="title">
@@ -1118,9 +979,6 @@
</widget>
<widget class="QWidget" name="nesdebugger">
<layout class="QGridLayout" name="gridLayout_6">
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
@@ -1185,9 +1043,6 @@
</widget>
<widget class="QWidget" name="c64emulator">
<layout class="QGridLayout" name="gridLayout_15">
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
@@ -1203,6 +1058,7 @@
</widget>
<resources>
<include location="../../common/resource.qrc"/>
<include location="../../common/resource.qrc"/>
</resources>
<connections>
<connection>
+14 -18
View File
@@ -21,25 +21,20 @@ public:
parentItem = parent;
ident = new QUuid();
(*ident) = QUuid::createUuid();
// if ( iconResource.isEmpty() )
// {
// _icon = QIcon(":/resources/RR_page_white.png");
// }
// else
// {
// _icon = QIcon(iconResource);
// }
if ( iconResource.isEmpty() )
{
_icon = QIcon(":/resources/RR_page_white.png");
}
else
{
_icon = QIcon(iconResource);
}
}
// QIcon icon()
// {
// return _icon;
// }
// void setIcon(QString iconFile)
// {
// _icon = QIcon(iconFile);
// }
QIcon icon()
{
return _icon;
}
QString uuid()
{
@@ -164,7 +159,8 @@ public:
void reset(IProjectTreeViewItem* pTVI)
{
m_pBase = pTVI;
reset();
m_pAt = pTVI;
m_nodeIndex = 0;
}
void next()
+8 -10
View File
@@ -27,16 +27,6 @@ int main(int argc, char* argv[])
// Main window of application.
MainWindow* nesicideWindow;
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts,true);
// Set up default OpenGL format.
QSurfaceFormat fmt = QSurfaceFormat::defaultFormat();
// Disable VSYNC waiting.
//fmt.setSwapInterval(0);
QSurfaceFormat::setDefaultFormat(fmt);
QApplication nesicideApplication(argc, argv);
AppEventFilter nesicideEventFilter;
@@ -51,6 +41,14 @@ int main(int argc, char* argv[])
//splash->exec();
delete splash;
// Set up default OpenGL format.
QGLFormat fmt = QGLFormat::defaultFormat();
// Disable VSYNC waiting.
fmt.setSwapInterval(0);
QGLFormat::setDefaultFormat(fmt);
// Create the project model.
CProjectModel projectModel;
Executable → Regular
+166 -542
View File
File diff suppressed because it is too large Load Diff
+1 -16
View File
@@ -112,7 +112,6 @@ protected:
MemoryInspectorDockWidget* m_pBinCHRMemoryInspector;
MemoryInspectorDockWidget* m_pBinSRAMMemoryInspector;
MemoryInspectorDockWidget* m_pBinEXRAMMemoryInspector;
MemoryInspectorDockWidget* m_pBinCartVRAMMemoryInspector;
RegisterInspectorDockWidget* m_pBinPPURegisterInspector;
RegisterInspectorDockWidget* m_pBinAPURegisterInspector;
RegisterInspectorDockWidget* m_pBinOAMMemoryInspector;
@@ -129,7 +128,6 @@ protected:
QMenu *menuCartridge_Inspectors;
QMenu *menuSystem;
QMenu *menuAudio;
QMenu *menuAudioMMC5;
QMenu *menuAudioVRC6;
QMenu *menuAudioN106;
QMenu *menuVideo;
@@ -147,7 +145,6 @@ protected:
QAction *actionBinEXRAMMemory_Inspector;
QAction *actionBinMapperMemory_Inspector;
QAction *actionBinROM_Inspector;
QAction *actionBinCartVRAMMemory_Inspector;
QAction *actionPPUInformation_Inspector;
QAction *actionJoypadLogger_Inspector;
QAction *actionCodeDataLogger_Inspector;
@@ -166,9 +163,6 @@ protected:
QAction *actionPulse_1VRC6;
QAction *actionPulse_2VRC6;
QAction *actionSawtoothVRC6;
QAction *actionSquare_1MMC5;
QAction *actionSquare_2MMC5;
QAction *actionDMCMMC5;
QAction *actionWave_1N106;
QAction *actionWave_2N106;
QAction *actionWave_3N106;
@@ -209,8 +203,6 @@ private:
void saveProject(QString fileName);
void saveEmulatorState(QString fileName);
bool closeProject();
void applyAddOns(QStringList addOns);
void explodeAddOn(int level,QString projectName,QString addonDirName,QString localDirName);
void explodeTemplate(int level,QString templateName,QString projectName,QString templateDirName,QString localDirName,QString* projectFileName);
void explodeINESHeaderTemplate(QString templateName,QString projectName,QString templateDirName,QString localDirName);
void updateFromEmulatorPrefs(bool initial);
@@ -228,13 +220,12 @@ signals:
void primeEmulator();
void pauseEmulation(bool show);
void resetEmulator();
void exitEmulator();
void adjustAudio(int32_t length);
void updateTargetMachine(QString target);
void compile();
void clean();
public slots:
private slots:
void openRecentFile();
void saveRecentFiles(QString fileName);
void updateRecentFiles();
@@ -308,9 +299,6 @@ public slots:
void actionPulse_1VRC6_toggled(bool );
void actionPulse_2VRC6_toggled(bool );
void actionSawtoothVRC6_toggled(bool );
void actionSquare_1MMC5_toggled(bool );
void actionSquare_2MMC5_toggled(bool );
void actionDMCMMC5_toggled(bool );
void actionWave_1N106_toggled(bool );
void actionWave_2N106_toggled(bool );
void actionWave_3N106_toggled(bool );
@@ -331,7 +319,6 @@ public slots:
void actionBinCPURegister_Inspector_triggered();
void actionBinCPURAM_Inspector_triggered();
void actionBinROM_Inspector_triggered();
void actionBinCartVRAMMemory_Inspector_triggered();
void actionBinNameTableNESMemory_Inspector_triggered();
void actionBinCHRMemory_Inspector_triggered();
void actionBinOAMMemory_Inspector_triggered();
@@ -351,8 +338,6 @@ public slots:
void actionBinSIDRegister_Inspector_triggered();
void on_actionCoding_Mode_triggered();
void on_actionDebugging_Mode_triggered();
private slots:
void on_actionManage_Add_Ons_triggered();
};
#endif // MAINWINDOW_H
Executable → Regular
+7 -30
View File
@@ -84,20 +84,11 @@
<property name="currentIndex">
<number>0</number>
</property>
<property name="iconSize">
<size>
<width>25</width>
<height>25</height>
</size>
</property>
<property name="elideMode">
<enum>Qt::ElideNone</enum>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
</property>
<property name="documentMode">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="tabsClosable">
<bool>true</bool>
@@ -105,10 +96,7 @@
<property name="movable">
<bool>true</bool>
</property>
<property name="tabBarAutoHide">
<bool>false</bool>
</property>
<widget class="QWidget" name="welcome">
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Welcome</string>
</attribute>
@@ -135,7 +123,7 @@
</property>
<property name="url" stdset="0">
<url>
<string>https://nesicide.com</string>
<string>about:blank</string>
</url>
</property>
</widget>
@@ -180,7 +168,6 @@
<addaction name="actionLoad_In_Emulator"/>
<addaction name="actionClean_Project"/>
<addaction name="separator"/>
<addaction name="actionManage_Add_Ons"/>
<addaction name="actionProject_Properties"/>
</widget>
<widget class="QMenu" name="menu_Help">
@@ -236,7 +223,6 @@
<addaction name="separator"/>
<addaction name="actionCoding_Mode"/>
<addaction name="actionDebugging_Mode"/>
<addaction name="separator"/>
</widget>
<addaction name="menuNESICIDE"/>
<addaction name="menuProject"/>
@@ -267,10 +253,8 @@
<addaction name="separator"/>
<addaction name="actionOpen_Project"/>
<addaction name="actionSave_Project"/>
<addaction name="action_Close_Project"/>
<addaction name="separator"/>
<addaction name="actionProject_Properties"/>
<addaction name="actionManage_Add_Ons"/>
<addaction name="action_Close_Project"/>
</widget>
<widget class="QToolBar" name="compilerToolbar">
<property name="sizePolicy">
@@ -288,9 +272,9 @@
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="actionClean_Project"/>
<addaction name="actionCompile_Project"/>
<addaction name="actionLoad_In_Emulator"/>
<addaction name="actionClean_Project"/>
<addaction name="separator"/>
</widget>
<widget class="QToolBar" name="toolToolbar">
@@ -307,6 +291,7 @@
<addaction name="separator"/>
<addaction name="actionOutput_Window"/>
<addaction name="separator"/>
<addaction name="actionProject_Properties"/>
</widget>
<widget class="QStatusBar" name="appStatusBar">
<property name="sizeGripEnabled">
@@ -593,15 +578,6 @@
<string>Ctrl+Shift+D</string>
</property>
</action>
<action name="actionManage_Add_Ons">
<property name="icon">
<iconset resource="../../common/resource.qrc">
<normaloff>:/resources/icons8-swiss_army_knife.png</normaloff>:/resources/icons8-swiss_army_knife.png</iconset>
</property>
<property name="text">
<string>Manage Add-Ons...</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
@@ -614,6 +590,7 @@
</customwidgets>
<resources>
<include location="../../common/resource.qrc"/>
<include location="../../common/resource.qrc"/>
</resources>
<connections>
<connection>
+1 -1
View File
@@ -42,7 +42,7 @@ CProjectModel::CProjectModel()
QObject::connect(m_pTileStampModel, SIGNAL(tileStampAdded(QUuid)), this, SLOT(onItemAdded(QUuid)));
QObject::connect(m_pTileStampModel, SIGNAL(tileStampRemoved(QUuid)), this, SLOT(onItemRemoved(QUuid)));
QObject::connect(m_pMusicModel, SIGNAL(musicFileAdded(QUuid)), this, SLOT(onItemAdded(QUuid)));
QObject::connect(m_pMusicModel, SIGNAL(musicFileRemoved(QUuid)), this, SLOT(onItemRemoved(QUuid)));
QObject::connect(m_pMusicModel, SIGNAL(musicFileDeleted(QUuid)), this, SLOT(onItemRemoved(QUuid)));
}
CProjectModel::~CProjectModel()
-19
View File
@@ -2,7 +2,6 @@
#include "model/csourcefilemodel.h"
#include "model/projectsearcher.h"
#include "cnesicideproject.h"
#include "filepropertiesdialog.h"
CSourceFileModel::CSourceFileModel()
: CSubModel()
@@ -35,24 +34,6 @@ QUuid CSourceFileModel::addExistingSourceFile(const QString &path)
return file->uuid();
}
void CSourceFileModel::fileProperties(const QUuid &uuid)
{
if (m_pNesicideProject == NULL)
return;
// Make sure item has correct type before doing anything.
CSourceItem* item = ProjectSearcher::findItemByUuid<CSourceItem>(m_pNesicideProject, uuid);
if (item == NULL)
return;
FilePropertiesDialog fpd(item);
int ret = fpd.exec();
if ( ret == QDialog::Accepted )
{
m_pNesicideProject->setDirty(true);
}
}
void CSourceFileModel::removeSourceFile(const QUuid &uuid)
{
if (m_pNesicideProject == NULL)
-3
View File
@@ -21,9 +21,6 @@ public:
// Remove a source file from the project.
void removeSourceFile(const QUuid& uuid);
// Properties handler.
void fileProperties(const QUuid& uuid);
QList<QUuid> getUuids() const;
QString getName(const QUuid &uuid) const;
+1 -1
View File
@@ -20,7 +20,7 @@ public:
virtual QList<QUuid> getUuids() const=0;
// Get the name of an object.
virtual QString getName(const QUuid&) const=0;
virtual QString getName(const QUuid&)const=0;
// Workaround methods.
virtual CDesignerEditorBase* createEditorWidget(const QUuid& uuid) const=0;
+1
View File
@@ -56,6 +56,7 @@ QList<T*> findItemsOfType(CNesicideProject* project)
return items;
}
template<class T>
T* findItemByUuid(CNesicideProject* project, const QUuid& uuid)
{
+6 -6
View File
@@ -16,9 +16,9 @@ void CCartridgeBuilder::clean()
buildTextLogger->erase();
buildTextLogger->write("<b>Project build started.</b>");
if ( (CCC65Interface::instance()->getCLanguageSourcesFromProject().count()) ||
(CCC65Interface::instance()->getAssemblerSourcesFromProject().count()) ||
(CCC65Interface::instance()->getCustomSourcesFromProject().count()) )
if ( (CCC65Interface::getCLanguageSourcesFromProject().count()) ||
(CCC65Interface::getAssemblerSourcesFromProject().count()) ||
(CCC65Interface::getCustomSourcesFromProject().count()) )
{
sourceAssembler.clean();
graphicsAssembler.clean();
@@ -82,9 +82,9 @@ bool CCartridgeBuilder::build()
buildTextLogger->erase();
buildTextLogger->write("<b>Project build started.</b>");
if ( (CCC65Interface::instance()->getCLanguageSourcesFromProject().count()) ||
(CCC65Interface::instance()->getAssemblerSourcesFromProject().count()) ||
(CCC65Interface::instance()->getCustomSourcesFromProject().count()) )
if ( (CCC65Interface::getCLanguageSourcesFromProject().count()) ||
(CCC65Interface::getAssemblerSourcesFromProject().count()) ||
(CCC65Interface::getCustomSourcesFromProject().count()) )
{
if ( !nesicideProject->getLinkerConfigFile().isEmpty() )
{
@@ -21,11 +21,11 @@ APUInformationDockWidget::~APUInformationDockWidget()
void APUInformationDockWidget::updateTargetMachine(QString /*target*/)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::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* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateInformation()) );
}
@@ -45,14 +45,14 @@ void APUInformationDockWidget::changeEvent(QEvent* e)
void APUInformationDockWidget::showEvent(QShowEvent* /*e*/)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::connect ( emulator, SIGNAL(updateDebuggers()), this, SLOT(updateInformation()) );
updateInformation();
}
void APUInformationDockWidget::hideEvent(QHideEvent* /*e*/)
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::disconnect ( emulator, SIGNAL(updateDebuggers()), this, SLOT(updateInformation()) );
}
+42 -45
View File
@@ -12,56 +12,55 @@ CHRROMDisplayDialog::CHRROMDisplayDialog(bool usePPU,qint8* data,IProjectTreeVie
CDesignerEditorBase(link,parent),
ui(new Ui::CHRROMDisplayDialog)
{
int i;
ui->setupUi(this);
info = new QLabel(this);
imgData = new char[256*256*4];
// Clear image...
for ( i = 0; i < 256*256*4; i+=4 )
{
imgData[i] = 0;
imgData[i+1] = 0;
imgData[i+2] = 0;
imgData[i+3] = 0xFF;
}
m_usePPU = usePPU;
imgData = new int8_t[256*128*4];
memset(imgData,0,sizeof(imgData));
renderer = new PanZoomRenderer(256,128,2000,imgData,true,ui->frame);
ui->frame->layout()->addWidget(renderer);
ui->frame->layout()->update();
setCentralWidget(ui->window);
int i;
for ( i = 3; i < (256*128*4); i += 4 )
{
imgData[i] = 0xff;
}
QObject::connect(renderer,SIGNAL(repaintNeeded()),this,SLOT(repaintNeeded()));
if ( m_usePPU )
{
setCentralWidget(ui->window);
RENDERCHRMEM();
CPPUDBG::CHRMEMInspectorTV ( (int8_t*)imgData );
CPPUDBG::SetCHRMEMInspectorColor(0,renderer->getColor(0));
CPPUDBG::SetCHRMEMInspectorColor(1,renderer->getColor(1));
CPPUDBG::SetCHRMEMInspectorColor(2,renderer->getColor(2));
CPPUDBG::SetCHRMEMInspectorColor(3,renderer->getColor(3));
renderer = new PanZoomRenderer(256,128,2000,CHRMEMTV(),true,ui->frame);
SetCHRMEMInspectorColor(0,renderer->getColor(0));
SetCHRMEMInspectorColor(1,renderer->getColor(1));
SetCHRMEMInspectorColor(2,renderer->getColor(2));
SetCHRMEMInspectorColor(3,renderer->getColor(3));
pThread = new DebuggerUpdateThread(&RENDERCHRMEM);
pThread = new DebuggerUpdateThread(&CPPUDBG::RENDERCHRMEM);
QObject::connect(pThread,SIGNAL(updateComplete()),this,SLOT(renderData()));
}
else
{
// show CHR-ROM bank data...
setCentralWidget(ui->windowEx);
memcpy(chrrom,data,MEM_8KB);
renderer = new PanZoomRenderer(256,128,2000,imgData,true,ui->frame);
renderData();
// No thread necessary.
pThread = NULL;
// show CHR-ROM bank data...
memcpy(chrrom,data,MEM_8KB);
renderData();
}
ui->frame->layout()->addWidget(renderer);
ui->frame->layout()->update();
renderer->installEventFilter(this);
QObject::connect(renderer,SIGNAL(repaintNeeded()),this,SLOT(repaintNeeded()));
ui->updateScanline->setText ( "0" );
}
@@ -75,11 +74,8 @@ CHRROMDisplayDialog::~CHRROMDisplayDialog()
{
delete pThread;
}
else
{
delete imgData;
}
delete ui;
delete imgData;
delete renderer;
}
@@ -87,8 +83,8 @@ void CHRROMDisplayDialog::updateTargetMachine(QString /*target*/)
{
if ( m_usePPU )
{
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
@@ -101,7 +97,7 @@ void CHRROMDisplayDialog::showEvent(QShowEvent* /*event*/)
{
if ( m_usePPU )
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::connect(emulator,SIGNAL(updateDebuggers()),pThread,SLOT(updateDebuggers()));
@@ -114,7 +110,7 @@ void CHRROMDisplayDialog::hideEvent(QHideEvent* /*event*/)
{
if ( m_usePPU )
{
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
QObject* emulator = CObjectRegistry::getObject("Emulator");
QObject::disconnect(emulator,SIGNAL(updateDebuggers()),pThread,SLOT(updateDebuggers()));
}
@@ -215,10 +211,10 @@ void CHRROMDisplayDialog::updateInfoText(int x, int y)
side = 0;
}
str.sprintf("Pixel(%d,%d) Tile(%d,%d) $%04X",
str.sprintf("Cursor:Pixel(%d,%d) Tile(%d,%d) %s",
x,y,
tileX,tileY,
(side*0x1000)+(((tileY*16)+tileX)<<4));
sideStr[side]);
info->setText(str);
}
@@ -232,10 +228,10 @@ void CHRROMDisplayDialog::repaintNeeded()
{
if ( m_usePPU )
{
SetCHRMEMInspectorColor(0,renderer->getColor(0));
SetCHRMEMInspectorColor(1,renderer->getColor(1));
SetCHRMEMInspectorColor(2,renderer->getColor(2));
SetCHRMEMInspectorColor(3,renderer->getColor(3));
CPPUDBG::SetCHRMEMInspectorColor(0,renderer->getColor(0));
CPPUDBG::SetCHRMEMInspectorColor(1,renderer->getColor(1));
CPPUDBG::SetCHRMEMInspectorColor(2,renderer->getColor(2));
CPPUDBG::SetCHRMEMInspectorColor(3,renderer->getColor(3));
pThread->updateDebuggers();
}
@@ -256,7 +252,7 @@ void CHRROMDisplayDialog::renderData()
if ( m_usePPU )
{
renderer->reloadData(CHRMEMTV());
renderer->reloadData(imgData);
}
else
{
@@ -270,6 +266,7 @@ void CHRROMDisplayDialog::renderData()
for (int x = 0; x < 256; x += 8)
{
ppuAddr = ((y>>3)<<8)+((x%128)<<1)+(y&0x7);
if ( x >= 128 )
{
ppuAddr += 0x1000;
@@ -295,7 +292,7 @@ void CHRROMDisplayDialog::renderData()
void CHRROMDisplayDialog::on_updateScanline_editingFinished()
{
SetPPUViewerScanline ( ui->updateScanline->text().toInt() );
CPPUDBG::SetPPUViewerScanline ( ui->updateScanline->text().toInt() );
}
void CHRROMDisplayDialog::on_exportPushButton_clicked()
+2 -1
View File
@@ -40,10 +40,11 @@ protected:
private:
Ui::CHRROMDisplayDialog* ui;
QLabel* info;
int8_t* imgData;
char* imgData;
bool m_usePPU;
DebuggerUpdateThread* pThread;
PanZoomRenderer* renderer;
QPoint pressPos;
public slots:
void renderData();
+60 -96
View File
@@ -6,121 +6,85 @@
<rect>
<x>0</x>
<y>0</y>
<width>581</width>
<height>335</height>
<width>544</width>
<height>226</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QFrame" name="windowEx">
<widget class="QFrame" name="window">
<property name="geometry">
<rect>
<x>12</x>
<y>12</y>
<width>561</width>
<height>311</height>
<x>0</x>
<y>0</y>
<width>511</width>
<height>181</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_1">
<property name="leftMargin">
<number>12</number>
<property name="lineWidth">
<number>0</number>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="topMargin">
<number>12</number>
<property name="verticalSpacing">
<number>0</number>
</property>
<property name="rightMargin">
<number>12</number>
<property name="margin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="window">
<property name="lineWidth">
<item row="1" column="1">
<widget class="QLineEdit" name="updateScanline"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Update on scanline:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="exportPushButton">
<property name="text">
<string> Export... </string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout_5">
<property name="spacing">
<number>0</number>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="1" column="1">
<widget class="QLineEdit" name="updateScanline"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Update on scanline:</string>
<item row="0" column="0" colspan="2">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="margin">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="exportPushButton">
<property name="text">
<string> Export... </string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout_5">
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
</layout>
</widget>

Some files were not shown because too many files have changed in this diff Show More