--- hatari/src/uae-cpu/maccess.h 2019/04/01 07:11:35 1.1.1.3 +++ hatari/src/uae-cpu/maccess.h 2019/04/09 08:59:33 1.1.1.6 @@ -7,8 +7,8 @@ * * Adaptation to Hatari by Thomas Huth, Eero Tamminen * - * This file is distributed under the GNU Public License, version 2 or at - * your option any later version. Read the file gpl.txt for details. + * This file is distributed under the GNU General Public License, version 2 + * or at your option any later version. Read the file gpl.txt for details. */ #ifndef UAE_MACCESS_H @@ -17,7 +17,8 @@ /* Can the actual CPU access unaligned memory? */ #ifndef CPU_CAN_ACCESS_UNALIGNED -# if defined(__i386__) || defined(powerpc) || defined(__mc68020__) +# if defined(__i386__) || defined(__x86_64__) || defined(__mc68020__) || \ + defined(powerpc) || defined(__ppc__) || defined(__ppc64__) # define CPU_CAN_ACCESS_UNALIGNED 1 # else # define CPU_CAN_ACCESS_UNALIGNED 0 @@ -31,39 +32,39 @@ #include -static inline uae_u32 do_get_mem_long(uae_u32 *a) +static inline uae_u32 do_get_mem_long(void *a) { - return SDL_SwapBE32(*a); + return SDL_SwapBE32(*(uae_u32 *)a); } -static inline uae_u16 do_get_mem_word(uae_u16 *a) +static inline uae_u16 do_get_mem_word(void *a) { - return SDL_SwapBE16(*a); + return SDL_SwapBE16(*(uae_u16 *)a); } -static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) +static inline void do_put_mem_long(void *a, uae_u32 v) { - *a = SDL_SwapBE32(v); + *(uae_u32 *)a = SDL_SwapBE32(v); } -static inline void do_put_mem_word(uae_u16 *a, uae_u16 v) +static inline void do_put_mem_word(void *a, uae_u16 v) { - *a = SDL_SwapBE16(v); + *(uae_u16 *)a = SDL_SwapBE16(v); } #else /* Cpu can not access unaligned memory: */ -static inline uae_u32 do_get_mem_long(uae_u32 *a) +static inline uae_u32 do_get_mem_long(void *a) { uae_u8 *b = (uae_u8 *)a; return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]; } -static inline uae_u16 do_get_mem_word(uae_u16 *a) +static inline uae_u16 do_get_mem_word(void *a) { uae_u8 *b = (uae_u8 *)a; @@ -71,7 +72,7 @@ static inline uae_u16 do_get_mem_word(ua } -static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) +static inline void do_put_mem_long(void *a, uae_u32 v) { uae_u8 *b = (uae_u8 *)a; @@ -81,7 +82,7 @@ static inline void do_put_mem_long(uae_u b[3] = v; } -static inline void do_put_mem_word(uae_u16 *a, uae_u16 v) +static inline void do_put_mem_word(void *a, uae_u16 v) { uae_u8 *b = (uae_u8 *)a;