summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/tlcs90/tlcs90.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-11-23 00:05:00 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-11-23 00:05:00 +0000
commitcf2bb4f315bb15b991e22665838f62f6792001e2 (patch)
tree41589dc7872cee72972878990691ab4507e4111a /src/emu/cpu/tlcs90/tlcs90.c
parent2d5bd758dee8247a5b0ce096963962d32738fa11 (diff)
More memory conversions.
Diffstat (limited to 'src/emu/cpu/tlcs90/tlcs90.c')
-rw-r--r--src/emu/cpu/tlcs90/tlcs90.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c
index e5359746edd..0e199671935 100644
--- a/src/emu/cpu/tlcs90/tlcs90.c
+++ b/src/emu/cpu/tlcs90/tlcs90.c
@@ -6,6 +6,7 @@
*************************************************************************************************************/
+#define NO_LEGACY_MEMORY_HANDLERS 1
#include "debugger.h"
#include "deprecat.h"
#include "cpuexec.h"
@@ -19,6 +20,8 @@ typedef struct
UINT16 irq_state, irq_mask;
cpu_irq_callback irq_callback;
const device_config *device;
+ const address_space *program;
+ const address_space *io;
int extra_cycles; // extra cycles for interrupts
UINT8 internal_registers[48];
UINT32 ixbase,iybase;
@@ -161,16 +164,16 @@ static UINT32 addr;
#define R16D8( N,R,I ) mode##N = MODE_R16D8; r##N = R; r##N##b = I;
#define R16R8( N,R,g ) mode##N = MODE_R16R8; r##N = R; r##N##b = g;
-INLINE UINT8 RM8 (UINT32 a) { return program_read_byte_8le( a ); }
+INLINE UINT8 RM8 (UINT32 a) { return memory_read_byte_8le( T90.program, a ); }
INLINE UINT16 RM16(UINT32 a) { return RM8(a) | (RM8( (a+1) & 0xffff ) << 8); }
-INLINE void WM8 (UINT32 a, UINT8 v) { program_write_byte_8le( a, v ); }
+INLINE void WM8 (UINT32 a, UINT8 v) { memory_write_byte_8le( T90.program, a, v ); }
INLINE void WM16(UINT32 a, UINT16 v) { WM8(a,v); WM8( (a+1) & 0xffff, v >> 8); }
-INLINE UINT8 RX8 (UINT32 a, UINT32 base) { return program_read_byte_8le( base | a ); }
+INLINE UINT8 RX8 (UINT32 a, UINT32 base) { return memory_read_byte_8le( T90.program, base | a ); }
INLINE UINT16 RX16(UINT32 a, UINT32 base) { return RX8(a,base) | (RX8( (a+1) & 0xffff, base ) << 8); }
-INLINE void WX8 (UINT32 a, UINT8 v, UINT32 base) { program_write_byte_8le( base | a, v ); }
+INLINE void WX8 (UINT32 a, UINT8 v, UINT32 base) { memory_write_byte_8le( T90.program, base | a, v ); }
INLINE void WX16(UINT32 a, UINT16 v, UINT32 base) { WX8(a,v,base); WX8( (a+1) & 0xffff, v >> 8, base); }
INLINE UINT8 READ8(void) { UINT8 b0 = RM8( addr++ ); addr &= 0xffff; return b0; }
@@ -2278,7 +2281,7 @@ FFED BX R/W Reset Description
static READ8_HANDLER( t90_internal_registers_r )
{
- #define RIO io_read_byte_8le( T90_IOBASE+offset )
+ #define RIO memory_read_byte_8le( T90.io, T90_IOBASE+offset )
UINT8 data = T90.internal_registers[offset];
switch ( T90_IOBASE + offset )
@@ -2486,7 +2489,7 @@ static TIMER_CALLBACK( t90_timer4_callback )
static WRITE8_HANDLER( t90_internal_registers_w )
{
- #define WIO io_write_byte_8le( T90_IOBASE+offset, data )
+ #define WIO memory_write_byte_8le( T90.io, T90_IOBASE+offset, data )
UINT8 out_mask;
UINT8 old = T90.internal_registers[offset];
@@ -2655,6 +2658,8 @@ static CPU_INIT( t90 )
memset(&T90, 0, sizeof(T90));
T90.irq_callback = irqcallback;
T90.device = device;
+ T90.program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
+ T90.io = memory_find_address_space(device, ADDRESS_SPACE_IO);
T90.timer_period = attotime_mul(ATTOTIME_IN_HZ(cpu_get_clock(device->machine->activecpu)), 8);