ThirteenAG / WidescreenFixesPack

Plugins to make or improve widescreen resolutions support in games, add more features and fix bugs.
https://thirteenag.github.io/wfp
MIT License
2.34k stars 222 forks source link

[PSPSDK] improvements to buildscripts #1416

Closed xan1242 closed 1 year ago

xan1242 commented 1 year ago

I don't quite like the current scripts because they don't pass the return value of make and always return 0, making it look like it succeeded when it actually didn't.

I've written a better, more abstract script which takes this into account, plus it abstracts the location of the PPSSPP's memstick folder via an environment variable PPSSPPMemstick. (in coordination with: https://github.com/ThirteenAG/pspsdk/pull/2)

@ThirteenAG If you like this, could you please integrate this into the premake5.lua somehow? The scripts are the same for all the projects.

Build:

setlocal EnableDelayedExpansion
call $(SolutionDir)/../external/pspsdk/bin/vsmake -C $(SolutionDir)/../source/$(ProjectName)/
if !errorlevel! neq 0 exit /b !errorlevel!
if not defined PPSSPPMemstick goto :eof
if not exist $(PPSSPPMemstick)/PSP/PLUGINS/$(ProjectName) mkdir $(PPSSPPMemstick)/PSP/PLUGINS/$(ProjectName)
copy /y $(NMakeOutput) $(PPSSPPMemstick)/PSP/PLUGINS/$(ProjectName)

Rebuild:

setlocal EnableDelayedExpansion
call $(SolutionDir)/../external/pspsdk/bin/vsmake -C $(SolutionDir)/../source/$(ProjectName)/ clean
if !errorlevel! neq 0 exit /b !errorlevel!
call $(SolutionDir)/../external/pspsdk/bin/vsmake -C $(SolutionDir)/../source/$(ProjectName)/
if !errorlevel! neq 0 exit /b !errorlevel!
if not defined PPSSPPMemstick goto :eof
if not exist $(PPSSPPMemstick)/PSP/PLUGINS/$(ProjectName) mkdir $(PPSSPPMemstick)/PSP/PLUGINS/$(ProjectName)
copy /y $(NMakeOutput) $(PPSSPPMemstick)/PSP/PLUGINS/$(ProjectName)

Clean

setlocal EnableDelayedExpansion
call $(SolutionDir)/../external/pspsdk/bin/vsmake -C $(SolutionDir)/../source/$(ProjectName)/ clean
if !errorlevel! neq 0 exit /b !errorlevel!
ThirteenAG commented 1 year ago

Good stuff, this is very much needed, but right now I don't have access to my pc, and it's really inconvenient to me to tackle with this. May I ask to PR the necessary changes? Implementing this in premake lua script should be fairly straightforward, and btw, ps2 build scripts are exactly the same, I just copied all windows stuff over from pspsdk to ps2 sdk, so if it's not too much trouble, change ps2 sdk as well.

xan1242 commented 1 year ago

I'm very unfamiliar with LUA, that's why I asked you first actually... I'll try something out with the LUA script later.

As for ps2sdk, I'll try to come up with a similar solution (although I'm not very familiar with the pcsx2 fork again lol, will take a looksie).

ThirteenAG commented 1 year ago

Okay, I'll help if I can, but probably not within a week at least, dunno. Keep me posted, maybe I can help with some minor parts in the meanwhile.

xan1242 commented 1 year ago

Alrighty, after looking at PCSX2F a bit, these are the scripts (I'm surprised you didn't map more than 128MB memory lol)

Build:

setlocal EnableDelayedExpansion
call $(SolutionDir)/../external/ps2sdk/ee/bin/vsmake -C $(SolutionDir)/../source/$(ProjectName)/
if !errorlevel! neq 0 exit /b !errorlevel!
if not defined PCSX2FDir goto :eof
if not exist $(PCSX2FDir)/PLUGINS mkdir $(PCSX2FDir)/PLUGINS
copy /y $(NMakeOutput) $(PCSX2FDir)/PLUGINS

Rebuild:

setlocal EnableDelayedExpansion
call $(SolutionDir)/../external/ps2sdk/ee/bin/vsmake -C $(SolutionDir)/../source/$(ProjectName)/ clean
if !errorlevel! neq 0 exit /b !errorlevel!
call $(SolutionDir)/../external/ps2sdk/ee/bin/vsmake -C $(SolutionDir)/../source/$(ProjectName)/
if !errorlevel! neq 0 exit /b !errorlevel!
if not defined PCSX2FDir goto :eof
if not exist $(PCSX2FDir)/PLUGINS mkdir $(PCSX2FDir)/PLUGINS
copy /y $(NMakeOutput) $(PCSX2FDir)/PLUGINS

Clean:

setlocal EnableDelayedExpansion
call $(SolutionDir)/../external/ps2sdk/ee/bin/vsmake -C $(SolutionDir)/../source/$(ProjectName)/ clean
if !errorlevel! neq 0 exit /b !errorlevel!

Where PCSX2FDir is your PCSX2F's installation directory.

I'll try to hack around the premake5 script now...