-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build for PS2 #5238
base: master
Are you sure you want to change the base?
Build for PS2 #5238
Conversation
8981e82
to
dfb7f2a
Compare
74521db
to
2ee918d
Compare
The CLX stuff is done and PS2 SDK recently received lots of updates, might be a good time to give this another go! set(BUILD_ASSETS_MPQ OFF)
set(UNPACKED_MPQS ON) |
Slight update, the latest build chain fixes the ReadOnlyTest issue as well as remove the need for building the drivers. |
Everything appears to be working now with streaming audio (currently requires individual files and not using an MPQ)... but the PS2 only allows 16 files to be open at the same time meaning that we can't open all the needed audio files for streaming. So that's something we might have to look in to a solution for. |
It should now allow up to 128 open files ps2dev/ps2sdk#396 |
a488eeb
to
a25fcda
Compare
190499a
to
3b2bc7a
Compare
8aeb2ce
to
dd281a7
Compare
#ifndef PS2 | ||
#ifndef NOSOUND |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider doing this instead throughout:
#if !defined(NOSOUND) && !defined(PS2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the svid portion is still just a the stage where i stubbed everything out to avoid linking with audiolib. I still have to find the best way to bring video sound back up.
AssetHandle handle = OpenAsset(file_path_.c_str(), size); | ||
if (handle.ok()) { | ||
size -= 16; | ||
uint32_t buffer[3]; | ||
if (handle.read(buffer, sizeof(buffer))) { | ||
pitch = buffer[2]; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit surprising to have GetLength()
open a file.
This should probably be done when the SoundSample
is constructed.
audsrv_adpcm_t *sampleId_ = nullptr; | ||
std::unique_ptr<audsrv_adpcm_t> stream_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider a bool owned_;
instead. Or simply std::shared_ptr
#ifndef PS2 | ||
texture = SDLWrap::CreateTexture(renderer, SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_STREAMING, gnScreenWidth, gnScreenHeight); | ||
#else | ||
texture = SDLWrap::CreateTexture(renderer, SDL_PIXELFORMAT_ABGR1555, SDL_TEXTUREACCESS_STREAMING, gnScreenWidth, gnScreenHeight); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider doing it more generally by adding a CMake define for DEVILUTIONX_DISPLAY_TEXTURE_FORMAT
(can then be used in storm_svid.cpp
as well)
This give us 2MB of dedicated audio memory and support for compressed audio at runtime which is a huge boost to the already limited system memory
List taken from the PS2 PR (diasurgical#5238)
List taken from the PS2 PR (diasurgical#5238) Regexp used for removal: ``` PS_(WARR|ROGUE|MAGE|MONK)(14B|14C|16B|16C|17|18|19|20|21|22|23|25|26|28|30|31|32|33|36|37|38|39|40|41|42|44|45|47|48|57|64|65|66|67|72|73|74|75|76|77|78|97|98)\b ```
List taken from the PS2 PR (diasurgical#5238) Regexp used for removal: ``` PS_(WARR|ROGUE|MAGE|MONK)(14B|14C|16B|16C|17|18|19|20|21|22|23|25|26|28|30|31|32|33|36|37|38|39|40|41|42|44|45|47|48|57|64|65|66|67|72|73|74|75|76|77|78|97|98)\b ```
List taken from the PS2 PR (diasurgical#5238) Regexp used for removal: ``` PS_(WARR|ROGUE|MAGE|MONK)(14B|14C|16B|16C|17|18|19|20|21|22|23|25|26|28|30|31|32|33|36|37|38|39|40|41|42|44|45|47|48|57|64|65|66|67|72|73|74|75|76|77|78|97|98)\b ```
/*PS_WARR16B*/ { sfx_STREAM, "sfx\\warrior\\wario16b.wav", nullptr }, | ||
/*PS_WARR16C*/ { sfx_STREAM, "sfx\\warrior\\wario16c.wav", nullptr }, | ||
/*PS_WARR17*/ { sfx_STREAM, "sfx\\warrior\\warior17.wav", nullptr }, | ||
/*PS_WARR18*/ { sfx_STREAM, "sfx\\warrior\\warior18.wav", nullptr }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct.
This file is "Not a chance" and it is actually used (HeroSpeech::NotAChance
)
if you need to build the SDK (don't forget to clone and build ps2_drivers) you will also need this:
todo
ReadOnlyTest()
is creating a folder instead of a file, and fails to delete it, failing next lauchinstead of 640x480which is the max PS2 can doSide note
Initially we tried using SDL1.2, but the version provided by ps2sdk is 1.2.8 and we expect 1.2.10. There is also an issue with there port not correctly implementing Uint64. Solving that wasn't to big of an issue, but the game gets stuck during SDL_JoystickInit, so instead we for now have opted for SDL2 which went much smoother.