Previous 199869 Revisions Next

r18717 Friday 26th October, 2012 at 09:52:11 UTC by Robbbert
Williams System 8 : WIP
[src/mame]mame.mak
[src/mame/drivers]s3.c s4.c s8.c
[src/mame/layout]s8.lay*

trunk/src/mame/mame.mak
r18716r18717
22322232
22332233$(DRIVERS)/s6a.o:   $(LAYOUT)/s6a.lh
22342234
2235$(DRIVERS)/s8.o:   $(LAYOUT)/s8.lh
2236
22352237$(DRIVERS)/sbrkout.o:   $(LAYOUT)/sbrkout.lh
22362238
22372239$(DRIVERS)/sderby.o:   $(LAYOUT)/sderby.lh \
trunk/src/mame/layout/s8.lay
r0r18717
1<!-- s8.lay -->
2
3<!-- 2012-10-26: Initial version.  [Robbbert] -->
4
5<mamelayout version="2">
6
7   <element name="digit" defstate="0">
8      <led7seg>
9         <color red="1.0" green="0.25" blue="0.0" />
10      </led7seg>
11   </element>
12   <element name="red_led">
13      <disk><color red="1.0" green="0.0" blue="0.0" /></disk>
14   </element>
15   <element name="background">
16      <rect>
17         <bounds left="0" top="0" right="1" bottom="1" />
18         <color red="0.0" green="0.0" blue="0.0" />
19      </rect>
20   </element>
21   <element name="P0"><text string="Ball / Match"><color red="1.0" green="1.0" blue="1.0" /></text></element>
22   <element name="P1"><text string="Credits"><color red="1.0" green="1.0" blue="1.0" /></text></element>
23   <element name="P3"><text string="Player 1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
24   <element name="P4"><text string="Player 2"><color red="1.0" green="1.0" blue="1.0" /></text></element>
25   <element name="P5"><text string="Player 3"><color red="1.0" green="1.0" blue="1.0" /></text></element>
26   <element name="P6"><text string="Player 4"><color red="1.0" green="1.0" blue="1.0" /></text></element>
27
28   <view name="Default Layout">
29
30      <!-- Background -->
31      <backdrop element="background">
32         <bounds left="0" top="20" right="274" bottom="394" />
33      </backdrop>
34
35      <!-- LEDs -->
36
37      <!-- Player 1 Score -->
38
39      <bezel name="digit0" element="digit">
40         <bounds left="10" top="45" right="44" bottom="84" />
41      </bezel>
42      <bezel name="digit1" element="digit">
43         <bounds left="54" top="45" right="88" bottom="84" />
44      </bezel>
45      <bezel name="digit2" element="digit">
46         <bounds left="98" top="45" right="132" bottom="84" />
47      </bezel>
48      <bezel name="digit3" element="digit">
49         <bounds left="142" top="45" right="176" bottom="84" />
50      </bezel>
51      <bezel name="digit4" element="digit">
52         <bounds left="186" top="45" right="220" bottom="84" />
53      </bezel>
54      <bezel name="digit5" element="digit">
55         <bounds left="230" top="45" right="264" bottom="84" />
56      </bezel>
57
58      <!-- Player 2 Score -->
59      <bezel name="digit8" element="digit">
60         <bounds left="10" top="105" right="44" bottom="144" />
61      </bezel>
62      <bezel name="digit9" element="digit">
63         <bounds left="54" top="105" right="88" bottom="144" />
64      </bezel>
65      <bezel name="digit10" element="digit">
66         <bounds left="98" top="105" right="132" bottom="144" />
67      </bezel>
68      <bezel name="digit11" element="digit">
69         <bounds left="142" top="105" right="176" bottom="144" />
70      </bezel>
71      <bezel name="digit12" element="digit">
72         <bounds left="186" top="105" right="220" bottom="144" />
73      </bezel>
74      <bezel name="digit13" element="digit">
75         <bounds left="230" top="105" right="264" bottom="144" />
76      </bezel>
77
78      <!-- Player 3 Score -->
79      <bezel name="digit16" element="digit">
80         <bounds left="10" top="165" right="44" bottom="204" />
81      </bezel>
82      <bezel name="digit17" element="digit">
83         <bounds left="54" top="165" right="88" bottom="204" />
84      </bezel>
85      <bezel name="digit18" element="digit">
86         <bounds left="98" top="165" right="132" bottom="204" />
87      </bezel>
88      <bezel name="digit19" element="digit">
89         <bounds left="142" top="165" right="176" bottom="204" />
90      </bezel>
91      <bezel name="digit20" element="digit">
92         <bounds left="186" top="165" right="220" bottom="204" />
93      </bezel>
94      <bezel name="digit21" element="digit">
95         <bounds left="230" top="165" right="264" bottom="204" />
96      </bezel>
97
98      <!-- Player 4 Score -->
99      <bezel name="digit24" element="digit">
100         <bounds left="10" top="225" right="44" bottom="264" />
101      </bezel>
102      <bezel name="digit25" element="digit">
103         <bounds left="54" top="225" right="88" bottom="264" />
104      </bezel>
105      <bezel name="digit26" element="digit">
106         <bounds left="98" top="225" right="132" bottom="264" />
107      </bezel>
108      <bezel name="digit27" element="digit">
109         <bounds left="142" top="225" right="176" bottom="264" />
110      </bezel>
111      <bezel name="digit28" element="digit">
112         <bounds left="186" top="225" right="220" bottom="264" />
113      </bezel>
114      <bezel name="digit29" element="digit">
115         <bounds left="230" top="225" right="264" bottom="264" />
116      </bezel>
117
118      <!-- Credits and Balls -->
119      <bezel name="digit14" element="digit">
120         <bounds left="10" top="345" right="44" bottom="384" />
121      </bezel>
122      <bezel name="digit15" element="digit">
123         <bounds left="54" top="345" right="88" bottom="384" />
124      </bezel>
125      <bezel name="digit8" element="digit">
126         <bounds left="186" top="345" right="220" bottom="384" />
127      </bezel>
128      <bezel name="digit7" element="digit">
129         <bounds left="230" top="345" right="264" bottom="384" />
130      </bezel>
131      <bezel element="P0"><bounds left="200" right="258" top="330" bottom="342" /></bezel>
132      <bezel element="P1"><bounds left="30" right="88" top="330" bottom="342" /></bezel>
133      <bezel name="text3" element="P3"><bounds left="100" right="180" top="30" bottom="42" /></bezel>
134      <bezel name="text2" element="P4"><bounds left="100" right="180" top="90" bottom="102" /></bezel>
135      <bezel name="text1" element="P5"><bounds left="100" right="180" top="150" bottom="162" /></bezel>
136      <bezel name="text0" element="P6"><bounds left="100" right="180" top="210" bottom="222" /></bezel>
137      <bezel name="led0" element="red_led">
138         <bounds left="110" right="125" top="360" bottom="375" /></bezel>
139      <bezel name="led1" element="red_led">
140         <bounds left="144" right="159" top="360" bottom="375" /></bezel>
141   </view>
142</mamelayout>
trunk/src/mame/drivers/s3.c
r18716r18717
282282   {
283283      if (BIT(data, 0))
284284         m_samples->start(1, 1); // 10 chime
285      //else
285
286286      if (BIT(data, 1))
287287         m_samples->start(2, 2); // 100 chime
288      //else
288
289289      if (BIT(data, 2))
290290         m_samples->start(3, 3); // 1000 chime
291
291292      // we don't have a 10k chime in samples yet
292      //else
293293      //if (BIT(data, 3))
294294         //m_samples->start(1, x); // 10k chime
295295   }
trunk/src/mame/drivers/s4.c
r18716r18717
66    No schematics have been located as yet.
77
88    Phoenix and Pokerino are listed as System 4 systems, but use System 3 roms.
9    They have been moved to s4.c, and are working there.
9    They have been moved to s3.c, and are working there.
1010
1111    Only Flash and Stellar Wars are pinball machines. The remainder are so-called
1212    "Shuffle", which is a flat board with an air-driven puck and 10 bowling pins.
trunk/src/mame/drivers/s8.c
r18716r18717
33    Pinball
44    Williams System 8
55
6    Only 2 games used this system.
7
8    - Pennant Fever, which isn't a true pinball, it is a baseball game where you aim
9      for targets at the top of the playfield, and the players advance towards a
10      home run. There are no bumpers or other 'usual' pinball items.
11
12    - Still Crazy, a novelty game where the playfield is completely vertical. It has
13      4 flippers and the idea is to get the ball up to the alcohol 'still' before
14      the 'revenuers' do. The idea didn't catch on, and the game was not officially
15      released.
16
17ToDo:
18- Everything
19- Identify devices at 200x and 210x
20- Pennant Fever maincpu goes into lala-land after a rti.
21
622************************************************************************************/
723
824
9#include "emu.h"
25#include "machine/genpin.h"
1026#include "cpu/m6800/m6800.h"
27#include "machine/6821pia.h"
28#include "sound/dac.h"
29#include "s8.lh"
1130
12class williams_s8_state : public driver_device
31
32class s8_state : public genpin_class
1333{
1434public:
15   williams_s8_state(const machine_config &mconfig, device_type type, const char *tag)
16      : driver_device(mconfig, type, tag),
17   m_maincpu(*this, "maincpu")
35   s8_state(const machine_config &mconfig, device_type type, const char *tag)
36      : genpin_class(mconfig, type, tag),
37   m_maincpu(*this, "maincpu"),
38   m_audiocpu(*this, "audiocpu"),
39   m_dac(*this, "dac"),
40   m_pia0(*this, "pia0"),
41   m_pia1(*this, "pia1"),
42   m_pia2(*this, "pia2"),
43   m_pia3(*this, "pia3"),
44   m_pia4(*this, "pia4")
1845   { }
1946
47   DECLARE_READ8_MEMBER(dac_r);
48   DECLARE_WRITE8_MEMBER(dac_w);
49   DECLARE_WRITE8_MEMBER(dig0_w);
50   DECLARE_WRITE8_MEMBER(dig1_w);
51   DECLARE_WRITE8_MEMBER(lamp0_w);
52   DECLARE_WRITE8_MEMBER(lamp1_w);
53   DECLARE_WRITE8_MEMBER(sol0_w);
54   DECLARE_WRITE8_MEMBER(sol1_w);
55   DECLARE_READ8_MEMBER(dips_r);
56   DECLARE_READ8_MEMBER(switch_r);
57   DECLARE_WRITE8_MEMBER(switch_w);
58   DECLARE_READ_LINE_MEMBER(pia2_ca1_r);
59   DECLARE_READ_LINE_MEMBER(pia2_cb1_r);
60   DECLARE_READ_LINE_MEMBER(pia4_cb1_r);
61   DECLARE_WRITE_LINE_MEMBER(pia0_ca2_w) { }; //ST5
62   DECLARE_WRITE_LINE_MEMBER(pia0_cb2_w) { }; //ST-solenoids enable
63   DECLARE_WRITE_LINE_MEMBER(pia1_ca2_w) { }; //ST2
64   DECLARE_WRITE_LINE_MEMBER(pia1_cb2_w) { }; //ST1
65   DECLARE_WRITE_LINE_MEMBER(pia2_ca2_w) { }; //diag leds enable
66   DECLARE_WRITE_LINE_MEMBER(pia2_cb2_w) { }; //ST6
67   DECLARE_WRITE_LINE_MEMBER(pia3_ca2_w) { }; //ST4
68   DECLARE_WRITE_LINE_MEMBER(pia3_cb2_w) { }; //ST3
69   TIMER_DEVICE_CALLBACK_MEMBER(irq);
70   DECLARE_INPUT_CHANGED_MEMBER(main_nmi);
71   DECLARE_INPUT_CHANGED_MEMBER(audio_nmi);
72   DECLARE_MACHINE_RESET(s8);
73   DECLARE_MACHINE_RESET(s8a);
2074protected:
2175
2276   // devices
2377   required_device<cpu_device> m_maincpu;
24
25   // driver_device overrides
26   virtual void machine_reset();
27public:
28   DECLARE_DRIVER_INIT(williams_s8);
78   optional_device<cpu_device> m_audiocpu;
79   optional_device<dac_device> m_dac;
80   required_device<pia6821_device> m_pia0;
81   required_device<pia6821_device> m_pia1;
82   required_device<pia6821_device> m_pia2;
83   required_device<pia6821_device> m_pia3;
84   optional_device<pia6821_device> m_pia4;
85private:
86   UINT8 m_t_c;
87   UINT8 m_sound_data;
88   UINT8 m_strobe;
89   UINT8 m_kbdrow;
90   bool m_cb1;
91   bool m_data_ok;
92   bool m_chimes;
2993};
3094
31
32static ADDRESS_MAP_START( williams_s8_map, AS_PROGRAM, 8, williams_s8_state )
95static ADDRESS_MAP_START( s8_main_map, AS_PROGRAM, 8, s8_state )
3396   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
3497   AM_RANGE(0x0000, 0x07ff) AM_RAM
35   //AM_RANGE(0x2100, 0x2103) AM_WRITE
36   //AM_RANGE(0x2200, 0x2200) AM_WRITE
37   //AM_RANGE(0x2400, 0x2403) AM_WRITE
38   //AM_RANGE(0x2800, 0x2803) AM_WRITE
39   //AM_RANGE(0x3000, 0x3003) AM_WRITE
40   AM_RANGE(0x5000, 0x7fff) AM_ROM
98   //AM_RANGE(0x0100, 0x01ff) AM_RAM AM_SHARE("nvram")
99   AM_RANGE(0x2200, 0x2203) AM_DEVREADWRITE("pia0", pia6821_device, read, write) // solenoids
100   AM_RANGE(0x2400, 0x2403) AM_DEVREADWRITE("pia1", pia6821_device, read, write) // lamps
101   AM_RANGE(0x2800, 0x2803) AM_DEVREADWRITE("pia2", pia6821_device, read, write) // display
102   AM_RANGE(0x3000, 0x3003) AM_DEVREADWRITE("pia3", pia6821_device, read, write) // inputs
103   AM_RANGE(0x6000, 0x7fff) AM_ROM
41104ADDRESS_MAP_END
42105
43static ADDRESS_MAP_START( williams_s8_sub_map, AS_PROGRAM, 8, williams_s8_state )
106static ADDRESS_MAP_START( s8_audio_map, AS_PROGRAM, 8, s8_state )
44107   AM_RANGE(0x0000, 0x00ff) AM_RAM
45   //AM_RANGE(0x4000, 0x4003) AM_WRITE
108   AM_RANGE(0x4000, 0x4003) AM_MIRROR(0x8000) AM_DEVREADWRITE("pia4", pia6821_device, read, write) // sounds
46109   AM_RANGE(0x8000, 0xffff) AM_ROM
47110ADDRESS_MAP_END
48111
49static INPUT_PORTS_START( williams_s8 )
112static INPUT_PORTS_START( s8 )
113   PORT_START("X0")
114   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q)
115   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W)
116   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E)
117   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_R)
118   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Y)
119   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_U)
120   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I)
121   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O)
122
123   PORT_START("X1")
124   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
125   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER )
126   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START )
127   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
128   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
129   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
130   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER )
131   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER )
132
133   PORT_START("X2")
134   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A)
135   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S)
136   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D)
137   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F)
138   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_G)
139   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_H)
140   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J)
141   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K)
142
143   PORT_START("X4")
144   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L)
145   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z)
146   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C)
147   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_V)
148   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_B)
149   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_N)
150   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M)
151   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COMMA)
152
153   PORT_START("X8")
154   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_STOP)
155   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_SLASH)
156   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_COLON)
157   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_QUOTE)
158   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_X)
159   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_MINUS)
160   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS)
161   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSPACE)
162
163   PORT_START("X10")
164   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_OPENBRACE)
165   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_CLOSEBRACE)
166   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_BACKSLASH)
167   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_ENTER)
168   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_LEFT)
169   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_RIGHT)
170   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_UP)
171   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_DOWN)
172
173   PORT_START("X20")
174   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
175
176   PORT_START("X40")
177   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
178
179   PORT_START("X80")
180   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
181
182   PORT_START("SND")
183   PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
184   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Music1") PORT_CODE(KEYCODE_3) PORT_TOGGLE
185   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Music2") PORT_CODE(KEYCODE_4) PORT_TOGGLE
186
187   PORT_START("DIAGS")
188   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Audio Diag") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, s8_state, audio_nmi, 1)
189   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Main Diag") PORT_CODE(KEYCODE_F2) PORT_CHANGED_MEMBER(DEVICE_SELF, s8_state, main_nmi, 1)
190   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Advance") PORT_CODE(KEYCODE_0)
191   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Manual/Auto") PORT_CODE(KEYCODE_9)
192   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Enter") PORT_CODE(KEYCODE_8)
193
194   PORT_START("DSW0")
195   PORT_DIPNAME( 0x01, 0x01, "SW01" )
196   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
197   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
198   PORT_DIPNAME( 0x02, 0x02, "SW02" )
199   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
200   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
201   PORT_DIPNAME( 0x04, 0x04, "SW03" )
202   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
203   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
204   PORT_DIPNAME( 0x08, 0x08, "SW04" )
205   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
206   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
207   PORT_DIPNAME( 0x10, 0x10, "SW05" )
208   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
209   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
210   PORT_DIPNAME( 0x20, 0x20, "SW06" )
211   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
212   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
213   PORT_DIPNAME( 0x40, 0x40, "SW07" )
214   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
215   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
216   PORT_DIPNAME( 0x80, 0x80, "SW08" )
217   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
218   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
219
220   PORT_START("DSW1")
221   PORT_DIPNAME( 0x01, 0x01, "SW11" )
222   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
223   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
224   PORT_DIPNAME( 0x02, 0x02, "SW12" )
225   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
226   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
227   PORT_DIPNAME( 0x04, 0x04, "SW13" )
228   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
229   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
230   PORT_DIPNAME( 0x08, 0x08, "SW14" )
231   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
232   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
233   PORT_DIPNAME( 0x10, 0x10, "SW15" )
234   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
235   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
236   PORT_DIPNAME( 0x20, 0x20, "SW16" )
237   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
238   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
239   PORT_DIPNAME( 0x40, 0x40, "SW17" )
240   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
241   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
242   PORT_DIPNAME( 0x80, 0x80, "SW18" )
243   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
244   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
50245INPUT_PORTS_END
51246
52void williams_s8_state::machine_reset()
247MACHINE_RESET_MEMBER( s8_state, s8 )
53248{
249   m_t_c = 0;
250   m_chimes = 1;
54251}
55252
56DRIVER_INIT_MEMBER(williams_s8_state,williams_s8)
253MACHINE_RESET_MEMBER( s8_state, s8a )
57254{
255   m_t_c = 0;
256   m_chimes = 0;
58257}
59258
60static MACHINE_CONFIG_START( williams_s8, williams_s8_state )
259INPUT_CHANGED_MEMBER( s8_state::main_nmi )
260{
261   // Diagnostic button sends a pulse to NMI pin
262   if (newval==CLEAR_LINE)
263      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
264}
265
266INPUT_CHANGED_MEMBER( s8_state::audio_nmi )
267{
268   // Diagnostic button sends a pulse to NMI pin
269   if ((newval==CLEAR_LINE) && !m_chimes)
270      m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
271}
272
273WRITE8_MEMBER( s8_state::sol0_w )
274{
275   if (BIT(data, 4))
276      m_samples->start(2, 5); // outhole
277}
278
279WRITE8_MEMBER( s8_state::sol1_w )
280{
281   if (m_chimes)
282   {
283      if (BIT(data, 0))
284         m_samples->start(1, 1); // 10 chime
285
286      if (BIT(data, 1))
287         m_samples->start(2, 2); // 100 chime
288
289      if (BIT(data, 2))
290         m_samples->start(3, 3); // 1000 chime
291
292      // we don't have a 10k chime in samples yet
293      //if (BIT(data, 3))
294         //m_samples->start(1, x); // 10k chime
295   }
296   else
297   {printf("%X ",data);
298      m_sound_data = ioport("SND")->read();
299      if (BIT(data, 0))
300         m_sound_data &= 0xfe;
301
302      if (BIT(data, 1))
303         m_sound_data &= 0xfd;
304
305      if (BIT(data, 2))
306         m_sound_data &= 0xfb;
307
308      if (BIT(data, 3))
309         m_sound_data &= 0xf7;
310
311      if (BIT(data, 4))
312         m_sound_data &= 0x7f;
313
314      m_cb1 = ((m_sound_data & 0x7f) != 0x7f);
315
316      m_pia4->cb1_w(m_cb1);
317   }
318
319   if (BIT(data, 5))
320      m_samples->start(0, 6); // knocker
321}
322
323static const pia6821_interface pia0_intf =
324{
325   DEVCB_NULL,      /* port A in */
326   DEVCB_NULL,      /* port B in */
327   DEVCB_LINE_GND,      /* line CA1 in */
328   DEVCB_LINE_GND,      /* line CB1 in */
329   DEVCB_NULL,      /* line CA2 in */
330   DEVCB_NULL,      /* line CB2 in */
331   DEVCB_DRIVER_MEMBER(s8_state, sol0_w),      /* port A out */
332   DEVCB_DRIVER_MEMBER(s8_state, sol1_w),      /* port B out */
333   DEVCB_DRIVER_LINE_MEMBER(s8_state, pia0_ca2_w),      /* line CA2 out */
334   DEVCB_DRIVER_LINE_MEMBER(s8_state, pia0_cb2_w),      /* line CB2 out */
335   DEVCB_CPU_INPUT_LINE("maincpu", M6800_IRQ_LINE),      /* IRQA */
336   DEVCB_CPU_INPUT_LINE("maincpu", M6800_IRQ_LINE)      /* IRQB */
337};
338
339WRITE8_MEMBER( s8_state::lamp0_w )
340{
341   m_maincpu->set_input_line(M6800_IRQ_LINE, CLEAR_LINE);
342}
343
344WRITE8_MEMBER( s8_state::lamp1_w )
345{
346}
347
348static const pia6821_interface pia1_intf =
349{
350   DEVCB_NULL,      /* port A in */
351   DEVCB_NULL,      /* port B in */
352   DEVCB_LINE_GND,      /* line CA1 in */
353   DEVCB_LINE_GND,      /* line CB1 in */
354   DEVCB_NULL,      /* line CA2 in */
355   DEVCB_NULL,      /* line CB2 in */
356   DEVCB_DRIVER_MEMBER(s8_state, lamp0_w),      /* port A out */
357   DEVCB_DRIVER_MEMBER(s8_state, lamp1_w),      /* port B out */
358   DEVCB_DRIVER_LINE_MEMBER(s8_state, pia1_ca2_w),      /* line CA2 out */
359   DEVCB_DRIVER_LINE_MEMBER(s8_state, pia1_cb2_w),      /* line CB2 out */
360   DEVCB_CPU_INPUT_LINE("maincpu", M6800_IRQ_LINE),      /* IRQA */
361   DEVCB_CPU_INPUT_LINE("maincpu", M6800_IRQ_LINE)      /* IRQB */
362};
363
364READ_LINE_MEMBER( s8_state::pia2_ca1_r )
365{
366   return BIT(ioport("DIAGS")->read(), 2); // advance button
367}
368
369READ_LINE_MEMBER( s8_state::pia2_cb1_r )
370{
371   return BIT(ioport("DIAGS")->read(), 3); // auto/manual switch
372}
373
374READ8_MEMBER( s8_state::dips_r )
375{
376   if (BIT(ioport("DIAGS")->read(), 4) )
377   {
378      switch (m_strobe)
379      {
380      case 0:
381         return ioport("DSW0")->read() & 15;
382         break;
383      case 1:
384         return ioport("DSW0")->read() << 4;
385         break;
386      case 2:
387         return ioport("DSW1")->read() & 15;
388         break;
389      case 3:
390         return ioport("DSW1")->read() << 4;
391         break;
392      }
393   }
394   return 0xff;
395}
396
397WRITE8_MEMBER( s8_state::dig0_w )
398{
399   m_strobe = data & 15;
400   m_data_ok = true;
401   output_set_value("led0", BIT(data, 4));
402   output_set_value("led1", BIT(data, 5));
403}
404
405WRITE8_MEMBER( s8_state::dig1_w )
406{
407   static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558
408   if (m_data_ok)
409   {
410      output_set_digit_value(m_strobe+16, patterns[data&15]);
411      output_set_digit_value(m_strobe, patterns[data>>4]);
412   }
413   m_data_ok = false;
414}
415
416static const pia6821_interface pia2_intf =
417{
418   DEVCB_DRIVER_MEMBER(s8_state, dips_r),      /* port A in */
419   DEVCB_NULL,      /* port B in */
420   DEVCB_DRIVER_LINE_MEMBER(s8_state, pia2_ca1_r),      /* line CA1 in */
421   DEVCB_DRIVER_LINE_MEMBER(s8_state, pia2_cb1_r),      /* line CB1 in */
422   DEVCB_NULL,      /* line CA2 in */
423   DEVCB_NULL,      /* line CB2 in */
424   DEVCB_DRIVER_MEMBER(s8_state, dig0_w),      /* port A out */
425   DEVCB_DRIVER_MEMBER(s8_state, dig1_w),      /* port B out */
426   DEVCB_DRIVER_LINE_MEMBER(s8_state, pia2_ca2_w),      /* line CA2 out */
427   DEVCB_DRIVER_LINE_MEMBER(s8_state, pia2_cb2_w),      /* line CB2 out */
428   DEVCB_CPU_INPUT_LINE("maincpu", M6800_IRQ_LINE),      /* IRQA */
429   DEVCB_CPU_INPUT_LINE("maincpu", M6800_IRQ_LINE)      /* IRQB */
430};
431
432READ8_MEMBER( s8_state::switch_r )
433{
434   char kbdrow[8];
435   sprintf(kbdrow,"X%X",m_kbdrow);
436   return ioport(kbdrow)->read();
437}
438
439WRITE8_MEMBER( s8_state::switch_w )
440{
441   m_kbdrow = data;
442}
443
444static const pia6821_interface pia3_intf =
445{
446   DEVCB_DRIVER_MEMBER(s8_state, switch_r),      /* port A in */
447   DEVCB_NULL,      /* port B in */
448   DEVCB_LINE_GND,      /* line CA1 in */
449   DEVCB_LINE_GND,      /* line CB1 in */
450   DEVCB_NULL,      /* line CA2 in */
451   DEVCB_NULL,      /* line CB2 in */
452   DEVCB_NULL,      /* port A out */
453   DEVCB_DRIVER_MEMBER(s8_state, switch_w),      /* port B out */
454   DEVCB_DRIVER_LINE_MEMBER(s8_state, pia3_ca2_w),      /* line CA2 out */
455   DEVCB_DRIVER_LINE_MEMBER(s8_state, pia3_cb2_w),      /* line CB2 out */
456   DEVCB_CPU_INPUT_LINE("maincpu", M6800_IRQ_LINE),      /* IRQA */
457   DEVCB_CPU_INPUT_LINE("maincpu", M6800_IRQ_LINE)      /* IRQB */
458};
459
460READ_LINE_MEMBER( s8_state::pia4_cb1_r )
461{
462   return m_cb1;
463}
464
465READ8_MEMBER( s8_state::dac_r )
466{printf("%X ",m_sound_data);
467   return m_sound_data;   
468}
469
470WRITE8_MEMBER( s8_state::dac_w )
471{
472   m_dac->write_unsigned8(data);
473}
474
475static const pia6821_interface pia4_intf =
476{
477   DEVCB_NULL,      /* port A in */
478   DEVCB_DRIVER_MEMBER(s8_state, dac_r),      /* port B in */
479   DEVCB_NULL,      /* line CA1 in */
480   DEVCB_DRIVER_LINE_MEMBER(s8_state, pia4_cb1_r),      /* line CB1 in */
481   DEVCB_NULL,      /* line CA2 in */
482   DEVCB_NULL,      /* line CB2 in */
483   DEVCB_DRIVER_MEMBER(s8_state, dac_w),      /* port A out */
484   DEVCB_NULL,      /* port B out */
485   DEVCB_NULL,      /* line CA2 out */
486   DEVCB_NULL,      /* line CB2 out */
487   DEVCB_CPU_INPUT_LINE("audiocpu", M6800_IRQ_LINE),      /* IRQA */
488   DEVCB_CPU_INPUT_LINE("audiocpu", M6800_IRQ_LINE)      /* IRQB */
489};
490
491TIMER_DEVICE_CALLBACK_MEMBER( s8_state::irq)
492{
493   if (m_t_c > 0x70)
494      m_maincpu->set_input_line(M6800_IRQ_LINE, ASSERT_LINE);
495   else
496      m_t_c++;
497}
498
499static MACHINE_CONFIG_START( s8, s8_state )
61500   /* basic machine hardware */
62   MCFG_CPU_ADD("maincpu", M6800, 1000000)
63   MCFG_CPU_PROGRAM_MAP(williams_s8_map)
64   MCFG_CPU_ADD("cpu2", M6800, 1000000)
65   MCFG_CPU_PROGRAM_MAP(williams_s8_sub_map)
501   MCFG_CPU_ADD("maincpu", M6802, 4000000)
502   MCFG_CPU_PROGRAM_MAP(s8_main_map)
503   MCFG_TIMER_DRIVER_ADD_PERIODIC("irq", s8_state, irq, attotime::from_hz(1000))
504   MCFG_MACHINE_RESET_OVERRIDE(s8_state, s8)
505
506   /* Video */
507   MCFG_DEFAULT_LAYOUT(layout_s8)
508
509   /* Sound */
510   MCFG_FRAGMENT_ADD( genpin_audio )
511
512   /* Devices */
513   MCFG_PIA6821_ADD("pia0", pia0_intf)
514   MCFG_PIA6821_ADD("pia1", pia1_intf)
515   MCFG_PIA6821_ADD("pia2", pia2_intf)
516   MCFG_PIA6821_ADD("pia3", pia3_intf)
517   //MCFG_NVRAM_ADD_1FILL("nvram")
518   /* Add the soundcard */
519   MCFG_CPU_ADD("audiocpu", M6808, 3580000)
520   MCFG_CPU_PROGRAM_MAP(s8_audio_map)
521   MCFG_MACHINE_RESET_OVERRIDE(s8_state, s8a)
522   MCFG_SPEAKER_STANDARD_MONO("mono")
523   MCFG_SOUND_ADD("dac", DAC, 0)
524   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
525   MCFG_PIA6821_ADD("pia4", pia4_intf)
66526MACHINE_CONFIG_END
67527
68/*--------------------
69/ Pennant Fever (#526)
70/--------------------*/
528/*------------------------------
529/ Pennant Fever (#526) 05/1984
530/-------------------------------*/
71531ROM_START(pfevr_l2)
72532   ROM_REGION(0x10000, "maincpu", 0)
73533   ROM_LOAD("pf-rom1.u19", 0x5000, 0x1000, CRC(00be42bd) SHA1(72ca21c96e3ffa3c43499165f3339b669c8e94a5))
74534   ROM_LOAD("pf-rom2.u20", 0x6000, 0x2000, CRC(7b101534) SHA1(21e886d5872104d71bb528b9affb12230268597a))
75535
76   ROM_REGION(0x10000, "cpu2", 0)
536   ROM_REGION(0x10000, "audiocpu", 0)
77537   ROM_LOAD("cpu_u49.128", 0xc000, 0x4000, CRC(b0161712) SHA1(5850f1f1f11e3ac9b9629cff2b26c4ad32436b55))
78538   ROM_RELOAD(0x8000, 0x4000)
79539ROM_END
r18716r18717
83543   ROM_LOAD("cpu_u19.732", 0x5000, 0x1000, CRC(03796c6d) SHA1(38c95fcce9d0f357a74f041f0df006b9c6f6efc7))
84544   ROM_LOAD("cpu_u20.764", 0x6000, 0x2000, CRC(3a3acb39) SHA1(7844cc30a9486f718a556850fc9cef3be82f26b7))
85545
86   ROM_REGION(0x10000, "cpu2", 0)
546   ROM_REGION(0x10000, "audiocpu", 0)
87547   ROM_LOAD("cpu_u49.128", 0xc000, 0x4000, CRC(b0161712) SHA1(5850f1f1f11e3ac9b9629cff2b26c4ad32436b55))
88548   ROM_RELOAD(0x8000, 0x4000)
89549ROM_END
90550
91/*--------------------
92/ Still Crazy
93/--------------------*/
551/*----------------------------
552/ Still Crazy (#534) 06/1984
553/-----------------------------*/
94554ROM_START(stillcra)
95555   ROM_REGION(0x10000, "maincpu", 0)
96556   ROM_LOAD("ic20.bin", 0x6000, 0x2000, CRC(b0df42e6) SHA1(bb10268d7b820d1de0c20e1b79aba558badd072b) )
97557
98   ROM_REGION(0x10000, "cpu2", 0)
558   ROM_REGION(0x10000, "audiocpu", 0)
99559   ROM_LOAD("ic49.bin", 0xc000, 0x4000, CRC(bcc8ccc4) SHA1(2312f9cc4f5a2dadfbfa61d13c31bb5838adf152) )
100560   ROM_RELOAD(0x8000, 0x4000)
101561ROM_END
102562
103GAME(1984,pfevr_l2, 0,        williams_s8, williams_s8, williams_s8_state, williams_s8, ROT0, "Williams", "Pennant Fever (L-2)", GAME_IS_SKELETON_MECHANICAL)
104GAME(1984,pfevr_p3, pfevr_l2, williams_s8, williams_s8, williams_s8_state, williams_s8, ROT0, "Williams", "Pennant Fever (P-3)", GAME_IS_SKELETON_MECHANICAL)
105GAME(1984,stillcra, 0,        williams_s8, williams_s8, williams_s8_state, williams_s8, ROT0, "Williams", "Still Crazy", GAME_IS_SKELETON_MECHANICAL)
563GAME(1984,pfevr_l2, 0,        s8, s8, driver_device, 0, ROT0, "Williams", "Pennant Fever (L-2)", GAME_IS_SKELETON_MECHANICAL)
564GAME(1984,pfevr_p3, pfevr_l2, s8, s8, driver_device, 0, ROT0, "Williams", "Pennant Fever (P-3)", GAME_IS_SKELETON_MECHANICAL)
565GAME(1984,stillcra, 0,        s8, s8, driver_device, 0, ROT0, "Williams", "Still Crazy", GAME_IS_SKELETON_MECHANICAL)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team