From eeee1cb4378411175c14fb463b58d97794063afb Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Wed, 9 Apr 2008 07:31:47 +0000 Subject: 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. --- src/emu/cpu/i86/i86mem.c | 40 ++++++++-------------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) (limited to 'src/emu/cpu/i86/i86mem.c') diff --git a/src/emu/cpu/i86/i86mem.c b/src/emu/cpu/i86/i86mem.c index 3a06419dc36..47dbdc7d4c2 100644 --- a/src/emu/cpu/i86/i86mem.c +++ b/src/emu/cpu/i86/i86mem.c @@ -4,43 +4,19 @@ #ifdef I8086 #if (HAS_I8088||HAS_I80188) -static UINT16 read_word_8(offs_t addr) -{ - UINT16 result = program_read_byte_8(addr); - return result | (program_read_byte_8(addr + 1) << 8); -} - -static void write_word_8(offs_t addr, UINT16 data) -{ - program_write_byte_8(addr, data); - program_write_byte_8(addr + 1, data >> 8); -} - -static UINT16 read_port_word_8(offs_t addr) -{ - UINT16 result = io_read_byte_8(addr); - return result | (io_read_byte_8(addr + 1) << 8); -} - -static void write_port_word_8(offs_t addr, UINT16 data) -{ - io_write_byte_8(addr, data); - io_write_byte_8(addr + 1, data >> 8); -} - static void configure_memory_8bit(void) { I.mem.fetch_xor = 0; - I.mem.rbyte = program_read_byte_8; - I.mem.rword = read_word_8; - I.mem.wbyte = program_write_byte_8; - I.mem.wword = write_word_8; + I.mem.rbyte = program_read_byte_8le; + I.mem.rword = program_read_word_8le; + I.mem.wbyte = program_write_byte_8le; + I.mem.wword = program_write_word_8le; - I.mem.rbyte_port = io_read_byte_8; - I.mem.rword_port = read_port_word_8; - I.mem.wbyte_port = io_write_byte_8; - I.mem.wword_port = write_port_word_8; + I.mem.rbyte_port = io_read_byte_8le; + I.mem.rword_port = io_read_word_8le; + I.mem.wbyte_port = io_write_byte_8le; + I.mem.wword_port = io_write_word_8le; } #endif #endif -- cgit v1.2.3-70-g09d2