├── gpsp ├── gms │ ├── dist │ │ └── gcce │ │ │ └── .gitignore │ ├── obj │ │ └── gcce │ │ │ └── .gitignore │ ├── config.mk │ ├── defines.mk │ └── Makefile ├── group │ ├── bld.inf │ └── gpSP4Symbian.mmp ├── inc │ ├── zip.h │ ├── symbian_memory_handler.h │ ├── cheats.h │ ├── gui.h │ ├── symb_adaptation.h │ ├── debug.h │ ├── relocutils.h │ ├── AntAudio.h │ ├── input.h │ ├── video.h │ ├── tracer.h │ ├── memory.h │ ├── cpu.h │ └── main.h └── src │ ├── asm_debug.c │ ├── arm_stub_c.c │ ├── relocator.cpp │ ├── relocator_glue.s │ ├── zip.c │ ├── symbian_memory_handler.cpp │ └── video_blend.S ├── gpsp4cute ├── gfx │ ├── dpad.png │ ├── menu.png │ ├── BAButtons.png │ ├── downarrow.png │ ├── separator.png │ ├── tl_button_top.png │ ├── tr_button_top.png │ ├── gpsp4symbianlogo.png │ ├── select_start_buttons.png │ └── gpsp.svg ├── make_package.cmd ├── sis │ ├── game_config.txt │ ├── make_package.cmd │ ├── gpsp_installer.pkg │ ├── gpsp.key │ ├── gpsp.cer │ ├── gpsp_urel.pkg │ └── releasenotes.txt ├── gpspresources.qrc ├── gpsp4cute_gcce.pkg ├── rightbuttonwidget.ui ├── dpadwidget.ui ├── cuteErrorDialog.ui ├── MEmulatorAdaptation.h ├── aboutdialog.cpp ├── aboutdialog.h ├── rightbuttonwidget.h ├── cuteErrorDialog.cpp ├── cuteErrorDialog.h ├── dpadwidget.h ├── filewidget.h ├── audiosettings.h ├── gpspSettings.h ├── videosettings.h ├── controlsettings.h ├── keyconfigdialog.h ├── cuteDebug.h ├── filewidget.cpp ├── main.cpp ├── filewidget.ui ├── controlsettings.cpp ├── audiosettings.cpp ├── buttonpositions.h ├── viewcontroller.h ├── keyconfigdialog.ui ├── gpsp4cute.pro ├── QBlitterWidget.h ├── controlsettings.ui ├── videosettings.cpp ├── gpspadaptation.h ├── AntAudio.h ├── keyconfigdialog.cpp ├── QRemoteControlKeys.h ├── style │ └── summelistyle.qss ├── audiosettings.ui ├── emusettings.h ├── gpsp4Qt.h ├── rightbuttonwidget.cpp ├── viewcontroller.cpp ├── dpadwidget.cpp ├── AntAudio.cpp ├── emusettings.ui └── videosettings.ui └── readme.md /gpsp/gms/dist/gcce/.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o -------------------------------------------------------------------------------- /gpsp/gms/obj/gcce/.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o -------------------------------------------------------------------------------- /gpsp4cute/gfx/dpad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summeli/gpSP4Cute/HEAD/gpsp4cute/gfx/dpad.png -------------------------------------------------------------------------------- /gpsp4cute/gfx/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summeli/gpSP4Cute/HEAD/gpsp4cute/gfx/menu.png -------------------------------------------------------------------------------- /gpsp4cute/make_package.cmd: -------------------------------------------------------------------------------- 1 | call createsis create -cert sis\gpsp.cer -key sis\gpsp.key gpsp4cute_gcce.pkg -------------------------------------------------------------------------------- /gpsp4cute/gfx/BAButtons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summeli/gpSP4Cute/HEAD/gpsp4cute/gfx/BAButtons.png -------------------------------------------------------------------------------- /gpsp4cute/gfx/downarrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summeli/gpSP4Cute/HEAD/gpsp4cute/gfx/downarrow.png -------------------------------------------------------------------------------- /gpsp4cute/gfx/separator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summeli/gpSP4Cute/HEAD/gpsp4cute/gfx/separator.png -------------------------------------------------------------------------------- /gpsp4cute/sis/game_config.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summeli/gpSP4Cute/HEAD/gpsp4cute/sis/game_config.txt -------------------------------------------------------------------------------- /gpsp4cute/gfx/tl_button_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summeli/gpSP4Cute/HEAD/gpsp4cute/gfx/tl_button_top.png -------------------------------------------------------------------------------- /gpsp4cute/gfx/tr_button_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summeli/gpSP4Cute/HEAD/gpsp4cute/gfx/tr_button_top.png -------------------------------------------------------------------------------- /gpsp4cute/gfx/gpsp4symbianlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summeli/gpSP4Cute/HEAD/gpsp4cute/gfx/gpsp4symbianlogo.png -------------------------------------------------------------------------------- /gpsp4cute/gfx/select_start_buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Summeli/gpSP4Cute/HEAD/gpsp4cute/gfx/select_start_buttons.png -------------------------------------------------------------------------------- /gpsp4cute/sis/make_package.cmd: -------------------------------------------------------------------------------- 1 | call createsis create -cert gpsp.cer -key gpsp.key gpsp_urel.pkg 2 | call createsis create -cert gpsp.cer -key gpsp.key gpsp_installer.pkg -------------------------------------------------------------------------------- /gpsp4cute/gpspresources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | style/summelistyle.qss 4 | gfx/dpad.png 5 | gfx/menu.png 6 | gfx/select_start_buttons.png 7 | gfx/tl_button_top.png 8 | gfx/tr_button_top.png 9 | gfx/BAButtons.png 10 | 11 | 12 | gfx/downarrow.png 13 | gfx/gpsp4symbianlogo.png 14 | gfx/separator.png 15 | 16 | 17 | -------------------------------------------------------------------------------- /gpsp4cute/sis/gpsp_installer.pkg: -------------------------------------------------------------------------------- 1 | ; E:/QtSDK/Symbian/projects/gpsp/gpSP4Symbian/gpsp4cute//gpsp_installer.pkg generated by qmake at 2011-05-23T23:15:38 2 | ; This file is generated by qmake and should not be modified by the user 3 | ; 4 | 5 | ; Language 6 | &EN 7 | 8 | 9 | ; SIS header: name, uid, version 10 | #{"gpsp installer"},(0xA000D7CE),0,7,2 11 | 12 | ; Default localized vendor name 13 | %{"Summeli"} 14 | 15 | 16 | ; Default unique vendor name 17 | :"Summeli" 18 | 19 | 20 | 21 | 22 | "E:/QtSDK/projects/gpsp/gpsp4Cute/gpsp4Cute/sis/gpsp_urel.sis" - "!:\private\2002CCCE\import\gpsp.sis" 23 | @"E:/QtSDK/Symbian/SDKs/SymbianSR1Qt474/smartinstaller.sis",(0x2002CCCD) 24 | -------------------------------------------------------------------------------- /gpsp4cute/sis/gpsp.key: -------------------------------------------------------------------------------- 1 | -----BEGIN DSA PRIVATE KEY----- 2 | MIIBugIBAAKBgQCP1/CGI/rz4x5+8XWPhfRH4f0JzxhsZQRtYp6KQBz6H3W9fbAa 3 | I7txUQhmFsgju4X/xMkEBcjQmqGRkadHGANAIPD6UsU5Mdb2OEMPtnWCGNEiQF3L 4 | k907XYLx3tdtwoh4xKzUf1tywySmrqQw/kh4sTUR6L63Fd0KTpFDYeFlWQIVALXE 5 | ftZJIraUfIDvGxPW5XJhmFrPAoGARUHK1ip/4/Vx2qskMMbp0nrgWYYui5ikJcS6 6 | z7DrT2uYk88fhaxkk6+hG8IB1j/Uz+TVFwy8As9/k6xVJtPN5wrgaR8xPyea6qh4 7 | epDVthJFKigZ8Njw4LZIlTRVNfa8aVdliMDCsCYZYY8LbpvI3E1gI3iemaE2zTLx 8 | khlF8SMCgYBKnVXTJatim22T+aGJ8uYwyVTKD6G+EeEMs7YhSgFzla6lQ60o8SNA 9 | bU39cL7SEmWzHnRifCrp/mOZWYcrB+2sxc2YzolRUVOLV9EL3QlyaVuYXQCRohfc 10 | S2EmmkgbOod4HhCmRRLCAroZi12B1Y5nTNzpajOS/R9fq96gWw43gwIUGWyh0REY 11 | 8trm1I967gSs9zz4gKc= 12 | -----END DSA PRIVATE KEY----- 13 | -------------------------------------------------------------------------------- /gpsp/gms/config.mk: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = gpsp4symbian 2 | TARGET_TYPE = LIB 3 | UID2 = 0 4 | UID3 = E0D278F3 5 | SECUREID = E0D278F3 6 | EPOCSTACKSIZE = 80000 7 | EPOCHEAPSIZE = 5000000,67108864 8 | CAPABILITY = LocalServices 9 | SYSINCLUDE = $(EPOCROOT2)/include $(EPOCROOT2)/include/libc $(EPOCROOT2)/include/platform 10 | USERINCLUDE = ../inc ../../gpsp4cute 11 | CXXSRCS = \ 12 | symbian_memory_handler.cpp \ 13 | relocator.cpp \ 14 | $(NULL) 15 | CSRCS = \ 16 | gpspmain.c \ 17 | cpu.c \ 18 | video.c \ 19 | input.c \ 20 | sound.c \ 21 | gui.c \ 22 | zip.c \ 23 | cpu_threaded.c \ 24 | cheats.c \ 25 | arm_stub_c.c \ 26 | asm_debug.c \ 27 | $(NULL) 28 | ASRCS = \ 29 | arm_stub.S \ 30 | video_blend.S \ 31 | relocator_glue.S \ 32 | memory.S \ 33 | $(NULL) 34 | CERT = /c/cert/gpsp4symbian.cert 35 | KEY = /c/cert/gpsp4symbian.key 36 | -------------------------------------------------------------------------------- /gpsp4cute/gpsp4cute_gcce.pkg: -------------------------------------------------------------------------------- 1 | ; Language 2 | &EN 3 | 4 | ; SIS header: name, uid, version 5 | #{"gpsp"},(0xE0D278F3),0,6,0 6 | 7 | ; Localised Vendor name 8 | %{"Summeli"} 9 | 10 | ; Unique Vendor name 11 | :"Summeli" 12 | 13 | ; Manual PKG pre-rules from PRO files 14 | ; Default HW/platform dependencies 15 | [0x20022E6D],0,0,0,{"S60ProductID"} 16 | 17 | ; Default dependency to Qt libraries 18 | (0x2001E61C), 4, 6, 0, {"Qt"} 19 | 20 | ; Executable and default resource files 21 | "\epoc32\release\gcce\udeb\gpsp.exe" - "!:\sys\bin\gpsp.exe" 22 | "\epoc32\data\z\resource\apps\gpsp.rsc" - "!:\resource\apps\gpsp.rsc" 23 | "\epoc32\data\z\private\10003a3f\import\apps\gpsp_reg.rsc" - "!:\private\10003a3f\import\apps\gpsp_reg.rsc" 24 | "\epoc32\data\z\resource\apps\gpsp.mif" - "!:\resource\apps\gpsp.mif" 25 | 26 | "sis\game_config.txt" -"!:\private\E0D278F3\game_config.txt" 27 | 28 | -------------------------------------------------------------------------------- /gpsp/group/bld.inf: -------------------------------------------------------------------------------- 1 | /* gpsp4Symbian 2 | * 3 | * Copyright (C) 2011 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | PRJ_MMPFILES 21 | gpSP4Symbian.mmp -------------------------------------------------------------------------------- /gpsp/inc/zip.h: -------------------------------------------------------------------------------- 1 | /* gameplaySP 2 | * 3 | * Copyright (C) 2006 Exophase 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef COMMON_H 21 | #define COMMON_H 22 | 23 | u32 load_file_zip(char *filename); 24 | 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /gpsp4cute/rightbuttonwidget.ui: -------------------------------------------------------------------------------- 1 | 2 | rightbuttonwidgetClass 3 | 4 | 5 | 6 | 0 7 | 0 8 | 80 9 | 360 10 | 11 | 12 | 13 | rightbuttonwidget 14 | 15 | 16 | 17 | 18 | 0 19 | 0 20 | 80 21 | 360 22 | 23 | 24 | 25 | QLabel{ 26 | background-image: url(:/graphics/gfx/right.png); 27 | } 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /gpsp4cute/dpadwidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DPadWidgetClass 4 | 5 | 6 | 7 | 0 8 | 0 9 | 160 10 | 360 11 | 12 | 13 | 14 | DPadWidget 15 | 16 | 17 | 18 | 19 | 0 20 | 0 21 | 160 22 | 360 23 | 24 | 25 | 26 | QLabel{ 27 | background-image: url(:/graphics/gfx/dpad.png); 28 | } 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /gpsp4cute/sis/gpsp.cer: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDCjCCAsegAwIBAgIBADALBgcqhkjOOAQDBQAwajELMAkGA1UEBhMCRkkxEDAO 3 | BgNVBAoTB1N1bW1lbGkxFDASBgNVBAsTC0RldmVsb3BtZW50MRAwDgYDVQQDEwdT 4 | dW1tZWxpMSEwHwYJKoZIhvcNAQkBFhJzdW1tZWxpQHN1bW1lbGkuZmkwHhcNMDkw 5 | OTEwMTUwNTMxWhcNMTkwOTA4MTUwNTMxWjBqMQswCQYDVQQGEwJGSTEQMA4GA1UE 6 | ChMHU3VtbWVsaTEUMBIGA1UECxMLRGV2ZWxvcG1lbnQxEDAOBgNVBAMTB1N1bW1l 7 | bGkxITAfBgkqhkiG9w0BCQEWEnN1bW1lbGlAc3VtbWVsaS5maTCCAbYwggErBgcq 8 | hkjOOAQBMIIBHgKBgQCP1/CGI/rz4x5+8XWPhfRH4f0JzxhsZQRtYp6KQBz6H3W9 9 | fbAaI7txUQhmFsgju4X/xMkEBcjQmqGRkadHGANAIPD6UsU5Mdb2OEMPtnWCGNEi 10 | QF3Lk907XYLx3tdtwoh4xKzUf1tywySmrqQw/kh4sTUR6L63Fd0KTpFDYeFlWQIV 11 | ALXEftZJIraUfIDvGxPW5XJhmFrPAoGARUHK1ip/4/Vx2qskMMbp0nrgWYYui5ik 12 | JcS6z7DrT2uYk88fhaxkk6+hG8IB1j/Uz+TVFwy8As9/k6xVJtPN5wrgaR8xPyea 13 | 6qh4epDVthJFKigZ8Njw4LZIlTRVNfa8aVdliMDCsCYZYY8LbpvI3E1gI3iemaE2 14 | zTLxkhlF8SMDgYQAAoGASp1V0yWrYpttk/mhifLmMMlUyg+hvhHhDLO2IUoBc5Wu 15 | pUOtKPEjQG1N/XC+0hJlsx50Ynwq6f5jmVmHKwftrMXNmM6JUVFTi1fRC90Jcmlb 16 | mF0AkaIX3EthJppIGzqHeB4QpkUSwgK6GYtdgdWOZ0zc6Wozkv0fX6veoFsON4Mw 17 | CwYHKoZIzjgEAwUAAzAAMC0CFAUTAqKMQZwQ9S79fhQzWDqEWL7FAhUAo+8LHGv6 18 | 9ESFPiHWU5uEJVsT77E= 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /gpsp4cute/cuteErrorDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | cuteErrorDialogClass 4 | 5 | 6 | 7 | 0 8 | 0 9 | 640 10 | 200 11 | 12 | 13 | 14 | cuteErrorDialog 15 | 16 | 17 | 18 | 19 | 0 20 | 10 21 | 640 22 | 120 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 240 33 | 140 34 | 191 35 | 51 36 | 37 | 38 | 39 | OK 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /gpsp4cute/MEmulatorAdaptation.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef MEMULATORADAPTATION_H_ 21 | #define MEMULATORADAPTATION_H_ 22 | 23 | #include 24 | 25 | 26 | class MEmulatorAdaptation 27 | { 28 | public: 29 | virtual ~MEmulatorAdaptation() {}; 30 | public: 31 | virtual quint32 getGpspKeys() = 0; 32 | }; 33 | 34 | #endif /* MEMULATORADAPTATION_H_ */ 35 | -------------------------------------------------------------------------------- /gpsp4cute/aboutdialog.cpp: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #include "aboutdialog.h" 22 | 23 | aboutdialog::aboutdialog(QWidget *parent) 24 | : QWidget(parent) 25 | { 26 | ui.setupUi(this); 27 | connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(closeButtonClicked()) ); 28 | 29 | } 30 | 31 | aboutdialog::~aboutdialog() 32 | { 33 | 34 | } 35 | void aboutdialog::closeButtonClicked() 36 | { 37 | emit( closeDialog() ); 38 | } 39 | -------------------------------------------------------------------------------- /gpsp4cute/sis/gpsp_urel.pkg: -------------------------------------------------------------------------------- 1 | ; Language 2 | &EN 3 | 4 | ; SIS header: name, uid, version 5 | #{"gpsp"},(0xE0D278F3),0,7,2 6 | 7 | ; Localised Vendor name 8 | %{"Summeli"} 9 | 10 | ; Unique Vendor name 11 | :"Summeli" 12 | 13 | ; Manual PKG pre-rules from PRO files 14 | ; Default HW/platform dependencies 15 | [0x101F7961],0,0,0,{"S60ProductID"} 16 | [0x102032BE],0,0,0,{"S60ProductID"} 17 | [0x102752AE],0,0,0,{"S60ProductID"} 18 | [0x1028315F],0,0,0,{"S60ProductID"} 19 | 20 | ; Default dependency to Qt libraries 21 | (0x2001E61C), 4, 7, 4, {"Qt"} 22 | 23 | ; Executable and default resource files 24 | "/QtSDK/Symbian/SDKs/SymbianSR1Qt474/epoc32/release/armv5/urel/gpsp.exe" - "!:/sys/bin/gpsp.exe" 25 | "/QtSDK/Symbian/SDKs/SymbianSR1Qt474/epoc32/data/z/resource/apps/gpsp.rsc" - "!:/resource/apps/gpsp.rsc" 26 | "/QtSDK/Symbian/SDKs/SymbianSR1Qt474/epoc32/data/z/private/10003a3f/import/apps/gpsp_reg.rsc" - "!:/private/10003a3f/import/apps/gpsp_reg.rsc" 27 | "/QtSDK/Symbian/SDKs/SymbianSR1Qt474/epoc32/data/z/resource/apps/gpsp.mif" - "!:/resource/apps/gpsp.mif" 28 | 29 | "game_config.txt" -"!:/private/E0D278F3/game_config.txt" 30 | 31 | ; Manual PKG post-rules from PRO files 32 | 33 | ; Add any installation notes if applicable 34 | "releasenotes.txt" - "", FILETEXT, TEXTCONTINUE 35 | -------------------------------------------------------------------------------- /gpsp/src/asm_debug.c: -------------------------------------------------------------------------------- 1 | /* gameplayS60p 2 | * 3 | * Copyright (C) 2009 summeli AT summeli.fi 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "debug.h" 21 | 22 | /* Just an easy way to generate debugs form assembler side of the code. 23 | I'm hope that there wont be that much to debug in the assembler side, 24 | since Symbian phones should use ARM after all ;-) 25 | Use this at the asm side by making call_c_function(CallDebugFromASM) calls. */ 26 | #define DEBUGBUILDER \ 27 | void CallDebugFromASM() \ 28 | { \ 29 | DEBUG("ARRRGH"); \ 30 | } \ 31 | 32 | DEBUGBUILDER; 33 | -------------------------------------------------------------------------------- /gpsp4cute/aboutdialog.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #ifndef ABOUTDIALOG_H 22 | #define ABOUTDIALOG_H 23 | 24 | #include 25 | #include "ui_aboutdialog.h" 26 | 27 | class aboutdialog : public QWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | aboutdialog(QWidget *parent = 0); 33 | ~aboutdialog(); 34 | 35 | public slots: 36 | void closeButtonClicked(); 37 | 38 | signals: 39 | void closeDialog(); 40 | 41 | private: 42 | Ui::aboutdialogClass ui; 43 | }; 44 | 45 | #endif // ABOUTDIALOG_H 46 | -------------------------------------------------------------------------------- /gpsp4cute/rightbuttonwidget.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2011 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef RIGHTBUTTONWIDGET_H 21 | #define RIGHTBUTTONWIDGET_H 22 | 23 | #include 24 | 25 | class rightbuttonwidget : public QObject 26 | { 27 | Q_OBJECT 28 | 29 | public: 30 | rightbuttonwidget(QObject *parent = 0); 31 | ~rightbuttonwidget(); 32 | 33 | public: 34 | quint32 getGpspKeys( int x, int y ); 35 | void setButtonSettings( int buttonSettings ); 36 | 37 | private: 38 | int m_buttonSettings; 39 | }; 40 | 41 | #endif // RIGHTBUTTONWIDGET_H 42 | -------------------------------------------------------------------------------- /gpsp4cute/cuteErrorDialog.cpp: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #include "cuteErrorDialog.h" 22 | #include "cutedebug.h" 23 | 24 | cuteErrorDialog::cuteErrorDialog( QString message, QWidget *parent) 25 | : QDialog(parent) 26 | { 27 | ui.setupUi(this); 28 | ui.errorLabel->setText( message ); 29 | connect(ui.OkButton, SIGNAL(clicked()), this, SLOT(buttonClicked())); 30 | 31 | } 32 | 33 | cuteErrorDialog::~cuteErrorDialog() 34 | { 35 | 36 | } 37 | 38 | void cuteErrorDialog::buttonClicked() 39 | { 40 | __DEBUG_IN 41 | emit( notifiedUser() ); 42 | } 43 | -------------------------------------------------------------------------------- /gpsp4cute/cuteErrorDialog.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #ifndef CUTEERRORDIALOG_H 22 | #define CUTEERRORDIALOG_H 23 | 24 | #include 25 | #include "ui_cuteErrorDialog.h" 26 | 27 | class cuteErrorDialog : public QDialog 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | cuteErrorDialog( QString message, QWidget *parent = 0); 33 | ~cuteErrorDialog(); 34 | 35 | public slots: 36 | void buttonClicked(); 37 | 38 | signals: 39 | void notifiedUser(); 40 | 41 | private: 42 | Ui::cuteErrorDialogClass ui; 43 | }; 44 | 45 | #endif // CUTEERRORDIALOG_H 46 | -------------------------------------------------------------------------------- /gpsp/inc/symbian_memory_handler.h: -------------------------------------------------------------------------------- 1 | /* gpSP4Symbian 2 | * 3 | * Copyright (C) 2009 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef SYMBIAN_MEMORY_HANDLER_H_ 21 | #define SYMBIAN_MEMORY_HANDLER_H_ 22 | 23 | #include "common.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | int create_all_translation_caches(); 30 | void CLEAR_INSN_CACHE(const u8 *code, int size); 31 | void SymbianPackHeap(); 32 | void close_all_caches(); 33 | void keepBacklightOn(); 34 | void symb_usleep(int aValue); 35 | 36 | void symb_create_interpolate_table(); 37 | 38 | #ifdef __cplusplus 39 | }; 40 | #endif 41 | 42 | #endif /* SYMBIAN_MEMORY_HANDLER_H_ */ 43 | -------------------------------------------------------------------------------- /gpsp4cute/sis/releasenotes.txt: -------------------------------------------------------------------------------- 1 | gpSP4Symbian v. 0.7.2 2 | 3 | Symbian port by summeli. 4 | Follow progress of gpsp port at my blog: http://www.summeli.fi 5 | 6 | Credits 7 | ------- 8 | 9 | This emulator uses code from these people/projects: 10 | 11 | Exophase 12 | * Original gpsp code 13 | Homepage: http://gpsp-dev.blogspot.com/ 14 | 15 | Olli Hinkka 16 | * Memory Relocator code 17 | 18 | Saiyaku 19 | * The gpsp4Symbian logo 20 | * The D-PAD grapchics 21 | * app icon 22 | 23 | Summeli 24 | * Symbian port 25 | Homepage: http://www.summeli.fi 26 | E-mail: summeli(atsymbol)summeli.fi 27 | 28 | 29 | Legal / Disclaimer 30 | ------------------ 31 | 32 | This program is free software; you can redistribute it and/or 33 | modify it under the terms of the GNU General Public License as 34 | published by the Free Software Foundation; either version 2 of 35 | the License, or (at your option) any later version. 36 | 37 | This program is distributed in the hope that it will be useful, 38 | but WITHOUT ANY WARRANTY; without even the implied warranty of 39 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 40 | General Public License for more details. 41 | 42 | You should have received a copy of the GNU General Public License 43 | along with this program; if not, write to the Free Software 44 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 45 | 46 | -------------------------------------------------------------------------------- /gpsp/gms/defines.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2009, Harry Li 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | 18 | VARIANT = $(EPOCROOT2)/include/variant 19 | OS_HRH = $(VARIANT)/Symbian_OS.hrh 20 | 21 | SYMBIAN_MACRO = -D__SYMBIAN32__ -D__EPOC32__ 22 | GCCE_MACRO = -D__GCCE__ -D__MARM__ -D__MARM_ARMV5__ -D__EABI__ -march=armv5t #-O0 -fexpensive-optimizations -finline -ffast-math -msoft-float -falign-functions=32 -falign-loops -falign-labels -falign-jumps -fomit-frame-pointer 23 | CPP_MACRO = -D__SUPPORT_CPP_EXCEPTIONS__ 24 | EXE_MACRO = -D__EXE__ 25 | REL_MACRO = -DNDEBUG 26 | DEB_MACRO = -D_DEBUG 27 | UNICODE_MACRO = -D_UNICODE 28 | 29 | GCCE_WARNING_FLAGS = -Wall -Wno-unknown-pragmas 30 | 31 | CPP_ARGS = -undef -M -nostdinc -D__PRODUCT_INCLUDE__=\"$(OS_HRH)" 32 | -------------------------------------------------------------------------------- /gpsp/inc/cheats.h: -------------------------------------------------------------------------------- 1 | /* gameplaySP 2 | * 3 | * Copyright (C) 2006 Exophase 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #define CHEAT_NAME_LENGTH 17 21 | 22 | typedef enum 23 | { 24 | CHEAT_TYPE_GAMESHARK_V1, 25 | CHEAT_TYPE_GAMESHARK_V3, 26 | CHEAT_TYPE_INVALID 27 | } cheat_variant_enum; 28 | 29 | typedef struct 30 | { 31 | u8 cheat_name[CHEAT_NAME_LENGTH]; 32 | u32 cheat_active; 33 | u32 cheat_codes[256]; 34 | u32 num_cheat_lines; 35 | cheat_variant_enum cheat_variant; 36 | } cheat_type; 37 | 38 | void process_cheats(); 39 | void add_cheats(u8 *cheats_filename); 40 | 41 | #define MAX_CHEATS 16 42 | 43 | extern cheat_type cheats[MAX_CHEATS]; 44 | extern u32 num_cheats; 45 | -------------------------------------------------------------------------------- /gpsp4cute/dpadwidget.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #ifndef DPADWIDGET_H 22 | #define DPADWIDGET_H 23 | 24 | #include 25 | 26 | class DPadWidget : public QObject 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | DPadWidget(QObject *parent = 0); 32 | ~DPadWidget(); 33 | 34 | signals: 35 | void showMenu(); 36 | public slots: 37 | void setDpadMode( int mode ); 38 | private: 39 | quint32 getFourDirectinalPad( int x, int y ); 40 | public: 41 | quint32 getGpspKeys( int x, int y ); 42 | 43 | private: 44 | int m_dpadMode; 45 | }; 46 | 47 | #endif // DPADWIDGET_H 48 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | gpSP4SCute: [gpsp][gpsp] for Symbian 2 | =========================== 3 | 4 | gpSP4Cute is a gameboy advanced emulator for Symbian. It's based on gpSP version 0.9-2Xb by Exophase for gp2x. 5 | 6 | 7 | Building 8 | ---------- 9 | The gpSP stuff is build separately with custom makefilesystem, and the gpsp4cute is build with the usual Qt flags. 10 | 11 | The gpSP lib should be build with [General Makefile system by summeli] (https://summeli.com/2247) 12 | You'll also will get some errors from the checklib when buildin the gpsp. Therefore you should [get rid of the checklib 13 | in QtSDK] (https://summeli.com/2492) 14 | 15 | After the gpSP lib is build, you can build the gpsp4cute project which will add the UI to the gpsp project. The gpsp4cute 16 | is build with standard Qt-stuff. See my blog post how to set up the environement with QtSDK [www.summeli.com] (https://summeli.com/2277) 17 | 18 | License 19 | ------- 20 | 21 | gpsp is distributed under [GPLv2 license](https://github.com/Summeli/gpSP4Symbian/blob/master/COPYING.DOC) 22 | 23 | Credits 24 | ------- 25 | * Exophase [gpsp] - Creator of original gpSP 26 | * Zodttd [Zodttd] - Helping Exophase with ARM port 27 | * Summeli [summeli] - Symbian port 28 | * Olli Hinkka - Memory Relocator code 29 | * Saiyaku - graphics and app icon 30 | 31 | [gpsp]: http://gpsp-dev.blogspot.com/ "gpSP development bblog" 32 | [summeli]: https://summeli.com 33 | [Zodttd]: http://www.zodttd.com/ 34 | -------------------------------------------------------------------------------- /gpsp4cute/filewidget.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef FILEWIDGET_H 21 | #define FILEWIDGET_H 22 | 23 | #include 24 | #include "ui_filewidget.h" 25 | 26 | class filewidget : public QWidget 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | filewidget(QString rom, QString bios, QWidget *parent = 0); 32 | ~filewidget(); 33 | 34 | public: 35 | void setRomLabel(QString rom); 36 | void setBiosLabel(QString bios); 37 | 38 | public slots: 39 | void loadbuttonclicked(); 40 | void setbiosclicked(); 41 | 42 | signals: 43 | void loadROM(); 44 | void setBios(); 45 | 46 | private: 47 | Ui::filewidgetClass ui; 48 | }; 49 | 50 | #endif // FILEWIDGET_H 51 | -------------------------------------------------------------------------------- /gpsp4cute/audiosettings.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #ifndef AUDIOSETTINGS_H 22 | #define AUDIOSETTINGS_H 23 | 24 | #include 25 | #include "ui_audiosettings.h" 26 | 27 | class AudioSettings : public QWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | AudioSettings(int audioOn, int volume, 33 | QWidget *parent = 0); 34 | ~AudioSettings(); 35 | 36 | public slots: 37 | void setAudioOn( int audioOn ); 38 | void setVolume( int volume ); 39 | 40 | signals: 41 | void AudioOn( int audioOn ); 42 | void Volume( int volume ); 43 | 44 | private: 45 | void updateVolumeLabel( int vol ); 46 | private: 47 | Ui::AudioSettingsClass ui; 48 | }; 49 | 50 | #endif // AUDIOSETTINGS_H 51 | -------------------------------------------------------------------------------- /gpsp4cute/gpspSettings.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #ifndef ANTSETTINGS_H_ 22 | #define ANTSETTINGS_H_ 23 | 24 | #include 25 | 26 | struct TGPSPSettings 27 | { 28 | enum TScreenSettings { 29 | EMedium = 0, 30 | EFullScreen 31 | }; 32 | 33 | int iVersion; 34 | //matches to the snes-keys 35 | quint32 iScanKeyTable[10]; 36 | QString iLastROM; 37 | QString iBios; 38 | int iLastSlot; 39 | bool iShowFPS; 40 | 41 | //Audio Settings 42 | bool iAudioOn; 43 | int iVolume; 44 | int iDpadSettings; 45 | int iButtonSettings; 46 | 47 | int iButtonOpacity; 48 | int iStretch; 49 | }; 50 | 51 | #endif /* ANTSETTINGS_H_ */ 52 | -------------------------------------------------------------------------------- /gpsp4cute/videosettings.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef VIDEOSETTINGS_H 21 | #define VIDEOSETTINGS_H 22 | 23 | #include 24 | #include "ui_videosettings.h" 25 | 26 | class videosettings : public QWidget 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | videosettings( bool showFps, int buttonOpacity, int stretch, QWidget *parent = 0); 32 | ~videosettings(); 33 | 34 | public slots: 35 | void showFPSChecked( int state ); 36 | void stretchIndexChecked( int state ); 37 | void setOpacity(int slider); 38 | signals: 39 | void showFPS( bool showFPS ); 40 | void stretch( int stretch ); 41 | void buttonOpacity( int buttonOpacity ); 42 | private: 43 | Ui::videosettingsClass ui; 44 | }; 45 | 46 | #endif // VIDEOSETTINGS_H 47 | -------------------------------------------------------------------------------- /gpsp4cute/controlsettings.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #ifndef CONTROLSETTINGS_H 22 | #define CONTROLSETTINGS_H 23 | 24 | #include 25 | #include "ui_controlsettings.h" 26 | 27 | class controlsettings : public QWidget 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | controlsettings( int dpadSettings, int hiddenABButtons, QWidget *parent = 0); 33 | ~controlsettings(); 34 | 35 | public slots: 36 | void keyConfig(); 37 | void setDPadSettings( int settings ); 38 | void setButtonSettings( int settings ); 39 | signals: 40 | void runkeyconfig(); 41 | void dpadSettings(int settings); 42 | void buttonSettings( int settings ); 43 | 44 | private: 45 | Ui::controlsettingsClass ui; 46 | }; 47 | 48 | #endif // CONTROLSETTINGS_H 49 | -------------------------------------------------------------------------------- /gpsp4cute/keyconfigdialog.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef KEYCONFIGDIALOG_H 21 | #define KEYCONFIGDIALOG_H 22 | 23 | #include 24 | #include 25 | 26 | #include "ui_keyconfigdialog.h" 27 | 28 | class keyconfigdialog : public QWidget 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | keyconfigdialog(QWidget *parent = 0); 34 | ~keyconfigdialog(); 35 | void keyPressEvent( QKeyEvent * event); 36 | 37 | quint32 getKeyBind( int key ); 38 | public slots: 39 | void cancelClicked(); 40 | 41 | signals: 42 | void configDone(); 43 | 44 | private: 45 | void updateText(); 46 | 47 | private: 48 | Ui::keyconfigdialogClass ui; 49 | int round; 50 | quint32 scanKeyTable[10]; 51 | }; 52 | 53 | #endif // KEYCONFIGDIALOG_H 54 | -------------------------------------------------------------------------------- /gpsp4cute/cuteDebug.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef DEBUG_H_ 21 | #define DEBUG_H_ 22 | 23 | //#define _DEBUG 24 | void initdebug(); 25 | 26 | #include 27 | #ifdef _DEBUG 28 | #define __DEBUG_IN qDebug() << __PRETTY_FUNCTION__ << "in"; 29 | #define __DEBUG_OUT qDebug() << __PRETTY_FUNCTION__ << "out"; 30 | #define __DEBUG1(a) qDebug() << a; 31 | #define __DEBUG2(a,b) qDebug() << a << b; 32 | #define __DEBUG3(a,b,c) qDebug() << a << b << c; 33 | #define __DEBUG4(a,b,c,d) qDebug() << a << b << c << d; 34 | #else 35 | #define __DEBUG_IN 36 | #define __DEBUG_OUT 37 | #define __DEBUG1(a) 38 | #define __DEBUG2(a,b) 39 | #define __DEBUG3(a,b,c) 40 | #define __DEBUG4(a,b,c,d) 41 | #endif 42 | 43 | #endif /* DEBUG_H_ */ 44 | -------------------------------------------------------------------------------- /gpsp/inc/gui.h: -------------------------------------------------------------------------------- 1 | /* gameplaySP 2 | * 3 | * Copyright (C) 2006 Exophase 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef GUI_H 21 | #define GUI_H 22 | 23 | #define GPSP_CONFIG_FILENAME "gpsp.cfg" 24 | 25 | //export some functions to be called from the c++ side 26 | #ifdef __SYMBIAN32__ 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | s32 load_file(u8 **wildcards, u8 *result); 32 | u32 adjust_frameskip(u32 button_id); 33 | s32 load_game_config_file(); 34 | s32 load_config_file(); 35 | s32 save_game_config_file(); 36 | s32 save_config_file(); 37 | u32 menu(u16 *original_screen); 38 | 39 | #ifdef __cplusplus 40 | }; 41 | #endif 42 | #endif 43 | 44 | extern u32 savestate_slot; 45 | 46 | void get_savestate_filename_noshot(u32 slot, u8 *name_buffer); 47 | void get_savestate_filename(u32 slot, u8 *name_buffer); 48 | void get_savestate_snapshot(u8 *savestate_filename); 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /gpsp4cute/filewidget.cpp: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #include "filewidget.h" 22 | 23 | filewidget::filewidget(QString rom, QString bios, QWidget *parent) 24 | : QWidget(parent) 25 | { 26 | ui.setupUi(this); 27 | ui.romLabel->setText( rom ); 28 | ui.biosLabel->setText( bios ); 29 | connect(ui.loadButton, SIGNAL(clicked()), this, SLOT(loadbuttonclicked())); 30 | connect(ui.biosButton, SIGNAL(clicked()), this, SLOT(setbiosclicked())); 31 | 32 | } 33 | 34 | filewidget::~filewidget() 35 | { 36 | 37 | } 38 | 39 | void filewidget::setRomLabel(QString rom) 40 | { 41 | ui.romLabel->setText( rom ); 42 | } 43 | 44 | void filewidget::setBiosLabel(QString bios) 45 | { 46 | ui.biosLabel->setText( bios ); 47 | } 48 | 49 | void filewidget::loadbuttonclicked() 50 | { 51 | emit(loadROM()); 52 | } 53 | 54 | void filewidget::setbiosclicked() 55 | { 56 | emit(setBios()); 57 | } 58 | -------------------------------------------------------------------------------- /gpsp4cute/main.cpp: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #include "cuteDebug.h" 22 | #include "viewcontroller.h" 23 | #include "relocutils.h" 24 | 25 | #include 26 | #include 27 | 28 | 29 | extern "C" void init_symbian_stuff(); 30 | 31 | void loadStyleSheet() 32 | { 33 | QFile file(":/style/summelistyle.qss"); 34 | if(!file.open(QFile::ReadOnly)) 35 | { 36 | __DEBUG1("Unable to open file"); 37 | } 38 | QString styleSheet = QLatin1String(file.readAll()); 39 | qApp->setStyleSheet(styleSheet); 40 | file.close(); 41 | } 42 | 43 | int main(int argc, char *argv[]) 44 | { 45 | BEGIN_RELOCATED_CODE(0x10000000); 46 | 47 | //init all the basic symbian stuff 48 | init_symbian_stuff(); 49 | QApplication a(argc, argv); 50 | loadStyleSheet(); 51 | 52 | ViewController* vc = new ViewController(); 53 | 54 | return a.exec(); 55 | END_RELOCATED_CODE(); // return to the original code section 56 | } 57 | -------------------------------------------------------------------------------- /gpsp/inc/symb_adaptation.h: -------------------------------------------------------------------------------- 1 | /* AntSnes 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | #ifndef SYMB_ADAPTATION_H_ 20 | #define SYMB_ADAPTATION_H_ 21 | 22 | #include "common.h" 23 | 24 | typedef long long int64; 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /*This interface should be build in the application side 31 | * the gpsp is just statically linking into these functions 32 | * for integration 33 | * */ 34 | u32 updateSymbianInput(); 35 | void symbian_blit( const u16* screen ); 36 | 37 | void gameconfigFilePath( char* path ); 38 | void getmainPath( char* path ); 39 | 40 | void dispatchNoBiosErrorNote(); 41 | void dispatchWrongBiosErrorNote(); 42 | void dispatchRomErrorNote(); 43 | 44 | u16* get_screen_pixels(); 45 | 46 | u16* allocateFramenBuffer( u32 size ); 47 | 48 | /* 49 | * This stuff is used from the C++ side to C side 50 | * */ 51 | int symbian_library_main(u8* rom, u8* bios ); 52 | 53 | //audio adaptation 54 | 55 | #ifdef __cplusplus 56 | }; 57 | #endif 58 | 59 | #endif /* SYMB_ADAPTATION_H_ */ 60 | -------------------------------------------------------------------------------- /gpsp4cute/filewidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | filewidgetClass 4 | 5 | 6 | 7 | 0 8 | 0 9 | 640 10 | 150 11 | 12 | 13 | 14 | filewidget 15 | 16 | 17 | 18 | 19 | 30 20 | 10 21 | 151 22 | 61 23 | 24 | 25 | 26 | Load ROM 27 | 28 | 29 | 30 | 31 | 32 | 30 33 | 80 34 | 151 35 | 61 36 | 37 | 38 | 39 | Set Bios 40 | 41 | 42 | 43 | 44 | 45 | 200 46 | 30 47 | 351 48 | 31 49 | 50 | 51 | 52 | No ROM is set 53 | 54 | 55 | 56 | 57 | 58 | 200 59 | 101 60 | 351 61 | 31 62 | 63 | 64 | 65 | No Bios is set 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /gpsp4cute/controlsettings.cpp: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #include "controlsettings.h" 22 | 23 | controlsettings::controlsettings( int dpadSettings, int hiddenABButtons, QWidget *parent) 24 | : QWidget(parent) 25 | { 26 | ui.setupUi(this); 27 | ui.dpadSettings->setCurrentIndex( dpadSettings ); 28 | ui.buttonSettings->setCurrentIndex( hiddenABButtons ); 29 | 30 | connect(ui.keyconfigButton, SIGNAL(clicked()), this, SLOT(keyConfig())); 31 | connect(ui.dpadSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setDPadSettings(int))); 32 | connect(ui.buttonSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(setButtonSettings(int))); 33 | } 34 | 35 | controlsettings::~controlsettings() 36 | { 37 | 38 | } 39 | 40 | void controlsettings::keyConfig() 41 | { 42 | emit( runkeyconfig() ); 43 | } 44 | 45 | void controlsettings::setDPadSettings( int settings ) 46 | { 47 | emit( dpadSettings(settings) ); 48 | } 49 | 50 | void controlsettings::setButtonSettings( int settings ) 51 | { 52 | emit( buttonSettings( settings )); 53 | } 54 | -------------------------------------------------------------------------------- /gpsp4cute/audiosettings.cpp: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #include "audiosettings.h" 22 | 23 | AudioSettings::AudioSettings(int audioOn, int volume, 24 | QWidget *parent ) 25 | : QWidget(parent) 26 | { 27 | ui.setupUi(this); 28 | ui.AudioOnOffBox->setCurrentIndex( audioOn ); 29 | ui.volumeSlider->setValue( volume ); 30 | 31 | connect(ui.AudioOnOffBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setAudioOn(int))); 32 | connect(ui.volumeSlider, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); 33 | updateVolumeLabel( volume ); 34 | } 35 | 36 | AudioSettings::~AudioSettings() 37 | { 38 | 39 | } 40 | 41 | void AudioSettings::setAudioOn( int audioOn ) 42 | { 43 | emit( AudioOn(audioOn) ); 44 | } 45 | 46 | 47 | void AudioSettings::setVolume( int volume ) 48 | { 49 | updateVolumeLabel( volume ); 50 | emit( Volume(volume) ); 51 | } 52 | 53 | void AudioSettings::updateVolumeLabel( int vol ) 54 | { 55 | QString volstr( QString::number( vol * 10 ) ); 56 | volstr.append("%"); 57 | ui.volumeLabel->setText( volstr ); 58 | } 59 | -------------------------------------------------------------------------------- /gpsp4cute/buttonpositions.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2011 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | //statics for rendering 22 | const int GBA_SCREEN_WIDTH=240; 23 | const int GBA_SCREEN_HEIGHT=160; 24 | const int GBA_BYTES_PER_LINE=GBA_SCREEN_WIDTH*2; 25 | 26 | //statis for the phone screen 27 | const int SCREEN_TOP = 0; 28 | const int SCREEN_HEIGHT = 360; 29 | const int SCREEN_WIDTH = 640; 30 | 31 | const int DPAD_WIDTH = 169; 32 | const int DPAD_HEIGHT = 169; 33 | const int BUTTON_WIDTH = 169; 34 | const int BUTTON_LEFT_POS = SCREEN_WIDTH -BUTTON_WIDTH ; 35 | 36 | const int SMALLBUTTON_WIDTH = 80; 37 | const int SMALLBUTTON_HEIGHT = 40; 38 | const int MENU_HEIGHT = 32; 39 | 40 | const QPoint tl_point(0, SMALLBUTTON_HEIGHT ); 41 | const QPoint tr_point(SCREEN_WIDTH - SMALLBUTTON_WIDTH, SMALLBUTTON_HEIGHT ); 42 | const QPoint dpad_point(0,SCREEN_HEIGHT - DPAD_WIDTH); 43 | const QPoint buttons_point( BUTTON_LEFT_POS,SCREEN_HEIGHT - BUTTON_WIDTH); 44 | const QPoint menu_point( 0, 0 ); 45 | const QPoint start_select_point( SCREEN_WIDTH - SMALLBUTTON_WIDTH, 0 ); 46 | const QPoint showFPS_point(128,20); 47 | -------------------------------------------------------------------------------- /gpsp/inc/debug.h: -------------------------------------------------------------------------------- 1 | /* gameplayS60p 2 | * 3 | * Copyright (C) 2009 summeli AT summeli.fi 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __DEBUG_H__ 21 | #define __DEBUG_H__ 22 | 23 | //#define __DEBUG__ON__ 24 | #define __DEBUG_TO_FILE__ 25 | 26 | #ifdef __DEBUG__ON__ 27 | 28 | #define DEBUG(x) WriteLOG( x ) 29 | #define DEBUG1(x, v) WriteLOG1( x, v ) 30 | #define DEBUG2(x, v1, v2) WriteLOG2( x, v1, v2 ) 31 | #define DEBUG3(x, v1, v2, v3) WriteLOG3( x, v1, v2, v3 ) 32 | #define DEBUG4(x, v1, v2, v3, v4) WriteLOG4( x, v1, v2, v3, v4 ) 33 | #define INITSYMBIANDEBUG InitDEBUG(); 34 | 35 | #else 36 | #define DEBUG(x) 37 | #define DEBUG1(x, v) 38 | #define DEBUG2(x, v1, v2) 39 | #define DEBUG2(f, s, v1, v2) 40 | #define DEBUG3(x, v1, v2, v3) 41 | #define DEBUG4(x, v1, v2, v3, v4) 42 | #define INITSYMBIANDEBUG 43 | #endif 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | void WriteLOG( char* x ); 49 | void WriteLOG1( char* x, char* v ); 50 | void WriteLOG2( char* x, char* v, char* v1 ); 51 | void WriteLOG3( char* x, char* v, char* v1, char* v2 ); 52 | void WriteLOG4( char* x, char* v, char* v1, char* v2, char* v3 ); 53 | void InitDEBUG(); 54 | #ifdef __cplusplus 55 | }; 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /gpsp4cute/viewcontroller.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef VIEWCONTROLLER_H_ 21 | #define VIEWCONTROLLER_H_ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include "gpsp4qt.h" 28 | #include "emusettings.h" 29 | #include "QRemoteControlKeys.h" 30 | 31 | class ViewController : public QObject 32 | { 33 | Q_OBJECT 34 | public: 35 | ViewController(); 36 | ~ViewController(); 37 | 38 | public slots: 39 | void loadROM( QString rom, TGPSPSettings antSettings ); 40 | void showSettings(); 41 | void LoadState( int state ); 42 | void SaveState( int state ); 43 | void reset(); 44 | void continueGame(); 45 | 46 | private: 47 | gpsp4Qt* emuView; 48 | EmuSettings* settingsView; 49 | QRemoteControlKeys* remotekeys; 50 | 51 | #ifdef Q_OS_SYMBIAN 52 | qint32 iMenuKeyHandle; 53 | qint32 iNoKeyHandle; 54 | qint32 iNoKeyHandle2; 55 | qint32 iMenuKeyHandle2; 56 | qint32 iCameraKeyHandle; 57 | #endif 58 | 59 | 60 | }; 61 | #endif /* VIEWCONTROLLER_H_ */ 62 | -------------------------------------------------------------------------------- /gpsp/inc/relocutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TheRelocator, dynamic text segment relocation routine v1.0 for SymbianOS. 3 | * Copyright (C) 2009,2010 Olli Hinkka 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; version 2 8 | * of the License. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | *along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | #ifndef __RELOCUTILS__H__ 22 | #define __RELOCUTILS__H__ 23 | 24 | #ifdef __cplusplus 25 | 26 | #include 27 | 28 | #define RELOCATED_CODE(x) TheRelocator __theRelocator((TAny*)x); 29 | 30 | extern "C" unsigned int original_ro_base; 31 | extern "C" int relocated_ro_offset; 32 | 33 | NONSHARABLE_CLASS(TheRelocator) 34 | { 35 | public: 36 | TheRelocator(TAny* aTargetAddr); 37 | ~TheRelocator(); 38 | private: 39 | TheRelocator(); 40 | void Jmp(TAny* aOldCodeBase, TAny* aNewCodeBase); 41 | void Relocate(TAny* aTargetAddr); 42 | TAny* iOldBaseAddr; 43 | TAny* iNewBaseAddr; 44 | RChunk iChunk; 45 | }; 46 | 47 | extern "C" void* __begin_relocated_code(void* ptr); 48 | extern "C" void __end_relocated_code(void* ptr); 49 | 50 | #else 51 | 52 | extern void* __begin_relocated_code(void* ptr); 53 | extern void __end_relocated_code(void* ptr); 54 | extern unsigned int original_ro_base; 55 | extern int relocated_ro_offset; 56 | 57 | #endif 58 | 59 | #define BEGIN_RELOCATED_CODE(x) void* __reloc_obj_ptr=__begin_relocated_code((void*)x); 60 | #define END_RELOCATED_CODE() __end_relocated_code(__reloc_obj_ptr); 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /gpsp/src/arm_stub_c.c: -------------------------------------------------------------------------------- 1 | /* gameplaySP 2 | * 3 | * Copyright (C) 2006 Exophase 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "common.h" 21 | 22 | #if 0 23 | // Temporary replacement of cpu_threaded.c declarations shoved in here for the time being 24 | u8 rom_translation_cache[ROM_TRANSLATION_CACHE_SIZE]; 25 | u8 *rom_translation_ptr = rom_translation_cache; 26 | 27 | u8 ram_translation_cache[RAM_TRANSLATION_CACHE_SIZE]; 28 | u8 *ram_translation_ptr = ram_translation_cache; 29 | u32 iwram_code_min = 0xFFFFFFFF; 30 | u32 iwram_code_max = 0xFFFFFFFF; 31 | u32 ewram_code_min = 0xFFFFFFFF; 32 | u32 ewram_code_max = 0xFFFFFFFF; 33 | 34 | u8 bios_translation_cache[BIOS_TRANSLATION_CACHE_SIZE]; 35 | u8 *bios_translation_ptr = bios_translation_cache; 36 | 37 | u32 *rom_branch_hash[ROM_BRANCH_HASH_SIZE]; 38 | 39 | // Default 40 | u32 idle_loop_target_pc = 0xFFFFFFFF; 41 | u32 translation_gate_target_pc[MAX_TRANSLATION_GATES]; 42 | u32 translation_gate_targets = 0; 43 | u32 iwram_stack_optimize = 1; 44 | 45 | void dump_translation_cache() {} 46 | void flush_translation_cache_bios() {} 47 | void flush_translation_cache_rom() {} 48 | void flush_translation_cache_ram() {} 49 | #endif 50 | 51 | // Temporary replacement of stub declarations for use with interpreter to make things easier 52 | u8 *memory_map_read[8 * 1024]; 53 | u8 *memory_map_write[8 * 1024]; 54 | 55 | -------------------------------------------------------------------------------- /gpsp/group/gpSP4Symbian.mmp: -------------------------------------------------------------------------------- 1 | /* gpsp4Symbian buildfile 2 | * 3 | * Copyright (C) 2011 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | TARGET gpsp4symbian.lib 22 | TARGETTYPE LIB 23 | UID 0x100039CE 0xE0D278F3 24 | 25 | SOURCEPATH ..\src 26 | SOURCE symbian_memory_handler.cpp 27 | SOURCE relocator.cpp 28 | 29 | SOURCE gpspmain.c 30 | SOURCE cpu.c 31 | SOURCE video.c 32 | SOURCE sound.c 33 | SOURCE input.c 34 | SOURCE cpu_threaded.c 35 | SOURCE gui.c 36 | SOURCE zip.c 37 | SOURCE cheats.c 38 | SOURCE memory.c 39 | SOURCE arm_stub_c.c 40 | SOURCE asm_debug.c 41 | 42 | SOURCE arm_stub.s 43 | SOURCE video_blend.s 44 | SOURCE relocator_glue.s 45 | 46 | 47 | USERINCLUDE ..\inc 48 | 49 | SYSTEMINCLUDE \epoc32\include 50 | SYSTEMINCLUDE \epoc32\include\stdapis 51 | SYSTEMINCLUDE \epoc32\include\libc 52 | 53 | LIBRARY euser.lib avkon.lib eikcore.lib eiksrv.lib apparc.lib estlib.lib efsrv.lib 54 | LIBRARY cone.lib hal.lib fbscli.lib ws32.lib apgrfx.lib gdi.lib bitgdi.lib mediaclientaudiostream.lib 55 | LIBRARY bafl.lib estor.lib commonengine.lib hlplch.lib ezlib.lib libc.lib flogger.lib 56 | 57 | LANG SC 58 | 59 | VENDORID 0 60 | SECUREID 0xE0D278F3 61 | CAPABILITY ReadUserData 62 | 63 | #ifdef ENABLE_ABIV2_MODE 64 | DEBUGGABLE_UDEBONLY 65 | #endif 66 | // End of File 67 | 68 | -------------------------------------------------------------------------------- /gpsp4cute/keyconfigdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | keyconfigdialogClass 3 | 4 | 5 | 6 | 0 7 | 0 8 | 640 9 | 150 10 | 11 | 12 | 13 | 14 | 640 15 | 150 16 | 17 | 18 | 19 | keyconfigdialog 20 | 21 | 22 | 23 | 24 | 0 25 | 0 26 | 640 27 | 150 28 | 29 | 30 | 31 | 32 | 33 | 34 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 35 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 36 | p, li { white-space: pre-wrap; } 37 | </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> 38 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;">Press Up, or </p> 39 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;">Press Skip to skip this button</p></body></html> 40 | 41 | 42 | Qt::AlignCenter 43 | 44 | 45 | 46 | 47 | 48 | 240 49 | 100 50 | 161 51 | 41 52 | 53 | 54 | 55 | Skip 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /gpsp/src/relocator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * TheRelocator, dynamic text segment relocation routine v1.0 for SymbianOS. 3 | * Copyright (C) 2009,2010 Olli Hinkka 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; version 2 8 | * of the License. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | *along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | * 19 | */ 20 | 21 | 22 | #include "relocutils.h" 23 | 24 | unsigned int original_ro_base = 0; 25 | int relocated_ro_offset = 0; 26 | 27 | _LIT(KRelocatorPanic, "RELOCATOR PANIC"); 28 | 29 | TheRelocator::TheRelocator() 30 | { 31 | } 32 | 33 | void TheRelocator::Relocate(TAny* aTargetAddr) 34 | { 35 | TProcessMemoryInfo procInfo; 36 | RProcess myself; 37 | myself.GetMemoryInfo(procInfo); 38 | original_ro_base = procInfo.iCodeBase; 39 | TInt err = iChunk.CreateLocalCode(procInfo.iCodeSize,procInfo.iCodeSize); 40 | if(err) 41 | User::Panic(KRelocatorPanic, err); 42 | 43 | if ((TUint32)iChunk.Base() != (TUint32)aTargetAddr) 44 | { 45 | RChunk temp; 46 | TUint32 offset = 0; 47 | offset = (TUint32)aTargetAddr-(TUint32)iChunk.Base(); 48 | iChunk.Close(); 49 | temp.CreateLocal(0,offset); 50 | err = iChunk.CreateLocalCode(procInfo.iCodeSize,procInfo.iCodeSize); 51 | if( err ) 52 | User::Panic(KRelocatorPanic, err); 53 | temp.Close(); 54 | } 55 | relocated_ro_offset=-(original_ro_base-(unsigned int)iChunk.Base()); 56 | Mem::Copy(iChunk.Base(), (TAny*)procInfo.iCodeBase, procInfo.iCodeSize); 57 | User::IMB_Range(iChunk.Base(), iChunk.Base()+procInfo.iCodeSize); 58 | iOldBaseAddr = (TAny*)procInfo.iCodeBase; 59 | iNewBaseAddr = (TAny*)iChunk.Base(); 60 | myself.Close(); 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /gpsp4cute/gpsp4cute.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | TARGET = gpsp 3 | 4 | QT += core \ 5 | gui \ 6 | opengl 7 | 8 | HEADERS += filewidget.h \ 9 | dpadwidget.h \ 10 | QRemoteControlKeys.h \ 11 | aboutdialog.h \ 12 | controlsettings.h \ 13 | videosettings.h \ 14 | audiosettings.h \ 15 | keyconfigdialog.h \ 16 | viewcontroller.h \ 17 | emusettings.h \ 18 | gpspadaptation.h \ 19 | gpspSettings.h \ 20 | gpsp4Qt.h \ 21 | cuteErrorDialog.h \ 22 | rightbuttonwidget.h \ 23 | AntAudio.h 24 | 25 | SOURCES += cuteErrorDialog.cpp \ 26 | filewidget.cpp \ 27 | dpadwidget.cpp \ 28 | QRemoteControlKeys.cpp \ 29 | aboutdialog.cpp \ 30 | controlsettings.cpp \ 31 | videosettings.cpp \ 32 | audiosettings.cpp \ 33 | keyconfigdialog.cpp \ 34 | viewcontroller.cpp \ 35 | emusettings.cpp \ 36 | gpspadaptation.cpp \ 37 | main.cpp \ 38 | gpsp4Qt.cpp \ 39 | rightbuttonwidget.cpp \ 40 | AntAudio.cpp 41 | 42 | FORMS += cuteErrorDialog.ui \ 43 | filewidget.ui \ 44 | aboutdialog.ui \ 45 | controlsettings.ui \ 46 | videosettings.ui \ 47 | keyconfigdialog.ui \ 48 | audiosettings.ui \ 49 | emusettings.ui 50 | 51 | RESOURCES += gpspresources.qrc 52 | 53 | symbian:LIBS += -lgpsp4symbian.lib \ 54 | -lscdv \ 55 | -lws32 \ 56 | -lcone \ 57 | -lmediaclientaudiostream \ 58 | -leikcore \ 59 | -lavkon \ 60 | -lremconcoreapi \ 61 | -lremconinterfacebase \ 62 | -lecom \ 63 | -lhal \ 64 | -llibEGL \ 65 | -llibGLESv2 \ 66 | -lmmfcontrollerframework #TODO: remove when audio can be removed.. 67 | 68 | symbian:TARGET.UID3 \ 69 | = \ 70 | 0xE0D278F3 71 | symbian:TARGET.EPOCHEAPSIZE = 0x800000 \ 72 | 0x1400000 73 | 74 | symbian:TARGET.EPOCSTACKKSIZE = 0x20000 75 | symbian: TARGET.CAPABILITY = UserEnvironment 76 | symbian:ICON = gfx/gpsp.svg 77 | symbian:INCLUDEPATH += ../gpsp/inc/ 78 | symbian:MACRO = SYMBIAN_ENABLE_SPLIT_HEADERS 79 | 80 | OTHER_FILES += summelistyle.qss 81 | 82 | #pkg files 83 | gpspFiles.sources = sis\\game_config.txt 84 | gpspFiles.path = !:\\private\\E0D278F3\\game_config.txt 85 | DEPLOYMENT += gpspFiles; 86 | 87 | 88 | packageheader = "$${LITERAL_HASH}{\"gpsp\"}, (0xE0D278F3), 0, 7, 2 " 89 | default_deployment.pkg_prerules = packageheader 90 | -------------------------------------------------------------------------------- /gpsp4cute/QBlitterWidget.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #ifndef QBLITTERWIDGET_H_ 22 | #define QBLITTERWIDGET_H_ 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #include "smallgpsplogo.h" 32 | 33 | class QBlitterWidget : public QWidget, public CActive, public MDirectScreenAccess 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | QBlitterWidget( QWidget *parent = 0 ); 39 | ~QBlitterWidget(); 40 | 41 | public slots: 42 | void render(); 43 | void stopDSA(); 44 | void startDSA(); 45 | void setScreenMode( int mode, bool keepaspectratio ); 46 | void setLogo(); 47 | 48 | protected: 49 | void paintEvent(QPaintEvent *); 50 | void createScreenBuffer(); 51 | void createScreenBufferSamsung(); 52 | 53 | public: 54 | // from MDirectScreenAccess class 55 | void Restart(RDirectScreenAccess::TTerminationReasons aReason); 56 | void AbortNow(RDirectScreenAccess::TTerminationReasons aReason); 57 | 58 | public: 59 | // from CActive 60 | virtual void DoCancel(); 61 | virtual void RunL(); 62 | 63 | protected: //data 64 | QImage* buf; 65 | TUint8* bitmapdata; 66 | 67 | int screenmode; 68 | bool keepratio; 69 | CDirectScreenAccess *iDSA; 70 | CDirectScreenBitmap *iDSBitmap; 71 | smallgpsplogo* logo; 72 | bool samsung; 73 | }; 74 | 75 | #endif /* QBLITTERWIDGET_H_ */ 76 | -------------------------------------------------------------------------------- /gpsp4cute/controlsettings.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | controlsettingsClass 4 | 5 | 6 | 7 | 0 8 | 0 9 | 640 10 | 150 11 | 12 | 13 | 14 | controlsettings 15 | 16 | 17 | 18 | 19 | 0 20 | 0 21 | 640 22 | 150 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 200 36 | 80 37 | 251 38 | 61 39 | 40 | 41 | 42 | Run Key Config 43 | 44 | 45 | 46 | 47 | 48 | 10 49 | 10 50 | 281 51 | 61 52 | 53 | 54 | 55 | 56 | use 4 directions D-Pad 57 | 58 | 59 | 60 | 61 | use 8 directions D-Pad 62 | 63 | 64 | 65 | 66 | 67 | 68 | 330 69 | 10 70 | 281 71 | 61 72 | 73 | 74 | 75 | 76 | disable hidden A+B buttons 77 | 78 | 79 | 80 | 81 | enable hidden A+B buttons 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /gpsp/inc/AntAudio.h: -------------------------------------------------------------------------------- 1 | /* gpSP4Symbian 2 | * 3 | * Copyright (C) 2009 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __ANT_AUDIO_H 21 | #define __ANT_AUDIO_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | const TInt KSoundBuffers = 5; 28 | const TInt KBlockTime = 1000000 / 5; // hardcoded: 5 updates/sec 29 | const TInt KMaxLag = 260000; // max sound lag, lower values increase chanse of underflow 30 | const TInt KMaxUnderflows = 50; // max underflows/API errors we are going allow in a row (to prevent lockups) 31 | 32 | class MAudioListener; 33 | 34 | class CAntAudio : public CBase, 35 | public MMdaAudioOutputStreamCallback 36 | { 37 | public: 38 | void Reset(); 39 | TUint8* NextFrameL(); 40 | void FrameMixed(); 41 | TInt FreeBufferCount(); 42 | void Stop(); 43 | void SetVolume( TInt aVolume ); 44 | public: 45 | ~CAntAudio(); 46 | CAntAudio(TInt aRate, TBool aStereo, TInt aPcmFrames, TInt aVolume ); 47 | void ConstructL(); 48 | static CAntAudio* NewL(TInt aRate, TBool aStereo, TInt aPcmFrames, TInt aVolume ); 49 | public: 50 | void MaoscOpenComplete(TInt aError); 51 | void MaoscBufferCopied(TInt aError, const TDesC8& ); 52 | void MaoscPlayComplete(TInt aError); 53 | 54 | protected: 55 | 56 | TInt iRate; 57 | TBool iStereo; 58 | 59 | CMdaAudioOutputStream *iMdaAudioOutputStream; 60 | TMdaAudioDataSettings iMdaAudioDataSettings; 61 | 62 | HBufC8* iSoundBuffers[KSoundBuffers+1]; 63 | TInt iBufferedFrames; 64 | TUint8* iCurrentPosition; 65 | TInt iPcmFrames; 66 | CActiveSchedulerWait* iWait; 67 | 68 | RArray iEmptyBufQ; 69 | TInt iFrameCount; 70 | TInt iVolume; 71 | }; 72 | #endif //__ANT_AUDIO_H 73 | -------------------------------------------------------------------------------- /gpsp4cute/videosettings.cpp: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #include "videosettings.h" 22 | 23 | videosettings::videosettings( bool showFps, int buttonOpacity, int stretch, QWidget *parent) 24 | : QWidget(parent) 25 | { 26 | ui.setupUi(this); 27 | ui.showFPSbox->setChecked( showFps ); 28 | ui.strechSettings->setCurrentIndex( stretch ); 29 | ui.buttonOpacity->setValue( buttonOpacity ); 30 | 31 | connect(ui.showFPSbox, SIGNAL(stateChanged(int)), this, SLOT(showFPSChecked(int))); 32 | connect(ui.strechSettings, SIGNAL(currentIndexChanged(int)), this, SLOT(stretchIndexChecked(int))); 33 | connect(ui.buttonOpacity, SIGNAL(valueChanged(int)), this, SLOT(setOpacity(int))); 34 | 35 | setOpacity(buttonOpacity); 36 | } 37 | 38 | videosettings::~videosettings() 39 | { 40 | 41 | } 42 | 43 | void videosettings::showFPSChecked( int state ) 44 | { 45 | emit (showFPS( (bool) state )); 46 | } 47 | 48 | void videosettings::stretchIndexChecked( int state ) 49 | { 50 | emit (stretch( state )); 51 | } 52 | 53 | void videosettings::setOpacity(int slider) 54 | { 55 | switch ( slider ) 56 | { 57 | case 0: 58 | ui.buttonOpacityLabel->setText("0%"); 59 | break; 60 | case 1: 61 | ui.buttonOpacityLabel->setText("25%"); 62 | break; 63 | case 2: 64 | ui.buttonOpacityLabel->setText("50%"); 65 | break; 66 | case 3: 67 | ui.buttonOpacityLabel->setText("75%"); 68 | break; 69 | default: 70 | ui.buttonOpacityLabel->setText("100%"); 71 | break; 72 | } 73 | 74 | emit(buttonOpacity(slider)); 75 | } 76 | -------------------------------------------------------------------------------- /gpsp/inc/input.h: -------------------------------------------------------------------------------- 1 | /* gameplaySP 2 | * 3 | * Copyright (C) 2006 Exophase 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef INPUT_H 21 | #define INPUT_H 22 | 23 | #include "common.h" 24 | 25 | typedef enum 26 | { 27 | BUTTON_L = 0x200, 28 | BUTTON_R = 0x100, 29 | BUTTON_DOWN = 0x80, 30 | BUTTON_UP = 0x40, 31 | BUTTON_LEFT = 0x20, 32 | BUTTON_RIGHT = 0x10, 33 | BUTTON_START = 0x08, 34 | BUTTON_SELECT = 0x04, 35 | BUTTON_B = 0x02, 36 | BUTTON_A = 0x01, 37 | BUTTON_NONE = 0x00 38 | } input_buttons_type; 39 | 40 | typedef enum 41 | { 42 | BUTTON_ID_UP, 43 | BUTTON_ID_DOWN, 44 | BUTTON_ID_LEFT, 45 | BUTTON_ID_RIGHT, 46 | BUTTON_ID_A, 47 | BUTTON_ID_B, 48 | BUTTON_ID_L, 49 | BUTTON_ID_R, 50 | BUTTON_ID_START, 51 | BUTTON_ID_SELECT, 52 | BUTTON_ID_MENU, 53 | BUTTON_ID_FASTFORWARD, 54 | BUTTON_ID_LOADSTATE, 55 | BUTTON_ID_SAVESTATE, 56 | BUTTON_ID_RAPIDFIRE_A, 57 | BUTTON_ID_RAPIDFIRE_B, 58 | BUTTON_ID_RAPIDFIRE_L, 59 | BUTTON_ID_RAPIDFIRE_R, 60 | BUTTON_ID_VOLUP, 61 | BUTTON_ID_VOLDOWN, 62 | BUTTON_ID_FPS, 63 | BUTTON_ID_NONE 64 | } input_buttons_id_type; 65 | 66 | typedef enum 67 | { 68 | CURSOR_UP, 69 | CURSOR_DOWN, 70 | CURSOR_LEFT, 71 | CURSOR_RIGHT, 72 | CURSOR_SELECT, 73 | CURSOR_BACK, 74 | CURSOR_EXIT, 75 | CURSOR_NONE 76 | } gui_action_type; 77 | 78 | void init_input(); 79 | u32 update_input(); 80 | gui_action_type get_gui_input(); 81 | gui_action_type get_gui_input_fs_hold(u32 button_id); 82 | void input_write_mem_savestate(file_tag_type savestate_file); 83 | void input_read_savestate(file_tag_type savestate_file); 84 | 85 | extern u32 gamepad_config_map[16]; 86 | extern u32 global_enable_analog; 87 | extern u32 analog_sensitivity_level; 88 | 89 | #if defined(GP2X_BUILD) 90 | u32 gpsp_gp2x_joystick_read(void); 91 | #endif 92 | 93 | #endif 94 | 95 | -------------------------------------------------------------------------------- /gpsp4cute/gpspadaptation.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #ifndef GPSP_ADAPTATION_H_ 22 | #define GPSP_ADAPTATION_H_ 23 | 24 | #include 25 | 26 | #include "gpspSettings.h" 27 | #include "gpsp4Qt.h" 28 | #include "AntAudio.h" 29 | 30 | /* the gpspadapation is basically the emulation thread 31 | * it's also passing commands safely from the UI thread 32 | * into the gpsp via Qts signal/slot system */ 33 | class gpspadaptation : public QThread 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | gpspadaptation( gpsp4Qt* widget, CAntAudio* audioInterface ); 39 | ~gpspadaptation(); 40 | 41 | virtual void run(); 42 | public: 43 | void blit( const quint16* screen ); 44 | public slots: 45 | 46 | void Start(); 47 | void Stop(); 48 | void ResetGame(); 49 | void LoadRom( QString aFileName, TGPSPSettings settings ); 50 | 51 | void savegpspState( int aState ); 52 | void loadgpspState( int aState ); 53 | void exitgpsp(); 54 | 55 | public: 56 | void updateSettings( TGPSPSettings settings ); 57 | QString gameconfigpath(); 58 | QString getMainpath(); 59 | void showErrorNote( QString message ); 60 | void audioFrameMixed(); 61 | 62 | signals: 63 | void frameblit(); 64 | void dispatchErrorNote( QString message ); 65 | void audioFrameReady(); 66 | 67 | private: 68 | gpsp4Qt* m_blitter; //not owned 69 | 70 | CAntAudio* m_audio; 71 | TGPSPSettings m_settings; 72 | QString m_rom; 73 | }; 74 | 75 | 76 | // function directly from the UI to check bios file 77 | #ifdef __cplusplus 78 | extern "C" { 79 | #endif 80 | 81 | bool isBiosValid( const char* bios ); 82 | 83 | #ifdef __cplusplus 84 | }; 85 | #endif 86 | 87 | #endif /* GPSP_ADAPTATION_H_ */ 88 | -------------------------------------------------------------------------------- /gpsp4cute/AntAudio.h: -------------------------------------------------------------------------------- 1 | /* AntSnes 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef __ANT_AUDIO_H 21 | #define __ANT_AUDIO_H 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | 30 | const TInt KSoundBuffers = 4; 31 | const TInt KBlockTime = 1000000 / 5; // hardcoded: 5 updates/sec 32 | const TInt KMaxLag = 260000; // max sound lag, lower values increase chanse of underflow 33 | const TInt KMaxUnderflows = 50; // max underflows/API errors we are going allow in a row (to prevent lockups) 34 | 35 | const int KSampleRate = 44100; 36 | const int KStereo = 1; 37 | const int KFramesize = 2940; // sampleRate / 60 * 2 38 | 39 | class CAntAudio : public QObject, 40 | public MMdaAudioOutputStreamCallback 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | ~CAntAudio(); 46 | CAntAudio(); 47 | 48 | public: 49 | void setVolume( TInt aVolume ); 50 | TInt8* NextFrameL(); 51 | TInt FreeBufferCount(); 52 | void Stop(); 53 | 54 | public slots: 55 | void FrameMixed(); 56 | void Reset(); 57 | 58 | public: 59 | void MaoscOpenComplete(TInt aError); 60 | void MaoscBufferCopied(TInt aError, const TDesC8& ); 61 | void MaoscPlayComplete(TInt aError); 62 | 63 | protected: 64 | 65 | TInt iRate; 66 | TBool iStereo; 67 | 68 | CMdaAudioOutputStream *iMdaAudioOutputStream; 69 | TMdaAudioDataSettings iMdaAudioDataSettings; 70 | 71 | HBufC8* iSoundBuffers[KSoundBuffers+1]; 72 | TInt iBufferedFrames; 73 | TUint8* iCurrentPosition; 74 | TInt iPcmFrames; 75 | CActiveSchedulerWait* iWait; 76 | 77 | RArray iEmptyBufQ; 78 | TInt iFrameCount; 79 | TInt iVolume; 80 | #ifdef OUTPUT_TO_FILE 81 | RFile iFile; 82 | RFs iFs; 83 | #endif 84 | }; 85 | #endif //__ANT_AUDIO_H 86 | -------------------------------------------------------------------------------- /gpsp4cute/keyconfigdialog.cpp: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #include "keyconfigdialog.h" 22 | 23 | #include "cuteDebug.h" 24 | //include the config file 25 | 26 | keyconfigdialog::keyconfigdialog(QWidget *parent) 27 | : QWidget(parent) 28 | { 29 | ui.setupUi(this); 30 | 31 | connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked())); 32 | round = 0; 33 | } 34 | 35 | keyconfigdialog::~keyconfigdialog() 36 | { 37 | 38 | } 39 | 40 | void keyconfigdialog::keyPressEvent( QKeyEvent * event) 41 | { 42 | updateText(); 43 | 44 | if( event->key() != 0 ) 45 | { 46 | __DEBUG2("keyPressEvent: native scancode is:", event->nativeScanCode()); 47 | scanKeyTable[round] = event->nativeScanCode(); 48 | } 49 | 50 | if( round == 9 ) 51 | emit(configDone()); 52 | 53 | round++; 54 | } 55 | 56 | void keyconfigdialog::cancelClicked() 57 | { 58 | updateText(); 59 | scanKeyTable[round] = 0; 60 | if( round == 9 ) 61 | emit(configDone()); 62 | round++; 63 | 64 | } 65 | 66 | quint32 keyconfigdialog::getKeyBind( int key ) 67 | { 68 | return scanKeyTable[key]; 69 | } 70 | 71 | void keyconfigdialog::updateText() 72 | { 73 | switch( round ) 74 | { 75 | case 0: 76 | ui.keyLabel->setText("Press Down, or \n Press Skip to skip this button"); 77 | break; 78 | case 1: 79 | ui.keyLabel->setText("Press Left, or \n Press Skip to skip this button"); 80 | break; 81 | case 2: 82 | ui.keyLabel->setText("Press Right, or \n Press Skip to skip this button"); 83 | break; 84 | case 3: 85 | ui.keyLabel->setText("Press A button, or \n Press Skip to skip this button"); 86 | break; 87 | case 4: 88 | ui.keyLabel->setText("Press B button, or \n Press Skip to skip this button"); 89 | break; 90 | case 5: 91 | ui.keyLabel->setText("Press L button, or \n Press Skip to skip this button"); 92 | break; 93 | case 6: 94 | ui.keyLabel->setText("Press R button, or \n Press Skip to skip this button"); 95 | break; 96 | case 7: 97 | ui.keyLabel->setText("Press START button, or \n Press Skip to skip this button"); 98 | break; 99 | case 8: 100 | ui.keyLabel->setText("Press SELECT button, or \n Press Skip to skip this button"); 101 | break; 102 | case 9: 103 | break; 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /gpsp4cute/QRemoteControlKeys.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #ifndef QREMOTECONTROLKEYS_H_ 22 | #define QREMOTECONTROLKEYS_H_ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include // link against RemConCoreApi.lib 29 | #include // and 30 | #include // RemConInterfaceBase.lib 31 | 32 | class QRemoteControlKeys: public QObject, public CActive, public MRemConCoreApiTargetObserver 33 | { 34 | Q_OBJECT 35 | public: 36 | QRemoteControlKeys(); 37 | virtual ~QRemoteControlKeys(); 38 | 39 | public: 40 | void subscribeKeyEvent(QObject* aObject ); 41 | 42 | public: //From MRemConCoreApiTargetObserver 43 | void MrccatoCommand(TRemConCoreApiOperationId aOperationId, 44 | TRemConCoreApiButtonAction aButtonAct); 45 | 46 | void MrccatoPlay(TRemConCoreApiPlaybackSpeed aSpeed, 47 | TRemConCoreApiButtonAction aButtonAct); 48 | 49 | void MrccatoTuneFunction(TBool aTwoPart, 50 | TUint aMajorChannel, 51 | TUint aMinorChannel, 52 | TRemConCoreApiButtonAction aButtonAct); 53 | 54 | void MrccatoSelectDiskFunction(TUint aDisk, 55 | TRemConCoreApiButtonAction aButtonAct); 56 | 57 | void MrccatoSelectAvInputFunction(TUint8 aAvInputSignalNumber, 58 | TRemConCoreApiButtonAction aButtonAct); 59 | 60 | void MrccatoSelectAudioInputFunction(TUint8 aAudioInputSignalNumber, 61 | TRemConCoreApiButtonAction aButtonAct); 62 | 63 | private: 64 | void CompleteMediaKeyEvent( TRemConCoreApiOperationId aOperationId ); 65 | void RunL(); 66 | void DoCancel(); 67 | 68 | public slots: 69 | void playtimerexpired(); 70 | void stoptimerexpired(); 71 | void forwardtimerexpired(); 72 | void backwardtimerexpired(); 73 | void voluptimerexpired(); 74 | void voldowntimerexpired(); 75 | private: 76 | 77 | RArray iResponseQ; //response queue 78 | 79 | CRemConCoreApiTarget* iRemConCore; //the controller 80 | CRemConInterfaceSelector* iInterfaceSelector; 81 | 82 | QObject* receiver; 83 | 84 | QTimer* playtimer; 85 | QTimer* stoptimer; 86 | QTimer* forwardtimer; 87 | QTimer* backwardtimer; 88 | QTimer* voluptimer; 89 | QTimer* voldowntimer; 90 | }; 91 | 92 | #endif /* QREMOTECONTROLKEYS_H_ */ 93 | -------------------------------------------------------------------------------- /gpsp/inc/video.h: -------------------------------------------------------------------------------- 1 | /* gameplaySP 2 | * 3 | * Copyright (C) 2006 Exophase 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef VIDEO_H 21 | #define VIDEO_H 22 | 23 | void update_scanline(); 24 | void update_screen(); 25 | void init_video(); 26 | void video_resolution_large(); 27 | void video_resolution_small(); 28 | void print_string(const char *str, u16 fg_color, u16 bg_color, 29 | u32 x, u32 y); 30 | void print_string_pad(const char *str, u16 fg_color, u16 bg_color, 31 | u32 x, u32 y, u32 pad); 32 | void print_string_ext(const char *str, u16 fg_color, u16 bg_color, 33 | u32 x, u32 y, void *_dest_ptr, u32 pitch, u32 pad); 34 | void clear_screen(u16 color); 35 | void blit_to_screen(u16 *src, u32 w, u32 h, u32 x, u32 y); 36 | u16 *copy_screen(); 37 | void flip_screen(); 38 | void video_write_mem_savestate(file_tag_type savestate_file); 39 | void video_read_savestate(file_tag_type savestate_file); 40 | 41 | void debug_screen_clear(); 42 | void debug_screen_start(); 43 | void debug_screen_end(); 44 | void debug_screen_printf(const char *format, ...); 45 | void debug_screen_printl(const char *format, ...); 46 | void debug_screen_newline(u32 count); 47 | void debug_screen_update(); 48 | 49 | extern u32 frame_speed; 50 | 51 | extern s32 affine_reference_x[2]; 52 | extern s32 affine_reference_y[2]; 53 | 54 | typedef void (* tile_render_function)(u32 layer_number, u32 start, u32 end, 55 | void *dest_ptr); 56 | typedef void (* bitmap_render_function)(u32 start, u32 end, void *dest_ptr); 57 | 58 | typedef struct 59 | { 60 | tile_render_function normal_render_base; 61 | tile_render_function normal_render_transparent; 62 | tile_render_function alpha_render_base; 63 | tile_render_function alpha_render_transparent; 64 | tile_render_function color16_render_base; 65 | tile_render_function color16_render_transparent; 66 | tile_render_function color32_render_base; 67 | tile_render_function color32_render_transparent; 68 | } tile_layer_render_struct; 69 | 70 | typedef struct 71 | { 72 | bitmap_render_function normal_render; 73 | } bitmap_layer_render_struct; 74 | 75 | typedef enum 76 | { 77 | unscaled, 78 | scaled_aspect, 79 | fullscreen, 80 | } video_scale_type; 81 | 82 | typedef enum 83 | { 84 | filter_nearest, 85 | filter_bilinear 86 | } video_filter_type; 87 | 88 | extern video_scale_type screen_scale; 89 | extern video_scale_type current_scale; 90 | extern video_filter_type screen_filter; 91 | 92 | void set_gba_resolution(video_scale_type scale); 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /gpsp/src/relocator_glue.s: -------------------------------------------------------------------------------- 1 | @ 2 | @ TheRelocator, dynamic text segment relocation routine v1.0 for SymbianOS. 3 | @ Copyright (C) 2009,2010 Olli Hinkka 4 | @ 5 | @ This program is free software; you can redistribute it and/or 6 | @ modify it under the terms of the GNU General Public License 7 | @ as published by the Free Software Foundation; version 2 8 | @ of the License. 9 | @ 10 | @ This program is distributed in the hope that it will be useful, 11 | @ but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | @ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | @ GNU General Public License for more details. 14 | @ 15 | @ You should have received a copy of the GNU General Public License 16 | @ along with this program; if not, write to the Free Software 17 | @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | @ 19 | 20 | 21 | .align 2 22 | 23 | .global _ZN12TheRelocatorC1EPv 24 | .global _ZN12TheRelocatorD1Ev 25 | .global __begin_relocated_code 26 | .global __end_relocated_code 27 | 28 | .global _ZN12TheRelocator8RelocateEPv 29 | .global _ZN11RHandleBase5CloseEv 30 | .global _Znwj 31 | .global _ZdlPv 32 | 33 | 34 | @AREA ||.text||, CODE, READONLY, ALIGN=2 35 | .text 36 | 37 | @ TheRelocator::TheRelocator(TAny* aTargetAddr) 38 | _ZN12TheRelocatorC1EPv: 39 | push {r4} 40 | mov r2,#0 41 | mov r4,r0 42 | str r2,[r0,#8] 43 | push {lr} 44 | bl _ZN12TheRelocator8RelocateEPv 45 | pop {lr} 46 | ldmia r4,{r1,r2} 47 | sub lr,r1 48 | add lr,r2 49 | mov r0,r4 50 | pop {r4} 51 | bx lr 52 | 53 | @ TheRelocator::~TheRelocator() 54 | _ZN12TheRelocatorD1Ev: 55 | push {r4} 56 | ldr r1,[r0,#4] 57 | ldr r2,[r0,#0] 58 | mov r4,r0 59 | sub lr,r1 60 | add lr,r2 61 | add r0,r4,#8 62 | push {lr} 63 | adr lr,trg 64 | sub lr,r1 65 | add lr,r2 66 | bx lr 67 | trg: bl _ZN11RHandleBase5CloseEv 68 | pop {lr} 69 | mov r0,r4 70 | pop {r4} 71 | bx lr 72 | 73 | 74 | 75 | __begin_relocated_code: 76 | push {r4-r6} 77 | mov r5,r0 78 | mov r0,#0xc 79 | push {lr} 80 | bl _Znwj 81 | pop {lr} 82 | movs r4,r0 83 | popeq {r4-r6} 84 | bxeq lr 85 | mov r1,r5 86 | pop {r4-r6} 87 | b _ZN12TheRelocatorC1EPv 88 | 89 | 90 | __end_relocated_code: 91 | cmp r0,#0 92 | bxeq lr 93 | push {r4} 94 | ldr r1,[r0,#4] 95 | ldr r2,[r0,#0] 96 | mov r4,r0 97 | sub lr,r1 98 | add lr,r2 99 | add r0,r4,#8 100 | push {lr} 101 | adr lr,trg2 102 | sub lr,r1 103 | add lr,r2 104 | bx lr 105 | trg2: bl _ZN11RHandleBase5CloseEv 106 | pop {lr} 107 | mov r0,r4 108 | pop {r4} 109 | b _ZdlPv 110 | 111 | 112 | -------------------------------------------------------------------------------- /gpsp4cute/style/summelistyle.qss: -------------------------------------------------------------------------------- 1 | /* The background of the tab bar */ 2 | QMainWindow { 3 | background: #1e1e1e; 4 | color: #F8F8F8; 5 | padding: 0; 6 | margin: 0; 7 | border: 0; 8 | } 9 | 10 | QWidget { 11 | background: #1e1e1e; 12 | color: #F8F8F8; 13 | padding: 0; 14 | margin: 0; 15 | border: 0; 16 | } 17 | 18 | QStackedWidget { 19 | padding: 0; 20 | margin: 0; 21 | } 22 | 23 | /* Dialogs */ 24 | QDialog { 25 | background: #1e1e1e; 26 | color: #F8F8F8; 27 | padding: 0; 28 | margin: 0; 29 | border: 1px solid #666; 30 | } 31 | 32 | /* Form fields */ 33 | QLabel { 34 | background: #1e1e1e; 35 | padding: 0; 36 | margin: 0; 37 | } 38 | 39 | 40 | QCheckBox { 41 | background: none; 42 | color: #F8F8F8; 43 | } 44 | 45 | 46 | QCheckBox:focus { 47 | color: #F8F8F8; 48 | } 49 | 50 | 51 | QLineEdit, QTextEdit { 52 | border: 1px solid gray; 53 | background: none; 54 | padding: 0.2em; 55 | color: #F8F8F8; 56 | border-radius: 3px; 57 | } 58 | 59 | 60 | QLineEdit:focus, QTextEdit:focus { 61 | border: 1px solid black; 62 | color: black; 63 | } 64 | 65 | /* fun color to use with some texts 66 | color: #75ffb2; */ 67 | /* background: #333;*/ 68 | QPushButton { 69 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 70 | stop: 0 #333, stop: 0.49 #555, 71 | stop: 0.50 #333, stop: 1.0 #555); 72 | border: 1px solid #666; 73 | padding: 0.4em; 74 | color: #F8F8F8; 75 | font: normal normal 6pt; 76 | border-radius: 3px; 77 | } 78 | 79 | /*TODO: use this same color in other places too*/ 80 | QPushButton:pressed { 81 | background: #292929; 82 | } 83 | 84 | 85 | /* QComboBox/QDateTime specials */ 86 | QComboBox, QDateTimeEdit { 87 | background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 88 | stop: 0 #333, stop: 0.49 #555, 89 | stop: 0.50 #333, stop: 1.0 #555); 90 | border: 1px solid #666; 91 | padding: 0.4em; 92 | color: #F8F8F8; 93 | font: normal normal 6pt; 94 | border-radius: 3px; 95 | } 96 | 97 | 98 | QComboBox:focus, QDateTimeEdit:focus { 99 | border: 1px solid #666; 100 | color: #F8F8F8; 101 | } 102 | 103 | 104 | QComboBox::drop-down, QDateTimeEdit::drop-down { 105 | border: 1px solid #666; 106 | margin: -1px; 107 | border: 1px solid gray; 108 | width: 1.3em; 109 | border-radius: 3px; 110 | } 111 | 112 | 113 | QComboBox::down-arrow, QDateTimeEdit::down-arrow { 114 | image: url(:/graphics/gfx/downarrow.png); 115 | } 116 | 117 | QSlider::groove:horizontal { 118 | border: 1px solid #333; 119 | background: #555; 120 | margin: 2px 0; 121 | } 122 | 123 | QSlider::handle:horizontal { 124 | background: #75ffb2; 125 | border: 1px solid #F8F8F8; 126 | width: 18px; 127 | margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */ 128 | border-radius: 3px; 129 | } 130 | 131 | QGroupBox { 132 | background: #1e1e1e; 133 | padding: 0; 134 | margin: 0; 135 | border: 1px solid #666; 136 | color: #F8F8F8; 137 | } 138 | 139 | QGroupBox::title { 140 | subcontrol-origin: margin; 141 | subcontrol-position: top left; /* position at the top left */ 142 | padding: 0 3px; 143 | background-color: #1e1e1e; 144 | color: #F8F8F8; 145 | } 146 | -------------------------------------------------------------------------------- /gpsp4cute/audiosettings.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AudioSettingsClass 4 | 5 | 6 | true 7 | 8 | 9 | 10 | 0 11 | 0 12 | 640 13 | 150 14 | 15 | 16 | 17 | Qt::DefaultContextMenu 18 | 19 | 20 | AudioSettings 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 0 29 | 0 30 | 640 31 | 150 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 180 45 | 90 46 | 211 47 | 51 48 | 49 | 50 | 51 | 52 | Audio Off 53 | 54 | 55 | 56 | 57 | Audio On 58 | 59 | 60 | 61 | 62 | 63 | 64 | 10 65 | 10 66 | 621 67 | 71 68 | 69 | 70 | 71 | Volume 72 | 73 | 74 | 75 | 76 | 20 77 | 20 78 | 521 79 | 41 80 | 81 | 82 | 83 | 10 84 | 85 | 86 | 1 87 | 88 | 89 | 4 90 | 91 | 92 | 4 93 | 94 | 95 | Qt::Horizontal 96 | 97 | 98 | 99 | 100 | 101 | 550 102 | 20 103 | 61 104 | 37 105 | 106 | 107 | 108 | 109 | 0 110 | 0 111 | 112 | 113 | 114 | 115 | 35 116 | 0 117 | 118 | 119 | 120 | 100 % 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /gpsp4cute/emusettings.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef EMUSETTINGS_H 21 | #define EMUSETTINGS_H 22 | 23 | #include 24 | #include "ui_emusettings.h" 25 | #include "keyconfigdialog.h" 26 | #include "audiosettings.h" 27 | #include "gpspSettings.h" 28 | 29 | #include "qremotecontrolkeys.h" 30 | #include "videosettings.h" 31 | #include "controlsettings.h" 32 | #include "aboutdialog.h" 33 | #include "filewidget.h" 34 | #include "gpspadaptation.h" 35 | #include "cuteErrorDialog.h" 36 | 37 | class EmuSettings : public QMainWindow 38 | { 39 | Q_OBJECT 40 | 41 | enum 42 | { 43 | EEmptyWidget = 0, 44 | EMainWidget = 1, 45 | EAudioWidget = 2, 46 | EVideoWidget = 3, 47 | EKeyWidget = 4, 48 | EFileWidget = 5 49 | }; 50 | public: 51 | EmuSettings(QWidget *parent = 0); 52 | ~EmuSettings(); 53 | 54 | public: 55 | void setRemoteControl( QRemoteControlKeys* remote ); 56 | 57 | public slots: 58 | void loadROM(); 59 | void setBios(); 60 | void showFileMenu(); 61 | void keyConfig(); 62 | void DPadSettings( int settings ); 63 | void ButtonSettings( int settings ); 64 | void showFPS( bool showFPS ); 65 | void stretch( int stretch ); 66 | void buttonOpacity( int opacity ); 67 | void keyconfigDone(); 68 | void exit(); 69 | void resetButtonClicked(); 70 | void continueClicked(); 71 | void aboutClicked(); 72 | void saveSlotIndexChanged( int index ); 73 | 74 | //states 75 | void loadStateButtonClicked(); 76 | void saveStateButtonClicked(); 77 | 78 | //Audio Settings 79 | void showAudioSettings(); 80 | void setAudioOn( int audioOn ); 81 | void setVolume( int volume ); 82 | 83 | //Video Settings 84 | void showVideoSettings(); 85 | 86 | void showControlSettings(); 87 | void closeAboutDialog(); 88 | 89 | void errorNoteDismissed(); 90 | signals: 91 | void LoadROM( QString rom, TGPSPSettings antSettings ); 92 | void LoadState( int state ); 93 | void SaveState( int state ); 94 | void resetGame(); 95 | void continueGame(); 96 | void updateSettings( TGPSPSettings ); 97 | 98 | private: 99 | void hidecurrentWidget(); 100 | void setDefaultSettings(); 101 | void savecurrentSettings(); 102 | void loadSettings(); 103 | 104 | private: 105 | Ui::EmuSettingsClass ui; 106 | keyconfigdialog* keydialog; 107 | AudioSettings* audiosettings; 108 | videosettings* antvideosettings; 109 | controlsettings* keysettings; 110 | filewidget* fileview; 111 | aboutdialog* about; 112 | 113 | int currentWidget; 114 | bool romloaded; 115 | 116 | bool settingsChanged; 117 | TGPSPSettings gpspsettings; 118 | QRemoteControlKeys* remotecontrol; 119 | cuteErrorDialog* errorDialog; 120 | }; 121 | 122 | #endif // EMUSETTINGS_H 123 | -------------------------------------------------------------------------------- /gpsp4cute/gpsp4Qt.h: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | 21 | #ifndef GPSP4QT_H 22 | #define GPSP4QT_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include "dpadwidget.h" 32 | #include "gpspSettings.h" 33 | #include "MEmulatorAdaptation.h" 34 | #include "QRemoteControlKeys.h" 35 | #include "cuteErrorDialog.h" 36 | #include "AntAudio.h" 37 | #include "dpadwidget.h" 38 | #include "rightbuttonwidget.h" 39 | 40 | class gpspadaptation; 41 | 42 | /* This class is the UI controller in the UI thread side 43 | * it's only purpose is to keep things in order in the UI 44 | * thread side */ 45 | class gpsp4Qt : public QWidget, MEmulatorAdaptation 46 | { 47 | Q_OBJECT 48 | 49 | public: 50 | gpsp4Qt(QWidget *parent = 0); 51 | ~gpsp4Qt(); 52 | 53 | public: 54 | void setRemoteControl( QRemoteControlKeys* remote ); 55 | void keyPressEvent( QKeyEvent * event); 56 | void keyReleaseEvent(QKeyEvent* event); 57 | bool event(QEvent *event); 58 | 59 | //rendering stuff 60 | public slots: 61 | void render(); 62 | 63 | protected: 64 | void paintEvent(QPaintEvent *); 65 | 66 | public: //From MEmulatorAdaptation 67 | quint32 getGpspKeys(); 68 | 69 | public: 70 | void LoadROM(QString rom, TGPSPSettings antSettings); 71 | void LoadState( int state ); 72 | void SaveState( int state ); 73 | void reset(); 74 | void continueGame(); 75 | 76 | signals: 77 | void Start(); 78 | void Stop(); 79 | void doLoadROM(QString rom, TGPSPSettings antSettings); 80 | void showmenu(); 81 | void saveState(int state); 82 | void loadState( int state); 83 | void resetgpsp(); 84 | void exitgpsp(); 85 | 86 | 87 | public slots: 88 | void showAntSnesMenu(); 89 | void updateSettings( TGPSPSettings ); 90 | void showErrorNote( QString message ); 91 | void errorNoteDismissed(); 92 | 93 | private slots: 94 | void listencontrols(); 95 | 96 | private: 97 | void LoadButtons(); 98 | void ApplyTransparency(QPixmap &pm, QString png); 99 | 100 | private: 101 | CAntAudio* m_audio; 102 | TGPSPSettings m_settings; 103 | QRemoteControlKeys* m_remotecontrol; 104 | DPadWidget* m_dpad; 105 | gpspadaptation* m_adaptation; 106 | QString m_currentROM; 107 | cuteErrorDialog* m_errorDialog; 108 | rightbuttonwidget* m_rightButtons; 109 | 110 | quint32 m_softKeys; 111 | quint32 m_hardKeys; 112 | 113 | //drawing 114 | QImage* m_buf; 115 | QPixmap m_dpadGraphics; 116 | QPixmap m_buttonsGraphics; 117 | QPixmap m_tlGraphics; 118 | QPixmap m_trGraphics; 119 | QPixmap m_menuGraphics; 120 | QPixmap m_startSelectGraphics; 121 | int m_buttonOpacity; 122 | int m_stretch; 123 | int m_screenHeight; 124 | }; 125 | 126 | #endif // GPSP4QT_H 127 | -------------------------------------------------------------------------------- /gpsp4cute/rightbuttonwidget.cpp: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2011 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "rightbuttonwidget.h" 21 | #include "buttonpositions.h" 22 | #include "input.h" 23 | 24 | #include 25 | 26 | const int KCenter_x = 85; 27 | const int KCenter_y = 275; 28 | 29 | const int BUTTONS_CENTER_RIGHT = KCenter_x + 10; 30 | const int BUTTONS_CENTER_LEFT = KCenter_x - 10; 31 | const int BUTTONS_CENTER_TOP = KCenter_y - 10; 32 | const int BUTTONS_CENTER_BOTTOM = KCenter_y + 10; 33 | 34 | const int BUTTONS_TOP = 200 - 30; 35 | 36 | const int SELECT_LEFT = BUTTON_WIDTH - SMALLBUTTON_WIDTH / 2; 37 | const int R_TOP = MENU_HEIGHT + SMALLBUTTON_HEIGHT; 38 | 39 | rightbuttonwidget::rightbuttonwidget(QObject *parent) 40 | : QObject(parent), m_buttonSettings(0) 41 | { 42 | } 43 | 44 | rightbuttonwidget::~rightbuttonwidget() 45 | { 46 | 47 | } 48 | 49 | 50 | quint32 rightbuttonwidget::getGpspKeys( int x, int y ) 51 | { 52 | quint32 key = 0; 53 | if( y <= MENU_HEIGHT ) 54 | { 55 | //select or start was pressed 56 | if( x > SELECT_LEFT ) 57 | key = BUTTON_SELECT; 58 | else 59 | key = BUTTON_START; 60 | } 61 | else if( y > MENU_HEIGHT && y <= R_TOP ) 62 | { 63 | //R was pressed 64 | key = BUTTON_R; 65 | } 66 | 67 | else if ((y > BUTTONS_CENTER_TOP ) && (y < BUTTONS_CENTER_BOTTOM ) && (x > BUTTONS_CENTER_LEFT ) 68 | && (x < BUTTONS_CENTER_RIGHT )) 69 | { 70 | // Inside center circle of dpad, let's return both A and B 71 | key += BUTTON_B; 72 | key += BUTTON_A; 73 | } 74 | else if ( y > BUTTONS_TOP ) 75 | { 76 | qreal x_coord = x - KCenter_x; 77 | qreal y_coord = y - KCenter_y; 78 | 79 | qreal r = qAtan2(y_coord,x_coord); 80 | 81 | r = (r * 180 )/ KPi; //convert radians to degrees 82 | 83 | //lets use full circle instead of negative angles 84 | if (r < 0) 85 | { 86 | r = 360 + r; 87 | } 88 | 89 | qint32 angle = qRound(r); 90 | 91 | 92 | //360 degrees is divided into 2 sectors. 93 | /* if (angle >= 226|| angle < 55 ) 94 | { 95 | //A button was pressed 96 | key += BUTTON_A; 97 | } 98 | else 99 | { 100 | key += BUTTON_B; 101 | }*/ 102 | //360 degrees is divided into 2 sectorss 103 | if (angle >= 248|| angle < 23) 104 | { 105 | //A button was pressed 106 | key += BUTTON_A; 107 | } 108 | else if (angle >= 23 && angle < 68 && m_buttonSettings ) 109 | { 110 | //A and B key was pressed 111 | key += BUTTON_B; 112 | key += BUTTON_A; 113 | } 114 | else if (angle >= 68 && angle < 203) 115 | { 116 | //B key was pressed 117 | key += BUTTON_B; 118 | } 119 | else if (angle >= 203 && angle < 248 && m_buttonSettings ) 120 | { 121 | //A and B key was pressed 122 | key += BUTTON_B; 123 | key += BUTTON_A; 124 | } 125 | } 126 | return key; 127 | } 128 | 129 | void rightbuttonwidget::setButtonSettings( int buttonSettings ) 130 | { 131 | m_buttonSettings = buttonSettings; 132 | } 133 | -------------------------------------------------------------------------------- /gpsp/src/zip.c: -------------------------------------------------------------------------------- 1 | /* gameplaySP 2 | * 3 | * Copyright (C) 2006 Exophase 4 | * Copyright (C) 2006 SiberianSTAR 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License as 8 | * published by the Free Software Foundation; either version 2 of 9 | * the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include 22 | #include "common.h" 23 | 24 | #define ZIP_BUFFER_SIZE (128 * 1024) 25 | 26 | struct SZIPFileDataDescriptor 27 | { 28 | s32 CRC32; 29 | s32 CompressedSize; 30 | s32 UncompressedSize; 31 | } __attribute__((packed)); 32 | 33 | struct SZIPFileHeader 34 | { 35 | char Sig[4]; // EDIT: Used to be s32 Sig; 36 | s16 VersionToExtract; 37 | s16 GeneralBitFlag; 38 | s16 CompressionMethod; 39 | s16 LastModFileTime; 40 | s16 LastModFileDate; 41 | struct SZIPFileDataDescriptor DataDescriptor; 42 | s16 FilenameLength; 43 | s16 ExtraFieldLength; 44 | } __attribute__((packed)); 45 | 46 | u32 load_file_zip(char *filename) 47 | { 48 | struct SZIPFileHeader data; 49 | u8 tmp[1024]; 50 | s32 retval = -1; 51 | u8 *buffer = NULL; 52 | u8 *cbuffer; 53 | u8 *ext; 54 | 55 | file_open(fd, filename, read); 56 | 57 | if(!file_check_valid(fd)) 58 | return -1; 59 | 60 | #if 0 // EDIT: Why this while(1) is used is unknown and can cause a crash. 61 | while(1) 62 | #endif 63 | { 64 | file_read(fd, &data, sizeof(struct SZIPFileHeader)); 65 | 66 | // EDIT: Check if this is a zip file without worrying about endian 67 | // It checks for the following: 0x50 0x4B 0x03 0x04 (PK..) 68 | // Used to be: if(data.Sig != 0x04034b50) break; 69 | if( data.Sig[0] != 0x50 || data.Sig[1] != 0x4B || 70 | data.Sig[2] != 0x03 || data.Sig[3] != 0x04 ) 71 | { 72 | goto outcode; 73 | } 74 | 75 | file_read(fd, tmp, data.FilenameLength); 76 | tmp[data.FilenameLength] = 0; // end string 77 | 78 | if(data.ExtraFieldLength) 79 | file_seek(fd, data.ExtraFieldLength, SEEK_CUR); 80 | 81 | if(data.GeneralBitFlag & 0x0008) 82 | { 83 | file_read(fd, &data.DataDescriptor, 84 | sizeof(struct SZIPFileDataDescriptor)); 85 | } 86 | 87 | ext = strrchr(tmp, '.') + 1; 88 | 89 | // file is too big 90 | if(data.DataDescriptor.UncompressedSize > gamepak_ram_buffer_size) 91 | goto outcode; 92 | 93 | if(!strcasecmp(ext, "bin") || !strcasecmp(ext, "gba")) 94 | { 95 | buffer = gamepak_rom; 96 | 97 | // ok, found 98 | switch(data.CompressionMethod) 99 | { 100 | case 0: 101 | retval = data.DataDescriptor.UncompressedSize; 102 | file_read(fd, buffer, retval); 103 | 104 | goto outcode; 105 | 106 | case 8: 107 | { 108 | z_stream stream; 109 | s32 err; 110 | 111 | cbuffer = malloc(ZIP_BUFFER_SIZE); 112 | 113 | stream.next_in = (Bytef*)cbuffer; 114 | stream.avail_in = (u32)ZIP_BUFFER_SIZE; 115 | 116 | stream.next_out = (Bytef*)buffer; 117 | 118 | // EDIT: Now uses proper conversion of data types for retval. 119 | retval = (u32)data.DataDescriptor.UncompressedSize; 120 | stream.avail_out = data.DataDescriptor.UncompressedSize; 121 | 122 | stream.zalloc = (alloc_func)0; 123 | stream.zfree = (free_func)0; 124 | 125 | err = inflateInit2(&stream, -MAX_WBITS); 126 | 127 | file_read(fd, cbuffer, ZIP_BUFFER_SIZE); 128 | 129 | if(err == Z_OK) 130 | { 131 | while(err != Z_STREAM_END) 132 | { 133 | err = inflate(&stream, Z_SYNC_FLUSH); 134 | if(err == Z_BUF_ERROR) 135 | { 136 | stream.avail_in = ZIP_BUFFER_SIZE; 137 | stream.next_in = (Bytef*)cbuffer; 138 | file_read(fd, cbuffer, ZIP_BUFFER_SIZE); 139 | } 140 | } 141 | err = Z_OK; 142 | inflateEnd(&stream); 143 | } 144 | free(cbuffer); 145 | goto outcode; 146 | } 147 | } 148 | } 149 | } 150 | 151 | outcode: 152 | file_close(fd); 153 | 154 | return retval; 155 | } 156 | -------------------------------------------------------------------------------- /gpsp4cute/viewcontroller.cpp: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "viewcontroller.h" 21 | #include "cuteDebug.h" 22 | 23 | // Needed Symbian specific headers 24 | #ifdef Q_OS_SYMBIAN 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #endif 31 | 32 | ViewController::ViewController() 33 | { 34 | 35 | #if defined(Q_OS_SYMBIAN) 36 | CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); 37 | TRAPD(error, 38 | if (appUi) { 39 | // Lock application orientation into landscape 40 | appUi->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape); 41 | appUi->SetKeyEventFlags(CAknAppUi::EDisableSendKeyShort|CAknAppUi::EDisableSendKeyLong); 42 | 43 | } 44 | ); 45 | 46 | iMenuKeyHandle = CEikonEnv::Static()->RootWin().CaptureKeyUpAndDowns(EStdKeyMenu, 0, 0); 47 | iMenuKeyHandle2 = CEikonEnv::Static()->RootWin().CaptureKeyUpAndDowns(EStdKeyApplication0, 0, 0); 48 | iNoKeyHandle = CEikonEnv::Static()->RootWin().CaptureKeyUpAndDowns(EStdKeyNo, 0, 0); 49 | iNoKeyHandle2 = CEikonEnv::Static()->RootWin().CaptureKey( EKeyNo, 0, 0 ); 50 | iCameraKeyHandle = CEikonEnv::Static()->RootWin().CaptureKey( EKeyDevice7, 0, 0 ); 51 | 52 | #endif 53 | 54 | remotekeys = new QRemoteControlKeys(); 55 | 56 | emuView = new gpsp4Qt(); 57 | //emuView->setGeometry(QRect(0, 0, 640, 360)); 58 | emuView->setRemoteControl( remotekeys ); 59 | emuView->hide(); 60 | 61 | settingsView = new EmuSettings(); 62 | settingsView->setRemoteControl( remotekeys ); 63 | settingsView->show(); 64 | 65 | connect(settingsView, SIGNAL(LoadROM( QString,TGPSPSettings)), this, SLOT(loadROM( QString,TGPSPSettings))); 66 | 67 | connect(settingsView, SIGNAL(LoadState( int )), this, SLOT(LoadState( int ))); 68 | connect(settingsView, SIGNAL(SaveState( int )), this, SLOT(SaveState( int ))); 69 | connect(settingsView, SIGNAL(resetGame()), this, SLOT(reset())); 70 | connect(settingsView, SIGNAL(continueGame()), this, SLOT(continueGame())); 71 | 72 | connect(settingsView, SIGNAL(updateSettings(TGPSPSettings)), emuView, SLOT(updateSettings(TGPSPSettings))); 73 | 74 | connect(emuView, SIGNAL(showmenu()), this, SLOT(showSettings())); 75 | } 76 | 77 | ViewController::~ViewController() 78 | { 79 | delete remotekeys; 80 | delete settingsView; 81 | delete emuView; 82 | #if defined(Q_OS_SYMBIAN) 83 | CEikonEnv::Static()->RootWin().CancelCaptureKeyUpAndDowns(iMenuKeyHandle); 84 | CEikonEnv::Static()->RootWin().CancelCaptureKeyUpAndDowns(iMenuKeyHandle2); 85 | CEikonEnv::Static()->RootWin().CancelCaptureKeyUpAndDowns(iNoKeyHandle); 86 | CEikonEnv::Static()->RootWin().CancelCaptureKey(iCameraKeyHandle); 87 | CEikonEnv::Static()->RootWin().CancelCaptureKey(iNoKeyHandle2); 88 | #endif 89 | } 90 | 91 | 92 | void ViewController::loadROM( QString rom, TGPSPSettings antSettings ) 93 | { 94 | __DEBUG_IN 95 | 96 | settingsView->hide(); 97 | emuView->show(); 98 | 99 | emuView->LoadROM( rom, antSettings ); 100 | 101 | __DEBUG_OUT 102 | } 103 | 104 | void ViewController::showSettings() 105 | { 106 | emuView->hide(); 107 | settingsView->show(); 108 | } 109 | 110 | void ViewController::LoadState( int state ) 111 | { 112 | __DEBUG_IN 113 | settingsView->hide(); 114 | emuView->show(); 115 | 116 | emuView->LoadState( state ); 117 | __DEBUG_OUT 118 | } 119 | 120 | void ViewController::SaveState( int state ) 121 | { 122 | __DEBUG_IN 123 | settingsView->hide(); 124 | emuView->show(); 125 | 126 | emuView->SaveState( state ); 127 | __DEBUG_OUT 128 | } 129 | 130 | void ViewController::reset() 131 | { 132 | __DEBUG_IN 133 | settingsView->hide(); 134 | emuView->show(); 135 | 136 | emuView->reset(); 137 | __DEBUG_OUT 138 | } 139 | 140 | void ViewController::continueGame() 141 | { 142 | __DEBUG_IN 143 | settingsView->hide(); 144 | emuView->show(); 145 | 146 | emuView->continueGame(); 147 | __DEBUG_OUT 148 | } 149 | -------------------------------------------------------------------------------- /gpsp/src/symbian_memory_handler.cpp: -------------------------------------------------------------------------------- 1 | /* gpSP4Symbian 2 | * 3 | * Copyright (C) 2009 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | #ifdef __SYMBIAN32__ 20 | 21 | #include 22 | 23 | #include "symbian_memory_handler.h" 24 | #include "cpu.h" 25 | #include "debug.h" 26 | 27 | static RChunk* g_code_chunk = NULL; 28 | static RHeap* g_code_heap = NULL; 29 | 30 | 31 | extern u8* rom_translation_cache; 32 | extern u8* ram_translation_cache; 33 | extern u8* bios_translation_cache; 34 | 35 | extern u8* rom_translation_ptr; 36 | extern u8* ram_translation_ptr; 37 | extern u8* bios_translation_ptr; 38 | 39 | #define KDistanceFromCodeSection 0x200000 40 | 41 | 42 | //in Symbian we have to tell to the OS that these memoryblocks contains codes, 43 | //so we can invalidate and execute the codeblock in the future. 44 | typedef unsigned char byte; 45 | 46 | TInt user_counter =0; 47 | 48 | TInt CreateChunkAt(TUint32 addr,TInt minsize, TInt maxsize ) 49 | { 50 | TInt err = g_code_chunk->CreateLocalCode( minsize, maxsize ); 51 | if( err ) 52 | return err; 53 | if ((TUint32)g_code_chunk->Base() != addr) 54 | { 55 | TUint offset = (TInt)g_code_chunk->Base(); 56 | offset = addr-offset; 57 | g_code_chunk->Close(); 58 | RChunk temp; 59 | if( offset > 0x7FFFFFFF ) 60 | { 61 | //shit, offset too big :( 62 | return KErrNoMemory; 63 | } 64 | TInt chunkoffset = (TInt) offset; 65 | err = temp.CreateLocal(0,chunkoffset); 66 | if( err ) 67 | { 68 | temp.Close(); 69 | return err; 70 | } 71 | err = g_code_chunk->CreateLocalCode(minsize,maxsize); 72 | temp.Close(); 73 | } 74 | return err; 75 | } 76 | 77 | int create_all_translation_caches() 78 | { 79 | TInt minsize = ROM_TRANSLATION_CACHE_SIZE + RAM_TRANSLATION_CACHE_SIZE + BIOS_TRANSLATION_CACHE_SIZE; 80 | TInt maxsize = ROM_TRANSLATION_CACHE_SIZE + RAM_TRANSLATION_CACHE_SIZE + BIOS_TRANSLATION_CACHE_SIZE + 3 * 4096; 81 | 82 | RProcess process; 83 | TModuleMemoryInfo info; 84 | 85 | TInt error = process.GetMemoryInfo( info ); 86 | if( error ) 87 | return error; 88 | 89 | TUint32 programAddr = 0x10000000;//(TUint32) info.iCodeBase; 90 | programAddr += info.iCodeSize; 91 | 92 | TUint32 destAddr = programAddr - KDistanceFromCodeSection; 93 | 94 | g_code_chunk = new RChunk(); 95 | 96 | TInt err = CreateChunkAt(destAddr,minsize, maxsize ); 97 | 98 | TUint32 dynamiaddr = (TUint32) g_code_chunk->Base(); 99 | 100 | DEBUG("CREATING HEAPS"); 101 | g_code_heap = UserHeap::ChunkHeap(*g_code_chunk, minsize, 1, maxsize ); 102 | if( g_code_heap != NULL ) 103 | { 104 | DEBUG("ROM HEAP SUCCESS!"); 105 | rom_translation_cache = (u8*) g_code_heap->Alloc( ROM_TRANSLATION_CACHE_SIZE ); 106 | ram_translation_cache = (u8*) g_code_heap->Alloc( RAM_TRANSLATION_CACHE_SIZE ); 107 | bios_translation_cache = (u8*) g_code_heap->Alloc( BIOS_TRANSLATION_CACHE_SIZE ); 108 | if( rom_translation_cache == NULL) 109 | DEBUG("ROM ALLOC FAIL!"); 110 | if( ram_translation_cache == NULL) 111 | DEBUG("RAM ALLOC FAIL!"); 112 | if( bios_translation_cache == NULL) 113 | DEBUG("BIOS ALLOC FAIL!"); 114 | } 115 | 116 | DEBUG("EVERYTHING DONE IN MEMORY HANDLING"); 117 | 118 | rom_translation_ptr = rom_translation_cache; 119 | ram_translation_ptr = ram_translation_cache; 120 | bios_translation_ptr = bios_translation_cache; 121 | 122 | return 0; 123 | } 124 | 125 | 126 | void CLEAR_INSN_CACHE(const u8 *code, int size) 127 | { 128 | TUint8* end = (TUint8*) code; 129 | end += size; 130 | User::IMB_Range( (void*) code, end ); 131 | } 132 | 133 | void SymbianPackHeap() 134 | { 135 | User::CompressAllHeaps(); 136 | User::Heap().Compress(); 137 | /* 138 | RProcess myProcess; 139 | myProcess.SetPriority(EPriorityForeground); 140 | myProcess.Close();*/ 141 | } 142 | 143 | void close_all_caches() 144 | { 145 | g_code_heap->Free( rom_translation_cache ); 146 | g_code_heap->Free( ram_translation_cache ); 147 | g_code_heap->Free( bios_translation_cache ); 148 | 149 | g_code_heap->Close(); 150 | 151 | g_code_chunk->Close(); 152 | } 153 | 154 | void keepBacklightOn() 155 | { 156 | User::ResetInactivityTime(); 157 | } 158 | 159 | void symb_usleep(int aValue) 160 | { 161 | User::AfterHighRes(aValue); 162 | } 163 | 164 | 165 | #endif 166 | -------------------------------------------------------------------------------- /gpsp4cute/dpadwidget.cpp: -------------------------------------------------------------------------------- 1 | /* gpsp4cute 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "dpadwidget.h" 21 | #include "cuteDebug.h" 22 | #include "buttonpositions.h" 23 | 24 | #include 25 | 26 | const int KCenter_x = 85; 27 | const int KCenter_y = 275; 28 | 29 | const int DPAD_CENTER_RIGHT = KCenter_x + 10; 30 | const int DPAD_CENTER_LEFT = KCenter_x - 10; 31 | const int DPAD_CENTER_TOP = KCenter_y - 10; 32 | const int DPAD_CENTER_BOTTOM = KCenter_y + 10; 33 | 34 | const int DPAD_TOP = 200 - 30; 35 | 36 | const int L_TOP = MENU_HEIGHT + SMALLBUTTON_HEIGHT; 37 | 38 | #include "input.h" 39 | 40 | DPadWidget::DPadWidget(QObject *parent) 41 | : QObject(parent) 42 | { 43 | __DEBUG_IN 44 | __DEBUG_OUT 45 | } 46 | 47 | DPadWidget::~DPadWidget() 48 | { 49 | 50 | } 51 | 52 | quint32 DPadWidget::getGpspKeys( int x, int y ) 53 | { 54 | quint32 key = 0; 55 | if( y <= MENU_HEIGHT ) 56 | { 57 | //Menu was pressed 58 | emit( showMenu() ); 59 | } 60 | else if( y > MENU_HEIGHT && y <= L_TOP ) 61 | { 62 | //L was pressed 63 | key = BUTTON_L; 64 | } 65 | else if ((y > DPAD_CENTER_TOP ) && (y < DPAD_CENTER_BOTTOM ) && (x > DPAD_CENTER_LEFT ) 66 | && (x < DPAD_CENTER_RIGHT )) 67 | { 68 | // Inside center circle of dpad 69 | } 70 | else if ( y > DPAD_TOP ) 71 | { 72 | //return only 4-directions 73 | if( m_dpadMode == 0 ) 74 | return getFourDirectinalPad( x, y ); 75 | 76 | qreal x_coord = x - KCenter_x; 77 | qreal y_coord = y - KCenter_y; 78 | 79 | qreal r = qAtan2( y_coord, x_coord); 80 | 81 | r = (r * 180 )/ KPi; //convert radians to degrees 82 | 83 | //lets use full circle instead of negative angles 84 | if (r < 0) 85 | { 86 | r = 360 + r; 87 | } 88 | 89 | qint32 angle = qRound(r); 90 | 91 | 92 | //360 degrees is divided into 8 sectors. 93 | if (angle > 337 || angle < 23) 94 | { 95 | //right key was pressed 96 | key += BUTTON_RIGHT; 97 | } 98 | else if (angle >= 23 && angle < 68) 99 | { 100 | //right and down was pressed 101 | key += BUTTON_RIGHT; 102 | key += BUTTON_DOWN; 103 | } 104 | else if (angle >= 68 && angle < 113) 105 | { 106 | //Down key was pressed 107 | key += BUTTON_DOWN; 108 | } 109 | else if (angle >= 113 && angle < 158) 110 | { 111 | //Down and left key was pressed 112 | key += BUTTON_DOWN; 113 | key += BUTTON_LEFT; 114 | } 115 | else if (angle >= 158 && angle < 203) 116 | { 117 | //Left key was pressed 118 | key += BUTTON_LEFT; 119 | } 120 | else if (angle >= 203 && angle < 248) 121 | { 122 | //left and up key was pressed 123 | key += BUTTON_LEFT; 124 | key += BUTTON_UP; 125 | } 126 | else if (angle >= 248 && angle < 293) 127 | { 128 | //up key was BUTTON_UP 129 | key += BUTTON_UP; 130 | } 131 | else if (angle >= 293 && angle <= 337) 132 | { 133 | //up and right key was pressed 134 | key += BUTTON_UP; 135 | key += BUTTON_RIGHT; 136 | } 137 | } 138 | return key; 139 | } 140 | 141 | quint32 DPadWidget::getFourDirectinalPad( int x, int y ) 142 | { 143 | quint32 key = 0; 144 | 145 | qreal rx = x - KCenter_x; 146 | qreal ry = y - KCenter_y; 147 | 148 | qreal r = qAtan2(ry, rx); 149 | 150 | r = (r * 180) / KPi; //convert radians to degrees 151 | 152 | //lets use full circle instead of negative angles 153 | if (r < 0) 154 | { 155 | r = 360 + r; 156 | } 157 | 158 | qint32 angle = qRound(r); 159 | 160 | 161 | //360 degrees is divided into 8 sectors. 162 | if (angle > 337 || angle < 68) 163 | { 164 | //right key was pressed 165 | key += BUTTON_RIGHT; 166 | } 167 | 168 | else if (angle >= 68 && angle < 158) 169 | { 170 | //Down key was pressed 171 | key += BUTTON_DOWN; 172 | } 173 | else if (angle >= 158 && angle < 248) 174 | { 175 | //Left key was pressed 176 | key += BUTTON_LEFT; 177 | } 178 | else if (angle >= 248 && angle < 337) 179 | { 180 | //up key was pressed 181 | key += BUTTON_UP; 182 | } 183 | return key; 184 | } 185 | 186 | 187 | void DPadWidget::setDpadMode( int mode ) 188 | { 189 | m_dpadMode = mode; 190 | } 191 | -------------------------------------------------------------------------------- /gpsp/inc/tracer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tracer.h 3 | * 4 | * Created on: Apr 4, 2009 5 | * Author: Administrator 6 | */ 7 | 8 | #ifndef TRACER_H_ 9 | #define TRACER_H_ 10 | 11 | #include 12 | 13 | // Define tracer logging method 14 | // 0 = Logging off 15 | // 1 = Log to RDebug 16 | // 2 = Log to file (RFileLogger) 17 | #define TRACER_LOG_METHOD 2 18 | 19 | // ============================================================================ 20 | 21 | // Logging off, define empty macros and skip all the rest 22 | #if TRACER_LOG_METHOD == 0 23 | 24 | #define TRACER(func) 25 | #define TRACER_RET(func,format) 26 | 27 | #else // Logging on 28 | 29 | // Macro to print function entry, exit and leave. 30 | // Example: TRACER("CMyClass::MyFunction"); 31 | #define TRACER(func) TTracer function_tracer( _S(func), _S("") ); 32 | 33 | // Macro to print function return value in addition to entry, exit 34 | // and leave conditions Second parameter is a formatting string used 35 | // to print the return value Example to print an integer return value: 36 | // TRACER_RET("CMyclass::MyFunction", "%d"); 37 | #define TRACER_RET(func,format) TTracer func_tracer( _S(func), _S(format) ); 38 | 39 | // Macro to print function entry, exit and leave. 40 | // Gets the function name automatically 41 | // Example: TRACER_AUTO; 42 | // Substract 1 from MaxLength() because PtrZ() adds the zero terminator 43 | #define TRACER_AUTO \ 44 | TPtrC8 __ptr8((const TUint8*)__PRETTY_FUNCTION__); \ 45 | TBuf<150> __buf; \ 46 | __buf.Copy( __ptr8.Left( __buf.MaxLength() - 1 ) ); \ 47 | TTracer function_tracer( __buf.PtrZ(), _S("") ) 48 | 49 | // Macro to print function entry, exit and leave. 50 | // Gets the function name automatically 51 | // Example: TRACER_AUTO_RET("%d"); 52 | // Substract 1 from MaxLength() because PtrZ() adds the zero terminator 53 | #define TRACER_AUTO_RET(format) \ 54 | TPtrC8 __ptr8((const TUint8*)__PRETTY_FUNCTION__); \ 55 | TBuf<150> __buf; \ 56 | __buf.Copy( __ptr8.Left( __buf.MaxLength() - 1 ) ); \ 57 | TTracer function_tracer( __buf.PtrZ(), _S(format) ) 58 | 59 | #if TRACER_LOG_METHOD == 1 // Print to RDebug 60 | 61 | #include 62 | #define TRACER_PRINT(a) RDebug::Print(a,&iFunc); 63 | #define TRACER_PRINT_RET(a,b) RDebug::Print(a,&iFunc,b); 64 | 65 | #elif TRACER_LOG_METHOD == 2 // Print to file 66 | 67 | #include 68 | _LIT( KLogDir, "gpsp4symbian" ); // Log directory: C:\logs\tracer 69 | _LIT( KLogFile, "log.txt" ); // Log file: c:\logs\tracer\tracer.txt 70 | #define TRACER_PRINT(a) RFileLogger::WriteFormat(KLogDir, \ 71 | KLogFile,EFileLoggingModeAppend,a,&iFunc); 72 | #define TRACER_PRINT_RET(a,b) RFileLogger::WriteFormat(KLogDir, \ 73 | KLogFile,EFileLoggingModeAppend,a,&iFunc,b); 74 | 75 | #endif 76 | 77 | _LIT( KLogEnter, "%S: ENTER" ); 78 | _LIT( KLogExit, "%S: EXIT" ); 79 | _LIT( KLogLeave, "%S: LEAVE!" ); 80 | _LIT( KLogExitRet, "%S: EXIT, Returning " ); 81 | 82 | /** 83 | * Simple tracer class that logs function enter, exit, or leave 84 | */ 85 | class TTracer 86 | { 87 | public: 88 | 89 | /** 90 | * inline constructor to write log of entering a function 91 | */ 92 | TTracer( const TText* aFunc, const TText* aRetFormat ) 93 | : iFunc( aFunc ) 94 | , iRetFormat( aRetFormat ) 95 | { 96 | TRACER_PRINT( KLogEnter ); 97 | } 98 | 99 | /** 100 | * inline destructor to write log of exiting a function 101 | * normally or with a leave 102 | */ 103 | ~TTracer() 104 | { 105 | if ( std::uncaught_exception() ) // Leave is an exception 106 | { 107 | // The function exited with a leave 108 | TRACER_PRINT( KLogLeave ); 109 | } 110 | else 111 | { 112 | // The function exited normally 113 | if ( iRetFormat.Length() == 0 ) 114 | { 115 | TRACER_PRINT( KLogExit ); 116 | } 117 | else 118 | { 119 | // Log the return value 120 | #ifdef __WINS__ 121 | TInt32 retVal = 0; 122 | 123 | // The assembly bit. This needs to be reimplemented 124 | // for every target. 125 | _asm( mov retVal, ebx ); 126 | 127 | TBuf<100> format( KLogExitRet ); 128 | format.Append( iRetFormat ); 129 | TRACER_PRINT_RET( format, retVal ); 130 | #else 131 | TRACER_PRINT( KLogExit ); 132 | #endif 133 | } 134 | } 135 | } 136 | 137 | private: 138 | 139 | /** 140 | * Pointer descriptor to function signature that is to be logged. 141 | */ 142 | TPtrC iFunc; 143 | 144 | /** 145 | * Formatting string used to print the function return value 146 | */ 147 | TPtrC iRetFormat; 148 | 149 | }; 150 | 151 | #endif // TRACER_LOG_METHOD == 0 152 | 153 | 154 | #endif /* TRACER_H_ */ 155 | -------------------------------------------------------------------------------- /gpsp/inc/memory.h: -------------------------------------------------------------------------------- 1 | /* gameplaySP 2 | * 3 | * Copyright (C) 2006 Exophase 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef MEMORY_H 21 | #define MEMORY_H 22 | 23 | typedef enum 24 | { 25 | DMA_START_IMMEDIATELY, 26 | DMA_START_VBLANK, 27 | DMA_START_HBLANK, 28 | DMA_START_SPECIAL, 29 | DMA_INACTIVE 30 | } dma_start_type; 31 | 32 | typedef enum 33 | { 34 | DMA_16BIT, 35 | DMA_32BIT 36 | } dma_length_type; 37 | 38 | typedef enum 39 | { 40 | DMA_NO_REPEAT, 41 | DMA_REPEAT 42 | } dma_repeat_type; 43 | 44 | typedef enum 45 | { 46 | DMA_INCREMENT, 47 | DMA_DECREMENT, 48 | DMA_FIXED, 49 | DMA_RELOAD 50 | } dma_increment_type; 51 | 52 | typedef enum 53 | { 54 | DMA_NO_IRQ, 55 | DMA_TRIGGER_IRQ 56 | } dma_irq_type; 57 | 58 | typedef enum 59 | { 60 | DMA_DIRECT_SOUND_A, 61 | DMA_DIRECT_SOUND_B, 62 | DMA_NO_DIRECT_SOUND 63 | } dma_ds_type; 64 | 65 | typedef struct 66 | { 67 | u32 dma_channel; 68 | u32 source_address; 69 | u32 dest_address; 70 | u32 length; 71 | dma_repeat_type repeat_type; 72 | dma_ds_type direct_sound_channel; 73 | dma_increment_type source_direction; 74 | dma_increment_type dest_direction; 75 | dma_length_type length_type; 76 | dma_start_type start_type; 77 | dma_irq_type irq; 78 | } dma_transfer_type; 79 | 80 | typedef enum 81 | { 82 | REG_DISPCNT = 0x000, 83 | REG_DISPSTAT = 0x002, 84 | REG_VCOUNT = 0x003, 85 | REG_BG0CNT = 0x004, 86 | REG_BG1CNT = 0x005, 87 | REG_BG2CNT = 0x006, 88 | REG_BG3CNT = 0x007, 89 | REG_BG0HOFS = 0x08, 90 | REG_BG0VOFS = 0x09, 91 | REG_BG1HOFS = 0x0A, 92 | REG_BG1VOFS = 0x0B, 93 | REG_BG2HOFS = 0x0C, 94 | REG_BG2VOFS = 0x0D, 95 | REG_BG3HOFS = 0x0E, 96 | REG_BG3VOFS = 0x0F, 97 | REG_BG2PA = 0x10, 98 | REG_BG2PB = 0x11, 99 | REG_BG2PC = 0x12, 100 | REG_BG2PD = 0x13, 101 | REG_BG2X_L = 0x14, 102 | REG_BG2X_H = 0x15, 103 | REG_BG2Y_L = 0x16, 104 | REG_BG2Y_H = 0x17, 105 | REG_BG3PA = 0x18, 106 | REG_BG3PB = 0x19, 107 | REG_BG3PC = 0x1A, 108 | REG_BG3PD = 0x1B, 109 | REG_BG3X_L = 0x1C, 110 | REG_BG3X_H = 0x1D, 111 | REG_BG3Y_L = 0x1E, 112 | REG_BG3Y_H = 0x1F, 113 | REG_WIN0H = 0x20, 114 | REG_WIN1H = 0x21, 115 | REG_WIN0V = 0x22, 116 | REG_WIN1V = 0x23, 117 | REG_WININ = 0x24, 118 | REG_WINOUT = 0x25, 119 | REG_BLDCNT = 0x28, 120 | REG_BLDALPHA = 0x29, 121 | REG_BLDY = 0x2A, 122 | REG_TM0D = 0x80, 123 | REG_TM0CNT = 0x81, 124 | REG_TM1D = 0x82, 125 | REG_TM1CNT = 0x83, 126 | REG_TM2D = 0x84, 127 | REG_TM2CNT = 0x85, 128 | REG_TM3D = 0x86, 129 | REG_TM3CNT = 0x87, 130 | REG_P1 = 0x098, 131 | REG_P1CNT = 0x099, 132 | REG_RCNT = 0x9A, 133 | REG_IE = 0x100, 134 | REG_IF = 0x101, 135 | REG_IME = 0x104, 136 | REG_HALTCNT = 0x180 137 | } hardware_register; 138 | 139 | typedef enum 140 | { 141 | FLASH_DEVICE_MACRONIX_64KB = 0x1C, 142 | FLASH_DEVICE_AMTEL_64KB = 0x3D, 143 | FLASH_DEVICE_SST_64K = 0xD4, 144 | FLASH_DEVICE_PANASONIC_64KB = 0x1B, 145 | FLASH_DEVICE_MACRONIX_128KB = 0x09 146 | } flash_device_id_type; 147 | 148 | typedef enum 149 | { 150 | FLASH_MANUFACTURER_MACRONIX = 0xC2, 151 | FLASH_MANUFACTURER_AMTEL = 0x1F, 152 | FLASH_MANUFACTURER_PANASONIC = 0x32, 153 | FLASH_MANUFACTURER_SST = 0xBF 154 | } flash_manufacturer_id_type; 155 | 156 | u8 function_cc read_memory8(u32 address); 157 | u32 function_cc read_memory16(u32 address); 158 | u16 function_cc read_memory16_signed(u32 address); 159 | u32 function_cc read_memory32(u32 address); 160 | cpu_alert_type function_cc write_memory8(u32 address, u8 value); 161 | cpu_alert_type function_cc write_memory16(u32 address, u16 value); 162 | cpu_alert_type function_cc write_memory32(u32 address, u32 value); 163 | 164 | extern u8 *memory_regions[16]; 165 | extern u32 memory_limits[16]; 166 | 167 | /* EDIT: Shouldn't this be extern ?! */ 168 | extern u32 waitstate_cycles_sequential[16][3]; 169 | 170 | extern u32 gamepak_size; 171 | extern u8 gamepak_title[13]; 172 | extern u8 gamepak_code[5]; 173 | extern u8 gamepak_maker[3]; 174 | extern u8 gamepak_filename[512]; 175 | 176 | //export some functions to be called from the c++ side 177 | #ifdef __SYMBIAN32__ 178 | #ifdef __cplusplus 179 | extern "C" { 180 | #endif 181 | 182 | cpu_alert_type dma_transfer(dma_transfer_type *dma); 183 | u8 *memory_region(u32 address, u32 *memory_limit); 184 | u32 load_gamepak(char *name); 185 | u32 load_backup(char *name); 186 | s32 load_bios(char *name); 187 | void update_backup(); 188 | void update_backup_force(); 189 | void init_memory(); 190 | void memory_exit(); 191 | void init_gamepak_buffer(); 192 | void bios_region_read_allow(); 193 | void bios_region_read_protect(); 194 | u8 *load_gamepak_page(u32 physical_index); 195 | void memory_write_mem_savestate(file_tag_type savestate_file); 196 | void memory_read_savestate(file_tag_type savestate_file); 197 | void load_state(char *savestate_filename); 198 | void save_state(char *savestate_filename, u16 *screen_capture); 199 | 200 | 201 | extern u8 *gamepak_rom; 202 | extern u32 gamepak_ram_buffer_size; 203 | extern u32 oam_update; 204 | extern u32 gbc_sound_update; 205 | extern u32 gbc_sound_wave_update; 206 | extern dma_transfer_type dma[4]; 207 | 208 | extern u8 *write_mem_ptr; 209 | 210 | extern u16 palette_ram[512]; 211 | extern u16 oam_ram[512]; 212 | extern u16 palette_ram_converted[512]; 213 | extern u16 io_registers[1024 * 16]; 214 | extern u8 ewram[1024 * 256 * 2]; 215 | extern u8 iwram[1024 * 32 * 2]; 216 | extern u8 vram[1024 * 96 * 2]; 217 | 218 | extern u8 bios_rom[1024 * 32]; 219 | extern u32 bios_read_protect; 220 | 221 | extern u8 *memory_map_read[8 * 1024]; 222 | extern u32 *reg; 223 | extern u8 *memory_map_write[8 * 1024]; 224 | 225 | extern flash_device_id_type flash_device_id; 226 | 227 | #ifdef __cplusplus 228 | }; 229 | #endif 230 | #endif 231 | 232 | #endif 233 | -------------------------------------------------------------------------------- /gpsp4cute/AntAudio.cpp: -------------------------------------------------------------------------------- 1 | /* AntSnes 2 | * 3 | * Copyright (C) 2010 Summeli 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "AntAudio.h" 21 | 22 | #include "cutedebug.h" 23 | 24 | #ifdef OUTPUT_TO_FILE 25 | _LIT( KTESTDATA, "c:\\Data\\test_data\\testdata.dat"); 26 | #endif 27 | /******************************************* 28 | * 29 | * CAntAudio 30 | * 31 | *******************************************/ 32 | 33 | 34 | CAntAudio::CAntAudio(): 35 | iRate(KSampleRate),iStereo(KStereo),iPcmFrames(KFramesize) 36 | { 37 | for (TInt i=0 ; iDes().FillZ (iPcmFrames ); 110 | TInt err = iEmptyBufQ.Append(i); 111 | User::LeaveIfError(err); 112 | } 113 | 114 | iFrameCount = 0; 115 | __DEBUG_OUT 116 | } 117 | 118 | void CAntAudio::Reset() 119 | { 120 | __DEBUG_IN 121 | iMdaAudioOutputStream->Open(&iMdaAudioDataSettings); 122 | 123 | iWait->Start(); 124 | iMdaAudioOutputStream->SetPriority(EPriorityMuchMore, EMdaPriorityPreferenceNone); 125 | TInt MaxVol = iMdaAudioOutputStream->MaxVolume(); 126 | TInt vol = (MaxVol * iVolume) / 10; 127 | iMdaAudioOutputStream->SetVolume(vol); 128 | __DEBUG_OUT 129 | } 130 | 131 | // returns a pointer to buffer for next frame, 132 | // to be used when iSoundBuffers are used directly 133 | TInt8 *CAntAudio::NextFrameL() 134 | { 135 | #ifdef OUTPUT_TO_FILE 136 | return (TUint8*) iSoundBuffers[iEmptyBufQ[0]]->Ptr(); 137 | #endif 138 | if( (iEmptyBufQ.Count() < 2) ) 139 | { 140 | __DEBUG1("CAntAudio: NextFrame is NULL"); 141 | return NULL; 142 | } 143 | return (TInt8*) iSoundBuffers[iEmptyBufQ[0]]->Ptr(); 144 | } 145 | 146 | void CAntAudio::FrameMixed() 147 | { 148 | __DEBUG_IN 149 | TInt nextFrame = iEmptyBufQ[0]; 150 | iEmptyBufQ.Remove(0); 151 | iEmptyBufQ.Compress(); 152 | iMdaAudioOutputStream->WriteL(*iSoundBuffers[nextFrame]); 153 | __DEBUG_OUT 154 | } 155 | 156 | void CAntAudio::Stop() 157 | { 158 | iMdaAudioOutputStream->Stop(); 159 | TInt queuedbuffers = KSoundBuffers - iEmptyBufQ.Count(); 160 | for( TInt i= queuedbuffers; i>0; i--) 161 | { 162 | //iWait->Start(); 163 | } 164 | } 165 | 166 | TInt CAntAudio::FreeBufferCount() 167 | { 168 | return iEmptyBufQ.Count(); 169 | } 170 | 171 | void CAntAudio::MaoscOpenComplete(TInt aError) 172 | { __DEBUG_IN 173 | if (aError==KErrNone) 174 | { 175 | //iMdaAudioOutputStream->SetPriority(EPriorityMuchMore, EMdaPriorityPreferenceNone); 176 | } 177 | if( aError == KErrServerBusy ) 178 | { 179 | //iMdaAudioOutputStream->Open(&iMdaAudioDataSettings); 180 | } 181 | iWait->AsyncStop(); 182 | __DEBUG_OUT 183 | } 184 | 185 | void CAntAudio::MaoscBufferCopied(TInt aError, const TDesC8& aBuffer) 186 | { 187 | __DEBUG_IN 188 | if( aBuffer.Ptr() == iSoundBuffers[0]->Ptr()) 189 | iEmptyBufQ.Append(0); 190 | else if( aBuffer.Ptr() == iSoundBuffers[1]->Ptr() ) 191 | iEmptyBufQ.Append(1); 192 | else if( aBuffer.Ptr() == iSoundBuffers[2]->Ptr() ) 193 | iEmptyBufQ.Append(2); 194 | else if( aBuffer.Ptr() == iSoundBuffers[3]->Ptr() ) 195 | iEmptyBufQ.Append(3); 196 | __DEBUG_OUT 197 | } 198 | void CAntAudio::MaoscPlayComplete(TInt aError) 199 | { 200 | //iPlaying = EFalse; 201 | } 202 | -------------------------------------------------------------------------------- /gpsp/inc/cpu.h: -------------------------------------------------------------------------------- 1 | /* gameplaySP 2 | * 3 | * Copyright (C) 2006 Exophase 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef CPU_H 21 | #define CPU_H 22 | 23 | // System mode and user mode are represented as the same here 24 | 25 | typedef enum 26 | { 27 | MODE_USER, 28 | MODE_IRQ, 29 | MODE_FIQ, 30 | MODE_SUPERVISOR, 31 | MODE_ABORT, 32 | MODE_UNDEFINED, 33 | MODE_INVALID 34 | } cpu_mode_type; 35 | 36 | typedef enum 37 | { 38 | CPU_ALERT_NONE, 39 | CPU_ALERT_HALT, 40 | CPU_ALERT_SMC, 41 | CPU_ALERT_IRQ 42 | } cpu_alert_type; 43 | 44 | typedef enum 45 | { 46 | CPU_ACTIVE, 47 | CPU_HALT, 48 | CPU_STOP 49 | } cpu_halt_type; 50 | 51 | typedef enum 52 | { 53 | IRQ_NONE = 0x0000, 54 | IRQ_VBLANK = 0x0001, 55 | IRQ_HBLANK = 0x0002, 56 | IRQ_VCOUNT = 0x0004, 57 | IRQ_TIMER0 = 0x0008, 58 | IRQ_TIMER1 = 0x0010, 59 | IRQ_TIMER2 = 0x0020, 60 | IRQ_TIMER3 = 0x0040, 61 | IRQ_SERIAL = 0x0080, 62 | IRQ_DMA0 = 0x0100, 63 | IRQ_DMA1 = 0x0200, 64 | IRQ_DMA2 = 0x0400, 65 | IRQ_DMA3 = 0x0800, 66 | IRQ_KEYPAD = 0x1000, 67 | IRQ_GAMEPAK = 0x2000, 68 | } irq_type; 69 | 70 | typedef enum 71 | { 72 | REG_SP = 13, 73 | REG_LR = 14, 74 | REG_PC = 15, 75 | REG_N_FLAG = 16, 76 | REG_Z_FLAG = 17, 77 | REG_C_FLAG = 18, 78 | REG_V_FLAG = 19, 79 | REG_CPSR = 20, 80 | REG_SAVE = 21, 81 | REG_SAVE2 = 22, 82 | REG_SAVE3 = 23, 83 | CPU_MODE = 29, 84 | CPU_HALT_STATE = 30, 85 | CHANGED_PC_STATUS = 31 86 | } ext_reg_numbers; 87 | 88 | typedef enum 89 | { 90 | STEP, 91 | PC_BREAKPOINT, 92 | VCOUNT_BREAKPOINT, 93 | Z_BREAKPOINT, 94 | COUNTDOWN_BREAKPOINT, 95 | COUNTDOWN_BREAKPOINT_B, 96 | STEP_RUN, 97 | RUN 98 | } debug_state; 99 | 100 | typedef enum 101 | { 102 | TRANSLATION_REGION_RAM, 103 | TRANSLATION_REGION_ROM, 104 | TRANSLATION_REGION_BIOS 105 | } translation_region_type; 106 | 107 | extern debug_state current_debug_state; 108 | extern u32 instruction_count; 109 | extern u32 last_instruction; 110 | 111 | u32 function_cc step_debug(u32 pc, u32 cycles); 112 | u32 execute_arm(u32 cycles); 113 | void raise_interrupt(irq_type irq_raised); 114 | 115 | void set_cpu_mode(cpu_mode_type new_mode); 116 | 117 | u32 function_cc execute_load_u8(u32 address); 118 | u32 function_cc execute_load_u16(u32 address); 119 | u32 function_cc execute_load_u32(u32 address); 120 | u32 function_cc execute_load_s8(u32 address); 121 | u32 function_cc execute_load_s16(u32 address); 122 | void function_cc execute_store_u8(u32 address, u32 source); 123 | void function_cc execute_store_u16(u32 address, u32 source); 124 | void function_cc execute_store_u32(u32 address, u32 source); 125 | void function_cc execute_store_u8_no_smc(u32 address, u32 source); 126 | void function_cc execute_store_u16_no_smc(u32 address, u32 source); 127 | void function_cc execute_store_u32_no_smc(u32 address, u32 source); 128 | u32 function_cc execute_arm_translate(u32 cycles); 129 | void init_translater(); 130 | void cpu_write_mem_savestate(file_tag_type savestate_file); 131 | void cpu_read_savestate(file_tag_type savestate_file); 132 | 133 | u8 function_cc *block_lookup_address_arm(u32 pc); 134 | u8 function_cc *block_lookup_address_thumb(u32 pc); 135 | s32 translate_block_arm(u32 pc, translation_region_type translation_region, 136 | u32 smc_enable); 137 | s32 translate_block_thumb(u32 pc, translation_region_type translation_region, 138 | u32 smc_enable); 139 | 140 | #ifdef __SYMBIAN32__ 141 | //#define ROM_TRANSLATION_CACHE_SIZE (1024 * 512 * 4 * 5) //too big maybe... 142 | #define ROM_TRANSLATION_CACHE_SIZE (1024 * 512 * 4 * 5 ) 143 | #define RAM_TRANSLATION_CACHE_SIZE (1024 * 1024) 144 | #define BIOS_TRANSLATION_CACHE_SIZE (1024 * 512) 145 | #define TRANSLATION_CACHE_LIMIT_THRESHOLD (1024 * 32) 146 | 147 | int create_functioncall_stubs_symbian(); 148 | 149 | #else 150 | 151 | #define ROM_TRANSLATION_CACHE_SIZE (1024 * 512 * 4) 152 | #define RAM_TRANSLATION_CACHE_SIZE (1024 * 384) 153 | #define BIOS_TRANSLATION_CACHE_SIZE (1024 * 128) 154 | #define TRANSLATION_CACHE_LIMIT_THRESHOLD (1024) 155 | 156 | #endif 157 | 158 | #ifdef __SYMBIAN32__ 159 | extern u8* rom_translation_cache; 160 | extern u8* ram_translation_cache; 161 | extern u8* bios_translation_cache; 162 | 163 | #else 164 | extern u8 rom_translation_cache[ROM_TRANSLATION_CACHE_SIZE]; 165 | extern u8 ram_translation_cache[RAM_TRANSLATION_CACHE_SIZE]; 166 | extern u8 bios_translation_cache[BIOS_TRANSLATION_CACHE_SIZE]; 167 | #endif 168 | extern u8 *rom_translation_ptr; 169 | extern u8 *ram_translation_ptr; 170 | extern u8 *bios_translation_ptr; 171 | 172 | #define MAX_TRANSLATION_GATES 8 173 | 174 | extern u32 idle_loop_target_pc; 175 | extern u32 force_pc_update_target; 176 | extern u32 iwram_stack_optimize; 177 | extern u32 allow_smc_ram_u8; 178 | extern u32 allow_smc_ram_u16; 179 | extern u32 allow_smc_ram_u32; 180 | extern u32 direct_map_vram; 181 | extern u32 translation_gate_targets; 182 | extern u32 translation_gate_target_pc[MAX_TRANSLATION_GATES]; 183 | 184 | extern u32 in_interrupt; 185 | 186 | #define ROM_BRANCH_HASH_SIZE (1024 * 64) 187 | 188 | /* EDIT: Shouldn't this be extern ?! */ 189 | extern u32 *rom_branch_hash[ROM_BRANCH_HASH_SIZE]; 190 | 191 | void flush_translation_cache_rom(); 192 | void flush_translation_cache_ram(); 193 | void flush_translation_cache_bios(); 194 | void dump_translation_cache(); 195 | 196 | extern u32 reg_mode[7][7]; 197 | extern u32 spsr[6]; 198 | extern cpu_mode_type cpu_mode; 199 | extern cpu_halt_type cpu_halt; 200 | 201 | extern u32 cpu_modes[32]; 202 | extern const u32 psr_masks[16]; 203 | 204 | extern u32 breakpoint_value; 205 | 206 | extern u32 memory_region_access_read_u8[16]; 207 | extern u32 memory_region_access_read_s8[16]; 208 | extern u32 memory_region_access_read_u16[16]; 209 | extern u32 memory_region_access_read_s16[16]; 210 | extern u32 memory_region_access_read_u32[16]; 211 | extern u32 memory_region_access_write_u8[16]; 212 | extern u32 memory_region_access_write_u16[16]; 213 | extern u32 memory_region_access_write_u32[16]; 214 | extern u32 memory_reads_u8; 215 | extern u32 memory_reads_s8; 216 | extern u32 memory_reads_u16; 217 | extern u32 memory_reads_s16; 218 | extern u32 memory_reads_u32; 219 | extern u32 memory_writes_u8; 220 | extern u32 memory_writes_u16; 221 | extern u32 memory_writes_u32; 222 | 223 | void init_cpu(); 224 | void move_reg(); 225 | 226 | #endif 227 | -------------------------------------------------------------------------------- /gpsp4cute/emusettings.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | EmuSettingsClass 4 | 5 | 6 | 7 | 0 8 | 0 9 | 640 10 | 360 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 250 24 | 190 25 | 121 26 | 65 27 | 28 | 29 | 30 | File 31 | 32 | 33 | 34 | 35 | 36 | 250 37 | 265 38 | 121 39 | 65 40 | 41 | 42 | 43 | Controls 44 | 45 | 46 | 47 | 48 | 49 | 10 50 | 265 51 | 131 52 | 65 53 | 54 | 55 | 56 | EXIT 57 | 58 | 59 | 60 | 61 | 62 | 510 63 | 265 64 | 121 65 | 65 66 | 67 | 68 | 69 | Audio 70 | 71 | 72 | 73 | 74 | 75 | 510 76 | 190 77 | 121 78 | 65 79 | 80 | 81 | 82 | Continue 83 | 84 | 85 | 86 | 87 | 88 | 0 89 | 0 90 | 640 91 | 150 92 | 93 | 94 | 95 | 96 | 97 | 0 98 | 0 99 | 640 100 | 140 101 | 102 | 103 | 104 | QLabel{ 105 | background-image: url(:/graphics/gfx/gpsp4symbianlogo.png); 106 | background-repeat: no-repeat; 107 | background-position: center; 108 | } 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 2 119 | 171 120 | 241 121 | 91 122 | 123 | 124 | 125 | 126 | 127 | 128 | Save/Load State 129 | 130 | 131 | 132 | 133 | 150 134 | 26 135 | 81 136 | 56 137 | 138 | 139 | 140 | Save 141 | 142 | 143 | 144 | 145 | 146 | 84 147 | 26 148 | 61 149 | 56 150 | 151 | 152 | 153 | 154 | 1 155 | 156 | 157 | 158 | 159 | 2 160 | 161 | 162 | 163 | 164 | 3 165 | 166 | 167 | 168 | 169 | 4 170 | 171 | 172 | 173 | 174 | 5 175 | 176 | 177 | 178 | 179 | 180 | 181 | 1 182 | 26 183 | 81 184 | 56 185 | 186 | 187 | 188 | Load 189 | 190 | 191 | 192 | 193 | 194 | 195 | 380 196 | 265 197 | 121 198 | 65 199 | 200 | 201 | 202 | Video 203 | 204 | 205 | 206 | 207 | 208 | 380 209 | 190 210 | 121 211 | 65 212 | 213 | 214 | 215 | Reset 216 | 217 | 218 | 219 | 220 | 221 | 155 222 | 265 223 | 80 224 | 65 225 | 226 | 227 | 228 | About 229 | 230 | 231 | 232 | 233 | 234 | 0 235 | 150 236 | 640 237 | 20 238 | 239 | 240 | 241 | QLabel{ 242 | background-image: url(:/graphics/gfx/separator.png); 243 | } 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 0 254 | 0 255 | 640 256 | 22 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | -------------------------------------------------------------------------------- /gpsp/src/video_blend.S: -------------------------------------------------------------------------------- 1 | .align 2 2 | 3 | .global expand_blend 4 | @.global expand_normal 5 | 6 | @ Input: 7 | @ r0 = screen_src_ptr 8 | @ r1 = screen_dest_ptr 9 | @ r2 = start 10 | @ r3 = end 11 | 12 | 6: 13 | .long io_registers 14 | .long palette_ram_converted 15 | .long 0x04000200 @ combine test mask 16 | .long 0x07E0F81F @ clamp mask 17 | .long 0x000003FE @ palette index mask 18 | .long 0x08010020 @ saturation mask 19 | 20 | expand_blend: 21 | stmdb sp!, { r4, r5, r6, r9, r10, r11, r14 } 22 | 23 | add r0, r0, r2, lsl #2 @ screen_src_ptr += start 24 | add r1, r1, r2, lsl #1 @ screen_dest_ptr += start 25 | sub r2, r3, r2 @ r2 = end - start 26 | ldr r3, 6b @ r3 = io_registers 27 | ldr r3, [r3, #0x52] @ r3 = bldalpha 28 | mov r4, r3, lsr #8 @ r4 = bldalpha >> 8 29 | and r3, r3, #0x1F @ r3 = blend_a 30 | and r4, r4, #0x1F @ r4 = blend_b 31 | cmp r3, #16 @ if(blend_a > 16) 32 | movgt r3, #16 @ blend_a = 16 33 | cmp r4, #16 @ if(blend_b > 16) 34 | movgt r3, #16 @ blend_b = 16 35 | 36 | ldr r14, 6b + 4 @ r14 = palette_ram_converted 37 | ldr r12, 6b + 8 @ r12 = 0x04000200 38 | ldr r11, 6b + 12 @ r11 = 0x07E0F81F 39 | ldr r10, 6b + 16 @ r10 = 0x000003FE 40 | 41 | add r5, r3, r4 @ r5 = blend_a + blend_b 42 | cmp r5, #16 @ if((blend_a + blend_b) > 16) 43 | bgt 3f @ goto loop w/saturation 44 | 45 | 46 | @ loop w/o saturation 47 | 1: 48 | ldr r5, [r0], #4 @ r5 = pixel_pair, screen_src_ptr++ 49 | and r6, r5, r12 @ r6 = r5 & 0x04000200 50 | cmp r6, r12 @ if(r6 != 0x4000200) 51 | bne 2f @ goto no_blend 52 | 53 | and r6, r10, r5, lsl #1 @ r6 = (pixel_pair & 0x1FF) << 1 54 | ldrh r6, [r14, r6] @ r6 = pixel_top 55 | orr r6, r6, r6, lsl #16 @ r6 = pixel_top | (pixel_top << 16) 56 | and r6, r6, r11 @ r6 = pixel_top_dilated 57 | 58 | and r5, r10, r5, lsr #15 @ r5 = ((pixel_pair >> 16) & 0x1FF) << 1 59 | ldrh r5, [r14, r5] @ r5 = pixel_bottom 60 | orr r5, r5, r5, lsl #16 @ r5 = pixel_bottom | (pixel_bottom << 16) 61 | and r5, r5, r11 @ r5 = pixel_bottom_dilated 62 | 63 | mul r5, r4, r5 @ r5 = pixel_bottom * blend_b = bottom_mul 64 | mla r5, r3, r6, r5 @ r5 = (pixel_top * blend_a) + bottom_mul 65 | 66 | and r5, r11, r5, lsr #4 @ r5 = (color_dilated >> 4) & 0x07E0F81F 67 | orr r5, r5, r5, lsr #16 @ r5 = color_dilated | (color_dilated >> 16) 68 | 69 | strh r5, [r1], #2 @ *screen_dest_ptr = r5, screen_dest_ptr++ 70 | subs r2, r2, #1 @ counter-- 71 | bne 1b @ go again 72 | 73 | ldmia sp!, { r4, r5, r6, r9, r10, r11, pc } 74 | 75 | 2: 76 | and r5, r10, r5, lsl #1 @ r5 = (pixel_pair & 0x1FF) << 1 77 | ldrh r5, [r14, r5] @ r5 = pixel_top 78 | strh r5, [r1], #2 @ *screen_dest_ptr = r5, screen_dest_ptr++ 79 | 80 | subs r2, r2, #1 @ counter-- 81 | bne 1b @ go again 82 | 83 | ldmia sp!, { r4, r5, r6, r9, r10, r11, pc } 84 | 85 | @ loop w/saturation 86 | 87 | 3: 88 | ldr r9, 6b + 20 @ r9 = 0x08010020 89 | 90 | 4: 91 | ldr r5, [r0], #4 @ r5 = pixel_pair, screen_src_ptr++ 92 | and r6, r5, r12 @ r6 = r5 & 0x04000200 93 | cmp r6, r12 @ if(r6 != 0x4000200) 94 | bne 5f @ goto no_blend 95 | 96 | and r6, r10, r5, lsl #1 @ r6 = (pixel_pair & 0x1FF) << 1 97 | ldrh r6, [r14, r6] @ r6 = pixel_top 98 | orr r6, r6, r6, lsl #16 @ r6 = pixel_top | (pixel_top << 16) 99 | and r6, r6, r11 @ r6 = pixel_top_dilated 100 | 101 | and r5, r10, r5, lsr #15 @ r5 = ((pixel_pair >> 16) & 0x1FF) << 1 102 | ldrh r5, [r14, r5] @ r5 = pixel_bottom 103 | orr r5, r5, r5, lsl #16 @ r5 = pixel_bottom | (pixel_bottom << 16) 104 | and r5, r5, r11 @ r5 = pixel_bottom_dilated 105 | 106 | mul r5, r4, r5 @ r5 = pixel_bottom * blend_b = bottom_mul 107 | mla r5, r3, r6, r5 @ r5 = (pixel_top * blend_a) + bottom_mul 108 | 109 | and r6, r9, r5, lsr #4 @ r6 = saturation bits 110 | orr r6, r6, r6, lsr #1 @ propogate saturation down msb 111 | orr r6, r6, r6, lsr #2 @ propogate down next two bits 112 | orr r6, r6, r6, lsr #3 @ propogate down next three bits 113 | orr r5, r6, r5, lsr #4 @ mask over result w/saturation 114 | 115 | and r5, r11, r5 @ r5 = (color_dilated >> 4) & 0x07E0F81F 116 | orr r5, r5, r5, lsr #16 @ r5 = color_dilated | (color_dilated >> 16) 117 | strh r5, [r1], #2 @ *screen_dest_ptr = r5, screen_dest_ptr++ 118 | 119 | subs r2, r2, #1 @ counter-- 120 | bne 4b @ go again 121 | 122 | ldmia sp!, { r4, r5, r6, r9, r10, r11, pc } 123 | 124 | 5: 125 | and r5, r10, r5, lsl #1 @ r5 = (pixel_pair & 0x1FF) << 1 126 | ldrh r5, [r14, r5] @ r5 = pixel_top 127 | strh r5, [r1], #2 @ *screen_dest_ptr = r5, screen_dest_ptr++ 128 | 129 | subs r2, r2, #1 @ counter-- 130 | bne 4b @ go again 131 | 132 | ldmia sp!, { r4, r5, r6, r9, r10, r11, pc } 133 | 134 | 135 | 136 | @ The following function isn't complete (only works on run multiples of 8), 137 | @ but unfortunately I don't see much potential for actually being able to 138 | @ use it.. 139 | 140 | #define expand_pixel_pair(reg, temp) ;\ 141 | and temp, r3, reg, lsr #15 ;\ 142 | ldrh temp, [r2, temp] ;\ 143 | ;\ 144 | and reg, r3, reg, lsl #1 ;\ 145 | ldrh reg, [r2, reg] ;\ 146 | ;\ 147 | orr reg, reg, temp, lsl #16 ;\ 148 | 149 | 150 | @ Input: 151 | @ r0 = screen_ptr 152 | @ r1 = start 153 | @ r2 = end 154 | 155 | 1: 156 | .long palette_ram_converted 157 | .long 0x3FE 158 | 159 | expand_normal: 160 | stmdb sp!, { r4, r5, r6, r7, r14 } 161 | 162 | add r0, r0, r1, lsl #1 @ screen_ptr += start 163 | sub r1, r2, r1 @ r1 = end - start 164 | ldr r2, 1b @ r2 = palette_ram_converted 165 | ldr r3, 1b + 4 @ r3 = 0x3FE 166 | 167 | 2: 168 | ldmia r0, { r4, r5, r6, r7 } 169 | 170 | expand_pixel_pair(r4, r14) 171 | expand_pixel_pair(r5, r14) 172 | expand_pixel_pair(r6, r14) 173 | expand_pixel_pair(r7, r14) 174 | 175 | stmia r0!, { r4, r5, r6, r7 } 176 | 177 | subs r1, r1, #8 178 | bne 2b 179 | 180 | ldmia sp!, { r4, r5, r6, r7, pc } 181 | 182 | -------------------------------------------------------------------------------- /gpsp/gms/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2009, Harry Li 3 | # 2011, Antti Pojola < summeli AT summeli.fi> 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | EPOCROOT2 = $(SYMBIAN_SDK_PATH)Epoc32 20 | #path could be easily extended with /c/Program\ Files/CodeSourcery/SourceGLite/bin: 21 | PATH := $(EPOCROOT2)/tools:$(EPOCROOT2)/gcc/bin:$(PATH) 22 | 23 | # Defaults 24 | PKG_PATH = ../sis/$(PROJECT_NAME) 25 | 26 | SRC_PATH = ../src 27 | RSS_PATH = ../data 28 | OBJ_BASE = obj 29 | DIST_BASE = dist 30 | VENDORID = 0 31 | 32 | include config.mk 33 | include defines.mk 34 | 35 | check: 36 | @echo 'SYMBIAN_SDK_PATH is' $(SYMBIAN_SDK_PATH) 37 | @echo 'ACTIVE_PERL is ' $(ACTIVE_PERL) 38 | @echo 'CC_INSTALL_PATH is ' $(CC_INSTALL_PATH) 39 | # @echo 'PATH is ' $(PATH) 40 | # @echo '===============================================================' 41 | 42 | preGCCE: 43 | CC = arm-none-symbianelf-gcc 44 | CXX = arm-none-symbianelf-g++ 45 | LD = arm-none-symbianelf-ld 46 | AS = arm-none-symbianelf-as.exe 47 | AR = arm-none-symbianelf-ar 48 | RAL = $(EPOCROOT2)/RELEASE/ARMV5/LIB 49 | DIST_PATH = $(DIST_BASE)/gcce 50 | OBJ_PATH = $(OBJ_BASE)/gcce 51 | TARGET_MACRO = $(GCCE_MACRO) $(GCCE_WARNING_FLAGS) 52 | 53 | #preDEBUG: 54 | # RAU = $(EPOCROOT2)/RELEASE/ARMV5/UDEB 55 | # COMPFLAGS = -march=armv5t -O0 -mapcs -pipe -nostdinc -c -msoft-float -g \ 56 | # -MD $(DEB_MACRO) -include $(EPOCROOT2)/include/gcce/gcce.h 57 | # LD_EXE_FLAGS = -L$(CC_INSTALL_PATH)/arm-none-symbianelf/lib \ 58 | # -L$(EPOCROOT2)/RELEASE/ARMV5/UDEB \ 59 | # -L$(CC_INSTALL_PATH)/lib/gcc/arm-none-symbianelf/4.4.1 --target1-abs \ 60 | # --no-undefined -nostdlib -shared -Ttext 0x8000 -Tdata 0x400000 \ 61 | # --default-symver -soname $(PROJECT_NAME){000a0000}[$(UID3)].exe \ 62 | # --entry _E32Startup -u _E32Startup \ 63 | # $(EPOCROOT2)/RELEASE/ARMV5/UDEB/EEXE.LIB \ 64 | # -o $(OBJ_PATH)/$(PROJECT_NAME).exe \ 65 | # -Map $(BIN_TARGET).map $^ \ 66 | # $(patsubst %.lib,$(RAL)/%.dso,$(SYSLIBRARY)) \ 67 | # $(RAU)/usrt2_2.lib $(RAL)/dfpaeabi.dso $(RAL)/dfprvct2_2.dso \ 68 | # $(RAL)/drtaeabi.dso $(RAL)/scppnwdl.dso $(RAL)/drtrvct2_2.dso \ 69 | # $(patsubst %.lib,$(RAU)/%.lib,$(STATICLIBRARY)) \ 70 | # -lsupc++ -lgcc 71 | # COPYSYMBOLS = cp $(OBJ_PATH)/$(PROJECT_NAME).$(TARGET_TYPE) $(DIST_PATH)/$(PROJECT_NAME).sym 72 | # COPYEXEC = cp $(DIST_PATH)/$(PROJECT_NAME).$(TARGET_TYPE) $(EPOCROOT2)/release/GCCE/UDEB/$(PROJECT_NAME).$(TARGET_TYPE) 73 | # COPYSYMB = cp $(DIST_PATH)/$(PROJECT_NAME).sym $(EPOCROOT2)/release/GCCE/UDEB/$(PROJECT_NAME).sym 74 | # COPYMAP = cp $(DIST_PATH)/$(PROJECT_NAME).$(TARGET_TYPE).map $(EPOCROOT2)/release/GCCE/UDEB/$(PROJECT_NAME).$(TARGET_TYPE).map 75 | # COPYLIB = cp $(DIST_PATH)/$(PROJECT_NAME).$(TARGET_TYPE) $(EPOCROOT2)/release/ARMV5/UDEB/$(PROJECT_NAME).lib 76 | 77 | preREL: 78 | RAU = $(EPOCROOT2)/RELEASE/ARMV5/UREL 79 | COMPFLAGS = -march=armv5t -O2 -mapcs -pipe -nostdinc -c -msoft-float \ 80 | -MD $(REL_MACRO) -include $(EPOCROOT2)/include/gcce/gcce.h 81 | LD_EXE_FLAGS = -L$(CC_INSTALL_PATH)/arm-none-symbianelf/lib \ 82 | -L$(EPOCROOT2)/RELEASE/ARMV5/UREL \ 83 | -L$(CC_INSTALL_PATH)/lib/gcc/arm-none-symbianelf/4.4.1 --target1-abs \ 84 | --no-undefined -nostdlib -shared -Ttext 0x8000 -Tdata 0x400000 \ 85 | --default-symver -soname $(PROJECT_NAME){000a0000}[$(UID3)].exe \ 86 | --entry _E32Startup -u _E32Startup \ 87 | $(EPOCROOT2)/RELEASE/ARMV5/UREL/EEXE.LIB \ 88 | -o $(OBJ_PATH)/$(PROJECT_NAME).exe \ 89 | -Map $(BIN_TARGET).map $^ \ 90 | $(patsubst %.lib,$(RAL)/%.dso,$(SYSLIBRARY)) \ 91 | $(RAU)/usrt2_2.lib $(RAL)/dfpaeabi.dso $(RAL)/dfprvct2_2.dso \ 92 | $(RAL)/drtaeabi.dso $(RAL)/scppnwdl.dso $(RAL)/drtrvct2_2.dso \ 93 | $(patsubst %.lib,$(RAU)/%.lib,$(STATICLIBRARY)) \ 94 | -lsupc++ -lgcc 95 | COPYSYMBOLS = cp $(OBJ_PATH)/$(PROJECT_NAME).$(TARGET_TYPE) $(DIST_PATH)/$(PROJECT_NAME).sym 96 | COPYEXEC = cp $(DIST_PATH)/$(PROJECT_NAME).$(TARGET_TYPE) $(EPOCROOT2)/release/GCCE/UREL/$(PROJECT_NAME).$(TARGET_TYPE) 97 | COPYSYMB = cp $(DIST_PATH)/$(PROJECT_NAME).sym $(EPOCROOT2)/release/GCCE/UREL/$(PROJECT_NAME).sym 98 | COPYMAP = cp $(DIST_PATH)/$(PROJECT_NAME).$(TARGET_TYPE).map $(EPOCROOT2)/release/GCCE/UREL/$(PROJECT_NAME).$(TARGET_TYPE).map 99 | COPYLIB = cp $(DIST_PATH)/$(PROJECT_NAME).$(TARGET_TYPE) $(EPOCROOT2)/release/ARMV5/UREL/$(PROJECT_NAME).$(TARGET_TYPE) 100 | 101 | preALL: 102 | CFLAGS += $(COMPFLAGS) $(UNICODE_MACRO) $(TARGET_MACRO) $(SYMBIAN_MACRO) \ 103 | $(EXE_MACRO) $(addprefix -D ,$(PRJ_MACRO)) \ 104 | -D__PRODUCT_INCLUDE__=$(OS_HRH) -I $(SRC_PATH) -I $(VARIANT) \ 105 | $(addprefix -I ,$(USERINCLUDE)) $(addprefix -I ,$(SYSINCLUDE)) \ 106 | -I $(CC_INSTALL_PATH)/lib/gcc/arm-none-symbianelf/4.4.1/include 107 | CXXFLAGS = $(CFLAGS) -Wno-ctor-dtor-privacy -x c++ $(CPP_MACRO) 108 | C_OBJS = $(patsubst %.c,$(OBJ_PATH)/%.o,$(CSRCS)) 109 | CXX_OBJS = $(patsubst %.cpp,$(OBJ_PATH)/%.o,$(CXXSRCS)) 110 | A_OBJS = $(patsubst %.S,$(OBJ_PATH)/%.o,$(ASRCS)) 111 | BIN_TARGET = $(DIST_PATH)/$(PROJECT_NAME).$(TARGET_TYPE) 112 | ASFLAGS = -mfloat-abi=soft 113 | 114 | $(IMG_TARGETS): $(IMG_SRCS) 115 | $(EPOCROOT2)/tools/mifconv $@ $(subst /,//,$(IMG_ARGS)) $^ 116 | 117 | $(RSS_TARGETS): $(DIST_PATH)/%.rsc : $(RSS_PATH)/%.rss 118 | $(ACTIVE_PERL) -S $(EPOCROOT2)/tools/epocrc.pl -m045,046,047 \ 119 | $(addprefix -I ,$(RSS_PATH)) $(addprefix -I ,$(USERINCLUDE)) -I- \ 120 | $(addprefix -I ,$(SYSINCLUDE)) $(addprefix -D ,$(LANG_MACRO)) \ 121 | -I $(VARIANT) -t$(OBJ_PATH) -u -v $< -o$@ \ 122 | -h$(EPOCROOT2)/include/$(notdir $(basename $@)).rsg 123 | 124 | $(CXX_OBJS): $(OBJ_PATH)/%.o : $(SRC_PATH)/%.cpp 125 | $(CXX) $(CXXFLAGS) -o $@ $< 126 | 127 | $(C_OBJS): $(OBJ_PATH)/%.o : $(SRC_PATH)/%.c 128 | $(CC) $(CFLAGS) -o $@ $< 129 | 130 | $(A_OBJS): $(OBJ_PATH)/%.o : $(SRC_PATH)/%.S 131 | $(CC) -c -o $@ $^ 132 | 133 | $(BIN_TARGET): $(C_OBJS) $(CXX_OBJS) $(A_OBJS) 134 | ifeq ($(TARGET_TYPE),LIB) 135 | $(AR) rsc $(BIN_TARGET) $(C_OBJS) $(CXX_OBJS) $(A_OBJS) 136 | $(COPYLIB) 137 | else 138 | $(LD) $(LD_EXE_FLAGS) 139 | $(COPYSYMBOLS) 140 | $(EPOCROOT2)/tools/elf2e32 --sid=0x$(SECUREID) --stack=$(EPOCSTACKSIZE) --heap=$(EPOCHEAPSIZE) \ 141 | --vid=0x$(VENDORID) --uid1=0x1000007a --uid2=0x$(UID2) --uid3=0x$(UID3) \ 142 | --capability=$(CAPABILITY) --dlldata --defoutput=$(PROJECT_NAME).def \ 143 | --fpu=softvfp --targettype=$(TARGET_TYPE) \ 144 | --output=$@ --elfinput=$(OBJ_PATH)/$(PROJECT_NAME).$(TARGET_TYPE) \ 145 | --linkas=$(PROJECT_NAME){000a0000}[$(UID3)].$(TARGET_TYPE) \ 146 | --libpath=$(RAL) 147 | $(COPYEXEC) 148 | $(COPYSYMB) 149 | $(COPYMAP) 150 | endif 151 | pack: buildg $(PKG_PATH).pkg 152 | $(EPOCROOT2)/tools/makesis.exe -v $(PKG_PATH).pkg $(PKG_PATH).sis 153 | $(EPOCROOT2)/tools/signsis.exe -v $(PKG_PATH).sis $(PKG_PATH).sisx \ 154 | $(CERT) $(KEY) $(PASS) 155 | 156 | cleang: check preGCCE preALL 157 | rm -rf $(IMG_TARGETS) 158 | rm -rf $(RSS_TARGETS) 159 | rm -rf $(C_OBJS) $(CXX_OBJS) $(A_OBJS) 160 | rm -rf $(BIN_TARGET) 161 | 162 | cleanw: check 163 | 164 | buildw: check 165 | 166 | clean: cleang 167 | 168 | debug: check preGCCE preDEBUG preALL $(IMG_TARGETS) $(RSS_TARGETS) $(BIN_TARGET) 169 | 170 | release: check preGCCE preREL preALL $(IMG_TARGETS) $(RSS_TARGETS) $(BIN_TARGET) 171 | -------------------------------------------------------------------------------- /gpsp4cute/gfx/gpsp.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | ]> 6 | 10 | 11 | 12 | 13 | 14 | 32 | 33 | 34 | 35 | 36 | 52 | 53 | 55 | 56 | 60 | 62 | 63 | 66 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 86 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /gpsp/inc/main.h: -------------------------------------------------------------------------------- 1 | /* gameplaySP 2 | * 3 | * Copyright (C) 2006 Exophase 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef MAIN_H 21 | #define MAIN_H 22 | 23 | typedef enum 24 | { 25 | TIMER_INACTIVE, 26 | TIMER_PRESCALE, 27 | TIMER_CASCADE 28 | } timer_status_type; 29 | 30 | typedef enum 31 | { 32 | TIMER_NO_IRQ, 33 | TIMER_TRIGGER_IRQ 34 | } timer_irq_type; 35 | 36 | 37 | typedef enum 38 | { 39 | TIMER_DS_CHANNEL_NONE, 40 | TIMER_DS_CHANNEL_A, 41 | TIMER_DS_CHANNEL_B, 42 | TIMER_DS_CHANNEL_BOTH 43 | } timer_ds_channel_type; 44 | 45 | typedef struct 46 | { 47 | s32 count; 48 | u32 reload; 49 | u32 prescale; 50 | u32 stop_cpu_ticks; 51 | fixed16_16 frequency_step; 52 | timer_ds_channel_type direct_sound_channels; 53 | timer_irq_type irq; 54 | timer_status_type status; 55 | } timer_type; 56 | 57 | typedef enum 58 | { 59 | auto_frameskip, 60 | manual_frameskip, 61 | no_frameskip 62 | } frameskip_type; 63 | 64 | extern u32 cpu_ticks; 65 | extern u32 frame_ticks; 66 | extern u32 execute_cycles; 67 | extern frameskip_type current_frameskip_type; 68 | extern u32 frameskip_value; 69 | extern u32 random_skip; 70 | extern u32 global_cycles_per_instruction; 71 | extern u32 synchronize_flag; 72 | extern u32 skip_next_frame; 73 | 74 | extern timer_type timer[4]; 75 | static u32 prescale_table[] = { 0, 6, 8, 10 }; 76 | 77 | extern u32 cycle_memory_access; 78 | extern u32 cycle_pc_relative_access; 79 | extern u32 cycle_sp_relative_access; 80 | extern u32 cycle_block_memory_access; 81 | extern u32 cycle_block_memory_sp_access; 82 | extern u32 cycle_block_memory_words; 83 | extern u32 cycle_dma16_words; 84 | extern u32 cycle_dma32_words; 85 | extern u32 flush_ram_count; 86 | 87 | extern u64 base_timestamp; 88 | 89 | extern u8 main_path[512]; 90 | 91 | extern u32 update_backup_flag; 92 | extern u32 clock_speed; 93 | 94 | extern u32 gp2x_fps_debug; 95 | 96 | 97 | //export some functions to be called from the c++ side 98 | #ifdef __SYMBIAN32__ 99 | #ifdef __cplusplus 100 | extern "C" { 101 | #endif 102 | 103 | u32 update_gba(); 104 | void reset_gba(); 105 | void synchronize(); 106 | void quit(); 107 | void delay_us(u32 us_count); 108 | void get_ticks_us(u64 *tick_return); 109 | void game_name_ext(u8 *src, u8 *buffer, u8 *extension); 110 | void main_write_mem_savestate(file_tag_type savestate_file); 111 | void main_read_savestate(file_tag_type savestate_file); 112 | 113 | #ifdef __cplusplus 114 | }; 115 | #endif 116 | #endif 117 | 118 | 119 | #ifdef PSP_BUILD 120 | 121 | u32 file_length(u8 *filename, s32 dummy); 122 | 123 | extern u32 real_frame_count; 124 | extern u32 virtual_frame_count; 125 | extern u32 max_frameskip; 126 | extern u32 num_skipped_frames; 127 | 128 | #endif 129 | 130 | 131 | #ifdef __SYMBIAN32__ 132 | extern u64 frame_count_initial_timestamp; 133 | extern u32 real_frame_count; 134 | extern u32 virtual_frame_count; 135 | extern u32 max_frameskip; 136 | extern u32 num_skipped_frames; 137 | 138 | #endif 139 | 140 | 141 | #ifdef PC_BUILD 142 | 143 | u32 file_length(u8 *dummy, FILE *fp); 144 | 145 | #endif 146 | 147 | #define count_timer(timer_number) \ 148 | timer[timer_number].reload = 0x10000 - value; \ 149 | if(timer_number < 2) \ 150 | { \ 151 | u32 timer_reload = \ 152 | timer[timer_number].reload << timer[timer_number].prescale; \ 153 | sound_update_frequency_step(timer_number); \ 154 | } \ 155 | 156 | #define adjust_sound_buffer(timer_number, channel) \ 157 | if(timer[timer_number].direct_sound_channels & (0x01 << channel)) \ 158 | { \ 159 | direct_sound_channel[channel].buffer_index = \ 160 | (direct_sound_channel[channel].buffer_index + buffer_adjust) % \ 161 | BUFFER_SIZE; \ 162 | } \ 163 | 164 | #define trigger_timer(timer_number) \ 165 | if(value & 0x80) \ 166 | { \ 167 | if(timer[timer_number].status == TIMER_INACTIVE) \ 168 | { \ 169 | u32 prescale = prescale_table[value & 0x03]; \ 170 | u32 timer_reload = timer[timer_number].reload; \ 171 | \ 172 | if((value >> 2) & 0x01) \ 173 | timer[timer_number].status = TIMER_CASCADE; \ 174 | else \ 175 | timer[timer_number].status = TIMER_PRESCALE; \ 176 | \ 177 | timer[timer_number].prescale = prescale; \ 178 | timer[timer_number].irq = (value >> 6) & 0x01; \ 179 | \ 180 | address16(io_registers, 0x100 + (timer_number * 4)) = \ 181 | -timer_reload; \ 182 | \ 183 | timer_reload <<= prescale; \ 184 | timer[timer_number].count = timer_reload; \ 185 | \ 186 | if(timer_reload < execute_cycles) \ 187 | execute_cycles = timer_reload; \ 188 | \ 189 | if(timer_number < 2) \ 190 | { \ 191 | u32 buffer_adjust = \ 192 | (u32)(((float)(cpu_ticks - timer[timer_number].stop_cpu_ticks) * \ 193 | sound_frequency) / 16777216.0) * 2; \ 194 | \ 195 | sound_update_frequency_step(timer_number); \ 196 | adjust_sound_buffer(timer_number, 0); \ 197 | adjust_sound_buffer(timer_number, 1); \ 198 | } \ 199 | } \ 200 | } \ 201 | else \ 202 | { \ 203 | if(timer[timer_number].status != TIMER_INACTIVE) \ 204 | { \ 205 | timer[timer_number].status = TIMER_INACTIVE; \ 206 | timer[timer_number].stop_cpu_ticks = cpu_ticks; \ 207 | } \ 208 | } \ 209 | address16(io_registers, 0x102 + (timer_number * 4)) = value; \ 210 | 211 | void change_ext(u8 *src, u8 *buffer, u8 *extension); 212 | 213 | #endif 214 | 215 | 216 | -------------------------------------------------------------------------------- /gpsp4cute/videosettings.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | videosettingsClass 4 | 5 | 6 | 7 | 0 8 | 0 9 | 640 10 | 150 11 | 12 | 13 | 14 | videosettings 15 | 16 | 17 | 18 | 19 | 0 20 | 0 21 | 640 22 | 150 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 10 36 | 10 37 | 621 38 | 136 39 | 40 | 41 | 42 | 43 | 44 | 45 | Qt::Horizontal 46 | 47 | 48 | QSizePolicy::Fixed 49 | 50 | 51 | 52 | 5 53 | 20 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 0 65 | 0 66 | 67 | 68 | 69 | 70 | Nokia Sans SemiBold 71 | 6 72 | 75 73 | true 74 | 75 | 76 | 77 | QGroupBox::title { left: 20px;top: -3px} 78 | 79 | 80 | Button Opacity 81 | 82 | 83 | 84 | 85 | 10 86 | 20 87 | 571 88 | 39 89 | 90 | 91 | 92 | 93 | 94 | 95 | Qt::Horizontal 96 | 97 | 98 | QSizePolicy::Fixed 99 | 100 | 101 | 102 | 10 103 | 20 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 1 113 | 0 114 | 115 | 116 | 117 | 4 118 | 119 | 120 | 1 121 | 122 | 123 | Qt::Horizontal 124 | 125 | 126 | false 127 | 128 | 129 | QSlider::TicksBelow 130 | 131 | 132 | 133 | 134 | 135 | 136 | Qt::Horizontal 137 | 138 | 139 | QSizePolicy::Fixed 140 | 141 | 142 | 143 | 10 144 | 20 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 0 154 | 0 155 | 156 | 157 | 158 | 159 | 35 160 | 0 161 | 162 | 163 | 164 | 100% 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 270 179 | 50 180 | 181 | 182 | 183 | 184 | keep aspect ratio 185 | 186 | 187 | 188 | 189 | FullScreen 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 0 199 | 0 200 | 201 | 202 | 203 | 204 | 150 205 | 50 206 | 207 | 208 | 209 | 210 | Nokia Sans SemiBold 211 | 6 212 | 75 213 | true 214 | 215 | 216 | 217 | QGroupBox::title { left: 20px;top: -3px} 218 | 219 | 220 | FPS 221 | 222 | 223 | 224 | 225 | 10 226 | 20 227 | 131 228 | 20 229 | 230 | 231 | 232 | 233 | 7 234 | 235 | 236 | 237 | Show FPS 238 | 239 | 240 | 241 | 35 242 | 35 243 | 244 | 245 | 246 | false 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | --------------------------------------------------------------------------------