Skip to content
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

Some numbers not decoded correctly on big-endian systems. #52

Open
wyatt8740 opened this issue Aug 7, 2020 · 2 comments
Open

Some numbers not decoded correctly on big-endian systems. #52

wyatt8740 opened this issue Aug 7, 2020 · 2 comments

Comments

@wyatt8740
Copy link

When I load a save on my PowerBook G4 (running Debian Sid), all multi-byte numerical fields are read incorrectly.

For instance, in the following picture, the Races won, Acceleration, and Cooperation values are all correct as viewed on an amd64 machine (also running Debian Sid). But Rocco's Stamina should be 3506, Run speed should be 1735/2650, and Sprint speed should be 2135/3050.
big-endian-bug-black-chocobo

I should have 40988 Gil, and 453 battles. 0 escapes is correct.
big-endian-bug-black-chocobo_2

@wyatt8740 wyatt8740 changed the title Numerical fields larger than one byte not decoded correctly on big-endian systems. Multi-byte numbers not decoded correctly on big-endian systems. Aug 7, 2020
@wyatt8740 wyatt8740 changed the title Multi-byte numbers not decoded correctly on big-endian systems. Some numbers not decoded correctly on big-endian systems. Aug 8, 2020
@sithlord48 sithlord48 transferred this issue from sithlord48/blackchocobo Aug 10, 2020
@sithlord48
Copy link
Owner

sithlord48 commented Aug 11, 2020

Started some changes with 7db8071 . BC has been synced with ff7tk so building the master branch there should work. Please let me know if it works for you and If you find other values being reported incorrect please report them here. (I don't have a bigEndian cpu to test on atm)

@wyatt8740
Copy link
Author

wyatt8740 commented Aug 13, 2020

Thanks.

There are still several issues, but it's looking better. I've not tried saving yet though.

For starters, run speed and sprint speed still show as 9999 each, when they should be (for Rocco, anyway) 1735/2560 and 2135/3050 respectively. Stamina is now displaying correctly however. So is Gil and GP, as well as battles. I have never escaped, so I don't know if escapes are being displayed correctly or not (zero is zero).

Materia AP is all wrong, too. According to big endian, my Cover materia has some massive negative number of AP (it gets truncated with ellipsis (…)), rather than positive 218, for instance. That's in the side column; in the selected materia skills/stat info window it shows as 40,000/40,000 (again, instead of 218/40000).

The Materia stolen by Yuffie area also uses incorrect AP numbers.

Also, Cloud (on PowerPC) appears to have used limit 1-1 17664 times, when in fact he has used it 69 times. Limit 2-1 claims 1536 uses, but has been used 6 times.

On big endian, Cloud also has 23325 HP and 32767 MP (Should be 2456 and 613).

Cloud also has 46849 kills rather than 439, and 1544291584 EXP rather than 330844.

That's everything I'm seeing at the moment. You got everything I reported before fixed except for the chocobo run and sprint speeds.

Qemu can be used to run PPC binaries on amd64, by the way. I've also managed to get the program to cross-compile for PPC from my amd64 desktop (although it took a bit of footwork, and this is from someone who's done a lot of cross-compiling before). An easier way would be to make a PowerPC chroot and use qemu user emulation again, but that will make compilation much, much slower than running a proper cross-compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants