MaikelChan / SpaceCadetPinball

Wii and 3DS ports of 3D Pinball - Space Cadet
https://pacochan.net/software/3d-pinball-space-cadet/
MIT License
100 stars 6 forks source link

Enable New3DS speedup / Add .cia build #7

Closed MrHuu closed 2 years ago

MrHuu commented 2 years ago

This PR add's a few features:

When defining ROMFS in the makefile to point to the directory containing gamefiles, they will be included and looked for in the romfs. If not defined, it builds like regular.

To be able to build a .cia, additional tools are required: bannertool and makerom

I'll have this as a Draft, feel free to implement something similar. This is mostly informative, but if you're interested it should be ready to merge

MaikelChan commented 2 years ago

Thanks!

I only have a 3DS, not a New 3DS, so I'm not able to test the speed up. Does the osSetSpeedupEnable(true) function checks if the game is run on a 3DS or New 3DS and ignores the speed up in 3DS?

And even if it does, do you know a good way of checking on which hardware is running? I'd like to disable vsync on 3DS but enable it on New 3DS. With the latest optimizations (along with the speed up), it should probably reach easily 60fps. But on 3DS there's still a way to go, so enabling vsync there caps the game at 30fps, which is too slow. Without vsync at least it reaches 40 something fps and it's more playable.

MrHuu commented 2 years ago

Thanks!

I only have a 3DS, not a New 3DS, so I'm not able to test the speed up. Does the osSetSpeedupEnable(true) function checks if the game is run on a 3DS or New 3DS and ignores the speed up in 3DS?

And even if it does, do you know a good way of checking on which hardware is running? I'd like to disable vsync on 3DS but enable it on New 3DS. With the latest optimizations (along with the speed up), it should probably reach easily 60fps. But on 3DS there's still a way to go, so enabling vsync there caps the game at 30fps, which is too slow. Without vsync at least it reaches 40 something fps and it's more playable.

The function should only enable the setting on actual new3ds hardware. But if we want to be sure, something like this could be used to differentiate between the old or new 3ds devices:

bool isN3DS;

APT_CheckNew3DS(&isN3DS);

if(isN3DS)
    osSetSpeedupEnable(true);
MaikelChan commented 2 years ago

Could the makefile be modified so, in case bannertool and makerom are not found, it creates only the 3dsx as before? Right now it causes an error. I would like, if possible, to consider generating a .cia as an optional extra step.

MaikelChan commented 2 years ago

I finally pushed your changes and made the CIA build optional.

Thanks again for the help.