diff options
author | 2008-04-09 07:31:47 +0000 | |
---|---|---|
committer | 2008-04-09 07:31:47 +0000 | |
commit | eeee1cb4378411175c14fb463b58d97794063afb (patch) | |
tree | c60cf5c4b43311d0b604f82929108c6aa02a70da /src/emu/cpu/z8000/z8000.c | |
parent | 0a3bdaa3ef7730bc5b992a7077024f706a1c5c75 (diff) |
Rewrote core memory handlers as inline functions. These should be easier to
trace through in a debug build, yet should operate the same as before.
Created a complete set of functions for all databus sizes (8,16,32,64) and
all endiannesses. A few functions are redundant, but it is now very clear
which functions to use in which scenarios. It is also now possible to rely
on being able to access values of 8, 16, 32 or 64 bits via the built-in
accessors without fear of crashing.
Updated all cores using 8-bit handlers to explicitly call the 8-bit handlers
with the appropriate endianness.
Fixed a few games which were calling n-bit handlers directly to use the
generic forms. In the future, this is all the access drivers will have.
Diffstat (limited to 'src/emu/cpu/z8000/z8000.c')
-rw-r--r-- | src/emu/cpu/z8000/z8000.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c index e25fa8154a6..7d1242e0608 100644 --- a/src/emu/cpu/z8000/z8000.c +++ b/src/emu/cpu/z8000/z8000.c @@ -233,7 +233,7 @@ INLINE UINT8 RDPORT_B(int mode, UINT16 addr) { if( mode == 0 ) { - return io_read_byte_8(addr); + return io_read_byte_8le(addr); } else { @@ -246,8 +246,8 @@ INLINE UINT16 RDPORT_W(int mode, UINT16 addr) { if( mode == 0 ) { - return io_read_byte_8((UINT16)(addr)) + - (io_read_byte_8((UINT16)(addr+1)) << 8); + return io_read_byte_8le((UINT16)(addr)) + + (io_read_byte_8le((UINT16)(addr+1)) << 8); } else { @@ -261,10 +261,10 @@ INLINE UINT32 RDPORT_L(int mode, UINT16 addr) { if( mode == 0 ) { - return io_read_byte_8((UINT16)(addr)) + - (io_read_byte_8((UINT16)(addr+1)) << 8) + - (io_read_byte_8((UINT16)(addr+2)) << 16) + - (io_read_byte_8((UINT16)(addr+3)) << 24); + return io_read_byte_8le((UINT16)(addr)) + + (io_read_byte_8le((UINT16)(addr+1)) << 8) + + (io_read_byte_8le((UINT16)(addr+2)) << 16) + + (io_read_byte_8le((UINT16)(addr+3)) << 24); } else { @@ -278,7 +278,7 @@ INLINE void WRPORT_B(int mode, UINT16 addr, UINT8 value) { if( mode == 0 ) { - io_write_byte_8(addr,value); + io_write_byte_8le(addr,value); } else { @@ -290,8 +290,8 @@ INLINE void WRPORT_W(int mode, UINT16 addr, UINT16 value) { if( mode == 0 ) { - io_write_byte_8((UINT16)(addr),value & 0xff); - io_write_byte_8((UINT16)(addr+1),(value >> 8) & 0xff); + io_write_byte_8le((UINT16)(addr),value & 0xff); + io_write_byte_8le((UINT16)(addr+1),(value >> 8) & 0xff); } else { @@ -304,10 +304,10 @@ INLINE void WRPORT_L(int mode, UINT16 addr, UINT32 value) { if( mode == 0 ) { - io_write_byte_8((UINT16)(addr),value & 0xff); - io_write_byte_8((UINT16)(addr+1),(value >> 8) & 0xff); - io_write_byte_8((UINT16)(addr+2),(value >> 16) & 0xff); - io_write_byte_8((UINT16)(addr+3),(value >> 24) & 0xff); + io_write_byte_8le((UINT16)(addr),value & 0xff); + io_write_byte_8le((UINT16)(addr+1),(value >> 8) & 0xff); + io_write_byte_8le((UINT16)(addr+2),(value >> 16) & 0xff); + io_write_byte_8le((UINT16)(addr+3),(value >> 24) & 0xff); } else { |