Project: Update readme and fix more stuff on non-windows os

This commit is contained in:
themitosan 2024-02-24 15:27:18 -03:00
parent 140cb016f6
commit 2093642ed8
11 changed files with 69 additions and 60 deletions

13
.gitignore vendored
View file

@ -1,7 +1,11 @@
# Paths
Games/*
Nwjs/*
Emu/*
Games/
Nwjs/
Emu/
# Paths generated by fpPS4
shader_dump/
savedata/
# Launcher settings
Settings.json
@ -17,4 +21,5 @@ Settings.json
*.zip
*.pkg
*.log
*.dat
*.dat
*.sh

View file

@ -695,7 +695,7 @@ temp_DESIGN = {
cDisplayMode = APP.settings.data.gameListMode;
// Grid options
switch (cDisplayMode) {
switch (cDisplayMode){
case 'normal':
document.getElementById('RANGE_settingsGridIconSize').disabled = 'disabled';
@ -713,13 +713,11 @@ temp_DESIGN = {
}
// Reset display modes
// Reset display modes and update zoom scale
this.gameListDisplayModes.forEach(function(cMode){
document.getElementById('BTN_displayMode_' + cMode).disabled = '';
document.getElementById(`BTN_displayMode_${cMode}`).disabled = '';
});
document.getElementById('BTN_displayMode_' + cDisplayMode).disabled = 'disabled';
// Update zoom scale
document.getElementById(`BTN_displayMode_${cDisplayMode}`).disabled = 'disabled';
document.body.style.zoom = guiZoomScale;
},

View file

@ -19,16 +19,12 @@ temp_EMUMANAGER = {
// Run emu
runGame: function(){
// Get selected game details
// Get selected game details and check if user selected a game
const mainGameData = APP.gameList.list[APP.gameList.selectedGame];
// If user selected a game
if (mainGameData !== void 0){
// Reset Error List
// Reset Error List and clear log on emu running (if needed)
APP.emuManager.emuErrorList = [];
// Options: Clear log on emu starts
if (APP.settings.data.clearLogOnEmuLoad === !0 && APP.emuManager.emuRunCounter !== 0){
APP.clearLog(!0);
}
@ -47,7 +43,7 @@ temp_EMUMANAGER = {
// Get enabled hacks
hList.forEach(function(hackName){
if (document.getElementById('CHECK_' + hackName).checked === !0){
if (document.getElementById(`CHECK_${hackName}`).checked === !0){
emuArgs.push('-h');
emuArgs.push(hackName);
}

View file

@ -92,6 +92,7 @@ temp_FILEMANAGER = {
}
// Open save dialog
TMS.triggerClick('APP_FILE_SAVE');
},
@ -99,8 +100,18 @@ temp_FILEMANAGER = {
// Open game folder
openDir: function(path){
// Spawn explorer
APP.childProcess.exec(`start "" "${path}"`);
// Switch platform
switch (APP.os.platform()){
case 'win32':
APP.childProcess.exec(`start "" "${path}"`);
break;
case 'linux':
APP.childProcess.exec(`browse "${path}"`);
break;
}
}

View file

@ -38,7 +38,7 @@ temp_GAMELIST = {
// Write file
try {
APP.fs.writeFileSync(data.path, JSON.stringify(gameSettings), 'utf8');
APP.fs.writeFileSync(data.path, JSON.stringify(gameSettings), 'utf-8');
logMessage = APP.lang.getVariable('createdSettingsFile', [data.name]);
} catch (err) {
console.error(err);
@ -87,7 +87,7 @@ temp_GAMELIST = {
// Write file
try {
APP.fs.writeFileSync(fPath, JSON.stringify(tempData), 'utf8');
APP.fs.writeFileSync(fPath, JSON.stringify(tempData), 'utf-8');
logMessage = APP.lang.getVariable('updateGameSettings', [APP.gameList.selectedGame]);
} catch (err) {
@ -156,6 +156,7 @@ temp_GAMELIST = {
if (this.selectedGame !== ''){
// Create main vars
var logMessage = '',
cGame = this.selectedGame;
@ -213,11 +214,13 @@ temp_GAMELIST = {
document.getElementById('INPUT_gameListSearch').value = '';
const gList = APP.fs.readdirSync(APP.settings.data.gamePath);
// Check if game list isn't empty
if (gList.length > 0){
// Process game list
gList.forEach(function(gPath){
// Create main vars
var appBg,
appIcon,
addGame = !0,
@ -307,6 +310,7 @@ temp_GAMELIST = {
// If executable exists, set data
if (addGame === !0){
// Create metadata
const metadata = {
bg: appBg,
name: appName,
@ -351,6 +355,7 @@ temp_GAMELIST = {
// Process search list
search: function(){
// Create main search vars
var gameListArray = Object.keys(APP.gameList.list),
searchQuery = document.getElementById('INPUT_gameListSearch').value;
@ -437,10 +442,10 @@ temp_GAMELIST = {
});
// Check if playgo-chunk.dat exists
if (APP.fs.existsSync(gPath + '/sce_sys/playgo-chunk.dat') !== !0){
cGameStatus = 'WARN';
if (APP.fs.existsSync(`${gPath}/sce_sys/playgo-chunk.dat`) !== !0){
// Check if playgo-chunk.dat is inside app folder
// Set current game status to warn and check if playgo-chunk.dat is inside app folder
cGameStatus = 'WARN';
if (APP.fs.existsSync(`${gPath}/sce_sys/app/playgo-chunk.dat`) === !0){
APP.fs.copyFileSync(`${gPath}/sce_sys/app/playgo-chunk.dat`, `${gPath}/sce_sys/playgo-chunk.dat`);
APP.log(APP.lang.getVariable('checkDumpPlayGoOnApp', [this.list[this.selectedGame].name]));
@ -465,6 +470,7 @@ temp_GAMELIST = {
// Open selected game location
openGameLocation: function(){
// Check if there's game selected
if (this.selectedGame !== ''){
APP.fileManager.openDir(`${APP.settings.data.gamePath}/${this.list[this.selectedGame].folderName}`);
}
@ -504,7 +510,7 @@ temp_GAMELIST = {
APP.gameList.selectedGame = '';
APP.gameList.load();
APP.design.selectGame(cGame);
TMS.scrollCenter('GAME_ENTRY_' + cGame);
TMS.scrollCenter(`GAME_ENTRY_${cGame}`);
}, 50);
} catch (err) {

View file

@ -72,9 +72,8 @@ temp_PARAMSFO_PARSER = {
// Get key table data info
listAttrArray.forEach(function(cAttr){
// Slice Current Data
// Slice current data and set current read mode
const cReadingMode = hexStartLocation.slice(readerLocation, parseInt(readerLocation + 32));
readMode[cAttr] = {
keyTableOffset: cReadingMode.slice(0, 4), // Key table offset
@ -91,7 +90,7 @@ temp_PARAMSFO_PARSER = {
});
/*
Set Metadata Info
Set metadata info
*/
// Set location to data table start create first slice
@ -104,7 +103,6 @@ temp_PARAMSFO_PARSER = {
// Get hex file starting from current location
var keyData = '',
convertUft8 = !1,
cSlice = dataTableSlice.slice(pointerLocation),
stopLocation = parseInt(pointerLocation + 8); // Default: int32
/*

View file

@ -27,7 +27,6 @@ temp_SETTINGS = {
nwPath: '',
emuPath: '',
gamePath: '',
emuWinePath: '',
// Run fpPS4 on fullscreen
enableEmuFullscreen: !1,
@ -106,10 +105,8 @@ temp_SETTINGS = {
try {
// Read settings file
// Read settings file and check for obsolete keys
var loadSettings = JSON.parse(APP.fs.readFileSync(settingsPath, 'utf8'));
// Check for obsolete settings
Object.keys(loadSettings).forEach(function(cSettings){
if (APP.settings.data[cSettings] === void 0){
@ -155,7 +152,7 @@ temp_SETTINGS = {
this.data.launcherVersion = APP.packageJson.version;
try {
APP.fs.writeFileSync(`${nwPath}/Settings.json`, JSON.stringify(this.data), 'utf8');
APP.fs.writeFileSync(`${nwPath}/Settings.json`, JSON.stringify(this.data), 'utf-8');
} catch (err) {
console.error(APP.lang.getVariable('settingsSaveError', [err]));
}
@ -175,7 +172,7 @@ temp_SETTINGS = {
if (cLang !== 'english' && APP.fs.existsSync(fileLocation) === !0){
// Get selected lang
var getLangFile = APP.fs.readFileSync(fileLocation, 'utf8');
var getLangFile = APP.fs.readFileSync(fileLocation, 'utf-8');
APP.lang.selected = JSON.parse(getLangFile);
} else {
@ -199,6 +196,7 @@ temp_SETTINGS = {
// Check paths
checkPaths: function(){
// Create main vars
var logMessage = '',
mainPath = this.data.nwPath,
pathList = ['/Emu', '/Games', '/Lang'];
@ -233,7 +231,6 @@ temp_SETTINGS = {
// Set flag to skip update check on window.onload
APP.emuManager.update.skipLoadingCheck = !0;
this.data.latestCommitSha = '';
APP.emuManager.update.check();
@ -243,8 +240,6 @@ temp_SETTINGS = {
if (this.data.latestCommitSha !== ''){
APP.log(APP.lang.getVariable('settingsLogEmuSha', [APP.settings.data.latestCommitSha.slice(0, 7)]));
}
// Log message
APP.log(logMessage);
},

View file

@ -41,7 +41,7 @@ temp_TOOLS = {
var textValue = '';
if (hex !== void 0 && hex !== ''){
textValue = decodeURIComponent('%' + hex.match(/.{2,2}/g).join('%'));
textValue = decodeURIComponent(`%${hex.match(/.{2,2}/g).join('%')}`);
}
return textValue;

View file

@ -170,7 +170,6 @@ temp_EMU_UPDATE = {
artifactData,
canPrompt = !0,
canUpdate = !1,
latestCommit = '',
msgMode = 'confirm',
settingsData = APP.settings.data;
@ -181,10 +180,8 @@ temp_EMU_UPDATE = {
const cRun = options.runs.workflow_runs[i];
if (cRun.status === 'completed' && cRun.conclusion === 'success' && cRun.head_branch === settingsData.fpps4BranchName){
// Set can update on
// Set canUpdate on and run info
canUpdate = !0;
// Set run info
artifactData = {
artifact: cRun.id,
sha: cRun.head_sha
@ -256,11 +253,9 @@ temp_EMU_UPDATE = {
// If (by some reason) fpPS4 is running - close it!
APP.emuManager.killEmu();
// Display GUI
// Display GUI and start download
APP.design.toggleEmuUpdateGUI('show');
APP.design.updateProgressbarStatus(25, APP.lang.getVariable('updateEmu-1-4', [actionsData.sha.slice(0, 7)]));
// Start download
fetch(`https://nightly.link/red-prig/fpPS4/actions/runs/${actionsData.artifact}/fpPS4.zip`).then(function(resp){
if (resp.ok === !0){
@ -319,10 +314,8 @@ temp_EMU_UPDATE = {
// Finish process
finish: function(data){
// Update status
// Update status, remove download file and update settings
APP.design.updateProgressbarStatus(75, APP.lang.getVariable('updateEmu-3-4'));
// Remove download file and update settings
APP.fs.unlinkSync(data.path);
APP.settings.data.latestCommitSha = data.actions.sha;
APP.settings.data.emuPath = `${APP.path.parse(data.path).dir}/fpPS4.exe`;

4
Launcher.sh Normal file → Executable file
View file

@ -1,3 +1,3 @@
clear
./Nwjs/nw ../
exit
./Nwjs/nw .
exit

View file

@ -1,22 +1,29 @@
# fpPS4 Temmie's Launcher
Created by TheMitoSan _(Previously known as TemmieHeartz)_, This is a simple launcher created for [fpPS4](https://github.com/red-prig/fpPS4/) project.
<h1 align="center">
<img src="App/img/logo.png" width="200" alt="fpPS4_TL_Logo"><br>
fpPS4 Temmie's Launcher
</h1>
Created by TheMitoSan _(Previously known as TemmieHeartz)_, This is a simple launcher created for [fpPS4](https://github.com/red-prig/fpPS4) compatibility layer.
<p align="center">
<img src="App/img/banner.jpg" width="750">
</p>
</p><br>
## How to install
- Download / Clone this repo
- [Download / Clone this repo](https://github.com/themitosan/fpPS4-Temmie-s-Launcher/archive/refs/heads/main.zip)
- Download [nw.js](https://dl.nwjs.io/v0.70.1/nwjs-sdk-v0.70.1-win-x64.zip) version `0.70.1`
- Extract all files from nw to the `Nwjs` folder
- Extract all files from `nw` on `Nwjs` folder
- Run `Launcher.bat`
### How to setup fpPS4 and launcher
### How to Setup fpPS4 and launcher
You can setup both launcher and emulator using [this tutorial](https://docs.google.com/document/d/1HHRm9939HL7b8XCBagIyBo1VJIDj7Me4/edit).
## External plugins used on this project
- [memoryjs](https://github.com/rob--/memoryjs) - created by [Rob--](https://github.com/rob--)
- [node-stream-zip](https://github.com/antelle/node-stream-zip) - created by [antelle](https://github.com/antelle)
- [TMS.js](https://github.com/themitosan/TMS.js) by [TheMitoSan](https://github.com/themitosan/) <sup><i>(Hi!)</i></sup>
- [TMS.js](https://github.com/themitosan/TMS.js) by [TheMitoSan](https://github.com/themitosan/) <sup>*(Hi!)*</sup>
<u><i><b>IMPORTANT</b>: This software does not allow you to obtain free PS4 Games / Apps.</i></u>
<u>
**IMPORTANT**: This software does not allow you to obtain free PS4 Games / Apps.
</u>