CE-Programming / CEmu

Third-party TI-84 Plus CE / TI-83 Premium CE emulator, focused on developer features
https://ce-programming.github.io/CEmu
Other
1.05k stars 77 forks source link

Doesn't work on big-endian architectures #468

Closed Heath123 closed 1 month ago

Heath123 commented 1 year ago

(Thanks for reporting an issue! Please make sure to fill out the blanks below.)

What's wrong, and with what software version?

Operating System: Debian for big-endian PowerPC emulated under qemu-user, or the Casio CG50 calculator CEmu version: … (see in the About CEmu menu) I'm using the SDL GUI so there is no menu but it's the latest commit from GitHub Describe your issue:
This happens: [CEmu] NMI reset caused by writing to the stack limit at address 000000. Hint: Probably a stack overflow (aka too much recursion). and I see a black screen

What are the steps to reproduce this issue?

  1. Modify the SDL build to actually print out the messages like this:
    
    void gui_console_printf(const char *format, ...)
    {
    va_list args;
    va_start(args, format);
    vprintf(format, args);
    va_end(args);
    }

void gui_console_err_printf(const char *format, ...) { va_list args; va_start(args, format); vfprintf(stderr, format, args); va_end(args); }


2. Compile it for a big-endian system
3. Run it with `cemu-sdl -r /ti-84ce.rom` and see this 

Any logs, error output, screenshot, other comments...?
------------------------------------------------------
`[CEmu] NMI reset caused by writing to the stack limit at address 000000. Hint: Probably a stack overflow (aka too much recursion).`
![image](https://github.com/CE-Programming/CEmu/assets/13787163/bab1e6ae-8c33-4d00-8705-f1e25cad3c9d)
Heath123 commented 1 year ago

There seem to be a lot of unions and bitfields that assume a little-endian CPU

Heath123 commented 1 year ago

By putting __attribute__((scalar_storage_order("little-endian"))) everywhere I'm starting to get it working: image

Heath123 commented 1 year ago

This is what I’m doing with it: 19153332-BEB8-4767-AEA8-5C3E5A5FBCA1

HurricanePootis commented 9 months ago

Any progress on this?