Merge pull request #617 from xsacha/master

Buildfix for Blackberry, Meego. Optimisations for Qt
This commit is contained in:
Henrik Rydgård 2013-02-07 02:05:58 -08:00
commit de309f6a8b
5 changed files with 24 additions and 157 deletions

View File

@ -1249,7 +1249,7 @@ void sceKernelCheckThreadStack()
u32 error;
Thread *t = kernelObjects.Get<Thread>(__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 {

View File

@ -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
}

View File

@ -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
}

View File

@ -1,101 +0,0 @@
#include "mainui.h"
#include <QAudioOutput>
#include <QAudioFormat>
#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<QTouchEvent::TouchPoint> touchPoints;
switch(e->type())
{
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
touchPoints = static_cast<QTouchEvent *>(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<<b);
}
break;
case QEvent::KeyRelease:
for (int b = 0; b < 14; b++) {
if (((QKeyEvent*)e)->key() == buttonMappings[b])
input_state.pad_buttons &= ~(1<<b);
}
break;
default:
return QWidget::event(e);
}
e->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();
}

View File

@ -61,8 +61,7 @@ with the mouse.
Alternatively, a Qt-based frontend is available in the Qt/ dir.
Open PPSSPPQt.pro with Qt Creator.
Install libsdl1.2 if you want to use USB Gamepad.
For Ubuntu user (>= 12.10) :
- Remove multimedia in PPSSPP.pro on line 3
If the build has an error about finding mobility or multimedia:
- Install the package "qtmobility-dev"
Building for OSX