Previous 199869 Revisions Next

r35010 Friday 13th February, 2015 at 23:40:01 UTC by hap
(MESS)New Working Game Added
----------------------
Epoch Dracula [hap, Kevin Horton]
[src/mess/drivers]edracula.c

trunk/src/mess/drivers/edracula.c
r243521r243522
55  Epoch Dracula (manufactured in Japan)
66  * NEC uCOM-43 MCU, labeled D553C 206
77  * cyan/red/green VFD display NEC FIP8BM20T
8 
9  known releases:
10  - Japan: Dracula House, yellow case
11  - USA: Dracula, red case
12  - Other: Dracula, yellow case, published by Hales
813
14  NOTE!: MESS external artwork is required to be able to play
915
1016***************************************************************************/
1117
r243521r243522
2733
2834   required_device<cpu_device> m_maincpu;
2935   required_device<speaker_sound_device> m_speaker;
36
37   UINT32 m_plate;
38   UINT16 m_grid;
39
40   DECLARE_WRITE8_MEMBER(grid_w);
41   DECLARE_WRITE8_MEMBER(plate_w);
42   DECLARE_WRITE8_MEMBER(port_i_w);
43
44   UINT32 m_vfd_state[0x10];
45   void update_vfd();
3046   
3147   virtual void machine_start();
3248};
3349
3450
3551
52/***************************************************************************
53
54  Display
55
56***************************************************************************/
57
58void edracula_state::update_vfd()
59{
60   for (int i = 0; i < 8; i++)
61      if (m_grid & (1 << i) && m_vfd_state[i] != m_plate)
62      {
63         // on difference, send to output
64         for (int j = 0; j < 18; j++)
65            output_set_lamp_value(i*100 + j, m_plate >> j & 1);
66         
67         m_vfd_state[i] = m_plate;
68      }
69}
70
71
72
73/***************************************************************************
74
75  I/O
76
77***************************************************************************/
78
79WRITE8_MEMBER(edracula_state::grid_w)
80{
81   // port C/D: vfd matrix grid
82   int shift = (offset - NEC_UCOM4_PORTC) * 4;
83   m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
84   
85   update_vfd();
86}
87
88WRITE8_MEMBER(edracula_state::plate_w)
89{
90   // port E/F/G/H/I01: vfd matrix plate
91   int shift = (offset - NEC_UCOM4_PORTE) * 4;
92   m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
93   
94   update_vfd();
95}
96
97WRITE8_MEMBER(edracula_state::port_i_w)
98{
99   plate_w(space, offset, data & 3);
100
101   // I2: speaker out
102   m_speaker->level_w(data >> 2 & 1);
103}
104
105
106
107/***************************************************************************
108
109  Inputs
110
111***************************************************************************/
112
36113static INPUT_PORTS_START( edracula )
114   PORT_START("IN0")
115   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START )
116   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SELECT )
117   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
118   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
119
120   PORT_START("IN1")
121   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
122   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
123   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
124   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
37125INPUT_PORTS_END
38126
39127
r243521r243522
46134
47135void edracula_state::machine_start()
48136{
137   // zerofill
138   memset(m_vfd_state, 0, sizeof(m_vfd_state));
139   m_plate = 0;
140   m_grid = 0;
141
142   // register for savestates
143   save_item(NAME(m_vfd_state));
144   save_item(NAME(m_plate));
145   save_item(NAME(m_grid));
49146}
50147
51148
r243521r243522
53150
54151   /* basic machine hardware */
55152   MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz)
153   MCFG_UCOM4_READ_A_CB(IOPORT("IN0"))
154   MCFG_UCOM4_READ_B_CB(IOPORT("IN1"))
155   MCFG_UCOM4_WRITE_C_CB(WRITE8(edracula_state, grid_w))
156   MCFG_UCOM4_WRITE_D_CB(WRITE8(edracula_state, grid_w))
157   MCFG_UCOM4_WRITE_E_CB(WRITE8(edracula_state, plate_w))
158   MCFG_UCOM4_WRITE_F_CB(WRITE8(edracula_state, plate_w))
159   MCFG_UCOM4_WRITE_G_CB(WRITE8(edracula_state, plate_w))
160   MCFG_UCOM4_WRITE_H_CB(WRITE8(edracula_state, plate_w))
161   MCFG_UCOM4_WRITE_I_CB(WRITE8(edracula_state, port_i_w))
56162
57163   MCFG_DEFAULT_LAYOUT(layout_edracula)
58164
r243521r243522
78184ROM_END
79185
80186
81CONS( 1982, edracula, 0, 0, edracula, edracula, driver_device, 0, "Epoch", "Dracula", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
187CONS( 1982, edracula, 0, 0, edracula, edracula, driver_device, 0, "Epoch", "Dracula", GAME_SUPPORTS_SAVE )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team