From 887c1393269b4a024df0e91cbae5713588e22b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Miko=C5=82ajczyk?= Date: Mon, 11 Feb 2013 22:12:17 +0100 Subject: [PATCH 01/49] Qt: Resize GL widget while no game is running --- Qt/EmuThread.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Qt/EmuThread.cpp b/Qt/EmuThread.cpp index 69f9d681ca..0246fb9fb4 100644 --- a/Qt/EmuThread.cpp +++ b/Qt/EmuThread.cpp @@ -52,7 +52,10 @@ namespace static void DrawBackground(float alpha) { static float xbase[100] = {0}; static float ybase[100] = {0}; - if (xbase[0] == 0.0f) { + static int old_dp_xres = dp_xres; + // if window was resized, recalculate animation coordinates + if (xbase[0] == 0.0f || dp_xres != old_dp_xres) { + old_dp_xres = dp_xres; GMRng rng; for (int i = 0; i < 100; i++) { xbase[i] = rng.F() * dp_xres; @@ -316,6 +319,7 @@ void EmuThread::run() ReapplyGfxState(); UIShader_Prepare(); + glViewport(0, 0, pixel_xres, pixel_yres); UIBegin(); DrawBackground(alpha); From 69da33bd29764196f7f31a230d755dc539ed20fb Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 12 Feb 2013 00:34:15 +0100 Subject: [PATCH 02/49] Add Show FPS to in-game menu on mobile. Make it green and right-adjusted. --- Core/HLE/sceDisplay.cpp | 14 ++++++-------- android/jni/MenuScreens.cpp | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 28368c6697..5f6cada894 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -242,7 +242,6 @@ void hleEnterVblank(u64 userdata, int cyclesLate) { char stats[2048]; sprintf(stats, - "FPS: %0.1f\n" "Frames: %i\n" "DL processing time: %0.2f ms\n" "Kernel processing time: %0.2f ms\n" @@ -260,7 +259,6 @@ void hleEnterVblank(u64 userdata, int cyclesLate) { "Vertex shaders loaded: %i\n" "Fragment shaders loaded: %i\n" "Combined shaders loaded: %i\n", - calculateFPS(), gpuStats.numFrames, gpuStats.msProcessingDisplayLists * 1000.0f, kernelStats.msInSyscalls * 1000.0f, @@ -299,14 +297,14 @@ void hleEnterVblank(u64 userdata, int cyclesLate) { if (g_Config.bShowFPSCounter) { char stats[50]; - sprintf(stats, "FPS: %0.1f", calculateFPS()); + sprintf(stats, "%0.1f", calculateFPS()); - float zoom = 0.3f; /// g_Config.iWindowZoom; - float soff = 0.3f; + float zoom = 0.7f; /// g_Config.iWindowZoom; + float soff = 0.7f; PPGeBegin(); - PPGeDrawText(stats, soff, soff, 0, zoom, 0xCC000000); - PPGeDrawText(stats, -soff, -soff, 0, zoom, 0xCC000000); - PPGeDrawText(stats, 0, 0, 0, zoom, 0xFFFFFFFF); + PPGeDrawText(stats, 476 + soff, 4 + soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000); + PPGeDrawText(stats, 476 + -soff, 4 -soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000); + PPGeDrawText(stats, 476, 4, PPGE_ALIGN_RIGHT, zoom, 0xFF30FF30); PPGeEnd(); } diff --git a/android/jni/MenuScreens.cpp b/android/jni/MenuScreens.cpp index 89af85abd2..22cce80bdb 100644 --- a/android/jni/MenuScreens.cpp +++ b/android/jni/MenuScreens.cpp @@ -245,6 +245,7 @@ void InGameMenuScreen::render() { int x = 30; int y = 50; UICheckBox(GEN_ID, x, y += 50, "Show Debug Statistics", ALIGN_TOPLEFT, &g_Config.bShowDebugStats); + UICheckBox(GEN_ID, x, y += 50, "Show FPS", ALIGN_TOPLEFT, &g_Config.bShowFPSCounter); UICheckBox(GEN_ID, x, y += 50, "Hardware Transform", ALIGN_TOPLEFT, &g_Config.bHardwareTransform); // TODO: Add UI for more than one slot. From 2c01b36585a89ad1e39d159c08daf07be736e2b4 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 12 Feb 2013 00:58:31 +0100 Subject: [PATCH 03/49] Some FPU optimization --- Core/MIPS/x86/CompFPU.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Core/MIPS/x86/CompFPU.cpp b/Core/MIPS/x86/CompFPU.cpp index 54f7459ff6..3f38104eb7 100644 --- a/Core/MIPS/x86/CompFPU.cpp +++ b/Core/MIPS/x86/CompFPU.cpp @@ -46,24 +46,27 @@ void Jit::CompFPTriArith(u32 op, void (XEmitter::*arith)(X64Reg reg, OpArg), boo int ft = _FT; int fs = _FS; int fd = _FD; - fpr.SpillLock(ft, fs, fd); + fpr.SpillLock(fd, fs, ft); - if (false && fs == fd) + if (fs == fd) { fpr.BindToRegister(fd, true, true); (this->*arith)(fpr.RX(fd), fpr.R(ft)); } - else + else if (ft == fd && !orderMatters) { - /* fpr.BindToRegister(fd, true, true); - if (fd != fs) - MOVSS(fpr.RX(fd), fpr.R(fs)); - (this->*arith)(fpr.RX(fd), fpr.R(ft));*/ + (this->*arith)(fpr.RX(fd), fpr.R(fs)); + } + else if (ft != fd && fs != fd && ft != fs) { + fpr.BindToRegister(fd, false, true); + MOVSS(fpr.RX(fd), fpr.R(fs)); + (this->*arith)(fpr.RX(fd), fpr.R(ft)); + } + else { + fpr.BindToRegister(fd, true, true); MOVSS(XMM0, fpr.R(fs)); - MOVSS(XMM1, fpr.R(ft)); - fpr.BindToRegister(fd, true, true); - (this->*arith)(XMM0, R(XMM1)); + (this->*arith)(XMM0, fpr.R(ft)); MOVSS(fpr.RX(fd), R(XMM0)); } fpr.ReleaseSpillLocks(); From 603a6d93f4e2f310fe507000ac1d64d3eac614ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Miko=C5=82ajczyk?= Date: Tue, 12 Feb 2013 01:36:16 +0100 Subject: [PATCH 04/49] Minor code cleanup --- Qt/mainwindow.cpp | 73 +++++++++++++++++++++-------------------------- Qt/mainwindow.h | 6 ++-- 2 files changed, 36 insertions(+), 43 deletions(-) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 734a0ee449..f6c28d24da 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -38,18 +38,15 @@ MainWindow::MainWindow(QWidget *parent) : gamePadDlg = new GamePadDialog(&input_state, this); #endif - SetPlaying(0); - host = new QtHost(this); - w = ui->widget; - w->init(&input_state); - w->resize(pixel_xres, pixel_yres); - w->setMinimumSize(pixel_xres, pixel_yres); - w->setMaximumSize(pixel_xres, pixel_yres); - QObject::connect( w, SIGNAL(doubleClick()), this, SLOT(on_action_OptionsFullScreen_triggered()) ); + emugl = ui->widget; + emugl->init(&input_state); + emugl->resize(pixel_xres, pixel_yres); + emugl->setMinimumSize(pixel_xres, pixel_yres); + emugl->setMaximumSize(pixel_xres, pixel_yres); + QObject::connect( emugl, SIGNAL(doubleClick()), this, SLOT(on_action_OptionsFullScreen_triggered()) ); createLanguageMenu(); - UpdateMenus(); int zoom = g_Config.iWindowZoom; @@ -57,19 +54,20 @@ MainWindow::MainWindow(QWidget *parent) : if (zoom > 4) zoom = 4; SetZoom(zoom); - EmuThread_Start(w); + EmuThread_Start(emugl); if (!fileToStart.isNull()) { - SetPlaying(fileToStart); - //Update(); + SetGameTitle(fileToStart); UpdateMenus(); EmuThread_StartGame(fileToStart); - } - if (!fileToStart.isNull() && stateToLoad != NULL) - SaveState::Load(stateToLoad); + if (stateToLoad != NULL) + SaveState::Load(stateToLoad); + } + else + SetGameTitle(""); } MainWindow::~MainWindow() @@ -164,26 +162,11 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co g_Config.memCardDirectory = std::string(getenv("HOME"))+"/.ppsspp/"; g_Config.flashDirectory = g_Config.memCardDirectory+"/flash/"; - LogManager::Init(); if (fileToLog != NULL) - LogManager::GetInstance()->ChangeFileLog(fileToLog); - //LogManager::GetInstance()->GetConsoleListener()->Open(hideLog, 150, 120, "PPSSPP Debug Console"); - LogManager::GetInstance()->SetLogLevel(LogTypes::G3D, LogTypes::LERROR); -} + LogManager::GetInstance()->ChangeFileLog(fileToLog); -void MainWindow::SetPlaying(QString text) -{ - if (text == 0) - { - QString title = "PPSSPP " + QString(PPSSPP_VERSION_STR); - setWindowTitle(title); - } - else - { - QString title = "PPSSPP " + QString(PPSSPP_VERSION_STR) + "-" + text; - setWindowTitle(title); - } + LogManager::GetInstance()->SetLogLevel(LogTypes::G3D, LogTypes::LERROR); } void MainWindow::SetNextState(CoreState state) @@ -191,6 +174,15 @@ void MainWindow::SetNextState(CoreState state) nextState = state; } +void MainWindow::SetGameTitle(QString text) +{ + QString title = "PPSSPP " + QString(PPSSPP_VERSION_STR); + if (text != "") + title += QString(" - %1").arg(text); + + setWindowTitle(title); +} + void MainWindow::BrowseAndBoot(void) { QString filename = QFileDialog::getOpenFileName(NULL, "Load File", g_Config.currentDirectory.c_str(), "PSP ROMs (*.pbp *.elf *.iso *.cso *.prx)"); @@ -261,6 +253,9 @@ void MainWindow::UpdateMenus() ui->action_CPUInterpreter->setEnabled(enable); ui->action_CPUFastInterpreter->setEnabled(enable); ui->action_EmulationStop->setEnabled(!enable); + ui->action_DebugDumpFrame->setEnabled(!enable); + ui->action_DebugDisassembly->setEnabled(!enable); + ui->action_DebugMemoryView->setEnabled(!enable); ui->action_OptionsScreen1x->setChecked(0 == (g_Config.iWindowZoom - 1)); ui->action_OptionsScreen2x->setChecked(1 == (g_Config.iWindowZoom - 1)); @@ -292,9 +287,9 @@ void MainWindow::SetZoom(float zoom) { dp_xres = pixel_xres; dp_yres = pixel_yres; - w->resize(pixel_xres, pixel_yres); - w->setMinimumSize(pixel_xres, pixel_yres); - w->setMaximumSize(pixel_xres, pixel_yres); + emugl->resize(pixel_xres, pixel_yres); + emugl->setMinimumSize(pixel_xres, pixel_yres); + emugl->setMaximumSize(pixel_xres, pixel_yres); ui->centralwidget->setFixedSize(pixel_xres, pixel_yres); ui->centralwidget->resize(pixel_xres, pixel_yres); @@ -339,8 +334,7 @@ void MainWindow::on_action_EmulationStop_triggered() memoryWindow->close(); EmuThread_StopGame(); - SetPlaying(0); - Update(); + SetGameTitle(""); UpdateMenus(); } @@ -596,8 +590,8 @@ void MainWindow::on_action_OptionsFullScreen_triggered() ui->statusbar->setVisible(false); // Remove constraint - w->setMinimumSize(0, 0); - w->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + emugl->setMinimumSize(0, 0); + emugl->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); ui->centralwidget->setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); @@ -853,7 +847,6 @@ void MainWindow::createLanguageMenu() locale.truncate(locale.lastIndexOf('.')); locale.remove(0, locale.indexOf('_') + 1); - //QString language = QLocale::languageToString(QLocale(locale).language()); QString language = QLocale(locale).nativeLanguageName(); QAction *action = new QAction(language, this); action->setCheckable(true); diff --git a/Qt/mainwindow.h b/Qt/mainwindow.h index d6de1f44e6..01b089c25d 100644 --- a/Qt/mainwindow.h +++ b/Qt/mainwindow.h @@ -29,7 +29,7 @@ public: void Create(int argc, const char *argv[], const char *savegame_directory, const char *external_directory, const char *installID); void BrowseAndBoot(); void SetNextState(CoreState state); - void SetPlaying(QString text); + void SetGameTitle(QString text); Debugger_Disasm* GetDialogDisasm() { return dialogDisasm; } Debugger_Memory* GetDialogMemory() { return memoryWindow; } @@ -163,9 +163,9 @@ private: QString currentLanguage; QString languagePath; - Ui::MainWindow *ui; + Ui::MainWindow *ui; - QtEmuGL* w; + QtEmuGL* emugl; CoreState nextState; InputState input_state; From 41aed1a09493dc5866345051d27404ab57794439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Miko=C5=82ajczyk?= Date: Tue, 12 Feb 2013 01:40:53 +0100 Subject: [PATCH 05/49] Qt: add AA, AF, show FPS to options --- Qt/languages/ppsspp_en.ts | 180 ++++++++++++++++++++++--------------- Qt/languages/ppsspp_fr.ts | 180 ++++++++++++++++++++++--------------- Qt/languages/ppsspp_pl.ts | 182 +++++++++++++++++++++++--------------- Qt/mainwindow.cpp | 48 ++++++++++ Qt/mainwindow.h | 14 +++ Qt/mainwindow.ui | 75 ++++++++++++++++ 6 files changed, 468 insertions(+), 211 deletions(-) diff --git a/Qt/languages/ppsspp_en.ts b/Qt/languages/ppsspp_en.ts index 67ab652ee1..c37a1fe9fe 100644 --- a/Qt/languages/ppsspp_en.ts +++ b/Qt/languages/ppsspp_en.ts @@ -6,7 +6,7 @@ Controls - Control window title + Controls window title @@ -539,318 +539,358 @@ - + + Anisotropic filtering + + + + &Help - + &Open... - + &Close - + - - + Quickload state - + F4 - + Quicksave state - + F2 - + &Load State File... - + &Save State File... - + E&xit - + &Run - + F7 - + &Pause - + F8 - + R&eset - + &Interpreter - + &Slightly Faster Interpreter - + &Dynarec - + Load &Map File... - + &Save Map File... - + &Reset Symbol Table - + &Disassembly - + Ctrl+D - + &Log Console - + Ctrl+L - + Memory &View... - + Ctrl+M - + Keyboard &Controls - + &Toggle Full Screen - + F12 - + &Buffered Rendering - + F5 - + &Hardware Transform - + F6 - + &Linear Filtering - + &Wireframe (experimental) - + &Display Raw Framebuffer - + &Show Debug Statistics - + Screen &1x - + Ctrl+1 - + Screen &2x - + Ctrl+2 - + Screen &3x - + Ctrl+3 - + Screen &4x - + Ctrl+4 - + &Fast Memory (dynarec, unstable) - + &Ignore illegal reads/writes - + &Go to http://www.ppsspp.org/ - + &About PPSSPP... - + &Use VBO - - - + + + Debug - - - + + + Warning - - - + + + Error - - - + + + Info - + GamePad Controls - + &Run on load - + D&ump next frame to log - + &Vertex Cache - + Memory View Texture... + + + Simple 2xAA + + + + + Off + + + + + 2x + + + + + 4x + + + + + 8x + + + + + 16x + + + + + Show FPS counter + + No translations diff --git a/Qt/languages/ppsspp_fr.ts b/Qt/languages/ppsspp_fr.ts index 945bbb1e20..3eca7f7754 100644 --- a/Qt/languages/ppsspp_fr.ts +++ b/Qt/languages/ppsspp_fr.ts @@ -6,7 +6,7 @@ Controls - Control window title + Controls window title @@ -539,318 +539,358 @@ Langue - + + Anisotropic filtering + + + + &Help &Aide - + &Open... &Ouvrir... - + &Close &Fermer - + - - + Quickload state - + F4 - + Quicksave state - + F2 - + &Load State File... - + &Save State File... - + E&xit &Quitter - + &Run - + F7 - + &Pause - + F8 - + R&eset - + &Interpreter - + &Slightly Faster Interpreter - + &Dynarec - + Load &Map File... - + &Save Map File... - + &Reset Symbol Table - + &Disassembly - + Ctrl+D - + &Log Console - + Ctrl+L - + Memory &View... - + Ctrl+M - + Keyboard &Controls - + &Toggle Full Screen - + F12 - + &Buffered Rendering - + F5 - + &Hardware Transform - + F6 - + &Linear Filtering - + &Wireframe (experimental) - + &Display Raw Framebuffer - + &Show Debug Statistics - + Screen &1x - + Ctrl+1 - + Screen &2x - + Ctrl+2 - + Screen &3x - + Ctrl+3 - + Screen &4x - + Ctrl+4 - + &Fast Memory (dynarec, unstable) - + &Ignore illegal reads/writes - + &Go to http://www.ppsspp.org/ - + &About PPSSPP... - + &Use VBO - - - + + + Debug - - - + + + Warning - - - + + + Error - - - + + + Info - + GamePad Controls - + &Run on load - + D&ump next frame to log - + &Vertex Cache - + Memory View Texture... + + + Simple 2xAA + + + + + Off + + + + + 2x + + + + + 4x + + + + + 8x + + + + + 16x + + + + + Show FPS counter + + No translations diff --git a/Qt/languages/ppsspp_pl.ts b/Qt/languages/ppsspp_pl.ts index ee2a848380..5da591151b 100644 --- a/Qt/languages/ppsspp_pl.ts +++ b/Qt/languages/ppsspp_pl.ts @@ -6,8 +6,8 @@ Controls - Control window title - Układ klawiszy + Controls window title + Układ klawiszy @@ -539,318 +539,358 @@ Język - + + Anisotropic filtering + Filtrowanie anizotropowe + + + &Help Pomo&c - + &Open... &Otwórz... - + &Close &Zamknij - + - - + Quickload state Wczytaj stan - + F4 F4 - + Quicksave state Zapisz stan - + F2 F2 - + &Load State File... &Wczytaj plik stanu... - + &Save State File... &Zapisz plik stanu... - + E&xit Wyj&dź - + &Run &Uruchom - + F7 F7 - + &Pause &Pauza - + F8 F8 - + R&eset &Reset - + &Interpreter &Interpreter - + &Slightly Faster Interpreter &Szybszy interpreter - + &Dynarec R&ekompilacja (Dynarec) - + Load &Map File... &Wczytaj plik mapy... - + &Save Map File... &Zapisz plik mapy... - + &Reset Symbol Table Zresetuj &tablicę symboli - + &Disassembly &Deasembler - + Ctrl+D Ctrl+D - + &Log Console &Konsola logowania - + Ctrl+L Ctrl+L - + Memory &View... Widok &pamięci... - + Ctrl+M Ctrl+M - + Keyboard &Controls Ustawienia &klawiatury - + &Toggle Full Screen &Pełny ekran - + F12 F12 - + &Buffered Rendering &Buforowane renderowanie - + F5 F5 - + &Hardware Transform Sprzętowa &transformacja - + F6 F6 - + &Linear Filtering Filtrowanie &liniowe - + &Wireframe (experimental) &Widok siatki (eksperymentalny) - + &Display Raw Framebuffer Wyświetl &surowy framebuffer - + &Show Debug Statistics Pokaż statystyki &emulacji - + Screen &1x &1x - + Ctrl+1 Ctrl+1 - + Screen &2x &2x - + Ctrl+2 Ctrl+2 - + Screen &3x &3x - + Ctrl+3 Ctrl+3 - + Screen &4x &4x - + Ctrl+4 Ctrl+4 - + &Fast Memory (dynarec, unstable) S&zybka pamięć (wymagany Dynarec, niestabilne) - + &Ignore illegal reads/writes &Ignoruj nieprawidłowe odczyty/zapisy - + &Go to http://www.ppsspp.org/ &Idź do http://www.ppsspp.org - + &About PPSSPP... &O PPSSPP... - + &Use VBO Użyj &VBO - - - + + + Debug Debug - - - + + + Warning Ostrzeżenia - - - + + + Error Błędy - - - + + + Info Info - + GamePad Controls Ustawienia pada - + &Run on load Uruchom po &załadowaniu - + D&ump next frame to log Z&rzuć następną ramkę do logu - + &Vertex Cache &Cache wierzchołków - + Memory View Texture... + + + Simple 2xAA + Prosty antyaliasing 2x + + + + Off + Wyłączone + + + + 2x + 2x + + + + 4x + 4x + + + + 8x + 8x + + + + 16x + 16x + + + + Show FPS counter + Pokaż licznik FPS + No translations diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index f6c28d24da..dbe4a29abf 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -237,6 +237,12 @@ void MainWindow::UpdateMenus() ui->action_EmulationRunLoad->setChecked(g_Config.bAutoRun); ui->action_OptionsUseVBO->setChecked(g_Config.bUseVBO); ui->action_OptionsVertexCache->setChecked(g_Config.bVertexCache); + ui->action_AFOff->setChecked(g_Config.iAnisotropyLevel == 0); + ui->action_AF2x->setChecked(g_Config.iAnisotropyLevel == 2); + ui->action_AF4x->setChecked(g_Config.iAnisotropyLevel == 4); + ui->action_AF8x->setChecked(g_Config.iAnisotropyLevel == 8); + ui->action_AF16x->setChecked(g_Config.iAnisotropyLevel == 16); + ui->action_Show_FPS_counter->setChecked(g_Config.bShowFPSCounter); bool enable = !Core_IsStepping() ? false : true; ui->action_EmulationRun->setEnabled(g_State.bEmuThreadStarted ? enable : false); @@ -939,3 +945,45 @@ void MainWindow::on_action_OptionsUseVBO_triggered() g_Config.bUseVBO = !g_Config.bUseVBO; UpdateMenus(); } + +void MainWindow::on_action_Simple_2xAA_triggered() +{ + g_Config.SSAntiAliasing = !g_Config.SSAntiAliasing; + UpdateMenus(); +} + +void MainWindow::on_action_AFOff_triggered() +{ + g_Config.iAnisotropyLevel = 0; + UpdateMenus(); +} + +void MainWindow::on_action_AF2x_triggered() +{ + g_Config.iAnisotropyLevel = 2; + UpdateMenus(); +} + +void MainWindow::on_action_AF4x_triggered() +{ + g_Config.iAnisotropyLevel = 4; + UpdateMenus(); +} + +void MainWindow::on_action_AF8x_triggered() +{ + g_Config.iAnisotropyLevel = 8; + UpdateMenus(); +} + +void MainWindow::on_action_AF16x_triggered() +{ + g_Config.iAnisotropyLevel = 16; + UpdateMenus(); +} + +void MainWindow::on_action_Show_FPS_counter_triggered() +{ + g_Config.bShowFPSCounter = !g_Config.bShowFPSCounter; + UpdateMenus(); +} diff --git a/Qt/mainwindow.h b/Qt/mainwindow.h index 01b089c25d..81603a641f 100644 --- a/Qt/mainwindow.h +++ b/Qt/mainwindow.h @@ -153,6 +153,20 @@ private slots: void on_action_OptionsUseVBO_triggered(); + void on_action_Simple_2xAA_triggered(); + + void on_action_AFOff_triggered(); + + void on_action_AF2x_triggered(); + + void on_action_AF4x_triggered(); + + void on_action_AF8x_triggered(); + + void on_action_AF16x_triggered(); + + void on_action_Show_FPS_counter_triggered(); + private: void loadLanguage(const QString &language); void createLanguageMenu(); diff --git a/Qt/mainwindow.ui b/Qt/mainwindow.ui index 67e1d79d4e..78eeedfad9 100644 --- a/Qt/mainwindow.ui +++ b/Qt/mainwindow.ui @@ -144,6 +144,16 @@ Language + + + Anisotropic filtering + + + + + + + @@ -151,12 +161,15 @@ + + + @@ -462,6 +475,9 @@ + + true + &Use VBO @@ -578,6 +594,9 @@ + + true + &Vertex Cache @@ -587,6 +606,62 @@ Memory View Texture... + + + true + + + Simple 2xAA + + + + + true + + + Off + + + + + true + + + 2x + + + + + true + + + 4x + + + + + true + + + 8x + + + + + true + + + 16x + + + + + true + + + Show FPS counter + + From 4e5250ab92edf1064efc000ed89449c5bdb4344b Mon Sep 17 00:00:00 2001 From: Sacha Date: Tue, 12 Feb 2013 12:55:15 +1000 Subject: [PATCH 06/49] Add Chinese (Simplified) translations to Qt front-end. Thanks to Chinese community. See: http://i.imgur.com/Satyijz.png --- Qt/PPSSPP.pro | 3 +- Qt/languages/ppsspp_cn.ts | 941 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 943 insertions(+), 1 deletion(-) create mode 100644 Qt/languages/ppsspp_cn.ts diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index a233854431..ceaeec9ab7 100755 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -23,7 +23,8 @@ desktop_ui { TRANSLATIONS = languages/ppsspp_en.ts \ languages/ppsspp_pl.ts \ - languages/ppsspp_fr.ts + languages/ppsspp_fr.ts \ + languages/ppsspp_cn.ts # Main SOURCES += ../native/base/QtMain.cpp diff --git a/Qt/languages/ppsspp_cn.ts b/Qt/languages/ppsspp_cn.ts new file mode 100644 index 0000000000..3106bdbd94 --- /dev/null +++ b/Qt/languages/ppsspp_cn.ts @@ -0,0 +1,941 @@ + + + + + Controls + + + Controls + 键盘布局 + + + + CtrlDisAsmView + + + Copy &address + + + + + Copy instruction (&hex) + + + + + Copy instruction (&disasm) + + + + + &Run to here + + + + + &Set Next Statement + + + + + &Toggle breakpoint + + + + + &Follow branch + + + + + Go to in &Memory View + + + + + &Rename function... + + + + + New function name + + + + + New function name : + + + + + CtrlMemView + + + Go to in &disasm + + + + + &Copy value + + + + + Dump... + + + + + CtrlRegisterList + + + Go to in &memory view + + + + + Go to in &disasm + + + + + &Copy value + + + + + C&hange... + + + + + Set new value + + + + + Set new value : + + + + + Debugger_Disasm + + + Dialog + + + + + Ctr: + + + + + &Go to + + + + + &PC + + + + + &LR + + + + + Show VFPU + + + + + Regs + + + + + Funcs + + + + + &Go + + + + + Stop + + + + + Step &Into + + + + + Step &Over + + + + + S&kip + + + + + Next &HLE + + + + + Breakpoints + + + + + Address + + + + + Clear All + + + + + Callstack + + + + + Display Lists + + + + + + Id + + + + + + Status + + + + + Start Address + + + + + Current Address + + + + + Run + + + + + Step + + + + + Threads + + + + + Name + + + + + Current PC + + + + + Entry point + + + + + Remove breakpoint + + + + + Go to entry point + + + + + Running + + + + + Wait + + + + + Suspend + + + + + Show code + + + + + Debugger_Memory + + + Dialog + + + + + Goto: + + + + + Mode + + + + + Normal + + + + + Symbols + + + + + Debugger_VFPU + + + Dialog + + + + + Float + + + + + HalfFloat + + + + + Hex + + + + + Bytes + + + + + Shorts + + + + + Ints + + + + + GamePadDialog + + + Gamepad Configuration + + + + + GamePad List + + + + + Refresh + + + + + Select + + + + + Gamepad Values : + + + + + TextLabel + + + + + Assign Gamepad input + + + + + to PSP button/axis + + + + + Assign + + + + + Press buttons on your gamePad to verify mapping : + + + + + + <b>No gamepad</b> + + + + + <b>Unknown gamepad</b> + + + + + Buttons + + + + + + Button %1 + + + + + Axes + + + + + %1 Neg + + + + + Axes %1 Neg + + + + + %1 Pos + + + + + Axes %1 Pos + + + + + Hats + + + + + <b>Current gamepad: %1</b> + + + + + MainWindow + + + PPSSPP + PPSSPP + + + + &File + (&F)文件 + + + + &Emulation + (&E)模拟 + + + + Debu&g + (&G)调试 + + + + &Options + (&O)选项 + + + + &Log Levels + (&L)日志级别 + + + + G3D + + + + + HLE + + + + + Default + 默认 + + + + Zoom + 缩放 + + + + Language + 语言 + + + + &Help + (&H)帮助 + + + + &Open... + (&O)打开 + + + + &Close + (&C)关闭 + + + + - + + + + + Quickload state + 快速读档 + + + + F4 + F4 + + + + Quicksave state + 快速存档 + + + + F2 + F2 + + + + &Load State File... + (&L)读取存档 + + + + &Save State File... + (&S)保存存档 + + + + E&xit + (&X)退出 + + + + &Run + (&R)运行 + + + + F7 + F7 + + + + &Pause + (&P)暂停 + + + + F8 + F8 + + + + R&eset + (&E)重置 + + + + &Interpreter + (&I)解释器 + + + + &Slightly Faster Interpreter + (&S)较快的解释器 + + + + &Dynarec + (&D)动态重编译 + + + + Load &Map File... + (&M)读取Map文件 + + + + &Save Map File... + (&S)保存Map文件 + + + + &Reset Symbol Table + (&R)重置符号表 + + + + &Disassembly + (&D)汇编视图 + + + + Ctrl+D + Ctrl+D + + + + &Log Console + (&L)查看控制台日志 + + + + Ctrl+L + Ctrl+L + + + + Memory &View... + (&V)内存视图 + + + + Ctrl+M + Ctrl+M + + + + Keyboard &Controls + 键盘与控制 + + + + &Toggle Full Screen + (&T)全屏幕 + + + + F12 + F12 + + + + &Buffered Rendering + (&B)渲染缓冲 + + + + F5 + F5 + + + + &Hardware Transform + (&H)硬件加速 + + + + F6 + F6 + + + + &Linear Filtering + (&L)线性过滤 + + + + &Wireframe (experimental) + (&W)使用线框 (实验性选项) + + + + &Display Raw Framebuffer + (&D)显示 Raw 原始缓冲 + + + + &Show Debug Statistics + (&S)显示调试统计 + + + + Screen &1x + &1倍窗口 + + + + Ctrl+1 + Ctrl+1 + + + + Screen &2x + &2倍窗口 + + + + Ctrl+2 + Ctrl+2 + + + + Screen &3x + &3倍窗口 + + + + Ctrl+3 + Ctrl+3 + + + + Screen &4x + &4倍窗口 + + + + Ctrl+4 + Ctrl+4 + + + + &Fast Memory (dynarec, unstable) + (&F)高速闪存 (动态重编译,不稳定) + + + + &Ignore illegal reads/writes + (&I)忽略非法读取/写入 + + + + &Go to http://www.ppsspp.org/ + (&G)转到 http://www.ppsspp.org/ + + + + &About PPSSPP... + (&A)关于 PPSSPP... + + + + &Use VBO + (&U)使用 VBO + + + + + + Debug + 调试 + + + + + + Warning + 警告 + + + + + + Error + 错误 + + + + + + Info + 信息 + + + + GamePad Controls + 手柄控制 + + + + &Run on load + (&R)加载后立即执行 + + + + D&ump next frame to log + (&U)将下一帧转储至日志 + + + + &Vertex Cache + (&V)顶点缓存 + + + + Memory View Texture... + + + + + No translations + + + + + gamepadMapping + + + Cross + + + + + Circle + + + + + Square + + + + + Triangle + + + + + Left Trigger + + + + + Right Trigger + + + + + Start + + + + + Select + + + + + Up + + + + + Down + + + + + Left + + + + + Right + + + + + Home + + + + + Stick left + + + + + Stick right + + + + + Stick up + + + + + Stick bottom + + + + From 66433a7386c20febe05c13d77325a6417a02d8d6 Mon Sep 17 00:00:00 2001 From: Sacha Date: Tue, 12 Feb 2013 14:39:18 +1000 Subject: [PATCH 07/49] Add a pause button to Symbian as it has no way of going back. --- android/jni/GamepadEmu.cpp | 15 +++++++++++++++ android/jni/MenuScreens.cpp | 5 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/android/jni/GamepadEmu.cpp b/android/jni/GamepadEmu.cpp index df93dda3c3..83e0b53429 100644 --- a/android/jni/GamepadEmu.cpp +++ b/android/jni/GamepadEmu.cpp @@ -32,6 +32,9 @@ TouchButton buttonLeft(&ui_atlas, I_DIR, I_ARROW, PAD_BUTTON_LEFT, 0); TouchButton buttonUp(&ui_atlas, I_DIR, I_ARROW, PAD_BUTTON_UP, 90); TouchButton buttonRight(&ui_atlas, I_DIR, I_ARROW, PAD_BUTTON_RIGHT, 180); TouchButton buttonDown(&ui_atlas, I_DIR, I_ARROW, PAD_BUTTON_DOWN, 270); +#ifdef __SYMBIAN32__ +TouchButton buttonPause(&ui_atlas, I_RECT, I_ARROW, PAD_BUTTON_BACK, 90); +#endif TouchStick leftStick(&ui_atlas, I_STICKBG, I_STICK, 0); @@ -72,6 +75,10 @@ void LayoutGamepad(int w, int h) buttonLShoulder.setPos(button_spacing + 10 * controlScale, 15 * controlScale, controlScale); buttonRShoulder.setPos(w - button_spacing - 10 * controlScale, 15 * controlScale, controlScale); +#ifdef __SYMBIAN32__ + buttonPause.setPos(halfW, 15 * controlScale, controlScale); +#endif + leftStick.setPos(stickX, stickY, controlScale); } @@ -94,6 +101,10 @@ void UpdateGamepad(InputState &input_state) buttonLShoulder.update(input_state); buttonRShoulder.update(input_state); +#ifdef __SYMBIAN32__ + buttonPause.update(input_state); +#endif + if (g_Config.bShowAnalogStick) leftStick.update(input_state); } @@ -117,6 +128,10 @@ void DrawGamepad(DrawBuffer &db) buttonLShoulder.draw(db, color, colorOverlay); buttonRShoulder.draw(db, color, colorOverlay); +#ifdef __SYMBIAN32__ + buttonPause.draw(db, color, colorOverlay); +#endif + if (g_Config.bShowAnalogStick) leftStick.draw(db, color); } diff --git a/android/jni/MenuScreens.cpp b/android/jni/MenuScreens.cpp index 22cce80bdb..fb03c2698c 100644 --- a/android/jni/MenuScreens.cpp +++ b/android/jni/MenuScreens.cpp @@ -170,7 +170,7 @@ void MenuScreen::render() { VLinear vlinear(dp_xres + xoff, 95, 20); if (UIButton(GEN_ID, vlinear, w, "Load...", ALIGN_RIGHT)) { -#if defined(USING_QT_UI) && defined(__SYMBIAN32__) +#if defined(USING_QT_UI) QString fileName = QFileDialog::getOpenFileName(NULL, "Load ROM", g_Config.currentDirectory.c_str(), "PSP ROMs (*.iso *.cso *.pbp *.elf)"); if (QFile::exists(fileName)) { QDir newPath; @@ -462,7 +462,8 @@ static const char *credits[] = "Android SDK + NDK", #elif defined(BLACKBERRY) "Blackberry NDK", -#elif defined(USING_QT_UI) +#endif +#if defined(USING_QT_UI) "Qt", #else "SDL", From 7043419cb8646caeb1b73de8ae8d52d76b207eb3 Mon Sep 17 00:00:00 2001 From: Sacha Date: Tue, 12 Feb 2013 16:47:12 +1000 Subject: [PATCH 08/49] More translations for Chinese. Thanks to lg560852. --- Qt/languages/ppsspp_cn.ts | 271 +++++++++++++++++++------------------- 1 file changed, 136 insertions(+), 135 deletions(-) mode change 100644 => 100755 Qt/languages/ppsspp_cn.ts diff --git a/Qt/languages/ppsspp_cn.ts b/Qt/languages/ppsspp_cn.ts old mode 100644 new mode 100755 index 3106bdbd94..8e070cd874 --- a/Qt/languages/ppsspp_cn.ts +++ b/Qt/languages/ppsspp_cn.ts @@ -1,12 +1,12 @@ - + Controls Controls - 键盘布局 + 控制器 @@ -14,57 +14,57 @@ Copy &address - + (&A)复制地址 Copy instruction (&hex) - + (&H)复制指令(十六进制型) Copy instruction (&disasm) - + (&D)复制指令(汇编型) &Run to here - + (&R)执行到此处 &Set Next Statement - + (&S)设置下一语句 &Toggle breakpoint - + (&T)锁定断点 &Follow branch - + (&F)跟随分支 Go to in &Memory View - + (&M)转到内存视图 &Rename function... - + (&R)重命名函数... New function name - + 新函数名称 New function name : - + 新函数名称: @@ -72,17 +72,17 @@ Go to in &disasm - + (&D)转到汇编视图 &Copy value - + (&C)复制值 Dump... - + 转储... @@ -90,32 +90,32 @@ Go to in &memory view - + (&M)转到内存视图 Go to in &disasm - + (&D)转到汇编视图 &Copy value - + (&C)复制值 C&hange... - + (&H)更改... Set new value - + 设置新值 Set new value : - + 设置新值: @@ -123,179 +123,179 @@ Dialog - + 对话框 Ctr: - + 计数器: &Go to - + (&G)转到 &PC - + (&P)PC寄存器 &LR - + (&L)连接寄存器 Show VFPU - + 显示VFPU Regs - + 寄存器 Funcs - + 函数 &Go - + (&G)转到 Stop - + 停止 Step &Into - + (&I)单步跟进 Step &Over - + (&O)单步步过 S&kip - + (&K)跳过 Next &HLE - + (&H)下一HLE Breakpoints - + 断点 Address - + 地址 Clear All - + 清空所有 Callstack - + 调用栈 Display Lists - + 显示列表 Id - + Id Status - + 状态 Start Address - + 起始地址 Current Address - + 当前地址 Run - + 执行 Step - + 单步执行 Threads - + 线程 Name - + 名称 Current PC - + 当前PC寄存器 Entry point - + 入口点 Remove breakpoint - + 移除断点 Go to entry point - + 转到入口点 Running - + 执行中 Wait - + 等待 Suspend - + 挂起 Show code - + 显示代码 @@ -303,27 +303,27 @@ Dialog - + 对话框 Goto: - + 转到: Mode - + 模式 Normal - + 普通模式 Symbols - + 特征符模式 @@ -331,37 +331,37 @@ Dialog - + 对话框 Float - + 浮点型 HalfFloat - + 半浮点型 Hex - + 十六进制型 Bytes - + 字节型 Shorts - + 短整型 Ints - + 整型 @@ -369,109 +369,110 @@ Gamepad Configuration - + 手柄设置 GamePad List - + 手柄列表 Refresh - + 刷新 Select - + 选中 Gamepad Values : - + 手柄值: TextLabel - + TextLabel + TextLabel Assign Gamepad input - + 指定该手柄 to PSP button/axis - + 作为PSP按键/摇杆输入 Assign - + 指定 Press buttons on your gamePad to verify mapping : - + 按下手柄按键来确认键位映射: <b>No gamepad</b> - + <b>未发现手柄</b> <b>Unknown gamepad</b> - + <b>未识别的手柄</b> Buttons - + 按钮 Button %1 - + 按钮 %1 Axes - + 摇杆 %1 Neg - + %1 Neg Axes %1 Neg - + Axes %1 Neg %1 Pos - + %1 Pos Axes %1 Pos - + Axes %1 Pos Hats - + Hats <b>Current gamepad: %1</b> - + <b>当前手柄: %1</b> @@ -479,7 +480,7 @@ PPSSPP - PPSSPP + PPSSPP @@ -509,12 +510,12 @@ G3D - + HLE - + @@ -539,7 +540,7 @@ &Open... - (&O)打开 + (&O)打开... @@ -549,7 +550,7 @@ - - + - @@ -574,12 +575,12 @@ &Load State File... - (&L)读取存档 + (&L)读取存档... &Save State File... - (&S)保存存档 + (&S)保存存档... @@ -629,12 +630,12 @@ Load &Map File... - (&M)读取Map文件 + (&M)读取Map文件... &Save Map File... - (&S)保存Map文件 + (&S)保存Map文件... @@ -649,7 +650,7 @@ Ctrl+D - Ctrl+D + Ctrl+D @@ -659,22 +660,22 @@ Ctrl+L - Ctrl+L + Ctrl+L Memory &View... - (&V)内存视图 + (&V)内存视图... Ctrl+M - Ctrl+M + Ctrl+M Keyboard &Controls - 键盘与控制 + (&C)键盘与控制 @@ -684,7 +685,7 @@ F12 - F12 + F12 @@ -694,7 +695,7 @@ F5 - F5 + F5 @@ -704,7 +705,7 @@ F6 - F6 + F6 @@ -734,7 +735,7 @@ Ctrl+1 - Ctrl+1 + Ctrl+1 @@ -744,7 +745,7 @@ Ctrl+2 - Ctrl+2 + Ctrl+2 @@ -754,7 +755,7 @@ Ctrl+3 - Ctrl+3 + Ctrl+3 @@ -764,7 +765,7 @@ Ctrl+4 - Ctrl+4 + Ctrl+4 @@ -796,33 +797,33 @@ Debug - 调试 + 调试 Warning - 警告 + 警告 Error - 错误 + 错误 Info - 信息 + 信息 GamePad Controls - 手柄控制 + 手柄控制 @@ -842,12 +843,12 @@ Memory View Texture... - + 内存纹理视图... No translations - + 未翻译 @@ -855,87 +856,87 @@ Cross - + × Circle - + Square - + Triangle - + Left Trigger - + L Right Trigger - + R Start - + 开始 Select - + 选择 Up - + Down - + Left - + Right - + Home - + Home Stick left - + 摇杆左 Stick right - + 摇杆右 Stick up - + 摇杆上 Stick bottom - + 摇杆下 From a7f46351c8c3d4c18c0e9b3bc78a537cdfce5811 Mon Sep 17 00:00:00 2001 From: raven02 Date: Tue, 12 Feb 2013 15:07:17 +0800 Subject: [PATCH 09/49] FPS: 0.7f for mobile and 0.5f for windows platform/rest --- Core/HLE/sceDisplay.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 5f6cada894..e7bb29ce4d 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -299,8 +299,13 @@ void hleEnterVblank(u64 userdata, int cyclesLate) { sprintf(stats, "%0.1f", calculateFPS()); - float zoom = 0.7f; /// g_Config.iWindowZoom; - float soff = 0.7f; + #ifdef USING_GLES2 + float zoom = 0.7f; /// g_Config.iWindowZoom; + float soff = 0.7f; + #else + float zoom = 0.5f; /// g_Config.iWindowZoom; + float soff = 0.5f; + #endif PPGeBegin(); PPGeDrawText(stats, 476 + soff, 4 + soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000); PPGeDrawText(stats, 476 + -soff, 4 -soff, PPGE_ALIGN_RIGHT, zoom, 0xCC000000); From 7d2c5c5041da93fda5ad7b1caa16f89ef3c8e528 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 11 Feb 2013 23:29:49 -0800 Subject: [PATCH 10/49] Fix vai->numFrames never incrementing. This made it never cache... oops. --- GPU/GLES/TransformPipeline.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 04653b50e7..d7fb760bff 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -913,7 +913,6 @@ void TransformDrawEngine::Flush() { vai->decFmt = dec.GetDecVtxFmt(); vai_[id] = vai; } - vai->lastFrame = gpuStats.numFrames; switch (vai->status) { case VertexArrayInfo::VAI_NEW: @@ -1025,6 +1024,8 @@ void TransformDrawEngine::Flush() { goto rotateVBO; } } + + vai->lastFrame = gpuStats.numFrames; } else { DecodeVerts(); rotateVBO: From 485bcac75793fcb0dd1807e3ef9f266b7b42ad0f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 11 Feb 2013 23:41:31 -0800 Subject: [PATCH 11/49] Actually, these are draws. Increase to 24. --- GPU/GLES/TransformPipeline.cpp | 10 +++++----- GPU/GLES/TransformPipeline.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index d7fb760bff..a82441285e 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -921,7 +921,7 @@ void TransformDrawEngine::Flush() { u32 dataHash = ComputeHash(); vai->hash = dataHash; vai->status = VertexArrayInfo::VAI_HASHING; - vai->framesUntilNextFullHash = 0; + vai->drawsUntilNextFullHash = 0; DecodeVerts(); // writes to indexGen goto rotateVBO; } @@ -934,10 +934,10 @@ void TransformDrawEngine::Flush() { if (vai->lastFrame != gpuStats.numFrames) { vai->numFrames++; } - if (vai->framesUntilNextFullHash == 0) { + if (vai->drawsUntilNextFullHash == 0) { u32 newHash = ComputeHash(); - // exponential backoff up to 16 frames - vai->framesUntilNextFullHash = std::min(16, vai->numFrames); + // exponential backoff up to 16 draws, then every 24 + vai->drawsUntilNextFullHash = std::min(24, vai->numFrames); // TODO: tweak //if (vai->numFrames > 1000) { // vai->status = VertexArrayInfo::VAI_RELIABLE; @@ -956,7 +956,7 @@ void TransformDrawEngine::Flush() { goto rotateVBO; } } else { - vai->framesUntilNextFullHash--; + vai->drawsUntilNextFullHash--; // TODO: "mini-hashing" the first 32 bytes of the vertex/index data or something. } diff --git a/GPU/GLES/TransformPipeline.h b/GPU/GLES/TransformPipeline.h index 56be85431b..816440427d 100644 --- a/GPU/GLES/TransformPipeline.h +++ b/GPU/GLES/TransformPipeline.h @@ -58,7 +58,7 @@ public: numFrames = 0; lastFrame = gpuStats.numFrames; numVerts = 0; - framesUntilNextFullHash = 0; + drawsUntilNextFullHash = 0; } ~VertexArrayInfo(); enum Status { @@ -87,7 +87,7 @@ public: int numDraws; int numFrames; int lastFrame; // So that we can forget. - u16 framesUntilNextFullHash; + u16 drawsUntilNextFullHash; }; From 1e1979b786a62b9df1750ed62d83d4fa9f540238 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 12 Feb 2013 00:02:53 -0800 Subject: [PATCH 12/49] Simply don't cache < 100 verts for now. Fixes wrong vertexes in a number of games. --- GPU/GLES/TransformPipeline.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index a82441285e..c4eccd5725 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -936,12 +936,6 @@ void TransformDrawEngine::Flush() { } if (vai->drawsUntilNextFullHash == 0) { u32 newHash = ComputeHash(); - // exponential backoff up to 16 draws, then every 24 - vai->drawsUntilNextFullHash = std::min(24, vai->numFrames); - // TODO: tweak - //if (vai->numFrames > 1000) { - // vai->status = VertexArrayInfo::VAI_RELIABLE; - //} if (newHash != vai->hash) { vai->status = VertexArrayInfo::VAI_UNRELIABLE; if (vai->vbo) { @@ -955,6 +949,17 @@ void TransformDrawEngine::Flush() { DecodeVerts(); goto rotateVBO; } + if (vai->numVerts > 100) { + // exponential backoff up to 16 draws, then every 24 + vai->drawsUntilNextFullHash = std::min(24, vai->numFrames); + } else { + // Lower numbers seem much more likely to change. + vai->status = VertexArrayInfo::VAI_UNRELIABLE; + } + // TODO: tweak + //if (vai->numFrames > 1000) { + // vai->status = VertexArrayInfo::VAI_RELIABLE; + //} } else { vai->drawsUntilNextFullHash--; // TODO: "mini-hashing" the first 32 bytes of the vertex/index data or something. From b548fe0aa699195b79df581a09ee133379f613d6 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 12 Feb 2013 00:17:12 -0800 Subject: [PATCH 13/49] Don't mark unreliable, just rehash each time. This improves perf significantly without the bugs. --- GPU/GLES/TransformPipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index c4eccd5725..68dfaf9b8e 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -954,7 +954,7 @@ void TransformDrawEngine::Flush() { vai->drawsUntilNextFullHash = std::min(24, vai->numFrames); } else { // Lower numbers seem much more likely to change. - vai->status = VertexArrayInfo::VAI_UNRELIABLE; + vai->drawsUntilNextFullHash = 0; } // TODO: tweak //if (vai->numFrames > 1000) { From 5a20d9fc2a1e3bf002247e742331cf7b4eddad5b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 12 Feb 2013 01:00:52 -0800 Subject: [PATCH 14/49] Clear vertex cache on savestates. Just so it's an easy way. We can remove later when we're sure. --- GPU/GLES/DisplayListInterpreter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/GPU/GLES/DisplayListInterpreter.cpp b/GPU/GLES/DisplayListInterpreter.cpp index eb793ecaf5..42bd68988d 100644 --- a/GPU/GLES/DisplayListInterpreter.cpp +++ b/GPU/GLES/DisplayListInterpreter.cpp @@ -1065,6 +1065,7 @@ void GLES_GPU::DoState(PointerWrap &p) { GPUCommon::DoState(p); textureCache_.Clear(true); + transformDraw_.ClearTrackedVertexArrays(); gstate_c.textureChanged = true; framebufferManager_.DestroyAllFBOs(); From fb7cabcccf997da03711b2e3005d001ff807cb06 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 12 Feb 2013 01:06:11 -0800 Subject: [PATCH 15/49] Fix some missing GPUCommon state. --- GPU/GPUCommon.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 336d46b093..d41ab94ab2 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -142,6 +142,23 @@ void GPUCommon::PreExecuteOp(u32 op, u32 diff) { void GPUCommon::DoState(PointerWrap &p) { p.Do(dlIdGenerator); p.Do(dlQueue); + int currentID = currentList == NULL ? 0 : currentList->id; + p.Do(currentID); + if (currentID == 0) { + currentList = 0; + } else { + for (auto it = dlQueue.begin(), end = dlQueue.end(); it != end; ++it) { + if (it->id == currentID) { + currentList = &*it; + break; + } + } + } + p.Do(interruptRunning); + p.Do(prev); + p.Do(stack); + p.Do(stackptr); + p.Do(finished); p.DoMarker("GPUCommon"); } From 5486d0a3c1c553accae0e12460843ef449d3bb0f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 12 Feb 2013 01:12:32 -0800 Subject: [PATCH 16/49] Don't crash if currentList is NULL. --- GPU/GPUCommon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index d58ae86ac3..66b6ccbdd8 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -44,7 +44,7 @@ protected: public: virtual DisplayList* getList(int listid) { - if(currentList->id == listid) + if (currentList && currentList->id == listid) return currentList; for(auto it = dlQueue.begin(); it != dlQueue.end(); ++it) { From c00bdb6f82f86f969186b0aef0ede32b21f7dc5a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 12 Feb 2013 01:23:05 -0800 Subject: [PATCH 17/49] Don't savestate the last frame time. --- Core/HLE/sceDisplay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index e7bb29ce4d..86bf36750a 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -86,6 +86,7 @@ static int hCountTotal; //unused static int vCount; static int isVblank; static bool hasSetMode; +// Don't include this in the state, time increases regardless of state. static double lastFrameTime; std::vector vblankWaitingThreads; @@ -137,7 +138,6 @@ void __DisplayDoState(PointerWrap &p) { p.Do(vCount); p.Do(isVblank); p.Do(hasSetMode); - p.Do(lastFrameTime); WaitVBlankInfo wvi(0); p.Do(vblankWaitingThreads, wvi); From f5431dcb8bdcceb015c1dbb1c42a5727eef22984 Mon Sep 17 00:00:00 2001 From: raven02 Date: Tue, 12 Feb 2013 22:43:41 +0800 Subject: [PATCH 18/49] Fix SW transform in Kidou_Senshi_Gundam_AGE_Universe_Accel --- GPU/GLES/TransformPipeline.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 68dfaf9b8e..1005515c20 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -509,6 +509,14 @@ void TransformDrawEngine::SoftwareTransformAndDraw( if (gstate.lightingEnable & 1) { // Don't ignore gstate.lmode - we should send two colors in that case + if (reader.hasColor0()) { + reader.ReadColor0(litColor0); + } else { + litColor0[0] = (gstate.materialambient & 0xFF) / 255.f; + litColor0[1] = ((gstate.materialambient >> 8) & 0xFF) / 255.f; + litColor0[2] = ((gstate.materialambient >> 16) & 0xFF) / 255.f; + litColor0[3] = (gstate.materialalpha & 0xFF) / 255.f; + } if (gstate.lmode & 1) { // Separate colors for (int j = 0; j < 4; j++) { From 21483f2d4c32ac5f73c219efcc69b732e6070d2e Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 12 Feb 2013 07:42:07 -0800 Subject: [PATCH 19/49] Cut down on rescheduling in sceGeListEnqueue. Fixes ClaDun X2. --- Core/HLE/sceGe.cpp | 7 ++++++- Core/HLE/sceGe.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index a8de87bf08..16e790d342 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -112,8 +112,13 @@ void __GeShutdown() } -void __GeTriggerInterrupt(int listid, u32 pc, u32 subIntrBase, u16 subIntrToken) +void __GeTriggerInterrupt(int listid, u32 pc, int subIntrBase, u16 subIntrToken) { + // ClaDun X2 does not expect sceGeListEnqueue to reschedule (which it does not on the PSP.) + // Once PPSSPP's GPU is multithreaded, we can remove this check. + if (subIntrBase < 0) + return; + GeInterruptData intrdata; intrdata.listid = listid; intrdata.pc = pc; diff --git a/Core/HLE/sceGe.h b/Core/HLE/sceGe.h index c2621a492f..4e8f2ff48b 100644 --- a/Core/HLE/sceGe.h +++ b/Core/HLE/sceGe.h @@ -39,7 +39,7 @@ void Register_sceGe_user(); void __GeInit(); void __GeDoState(PointerWrap &p); void __GeShutdown(); -void __GeTriggerInterrupt(int listid, u32 pc, u32 subIntrBase, u16 subIntrToken); +void __GeTriggerInterrupt(int listid, u32 pc, int subIntrBase, u16 subIntrToken); bool __GeHasPendingInterrupt(); From 8e51ce1bebae2c2449c67cd3a8c2f597525147dc Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 12 Feb 2013 07:55:44 -0800 Subject: [PATCH 20/49] Check the entire texture again, fixes wrong tex. Not sure why, but only on Android. Also faster on Windows. --- GPU/GLES/TextureCache.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 73b36a4eab..b73ab4bff6 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -653,18 +653,11 @@ static inline u32 MiniHash(const u32 *ptr) { } static inline u32 QuickTexHash(u32 addr, int bufw, int w, int h, u32 format) { - int pixToBytes = (bitsPerPixel[format < 11 ? format : 0] + 7) / 8; - int w32 = (w * pixToBytes + 3) / 4; - int pad32 = ((bufw * pixToBytes + 3) / 4) - w32; - + u32 sizeInRAM = (bitsPerPixel[format < 11 ? format : 0] * bufw * h / 2) / 8; const u32 *checkp = (const u32 *) Memory::GetPointer(addr); u32 check = 0; - for (int y = 0; y < h; ++y) { - for (int x = 0; x < w32; ++x) { - check += *checkp++; - } - checkp += pad32; - } + for (u32 i = 0; i < (sizeInRAM * 2) / 4; ++i) + check += *checkp++; return check; } From 1bfede452db5edc91f1193aaf92ff99d2a78b483 Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 03:07:36 +1000 Subject: [PATCH 21/49] Compile translations in to binary. This helps with packaging on mobile platforms. Also, build resources in a different dir so it doesn't conflict. --- Qt/PPSSPP.pro | 1 + Qt/languages/ppsspp_cn.ts | 0 Qt/mainwindow.cpp | 5 +---- Qt/resources.qrc | 6 ++++++ 4 files changed, 8 insertions(+), 4 deletions(-) mode change 100755 => 100644 Qt/languages/ppsspp_cn.ts diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index ceaeec9ab7..351a25551a 100755 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -43,6 +43,7 @@ INCLUDEPATH += .. ../Common ../native desktop_ui { MOC_DIR = moc UI_DIR = ui + RCC_DIR = rcc SOURCES += *.cpp HEADERS += *.h FORMS += *.ui diff --git a/Qt/languages/ppsspp_cn.ts b/Qt/languages/ppsspp_cn.ts old mode 100755 new mode 100644 diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index dbe4a29abf..d924e76c87 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -833,10 +833,7 @@ void MainWindow::createLanguageMenu() QString defaultLocale = QLocale::system().name(); defaultLocale.truncate(defaultLocale.lastIndexOf('_')); - languagePath = QApplication::applicationDirPath(); - languagePath.append("/languages"); - QDir langDir(languagePath); - QStringList fileNames = langDir.entryList(QStringList("ppsspp_*.qm")); + QStringList fileNames = QDir(":/languages").entryList(QStringList("ppsspp_*.qm")); if (fileNames.size() == 0) { diff --git a/Qt/resources.qrc b/Qt/resources.qrc index 444064348b..a6d411f82e 100644 --- a/Qt/resources.qrc +++ b/Qt/resources.qrc @@ -17,4 +17,10 @@ resources/stop1.ico resources/icon1.ico + + languages/ppsspp_cn.qm + languages/ppsspp_en.qm + languages/ppsspp_fr.qm + languages/ppsspp_pl.qm + From 58454413b3f26948c8906793a9bee6cb2d55b820 Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 04:05:54 +1000 Subject: [PATCH 22/49] Use QNX atomic_set on Blackberry. Allows Playbook builds to continue on GCC 4.4. --- Common/Atomic_GCC.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Common/Atomic_GCC.h b/Common/Atomic_GCC.h index e8c39c63bb..c6f508cc3d 100644 --- a/Common/Atomic_GCC.h +++ b/Common/Atomic_GCC.h @@ -18,6 +18,10 @@ #ifndef _ATOMIC_GCC_H_ #define _ATOMIC_GCC_H_ +#ifdef BLACKBERRY +#include +#endif + #include "Common.h" // Atomic operations are performed in a single step by the CPU. It is @@ -73,7 +77,11 @@ inline void AtomicStore(volatile u32& dest, u32 value) { dest = value; // 32-bit writes are always atomic. } inline void AtomicStoreRelease(volatile u32& dest, u32 value) { +#ifdef BLACKBERRY + atomic_set(&dest, value); +#else __sync_lock_test_and_set(&dest, value); // TODO: Wrong! This function is has acquire semantics. +#endif } } From 174b9749d7736d908a53e65955e4395a244d0024 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 12 Feb 2013 19:05:30 +0100 Subject: [PATCH 23/49] Minor speedup to 16-bit texture color conversion. --- GPU/GLES/TextureCache.cpp | 56 +++++++++++++++------------------------ GPU/GLES/TextureCache.h | 2 ++ 2 files changed, 24 insertions(+), 34 deletions(-) diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index b73ab4bff6..1dc68b97ec 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -29,6 +29,7 @@ float maxAnisotropyLevel ; TextureCache::TextureCache() { + lastBoundTexture = -1; // TODO: Switch to aligned allocations for alignment. AllocateMemoryPages would do the trick. // This is 5MB of temporary storage. Might be possible to shrink it. tmpTexBuf32 = new u32[1024 * 512]; // 2MB @@ -442,24 +443,6 @@ void TextureCache::UpdateSamplingParams(TexCacheEntry &entry, bool force) { } } -// Todo: Make versions of these that do two pixels at a time within a 32-bit register. - -// Convert from PSP bit order to GLES bit order -static inline u16 convert565(u16 c) { - return (c >> 11) | (c & 0x07E0) | (c << 11); -} - -// Convert from PSP bit order to GLES bit order -static inline u16 convert4444(u16 c) { - return (c >> 12) | ((c >> 4) & 0xF0) | ((c << 4) & 0xF00) | (c << 12); -} - -// Convert from PSP bit order to GLES bit order -static inline u16 convert5551(u16 c) { - return ((c & 0x8000) >> 15) | (c << 1); -} - - // All these DXT structs are in the reverse order, as compared to PC. // On PC, alpha comes before color, and interpolants are before the tile data. @@ -575,33 +558,40 @@ static void decodeDXT5Block(u32 *dst, const DXT5Block *src, int pitch) { } static void convertColors(u8 *finalBuf, GLuint dstFmt, int numPixels) { - // TODO: All these can be massively sped up with SSE, or even - // somewhat sped up using "manual simd" in 32 or 64-bit gprs. + // TODO: All these can be further sped up with SSE or NEON. switch (dstFmt) { case GL_UNSIGNED_SHORT_4_4_4_4: { - u16 *p = (u16 *)finalBuf; - for (int i = 0; i < numPixels; i++) { - u16 c = p[i]; - p[i] = (c >> 12) | ((c >> 4) & 0xF0) | ((c << 4) & 0xF00) | (c << 12); + u32 *p = (u32 *)finalBuf; + for (int i = 0; i < (numPixels + 1) / 2; i++) { + u32 c = p[i]; + p[i] = ((c >> 12) & 0x000F000F) | + ((c >> 4) & 0x00F000F0) | + ((c << 4) & 0x0F000F00) | + ((c << 12) & 0xF000F000); } } break; case GL_UNSIGNED_SHORT_5_5_5_1: { - u16 *p = (u16 *)finalBuf; - for (int i = 0; i < numPixels; i++) { - u16 c = p[i]; - p[i] = ((c & 0x8000) >> 15) | ((c >> 9) & 0x3E) | ((c << 1) & 0x7C0) | ((c << 11) & 0xF800); + u32 *p = (u32 *)finalBuf; + for (int i = 0; i < (numPixels + 1) / 2; i++) { + u32 c = p[i]; + p[i] = ((c >> 15) & 0x00010001) | + ((c >> 9) & 0x003E003E) | + ((c << 1) & 0x07C007C0) | + ((c << 11) & 0xF800F800); } } break; case GL_UNSIGNED_SHORT_5_6_5: { - u16 *p = (u16 *)finalBuf; - for (int i = 0; i < numPixels; i++) { - u16 c = p[i]; - p[i] = (c >> 11) | (c & 0x07E0) | (c << 11); + u32 *p = (u32 *)finalBuf; + for (int i = 0; i < (numPixels + 1) / 2; i++) { + u32 c = p[i]; + p[i] = ((c >> 11) & 0x001F001F) | + (c & 0x07E007E0) | + ((c << 11) & 0xF800F800); } } break; @@ -613,8 +603,6 @@ static void convertColors(u8 *finalBuf, GLuint dstFmt, int numPixels) { } } -int lastBoundTexture = -1; - void TextureCache::StartFrame() { lastBoundTexture = -1; Decimate(); diff --git a/GPU/GLES/TextureCache.h b/GPU/GLES/TextureCache.h index 7219d010cc..881e672902 100644 --- a/GPU/GLES/TextureCache.h +++ b/GPU/GLES/TextureCache.h @@ -99,5 +99,7 @@ private: u32 *clutBuf32; u16 *clutBuf16; + + int lastBoundTexture; }; From 3747c92d3dd5bb26b60b189ea3f727d0523dcc7e Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 12 Feb 2013 19:17:02 +0100 Subject: [PATCH 24/49] Enable dithering in GLES UI --- android/jni/UIShader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/android/jni/UIShader.cpp b/android/jni/UIShader.cpp index 4fecc16a51..94d18c5093 100644 --- a/android/jni/UIShader.cpp +++ b/android/jni/UIShader.cpp @@ -89,6 +89,7 @@ void UIShader_Prepare() glstate.depthTest.disable(); glstate.scissorTest.disable(); glstate.stencilTest.disable(); + glstate.dither.enable(); glstate.blend.enable(); glstate.blendFunc.set(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); From 952ea28b7637c03e7c00ff9f3c2543669daf4900 Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 04:54:04 +1000 Subject: [PATCH 25/49] Move PPSSPP specific window init in to PPSSPP as native should be generic. --- Qt/mainwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index d924e76c87..2c69ca407e 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -167,6 +167,12 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co LogManager::GetInstance()->ChangeFileLog(fileToLog); LogManager::GetInstance()->SetLogLevel(LogTypes::G3D, LogTypes::LERROR); + +#if defined(Q_WS_X11) && !defined(USING_GLES2) + // Start Desktop UI + MainWindow* mainWindow = new MainWindow(); + mainWindow->show(); +#endif } void MainWindow::SetNextState(CoreState state) From 6965b82c626685cbcade6bd0006156e4ccb6184b Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 12 Feb 2013 20:12:08 +0100 Subject: [PATCH 26/49] Set lastBoundTexture when creating a new one. --- GPU/GLES/TextureCache.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 1dc68b97ec..da9a9c968c 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -775,6 +775,9 @@ void TextureCache::SetTexture() { return; //Done! } else { INFO_LOG(G3D, "Texture different or overwritten, reloading at %08x", texaddr); + if (entry->texture == lastBoundTexture) + lastBoundTexture = -1; + glDeleteTextures(1, &entry->texture); if (entry->status == TexCacheEntry::STATUS_RELIABLE) { entry->status = TexCacheEntry::STATUS_HASHING; @@ -820,6 +823,7 @@ void TextureCache::SetTexture() { glGenTextures(1, &entry->texture); glBindTexture(GL_TEXTURE_2D, entry->texture); + lastBoundTexture = entry->texture; #ifdef USING_GLES2 // GLES2 doesn't have support for a "Max lod" which is critical as PSP games often From 4dc3413437e0e3fb30051eff6be65924d70fbd56 Mon Sep 17 00:00:00 2001 From: Daniel Reiser Date: Tue, 12 Feb 2013 11:13:13 -0800 Subject: [PATCH 27/49] Updated PPSSPP.pro and added german language --- Qt/PPSSPP.pro | 1 + Qt/languages/ppsspp_cn.ts | 221 ++++++--- Qt/languages/ppsspp_de.ts | 988 ++++++++++++++++++++++++++++++++++++++ Qt/languages/ppsspp_en.ts | 2 +- Qt/languages/ppsspp_fr.ts | 2 +- Qt/languages/ppsspp_pl.ts | 2 +- 6 files changed, 1136 insertions(+), 80 deletions(-) create mode 100644 Qt/languages/ppsspp_de.ts diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index 351a25551a..f0b357d341 100755 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -24,6 +24,7 @@ desktop_ui { TRANSLATIONS = languages/ppsspp_en.ts \ languages/ppsspp_pl.ts \ languages/ppsspp_fr.ts \ + languages/ppsspp_de.ts \ languages/ppsspp_cn.ts # Main diff --git a/Qt/languages/ppsspp_cn.ts b/Qt/languages/ppsspp_cn.ts index 8e070cd874..da1d206f1c 100644 --- a/Qt/languages/ppsspp_cn.ts +++ b/Qt/languages/ppsspp_cn.ts @@ -3,10 +3,15 @@ Controls + + Controls + 控制器 + Controls - 控制器 + Controls window title + 控制器 @@ -63,8 +68,12 @@ + New function name: + + + New function name : - 新函数名称: + 新函数名称: @@ -114,16 +123,25 @@ + Set new value: + + + Set new value : - 设置新值: + 设置新值: Debugger_Disasm - Dialog - 对话框 + 对话框 + + + + Disassembler + Window title + @@ -325,13 +343,22 @@ Symbols 特征符模式 + + + Memory Viewer - %1 + + Debugger_VFPU - Dialog - 对话框 + 对话框 + + + + VFPU + @@ -533,320 +560,360 @@ 语言 - + + Anisotropic filtering + + + + &Help (&H)帮助 - + &Open... (&O)打开... - + &Close (&C)关闭 - + - - - + Quickload state 快速读档 - + F4 F4 - + Quicksave state 快速存档 - + F2 F2 - + &Load State File... (&L)读取存档... - + &Save State File... (&S)保存存档... - + E&xit (&X)退出 - + &Run (&R)运行 - + F7 F7 - + &Pause (&P)暂停 - + F8 F8 - + R&eset (&E)重置 - + &Interpreter (&I)解释器 - + &Slightly Faster Interpreter (&S)较快的解释器 - + &Dynarec (&D)动态重编译 - + Load &Map File... (&M)读取Map文件... - + &Save Map File... (&S)保存Map文件... - + &Reset Symbol Table (&R)重置符号表 - + &Disassembly (&D)汇编视图 - + Ctrl+D Ctrl+D - + &Log Console (&L)查看控制台日志 - + Ctrl+L Ctrl+L - + Memory &View... (&V)内存视图... - + Ctrl+M Ctrl+M - + Keyboard &Controls (&C)键盘与控制 - + &Toggle Full Screen (&T)全屏幕 - + F12 F12 - + &Buffered Rendering (&B)渲染缓冲 - + F5 F5 - + &Hardware Transform (&H)硬件加速 - + F6 F6 - + &Linear Filtering (&L)线性过滤 - + &Wireframe (experimental) (&W)使用线框 (实验性选项) - + &Display Raw Framebuffer (&D)显示 Raw 原始缓冲 - + &Show Debug Statistics (&S)显示调试统计 - + Screen &1x &1倍窗口 - + Ctrl+1 Ctrl+1 - + Screen &2x &2倍窗口 - + Ctrl+2 Ctrl+2 - + Screen &3x &3倍窗口 - + Ctrl+3 Ctrl+3 - + Screen &4x &4倍窗口 - + Ctrl+4 Ctrl+4 - + &Fast Memory (dynarec, unstable) (&F)高速闪存 (动态重编译,不稳定) - + &Ignore illegal reads/writes (&I)忽略非法读取/写入 - + &Go to http://www.ppsspp.org/ (&G)转到 http://www.ppsspp.org/ - + &About PPSSPP... (&A)关于 PPSSPP... - + &Use VBO (&U)使用 VBO - - - + + + Debug 调试 - - - + + + Warning 警告 - - - + + + Error 错误 - - - + + + Info 信息 - + GamePad Controls 手柄控制 - + &Run on load (&R)加载后立即执行 - + D&ump next frame to log (&U)将下一帧转储至日志 - + &Vertex Cache (&V)顶点缓存 - + Memory View Texture... 内存纹理视图... - + + Simple 2xAA + + + + + Off + + + + + 2x + + + + + 4x + + + + + 8x + + + + + 16x + + + + + Show FPS counter + + + + No translations 未翻译 diff --git a/Qt/languages/ppsspp_de.ts b/Qt/languages/ppsspp_de.ts new file mode 100644 index 0000000000..fb63f074b4 --- /dev/null +++ b/Qt/languages/ppsspp_de.ts @@ -0,0 +1,988 @@ + + + + + Controls + + + Controls + Controls window title + + + + + CtrlDisAsmView + + + Copy &address + + + + + Copy instruction (&hex) + + + + + Copy instruction (&disasm) + + + + + &Run to here + + + + + &Set Next Statement + + + + + &Toggle breakpoint + + + + + &Follow branch + + + + + Go to in &Memory View + + + + + &Rename function... + + + + + New function name + + + + + New function name: + + + + + CtrlMemView + + + Go to in &disasm + + + + + &Copy value + + + + + Dump... + + + + + CtrlRegisterList + + + Go to in &memory view + + + + + Go to in &disasm + + + + + &Copy value + + + + + C&hange... + + + + + Set new value + + + + + Set new value: + + + + + Debugger_Disasm + + + Disassembler + Window title + + + + + Ctr: + + + + + &Go to + + + + + &PC + + + + + &LR + + + + + Show VFPU + + + + + Regs + + + + + Funcs + + + + + &Go + + + + + Stop + + + + + Step &Into + + + + + Step &Over + + + + + S&kip + + + + + Next &HLE + + + + + Breakpoints + + + + + Address + + + + + Clear All + + + + + Callstack + + + + + Display Lists + + + + + + Id + + + + + + Status + + + + + Start Address + + + + + Current Address + + + + + Run + + + + + Step + + + + + Threads + + + + + Name + + + + + Current PC + + + + + Entry point + + + + + Remove breakpoint + + + + + Go to entry point + + + + + Running + + + + + Wait + + + + + Suspend + + + + + Show code + + + + + Debugger_Memory + + + Dialog + + + + + Goto: + + + + + Mode + + + + + Normal + + + + + Symbols + + + + + Memory Viewer - %1 + + + + + Debugger_VFPU + + + VFPU + + + + + Float + + + + + HalfFloat + + + + + Hex + + + + + Bytes + + + + + Shorts + + + + + Ints + + + + + GamePadDialog + + + Gamepad Configuration + + + + + GamePad List + + + + + Refresh + + + + + Select + + + + + Gamepad Values : + + + + + TextLabel + + + + + Assign Gamepad input + + + + + to PSP button/axis + + + + + Assign + + + + + Press buttons on your gamePad to verify mapping : + + + + + + <b>No gamepad</b> + + + + + <b>Unknown gamepad</b> + + + + + Buttons + + + + + + Button %1 + + + + + Axes + + + + + %1 Neg + + + + + Axes %1 Neg + + + + + %1 Pos + + + + + Axes %1 Pos + + + + + Hats + + + + + <b>Current gamepad: %1</b> + + + + + MainWindow + + + PPSSPP + + + + + &File + + + + + &Emulation + + + + + Debu&g + + + + + &Options + + + + + &Log Levels + + + + + G3D + + + + + HLE + + + + + Default + + + + + Zoom + + + + + Language + + + + + Anisotropic filtering + + + + + &Help + + + + + &Open... + + + + + &Close + + + + + - + + + + + Quickload state + + + + + F4 + + + + + Quicksave state + + + + + F2 + + + + + &Load State File... + + + + + &Save State File... + + + + + E&xit + + + + + &Run + + + + + F7 + + + + + &Pause + + + + + F8 + + + + + R&eset + + + + + &Interpreter + + + + + &Slightly Faster Interpreter + + + + + &Dynarec + + + + + Load &Map File... + + + + + &Save Map File... + + + + + &Reset Symbol Table + + + + + &Disassembly + + + + + Ctrl+D + + + + + &Log Console + + + + + Ctrl+L + + + + + Memory &View... + + + + + Ctrl+M + + + + + Keyboard &Controls + + + + + &Toggle Full Screen + + + + + F12 + + + + + &Buffered Rendering + + + + + F5 + + + + + &Hardware Transform + + + + + F6 + + + + + &Linear Filtering + + + + + &Wireframe (experimental) + + + + + &Display Raw Framebuffer + + + + + &Show Debug Statistics + + + + + Screen &1x + + + + + Ctrl+1 + + + + + Screen &2x + + + + + Ctrl+2 + + + + + Screen &3x + + + + + Ctrl+3 + + + + + Screen &4x + + + + + Ctrl+4 + + + + + &Fast Memory (dynarec, unstable) + + + + + &Ignore illegal reads/writes + + + + + &Go to http://www.ppsspp.org/ + + + + + &About PPSSPP... + + + + + &Use VBO + + + + + + + Debug + + + + + + + Warning + + + + + + + Error + + + + + + + Info + + + + + GamePad Controls + + + + + &Run on load + + + + + D&ump next frame to log + + + + + &Vertex Cache + + + + + Memory View Texture... + + + + + Simple 2xAA + + + + + Off + + + + + 2x + + + + + 4x + + + + + 8x + + + + + 16x + + + + + Show FPS counter + + + + + No translations + + + + + gamepadMapping + + + Cross + + + + + Circle + + + + + Square + + + + + Triangle + + + + + Left Trigger + + + + + Right Trigger + + + + + Start + + + + + Select + + + + + Up + + + + + Down + + + + + Left + + + + + Right + + + + + Home + + + + + Stick left + + + + + Stick right + + + + + Stick up + + + + + Stick bottom + + + + diff --git a/Qt/languages/ppsspp_en.ts b/Qt/languages/ppsspp_en.ts index c37a1fe9fe..5d3846f784 100644 --- a/Qt/languages/ppsspp_en.ts +++ b/Qt/languages/ppsspp_en.ts @@ -892,7 +892,7 @@ - + No translations diff --git a/Qt/languages/ppsspp_fr.ts b/Qt/languages/ppsspp_fr.ts index 3eca7f7754..9b18ae76b0 100644 --- a/Qt/languages/ppsspp_fr.ts +++ b/Qt/languages/ppsspp_fr.ts @@ -892,7 +892,7 @@ - + No translations diff --git a/Qt/languages/ppsspp_pl.ts b/Qt/languages/ppsspp_pl.ts index 5da591151b..d052a3702a 100644 --- a/Qt/languages/ppsspp_pl.ts +++ b/Qt/languages/ppsspp_pl.ts @@ -892,7 +892,7 @@ Pokaż licznik FPS - + No translations Brak tłumaczeń From d563478b9da149cea76a26223b3dab457253a427 Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 05:14:57 +1000 Subject: [PATCH 28/49] Allow all desktop systems to use desktop UI, not just Windows. --- Qt/PPSSPP.pro | 8 ++++---- Qt/Settings.pri | 1 - Qt/mainwindow.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index 351a25551a..5dfe147eaf 100755 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -12,7 +12,7 @@ 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 -desktop_ui { +!mobile_platform { PRE_TARGETDEPS += ./libCommon.a ./libCore.a ./libNative.a CONFIG += link_pkgconfig packagesExist(sdl) { @@ -40,7 +40,9 @@ SOURCES += ../android/jni/EmuScreen.cpp \ INCLUDEPATH += .. ../Common ../native # Temporarily only use new UI for Linux desktop -desktop_ui { +mobile_platform { + SOURCES += ../android/jni/NativeApp.cpp +} else { MOC_DIR = moc UI_DIR = ui RCC_DIR = rcc @@ -48,8 +50,6 @@ desktop_ui { HEADERS += *.h FORMS += *.ui RESOURCES += resources.qrc -} else { - SOURCES += ../android/jni/NativeApp.cpp } # Packaging diff --git a/Qt/Settings.pri b/Qt/Settings.pri index 508abe4688..f8015cf5ec 100644 --- a/Qt/Settings.pri +++ b/Qt/Settings.pri @@ -1,7 +1,6 @@ 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 += -Wno-unused-function -Wno-unused-variable -Wno-multichar -Wno-uninitialized -Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-unused-parameter diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 2c69ca407e..c17a7dd105 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -168,7 +168,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co LogManager::GetInstance()->SetLogLevel(LogTypes::G3D, LogTypes::LERROR); -#if defined(Q_WS_X11) && !defined(USING_GLES2) +#if defined(USING_GLES2) // Start Desktop UI MainWindow* mainWindow = new MainWindow(); mainWindow->show(); From 3205d3dbeae2e17e0850f8b2355f7d55f24f93ae Mon Sep 17 00:00:00 2001 From: Daniel Reiser Date: Tue, 12 Feb 2013 11:32:09 -0800 Subject: [PATCH 29/49] updated german translation --- Qt/languages/ppsspp_de.ts | 70 +++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/Qt/languages/ppsspp_de.ts b/Qt/languages/ppsspp_de.ts index fb63f074b4..9ae06e04b2 100644 --- a/Qt/languages/ppsspp_de.ts +++ b/Qt/languages/ppsspp_de.ts @@ -491,7 +491,7 @@ &File - + &Datei @@ -506,7 +506,7 @@ &Options - + &Optionen @@ -526,7 +526,7 @@ Default - + Standard @@ -536,7 +536,7 @@ Language - + Sprache @@ -546,17 +546,17 @@ &Help - + &Hilfe &Open... - + &Öffnen... &Close - + &Schließen @@ -566,7 +566,7 @@ Quickload state - + Schnellladen @@ -576,7 +576,7 @@ Quicksave state - + Schnellspeichern @@ -586,12 +586,12 @@ &Load State File... - + &Lade Spielstand... &Save State File... - + &Speichere Spielstand... @@ -601,7 +601,7 @@ &Run - + &Starte @@ -631,7 +631,7 @@ &Slightly Faster Interpreter - + &etwas scnellerer Interpreter @@ -641,17 +641,17 @@ Load &Map File... - + Lade &Map Dateien... &Save Map File... - + &Speichere Map Dateien... &Reset Symbol Table - + &Setze Symboltabelle zurück @@ -666,7 +666,7 @@ &Log Console - + &Log Konsole @@ -686,7 +686,7 @@ Keyboard &Controls - + Tastatur &Tastenbelegung @@ -902,87 +902,87 @@ Cross - + Kreuz Circle - + Kreis Square - + Viereck Triangle - + Dreieck Left Trigger - + Linke Schultertaste Right Trigger - + Rechte Schultertaste Start - + Start Select - + Select Up - + Hoch Down - + Runter Left - + Links Right - + Rechts Home - + Home Stick left - + Analogstick links Stick right - + Analogstick rechts Stick up - + Analogstick oben Stick bottom - + Analogstick unten From 0982a29293eb836912ab78c0320c4e9f3bd0c156 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 12 Feb 2013 21:00:51 +0100 Subject: [PATCH 30/49] Some texturecache code cleanup. Fix missing DIRTY_AMBIENT. The latter fixes the blinking caustics in the tunnel in Vineta K in Wipeout Pure. And surely other things. --- GPU/GLES/DisplayListInterpreter.cpp | 14 +----- GPU/GLES/TextureCache.cpp | 70 +++++++++++++++-------------- GPU/GPUState.h | 2 +- 3 files changed, 39 insertions(+), 47 deletions(-) diff --git a/GPU/GLES/DisplayListInterpreter.cpp b/GPU/GLES/DisplayListInterpreter.cpp index 42bd68988d..d1a8f606db 100644 --- a/GPU/GLES/DisplayListInterpreter.cpp +++ b/GPU/GLES/DisplayListInterpreter.cpp @@ -605,11 +605,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) { break; case GE_CMD_FRAMEBUFPTR: - break; - case GE_CMD_FRAMEBUFWIDTH: - break; - case GE_CMD_FRAMEBUFPIXFORMAT: break; @@ -636,21 +632,13 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) { break; case GE_CMD_CLUTADDR: - gstate_c.textureChanged = true; - break; - case GE_CMD_CLUTADDRUPPER: - gstate_c.textureChanged = true; - break; - case GE_CMD_LOADCLUT: gstate_c.textureChanged = true; // This could be used to "dirty" textures with clut. break; case GE_CMD_TEXMAPMODE: - break; - case GE_CMD_TEXSHADELS: break; @@ -698,6 +686,8 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) { case GE_CMD_AMBIENTCOLOR: case GE_CMD_AMBIENTALPHA: + if (diff) + shaderManager_->DirtyUniform(DIRTY_AMBIENT); break; case GE_CMD_MATERIALAMBIENT: diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index da9a9c968c..f9f65062ec 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -652,7 +652,6 @@ static inline u32 QuickTexHash(u32 addr, int bufw, int w, int h, u32 format) { void TextureCache::SetTexture() { u32 texaddr = (gstate.texaddr[0] & 0xFFFFF0) | ((gstate.texbufwidth[0]<<8) & 0x0F000000); - if (!Memory::IsValidAddress(texaddr)) { // Bind a null texture and return. glBindTexture(GL_TEXTURE_2D, 0); @@ -667,32 +666,19 @@ void TextureCache::SetTexture() { bool hasClut = formatUsesClut[format]; const u8 *texptr = Memory::GetPointer(texaddr); - - u32 clutformat = gstate.clutformat & 3; - u32 clutaddr = GetClutAddr(clutformat == GE_CMODE_32BIT_ABGR8888 ? 4 : 2); - u64 cachekey = texaddr; - if (formatUsesClut[format]) + + u32 clutformat, clutaddr; + if (hasClut) { + clutformat = gstate.clutformat & 3; + clutaddr = GetClutAddr(clutformat == GE_CMODE_32BIT_ABGR8888 ? 4 : 2); cachekey |= (u64)clutaddr << 32; + } int maxLevel = ((gstate.texmode >> 16) & 0x7); - // Adjust maxLevel to actually present levels.. - for (int i = 0; i <= maxLevel; i++) { - // If encountering levels pointing to nothing, adjust max level. - u32 levelTexaddr = (gstate.texaddr[i] & 0xFFFFF0) | ((gstate.texbufwidth[i] << 8) & 0x0F000000); - if (!Memory::IsValidAddress(levelTexaddr)) { - maxLevel = i - 1; - break; - } - } - u32 texhash = MiniHash((const u32 *)Memory::GetPointer(texaddr)); - int w = 1 << (gstate.texsize[0] & 0xf); - int h = 1 << ((gstate.texsize[0] >> 8) & 0xf); - int bufw = gstate.texbufwidth[0] & 0x3ff; - TexCache::iterator iter = cache.find(cachekey); TexCacheEntry *entry = NULL; if (iter != cache.end()) { @@ -718,17 +704,14 @@ void TextureCache::SetTexture() { bool rehash = entry->status == TexCacheEntry::STATUS_UNRELIABLE; //TODO: Check more texture parameters, compute real texture hash - if (dim != entry->dim || entry->hash != texhash || entry->format != format) - match = false; - - //TODO: Check more clut parameters, compute clut hash - if (match && (format >= GE_TFMT_CLUT4 && format <= GE_TFMT_CLUT32) && - (entry->clutformat != clutformat || + if (dim != entry->dim || + entry->hash != texhash || + entry->format != format || + entry->maxLevel != maxLevel || + ((format >= GE_TFMT_CLUT4 && format <= GE_TFMT_CLUT32) && + (entry->clutformat != clutformat || entry->clutaddr != clutaddr || - entry->cluthash != Memory::Read_U32(entry->clutaddr))) - match = false; - - if (entry->maxLevel != maxLevel) + entry->cluthash != Memory::Read_U32(entry->clutaddr)))) match = false; if (match) { @@ -751,6 +734,9 @@ void TextureCache::SetTexture() { } if (rehash && entry->status != TexCacheEntry::STATUS_RELIABLE) { + int w = 1 << (gstate.texsize[0] & 0xf); + int h = 1 << ((gstate.texsize[0] >> 8) & 0xf); + int bufw = gstate.texbufwidth[0] & 0x3ff; u32 check = QuickTexHash(texaddr, bufw, w, h, format); if (check != entry->fullhash) { match = false; @@ -792,6 +778,11 @@ void TextureCache::SetTexture() { entry->status = TexCacheEntry::STATUS_HASHING; } + int w = 1 << (gstate.texsize[0] & 0xf); + int h = 1 << ((gstate.texsize[0] >> 8) & 0xf); + + int bufw = gstate.texbufwidth[0] & 0x3ff; + //we have to decode it entry->addr = texaddr; entry->hash = texhash; @@ -801,6 +792,7 @@ void TextureCache::SetTexture() { entry->maxLevel = maxLevel; entry->lodBias = 0.0f; + if (format >= GE_TFMT_CLUT4 && format <= GE_TFMT_CLUT32) { entry->clutformat = clutformat; entry->clutaddr = GetClutAddr(clutformat == GE_CMODE_32BIT_ABGR8888 ? 4 : 2); @@ -825,6 +817,16 @@ void TextureCache::SetTexture() { glBindTexture(GL_TEXTURE_2D, entry->texture); lastBoundTexture = entry->texture; + // Adjust maxLevel to actually present levels.. + for (int i = 0; i <= maxLevel; i++) { + // If encountering levels pointing to nothing, adjust max level. + u32 levelTexaddr = (gstate.texaddr[i] & 0xFFFFF0) | ((gstate.texbufwidth[i] << 8) & 0x0F000000); + if (!Memory::IsValidAddress(levelTexaddr)) { + maxLevel = i - 1; + break; + } + } + #ifdef USING_GLES2 // GLES2 doesn't have support for a "Max lod" which is critical as PSP games often // don't specify mips all the way down. As a result, we either need to manually generate @@ -835,15 +837,15 @@ void TextureCache::SetTexture() { // As is usual, GLES3 will solve this problem nicely but wide distribution of that is // years away. LoadTextureLevel(*entry, 0); - if (entry->maxLevel > 0) + if (maxLevel > 0) glGenerateMipmap(GL_TEXTURE_2D); #else - for (int i = 0; i <= entry->maxLevel; i++) { + for (int i = 0; i <= maxLevel; i++) { LoadTextureLevel(*entry, i); } - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, entry->maxLevel); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, maxLevel); #endif - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, (float)entry->maxLevel); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, (float)maxLevel); float anisotropyLevel = (float) g_Config.iAnisotropyLevel > maxAnisotropyLevel ? maxAnisotropyLevel : (float) g_Config.iAnisotropyLevel; glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropyLevel); // NOTICE_LOG(G3D,"AnisotropyLevel = %0.1f , MaxAnisotropyLevel = %0.1f ", anisotropyLevel, maxAnisotropyLevel ); diff --git a/GPU/GPUState.h b/GPU/GPUState.h index 84d9d8dcea..516042e892 100644 --- a/GPU/GPUState.h +++ b/GPU/GPUState.h @@ -242,7 +242,7 @@ struct GPUStateCache float lightpos[4][3]; float lightdir[4][3]; float lightatt[4][3]; - float lightColor[3][4][3]; //Amtient Diffuse Specular + float lightColor[3][4][3]; // Ambient Diffuse Specular float morphWeights[8]; u32 curTextureWidth; From 9c16223f8e747e39af020f8cf707d176affb45c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Miko=C5=82ajczyk?= Date: Tue, 12 Feb 2013 22:01:00 +0100 Subject: [PATCH 31/49] Fix loading translations at runtime --- Qt/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index c17a7dd105..1c412dcd60 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -826,7 +826,7 @@ void MainWindow::loadLanguage(const QString& language) QLocale locale = QLocale(currentLanguage); QLocale::setDefault(locale); QString languageName = QLocale::languageToString(locale.language()); - switchTranslator(translator, QString("languages/ppsspp_%1.qm").arg(language)); + switchTranslator(translator, QString(":/languages/ppsspp_%1.qm").arg(language)); } } From 5ace14dd30bf1896b9a1c52e61d7847d49e8b0de Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 12 Feb 2013 21:52:19 +0100 Subject: [PATCH 32/49] Log level adjustments --- Core/FileSystems/ISOFileSystem.cpp | 2 +- GPU/GLES/TextureCache.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/FileSystems/ISOFileSystem.cpp b/Core/FileSystems/ISOFileSystem.cpp index 7e81411d4a..1c92fa9f03 100644 --- a/Core/FileSystems/ISOFileSystem.cpp +++ b/Core/FileSystems/ISOFileSystem.cpp @@ -337,7 +337,7 @@ u32 ISOFileSystem::OpenFile(std::string filename, FileAccess access) return 0; } - INFO_LOG(FILESYS, "Got a raw sector open: %s, sector %08x, size %08x", filename.c_str(), sectorStart, readSize); + DEBUG_LOG(FILESYS, "Got a raw sector open: %s, sector %08x, size %08x", filename.c_str(), sectorStart, readSize); u32 newHandle = hAlloc->GetNewHandle(); entry.seekPos = 0; entry.file = 0; diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index f9f65062ec..fdfb3f4257 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -124,7 +124,7 @@ void TextureCache::NotifyFramebuffer(u32 address, FBO *fbo) { // Must be in VRAM so | 0x04000000 it is. TexCacheEntry *entry = GetEntryAt(address | 0x04000000); if (entry) { - // INFO_LOG(HLE, "Render to texture detected at %08x!", address); + DEBUG_LOG(HLE, "Render to texture detected at %08x!", address); if (!entry->fbo) entry->fbo = fbo; // TODO: Delete the original non-fbo texture too. From ddfcf79fcd4e9afb7cca0a3522c78a4506266caa Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 12 Feb 2013 22:09:14 +0100 Subject: [PATCH 33/49] Correct aspect ratio, adding black borders when necessary. --- GPU/GLES/Framebuffer.cpp | 41 +++++++++++++++++++++++++++++++++++----- GPU/GLES/Framebuffer.h | 2 +- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index 7090c2a784..f2eae31cff 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -64,6 +64,32 @@ static bool MaskedEqual(u32 addr1, u32 addr2) { return (addr1 & 0x3FFFFFF) == (addr2 & 0x3FFFFFF); } +static void CenterRect(float *x, float *y, float *w, float *h, + float origW, float origH, float frameW, float frameH) +{ + float origRatio = origW/origH; + float frameRatio = frameW/frameH; + + if (origRatio > frameRatio) + { + // Image is wider than frame. Center vertically. + float scale = origW / frameW; + *x = 0.0f; + *w = frameW; + *h = frameW / origRatio; + *y = (frameH - *h) / 2.0f; + } + else + { + // Image is taller than frame. Center horizontally. + float scale = origH / frameH; + *y = 0.0f; + *h = frameH; + *w = frameH * origRatio; + *x = (frameW - *w) / 2.0f; + } +} + FramebufferManager::FramebufferManager() : displayFramebufPtr_(0), prevDisplayFramebuf_(0), @@ -170,20 +196,23 @@ void FramebufferManager::DrawPixels(const u8 *framebuf, int pixelFormat, int lin glBindTexture(GL_TEXTURE_2D,backbufTex); glTexSubImage2D(GL_TEXTURE_2D,0,0,0,480,272, GL_RGBA, GL_UNSIGNED_BYTE, convBuf); - DrawActiveTexture(480, 272); + + float x, y, w, h; + CenterRect(&x, &y, &w, &h, 480.0f, 272.0f, (float)PSP_CoreParameter().pixelWidth, (float)PSP_CoreParameter().pixelHeight); + DrawActiveTexture(x, y, w, h); } -void FramebufferManager::DrawActiveTexture(float w, float h, bool flip) { +void FramebufferManager::DrawActiveTexture(float x, float y, float w, float h, bool flip) { float u2 = 1.0f; float v1 = flip ? 1.0f : 0.0f; float v2 = flip ? 0.0f : 1.0f; - const float pos[12] = {0,0,0, w,0,0, w,h,0, 0,h,0}; + const float pos[12] = {x,y,0, x+w,y,0, x+w,y+h,0, x,y+h,0}; const float texCoords[8] = {0, v1, u2, v1, u2, v2, 0, v2}; glsl_bind(draw2dprogram); Matrix4x4 ortho; - ortho.setOrtho(0, 480, 272, 0, -1, 1); + ortho.setOrtho(0, (float)PSP_CoreParameter().pixelWidth, (float)PSP_CoreParameter().pixelHeight, 0, -1, 1); glUniformMatrix4fv(draw2dprogram->u_viewproj, 1, GL_FALSE, ortho.getReadPtr()); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); @@ -370,7 +399,9 @@ void FramebufferManager::CopyDisplayToOutput() { fbo_bind_color_as_texture(vfb->fbo, 0); // These are in the output display coordinates - DrawActiveTexture(480, 272, true); + float x, y, w, h; + CenterRect(&x, &y, &w, &h, 480.0f, 272.0f, (float)PSP_CoreParameter().pixelWidth, (float)PSP_CoreParameter().pixelHeight); + DrawActiveTexture(x, y, w, h, true); if (resized_) { DestroyAllFBOs(); diff --git a/GPU/GLES/Framebuffer.h b/GPU/GLES/Framebuffer.h index 84486413df..dd7dcee56a 100644 --- a/GPU/GLES/Framebuffer.h +++ b/GPU/GLES/Framebuffer.h @@ -66,7 +66,7 @@ public: }; void DrawPixels(const u8 *framebuf, int pixelFormat, int linesize); - void DrawActiveTexture(float w, float h, bool flip = false); + void DrawActiveTexture(float x, float y, float w, float h, bool flip = false); void DestroyAllFBOs(); void DecimateFBOs(); From ca23c076a11190a2d3827028d5f29baefc397230 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Wed, 13 Feb 2013 00:49:49 +0100 Subject: [PATCH 34/49] Minor sceFont fixes --- Core/HLE/FunctionWrappers.h | 6 ++ Core/HLE/sceFont.cpp | 112 +++++++++++++++++++++--------------- 2 files changed, 72 insertions(+), 46 deletions(-) diff --git a/Core/HLE/FunctionWrappers.h b/Core/HLE/FunctionWrappers.h index 413407781a..85468754b8 100644 --- a/Core/HLE/FunctionWrappers.h +++ b/Core/HLE/FunctionWrappers.h @@ -131,6 +131,12 @@ template void WrapI_UU() { RETURN(retval); } +template void WrapI_UFF() { + // Not sure about the float arguments. + int retval = func(PARAM(0), currentMIPS->f[0], currentMIPS->f[1]); + RETURN(retval); +} + template void WrapI_UUU() { int retval = func(PARAM(0), PARAM(1), PARAM(2)); RETURN(retval); diff --git a/Core/HLE/sceFont.cpp b/Core/HLE/sceFont.cpp index fe955a0920..867d7ea664 100644 --- a/Core/HLE/sceFont.cpp +++ b/Core/HLE/sceFont.cpp @@ -9,7 +9,7 @@ typedef u32 FontLibraryHandle; typedef u32 FontHandle; -typedef struct { +struct FontNewLibParams { u32 userDataAddr; u32 numFonts; u32 cacheDataAddr; @@ -23,28 +23,28 @@ typedef struct { u32 seekFuncAddr; u32 errorFuncAddr; u32 ioFinishFuncAddr; -} FontNewLibParams; +}; -typedef enum { +typedef enum Family { FONT_FAMILY_SANS_SERIF = 1, FONT_FAMILY_SERIF = 2, -} Family; +}; -typedef enum { +typedef enum Style { FONT_STYLE_REGULAR = 1, FONT_STYLE_ITALIC = 2, FONT_STYLE_BOLD = 5, FONT_STYLE_BOLD_ITALIC = 6, FONT_STYLE_DB = 103, // Demi-Bold / semi-bold -} Style; +}; -typedef enum { +typedef enum Language { FONT_LANGUAGE_JAPANESE = 1, FONT_LANGUAGE_LATIN = 2, FONT_LANGUAGE_KOREAN = 3, -} Language; +}; -typedef struct { +struct FontStyle { float fontH; float fontV; float fontHRes; @@ -61,9 +61,9 @@ typedef struct { char fontFileName[64]; u32 fontAttributes; u32 fontExpire; -} FontStyle; +}; -typedef struct { +struct FontInfo { // Glyph metrics (in 26.6 signed fixed-point). u32 maxGlyphWidthI; u32 maxGlyphHeightI; @@ -99,9 +99,9 @@ typedef struct { u8 BPP; // Font's BPP. u8 pad[3]; -} FontInfo; +}; -typedef struct { +struct CharInfo { u32 bitmapWidth; u32 bitmapHeight; u32 bitmapLeft; @@ -118,17 +118,17 @@ typedef struct { s32 spf26AdvanceH; s32 spf26AdvanceV; u8 pad[4]; -} CharInfo; +}; -typedef enum { +enum FontPixelFormat { PSP_FONT_PIXELFORMAT_4 = 0, PSP_FONT_PIXELFORMAT_4_REV = 1, PSP_FONT_PIXELFORMAT_8 = 2, PSP_FONT_PIXELFORMAT_24 = 3, PSP_FONT_PIXELFORMAT_32 = 4 -} FontPixelFormat; +}; -typedef struct { +struct GlyphImage { FontPixelFormat pixelFormat; s32 xPos64; s32 yPos64; @@ -137,7 +137,7 @@ typedef struct { u16 bytesPerLine; u16 pad; u32 bufferPtr; -} GlyphImage; +}; FontNewLibParams fontLib; @@ -209,17 +209,6 @@ int sceFontClose(u32 fontHandle) return 0; } - -int sceFontGetNumFontList(u32 libHandle, u32 errorCodePtr) -{ - ERROR_LOG(HLE, "sceFontGetNumFontList %x, %x", libHandle, errorCodePtr); - if (Memory::IsValidAddress(errorCodePtr)) - { - Memory::Write_U32(0, errorCodePtr); - } - return 1; -} - int sceFontFindOptimumFont(u32 libHandlePtr, u32 fontStylePtr, u32 errorCodePtr) { ERROR_LOG(HLE, "sceFontFindOptimumFont %x, %x, %x", libHandlePtr, fontStylePtr, errorCodePtr); @@ -273,11 +262,11 @@ int sceFontGetFontInfo(u32 fontHandle, u32 fontInfoPtr) fi.fontStyle.fontCountry= 1; fi.fontStyle.fontExpire= 1; fi.fontStyle.fontFamily= 1; - //fi.fontStyle.fontFileName="asd"; + strcpy(fi.fontStyle.fontFileName, "asd"); fi.fontStyle.fontH=32; fi.fontStyle.fontHRes=32; fi.fontStyle.fontLanguage=1; - // fi.fontStyle.fontName="ppsspp"; + strcpy(fi.fontStyle.fontName, "ppsspp"); fi.fontStyle.fontRegion=9; fi.fontStyle.fontV=32; fi.fontStyle.fontVRes=32; @@ -290,7 +279,7 @@ int sceFontGetFontInfo(u32 fontHandle, u32 fontInfoPtr) int sceFontGetFontInfoByIndexNumber(u32 libHandle, u32 fontInfoPtr, u32 unknown, u32 fontIndex) { - ERROR_LOG(HLE, "sceFontGetFontInfoByIndexNumber %x, %x, %x, %x", libHandle, fontInfoPtr, unknown, fontIndex); + ERROR_LOG(HLE, "HACK sceFontGetFontInfoByIndexNumber %x, %x, %x, %x", libHandle, fontInfoPtr, unknown, fontIndex); // clearly wrong.. return sceFontGetFontInfo(libHandle, fontInfoPtr); @@ -298,13 +287,13 @@ int sceFontGetFontInfoByIndexNumber(u32 libHandle, u32 fontInfoPtr, u32 unknown, int sceFontGetCharInfo(u32 fontHandle, u32 charCode, u32 charInfoPtr) { - ERROR_LOG(HLE, "sceFontGetCharInfo %x, %x, %x", fontHandle, charCode, charInfoPtr); + ERROR_LOG(HLE, "HACK sceFontGetCharInfo %x, %x, %x", fontHandle, charCode, charInfoPtr); if (Memory::IsValidAddress(charInfoPtr)) { CharInfo pspCharInfo; memset(&pspCharInfo, 0, sizeof(pspCharInfo)); - pspCharInfo.bitmapWidth = 32; - pspCharInfo.bitmapHeight = 32; + pspCharInfo.bitmapWidth = 16; + pspCharInfo.bitmapHeight = 16; pspCharInfo.spf26Width = pspCharInfo.bitmapWidth << 6; pspCharInfo.spf26Height = pspCharInfo.bitmapHeight << 6; @@ -316,15 +305,18 @@ int sceFontGetCharInfo(u32 fontHandle, u32 charCode, u32 charInfoPtr) } int sceFontGetCharImageRect(u32 fontHandle, u32 charCode, u32 charRectPtr) - // finish this { - ERROR_LOG(HLE, "sceFontGetCharImageRect %x, %x (%c)", fontHandle, charRectPtr, charCode); + ERROR_LOG(HLE, "HACK sceFontGetCharImageRect %x, %x (%c)", fontHandle, charRectPtr, charCode); + if (Memory::IsValidAddress(charRectPtr)) { + Memory::Write_U16(16, charRectPtr); // character bitmap width in pixels + Memory::Write_U16(16, charRectPtr + 2); // character bitmap height in pixels + } return 0; } int sceFontGetCharGlyphImage(u32 fontHandle, u32 charCode, u32 glyphImagePtr) { - ERROR_LOG(HLE, "sceFontGetCharGlyphImage %x, %x, %x (%c)", fontHandle, charCode, glyphImagePtr, charCode); + ERROR_LOG(HLE, "HACK sceFontGetCharGlyphImage %x, %x, %x (%c)", fontHandle, charCode, glyphImagePtr, charCode); int pixelFormat = Memory::Read_U32(glyphImagePtr); int xPos64 = Memory::Read_U32(glyphImagePtr+4); @@ -332,13 +324,17 @@ int sceFontGetCharGlyphImage(u32 fontHandle, u32 charCode, u32 glyphImagePtr) int bufWidth = Memory::Read_U16(glyphImagePtr+12); int bufHeight = Memory::Read_U16(glyphImagePtr+14); int bytesPerLine = Memory::Read_U16(glyphImagePtr+16); - int buffer =Memory::Read_U32(glyphImagePtr+20); + int buffer = Memory::Read_U32(glyphImagePtr+20); - for (int y= 0; y < bufHeight; y++) + // Small chessboard. Does not respect pixelformat currently... + + // Actually should be really easy to substitute in a proper font here... + // could even grab pixel data from the PPGe one. + for (int y = 0; y < bufHeight; y++) { - for (int x=0; x> 1) ^ (y >> 1)) & 1) ? 0xff : 0x00, buffer + (y * bytesPerLine + x)); } } @@ -360,7 +356,7 @@ int sceFontSetAltCharacterCode(u32 libHandle, u32 charCode) int sceFontFlush(u32 fontHandle) { - ERROR_LOG(HLE, "sceFontFlush %x", fontHandle); + DEBUG_LOG(HLE, "sceFontFlush(%i)", fontHandle); return 0; } @@ -376,24 +372,48 @@ int sceFontGetFontList(u32 fontLibHandle, u32 fontStylePtr, u32 numFonts) style.fontHRes = 20 / 64.f; style.fontVRes = 20 / 64.f; style.fontStyle = 1; + //style.fontFamily for (u32 i = 0; i < numFonts; i++) { - Memory::WriteStruct(fontStylePtr+ (sizeof(style)), &style); + Memory::WriteStruct(fontStylePtr + (sizeof(style)) * i, &style); } return 0; } +int sceFontGetNumFontList(u32 libHandle, u32 errorCodePtr) +{ + ERROR_LOG(HLE, "UNIMPL sceFontGetNumFontList %x, %x", libHandle, errorCodePtr); + if (Memory::IsValidAddress(errorCodePtr)) + { + Memory::Write_U32(0, errorCodePtr); + } + return 1; +} + +int sceFontSetResolution(u32 fontLibHandle, float hRes, float vRes) +{ + ERROR_LOG(HLE, "UNIMPL sceFontSetResolution(%i, %f, %f)", fontLibHandle, hRes, vRes); + return 0; +} + +int sceFontCalcMemorySize() { + ERROR_LOG(HLE, "UNIMPL sceFontCalcMemorySize()"); + return 0; +} + + + const HLEFunction sceLibFont[] = { {0x67f17ed7, WrapU_UU, "sceFontNewLib"}, {0x574b6fbc, WrapI_U, "sceFontDoneLib"}, - {0x48293280, 0, "sceFontSetResolution"}, + {0x48293280, WrapI_UFF, "sceFontSetResolution"}, {0x27f6e642, WrapI_UU, "sceFontGetNumFontList"}, {0xbc75d85b, WrapI_UUU, "sceFontGetFontList"}, {0x099ef33c, WrapI_UUU, "sceFontFindOptimumFont"}, {0x681e61a7, WrapI_UUU, "sceFontFindFont"}, - {0x2f67356a, 0, "sceFontCalcMemorySize"}, + {0x2f67356a, WrapI_V, "sceFontCalcMemorySize"}, {0x5333322d, WrapI_UUUU, "sceFontGetFontInfoByIndexNumber"}, {0xa834319d, WrapU_UUUU, "sceFontOpen"}, {0x57fcb733, WrapU_UUUU, "sceFontOpenUserFile"}, From 26f37277f48d8da40180e19274e1f3c9048f9dc9 Mon Sep 17 00:00:00 2001 From: raven02 Date: Wed, 13 Feb 2013 07:50:08 +0800 Subject: [PATCH 35/49] Use enableColorTest for colortest --- GPU/GLES/FragmentShaderGenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/GLES/FragmentShaderGenerator.cpp b/GPU/GLES/FragmentShaderGenerator.cpp index bafae7aacb..b0e8fc6a7c 100644 --- a/GPU/GLES/FragmentShaderGenerator.cpp +++ b/GPU/GLES/FragmentShaderGenerator.cpp @@ -183,13 +183,13 @@ void GenerateFragmentShader(char *buffer) // Disabled for now until we actually find a need for it. /* - if (gstate.colorTestEnable & 1) { + if (enableColorTest) { // TODO: There are some colortestmasks we could handle. int colorTestFunc = gstate.colortest & 3; const char *colorTestFuncs[] = { "#", "#", " == ", " != " }; // never/always don't make sense} int colorTestMask = gstate.colormask; if (colorTestFuncs[colorTestFunc][0] != '#') - WRITE(p, "if (!(v.rgb %s u_alphacolorref.rgb)) discard;", colorTestFuncs[colorTestFunc]); + WRITE(p, "if (!(v.rgb %s u_alphacolorref.rgb)) discard;\n", colorTestFuncs[colorTestFunc]); }*/ if (enableFog) { From 5654a7eae56c77504566626228c36a202eeadf8c Mon Sep 17 00:00:00 2001 From: Xele02 Date: Wed, 13 Feb 2013 01:03:02 +0100 Subject: [PATCH 36/49] DrawSpline hack to draw something. --- GPU/GLES/TransformPipeline.cpp | 40 +++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 1005515c20..10aeb3ef2d 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -149,8 +149,46 @@ void TransformDrawEngine::DrawBezier(int ucount, int vcount) { Flush(); // as our vertex storage here is temporary, it will only survive one draw. } +// Copy code from bezier. This is not right, but allow to display something. void TransformDrawEngine::DrawSpline(int ucount, int vcount, int utype, int vtype) { - // TODO + u16 indices[3 * 3 * 6]; + + // Generate indices for a rectangular mesh. + int c = 0; + for (int y = 0; y < 3; y++) { + for (int x = 0; x < 3; x++) { + indices[c++] = y * 4 + x; + indices[c++] = y * 4 + x + 1; + indices[c++] = (y + 1) * 4 + x + 1; + indices[c++] = (y + 1) * 4 + x + 1; + indices[c++] = (y + 1) * 4 + x; + indices[c++] = y * 4 + x; + } + } + + // We are free to use the "decoded" buffer here. + // Let's split it into two to get a second buffer, there's enough space. + u8 *decoded2 = decoded + 65536 * 24; + + // Alright, now for the vertex data. + // For now, we will simply inject UVs. + + float customUV[4 * 4 * 2]; + for (int y = 0; y < 4; y++) { + for (int x = 0; x < 4; x++) { + customUV[(y * 4 + x) * 2 + 0] = (float)x/3.0f; + customUV[(y * 4 + x) * 2 + 1] = (float)y/3.0f; + } + } + + if (!(gstate.vertType & GE_VTYPE_TC_MASK)) { + dec.SetVertexType(gstate.vertType); + u32 newVertType = dec.InjectUVs(decoded2, Memory::GetPointer(gstate_c.vertexAddr), customUV, 16); + SubmitPrim(decoded2, &indices[0], GE_PRIM_TRIANGLES, c, newVertType, GE_VTYPE_IDX_16BIT, 0); + } else { + SubmitPrim(Memory::GetPointer(gstate_c.vertexAddr), &indices[0], GE_PRIM_TRIANGLES, c, gstate.vertType, GE_VTYPE_IDX_16BIT, 0); + } + Flush(); // as our vertex storage here is temporary, it will only survive one draw. } // Convenient way to do precomputation to save the parts of the lighting calculation From e16c0dea9be9949dc55b8df6a783066db6799076 Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 15:52:33 +1000 Subject: [PATCH 37/49] Use English version of the language on Qt4.7 where nativeLanguageName isn't supported. --- Qt/mainwindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 1c412dcd60..baae95e7f4 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -856,7 +856,11 @@ void MainWindow::createLanguageMenu() locale.truncate(locale.lastIndexOf('.')); locale.remove(0, locale.indexOf('_') + 1); +#if QT_VERSION >= 0x040800 QString language = QLocale(locale).nativeLanguageName(); +#else + QString language = QLocale::languageToString(QLocale(locale).language()); +#endif QAction *action = new QAction(language, this); action->setCheckable(true); action->setData(locale); From 013357f21e566a7c05633911f0fd3a9d68baec5f Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 16:21:33 +1000 Subject: [PATCH 38/49] Build fix for iOS --- Common/ChunkFile.h | 2 +- Common/StdMutex.h | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Common/ChunkFile.h b/Common/ChunkFile.h index b9ae0be8ae..095831678a 100644 --- a/Common/ChunkFile.h +++ b/Common/ChunkFile.h @@ -41,7 +41,7 @@ #include "FileUtil.h" #include "../ext/snappy/snappy-c.h" -#ifdef ANDROID +#if defined(ANDROID) || defined(IOS) namespace std { using tr1::is_pointer; } diff --git a/Common/StdMutex.h b/Common/StdMutex.h index e143f9bc95..cabebd51ab 100644 --- a/Common/StdMutex.h +++ b/Common/StdMutex.h @@ -5,24 +5,20 @@ #define GCC_VER(x,y,z) ((x) * 10000 + (y) * 100 + (z)) #define GCC_VERSION GCC_VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) -#if GCC_VERSION >= GCC_VER(4,4,0) && __GXX_EXPERIMENTAL_CXX0X__ && !defined(ANDROID) && !defined(__SYMBIAN32__) || defined(__APPLE__) -// GCC 4.4 provides +#if (GCC_VERSION >= GCC_VER(4,4,0) && __GXX_EXPERIMENTAL_CXX0X__ || defined(__APPLE__)) \ +/* GCC 4.4 provides , except on these platforms: */ \ + && !defined(ANDROID) && !defined(__SYMBIAN32__) && !defined(IOS) #include #else // partial implementation for win32/pthread - #include -#if defined(_WIN32) -// WIN32 +#if defined(_WIN32) // WIN32 #define WIN32_LEAN_AND_MEAN #include - -#else -// POSIX +#else // POSIX #include - #endif #if (_MSC_VER >= 1600) || (GCC_VERSION >= GCC_VER(4,3,0) && __GXX_EXPERIMENTAL_CXX0X__) From 43de173f08d0eb582247f29a6a36eafaad324147 Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 16:37:51 +1000 Subject: [PATCH 39/49] Update readme with potential iOS build instructions. Add an iOS cmake toolchain. --- README.md | 15 ++++ ios/ios.toolchain.cmake | 190 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+) create mode 100644 ios/ios.toolchain.cmake diff --git a/README.md b/README.md index 8b397088bb..6131a815d8 100644 --- a/README.md +++ b/README.md @@ -100,15 +100,30 @@ to get Eclipse to rebuild the project. Also note that the `Visual Studio` generators aren't compatible with compilers other than Microsoft's, but `NMake Makefiles` works fine. +Building for iOS +---------------- + +Note: This does not work yet. + +Create a `build-ios` directory and inside it run: + + cmake -DCMAKE_TOOLCHAIN_FILE=../ios/ios.toolchain.cmake -GXcode .. + +Then open the generated project in Xcode. + +For more information, see: http://code.google.com/p/ios-cmake/wiki/HowTo + Building for Blackberry ----------------------- To build for Blackberry, you must first have the [latest Native SDK][blackberry-ndk] installed. To set up your environment for cross-compiling you must then use: + source ~/bbndk/bbndk-env.sh Finally, you are ready to compile. Go to ppsspp/Blackberry/ and run: + ./build.sh If you are on Windows, you will need GNU and CMake to run the bash script. diff --git a/ios/ios.toolchain.cmake b/ios/ios.toolchain.cmake new file mode 100644 index 0000000000..469e83acf1 --- /dev/null +++ b/ios/ios.toolchain.cmake @@ -0,0 +1,190 @@ +# This file is based off of the Platform/Darwin.cmake and Platform/UnixPaths.cmake +# files which are included with CMake 2.8.4 +# It has been altered for iOS development + +# Options: +# +# IOS_PLATFORM = OS (default) or SIMULATOR +# This decides if SDKS will be selected from the iPhoneOS.platform or iPhoneSimulator.platform folders +# OS - the default, used to build for iPhone and iPad physical devices, which have an arm arch. +# SIMULATOR - used to build for the Simulator platforms, which have an x86 arch. +# +# CMAKE_IOS_DEVELOPER_ROOT = automatic(default) or /path/to/platform/Developer folder +# By default this location is automatcially chosen based on the IOS_PLATFORM value above. +# If set manually, it will override the default location and force the user of a particular Developer Platform +# +# CMAKE_IOS_SDK_ROOT = automatic(default) or /path/to/platform/Developer/SDKs/SDK folder +# By default this location is automatcially chosen based on the CMAKE_IOS_DEVELOPER_ROOT value. +# In this case it will always be the most up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path. +# If set manually, this will force the use of a specific SDK version + +# Macros: +# +# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE) +# A convenience macro for setting xcode specific properties on targets +# example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1") +# +# find_host_package (PROGRAM ARGS) +# A macro used to find executable programs on the host system, not within the iOS environment. +# Thanks to the android-cmake project for providing the command + + +# Standard settings +set (CMAKE_SYSTEM_NAME Darwin) +set (CMAKE_SYSTEM_VERSION 1) +set (UNIX True) +set (APPLE True) +set (IOS True) + +# Determine the cmake host system version so we know where to find the iOS SDKs +find_program (CMAKE_UNAME uname /bin /usr/bin /usr/local/bin) +if (CMAKE_UNAME) + exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) + string (REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") +endif (CMAKE_UNAME) + +# Force the compilers to gcc for iOS +include (CMakeForceCompiler) +CMAKE_FORCE_C_COMPILER (gcc gcc) +CMAKE_FORCE_CXX_COMPILER (g++ g++) + +# Skip the platform compiler checks for cross compiling +set (CMAKE_CXX_COMPILER_WORKS TRUE) +set (CMAKE_C_COMPILER_WORKS TRUE) + +# All iOS/Darwin specific settings - some may be redundant +set (CMAKE_SHARED_LIBRARY_PREFIX "lib") +set (CMAKE_SHARED_LIBRARY_SUFFIX ".dylib") +set (CMAKE_SHARED_MODULE_PREFIX "lib") +set (CMAKE_SHARED_MODULE_SUFFIX ".so") +set (CMAKE_MODULE_EXISTS 1) +set (CMAKE_DL_LIBS "") + +set (CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ") +set (CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ") +set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}") +set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}") + +# Hidden visibilty is required for cxx on iOS +set (CMAKE_C_FLAGS_INIT "") +set (CMAKE_CXX_FLAGS_INIT "-headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden") + +set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") +set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}") + +set (CMAKE_PLATFORM_HAS_INSTALLNAME 1) +set (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names") +set (CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names") +set (CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,") +set (CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,") +set (CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a") + +# hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree +# (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache +# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun) +# hardcode CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did before, Alex +if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL) + find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool) +endif (NOT DEFINED CMAKE_INSTALL_NAME_TOOL) + +# Setup iOS platform unless specified manually with IOS_PLATFORM +if (NOT DEFINED IOS_PLATFORM) + set (IOS_PLATFORM "OS") +endif (NOT DEFINED IOS_PLATFORM) +set (IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform") + +# Check the platform selection and setup for developer root +if (${IOS_PLATFORM} STREQUAL "OS") + set (IOS_PLATFORM_LOCATION "iPhoneOS.platform") + + # This causes the installers to properly locate the output libraries + set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos") +elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR") + set (IOS_PLATFORM_LOCATION "iPhoneSimulator.platform") + + # This causes the installers to properly locate the output libraries + set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator") +else (${IOS_PLATFORM} STREQUAL "OS") + message (FATAL_ERROR "Unsupported IOS_PLATFORM value selected. Please choose OS or SIMULATOR") +endif (${IOS_PLATFORM} STREQUAL "OS") + +# Setup iOS developer location unless specified manually with CMAKE_IOS_DEVELOPER_ROOT +# Note Xcode 4.3 changed the installation location, choose the most recent one available +set (XCODE_POST_43_ROOT "/Applications/Xcode.app/Contents/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer") +set (XCODE_PRE_43_ROOT "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer") +if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT) + if (EXISTS ${XCODE_POST_43_ROOT}) + set (CMAKE_IOS_DEVELOPER_ROOT ${XCODE_POST_43_ROOT}) + elseif(EXISTS ${XCODE_PRE_43_ROOT}) + set (CMAKE_IOS_DEVELOPER_ROOT ${XCODE_PRE_43_ROOT}) + endif (EXISTS ${XCODE_POST_43_ROOT}) +endif (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT) +set (CMAKE_IOS_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT} CACHE PATH "Location of iOS Platform") + +# Find and use the most recent iOS sdk unless specified manually with CMAKE_IOS_SDK_ROOT +if (NOT DEFINED CMAKE_IOS_SDK_ROOT) + file (GLOB _CMAKE_IOS_SDKS "${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/*") + if (_CMAKE_IOS_SDKS) + list (SORT _CMAKE_IOS_SDKS) + list (REVERSE _CMAKE_IOS_SDKS) + list (GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT) + else (_CMAKE_IOS_SDKS) + message (FATAL_ERROR "No iOS SDK's found in default seach path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.") + endif (_CMAKE_IOS_SDKS) + message (STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}") +endif (NOT DEFINED CMAKE_IOS_SDK_ROOT) +set (CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Location of the selected iOS SDK") + +# Set the sysroot default to the most recent SDK +set (CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS support") + +# set the architecture for iOS +# NOTE: Currently both ARCHS_STANDARD_32_BIT and ARCHS_UNIVERSAL_IPHONE_OS set armv7 only, so set both manually +if (${IOS_PLATFORM} STREQUAL "OS") + set (IOS_ARCH armv6 armv7) +else (${IOS_PLATFORM} STREQUAL "OS") + set (IOS_ARCH i386) +endif (${IOS_PLATFORM} STREQUAL "OS") + +set (CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE string "Build architecture for iOS") + +# Set the find root to the iOS developer roots and to user defined paths +set (CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE string "iOS find search path root") + +# default to searching for frameworks first +set (CMAKE_FIND_FRAMEWORK FIRST) + +# set up the default search directories for frameworks +set (CMAKE_SYSTEM_FRAMEWORK_PATH + ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks + ${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks + ${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks +) + +# only search the iOS sdks, not the remainder of the host filesystem +set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) +set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + + +# This little macro lets you set any XCode specific property +macro (set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE) + set_property (TARGET ${TARGET} PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE}) +endmacro (set_xcode_property) + + +# This macro lets you find executable programs on the host system +macro (find_host_package) + set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) + set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + set (IOS FALSE) + + find_package(${ARGN}) + + set (IOS TRUE) + set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) + set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endmacro (find_host_package) + From 3cab6986c58d2a265a717bdd455a2aa7884706f7 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 13 Feb 2013 00:55:10 -0800 Subject: [PATCH 40/49] Jit the FPU comparisons on x86. Probably not too fast. Also, NaN handling seems wrong? --- Core/MIPS/MIPSInt.cpp | 1 + Core/MIPS/x86/CompFPU.cpp | 46 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/Core/MIPS/MIPSInt.cpp b/Core/MIPS/MIPSInt.cpp index 91f576560b..da5645feab 100644 --- a/Core/MIPS/MIPSInt.cpp +++ b/Core/MIPS/MIPSInt.cpp @@ -826,6 +826,7 @@ namespace MIPSInt void Int_FPUComp(u32 op) { + // TODO: NaN handling seems wrong. int fs = _FS; int ft = _FT; bool cond; diff --git a/Core/MIPS/x86/CompFPU.cpp b/Core/MIPS/x86/CompFPU.cpp index 3f38104eb7..793c057a50 100644 --- a/Core/MIPS/x86/CompFPU.cpp +++ b/Core/MIPS/x86/CompFPU.cpp @@ -151,7 +151,51 @@ static const u64 GC_ALIGNED16(ssSignBits2[2]) = {0x8000000080000000ULL, 0x800000 static const u64 GC_ALIGNED16(ssNoSignMask[2]) = {0x7FFFFFFF7FFFFFFFULL, 0x7FFFFFFF7FFFFFFFULL}; void Jit::Comp_FPUComp(u32 op) { - DISABLE; + CONDITIONAL_DISABLE; + + int fs = _FS; + int ft = _FT; + + // TODO: NaN handling seems wrong. + switch (op & 0xf) + { + case 0: //f + case 1: //un + case 8: //sf + case 9: //ngle + MOV(32, M((void *) ¤tMIPS->fpcond), Imm32(0)); + break; + + case 2: //eq + case 3: //ueq + case 10: //seq + case 11: //ngl + MOVSS(XMM0, fpr.R(fs)); + CMPSS(XMM0, fpr.R(ft), 0); + MOVSS(M((void *) ¤tMIPS->fpcond), XMM0); + break; + + case 4: //olt + case 5: //ult + case 12: //lt + case 13: //nge + MOVSS(XMM0, fpr.R(fs)); + CMPSS(XMM0, fpr.R(ft), 1); + MOVSS(M((void *) ¤tMIPS->fpcond), XMM0); + break; + + case 6: //ole + case 7: //ule + case 14: //le + case 15: //ngt + MOVSS(XMM0, fpr.R(fs)); + CMPSS(XMM0, fpr.R(ft), 2); + MOVSS(M((void *) ¤tMIPS->fpcond), XMM0); + break; + + default: + DISABLE; + } } void Jit::Comp_FPU2op(u32 op) { From 949650b3e9bf14ab3e1c9dfa9dbd91bece6accda Mon Sep 17 00:00:00 2001 From: raven02 Date: Tue, 12 Feb 2013 18:26:33 -0800 Subject: [PATCH 41/49] traditional Chinese , ppsspp_tc.ts --- Qt/PPSSPP.pro | 3 +- Qt/languages/ppsspp_tc.ts | 1009 +++++++++++++++++++++++++++++++++++++ 2 files changed, 1011 insertions(+), 1 deletion(-) create mode 100644 Qt/languages/ppsspp_tc.ts diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index 98892acf70..3e8284bc03 100755 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -25,7 +25,8 @@ TRANSLATIONS = languages/ppsspp_en.ts \ languages/ppsspp_pl.ts \ languages/ppsspp_fr.ts \ languages/ppsspp_de.ts \ - languages/ppsspp_cn.ts + languages/ppsspp_cn.ts \ + languages/ppsspp_tc.ts # Main SOURCES += ../native/base/QtMain.cpp diff --git a/Qt/languages/ppsspp_tc.ts b/Qt/languages/ppsspp_tc.ts new file mode 100644 index 0000000000..2b760daad7 --- /dev/null +++ b/Qt/languages/ppsspp_tc.ts @@ -0,0 +1,1009 @@ + + + + + Controls + + Controls + 控制器 + + + + Controls + Controls window title + 控制器 + + + + CtrlDisAsmView + + + Copy &address + (&A)複製地址 + + + + Copy instruction (&hex) + (&H)複製指令(十六進制型) + + + + Copy instruction (&disasm) + (&D)複製指令(反彙編型) + + + + &Run to here + (&R)執行到此處 + + + + &Set Next Statement + (&S)設置下一語句 + + + + &Toggle breakpoint + (&T)鎖定斷點 + + + + &Follow branch + (&F)跟隨分支 + + + + Go to in &Memory View + (&M)轉到內存視圖 + + + + &Rename function... + (&R)重命名函數... + + + + New function name + 新函數名稱 + + + + New function name: + + + + New function name : + 新函數名稱: + + + + CtrlMemView + + + Go to in &disasm + (&D)轉到反彙編器 + + + + &Copy value + (&C)複製值 + + + + Dump... + 轉儲... + + + + CtrlRegisterList + + + Go to in &memory view + (&M)轉到內存視圖 + + + + Go to in &disasm + (&D)轉到反彙編器 + + + + &Copy value + (&C)複製值 + + + + C&hange... + (&H)更改... + + + + Set new value + 設置新值 + + + + Set new value: + + + + Set new value : + 設置新值: + + + + Debugger_Disasm + + Dialog + 對話框 + + + + Disassembler + Window title + + + + + Ctr: + 計數器: + + + + &Go to + (&G)轉到 + + + + &PC + (&P)PC寄存器 + + + + &LR + (&L)連接寄存器 + + + + Show VFPU + 顯示VFPU + + + + Regs + 寄存器 + + + + Funcs + 函數 + + + + &Go + (&G)轉到 + + + + Stop + 停止 + + + + Step &Into + (&I)單步跟進 + + + + Step &Over + (&O)單步步過 + + + + S&kip + (&K)跳過 + + + + Next &HLE + (&H)下一HLE + + + + Breakpoints + 斷點 + + + + Address + 地址 + + + + Clear All + 清空所有 + + + + Callstack + 調用棧 + + + + Display Lists + 顯示列表 + + + + + Id + Id + + + + + Status + 狀態 + + + + Start Address + 起始地址 + + + + Current Address + 當前地址 + + + + Run + 執行 + + + + Step + 單步執行 + + + + Threads + 線程 + + + + Name + 名稱 + + + + Current PC + 當前PC寄存器 + + + + Entry point + 入口點 + + + + Remove breakpoint + 移除斷點 + + + + Go to entry point + 轉到入口點 + + + + Running + 執行中 + + + + Wait + 等待 + + + + Suspend + 掛起 + + + + Show code + 顯示代碼 + + + + Debugger_Memory + + + Dialog + 對話框 + + + + Goto: + 轉到: + + + + Mode + 模式 + + + + Normal + 普通模式 + + + + Symbols + 特徵符模式 + + + + Memory Viewer - %1 + + + + + Debugger_VFPU + + Dialog + 對話框 + + + + VFPU + + + + + Float + 浮點型 + + + + HalfFloat + 半浮點型 + + + + Hex + 十六進制型 + + + + Bytes + 字節型 + + + + Shorts + 短整型 + + + + Ints + 整型 + + + + GamePadDialog + + + Gamepad Configuration + 手柄設置 + + + + GamePad List + 手柄列表 + + + + Refresh + 刷新 + + + + Select + 選中 + + + + Gamepad Values : + 手柄值: + + + + TextLabel + TextLabel + TextLabel + + + + Assign Gamepad input + 指定該手柄 + + + + to PSP button/axis + 作為PSP按鍵/搖桿輸入 + + + + Assign + 指定 + + + + Press buttons on your gamePad to verify mapping : + 按下手柄按鍵來確認鍵位映射: + + + + + <b>No gamepad</b> + <b>未發現手柄</b> + + + + <b>Unknown gamepad</b> + <b>未識別的手柄</b> + + + + Buttons + 按鈕 + + + + + Button %1 + 按鈕 %1 + + + + Axes + 搖桿 + + + + %1 Neg + %1 Neg + + + + Axes %1 Neg + Axes %1 Neg + + + + %1 Pos + %1 Pos + + + + Axes %1 Pos + Axes %1 Pos + + + + Hats + Hats + + + + <b>Current gamepad: %1</b> + <b>當前手柄: %1</b> + + + + MainWindow + + + PPSSPP + PPSSPP + + + + &File + (&F)文件 + + + + &Emulation + (&E)模擬 + + + + Debu&g + (&G)除錯 + + + + &Options + (&O)選項 + + + + &Log Levels + (&L)日誌級別 + + + + G3D + + + + + HLE + + + + + Default + 默認 + + + + Zoom + 縮放 + + + + Language + 語言 + + + + Anisotropic filtering + + + + + &Help + (&H)幫助 + + + + &Open... + (&O)打開... + + + + &Close + (&C)關閉 + + + + - + - + + + + Quickload state + 快速讀檔 + + + + F4 + F4 + + + + Quicksave state + 快速存檔 + + + + F2 + F2 + + + + &Load State File... + (&L)讀取存檔... + + + + &Save State File... + (&S)保存存檔... + + + + E&xit + (&X)退出 + + + + &Run + (&R)運行 + + + + F7 + F7 + + + + &Pause + (&P)暫停 + + + + F8 + F8 + + + + R&eset + (&E)重置 + + + + &Interpreter + (&I)解釋器 + + + + &Slightly Faster Interpreter + (&S)較快的解釋器 + + + + &Dynarec + (&D)動態解釋器 + + + + Load &Map File... + (&M)讀取Map文件... + + + + &Save Map File... + (&S)保存Map文件... + + + + &Reset Symbol Table + (&R)重置符號表 + + + + &Disassembly + (&D)反彙編器 + + + + Ctrl+D + Ctrl+D + + + + &Log Console + (&L)查看控制台日誌 + + + + Ctrl+L + Ctrl+L + + + + Memory &View... + (&V)內存視圖... + + + + Ctrl+M + Ctrl+M + + + + Keyboard &Controls + (&C)鍵盤與控制 + + + + &Toggle Full Screen + (&T)全屏幕 + + + + F12 + F12 + + + + &Buffered Rendering + (&B)渲染緩衝 + + + + F5 + F5 + + + + &Hardware Transform + (&H)硬件加速 + + + + F6 + F6 + + + + &Linear Filtering + (&L)線性過濾 + + + + &Wireframe (experimental) + (&W)使用線框 (實驗性) + + + + &Display Raw Framebuffer + (&D)顯示原始?緩衝 + + + + &Show Debug Statistics + (&S)顯示除錯資料 + + + + Screen &1x + &1倍窗口 + + + + Ctrl+1 + Ctrl+1 + + + + Screen &2x + &2倍窗口 + + + + Ctrl+2 + Ctrl+2 + + + + Screen &3x + &3倍窗口 + + + + Ctrl+3 + Ctrl+3 + + + + Screen &4x + &4倍窗口 + + + + Ctrl+4 + Ctrl+4 + + + + &Fast Memory (dynarec, unstable) + (&F)高速閃存 (動態重編譯,不穩定) + + + + &Ignore illegal reads/writes + (&I)忽略非法讀取/寫入 + + + + &Go to http://www.ppsspp.org/ + (&G)轉到 http://www.ppsspp.org/ + + + + &About PPSSPP... + (&A)關於 PPSSPP... + + + + &Use VBO + (&U)使用 VBO + + + + + + Debug + 除錯 + + + + + + Warning + 警告 + + + + + + Error + 錯誤 + + + + + + Info + 信息 + + + + GamePad Controls + 手柄控制 + + + + &Run on load + (&R)加載後立即執行 + + + + D&ump next frame to log + (&U)將下一幀轉儲至日誌 + + + + &Vertex Cache + (&V)頂點緩存 + + + + Memory View Texture... + 內存紋理視圖... + + + + Simple 2xAA + + + + + Off + + + + + 2x + + + + + 4x + + + + + 8x + + + + + 16x + + + + + Show FPS counter + + + + + No translations + 未翻譯 + + + + gamepadMapping + + + Cross + × + + + + Circle + + + + + Square + + + + + Triangle + + + + + Left Trigger + L + + + + Right Trigger + R + + + + Start + 開始 + + + + Select + 選擇 + + + + Up + + + + + Down + + + + + Left + + + + + Right + + + + + Home + Home + + + + Stick left + 搖桿左 + + + + Stick right + 搖桿右 + + + + Stick up + 搖桿上 + + + + Stick bottom + 搖桿下 + + + From 19cc652a376e67a6a076bbaaa5f9b7fe1e4ada92 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 13 Feb 2013 01:51:49 -0800 Subject: [PATCH 42/49] Correct NaN handling in fpu comparisons. --- Core/MIPS/MIPSInt.cpp | 36 +++++++++++++++----- Core/MIPS/x86/CompFPU.cpp | 72 ++++++++++++++++++++++++++++++--------- Core/MIPS/x86/Jit.h | 1 + 3 files changed, 84 insertions(+), 25 deletions(-) diff --git a/Core/MIPS/MIPSInt.cpp b/Core/MIPS/MIPSInt.cpp index da5645feab..3c593aeb20 100644 --- a/Core/MIPS/MIPSInt.cpp +++ b/Core/MIPS/MIPSInt.cpp @@ -27,6 +27,13 @@ #include "../HLE/HLE.h" #include "../System.h" +#ifdef __APPLE__ +using std::isnan; +#endif +#ifdef _MSC_VER +#define isnan _isnan +#endif + #define R(i) (currentMIPS->r[i]) #define RF(i) (*(float*)(&(currentMIPS->r[i]))) #define F(i) (currentMIPS->f[i]) @@ -826,40 +833,51 @@ namespace MIPSInt void Int_FPUComp(u32 op) { - // TODO: NaN handling seems wrong. int fs = _FS; int ft = _FT; bool cond; switch (op & 0xf) { case 0: //f - case 1: //un case 8: //sf - case 9: //ngle cond = false; break; + case 1: //un + case 9: //ngle + cond = isnan(F(fs)) || isnan(F(ft)); + break; + case 2: //eq case 10: //seq - case 3: //ueq - case 11: //ngl cond = (F(fs) == F(ft)); break; + case 3: //ueq + case 11: //ngl + cond = (F(fs) == F(ft)) || isnan(F(fs)) || isnan(F(ft)); + break; + case 4: //olt - case 5: //ult case 12: //lt - case 13: //nge cond = (F(fs) < F(ft)); break; + case 5: //ult + case 13: //nge + cond = (F(fs) < F(ft)) || isnan(F(fs)) || isnan(F(ft)); + break; + case 6: //ole - case 7: //ule case 14: //le - case 15: //ngt cond = (F(fs) <= F(ft)); break; + case 7: //ule + case 15: //ngt + cond = (F(fs) <= F(ft)) || isnan(F(fs)) || isnan(F(ft)); + break; + default: _dbg_assert_msg_(CPU,0,"Trying to interpret FPUComp instruction that can't be interpreted"); cond = false; diff --git a/Core/MIPS/x86/CompFPU.cpp b/Core/MIPS/x86/CompFPU.cpp index 793c057a50..b22a47de19 100644 --- a/Core/MIPS/x86/CompFPU.cpp +++ b/Core/MIPS/x86/CompFPU.cpp @@ -150,47 +150,87 @@ void Jit::Comp_FPULS(u32 op) static const u64 GC_ALIGNED16(ssSignBits2[2]) = {0x8000000080000000ULL, 0x8000000080000000ULL}; static const u64 GC_ALIGNED16(ssNoSignMask[2]) = {0x7FFFFFFF7FFFFFFFULL, 0x7FFFFFFF7FFFFFFFULL}; -void Jit::Comp_FPUComp(u32 op) { +static u32 ssCompareTemp; + +enum +{ + CMPEQSS = 0, + CMPLTSS = 1, + CMPLESS = 2, + CMPUNORDSS = 3, + CMPNEQSS = 4, + CMPNLTSS = 5, + CMPNLESS = 6, + CMPORDSS = 7, +}; + +void Jit::CompFPComp(int lhs, int rhs, u8 compare, bool allowNaN) +{ + CONDITIONAL_DISABLE; + + MOVSS(XMM0, fpr.R(lhs)); + CMPSS(XMM0, fpr.R(rhs), compare); + MOVSS(M((void *) ¤tMIPS->fpcond), XMM0); + + // This means that NaN also means true, e.g. !<> or !>, etc. + if (allowNaN) + { + MOVSS(XMM0, fpr.R(lhs)); + CMPSS(XMM0, fpr.R(rhs), CMPUNORDSS); + MOVSS(M((void *) &ssCompareTemp), XMM0); + + MOV(32, R(EAX), M((void *) &ssCompareTemp)); + OR(32, M((void *) ¤tMIPS->fpcond), R(EAX)); + } +} + +void Jit::Comp_FPUComp(u32 op) +{ CONDITIONAL_DISABLE; int fs = _FS; int ft = _FT; - // TODO: NaN handling seems wrong. switch (op & 0xf) { case 0: //f - case 1: //un case 8: //sf - case 9: //ngle MOV(32, M((void *) ¤tMIPS->fpcond), Imm32(0)); break; + case 1: //un + case 9: //ngle + CompFPComp(fs, ft, CMPUNORDSS); + break; + case 2: //eq - case 3: //ueq case 10: //seq + CompFPComp(fs, ft, CMPEQSS); + break; + + case 3: //ueq case 11: //ngl - MOVSS(XMM0, fpr.R(fs)); - CMPSS(XMM0, fpr.R(ft), 0); - MOVSS(M((void *) ¤tMIPS->fpcond), XMM0); + CompFPComp(fs, ft, CMPEQSS, true); break; case 4: //olt - case 5: //ult case 12: //lt + CompFPComp(fs, ft, CMPLTSS); + break; + + case 5: //ult case 13: //nge - MOVSS(XMM0, fpr.R(fs)); - CMPSS(XMM0, fpr.R(ft), 1); - MOVSS(M((void *) ¤tMIPS->fpcond), XMM0); + CompFPComp(fs, ft, CMPLTSS, true); break; case 6: //ole - case 7: //ule case 14: //le + CompFPComp(fs, ft, CMPLESS); + break; + + case 7: //ule case 15: //ngt - MOVSS(XMM0, fpr.R(fs)); - CMPSS(XMM0, fpr.R(ft), 2); - MOVSS(M((void *) ¤tMIPS->fpcond), XMM0); + CompFPComp(fs, ft, CMPLESS, true); break; default: diff --git a/Core/MIPS/x86/Jit.h b/Core/MIPS/x86/Jit.h index ff23c4d348..89b3abc09e 100644 --- a/Core/MIPS/x86/Jit.h +++ b/Core/MIPS/x86/Jit.h @@ -183,6 +183,7 @@ private: void CompITypeMemWrite(u32 op, u32 bits, void *safeFunc); void CompFPTriArith(u32 op, void (XEmitter::*arith)(X64Reg reg, OpArg), bool orderMatters); + void CompFPComp(int lhs, int rhs, u8 compare, bool allowNaN = false); JitBlockCache blocks; JitOptions jo; From 3503d4ed68d3dd25233cc4f0ac640945b9cd9981 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 13 Feb 2013 02:10:51 -0800 Subject: [PATCH 43/49] Clear the shader ids when clearing the cache. --- GPU/GLES/ShaderManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/GPU/GLES/ShaderManager.cpp b/GPU/GLES/ShaderManager.cpp index 2ce7a880dd..3cfe744654 100644 --- a/GPU/GLES/ShaderManager.cpp +++ b/GPU/GLES/ShaderManager.cpp @@ -351,6 +351,7 @@ void ShaderManager::Clear() { fsCache.clear(); vsCache.clear(); globalDirty = 0xFFFFFFFF; + DirtyShader(); } void ShaderManager::ClearCache(bool deleteThem) From f1386dfca1e17454e70644dc22dafdfe957f3bbc Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 13 Feb 2013 02:21:26 -0800 Subject: [PATCH 44/49] Add a quick optimization to the x86 fpu comps. --- Core/MIPS/x86/CompFPU.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/MIPS/x86/CompFPU.cpp b/Core/MIPS/x86/CompFPU.cpp index b22a47de19..03503769b1 100644 --- a/Core/MIPS/x86/CompFPU.cpp +++ b/Core/MIPS/x86/CompFPU.cpp @@ -220,7 +220,7 @@ void Jit::Comp_FPUComp(u32 op) case 5: //ult case 13: //nge - CompFPComp(fs, ft, CMPLTSS, true); + CompFPComp(ft, fs, CMPNLESS); break; case 6: //ole @@ -230,7 +230,7 @@ void Jit::Comp_FPUComp(u32 op) case 7: //ule case 15: //ngt - CompFPComp(fs, ft, CMPLESS, true); + CompFPComp(ft, fs, CMPNLTSS); break; default: From f55776ee59f3a7236d00c7339ee310acd809d5b7 Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 21:08:54 +1000 Subject: [PATCH 45/49] Windows MSVC 2010 compiler support for Qt. --- Common/CPUDetect.cpp | 1 + Qt/Native.pro | 2 -- Qt/PPSSPP.pro | 2 +- Qt/Settings.pri | 16 ++++++++++++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Common/CPUDetect.cpp b/Common/CPUDetect.cpp index c43c7fc5d7..9b42267324 100644 --- a/Common/CPUDetect.cpp +++ b/Common/CPUDetect.cpp @@ -27,6 +27,7 @@ #undef _interlockedbittestandreset #undef _interlockedbittestandset64 #undef _interlockedbittestandreset64 +#include #else #ifndef _M_GENERIC diff --git a/Qt/Native.pro b/Qt/Native.pro index 61ad98f6e8..cf03e5536b 100755 --- a/Qt/Native.pro +++ b/Qt/Native.pro @@ -9,7 +9,6 @@ include(Settings.pri) !mobile_platform: { SOURCES += ../native/ext/glew/glew.c HEADERS += ../native/ext/glew/GL/*.h - INCLUDEPATH += ../native/ext/glew } # Backtrace @@ -55,7 +54,6 @@ INCLUDEPATH += ../ext/snappy !symbian: { SOURCES += ../ext/zlib/*.c HEADERS += ../ext/zlib/*.h - INCLUDEPATH += ../ext/zlib } diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index 3e8284bc03..08bd45c65a 100755 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -9,7 +9,7 @@ include(Settings.pri) # 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 +win32: LIBS += -L$$OUT_PWD/release -lCore -lCommon -lNative -lwinmm -lws2_32 -lkernel32 -luser32 -lgdi32 -lshell32 -lcomctl32 -ldsound -lxinput linux: LIBS += -L. -lCore -lCommon -lNative !mobile_platform { diff --git a/Qt/Settings.pri b/Qt/Settings.pri index f8015cf5ec..9f2b69972b 100644 --- a/Qt/Settings.pri +++ b/Qt/Settings.pri @@ -3,12 +3,20 @@ blackberry|symbian|contains(MEEGO_EDITION,harmattan): CONFIG += mobile_platform unix:!blackberry:!symbian:!macx: CONFIG += linux # Global specific -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 +DEFINES -= UNICODE +INCLUDEPATH += ../ext/zlib ../native/ext/glew + +win32-msvc2010 { + QMAKE_CXXFLAGS_RELEASE += /O2 /arch:SSE2 + DEFINES += _MBCS GLEW_STATIC +} else { + 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): { - QMAKE_CXXFLAGS += -msse2 +contains(QT_ARCH, i686)|contains(QT_ARCH, x86)|contains(QT_ARCH, x86_64)|contains(QT_ARCH, windows): { + !win32-msvc2010: QMAKE_CXXFLAGS += -msse2 CONFIG += x86 } else { # Assume ARM From fd16744f36edb95c8cdc9bb5fd376f9c80bfba3d Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 21:16:40 +1000 Subject: [PATCH 46/49] Fix for Qt UI --- Qt/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index baae95e7f4..66d3d194f1 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -168,7 +168,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_directory, co LogManager::GetInstance()->SetLogLevel(LogTypes::G3D, LogTypes::LERROR); -#if defined(USING_GLES2) +#if !defined(USING_GLES2) // Start Desktop UI MainWindow* mainWindow = new MainWindow(); mainWindow->show(); From aac079f5acaa49f7c318b345a09be88ca56bfaa8 Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 22:50:20 +1000 Subject: [PATCH 47/49] Simplify translations includes. Fix for VS2010, remove some warnings. --- Qt/PPSSPP.pro | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Qt/PPSSPP.pro b/Qt/PPSSPP.pro index 08bd45c65a..77b2c18df8 100755 --- a/Qt/PPSSPP.pro +++ b/Qt/PPSSPP.pro @@ -3,6 +3,7 @@ TARGET = PPSSPPQt QT += core gui opengl CONFIG += mobility MOBILITY += multimedia +win32: QT += multimedia include(Settings.pri) @@ -12,7 +13,7 @@ blackberry: LIBS += -L. -lCore -lCommon -lNative -lscreen -lsocket -lstdc++ win32: LIBS += -L$$OUT_PWD/release -lCore -lCommon -lNative -lwinmm -lws2_32 -lkernel32 -luser32 -lgdi32 -lshell32 -lcomctl32 -ldsound -lxinput linux: LIBS += -L. -lCore -lCommon -lNative -!mobile_platform { +linux:!mobile_platform { PRE_TARGETDEPS += ./libCommon.a ./libCore.a ./libNative.a CONFIG += link_pkgconfig packagesExist(sdl) { @@ -21,12 +22,7 @@ linux: LIBS += -L. -lCore -lCommon -lNative } } -TRANSLATIONS = languages/ppsspp_en.ts \ - languages/ppsspp_pl.ts \ - languages/ppsspp_fr.ts \ - languages/ppsspp_de.ts \ - languages/ppsspp_cn.ts \ - languages/ppsspp_tc.ts +TRANSLATIONS = $$files(languages/ppsspp_*.ts) # Main SOURCES += ../native/base/QtMain.cpp @@ -52,6 +48,7 @@ mobile_platform { HEADERS += *.h FORMS += *.ui RESOURCES += resources.qrc + INCLUDEPATH += ../Qt } # Packaging From 3faeeea2f99ac5c9b80182d2042982e54d973771 Mon Sep 17 00:00:00 2001 From: Sacha Date: Thu, 14 Feb 2013 01:34:53 +1000 Subject: [PATCH 48/49] Support other MSVC compilers in Qt. Update native reference. --- Common/CPUDetect.cpp | 1 - Qt/Core.pro | 2 +- Qt/Settings.pri | 12 +++++++----- native | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Common/CPUDetect.cpp b/Common/CPUDetect.cpp index 9b42267324..c43c7fc5d7 100644 --- a/Common/CPUDetect.cpp +++ b/Common/CPUDetect.cpp @@ -27,7 +27,6 @@ #undef _interlockedbittestandreset #undef _interlockedbittestandset64 #undef _interlockedbittestandreset64 -#include #else #ifndef _M_GENERIC diff --git a/Qt/Core.pro b/Qt/Core.pro index d31aaeb1f5..d9f6260185 100755 --- a/Qt/Core.pro +++ b/Qt/Core.pro @@ -6,7 +6,7 @@ CONFIG += staticlib include(Settings.pri) -INCLUDEPATH += ../native ../Core/MIPS ../Common ../ +INCLUDEPATH += ../native ../Core/MIPS ../ arm { SOURCES += ../Core/MIPS/ARM/*.cpp \ #CoreARM diff --git a/Qt/Settings.pri b/Qt/Settings.pri index 9f2b69972b..f6f24b6c87 100644 --- a/Qt/Settings.pri +++ b/Qt/Settings.pri @@ -4,11 +4,13 @@ unix:!blackberry:!symbian:!macx: CONFIG += linux # Global specific DEFINES -= UNICODE -INCLUDEPATH += ../ext/zlib ../native/ext/glew +INCLUDEPATH += ../ext/zlib ../native/ext/glew ../Common -win32-msvc2010 { - QMAKE_CXXFLAGS_RELEASE += /O2 /arch:SSE2 - DEFINES += _MBCS GLEW_STATIC +win32-msvc* { + QMAKE_CXXFLAGS_RELEASE += /O2 /arch:SSE2 /fp:fast + DEFINES += _MBCS GLEW_STATIC NOMINMAX + PRECOMPILED_HEADER = ../Windows/stdafx.h + PRECOMPILED_SOURCE = ../Windows/stdafx.cpp } else { 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 @@ -16,7 +18,7 @@ win32-msvc2010 { # Arch specific contains(QT_ARCH, i686)|contains(QT_ARCH, x86)|contains(QT_ARCH, x86_64)|contains(QT_ARCH, windows): { - !win32-msvc2010: QMAKE_CXXFLAGS += -msse2 + !win32-msvc*: QMAKE_CXXFLAGS += -msse2 CONFIG += x86 } else { # Assume ARM diff --git a/native b/native index 3caced8524..f5e7bd5a9c 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 3caced8524c06cabcf968942a7780d80337de7bf +Subproject commit f5e7bd5a9c3e4b39a4eac71b577f06ad54f2bc96 From 36f49706e0e2814b9babf0ea3fa38ad3b0b92a74 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Wed, 13 Feb 2013 18:21:21 +0100 Subject: [PATCH 49/49] Add option to stretch to display (turns off the black bars fixing the aspect ratio). --- Core/Config.cpp | 2 ++ Core/Config.h | 2 ++ GPU/GLES/Framebuffer.cpp | 13 +++++++++++++ GPU/GLES/ShaderManager.cpp | 2 +- Windows/WndMainWindow.cpp | 7 +++++++ Windows/ppsspp.rc | 1 + Windows/resource.h | 3 ++- android/jni/MenuScreens.cpp | 4 ++++ 8 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 5a26c8035d..18ea2bc499 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -75,6 +75,7 @@ void CConfig::Load(const char *iniFileName) graphics->Get("DisableG3DLog", &bDisableG3DLog, false); graphics->Get("VertexCache", &bVertexCache, true); graphics->Get("FullScreen", &bFullScreen, false); + graphics->Get("StretchToDisplay", &bStretchToDisplay, false); IniFile::Section *sound = iniFile.GetOrCreateSection("Sound"); sound->Get("Enable", &bEnableSound, true); @@ -132,6 +133,7 @@ void CConfig::Save() graphics->Set("DisableG3DLog", bDisableG3DLog); graphics->Set("VertexCache", bVertexCache); graphics->Set("FullScreen", bFullScreen); + graphics->Set("StretchToDisplay", bStretchToDisplay); IniFile::Section *sound = iniFile.GetOrCreateSection("Sound"); sound->Set("Enable", bEnableSound); diff --git a/Core/Config.h b/Core/Config.h index e5ead1594d..e14cfe06d4 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -57,6 +57,8 @@ public: bool bDrawWireframe; bool bLinearFiltering; bool bUseVBO; + bool bStretchToDisplay; + int iWindowZoom; // for Windows bool SSAntiAliasing; //for Windows, too bool bDisableG3DLog; diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/Framebuffer.cpp index f2eae31cff..7ed3fefd6a 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/Framebuffer.cpp @@ -67,6 +67,15 @@ static bool MaskedEqual(u32 addr1, u32 addr2) { static void CenterRect(float *x, float *y, float *w, float *h, float origW, float origH, float frameW, float frameH) { + if (g_Config.bStretchToDisplay) + { + *x = 0; + *y = 0; + *w = frameW; + *h = frameH; + return; + } + float origRatio = origW/origH; float frameRatio = frameW/frameH; @@ -398,6 +407,10 @@ void FramebufferManager::CopyDisplayToOutput() { fbo_bind_color_as_texture(vfb->fbo, 0); + if (resized_) { + glClearColor(0,0,0,1); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + } // These are in the output display coordinates float x, y, w, h; CenterRect(&x, &y, &w, &h, 480.0f, 272.0f, (float)PSP_CoreParameter().pixelWidth, (float)PSP_CoreParameter().pixelHeight); diff --git a/GPU/GLES/ShaderManager.cpp b/GPU/GLES/ShaderManager.cpp index 3cfe744654..c3a91cebf4 100644 --- a/GPU/GLES/ShaderManager.cpp +++ b/GPU/GLES/ShaderManager.cpp @@ -249,7 +249,7 @@ void LinkedShader::updateUniforms() { SetColorUniform3(u_texenv, gstate.texenvcolor); } if (u_alphacolorref != -1 && (dirtyUniforms & DIRTY_ALPHACOLORREF)) { - SetColorUniform3Alpha(u_alphacolorref, gstate.colortest, (gstate.alphatest >> 8) & 0xFF); + SetColorUniform3Alpha(u_alphacolorref, gstate.colorref, (gstate.alphatest >> 8) & 0xFF); } if (u_fogcolor != -1 && (dirtyUniforms & DIRTY_FOGCOLOR)) { SetColorUniform3(u_fogcolor, gstate.fogcolor); diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 5a4189b430..8db545ffd4 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -441,6 +441,12 @@ namespace MainWindow UpdateMenus(); break; + case ID_OPTIONS_STRETCHDISPLAY: + g_Config.bStretchToDisplay = !g_Config.bStretchToDisplay; + UpdateMenus(); + gpu->Resized(); // easy way to force a clear... + break; + case ID_FILE_EXIT: DestroyWindow(hWnd); break; @@ -705,6 +711,7 @@ namespace MainWindow CHECKITEM(ID_OPTIONS_FASTMEMORY, g_Config.bFastMemory); CHECKITEM(ID_OPTIONS_LINEARFILTERING, g_Config.bLinearFiltering); CHECKITEM(ID_OPTIONS_SIMPLE2XSSAA, g_Config.SSAntiAliasing); + CHECKITEM(ID_OPTIONS_STRETCHDISPLAY, g_Config.bStretchToDisplay); CHECKITEM(ID_EMULATION_RUNONLOAD, g_Config.bAutoRun); CHECKITEM(ID_OPTIONS_USEVBO, g_Config.bUseVBO); CHECKITEM(ID_OPTIONS_DISABLEG3DLOG, g_Config.bDisableG3DLog); diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 71f7cf2e36..36ba9e8499 100644 --- a/Windows/ppsspp.rc +++ b/Windows/ppsspp.rc @@ -253,6 +253,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Toggle Full Screen\tF12", ID_OPTIONS_FULLSCREEN MENUITEM "&Buffered Rendering\tF5", ID_OPTIONS_BUFFEREDRENDERING + MENUITEM "&Stretch to display", ID_OPTIONS_STRETCHDISPLAY MENUITEM "&Hardware Transform\tF6", ID_OPTIONS_HARDWARETRANSFORM MENUITEM "&Linear Filtering", ID_OPTIONS_LINEARFILTERING MENUITEM "Si&mple 2x SSAA", ID_OPTIONS_SIMPLE2XSSAA diff --git a/Windows/resource.h b/Windows/resource.h index 21d4560ba7..91f5936a7e 100644 --- a/Windows/resource.h +++ b/Windows/resource.h @@ -259,6 +259,7 @@ #define ID_OPTIONS_DISABLEG3DLOG 40135 #define ID_OPTIONS_VERTEXCACHE 40136 #define ID_OPTIONS_SHOWFPS 40137 +#define ID_OPTIONS_STRETCHDISPLAY 40138 #define IDC_STATIC -1 // Next default values for new objects @@ -266,7 +267,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 233 -#define _APS_NEXT_COMMAND_VALUE 40138 +#define _APS_NEXT_COMMAND_VALUE 40139 #define _APS_NEXT_CONTROL_VALUE 1163 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/android/jni/MenuScreens.cpp b/android/jni/MenuScreens.cpp index fb03c2698c..56b78410bf 100644 --- a/android/jni/MenuScreens.cpp +++ b/android/jni/MenuScreens.cpp @@ -246,6 +246,10 @@ void InGameMenuScreen::render() { int y = 50; UICheckBox(GEN_ID, x, y += 50, "Show Debug Statistics", ALIGN_TOPLEFT, &g_Config.bShowDebugStats); UICheckBox(GEN_ID, x, y += 50, "Show FPS", ALIGN_TOPLEFT, &g_Config.bShowFPSCounter); + + // TODO: Maybe shouldn't show this if the screen ratios are very close... + UICheckBox(GEN_ID, x, y += 50, "Stretch to display", ALIGN_TOPLEFT, &g_Config.bStretchToDisplay); + UICheckBox(GEN_ID, x, y += 50, "Hardware Transform", ALIGN_TOPLEFT, &g_Config.bHardwareTransform); // TODO: Add UI for more than one slot.