mirror of
https://github.com/zeldaret/ss
synced 2026-05-31 09:21:42 -04:00
bitwise flag helper
This commit is contained in:
@@ -21,6 +21,9 @@ d/d_base.cpp:
|
||||
toBeSorted/unk_flag_stuff.cpp:
|
||||
.text start:0x800BEF90 end:0x800BF200
|
||||
|
||||
toBeSorted/bitwise_flag_helper.cpp:
|
||||
.text start:0x800BF200 end:0x800BF264
|
||||
|
||||
Runtime/__init_cpp_exceptions.cpp:
|
||||
.text start:0x804C71A8 end:0x804C7218
|
||||
.ctors start:0x804DB640 end:0x804DB644 rename:.ctors$10
|
||||
|
||||
@@ -4144,9 +4144,9 @@ maskForIdx__12UnkFlagStuffFUs = .text:0x800BF050; // type:function size:0x50
|
||||
getCounterOrFlag__12UnkFlagStuffFUsPUsUi = .text:0x800BF0A0; // type:function size:0x68
|
||||
setCounterOrFlag__12UnkFlagStuffFUsPUsUiUi = .text:0x800BF110; // type:function size:0x9C
|
||||
checkFlagValid__12UnkFlagStuffFUsUi = .text:0x800BF1B0; // type:function size:0x50
|
||||
fn_800BF200 = .text:0x800BF200; // type:function size:0x14
|
||||
fn_800BF220 = .text:0x800BF220; // type:function size:0x20
|
||||
fn_800BF240 = .text:0x800BF240; // type:function size:0x24
|
||||
checkFlag__17BitwiseFlagHelperFUsUsPUs = .text:0x800BF200; // type:function size:0x14
|
||||
setFlag__17BitwiseFlagHelperFUsUsPUs = .text:0x800BF220; // type:function size:0x20
|
||||
unsetFlag__17BitwiseFlagHelperFUsUsPUs = .text:0x800BF240; // type:function size:0x24
|
||||
fn_800BF270 = .text:0x800BF270; // type:function size:0x28
|
||||
fn_800BF2A0 = .text:0x800BF2A0; // type:function size:0x70
|
||||
fn_800BF310 = .text:0x800BF310; // type:function size:0xC
|
||||
|
||||
@@ -8,6 +8,7 @@ LIBS = [
|
||||
"objects": [
|
||||
["Runtime/__init_cpp_exceptions.cpp", False],
|
||||
["toBeSorted/unk_flag_stuff.cpp", True],
|
||||
["toBeSorted/bitwise_flag_helper.cpp", True],
|
||||
["d/d_base.cpp", False],
|
||||
["d/a/d_a_base.cpp", False],
|
||||
["toBeSorted/save_file.cpp", False],
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#include <types.h>
|
||||
|
||||
class BitwiseFlagHelper {
|
||||
public:
|
||||
bool checkFlag(u16 slot, u16 shift, u16 *pData);
|
||||
void setFlag(u16 slot, u16 shift, u16 *pData);
|
||||
void unsetFlag(u16 slot, u16 shift, u16 *pData);
|
||||
};
|
||||
|
||||
bool BitwiseFlagHelper::checkFlag(u16 slot, u16 shift, u16 *pData) {
|
||||
return (pData[slot] >> shift) & 1;
|
||||
}
|
||||
void BitwiseFlagHelper::setFlag(u16 slot, u16 shift, u16 *pData) {
|
||||
pData[slot] |= (1 << shift);
|
||||
}
|
||||
void BitwiseFlagHelper::unsetFlag(u16 slot, u16 shift, u16 *pData) {
|
||||
pData[slot] &= ~(1 << shift);
|
||||
}
|
||||
Reference in New Issue
Block a user