Previous 199869 Revisions Next

r21881 Saturday 16th March, 2013 at 05:50:35 UTC by Barry Rodewald
de_2: Adding a bit of meat to the bones.  Still need to work on the MSM5205 and some of the LEDs. (no whatsnew)
[src/mame]mame.mak
[src/mame/drivers]de_2.c
[src/mame/layout]de2.lay*

trunk/src/mame/layout/de2.lay
r0r21881
1<!-- de2.lay -->
2
3<!-- 2013-03-16: Initial version.  [Barry Rodewald] -->
4
5<mamelayout version="2">
6
7   <element name="digit" defstate="0">
8      <led14segsc>
9         <color red="1.0" green="0.0" blue="0.0" />
10      </led14segsc>
11   </element>
12   <element name="ldigit" defstate="0">
13      <led7seg>
14         <color red="1.0" green="0.0" blue="0.0" />
15      </led7seg>
16   </element>
17   <element name="diagled" defstate="0">
18      <disk>
19         <color red="1.0" green="0.0" blue="0.0" />
20      </disk>
21   </element>
22   <element name="background">
23      <rect>
24         <bounds left="0" top="0" right="1" bottom="1" />
25         <color red="0.0" green="0.0" blue="0.0" />
26      </rect>
27   </element>
28   <element name="P3"><text string="Player 1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
29   <element name="P4"><text string="Player 2"><color red="1.0" green="1.0" blue="1.0" /></text></element>
30   <element name="P5"><text string="Player 3"><color red="1.0" green="1.0" blue="1.0" /></text></element>
31   <element name="P6"><text string="Player 4"><color red="1.0" green="1.0" blue="1.0" /></text></element>
32
33   <view name="Default Layout">
34
35      <!-- Background -->
36      <backdrop element="background">
37         <bounds left="0" top="20" right="318" bottom="394" />
38      </backdrop>
39
40      <!-- LEDs -->
41
42      <!-- Player 1 Score -->
43
44      <bezel name="digit1" element="digit">
45         <bounds left="10" top="45" right="30" bottom="84" />
46      </bezel>
47      <bezel name="digit2" element="digit">
48         <bounds left="34" top="45" right="54" bottom="84" />
49      </bezel>
50      <bezel name="digit3" element="digit">
51         <bounds left="58" top="45" right="78" bottom="84" />
52      </bezel>
53      <bezel name="digit4" element="digit">
54         <bounds left="82" top="45" right="102" bottom="84" />
55      </bezel>
56      <bezel name="digit5" element="digit">
57         <bounds left="106" top="45" right="126" bottom="84" />
58      </bezel>
59      <bezel name="digit6" element="digit">
60         <bounds left="130" top="45" right="150" bottom="84" />
61      </bezel>
62      <bezel name="digit7" element="digit">
63         <bounds left="154" top="45" right="174" bottom="84" />
64      </bezel>
65
66      <!-- Player 2 Score -->
67      <bezel name="digit9" element="digit">
68         <bounds left="190" top="45" right="210" bottom="84" />
69      </bezel>
70      <bezel name="digit10" element="digit">
71         <bounds left="214" top="45" right="234" bottom="84" />
72      </bezel>
73      <bezel name="digit11" element="digit">
74         <bounds left="238" top="45" right="258" bottom="84" />
75      </bezel>
76      <bezel name="digit12" element="digit">
77         <bounds left="262" top="45" right="282" bottom="84" />
78      </bezel>
79      <bezel name="digit13" element="digit">
80         <bounds left="286" top="45" right="306" bottom="84" />
81      </bezel>
82      <bezel name="digit14" element="digit">
83         <bounds left="310" top="45" right="330" bottom="84" />
84      </bezel>
85      <bezel name="digit15" element="digit">
86         <bounds left="334" top="45" right="354" bottom="84" />
87      </bezel>
88
89      <!-- Player 3 Score -->
90      <bezel name="digit17" element="digit">
91         <bounds left="10" top="100" right="30" bottom="139" />
92      </bezel>
93      <bezel name="digit18" element="digit">
94         <bounds left="34" top="100" right="54" bottom="139" />
95      </bezel>
96      <bezel name="digit19" element="digit">
97         <bounds left="58" top="100" right="78" bottom="139" />
98      </bezel>
99      <bezel name="digit20" element="digit">
100         <bounds left="82" top="100" right="102" bottom="139" />
101      </bezel>
102      <bezel name="digit21" element="digit">
103         <bounds left="106" top="100" right="126" bottom="139" />
104      </bezel>
105      <bezel name="digit22" element="digit">
106         <bounds left="130" top="100" right="150" bottom="139" />
107      </bezel>
108      <bezel name="digit23" element="digit">
109         <bounds left="154" top="100" right="174" bottom="139" />
110      </bezel>
111
112      <!-- Player 4 Score -->
113      <bezel name="digit25" element="digit">
114         <bounds left="190" top="100" right="210" bottom="139" />
115      </bezel>
116      <bezel name="digit26" element="digit">
117         <bounds left="214" top="100" right="234" bottom="139" />
118      </bezel>
119      <bezel name="digit27" element="digit">
120         <bounds left="238" top="100" right="258" bottom="139" />
121      </bezel>
122      <bezel name="digit28" element="digit">
123         <bounds left="262" top="100" right="282" bottom="139" />
124      </bezel>
125      <bezel name="digit29" element="digit">
126         <bounds left="286" top="100" right="306" bottom="139" />
127      </bezel>
128      <bezel name="digit30" element="digit">
129         <bounds left="310" top="100" right="330" bottom="139" />
130      </bezel>
131      <bezel name="digit31" element="digit">
132         <bounds left="334" top="100" right="354" bottom="139" />
133      </bezel>
134
135      <bezel element="P3"><bounds left="10" right="174" top="30" bottom="42" /></bezel>
136      <bezel element="P4"><bounds left="190" right="354" top="30" bottom="42" /></bezel>
137      <bezel element="P5"><bounds left="10" right="174" top="88" bottom="100" /></bezel>
138      <bezel element="P6"><bounds left="190" right="354" top="88" bottom="100" /></bezel>
139   </view>
140</mamelayout>
Property changes on: trunk/src/mame/layout/de2.lay
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mame/drivers/de_2.c
r21880r21881
44
55
66#include "emu.h"
7#include "machine/genpin.h"
78#include "cpu/m6800/m6800.h"
9#include "cpu/m6809/m6809.h"
10#include "machine/6821pia.h"
11#include "sound/2151intf.h"
12#include "sound/msm5205.h"
13#include "de2.lh"
814
9class de_2_state : public driver_device
15// Data East CPU board is similar to Williams System 11, but without the generic audio board.
16// For now, we'll presume the timings are the same.
17
18// 6808 CPU's input clock is 4MHz
19// but because it has an internal /4 divider, its E clock runs at 1/4 that frequency
20#define E_CLOCK (XTAL_4MHz/4)
21
22// Length of time in cycles between IRQs on the main 6808 CPU
23// This length is determined by the settings of the W14 and W15 jumpers
24// It can be 0x300, 0x380, 0x700 or 0x780 cycles long.
25// IRQ length is always 32 cycles
26#define S11_IRQ_CYCLES 0x380
27
28class de_2_state : public genpin_class
1029{
1130public:
1231   de_2_state(const machine_config &mconfig, device_type type, const char *tag)
13      : driver_device(mconfig, type, tag),
14         m_maincpu(*this, "maincpu")
32      : genpin_class(mconfig, type, tag),
33         m_maincpu(*this, "maincpu"),
34         m_audiocpu(*this, "audiocpu"),
35         m_ym2151(*this, "ym2151"),
36         m_msm5205(*this, "msm5205"),
37         m_pia21(*this, "pia21"),
38         m_pia24(*this, "pia24"),
39         m_pia28(*this, "pia28"),
40         m_pia2c(*this, "pia2c"),
41         m_pia30(*this, "pia30"),
42         m_pia34(*this, "pia34")
1543   { }
1644
1745protected:
1846
1947   // devices
2048   required_device<cpu_device> m_maincpu;
49   required_device<cpu_device> m_audiocpu;
50   required_device<ym2151_device> m_ym2151;
51   required_device<msm5205_device> m_msm5205;
52   required_device<pia6821_device> m_pia21;
53   required_device<pia6821_device> m_pia24;
54   required_device<pia6821_device> m_pia28;
55   required_device<pia6821_device> m_pia2c;
56   required_device<pia6821_device> m_pia30;
57   required_device<pia6821_device> m_pia34;
2158
2259   // driver_device overrides
23   virtual void machine_reset();
60   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
61   static const device_timer_id TIMER_IRQ = 0;
62
2463public:
2564   DECLARE_DRIVER_INIT(de_2);
65   DECLARE_MACHINE_RESET(de_2);
66   DECLARE_WRITE8_MEMBER(sample_w);
67   DECLARE_WRITE8_MEMBER(pia34_pa_w);
68   DECLARE_READ8_MEMBER(switch_r);
69   DECLARE_WRITE8_MEMBER(switch_w);
70   DECLARE_WRITE8_MEMBER(pia2c_pa_w);
71   DECLARE_WRITE8_MEMBER(pia2c_pb_w);
72   DECLARE_WRITE_LINE_MEMBER(pia28_ca2_w) { }; // comma3&4
73   DECLARE_WRITE_LINE_MEMBER(pia28_cb2_w) { }; // comma1&2
74   DECLARE_READ8_MEMBER(pia28_w7_r);
75   DECLARE_WRITE8_MEMBER(dig0_w);
76   DECLARE_WRITE8_MEMBER(dig1_w);
77   DECLARE_WRITE8_MEMBER(lamp0_w);
78   DECLARE_WRITE8_MEMBER(lamp1_w) { };
79   DECLARE_WRITE_LINE_MEMBER(ym2151_irq_w);
80   DECLARE_WRITE_LINE_MEMBER(pia_irq);
81   DECLARE_WRITE8_MEMBER(sol2_w) { }; // solenoids 8-15
82   DECLARE_WRITE8_MEMBER(sol3_w);
83   DECLARE_WRITE8_MEMBER(sound_w);
84   DECLARE_WRITE_LINE_MEMBER(pia21_ca2_w);
85   DECLARE_INPUT_CHANGED_MEMBER(main_nmi);
86   DECLARE_INPUT_CHANGED_MEMBER(audio_nmi);
87
88   DECLARE_READ8_MEMBER(sound_latch_r);
89   DECLARE_WRITE8_MEMBER(sample_bank_w);
90
91private:
92   UINT32 m_segment1;
93   UINT32 m_segment2;
94   UINT8 m_strobe;
95   UINT8 m_kbdrow;
96   UINT8 m_diag;
97   bool m_ca1;
98   emu_timer* m_irq_timer;
99   bool m_irq_active;
100   UINT8 m_sound_data;
101
102   UINT8 m_sample_bank;
103   UINT8 m_msm_prescaler;
104   bool m_nmi_enable;
26105};
27106
28
29107static ADDRESS_MAP_START( de_2_map, AS_PROGRAM, 8, de_2_state )
30   AM_RANGE(0x0000, 0xffff) AM_NOP
108   AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("nvram")
109   AM_RANGE(0x2100, 0x2103) AM_DEVREADWRITE("pia21", pia6821_device, read, write) // sound+solenoids
110   AM_RANGE(0x2200, 0x2200) AM_WRITE(sol3_w) // solenoids
111   AM_RANGE(0x2400, 0x2403) AM_DEVREADWRITE("pia24", pia6821_device, read, write) // lamps
112   AM_RANGE(0x2800, 0x2803) AM_DEVREADWRITE("pia28", pia6821_device, read, write) // display
113   AM_RANGE(0x2c00, 0x2c03) AM_DEVREADWRITE("pia2c", pia6821_device, read, write) // alphanumeric display
114   AM_RANGE(0x3000, 0x3003) AM_DEVREADWRITE("pia30", pia6821_device, read, write) // inputs
115   AM_RANGE(0x3400, 0x3403) AM_DEVREADWRITE("pia34", pia6821_device, read, write) // widget
116   AM_RANGE(0x4000, 0xffff) AM_ROM
31117ADDRESS_MAP_END
32118
119static ADDRESS_MAP_START( de_2_audio_map, AS_PROGRAM, 8, de_2_state )
120   AM_RANGE(0x0000, 0x1fff) AM_RAM
121   AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ym2151", ym2151_device, read, write)
122   AM_RANGE(0x2400, 0x2400) AM_READ(sound_latch_r)
123   AM_RANGE(0x2800, 0x2800) AM_WRITE(sample_bank_w)
124   // 0x2c00        - 4052(?)
125   AM_RANGE(0x3000, 0x3000) AM_WRITE(sample_w)
126   // 0x3800        - Watchdog reset
127   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("sample_bank")
128   AM_RANGE(0x8000, 0xffff) AM_ROM
129ADDRESS_MAP_END
130
33131static INPUT_PORTS_START( de_2 )
132   PORT_START("INP0")
133   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
134
135   PORT_START("INP1")
136   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
137   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER )
138   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
139   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
140   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
141   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
142   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )
143   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER )
144
145   PORT_START("INP2")
146   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A)
147   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
148   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
149   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F)
150   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_G)
151   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_H)
152   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
153   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
154
155   PORT_START("INP4")
156   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
157   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
158   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
159   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_V)
160   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_B)
161   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_N)
162   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
163   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
164
165   PORT_START("INP8")
166   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
167   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
168   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
169   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_QUOTE)
170   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_X)
171   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_MINUS)
172   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
173   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
174
175   PORT_START("INP10")
176   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
177   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
178   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
179   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_ENTER)
180   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_LEFT)
181   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_RIGHT)
182   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
183   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
184
185   PORT_START("INP20")
186   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
187   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
188   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
189   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_R)
190   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Y)
191   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_U)
192   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I)
193   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O)
194
195   PORT_START("INP40")
196   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
197
198   PORT_START("INP80")
199   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
200
201   PORT_START("DIAGS")
202   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Audio Diag") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, de_2_state, audio_nmi, 1)
203   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Main Diag") PORT_CODE(KEYCODE_F2) PORT_CHANGED_MEMBER(DEVICE_SELF, de_2_state, main_nmi, 1)
204   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Advance") PORT_CODE(KEYCODE_0)
205   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Up/Down") PORT_CODE(KEYCODE_9) PORT_TOGGLE
206   PORT_CONFNAME( 0x10, 0x10, "Language" )
207   PORT_CONFSETTING( 0x00, "German" )
208   PORT_CONFSETTING( 0x10, "English" )
34209INPUT_PORTS_END
35210
36void de_2_state::machine_reset()
211void de_2_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
37212{
213   switch(id)
214   {
215   case TIMER_IRQ:
216      if(param == 1)
217      {
218         m_maincpu->set_input_line(M6800_IRQ_LINE,ASSERT_LINE);
219         m_irq_timer->adjust(attotime::from_ticks(32,E_CLOCK),0);
220         m_irq_active = true;
221         m_pia28->ca1_w(BIT(ioport("DIAGS")->read(), 2));  // Advance
222         m_pia28->cb1_w(BIT(ioport("DIAGS")->read(), 3));  // Up/Down
223      }
224      else
225      {
226         m_maincpu->set_input_line(M6800_IRQ_LINE,CLEAR_LINE);
227         m_irq_timer->adjust(attotime::from_ticks(S11_IRQ_CYCLES,E_CLOCK),1);
228         m_irq_active = false;
229         m_pia28->ca1_w(1);
230         m_pia28->cb1_w(1);
231      }
232      break;
233   }
38234}
39235
40DRIVER_INIT_MEMBER(de_2_state,de_2)
236
237MACHINE_RESET_MEMBER(de_2_state, de_2)
41238{
239   membank("sample_bank")->set_entry(0);
42240}
43241
242DRIVER_INIT_MEMBER(de_2_state, de_2)
243{
244   UINT8 *ROM = memregion("audiocpu")->base();
245   m_irq_timer = timer_alloc(TIMER_IRQ);
246   m_irq_timer->adjust(attotime::from_ticks(S11_IRQ_CYCLES,E_CLOCK),1);
247   m_irq_active = false;
248   membank("sample_bank")->configure_entries(0, 16, &ROM[0x0000], 0x4000);
249   membank("sample_bank")->set_entry(0);
250}
251
252WRITE_LINE_MEMBER(de_2_state::ym2151_irq_w)
253{
254   m_audiocpu->set_input_line(M6809_IRQ_LINE,state);
255}
256
257WRITE_LINE_MEMBER(de_2_state::pia_irq)
258{
259   if(state == CLEAR_LINE)
260   {
261      // restart IRQ timer
262      m_irq_timer->adjust(attotime::from_ticks(S11_IRQ_CYCLES,E_CLOCK),1);
263      m_irq_active = false;
264   }
265   else
266   {
267      // disable IRQ timer while other IRQs are being handled
268      // (counter is reset every 32 cycles while a PIA IRQ is handled)
269      m_irq_timer->adjust(attotime::zero);
270      m_irq_active = true;
271   }
272}
273
274INPUT_CHANGED_MEMBER( de_2_state::main_nmi )
275{
276   // Diagnostic button sends a pulse to NMI pin
277   if (newval==CLEAR_LINE)
278      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
279}
280
281INPUT_CHANGED_MEMBER( de_2_state::audio_nmi )
282{
283   // Not on DECO board?
284   // Diagnostic button sends a pulse to NMI pin
285//   if (newval==CLEAR_LINE)
286//      if(m_audiocpu)
287//         m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
288}
289
290// 6821 PIA at 0x2000
291WRITE8_MEMBER( de_2_state::sol3_w )
292{
293}
294
295WRITE8_MEMBER( de_2_state::sound_w )
296{
297   m_sound_data = data;
298   m_audiocpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
299   popmessage("sound_w: %02x",data);
300}
301
302WRITE_LINE_MEMBER( de_2_state::pia21_ca2_w )
303{
304// sound ns
305   m_ca1 = state;
306}
307
308static const pia6821_interface pia21_intf =
309{
310   DEVCB_NULL, //DEVCB_DRIVER_MEMBER(de_2_state, dac_r),      /* port A in */
311   DEVCB_NULL,     /* port B in */
312   DEVCB_NULL,     /* line CA1 in */
313   DEVCB_LINE_GND,     /* line CB1 in */
314   DEVCB_NULL,     /* line CA2 in */
315   DEVCB_NULL,     /* line CB2 in */
316   DEVCB_DRIVER_MEMBER(de_2_state, sol2_w),        /* port A out */
317   DEVCB_NULL,     /* port B out */
318   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia21_ca2_w),       /* line CA2 out */
319   DEVCB_NULL, //DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia21_cb2_w),       /* line CB2 out */
320   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq),       /* IRQA */
321   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq)        /* IRQB */
322};
323
324
325// 6821 PIA at 0x2400
326WRITE8_MEMBER( de_2_state::lamp0_w )
327{
328   m_maincpu->set_input_line(M6800_IRQ_LINE, CLEAR_LINE);
329}
330
331static const pia6821_interface pia24_intf =
332{
333   DEVCB_NULL,     /* port A in */
334   DEVCB_NULL,     /* port B in */
335   DEVCB_LINE_GND,     /* line CA1 in */
336   DEVCB_LINE_GND,     /* line CB1 in */
337   DEVCB_LINE_VCC,     /* line CA2 in */
338   DEVCB_LINE_VCC,     /* line CB2 in */
339   DEVCB_DRIVER_MEMBER(de_2_state, lamp0_w),        /* port A out */
340   DEVCB_DRIVER_MEMBER(de_2_state, lamp1_w),        /* port B out */
341   DEVCB_NULL,     /* line CA2 out */
342   DEVCB_NULL, //DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia24_cb2_w),       /* line CB2 out */
343   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq),       /* IRQA */
344   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq)        /* IRQB */
345};
346
347// 6821 PIA at 0x2800
348WRITE8_MEMBER( de_2_state::dig0_w )
349{
350   static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447
351   data &= 0x7f;
352   m_strobe = data & 15;
353   m_diag = (data & 0x70) >> 4;
354   output_set_digit_value(60, patterns[data>>4]); // diag digit
355   m_segment1 = 0;
356   m_segment2 = 0;
357}
358
359WRITE8_MEMBER( de_2_state::dig1_w )
360{
361   m_segment2 |= data;
362   m_segment2 |= 0x20000;
363   if ((m_segment2 & 0x70000) == 0x30000)
364   {
365      output_set_digit_value(m_strobe+16, BITSWAP16(m_segment2, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0));
366      m_segment2 |= 0x40000;
367   }
368}
369
370READ8_MEMBER( de_2_state::pia28_w7_r )
371{
372   UINT8 ret = 0x80;
373
374   ret |= m_strobe;
375   ret |= m_diag << 4;
376
377   if(BIT(ioport("DIAGS")->read(), 4))  // W7 Jumper
378      ret &= ~0x80;
379
380   return ret;
381}
382
383static const pia6821_interface pia28_intf =
384{
385   DEVCB_DRIVER_MEMBER(de_2_state, pia28_w7_r),     /* port A in */
386   DEVCB_NULL,     /* port B in */
387   DEVCB_NULL,     /* line CA1 in */
388   DEVCB_NULL,     /* line CB1 in */
389   DEVCB_NULL,     /* line CA2 in */
390   DEVCB_NULL,     /* line CB2 in */
391   DEVCB_DRIVER_MEMBER(de_2_state, dig0_w),     /* port A out */
392   DEVCB_DRIVER_MEMBER(de_2_state, dig1_w),     /* port B out */
393   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia28_ca2_w),       /* line CA2 out */  // comma 3+4
394   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia28_cb2_w),       /* line CB2 out */  // comma 1+2
395   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq),       /* IRQA */
396   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq)        /* IRQB */
397};
398
399
400// 6821 PIA at 0x2c00
401WRITE8_MEMBER( de_2_state::pia2c_pa_w )
402{
403   m_segment1 |= (data<<8);
404   m_segment1 |= 0x10000;
405   if ((m_segment1 & 0x70000) == 0x30000)
406   {
407      output_set_digit_value(m_strobe, BITSWAP16(m_segment1, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0));
408      m_segment1 |= 0x40000;
409   }
410}
411
412WRITE8_MEMBER( de_2_state::pia2c_pb_w )
413{
414   m_segment1 |= data;
415   m_segment1 |= 0x20000;
416   if ((m_segment1 & 0x70000) == 0x30000)
417   {
418      output_set_digit_value(m_strobe, BITSWAP16(m_segment1, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0));
419      m_segment1 |= 0x40000;
420   }
421}
422
423static const pia6821_interface pia2c_intf =
424{
425   DEVCB_NULL,     /* port A in */
426   DEVCB_NULL,     /* port B in */
427   DEVCB_NULL,     /* line CA1 in */
428   DEVCB_NULL,     /* line CB1 in */
429   DEVCB_NULL,     /* line CA2 in */
430   DEVCB_NULL,     /* line CB2 in */
431   DEVCB_DRIVER_MEMBER(de_2_state, pia2c_pa_w),     /* port A out */
432   DEVCB_DRIVER_MEMBER(de_2_state, pia2c_pb_w),     /* port B out */
433   DEVCB_NULL,     /* line CA2 out */
434   DEVCB_NULL,     /* line CB2 out */
435   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq),       /* IRQA */
436   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq)        /* IRQB */
437};
438
439
440// 6821 PIA at 0x3000
441READ8_MEMBER( de_2_state::switch_r )
442{
443   char kbdrow[8];
444   sprintf(kbdrow,"INP%X",m_kbdrow);
445   return ~ioport(kbdrow)->read();
446}
447
448WRITE8_MEMBER( de_2_state::switch_w )
449{
450   m_kbdrow = data;
451}
452
453static const pia6821_interface pia30_intf =
454{
455   DEVCB_DRIVER_MEMBER(de_2_state, switch_r),       /* port A in */
456   DEVCB_NULL,     /* port B in */
457   DEVCB_LINE_GND,     /* line CA1 in */
458   DEVCB_LINE_GND,     /* line CB1 in */
459   DEVCB_LINE_VCC,     /* line CA2 in */
460   DEVCB_LINE_VCC,     /* line CB2 in */
461   DEVCB_NULL,     /* port A out */
462   DEVCB_DRIVER_MEMBER(de_2_state, switch_w),       /* port B out */
463   DEVCB_NULL,     /* line CA2 out */
464   DEVCB_NULL, //DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia30_cb2_w),       /* line CB2 out */
465   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq),       /* IRQA */
466   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq)        /* IRQB */
467};
468
469// 6821 PIA at 0x3400
470WRITE8_MEMBER( de_2_state::pia34_pa_w )
471{
472   m_segment2 |= (data<<8);
473   m_segment2 |= 0x10000;
474   if ((m_segment2 & 0x70000) == 0x30000)
475   {
476      output_set_digit_value(m_strobe+16, BITSWAP16(m_segment2, 7, 15, 12, 10, 8, 14, 13, 9, 11, 6, 5, 4, 3, 2, 1, 0));
477      m_segment2 |= 0x40000;
478   }
479}
480
481static const pia6821_interface pia34_intf =
482{
483   DEVCB_NULL,     /* port A in */
484   DEVCB_NULL,     /* port B in */
485   DEVCB_NULL,     /* line CA1 in */
486   DEVCB_NULL,     /* line CB1 in */
487   DEVCB_NULL,     /* line CA2 in */
488   DEVCB_NULL,     /* line CB2 in */
489   DEVCB_DRIVER_MEMBER(de_2_state, pia34_pa_w),     /* port A out */
490   DEVCB_DRIVER_MEMBER(de_2_state, sound_w),     /* port B out */
491   DEVCB_NULL,     /* line CA2 out */
492   DEVCB_NULL, //DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia34_cb2_w),       /* line CB2 out */
493   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq),       /* IRQA */
494   DEVCB_DRIVER_LINE_MEMBER(de_2_state, pia_irq)        /* IRQB */
495};
496
497
498// Sound board
499WRITE8_MEMBER(de_2_state::sample_w)
500{
501   msm5205_data_w(m_msm5205,data);
502   msm5205_vclk_w(m_msm5205,1);
503   msm5205_vclk_w(m_msm5205,0);
504}
505
506READ8_MEMBER( de_2_state::sound_latch_r )
507{
508   m_audiocpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
509   return m_sound_data;
510}
511
512WRITE8_MEMBER( de_2_state::sample_bank_w )
513{
514   UINT8 prescale[4] = { MSM5205_S96_4B, MSM5205_S48_4B, MSM5205_S64_4B, 0 };
515
516   m_sample_bank = (data & 0x03) | ((data & 0x04) << 1);
517   m_msm_prescaler = (data & 0x30) >> 4;
518   m_nmi_enable = (~data & 0x80);
519   msm5205_playmode_w(m_msm5205,prescale[m_msm_prescaler]);
520   msm5205_reset_w(m_msm5205,data & 0x40);
521}
522
523static const msm5205_interface msm5205_intf =
524{
525   0,
526   MSM5205_SEX_4B
527};
528
44529static MACHINE_CONFIG_START( de_2, de_2_state )
45530   /* basic machine hardware */
46   MCFG_CPU_ADD("maincpu", M6800, 1000000)
531   MCFG_CPU_ADD("maincpu", M6808, XTAL_4MHz)
47532   MCFG_CPU_PROGRAM_MAP(de_2_map)
533   MCFG_MACHINE_RESET_OVERRIDE(de_2_state, de_2)
534
535   /* Video */
536   MCFG_DEFAULT_LAYOUT(layout_de2)
537
538   MCFG_FRAGMENT_ADD( genpin_audio )
539
540   /* Devices */
541   MCFG_PIA6821_ADD("pia21", pia21_intf)
542   MCFG_PIA6821_ADD("pia24", pia24_intf)
543   MCFG_PIA6821_ADD("pia28", pia28_intf)
544   MCFG_PIA6821_ADD("pia2c", pia2c_intf)
545   MCFG_PIA6821_ADD("pia30", pia30_intf)
546   MCFG_PIA6821_ADD("pia34", pia34_intf)
547   MCFG_NVRAM_ADD_1FILL("nvram")
548
549   /* sound CPU */
550   MCFG_CPU_ADD("audiocpu", M6809E, 8000000) // MC68B09E
551   MCFG_CPU_PROGRAM_MAP(de_2_audio_map)
552
553   MCFG_SPEAKER_STANDARD_MONO("bg")
554   MCFG_YM2151_ADD("ym2151", 3580000)
555   MCFG_YM2151_IRQ_HANDLER(WRITELINE(de_2_state, ym2151_irq_w))
556   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
557   MCFG_SOUND_ADD("msm5205", MSM5205, 3580000)
558   MCFG_SOUND_CONFIG(msm5205_intf)
559   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "bg", 0.50)
48560MACHINE_CONFIG_END
49561
50562/*-----------------------------------------------------------------------------------
r21880r21881
54566   ROM_REGION(0x10000, "maincpu", 0)
55567   ROM_LOAD("mnfb2-7.b5", 0x4000, 0x4000, CRC(995eb9b8) SHA1(d05d74393fda59ffd8d7b5546313779cdb10d23e))
56568   ROM_LOAD("mnfb2-7.c5", 0x8000, 0x8000, CRC(579d81df) SHA1(9c96da34d37d3369513003e208222bd6e8698638))
57   ROM_REGION(0x10000, "cpu2", 0)
569   ROM_REGION(0x10000, "audiocpu", 0)
58570   ROM_LOAD("mnf-f7.256", 0x8000, 0x8000, CRC(fbc2d6f6) SHA1(33173c081de776d32e926481e94b265ec48d770b))
59571   ROM_REGION(0x40000, "sound1", 0)
60572   ROM_LOAD("mnf-f5-6.512", 0x00000, 0x10000, CRC(0c6ea963) SHA1(8c88fa588222ef8a6c872b8c5b49639b108384d4))
r21880r21881
70582   ROM_REGION(0x10000, "maincpu", 0)
71583   ROM_LOAD("potob5.3-2", 0x4000, 0x4000, CRC(bdc39205) SHA1(67b3f56655ef2cc056912ab6e351cf83352abaa9))
72584   ROM_LOAD("potoc5.3-2", 0x8000, 0x8000, CRC(e6026455) SHA1(c1441fda6181e9014a8a6f93b7405998a952f508))
73   ROM_REGION(0x10000, "cpu2", 0)
585   ROM_REGION(0x10000, "audiocpu", 0)
74586   ROM_LOAD("potof7.rom", 0x8000, 0x8000, CRC(2e60b2e3) SHA1(0be89fc9b2c6548392febb35c1ace0eb912fc73f))
75587   ROM_REGION(0x40000, "sound1", 0)
76588   ROM_LOAD("potof6.rom", 0x00000, 0x10000, CRC(62b8f74b) SHA1(f82c706b88f49341bab9014bd83371259eb53b47))
r21880r21881
86598   ROM_REGION(0x10000, "maincpu", 0)
87599   ROM_LOAD("play2-4.b5", 0x0000, 0x8000, CRC(bc8d7b32) SHA1(3b57dea2feb12315586283548e0bffdc8173b8fb))
88600   ROM_LOAD("play2-4.c5", 0x8000, 0x8000, CRC(47c30bc2) SHA1(c62e192ec01f4884226e9628baa2cad10cc57bd9))
89   ROM_REGION(0x10000, "cpu2", 0)
601   ROM_REGION(0x10000, "audiocpu", 0)
90602   ROM_LOAD("pbsnd7.dat", 0x8000, 0x8000, CRC(c2cf2cc5) SHA1(1277704b1b38558c341b52da5e06ffa9f07942ad))
91603   ROM_REGION(0x40000, "sound1", 0)
92604   ROM_LOAD("pbsnd6.dat", 0x00000, 0x10000, CRC(c2570631) SHA1(135db5b923689884c73aa5ce48f566db7f1cf831))
r21880r21881
102614   ROM_REGION(0x10000, "maincpu", 0)
103615   ROM_LOAD("robob5.a34", 0x0000, 0x8000, CRC(5a611004) SHA1(08722f8f4386bbc467cfbe8854f0d45c4537bdc6))
104616   ROM_LOAD("roboc5.a34", 0x8000, 0x8000, CRC(c8705f47) SHA1(a29ad9e4e0269ab19dae77b1e70ff84c8c8d9e85))
105   ROM_REGION(0x10000, "cpu2", 0)
617   ROM_REGION(0x10000, "audiocpu", 0)
106618   ROM_LOAD("robof7.rom", 0x8000, 0x8000, CRC(fa0891bd) SHA1(332d03c7802989abf717564230993b54819ebc0d))
107619   ROM_REGION(0x40000, "sound1", 0)
108620   ROM_LOAD("robof6.rom", 0x00000, 0x10000, CRC(9246e107) SHA1(e8e72c0d099b17ea9e59ea7794011bad4c072c5e))
r21880r21881
118630   ROM_REGION(0x10000, "maincpu", 0)
119631   ROM_LOAD("ssvc2-6.b5", 0x0000, 0x8000, CRC(e5eab8cd) SHA1(63cb678084d4fb2131ba64ed9de1294830057960))
120632   ROM_LOAD("ssvc2-6.c5", 0x8000, 0x8000, CRC(171b97ae) SHA1(9d678b7b91a5d50ea3cf4f2352094c2355f917b2))
121   ROM_REGION(0x10000, "cpu2", 0)
633   ROM_REGION(0x10000, "audiocpu", 0)
122634   ROM_LOAD("sssndf7.rom", 0x8000, 0x8000, CRC(980778d0) SHA1(7c1f14d327b6d0e6d0fef058f96bb1cb440c9330))
123635   ROM_REGION(0x40000, "sound1", 0)
124636   ROM_LOAD("ssv1f6.rom", 0x00000, 0x10000, CRC(ccbc72f8) SHA1(c5c13fb8d05d7fb4005636655073d88b4d12d65e))
r21880r21881
131643   ROM_REGION(0x10000, "maincpu", 0)
132644   ROM_LOAD("ssvc2-6.b5", 0x0000, 0x8000, CRC(e5eab8cd) SHA1(63cb678084d4fb2131ba64ed9de1294830057960))
133645   ROM_LOAD("ssvc2-6.c5", 0x8000, 0x8000, CRC(171b97ae) SHA1(9d678b7b91a5d50ea3cf4f2352094c2355f917b2))
134   ROM_REGION(0x10000, "cpu2", 0)
646   ROM_REGION(0x10000, "audiocpu", 0)
135647   ROM_LOAD("sssndf7b.rom", 0x8000, 0x8000, CRC(4bd6b16a) SHA1(b9438a16cd35820628fe6eb82287b2c39fe4b1c6))
136648   ROM_REGION(0x40000, "sound1", 0)
137649   ROM_LOAD("ssv1f6.rom", 0x00000, 0x10000, CRC(ccbc72f8) SHA1(c5c13fb8d05d7fb4005636655073d88b4d12d65e))
r21880r21881
147659   ROM_REGION(0x10000, "maincpu", 0)
148660   ROM_LOAD("tmach2-4.b5", 0x4000, 0x4000, CRC(6ef3cf07) SHA1(3fabfbb2166273bf5bfab06d92fff094d3331d1a))
149661   ROM_LOAD("tmach2-4.c5", 0x8000, 0x8000, CRC(b61035f5) SHA1(08436b68f37323f50c1fec86aba303a1690af653))
150   ROM_REGION(0x10000, "cpu2", 0)
662   ROM_REGION(0x10000, "audiocpu", 0)
151663   ROM_LOAD("tmachf7.rom", 0x8000, 0x8000, CRC(0f518bd4) SHA1(05e24ca0e76d576c65d9d2a01417f1ad2aa984bb))
152664   ROM_REGION(0x40000, "sound1", 0)
153665   ROM_LOAD("tmachf6.rom", 0x00000, 0x10000, CRC(47e61641) SHA1(93cd946ebc9f69d82512429a9ae5f2754499b00a))
r21880r21881
160672   ROM_REGION(0x10000, "maincpu", 0)
161673   ROM_LOAD("tmach1-8.b5", 0x4000, 0x4000, CRC(5dabdc4c) SHA1(67fe261888ddaa088abe2f8a331eaa5ac34be92e))
162674   ROM_LOAD("tmach1-8.c5", 0x8000, 0x8000, CRC(5a348def) SHA1(bf2b9a69d516d38e6f87c5886e0ba768c2dc28ab))
163   ROM_REGION(0x10000, "cpu2", 0)
675   ROM_REGION(0x10000, "audiocpu", 0)
164676   ROM_LOAD("tmachf7.rom", 0x8000, 0x8000, CRC(0f518bd4) SHA1(05e24ca0e76d576c65d9d2a01417f1ad2aa984bb))
165677   ROM_REGION(0x40000, "sound1", 0)
166678   ROM_LOAD("tmachf6.rom", 0x00000, 0x10000, CRC(47e61641) SHA1(93cd946ebc9f69d82512429a9ae5f2754499b00a))
r21880r21881
176688   ROM_REGION(0x10000, "maincpu", 0)
177689   ROM_LOAD("torpe2-1.b5", 0x0000, 0x8000, CRC(ac0b03e3) SHA1(0ac57b2fec29cdc90ab35cba49844f0cf545d959))
178690   ROM_LOAD("torpe2-1.c5", 0x8000, 0x8000, CRC(9ad33882) SHA1(c4504d8e136f667652f79b54d4e8d775169c6ac3))
179   ROM_REGION(0x10000, "cpu2", 0)
691   ROM_REGION(0x10000, "audiocpu", 0)
180692   ROM_LOAD("torpef7.rom", 0x8000, 0x8000, CRC(26f4c33e) SHA1(114f85e93e7b699c4cd6ce1298f95228d439deba))
181693   ROM_REGION(0x40000, "sound1", 0)
182694   ROM_LOAD("torpef6.rom", 0x00000, 0x10000, CRC(b214a7ea) SHA1(d972148395581844e3eaed08f755f3e2217dbbc0))
trunk/src/mame/mame.mak
r21880r21881
20832083
20842084$(DRIVERS)/darius.o:    $(LAYOUT)/darius.lh
20852085
2086$(DRIVERS)/de_2.o:      $(LAYOUT)/de2.lh
2087
20862088$(DRIVERS)/destroyr.o:  $(LAYOUT)/destroyr.lh
20872089
20882090$(DRIVERS)/dlair.o:     $(LAYOUT)/dlair.lh

Previous 199869 Revisions Next


© 1997-2024 The MAME Team