dfsound: Fix issues on big-endian systems
[pcsx_rearmed.git] / plugins / dfsound / reverb.c
index ec570fb..de9b804 100644 (file)
@@ -20,6 +20,7 @@
  ***************************************************************************/\r
 \r
 #include "stdafx.h"\r
+#include "spu.h"\r
 \r
 #define _IN_REVERB\r
 \r
@@ -50,16 +51,16 @@ INLINE int rvb2ram_offs(int curr, int space, int iOff)
 \r
 // get_buffer content helper: takes care about wraps\r
 #define g_buffer(var) \\r
- ((int)(signed short)spu.spuMem[rvb2ram_offs(curr_addr, space, rvb->var)])\r
+ ((int)(signed short)LE16TOH(spu.spuMem[rvb2ram_offs(curr_addr, space, rvb->var)]))\r
 \r
 // saturate iVal and store it as var\r
 #define s_buffer(var, iVal) \\r
  ssat32_to_16(iVal); \\r
- spu.spuMem[rvb2ram_offs(curr_addr, space, rvb->var)] = iVal\r
+ spu.spuMem[rvb2ram_offs(curr_addr, space, rvb->var)] = HTOLE16(iVal)\r
 \r
 #define s_buffer1(var, iVal) \\r
  ssat32_to_16(iVal); \\r
- spu.spuMem[rvb2ram_offs(curr_addr, space, rvb->var + 1)] = iVal\r
+ spu.spuMem[rvb2ram_offs(curr_addr, space, rvb->var + 1)] = HTOLE16(iVal)\r
 \r
 ////////////////////////////////////////////////////////////////////////\r
 \r