NagyD / SDLPoP

An open-source port of Prince of Persia, based on the disassembly of the DOS version.
GNU General Public License v3.0
1.1k stars 140 forks source link

MIPS (PSP) exceptions when reading misaligned data #318

Closed vichoca9 closed 2 weeks ago

vichoca9 commented 1 month ago

I managed to compile a build for the PSP by modifying the cmake file. Using latest source, the game crashes whenever a word is loaded, resulting possibly from unaligned addresses (sh, lhu instructions and so on).

Examples: play_seq, load from ini (ini_process_word), convert_digi_sound and so on.

Using another data type for them results in undefined behavior or weird bugs (prince falling endlessly after disabling sound and ini from code).

vichoca9 commented 4 weeks ago

This also means: fixing all warnings made by -Wcast-align.

vichoca9 commented 4 weeks ago

Nevermind, I hacked around until it got into a playable state, I will close this and do a PR after some extra testing.

vichoca9 commented 3 weeks ago

It is now playable, but crashes whenever it reads something misaligned (now it is automoves). Reopening this issue, hope someone else can look at the pragmas.