Yet another case where the emulator does not match the real hardware.

Why bother with them?

Get qemu to fix their shit so that the frame buffer metrics variable are
aligned on 64-bit boundaries. There might not be a written specification
for this requirement, but that's the way real hardware behaves, and it
makes complete sense (the variables are OFW cells, which are 64-bit
values and 64-bit aligned).

If you really want to accomodate their broken firmware, you can avoid
using memcpy by relying upon sparc64 being big-endian and do something
like:

-       *fontwidth = (int)*(uint64_t *)romwidth;
-       *fontheight = (int)*(uint64_t *)romheight;
-       *wtop = (int)*(uint64_t *)windowtop;
-       *wleft = (int)*(uint64_t *)windowleft;
+       *fontwidth = *(uint32_t *)(romwidth + 4);
+       *fontheight = *(uint32_t *)(romheight + 4);
+       *wtop = *(uint32_t *)(windowtop + 4);
+       *wleft = *(uint32_t *)(windowleft + 4);

Miod

Reply via email to