From: Jean-Paul Mari Date: Tue, 10 Oct 2017 17:49:31 +0000 (-0400) Subject: Fixed the SP (Stack) window UI potential missing data X-Git-Tag: v2.1.3-R3~13 X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/commitdiff_plain/49a6ac1c591c80fabdd7832dc1613700d4d97ad2 Fixed the SP (Stack) window UI potential missing data --- diff --git a/VS2015/virtualjaguar.vcxproj.user b/VS2015/virtualjaguar.vcxproj.user index daed425..315a626 100644 --- a/VS2015/virtualjaguar.vcxproj.user +++ b/VS2015/virtualjaguar.vcxproj.user @@ -7,7 +7,7 @@ PATH=$(QTDIR)\bin%3b$(PATH) C:\Qt\Qt5.5.1\msvc2015_64 - --debugger --no-log + C:\Projects\GLib-M68K\Lib-Test-M68K\Debug\LibTestM68K_Debug.elf --debugger --no-log WindowsLocalDebugger $(OutDir) @@ -38,7 +38,7 @@ C:\Qt\Qt5.5.1\msvc2015_64 $(OutDir) WindowsLocalDebugger - --debugger + C:\Projects\GLib-M68K\Lib-Test-M68K\Debug\LibTestM68K_Debug.elf --debugger PATH=$(QTDIR)\bin%3bC:\Qt\qt5-5.5.1-vs2015\qt5-x86-shared-debug\bin%3b$(PATH) diff --git a/docs/vj_ReleaseNotes.txt b/docs/vj_ReleaseNotes.txt index b28596b..73f84e8 100644 --- a/docs/vj_ReleaseNotes.txt +++ b/docs/vj_ReleaseNotes.txt @@ -1,4 +1,4 @@ -Release 3 (TBC) +Release 3 (WiP) --------------- 0) Fixed the windows respawning in the next emulator launch within --alpine or --debugger options 1) Added an Exception Vector Table browser window @@ -14,6 +14,7 @@ Release 3 (TBC) 9) Fixed a crash, in Release mode, when the HW labels setting is turn on 10) Solved an interference between the HW labels setting and the one used by the debugger -- The setting is now only the reference used +11) Fixed the SP (Stack) window UI potential missing data Release 2 (3rd September 2017) ------------------------------ @@ -76,7 +77,7 @@ Release 0 (5th January 2017) Known issues ============ -1) Video output is not displayed due to OpenGL / QT5 integration problems with VS 2015 +1) Video output is not displayed due to my OpenGL / QT5 integration with VS 2015 2) The BPM (Breapoint) remains stuck on his address when user wants to continue the code execution -- Need to trace over the BPM or unset the BPM 3) To handle DWARF 2 issues with GCC, the code must be compiled with the -gdwarf-2 option @@ -87,6 +88,8 @@ Known issues -- The application needs to set the SP (Stack) in accordance 7) The Exception Vector Table broswer window displays only 65 vectors -- Missing vectors may be added in future release +8) User needs to manualy check if the Atari Jaguar executable match his source code files +-- Otherwise, source code and assembly may not match or leads to instabilities Cosmetic / UX issues ==================== diff --git a/src/gui/debug/stackbrowser.cpp b/src/gui/debug/stackbrowser.cpp index 43e970e..ebd68ac 100644 --- a/src/gui/debug/stackbrowser.cpp +++ b/src/gui/debug/stackbrowser.cpp @@ -1,205 +1,220 @@ -// -// stackbrowser.cpp - Jaguar stack browser -// -// by James Hammons -// (C) 2012 Underground Software -// -// JPM = Jean-Paul Mari -// -// Who When What -// --- ---------- ----------------------------------------------------------- -// JPM 01/11/2017 Created this file -// - -// STILL TO DO: -// - -#include "stackbrowser.h" -#include "memory.h" -#include "m68000/m68kinterface.h" -#include "settings.h" - - -StackBrowserWindow::StackBrowserWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog), -// layout(new QVBoxLayout), text(new QTextBrowser), - layout(new QVBoxLayout), - text(new QLabel), - //refresh(new QPushButton(tr("Refresh"))), - //address(new QLineEdit), - //go(new QPushButton(tr("Go"))), - memBase(m68k_get_reg(NULL, M68K_REG_SP)) -{ - setWindowTitle(tr("Stack Browser")); - -/* - address->setInputMask("hhhhhh"); - QHBoxLayout * hbox1 = new QHBoxLayout; - hbox1->addWidget(refresh); - hbox1->addWidget(address); - hbox1->addWidget(go); -*/ - - // Need to set the size as well... -// resize(560, 480); - - QFont fixedFont("Lucida Console", 8, QFont::Normal); -// QFont fixedFont("", 8, QFont::Normal); - fixedFont.setStyleHint(QFont::TypeWriter); - text->setFont(fixedFont); -//// layout->setSizeConstraint(QLayout::SetFixedSize); - setLayout(layout); - - layout->addWidget(text); -// layout->addWidget(refresh); -/* - layout->addLayout(hbox1); -*/ - -/* - connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents())); - connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress())); -*/ -} - - -// -void StackBrowserWindow::RefreshContents(void) -{ - char string[1024], buf[64]; - QString memDump; - size_t i, j; - uint8_t c; - - if (isVisible()) - { - memBase = m68k_get_reg(NULL, M68K_REG_SP); - - for (i = 0; i < 480; i += 16) - { - if ((memBase + i) < vjs.DRAM_size) - { - sprintf(string, "%s%06X: ", (i ? "
" : ""), (unsigned int)(memBase + i)); - - for (j = 0; j < 16; j++) - { - if ((memBase + i + j) < vjs.DRAM_size) - { - sprintf(buf, "%02X ", jaguarMainRAM[memBase + i + j]); - } - else - { - if (i) - { - sprintf(buf, "   "); - } - else - { - sprintf(buf, " "); - } -#ifdef _MSC_VER -#pragma message("Warning: !!! Need to dig the reason(s) why the 2nd line needs to use the   instead of space !!!") -#else -#warning "!!! Need to dig the reason(s) why the 2nd line needs to use the   instead of space !!!" -#endif // _MSC_VER - } - strcat(string, buf); - } - - //sprintf(buf, "| "); - //strcat(string, buf); - strcat(string, "| "); - - for (j = 0; j < 16; j++) - { - if ((memBase + i + j) < vjs.DRAM_size) - { - c = jaguarMainRAM[memBase + i + j]; - //sprintf(buf, "&#%i;", c); - - //if (c == 0x20) - //{ - // sprintf(buf, " "); - //} - //else - { - if ((c <= 0x20) || (c > 0x7E)) - { - //sprintf(buf, "."); - buf[0] = '.'; - } - else - { - //sprintf(buf, "&#%i;", c); - buf[0] = c; - } - buf[1] = 0; - } - - strcat(string, buf); - } - } - - memDump += QString(string); - } - } - - text->clear(); - text->setText(memDump); - } -} - - -/* -void StackBrowserWindow::keyPressEvent(QKeyEvent * e) -{ - if (e->key() == Qt::Key_Escape) - hide(); - else if (e->key() == Qt::Key_PageUp) - { - memBase -= 480; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_PageDown) - { - memBase += 480; - - if (memBase > (0x200000 - 480)) - memBase = 0x200000 - 480; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Minus) - { - memBase -= 16; - - if (memBase < 0) - memBase = 0; - - RefreshContents(); - } - else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Equal) - { - memBase += 16; - - if (memBase > (0x200000 - 480)) - memBase = 0x200000 - 480; - - RefreshContents(); - } -} -*/ - - -/* -void StackBrowserWindow::GoToAddress(void) -{ - bool ok; - QString newAddress = address->text(); - memBase = newAddress.toUInt(&ok, 16); - RefreshContents(); -} -*/ +// +// stackbrowser.cpp - Jaguar stack browser +// +// by James Hammons +// (C) 2012 Underground Software +// +// JPM = Jean-Paul Mari +// +// Who When What +// --- ---------- ----------------------------------------------------------- +// JPM 01/11/2017 Created this file +// + +// STILL TO DO: +// + +#include "stackbrowser.h" +#include "memory.h" +#include "m68000/m68kinterface.h" +#include "settings.h" + + +//#define DEBUG_SPDISPLAY 26 // To fill up to 256 bytes with values from 0 to $FF below the SP pointer + + +// +StackBrowserWindow::StackBrowserWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog), +// layout(new QVBoxLayout), text(new QTextBrowser), + layout(new QVBoxLayout), + text(new QLabel), + //refresh(new QPushButton(tr("Refresh"))), + //address(new QLineEdit), + //go(new QPushButton(tr("Go"))), + memBase(m68k_get_reg(NULL, M68K_REG_SP)) +{ + setWindowTitle(tr("Stack Browser")); + +/* + address->setInputMask("hhhhhh"); + QHBoxLayout * hbox1 = new QHBoxLayout; + hbox1->addWidget(refresh); + hbox1->addWidget(address); + hbox1->addWidget(go); +*/ + + // Need to set the size as well... +// resize(560, 480); + + QFont fixedFont("Lucida Console", 8, QFont::Normal); +// QFont fixedFont("", 8, QFont::Normal); + fixedFont.setStyleHint(QFont::TypeWriter); + text->setFont(fixedFont); +//// layout->setSizeConstraint(QLayout::SetFixedSize); + setLayout(layout); + + layout->addWidget(text); +// layout->addWidget(refresh); +/* + layout->addLayout(hbox1); +*/ + +/* + connect(refresh, SIGNAL(clicked()), this, SLOT(RefreshContents())); + connect(go, SIGNAL(clicked()), this, SLOT(GoToAddress())); +*/ +} + + +// +void StackBrowserWindow::RefreshContents(void) +{ + char string[1024], buf[64]; + QString memDump; + size_t i, j; + uint8_t c; + + if (isVisible()) + { + memBase = m68k_get_reg(NULL, M68K_REG_SP); + +#ifdef DEBUG_SPDISPLAY +#if DEBUG_SPDISPLAY < 257 + memBase -= DEBUG_SPDISPLAY; + for (i = 0; i < DEBUG_SPDISPLAY; i++) + { + jaguarMainRAM[memBase + i] = (uint8_t)i; + } +#endif +#endif + + for (i = 0; i < 480; i += 16) + { + if ((memBase + i) < vjs.DRAM_size) + { + sprintf(string, "%s%06X: ", (i ? "
" : ""), (unsigned int)(memBase + i)); + + for (j = 0; j < 16; j++) + { + if ((memBase + i + j) < vjs.DRAM_size) + { + sprintf(buf, "%02X ", jaguarMainRAM[memBase + i + j]); + } + else + { + if (i) + { + sprintf(buf, "   "); + } + else + { + sprintf(buf, " "); + } +#ifdef _MSC_VER +#pragma message("Warning: !!! Need to dig the reason(s) why the 2nd line needs to use the   instead of space !!!") +#else +#warning "!!! Need to dig the reason(s) why the 2nd line needs to use the   instead of space !!!" +#endif // _MSC_VER + } + strcat(string, buf); + } + + //sprintf(buf, "| "); + //strcat(string, buf); + strcat(string, "| "); + + for (j = 0; j < 16; j++) + { + if ((memBase + i + j) < vjs.DRAM_size) + { + c = jaguarMainRAM[memBase + i + j]; + //sprintf(buf, "&#%i;", c); + + //if (c == 0x20) + //{ + // sprintf(buf, " "); + //} + //else + { + //if (c < 0x20) + if ((c < 0x20) || (c > 0x7E)) + { + sprintf(buf, "."); + //buf[0] = '.'; + } + else + { + sprintf(buf, "&#%i;", c); + //buf[0] = c; + } + //buf[1] = 0; + } + + strcat(string, buf); + } + } + + memDump += QString(string); + } + } + + text->clear(); + text->setText(memDump); + } +} + + +/* +void StackBrowserWindow::keyPressEvent(QKeyEvent * e) +{ + if (e->key() == Qt::Key_Escape) + hide(); + else if (e->key() == Qt::Key_PageUp) + { + memBase -= 480; + + if (memBase < 0) + memBase = 0; + + RefreshContents(); + } + else if (e->key() == Qt::Key_PageDown) + { + memBase += 480; + + if (memBase > (0x200000 - 480)) + memBase = 0x200000 - 480; + + RefreshContents(); + } + else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Minus) + { + memBase -= 16; + + if (memBase < 0) + memBase = 0; + + RefreshContents(); + } + else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Equal) + { + memBase += 16; + + if (memBase > (0x200000 - 480)) + memBase = 0x200000 - 480; + + RefreshContents(); + } +} +*/ + + +/* +void StackBrowserWindow::GoToAddress(void) +{ + bool ok; + QString newAddress = address->text(); + memBase = newAddress.toUInt(&ok, 16); + RefreshContents(); +} +*/