DONTMERGE: DRAGONS: Incomplete attempt at improving big-endian compatibility #2784
+20
−13
Conversation
It seems that screen content must be written in native endianness here, not in little-endian. This appears to fix most scenes, cutscenes, and the bag. Shadows, menus, and text are still wrong. Audio hasn't been tested yet. See https://bugs.scummvm.org/ticket/11710.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Hi,
This is related to https://bugs.scummvm.org/ticket/11710.
DRAGONS has some important rendering issues with big-endian systems. I have a PowerBook G4 running Debian unstable on ppc32 (big-endian), so I tried having a look at this. (I'm doing my tests with
Blazing Dragons (Sony Playstation/French)
, for reference.)This first commit is incomplete, and has been mostly done through naive trial-and-error, so see this more as an attempt at showing where the problem lies. Feel free to improve on it or to rewrite it completely in a better way :)
It seems that, in this engine, screen content must be written in native endianness here, not in little-endian. So, I've just introduced a naive
WRITE_SCREEN
macro that chosesWRITE_LE_UINT16
orWRITE_BE_UINT16
, depending on your platform. Probably not the best way to handle this, but once again, let's suggest something and improve it.The first commit I'm including in this PR appears to fix most scenes, cutscenes, and the bag.
Shadows, menus, and text are still wrong (I think I'm just missing something for the menus, and for the fonts/shadows it looks like some possible alpha blending problem). Audio hasn't been tested yet (Fluidsynth gives me some really strange initialisation errors, but it's maybe a problem with Debian unstable -- I'll look at this a bit later).
By the way, I also see these
(char)
casts in this engine:on PowerPC,
char
is unsigned by default, and I'm not sure thechar
here are used in a "pure character" way? Otherwise, we might want to usesigned char
,int8
oruint8
instead. But I don't really understand this part yet.We can arrange for some more tests through Discord or whatever, if you like.