Previous 199869 Revisions Next

r40549 Sunday 30th August, 2015 at 12:06:06 UTC by Sergey Svishchev
Add skeleton support for K1801VM2 (as clone of T11), change relevant drivers to use it.
[src/emu/cpu/t11]t11.c t11.h
[src/mess/drivers]mk85.c mk90.c uknc.c

trunk/src/emu/cpu/t11/t11.c
r249060r249061
3636
3737
3838const device_type T11 = &device_creator<t11_device>;
39const device_type K1801VM2 = &device_creator<k1801vm2_device>;
3940
4041
42k1801vm2_device::k1801vm2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
43   : t11_device(mconfig, K1801VM2, "K1801VM2", tag, owner, clock, "k1801vm2", __FILE__)
44{
45}
46
47t11_device::t11_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
48   : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
49   , m_program_config("program", ENDIANNESS_LITTLE, 16, 16, 0)
50   , c_initial_mode(0)
51{
52   m_is_octal = true;
53   memset(m_reg, 0x00, sizeof(m_reg));
54   memset(&m_psw, 0x00, sizeof(m_psw));
55}
56
4157t11_device::t11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4258   : cpu_device(mconfig, T11, "T11", tag, owner, clock, "t11", __FILE__)
4359   , m_program_config("program", ENDIANNESS_LITTLE, 16, 16, 0)
r249060r249061
294310   }
295311}
296312
313void k1801vm2_device::state_string_export(const device_state_entry &entry, std::string &str)
314{
315   switch (entry.index())
316   {
317      case STATE_GENFLAGS:
318         strprintf(str, "%c%c%c%c%c%c%c%c%c",
319            m_psw.b.l & 0x100 ? 'H':'.',
320            m_psw.b.l & 0x80 ? 'P':'.',
321            m_psw.b.l & 0x40 ? '?':'.',
322            m_psw.b.l & 0x20 ? '?':'.',
323            m_psw.b.l & 0x10 ? 'T':'.',
324            m_psw.b.l & 0x08 ? 'N':'.',
325            m_psw.b.l & 0x04 ? 'Z':'.',
326            m_psw.b.l & 0x02 ? 'V':'.',
327            m_psw.b.l & 0x01 ? 'C':'.'
328         );
329         break;
330   }
331}
297332
333
298334/*************************************
299335 *
300336 *  CPU reset
r249060r249061
326362   m_wait_state = 0;
327363}
328364
365void k1801vm2_device::device_reset()
366{
367   t11_device::device_reset();
368   
369   PC = RWORD(c_initial_mode);
370   PSW = RWORD(c_initial_mode+2);
371}
329372
330373
331374/*************************************
trunk/src/emu/cpu/t11/t11.h
r249060r249061
3737public:
3838   // construction/destruction
3939   t11_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock);
40   t11_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
4041
4142   // static configuration helpers
4243   static void set_initial_mode(device_t &device, const UINT16 mode) { downcast<t11_device &>(device).c_initial_mode = mode; }
r249060r249061
11331134   void sub_ixd_ixd(UINT16 op);
11341135};
11351136
1137class k1801vm2_device : public t11_device
1138{
1139public:
1140   // construction/destruction
1141   k1801vm2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
11361142
1143protected:
1144   // device-level overrides
1145   virtual void device_reset();
1146
1147   // device_state_interface overrides
1148   void state_string_export(const device_state_entry &entry, std::string &str);
1149};
1150
1151
11371152extern const device_type T11;
1153extern const device_type K1801VM2;
11381154
11391155
11401156#endif /* __T11_H__ */
trunk/src/mess/drivers/mk85.c
r249060r249061
6363
6464static MACHINE_CONFIG_START( mk85, mk85_state )
6565   /* basic machine hardware */
66   MCFG_CPU_ADD("maincpu",T11, XTAL_4MHz)
67   MCFG_T11_INITIAL_MODE(5 << 13)         /* start from 0000 */
66   MCFG_CPU_ADD("maincpu", K1801VM2, XTAL_4MHz)
67   MCFG_T11_INITIAL_MODE(0)
6868   MCFG_CPU_PROGRAM_MAP(mk85_mem)
6969
7070
trunk/src/mess/drivers/mk90.c
r249060r249061
6868
6969static MACHINE_CONFIG_START( mk90, mk90_state )
7070   /* basic machine hardware */
71   MCFG_CPU_ADD("maincpu",T11, XTAL_4MHz)
72   MCFG_T11_INITIAL_MODE(0xf600)
71   MCFG_CPU_ADD("maincpu", K1801VM2, XTAL_4MHz)
72   MCFG_T11_INITIAL_MODE(0x8000)
7373   MCFG_CPU_PROGRAM_MAP(mk90_mem)
7474
7575
trunk/src/mess/drivers/uknc.c
r249060r249061
5858
5959static MACHINE_CONFIG_START( uknc, uknc_state )
6060   /* basic machine hardware */
61   MCFG_CPU_ADD("maincpu", T11, 8000000)
62   MCFG_T11_INITIAL_MODE(0x36ff)  /* initial mode word has DAL15,14,11,8 pulled low */
61   MCFG_CPU_ADD("maincpu", K1801VM2, 8000000)
62   MCFG_T11_INITIAL_MODE(0x8000)
6363   MCFG_CPU_PROGRAM_MAP(uknc_mem)
6464
65   MCFG_CPU_ADD("subcpu",  T11, 6000000)
66   MCFG_T11_INITIAL_MODE(0x36ff)  /* initial mode word has DAL15,14,11,8 pulled low */
65   MCFG_CPU_ADD("subcpu",  K1801VM2, 6000000)
66   MCFG_T11_INITIAL_MODE(0x8000)
6767   MCFG_CPU_PROGRAM_MAP(uknc_sub_mem)
6868
6969


Previous 199869 Revisions Next


© 1997-2024 The MAME Team