Skip to content

Commit

Permalink
[libromdata] wii_structs.h, uint32_rshift2_t: Actually byteswap when …
Browse files Browse the repository at this point in the history
…using get_be() or geto_be().

This completely broke parsing Wii disc images.

This fixes a regression from commit 67b360b.
([libromdata] GameCube: Convert uint34_rshift2_t into a struct with helper functions.)
  • Loading branch information
GerbilSoft committed Dec 23, 2023
1 parent 101e32a commit fa8510e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libromdata/Console/wii_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef struct _uint34_rshift2_t {
* @return uint64_t
*/
uint64_t get_be(void) const {
return (static_cast<uint64_t>(val) << 2);
return (static_cast<uint64_t>(be32_to_cpu(val)) << 2);
}

/**
Expand All @@ -63,7 +63,7 @@ typedef struct _uint34_rshift2_t {
* @return uint64_t
*/
off64_t geto_be(void) const {
return (static_cast<off64_t>(val) << 2);
return (static_cast<off64_t>(be32_to_cpu(val)) << 2);
}

/**
Expand Down

0 comments on commit fa8510e

Please sign in to comment.