diff --git a/src/vjag_memory.h b/src/vjag_memory.h index ad33cbd..003fb00 100644 --- a/src/vjag_memory.h +++ b/src/vjag_memory.h @@ -286,7 +286,18 @@ extern const char * whoName[10]; r[(a)+2] = ((v) & 0x0000FF00) >> 8, r[(a)+3] = (v) & 0x000000FF #define GET32(r, a) ((r[(a)] << 24) | (r[(a)+1] << 16) | (r[(a)+2] << 8) | r[(a)+3]) #define SET16(r, a, v) r[(a)] = ((v) & 0xFF00) >> 8, r[(a)+1] = (v) & 0xFF -#define GET16(r, a) ((r[(a)] << 8) | r[(a)+1]) + + +#ifdef USE_STRUCTS + INLINE static uint16_t GET16(uint8_t* r,uint32_t a) { + U16Union u16; + u16.Bytes.UBYTE = r[a]; + u16.Bytes.LBYTE = r[a+1]; + return u16.WORD; + } +#else + #define GET16(r, a) ((r[(a)] << 8) | r[(a)+1]) +#endif #ifdef __cplusplus }