danoon2 / Boxedwine

Emulator that can run 32-bit Windows programs/games on multiple platforms via Wine
GNU General Public License v2.0
816 stars 67 forks source link

big-endian host support #75

Open Exzap opened 1 year ago

Exzap commented 1 year ago

I'm trying to port Boxedwine to a big-endian 32bit PowerPC platform, and I ran into a crash in the elf loader due to it assuming little-endian native types. If I were to fix this, would I run into other issues further down the line?

There are traces of the intent to support arbitrary host endianness in the code (e.g. via setting UNALIGNED_MEMORY macro). But I can't tell if it's implemented everywhere and if not, what the scope of the missing support is?

Granted, big-endian is pretty much dead so I would understand if this is just not something this project wants to bother with.

danoon2 commented 1 year ago

I would think there is a good chance that the normal cpu emulation with no JIT might work on PPC. I have never run on a big-endian system, but the normal cpu emulation is based on Dosbox which does support that. It does work with WASM/Emscripten which is what uses that UNALIGNED_MEMORY define. It's not big endian but it did have limits on how memory can be accessed.

I did a search for (U32*) casting and only found a couple suspicious places. One is my native icon reading for Boxedwine UI. Another is drawing pixels to the screen.

Overall, I don't see any obvious issues with big endian except for the possibility of pixel color issues which would be easy for fix if you get that far.

Exzap commented 1 year ago

Thanks for the response! I will see how far I can get and report back.