diff --git a/src/app/core/common.cc b/src/app/core/common.cc index ec79a9bf..36c217a2 100644 --- a/src/app/core/common.cc +++ b/src/app/core/common.cc @@ -174,6 +174,15 @@ uint16_t ldle16b_i(uint8_t const *const p_arr, size_t const p_index) { // Initialize the static member std::stack ImGuiIdIssuer::idStack; +int Get24LocalFromPC(uint8_t *data, int addr, bool pc) { + int ret = (PcToSnes(addr) & 0xFF0000) | (data[addr + 1] << 8) | data[addr]; + if (pc) { + return SnesToPc(ret); + } else { + return ret; + } +} + } // namespace core } // namespace app } // namespace yaze diff --git a/src/app/core/common.h b/src/app/core/common.h index a7ff5389..f14e2093 100644 --- a/src/app/core/common.h +++ b/src/app/core/common.h @@ -220,6 +220,8 @@ struct FolderItem { typedef struct FolderItem FolderItem; +int Get24LocalFromPC(uint8_t *data, int addr, bool pc = true); + } // namespace core } // namespace app } // namespace yaze