diff options
author | _AG <gennariarmando@outlook.com> | 2019-07-07 09:21:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-07 09:21:44 +0200 |
commit | 0ac6d0515e1ba703da2c0f742d91e7b550feac06 (patch) | |
tree | 2a5b1fc5511841acb443636b5a9b560d7aca5f2b /src/common.h | |
parent | Lil update. (diff) | |
parent | some work on vehicles (diff) | |
download | re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar.gz re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar.bz2 re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar.lz re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar.xz re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.tar.zst re3-0ac6d0515e1ba703da2c0f742d91e7b550feac06.zip |
Diffstat (limited to 'src/common.h')
-rw-r--r-- | src/common.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h index 3d260f6e..79626acb 100644 --- a/src/common.h +++ b/src/common.h @@ -49,6 +49,19 @@ typedef uint16_t wchar; #define ALIGNPTR(p) (void*)((((uintptr)(void*)p) + sizeof(void*)-1) & ~(sizeof(void*)-1)) +// PDP-10 like byte functions +#define MASK(p, s) (((1<<(s))-1) << (p)) +inline uint32 dpb(uint32 b, uint32 p, uint32 s, uint32 w) +{ + uint32 m = MASK(p,s); + return w & ~m | b<<p & m; +} +inline uint32 ldb(uint32 p, uint32 s, uint32 w) +{ + return w>>p & (1<<s)-1; +} + + // little hack extern void **rwengine; #define RwEngineInstance (*rwengine) |