diff options
author | 2010-06-22 22:26:45 +0200 | |
---|---|---|
committer | 2010-06-22 22:26:45 +0200 | |
commit | 20575a338e9640eca924958484a5fee800e09971 (patch) | |
tree | efaeac41a8a21bea1c90494b3b0968169d4f8732 /plugins/ao/eng_dsf/arm7memil.c | |
parent | c901a7cbf52ee234220f21b85c2e77667264d16c (diff) |
audio overload plugin - highly experimental; no seeking; crashes
Diffstat (limited to 'plugins/ao/eng_dsf/arm7memil.c')
-rw-r--r-- | plugins/ao/eng_dsf/arm7memil.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/plugins/ao/eng_dsf/arm7memil.c b/plugins/ao/eng_dsf/arm7memil.c new file mode 100644 index 00000000..b9daed83 --- /dev/null +++ b/plugins/ao/eng_dsf/arm7memil.c @@ -0,0 +1,56 @@ +// memory inline functions shared by ARM and THUMB modes + +static INLINE void arm7_write_32(UINT32 addr, UINT32 data ) +{ + addr &= ~3; + dc_write32(addr,data); +} + + +static INLINE void arm7_write_16(UINT32 addr, UINT16 data) +{ + addr &= ~1; + dc_write16(addr,data); +} + +static INLINE void arm7_write_8(UINT32 addr, UINT8 data) +{ + dc_write8(addr,data); +} + +static INLINE UINT32 arm7_read_32(UINT32 addr) +{ + UINT32 result; + int k = (addr & 3) << 3; + + if (k) + { + result = dc_read32 (addr & ~3); + result = (result >> k) | (result << (32 - k)); + } + else + { + result = dc_read32(addr); + } + return result; +} + +static INLINE UINT16 arm7_read_16(UINT32 addr) +{ + UINT16 result; + + result = dc_read16(addr & ~1); + + if (addr & 1) + { + result = ((result>>8) & 0xff) | ((result&0xff)<<8); + } + + return result; +} + +static INLINE UINT8 arm7_read_8(UINT32 addr) +{ + return dc_read8(addr); +} + |