From ba7d727d10441607b067bbd5923af5cdd9239999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Banaan=20Ananas?= Date: Wed, 2 Jul 2014 23:19:47 +0000 Subject: [PATCH] small cleanup --- src/emu/cpu/tms7000/tms7000.c | 32 +++----------------------------- src/emu/cpu/tms7000/tms7000.h | 12 ++---------- src/emu/cpu/tms7000/tms70op.inc | 12 ++++-------- src/mess/drivers/exelv.c | 24 ++++++++++++------------ 4 files changed, 21 insertions(+), 59 deletions(-) diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c index b5dd2a4d001..3ad4c441009 100644 --- a/src/emu/cpu/tms7000/tms7000.c +++ b/src/emu/cpu/tms7000/tms7000.c @@ -16,6 +16,8 @@ * - This entire notice must remain in the source code. * ***************************************************************************** + * Misc. improvements were done over the years by team MESS/MAME + * * Currently this source emulates a TMS70x0, not any of the other variants * Unimplemented is the MC pin which (in conjunection with IOCNT0 bits 7 and 6 * control the memory mapping. @@ -23,11 +25,6 @@ * This source implements the MC pin at Vss and mode bits in single chip mode. *****************************************************************************/ -// SJE: Changed all references to ICount to icount (to match MAME requirements) -// SJE: Changed RM/WM macros to reference newly created tms7000 read/write handlers & removed unused SRM(cpustate) macro -// SJE: Fixed a mistake in tms70x0_pf_w where the wrong register was referenced -// SJE: Implemented internal register file - #include "emu.h" #include "debugger.h" #include "tms7000.h" @@ -37,8 +34,6 @@ #define LOG(x) do { if (VERBOSE) logerror x; } while (0) -/* Static variables */ - #define RM(Addr) ((unsigned)m_program->read_byte(Addr)) #define WM(Addr,Value) (m_program->write_byte(Addr, Value)) @@ -58,8 +53,7 @@ const device_type TMS7000_EXL = &device_creator; static ADDRESS_MAP_START(tms7000_mem, AS_PROGRAM, 8, tms7000_device ) - AM_RANGE(0x0000, 0x007f) AM_READWRITE(tms7000_internal_r, tms7000_internal_w) /* tms7000 internal RAM */ - AM_RANGE(0x0080, 0x00ff) AM_NOP /* reserved */ + AM_RANGE(0x0000, 0x007f) AM_RAM AM_RANGE(0x0100, 0x010f) AM_READWRITE(tms70x0_pf_r, tms70x0_pf_w) /* tms7000 internal I/O ports */ ADDRESS_MAP_END @@ -158,7 +152,6 @@ void tms7000_device::device_start() m_io = &space(AS_IO); memset(m_pf, 0, 0x100); - memset(m_rf, 0, 0x80); m_cycles_per_INT2 = 0; m_t1_capture_latch = 0; m_t1_prescaler = 0; @@ -177,7 +170,6 @@ void tms7000_device::device_start() save_item(NAME(m_irq_state)); /* Save register and perpherial file state */ - save_item(NAME(m_rf)); save_item(NAME(m_pf)); /* Save timer state */ @@ -381,14 +373,6 @@ void tms7000_device::execute_run() /**************************************************************************** * Trigger the event counter ****************************************************************************/ -void tms7000_device::tms7000_A6EC1() -{ - if( (m_pf[0x03] & 0x80) == 0x80 ) /* Is timer system active? */ - { - if( (m_pf[0x03] & 0x40) == 0x40) /* Is event counter the timer source? */ - tms7000_service_timer1(); - } -} void tms7000_device::tms7000_service_timer1() { @@ -591,13 +575,3 @@ inline UINT8 tms7000_device::bcd_sub( UINT8 a, UINT8 b, UINT8 c ) return ret; } - -WRITE8_MEMBER( tms7000_device::tms7000_internal_w ) -{ - m_rf[ offset ] = data; -} - -READ8_MEMBER( tms7000_device::tms7000_internal_r ) -{ - return m_rf[ offset ]; -} diff --git a/src/emu/cpu/tms7000/tms7000.h b/src/emu/cpu/tms7000/tms7000.h index 27505d854e7..14559696dac 100644 --- a/src/emu/cpu/tms7000/tms7000.h +++ b/src/emu/cpu/tms7000/tms7000.h @@ -25,10 +25,6 @@ enum { TMS7000_PC=1, TMS7000_SP, TMS7000_ST, TMS7000_IDLE, TMS7000_T1_CL, TMS7000_T1_PS, TMS7000_T1_DEC }; -enum { TMS7000_VCC, TMS7000_VSS }; - -enum { TMS7000_NMOS, TMS7000_CMOS }; - enum { TMS7000_IRQ1_LINE = 0, /* INT1 */ @@ -55,10 +51,6 @@ public: DECLARE_WRITE8_MEMBER( tms70x0_pf_w ); DECLARE_READ8_MEMBER( tms70x0_pf_r ); - DECLARE_WRITE8_MEMBER( tms7000_internal_w ); - DECLARE_READ8_MEMBER( tms7000_internal_r ); - - void tms7000_A6EC1(); protected: // device-level overrides @@ -99,7 +91,6 @@ private: UINT8 m_sp; /* Stack Pointer */ UINT8 m_sr; /* Status Register */ UINT8 m_irq_state[3]; /* State of the three IRQs */ - UINT8 m_rf[0x80]; /* Register file (SJE) */ UINT8 m_pf[0x100]; /* Perpherial file */ int m_icount; @@ -120,6 +111,8 @@ private: void tms7000_check_IRQ_lines(); void tms7000_do_interrupt( UINT16 address, UINT8 line ); + void tms7000_service_timer1(); + void illegal(); void adc_b2a(); void adc_r2a(); @@ -349,7 +342,6 @@ private: void xorp_a2p(); void xorp_b2p(); void xorp_i2p(); - void tms7000_service_timer1(); }; diff --git a/src/emu/cpu/tms7000/tms70op.inc b/src/emu/cpu/tms7000/tms70op.inc index 74d50510038..432b15428dd 100644 --- a/src/emu/cpu/tms7000/tms70op.inc +++ b/src/emu/cpu/tms7000/tms70op.inc @@ -17,14 +17,6 @@ * *****************************************************************************/ -//SJE: Changed all references to ICount to icount (to match MAME requirements) -//TJL: (From Gilles Fetis) JPZ in TI documentation was wrong: -// if ((pSR & SR_N) == 0 && (pSR & SR_Z) != 0) -// should be: -// if ((pSR & SR_N) == 0) - -#include "emu.h" - void tms7000_device::illegal() { /* This is a guess */ @@ -1808,6 +1800,10 @@ void tms7000_device::jp() void tms7000_device::jpz() { + // NOTE: JPZ in TI documentation was wrong: + // if ((pSR & SR_N) == 0 && (pSR & SR_Z) != 0) + // should be: + // if ((pSR & SR_N) == 0) if ((pSR & SR_N) == 0) { INT8 s; diff --git a/src/mess/drivers/exelv.c b/src/mess/drivers/exelv.c index 64d127872d0..a2c0130e2e3 100644 --- a/src/mess/drivers/exelv.c +++ b/src/mess/drivers/exelv.c @@ -451,13 +451,13 @@ WRITE8_MEMBER(exelv_state::tms7041_portd_w) static ADDRESS_MAP_START(tms7020_mem, AS_PROGRAM, 8, exelv_state) AM_RANGE(0x0080, 0x00ff) AM_NOP - AM_RANGE(0x0124, 0x00124) AM_DEVREAD("tms3556", tms3556_device, vram_r) - AM_RANGE(0x0125, 0x00125) AM_DEVREAD("tms3556", tms3556_device, reg_r) - AM_RANGE(0x0128, 0x00128) AM_DEVREAD("tms3556", tms3556_device, initptr_r) - AM_RANGE(0x012d, 0x0012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w) - AM_RANGE(0x012e, 0x0012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w) + AM_RANGE(0x0124, 0x0124) AM_DEVREAD("tms3556", tms3556_device, vram_r) + AM_RANGE(0x0125, 0x0125) AM_DEVREAD("tms3556", tms3556_device, reg_r) + AM_RANGE(0x0128, 0x0128) AM_DEVREAD("tms3556", tms3556_device, initptr_r) + AM_RANGE(0x012d, 0x012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w) + AM_RANGE(0x012e, 0x012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w) - AM_RANGE(0x0130, 0x00130) AM_READWRITE(mailbox_wx319_r, mailbox_wx318_w) + AM_RANGE(0x0130, 0x0130) AM_READWRITE(mailbox_wx319_r, mailbox_wx318_w) AM_RANGE(0x0200, 0x7fff) AM_ROMBANK("bank1") /* system ROM */ AM_RANGE(0x8000, 0xbfff) AM_NOP AM_RANGE(0xc000, 0xc7ff) AM_RAM /* CPU RAM */ @@ -487,12 +487,12 @@ ADDRESS_MAP_END static ADDRESS_MAP_START(tms7040_mem, AS_PROGRAM, 8, exelv_state) AM_RANGE(0x0080, 0x00ff) AM_NOP - AM_RANGE(0x0124, 0x00124) AM_DEVREAD("tms3556", tms3556_device, vram_r) - AM_RANGE(0x0125, 0x00125) AM_DEVREAD("tms3556", tms3556_device, reg_r) - AM_RANGE(0x0128, 0x00128) AM_DEVREAD("tms3556", tms3556_device, initptr_r) - AM_RANGE(0x012d, 0x0012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w) - AM_RANGE(0x012e, 0x0012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w) - AM_RANGE(0x0130, 0x00130) AM_READWRITE(mailbox_wx319_r, mailbox_wx318_w) + AM_RANGE(0x0124, 0x0124) AM_DEVREAD("tms3556", tms3556_device, vram_r) + AM_RANGE(0x0125, 0x0125) AM_DEVREAD("tms3556", tms3556_device, reg_r) + AM_RANGE(0x0128, 0x0128) AM_DEVREAD("tms3556", tms3556_device, initptr_r) + AM_RANGE(0x012d, 0x012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w) + AM_RANGE(0x012e, 0x012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w) + AM_RANGE(0x0130, 0x0130) AM_READWRITE(mailbox_wx319_r, mailbox_wx318_w) AM_RANGE(0x0200, 0x7fff) AM_ROMBANK("bank1") /* system ROM */ AM_RANGE(0x8000, 0xbfff) AM_NOP AM_RANGE(0xc000, 0xc7ff) AM_RAM /* CPU RAM */