deltabeard / Peanut-GB

A Game Boy (DMG) emulator single header library written in C99. Performance is prioritised over accuracy.
https://projects.deltabeard.com/peanutgb/
295 stars 40 forks source link

core: produce error when compiling for big endian machines #62

Closed deltabeard closed 2 years ago

deltabeard commented 2 years ago

Peanut-GB was written with little endian hosts in mind. As such, bulding for big endian targets should result in an error until the core is modified to work correctly on big endian system.

Specifically, emulated CPU instructions that use 16-bit values may use the wrong byte order on big endian systems.

Such compile error should describe what changes have to be made to make it easier for a developer to make these changes, should they want to target a big endian host.

Thank you to the anonymous contributor for raising this issue.