Set Qt to build debug menus on non Linux platforms and fix some debugger crashes

This makes Common.pro and Native.pro use their own distinct object directories
to prevent the two fbo.cpp and sha1.c files repectively to clash into the same
*.obj file.

The registerlist had polled register values of -1 in some cases when resizing
the window. Making sure it doesn't poll values smaller than 0 fixes it.

The memoryview crashed if it was switched into symbol mode outside of the
symbol definition range. Also, under Windows the monospace font wasn't
used because there's not literal font called "monospace" so a font family
hint had to be used.

The UpdateDisassembly() function jumped to the current PC, which sounds
reasonable at first but the issue is that this function gets called when a
breakpoint get set, so if you set a breakpoint somewhere completely
different then you suddenly lose that position for no good reason.

Enable the desktop QT interface for all non ARM QT platforms

make sure the QtMain.cpp in the native submodule is also updated
This commit is contained in:
Peter Tissen 2013-11-03 19:16:14 +01:00
parent ebd3763c7e
commit b40278fff6
5 changed files with 16 additions and 9 deletions

View File

@ -38,8 +38,11 @@ win32|symbian: LIBS += $${FFMPEG_DIR}avformat.lib $${FFMPEG_DIR}avcodec.lib $${F
else: LIBS += $${FFMPEG_DIR}libavformat.a $${FFMPEG_DIR}libavcodec.a $${FFMPEG_DIR}libavutil.a $${FFMPEG_DIR}libswresample.a $${FFMPEG_DIR}libswscale.a else: LIBS += $${FFMPEG_DIR}libavformat.a $${FFMPEG_DIR}libavcodec.a $${FFMPEG_DIR}libavutil.a $${FFMPEG_DIR}libswresample.a $${FFMPEG_DIR}libswscale.a
win32 { win32 {
#Use a fixed base-address under windows
QMAKE_LFLAGS += /FIXED /BASE:"0x00400000"
QMAKE_LFLAGS += /DYNAMICBASE:NO
LIBS += -lwinmm -lws2_32 -lShell32 -lAdvapi32 LIBS += -lwinmm -lws2_32 -lShell32 -lAdvapi32
contains($$QMAKE_TARGET.arch, x86_64): LIBS += $$files(../dx9sdk/Lib/x64/*.lib) contains(QMAKE_TARGET.arch, x86_64): LIBS += $$files(../dx9sdk/Lib/x64/*.lib)
else: LIBS += $$files(../dx9sdk/Lib/x86/*.lib) else: LIBS += $$files(../dx9sdk/Lib/x86/*.lib)
} }
linux { linux {
@ -75,8 +78,8 @@ SOURCES += ../UI/*Screen.cpp \
HEADERS += ../UI/*.h HEADERS += ../UI/*.h
INCLUDEPATH += .. ../Common ../native INCLUDEPATH += .. ../Common ../native
# Use forms UI for Linux desktop # Use forms UI for desktop platforms
linux:!mobile_platform { !mobile_platform {
SOURCES += *.cpp SOURCES += *.cpp
HEADERS += *.h HEADERS += *.h
FORMS += *.ui FORMS += *.ui

View File

@ -80,7 +80,6 @@ void QtHost::UpdateDisassembly()
{ {
if(mainWindow->GetDialogDisasm()) if(mainWindow->GetDialogDisasm())
{ {
mainWindow->GetDialogDisasm()->GotoPC();
mainWindow->GetDialogDisasm()->Update(); mainWindow->GetDialogDisasm()->Update();
} }
if(mainWindow->GetDialogDisplaylist()) if(mainWindow->GetDialogDisplaylist())
@ -334,7 +333,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co
g_gameInfoCache.Init(); g_gameInfoCache.Init();
#if defined(Q_OS_LINUX) && !defined(ARM) #if !defined(ARM)
// Start Desktop UI // Start Desktop UI
MainWindow* mainWindow = new MainWindow(); MainWindow* mainWindow = new MainWindow();
mainWindow->show(); mainWindow->show();

View File

@ -82,6 +82,7 @@ void CtrlMemView::paintEvent(QPaintEvent *)
QFont normalFont("Arial", 10); QFont normalFont("Arial", 10);
QFont alignedFont("Monospace", 10); QFont alignedFont("Monospace", 10);
alignedFont.setStyleHint(QFont::Monospace);
painter.setFont(normalFont); painter.setFont(normalFont);
int i; int i;
@ -162,12 +163,16 @@ void CtrlMemView::paintEvent(QPaintEvent *)
if (align==4) if (align==4)
{ {
u32 value = Memory::ReadUnchecked_U32(address); u32 value = Memory::ReadUnchecked_U32(address);
sprintf(temp, "%08x [%s]", value, symbolMap.GetSymbolName(symbolMap.GetSymbolNum(value))); int symbolnum = symbolMap.GetSymbolNum(value);
if(symbolnum>=0)
sprintf(temp, "%08x [%s]", value, symbolMap.GetSymbolName(symbolnum));
} }
else if (align==2) else if (align==2)
{ {
u16 value = Memory::ReadUnchecked_U16(address); u16 value = Memory::ReadUnchecked_U16(address);
sprintf(temp, "%04x [%s]", value, symbolMap.GetSymbolName(symbolMap.GetSymbolNum(value))); int symbolnum = symbolMap.GetSymbolNum(value);
if(symbolnum>=0)
sprintf(temp, "%04x [%s]", value, symbolMap.GetSymbolName(symbolnum));
} }
painter.drawText(85,rowY1 - 2 + rowHeight, temp); painter.drawText(85,rowY1 - 2 + rowHeight, temp);

View File

@ -137,7 +137,7 @@ void CtrlRegisterList::paintEvent(QPaintEvent *)
int maxRowsDisplay =rect().bottom()/rowHeight - 1; int maxRowsDisplay =rect().bottom()/rowHeight - 1;
selection = std::min(std::max(selection,0),numRowsTotal); selection = std::min(std::max(selection,0),numRowsTotal);
curVertOffset = std::min(std::max(curVertOffset, 0),numRowsTotal - maxRowsDisplay); curVertOffset = std::max(std::min(curVertOffset,numRowsTotal - maxRowsDisplay),0);
QScrollBar *bar = findChild<QScrollBar*>("RegListScroll"); QScrollBar *bar = findChild<QScrollBar*>("RegListScroll");
if(bar) if(bar)

2
native

@ -1 +1 @@
Subproject commit c2b558e8817d1e736686a6d70db997a060a5488e Subproject commit f0e47c2cede7313a057df66a6e01ba173df1e001