diff options
author | Javier <dev.git@javispedro.com> | 2024-05-19 21:03:50 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2024-05-19 21:03:50 +0200 |
commit | 4a8fe8127c57b0953e2ba2ad4da5e45a20300645 (patch) | |
tree | 60eacf9089c2883bc78b3fc8bf22dc1a7c456031 /utils.h | |
parent | dfa929d625028dae01c8317823f210a3b056c385 (diff) | |
download | vbados-4a8fe8127c57b0953e2ba2ad4da5e45a20300645.tar.gz vbados-4a8fe8127c57b0953e2ba2ad4da5e45a20300645.zip |
add initial support for 2nd wheel & 4-5 mouse buttons
Diffstat (limited to 'utils.h')
-rw-r--r-- | utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -92,4 +92,11 @@ static int scalei_rem(int x, int srcmax, int dstmax, short *rem); __value [ax] \ __modify [ax cx dx si] +/** Sign extend x from b bits to 16. */ +static inline int16_t sign_extend(int16_t x, int b) +{ + int m = 16 - b; + return (x << m) >> m; +} + #endif |