Compare commits
178 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c90fc041d8 | |||
| 3cb0fa530d | |||
| 91a5f7dd4d | |||
| 7268bf4105 | |||
| c6ab6c4484 | |||
| 922443e6b5 | |||
| efbfe88481 | |||
| 65145818ef | |||
| 993e4f2120 | |||
| 05b5ab3a0c | |||
| 14c32d601e | |||
| 1d9aeed278 | |||
| 2d559eb758 | |||
| 34a7fa6c47 | |||
| a6ad4f03cc | |||
| 90b45b1e84 | |||
| a49a424948 | |||
| 10320371bf | |||
| c79728bacf | |||
| 1495f180b2 | |||
| b4ff3db93d | |||
| 378b4cfbaf | |||
| c8d2d7df3c | |||
| b32203c69e | |||
| abeb54439a | |||
| da6eef757d | |||
| c1cab1b53b | |||
| 1ef7979eda | |||
| b3510eb5b9 | |||
| b9c61d4d75 | |||
| f5a9d131bb | |||
| 563a4d307b | |||
| cc33e59ff3 | |||
| 95f1e9009b | |||
| 6bf0cefdac | |||
| 9c133a6612 | |||
| efad631cd4 | |||
| bec5296b88 | |||
| a5ad5670e1 | |||
| a0fbc8c7e5 | |||
| 0edd5e0085 | |||
| c9c374df9d | |||
| 96fb970da8 | |||
| 2e272cfbe9 | |||
| ea3434b3d7 | |||
| 9ac2faa5cd | |||
| daea5b382a | |||
| 08b94785bd | |||
| 2f8dfac102 | |||
| b6317ea75c | |||
| 3d7a513d89 | |||
| 010ca8be62 | |||
| 775229a034 | |||
| 59d6297a4f | |||
| 616816037d | |||
| 9583c4c066 | |||
| 93df42983a | |||
| fb13cb7370 | |||
| 3a9d7ef9c1 | |||
| 6a90008a28 | |||
| 5a77459b84 | |||
| 89d4399bfe | |||
| 2dbceb9522 | |||
| 1a18cc50ba | |||
| 6453014b95 | |||
| 3c5a029598 | |||
| 76591dad18 | |||
| 91357d099c | |||
| 80b78a300a | |||
| 65f0da89d4 | |||
| 889e2bab1f | |||
| 6063181cb4 | |||
| 1afe2ebc67 | |||
| 0351d0df82 | |||
| c478a0340c | |||
| 017f1fe697 | |||
| 5a9e6f1f31 | |||
| 6b03be7d14 | |||
| a8a615b574 | |||
| 00276e893b | |||
| 5d7ecfc55a | |||
| f9eb913515 | |||
| 53d29d6d31 | |||
| fd0891c0cb | |||
| d01880ae99 | |||
| b1def98876 | |||
| 0a0f8032b6 | |||
| 7a42520a07 | |||
| 3ea4fa77d4 | |||
| 5593b9cf94 | |||
| b174b7d4c0 | |||
| 15a4bb5586 | |||
| 74b265ca93 | |||
| 7d4c0bed1b | |||
| c584252a21 | |||
| aac587ce83 | |||
| e6eed7f5f5 | |||
| 304ccfda40 | |||
| d87420ed00 | |||
| 68a9046584 | |||
| d7662ddc2f | |||
| 1a18c2616f | |||
| 522e55fee7 | |||
| 654987c9a7 | |||
| 1c144fc5a8 | |||
| 3cb26c33bf | |||
| c22439189f | |||
| 92984655e1 | |||
| 9462d2d5f8 | |||
| a9f16afb39 | |||
| 4f84d6eb85 | |||
| 5be35f16fd | |||
| 53f25b10aa | |||
| e03cd8d02e | |||
| c086d5afc6 | |||
| b7731c7c6c | |||
| f6d63c6429 | |||
| c7c45c2807 | |||
| 38afc3b3af | |||
| e895a2a4dd | |||
| 399085bd8e | |||
| b1b835b01e | |||
| e0fab989c5 | |||
| b37a60130b | |||
| b255e353ff | |||
| 140c8a499f | |||
| a31beb3407 | |||
| a6265fc929 | |||
| 5d05c76bdb | |||
| bc974dd87b | |||
| c07d5e5501 | |||
| 89b35692fb | |||
| b08ba30a1c | |||
| 9202930944 | |||
| 912d8342d9 | |||
| 23f147b1ff | |||
| b191e71a20 | |||
| 6b75497f38 | |||
| 4a3f9df322 | |||
| d040b48c5a | |||
| c08c0bbfbd | |||
| 70b5e502cc | |||
| 2777f2cc15 | |||
| 031509868f | |||
| 97def918a3 | |||
| c49c7c8728 | |||
| 0b3b188070 | |||
| 61dac3dc6d | |||
| 80ea58e768 | |||
| fd84c3fe51 | |||
| 8008e4e6f2 | |||
| 34dec59103 | |||
| 78091204d3 | |||
| 254a1d47f9 | |||
| 841bbb9477 | |||
| 3cf3526c96 | |||
| a22483f227 | |||
| a0f1126abd | |||
| acb6cdd249 | |||
| 34407c9e43 | |||
| 331ff1b07b | |||
| ec7987eecb | |||
| aed6f8587d | |||
| 5e27e24c7d | |||
| 5f7615db41 | |||
| f03bfce077 | |||
| b25344dca1 | |||
| 89313ab766 | |||
| 3e6aa3b84f | |||
| 220e141bbc | |||
| 3bca4ca747 | |||
| 71f4e04eb1 | |||
| d44518df47 | |||
| b3aedbe0d8 | |||
| 9a07129b8c | |||
| d1d816c3f0 | |||
| d146f50dbc | |||
| afd3c543f4 |
+18
-17
@@ -1,16 +1,13 @@
|
||||
version: 1.0.{build}
|
||||
image: Visual Studio 2017
|
||||
platform: x64
|
||||
|
||||
branches:
|
||||
only:
|
||||
- appveyor
|
||||
|
||||
- master
|
||||
skip_tags: true
|
||||
environment:
|
||||
QTDIR: C:\Qt\5.11\mingw53_32
|
||||
|
||||
skip_tags: true
|
||||
|
||||
hosts:
|
||||
phrenetic: 162.243.126.83
|
||||
|
||||
@@ -28,15 +25,19 @@ build_script:
|
||||
|
||||
bash ./build/windows-deploy.sh local
|
||||
test: off
|
||||
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
|
||||
#
|
||||
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
|
||||
|
||||
+1
-6
@@ -12,9 +12,7 @@ moc_*
|
||||
*.moc
|
||||
qrc_*
|
||||
*.exe
|
||||
Makefile.Debug
|
||||
Makefile
|
||||
Makefile.Release
|
||||
**/Makefile*
|
||||
*/.directory
|
||||
deps/
|
||||
compiler/lex.asm.c
|
||||
@@ -39,6 +37,3 @@ rcParser*
|
||||
rcVisitor*
|
||||
rcListener*
|
||||
/build/nesicide-deps.tar.bz2
|
||||
|
||||
/apps/famitracker/Makefile*
|
||||
/libs/famitracker/Makefile*
|
||||
|
||||
+6
-1
@@ -1,16 +1,21 @@
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
osx_image: xcode10.1
|
||||
osx_image: xcode11.3
|
||||
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:
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
nesicide is an Integrated Development Environment (IDE) for the 8-bit Nintendo Entertainment System (NES).
|
||||
|
||||
This project contains:
|
||||
## Products in Project
|
||||
|
||||
This project contains the following products:
|
||||
|
||||
* NESICIDE (the IDE itself)
|
||||
* A NES emulator (standalone package of the emulator used in the IDE)
|
||||
@@ -14,12 +16,19 @@ This project contains:
|
||||
The following steps are required prior to building this project on any platform.
|
||||
|
||||
0. Install `git`
|
||||
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.
|
||||
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
|
||||
```
|
||||
|
||||
### Debian prerequisites
|
||||
|
||||
```sh
|
||||
sudo apt-get install build-essential libasound2-dev liblua5.1-dev libsdl1.2-dev libgl1-mesa-dev wine-dev
|
||||
sudo apt-get install qtchooser build-essential libasound2-dev liblua5.1-dev libsdl1.2-dev libgl1-mesa-dev
|
||||
```
|
||||
|
||||
### Arch Linux prerequisites
|
||||
@@ -36,32 +45,45 @@ 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. `cd build`
|
||||
1. `./build.sh`
|
||||
2. Once the build process is complete run: `./linux-deploy.sh`
|
||||
0. `./build/linux-build.sh`
|
||||
1. `./build/linux-deploy.sh local`
|
||||
|
||||
### macOS
|
||||
|
||||
0. `cd build`
|
||||
1. `./build.sh`
|
||||
2. Once the build process is complete run: `./osx-deploy.sh`
|
||||
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`
|
||||
|
||||
### 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.
|
||||
|
||||
1. `./win-build.sh`
|
||||
|
||||
2. Once the build process is complete run: `./win-deploy.sh`
|
||||
0. `./build/windows-build.sh`
|
||||
1. `./build/windows-deploy.sh local`
|
||||
|
||||
## Running
|
||||
|
||||
The `deploy.sh` creates a tarball containing all of the executables and dependent libraries. Extract the tarball to your location of choice and execute.
|
||||
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.
|
||||
|
||||
Enjoy!
|
||||
|
||||
@@ -22,26 +22,41 @@
|
||||
The following items are being tracked here because otherwise they'd be forgotten:
|
||||
|
||||
- [x] Add folders to project panel and support loading different file types (headers, etc.)
|
||||
- [x] Finish Code Editor lexer for syntax highlights.
|
||||
- [ ] 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.
|
||||
- [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).
|
||||
- [ ] Figure out how to adjust lines of errors, breakpoints, and symbol lookups...probably have to do background compilation.
|
||||
- [ ] Extend drag-drop capability to allow adding source files (use specified extensions to check) to a project.
|
||||
- [x] Project still does not get cleared out properly when a ROM is loaded after a project has been loaded. Saving the "project" overwrites it with crap.
|
||||
- [x] Execution Visualizer doesn't open file for address that's clicked on and doesn't bring that file to view in the project.
|
||||
- [x] Somehow tabs aren't being removed from the Window menu.
|
||||
- [ ] 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
|
||||
|
||||
Regular → Executable
+6
-7
@@ -13,7 +13,7 @@ greaterThan(QT_MAJOR_VERSION,4) {
|
||||
TOP = ../..
|
||||
|
||||
macx {
|
||||
QMAKE_MAC_SDK = macosx10.14
|
||||
QMAKE_MAC_SDK = macosx10.15
|
||||
}
|
||||
|
||||
CONFIG(release, debug|release) {
|
||||
@@ -55,12 +55,11 @@ FAMITRACKER_CXXFLAGS = -I$$TOP/libs/famitracker
|
||||
RTMIDI_LIBS = -L$$DEPENDENCYROOTPATH/rtmidi/$$DESTDIR -lrtmidi
|
||||
|
||||
win32 {
|
||||
# contains(QT_ARCH, i386) {
|
||||
# arch = x86
|
||||
# } else {
|
||||
# arch = x64
|
||||
# }
|
||||
arch = x86
|
||||
contains(QT_ARCH, i386) {
|
||||
arch = x86
|
||||
} else {
|
||||
arch = x64
|
||||
}
|
||||
|
||||
SDL_CXXFLAGS = -I$$DEPENDENCYPATH/SDL
|
||||
SDL_LIBS = -L$$DEPENDENCYPATH/SDL/$$arch -lsdl
|
||||
|
||||
Regular → Executable
+8
-9
@@ -14,7 +14,7 @@ greaterThan(QT_MAJOR_VERSION,4) {
|
||||
TOP = ../..
|
||||
|
||||
macx {
|
||||
QMAKE_MAC_SDK = macosx10.14
|
||||
QMAKE_MAC_SDK = macosx10.15
|
||||
}
|
||||
|
||||
CONFIG(release, debug|release) {
|
||||
@@ -57,12 +57,11 @@ 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
|
||||
# }
|
||||
arch = x86
|
||||
contains(QT_ARCH, i386) {
|
||||
arch = x86
|
||||
} else {
|
||||
arch = x64
|
||||
}
|
||||
|
||||
SDL_CXXFLAGS = -I$$DEPENDENCYPATH/SDL
|
||||
SDL_LIBS = -L$$DEPENDENCYPATH/SDL/$$arch -lsdl
|
||||
@@ -135,8 +134,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 += \
|
||||
|
||||
@@ -27,7 +27,7 @@ private:
|
||||
Ui::MainWindow *ui;
|
||||
bool _initialized;
|
||||
|
||||
private slots:
|
||||
public slots:
|
||||
void addToolBarWidget(QToolBar* toolBar);
|
||||
void removeToolBarWidget(QToolBar* toolBar);
|
||||
void editor_modificationChanged(bool m);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<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>
|
||||
@@ -0,0 +1,18 @@
|
||||
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
|
||||
@@ -0,0 +1,5 @@
|
||||
<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
|
||||
@@ -0,0 +1,10 @@
|
||||
;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::getCLanguageSourcesFromProject().count()) ||
|
||||
(CCC65Interface::getAssemblerSourcesFromProject().count()) ||
|
||||
(CCC65Interface::getCustomSourcesFromProject().count()) )
|
||||
if ( (CCC65Interface::instance()->getCLanguageSourcesFromProject().count()) ||
|
||||
(CCC65Interface::instance()->getAssemblerSourcesFromProject().count()) ||
|
||||
(CCC65Interface::instance()->getCustomSourcesFromProject().count()) )
|
||||
{
|
||||
sourceAssembler.clean();
|
||||
}
|
||||
@@ -37,9 +37,9 @@ bool CMachineImageBuilder::build()
|
||||
buildTextLogger->erase();
|
||||
buildTextLogger->write("<b>Project build started.</b>");
|
||||
|
||||
if ( (CCC65Interface::getCLanguageSourcesFromProject().count()) ||
|
||||
(CCC65Interface::getAssemblerSourcesFromProject().count()) ||
|
||||
(CCC65Interface::getCustomSourcesFromProject().count()) )
|
||||
if ( (CCC65Interface::instance()->getCLanguageSourcesFromProject().count()) ||
|
||||
(CCC65Interface::instance()->getAssemblerSourcesFromProject().count()) ||
|
||||
(CCC65Interface::instance()->getCustomSourcesFromProject().count()) )
|
||||
{
|
||||
if ( !nesicideProject->getLinkerConfigFile().isEmpty() )
|
||||
{
|
||||
|
||||
@@ -16,8 +16,8 @@ C64EmulatorControl::C64EmulatorControl(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->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::isBuildUpToDate();
|
||||
CCC65Interface::instance()->isBuildUpToDate();
|
||||
|
||||
emit startEmulation();
|
||||
}
|
||||
@@ -110,28 +110,28 @@ void C64EmulatorControl::on_pauseButton_clicked()
|
||||
|
||||
void C64EmulatorControl::on_stepCPUButton_clicked()
|
||||
{
|
||||
CCC65Interface::isBuildUpToDate();
|
||||
CCC65Interface::instance()->isBuildUpToDate();
|
||||
|
||||
emit stepCPUEmulation();
|
||||
}
|
||||
|
||||
void C64EmulatorControl::on_resetButton_clicked()
|
||||
{
|
||||
CCC65Interface::isBuildUpToDate();
|
||||
CCC65Interface::instance()->isBuildUpToDate();
|
||||
|
||||
emit resetEmulator();
|
||||
}
|
||||
|
||||
void C64EmulatorControl::on_stepOverButton_clicked()
|
||||
{
|
||||
CCC65Interface::isBuildUpToDate();
|
||||
CCC65Interface::instance()->isBuildUpToDate();
|
||||
|
||||
emit stepOverCPUEmulation();
|
||||
}
|
||||
|
||||
void C64EmulatorControl::on_stepOutButton_clicked()
|
||||
{
|
||||
CCC65Interface::isBuildUpToDate();
|
||||
CCC65Interface::instance()->isBuildUpToDate();
|
||||
|
||||
emit stepOutCPUEmulation();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
static void breakpointHook ( void )
|
||||
{
|
||||
// Tell the world.
|
||||
C64EmulatorThread* emulator = dynamic_cast<C64EmulatorThread*>(CObjectRegistry::getObject("Emulator"));
|
||||
C64EmulatorThread* emulator = dynamic_cast<C64EmulatorThread*>(CObjectRegistry::instance()->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::getObject("Breakpoint Watcher"));
|
||||
BreakpointWatcherThread* breakpointWatcher = dynamic_cast<BreakpointWatcherThread*>(CObjectRegistry::instance()->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::getSegmentBase("STARTUP");
|
||||
addr = CCC65Interface::instance()->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 = c64GetAbsoluteAddressFromAddress(addr);
|
||||
endAddr = CCC65Interface::getEndAddressFromAbsoluteAddress(addr,absAddr);
|
||||
absAddr = c64GetPhysicalAddressFromAddress(addr);
|
||||
endAddr = CCC65Interface::instance()->getEndAddressFromPhysicalAddress(addr,absAddr);
|
||||
|
||||
if ( endAddr != 0xFFFFFFFF )
|
||||
{
|
||||
// Find the last opcode in the C-statement.
|
||||
for ( ; endAddr > absAddr; endAddr-- )
|
||||
{
|
||||
if ( CCC65Interface::isAbsoluteAddressAnOpcode(endAddr) )
|
||||
if ( CCC65Interface::instance()->isPhysicalAddressAnOpcode(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 = c64GetAbsoluteAddressFromAddress(addr);
|
||||
endAddr = CCC65Interface::getEndAddressFromAbsoluteAddress(addr,absAddr);
|
||||
absAddr = c64GetPhysicalAddressFromAddress(addr);
|
||||
endAddr = CCC65Interface::instance()->getEndAddressFromPhysicalAddress(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 = c64GetAbsoluteAddressFromAddress(endAddr-2);
|
||||
isInstr = CCC65Interface::isAbsoluteAddressAnOpcode(instAbsAddr);
|
||||
instAbsAddr = c64GetPhysicalAddressFromAddress(endAddr-2);
|
||||
isInstr = CCC65Interface::instance()->isPhysicalAddressAnOpcode(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::isAbsoluteAddressAnOpcode(a) )
|
||||
if ( CCC65Interface::instance()->isPhysicalAddressAnOpcode(a) )
|
||||
{
|
||||
c64SetOpcodeMask(a,1);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
#include "cdockwidgetregistry.h"
|
||||
|
||||
QHash<QString,CDockWidgetRegistry::CDockWidgetManager*> CDockWidgetRegistry::widgets;
|
||||
#include <QSettings>
|
||||
|
||||
CDockWidgetRegistry *CDockWidgetRegistry::_instance = NULL;
|
||||
|
||||
CDockWidgetRegistry::CDockWidgetRegistry()
|
||||
{
|
||||
mutex = new QMutex(QMutex::Recursive);
|
||||
}
|
||||
|
||||
QWidget* CDockWidgetRegistry::getWidget(const QString& name)
|
||||
{
|
||||
QWidget* widget = NULL;
|
||||
mutex->lock();
|
||||
if ( widgets.contains(name) )
|
||||
{
|
||||
return widgets[name]->widget;
|
||||
widget = widgets[name]->widget;
|
||||
}
|
||||
mutex->unlock();
|
||||
|
||||
return 0;
|
||||
return widget;
|
||||
}
|
||||
|
||||
void CDockWidgetRegistry::addWidget(const QString& name, QWidget* widget, bool visible, bool permanent)
|
||||
@@ -20,18 +30,23 @@ 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 )
|
||||
@@ -40,32 +55,50 @@ 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)
|
||||
{
|
||||
i.value()->visible = i.value()->widget->isVisible();
|
||||
settings.setValue(i.value()->widget->objectName(),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 ( i.value()->visible )
|
||||
if ( settings.value(i.value()->widget->objectName()).toBool() )
|
||||
{
|
||||
i.value()->widget->show();
|
||||
}
|
||||
}
|
||||
|
||||
mutex->unlock();
|
||||
}
|
||||
|
||||
bool CDockWidgetRegistry::visible(const QString& name)
|
||||
{
|
||||
return widgets.find(name).value()->visible;
|
||||
bool visible = false;
|
||||
|
||||
mutex->lock();
|
||||
visible = widgets.find(name).value()->visible;
|
||||
mutex->unlock();
|
||||
|
||||
return visible;
|
||||
}
|
||||
|
||||
@@ -4,10 +4,20 @@
|
||||
#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;
|
||||
@@ -15,20 +25,21 @@ public:
|
||||
bool enabled;
|
||||
bool permanent;
|
||||
} CDockWidgetManager;
|
||||
CDockWidgetRegistry() {};
|
||||
static QWidget* getWidget(const QString& name);
|
||||
static void addWidget(const QString& name,
|
||||
QWidget* getWidget(const QString& name);
|
||||
void addWidget(const QString& name,
|
||||
QWidget* widget,
|
||||
bool visible = false,
|
||||
bool permanent = false);
|
||||
static void removeWidget(const QString& name);
|
||||
static void hideAll();
|
||||
static void saveVisibility();
|
||||
static bool visible(const QString& name);
|
||||
static void restoreVisibility();
|
||||
void removeWidget(const QString& name);
|
||||
void hideAll();
|
||||
void saveVisibility();
|
||||
bool visible(const QString& name);
|
||||
void restoreVisibility();
|
||||
|
||||
private:
|
||||
static QHash<QString,CDockWidgetManager*> widgets;
|
||||
CDockWidgetRegistry();
|
||||
QHash<QString,CDockWidgetManager*> widgets;
|
||||
QMutex *mutex;
|
||||
};
|
||||
|
||||
#endif // CDOCKWIDGETREGISTRY_H
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "cdockwidgetregistry.h"
|
||||
#include "ccc65interface.h"
|
||||
|
||||
#include "model/projectsearcher.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include <QToolButton>
|
||||
@@ -13,6 +15,7 @@ CProjectTabWidget::CProjectTabWidget(QWidget *parent) :
|
||||
{
|
||||
tabBar()->installEventFilter(this);
|
||||
tabBar()->setMouseTracking(true);
|
||||
tabBar()->setVisible(EnvironmentSettingsDialog::useTabBarInEditorArea());
|
||||
}
|
||||
|
||||
bool CProjectTabWidget::eventFilter(QObject *object, QEvent *event)
|
||||
@@ -91,10 +94,10 @@ void CProjectTabWidget::tabBar_contextMenuEvent(QContextMenuEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
int CProjectTabWidget::addTab(QWidget *widget, const QIcon &/*icon*/, const QString &label)
|
||||
int CProjectTabWidget::addTab(QWidget *page, const QIcon &icon, const QString &label)
|
||||
{
|
||||
CDesignerEditorBase* editor = dynamic_cast<CDesignerEditorBase*>(widget);
|
||||
QDockWidget* codeBrowser = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Assembly Browser"));
|
||||
CDesignerEditorBase* editor = dynamic_cast<CDesignerEditorBase*>(page);
|
||||
QDockWidget* codeBrowser = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Assembly Browser"));
|
||||
QIcon myIcon;
|
||||
int tabIdx;
|
||||
|
||||
@@ -119,15 +122,23 @@ int CProjectTabWidget::addTab(QWidget *widget, const QIcon &/*icon*/, const QStr
|
||||
QObject::connect(this,SIGNAL(updateTargetMachine(QString)),editor,SLOT(updateTargetMachine(QString)));
|
||||
}
|
||||
|
||||
if ( editor && editor->treeLink() )
|
||||
{
|
||||
myIcon = editor->treeLink()->icon();
|
||||
}
|
||||
else
|
||||
{
|
||||
myIcon = QIcon(":/resources/add_file.png");
|
||||
}
|
||||
tabIdx = QTabWidget::addTab(widget,myIcon,label);
|
||||
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);
|
||||
|
||||
// QToolButton* closeButton = new QToolButton;
|
||||
// QStyle* closeButtonStyle = closeButton->style();
|
||||
@@ -142,9 +153,48 @@ int CProjectTabWidget::addTab(QWidget *widget, const QIcon &/*icon*/, const QStr
|
||||
return tabIdx;
|
||||
}
|
||||
|
||||
int CProjectTabWidget::addTab(QWidget *widget, const QString &label)
|
||||
void CProjectTabWidget::unDockTab()
|
||||
{
|
||||
return addTab(widget,QIcon(),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);
|
||||
}
|
||||
|
||||
void CProjectTabWidget::removeTab(int index)
|
||||
@@ -192,9 +242,7 @@ void CProjectTabWidget::snapToTab(QString item)
|
||||
QStringList splits;
|
||||
uint32_t addr;
|
||||
uint32_t absAddr;
|
||||
IProjectTreeViewItemIterator iter;
|
||||
IProjectTreeViewItem* treeItem;
|
||||
CSourceItem* pSource;
|
||||
QList<CSourceItem*> sources = ProjectSearcher::findItemsOfType<CSourceItem>(nesicideProject);
|
||||
bool found = false;
|
||||
bool open = false;
|
||||
QDir dir;
|
||||
@@ -225,17 +273,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 = CCC65Interface::getSourceFileFromAbsoluteAddress(addr,absAddr);
|
||||
file = QDir::cleanPath(CCC65Interface::instance()->getSourceFileFromPhysicalAddress(addr,absAddr));
|
||||
}
|
||||
else if ( item.startsWith("SourceNavigatorFile,") )
|
||||
{
|
||||
splits = item.split(QRegExp("[,]"));
|
||||
file = splits.at(1);
|
||||
file = QDir::cleanPath(splits.at(1));
|
||||
}
|
||||
else if ( item.startsWith("OutputPaneFile,") )
|
||||
{
|
||||
splits = item.split(QRegExp("[,]"));
|
||||
file = splits.at(1);
|
||||
file = QDir::cleanPath(splits.at(1));
|
||||
}
|
||||
else if ( item.startsWith("Tile,") )
|
||||
{
|
||||
@@ -256,9 +304,21 @@ 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 )
|
||||
{
|
||||
@@ -280,24 +340,29 @@ 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 )
|
||||
{
|
||||
iter.reset(nesicideProject->getProject()->getSources());
|
||||
while ( iter.current() )
|
||||
foreach ( CSourceItem* source, sources )
|
||||
{
|
||||
pSource = dynamic_cast<CSourceItem*>(iter.current());
|
||||
if ( pSource )
|
||||
if ( source->path() == file )
|
||||
{
|
||||
if ( pSource->path() == file )
|
||||
{
|
||||
pSource->openItemEvent(this);
|
||||
found = true;
|
||||
open = true;
|
||||
break;
|
||||
}
|
||||
source->openItemEvent(this);
|
||||
found = true;
|
||||
open = true;
|
||||
break;
|
||||
}
|
||||
iter.next();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,6 +402,17 @@ 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;
|
||||
@@ -350,7 +426,7 @@ void CProjectTabWidget::snapToTab(QString item)
|
||||
{
|
||||
QString str;
|
||||
str.sprintf("Locate %s...",file.toLatin1().constData());
|
||||
QString newDir = QFileDialog::getOpenFileName(0,str,QDir::currentPath());
|
||||
QString newDir = QFileDialog::getOpenFileName(0,str,QDir::currentPath(),QString(),NULL,QFileDialog::DontUseNativeDialog);
|
||||
if ( !newDir.isEmpty() )
|
||||
{
|
||||
QFileInfo fileInfo(newDir);
|
||||
@@ -423,6 +499,7 @@ void CProjectTabWidget::applyProjectProperties()
|
||||
|
||||
void CProjectTabWidget::applyEnvironmentSettings()
|
||||
{
|
||||
tabBar()->setVisible(EnvironmentSettingsDialog::useTabBarInEditorArea());
|
||||
emit applyEnvironmentSettingsToTab();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#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
|
||||
@@ -71,8 +72,8 @@ class CProjectTabWidget : public QTabWidget
|
||||
public:
|
||||
explicit CProjectTabWidget(QWidget *parent = 0);
|
||||
|
||||
int addTab(QWidget *widget, const QIcon &icon, const QString &label);
|
||||
int addTab(QWidget *widget, const QString &label);
|
||||
int addTab(QWidget *page, const QString &label);
|
||||
int addTab(QWidget *page, const QIcon &icon, const QString &label);
|
||||
void removeTab(int index);
|
||||
|
||||
protected:
|
||||
@@ -100,6 +101,8 @@ signals:
|
||||
void checkOpenFile(QDateTime lastActivationTime);
|
||||
|
||||
public slots:
|
||||
void unDockTab();
|
||||
void reDockTab();
|
||||
void checkOpenFiles(QDateTime lastActivationTime);
|
||||
void tabModified(bool modified);
|
||||
void projectDirtied(bool dirtied);
|
||||
@@ -108,6 +111,9 @@ public slots:
|
||||
void applyProjectProperties();
|
||||
void applyEnvironmentSettings();
|
||||
void applyAppSettings();
|
||||
|
||||
protected:
|
||||
QMap<QString,QWidget*> tearOffs;
|
||||
};
|
||||
|
||||
#endif // CPROJECTTABWIDGET_H
|
||||
|
||||
Regular → Executable
+47
-38
@@ -1,56 +1,62 @@
|
||||
#include "crendererbase.h"
|
||||
|
||||
CRendererBase::CRendererBase(int sizeX,int sizeY,int textureSizeXY,int maxZoom,char* imageData,QWidget *parent) :
|
||||
QGLWidget(parent),
|
||||
CRendererBase::CRendererBase(int sizeX,int sizeY,int textureSizeXY,int maxZoom,int8_t* imageData,QWidget *parent) :
|
||||
QOpenGLWidget(parent),
|
||||
_sizeX(sizeX),
|
||||
_trueSizeX(textureSizeXY),
|
||||
_sizeY(sizeY),
|
||||
_scrollX(0),
|
||||
_scrollY(0),
|
||||
_textureSizeXY(textureSizeXY),
|
||||
_imageData(imageData),
|
||||
_zoomFactor(100),
|
||||
_maxZoom(maxZoom)
|
||||
_maxZoom(maxZoom),
|
||||
_initialized(false)
|
||||
{
|
||||
setBackgroundRole(QPalette::Dark);
|
||||
|
||||
setCursor(QCursor(Qt::CrossCursor));
|
||||
|
||||
_imageData = imageData;
|
||||
}
|
||||
|
||||
CRendererBase::CRendererBase(int sizeX,int sizeY,int maxZoom,char* imageData,QWidget *parent) :
|
||||
QGLWidget(parent),
|
||||
CRendererBase::CRendererBase(int sizeX,int sizeY,int maxZoom,int8_t* imageData,QWidget *parent) :
|
||||
QOpenGLWidget(parent),
|
||||
_sizeX(sizeX),
|
||||
_trueSizeX(sizeX),
|
||||
_sizeY(sizeY),
|
||||
_scrollX(0),
|
||||
_scrollY(0),
|
||||
_imageData(imageData),
|
||||
_zoomFactor(100),
|
||||
_maxZoom(maxZoom)
|
||||
_maxZoom(maxZoom),
|
||||
_initialized(false)
|
||||
{
|
||||
setBackgroundRole(QPalette::Dark);
|
||||
|
||||
setCursor(QCursor(Qt::CrossCursor));
|
||||
|
||||
if ( _sizeX > sizeY )
|
||||
{
|
||||
_textureSizeXY = _sizeX;
|
||||
}
|
||||
else if ( _sizeY > sizeX )
|
||||
{
|
||||
_textureSizeXY = _sizeY;
|
||||
}
|
||||
else
|
||||
{
|
||||
_textureSizeXY = _sizeX;
|
||||
}
|
||||
_imageData = imageData;
|
||||
}
|
||||
|
||||
CRendererBase::~CRendererBase()
|
||||
{
|
||||
glDeleteTextures(1,(GLuint*)&_textureID);
|
||||
if ( _initialized )
|
||||
{
|
||||
glDeleteTextures(1,(GLuint*)&_textureID);
|
||||
}
|
||||
DeleteFunctions();
|
||||
}
|
||||
|
||||
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
|
||||
@@ -78,16 +84,14 @@ 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, _textureSizeXY);
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, _textureSizeXY);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, _trueSizeX);
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, _trueSizeX);
|
||||
|
||||
// Set our texture parameters
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
@@ -97,10 +101,12 @@ void CRendererBase::initializeGL()
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
|
||||
|
||||
// Load the actual texture
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, _textureSizeXY, _textureSizeXY, 0, GL_RGBA, GL_UNSIGNED_BYTE, _imageData);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, _sizeX, _sizeY, 0, GL_RGBA, GL_UNSIGNED_BYTE, _imageData);
|
||||
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
void CRendererBase::reloadData(char* imageData)
|
||||
void CRendererBase::reloadData(int8_t* imageData)
|
||||
{
|
||||
_imageData = imageData;
|
||||
|
||||
@@ -116,6 +122,8 @@ 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;
|
||||
|
||||
@@ -148,25 +156,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()
|
||||
{
|
||||
float scaleX = (float)_sizeX/(float)_textureSizeXY;
|
||||
float scaleY = (float)_sizeY/(float)_textureSizeXY;
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
QOpenGLWidget::paintGL();
|
||||
|
||||
glBindTexture (GL_TEXTURE_2D, _textureID);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _textureSizeXY, _textureSizeXY, GL_RGBA, GL_UNSIGNED_BYTE, _imageData);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _sizeX, _sizeY, GL_RGBA, GL_UNSIGNED_BYTE, _imageData);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f (0.0, 0.0);
|
||||
glVertex3f(000.0f - _scrollX, 000.0f - _scrollY, 0.0f);
|
||||
glTexCoord2f (scaleX, 0.0);
|
||||
glTexCoord2f (1.0, 0.0);
|
||||
glVertex3f(_sizeX - _scrollX, 000.0f - _scrollY, 0.0f);
|
||||
glTexCoord2f (scaleX, scaleY);
|
||||
glTexCoord2f (1.0, 1.0);
|
||||
glVertex3f(_sizeX - _scrollX, _sizeY - _scrollY, 0.0f);
|
||||
glTexCoord2f (0.0, scaleY);
|
||||
glTexCoord2f (0.0, 1.0);
|
||||
glVertex3f(000.0f - _scrollX, _sizeY - _scrollY, 0.0f);
|
||||
glEnd();
|
||||
}
|
||||
@@ -176,6 +184,7 @@ void CRendererBase::changeZoom(int newZoom)
|
||||
makeCurrent();
|
||||
_zoomFactor = newZoom;
|
||||
resizeGL(width(),height());
|
||||
doneCurrent();
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,41 +2,39 @@
|
||||
#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 QGLWidget
|
||||
class CRendererBase : public QOpenGLWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
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);
|
||||
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);
|
||||
virtual ~CRendererBase();
|
||||
|
||||
void initializeGL();
|
||||
void resizeGL(int width, int height);
|
||||
void paintGL();
|
||||
void changeZoom(int newZoom);
|
||||
void reloadData(char* imageData);
|
||||
void reloadData(int8_t* 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);
|
||||
|
||||
public slots:
|
||||
|
||||
protected:
|
||||
void DeleteFunctions() {delete(m_pFunctions); m_pFunctions = nullptr;}
|
||||
|
||||
QOpenGLFunctions * m_pFunctions = nullptr;
|
||||
int _sizeX;
|
||||
int _trueSizeX;
|
||||
int _sizeY;
|
||||
int _scrollX;
|
||||
int _scrollY;
|
||||
int _textureSizeXY;
|
||||
char* _imageData;
|
||||
bool _initialized;
|
||||
int8_t* _imageData;
|
||||
int _zoomFactor;
|
||||
int _maxZoom;
|
||||
GLuint _textureID;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "nes_emulator_core.h"
|
||||
|
||||
PanZoomRenderer::PanZoomRenderer(int sizeX,int sizeY,int textureSizeXY,int maxZoom,char* imageData,bool showPalette,QWidget *parent) :
|
||||
PanZoomRenderer::PanZoomRenderer(int sizeX,int sizeY,int textureSizeXY,int maxZoom,int8_t* 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,char* imageData,bool showPalette,QWidget *parent) :
|
||||
PanZoomRenderer::PanZoomRenderer(int sizeX,int sizeY,int maxZoom,int8_t* imageData,bool showPalette,QWidget *parent) :
|
||||
QWidget(parent),
|
||||
_sizeX(sizeX),
|
||||
_sizeY(sizeY),
|
||||
|
||||
@@ -14,11 +14,11 @@ class PanZoomRenderer : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
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);
|
||||
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);
|
||||
void commonConstructor(bool showPalette);
|
||||
virtual ~PanZoomRenderer();
|
||||
void reloadData(char* imageData) { renderer->reloadData(imageData); }
|
||||
void reloadData(int8_t* 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); }
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<width>782</width>
|
||||
<height>312</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
@@ -19,34 +19,49 @@
|
||||
<property name="widgetResizable" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<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">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<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>
|
||||
<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="Fixed" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -65,7 +80,7 @@
|
||||
<item>
|
||||
<widget class="QtColorPicker" name="col1PushButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -84,7 +99,7 @@
|
||||
<item>
|
||||
<widget class="QtColorPicker" name="col2PushButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -103,7 +118,7 @@
|
||||
<item>
|
||||
<widget class="QtColorPicker" name="col3PushButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -202,8 +217,8 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_3" rowstretch="1,0" columnstretch="1,0">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -221,6 +236,9 @@
|
||||
<property name="mouseTracking">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::StrongFocus</enum>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
@@ -231,7 +249,16 @@
|
||||
<number>1</number>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="margin">
|
||||
<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">
|
||||
|
||||
@@ -2,25 +2,16 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
SearcherThread::SearcherThread(QObject*)
|
||||
SearcherWorker::SearcherWorker(QObject*)
|
||||
{
|
||||
m_found = 0;
|
||||
|
||||
pThread = new QThread();
|
||||
|
||||
moveToThread(pThread);
|
||||
|
||||
pThread->start();
|
||||
}
|
||||
|
||||
SearcherThread::~SearcherThread()
|
||||
SearcherWorker::~SearcherWorker()
|
||||
{
|
||||
pThread->exit(0);
|
||||
pThread->wait();
|
||||
delete pThread;
|
||||
}
|
||||
|
||||
void SearcherThread::search(QDir dir, QString searchText, QString pattern, bool subfolders, bool sourceSearchPaths, bool useRegex, bool caseSensitive)
|
||||
void SearcherWorker::search(QDir dir, QString searchText, QString pattern, bool subfolders, bool sourceSearchPaths, bool useRegex, bool caseSensitive)
|
||||
{
|
||||
m_dir = dir;
|
||||
m_searchText = searchText;
|
||||
@@ -43,7 +34,7 @@ void SearcherThread::search(QDir dir, QString searchText, QString pattern, bool
|
||||
emit searchDone(m_found);
|
||||
}
|
||||
|
||||
void SearcherThread::doSearch(QDir dir,int* finds)
|
||||
void SearcherWorker::doSearch(QDir dir,int* finds)
|
||||
{
|
||||
QDir base(QDir::currentPath());
|
||||
QFileInfoList entries = dir.entryInfoList(QDir::AllDirs|QDir::NoDotAndDotDot|QDir::NoSymLinks|QDir::Files);
|
||||
@@ -98,3 +89,24 @@ void SearcherThread::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;
|
||||
}
|
||||
|
||||
@@ -5,22 +5,19 @@
|
||||
#include <QDir>
|
||||
#include <QSemaphore>
|
||||
|
||||
class SearcherThread : public QObject
|
||||
class SearcherWorker : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SearcherThread ( QObject* parent = 0 );
|
||||
virtual ~SearcherThread ();
|
||||
SearcherWorker ( QObject* parent = 0 );
|
||||
virtual ~SearcherWorker ();
|
||||
|
||||
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;
|
||||
@@ -33,4 +30,25 @@ 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
|
||||
|
||||
@@ -35,7 +35,7 @@ SearchWidget::SearchWidget(QWidget *parent) :
|
||||
ui->location->completer()->setCompletionMode(QCompleter::PopupCompletion);
|
||||
ui->type->completer()->setCompletionMode(QCompleter::PopupCompletion);
|
||||
|
||||
QObject* searcher = CObjectRegistry::getObject("Searcher");
|
||||
QObject* searcher = CObjectRegistry::instance()->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::getObject("Searcher"));
|
||||
SearcherThread* searcher = dynamic_cast<SearcherThread*>(CObjectRegistry::instance()->getObject("Searcher"));
|
||||
|
||||
if ( !ui->searchText->currentText().isEmpty() )
|
||||
{
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>559</width>
|
||||
<height>155</height>
|
||||
<width>758</width>
|
||||
<height>194</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -116,17 +116,16 @@
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="projectFolder">
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="find">
|
||||
<property name="text">
|
||||
<string>Limit search to Project folders</string>
|
||||
<string>Find...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="subfolders">
|
||||
<property name="text">
|
||||
<string>Include Subfolders</string>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -144,6 +143,13 @@
|
||||
</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">
|
||||
@@ -151,16 +157,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="find">
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="subfolders">
|
||||
<property name="text">
|
||||
<string>Find...</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
<string>Include Subfolders</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -22,8 +22,8 @@ SourceNavigator::SourceNavigator(QWidget *parent) :
|
||||
|
||||
m_loadedTarget = "none";
|
||||
|
||||
QObject* compiler = CObjectRegistry::getObject("Compiler");
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* compiler = CObjectRegistry::instance()->getObject("Compiler");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->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::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
m_loadedTarget = target;
|
||||
|
||||
@@ -60,7 +60,7 @@ void SourceNavigator::updateFiles(bool doIt)
|
||||
ui->files->clear();
|
||||
ui->symbols->clear();
|
||||
|
||||
QStringList files = CCC65Interface::getSourceFiles();
|
||||
QStringList files = CCC65Interface::instance()->getSourceFiles();
|
||||
ui->files->addItems(files);
|
||||
|
||||
if ( doIt )
|
||||
@@ -86,7 +86,7 @@ void SourceNavigator::updateSymbolsForFile(QString file)
|
||||
blockSignals(true);
|
||||
ui->symbols->clear();
|
||||
|
||||
symbols = CCC65Interface::getSymbolsForSourceFile(file);
|
||||
symbols = CCC65Interface::instance()->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 = nesGetAbsoluteAddressFromAddress(addr);
|
||||
absAddr = nesGetPhysicalAddressFromAddress(addr);
|
||||
}
|
||||
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = c64GetCPURegister(CPU_PC);
|
||||
absAddr = c64GetAbsoluteAddressFromAddress(addr);
|
||||
absAddr = c64GetPhysicalAddressFromAddress(addr);
|
||||
}
|
||||
|
||||
file = CCC65Interface::getSourceFileFromAbsoluteAddress(addr,absAddr);
|
||||
file = CCC65Interface::instance()->getSourceFileFromPhysicalAddress(addr,absAddr);
|
||||
if ( !file.isEmpty() )
|
||||
{
|
||||
linenumber = CCC65Interface::getSourceLineFromAbsoluteAddress(addr,absAddr);
|
||||
linenumber = CCC65Interface::instance()->getSourceLineFromPhysicalAddress(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::getSourceFileFromSymbol(symbol);
|
||||
QString file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
|
||||
emit snapTo("SourceNavigatorFile,"+file);
|
||||
emit snapTo("SourceNavigatorSymbol,"+symbol);
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
#include "dbg_cnes6502.h"
|
||||
|
||||
#include "model/projectsearcher.h"
|
||||
|
||||
#include "main.h"
|
||||
|
||||
cc65_dbginfo CCC65Interface::dbgInfo = NULL;
|
||||
QStringList CCC65Interface::errors;
|
||||
QString CCC65Interface::targetMachine = "none";
|
||||
CCC65Interface *CCC65Interface::_instance = NULL;
|
||||
|
||||
// This utility compares two file paths regardless of original slashery.
|
||||
bool fileNamesAreIdentical(QString file1, QString file2)
|
||||
@@ -33,7 +33,13 @@ 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()
|
||||
@@ -54,47 +60,44 @@ void CCC65Interface::clear()
|
||||
|
||||
QStringList CCC65Interface::getAssemblerSourcesFromProject()
|
||||
{
|
||||
IProjectTreeViewItemIterator iter(nesicideProject->getProject()->getSources());
|
||||
QDir baseDir(QDir::currentPath());
|
||||
CSourceItem* source;
|
||||
QStringList sources;
|
||||
QStringList extensions = EnvironmentSettingsDialog::sourceExtensionsForAssembly().split(" ", QString::SkipEmptyParts);
|
||||
QDir baseDir(QDir::currentPath());
|
||||
QStringList extensions = EnvironmentSettingsDialog::sourceExtensionsForAssembly().split(" ", QString::SkipEmptyParts);
|
||||
QList<CSourceItem*> projectSources = ProjectSearcher::findItemsOfType<CSourceItem>(nesicideProject);
|
||||
QStringList includedSources;
|
||||
|
||||
// For each source code object, compile it.
|
||||
while ( iter.current() )
|
||||
foreach ( CSourceItem* source, projectSources )
|
||||
{
|
||||
source = dynamic_cast<CSourceItem*>(iter.current());
|
||||
foreach ( QString extension, extensions )
|
||||
{
|
||||
if ( source && source->path().endsWith(extension,Qt::CaseInsensitive) )
|
||||
if ( source->includeInBuild() &&
|
||||
source->path().endsWith(extension,Qt::CaseInsensitive) )
|
||||
{
|
||||
sources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
|
||||
includedSources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
|
||||
}
|
||||
}
|
||||
iter.next();
|
||||
}
|
||||
|
||||
return sources;
|
||||
return includedSources;
|
||||
}
|
||||
|
||||
QStringList CCC65Interface::getCLanguageSourcesFromProject()
|
||||
{
|
||||
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;
|
||||
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;
|
||||
|
||||
// For each source code object, compile it.
|
||||
while ( iter.current() )
|
||||
foreach ( CSourceItem* source, projectSources )
|
||||
{
|
||||
source = dynamic_cast<CSourceItem*>(iter.current());
|
||||
add = true;
|
||||
foreach ( QString extension, extensions )
|
||||
{
|
||||
if ( source && source->path().endsWith(extension,Qt::CaseInsensitive) )
|
||||
if ( source->includeInBuild() &&
|
||||
source->path().endsWith(extension,Qt::CaseInsensitive) )
|
||||
{
|
||||
foreach ( QString headerExtension, headerExtensions )
|
||||
{
|
||||
@@ -107,34 +110,32 @@ QStringList CCC65Interface::getCLanguageSourcesFromProject()
|
||||
|
||||
if ( add )
|
||||
{
|
||||
sources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
|
||||
includedSources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
|
||||
}
|
||||
}
|
||||
}
|
||||
iter.next();
|
||||
}
|
||||
|
||||
return sources;
|
||||
return includedSources;
|
||||
}
|
||||
|
||||
QStringList CCC65Interface::getCustomSourcesFromProject()
|
||||
{
|
||||
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;
|
||||
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;
|
||||
|
||||
// For each source code object, compile it.
|
||||
while ( iter.current() )
|
||||
foreach ( CSourceItem* source, projectSources )
|
||||
{
|
||||
source = dynamic_cast<CSourceItem*>(iter.current());
|
||||
add = true;
|
||||
foreach ( QString extension, extensions )
|
||||
{
|
||||
if ( source && source->path().endsWith(extension,Qt::CaseInsensitive) )
|
||||
if ( source->includeInBuild() &&
|
||||
source->path().endsWith(extension,Qt::CaseInsensitive) )
|
||||
{
|
||||
foreach ( QString headerExtension, headerExtensions )
|
||||
{
|
||||
@@ -147,14 +148,13 @@ QStringList CCC65Interface::getCustomSourcesFromProject()
|
||||
|
||||
if ( add )
|
||||
{
|
||||
sources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
|
||||
includedSources.append(baseDir.fromNativeSeparators(baseDir.relativeFilePath(source->path())));
|
||||
}
|
||||
}
|
||||
}
|
||||
iter.next();
|
||||
}
|
||||
|
||||
return sources;
|
||||
return includedSources;
|
||||
}
|
||||
|
||||
bool CCC65Interface::createMakefile()
|
||||
@@ -220,14 +220,12 @@ bool CCC65Interface::createMakefile()
|
||||
makeFileContent.replace("<!target-rules!>",targetRules);
|
||||
makeFileContent.replace("<!linker-dependencies!>",nesicideProject->getLinkerAdditionalDependencies());
|
||||
|
||||
if ( !nesicideProject->getMakefileCustomRulesFile().isEmpty() )
|
||||
QString customRulesFiles;
|
||||
foreach ( QString customRuleFile,nesicideProject->getMakefileCustomRuleFiles() )
|
||||
{
|
||||
makeFileContent.replace("<!custom-rules!>",QString("-include ")+nesicideProject->getMakefileCustomRulesFile());
|
||||
}
|
||||
else
|
||||
{
|
||||
makeFileContent.replace("<!custom-rules!>","");
|
||||
customRulesFiles += "-include "+customRuleFile+"\r\n";
|
||||
}
|
||||
makeFileContent.replace("<!custom-rules!>",customRulesFiles);
|
||||
|
||||
// Write the file to disk.
|
||||
makeFile.write(makeFileContent.toLatin1());
|
||||
@@ -241,18 +239,106 @@ 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.
|
||||
make.setEnvironment(env);
|
||||
make.setWorkingDirectory(QDir::currentPath());
|
||||
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)));
|
||||
|
||||
// Clear the error storage.
|
||||
errors.clear();
|
||||
@@ -263,30 +349,24 @@ void CCC65Interface::clean()
|
||||
|
||||
buildTextLogger->write(invocationStr);
|
||||
|
||||
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>");
|
||||
}
|
||||
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();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
bool CCC65Interface::assemble()
|
||||
{
|
||||
QProcess make;
|
||||
QStringList env = QProcess::systemEnvironment();
|
||||
QString invocationStr;
|
||||
QString stdioStr;
|
||||
@@ -296,6 +376,9 @@ bool CCC65Interface::assemble()
|
||||
int exitCode;
|
||||
bool ok = true;
|
||||
|
||||
// Prevent overbuild
|
||||
protect.lock();
|
||||
|
||||
if ( nesicideProject->getProjectLinkerOutputName().isEmpty() )
|
||||
{
|
||||
outputName = outputDir.fromNativeSeparators(outputDir.filePath(nesicideProject->getProjectOutputName()+".prg"));
|
||||
@@ -307,8 +390,14 @@ bool CCC65Interface::assemble()
|
||||
buildTextLogger->write("<b>Building: "+outputName+"</b>");
|
||||
|
||||
// Copy the system environment to the child process.
|
||||
make.setEnvironment(env);
|
||||
make.setWorkingDirectory(QDir::currentPath());
|
||||
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)));
|
||||
|
||||
// Clear the error storage.
|
||||
errors.clear();
|
||||
@@ -319,28 +408,24 @@ bool CCC65Interface::assemble()
|
||||
|
||||
buildTextLogger->write(invocationStr);
|
||||
|
||||
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>");
|
||||
}
|
||||
process.start(invocationStr);
|
||||
process.waitForFinished();
|
||||
exitCode = process.exitCode();
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -389,7 +474,6 @@ bool CCC65Interface::captureDebugInfo()
|
||||
|
||||
bool CCC65Interface::isBuildUpToDate()
|
||||
{
|
||||
QProcess make;
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
QString invocationStr;
|
||||
QString stdioStr;
|
||||
@@ -400,13 +484,22 @@ 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.
|
||||
make.setProcessEnvironment(env);
|
||||
make.setWorkingDirectory(QDir::currentPath());
|
||||
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)));
|
||||
|
||||
// Clear the error storage.
|
||||
errors.clear();
|
||||
@@ -415,17 +508,27 @@ bool CCC65Interface::isBuildUpToDate()
|
||||
|
||||
invocationStr = "make -f nesicide.mk -q all";
|
||||
|
||||
make.start(invocationStr);
|
||||
make.waitForFinished();
|
||||
exitCode = make.exitCode();
|
||||
process.start(invocationStr);
|
||||
process.waitForFinished();
|
||||
exitCode = process.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;
|
||||
}
|
||||
|
||||
@@ -609,20 +712,20 @@ unsigned int CCC65Interface::getSymbolAddress(QString symbol, int index)
|
||||
return addr;
|
||||
}
|
||||
|
||||
unsigned int CCC65Interface::getSymbolAbsoluteAddress(QString symbol, int index)
|
||||
unsigned int CCC65Interface::getSymbolPhysicalAddress(QString symbol, int index)
|
||||
{
|
||||
// Dispatch to appropriate target machine handler.
|
||||
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
return nesGetSymbolAbsoluteAddress(symbol,index);
|
||||
return nesGetSymbolPhysicalAddress(symbol,index);
|
||||
}
|
||||
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
return c64GetSymbolAbsoluteAddress(symbol,index);
|
||||
return c64GetSymbolPhysicalAddress(symbol,index);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int CCC65Interface::nesGetSymbolAbsoluteAddress(QString symbol, int index)
|
||||
unsigned int CCC65Interface::nesGetSymbolPhysicalAddress(QString symbol, int index)
|
||||
{
|
||||
const cc65_symbolinfo* dbgSymbols;
|
||||
const cc65_segmentinfo* dbgSegments;
|
||||
@@ -679,7 +782,7 @@ unsigned int CCC65Interface::nesGetSymbolAbsoluteAddress(QString symbol, int ind
|
||||
return absAddr;
|
||||
}
|
||||
|
||||
unsigned int CCC65Interface::c64GetSymbolAbsoluteAddress(QString symbol, int index)
|
||||
unsigned int CCC65Interface::c64GetSymbolPhysicalAddress(QString symbol, int index)
|
||||
{
|
||||
const cc65_symbolinfo* dbgSymbols;
|
||||
const cc65_segmentinfo* dbgSegments;
|
||||
@@ -911,20 +1014,20 @@ int CCC65Interface::getSymbolMatchCount(QString symbol)
|
||||
return count;
|
||||
}
|
||||
|
||||
QString CCC65Interface::getSourceFileFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
|
||||
QString CCC65Interface::getSourceFileFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
|
||||
{
|
||||
// Dispatch to appropriate target machine handler.
|
||||
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
return QDir::fromNativeSeparators(nesGetSourceFileFromAbsoluteAddress(addr,absAddr));
|
||||
return QDir::fromNativeSeparators(nesGetSourceFileFromPhysicalAddress(addr,absAddr));
|
||||
}
|
||||
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
return QDir::fromNativeSeparators(c64GetSourceFileFromAbsoluteAddress(addr,absAddr));
|
||||
return QDir::fromNativeSeparators(c64GetSourceFileFromPhysicalAddress(addr,absAddr));
|
||||
}
|
||||
}
|
||||
|
||||
QString CCC65Interface::nesGetSourceFileFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
|
||||
QString CCC65Interface::nesGetSourceFileFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
|
||||
{
|
||||
const cc65_spaninfo* dbgSpans;
|
||||
const cc65_segmentinfo* dbgSegments;
|
||||
@@ -1017,7 +1120,7 @@ QString CCC65Interface::nesGetSourceFileFromAbsoluteAddress(uint32_t addr,uint32
|
||||
return QDir::fromNativeSeparators(file);
|
||||
}
|
||||
|
||||
QString CCC65Interface::c64GetSourceFileFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
|
||||
QString CCC65Interface::c64GetSourceFileFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
|
||||
{
|
||||
const cc65_spaninfo* dbgSpans;
|
||||
const cc65_segmentinfo* dbgSegments;
|
||||
@@ -1092,20 +1195,20 @@ QString CCC65Interface::c64GetSourceFileFromAbsoluteAddress(uint32_t addr,uint32
|
||||
return QDir::fromNativeSeparators(file);
|
||||
}
|
||||
|
||||
int CCC65Interface::getSourceLineFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
|
||||
int CCC65Interface::getSourceLineFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
|
||||
{
|
||||
// Dispatch to appropriate target machine handler.
|
||||
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
return nesGetSourceLineFromAbsoluteAddress(addr,absAddr);
|
||||
return nesGetSourceLineFromPhysicalAddress(addr,absAddr);
|
||||
}
|
||||
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
return c64GetSourceLineFromAbsoluteAddress(addr,absAddr);
|
||||
return c64GetSourceLineFromPhysicalAddress(addr,absAddr);
|
||||
}
|
||||
}
|
||||
|
||||
int CCC65Interface::nesGetSourceLineFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
|
||||
int CCC65Interface::nesGetSourceLineFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
|
||||
{
|
||||
const cc65_spaninfo* dbgSpans;
|
||||
const cc65_lineinfo* dbgLines;
|
||||
@@ -1191,7 +1294,7 @@ int CCC65Interface::nesGetSourceLineFromAbsoluteAddress(uint32_t addr,uint32_t a
|
||||
return source_line;
|
||||
}
|
||||
|
||||
int CCC65Interface::c64GetSourceLineFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
|
||||
int CCC65Interface::c64GetSourceLineFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
|
||||
{
|
||||
const cc65_spaninfo* dbgSpans;
|
||||
const cc65_lineinfo* dbgLines;
|
||||
@@ -1503,20 +1606,20 @@ unsigned int CCC65Interface::getAddressFromFileAndLine(QString file,int source_l
|
||||
return addr;
|
||||
}
|
||||
|
||||
unsigned int CCC65Interface::getAbsoluteAddressFromFileAndLine(QString file,int source_line,int entry)
|
||||
unsigned int CCC65Interface::getPhysicalAddressFromFileAndLine(QString file,int source_line,int entry)
|
||||
{
|
||||
// Dispatch to appropriate target machine handler.
|
||||
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
return nesGetAbsoluteAddressFromFileAndLine(file,source_line,entry);
|
||||
return nesGetPhysicalAddressFromFileAndLine(file,source_line,entry);
|
||||
}
|
||||
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
return c64GetAbsoluteAddressFromFileAndLine(file,source_line,entry);
|
||||
return c64GetPhysicalAddressFromFileAndLine(file,source_line,entry);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int CCC65Interface::nesGetAbsoluteAddressFromFileAndLine(QString file,int source_line,int entry)
|
||||
unsigned int CCC65Interface::nesGetPhysicalAddressFromFileAndLine(QString file,int source_line,int entry)
|
||||
{
|
||||
const cc65_sourceinfo* dbgSources;
|
||||
const cc65_lineinfo* dbgLines;
|
||||
@@ -1609,7 +1712,7 @@ unsigned int CCC65Interface::nesGetAbsoluteAddressFromFileAndLine(QString file,i
|
||||
return absAddr;
|
||||
}
|
||||
|
||||
unsigned int CCC65Interface::c64GetAbsoluteAddressFromFileAndLine(QString file,int source_line,int entry)
|
||||
unsigned int CCC65Interface::c64GetPhysicalAddressFromFileAndLine(QString file,int source_line,int entry)
|
||||
{
|
||||
const cc65_sourceinfo* dbgSources;
|
||||
const cc65_lineinfo* dbgLines;
|
||||
@@ -1695,20 +1798,20 @@ unsigned int CCC65Interface::c64GetAbsoluteAddressFromFileAndLine(QString file,i
|
||||
return absAddr;
|
||||
}
|
||||
|
||||
unsigned int CCC65Interface::getEndAddressFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
|
||||
unsigned int CCC65Interface::getEndAddressFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
|
||||
{
|
||||
// Dispatch to appropriate target machine handler.
|
||||
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
return nesGetEndAddressFromAbsoluteAddress(addr,absAddr);
|
||||
return nesGetEndAddressFromPhysicalAddress(addr,absAddr);
|
||||
}
|
||||
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
return c64GetEndAddressFromAbsoluteAddress(addr,absAddr);
|
||||
return c64GetEndAddressFromPhysicalAddress(addr,absAddr);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int CCC65Interface::nesGetEndAddressFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
|
||||
unsigned int CCC65Interface::nesGetEndAddressFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
|
||||
{
|
||||
const cc65_lineinfo* dbgLines;
|
||||
const cc65_spaninfo* dbgSpans;
|
||||
@@ -1792,7 +1895,7 @@ unsigned int CCC65Interface::nesGetEndAddressFromAbsoluteAddress(uint32_t addr,u
|
||||
return endAddr;
|
||||
}
|
||||
|
||||
unsigned int CCC65Interface::c64GetEndAddressFromAbsoluteAddress(uint32_t addr,uint32_t absAddr)
|
||||
unsigned int CCC65Interface::c64GetEndAddressFromPhysicalAddress(uint32_t addr,uint32_t absAddr)
|
||||
{
|
||||
const cc65_lineinfo* dbgLines;
|
||||
const cc65_spaninfo* dbgSpans;
|
||||
@@ -1858,21 +1961,21 @@ unsigned int CCC65Interface::c64GetEndAddressFromAbsoluteAddress(uint32_t addr,u
|
||||
return endAddr;
|
||||
}
|
||||
|
||||
bool CCC65Interface::isAbsoluteAddressAnOpcode(uint32_t absAddr)
|
||||
bool CCC65Interface::isPhysicalAddressAnOpcode(uint32_t absAddr)
|
||||
{
|
||||
// Dispatch to appropriate target machine handler.
|
||||
if ( !targetMachine.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
return nesIsAbsoluteAddressAnOpcode(absAddr);
|
||||
return nesIsPhysicalAddressAnOpcode(absAddr);
|
||||
}
|
||||
else if ( !targetMachine.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
return c64IsAbsoluteAddressAnOpcode(absAddr);
|
||||
return c64IsPhysicalAddressAnOpcode(absAddr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CCC65Interface::nesIsAbsoluteAddressAnOpcode(uint32_t absAddr)
|
||||
bool CCC65Interface::nesIsPhysicalAddressAnOpcode(uint32_t absAddr)
|
||||
{
|
||||
const cc65_spaninfo* dbgSpans;
|
||||
const cc65_segmentinfo* dbgSegments;
|
||||
@@ -1926,7 +2029,7 @@ bool CCC65Interface::nesIsAbsoluteAddressAnOpcode(uint32_t absAddr)
|
||||
return opcode;
|
||||
}
|
||||
|
||||
bool CCC65Interface::c64IsAbsoluteAddressAnOpcode(uint32_t absAddr)
|
||||
bool CCC65Interface::c64IsPhysicalAddressAnOpcode(uint32_t absAddr)
|
||||
{
|
||||
const cc65_spaninfo* dbgSpans;
|
||||
const cc65_segmentinfo* dbgSegments;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define CCC65INTERFACE_H
|
||||
|
||||
#include <QProcess>
|
||||
#include <QMutex>
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
@@ -11,71 +12,91 @@ class CCC65Interface : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
// Class maintenance.
|
||||
CCC65Interface();
|
||||
static CCC65Interface *_instance;
|
||||
static CCC65Interface *instance()
|
||||
{
|
||||
if ( !_instance )
|
||||
{
|
||||
_instance = new CCC65Interface();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
virtual ~CCC65Interface();
|
||||
static void clear();
|
||||
void clear();
|
||||
|
||||
// Makefile and target image APIs.
|
||||
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);
|
||||
bool createMakefile();
|
||||
void clean();
|
||||
bool assemble();
|
||||
bool captureDebugInfo();
|
||||
bool isBuildUpToDate();
|
||||
bool captureINESImage();
|
||||
QStringList getCLanguageSourcesFromProject();
|
||||
QStringList getAssemblerSourcesFromProject();
|
||||
QStringList getCustomSourcesFromProject();
|
||||
void updateTargetMachine(QString target);
|
||||
|
||||
// Debug information parsing/extending APIs.
|
||||
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);
|
||||
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);
|
||||
|
||||
// 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);
|
||||
// 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);
|
||||
|
||||
// NES target-dependent APIs.
|
||||
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);
|
||||
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);
|
||||
|
||||
// C64 target-dependent APIs.
|
||||
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);
|
||||
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);
|
||||
|
||||
protected:
|
||||
static cc65_dbginfo dbgInfo;
|
||||
static QStringList errors;
|
||||
static QString targetMachine;
|
||||
cc65_dbginfo dbgInfo;
|
||||
QStringList errors;
|
||||
QString targetMachine;
|
||||
QMutex protect;
|
||||
QProcess process;
|
||||
|
||||
private:
|
||||
CCC65Interface();
|
||||
};
|
||||
|
||||
#endif // CCC65INTERFACE_H
|
||||
|
||||
@@ -5,25 +5,16 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
CompilerThread::CompilerThread(QObject*)
|
||||
CompilerWorker::CompilerWorker(QObject*)
|
||||
{
|
||||
m_assembledOk = false;
|
||||
|
||||
pThread = new QThread();
|
||||
|
||||
moveToThread(pThread);
|
||||
|
||||
pThread->start();
|
||||
}
|
||||
|
||||
CompilerThread::~CompilerThread()
|
||||
CompilerWorker::~CompilerWorker()
|
||||
{
|
||||
pThread->exit(0);
|
||||
pThread->wait();
|
||||
delete pThread;
|
||||
}
|
||||
|
||||
void CompilerThread::compile()
|
||||
void CompilerWorker::compile()
|
||||
{
|
||||
CCartridgeBuilder cartridgeBuilder;
|
||||
CMachineImageBuilder machineImageBuilder;
|
||||
@@ -40,7 +31,7 @@ void CompilerThread::compile()
|
||||
emit compileDone(m_assembledOk);
|
||||
}
|
||||
|
||||
void CompilerThread::clean()
|
||||
void CompilerWorker::clean()
|
||||
{
|
||||
CCartridgeBuilder cartridgeBuilder;
|
||||
CMachineImageBuilder machineImageBuilder;
|
||||
@@ -56,3 +47,27 @@ void CompilerThread::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;
|
||||
}
|
||||
|
||||
@@ -10,17 +10,16 @@ enum
|
||||
DoClean
|
||||
};
|
||||
|
||||
class CompilerThread : public QObject
|
||||
class CompilerWorker : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CompilerThread ( QObject* parent = 0 );
|
||||
virtual ~CompilerThread ();
|
||||
CompilerWorker ( QObject* parent = 0 );
|
||||
virtual ~CompilerWorker ();
|
||||
|
||||
bool assembledOk() { return m_assembledOk; }
|
||||
void reset() { m_assembledOk = false; }
|
||||
|
||||
public slots:
|
||||
void compile();
|
||||
void clean();
|
||||
|
||||
@@ -33,8 +32,31 @@ signals:
|
||||
protected:
|
||||
bool m_assembledOk;
|
||||
int m_operation;
|
||||
};
|
||||
|
||||
QThread* pThread;
|
||||
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;
|
||||
};
|
||||
|
||||
#endif // COMPILERTHREAD_H
|
||||
|
||||
@@ -12,7 +12,7 @@ CSourceAssembler::CSourceAssembler()
|
||||
|
||||
void CSourceAssembler::clean()
|
||||
{
|
||||
return CCC65Interface::clean();
|
||||
CCC65Interface::instance()->clean();
|
||||
}
|
||||
|
||||
bool CSourceAssembler::assemble()
|
||||
@@ -40,7 +40,7 @@ bool CSourceAssembler::assemble()
|
||||
|
||||
if ( ok )
|
||||
{
|
||||
ok = CCC65Interface::assemble();
|
||||
ok = CCC65Interface::instance()->assemble();
|
||||
}
|
||||
|
||||
return ok;
|
||||
|
||||
@@ -447,7 +447,7 @@ void BreakpointDialog::DisplayResolutions(BreakpointInfo* pBreakpoint)
|
||||
QString text;
|
||||
QStringList textSplit;
|
||||
QFileInfo fileInfo;
|
||||
CompilerThread* compiler = dynamic_cast<CompilerThread*>(CObjectRegistry::getObject("Compiler"));
|
||||
CompilerThread* compiler = dynamic_cast<CompilerThread*>(CObjectRegistry::instance()->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::getSourceFileFromAbsoluteAddress(originalAddr,maskedAddr);
|
||||
source = CCC65Interface::instance()->getSourceFileFromPhysicalAddress(originalAddr,maskedAddr);
|
||||
if ( !source.isEmpty() )
|
||||
{
|
||||
fileInfo.setFile(source);
|
||||
source = fileInfo.fileName();
|
||||
|
||||
text = "put something";//pasm_get_source_file_text_by_addr(maskedAddr);
|
||||
linenum = CCC65Interface::getSourceLineFromAbsoluteAddress(originalAddr,maskedAddr);
|
||||
linenum = CCC65Interface::instance()->getSourceLineFromPhysicalAddress(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
|
||||
{
|
||||
nesGetDisassemblyAtAbsoluteAddress(maskedAddr,disassembly);
|
||||
nesGetPrintableAddressWithAbsolute(address,originalAddr,maskedAddr);
|
||||
nesGetDisassemblyAtPhysicalAddress(maskedAddr,disassembly);
|
||||
nesGetPrintablePhysicalAddress(address,originalAddr,maskedAddr);
|
||||
item.sprintf("%s:%s",address,disassembly);
|
||||
ui->resolutions->addItem(item);
|
||||
ui->resolutions->setItemData(ui->resolutions->count()-1,maskedAddr);
|
||||
}
|
||||
if ( pBreakpoint && pBreakpoint->item1Absolute == maskedAddr )
|
||||
if ( pBreakpoint && pBreakpoint->item1Physical == 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->item1Absolute >= 0) )
|
||||
(pBreakpoint->item1Physical >= 0) )
|
||||
{
|
||||
ui->resolve->setChecked(true);
|
||||
}
|
||||
@@ -629,7 +629,7 @@ void BreakpointDialog::on_cancel_clicked()
|
||||
void BreakpointDialog::on_addBreakpoint_clicked()
|
||||
{
|
||||
int item1 = 0;
|
||||
int item1Absolute = 0;
|
||||
int item1Physical = 0;
|
||||
int item2 = 0;
|
||||
int mask = 0;
|
||||
int data = 0;
|
||||
@@ -689,7 +689,7 @@ void BreakpointDialog::on_addBreakpoint_clicked()
|
||||
|
||||
if ( ui->resolve->isChecked() )
|
||||
{
|
||||
item1Absolute = ui->resolutions->itemData(ui->resolutions->currentIndex()).toInt();
|
||||
item1Physical = 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.
|
||||
item1Absolute = (item1-MEM_32KB)%nesGetPRGROMSize();
|
||||
item1Physical = (item1-MEM_32KB)%nesGetPRGROMSize();
|
||||
}
|
||||
else if ( item1 >= 0x6000 )
|
||||
{
|
||||
// CPTODO: For now assume identity mapped SRAM.
|
||||
item1Absolute = (item1-0x6000);
|
||||
item1Physical = (item1-0x6000);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Virtual is physical if address is less than $8000.
|
||||
item1Absolute = item1;
|
||||
item1Physical = item1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Virtual is physical for now. Might need to revisit.
|
||||
item1Absolute = item1;
|
||||
item1Physical = item1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,7 +729,7 @@ void BreakpointDialog::on_addBreakpoint_clicked()
|
||||
(eBreakpointItemType)ui->itemWidget->currentIndex(),
|
||||
event,
|
||||
item1,
|
||||
item1Absolute,
|
||||
item1Physical,
|
||||
item2,
|
||||
mask,
|
||||
maskExclusive,
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>330</width>
|
||||
<height>222</height>
|
||||
<width>541</width>
|
||||
<height>320</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -18,20 +18,35 @@
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>330</width>
|
||||
<height>0</height>
|
||||
<width>416</width>
|
||||
<height>292</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<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="Preferred" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -46,6 +61,12 @@
|
||||
</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>
|
||||
@@ -53,86 +74,225 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="itemWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="addrpage">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="addr1label">
|
||||
<property name="text">
|
||||
<string>Address 1:</string>
|
||||
<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>
|
||||
</property>
|
||||
</widget>
|
||||
<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>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="addr2label">
|
||||
<property name="text">
|
||||
<string>Address 2:</string>
|
||||
<item row="1" column="1">
|
||||
<layout class="QFormLayout" name="formLayout_7">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<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>
|
||||
</item>
|
||||
<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>
|
||||
<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>
|
||||
</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">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Mask:</string>
|
||||
<layout class="QFormLayout" name="formLayout_6">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
</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>
|
||||
<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>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Inclusive (unmasked bits are ignored)</string>
|
||||
</property>
|
||||
<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>
|
||||
</widget>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="regpage">
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<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">
|
||||
<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>
|
||||
@@ -140,30 +300,73 @@
|
||||
</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"/>
|
||||
<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>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="eventpage">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="margin">
|
||||
<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>
|
||||
<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>
|
||||
@@ -171,6 +374,12 @@
|
||||
</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>
|
||||
@@ -178,33 +387,339 @@
|
||||
</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"/>
|
||||
<widget class="QLineEdit" name="eventData1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</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"/>
|
||||
<widget class="QLineEdit" name="eventData2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="emptypage"/>
|
||||
<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>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QStackedWidget" name="conditionWidget">
|
||||
<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">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -212,121 +727,69 @@
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="emptyCondition"/>
|
||||
<widget class="QWidget" name="addrCondition">
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<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">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="conditionlabel">
|
||||
<widget class="QCheckBox" name="resolve">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Break if:</string>
|
||||
<string>Resolve using Mapper</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<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 class="QComboBox" name="resolutions">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<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>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<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>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cancel">
|
||||
<property name="text">
|
||||
@@ -339,6 +802,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="enabled">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
@@ -356,35 +822,10 @@
|
||||
</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>
|
||||
@@ -395,7 +836,6 @@
|
||||
<tabstop>cancel</tabstop>
|
||||
<tabstop>enabled</tabstop>
|
||||
<tabstop>addBreakpoint</tabstop>
|
||||
<tabstop>resolutions</tabstop>
|
||||
<tabstop>resolve</tabstop>
|
||||
<tabstop>reg</tabstop>
|
||||
</tabstops>
|
||||
|
||||
@@ -45,8 +45,8 @@ BreakpointDockWidget::~BreakpointDockWidget()
|
||||
|
||||
void BreakpointDockWidget::updateTargetMachine(QString /*target*/)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),this,SLOT(updateData()) );
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),model,SLOT(update()));
|
||||
@@ -102,23 +102,23 @@ void BreakpointDockWidget::changeEvent(QEvent* e)
|
||||
|
||||
void BreakpointDockWidget::showEvent(QShowEvent*)
|
||||
{
|
||||
QDockWidget* codeBrowser = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Assembly Browser"));
|
||||
QDockWidget* symbolInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Symbol Inspector"));
|
||||
QDockWidget* codeBrowser = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Assembly Browser"));
|
||||
QDockWidget* symbolInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Symbol Inspector"));
|
||||
QDockWidget* memoryInspector;
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(codeBrowser,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
|
||||
QObject::connect(symbolInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
|
||||
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("CPU RAM Inspector"));
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("CPU RAM Inspector"));
|
||||
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Cartridge EXRAM Memory Inspector"));
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Cartridge EXRAM Memory Inspector"));
|
||||
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Cartridge SRAM Memory Inspector"));
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Cartridge SRAM Memory Inspector"));
|
||||
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),model, SLOT(update()) );
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("PRG-ROM Inspector"));
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->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::getWidget("CPU RAM Inspector"));
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("CPU RAM Inspector"));
|
||||
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),emulator, SLOT(breakpointsChanged()) );
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Cartridge EXRAM Memory Inspector"));
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Cartridge EXRAM Memory Inspector"));
|
||||
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),emulator, SLOT(breakpointsChanged()) );
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Cartridge SRAM Memory Inspector"));
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("Cartridge SRAM Memory Inspector"));
|
||||
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),emulator, SLOT(breakpointsChanged()) );
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("PRG-ROM Inspector"));
|
||||
memoryInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::instance()->getWidget("PRG-ROM Inspector"));
|
||||
QObject::connect(memoryInspector,SIGNAL(breakpointsChanged()),emulator, SLOT(breakpointsChanged()) );
|
||||
}
|
||||
}
|
||||
@@ -170,6 +170,7 @@ 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);
|
||||
}
|
||||
@@ -224,7 +225,7 @@ void BreakpointDockWidget::dropEvent(QDropEvent *event)
|
||||
|
||||
if ( event->isAccepted() )
|
||||
{
|
||||
addr = CCC65Interface::getSymbolAddress(text);
|
||||
addr = CCC65Interface::instance()->getSymbolAddress(text);
|
||||
if ( addr != 0xFFFFFFFF )
|
||||
{
|
||||
bpIdx = m_pBreakpoints->AddBreakpoint ( eBreakOnCPUMemoryAccess,
|
||||
@@ -292,7 +293,7 @@ void BreakpointDockWidget::on_tableView_pressed(QModelIndex index)
|
||||
if ( (index.row() < m_pBreakpoints->GetNumBreakpoints()) &&
|
||||
(m_pBreakpoints->GetBreakpoint(index.row())->type == eBreakOnCPUExecution) )
|
||||
{
|
||||
nesGetPrintableAddressWithAbsolute(buffer,m_pBreakpoints->GetBreakpoint(index.row())->item1,m_pBreakpoints->GetBreakpoint(index.row())->item1Absolute);
|
||||
nesGetPrintablePhysicalAddress(buffer,m_pBreakpoints->GetBreakpoint(index.row())->item1,m_pBreakpoints->GetBreakpoint(index.row())->item1Physical);
|
||||
emit snapTo(QString("Address,")+QString(buffer));
|
||||
}
|
||||
|
||||
@@ -366,6 +367,17 @@ 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;
|
||||
@@ -442,7 +454,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->item1Absolute);
|
||||
breakpointElement.setAttribute("item1absolute",pBreakpoint->item1Physical);
|
||||
breakpointElement.setAttribute("item2",pBreakpoint->item2);
|
||||
breakpointElement.setAttribute("itemMask",pBreakpoint->itemMask);
|
||||
breakpointElement.setAttribute("itemMaskExclusive",pBreakpoint->itemMaskExclusive);
|
||||
@@ -488,7 +500,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.item1Absolute = element.attribute("item1absolute").toInt();
|
||||
breakpoint.item1Physical = element.attribute("item1absolute").toInt();
|
||||
breakpoint.item2 = element.attribute("item2").toInt();
|
||||
breakpoint.itemMask = element.attribute("itemMask").toInt();
|
||||
breakpoint.itemMaskExclusive = element.attribute("itemMaskExclusive").toInt();
|
||||
|
||||
@@ -56,6 +56,7 @@ 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();
|
||||
};
|
||||
|
||||
|
||||
@@ -30,11 +30,17 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
<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="QTableView" name="tableView">
|
||||
@@ -86,10 +92,10 @@
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<number>23</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<number>23</number>
|
||||
</attribute>
|
||||
</widget>
|
||||
@@ -134,6 +140,14 @@
|
||||
<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/>
|
||||
|
||||
@@ -5,23 +5,15 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
BreakpointWatcherThread::BreakpointWatcherThread(QObject*)
|
||||
BreakpointWatcherWorker::BreakpointWatcherWorker(QObject*)
|
||||
{
|
||||
pThread = new QThread();
|
||||
|
||||
moveToThread(pThread);
|
||||
|
||||
pThread->start();
|
||||
}
|
||||
|
||||
BreakpointWatcherThread::~BreakpointWatcherThread()
|
||||
BreakpointWatcherWorker::~BreakpointWatcherWorker()
|
||||
{
|
||||
pThread->exit(0);
|
||||
pThread->wait();
|
||||
delete pThread;
|
||||
}
|
||||
|
||||
void BreakpointWatcherThread::breakpoint()
|
||||
void BreakpointWatcherWorker::breakpoint()
|
||||
{
|
||||
CBreakpointInfo* pBreakpoints = NULL;
|
||||
int idx;
|
||||
@@ -56,3 +48,25 @@ void BreakpointWatcherThread::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;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,20 @@
|
||||
#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
|
||||
@@ -16,10 +30,11 @@ signals:
|
||||
void showPane(int pane);
|
||||
|
||||
public slots:
|
||||
void breakpoint();
|
||||
void breakpoint() { pWorker->breakpoint(); }
|
||||
|
||||
protected:
|
||||
QThread* pThread;
|
||||
BreakpointWatcherWorker *pWorker;
|
||||
QThread *pThread;
|
||||
};
|
||||
|
||||
#endif // BREAKPOINTWATCHERTHREAD_H
|
||||
|
||||
@@ -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 absAddr;
|
||||
int32_t physAddr;
|
||||
//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) )
|
||||
{
|
||||
absAddr = nesGetAbsoluteAddressFromAddress(addr);
|
||||
physAddr = nesGetPhysicalAddressFromAddress(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) )
|
||||
{
|
||||
absAddr = c64GetAbsoluteAddressFromAddress(addr);
|
||||
physAddr = c64GetPhysicalAddressFromAddress(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 ( (absAddr >= pMarker->startAbsAddr) &&
|
||||
(absAddr <= pMarker->endAbsAddr) )
|
||||
if ( (physAddr >= pMarker->startAbsAddr) &&
|
||||
(physAddr <= 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) &&
|
||||
((absAddr == -1) || (absAddr == pBreakpoint->item1Absolute)) &&
|
||||
((physAddr == -1) || (physAddr == pBreakpoint->item1Physical)) &&
|
||||
(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) &&
|
||||
((absAddr == -1) || (absAddr == pBreakpoint->item1Absolute)) &&
|
||||
((physAddr == -1) || (physAddr == pBreakpoint->item1Physical)) &&
|
||||
(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 addr;
|
||||
int physAddr;
|
||||
|
||||
if ( (row >= 0) && (column >= 0) )
|
||||
{
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = nesGetAddressFromSLOC(row);
|
||||
physAddr = nesGetVirtualAddressFromSLOC(row);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = c64GetAddressFromSLOC(row);
|
||||
physAddr = c64GetAddressFromSLOC(row);
|
||||
}
|
||||
|
||||
return createIndex(row, column, addr);
|
||||
return createIndex(row, column, physAddr);
|
||||
}
|
||||
|
||||
return QModelIndex();
|
||||
|
||||
@@ -39,8 +39,8 @@ QModelIndex CDebuggerCodeProfilerModel::index(int row, int column, const QModelI
|
||||
unsigned int addr;
|
||||
unsigned int absAddr;
|
||||
|
||||
addr = CCC65Interface::getSymbolAddress(m_items.at(row).symbol);
|
||||
absAddr = CCC65Interface::getSymbolAbsoluteAddress(m_items.at(row).symbol);
|
||||
addr = CCC65Interface::instance()->getSymbolAddress(m_items.at(row).symbol);
|
||||
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(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::getSymbolsForSourceFile(""); // CPTODO: File doesn't matter (yet).
|
||||
QStringList symbols = CCC65Interface::instance()->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::getSymbolAddress(symbol);
|
||||
absAddr = CCC65Interface::getSymbolAbsoluteAddress(symbol);
|
||||
addr = CCC65Interface::instance()->getSymbolAddress(symbol);
|
||||
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(symbol);
|
||||
|
||||
if ( absAddr != -1 )
|
||||
{
|
||||
@@ -170,11 +170,11 @@ void CDebuggerCodeProfilerModel::update()
|
||||
(pLogger->GetType(addr&mask) == eLogger_InstructionFetch) )
|
||||
{
|
||||
item.symbol = symbol;
|
||||
item.size = CCC65Interface::getSymbolSize(symbol);
|
||||
item.file = CCC65Interface::getSourceFileFromSymbol(symbol);
|
||||
item.size = CCC65Interface::instance()->getSymbolSize(symbol);
|
||||
item.file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
|
||||
fileInfo.setFile(item.file);
|
||||
|
||||
nesGetPrintableAddressWithAbsolute(modelStringBuffer,addr,absAddr);
|
||||
nesGetPrintablePhysicalAddress(modelStringBuffer,addr,absAddr);
|
||||
item.address = modelStringBuffer;
|
||||
item.count = pLogger->GetCount(addr&mask);
|
||||
if ( !m_items.contains(item) )
|
||||
|
||||
@@ -7,7 +7,8 @@ static char modelStringBuffer [ 2048 ];
|
||||
|
||||
CDebuggerMemoryDisplayModel::CDebuggerMemoryDisplayModel(memDBFunc memDB,QObject*)
|
||||
{
|
||||
m_memDB = memDB;
|
||||
m_memDBFunc = memDB;
|
||||
m_memDB = memDB();
|
||||
}
|
||||
|
||||
CDebuggerMemoryDisplayModel::~CDebuggerMemoryDisplayModel()
|
||||
@@ -16,60 +17,52 @@ CDebuggerMemoryDisplayModel::~CDebuggerMemoryDisplayModel()
|
||||
|
||||
int CDebuggerMemoryDisplayModel::memoryType() const
|
||||
{
|
||||
CMemoryDatabase* memDB = m_memDB();
|
||||
|
||||
if ( memDB )
|
||||
if ( m_memDB )
|
||||
{
|
||||
return memDB->GetType();
|
||||
return m_memDB->GetType();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CDebuggerMemoryDisplayModel::memoryBottom() const
|
||||
{
|
||||
CMemoryDatabase* memDB = m_memDB();
|
||||
|
||||
if ( memDB )
|
||||
if ( m_memDB )
|
||||
{
|
||||
return memDB->GetBase();
|
||||
return m_memDB->GetBase();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CDebuggerMemoryDisplayModel::memoryTop() const
|
||||
{
|
||||
CMemoryDatabase* memDB = m_memDB();
|
||||
|
||||
if ( memDB )
|
||||
if ( m_memDB )
|
||||
{
|
||||
return memDB->GetBase()+memDB->GetSize()-1;
|
||||
return m_memDB->GetBase()+m_memDB->GetSize()-1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
QVariant CDebuggerMemoryDisplayModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
CMemoryDatabase* memDB = m_memDB();
|
||||
|
||||
if (!index.isValid())
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if ( memDB )
|
||||
if ( m_memDB )
|
||||
{
|
||||
if (role == Qt::BackgroundRole)
|
||||
{
|
||||
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()))));
|
||||
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()))));
|
||||
}
|
||||
|
||||
if (role == Qt::ForegroundRole)
|
||||
{
|
||||
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())));
|
||||
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())));
|
||||
|
||||
if ((((double)col.red() +
|
||||
(double)col.green() +
|
||||
@@ -89,9 +82,9 @@ QVariant CDebuggerMemoryDisplayModel::data(const QModelIndex& index, int role) c
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if ( memDB )
|
||||
if ( m_memDB )
|
||||
{
|
||||
sprintf(modelStringBuffer,"%02X",memDB->Get((index.row()*memDB->GetNumColumns())+index.column()));
|
||||
sprintf(modelStringBuffer,"%02X",m_memDB->Get((index.row()*m_memDB->GetNumColumns())+index.column()));
|
||||
}
|
||||
|
||||
return QVariant(modelStringBuffer);
|
||||
@@ -101,13 +94,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;
|
||||
}
|
||||
@@ -129,9 +122,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()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,13 +136,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);
|
||||
}
|
||||
}
|
||||
@@ -159,11 +152,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,9 +165,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;
|
||||
@@ -182,9 +175,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;
|
||||
@@ -192,5 +185,6 @@ int CDebuggerMemoryDisplayModel::columnCount(const QModelIndex& /*parent*/) cons
|
||||
|
||||
void CDebuggerMemoryDisplayModel::update()
|
||||
{
|
||||
m_memDB = m_memDBFunc();
|
||||
emit dataChanged(QModelIndex(),QModelIndex());
|
||||
}
|
||||
|
||||
@@ -29,7 +29,8 @@ public slots:
|
||||
void update(void);
|
||||
|
||||
private:
|
||||
memDBFunc m_memDB;
|
||||
memDBFunc m_memDBFunc;
|
||||
CMemoryDatabase* m_memDB;
|
||||
};
|
||||
|
||||
#endif // CDEBUGGERMEMORYDISPLAYMODEL_H
|
||||
|
||||
@@ -4,7 +4,8 @@ static char modelStringBuffer [ 2048 ];
|
||||
|
||||
CDebuggerRegisterDisplayModel::CDebuggerRegisterDisplayModel(regDBFunc regDB,QObject*)
|
||||
{
|
||||
m_regDB = regDB;
|
||||
m_regDBFunc = regDB;
|
||||
m_regDB = regDB();
|
||||
}
|
||||
|
||||
CDebuggerRegisterDisplayModel::~CDebuggerRegisterDisplayModel()
|
||||
@@ -13,33 +14,27 @@ CDebuggerRegisterDisplayModel::~CDebuggerRegisterDisplayModel()
|
||||
|
||||
int CDebuggerRegisterDisplayModel::memoryType() const
|
||||
{
|
||||
CRegisterDatabase* regDB = m_regDB();
|
||||
|
||||
if ( regDB )
|
||||
if ( m_regDB )
|
||||
{
|
||||
return regDB->GetType();
|
||||
return m_regDB->GetType();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CDebuggerRegisterDisplayModel::memoryContains(uint32_t addr) const
|
||||
{
|
||||
CRegisterDatabase* regDB = m_regDB();
|
||||
|
||||
if ( regDB )
|
||||
if ( m_regDB )
|
||||
{
|
||||
return regDB->Contains(addr);
|
||||
return m_regDB->Contains(addr);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int CDebuggerRegisterDisplayModel::memoryBottom() const
|
||||
{
|
||||
CRegisterDatabase* regDB = m_regDB();
|
||||
|
||||
if ( regDB )
|
||||
if ( m_regDB )
|
||||
{
|
||||
return regDB->GetRegister(0)->GetAddr();
|
||||
return m_regDB->GetRegister(0)->GetAddr();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -79,22 +74,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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,13 +102,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);
|
||||
}
|
||||
}
|
||||
@@ -123,12 +118,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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,9 +132,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;
|
||||
@@ -147,9 +142,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;
|
||||
@@ -157,5 +152,6 @@ int CDebuggerRegisterDisplayModel::columnCount(const QModelIndex& /*parent*/) co
|
||||
|
||||
void CDebuggerRegisterDisplayModel::update()
|
||||
{
|
||||
m_regDB = m_regDBFunc();
|
||||
emit layoutChanged();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,8 @@ public slots:
|
||||
void update(void);
|
||||
|
||||
private:
|
||||
regDBFunc m_regDB;
|
||||
regDBFunc m_regDBFunc;
|
||||
CRegisterDatabase* 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::getSymbolsForSourceFile("<CPTODO:fixme>");
|
||||
QStringList symbols = CCC65Interface::instance()->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 )
|
||||
{
|
||||
nesGetPrintableAddressWithAbsolute(modelStringBuffer,
|
||||
nesGetPrintablePhysicalAddress(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 )
|
||||
{
|
||||
nesGetPrintableAddressWithAbsolute(modelStringBuffer,
|
||||
nesGetPrintablePhysicalAddress(modelStringBuffer,
|
||||
pMarker->endAddr,
|
||||
pMarker->endAbsAddr);
|
||||
return QVariant(modelStringBuffer);
|
||||
|
||||
@@ -29,6 +29,16 @@ 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()) );
|
||||
}
|
||||
|
||||
@@ -40,8 +50,8 @@ CodeBrowserDockWidget::~CodeBrowserDockWidget()
|
||||
|
||||
void CodeBrowserDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), assemblyViewModel, SLOT(update()) );
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(breakpointHit()) );
|
||||
@@ -60,15 +70,15 @@ void CodeBrowserDockWidget::updateTargetMachine(QString target)
|
||||
|
||||
void CodeBrowserDockWidget::showEvent(QShowEvent* /*e*/)
|
||||
{
|
||||
QDockWidget* breakpointInspector = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Breakpoints"));
|
||||
QDockWidget* executionVisualizer = dynamic_cast<QDockWidget*>(CDockWidgetRegistry::getWidget("Execution Visualizer"));
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
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");
|
||||
|
||||
// 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(emulatorPaused(bool)), this, SLOT(emulatorPaused(bool)) );
|
||||
// QObject::connect ( emulator, SIGNAL(updateDebuggers()), this, SLOT(updateDebuggers()) );
|
||||
}
|
||||
QObject::connect ( breakpointInspector, SIGNAL(breakpointsChanged()), assemblyViewModel, SLOT(update()) );
|
||||
QObject::connect ( breakpointInspector, SIGNAL(snapTo(QString)), this, SLOT(snapTo(QString)) );
|
||||
@@ -91,11 +101,11 @@ void CodeBrowserDockWidget::showEvent(QShowEvent* /*e*/)
|
||||
|
||||
void CodeBrowserDockWidget::hideEvent(QHideEvent* /*e*/)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
if ( emulator )
|
||||
{
|
||||
QObject::disconnect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(emulatorPaused(bool)) );
|
||||
// QObject::disconnect ( emulator, SIGNAL(updateDebuggers()), this, SLOT(updateDebuggers()) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,18 +114,18 @@ void CodeBrowserDockWidget::contextMenuEvent(QContextMenuEvent* e)
|
||||
QMenu menu;
|
||||
int bp;
|
||||
int addr = 0;
|
||||
int absAddr = 0;
|
||||
int physAddr = 0;
|
||||
QModelIndex index = ui->tableView->currentIndex();
|
||||
|
||||
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = nesGetAddressFromSLOC(index.row());
|
||||
absAddr = nesGetAbsoluteAddressFromAddress(addr);
|
||||
addr = nesGetVirtualAddressFromSLOC(index.row());
|
||||
physAddr = nesGetPhysicalAddressFromAddress(addr);
|
||||
}
|
||||
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = c64GetAddressFromSLOC(index.row());
|
||||
absAddr = c64GetAbsoluteAddressFromAddress(addr);
|
||||
physAddr = c64GetPhysicalAddressFromAddress(addr);
|
||||
}
|
||||
|
||||
if ( addr != -1 )
|
||||
@@ -127,7 +137,7 @@ void CodeBrowserDockWidget::contextMenuEvent(QContextMenuEvent* e)
|
||||
eBreakpointItemAddress,
|
||||
0,
|
||||
addr,
|
||||
absAddr,
|
||||
physAddr,
|
||||
addr,
|
||||
0xFFFF,
|
||||
true,
|
||||
@@ -166,6 +176,8 @@ 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;
|
||||
@@ -222,7 +234,7 @@ void CodeBrowserDockWidget::snapTo(QString item)
|
||||
{
|
||||
ui->tableView->setCurrentIndex(assemblyViewModel->index(c64GetSLOCFromAddress(addr),0));
|
||||
}
|
||||
ui->tableView->scrollTo(ui->tableView->currentIndex());
|
||||
ui->tableView->scrollTo(ui->tableView->currentIndex(),QAbstractItemView::PositionAtTop);
|
||||
ui->tableView->resizeColumnsToContents();
|
||||
}
|
||||
}
|
||||
@@ -286,17 +298,17 @@ void CodeBrowserDockWidget::on_actionBreak_on_CPU_execution_here_triggered()
|
||||
QModelIndex index = ui->tableView->currentIndex();
|
||||
int bpIdx;
|
||||
int addr = 0;
|
||||
int absAddr = 0;
|
||||
int physAddr = 0;
|
||||
|
||||
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = nesGetAddressFromSLOC(index.row());
|
||||
absAddr = nesGetAbsoluteAddressFromAddress(addr);
|
||||
addr = nesGetVirtualAddressFromSLOC(index.row());
|
||||
physAddr = nesGetPhysicalAddressFromAddress(addr);
|
||||
}
|
||||
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = c64GetAddressFromSLOC(index.row());
|
||||
absAddr = c64GetAbsoluteAddressFromAddress(addr);
|
||||
physAddr = c64GetPhysicalAddressFromAddress(addr);
|
||||
}
|
||||
|
||||
if ( addr != -1 )
|
||||
@@ -305,10 +317,10 @@ void CodeBrowserDockWidget::on_actionBreak_on_CPU_execution_here_triggered()
|
||||
eBreakpointItemAddress,
|
||||
0,
|
||||
addr,
|
||||
absAddr,
|
||||
physAddr,
|
||||
addr,
|
||||
0xFFFF,
|
||||
false,
|
||||
true,
|
||||
eBreakpointConditionNone,
|
||||
0,
|
||||
eBreakpointDataNone,
|
||||
@@ -333,12 +345,12 @@ void CodeBrowserDockWidget::on_actionRun_to_here_triggered()
|
||||
{
|
||||
QModelIndex index = ui->tableView->currentIndex();
|
||||
int addr = 0;
|
||||
int absAddr = 0;
|
||||
int physAddr = 0;
|
||||
|
||||
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = nesGetAddressFromSLOC(index.row());
|
||||
absAddr = nesGetAbsoluteAddressFromAddress(addr);
|
||||
addr = nesGetVirtualAddressFromSLOC(index.row());
|
||||
physAddr = nesGetPhysicalAddressFromAddress(addr);
|
||||
if ( addr != -1 )
|
||||
{
|
||||
nesSetGotoAddress(addr);
|
||||
@@ -347,7 +359,7 @@ void CodeBrowserDockWidget::on_actionRun_to_here_triggered()
|
||||
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = c64GetAddressFromSLOC(index.row());
|
||||
absAddr = c64GetAbsoluteAddressFromAddress(addr);
|
||||
physAddr = c64GetPhysicalAddressFromAddress(addr);
|
||||
if ( addr != -1 )
|
||||
{
|
||||
c64SetGotoAddress(addr);
|
||||
@@ -388,6 +400,48 @@ 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();
|
||||
@@ -399,7 +453,7 @@ void CodeBrowserDockWidget::on_actionStart_marker_here_triggered()
|
||||
{
|
||||
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = nesGetAddressFromSLOC(index.row());
|
||||
addr = nesGetVirtualAddressFromSLOC(index.row());
|
||||
}
|
||||
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
@@ -411,11 +465,11 @@ void CodeBrowserDockWidget::on_actionStart_marker_here_triggered()
|
||||
// Find unused Marker entry...
|
||||
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
marker = markers->AddMarker(addr,nesGetAbsoluteAddressFromAddress(addr));
|
||||
marker = markers->AddMarker(addr,nesGetPhysicalAddressFromAddress(addr));
|
||||
}
|
||||
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
marker = markers->AddMarker(addr,c64GetAbsoluteAddressFromAddress(addr));
|
||||
marker = markers->AddMarker(addr,c64GetPhysicalAddressFromAddress(addr));
|
||||
}
|
||||
|
||||
emit breakpointsChanged();
|
||||
@@ -435,7 +489,7 @@ void CodeBrowserDockWidget::on_actionEnd_marker_here_triggered()
|
||||
{
|
||||
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = nesGetAddressFromSLOC(index.row());
|
||||
addr = nesGetVirtualAddressFromSLOC(index.row());
|
||||
}
|
||||
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
@@ -446,11 +500,11 @@ void CodeBrowserDockWidget::on_actionEnd_marker_here_triggered()
|
||||
{
|
||||
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
markers->CompleteMarker(marker,addr,nesGetAbsoluteAddressFromAddress(addr));
|
||||
markers->CompleteMarker(marker,addr,nesGetPhysicalAddressFromAddress(addr));
|
||||
}
|
||||
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
markers->CompleteMarker(marker,addr,c64GetAbsoluteAddressFromAddress(addr));
|
||||
markers->CompleteMarker(marker,addr,c64GetPhysicalAddressFromAddress(addr));
|
||||
}
|
||||
|
||||
emit breakpointsChanged();
|
||||
@@ -472,7 +526,7 @@ void CodeBrowserDockWidget::on_tableView_pressed(QModelIndex index)
|
||||
{
|
||||
int bp;
|
||||
int addr = 0;
|
||||
int absAddr = 0;
|
||||
int physAddr = 0;
|
||||
|
||||
if ( QApplication::mouseButtons() == Qt::LeftButton )
|
||||
{
|
||||
@@ -480,13 +534,13 @@ void CodeBrowserDockWidget::on_tableView_pressed(QModelIndex index)
|
||||
{
|
||||
if ( !m_loadedTarget.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = nesGetAddressFromSLOC(index.row());
|
||||
absAddr = nesGetAbsoluteAddressFromAddress(addr);
|
||||
addr = nesGetVirtualAddressFromSLOC(index.row());
|
||||
physAddr = nesGetPhysicalAddressFromAddress(addr);
|
||||
}
|
||||
else if ( !m_loadedTarget.compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
addr = c64GetAddressFromSLOC(index.row());
|
||||
absAddr = c64GetAbsoluteAddressFromAddress(addr);
|
||||
physAddr = c64GetPhysicalAddressFromAddress(addr);
|
||||
}
|
||||
|
||||
if ( addr != -1 )
|
||||
@@ -495,7 +549,7 @@ void CodeBrowserDockWidget::on_tableView_pressed(QModelIndex index)
|
||||
eBreakpointItemAddress,
|
||||
0,
|
||||
addr,
|
||||
absAddr,
|
||||
physAddr,
|
||||
addr,
|
||||
0xFFFF,
|
||||
true,
|
||||
|
||||
@@ -55,6 +55,7 @@ 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();
|
||||
};
|
||||
|
||||
@@ -24,7 +24,16 @@
|
||||
</property>
|
||||
<widget class="QWidget" name="dockWidgetContents">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<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">
|
||||
@@ -51,7 +60,7 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
<enum>QAbstractItemView::ContiguousSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
@@ -83,12 +92,12 @@
|
||||
<attribute name="horizontalHeaderCascadingSectionResizes">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||
<number>50</number>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderMinimumSectionSize">
|
||||
<number>26</number>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||
<number>50</number>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
@@ -98,10 +107,10 @@
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<number>23</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<number>23</number>
|
||||
</attribute>
|
||||
</widget>
|
||||
@@ -180,6 +189,14 @@
|
||||
<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/>
|
||||
|
||||
@@ -20,8 +20,17 @@ CodeProfilerDockWidget::CodeProfilerDockWidget(QWidget *parent) :
|
||||
|
||||
ui->tableView->sortByColumn(CodeProfilerCol_Calls,Qt::DescendingOrder);
|
||||
|
||||
QObject::connect(ui->tableView->horizontalHeader(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),model,SLOT(sort(int,Qt::SortOrder)));
|
||||
#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()));
|
||||
}
|
||||
|
||||
@@ -32,8 +41,8 @@ CodeProfilerDockWidget::~CodeProfilerDockWidget()
|
||||
|
||||
void CodeProfilerDockWidget::updateTargetMachine(QString /*target*/)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(breakpointWatcher,SIGNAL(breakpointHit()),model,SLOT(update()));
|
||||
if ( emulator )
|
||||
@@ -46,7 +55,7 @@ void CodeProfilerDockWidget::updateTargetMachine(QString /*target*/)
|
||||
|
||||
void CodeProfilerDockWidget::showEvent(QShowEvent */*event*/)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
if ( emulator )
|
||||
{
|
||||
@@ -57,7 +66,7 @@ void CodeProfilerDockWidget::showEvent(QShowEvent */*event*/)
|
||||
|
||||
void CodeProfilerDockWidget::hideEvent(QHideEvent */*event*/)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
if ( emulator )
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderVisible">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderCascadingSectionResizes">
|
||||
<bool>false</bool>
|
||||
@@ -86,16 +86,19 @@
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<number>23</number>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderMinimumSectionSize">
|
||||
<attribute name="verticalHeaderDefaultSectionSize">
|
||||
<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">
|
||||
@@ -134,7 +137,6 @@
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../common/resource.qrc"/>
|
||||
<include location="../../../common/resource.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -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::getSymbolIndexFromSegment(m_items.at(index.row()).symbol,m_items.at(index.row()).segment);
|
||||
symbolIdx = CCC65Interface::instance()->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::getSymbolAddress(m_items.at(index.row()).symbol,symbolIdx);
|
||||
absAddr = CCC65Interface::getSymbolAbsoluteAddress(m_items.at(index.row()).symbol,symbolIdx);
|
||||
addr = CCC65Interface::instance()->getSymbolAddress(m_items.at(index.row()).symbol,symbolIdx);
|
||||
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(m_items.at(index.row()).symbol,symbolIdx);
|
||||
if ( addr != -1 )
|
||||
{
|
||||
nesGetPrintableAddressWithAbsolute(modelStringBuffer,addr,absAddr);
|
||||
nesGetPrintablePhysicalAddress(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::getSymbolSize(m_items.at(index.row()).symbol,symbolIdx);
|
||||
size = CCC65Interface::instance()->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::getSymbolAddress(m_items.at(index.row()).symbol,symbolIdx);
|
||||
addr = CCC65Interface::instance()->getSymbolAddress(m_items.at(index.row()).symbol,symbolIdx);
|
||||
if ( addr != -1 )
|
||||
{
|
||||
char* bufferPtr = modelStringBuffer;
|
||||
unsigned int symbolSize = CCC65Interface::getSymbolSize(m_items.at(index.row()).symbol,symbolIdx);
|
||||
unsigned int symbolSize = CCC65Interface::instance()->getSymbolSize(m_items.at(index.row()).symbol,symbolIdx);
|
||||
|
||||
// If symbol size <= 10 print values as an array, seperated by commas
|
||||
if ((symbolSize > 0) && (symbolSize <= 10))
|
||||
@@ -130,10 +130,10 @@ QVariant CSymbolWatchModel::data(const QModelIndex& index, int role) const
|
||||
}
|
||||
break;
|
||||
case SymbolWatchCol_Segment:
|
||||
return CCC65Interface::getSymbolSegmentName(m_items.at(index.row()).symbol,symbolIdx);
|
||||
return CCC65Interface::instance()->getSymbolSegmentName(m_items.at(index.row()).symbol,symbolIdx);
|
||||
break;
|
||||
case SymbolWatchCol_File:
|
||||
return CCC65Interface::getSourceFileFromSymbol(m_items.at(index.row()).symbol);
|
||||
return CCC65Interface::instance()->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::getSymbolAddress(m_items.at(index.row()).symbol,CCC65Interface::getSymbolIndexFromSegment(value.toString(),m_items.at(index.row()).segment));
|
||||
addr = CCC65Interface::instance()->getSymbolAddress(m_items.at(index.row()).symbol,CCC65Interface::instance()->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::getSymbolMatchCount(text);
|
||||
count = CCC65Interface::instance()->getSymbolMatchCount(text);
|
||||
if ( count > 1 )
|
||||
{
|
||||
for ( idx = 0; idx < count; idx++ )
|
||||
{
|
||||
checkAddr = CCC65Interface::getSymbolAddress(text,idx);
|
||||
checkAddr = CCC65Interface::instance()->getSymbolAddress(text,idx);
|
||||
if ( checkAddr == addr )
|
||||
{
|
||||
selIdx = idx;
|
||||
break;
|
||||
}
|
||||
absAddr = CCC65Interface::getSymbolAbsoluteAddress(text,idx);
|
||||
symbolFile = CCC65Interface::getSourceFileFromSymbol(text);
|
||||
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(text,idx);
|
||||
symbolFile = CCC65Interface::instance()->getSourceFileFromSymbol(text);
|
||||
|
||||
symbol = text;
|
||||
symbol += " @";
|
||||
nesGetPrintableAddressWithAbsolute(modelStringBuffer,checkAddr,absAddr);
|
||||
nesGetPrintablePhysicalAddress(modelStringBuffer,checkAddr,absAddr);
|
||||
symbol += modelStringBuffer;
|
||||
symbol += " in ";
|
||||
symbol += symbolFile;
|
||||
@@ -356,7 +356,7 @@ int CSymbolWatchModel::resolveSymbol(QString text,int addr)
|
||||
}
|
||||
}
|
||||
}
|
||||
return CCC65Interface::getSymbolSegment(text,selIdx);
|
||||
return CCC65Interface::instance()->getSymbolSegment(text,selIdx);
|
||||
}
|
||||
|
||||
void CSymbolWatchModel::sort(int column, Qt::SortOrder order)
|
||||
|
||||
@@ -4,28 +4,75 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
DebuggerUpdateThread::DebuggerUpdateThread(void (*func)(),QObject */*parent*/) :
|
||||
QObject(),_func(func)
|
||||
QThread *DebuggerUpdateThread::pThread = NULL;
|
||||
int DebuggerUpdateThread::resourceCount = -1;
|
||||
QMutex *DebuggerUpdateThread::pMutex = NULL;
|
||||
bool DebuggerUpdateThread::silenced = true;
|
||||
|
||||
DebuggerUpdateWorker::DebuggerUpdateWorker(void (*func)(),QObject */*parent*/) :
|
||||
_func(func)
|
||||
{
|
||||
pThread = new QThread();
|
||||
}
|
||||
|
||||
moveToThread(pThread);
|
||||
DebuggerUpdateWorker::~DebuggerUpdateWorker()
|
||||
{
|
||||
}
|
||||
|
||||
pThread->start();
|
||||
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);
|
||||
}
|
||||
|
||||
DebuggerUpdateThread::~DebuggerUpdateThread()
|
||||
{
|
||||
_func = NULL;
|
||||
pThread->exit(0);
|
||||
pThread->wait();
|
||||
delete pThread;
|
||||
delete pWorker;
|
||||
pWorker = NULL;
|
||||
|
||||
pMutex->lock();
|
||||
resourceCount--;
|
||||
if ( resourceCount == 0 )
|
||||
{
|
||||
resourceCount = -1;
|
||||
pThread->exit(0);
|
||||
pThread->wait();
|
||||
delete pThread;
|
||||
}
|
||||
pMutex->unlock();
|
||||
}
|
||||
|
||||
void DebuggerUpdateThread::updateDebuggers()
|
||||
{
|
||||
if ( _func )
|
||||
_func();
|
||||
|
||||
emit updateComplete();
|
||||
if ( !silenced )
|
||||
{
|
||||
pWorker->updateDebuggers();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
#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
|
||||
{
|
||||
@@ -10,17 +28,23 @@ public:
|
||||
explicit DebuggerUpdateThread(void (*func)(),QObject *parent = 0);
|
||||
~DebuggerUpdateThread();
|
||||
|
||||
void changeFunction(void (*func)()) { _func = func; }
|
||||
void changeFunction(void (*func)()) { pWorker->changeFunction(func); }
|
||||
|
||||
signals:
|
||||
void updateComplete();
|
||||
static void silence(bool silence) { silenced = silence; }
|
||||
static bool isSilenced() { return silenced; }
|
||||
|
||||
public slots:
|
||||
void updateDebuggers();
|
||||
|
||||
signals:
|
||||
void updateComplete();
|
||||
|
||||
private:
|
||||
void (*_func)();
|
||||
QThread* pThread;
|
||||
DebuggerUpdateWorker *pWorker;
|
||||
static QThread *pThread;
|
||||
static QMutex *pMutex;
|
||||
static int resourceCount;
|
||||
static bool silenced;
|
||||
};
|
||||
|
||||
#endif // DEBUGGERUPDATETHREAD_H
|
||||
|
||||
@@ -17,6 +17,16 @@ 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()
|
||||
@@ -27,8 +37,8 @@ ExecutionInspectorDockWidget::~ExecutionInspectorDockWidget()
|
||||
|
||||
void ExecutionInspectorDockWidget::updateTargetMachine(QString /*target*/)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), this, SLOT(updateTracer()) );
|
||||
QObject::connect ( breakpointWatcher, SIGNAL(breakpointHit()), model, SLOT(update()) );
|
||||
@@ -36,13 +46,14 @@ 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::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
if ( emulator )
|
||||
{
|
||||
@@ -54,7 +65,7 @@ void ExecutionInspectorDockWidget::showEvent(QShowEvent* /*e*/)
|
||||
|
||||
void ExecutionInspectorDockWidget::hideEvent(QHideEvent* /*e*/)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
if ( emulator )
|
||||
{
|
||||
@@ -99,7 +110,6 @@ void ExecutionInspectorDockWidget::updateTracer ()
|
||||
{
|
||||
// Update display...
|
||||
show();
|
||||
ui->tableView->resizeColumnsToContents();
|
||||
ui->tableView->setCurrentIndex(model->index(0,0));
|
||||
}
|
||||
else if ( (pBreakpoint->type == eBreakOnPPUFetch) &&
|
||||
@@ -107,22 +117,24 @@ 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,7 +22,18 @@ MemoryInspectorDockWidget::MemoryInspectorDockWidget(memDBFunc memDB,CBreakpoint
|
||||
ui->tableView->setModel(model);
|
||||
ui->tableView->setItemDelegate(delegate);
|
||||
|
||||
m_memDB = memDB;
|
||||
#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();
|
||||
}
|
||||
|
||||
MemoryInspectorDockWidget::~MemoryInspectorDockWidget()
|
||||
@@ -34,25 +45,29 @@ MemoryInspectorDockWidget::~MemoryInspectorDockWidget()
|
||||
|
||||
void MemoryInspectorDockWidget::updateTargetMachine(QString /*target*/)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->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()), model, SLOT(update()));
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), model, SLOT(update()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), model, SLOT(update()) );
|
||||
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()) );
|
||||
}
|
||||
}
|
||||
|
||||
void MemoryInspectorDockWidget::showEvent(QShowEvent* /*e*/)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->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();
|
||||
@@ -61,10 +76,15 @@ void MemoryInspectorDockWidget::showEvent(QShowEvent* /*e*/)
|
||||
|
||||
void MemoryInspectorDockWidget::hideEvent(QHideEvent* /*e*/)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->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()));
|
||||
}
|
||||
}
|
||||
@@ -104,6 +124,8 @@ 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++ )
|
||||
{
|
||||
@@ -133,7 +155,8 @@ void MemoryInspectorDockWidget::updateMemory ()
|
||||
((pBreakpoint->target == eBreakInPPU) &&
|
||||
((memoryType == eMemory_PPU) ||
|
||||
(memoryType == eMemory_PPUpalette) ||
|
||||
(memoryType == eMemory_cartCHRMEM))) )
|
||||
(memoryType == eMemory_cartCHRMEM) ||
|
||||
(memoryType == eMemory_cartVRAM))) )
|
||||
{
|
||||
// Change memory address into row/column of display...
|
||||
itemActual = pBreakpoint->itemActual - model->memoryBottom();
|
||||
@@ -156,7 +179,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,
|
||||
@@ -186,7 +209,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,
|
||||
@@ -216,7 +239,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,7 +40,8 @@ private:
|
||||
CDebuggerMemoryDisplayModel* model;
|
||||
CDebuggerNumericItemDelegate* delegate;
|
||||
CBreakpointInfo* m_pBreakpoints;
|
||||
memDBFunc m_memDB;
|
||||
memDBFunc m_memDBFunc;
|
||||
CMemoryDatabase* m_memDB;
|
||||
|
||||
private slots:
|
||||
void on_actionBreak_on_CPU_write_here_triggered();
|
||||
|
||||
@@ -22,12 +22,26 @@ RegisterInspectorDockWidget::RegisterInspectorDockWidget(regDBFunc regDB,CBreakp
|
||||
ui->bitfieldView->setModel(bitfieldModel);
|
||||
ui->bitfieldView->setItemDelegate(bitfieldDelegate);
|
||||
|
||||
m_regDB = regDB;
|
||||
m_regDBFunc = 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()) );
|
||||
@@ -45,31 +59,33 @@ RegisterInspectorDockWidget::~RegisterInspectorDockWidget()
|
||||
|
||||
void RegisterInspectorDockWidget::updateTargetMachine(QString /*target*/)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->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(machineReady()), this, SLOT(updateMemory()));
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), 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()));
|
||||
}
|
||||
@@ -79,10 +95,19 @@ void RegisterInspectorDockWidget::showEvent(QShowEvent* /*e*/)
|
||||
|
||||
void RegisterInspectorDockWidget::hideEvent(QHideEvent* /*e*/)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->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()));
|
||||
}
|
||||
@@ -115,15 +140,17 @@ 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_regDB == nesGetCartridgeRegisterDatabase )
|
||||
if ( m_regDBFunc == nesGetCartridgeRegisterDatabase )
|
||||
{
|
||||
sprintf ( buffer, "Mapper %d: %s Register Inspector", nesGetMapper(), mapperNameFromID(nesGetMapper()) );
|
||||
setWindowTitle ( buffer );
|
||||
@@ -193,9 +220,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();
|
||||
@@ -225,9 +252,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 );
|
||||
}
|
||||
|
||||
@@ -241,9 +268,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 );
|
||||
}
|
||||
|
||||
@@ -257,9 +284,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 );
|
||||
}
|
||||
|
||||
@@ -273,9 +300,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 );
|
||||
}
|
||||
|
||||
@@ -289,9 +316,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 );
|
||||
}
|
||||
|
||||
@@ -305,9 +332,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 );
|
||||
}
|
||||
|
||||
@@ -317,12 +344,18 @@ void RegisterInspectorDockWidget::on_binaryView_entered(QModelIndex index)
|
||||
|
||||
void RegisterInspectorDockWidget::on_bitfieldView_clicked(QModelIndex index)
|
||||
{
|
||||
bitfieldDelegate->setBitfield ( m_regDB()->GetRegister(m_register)->GetBitfield(index.row()) );
|
||||
binaryModel->update();
|
||||
if ( m_regDB )
|
||||
{
|
||||
bitfieldDelegate->setBitfield ( m_regDB->GetRegister(m_register)->GetBitfield(index.row()) );
|
||||
binaryModel->update();
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterInspectorDockWidget::on_bitfieldView_doubleClicked(QModelIndex index)
|
||||
{
|
||||
bitfieldDelegate->setBitfield ( m_regDB()->GetRegister(m_register)->GetBitfield(index.row()) );
|
||||
binaryModel->update();
|
||||
if ( m_regDB )
|
||||
{
|
||||
bitfieldDelegate->setBitfield ( m_regDB->GetRegister(m_register)->GetBitfield(index.row()) );
|
||||
binaryModel->update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,8 @@ private:
|
||||
CDebuggerBitfieldComboBoxDelegate* bitfieldDelegate;
|
||||
CDebuggerNumericItemDelegate* binaryDelegate;
|
||||
CBreakpointInfo* m_pBreakpoints;
|
||||
regDBFunc m_regDB;
|
||||
regDBFunc m_regDBFunc;
|
||||
CRegisterDatabase* m_regDB;
|
||||
int m_register;
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -35,6 +35,19 @@ 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)));
|
||||
@@ -58,8 +71,8 @@ void SymbolWatchDockWidget::createNesUi()
|
||||
return;
|
||||
}
|
||||
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
sramTab = new QWidget();
|
||||
sramTab->setObjectName(QString::fromUtf8("sramTab"));
|
||||
@@ -128,6 +141,19 @@ 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)));
|
||||
|
||||
@@ -184,9 +210,9 @@ void SymbolWatchDockWidget::destroyC64Ui()
|
||||
|
||||
void SymbolWatchDockWidget::updateTargetMachine(QString target)
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* compiler = CObjectRegistry::getObject("Compiler");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
QObject* compiler = CObjectRegistry::instance()->getObject("Compiler");
|
||||
|
||||
if ( !target.compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
@@ -228,7 +254,7 @@ void SymbolWatchDockWidget::updateUi()
|
||||
|
||||
void SymbolWatchDockWidget::updateVariables()
|
||||
{
|
||||
QStringList symbols = CCC65Interface::getSymbolsForSourceFile("");
|
||||
QStringList symbols = CCC65Interface::instance()->getSymbolsForSourceFile("");
|
||||
int addr;
|
||||
|
||||
if ( !m_targetLoaded.compare("nes",Qt::CaseInsensitive) )
|
||||
@@ -238,7 +264,7 @@ void SymbolWatchDockWidget::updateVariables()
|
||||
exramModel->removeRows(0,exramModel->rowCount());
|
||||
foreach ( QString symbol,symbols )
|
||||
{
|
||||
addr = CCC65Interface::getSymbolAddress(symbol);
|
||||
addr = CCC65Interface::instance()->getSymbolAddress(symbol);
|
||||
if ( addr < MEM_2KB )
|
||||
{
|
||||
// Symbol is in RAM...
|
||||
@@ -264,7 +290,7 @@ void SymbolWatchDockWidget::updateVariables()
|
||||
ramModel->removeRows(0,ramModel->rowCount());
|
||||
foreach ( QString symbol,symbols )
|
||||
{
|
||||
addr = CCC65Interface::getSymbolAddress(symbol);
|
||||
addr = CCC65Interface::instance()->getSymbolAddress(symbol);
|
||||
|
||||
// Symbol is in RAM...
|
||||
ramModel->insertRow(symbol,addr);
|
||||
@@ -380,7 +406,7 @@ void SymbolWatchDockWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
|
||||
void SymbolWatchDockWidget::showEvent(QShowEvent*)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
if ( emulator )
|
||||
{
|
||||
@@ -415,7 +441,7 @@ void SymbolWatchDockWidget::showEvent(QShowEvent*)
|
||||
|
||||
void SymbolWatchDockWidget::hideEvent(QHideEvent */*event*/)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
if ( emulator )
|
||||
{
|
||||
@@ -717,7 +743,7 @@ void SymbolWatchDockWidget::on_actionGo_to_Definition_triggered()
|
||||
}
|
||||
|
||||
symbol = index.data(Qt::DisplayRole).toString();
|
||||
file = CCC65Interface::getSourceFileFromSymbol(symbol);
|
||||
file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
|
||||
|
||||
emit snapTo("SourceNavigatorFile,"+file);
|
||||
emit snapTo("SourceNavigatorSymbol,"+symbol);
|
||||
@@ -761,7 +787,7 @@ void SymbolWatchDockWidget::exram_doubleClicked(const QModelIndex &index)
|
||||
|
||||
void SymbolWatchDockWidget::on_tabWidget_currentChanged(int index)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
if ( emulator )
|
||||
{
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
CDesignerEditorBase::CDesignerEditorBase(IProjectTreeViewItem* link,QWidget *parent) :
|
||||
QMainWindow(parent)
|
||||
{
|
||||
QWidget* searchBar = CDockWidgetRegistry::getWidget("Search Bar");
|
||||
QWidget* search = CDockWidgetRegistry::getWidget("Search");
|
||||
QWidget* searchBar = CDockWidgetRegistry::instance()->getWidget("Search Bar");
|
||||
QWidget* search = CDockWidgetRegistry::instance()->getWidget("Search");
|
||||
|
||||
InitTabItem(link);
|
||||
|
||||
|
||||
Regular → Executable
+141
-98
@@ -5,6 +5,7 @@
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
#include <QPixmap>
|
||||
#include <QStringList>
|
||||
|
||||
#include "Qsci/qsciscintillabase.h"
|
||||
|
||||
@@ -31,10 +32,10 @@ CodeEditorForm::CodeEditorForm(QString fileName,QString sourceCode,IProjectTreeV
|
||||
m_scintilla(NULL),
|
||||
m_apis(NULL)
|
||||
{
|
||||
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"));
|
||||
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"));
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
|
||||
CMarker* markers = nesGetExecutionMarkerDatabase();
|
||||
MarkerSetInfo* pMarker;
|
||||
@@ -70,7 +71,7 @@ CodeEditorForm::CodeEditorForm(QString fileName,QString sourceCode,IProjectTreeV
|
||||
m_scintilla->setAutoCompletionThreshold(2);
|
||||
m_scintilla->setAutoCompletionCaseSensitivity(false);
|
||||
m_scintilla->setAutoCompletionReplaceWord(false);
|
||||
m_scintilla->setAutoCompletionUseSingle(QsciScintilla::AcusAlways);
|
||||
m_scintilla->setAutoCompletionUseSingle(QsciScintilla::AcusNever);
|
||||
|
||||
m_scintilla->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
m_scintilla->setMarginWidth(4,0);
|
||||
@@ -133,9 +134,9 @@ CodeEditorForm::CodeEditorForm(QString fileName,QString sourceCode,IProjectTreeV
|
||||
QObject::connect ( executionVisualizer, SIGNAL(breakpointsChanged()), this, SLOT(external_breakpointsChanged()) );
|
||||
}
|
||||
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* compiler = CObjectRegistry::getObject("Compiler");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
QObject* compiler = CObjectRegistry::instance()->getObject("Compiler");
|
||||
|
||||
QObject::connect ( compiler, SIGNAL(compileStarted()), this, SLOT(compiler_compileStarted()) );
|
||||
QObject::connect ( compiler, SIGNAL(compileDone(bool)), this, SLOT(compiler_compileDone(bool)) );
|
||||
@@ -240,6 +241,7 @@ 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;
|
||||
@@ -247,7 +249,7 @@ void CodeEditorForm::customContextMenuRequested(const QPoint &pos)
|
||||
}
|
||||
|
||||
if ( (!symbol.isEmpty()) &&
|
||||
(CCC65Interface::isStringASymbol(symbol)) )
|
||||
(CCC65Interface::instance()->isStringASymbol(symbol)) )
|
||||
{
|
||||
QString str = GO_TO_DEFINITION_TEXT;
|
||||
str += symbol;
|
||||
@@ -262,7 +264,7 @@ void CodeEditorForm::customContextMenuRequested(const QPoint &pos)
|
||||
|
||||
if ( (action) && (action->text().startsWith(GO_TO_DEFINITION_TEXT)) )
|
||||
{
|
||||
QString file = CCC65Interface::getSourceFileFromSymbol(symbol);
|
||||
QString file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
|
||||
emit snapToTab("SourceNavigatorFile,"+file);
|
||||
emit snapToTab("SourceNavigatorSymbol,"+symbol);
|
||||
}
|
||||
@@ -398,7 +400,7 @@ void CodeEditorForm::compiler_compileDone(bool ok)
|
||||
|
||||
for ( line = 0; line < m_scintilla->lines(); line++ )
|
||||
{
|
||||
if ( CCC65Interface::isErrorOnLineOfFile(m_fileName,line+1) )
|
||||
if ( CCC65Interface::instance()->isErrorOnLineOfFile(m_fileName,line+1) )
|
||||
{
|
||||
m_scintilla->markerAdd(line,Marker_Error);
|
||||
}
|
||||
@@ -445,11 +447,11 @@ void CodeEditorForm::external_breakpointsChanged()
|
||||
|
||||
for ( line = 0; line < m_scintilla->lines(); line++ )
|
||||
{
|
||||
asmcount = CCC65Interface::getLineMatchCount(m_fileName,line+1);
|
||||
asmcount = CCC65Interface::instance()->getLineMatchCount(m_fileName,line+1);
|
||||
for ( asmline = 0; asmline < asmcount; asmline++ )
|
||||
{
|
||||
addr = CCC65Interface::getAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
absAddr = CCC65Interface::getAbsoluteAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
addr = CCC65Interface::instance()->getAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
absAddr = CCC65Interface::instance()->getPhysicalAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
|
||||
if ( addr != (unsigned int)-1 )
|
||||
{
|
||||
@@ -477,14 +479,14 @@ void CodeEditorForm::external_breakpointsChanged()
|
||||
if ( (pBreakpoint->enabled) &&
|
||||
(pBreakpoint->type == eBreakOnCPUExecution) &&
|
||||
(pBreakpoint->item1 <= addr) &&
|
||||
((absAddr == (unsigned int)-1) || (absAddr == pBreakpoint->item1Absolute)) )
|
||||
((absAddr == (unsigned int)-1) || (absAddr == pBreakpoint->item1Physical)) )
|
||||
{
|
||||
m_scintilla->markerAdd(line,Marker_Breakpoint);
|
||||
}
|
||||
else if ( (!pBreakpoint->enabled) &&
|
||||
(pBreakpoint->type == eBreakOnCPUExecution) &&
|
||||
(pBreakpoint->item1 <= addr) &&
|
||||
((absAddr == (unsigned int)-1) || (absAddr == pBreakpoint->item1Absolute)) )
|
||||
((absAddr == (unsigned int)-1) || (absAddr == pBreakpoint->item1Physical)) )
|
||||
{
|
||||
m_scintilla->markerAdd(line,Marker_BreakpointDisabled);
|
||||
}
|
||||
@@ -695,30 +697,30 @@ void CodeEditorForm::updateToolTip(QString symbol)
|
||||
if ( EnvironmentSettingsDialog::showSymbolTips() )
|
||||
{
|
||||
// Look for C-language emitted symbols [prepended with underscore]...
|
||||
if ( (CCC65Interface::getSymbolType(clangSymbol) == CC65_SYM_LABEL) ||
|
||||
(CCC65Interface::getSymbolType(clangSymbol) == CC65_SYM_IMPORT) )
|
||||
if ( (CCC65Interface::instance()->getSymbolType(clangSymbol) == CC65_SYM_LABEL) ||
|
||||
(CCC65Interface::instance()->getSymbolType(clangSymbol) == CC65_SYM_IMPORT) )
|
||||
{
|
||||
symbol = clangSymbol;
|
||||
}
|
||||
if ( (CCC65Interface::getSymbolType(symbol) == CC65_SYM_LABEL) ||
|
||||
(CCC65Interface::getSymbolType(symbol) == CC65_SYM_IMPORT) )
|
||||
if ( (CCC65Interface::instance()->getSymbolType(symbol) == CC65_SYM_LABEL) ||
|
||||
(CCC65Interface::instance()->getSymbolType(symbol) == CC65_SYM_IMPORT) )
|
||||
{
|
||||
addr = CCC65Interface::getSymbolAddress(symbol);
|
||||
addr = CCC65Interface::instance()->getSymbolAddress(symbol);
|
||||
|
||||
if ( addr != 0xFFFFFFFF )
|
||||
{
|
||||
absAddr = CCC65Interface::getSymbolAbsoluteAddress(symbol);
|
||||
absAddr = CCC65Interface::instance()->getSymbolPhysicalAddress(symbol);
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesGetPrintableAddressWithAbsolute(address,addr,absAddr);
|
||||
nesGetPrintablePhysicalAddress(address,addr,absAddr);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
c64GetPrintableAddressWithAbsolute(address,addr,absAddr);
|
||||
c64GetPrintablePhysicalAddress(address,addr,absAddr);
|
||||
}
|
||||
|
||||
file = CCC65Interface::getSourceFileFromSymbol(symbol);
|
||||
line = CCC65Interface::getSourceLineFromFileAndSymbol(file,symbol);
|
||||
file = CCC65Interface::instance()->getSourceFileFromSymbol(symbol);
|
||||
line = CCC65Interface::instance()->getSourceLineFromFileAndSymbol(file,symbol);
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
@@ -731,9 +733,9 @@ void CodeEditorForm::updateToolTip(QString symbol)
|
||||
setToolTip(toolTipText);
|
||||
}
|
||||
}
|
||||
else if ( CCC65Interface::getSymbolType(symbol) == CC65_SYM_EQUATE )
|
||||
else if ( CCC65Interface::instance()->getSymbolType(symbol) == CC65_SYM_EQUATE )
|
||||
{
|
||||
addr = CCC65Interface::getSymbolAddress(symbol);
|
||||
addr = CCC65Interface::instance()->getSymbolAddress(symbol);
|
||||
|
||||
sprintf(toolTipText,TOOLTIP_EQUATE,symbol.toLatin1().constData(),addr);
|
||||
setToolTip(toolTipText);
|
||||
@@ -844,6 +846,45 @@ 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();
|
||||
@@ -920,14 +961,7 @@ void CodeEditorForm::setSourceCode(QString source)
|
||||
// Force EOL conversion if desired.
|
||||
if ( EnvironmentSettingsDialog::eolForceConsistent() )
|
||||
{
|
||||
// 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());
|
||||
}
|
||||
m_scintilla->convertEols((QsciScintilla::EolMode)EnvironmentSettingsDialog::eolMode());
|
||||
}
|
||||
|
||||
// Force repaint of error tags.
|
||||
@@ -981,23 +1015,23 @@ void CodeEditorForm::resolveLineAddress(int line, int *addr, int *absAddr)
|
||||
int asmline;
|
||||
bool ok;
|
||||
|
||||
asmcount = CCC65Interface::getLineMatchCount(m_fileName,line+1);
|
||||
asmcount = CCC65Interface::instance()->getLineMatchCount(m_fileName,line+1);
|
||||
if ( asmcount > 1 )
|
||||
{
|
||||
for ( asmline = 0; asmline < asmcount; asmline++ )
|
||||
{
|
||||
(*addr) = CCC65Interface::getAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
(*absAddr) = CCC65Interface::getAbsoluteAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
(*addr) = CCC65Interface::instance()->getAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
(*absAddr) = CCC65Interface::instance()->getPhysicalAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesGetPrintableAddressWithAbsolute(resolutionBuffer,(*addr),(*absAddr));
|
||||
nesGetDisassemblyAtAbsoluteAddress((*absAddr),resolutionBuffer);
|
||||
nesGetPrintablePhysicalAddress(resolutionBuffer,(*addr),(*absAddr));
|
||||
nesGetDisassemblyAtPhysicalAddress((*absAddr),resolutionBuffer);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
c64GetPrintableAddressWithAbsolute(resolutionBuffer,(*addr),(*absAddr));
|
||||
c64GetDisassemblyAtAbsoluteAddress((*absAddr),resolutionBuffer);
|
||||
c64GetPrintablePhysicalAddress(resolutionBuffer,(*addr),(*absAddr));
|
||||
c64GetDisassemblyAtPhysicalAddress((*absAddr),resolutionBuffer);
|
||||
}
|
||||
asmChunk = resolutionBuffer;
|
||||
asmChunk += ":";
|
||||
@@ -1026,8 +1060,8 @@ void CodeEditorForm::resolveLineAddress(int line, int *addr, int *absAddr)
|
||||
}
|
||||
else
|
||||
{
|
||||
(*addr) = CCC65Interface::getAddressFromFileAndLine(m_fileName,line+1);
|
||||
(*absAddr) = CCC65Interface::getAbsoluteAddressFromFileAndLine(m_fileName,line+1);
|
||||
(*addr) = CCC65Interface::instance()->getAddressFromFileAndLine(m_fileName,line+1);
|
||||
(*absAddr) = CCC65Interface::instance()->getPhysicalAddressFromFileAndLine(m_fileName,line+1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1058,12 +1092,12 @@ void CodeEditorForm::annotateText()
|
||||
first = true;
|
||||
firstBlock = true;
|
||||
|
||||
asmcount = CCC65Interface::getLineMatchCount(m_fileName,line+1);
|
||||
asmcount = CCC65Interface::instance()->getLineMatchCount(m_fileName,line+1);
|
||||
for ( asmline = 0; asmline < asmcount; asmline++ )
|
||||
{
|
||||
addr = CCC65Interface::getAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
absAddr = CCC65Interface::getAbsoluteAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
endAddr = CCC65Interface::getEndAddressFromAbsoluteAddress(addr,absAddr);
|
||||
addr = CCC65Interface::instance()->getAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
absAddr = CCC65Interface::instance()->getPhysicalAddressFromFileAndLine(m_fileName,line+1,asmline);
|
||||
endAddr = CCC65Interface::instance()->getEndAddressFromPhysicalAddress(addr,absAddr);
|
||||
|
||||
if ( (addr != -1) && (absAddr != -1) && (endAddr != -1) )
|
||||
{
|
||||
@@ -1075,15 +1109,15 @@ void CodeEditorForm::annotateText()
|
||||
|
||||
for ( ; addr <= endAddr; addr++, absAddr++ )
|
||||
{
|
||||
if ( CCC65Interface::isAbsoluteAddressAnOpcode(absAddr) )
|
||||
if ( CCC65Interface::instance()->isPhysicalAddressAnOpcode(absAddr) )
|
||||
{
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesGetDisassemblyAtAbsoluteAddress(absAddr,disassembly);
|
||||
nesGetDisassemblyAtPhysicalAddress(absAddr,disassembly);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
c64GetDisassemblyAtAbsoluteAddress(absAddr,disassembly);
|
||||
c64GetDisassemblyAtPhysicalAddress(absAddr,disassembly);
|
||||
}
|
||||
if ( disassembly[0] )
|
||||
{
|
||||
@@ -1095,11 +1129,11 @@ void CodeEditorForm::annotateText()
|
||||
|
||||
if ( !nesicideProject->getProjectTarget().compare("nes",Qt::CaseInsensitive) )
|
||||
{
|
||||
nesGetPrintableAddressWithAbsolute(address,addr,absAddr);
|
||||
nesGetPrintablePhysicalAddress(address,addr,absAddr);
|
||||
}
|
||||
else if ( !nesicideProject->getProjectTarget().compare("c64",Qt::CaseInsensitive) )
|
||||
{
|
||||
c64GetPrintableAddressWithAbsolute(address,addr,absAddr);
|
||||
c64GetPrintablePhysicalAddress(address,addr,absAddr);
|
||||
}
|
||||
pAnnotationBuffer += sprintf(pAnnotationBuffer,"%s:",address);
|
||||
pAnnotationBuffer += sprintf(pAnnotationBuffer,disassembly);
|
||||
@@ -1227,10 +1261,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 = CCC65Interface::getSourceFileFromAbsoluteAddress(addr,absAddr);
|
||||
fileName = QDir::cleanPath(CCC65Interface::instance()->getSourceFileFromPhysicalAddress(addr,absAddr));
|
||||
if ( fileName == m_fileName )
|
||||
{
|
||||
line = CCC65Interface::getSourceLineFromAbsoluteAddress(addr,absAddr);
|
||||
line = CCC65Interface::instance()->getSourceLineFromPhysicalAddress(addr,absAddr);
|
||||
highlightLine(line);
|
||||
}
|
||||
}
|
||||
@@ -1268,7 +1302,8 @@ void CodeEditorForm::snapTo(QString item)
|
||||
else if ( item.startsWith("SourceNavigatorFile,") )
|
||||
{
|
||||
splits = item.split(QRegExp("[,]"));
|
||||
if ( m_fileName.endsWith(splits.at(1),Qt::CaseInsensitive) )
|
||||
QString cleanPath = QDir::cleanPath(splits.at(1));
|
||||
if ( m_fileName.endsWith(cleanPath,Qt::CaseInsensitive) )
|
||||
{
|
||||
if ( splits.count() == 3 )
|
||||
{
|
||||
@@ -1287,7 +1322,8 @@ void CodeEditorForm::snapTo(QString item)
|
||||
else if ( item.startsWith("OutputPaneFile,") )
|
||||
{
|
||||
splits = item.split(QRegExp("[,]"));
|
||||
if ( splits.at(1) == m_fileName )
|
||||
QString cleanPath = QDir::cleanPath(splits.at(1));
|
||||
if ( cleanPath == m_fileName )
|
||||
{
|
||||
if ( splits.count() == 3 )
|
||||
{
|
||||
@@ -1307,7 +1343,7 @@ void CodeEditorForm::snapTo(QString item)
|
||||
else if ( item.startsWith("SourceNavigatorSymbol,") )
|
||||
{
|
||||
splits = item.split(QRegExp("[,]"));
|
||||
line = CCC65Interface::getSourceLineFromFileAndSymbol(m_fileName,splits.at(1));
|
||||
line = CCC65Interface::instance()->getSourceLineFromFileAndSymbol(m_fileName,splits.at(1));
|
||||
if ( line >= 0 )
|
||||
{
|
||||
highlightLine(line);
|
||||
@@ -1357,7 +1393,7 @@ void CodeEditorForm::applyEnvironmentSettingsToTab()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
|
||||
int op;
|
||||
|
||||
|
||||
if ( EnvironmentSettingsDialog::foldSource() )
|
||||
{
|
||||
m_scintilla->setMarginType(Margin_Folding,QsciScintilla::SymbolMargin);
|
||||
@@ -1370,6 +1406,8 @@ 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());
|
||||
@@ -1385,53 +1423,58 @@ void CodeEditorForm::applyEnvironmentSettingsToTab()
|
||||
m_scintilla->setMarkerBackgroundColor(m_lexer->defaultPaper(),Marker_Highlight);
|
||||
}
|
||||
|
||||
m_language = Language_Default;
|
||||
m_scintilla->setLexer();
|
||||
if ( m_lexer )
|
||||
if ( m_lexer == NULL )
|
||||
{
|
||||
delete m_lexer;
|
||||
}
|
||||
m_language = Language_Default;
|
||||
m_scintilla->setLexer();
|
||||
|
||||
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(" ") )
|
||||
foreach ( QString ext, EnvironmentSettingsDialog::highlightAsC().split(" ") )
|
||||
{
|
||||
if ( m_fileName.endsWith(ext,Qt::CaseInsensitive) )
|
||||
{
|
||||
m_language = Language_Assembly;
|
||||
m_language = Language_C;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_language == Language_C )
|
||||
{
|
||||
m_lexer = new QsciLexerCC65(m_scintilla);
|
||||
}
|
||||
else if ( m_language == Language_Assembly )
|
||||
{
|
||||
m_lexer = new QsciLexerCA65(m_scintilla);
|
||||
|
||||
if ( m_apis )
|
||||
delete m_apis;
|
||||
m_apis = new QsciAPIsCA65(m_lexer);
|
||||
for ( op = 0; op < 256; op++ )
|
||||
if ( m_language == Language_Default )
|
||||
{
|
||||
QString opcodeTooltipText = OPCODEINFO(op);
|
||||
opcodeTooltipText = opcodeTooltipText.split(":")[0];
|
||||
m_apis->add(opcodeTooltipText);
|
||||
foreach ( QString ext, EnvironmentSettingsDialog::highlightAsASM().split(" ") )
|
||||
{
|
||||
if ( m_fileName.endsWith(ext,Qt::CaseInsensitive) )
|
||||
{
|
||||
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);
|
||||
|
||||
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
|
||||
{
|
||||
m_lexer = new QsciLexerDefault(m_scintilla);
|
||||
}
|
||||
m_apis->prepare();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_lexer = new QsciLexerDefault(m_scintilla);
|
||||
}
|
||||
m_scintilla->setLexer(m_lexer);
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ private:
|
||||
CBreakpointInfo* m_pBreakpoints;
|
||||
QsciScintilla* m_scintilla;
|
||||
QsciLexer* m_lexer;
|
||||
QsciAPIsCA65* m_apis;
|
||||
QsciAPIs* m_apis;
|
||||
int m_breakpointIndex;
|
||||
int m_contextMenuLine;
|
||||
int m_toolTipTimer;
|
||||
@@ -126,6 +126,7 @@ 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();
|
||||
|
||||
@@ -86,6 +86,14 @@
|
||||
<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/>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#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();
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#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
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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>
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <QFileDialog>
|
||||
#include <QSettings>
|
||||
|
||||
NewProjectDialog::NewProjectDialog(QString windowTitle,QString defName,QString defPath, QWidget* parent) :
|
||||
NewProjectDialog::NewProjectDialog(QString windowTitle,QString defName,QString defPath,bool addOnsOnly,QWidget* parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::NewProjectDialog)
|
||||
{
|
||||
@@ -18,12 +18,42 @@ 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()
|
||||
@@ -45,6 +75,35 @@ 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();
|
||||
@@ -60,6 +119,11 @@ 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();
|
||||
@@ -70,6 +134,24 @@ 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");
|
||||
@@ -100,24 +182,15 @@ void NewProjectDialog::on_name_textChanged(QString /*text*/)
|
||||
|
||||
bool NewProjectDialog::checkValidity()
|
||||
{
|
||||
// Hackety hack (but then again so is using "new project dialog" for adding
|
||||
// source files)
|
||||
if( windowTitle() == "New Source" )
|
||||
QDir check(ui->path->text());
|
||||
|
||||
if ( !ui->path->text().isEmpty() && !ui->name->text().isEmpty() )
|
||||
{
|
||||
return !ui->name->text().isEmpty();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
QDir check(ui->path->text());
|
||||
|
||||
if ( !ui->path->text().isEmpty() && !ui->name->text().isEmpty() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +204,7 @@ void NewProjectDialog::on_buttonBox_accepted()
|
||||
else
|
||||
{
|
||||
nesicideProject->setProjectTitle(getName());
|
||||
nesicideProject->setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,21 +236,40 @@ 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();
|
||||
templates.removeAll("header.s_in");
|
||||
|
||||
QDir addonsDir(":/addons/NES");
|
||||
addonsLoc = ":/addons/NES";
|
||||
addons = addonsDir.entryList();
|
||||
}
|
||||
else if ( target == "Commodore 64" )
|
||||
{
|
||||
QDir templatesDir(":/templates/C64");
|
||||
templates = templatesDir.entryList();
|
||||
templates.removeAll("header.s_in");
|
||||
|
||||
QDir addonsDir(":/addons/C64");
|
||||
addonsLoc = ":/addons/C64";
|
||||
addons = addonsDir.entryList();
|
||||
}
|
||||
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()
|
||||
@@ -196,3 +289,36 @@ 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);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define NEWPROJECTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QListWidgetItem>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@@ -12,17 +13,20 @@ class NewProjectDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NewProjectDialog(QString windowTitle = "New",QString defName = "", QString defPath = "", QWidget* parent = 0);
|
||||
NewProjectDialog(QString windowTitle = "New",QString defName = "", QString defPath = "", bool addOnsOnly = false, 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;
|
||||
@@ -35,6 +39,8 @@ 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
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>433</width>
|
||||
<height>317</height>
|
||||
<width>598</width>
|
||||
<height>402</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -41,75 +41,45 @@
|
||||
<string>General</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
<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>
|
||||
</property>
|
||||
</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>
|
||||
<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>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="target">
|
||||
@@ -125,6 +95,118 @@
|
||||
</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>
|
||||
@@ -133,8 +215,6 @@
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../common/resource.qrc"/>
|
||||
<include location="../../../common/resource.qrc"/>
|
||||
<include location="../../../common/resource.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -46,7 +46,7 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(QWidget* parent) :
|
||||
ui->linkerAdditionalDependencies->setText(nesicideProject->getLinkerAdditionalDependencies());
|
||||
ui->linkerConfigFile->setText(nesicideProject->getLinkerConfigFile());
|
||||
deserializeLinkerConfig();
|
||||
ui->customRuleFile->setText(nesicideProject->getMakefileCustomRulesFile());
|
||||
ui->customRuleFiles->addItems(nesicideProject->getMakefileCustomRuleFiles());
|
||||
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->customRuleFile->text().isEmpty() )
|
||||
if ( ui->customRuleFiles->currentText().isEmpty() )
|
||||
{
|
||||
ui->customRules->setText("Select a file to store custom makefile rules in, then modify it here.");
|
||||
ui->customRules->setEnabled(false);
|
||||
@@ -521,7 +521,13 @@ void ProjectPropertiesDialog::on_buttonBox_accepted()
|
||||
nesicideProject->setTileProperties(tilePropertyListModel->getItems());
|
||||
nesicideProject->setLinkerConfigFile(ui->linkerConfigFile->text());
|
||||
serializeLinkerConfig();
|
||||
nesicideProject->setMakefileCustomRulesFile(ui->customRuleFile->text());
|
||||
QStringList customRuleFiles;
|
||||
int idx;
|
||||
for ( idx = 0; idx < ui->customRuleFiles->count(); idx++ )
|
||||
{
|
||||
customRuleFiles += ui->customRuleFiles->itemText(idx);
|
||||
}
|
||||
nesicideProject->setMakefileCustomRuleFiles(customRuleFiles);
|
||||
serializeCustomRules();
|
||||
|
||||
nesicideProject->getProjectPaletteEntries()->clear();
|
||||
@@ -571,7 +577,7 @@ void ProjectPropertiesDialog::on_projectNameLineEdit_textEdited(QString )
|
||||
|
||||
void ProjectPropertiesDialog::on_linkerConfigFileBrowse_clicked()
|
||||
{
|
||||
QString value = QFileDialog::getSaveFileName(this,"Linker Config File",QDir::currentPath());
|
||||
QString value = QFileDialog::getOpenFileName(this,"Linker Config File",QDir::currentPath());
|
||||
QDir dir(QDir::currentPath());
|
||||
|
||||
if ( !value.isEmpty() )
|
||||
@@ -759,14 +765,18 @@ void ProjectPropertiesDialog::on_treeWidget_itemSelectionChanged()
|
||||
ui->stackedWidget->setCurrentWidget(pageMap[ui->treeWidget->currentItem()->text(0)]);
|
||||
}
|
||||
|
||||
void ProjectPropertiesDialog::serializeCustomRules()
|
||||
void ProjectPropertiesDialog::serializeCustomRules(QString rulesFile)
|
||||
{
|
||||
if ( !ui->customRuleFile->text().isEmpty() )
|
||||
if ( rulesFile.isEmpty() )
|
||||
{
|
||||
rulesFile = ui->customRuleFiles->currentText();
|
||||
}
|
||||
if ( !rulesFile.isEmpty() )
|
||||
{
|
||||
if ( customRulesChanged )
|
||||
{
|
||||
QDir dir(QDir::currentPath());
|
||||
QFile fileOut(dir.filePath(ui->customRuleFile->text()));
|
||||
QFile fileOut(dir.filePath(ui->customRuleFiles->currentText()));
|
||||
|
||||
fileOut.open(QIODevice::ReadWrite|QIODevice::Truncate|QIODevice::Text);
|
||||
if ( fileOut.isOpen() )
|
||||
@@ -776,7 +786,7 @@ void ProjectPropertiesDialog::serializeCustomRules()
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(0,"File I/O Error", "Could not write custom rules file:\n"+ui->customRuleFile->text());
|
||||
QMessageBox::critical(0,"File I/O Error", "Could not write custom rules file:\n"+rulesFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,9 +798,9 @@ void ProjectPropertiesDialog::deserializeCustomRules()
|
||||
{
|
||||
QDir dir(QDir::currentPath());
|
||||
|
||||
if ( !ui->customRuleFile->text().isEmpty() )
|
||||
if ( !ui->customRuleFiles->currentText().isEmpty() )
|
||||
{
|
||||
QFile fileIn(dir.filePath(ui->customRuleFile->text()));
|
||||
QFile fileIn(dir.filePath(ui->customRuleFiles->currentText()));
|
||||
|
||||
if ( fileIn.exists() )
|
||||
{
|
||||
@@ -802,7 +812,7 @@ void ProjectPropertiesDialog::deserializeCustomRules()
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(0,"File I/O Error", "Could not read custom rules file:\n"+ui->customRuleFile->text());
|
||||
QMessageBox::critical(0,"File I/O Error", "Could not read custom rules file:\n"+ui->customRuleFiles->currentText());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -818,12 +828,12 @@ void ProjectPropertiesDialog::on_customRules_textChanged()
|
||||
|
||||
void ProjectPropertiesDialog::on_customRuleFileBrowse_clicked()
|
||||
{
|
||||
QString value = QFileDialog::getSaveFileName(this,"Custom Rule File",QDir::currentPath());
|
||||
QString value = QFileDialog::getOpenFileName(this,"Custom Rule File",QDir::currentPath());
|
||||
QDir dir(QDir::currentPath());
|
||||
|
||||
if ( !value.isEmpty() )
|
||||
{
|
||||
ui->customRuleFile->setText(dir.fromNativeSeparators(dir.relativeFilePath(value)));
|
||||
ui->customRuleFiles->addItem(dir.fromNativeSeparators(dir.relativeFilePath(value)));
|
||||
ui->customRules->setEnabled(true);
|
||||
ui->customRules->setText("");
|
||||
}
|
||||
@@ -858,3 +868,36 @@ 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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ protected:
|
||||
void changeEvent(QEvent* e);
|
||||
void serializeLinkerConfig();
|
||||
void deserializeLinkerConfig();
|
||||
void serializeCustomRules();
|
||||
void serializeCustomRules(QString rulesFile = QString());
|
||||
void deserializeCustomRules();
|
||||
|
||||
private:
|
||||
@@ -37,6 +37,7 @@ private:
|
||||
QList<QColor> currentPalette;
|
||||
bool linkerConfigChanged;
|
||||
bool customRulesChanged;
|
||||
QString currentCustomRulesFile;
|
||||
CPropertyListModel* tilePropertyListModel;
|
||||
QMap<QString,QWidget*> pageMap;
|
||||
|
||||
@@ -69,6 +70,9 @@ 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
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>7</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="project">
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
@@ -476,6 +476,17 @@
|
||||
</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">
|
||||
@@ -609,45 +620,78 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QTextEdit" name="customRules"/>
|
||||
</item>
|
||||
<item row="2" 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="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>
|
||||
<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>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="customRuleFileBrowse">
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9" stretch="1,0,0">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../../../common/resource.qrc">
|
||||
<normaloff>:/resources/document-open.png</normaloff>:/resources/document-open.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
<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>
|
||||
</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">
|
||||
@@ -701,29 +745,6 @@
|
||||
</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">
|
||||
@@ -737,6 +758,29 @@
|
||||
</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">
|
||||
@@ -1305,8 +1349,6 @@
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../../common/resource.qrc"/>
|
||||
<include location="../../../common/resource.qrc"/>
|
||||
<include location="../../../common/resource.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -6,22 +6,16 @@ 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
|
||||
|
||||
@@ -7,10 +7,9 @@
|
||||
|
||||
class QsciAPIsCA65 : public QsciAPIs
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QsciAPIsCA65(QsciLexer *lexer);
|
||||
virtual ~QsciAPIsCA65();
|
||||
|
||||
//! \reimp
|
||||
virtual void updateAutoCompletionList(const QStringList &context,
|
||||
|
||||
@@ -20,3 +20,42 @@ 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
|
||||
}
|
||||
|
||||
@@ -13,6 +13,11 @@ 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
|
||||
|
||||
Regular → Executable
+31
-3
@@ -17,6 +17,7 @@ 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;
|
||||
@@ -32,6 +33,7 @@ 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;
|
||||
@@ -89,14 +91,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();
|
||||
@@ -123,6 +125,7 @@ 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 )
|
||||
{
|
||||
@@ -152,8 +155,9 @@ 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);
|
||||
@@ -212,6 +216,7 @@ 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();
|
||||
@@ -248,6 +253,7 @@ 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();
|
||||
@@ -292,6 +298,7 @@ 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() )
|
||||
{
|
||||
@@ -315,6 +322,7 @@ 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();
|
||||
@@ -340,6 +348,7 @@ void EnvironmentSettingsDialog::writeSettings()
|
||||
|
||||
settings.setValue("runRomOnLoad",m_runRomOnLoad);
|
||||
settings.setValue("followExecution",m_followExecution);
|
||||
settings.setValue("useTabBarInEditorArea",m_useTabBarInEditorArea);
|
||||
|
||||
settings.setValue("debuggerUpdateRate",m_debuggerUpdateRate);
|
||||
|
||||
@@ -357,6 +366,7 @@ 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);
|
||||
@@ -443,6 +453,7 @@ 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);
|
||||
@@ -898,3 +909,20 @@ 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";
|
||||
}
|
||||
}
|
||||
|
||||
Regular → Executable
+6
@@ -35,6 +35,7 @@ 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; }
|
||||
@@ -49,6 +50,8 @@ 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; }
|
||||
@@ -89,6 +92,7 @@ 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;
|
||||
@@ -104,6 +108,7 @@ 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;
|
||||
@@ -140,6 +145,7 @@ 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
|
||||
|
||||
Regular → Executable
+257
-113
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>802</width>
|
||||
<height>535</height>
|
||||
<width>801</width>
|
||||
<height>527</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -91,7 +91,7 @@
|
||||
<item row="1" column="1">
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="general">
|
||||
<layout class="QGridLayout" name="gridLayout_14">
|
||||
@@ -107,6 +107,22 @@
|
||||
<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">
|
||||
@@ -121,31 +137,7 @@
|
||||
</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="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">
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Plugin Path</string>
|
||||
@@ -172,20 +164,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<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">
|
||||
<item row="9" column="0" colspan="2">
|
||||
<widget class="QLabel" name="settingsLocation">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
@@ -195,6 +174,37 @@
|
||||
</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">
|
||||
@@ -211,6 +221,9 @@
|
||||
<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">
|
||||
@@ -221,31 +234,14 @@
|
||||
<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>
|
||||
@@ -260,7 +256,61 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<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">
|
||||
<widget class="QGroupBox" name="groupBox_13">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
@@ -320,16 +370,29 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_14">
|
||||
<property name="title">
|
||||
<string>Folding</string>
|
||||
<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>
|
||||
<layout class="QGridLayout" name="gridLayout_19">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="fold">
|
||||
<property name="title">
|
||||
<string>Tips</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="showOpcodeTips">
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
<string>Opcodes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="showSymbolTips">
|
||||
<property name="text">
|
||||
<string>Symbols</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -689,43 +752,22 @@
|
||||
<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="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">
|
||||
<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">
|
||||
<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>
|
||||
@@ -735,14 +777,85 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<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>
|
||||
<property name="text">
|
||||
<string>Custom:</string>
|
||||
<string>C:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<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">
|
||||
<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>
|
||||
@@ -755,8 +868,31 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="customExtensions"/>
|
||||
<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>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -810,6 +946,9 @@
|
||||
<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">
|
||||
@@ -979,6 +1118,9 @@
|
||||
</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">
|
||||
@@ -1043,6 +1185,9 @@
|
||||
</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">
|
||||
@@ -1058,7 +1203,6 @@
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../../common/resource.qrc"/>
|
||||
<include location="../../common/resource.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -21,20 +21,25 @@ 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;
|
||||
}
|
||||
// QIcon icon()
|
||||
// {
|
||||
// return _icon;
|
||||
// }
|
||||
|
||||
// void setIcon(QString iconFile)
|
||||
// {
|
||||
// _icon = QIcon(iconFile);
|
||||
// }
|
||||
|
||||
QString uuid()
|
||||
{
|
||||
@@ -159,8 +164,7 @@ public:
|
||||
void reset(IProjectTreeViewItem* pTVI)
|
||||
{
|
||||
m_pBase = pTVI;
|
||||
m_pAt = pTVI;
|
||||
m_nodeIndex = 0;
|
||||
reset();
|
||||
}
|
||||
|
||||
void next()
|
||||
|
||||
+10
-8
@@ -27,6 +27,16 @@ 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;
|
||||
@@ -41,14 +51,6 @@ 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;
|
||||
|
||||
|
||||
Regular → Executable
+547
-171
File diff suppressed because it is too large
Load Diff
+16
-1
@@ -112,6 +112,7 @@ protected:
|
||||
MemoryInspectorDockWidget* m_pBinCHRMemoryInspector;
|
||||
MemoryInspectorDockWidget* m_pBinSRAMMemoryInspector;
|
||||
MemoryInspectorDockWidget* m_pBinEXRAMMemoryInspector;
|
||||
MemoryInspectorDockWidget* m_pBinCartVRAMMemoryInspector;
|
||||
RegisterInspectorDockWidget* m_pBinPPURegisterInspector;
|
||||
RegisterInspectorDockWidget* m_pBinAPURegisterInspector;
|
||||
RegisterInspectorDockWidget* m_pBinOAMMemoryInspector;
|
||||
@@ -128,6 +129,7 @@ protected:
|
||||
QMenu *menuCartridge_Inspectors;
|
||||
QMenu *menuSystem;
|
||||
QMenu *menuAudio;
|
||||
QMenu *menuAudioMMC5;
|
||||
QMenu *menuAudioVRC6;
|
||||
QMenu *menuAudioN106;
|
||||
QMenu *menuVideo;
|
||||
@@ -145,6 +147,7 @@ protected:
|
||||
QAction *actionBinEXRAMMemory_Inspector;
|
||||
QAction *actionBinMapperMemory_Inspector;
|
||||
QAction *actionBinROM_Inspector;
|
||||
QAction *actionBinCartVRAMMemory_Inspector;
|
||||
QAction *actionPPUInformation_Inspector;
|
||||
QAction *actionJoypadLogger_Inspector;
|
||||
QAction *actionCodeDataLogger_Inspector;
|
||||
@@ -163,6 +166,9 @@ 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;
|
||||
@@ -203,6 +209,8 @@ 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);
|
||||
@@ -220,12 +228,13 @@ signals:
|
||||
void primeEmulator();
|
||||
void pauseEmulation(bool show);
|
||||
void resetEmulator();
|
||||
void exitEmulator();
|
||||
void adjustAudio(int32_t length);
|
||||
void updateTargetMachine(QString target);
|
||||
void compile();
|
||||
void clean();
|
||||
|
||||
private slots:
|
||||
public slots:
|
||||
void openRecentFile();
|
||||
void saveRecentFiles(QString fileName);
|
||||
void updateRecentFiles();
|
||||
@@ -299,6 +308,9 @@ private 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 );
|
||||
@@ -319,6 +331,7 @@ private 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();
|
||||
@@ -338,6 +351,8 @@ private 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
|
||||
|
||||
Regular → Executable
+30
-7
@@ -84,11 +84,20 @@
|
||||
<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>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="tabsClosable">
|
||||
<bool>true</bool>
|
||||
@@ -96,7 +105,10 @@
|
||||
<property name="movable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<property name="tabBarAutoHide">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="welcome">
|
||||
<attribute name="title">
|
||||
<string>Welcome</string>
|
||||
</attribute>
|
||||
@@ -123,7 +135,7 @@
|
||||
</property>
|
||||
<property name="url" stdset="0">
|
||||
<url>
|
||||
<string>about:blank</string>
|
||||
<string>https://nesicide.com</string>
|
||||
</url>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -168,6 +180,7 @@
|
||||
<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">
|
||||
@@ -223,6 +236,7 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionCoding_Mode"/>
|
||||
<addaction name="actionDebugging_Mode"/>
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
<addaction name="menuNESICIDE"/>
|
||||
<addaction name="menuProject"/>
|
||||
@@ -253,8 +267,10 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionOpen_Project"/>
|
||||
<addaction name="actionSave_Project"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_Close_Project"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionProject_Properties"/>
|
||||
<addaction name="actionManage_Add_Ons"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="compilerToolbar">
|
||||
<property name="sizePolicy">
|
||||
@@ -272,9 +288,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">
|
||||
@@ -291,7 +307,6 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionOutput_Window"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionProject_Properties"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="appStatusBar">
|
||||
<property name="sizeGripEnabled">
|
||||
@@ -578,6 +593,15 @@
|
||||
<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>
|
||||
@@ -590,7 +614,6 @@
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../common/resource.qrc"/>
|
||||
<include location="../../common/resource.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -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(musicFileDeleted(QUuid)), this, SLOT(onItemRemoved(QUuid)));
|
||||
QObject::connect(m_pMusicModel, SIGNAL(musicFileRemoved(QUuid)), this, SLOT(onItemRemoved(QUuid)));
|
||||
}
|
||||
|
||||
CProjectModel::~CProjectModel()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "model/csourcefilemodel.h"
|
||||
#include "model/projectsearcher.h"
|
||||
#include "cnesicideproject.h"
|
||||
#include "filepropertiesdialog.h"
|
||||
|
||||
CSourceFileModel::CSourceFileModel()
|
||||
: CSubModel()
|
||||
@@ -34,6 +35,24 @@ 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)
|
||||
|
||||
@@ -21,6 +21,9 @@ 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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -56,7 +56,6 @@ QList<T*> findItemsOfType(CNesicideProject* project)
|
||||
return items;
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
T* findItemByUuid(CNesicideProject* project, const QUuid& uuid)
|
||||
{
|
||||
|
||||
@@ -16,9 +16,9 @@ void CCartridgeBuilder::clean()
|
||||
buildTextLogger->erase();
|
||||
buildTextLogger->write("<b>Project build started.</b>");
|
||||
|
||||
if ( (CCC65Interface::getCLanguageSourcesFromProject().count()) ||
|
||||
(CCC65Interface::getAssemblerSourcesFromProject().count()) ||
|
||||
(CCC65Interface::getCustomSourcesFromProject().count()) )
|
||||
if ( (CCC65Interface::instance()->getCLanguageSourcesFromProject().count()) ||
|
||||
(CCC65Interface::instance()->getAssemblerSourcesFromProject().count()) ||
|
||||
(CCC65Interface::instance()->getCustomSourcesFromProject().count()) )
|
||||
{
|
||||
sourceAssembler.clean();
|
||||
graphicsAssembler.clean();
|
||||
@@ -82,9 +82,9 @@ bool CCartridgeBuilder::build()
|
||||
buildTextLogger->erase();
|
||||
buildTextLogger->write("<b>Project build started.</b>");
|
||||
|
||||
if ( (CCC65Interface::getCLanguageSourcesFromProject().count()) ||
|
||||
(CCC65Interface::getAssemblerSourcesFromProject().count()) ||
|
||||
(CCC65Interface::getCustomSourcesFromProject().count()) )
|
||||
if ( (CCC65Interface::instance()->getCLanguageSourcesFromProject().count()) ||
|
||||
(CCC65Interface::instance()->getAssemblerSourcesFromProject().count()) ||
|
||||
(CCC65Interface::instance()->getCustomSourcesFromProject().count()) )
|
||||
{
|
||||
if ( !nesicideProject->getLinkerConfigFile().isEmpty() )
|
||||
{
|
||||
|
||||
@@ -21,11 +21,11 @@ APUInformationDockWidget::~APUInformationDockWidget()
|
||||
|
||||
void APUInformationDockWidget::updateTargetMachine(QString /*target*/)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
QObject::connect ( emulator, SIGNAL(machineReady()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorReset()), this, SLOT(updateInformation()) );
|
||||
QObject::connect ( emulator, SIGNAL(emulatorPaused(bool)), this, SLOT(updateInformation()) );
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->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::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
QObject::connect ( emulator, SIGNAL(updateDebuggers()), this, SLOT(updateInformation()) );
|
||||
updateInformation();
|
||||
}
|
||||
|
||||
void APUInformationDockWidget::hideEvent(QHideEvent* /*e*/)
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
QObject::disconnect ( emulator, SIGNAL(updateDebuggers()), this, SLOT(updateInformation()) );
|
||||
}
|
||||
|
||||
|
||||
Regular → Executable
+45
-42
@@ -12,55 +12,56 @@ 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;
|
||||
|
||||
renderer = new PanZoomRenderer(256,128,2000,imgData,true,ui->frame);
|
||||
ui->frame->layout()->addWidget(renderer);
|
||||
ui->frame->layout()->update();
|
||||
setCentralWidget(ui->window);
|
||||
imgData = new int8_t[256*128*4];
|
||||
memset(imgData,0,sizeof(imgData));
|
||||
|
||||
QObject::connect(renderer,SIGNAL(repaintNeeded()),this,SLOT(repaintNeeded()));
|
||||
int i;
|
||||
for ( i = 3; i < (256*128*4); i += 4 )
|
||||
{
|
||||
imgData[i] = 0xff;
|
||||
}
|
||||
|
||||
if ( m_usePPU )
|
||||
{
|
||||
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));
|
||||
setCentralWidget(ui->window);
|
||||
RENDERCHRMEM();
|
||||
|
||||
pThread = new DebuggerUpdateThread(&CPPUDBG::RENDERCHRMEM);
|
||||
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);
|
||||
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" );
|
||||
}
|
||||
|
||||
@@ -74,8 +75,11 @@ CHRROMDisplayDialog::~CHRROMDisplayDialog()
|
||||
{
|
||||
delete pThread;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete imgData;
|
||||
}
|
||||
delete ui;
|
||||
delete imgData;
|
||||
delete renderer;
|
||||
}
|
||||
|
||||
@@ -83,8 +87,8 @@ void CHRROMDisplayDialog::updateTargetMachine(QString /*target*/)
|
||||
{
|
||||
if ( m_usePPU )
|
||||
{
|
||||
QObject* breakpointWatcher = CObjectRegistry::getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* breakpointWatcher = CObjectRegistry::instance()->getObject("Breakpoint Watcher");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(emulator,SIGNAL(machineReady()),pThread,SLOT(updateDebuggers()));
|
||||
QObject::connect(emulator,SIGNAL(emulatorReset()),pThread,SLOT(updateDebuggers()));
|
||||
@@ -97,7 +101,7 @@ void CHRROMDisplayDialog::showEvent(QShowEvent* /*event*/)
|
||||
{
|
||||
if ( m_usePPU )
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::connect(emulator,SIGNAL(updateDebuggers()),pThread,SLOT(updateDebuggers()));
|
||||
|
||||
@@ -110,7 +114,7 @@ void CHRROMDisplayDialog::hideEvent(QHideEvent* /*event*/)
|
||||
{
|
||||
if ( m_usePPU )
|
||||
{
|
||||
QObject* emulator = CObjectRegistry::getObject("Emulator");
|
||||
QObject* emulator = CObjectRegistry::instance()->getObject("Emulator");
|
||||
|
||||
QObject::disconnect(emulator,SIGNAL(updateDebuggers()),pThread,SLOT(updateDebuggers()));
|
||||
}
|
||||
@@ -211,10 +215,10 @@ void CHRROMDisplayDialog::updateInfoText(int x, int y)
|
||||
side = 0;
|
||||
}
|
||||
|
||||
str.sprintf("Cursor:Pixel(%d,%d) Tile(%d,%d) %s",
|
||||
str.sprintf("Pixel(%d,%d) Tile(%d,%d) $%04X",
|
||||
x,y,
|
||||
tileX,tileY,
|
||||
sideStr[side]);
|
||||
(side*0x1000)+(((tileY*16)+tileX)<<4));
|
||||
|
||||
info->setText(str);
|
||||
}
|
||||
@@ -228,10 +232,10 @@ void CHRROMDisplayDialog::repaintNeeded()
|
||||
{
|
||||
if ( m_usePPU )
|
||||
{
|
||||
CPPUDBG::SetCHRMEMInspectorColor(0,renderer->getColor(0));
|
||||
CPPUDBG::SetCHRMEMInspectorColor(1,renderer->getColor(1));
|
||||
CPPUDBG::SetCHRMEMInspectorColor(2,renderer->getColor(2));
|
||||
CPPUDBG::SetCHRMEMInspectorColor(3,renderer->getColor(3));
|
||||
SetCHRMEMInspectorColor(0,renderer->getColor(0));
|
||||
SetCHRMEMInspectorColor(1,renderer->getColor(1));
|
||||
SetCHRMEMInspectorColor(2,renderer->getColor(2));
|
||||
SetCHRMEMInspectorColor(3,renderer->getColor(3));
|
||||
|
||||
pThread->updateDebuggers();
|
||||
}
|
||||
@@ -252,7 +256,7 @@ void CHRROMDisplayDialog::renderData()
|
||||
|
||||
if ( m_usePPU )
|
||||
{
|
||||
renderer->reloadData(imgData);
|
||||
renderer->reloadData(CHRMEMTV());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -266,7 +270,6 @@ 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;
|
||||
@@ -292,7 +295,7 @@ void CHRROMDisplayDialog::renderData()
|
||||
|
||||
void CHRROMDisplayDialog::on_updateScanline_editingFinished()
|
||||
{
|
||||
CPPUDBG::SetPPUViewerScanline ( ui->updateScanline->text().toInt() );
|
||||
SetPPUViewerScanline ( ui->updateScanline->text().toInt() );
|
||||
}
|
||||
|
||||
void CHRROMDisplayDialog::on_exportPushButton_clicked()
|
||||
|
||||
@@ -40,11 +40,10 @@ protected:
|
||||
private:
|
||||
Ui::CHRROMDisplayDialog* ui;
|
||||
QLabel* info;
|
||||
char* imgData;
|
||||
int8_t* imgData;
|
||||
bool m_usePPU;
|
||||
DebuggerUpdateThread* pThread;
|
||||
PanZoomRenderer* renderer;
|
||||
QPoint pressPos;
|
||||
|
||||
public slots:
|
||||
void renderData();
|
||||
|
||||
Regular → Executable
+96
-60
@@ -6,85 +6,121 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>544</width>
|
||||
<height>226</height>
|
||||
<width>581</width>
|
||||
<height>335</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QFrame" name="window">
|
||||
<widget class="QFrame" name="windowEx">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>511</width>
|
||||
<height>181</height>
|
||||
<x>12</x>
|
||||
<y>12</y>
|
||||
<width>561</width>
|
||||
<height>311</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
<layout class="QGridLayout" name="gridLayout_1">
|
||||
<property name="leftMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
<property name="topMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
<property name="rightMargin">
|
||||
<number>12</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>
|
||||
</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">
|
||||
<property name="bottomMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="window">
|
||||
<property name="lineWidth">
|
||||
<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="margin">
|
||||
<number>0</number>
|
||||
<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>
|
||||
</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>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user