diff --git a/src/sim65/memory.c b/src/sim65/memory.c index 11f0be55a..68e7bb93b 100644 --- a/src/sim65/memory.c +++ b/src/sim65/memory.c @@ -46,7 +46,7 @@ /* THE memory */ -static unsigned char Mem[0x10000]; +unsigned char Mem[0x10000]; @@ -73,14 +73,6 @@ void MemWriteWord (unsigned Addr, unsigned Val) -unsigned char MemReadByte (unsigned Addr) -/* Read a byte from a memory location */ -{ - return Mem[Addr]; -} - - - unsigned MemReadWord (unsigned Addr) /* Read a word from a memory location */ { diff --git a/src/sim65/memory.h b/src/sim65/memory.h index 41cc800d3..cef786aaa 100644 --- a/src/sim65/memory.h +++ b/src/sim65/memory.h @@ -36,7 +36,9 @@ #ifndef MEMORY_H #define MEMORY_H +#include "inline.h" +extern unsigned char Mem[0x10000]; /*****************************************************************************/ /* Code */ @@ -50,8 +52,15 @@ void MemWriteByte (unsigned Addr, unsigned char Val); void MemWriteWord (unsigned Addr, unsigned Val); /* Write a word to a memory location */ -unsigned char MemReadByte (unsigned Addr); +#if defined(HAVE_INLINE) +INLINE unsigned char MemReadByte (unsigned Addr) /* Read a byte from a memory location */ +{ + return Mem[Addr]; +} +#else +#define MemReadByte(Addr) Mem[Addr] +#endif unsigned MemReadWord (unsigned Addr); /* Read a word from a memory location */