rpcsx/rpcs3/main.cpp

1243 lines
36 KiB
C++
Raw Normal View History

2020-12-05 13:08:24 +01:00
// Qt5.10+ frontend implementation for rpcs3. Known to work on Windows, Linux, Mac
// by Sacha Refshauge, Megamouse and flash-fire
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
2020-02-22 20:42:49 +01:00
#include <iostream>
#include <chrono>
#include <sstream>
#include <iomanip>
2020-02-22 20:42:49 +01:00
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
#include <QApplication>
#include <QCommandLineParser>
2017-07-13 17:34:37 +02:00
#include <QFileInfo>
#include <QTimer>
2017-11-23 16:37:08 +01:00
#include <QObject>
2019-09-08 22:49:58 +02:00
#include <QStyleFactory>
#include <QByteArray>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonDocument>
#include <QMessageBox>
#include <QMetaEnum>
#include <QStandardPaths>
2019-06-18 04:02:06 +02:00
#include "rpcs3qt/gui_application.h"
#include "rpcs3qt/fatal_error_dialog.h"
#include "rpcs3qt/curl_handle.h"
#include "rpcs3qt/main_window.h"
#include "rpcs3qt/uuid.h"
#include "headless_application.h"
2017-11-23 16:37:08 +01:00
#include "Utilities/sema.h"
2022-05-09 23:13:43 +02:00
#include "Crypto/decrypt_binaries.h"
#ifdef _WIN32
#include <windows.h>
#include "util/dyn_lib.hpp"
// TODO(cjj19970505@live.cn)
// When compiling with WIN32_LEAN_AND_MEAN definition
// NTSTATUS is defined in CMake build but not in VS build
// May be caused by some different header pre-inclusion between CMake and VS configurations.
#if !defined(NTSTATUS)
// Copied from ntdef.h
typedef _Return_type_success_(return >= 0) LONG NTSTATUS;
#endif
2019-06-18 04:02:06 +02:00
DYNAMIC_IMPORT("ntdll.dll", NtQueryTimerResolution, NTSTATUS(PULONG MinimumResolution, PULONG MaximumResolution, PULONG CurrentResolution));
DYNAMIC_IMPORT("ntdll.dll", NtSetTimerResolution, NTSTATUS(ULONG DesiredResolution, BOOLEAN SetResolution, PULONG CurrentResolution));
#else
#include <unistd.h>
#include <spawn.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <signal.h>
#endif
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
#ifdef __linux__
#include <sys/time.h>
#include <sys/resource.h>
#endif
#if defined(__APPLE__)
#include <dispatch/dispatch.h>
#endif
#include "Utilities/Config.h"
#include "Utilities/Thread.h"
#include "Utilities/File.h"
#include "Utilities/StrUtil.h"
#include "rpcs3_version.h"
2020-02-22 20:42:49 +01:00
#include "Emu/System.h"
#include "Emu/system_utils.hpp"
#include <thread>
#include <charconv>
#include "util/sysinfo.hpp"
[Qt/Input] Improve pad_settings_dialog a bit (#3611) * Input: further work on remapping Xinput and begin work on remapping DS4 * Input: Improve pad_settings_dialog a bit and begin Remapping for XInput * Input: begin evdev remapping and change all handlers to use cfg::string * Input: finish work on remapping evdev and some more crap * Input: finish work on remapping Xinput and DS4 * Input: add DS4 Colors to DS4 config * Input: Improve DS4 deadzone scaling Jarves made some mistakes, so I'll fix them in the follow up commit * Input: fix Jarves fixes on DS4 deadzone and remove unnecessary usage of toUtf8 * Input: add primitive batterychecks to XInput and DS4 * Input: add mmjoystick remapping * Input: Fix evdev and some Vibration issues * Input: adjust capabilities to fix stick input for games like LoS 2 also fix threshold slider minimum also add ps button to all the handlers * Input: Further evdev work based on danilaml code review and own debugging: Fixed path issue, <= 0 issue, some captures, const, axis with same codes. Adds a map to each device that differentiates negative and positive axis mappings. adjusted rest of the file to tabs (ListDevices and beginning of threadProc) * Input: use 20ms vibration update time for xbox one elite controllers. * Input: Fix return type of Clamp() * Input: Evdev Fix * Input: Evdev Optional GetNextButtonPress presumably better than the other * Input: review changes * Input: evdev: fix wrong index in axis handling move bindpadtodevice down to keep consistency between handlers and not get crazy * Input: evdev: fix expensive add_device in GetNextButtonPress * cleanup * Input: mmjoy: fix type * Input: evdev: final fixes * Input: evdev: exclude unnecessary buttons while mapping Xbox 360 or DS4 * Input: add deadzone preview by passing necessary values in callback use 0.5 of max value for threshold in pad dialog * Input: get rid of all-uppercase variables
2017-11-27 22:31:15 +01:00
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
static semaphore<> s_qt_init;
static atomic_t<bool> s_headless = false;
static atomic_t<bool> s_no_gui = false;
static atomic_t<char*> s_argv0;
extern thread_local std::string(*g_tls_log_prefix)();
extern thread_local std::string_view g_tls_serialize_name;
#ifndef _WIN32
extern char **environ;
#endif
2017-11-23 16:37:08 +01:00
LOG_CHANNEL(sys_log, "SYS");
2020-11-02 23:33:07 +01:00
LOG_CHANNEL(q_debug, "QDEBUG");
[[noreturn]] extern void report_fatal_error(std::string_view _text)
2017-11-23 16:37:08 +01:00
{
2022-09-08 13:34:17 +02:00
extern void jit_announce(uptr, usz, std::string_view);
std::string buf;
// Check if thread id is in string
if (_text.find("\nThread id = "sv) == umax)
{
// Copy only when needed
buf = std::string(_text);
// Always print thread id
fmt::append(buf, "\n\nThread id = %u.", thread_ctrl::get_tid());
}
if (!g_tls_serialize_name.empty())
{
// Copy only when needed
if (!buf.empty())
{
buf = std::string(_text);
}
fmt::append(buf, "\nSerialized Object: %s", g_tls_serialize_name);
}
std::string_view text = buf.empty() ? _text : buf;
if (s_headless)
{
#ifdef _WIN32
if (AttachConsole(ATTACH_PARENT_PROCESS) || AllocConsole())
[[maybe_unused]] const auto con_out = freopen("conout$", "w", stderr);
#endif
std::cerr << fmt::format("RPCS3: %s\n", text);
2022-09-08 13:34:17 +02:00
#ifdef __linux__
jit_announce(0, 0, "");
#endif
std::abort();
}
const bool local = s_qt_init.try_lock();
2017-11-23 16:37:08 +01:00
// Possibly created and assigned here
static QScopedPointer<QCoreApplication> app;
if (local)
2017-11-23 16:37:08 +01:00
{
static int argc = 1;
static char* argv[] = {+s_argv0};
app.reset(new QApplication{argc, argv});
2017-11-23 16:37:08 +01:00
}
2020-06-04 08:19:56 +02:00
else
{
std::cerr << fmt::format("RPCS3: %s\n", text);
}
static auto show_report = [](std::string_view text)
{
fatal_error_dialog dlg(text);
dlg.exec();
};
#if defined(__APPLE__)
if (!pthread_main_np())
{
dispatch_sync_f(dispatch_get_main_queue(), &text, [](void* text){ show_report(*static_cast<std::string_view*>(text)); });
}
else
#endif
{
// If Qt is already initialized, spawn a new RPCS3 process with an --error argument
if (local)
{
show_report(text);
#ifdef _WIN32
ExitProcess(0);
#else
kill(getpid(), SIGKILL);
#endif
}
2021-04-07 23:05:18 +02:00
#ifdef _WIN32
2021-04-07 23:05:18 +02:00
wchar_t buffer[32767];
GetModuleFileNameW(nullptr, buffer, sizeof(buffer) / 2);
const std::wstring arg(text.cbegin(), text.cend()); // ignore unicode for now
_wspawnl(_P_WAIT, buffer, buffer, L"--error", arg.c_str(), nullptr);
#else
2021-04-07 23:05:18 +02:00
pid_t pid;
std::vector<char> data(text.data(), text.data() + text.size() + 1);
std::string run_arg = +s_argv0;
std::string err_arg = "--error";
2021-04-07 23:05:18 +02:00
if (run_arg.find_first_of('/') == umax)
{
// AppImage has "rpcs3" in argv[0], can't just execute it
#ifdef __linux__
2021-04-07 23:05:18 +02:00
char buffer[PATH_MAX]{};
if (::readlink("/proc/self/exe", buffer, sizeof(buffer) - 1) > 0)
{
2021-04-07 23:05:18 +02:00
printf("Found exec link: %s\n", buffer);
run_arg = buffer;
}
#endif
}
2021-04-07 23:05:18 +02:00
char* argv[] = {run_arg.data(), err_arg.data(), data.data(), nullptr};
int ret = posix_spawn(&pid, run_arg.c_str(), nullptr, nullptr, argv, environ);
if (ret == 0)
{
int status;
waitpid(pid, &status, 0);
}
else
{
std::fprintf(stderr, "posix_spawn() failed: %d\n", ret);
}
#endif
}
2017-11-23 16:37:08 +01:00
2022-09-08 13:34:17 +02:00
#ifdef __linux__
jit_announce(0, 0, "");
#endif
std::abort();
2017-11-23 16:37:08 +01:00
}
2021-04-03 17:11:04 +02:00
struct fatal_error_listener final : logs::listener
{
2021-04-03 17:11:04 +02:00
~fatal_error_listener() override = default;
void log(u64 /*stamp*/, const logs::message& msg, const std::string& prefix, const std::string& text) override
{
if (msg == logs::level::fatal)
{
std::string _msg = "RPCS3: ";
if (!prefix.empty())
{
_msg += prefix;
_msg += ": ";
}
if (msg->name && '\0' != *msg->name)
{
_msg += msg->name;
_msg += ": ";
}
_msg += text;
_msg += '\n';
#ifdef _WIN32
// If launched from CMD
if (AttachConsole(ATTACH_PARENT_PROCESS))
[[maybe_unused]] const auto con_out = freopen("CONOUT$", "w", stderr);
#endif
// Output to error stream as is
std::cerr << _msg;
#ifdef _WIN32
if (IsDebuggerPresent())
{
// Output string to attached debugger
OutputDebugStringA(_msg.c_str());
}
#endif
// Pause emulation if fatal error encountered
Emu.Pause(true);
}
}
};
2022-05-09 23:13:43 +02:00
// Arguments that force a headless application (need to be checked in create_application)
constexpr auto arg_headless = "headless";
2022-05-09 23:13:43 +02:00
constexpr auto arg_decrypt = "decrypt";
constexpr auto arg_commit_db = "get-commit-db";
// Arguments that can be used with a gui application
constexpr auto arg_no_gui = "no-gui";
constexpr auto arg_high_dpi = "hidpi";
constexpr auto arg_rounding = "dpi-rounding";
constexpr auto arg_styles = "styles";
constexpr auto arg_style = "style";
constexpr auto arg_stylesheet = "stylesheet";
constexpr auto arg_config = "config";
constexpr auto arg_q_debug = "qDebug";
constexpr auto arg_error = "error";
constexpr auto arg_updating = "updating";
constexpr auto arg_user_id = "user-id";
constexpr auto arg_installfw = "installfw";
constexpr auto arg_installpkg = "installpkg";
constexpr auto arg_savestate = "savestate";
constexpr auto arg_timer = "high-res-timer";
constexpr auto arg_verbose_curl = "verbose-curl";
constexpr auto arg_any_location = "allow-any-location";
2019-06-18 04:02:06 +02:00
2019-10-04 18:04:23 +02:00
int find_arg(std::string arg, int& argc, char* argv[])
2019-06-18 04:02:06 +02:00
{
arg = "--" + arg;
for (int i = 0; i < argc; ++i) // It's not guaranteed that argv 0 is the executable.
if (!strcmp(arg.c_str(), argv[i]))
2019-10-04 18:04:23 +02:00
return i;
return -1;
}
2022-05-09 23:13:43 +02:00
QCoreApplication* create_application(int& argc, char* argv[])
{
2022-05-09 23:13:43 +02:00
if (find_arg(arg_headless, argc, argv) != -1 ||
find_arg(arg_decrypt, argc, argv) != -1 ||
find_arg(arg_commit_db, argc, argv) != -1)
{
return new headless_application(argc, argv);
2022-05-09 23:13:43 +02:00
}
#ifdef __linux__
// set the DISPLAY variable in order to open web browsers
if (qEnvironmentVariable("DISPLAY", "").isEmpty())
{
qputenv("DISPLAY", ":0");
}
2020-07-29 13:21:49 +02:00
// Set QT_AUTO_SCREEN_SCALE_FACTOR to 0. This value is deprecated but still seems to make problems on some distros
if (!qEnvironmentVariable("QT_AUTO_SCREEN_SCALE_FACTOR", "").isEmpty())
2020-07-29 13:21:49 +02:00
{
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "0");
2020-07-29 13:21:49 +02:00
}
#endif
2019-10-04 18:04:23 +02:00
bool use_high_dpi = true;
const int i_hdpi = find_arg(arg_high_dpi, argc, argv);
if (i_hdpi != -1)
2019-10-04 18:04:23 +02:00
{
const std::string cmp_str = "0";
const auto i_hdpi_2 = (argc > (i_hdpi + 1)) ? (i_hdpi + 1) : 0;
const auto high_dpi_setting = (i_hdpi_2 && !strcmp(cmp_str.c_str(), argv[i_hdpi_2])) ? "0" : "1";
// Set QT_ENABLE_HIGHDPI_SCALING from environment. Defaults to cli argument, which defaults to 1.
use_high_dpi = "1" == qEnvironmentVariable("QT_ENABLE_HIGHDPI_SCALING", high_dpi_setting);
2019-10-04 18:04:23 +02:00
}
// AA_EnableHighDpiScaling has to be set before creating a QApplication
QApplication::setAttribute(use_high_dpi ? Qt::AA_EnableHighDpiScaling : Qt::AA_DisableHighDpiScaling);
if (use_high_dpi)
{
// Set QT_SCALE_FACTOR_ROUNDING_POLICY from environment. Defaults to cli argument, which defaults to PassThrough.
Qt::HighDpiScaleFactorRoundingPolicy rounding_val = Qt::HighDpiScaleFactorRoundingPolicy::PassThrough;
const QMetaEnum meta_enum = QMetaEnum::fromType<Qt::HighDpiScaleFactorRoundingPolicy>();
QString rounding_str_cli = meta_enum.valueToKey(static_cast<int>(rounding_val));
const auto check_dpi_rounding_arg = [&rounding_str_cli, &rounding_val, &meta_enum](const char* val) -> bool
{
// Try to find out if the argument is a valid string representation of Qt::HighDpiScaleFactorRoundingPolicy
bool ok{false};
if (const int enum_index = meta_enum.keyToValue(val, &ok); ok)
{
rounding_str_cli = meta_enum.valueToKey(enum_index);
rounding_val = static_cast<Qt::HighDpiScaleFactorRoundingPolicy>(enum_index);
}
return ok;
};
if (const int i_rounding = find_arg(arg_rounding, argc, argv); i_rounding != -1)
{
2021-08-28 18:14:47 +02:00
if (const int i_rounding_2 = i_rounding + 1; argc > i_rounding_2)
{
if (const auto arg_val = argv[i_rounding_2]; !check_dpi_rounding_arg(arg_val))
{
const std::string msg = fmt::format("The command line value %s for %s is not allowed. Please use a valid value for Qt::HighDpiScaleFactorRoundingPolicy.", arg_val, arg_rounding);
sys_log.error("%s", msg); // Don't exit with fatal error. The resulting dialog might be unreadable with dpi problems.
std::cerr << msg << std::endl;
}
}
}
// Get the environment variable. Fallback to cli argument.
rounding_str_cli = qEnvironmentVariable("QT_SCALE_FACTOR_ROUNDING_POLICY", rounding_str_cli);
if (!check_dpi_rounding_arg(rounding_str_cli.toStdString().c_str()))
{
const std::string msg = fmt::format("The value %s for the environment variable QT_SCALE_FACTOR_ROUNDING_POLICY is not allowed. Please use a valid value for Qt::HighDpiScaleFactorRoundingPolicy.", rounding_str_cli.toStdString());
sys_log.error("%s", msg); // Don't exit with fatal error. The resulting dialog might be unreadable with dpi problems.
std::cerr << msg << std::endl;
}
QApplication::setHighDpiScaleFactorRoundingPolicy(rounding_val);
}
2019-06-18 04:02:06 +02:00
return new gui_application(argc, argv);
}
2020-11-02 23:33:07 +01:00
void log_q_debug(QtMsgType type, const QMessageLogContext& context, const QString& msg)
{
2021-04-07 23:05:18 +02:00
Q_UNUSED(context)
2020-11-02 23:33:07 +01:00
switch (type)
{
case QtDebugMsg: q_debug.trace("%s", msg.toStdString()); break;
case QtInfoMsg: q_debug.notice("%s", msg.toStdString()); break;
case QtWarningMsg: q_debug.warning("%s", msg.toStdString()); break;
case QtCriticalMsg: q_debug.error("%s", msg.toStdString()); break;
case QtFatalMsg: q_debug.fatal("%s", msg.toStdString()); break;
}
}
template <>
void fmt_class_string<std::chrono::sys_time<typename std::chrono::system_clock::duration>>::format(std::string& out, u64 arg)
{
std::ostringstream ss;
const std::time_t dateTime = std::chrono::system_clock::to_time_t(get_object(arg));
const std::tm tm = *std::localtime(&dateTime);
ss << std::put_time(&tm, "%Y-%m-%eT%H:%M:%S");
out += ss.str();
}
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
int main(int argc, char** argv)
{
#ifdef _WIN32
ULONG64 intro_cycles{};
QueryThreadCycleTime(GetCurrentThread(), &intro_cycles);
#elif defined(RUSAGE_THREAD)
struct ::rusage intro_stats{};
::getrusage(RUSAGE_THREAD, &intro_stats);
const u64 intro_time = (intro_stats.ru_utime.tv_sec + intro_stats.ru_stime.tv_sec) * 1000000000ull + (intro_stats.ru_utime.tv_usec + intro_stats.ru_stime.tv_usec) * 1000ull;
#endif
s_argv0 = argv[0]; // Save for report_fatal_error
// Only run RPCS3 to display an error
if (int err_pos = find_arg(arg_error, argc, argv); err_pos != -1)
{
// Reconstruction of the error from multiple args
std::string error;
for (int i = err_pos + 1; i < argc; i++)
{
if (i > err_pos + 1)
error += ' ';
error += argv[i];
}
report_fatal_error(error);
}
const std::string lock_name = fs::get_cache_dir() + "RPCS3.buf";
static fs::file instance_lock;
// True if an argument --updating found
const bool is_updating = find_arg(arg_updating, argc, argv) != -1;
// Keep trying to lock the file for ~2s normally, and for ~10s in the case of --updating
for (u32 num = 0; num < (is_updating ? 500u : 100u) && !instance_lock.open(lock_name, fs::rewrite + fs::lock); num++)
{
std::this_thread::sleep_for(20ms);
}
if (!instance_lock)
{
if (fs::g_tls_error == fs::error::acces)
{
if (fs::exists(lock_name))
{
2022-05-30 19:35:41 +02:00
report_fatal_error("Another instance of RPCS3 is running.\nClose it or kill its process, if necessary.");
}
2021-04-07 23:05:18 +02:00
report_fatal_error("Cannot create RPCS3.log (access denied)."
#ifdef _WIN32
"\nNote that RPCS3 cannot be installed in Program Files or similar directories with limited permissions."
#else
"\nPlease, check RPCS3 permissions in '~/.config/rpcs3'."
#endif
2021-04-07 23:05:18 +02:00
);
}
2021-04-07 23:05:18 +02:00
report_fatal_error(fmt::format("Cannot create RPCS3.log (error %s)", fs::g_tls_error));
}
#ifdef _WIN32
if (!SetProcessWorkingSetSize(GetCurrentProcess(), 0x80000000, 0xC0000000)) // 2-3 GiB
{
report_fatal_error("Not enough memory for RPCS3 process.");
}
2022-04-09 14:51:22 +02:00
WSADATA wsa_data;
WSAStartup(MAKEWORD(2, 2), &wsa_data);
#endif
ensure(thread_ctrl::is_main(), "Not main thread");
2021-03-06 19:02:37 +01:00
// Initialize TSC freq (in case it isn't)
static_cast<void>(utils::get_tsc_freq());
// Initialize thread pool finalizer (on first use)
static_cast<void>(named_thread("", [](int) {}));
static std::unique_ptr<logs::listener> log_file;
2020-03-06 20:29:16 +01:00
{
// Check free space
fs::device_stat stats{};
if (!fs::statfs(fs::get_cache_dir(), stats) || stats.avail_free < 128 * 1024 * 1024)
{
report_fatal_error(fmt::format("Not enough free space (%f KB)", stats.avail_free / 1000000.));
}
// Limit log size to ~25% of free space
log_file = logs::make_file_listener(fs::get_cache_dir() + "RPCS3.log", stats.avail_free / 4);
}
2021-04-10 11:54:52 +02:00
static std::unique_ptr<logs::listener> fatal_listener = std::make_unique<fatal_error_listener>();
logs::listener::add(fatal_listener.get());
2020-03-06 20:29:16 +01:00
{
2021-04-02 02:46:07 +02:00
// Write RPCS3 version
logs::stored_message ver{sys_log.always()};
ver.text = fmt::format("RPCS3 v%s", rpcs3::get_verbose_version());
2021-04-02 02:46:07 +02:00
// Write System information
logs::stored_message sys{sys_log.always()};
sys.text = utils::get_system_info();
2020-03-06 20:29:16 +01:00
// Write OS version
logs::stored_message os{sys_log.always()};
os.text = utils::get_OS_version();
2020-03-06 20:29:16 +01:00
2020-11-02 22:28:57 +01:00
// Write Qt version
logs::stored_message qt{(strcmp(QT_VERSION_STR, qVersion()) != 0) ? sys_log.error : sys_log.notice};
qt.text = fmt::format("Qt version: Compiled against Qt %s | Run-time uses Qt %s", QT_VERSION_STR, qVersion());
logs::stored_message time{sys_log.always()};
time.text = fmt::format("Current Time: %s", std::chrono::system_clock::now());
2020-11-02 22:28:57 +01:00
logs::set_init({std::move(ver), std::move(sys), std::move(os), std::move(qt), std::move(time)});
2020-03-06 20:29:16 +01:00
}
2017-08-20 23:58:25 +02:00
#ifdef _WIN32
sys_log.notice("Initialization times before main(): %fGc", intro_cycles / 1000000000.);
#elif defined(RUSAGE_THREAD)
sys_log.notice("Initialization times before main(): %fs", intro_time / 1000000000.);
#endif
2021-03-06 15:23:26 +01:00
std::string argument_str;
for (int i = 0; i < argc; i++)
{
2022-09-13 15:08:55 +02:00
argument_str += '\'' + std::string(argv[i]) + '\'';
2021-03-06 15:23:26 +01:00
if (i != argc - 1) argument_str += " ";
}
sys_log.notice("argc: %d, argv: %s", argc, argument_str);
2021-03-06 15:23:26 +01:00
#ifdef __linux__
struct ::rlimit rlim;
rlim.rlim_cur = 4096;
rlim.rlim_max = 4096;
#ifdef RLIMIT_NOFILE
if (::setrlimit(RLIMIT_NOFILE, &rlim) != 0)
{
std::cerr << "Failed to set max open file limit (4096).\n";
}
#endif
rlim.rlim_cur = 0x80000000;
rlim.rlim_max = 0x80000000;
#ifdef RLIMIT_MEMLOCK
if (::setrlimit(RLIMIT_MEMLOCK, &rlim) != 0)
{
std::cerr << "Failed to set RLIMIT_MEMLOCK size to 2 GiB. Try to update your system configuration.\n";
}
#endif
// Work around crash on startup on KDE: https://bugs.kde.org/show_bug.cgi?id=401637
setenv( "KDE_DEBUG", "1", 0 );
#endif
#ifdef __APPLE__
struct ::rlimit rlim;
::getrlimit(RLIMIT_NOFILE, &rlim);
rlim.rlim_cur = OPEN_MAX;
if (::setrlimit(RLIMIT_NOFILE, &rlim) != 0)
{
std::cerr << "Failed to set max open file limit (" << OPEN_MAX << ").\n";
}
#endif
#ifndef _WIN32
// Write file limits
sys_log.notice("Maximum open file descriptors: %i", utils::get_maxfiles());
#endif
if (utils::get_low_power_mode())
{
sys_log.error("Low Power Mode is enabled, performance may be reduced.");
}
std::lock_guard qt_init(s_qt_init);
// The constructor of QApplication eats the --style and --stylesheet arguments.
// By checking for stylesheet().isEmpty() we could implicitly know if a stylesheet was passed,
// but I haven't found an implicit way to check for style yet, so we naively check them both here for now.
const bool use_cli_style = find_arg(arg_style, argc, argv) != -1 || find_arg(arg_stylesheet, argc, argv) != -1;
2022-05-09 23:13:43 +02:00
QScopedPointer<QCoreApplication> app(create_application(argc, argv));
2020-02-22 20:42:49 +01:00
app->setApplicationVersion(QString::fromStdString(rpcs3::get_version().to_string()));
2019-08-25 09:40:55 +02:00
app->setApplicationName("RPCS3");
2022-02-22 13:52:27 +01:00
app->setOrganizationName("RPCS3");
// Command line args
static QCommandLineParser parser;
parser.setApplicationDescription("Welcome to RPCS3 command line.");
parser.addPositionalArgument("(S)ELF", "Path for directly executing a (S)ELF");
2017-10-12 16:58:06 +02:00
parser.addPositionalArgument("[Args...]", "Optional args for the executable");
const QCommandLineOption help_option = parser.addHelpOption();
const QCommandLineOption version_option = parser.addVersionOption();
2019-08-25 11:51:13 +02:00
parser.addOption(QCommandLineOption(arg_headless, "Run RPCS3 in headless mode."));
parser.addOption(QCommandLineOption(arg_no_gui, "Run RPCS3 without its GUI."));
parser.addOption(QCommandLineOption(arg_high_dpi, "Enables Qt High Dpi Scaling.", "enabled", "1"));
parser.addOption(QCommandLineOption(arg_rounding, "Sets the Qt::HighDpiScaleFactorRoundingPolicy for values like 150% zoom.", "rounding", "4"));
2019-09-08 22:49:58 +02:00
parser.addOption(QCommandLineOption(arg_styles, "Lists the available styles."));
parser.addOption(QCommandLineOption(arg_style, "Loads a custom style.", "style", ""));
parser.addOption(QCommandLineOption(arg_stylesheet, "Loads a custom stylesheet.", "path", ""));
const QCommandLineOption config_option(arg_config, "Forces the emulator to use this configuration file for CLI-booted game.", "path", "");
parser.addOption(config_option);
const QCommandLineOption installfw_option(arg_installfw, "Forces the emulator to install this firmware file.", "path", "");
parser.addOption(installfw_option);
const QCommandLineOption installpkg_option(arg_installpkg, "Forces the emulator to install this pkg file.", "path", "");
parser.addOption(installpkg_option);
2022-05-09 23:13:43 +02:00
const QCommandLineOption decrypt_option(arg_decrypt, "Decrypt PS3 binaries.", "path(s)", "");
parser.addOption(decrypt_option);
2021-04-02 00:54:32 +02:00
const QCommandLineOption user_id_option(arg_user_id, "Start RPCS3 as this user.", "user id", "");
parser.addOption(user_id_option);
const QCommandLineOption savestate_option(arg_savestate, "Path for directly loading a savestate.", "path", "");
parser.addOption(savestate_option);
2020-11-02 23:33:07 +01:00
parser.addOption(QCommandLineOption(arg_q_debug, "Log qDebug to RPCS3.log."));
parser.addOption(QCommandLineOption(arg_error, "For internal usage."));
2020-03-25 09:23:38 +01:00
parser.addOption(QCommandLineOption(arg_updating, "For internal usage."));
2021-08-28 18:14:47 +02:00
parser.addOption(QCommandLineOption(arg_commit_db, "Update commits.lst cache. Optional arguments: <path> <sha>"));
parser.addOption(QCommandLineOption(arg_timer, "Enable high resolution timer for better performance (windows)", "enabled", "1"));
parser.addOption(QCommandLineOption(arg_verbose_curl, "Enable verbose curl logging."));
parser.addOption(QCommandLineOption(arg_any_location, "Allow RPCS3 to be run from any location. Dangerous"));
2019-06-18 04:02:06 +02:00
parser.process(app->arguments());
// Don't start up the full rpcs3 gui if we just want the version or help.
if (parser.isSet(version_option) || parser.isSet(help_option))
return 0;
// Set curl to verbose if needed
2021-11-11 14:20:11 +01:00
rpcs3::curl::g_curl_verbose = parser.isSet(arg_verbose_curl);
if (rpcs3::curl::g_curl_verbose)
{
#ifdef _WIN32
if (AttachConsole(ATTACH_PARENT_PROCESS) || AllocConsole())
{
[[maybe_unused]] const auto con_out = freopen("CONOUT$", "w", stdout);
[[maybe_unused]] const auto con_err = freopen("CONOUT$", "w", stderr);
}
#endif
fprintf(stdout, "Enabled Curl verbose logging.\n");
sys_log.always()("Enabled Curl verbose logging. Please look at your console output.");
}
// Handle update of commit database
if (parser.isSet(arg_commit_db))
{
2021-08-28 18:14:47 +02:00
#ifdef _WIN32
if (AttachConsole(ATTACH_PARENT_PROCESS) || AllocConsole())
2021-08-29 21:15:03 +02:00
{
2021-08-28 18:14:47 +02:00
[[maybe_unused]] const auto con_out = freopen("CONOUT$", "w", stdout);
[[maybe_unused]] const auto con_err = freopen("CONOUT$", "w", stderr);
2021-08-29 21:15:03 +02:00
}
2021-08-28 18:14:47 +02:00
std::string path;
#else
std::string path = "bin/git/commits.lst";
#endif
std::string from_sha;
if (const int i_arg_commit_db = find_arg(arg_commit_db, argc, argv); i_arg_commit_db != -1)
{
if (int i = i_arg_commit_db + 1; argc > i)
{
path = argv[i++];
if (argc > i)
{
from_sha = argv[i];
}
}
#ifdef _WIN32
else
{
fprintf(stderr, "Missing path argument.\n");
return 1;
}
#endif
}
else
{
fprintf(stderr, "Can not find argument --%s\n", arg_commit_db);
return 1;
}
fs::file file(path, fs::read + fs::write + fs::append + fs::create);
2021-08-28 18:14:47 +02:00
if (!file)
{
2021-08-28 18:14:47 +02:00
fprintf(stderr, "Failed to open file: '%s' (errno=%d)\n", path.c_str(), errno);
return 1;
}
fprintf(stdout, "\nAppending commits to '%s' ...\n", path.c_str());
// Get existing list
std::string data = file.to_string();
std::vector<std::string> list = fmt::split(data, {"\n"});
2021-08-28 18:14:47 +02:00
const bool was_empty = data.empty();
2021-08-28 18:14:47 +02:00
// SHA to start
std::string last;
2021-08-28 18:14:47 +02:00
if (!list.empty())
{
// Decode last entry to check last written commit
QByteArray buf(list.back().c_str(), list.back().size());
QJsonDocument doc = QJsonDocument::fromJson(buf);
if (doc.isObject() && doc["sha"].isString())
{
2021-08-28 18:14:47 +02:00
last = doc["sha"].toString().toStdString();
}
2021-08-28 18:14:47 +02:00
}
2021-08-28 18:14:47 +02:00
list.clear();
2021-08-28 18:14:47 +02:00
// JSON buffer
QByteArray buf;
2021-08-28 18:14:47 +02:00
// CURL handle to work with GitHub API
rpcs3::curl::curl_handle curl;
2021-08-28 18:14:47 +02:00
struct curl_slist* hhdr{};
hhdr = curl_slist_append(hhdr, "Accept: application/vnd.github.v3+json");
hhdr = curl_slist_append(hhdr, "User-Agent: curl/7.37.0");
2021-08-28 18:14:47 +02:00
CURLcode err = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, hhdr);
if (err != CURLE_OK) fprintf(stderr, "curl_easy_setopt(CURLOPT_HTTPHEADER) error: %s", curl_easy_strerror(err));
err = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, +[](const char* ptr, usz, usz size, void* json) -> usz
{
static_cast<QByteArray*>(json)->append(ptr, size);
return size;
});
if (err != CURLE_OK) fprintf(stderr, "curl_easy_setopt(CURLOPT_WRITEFUNCTION) error: %s", curl_easy_strerror(err));
2021-08-28 18:14:47 +02:00
err = curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buf);
if (err != CURLE_OK) fprintf(stderr, "curl_easy_setopt(CURLOPT_WRITEDATA) error: %s", curl_easy_strerror(err));
2021-08-28 18:14:47 +02:00
u32 page = 1;
constexpr u32 per_page = 100;
2021-08-28 16:11:53 +02:00
2021-08-28 18:14:47 +02:00
while (page <= 55)
{
fprintf(stdout, "Fetching page %d ...\n", page);
std::string url = "https://api.github.com/repos/RPCS3/rpcs3/commits?per_page=";
fmt::append(url, "%u&page=%u", per_page, page++);
if (!from_sha.empty())
fmt::append(url, "&sha=%s", from_sha);
err = curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
if (err != CURLE_OK)
{
2021-08-28 18:14:47 +02:00
fprintf(stderr, "curl_easy_setopt(CURLOPT_URL, %s) error: %s", url.c_str(), curl_easy_strerror(err));
break;
}
// Reset error buffer before we call curl_easy_perform
curl.reset_error_buffer();
2021-08-28 18:14:47 +02:00
err = curl_easy_perform(curl);
if (err != CURLE_OK)
{
const std::string error_string = curl.get_verbose_error(err);
fprintf(stderr, "curl_easy_perform(): %s", error_string.c_str());
2021-08-28 18:14:47 +02:00
break;
}
2021-08-28 18:14:47 +02:00
QJsonDocument info = QJsonDocument::fromJson(buf);
2021-08-28 18:14:47 +02:00
if (!info.isArray()) [[unlikely]]
{
2021-08-28 18:14:47 +02:00
fprintf(stderr, "Bad response:\n%s", buf.data());
break;
}
2021-08-28 18:14:47 +02:00
u32 count = 0;
2021-08-28 16:11:53 +02:00
2021-08-28 18:14:47 +02:00
for (auto&& ref : info.array())
{
if (!ref.isObject())
2021-08-28 16:11:53 +02:00
{
2021-08-28 18:14:47 +02:00
page = -1;
2021-08-28 16:11:53 +02:00
break;
}
2021-08-28 18:14:47 +02:00
count++;
2021-08-28 18:14:47 +02:00
QJsonObject result, author, committer;
QJsonObject commit = ref.toObject();
2021-08-28 18:14:47 +02:00
auto commit_ = commit["commit"].toObject();
auto author_ = commit_["author"].toObject();
auto committer_ = commit_["committer"].toObject();
auto _author = commit["author"].toObject();
auto _committer = commit["committer"].toObject();
2021-08-28 18:14:47 +02:00
result["sha"] = commit["sha"];
result["msg"] = commit_["message"];
author["name"] = author_["name"];
author["date"] = author_["date"];
author["email"] = author_["email"];
author["login"] = _author["login"];
author["avatar"] = _author["avatar_url"];
committer["name"] = committer_["name"];
committer["date"] = committer_["date"];
committer["email"] = committer_["email"];
committer["login"] = _committer["login"];
committer["avatar"] = _committer["avatar_url"];
2021-08-28 18:14:47 +02:00
result["author"] = author;
result["committer"] = committer;
2021-08-28 18:14:47 +02:00
QJsonDocument out(result);
buf = out.toJson(QJsonDocument::JsonFormat::Compact);
buf += "\n";
if (was_empty || !from_sha.empty())
{
data = buf.toStdString() + std::move(data);
}
else if (commit["sha"].toString().toStdString() == last)
{
2021-08-28 18:14:47 +02:00
page = -1;
break;
}
2021-08-28 18:14:47 +02:00
else
{
// Append to the list
list.emplace_back(buf.data(), buf.size());
}
}
2021-08-28 18:14:47 +02:00
buf.clear();
if (count < per_page)
{
2021-08-28 18:14:47 +02:00
break;
}
2021-08-28 18:14:47 +02:00
}
2021-08-28 18:14:47 +02:00
if (was_empty || !from_sha.empty())
{
file.trunc(0);
file.write(data);
}
else
{
2021-08-28 18:14:47 +02:00
// Append list in reverse order
for (usz i = list.size() - 1; ~i; --i)
{
file.write(list[i]);
}
}
2021-08-28 18:14:47 +02:00
curl_slist_free_all(hhdr);
2021-08-29 21:15:03 +02:00
fprintf(stdout, "Finished fetching commits: %s\n", path.c_str());
return 0;
}
2020-11-02 23:33:07 +01:00
if (parser.isSet(arg_q_debug))
{
qInstallMessageHandler(log_q_debug);
}
2019-09-08 22:49:58 +02:00
if (parser.isSet(arg_styles))
{
#ifdef _WIN32
if (AttachConsole(ATTACH_PARENT_PROCESS) || AllocConsole())
2019-12-26 21:01:48 +01:00
[[maybe_unused]] const auto con_out = freopen("CONOUT$", "w", stdout);
2019-09-08 22:49:58 +02:00
#endif
for (const auto& style : QStyleFactory::keys())
std::cout << "\n" << style.toStdString();
return 0;
}
// Log unique ID
gui::utils::log_uuid();
2021-04-02 00:54:32 +02:00
std::string active_user;
if (parser.isSet(arg_user_id))
{
active_user = parser.value(arg_user_id).toStdString();
if (rpcs3::utils::check_user(active_user) == 0)
2021-04-02 00:54:32 +02:00
{
report_fatal_error(fmt::format("Failed to set user ID '%s'.\nThe user ID must consist of 8 digits and cannot be 00000000.", active_user));
}
}
s_no_gui = parser.isSet(arg_no_gui);
2019-06-21 13:33:32 +02:00
if (auto gui_app = qobject_cast<gui_application*>(app.data()))
2019-06-18 04:02:06 +02:00
{
gui_app->setAttribute(Qt::AA_UseHighDpiPixmaps);
gui_app->setAttribute(Qt::AA_DisableWindowContextHelpButton);
gui_app->setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity);
2019-06-18 04:02:06 +02:00
gui_app->SetShowGui(!s_no_gui);
gui_app->SetUseCliStyle(use_cli_style);
gui_app->SetWithCliBoot(parser.isSet(arg_installfw) || parser.isSet(arg_installpkg) || !parser.positionalArguments().isEmpty());
2021-04-02 00:54:32 +02:00
gui_app->SetActiveUser(active_user);
if (!gui_app->Init())
{
Emu.Quit(true);
return 0;
}
2019-06-18 04:02:06 +02:00
}
2019-08-25 09:40:55 +02:00
else if (auto headless_app = qobject_cast<headless_application*>(app.data()))
2019-06-18 04:02:06 +02:00
{
s_headless = true;
2021-04-02 00:54:32 +02:00
headless_app->SetActiveUser(active_user);
if (!headless_app->Init())
{
Emu.Quit(true);
return 0;
}
2019-06-18 04:02:06 +02:00
}
else
{
// Should be unreachable
report_fatal_error("RPCS3 initialization failed!");
}
2019-06-18 04:02:06 +02:00
// Check if the current location is actually useable
if (!parser.isSet(arg_any_location))
{
const std::string emu_dir = rpcs3::utils::get_emu_dir();
// Check temporary directories
for (const QString& path : QStandardPaths::standardLocations(QStandardPaths::StandardLocation::TempLocation))
{
if (Emu.IsPathInsideDir(emu_dir, path.toStdString()))
{
report_fatal_error(fmt::format(
"RPCS3 should never be run from a temporary location!\n"
"Please install RPCS3 in a persistent location.\n"
"Current location:\n%s", emu_dir));
return 1;
}
}
}
2019-06-18 04:02:06 +02:00
#ifdef _WIN32
// Create dummy permanent low resolution timer to workaround messing with system timer resolution
QTimer* dummy_timer = new QTimer(app.data());
dummy_timer->start(13);
ULONG min_res, max_res, orig_res;
bool got_timer_resolution = NtQueryTimerResolution(&min_res, &max_res, &orig_res) == 0;
2019-06-18 04:02:06 +02:00
// Set 0.5 msec timer resolution for best performance
// - As QT5 timers (QTimer) sets the timer resolution to 1 msec, override it here.
if (parser.value(arg_timer).toStdString() == "1")
{
ULONG new_res;
if (got_timer_resolution && NtSetTimerResolution(max_res, TRUE, &new_res) == 0)
{
NtSetTimerResolution(max_res, TRUE, &new_res);
sys_log.notice("New timer resolution: %d us (old=%d us, min=%d us, max=%d us)", new_res / 10, orig_res / 10, min_res / 10, max_res / 10);
got_timer_resolution = false; // Invalidate for log message later
}
else
{
sys_log.error("Failed to set timer resolution!");
}
}
else
{
sys_log.warning("High resolution timer disabled!");
}
if (got_timer_resolution)
2019-06-18 04:02:06 +02:00
{
sys_log.notice("Timer resolution: %d us (min=%d us, max=%d us)", orig_res / 10, min_res / 10, max_res / 10);
2019-06-18 04:02:06 +02:00
}
#endif
2022-05-09 23:13:43 +02:00
if (parser.isSet(arg_decrypt))
{
#ifdef _WIN32
if (AttachConsole(ATTACH_PARENT_PROCESS) || AllocConsole())
{
[[maybe_unused]] const auto con_out = freopen("CONOUT$", "w", stdout);
[[maybe_unused]] const auto con_in = freopen("CONIN$", "r", stdin);
}
#endif
std::vector<std::string> vec_modules;
for (const QString& mod : parser.values(decrypt_option))
{
const QFileInfo fi(mod);
if (!fi.exists())
{
std::cout << "File not found: " << mod.toStdString() << std::endl;
return 1;
}
if (!fi.isFile())
{
std::cout << "Not a file: " << mod.toStdString() << std::endl;
return 1;
}
vec_modules.push_back(fi.absoluteFilePath().toStdString());
}
const auto input_cb = [](std::string old_path, std::string path, bool tried) -> std::string
{
const std::string hint = fmt::format("Hint: KLIC (KLicense key) is a 16-byte long string. (32 hexadecimal characters)"
"\nAnd is logged with some sceNpDrm* functions when the game/application which owns \"%0\" is running.", path);
if (tried)
{
std::cout << "Failed to decrypt " << old_path << " with specfied KLIC, retrying.\n" << hint << std::endl;
}
std::cout << "Enter KLIC of " << path << "\nHexadecimal only, 32 characters:" << std::endl;
std::string input;
std::cin >> input;
return input;
};
Emu.Init();
decrypt_sprx_libraries(vec_modules, input_cb);
Emu.Quit(true);
return 0;
}
// Force install firmware or pkg first if specified through command-line
if (parser.isSet(arg_installfw) || parser.isSet(arg_installpkg))
{
if (auto gui_app = qobject_cast<gui_application*>(app.data()))
{
if (s_no_gui)
{
report_fatal_error("Cannot perform installation in no-gui mode!");
}
if (gui_app->m_main_window)
{
if (parser.isSet(arg_installfw) && parser.isSet(arg_installpkg))
{
QMessageBox::warning(gui_app->m_main_window, QObject::tr("Invalid command-line arguments!"), QObject::tr("Cannot perform multiple installations at the same time!"));
}
else if (parser.isSet(arg_installfw))
{
gui_app->m_main_window->InstallPup(parser.value(installfw_option));
}
else
{
gui_app->m_main_window->InstallPackages({parser.value(installpkg_option)});
}
}
else
{
report_fatal_error("Cannot perform installation. No main window found!");
}
}
else
{
report_fatal_error("Cannot perform installation in headless mode!");
}
}
for (const auto& opt : parser.optionNames())
{
2021-03-06 15:23:26 +01:00
sys_log.notice("Option passed via command line: %s %s", opt.toStdString(), parser.value(opt).toStdString());
}
if (parser.isSet(arg_savestate))
{
const std::string savestate_path = parser.value(savestate_option).toStdString();
sys_log.notice("Booting savestate from command line: %s", savestate_path);
if (!fs::is_file(savestate_path))
{
report_fatal_error(fmt::format("No savestate file found: %s", savestate_path));
}
Emu.CallFromMainThread([path = savestate_path]()
{
Emu.SetForceBoot(true);
if (const game_boot_result error = Emu.BootGame(path); error != game_boot_result::no_errors)
{
sys_log.error("Booting savestate '%s' failed: reason: %s", path, error);
if (s_headless || s_no_gui)
{
report_fatal_error(fmt::format("Booting savestate '%s' failed!\n\nReason: %s", path, error));
}
}
});
}
else if (const QStringList args = parser.positionalArguments(); !args.isEmpty() && !is_updating && !parser.isSet(arg_installfw) && !parser.isSet(arg_installpkg))
{
sys_log.notice("Booting application from command line: %s", args.at(0).toStdString());
2017-10-12 16:58:06 +02:00
// Propagate command line arguments
2021-04-07 23:05:18 +02:00
std::vector<std::string> rpcs3_argv;
2017-10-12 16:58:06 +02:00
if (args.length() > 1)
{
2021-04-07 23:05:18 +02:00
rpcs3_argv.emplace_back();
2017-10-12 16:58:06 +02:00
for (int i = 1; i < args.length(); i++)
2017-10-12 16:58:06 +02:00
{
const std::string arg = args[i].toStdString();
2021-04-07 23:05:18 +02:00
rpcs3_argv.emplace_back(arg);
sys_log.notice("Optional command line argument %d: %s", i, arg);
2017-10-12 16:58:06 +02:00
}
}
2021-09-22 21:44:52 +02:00
std::string config_path;
if (parser.isSet(arg_config))
{
config_path = parser.value(config_option).toStdString();
if (!fs::is_file(config_path))
{
report_fatal_error(fmt::format("No config file found: %s", config_path));
}
}
// Postpone startup to main event loop
2022-01-20 18:44:49 +01:00
Emu.CallFromMainThread([path = sstr(QFileInfo(args.at(0)).absoluteFilePath()), rpcs3_argv = std::move(rpcs3_argv), config_path = std::move(config_path)]() mutable
2017-07-13 17:34:37 +02:00
{
2021-04-07 23:05:18 +02:00
Emu.argv = std::move(rpcs3_argv);
Emu.SetForceBoot(true);
2021-09-22 21:44:52 +02:00
const cfg_mode config_mode = config_path.empty() ? cfg_mode::custom : cfg_mode::config_override;
if (const game_boot_result error = Emu.BootGame(path, "", false, false, config_mode, config_path); error != game_boot_result::no_errors)
{
sys_log.error("Booting '%s' with cli argument failed: reason: %s", path, error);
if (s_headless || s_no_gui)
{
report_fatal_error(fmt::format("Booting '%s' failed!\n\nReason: %s", path, error));
}
}
2017-07-13 17:34:37 +02:00
});
}
else if (s_headless || s_no_gui)
{
#ifdef _WIN32
// If launched from CMD
if (AttachConsole(ATTACH_PARENT_PROCESS))
[[maybe_unused]] const auto con_out = freopen("CONOUT$", "w", stderr);
#endif
sys_log.error("Cannot run %s mode without boot target. Terminating...", s_headless ? "headless" : "no-gui");
fprintf(stderr, "Cannot run %s mode without boot target. Terminating...\n", s_headless ? "headless" : "no-gui");
if (s_no_gui)
{
QMessageBox::warning(nullptr, QObject::tr("Missing command-line arguments!"), QObject::tr("Cannot run no-gui mode without boot target.\nTerminating..."));
}
Emu.Quit(true);
return 0;
}
2019-06-18 04:02:06 +02:00
// run event loop (maybe only needed for the gui application)
return app->exec();
RPCS3 QT (#2645) * Fix windows build. I made sure to do everything with a win32 prefix to not effect linux build. * Make the window resizable instead of fixed in the corner. * Ignore moc files and things in the debug/release folder. I might also ignore rpcs3qt.vcxproj and its filters as they're autogenerated by importing the qt project file. But, this helps clean out clutter for now. * Add cmake. This doesn't interact with the rest of rpcs3 nor the main cmake file. That's the next thing I'm doing. I'll probably need to modify them so it'll take me time to figure out. But, this will build rpcs3qt on linux and build as is with using qt. * The build works. I'd like to thank my friends, Google and Stackoverflow. Setted up by importing rpcs3Qt project using Qt's visual studio plugin. * Cleanup. Remove all the stuff in the rpcs3qt folder as its incorporated elsewhere. Remove the rpcs3qt project file as its now built into the solution and cmake doesn't care about pro files. * Update readme to reflect getting Qt. * Remove wxwidgets as submodule and add zlib instead. Wxwidgets was our old way of having zlib. I also added build dependencies to rpcs3qt so you should no longer get link errors on the first clean rebuild. * Add rpcs3_version, few GUI tweaks * Set defaultSize to 70% of screen size * Add the view menu (#3) * Added the view menu with the corresponding elements. Now, the debugger/log are hidden by default. The view menu has a checkbox which you click to show/hide the dock widgets. * Make log visible by default * Improve UI by making it into a checkbox that's easier to use. * fix qt build for vs2017 (seems to work fine in 2015 with plugin but needs testing by other users) * updated readme for qt * update appveyor for qt - cleaned formatting for the post build command * fix build (#6) * fix build legit this time i promise * [Ready] Gamepadsettings (#4) * WIP Gamepadsettings pushbutton Eventhandling missing * GamepadSettings should work except for cfg Init Some KeyInputs are missing * Update padsettingsdialog.h * Update padsettingsdialog.cpp (#5) * Update padsettingsdialog.cpp removed silly tabs * Update padsettingsdialog.cpp * GetKeyCode simplified * rename pad settings to keyboard settings o.O * rename keyboard setting to input settings * Remvoed the QT_UI defines. * Readded new line at end of file. Replaced define in padsettings with constant. * GUI fixes (Settings) * Stub the logger UI. Nothing special besides a simple stub. * Unstub the log. I haven't tested TTY but it should work. Only thing to do, but this is in general, is add persistent settings. * Minor refactoring to simplify code. * Fix image loading. I'm 90% sure it works because it loads the path as expected and that's the same format I used in my gamelist implementation for the images. * Made game lists much more functional than it was. * mainwindow * gamelist * Please forgive me for I have lambdaed. Added the ability to toggle showing columns via a context menu. * Fix GameList further * sort by name on init fixed * Created the baseline refactoring. I'm going to start working on the callbacks now. May need to implement other classes in the process. Fun stuff, I know. * adds InstallPkg (tested) and InstallPup (should work but makes unknown shenanigans) implementation adds RefreshGameList obliterates 10sec Refresh * messages * Rpcs3 gs frame (#16) * Messing with project settings try to get trails of cold steel to boot.bluh Definitely one change is needed in linker settings for RPCS3 to not crash immediately. Can't even see how horribly botched my implementation of GSFrame is because we aren't booting lol. Something is gone awry with elf. * remove random ! not that it matters much right now * minor additions * "Working" with debug mode though you have to ignore an assert reached from Qt. Qt is upset that the rsx thread is calling stuff on the UI thread despite not owning it. However, I can't do a thing to change that atm. (The fix would be to do what the TODO says in System.cpp-- making gsframe and stuff get initialized via system call) Crashes due to needing pad callback to be done. * With this build in debug mode, Trails of Cold steel will get FPS. (caveat. You have to ignore when Qt throws a debug assert lol) * Fix release mode. Fix the Qt debug assert by using ancient occault rituals. I want to be able to remove the blocking connects but it won't work right now without it. It isn't perfect but it's good enough for now IMO. * Add enters to the end of files. * Removing target and setting source of events to be the application instead of the main window. The main window isn't the game window, and I don't really know what widget will be targetted for the game event. Works, though, it's admittedly probably not optimal by ANY means. * Fix comment. * Fix libpng wit zlib. * Move Qt GUI into RPCS3Qt. (#17) Restore wx GUI. * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * Add stylesheet to git ignore. * XInput.. * Joystick... * Rpcs3 qt small fixes (#20) * Small fixes. Have emulator stop when x button is pressed on game window. Have emulator/application stop when the main window is closed. * If I forget another new line ending for a file............................................. * Add CgDisasm (#21) * fix install-progressdialogs randomly not showing * install-progressdialog cosmetics * add stylesheet file loading * apply request * add CgDisasm add code to disable contextmenu options fix gamelist issue * missing proj changes * Add ability to open stylesheets from menu. * Mega searcher (#23) * add MemoryStringSearcher set minimum Sizes for mainwindow and CgDisasm * minor fixes * Since the system.cpp callbacks for emulator state were unused, I removed them. Then, I replaced them with callbacks for the Gui. * added stylesheet options setfocus on settings fixed newline added * added signals and slots for EmuRun and EmuStop * update ui update ui now works added callback onReady added EnableMenues added ps3 commands * added restart logic to menu * newline * event header removed * Added graphic settings class. (#26) * Added graphic settings class. First thing is to have the dock widgets and window size/location be stateful. Minor bug with debugger frame changing size on hide/show on default setup on second load. But, otherwise, fine. Also, the GUI doesn't update to accomodate the statefulness of the widgets. But, that'll come in time as I update this class. * Add view debugger, logger, gamelist to settings and synchronize them. * Separate initializing actions from connects * Add invisible fullscreen cursor and double click event. * Add the UI log settings. * Add MemoryViewer (#30) * Add Memoryviewer Image Button crashes/not fully implemented focus on some button annoying minor changes for question dialogs * GuiSettings Refactoring (#31) * Add settings for columns shown and which one is saved * I accidentally refactored the settings class. Added ability to reset to default GUI. Added statefulness to column widths. * add gui tab * Fix logging at startup. * Preset settings.I think I ironed out MOST of the glitches. Will work on the rest of it soon. Should be a lot simpler as I won't have to use the so-called meta settings. Also, renamed all settings methods to CapitalCase. * Removed dock widget controls. * Added style sheets. Removed the option from the menu. * Rewrite to use folder design. Much simpler! Yay! Simpler. Better, right? * It's remarkable how tricky this is. * Added convenience button to open up the settings folder in explorer * Add newlines at end of file * simplified logic. Fixed a bug.. hopefully not more bugs * Fix the undocumented feature * Make the dialog big enough to have entire text on title shown. If talkashie changes the font to size 1203482 I don't care lol * Make warning messagebox instead of changing the title of the dialog. * marking... * Hcorion suggested changes. * [WIP] autopause (#32) * autopause added needs fixing headers do not show text * fix compile stuff * Add MsgDialog + edge widgets (#33) * Add MsgDialog needs magic * add "Debugger" Buttons to menubar * Adapt ds4 changes. I'm not sure if they work as I don't have a compatible controller. But, at the same time, it's kind of silly all I had to do was remove stdguiafx to get compilation. * [Ready] Add KernelExplorer (#36) * KernelExplorer added * Fix build. Connect mainwindow to show explorer. * qstr formatting added hid header, fixed button size * Taskbar Progress for install PUP/PKG (#37) * Add Taskbar Progress for both PKG and PUP installer * fix missing ifdefs for windows * add mainwindow icon + thumbnail toolbar * add game specific icons to the GSFrame * fix icon crash * fix appIcon's aspect ratio in SetAppIconFromPath * Fix black borders in RGB32 icons * rename thumbar related buttons * EmuSettings (#35) * Core tab done minus doing the library list. * Graphics tab. * Audio tab * Input tab * Added the other tabs * LLE part one-- load existing libraries sorted. (I'd finish it but I'm going to look at a PR by mega) * add search and add other libraries that aren't checked. * Finish adding lle selecting things. * marking my territory (#38) fixed settingsdialog glitch and width added groupbox to gui buttons removed parents from layouts * add debuggerframe + RSXDebugger (#34) * Add Debuggerframe * add RSXDebugger * add RSXDebugger fo real * RSXDebugger improved minor adjustments * add utf8 conversions like neko told me to hopefully i did not utf8-ise too many things xD * fix some variables * maybe fix image buffers in RSXDebugger * fixed image view (pretty sure) * fixed image buffer (hopefully) * QT Opengl frame (#41) * fix RSX Debugger headers (#40) * fix some debugger layout issues fix RSX Debugger headers + some comments * add kd-11's SPU options fix D3D12 showing on non-compatible systems tidy up coretab * improve D3D12 behaviour in graphicstab: adapter selection and D3D12 render won't show on non-compatible systems add monospace font to cgDisasm * enable update only on visibility * Rpcs3 qt llvm build (#42) * LLVM pushed so mega can test * probably is what is needed with Release LLVM * should probably have RPCS3-Qt be using release-llvm * include zlib the same way. * don't talk to me about how I made this happen. * I applied the magical treatment to debug mode too. Though, it's entirely probably that doing it once in LLVM-release mode made this entirely redundant * hack * progress bar for LLVM spawns but doesn't close yet. * fix msgDialog (#43) fix oskDialog * Minor bug fixzz * fix osk and msgdialog for real (#44) * fix msgDialog fix oskDialog * fix OskDialog part 2 fix MsgDialog part 2 * This bug is evil, and it should be ashamed of itself. * Refactor YAML. Commented out gui options that aren't added to config yet (add em back later when we merge that in) * Fix pad stuff. * add SaveDataUtility (#45) * add SaveDataUtility * fix slots * fix slots again fix lists not showing stuff fix dialogs not showing add colClicked refactor stuff and polish some layouts * add SaveDataDialog.h and SaveDataDialog.cpp * tidy up mainwindow * add callback * fix RegisterEditor (#47) * fix RegisterEditor * fix other dialogs' immortality (gasp...vampires) * remove debug leftovers * fix InstructionEditor (#46) * fix InstructionEditor * fix typo * Fix MouseClickEvents in RSXDebugger (#50) * Fix MouseClickEvents in RSXDebugger Fix focus on MemoryViewer and RSXDebugger Adjust PadButtonWidth * fix another comment * fix debuggerframe events (#49) * Fix pad settings bro (#48) * Fix pad settings bro * fix comment * Icons and Menu-Additions (#39) * Add Icons and iconlogic to cornerWidget and actions * add cornerWidget toggle fix dockwidget action state on start remove DoSettings * fix game removal bug remove tableitem focus rectangle therefore add TableItemDelegate.h * remove grid and focus rectangle from autopausedialog * add fullscreen checkbox to misctab minor padsettings layout improvements * Add show category submenu to view menu Add gamelist filter accordingly fix minor bug where play icon was displayed despite pause label add boolean b_fullscreen to mainwindow for later use in GSFrame * fix headers in autopausesettings fix remove bug in autopausesettings add delete keypressevent in autopausesettings fix missing tr() and minor refactoring in gamelist * add default Icons for play/pause/stop/restart * Fix fullscreen start. Some stuff was wrong with settings, just trust me. * remove fullscreen leftovers and fix merge * SPU stuff. (There was also a weird thing with config.h in GLGSFrame.h with an include that I removed to fix build) * please neko's lambda fetishes (#53) * please neko's lambda fetish in mainwindow * please neko's lambda fetish in gamelistframe * please neko's lambda fetish in logframe * fix neko's lambda fetish in debuggerframe * pleasefixdofetishsomething in Autopausesettingsdialog * fix sth sth lambda in cg disasm * lambda stuff in instructioneditor * lambda kernelexplorer * lambda-ise memoryviewer * lambda rsxdebugger * lambda savedatautil this could be done even more, but the functions are not implemented * Rpcs3 qt fixes -- shadow taskbar bug (#52) * SShadow's bug of taskbar progress staying fixed on cancelling pkg install. * other taskbar * i'm still a baka * Fix a warning * qtQt refactoring (#54) * fix neko's snake fetish * File names should match headers. Are these the names I want? Not necessarily. But, this is much less confusing. * i thought I committed everything with stage all......................... * remove unused utilities * The most important commit of them all. * Disable legacy opengl buffers when not using opengl. * fix code review comment * Quick crash patch. Neko removed autopause. SO, I remove it too from emusettings/misc tab * Merge lovely things from master (#55) * Configuration simplified * untrivial parts of the merge * no need for these options anymore * Minor change to fix column widths at startup (not sure why it doesn't work already, but adding the true makes it work so......... whatever) * here ya go * FIx hitting okay in settings causing graphics to messup (#57) * fixes + msgdialog taskbarprogress (#56) * fix ok button in taskbar add taskicon progressbar for msgdialog add tablewidgetitem to rsxdebugger fix comments in save_data_utility.cpp * fix d3d adapter default * fix taskicon progressbar not being destroyed properly * add last_path to filedialogs * fix msgdialog crash on ok (#58) * fix thread stopping in debbugerFrame (#59) * Move Emu.init to be first. This will fix the qt stuff seeming to ignore the virtual filesystem in the config. (VFS to be made soon maybe) (#60) * Fix full screen opening on double RIGHT click. * fix other instances of double click ... * Fix locaiton of gui config. (#61) * fix d3d bug (#62) * fix d3d bug * small utf8 addition * Fix cmake for qt (#64) * Initial CMake fix * Fix compilation with GCC * Get rid of awful hack * Update cotire with qt support * Maybe fix travis * Emergency Hack Relief Program Activated * Fix travis build (#65) * make about dialog great again (#67) and add previous additions * Fix library sort / smart gamelist context menu (#63) * fix library sort * add Title to custom game config dialog * disable options on gamelist context menu * use namespace for category Strings * introduce sstr * fix some tr nonsense * Rpcs3qt Appveyor (#68) Fix appyveyor build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * possible fix for gamelist icons (#69) add warning for appicon * Fix clang build (#66) Hcorion, the build savior. * Rpcs3 qt resources (#70) * Resource files attempt 1 * Autorcc should probably be on? * forgot the most important file lol * Forgot an instance of the icon in the code... * Patch fix for clang build. * vulkan/d3d12 combobox merge (#71) * add vulkan adapterbox and merge with d3d12 box * fix adapter text on other renderer * gather render strings * attempt fix on gamelist row height * adjust adapter behaviour to new guideline * Compiler of Peace. * High critical hit rate. * Mugi eating strawberries is savage. * Apply KD-11 Hotfix (#73) * Most of Ani Adjusts (#72) * Most of the adjustments are made here. * fix gamelist rowheight * fix msg dialog layout and disable_cancel * cleanup * fix disable cancle again * fix debuggerframe buttons and doubleclick * Add a fun little bonus feature :) (#74) * category filters simplyfied (#75) * Cleaning up cmake a bit. * fixezzzzzz (#76) * upgrade Info Boxes * upgrade file explorer * refactor GetSettings and SetSettings * second refactoring * cleanup * travis is a grammar nazi * second travis shenanigans * third travis weirdo thingy * travis 4 mega fun * travis 5 default to def * finish refactoring for settings fix gamelist headers * hotfix msgdialog and infobox (#77) * msgdialog fix 1 * fix zombie infobox * Rpcs3 Qt Welcome Page (#78) * Add a welcome dialog. * Add enter to end of file * i'm an idiot * last mistake i hope * sponsored via --> funded by * RPCS3 does not condone piracy. * Mega Adjusts * Ani Adjustments and a few refactorings * Yay * Add Gamelist Icon Sizes (#79) * Reverting Mega's suggestion. If people can use alt-f4 to get around this dialog, they can probably use an emulator too. * Fix firmware file choice dialog in QT GUI (#80) * ani adjusts 2 + minor icon size simplifications (#81) FPS Additions * Update Travis to Qt 5.9 (#82)
2017-06-04 16:48:33 +02:00
}
2020-11-02 04:07:58 +01:00
// Temporarily, this is code from std for prebuilt LLVM. I don't understand why this is necessary.
// From the same MSVC 19.27.29112.0, LLVM libs depend on these, but RPCS3 gets linker errors.
#ifdef _WIN32
extern "C"
{
int __stdcall __std_init_once_begin_initialize(void** ppinit, ulong f, int* fp, void** lpc) noexcept
{
return InitOnceBeginInitialize(reinterpret_cast<LPINIT_ONCE>(ppinit), f, fp, lpc);
}
int __stdcall __std_init_once_complete(void** ppinit, ulong f, void* lpc) noexcept
{
return InitOnceComplete(reinterpret_cast<LPINIT_ONCE>(ppinit), f, lpc);
}
2020-12-18 08:39:54 +01:00
usz __stdcall __std_get_string_size_without_trailing_whitespace(const char* str, usz size) noexcept
2020-11-02 04:07:58 +01:00
{
while (size)
{
switch (str[size - 1])
{
case 0:
case ' ':
case '\n':
case '\r':
case '\t':
{
size--;
continue;
}
2021-04-07 23:05:18 +02:00
default: break;
2020-11-02 04:07:58 +01:00
}
break;
}
return size;
}
2020-12-18 08:39:54 +01:00
usz __stdcall __std_system_error_allocate_message(const unsigned long msg_id, char** ptr_str) noexcept
2020-11-02 04:07:58 +01:00
{
return __std_get_string_size_without_trailing_whitespace(*ptr_str, FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
nullptr, msg_id, 0, reinterpret_cast<char*>(ptr_str), 0, nullptr));
}
void __stdcall __std_system_error_deallocate_message(char* s) noexcept
{
LocalFree(s);
}
}
#endif