Fixed unaligned 16 and 32-bit i/o accesses in i386 CPU core [Barry Rodewald]

This commit is contained in:
Angelo Salese 2010-09-29 11:42:38 +00:00
parent 13dce3ebe6
commit e1a32f54d8
3 changed files with 28 additions and 24 deletions

2
.gitattributes vendored
View File

@ -149,7 +149,7 @@ src/emu/cpu/hd6309/hd6309.c svneol=native#text/plain
src/emu/cpu/hd6309/hd6309.h svneol=native#text/plain src/emu/cpu/hd6309/hd6309.h svneol=native#text/plain
src/emu/cpu/i386/cycles.h svneol=native#text/plain src/emu/cpu/i386/cycles.h svneol=native#text/plain
src/emu/cpu/i386/i386.c svneol=native#text/plain src/emu/cpu/i386/i386.c svneol=native#text/plain
src/emu/cpu/i386/i386.h -text svneol=native#text/plain src/emu/cpu/i386/i386.h svneol=native#text/plain
src/emu/cpu/i386/i386dasm.c svneol=native#text/plain src/emu/cpu/i386/i386dasm.c svneol=native#text/plain
src/emu/cpu/i386/i386op16.c svneol=native#text/plain src/emu/cpu/i386/i386op16.c svneol=native#text/plain
src/emu/cpu/i386/i386op32.c svneol=native#text/plain src/emu/cpu/i386/i386op32.c svneol=native#text/plain

View File

@ -894,10 +894,14 @@ INLINE void BUMP_DI(i386_state *cpustate,int adjustment)
/***********************************************************************************/ /***********************************************************************************/
#define READPORT8(port) (cpustate->io->read_byte(port)) #define READPORT8(port) (cpustate->io->read_byte(port))
#define READPORT16(port) (cpustate->io->read_word(port)) #define READPORT16(port) (READPORT8(port) | (READPORT8(port+1) << 8))
#define READPORT32(port) (cpustate->io->read_dword(port)) #define READPORT32(port) (READPORT8(port) | (READPORT8(port+1) << 8) | (READPORT8(port+2) << 16) | (READPORT8(port+3) << 24))
#define WRITEPORT8(port, value) (cpustate->io->write_byte(port, value)) #define WRITEPORT8(port, value) (cpustate->io->write_byte(port, value))
#define WRITEPORT16(port, value) (cpustate->io->write_word(port, value)) #define WRITEPORT16(port, value) WRITEPORT8(port,value & 0xff); \
#define WRITEPORT32(port, value) (cpustate->io->write_dword(port, value)) (WRITEPORT8(port+1,(value >> 8) & 0xff))
#define WRITEPORT32(port, value) WRITEPORT8(port,value & 0xff); \
(WRITEPORT8(port+1,(value >> 8) & 0xff)); \
(WRITEPORT8(port+2,(value >> 16) & 0xff)); \
(WRITEPORT8(port+3,(value >> 24) & 0xff))
#endif /* __I386_H__ */ #endif /* __I386_H__ */