handle incorrect mag endianness in PSO GC

This commit is contained in:
Martin Michelsen
2023-06-19 15:20:16 -07:00
parent 46dd11fab0
commit 8926c22eae
9 changed files with 345 additions and 85 deletions
+6
View File
@@ -78,6 +78,10 @@ struct ItemData { // 0x14 bytes
// W = photon blasts
// Y = mag synchro
// Z = item ID
// Note: PSO GC erroneously byteswaps data2 even when the item is a mag. This
// makes it incompatible with little-endian versions of PSO (i.e. all other
// versions). We manually byteswap data2 upon receipt and immediately before
// sending where needed.
union {
parray<uint8_t, 12> data1;
@@ -101,6 +105,8 @@ struct ItemData { // 0x14 bytes
void clear();
void bswap_data2_if_mag();
std::string hex() const;
std::string name(bool include_color_codes) const;
uint32_t primary_identifier() const;