#ifndef __BITACCESS_H__ #include #include "debug.h" // these are disabled when running in the emulator inline void SetMemory(DWORD address, DWORD value) { #ifndef _X86_ *(DWORD*)address= value; #endif } inline DWORD GetMemory(DWORD address) { #ifndef _X86_ return *(DWORD*)address; #else return 0; #endif } inline void SetMemoryBits(DWORD address, DWORD bits) { #ifndef _X86_ //debug("%08lx |= %08lx\n", address, bits); *(DWORD*)address |= bits; #endif } inline void ClearMemoryBits(DWORD address, DWORD bits) { #ifndef _X86_ //debug("%08lx &= ~%08lx\n", address, bits); *(DWORD*)address &= ~bits; #endif } inline bool TestBitsAll(DWORD value, DWORD bits) { return (value & bits)==bits; } inline bool TestBitsAny(DWORD value, DWORD bits) { return (value & bits)!=0; } inline bool TestMemoryBitsAll(DWORD address, DWORD bits) { return TestBitsAll(GetMemory(address), bits); } inline bool TestMemoryBitsAny(DWORD address, DWORD bits) { return TestBitsAny(GetMemory(address), bits); } #define __BITACCESS_H__ #endif