Boxedwine icon indicating copy to clipboard operation
Boxedwine copied to clipboard

big-endian host support

Open Exzap opened this issue 2 years ago • 2 comments

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.

Exzap avatar Jun 15 '23 16:06 Exzap

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.

danoon2 avatar Jun 15 '23 23:06 danoon2

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

Exzap avatar Jun 15 '23 23:06 Exzap