diff options
author | 2008-11-23 02:06:51 +0000 | |
---|---|---|
committer | 2008-11-23 02:06:51 +0000 | |
commit | 2b5f8f5f0e9a6eb9397ec9a573183f673c40477e (patch) | |
tree | 9304d26d40913e66f109bd76c704771e69c52e5e /src/emu | |
parent | 3601d8880cbea5cdb9e1ebe734f1ae98106d66ca (diff) |
Removed cpu_read_byte/cpu_write_byte. Fixed a few lingering compiler
issues. Fixed Z8000 crash.
Diffstat (limited to 'src/emu')
-rw-r--r-- | src/emu/cpu/pdp1/pdp1dasm.c | 4 | ||||
-rw-r--r-- | src/emu/cpu/tms34010/34010ops.h | 119 | ||||
-rw-r--r-- | src/emu/cpu/tms34010/tms34010.h | 120 | ||||
-rw-r--r-- | src/emu/cpu/v810/v810dasm.c | 4 | ||||
-rw-r--r-- | src/emu/cpu/z8000/z8000.c | 2 | ||||
-rw-r--r-- | src/emu/cpuintrf.c | 53 | ||||
-rw-r--r-- | src/emu/cpuintrf.h | 13 | ||||
-rw-r--r-- | src/emu/machine/idectrl.c | 38 |
8 files changed, 146 insertions, 207 deletions
diff --git a/src/emu/cpu/pdp1/pdp1dasm.c b/src/emu/cpu/pdp1/pdp1dasm.c index 3c0ca1b0d4d..9b7a9322d51 100644 --- a/src/emu/cpu/pdp1/pdp1dasm.c +++ b/src/emu/cpu/pdp1/pdp1dasm.c @@ -8,13 +8,13 @@ static int y; INLINE void ea (void) { - while (1) +/* while (1) { if (ib == 0) return; ib = (READ_PDP_18BIT (y) >> 12) & 1; y = READ_PDP_18BIT (y) & 07777; - } + }*/ } #define IN if (ib) sprintf(buffer+strlen(buffer)," i") diff --git a/src/emu/cpu/tms34010/34010ops.h b/src/emu/cpu/tms34010/34010ops.h index f4a7fc6a84d..b9662898198 100644 --- a/src/emu/cpu/tms34010/34010ops.h +++ b/src/emu/cpu/tms34010/34010ops.h @@ -46,125 +46,6 @@ INLINE void TMS34010_WRMEM_DWORD(tms34010_state *tms, offs_t A,UINT32 V) -/*************************************************************************** - INTERNAL I/O CONSTANTS -***************************************************************************/ - -enum -{ - REG_HESYNC = 0, - REG_HEBLNK, - REG_HSBLNK, - REG_HTOTAL, - REG_VESYNC, - REG_VEBLNK, - REG_VSBLNK, - REG_VTOTAL, - REG_DPYCTL, - REG_DPYSTRT, - REG_DPYINT, - REG_CONTROL, - REG_HSTDATA, - REG_HSTADRL, - REG_HSTADRH, - REG_HSTCTLL, - - REG_HSTCTLH, - REG_INTENB, - REG_INTPEND, - REG_CONVSP, - REG_CONVDP, - REG_PSIZE, - REG_PMASK, - REG_UNK23, - REG_UNK24, - REG_UNK25, - REG_UNK26, - REG_DPYTAP, - REG_HCOUNT, - REG_VCOUNT, - REG_DPYADR, - REG_REFCNT -}; - -enum -{ - REG020_VESYNC, - REG020_HESYNC, - REG020_VEBLNK, - REG020_HEBLNK, - REG020_VSBLNK, - REG020_HSBLNK, - REG020_VTOTAL, - REG020_HTOTAL, - REG020_DPYCTL, /* matches 010 */ - REG020_DPYSTRT, /* matches 010 */ - REG020_DPYINT, /* matches 010 */ - REG020_CONTROL, /* matches 010 */ - REG020_HSTDATA, /* matches 010 */ - REG020_HSTADRL, /* matches 010 */ - REG020_HSTADRH, /* matches 010 */ - REG020_HSTCTLL, /* matches 010 */ - - REG020_HSTCTLH, /* matches 010 */ - REG020_INTENB, /* matches 010 */ - REG020_INTPEND, /* matches 010 */ - REG020_CONVSP, /* matches 010 */ - REG020_CONVDP, /* matches 010 */ - REG020_PSIZE, /* matches 010 */ - REG020_PMASKL, - REG020_PMASKH, - REG020_CONVMP, - REG020_CONTROL2, - REG020_CONFIG, - REG020_DPYTAP, /* matches 010 */ - REG020_VCOUNT, - REG020_HCOUNT, - REG020_DPYADR, /* matches 010 */ - REG020_REFADR, - - REG020_DPYSTL, - REG020_DPYSTH, - REG020_DPYNXL, - REG020_DPYNXH, - REG020_DINCL, - REG020_DINCH, - REG020_RES0, - REG020_HESERR, - REG020_RES1, - REG020_RES2, - REG020_RES3, - REG020_RES4, - REG020_SCOUNT, - REG020_BSFLTST, - REG020_DPYMSK, - REG020_RES5, - - REG020_SETVCNT, - REG020_SETHCNT, - REG020_BSFLTDL, - REG020_BSFLTDH, - REG020_RES6, - REG020_RES7, - REG020_RES8, - REG020_RES9, - REG020_IHOST1L, - REG020_IHOST1H, - REG020_IHOST2L, - REG020_IHOST2H, - REG020_IHOST3L, - REG020_IHOST3H, - REG020_IHOST4L, - REG020_IHOST4H -}; - -/* Interrupts that are generated by the processor internally */ -#define TMS34010_INT1 0x0002 /* External Interrupt 1 */ -#define TMS34010_INT2 0x0004 /* External Interrupt 2 */ -#define TMS34010_HI 0x0200 /* Host Interrupt */ -#define TMS34010_DI 0x0400 /* Display Interrupt */ -#define TMS34010_WV 0x0800 /* Window Violation Interrupt */ - /* IO registers accessor */ #define IOREG(T,reg) ((T)->IOregs[reg]) #define SMART_IOREG(T,reg) ((T)->IOregs[(T)->is_34020 ? REG020_##reg : REG_##reg]) diff --git a/src/emu/cpu/tms34010/tms34010.h b/src/emu/cpu/tms34010/tms34010.h index 2dd737ce16c..8389bb9064b 100644 --- a/src/emu/cpu/tms34010/tms34010.h +++ b/src/emu/cpu/tms34010/tms34010.h @@ -55,6 +55,126 @@ enum }; +/*************************************************************************** + INTERNAL I/O CONSTANTS +***************************************************************************/ + +enum +{ + REG_HESYNC = 0, + REG_HEBLNK, + REG_HSBLNK, + REG_HTOTAL, + REG_VESYNC, + REG_VEBLNK, + REG_VSBLNK, + REG_VTOTAL, + REG_DPYCTL, + REG_DPYSTRT, + REG_DPYINT, + REG_CONTROL, + REG_HSTDATA, + REG_HSTADRL, + REG_HSTADRH, + REG_HSTCTLL, + + REG_HSTCTLH, + REG_INTENB, + REG_INTPEND, + REG_CONVSP, + REG_CONVDP, + REG_PSIZE, + REG_PMASK, + REG_UNK23, + REG_UNK24, + REG_UNK25, + REG_UNK26, + REG_DPYTAP, + REG_HCOUNT, + REG_VCOUNT, + REG_DPYADR, + REG_REFCNT +}; + +enum +{ + REG020_VESYNC, + REG020_HESYNC, + REG020_VEBLNK, + REG020_HEBLNK, + REG020_VSBLNK, + REG020_HSBLNK, + REG020_VTOTAL, + REG020_HTOTAL, + REG020_DPYCTL, /* matches 010 */ + REG020_DPYSTRT, /* matches 010 */ + REG020_DPYINT, /* matches 010 */ + REG020_CONTROL, /* matches 010 */ + REG020_HSTDATA, /* matches 010 */ + REG020_HSTADRL, /* matches 010 */ + REG020_HSTADRH, /* matches 010 */ + REG020_HSTCTLL, /* matches 010 */ + + REG020_HSTCTLH, /* matches 010 */ + REG020_INTENB, /* matches 010 */ + REG020_INTPEND, /* matches 010 */ + REG020_CONVSP, /* matches 010 */ + REG020_CONVDP, /* matches 010 */ + REG020_PSIZE, /* matches 010 */ + REG020_PMASKL, + REG020_PMASKH, + REG020_CONVMP, + REG020_CONTROL2, + REG020_CONFIG, + REG020_DPYTAP, /* matches 010 */ + REG020_VCOUNT, + REG020_HCOUNT, + REG020_DPYADR, /* matches 010 */ + REG020_REFADR, + + REG020_DPYSTL, + REG020_DPYSTH, + REG020_DPYNXL, + REG020_DPYNXH, + REG020_DINCL, + REG020_DINCH, + REG020_RES0, + REG020_HESERR, + REG020_RES1, + REG020_RES2, + REG020_RES3, + REG020_RES4, + REG020_SCOUNT, + REG020_BSFLTST, + REG020_DPYMSK, + REG020_RES5, + + REG020_SETVCNT, + REG020_SETHCNT, + REG020_BSFLTDL, + REG020_BSFLTDH, + REG020_RES6, + REG020_RES7, + REG020_RES8, + REG020_RES9, + REG020_IHOST1L, + REG020_IHOST1H, + REG020_IHOST2L, + REG020_IHOST2H, + REG020_IHOST3L, + REG020_IHOST3H, + REG020_IHOST4L, + REG020_IHOST4H +}; + +/* Interrupts that are generated by the processor internally */ +#define TMS34010_INT1 0x0002 /* External Interrupt 1 */ +#define TMS34010_INT2 0x0004 /* External Interrupt 2 */ +#define TMS34010_HI 0x0200 /* Host Interrupt */ +#define TMS34010_DI 0x0400 /* Display Interrupt */ +#define TMS34010_WV 0x0800 /* Window Violation Interrupt */ + + /* Configuration structure */ typedef struct _tms34010_display_params tms34010_display_params; struct _tms34010_display_params diff --git a/src/emu/cpu/v810/v810dasm.c b/src/emu/cpu/v810/v810dasm.c index 910467f3f04..2b6038f357a 100644 --- a/src/emu/cpu/v810/v810dasm.c +++ b/src/emu/cpu/v810/v810dasm.c @@ -34,8 +34,8 @@ CPU_DISASSEMBLE( v810 ) UINT32 flags = 0; UINT32 opc,opc2; unsigned size; - opc = R_OP(pc); - opc2 = R_OP(pc+2); + opc = oprom[0] | (oprom[1] << 8); + opc2 = oprom[2] | (oprom[3] << 8); switch(opc>>10) { diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c index f4ae35d9e9f..d6a4cd80a12 100644 --- a/src/emu/cpu/z8000/z8000.c +++ b/src/emu/cpu/z8000/z8000.c @@ -468,6 +468,8 @@ static CPU_RESET( z8000 ) memset(&Z, 0, sizeof(z8000_Regs)); Z.irq_callback = save_irqcallback; Z.device = device; + Z.program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); + Z.io = memory_find_address_space(device, ADDRESS_SPACE_IO); FCW = RDMEM_W( 2 ); /* get reset FCW */ PC = RDMEM_W( 4 ); /* get reset PC */ change_pc(PC); diff --git a/src/emu/cpuintrf.c b/src/emu/cpuintrf.c index bc9c3f1a175..33b4a7bf6eb 100644 --- a/src/emu/cpuintrf.c +++ b/src/emu/cpuintrf.c @@ -124,14 +124,8 @@ CPU_GET_INFO( tms34010 ); CPU_GET_INFO( tms34020 ); CPU_GET_INFO( ti990_10 ); CPU_GET_INFO( tms9900 ); -CPU_GET_INFO( tms9940 ); CPU_GET_INFO( tms9980a ); -CPU_GET_INFO( tms9985 ); -CPU_GET_INFO( tms9989 ); CPU_GET_INFO( tms9995 ); -CPU_GET_INFO( tms99105a ); -CPU_GET_INFO( tms99110a ); -CPU_GET_INFO( tms99000 ); CPU_GET_INFO( z8000 ); CPU_GET_INFO( tms32010 ); CPU_GET_INFO( tms32025 ); @@ -526,30 +520,12 @@ static const struct #if (HAS_TMS9900) { CPU_TMS9900, CPU_GET_INFO_NAME(tms9900) }, #endif -#if (HAS_TMS9940) - { CPU_TMS9940, CPU_GET_INFO_NAME(tms9940) }, -#endif #if (HAS_TMS9980) { CPU_TMS9980, CPU_GET_INFO_NAME(tms9980a) }, #endif -#if (HAS_TMS9985) - { CPU_TMS9985, CPU_GET_INFO_NAME(tms9985) }, -#endif -#if (HAS_TMS9989) - { CPU_TMS9989, CPU_GET_INFO_NAME(tms9989) }, -#endif #if (HAS_TMS9995) { CPU_TMS9995, CPU_GET_INFO_NAME(tms9995) }, #endif -#if (HAS_TMS99105A) - { CPU_TMS99105A, CPU_GET_INFO_NAME(tms99105a) }, -#endif -#if (HAS_TMS99110A) - { CPU_TMS99110A, CPU_GET_INFO_NAME(tms99110a) }, -#endif -#if (HAS_TMS99000) - { CPU_TMS99000, CPU_GET_INFO_NAME(tms99000) }, -#endif #if (HAS_Z8000) { CPU_Z8000, CPU_GET_INFO_NAME(z8000) }, #endif @@ -1328,35 +1304,6 @@ void cpu_reset(const device_config *device) /*------------------------------------------------- - cpu_read_byte - read a byte from another CPU's - memory space --------------------------------------------------*/ - -UINT8 cpu_read_byte(const device_config *device, offs_t address) -{ - UINT8 result; - - cpu_push_context(device); - result = program_read_byte(address); - cpu_pop_context(); - return result; -} - - -/*------------------------------------------------- - cpu_write_byte - write a byte to another CPU's - memory space --------------------------------------------------*/ - -void cpu_write_byte(const device_config *device, offs_t address, UINT8 data) -{ - cpu_push_context(device); - program_write_byte(address, data); - cpu_pop_context(); -} - - -/*------------------------------------------------- cpu_get_physical_pc_byte - return the PC, corrected to a byte offset and translated to physical space, on a given CPU diff --git a/src/emu/cpuintrf.h b/src/emu/cpuintrf.h index 8a770900cf8..3f017628a1c 100644 --- a/src/emu/cpuintrf.h +++ b/src/emu/cpuintrf.h @@ -289,15 +289,8 @@ enum _cpu_type CPU_TMS34020, CPU_TI990_10, CPU_TMS9900, - CPU_TMS9940, CPU_TMS9980, - CPU_TMS9985, - CPU_TMS9989, CPU_TMS9995, - CPU_TMS99100, - CPU_TMS99105A, - CPU_TMS99110A, - CPU_TMS99000, CPU_Z8000, CPU_TMS32010, CPU_TMS32025, @@ -729,12 +722,6 @@ int cpu_execute(const device_config *cpu, int cycles); /* signal a reset for a given CPU */ void cpu_reset(const device_config *cpu); -/* read a byte from another CPU's memory space */ -UINT8 cpu_read_byte(const device_config *cpu, offs_t address); - -/* write a byte from another CPU's memory space */ -void cpu_write_byte(const device_config *cpu, offs_t address, UINT8 data); - /* return the PC, corrected to a byte offset and translated to physical space, on a given CPU */ offs_t cpu_get_physical_pc_byte(const device_config *cpu); diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c index b4391bdb660..d69eba04fdc 100644 --- a/src/emu/machine/idectrl.c +++ b/src/emu/machine/idectrl.c @@ -655,6 +655,7 @@ static void continue_read(ide_state *ide) static void write_buffer_to_dma(ide_state *ide) { + const address_space *target = cpu_get_address_space(ide->device->machine->cpu[ide->dma_cpu], ADDRESS_SPACE_PROGRAM); int bytesleft = IDE_DISK_SECTOR_SIZE; UINT8 *data = ide->buffer; @@ -674,17 +675,17 @@ static void write_buffer_to_dma(ide_state *ide) } /* fetch the address */ - ide->dma_address = cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor); - ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; - ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; - ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; + ide->dma_address = memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor); + ide->dma_address |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; + ide->dma_address |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; + ide->dma_address |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; ide->dma_address &= 0xfffffffe; /* fetch the length */ - ide->dma_bytes_left = cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor); - ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; - ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; - ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; + ide->dma_bytes_left = memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor); + ide->dma_bytes_left |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; + ide->dma_bytes_left |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; + ide->dma_bytes_left |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; ide->dma_last_buffer = (ide->dma_bytes_left >> 31) & 1; ide->dma_bytes_left &= 0xfffe; if (ide->dma_bytes_left == 0) @@ -694,7 +695,7 @@ static void write_buffer_to_dma(ide_state *ide) } /* write the next byte */ - cpu_write_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_address++, *data++); + memory_write_byte(target, ide->dma_address++, *data++); ide->dma_bytes_left--; } } @@ -853,6 +854,7 @@ static void continue_write(ide_state *ide) static void read_buffer_from_dma(ide_state *ide) { + const address_space *target = cpu_get_address_space(ide->device->machine->cpu[ide->dma_cpu], ADDRESS_SPACE_PROGRAM); int bytesleft = IDE_DISK_SECTOR_SIZE; UINT8 *data = ide->buffer; @@ -872,17 +874,17 @@ static void read_buffer_from_dma(ide_state *ide) } /* fetch the address */ - ide->dma_address = cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor); - ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; - ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; - ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; + ide->dma_address = memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor); + ide->dma_address |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; + ide->dma_address |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; + ide->dma_address |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; ide->dma_address &= 0xfffffffe; /* fetch the length */ - ide->dma_bytes_left = cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor); - ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; - ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; - ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; + ide->dma_bytes_left = memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor); + ide->dma_bytes_left |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; + ide->dma_bytes_left |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; + ide->dma_bytes_left |= memory_read_byte(target, ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; ide->dma_last_buffer = (ide->dma_bytes_left >> 31) & 1; ide->dma_bytes_left &= 0xfffe; if (ide->dma_bytes_left == 0) @@ -892,7 +894,7 @@ static void read_buffer_from_dma(ide_state *ide) } /* read the next byte */ - *data++ = cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_address++); + *data++ = memory_read_byte(target, ide->dma_address++); ide->dma_bytes_left--; } } |