Previous 199869 Revisions Next

r31169 Wednesday 2nd July, 2014 at 23:19:47 UTC by hap
small cleanup
[src/emu/cpu/tms7000]tms7000.c tms7000.h tms70op.inc
[src/mess/drivers]exelv.c

trunk/src/emu/cpu/tms7000/tms7000.h
r31168r31169
2525
2626enum { TMS7000_PC=1, TMS7000_SP, TMS7000_ST, TMS7000_IDLE, TMS7000_T1_CL, TMS7000_T1_PS, TMS7000_T1_DEC };
2727
28enum { TMS7000_VCC, TMS7000_VSS };
29
30enum { TMS7000_NMOS, TMS7000_CMOS };
31
3228enum
3329{
3430   TMS7000_IRQ1_LINE = 0,   /* INT1 */
r31168r31169
5551
5652   DECLARE_WRITE8_MEMBER( tms70x0_pf_w );
5753   DECLARE_READ8_MEMBER( tms70x0_pf_r );
58   DECLARE_WRITE8_MEMBER( tms7000_internal_w );
59   DECLARE_READ8_MEMBER( tms7000_internal_r );
6054
61   void tms7000_A6EC1();
62
6355protected:
6456   // device-level overrides
6557   virtual void device_start();
r31168r31169
9991   UINT8       m_sp;               /* Stack Pointer */
10092   UINT8       m_sr;               /* Status Register */
10193   UINT8       m_irq_state[3];     /* State of the three IRQs */
102   UINT8       m_rf[0x80];         /* Register file (SJE) */
10394   UINT8       m_pf[0x100];        /* Perpherial file */
10495
10596   int         m_icount;
r31168r31169
120111
121112   void tms7000_check_IRQ_lines();
122113   void tms7000_do_interrupt( UINT16 address, UINT8 line );
114   void tms7000_service_timer1();
115
123116   void illegal();
124117   void adc_b2a();
125118   void adc_r2a();
r31168r31169
349342   void xorp_a2p();
350343   void xorp_b2p();
351344   void xorp_i2p();
352   void tms7000_service_timer1();
353345};
354346
355347
trunk/src/emu/cpu/tms7000/tms70op.inc
r31168r31169
1717 *
1818 *****************************************************************************/
1919
20//SJE: Changed all references to ICount to icount (to match MAME requirements)
21//TJL: (From Gilles Fetis) JPZ in TI documentation was wrong:
22//     if ((pSR & SR_N) == 0 && (pSR & SR_Z) != 0)
23//     should be:
24//     if ((pSR & SR_N) == 0)
25
26#include "emu.h"
27
2820void tms7000_device::illegal()
2921{
3022   /* This is a guess */
r31168r31169
18081800
18091801void tms7000_device::jpz()
18101802{
1803   // NOTE: JPZ in TI documentation was wrong:
1804   //     if ((pSR & SR_N) == 0 && (pSR & SR_Z) != 0)
1805   // should be:
1806   //     if ((pSR & SR_N) == 0)
18111807   if ((pSR & SR_N) == 0)
18121808   {
18131809      INT8 s;
trunk/src/emu/cpu/tms7000/tms7000.c
r31168r31169
1616 *   - This entire notice must remain in the source code.
1717 *
1818 *****************************************************************************
19 *  Misc. improvements were done over the years by team MESS/MAME
20 *
1921 *  Currently this source emulates a TMS70x0, not any of the other variants
2022 *  Unimplemented is the MC pin which (in conjunection with IOCNT0 bits 7 and 6
2123 *  control the memory mapping.
r31168r31169
2325 *  This source implements the MC pin at Vss and mode bits in single chip mode.
2426 *****************************************************************************/
2527
26// SJE: Changed all references to ICount to icount (to match MAME requirements)
27// SJE: Changed RM/WM macros to reference newly created tms7000 read/write handlers & removed unused SRM(cpustate) macro
28// SJE: Fixed a mistake in tms70x0_pf_w where the wrong register was referenced
29// SJE: Implemented internal register file
30
3128#include "emu.h"
3229#include "debugger.h"
3330#include "tms7000.h"
r31168r31169
3734#define LOG(x)  do { if (VERBOSE) logerror x; } while (0)
3835
3936
40/* Static variables */
41
4237#define RM(Addr) ((unsigned)m_program->read_byte(Addr))
4338#define WM(Addr,Value) (m_program->write_byte(Addr, Value))
4439
r31168r31169
5853
5954
6055static ADDRESS_MAP_START(tms7000_mem, AS_PROGRAM, 8, tms7000_device )
61   AM_RANGE(0x0000, 0x007f) AM_READWRITE(tms7000_internal_r, tms7000_internal_w) /* tms7000 internal RAM */
62   AM_RANGE(0x0080, 0x00ff) AM_NOP                                               /* reserved */
56   AM_RANGE(0x0000, 0x007f) AM_RAM
6357   AM_RANGE(0x0100, 0x010f) AM_READWRITE(tms70x0_pf_r, tms70x0_pf_w)             /* tms7000 internal I/O ports */
6458ADDRESS_MAP_END
6559
r31168r31169
158152   m_io = &space(AS_IO);
159153
160154   memset(m_pf, 0, 0x100);
161   memset(m_rf, 0, 0x80);
162155   m_cycles_per_INT2 = 0;
163156   m_t1_capture_latch = 0;
164157   m_t1_prescaler = 0;
r31168r31169
177170   save_item(NAME(m_irq_state));
178171
179172   /* Save register and perpherial file state */
180   save_item(NAME(m_rf));
181173   save_item(NAME(m_pf));
182174
183175   /* Save timer state */
r31168r31169
381373/****************************************************************************
382374 * Trigger the event counter
383375 ****************************************************************************/
384void tms7000_device::tms7000_A6EC1()
385{
386   if( (m_pf[0x03] & 0x80) == 0x80 ) /* Is timer system active? */
387   {
388      if( (m_pf[0x03] & 0x40) == 0x40) /* Is event counter the timer source? */
389         tms7000_service_timer1();
390   }
391}
392376
393377void tms7000_device::tms7000_service_timer1()
394378{
r31168r31169
591575   
592576   return ret;
593577}
594
595WRITE8_MEMBER( tms7000_device::tms7000_internal_w )
596{
597   m_rf[ offset ] = data;
598}
599
600READ8_MEMBER( tms7000_device::tms7000_internal_r )
601{
602   return m_rf[ offset ];
603}
trunk/src/mess/drivers/exelv.c
r31168r31169
451451
452452static ADDRESS_MAP_START(tms7020_mem, AS_PROGRAM, 8, exelv_state)
453453   AM_RANGE(0x0080, 0x00ff) AM_NOP
454    AM_RANGE(0x0124, 0x00124) AM_DEVREAD("tms3556", tms3556_device, vram_r)
455    AM_RANGE(0x0125, 0x00125) AM_DEVREAD("tms3556", tms3556_device, reg_r)
456    AM_RANGE(0x0128, 0x00128) AM_DEVREAD("tms3556", tms3556_device, initptr_r)
457    AM_RANGE(0x012d, 0x0012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w)
458    AM_RANGE(0x012e, 0x0012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w)
454    AM_RANGE(0x0124, 0x0124) AM_DEVREAD("tms3556", tms3556_device, vram_r)
455    AM_RANGE(0x0125, 0x0125) AM_DEVREAD("tms3556", tms3556_device, reg_r)
456    AM_RANGE(0x0128, 0x0128) AM_DEVREAD("tms3556", tms3556_device, initptr_r)
457    AM_RANGE(0x012d, 0x012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w)
458    AM_RANGE(0x012e, 0x012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w)
459459
460   AM_RANGE(0x0130, 0x00130) AM_READWRITE(mailbox_wx319_r, mailbox_wx318_w)
460   AM_RANGE(0x0130, 0x0130) AM_READWRITE(mailbox_wx319_r, mailbox_wx318_w)
461461   AM_RANGE(0x0200, 0x7fff) AM_ROMBANK("bank1")                                /* system ROM */
462462   AM_RANGE(0x8000, 0xbfff) AM_NOP
463463   AM_RANGE(0xc000, 0xc7ff) AM_RAM                                     /* CPU RAM */
r31168r31169
487487
488488static ADDRESS_MAP_START(tms7040_mem, AS_PROGRAM, 8, exelv_state)
489489   AM_RANGE(0x0080, 0x00ff) AM_NOP
490    AM_RANGE(0x0124, 0x00124) AM_DEVREAD("tms3556", tms3556_device, vram_r)
491    AM_RANGE(0x0125, 0x00125) AM_DEVREAD("tms3556", tms3556_device, reg_r)
492    AM_RANGE(0x0128, 0x00128) AM_DEVREAD("tms3556", tms3556_device, initptr_r)
493    AM_RANGE(0x012d, 0x0012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w)
494    AM_RANGE(0x012e, 0x0012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w)
495   AM_RANGE(0x0130, 0x00130) AM_READWRITE(mailbox_wx319_r, mailbox_wx318_w)
490    AM_RANGE(0x0124, 0x0124) AM_DEVREAD("tms3556", tms3556_device, vram_r)
491    AM_RANGE(0x0125, 0x0125) AM_DEVREAD("tms3556", tms3556_device, reg_r)
492    AM_RANGE(0x0128, 0x0128) AM_DEVREAD("tms3556", tms3556_device, initptr_r)
493    AM_RANGE(0x012d, 0x012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w)
494    AM_RANGE(0x012e, 0x012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w)
495   AM_RANGE(0x0130, 0x0130) AM_READWRITE(mailbox_wx319_r, mailbox_wx318_w)
496496   AM_RANGE(0x0200, 0x7fff) AM_ROMBANK("bank1")                                /* system ROM */
497497   AM_RANGE(0x8000, 0xbfff) AM_NOP
498498   AM_RANGE(0xc000, 0xc7ff) AM_RAM                                     /* CPU RAM */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team