add Get24LocalFromPC

This commit is contained in:
scawful
2024-07-23 21:01:12 -04:00
parent 88e91859b6
commit 8672ab4372
2 changed files with 11 additions and 0 deletions

View File

@@ -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<ImGuiID> 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

View File

@@ -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