From e79c8e032a3a1ab58bbce491c2ba0c37d2f1eb0b Mon Sep 17 00:00:00 2001 From: Sacha Date: Thu, 7 Feb 2013 14:41:02 +1000 Subject: [PATCH] Buildfix for Blackberry, Meego. Optimisations to Qt build. --- Core/HLE/sceKernelThread.cpp | 2 +- Qt/PPSSPP.pro | 70 +++++++----------------- Qt/Settings.pri | 5 +- Qt/mainui.cpp | 101 ----------------------------------- 4 files changed, 23 insertions(+), 155 deletions(-) delete mode 100644 Qt/mainui.cpp diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index ad236c2039..293bab900e 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -1249,7 +1249,7 @@ void sceKernelCheckThreadStack() u32 error; Thread *t = kernelObjects.Get(__KernelGetCurThread(), error); if (t) { - u32 diff = abs((long)((s64)t->stackBlock - (s64)currentMIPS->r[MIPS_REG_SP])); + u32 diff = labs((long)((s64)t->stackBlock - (s64)currentMIPS->r[MIPS_REG_SP])); WARN_LOG(HLE, "%i=sceKernelCheckThreadStack()", diff); RETURN(diff); } else { diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index 76ab64cefa..0fd569e699 100755 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -1,29 +1,23 @@ TARGET = PPSSPPQt -# Ubuntu user, remove multimedia -QT += core gui opengl multimedia + +QT += core gui opengl +CONFIG += mobility +MOBILITY += multimedia include(Settings.pri) -linux { - CONFIG += mobility link_pkgconfig - MOBILITY += multimedia -} -else { - QT += multimedia -} # Libs symbian: LIBS += -lCore.lib -lCommon.lib -lNative.lib -lcone -leikcore -lavkon -lezlib - blackberry: LIBS += -L. -lCore -lCommon -lNative -lscreen -lsocket -lstdc++ - win32: LIBS += -L. -lCore -lCommon -lNative -lwinmm -lws2_32 -lkernel32 -luser32 -lgdi32 -lshell32 -lcomctl32 -ldsound -lxinput +linux: LIBS += -L. -lCore -lCommon -lNative -linux { - LIBS += -L. -lCore -lCommon -lNative +desktop_ui { PRE_TARGETDEPS += ./libCommon.a ./libCore.a ./libNative.a + CONFIG += link_pkgconfig packagesExist(sdl) { - DEFINES += QT_HAS_SDL - PKGCONFIG += sdl + DEFINES += QT_HAS_SDL + PKGCONFIG += sdl } } @@ -41,51 +35,25 @@ SOURCES += ../android/jni/EmuScreen.cpp \ INCLUDEPATH += .. ../Common ../native # Temporarily only use new UI for Linux desktop -linux:!mobile_platform { - SOURCES += mainwindow.cpp \ - debugger_disasm.cpp \ - EmuThread.cpp\ - QtHost.cpp \ - qtemugl.cpp \ - ctrldisasmview.cpp \ - ctrlregisterlist.cpp \ - controls.cpp \ - qkeyedit.cpp \ - gamepaddialog.cpp - HEADERS += mainwindow.h \ - debugger_disasm.h \ - EmuThread.h \ - QtHost.h \ - qtemugl.h \ - ctrldisasmview.h \ - ctrlregisterlist.h \ - controls.h \ - qkeyedit.h \ - gamepaddialog.h +desktop_ui { + MOC_DIR = moc + UI_DIR = ui + SOURCES += *.cpp + HEADERS += *.h + FORMS += *.ui + RESOURCES += resources.qrc } else { SOURCES += ../android/jni/NativeApp.cpp } # Packaging symbian { - vendorinfo = "%{\"Qtness\"}" ":\"Qtness\"" - packageheader = "$${LITERAL_HASH}{\"PPSSPP\"}, (0xE0095B1D), 0, 6, 1, TYPE=SA" - deployinfo.pkg_prerules = packageheader vendorinfo + deploy.pkg_prerules = "$${LITERAL_HASH}{\"PPSSPP\"}, (0xE0095B1D), 0, 6, 1, TYPE=SA" "%{\"Qtness\"}" ":\"Qtness\"" assets.sources = ../android/assets/ui_atlas.zim ../assets/ppge_atlas.zim assets.path = E:/PPSSPP - DEPLOYMENT += deployinfo assets + DEPLOYMENT += deploy assets ICON = ../assets/icon.svg -# 268MB maximum + # 268MB maximum TARGET.EPOCHEAPSIZE = 0x40000 0x10000000 TARGET.EPOCSTACKSIZE = 0x10000 } - -linux:!mobile_platform { - FORMS += mainwindow.ui \ - debugger_disasm.ui \ - controls.ui\ - gamepaddialog.ui - - RESOURCES += \ - resources.qrc -} diff --git a/Qt/Settings.pri b/Qt/Settings.pri index 151315dd54..508abe4688 100644 --- a/Qt/Settings.pri +++ b/Qt/Settings.pri @@ -1,9 +1,11 @@ DEFINES += USING_QT_UI blackberry|symbian|contains(MEEGO_EDITION,harmattan): CONFIG += mobile_platform unix:!blackberry:!symbian:!macx: CONFIG += linux +linux:!mobile_platform: CONFIG += desktop_ui # Global specific -QMAKE_CXXFLAGS += -std=c++0x -Wno-unused-function -Wno-unused-variable -Wno-multichar -Wno-uninitialized -Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-unused-parameter +QMAKE_CXXFLAGS += -Wno-unused-function -Wno-unused-variable -Wno-multichar -Wno-uninitialized -Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-unused-parameter +QMAKE_CXXFLAGS += -std=c++0x -ffast-math -fno-strict-aliasing # Arch specific contains(QT_ARCH, i686)|contains(QT_ARCH, x86)|contains(QT_ARCH, x86_64): { @@ -34,4 +36,3 @@ symbian: { DEFINES += __MARM_ARMV6__ CONFIG += 4.6.3 } - diff --git a/Qt/mainui.cpp b/Qt/mainui.cpp deleted file mode 100644 index c210f09c7e..0000000000 --- a/Qt/mainui.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "mainui.h" - -#include -#include -#include "base/display.h" -#include "base/logging.h" -#include "base/timeutil.h" -#include "file/zip_read.h" -#include "base/NativeApp.h" -#include "net/resolve.h" -#include "base/display.h" - - -void SimulateGamepad(InputState *input) { - input->pad_lstick_x = 0; - input->pad_lstick_y = 0; - input->pad_rstick_x = 0; - input->pad_rstick_y = 0; - - if (input->pad_buttons & (1<<14)) - input->pad_lstick_y=1; - else if (input->pad_buttons & (1<<15)) - input->pad_lstick_y=-1; - if (input->pad_buttons & (1<<16)) - input->pad_lstick_x=-1; - else if (input->pad_buttons & (1<<17)) - input->pad_lstick_x=1; -} - -MainUI::~MainUI() { - NativeShutdownGraphics(); -} - -bool MainUI::event(QEvent *e) -{ - QList touchPoints; - switch(e->type()) - { - case QEvent::TouchBegin: - case QEvent::TouchUpdate: - case QEvent::TouchEnd: - touchPoints = static_cast(e)->touchPoints(); - foreach (const QTouchEvent::TouchPoint &touchPoint, touchPoints) { - switch (touchPoint.state()) { - case Qt::TouchPointStationary: - break; - case Qt::TouchPointPressed: - case Qt::TouchPointReleased: - input_state.pointer_down[touchPoint.id()] = (touchPoint.state() == Qt::TouchPointPressed); - case Qt::TouchPointMoved: - input_state.pointer_x[touchPoint.id()] = touchPoint.pos().x() * dpi_scale; - input_state.pointer_y[touchPoint.id()] = touchPoint.pos().y() * dpi_scale; - break; - default: - break; - } - } - break; - case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: - input_state.pointer_down[0] = (e->type() == QEvent::MouseButtonPress); - case QEvent::MouseMove: - input_state.pointer_x[0] = ((QMouseEvent*)e)->pos().x() * dpi_scale; - input_state.pointer_y[0] = ((QMouseEvent*)e)->pos().y() * dpi_scale; - break; - case QEvent::KeyPress: - for (int b = 0; b < 14; b++) { - if (((QKeyEvent*)e)->key() == buttonMappings[b]) - input_state.pad_buttons |= (1<key() == buttonMappings[b]) - input_state.pad_buttons &= ~(1<accept(); - return true; -} - -void MainUI::initializeGL() -{ -#ifndef USING_GLES2 - glewInit(); -#endif - NativeInitGraphics(); -} -void MainUI::paintGL() -{ - SimulateGamepad(&input_state); - UpdateInputState(&input_state); - NativeUpdate(input_state); - EndInputState(&input_state); - NativeRender(); - - update(); -}