1 // license:GPL-2.0+
2 // copyright-holders:Juergen Buchmueller, David Haywood
3 /***********************************************************************
4 
5     DECO Cassette System driver
6     by Juergen Buchmueller
7     with contributions by:
8     David Widel
9     Nicola Salmoria
10     Aaron Giles
11     Brian Troha
12     Fabio Priuli
13     Lord Nightmare
14     The Dumping Union
15     Team Japump!!!
16     Hau
17     Jean-Francois Del Nero
18     Omar Cornut
19     Game Preservation Society
20     Joseph Redon
21 
22     The DECO cassette system consists of three PCBS in a card cage:
23     Early boardset: (1980-1983) (proms unknown for this boardset, no schematics for this boardset)
24     One DE-0069C-0 RMS-3 pcb with a 6502 processor, D8041C MCU (DECO Cassette control), two ay-3-8910s, and one 2708 eprom holding the audio bios. (audio, needs external amp and volume control)
25     One DE-0068B-0 DSP-3 pcb with a 'DECO CPU-3' custom, two 2716 eproms. (main processor and bios, graphics, dipswitches?)
26     One DE-0070C-0 BIO-3 pcb with an analog ADC0908 8-bit adc.
27     One DE-0066B-0 card rack board that the other three boards plug into.
28     This boardset has two versions : MD, known as "shokase" in Japan, and MT, known as "daikase" which is using bigger data tapes. (MT was only sold in Japan, not emulated yet)
29 
30     Later boardset: (1984 onward, schematic is dated October 1983)
31     One DE-0097C-0 RMS-8 pcb with a 6502 processor, two ay-3-8910s, two eproms (2716 and 2732) plus one prom, and 48k worth of 4116 16kx1 DRAMs; the 6502 processor has its own 4K of SRAM. (audio processor and RAM, Main processor's dram, dipswitches)
32     One DE-0096C-0 DSP-8 board with a 'DECO 222' custom on it (labeled '8049 // C10707-2') which appears to really be a 'cleverly' disguised 6502, and two proms, plus 4K of sram, and three hm2511-1 1kx1 srams. (main processor, sprites, missiles, palette)
33     One DE-0098C-0 B10-8 (BIO-8 on schematics) board with an 8041, an analog devices ADC0908 8-bit adc, and 4K of SRAM on it. (DECO Cassette control, inputs, tilemaps, headlights)
34     One DE-0109C-0 card rack board that the other three boards plug into. (fourth connector for DE-109C-0 is shorter than in earlier versions)
35 
36     The actual cassettes use a custom player hooked to the BIO board, and are roughly microcassette form factor, but are larger and will not fit in a conventional microcassette player.
37     Each cassette has one track on it and is separated into clock and data by two Magtek IC in the player, for a form of synchronous serial.
38     The data is stored in blocks with headers and CRC16 checksums.
39     The first block contains information such as the region (A:Japan, B:USA, C:UK, D:Europe) and the total number of blocks left to read.
40     The last physical block on the cassette is a dummy block not used by the system. (only used to mark the end of last block)
41 
42  ***********************************************************************/
43 
44 #include "emu.h"
45 #include "includes/decocass.h"
46 
47 #include "cpu/m6502/m6502.h"
48 #include "cpu/mcs48/mcs48.h"
49 #include "machine/deco222.h"
50 #include "machine/decocass_tape.h"
51 #include "sound/ay8910.h"
52 #include "speaker.h"
53 
54 #define MASTER_CLOCK    XTAL(12'000'000)
55 #define HCLK            (MASTER_CLOCK/2)
56 #define HCLK1           (HCLK/2)
57 #define HCLK2           (HCLK1/2)
58 #define HCLK4           (HCLK2/2)
59 
60 
61 /***************************************************************************
62  *
63  *  swizzled mirror handlers
64  *
65  ***************************************************************************/
66 
mirrorvideoram_w(offs_t offset,uint8_t data)67 void decocass_state::mirrorvideoram_w(offs_t offset, uint8_t data) { offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5); decocass_fgvideoram_w(offset, data); }
mirrorcolorram_w(offs_t offset,uint8_t data)68 void decocass_state::mirrorcolorram_w(offs_t offset, uint8_t data) { offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5); decocass_colorram_w(offset, data); }
69 
mirrorvideoram_r(offs_t offset)70 uint8_t decocass_state::mirrorvideoram_r(offs_t offset)
71 {
72 	offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5);
73 	return m_fgvideoram[offset];
74 }
75 
mirrorcolorram_r(offs_t offset)76 uint8_t decocass_state::mirrorcolorram_r(offs_t offset)
77 {
78 	offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5);
79 	return m_colorram[offset];
80 }
81 
82 
decocass_map(address_map & map)83 void decocass_state::decocass_map(address_map &map)
84 {
85 	map(0x0000, 0x5fff).ram().share("rambase");
86 	map(0x6000, 0xbfff).ram().w(FUNC(decocass_state::decocass_charram_w)).share("charram"); /* still RMS3 RAM */
87 	map(0xc000, 0xc3ff).ram().w(FUNC(decocass_state::decocass_fgvideoram_w)).share("fgvideoram");  /* DSP3 RAM */
88 	map(0xc400, 0xc7ff).ram().w(FUNC(decocass_state::decocass_colorram_w)).share("colorram");
89 	map(0xc800, 0xcbff).rw(FUNC(decocass_state::mirrorvideoram_r), FUNC(decocass_state::mirrorvideoram_w));
90 	map(0xcc00, 0xcfff).rw(FUNC(decocass_state::mirrorcolorram_r), FUNC(decocass_state::mirrorcolorram_w));
91 	map(0xd000, 0xd7ff).ram().w(FUNC(decocass_state::decocass_tileram_w)).share("tileram");
92 	map(0xd800, 0xdbff).ram().w(FUNC(decocass_state::decocass_objectram_w)).share("objectram");
93 	map(0xe000, 0xe0ff).ram().w(FUNC(decocass_state::decocass_paletteram_w)).share("paletteram");
94 	map(0xe300, 0xe300).portr("DSW1").w(FUNC(decocass_state::decocass_watchdog_count_w));
95 	map(0xe301, 0xe301).portr("DSW2").w(FUNC(decocass_state::decocass_watchdog_flip_w));
96 	map(0xe302, 0xe302).w(FUNC(decocass_state::decocass_color_missiles_w));
97 	map(0xe400, 0xe400).w(FUNC(decocass_state::decocass_reset_w));
98 
99 /* BIO-3 board */
100 	map(0xe402, 0xe402).w(FUNC(decocass_state::decocass_mode_set_w));      /* scroll mode regs + various enable regs */
101 	map(0xe403, 0xe403).w(FUNC(decocass_state::decocass_back_h_shift_w));  /* back (both)  tilemap x scroll */
102 	map(0xe404, 0xe404).w(FUNC(decocass_state::decocass_back_vl_shift_w)); /* back (left)  (top@rot0) tilemap y scroll */
103 	map(0xe405, 0xe405).w(FUNC(decocass_state::decocass_back_vr_shift_w)); /* back (right) (bot@rot0) tilemap y scroll */
104 	map(0xe406, 0xe406).w(FUNC(decocass_state::decocass_part_h_shift_w)); /* headlight */
105 	map(0xe407, 0xe407).w(FUNC(decocass_state::decocass_part_v_shift_w)); /* headlight */
106 
107 	map(0xe410, 0xe410).w(FUNC(decocass_state::decocass_color_center_bot_w));
108 	map(0xe411, 0xe411).w(FUNC(decocass_state::decocass_center_h_shift_space_w));
109 	map(0xe412, 0xe412).w(FUNC(decocass_state::decocass_center_v_shift_w));
110 	map(0xe413, 0xe413).w(FUNC(decocass_state::decocass_coin_counter_w));
111 	map(0xe414, 0xe414).rw(FUNC(decocass_state::decocass_sound_command_main_r), FUNC(decocass_state::decocass_sound_command_w));
112 	map(0xe415, 0xe416).w(FUNC(decocass_state::decocass_quadrature_decoder_reset_w));
113 	map(0xe417, 0xe417).w(FUNC(decocass_state::decocass_nmi_reset_w));
114 	map(0xe420, 0xe42f).w(FUNC(decocass_state::decocass_adc_w));
115 
116 	map(0xe500, 0xe5ff).rw(FUNC(decocass_state::decocass_e5xx_r), FUNC(decocass_state::decocass_e5xx_w)); /* read data from 8041/status */
117 
118 	map(0xe600, 0xe6ff).r(FUNC(decocass_state::decocass_input_r));      /* inputs */
119 	map(0xe700, 0xe700).r(FUNC(decocass_state::decocass_sound_data_r)); /* read sound CPU data */
120 	map(0xe701, 0xe701).r(FUNC(decocass_state::decocass_sound_ack_r));  /* read sound CPU ack status */
121 
122 	map(0xf000, 0xffff).rom();
123 }
124 
decocass_sound_map(address_map & map)125 void decocass_state::decocass_sound_map(address_map &map)
126 {
127 	map(0x0000, 0x0fff).ram();
128 	map(0x1000, 0x17ff).rw(FUNC(decocass_state::decocass_sound_nmi_enable_r), FUNC(decocass_state::decocass_sound_nmi_enable_w));
129 	map(0x1800, 0x1fff).rw(FUNC(decocass_state::decocass_sound_data_ack_reset_r), FUNC(decocass_state::decocass_sound_data_ack_reset_w));
130 	map(0x2000, 0x2fff).w("ay1", FUNC(ay8910_device::data_w));
131 	map(0x4000, 0x4fff).w("ay1", FUNC(ay8910_device::address_w));
132 	map(0x6000, 0x6fff).w("ay2", FUNC(ay8910_device::data_w));
133 	map(0x8000, 0x8fff).w("ay2", FUNC(ay8910_device::address_w));
134 	map(0xa000, 0xafff).r(FUNC(decocass_state::decocass_sound_command_r));
135 	map(0xc000, 0xcfff).w(FUNC(decocass_state::decocass_sound_data_w));
136 	map(0xf800, 0xffff).rom();
137 }
138 
139 
140 static INPUT_PORTS_START( decocass )
141 	PORT_START("IN0")
142 	PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_JOYSTICK_RIGHT )
143 	PORT_BIT( 0x02, IP_ACTIVE_HIGH,IPT_JOYSTICK_LEFT )
144 	PORT_BIT( 0x04, IP_ACTIVE_HIGH,IPT_JOYSTICK_UP )
145 	PORT_BIT( 0x08, IP_ACTIVE_HIGH,IPT_JOYSTICK_DOWN )
146 	PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_BUTTON1 )
147 	PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_BUTTON2 )
148 	PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_UNUSED )
149 	PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_UNUSED )
150 
151 	PORT_START("IN1")
152 	PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
153 	PORT_BIT( 0x02, IP_ACTIVE_HIGH,IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
154 	PORT_BIT( 0x04, IP_ACTIVE_HIGH,IPT_JOYSTICK_UP ) PORT_COCKTAIL
155 	PORT_BIT( 0x08, IP_ACTIVE_HIGH,IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
156 	PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_BUTTON1 ) PORT_COCKTAIL
157 	PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_BUTTON2 ) PORT_COCKTAIL
158 	PORT_BIT( 0x40, IP_ACTIVE_HIGH,IPT_UNUSED )
159 	PORT_BIT( 0x80, IP_ACTIVE_HIGH,IPT_UNUSED )
160 
161 	PORT_START("IN2")
162 	PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_UNKNOWN )
163 	PORT_BIT( 0x02, IP_ACTIVE_HIGH,IPT_UNKNOWN )
164 	PORT_BIT( 0x04, IP_ACTIVE_HIGH,IPT_UNKNOWN )
165 	PORT_BIT( 0x08, IP_ACTIVE_HIGH,IPT_START1 ) PORT_IMPULSE(1)
166 	PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_START2 ) PORT_IMPULSE(1)
167 	PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_UNKNOWN )
168 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1)
169 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
170 
171 	PORT_START("AN0")
172 	PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1)
173 
174 	PORT_START("AN1")
175 	PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1)
176 
177 	PORT_START("AN2")
178 	PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(2)
179 
180 	PORT_START("AN3")
181 	PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(2)
182 
183 	PORT_START("DSW1")
184 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )                       PORT_DIPLOCATION("SW1:1,2")
185 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
186 	PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
187 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
188 	PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
189 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )                       PORT_DIPLOCATION("SW1:3,4")
190 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
191 	PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
192 	PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
193 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
194 	PORT_DIPNAME( 0x30, 0x30, "Type of Tape" )                          PORT_DIPLOCATION("SW1:5,6")   /* Used by the "bios" */
195 	PORT_DIPSETTING(    0x00, "MT (Big)" )          /* Was listed as "Board Type" with this being "OLD" */
196 	PORT_DIPSETTING(    0x10, "invalid?" )
197 	PORT_DIPSETTING(    0x20, "invalid?" )
198 	PORT_DIPSETTING(    0x30, "MD (Small)" )        /* Was listed as "Board Type" with this being "NEW" */
199 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )                      PORT_DIPLOCATION("SW1:7")
200 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
201 	PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
202 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
203 
204 	PORT_START("DSW2") /* Start with all Unknown as each can change per game, except for Country Code */
205 	PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1")        /* Most Dipswitch Settings sheets show this as "Number of Players" (Lives) */
206 	PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2")        /* Most Dipswitch Settings sheets show 2 & 3 as "Bonus Players" */
207 	PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3")
208 	PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4")        /* Most Dipswitch Settings sheets show 4 (with/without 5) as some form of Diffculty */
209 	PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5")
210 	PORT_DIPNAME( 0xe0, 0xe0, "Country Code" )                          PORT_DIPLOCATION("SW2:6,7,8") /* Always Listed as "DON'T CHANGE" */
211 	PORT_DIPSETTING(    0xe0, "A" )
212 	PORT_DIPSETTING(    0xc0, "B" )
213 	PORT_DIPSETTING(    0xa0, "C" )
214 	PORT_DIPSETTING(    0x80, "D" )
215 	PORT_DIPSETTING(    0x60, "E" )
216 	PORT_DIPSETTING(    0x40, "F" )
217 INPUT_PORTS_END
218 
219 static INPUT_PORTS_START( cterrani )
220 	PORT_INCLUDE( decocass )
221 
222 	PORT_MODIFY("DSW2")
223 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
224 	PORT_DIPSETTING(    0x01, "3" )
225 	PORT_DIPSETTING(    0x00, "5" )
226 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
227 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
228 	PORT_DIPSETTING(    0x06, "3000" )
229 	PORT_DIPSETTING(    0x04, "5000" )
230 	PORT_DIPSETTING(    0x02, "7000" )
231 	PORT_DIPNAME( 0x08, 0x08, "Player's Rocket Movement" )              PORT_DIPLOCATION("SW2:4")
232 	PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
233 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
234 	PORT_DIPNAME( 0x10, 0x10, "Alien Craft Movement" )                  PORT_DIPLOCATION("SW2:5")
235 	PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
236 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
237 	/* Switches 6, 7 & 8 are shown as completly blank */
238 INPUT_PORTS_END
239 
240 static INPUT_PORTS_START( csuperas )
241 	PORT_INCLUDE( decocass )
242 
243 	PORT_MODIFY("DSW2")
244 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
245 	PORT_DIPSETTING(    0x01, "3" )
246 	PORT_DIPSETTING(    0x00, "5" )
247 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
248 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
249 	PORT_DIPSETTING(    0x06, "20000" )
250 	PORT_DIPSETTING(    0x04, "30000" )
251 	PORT_DIPSETTING(    0x02, "40000" )
252 	PORT_DIPNAME( 0x08, 0x08, "Alien Craft Movement" )                  PORT_DIPLOCATION("SW2:4")
253 	PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
254 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
255 	/* Switches 6, 7 & 8 are listed as "Country Code" A through F and "Don't Change" */
256 INPUT_PORTS_END
257 
258 
259 static INPUT_PORTS_START( cocean1a ) /* 10 */
260 	PORT_INCLUDE( decocass )
261 
262 	PORT_MODIFY("DSW1") /* Switches 5 and 6 defined as blank/2100/2100/2100 and "Don't change" */
263 	PORT_DIPNAME( 0x07, 0x07, "Number of 1 Coin Credit")                PORT_DIPLOCATION("SW1:1,2,3") /* Credits for 1 coin */
264 	PORT_DIPSETTING(    0x07, "1")
265 	PORT_DIPSETTING(    0x06, "2")
266 	PORT_DIPSETTING(    0x05, "5")
267 	PORT_DIPSETTING(    0x04, "10")
268 	PORT_DIPSETTING(    0x03, "20")
269 	PORT_DIPSETTING(    0x02, "30")
270 	PORT_DIPSETTING(    0x01, "40")
271 	PORT_DIPSETTING(    0x00, "50")
272 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( None ) )                         PORT_DIPLOCATION("SW1:4")     /* Default is "Off" and shown as "Don't change" */
273 	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
274 	PORT_DIPSETTING(    0x00, DEF_STR( None ) )
275 
276 	PORT_MODIFY("DSW2")
277 	PORT_DIPNAME( 0x03, 0x03, "Key Switch Credit" )                     PORT_DIPLOCATION("SW2:1,2")   /* Unknown */
278 	PORT_DIPSETTING(    0x03, "1 Coin 10 Credits" )
279 	PORT_DIPSETTING(    0x02, "1 Coin 20 Credits" )
280 	PORT_DIPSETTING(    0x01, "1 Coin 50 Credits" )
281 	PORT_DIPSETTING(    0x00, "1 Coin 100 Credits" )
282 	PORT_DIPNAME( 0x04, 0x04, "Game Select" )                           PORT_DIPLOCATION("SW2:3")
283 	PORT_DIPSETTING(    0x04, "1 to 8 Lines" )
284 	PORT_DIPSETTING(    0x00, "Center Line" )
285 	PORT_DIPNAME( 0x08, 0x08, "Background Music" )                      PORT_DIPLOCATION("SW2:4")
286 	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
287 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
288 	PORT_DIPNAME( 0x10, 0x10, "Pay Out %" )                             PORT_DIPLOCATION("SW2:5")
289 	PORT_DIPSETTING(    0x10, "Payout 75%")
290 	PORT_DIPSETTING(    0x00, "Payout 85%")
291 	/* Switches 6 to 8 are shown as completly blank and "Don't change" */
292 INPUT_PORTS_END
293 
294 static INPUT_PORTS_START( clocknchj )
295 	PORT_INCLUDE( decocass )
296 
297 	PORT_MODIFY("DSW2")
298 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
299 	PORT_DIPSETTING(    0x01, "3" )
300 	PORT_DIPSETTING(    0x00, "5" )
301 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
302 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
303 	PORT_DIPSETTING(    0x06, "15000" )
304 	PORT_DIPSETTING(    0x04, "20000" )
305 	PORT_DIPSETTING(    0x02, "30000" )
306 	/* Switches 4, 5, 6, 7 & 8 are listed as "Not Used" and "Don't Change" */
307 INPUT_PORTS_END
308 
309 static INPUT_PORTS_START( clocknch )
310 	PORT_INCLUDE( clocknchj )
311 
312 	PORT_MODIFY("DSW2")
313 	PORT_DIPNAME( 0x08, 0x08, "Game Speed" ) PORT_DIPLOCATION("SW2:4")
314 	PORT_DIPSETTING(    0x08, "Slow" )
315 	PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
316 INPUT_PORTS_END
317 
318 static INPUT_PORTS_START( cprogolf )
319 	PORT_INCLUDE( decocass )
320 
321 	PORT_MODIFY("DSW2")
322 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
323 	PORT_DIPSETTING(    0x01, "2" )
324 	PORT_DIPSETTING(    0x00, "3" )
325 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3") /* You must shoot equal to or under the listed value for a bonus */
326 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
327 	PORT_DIPSETTING(    0x02, "6 Under" )
328 	PORT_DIPSETTING(    0x04, "3 Under" )
329 	PORT_DIPSETTING(    0x06, "1 Under" )
330 	PORT_DIPNAME( 0x08, 0x08, "Number of Strokes" )                     PORT_DIPLOCATION("SW2:4") /* You must shoot equal to or under to continue, else you lose a life */
331 	PORT_DIPSETTING(    0x00, "Par +2" )
332 	PORT_DIPSETTING(    0x08, "Par +3" )
333 	PORT_DIPNAME( 0x10, 0x10, "Show Stroke Power/Ball Direction" )      PORT_DIPLOCATION("SW2:5")
334 	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
335 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
336 	/* Switches 6, 7 & 8 are listed as "Country Code" A through F and "Don't Change" */
337 INPUT_PORTS_END
338 
339 static INPUT_PORTS_START( cdsteljn )
340 	PORT_INCLUDE( decocass )
341 
342 	PORT_START("P1_MP0")
343 	PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
344 
345 	PORT_START("P1_MP1")
346 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) PORT_PLAYER(1)
347 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) PORT_PLAYER(1)
348 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) PORT_PLAYER(1)
349 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) PORT_PLAYER(1)
350 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) PORT_PLAYER(1)
351 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) PORT_PLAYER(1)
352 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) PORT_PLAYER(1)
353 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
354 
355 
356 	PORT_START("P1_MP2")
357 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) PORT_PLAYER(1)
358 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) PORT_PLAYER(1)
359 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) PORT_PLAYER(1)
360 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) PORT_PLAYER(1)
361 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) PORT_PLAYER(1)
362 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) PORT_PLAYER(1)
363 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) PORT_PLAYER(1)
364 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
365 
366 	PORT_START("P1_MP3")
367 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) PORT_PLAYER(1)
368 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) PORT_PLAYER(1)
369 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) PORT_PLAYER(1)
370 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) PORT_PLAYER(1)
371 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) PORT_PLAYER(1)
372 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
373 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
374 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
375 
376 	PORT_START("P2_MP0")
377 	PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
378 
379 	PORT_START("P2_MP1")
380 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) PORT_PLAYER(2)
381 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) PORT_PLAYER(2)
382 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) PORT_PLAYER(2)
383 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) PORT_PLAYER(2)
384 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) PORT_PLAYER(2)
385 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) PORT_PLAYER(2)
386 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) PORT_PLAYER(2)
387 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
388 
389 	PORT_START("P2_MP2")
390 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) PORT_PLAYER(2)
391 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) PORT_PLAYER(2)
392 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) PORT_PLAYER(2)
393 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) PORT_PLAYER(2)
394 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) PORT_PLAYER(2)
395 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) PORT_PLAYER(2)
396 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) PORT_PLAYER(2)
397 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
398 
399 	PORT_START("P2_MP3")
400 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
401 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) PORT_PLAYER(2)
402 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
403 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
404 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) PORT_PLAYER(2)
405 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
406 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
407 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
408 INPUT_PORTS_END
409 
410 static INPUT_PORTS_START( cexplore )
411 	PORT_INCLUDE( decocass )
412 
413 	PORT_MODIFY("DSW2")
414 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
415 	PORT_DIPSETTING(    0x01, "3" )
416 	PORT_DIPSETTING(    0x00, "5" )
417 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
418 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
419 	PORT_DIPSETTING(    0x06, "10000" )
420 	PORT_DIPSETTING(    0x04, "1500000" )
421 	PORT_DIPSETTING(    0x02, "30000" )
422 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) )                   PORT_DIPLOCATION("SW2:4") /* Listed as "Missle" */
423 	PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
424 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
425 	PORT_DIPNAME( 0x10, 0x10, "Number of UFOs" )                        PORT_DIPLOCATION("SW2:5")
426 	PORT_DIPSETTING(    0x10, "Few" )
427 	PORT_DIPSETTING(    0x00, "Many" )
428 	/* Switches 6, 7 & 8 are listed as "Country Code" A through F and "Don't Change" */
429 INPUT_PORTS_END
430 static INPUT_PORTS_START( ctornado )
431 	PORT_INCLUDE( decocass )
432 
433 	PORT_MODIFY("DSW2")
434 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
435 	PORT_DIPSETTING(    0x01, "3" )
436 	PORT_DIPSETTING(    0x00, "5" )
437 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
438 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
439 	PORT_DIPSETTING(    0x06, "10000" )
440 	PORT_DIPSETTING(    0x04, "20000" )
441 	PORT_DIPSETTING(    0x02, "30000" )
442 	PORT_DIPNAME( 0x08, 0x08, "Crash Bombs" )                           PORT_DIPLOCATION("SW2:4") /* Printed English translation "Hero Destructor" */
443 	PORT_DIPSETTING(    0x08, "3" )
444 	PORT_DIPSETTING(    0x00, "5" )
445 	PORT_DIPNAME( 0x10, 0x10, "Alens' Speed" )                          PORT_DIPLOCATION("SW2:5")
446 	PORT_DIPSETTING(    0x10, "Slow" )
447 	PORT_DIPSETTING(    0x00, "Fast" )
448 	/* Switches 6, 7 & 8 are listed as "Country Code" A through F and "Don't Change" */
449 INPUT_PORTS_END
450 
451 static INPUT_PORTS_START( cmissnx )
452 	PORT_INCLUDE( decocass )
453 
454 	PORT_MODIFY("DSW2")
455 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
456 	PORT_DIPSETTING(    0x01, "3" )
457 	PORT_DIPSETTING(    0x00, "5" )
458 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
459 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
460 	PORT_DIPSETTING(    0x06, "5000" )
461 	PORT_DIPSETTING(    0x04, "10000" )
462 	PORT_DIPSETTING(    0x02, "15000" )
463 	PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) )                   PORT_DIPLOCATION("SW2:4,5") /* Listed as "Game Level" */
464 	PORT_DIPSETTING(    0x18, DEF_STR( Easy ) )
465 	PORT_DIPSETTING(    0x10, DEF_STR( Normal ) )
466 	PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )
467 	PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
468 	/* Switches 6, 7 & 8 are listed as "Country Code" A through F and "Don't Change" */
469 INPUT_PORTS_END
470 
471 static INPUT_PORTS_START( cbtime )
472 	PORT_INCLUDE( decocass )
473 
474 	PORT_MODIFY("DSW2")
475 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
476 	PORT_DIPSETTING(    0x01, "3" )
477 	PORT_DIPSETTING(    0x00, "5" )
478 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
479 	PORT_DIPSETTING(    0x06, "20000" )
480 	PORT_DIPSETTING(    0x04, "30000" )
481 	PORT_DIPSETTING(    0x02, "40000" )
482 	PORT_DIPSETTING(    0x00, "50000" )
483 	PORT_DIPNAME( 0x08, 0x08, "Enemies" )                               PORT_DIPLOCATION("SW2:4")
484 	PORT_DIPSETTING(    0x08, "4" )
485 	PORT_DIPSETTING(    0x00, "6" )
486 	PORT_DIPNAME( 0x10, 0x10, "End of Level Pepper" )                   PORT_DIPLOCATION("SW2:5")
487 	PORT_DIPSETTING(    0x10, DEF_STR( No ) )
488 	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
489 INPUT_PORTS_END
490 
491 static INPUT_PORTS_START( cgraplop )
492 	PORT_INCLUDE( decocass )
493 
494 	PORT_MODIFY("DSW2")
495 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
496 	PORT_DIPSETTING(    0x01, "3" )
497 	PORT_DIPSETTING(    0x00, "5" )
498 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
499 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
500 	PORT_DIPSETTING(    0x06, "20000" )
501 	PORT_DIPSETTING(    0x04, "50000" )
502 	PORT_DIPSETTING(    0x02, "70000" )
503 	PORT_DIPNAME( 0x08, 0x08, "Number of Up Sign" )                     PORT_DIPLOCATION("SW2:4")
504 	PORT_DIPSETTING(    0x08, "Few" )
505 	PORT_DIPSETTING(    0x00, "Many" )
506 	PORT_DIPNAME( 0x10, 0x10, "Falling Speed" )                         PORT_DIPLOCATION("SW2:5")
507 	PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
508 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
509 	/* Switches 6, 7 & 8 are listed as "Not Used" and "Don't Change" */
510 INPUT_PORTS_END
511 
512 static INPUT_PORTS_START( cnightst )
513 	PORT_INCLUDE( decocass )
514 
515 	PORT_MODIFY("DSW2")
516 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
517 	PORT_DIPSETTING(    0x01, "3" )
518 	PORT_DIPSETTING(    0x00, "5" )
519 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
520 	PORT_DIPSETTING(    0x06, "When Night Star Completed (First 2 Times)" )
521 	PORT_DIPSETTING(    0x04, "When Night Star Completed (First Time Only)" )
522 	PORT_DIPSETTING(    0x02, "Every 70000"  )
523 	PORT_DIPSETTING(    0x00, "30000 Only"  )
524 	PORT_DIPNAME( 0x08, 0x08, "Number of Missles" )                     PORT_DIPLOCATION("SW2:4")
525 	PORT_DIPSETTING(    0x08, "Few" )
526 	PORT_DIPSETTING(    0x00, "Many" )
527 	PORT_DIPNAME( 0x10, 0x10, "Enemy's Speed" )                         PORT_DIPLOCATION("SW2:5")
528 	PORT_DIPSETTING(    0x10, "Slow" )
529 	PORT_DIPSETTING(    0x00, "Fast" )
530 	/* Switches 6, 7 & 8 are listed as "Country Code" A through F and "Don't Change" */
531 INPUT_PORTS_END
532 
533 static INPUT_PORTS_START( cskater )
534 	PORT_INCLUDE( decocass )
535 
536 	PORT_MODIFY("DSW2")
537 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1") /* Listed as "Number of Balls" */
538 	PORT_DIPSETTING(    0x01, "3" )
539 	PORT_DIPSETTING(    0x00, "5" )
540 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
541 	PORT_DIPSETTING(    0x00, "60000" )
542 	PORT_DIPSETTING(    0x06, "20000" )
543 	PORT_DIPSETTING(    0x04, "30000" )
544 	PORT_DIPSETTING(    0x02, "40000" )
545 	PORT_DIPNAME( 0x08, 0x08, "Enemy's Speed" )                         PORT_DIPLOCATION("SW2:4")
546 	PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
547 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
548 	PORT_DIPNAME( 0x10, 0x10, "Number of Skates" )                      PORT_DIPLOCATION("SW2:5")
549 	PORT_DIPSETTING(    0x10, "Small" )
550 	PORT_DIPSETTING(    0x00, "Large" )
551 	/* Switches 6, 7 & 8 are listed as "Country Code" A through F and "Don't Change" */
552 INPUT_PORTS_END
553 
554 static INPUT_PORTS_START( cpsoccer )
555 	PORT_INCLUDE( decocass )
556 
557 	PORT_MODIFY("DSW2")
558 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1") /* Listed as "Number of Balls" */
559 	PORT_DIPSETTING(    0x01, "3" )
560 	PORT_DIPSETTING(    0x00, "5" )
561 	PORT_DIPNAME( 0x06, 0x06, "Number of Nice Goal" )                   PORT_DIPLOCATION("SW2:2,3")
562 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
563 	PORT_DIPSETTING(    0x06, "5" )
564 	PORT_DIPSETTING(    0x04, "10" )
565 	PORT_DIPSETTING(    0x02, "20" )
566 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )                  PORT_DIPLOCATION("SW2:4")
567 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
568 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
569 	PORT_DIPNAME( 0x10, 0x10, DEF_STR( Difficulty ) )                   PORT_DIPLOCATION("SW2:4") /* Listed as "Class" */
570 	PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
571 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
572 	/* Switches 6, 7 & 8 are listed as "Country Code" A through F and "Don't Change" */
573 INPUT_PORTS_END
574 
575 static INPUT_PORTS_START( csdtenis )
576 	PORT_INCLUDE( decocass )
577 
578 	PORT_MODIFY("DSW2")
579 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1") /* Listed as "Number of Balls" */
580 	PORT_DIPSETTING(    0x01, "2" )
581 	PORT_DIPSETTING(    0x00, "1" )
582 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
583 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
584 	PORT_DIPSETTING(    0x06, "Every 1set" )
585 	PORT_DIPSETTING(    0x04, "Every 2set" )
586 	PORT_DIPSETTING(    0x02, "Every 3set" )
587 	PORT_DIPNAME( 0x08, 0x08, "Speed Level" )                           PORT_DIPLOCATION("SW2:4")
588 	PORT_DIPSETTING(    0x08, "Low Speed" )
589 	PORT_DIPSETTING(    0x00, "High Speed" )
590 	PORT_DIPNAME( 0x10, 0x10, "Attack Level" )                          PORT_DIPLOCATION("SW2:5")
591 	PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
592 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
593 	/* Switches 6, 7 & 8 are listed as "Country Code" A through F and "Don't Change" */
594 INPUT_PORTS_END
595 
596 static INPUT_PORTS_START( cscrtry )
597 	PORT_INCLUDE( decocass )
598 
599 	PORT_MODIFY("DSW2")
600 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
601 	PORT_DIPSETTING(    0x01, "2" )
602 	PORT_DIPSETTING(    0x00, "4" )
603 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
604 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
605 	PORT_DIPSETTING(    0x06, "30000" )
606 	PORT_DIPSETTING(    0x04, "50000" )
607 	PORT_DIPSETTING(    0x02, "70000" )
608 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) )                   PORT_DIPLOCATION("SW2:4")
609 	PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
610 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
611 	PORT_DIPNAME( 0x10, 0x10, "Timer(Don't Change)" )                   PORT_DIPLOCATION("SW2:5")
612 	PORT_DIPSETTING(    0x10, "Timer decrease" )
613 	PORT_DIPSETTING(    0x00, "Timer infinity" )
614 	/* Switches 6, 7 & 8 are listed as "Special Purpose" and "Don't Change" */
615 INPUT_PORTS_END
616 
617 static INPUT_PORTS_START( cfghtice )
618 	PORT_INCLUDE( decocass )
619 
620 	PORT_MODIFY("DSW2")
621 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
622 	PORT_DIPSETTING(    0x01, "3" )
623 	PORT_DIPSETTING(    0x00, "5" )
624 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Very_Difficult ) )               PORT_DIPLOCATION("SW2:2,3")
625 	PORT_DIPSETTING(    0x04, DEF_STR( Very_Easy )  )
626 	PORT_DIPSETTING(    0x06, DEF_STR( Easy ) )
627 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
628 	PORT_DIPSETTING(    0x02, DEF_STR( Very_Difficult ) )
629 	PORT_DIPNAME( 0x08, 0x08, "Enemy's Speed" )                         PORT_DIPLOCATION("SW2:4")
630 	PORT_DIPSETTING(    0x08, DEF_STR( Normal ) )
631 	PORT_DIPSETTING(    0x00, "Fast" )
632 	PORT_SERVICE_DIPLOC(  0x10, IP_ACTIVE_LOW, "SW2:5" )    /* Listed as Test Mode, but doesn't seem to work??? */
633 	/* Switches 6, 7 & 8 are listed as "Country Code" A through F and "Don't Change" */
634 INPUT_PORTS_END
635 
636 static INPUT_PORTS_START( cbdash )
637 	PORT_INCLUDE( decocass )
638 
639 	PORT_MODIFY("DSW2")
640 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
641 	PORT_DIPSETTING(    0x01, "3" )
642 	PORT_DIPSETTING(    0x00, "5" )
643 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
644 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
645 	PORT_DIPSETTING(    0x06, "20000" )
646 	PORT_DIPSETTING(    0x04, "30000" )
647 	PORT_DIPSETTING(    0x02, "40000" )
648 	PORT_DIPNAME( 0x18, 0x18, DEF_STR( Difficulty ) )                   PORT_DIPLOCATION("SW2:4,5")
649 	PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )       /* Number of Diamonds Little, Timer: Long */
650 	PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )     /* Number of Diamonds Little, Timer: Long */
651 	PORT_DIPSETTING(    0x08, DEF_STR( Harder ) )       /* Number of Diamonds Many, Timer: Short */
652 	PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )      /* Number of Diamonds Many, Timer: Short */
653 	/* Switches 6, 7 & 8 are listed as "Country Code" A through F and "Don't Change" */
654 INPUT_PORTS_END
655 
656 static INPUT_PORTS_START( cfishing )
657 	PORT_INCLUDE( decocass )
658 
659 	PORT_MODIFY("DSW2")
660 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
661 	PORT_DIPSETTING(    0x01, "3" )
662 	PORT_DIPSETTING(    0x00, "5" )
663 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
664 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
665 	PORT_DIPSETTING(    0x06, "10000" )
666 	PORT_DIPSETTING(    0x04, "20000" )
667 	PORT_DIPSETTING(    0x02, "30000" )
668 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) )                   PORT_DIPLOCATION("SW2:4")
669 	PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
670 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
671 	/* Switches 5, 6, 7 & 8 are listed as "Not Used" and "Don't Change" */
672 INPUT_PORTS_END
673 
674 static INPUT_PORTS_START( cfboy0a1 ) /* 12 */
675 	PORT_INCLUDE( decocass )
676 
677 	PORT_MODIFY("DSW2")
678 	PORT_DIPNAME( 0x01, 0x01, "Number of The Deco Kids" )                PORT_DIPLOCATION("SW2:1")
679 	PORT_DIPSETTING(    0x01, "3" )
680 	PORT_DIPSETTING(    0x00, "5" )
681 	PORT_DIPNAME( 0x06, 0x06, "Bonus Points" )                           PORT_DIPLOCATION("SW2:2,3")
682 	PORT_DIPSETTING(    0x06, "5000" )
683 	PORT_DIPSETTING(    0x04, "10000" )
684 	PORT_DIPSETTING(    0x02, "15000" )
685 	PORT_DIPSETTING(    0x00, DEF_STR( None )  )
686 	PORT_DIPNAME( 0x08, 0x08, "Number of Alien Missiles" )               PORT_DIPLOCATION("SW2:4")
687 	PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
688 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
689 	PORT_DIPNAME( 0x10, 0x10, "Alien Craft Movement" )                   PORT_DIPLOCATION("SW2:5")
690 	PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
691 	PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
692 	/* Switches 6 to 8 are shown as "Country Code" (A to F) and "Don't Change" */
693 INPUT_PORTS_END
694 
695 static INPUT_PORTS_START( ctisland )
696 	PORT_INCLUDE( decocass )
697 
698 	PORT_MODIFY("DSW2")
699 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
700 	PORT_DIPSETTING(    0x01, "3" )
701 	PORT_DIPSETTING(    0x00, "5" )
702 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
703 	PORT_DIPSETTING(    0x06, "15000" )
704 	PORT_DIPSETTING(    0x04, "20000" )
705 	PORT_DIPSETTING(    0x02, "25000" )
706 	PORT_DIPSETTING(    0x00, "30000"  )
707 	/* other dips not verified */
708 INPUT_PORTS_END
709 
710 static INPUT_PORTS_START( cppicf )
711 	PORT_INCLUDE( decocass )
712 
713 	PORT_MODIFY("DSW2")
714 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
715 	PORT_DIPSETTING(    0x01, "3" )
716 	PORT_DIPSETTING(    0x00, "5" )
717 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
718 	PORT_DIPSETTING(    0x00, DEF_STR( None ) )
719 	PORT_DIPSETTING(    0x06, "30000" )
720 	PORT_DIPSETTING(    0x04, "50000" )
721 	PORT_DIPSETTING(    0x02, "70000" )
722 	PORT_DIPNAME( 0x10, 0x10, "Infinite Lives" )                        PORT_DIPLOCATION("SW2:5")
723 	PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
724 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
725 	/* other dips not verified */
726 INPUT_PORTS_END
727 
728 static INPUT_PORTS_START( clapapa )
729 	PORT_INCLUDE( decocass )
730 
731 	PORT_MODIFY("DSW2")
732 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
733 	PORT_DIPSETTING(    0x01, "3" )
734 	PORT_DIPSETTING(    0x00, "5" )
735 	/* other dips not verified */
736 INPUT_PORTS_END
737 
738 static INPUT_PORTS_START( cburnrub )
739 	PORT_INCLUDE( decocass )
740 
741 	PORT_MODIFY("DSW2")
742 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
743 	PORT_DIPSETTING(    0x01, "3" )
744 	PORT_DIPSETTING(    0x00, "5" )
745 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
746 	PORT_DIPSETTING(    0x02, "20000" )
747 	PORT_DIPSETTING(    0x00, "30000" )
748 	PORT_DIPSETTING(    0x06, "Every 30000" )
749 	PORT_DIPSETTING(    0x04, "Every 70000" )
750 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Allow_Continue ) )               PORT_DIPLOCATION("SW2:4")
751 	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
752 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
753 	/* other dips not verified */
754 INPUT_PORTS_END
755 
756 static INPUT_PORTS_START( cmanhat )
757 	PORT_INCLUDE( decocass )
758 
759 	PORT_MODIFY("DSW2")
760 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
761 	PORT_DIPSETTING(    0x01, "4" )
762 	PORT_DIPSETTING(    0x00, "6" )
763 	/* other dips not verified */
764 INPUT_PORTS_END
765 
766 static INPUT_PORTS_START( cluckypo )
767 	PORT_INCLUDE( decocass )
768 
769 	PORT_MODIFY("DSW2")
770 	PORT_DIPNAME( 0x01, 0x01, "Show Dealer Hand" )                      PORT_DIPLOCATION("SW2:1")
771 	PORT_DIPSETTING(    0x01, DEF_STR( No ) )
772 	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
773 	/* other dips not verified */
774 INPUT_PORTS_END
775 
776 static INPUT_PORTS_START( czeroize )
777 	PORT_INCLUDE( decocass )
778 
779 	PORT_MODIFY("DSW2")
780 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
781 	PORT_DIPSETTING(    0x01, "3" )
782 	PORT_DIPSETTING(    0x00, "5" )
783 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
784 	PORT_DIPSETTING(    0x06, DEF_STR ( None ) )
785 	PORT_DIPSETTING(    0x04, "50000" )
786 	PORT_DIPSETTING(    0x02, "70000" )
787 	PORT_DIPSETTING(    0x00, "90000"  )
788 	/* other dips not verified */
789 INPUT_PORTS_END
790 
791 static INPUT_PORTS_START( cflyball )
792 	PORT_INCLUDE( decocass )
793 
794 	PORT_MODIFY("DSW2")
795 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
796 	PORT_DIPSETTING(    0x01, "3" )
797 	PORT_DIPSETTING(    0x00, "5" )
798 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
799 	PORT_DIPSETTING(    0x00, DEF_STR ( None ) )
800 	PORT_DIPSETTING(    0x06, "20000" )
801 	PORT_DIPSETTING(    0x04, "50000" )
802 	PORT_DIPSETTING(    0x02, "70000" )
803 	PORT_DIPNAME( 0x08, 0x08, "Push Backs" )                            PORT_DIPLOCATION("SW2:4")
804 	PORT_DIPSETTING(    0x08, "2" )
805 	PORT_DIPSETTING(    0x00, "3" )
806 	/* other dips not verified */
807 INPUT_PORTS_END
808 
809 static INPUT_PORTS_START( cdiscon1 )
810 	PORT_INCLUDE( decocass )
811 
812 	PORT_MODIFY("DSW2")
813 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
814 	PORT_DIPSETTING(    0x01, "3" )
815 	PORT_DIPSETTING(    0x00, "5" )
816 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
817 	PORT_DIPSETTING(    0x00, DEF_STR ( None ) )
818 	PORT_DIPSETTING(    0x06, "10000" )
819 	PORT_DIPSETTING(    0x04, "20000" )
820 	PORT_DIPSETTING(    0x02, "30000" )
821 	PORT_DIPNAME( 0x08, 0x08, "Music Weapons" )                         PORT_DIPLOCATION("SW2:4")
822 	PORT_DIPSETTING(    0x08, "1" )
823 	PORT_DIPSETTING(    0x00, "2" )
824 	/* other dips not verified */
825 INPUT_PORTS_END
826 
827 static INPUT_PORTS_START( csweetht )
828 	PORT_INCLUDE( cdiscon1 )
829 
830 	PORT_MODIFY("DSW2")
831 	PORT_DIPNAME( 0x08, 0x08, "Music Weapons" )                         PORT_DIPLOCATION("SW2:4")
832 	PORT_DIPSETTING(    0x08, "5" )
833 	PORT_DIPSETTING(    0x00, "8" )
834 	/* other dips not verified */
835 INPUT_PORTS_END
836 
837 static INPUT_PORTS_START( chwy )
838 	PORT_INCLUDE( decocass )
839 
840 	PORT_MODIFY("DSW2")
841 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
842 	PORT_DIPSETTING(    0x01, "3" )
843 	PORT_DIPSETTING(    0x00, "5" )
844 	/* other dips not verified */
845 INPUT_PORTS_END
846 
847 static INPUT_PORTS_START( castfant )
848 	PORT_INCLUDE( decocass )
849 
850 	PORT_MODIFY("DSW2")
851 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
852 	PORT_DIPSETTING(    0x01, "3" )
853 	PORT_DIPSETTING(    0x00, "5" )
854 	/* other dips not verified */
855 INPUT_PORTS_END
856 
857 static INPUT_PORTS_START( cptennis )
858 	PORT_INCLUDE( decocass )
859 
860 	PORT_MODIFY("DSW2")
861 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )                        PORT_DIPLOCATION("SW2:1")
862 	PORT_DIPSETTING(    0x01, "2" )
863 	PORT_DIPSETTING(    0x00, "3" )
864 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) )                   PORT_DIPLOCATION("SW2:2,3")
865 	PORT_DIPSETTING(    0x06, "10000" )
866 	PORT_DIPSETTING(    0x04, "20000" )
867 	PORT_DIPSETTING(    0x02, "30000" )
868 	PORT_DIPSETTING(    0x00, DEF_STR( None ) )
869 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Difficulty ) )                   PORT_DIPLOCATION("SW2:4")
870 	PORT_DIPSETTING(    0x08, "Amateur" )
871 	PORT_DIPSETTING(    0x00, "Professional" )
872 	PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:5")
873 	// DIPs verified from DIPSW sheet
874 INPUT_PORTS_END
875 
876 static INPUT_PORTS_START( cprobowl )
877 	PORT_INCLUDE( decocass )
878 
879 	PORT_MODIFY("DSW2")
880 	PORT_DIPNAME( 0x01, 0x01, "Show Bonus Instructions" )                        PORT_DIPLOCATION("SW2:1")
881 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
882 	PORT_DIPSETTING(    0x01, DEF_STR( On ) )
883 	/* other dips not verified */
884 INPUT_PORTS_END
885 
886 static const gfx_layout charlayout =
887 {
888 	8,8,
889 	1024,
890 	3,
891 	{ 2*1024*8*8, 1*1024*8*8, 0*1024*8*8 },
892 	{ STEP8(0,1) },
893 	{ STEP8(0,8) },
894 	8*8
895 };
896 
897 static const gfx_layout spritelayout =
898 {
899 	16,16,
900 	256,
901 	3,
902 	{ 2*256*16*16, 1*256*16*16, 0*256*16*16 },
903 	{ STEP8(16*8,1), STEP8(0*8,1) },
904 	{ STEP16(0,8) },
905 	32*8
906 };
907 
908 static const gfx_layout tilelayout =
909 {
910 	16,16,
911 	16,
912 	3,
913 	{ 2*16*16*16+4, 2*16*16*16+0, 4 },
914 	{ STEP4(3*16*8,1), STEP4(2*16*8,1), STEP4(1*16*8,1), STEP4(0*16*8,1) },
915 	{ STEP16(0,8) },
916 	2*16*16
917 };
918 
919 static const uint32_t objlayout_xoffset[64] =
920 {
921 	STEP8(7*8,1), STEP8(6*8,1), STEP8(5*8,1), STEP8(4*8,1),
922 	STEP8(3*8,1), STEP8(2*8,1), STEP8(1*8,1), STEP8(0*8,1)
923 };
924 
925 static const uint32_t objlayout_yoffset[64] =
926 {
927 	STEP32(63*2*64, -1*2*64),
928 	STEP32(31*2*64, -1*2*64)
929 };
930 
931 static const gfx_layout objlayout =
932 {
933 	64,64,  /* 64x64 object */
934 	2,      /* 2 objects */
935 	1,      /* 1 bits per pixel */
936 	{ 0 },
937 	EXTENDED_XOFFS,
938 	EXTENDED_YOFFS,
939 	8*8, /* object takes 8 consecutive bytes */
940 	objlayout_xoffset,
941 	objlayout_yoffset
942 };
943 
944 static GFXDECODE_START( gfx_decocass )
945 	GFXDECODE_ENTRY( nullptr, 0x6000, charlayout,       0, 4 )  /* char set #1 */
946 	GFXDECODE_ENTRY( nullptr, 0x6000, spritelayout,     0, 4 )  /* sprites */
947 	GFXDECODE_ENTRY( nullptr, 0xd000, tilelayout,       0, 8 )  /* background tiles */
948 	GFXDECODE_ENTRY( nullptr, 0xd800, objlayout,        0, 64 )  /* object */
949 GFXDECODE_END
950 
decocass_palette(palette_device & palette) const951 void decocass_state::decocass_palette(palette_device &palette) const
952 {
953 	// set up 32 colors 1:1 pens and flipped colors for background tiles (D7 of color_center_bot)
954 	for (int i = 0; i < 32; i++)
955 	{
956 		palette.set_pen_indirect(i, i);
957 		palette.set_pen_indirect(32 + i, bitswap<8>(i, 7, 6, 5, 4, 3, 1, 2, 0));
958 	}
959 }
960 
961 
decocass(machine_config & config)962 void decocass_state::decocass(machine_config &config)
963 {
964 	/* basic machine hardware */
965 	DECO_222(config, m_maincpu, HCLK4); /* the earlier revision board doesn't have the 222 but must have the same thing implemented in logic for the M6502 */
966 	m_maincpu->set_addrmap(AS_PROGRAM, &decocass_state::decocass_map);
967 
968 	M6502(config, m_audiocpu, HCLK1/3/2);
969 	m_audiocpu->set_addrmap(AS_PROGRAM, &decocass_state::decocass_sound_map);
970 	TIMER(config, "audionmi").configure_scanline(FUNC(decocass_state::decocass_audio_nmi_gen), "screen", 0, 8);
971 
972 	I8041A(config, m_mcu, HCLK);
973 	m_mcu->p1_in_cb().set(FUNC(decocass_state::i8041_p1_r));
974 	m_mcu->p1_out_cb().set(FUNC(decocass_state::i8041_p1_w));
975 	m_mcu->p2_in_cb().set(FUNC(decocass_state::i8041_p2_r));
976 	m_mcu->p2_out_cb().set(FUNC(decocass_state::i8041_p2_w));
977 
978 	config.set_maximum_quantum(attotime::from_hz(4200));              /* interleave CPUs */
979 
980 	WATCHDOG_TIMER(config, m_watchdog);
981 
982 	DECOCASS_TAPE(config, m_cassette, 0);
983 
984 	/* video hardware */
985 	SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
986 	m_screen->set_raw(HCLK, 384, 0*8, 256, 272, 1*8, 248);
987 	m_screen->set_screen_update(FUNC(decocass_state::screen_update_decocass));
988 	m_screen->set_palette(m_palette);
989 
990 	GFXDECODE(config, m_gfxdecode, m_palette, gfx_decocass);
991 	PALETTE(config, m_palette, FUNC(decocass_state::decocass_palette), 64, 32);
992 
993 	/* sound hardware */
994 	SPEAKER(config, "mono").front_center();
995 
996 	GENERIC_LATCH_8(config, m_soundlatch);
997 	GENERIC_LATCH_8(config, m_soundlatch2);
998 
999 	AY8910(config, "ay1", HCLK2).add_route(ALL_OUTPUTS, "mono", 0.40);
1000 
1001 	AY8910(config, "ay2", HCLK2).add_route(ALL_OUTPUTS, "mono", 0.40);
1002 }
1003 
1004 
ctsttape(machine_config & config)1005 void decocass_type1_state::ctsttape(machine_config &config)
1006 {
1007 	decocass(config);
1008 
1009 	/* basic machine hardware */
1010 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,ctsttape)
1011 }
1012 
cprogolfj(machine_config & config)1013 void decocass_type1_state::cprogolfj(machine_config &config)
1014 {
1015 	decocass(config);
1016 
1017 	/* basic machine hardware */
1018 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,cprogolfj)
1019 }
1020 
cdsteljn(machine_config & config)1021 void decocass_type1_state::cdsteljn(machine_config &config)
1022 {
1023 	decocass(config);
1024 
1025 	/* basic machine hardware */
1026 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,cdsteljn)
1027 }
1028 
cmanhat(machine_config & config)1029 void decocass_type1_state::cmanhat(machine_config &config)
1030 {
1031 	decocass(config);
1032 
1033 	/* basic machine hardware */
1034 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,cmanhat)
1035 }
1036 
cfishing(machine_config & config)1037 void decocass_type3_state::cfishing(machine_config &config)
1038 {
1039 	decocass(config);
1040 
1041 	/* basic machine hardware */
1042 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,cfishing)
1043 }
1044 
1045 
chwy(machine_config & config)1046 void decocass_type1_state::chwy(machine_config &config)
1047 {
1048 	decocass(config);
1049 
1050 	/* basic machine hardware */
1051 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,chwy)
1052 }
1053 
1054 
cterrani(machine_config & config)1055 void decocass_type1_state::cterrani(machine_config &config)
1056 {
1057 	decocass(config);
1058 
1059 	/* basic machine hardware */
1060 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,cterrani)
1061 }
1062 
1063 
castfant(machine_config & config)1064 void decocass_type1_state::castfant(machine_config &config)
1065 {
1066 	decocass(config);
1067 
1068 	/* basic machine hardware */
1069 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,castfant)
1070 }
1071 
1072 
csuperas(machine_config & config)1073 void decocass_type1_state::csuperas(machine_config &config)
1074 {
1075 	decocass(config);
1076 
1077 	/* basic machine hardware */
1078 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,csuperas)
1079 }
1080 
1081 
cocean1a(machine_config & config)1082 void decocass_type1_state::cocean1a(machine_config &config) /* 10 */
1083 {
1084 	decocass(config);
1085 
1086 	/* basic machine hardware */
1087 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,cocean1a)
1088 }
1089 
1090 
clocknch(machine_config & config)1091 void decocass_type1_state::clocknch(machine_config &config)
1092 {
1093 	decocass(config);
1094 
1095 	/* basic machine hardware */
1096 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,clocknch)
1097 }
1098 
clocknchj(machine_config & config)1099 void decocass_type1_state::clocknchj(machine_config &config)
1100 {
1101 	decocass(config);
1102 
1103 	/* basic machine hardware */
1104 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,clocknchj)
1105 }
1106 
cfboy0a1(machine_config & config)1107 void decocass_type1_state::cfboy0a1(machine_config &config) /* 12 */
1108 {
1109 	decocass(config);
1110 
1111 	/* basic machine hardware */
1112 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,cfboy0a1)
1113 }
1114 
1115 
cprogolf(machine_config & config)1116 void decocass_type1_state::cprogolf(machine_config &config)
1117 {
1118 	decocass(config);
1119 
1120 	/* basic machine hardware */
1121 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,cprogolf)
1122 }
1123 
1124 
cluckypo(machine_config & config)1125 void decocass_type1_state::cluckypo(machine_config &config)
1126 {
1127 	decocass(config);
1128 
1129 	/* basic machine hardware */
1130 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,cluckypo)
1131 }
1132 
1133 
ctisland(machine_config & config)1134 void decocass_type1_state::ctisland(machine_config &config)
1135 {
1136 	decocass(config);
1137 
1138 	/* basic machine hardware */
1139 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,ctisland)
1140 }
1141 
ctisland3(machine_config & config)1142 void decocass_type1_state::ctisland3(machine_config &config)
1143 {
1144 	decocass(config);
1145 
1146 	/* basic machine hardware */
1147 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,ctisland3)
1148 }
1149 
cexplore(machine_config & config)1150 void decocass_type1_state::cexplore(machine_config &config)
1151 {
1152 	decocass(config);
1153 
1154 	/* basic machine hardware */
1155 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type1_state,cexplore)
1156 }
1157 
1158 
1159 
1160 
cbtime(machine_config & config)1161 void decocass_type3_state::cbtime(machine_config &config)
1162 {
1163 	decocass(config);
1164 
1165 	/* basic machine hardware */
1166 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,cbtime)
1167 }
1168 
1169 
cburnrub(machine_config & config)1170 void decocass_type3_state::cburnrub(machine_config &config)
1171 {
1172 	decocass(config);
1173 
1174 	/* basic machine hardware */
1175 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,cburnrub)
1176 }
1177 
1178 
cgraplop(machine_config & config)1179 void decocass_type3_state::cgraplop(machine_config &config)
1180 {
1181 	decocass(config);
1182 
1183 	/* basic machine hardware */
1184 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,cgraplop)
1185 }
1186 
1187 
cgraplop2(machine_config & config)1188 void decocass_type3_state::cgraplop2(machine_config &config)
1189 {
1190 	decocass(config);
1191 
1192 	/* basic machine hardware */
1193 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,cgraplop2)
1194 }
1195 
1196 
clapapa(machine_config & config)1197 void decocass_type3_state::clapapa(machine_config &config)
1198 {
1199 	decocass(config);
1200 
1201 	/* basic machine hardware */
1202 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,clapapa)
1203 }
1204 
1205 
cskater(machine_config & config)1206 void decocass_type3_state::cskater(machine_config &config)
1207 {
1208 	decocass(config);
1209 
1210 	/* basic machine hardware */
1211 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,cskater)
1212 }
1213 
1214 
cprobowl(machine_config & config)1215 void decocass_type3_state::cprobowl(machine_config &config)
1216 {
1217 	decocass(config);
1218 
1219 	/* basic machine hardware */
1220 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,cprobowl)
1221 }
1222 
1223 
cnightst(machine_config & config)1224 void decocass_type3_state::cnightst(machine_config &config)
1225 {
1226 	decocass(config);
1227 
1228 	/* basic machine hardware */
1229 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,cnightst)
1230 }
1231 
1232 
cpsoccer(machine_config & config)1233 void decocass_type3_state::cpsoccer(machine_config &config)
1234 {
1235 	decocass(config);
1236 
1237 	/* basic machine hardware */
1238 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,cpsoccer)
1239 }
1240 
1241 
csdtenis(machine_config & config)1242 void decocass_type3_state::csdtenis(machine_config &config)
1243 {
1244 	decocass(config);
1245 
1246 	/* basic machine hardware */
1247 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,csdtenis)
1248 }
1249 
1250 
czeroize(machine_config & config)1251 void decocass_type3_state::czeroize(machine_config &config)
1252 {
1253 	decocass(config);
1254 
1255 	/* basic machine hardware */
1256 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,czeroize)
1257 }
1258 
1259 
cppicf(machine_config & config)1260 void decocass_type3_state::cppicf(machine_config &config)
1261 {
1262 	decocass(config);
1263 
1264 	/* basic machine hardware */
1265 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,cppicf)
1266 }
1267 
1268 
cfghtice(machine_config & config)1269 void decocass_type3_state::cfghtice(machine_config &config)
1270 {
1271 	decocass(config);
1272 
1273 	/* basic machine hardware */
1274 	MCFG_MACHINE_RESET_OVERRIDE(decocass_type3_state,cfghtice)
1275 }
1276 
1277 
1278 
1279 #define ROM_LOAD_BIOS(bios,name,offset,length,hash) \
1280 	ROMX_LOAD(name, offset, length, hash, ROM_BIOS(bios))
1281 
1282 
1283 /************ Version A bios roms *************/
1284 
1285 /* v0a.7e, New boardset bios, country code A */
1286 #define DECOCASS_BIOS_A_MAINCPU \
1287 	ROM_SYSTEM_BIOS( 0, "a",   "Bios A (Japan)" ) \
1288 	ROM_LOAD_BIOS( 0, "v0a-.7e",    0xf000, 0x1000, CRC(3d33ac34) SHA1(909d59e7a993affd10224402b4370e82a5f5545c) ) /* from RMS-8 board: 2732 EPROM @7E w/'V0A-' label (has HDRA01HDR string inside it), bios code */
1289 #define DECOCASS_BIOS_A_AUDIOCPU \
1290 	ROM_LOAD_BIOS( 0, "v1-.5a",     0xf800, 0x0800, CRC(b66b2c2a) SHA1(0097f38beb4872e735e560148052e258a26b08fd) ) /* from RMS-8 board: 2716 eprom @5A w/V1- label,  contains audio cpu code */
1291 #define DECOCASS_BIOS_A_PROMS \
1292 	ROM_LOAD_BIOS( 0, "v2.3m",      0x0000, 0x0020, CRC(238fdb40) SHA1(b88e8fabb82092105c3828154608ea067acbf2e5) ) /* from DSP-8 board: M3-7603-5 (82s123 equiv, 32x8 TS) PROM @3M w/'V2' stamp, unknown purpose (gfx related: row/interrupt/vblank related? vertical counter related) */ \
1293 	ROM_LOAD_BIOS( 0, "v4.10d",     0x0020, 0x0020, CRC(3b5836b4) SHA1(b630bb277d9ec09d46ef26b944014dd6165b35d8) ) /* from DSP-8 board: M3-7603-5 (82s123 equiv, 32x8 TS) PROM @10D w/'V4' stamp, unknown purpose (gfx related: tile banking? horizontal counter related) */ \
1294 	ROM_LOAD_BIOS( 0, "v3.3j",      0x0040, 0x0020, CRC(51eef657) SHA1(eaedce5caf55624ad6ae706aedf82c5717c60f1f) ) /* from RMS-8 board: M3-7603-5 (82s123 equiv, 32x8 TS) PROM @3J w/'V3' stamp, handles DRAM banking and timing */
1295 
1296 /* Old boardset bios, country code A (for Japan), 2x 2716 EPROM, MD labbeled as RMS-3D and MT as RMS-3T, region code (letter) is (not always) inserted after "-" */ \
1297 #define DECOCASS_BIOS_A0_MAINCPU \
1298 	ROM_SYSTEM_BIOS( 1, "a0",   "Bios A (Japan, older)" ) \
1299 	ROM_LOAD_BIOS( 1, "dsp-3_p0-a.m9",      0xf000, 0x0800, CRC(2541e34b) SHA1(4f983513dbae1350c83a433dea77a4465748b9c6) ) \
1300 	ROM_LOAD_BIOS( 1, "dsp-3_p1-.l9",       0xf800, 0x0800, CRC(3bfff5f3) SHA1(4e9437cb1b76d64da6b37f01bd6e879fb399e8ce) )
1301 #define DECOCASS_BIOS_A0_AUDIOCPU \
1302 	ROM_LOAD_BIOS( 1, "rms-3_p2-.c9",       0xfc00, 0x0400, CRC(6c4a891f) SHA1(5c00cf8b1accfdbb1d61e9b3f6db1594dfbc608b) ) /* 2708 EPROM, contains audio cpu code */
1303 #define DECOCASS_BIOS_A0_PROMS \
1304 	ROM_LOAD_BIOS( 1, "dsp-3_p3-.e5",       0x0000, 0x0020, CRC(539a5a64) SHA1(7b7d3cc58ac6f95242240c97046e770d2fd20c96) ) /* M3-7603-5 (82s123 equiv, 32x8 TS) PROM, unknown purpose (gfx related: row/interrupt/vblank related? vertical counter related) */ \
1305 	ROM_LOAD_BIOS( 1, "rms-3_p4-.f6",       0x0020, 0x0020, CRC(9014c0fd) SHA1(7405d39a5f4fcad821448ddaf6bd4e27c0c9e145) ) /* M3-7603-5 (82s123 equiv, 32x8 TS) PROM, unknown purpose (gfx related: tile banking? horizontal counter related) */ \
1306 	ROM_LOAD_BIOS( 1, "dsp-3_p5-.m4",       0x0040, 0x0020, CRC(e52089a0) SHA1(d85c17809b089c6977ee9571f976af6f107fd4d3) ) /* M3-7603-5 (82s123 equiv, 32x8 TS) PROM, handles DRAM banking and timing */ \
1307 
1308 /************ Version B bios roms *************/
1309 
1310 /* rms8.7e, New boardset bios, country code B */ \
1311 #define DECOCASS_BIOS_B_MAINCPU \
1312 	ROM_SYSTEM_BIOS( 2, "b",   "Bios B (USA)" ) \
1313 	ROM_LOAD_BIOS( 2, "v0b-.7e",    0xf000, 0x1000, CRC(23d929b7) SHA1(063f83020ba3d6f43ab8471f95ca919767b93aa4) ) /* from RMS-8 board: 2732 EPROM @7E w/'V0B-' label (has HDRB01HDR string inside it), bios code */
1314 #define DECOCASS_BIOS_B_AUDIOCPU \
1315 	ROM_LOAD_BIOS( 2, "v1-.5a",     0xf800, 0x0800, CRC(b66b2c2a) SHA1(0097f38beb4872e735e560148052e258a26b08fd) ) /* from RMS-8 board: 2716 eprom @5A w/V1- label,  contains audio cpu code */
1316 #define DECOCASS_BIOS_B_PROMS \
1317 	ROM_LOAD_BIOS( 2, "v2.3m",      0x0000, 0x0020, CRC(238fdb40) SHA1(b88e8fabb82092105c3828154608ea067acbf2e5) ) /* from DSP-8 board: M3-7603-5 (82s123 equiv, 32x8 TS) PROM @3M w/'V2' stamp, unknown purpose (gfx related: row/interrupt/vblank related? vertical counter related) */ \
1318 	ROM_LOAD_BIOS( 2, "v4.10d",     0x0020, 0x0020, CRC(3b5836b4) SHA1(b630bb277d9ec09d46ef26b944014dd6165b35d8) ) /* from DSP-8 board: M3-7603-5 (82s123 equiv, 32x8 TS) PROM @10D w/'V4' stamp, unknown purpose (gfx related: tile banking? horizontal counter related) */ \
1319 	ROM_LOAD_BIOS( 2, "v3.3j",      0x0040, 0x0020, CRC(51eef657) SHA1(eaedce5caf55624ad6ae706aedf82c5717c60f1f) ) /* from RMS-8 board: M3-7603-5 (82s123 equiv, 32x8 TS) PROM @3J w/'V3' stamp, handles DRAM banking and timing */
1320 
1321 /* Old boardset bios, version B for USA, 2x 2716 EPROM, MD labbeled as RMS-3D and MT as RMS-3T, region code (letter) is (not always) inserted after "-" */ \
1322 /* dsp3.p0b/p1b, Old boardset bios, country code B?; from DSP-3 board? has HDRB01x string in it, 2x 2716 EPROM? */ \
1323 #define DECOCASS_BIOS_B0_MAINCPU \
1324 	ROM_SYSTEM_BIOS( 3, "b0",   "Bios B (USA, older)" ) \
1325 	ROM_LOAD_BIOS( 3, "dsp-3_p0-b.m9",      0xf000, 0x0800, CRC(b67a91d9) SHA1(681c040be0f0ed1ba0a50161b36d0ad8e1c8c5cb) ) \
1326 	ROM_LOAD_BIOS( 3, "dsp-3_p1-.l9",       0xf800, 0x0800, CRC(3bfff5f3) SHA1(4e9437cb1b76d64da6b37f01bd6e879fb399e8ce) )
1327 #define DECOCASS_BIOS_B0_AUDIOCPU \
1328 	ROM_LOAD_BIOS( 3, "rms-3_p2-.c9",       0xfc00, 0x0400, CRC(6c4a891f) SHA1(5c00cf8b1accfdbb1d61e9b3f6db1594dfbc608b) ) /* 2708 EPROM, contains audio cpu code */
1329 #define DECOCASS_BIOS_B0_PROMS \
1330 	ROM_LOAD_BIOS( 3, "dsp-3_p3-.e5",       0x0000, 0x0020, CRC(539a5a64) SHA1(7b7d3cc58ac6f95242240c97046e770d2fd20c96) ) /* M3-7603-5 (82s123 equiv, 32x8 TS) PROM, unknown purpose (gfx related: row/interrupt/vblank related? vertical counter related) */ \
1331 	ROM_LOAD_BIOS( 3, "rms-3_p4-.f6",       0x0020, 0x0020, CRC(9014c0fd) SHA1(7405d39a5f4fcad821448ddaf6bd4e27c0c9e145) ) /* M3-7603-5 (82s123 equiv, 32x8 TS) PROM, unknown purpose (gfx related: tile banking? horizontal counter related) */ \
1332 	ROM_LOAD_BIOS( 3, "dsp-3_p5-.m4",       0x0040, 0x0020, CRC(e52089a0) SHA1(d85c17809b089c6977ee9571f976af6f107fd4d3) ) /* M3-7603-5 (82s123 equiv, 32x8 TS) PROM, handles DRAM banking and timing */ \
1333 
1334 /* rms8.7e, New boardset bios, country code D */ \
1335 #define DECOCASS_BIOS_D_MAINCPU \
1336 	ROM_SYSTEM_BIOS( 4, "d",   "Bios D (unknown region)" ) \
1337 	ROM_LOAD_BIOS( 4, "v0d-.7e",    0xf000, 0x1000, CRC(1e0c22b1) SHA1(5fec8fef500bbebc13d0173406afc55235d3affb) ) /* handcrafted (single byte changed) because ctisland3 requires region D */
1338 #define DECOCASS_BIOS_D_AUDIOCPU \
1339 	ROM_LOAD_BIOS( 4, "v1-.5a",     0xf800, 0x0800, CRC(b66b2c2a) SHA1(0097f38beb4872e735e560148052e258a26b08fd) ) /* from RMS-8 board: 2716 eprom @5A w/V1- label,  contains audio cpu code */
1340 #define DECOCASS_BIOS_D_PROMS \
1341 	ROM_LOAD_BIOS( 4, "v2.3m",      0x0000, 0x0020, CRC(238fdb40) SHA1(b88e8fabb82092105c3828154608ea067acbf2e5) ) /* from DSP-8 board: M3-7603-5 (82s123 equiv, 32x8 TS) PROM @3M w/'V2' stamp, unknown purpose (gfx related: row/interrupt/vblank related? vertical counter related) */ \
1342 	ROM_LOAD_BIOS( 4, "v4.10d",     0x0020, 0x0020, CRC(3b5836b4) SHA1(b630bb277d9ec09d46ef26b944014dd6165b35d8) ) /* from DSP-8 board: M3-7603-5 (82s123 equiv, 32x8 TS) PROM @10D w/'V4' stamp, unknown purpose (gfx related: tile banking? horizontal counter related) */ \
1343 	ROM_LOAD_BIOS( 4, "v3.3j",      0x0040, 0x0020, CRC(51eef657) SHA1(eaedce5caf55624ad6ae706aedf82c5717c60f1f) ) /* from RMS-8 board: M3-7603-5 (82s123 equiv, 32x8 TS) PROM @3J w/'V3' stamp, handles DRAM banking and timing */
1344 
1345 
1346 
1347 /************ Common MCU bios rom *************/
1348 
1349 #define DECOCASS_BIOS_MCU \
1350 	ROM_LOAD( "cassmcu.1c", 0x0000, 0x0400, CRC(a6df18fd) SHA1(1f9ea47e372d31767c936c15852b43df2b0ee8ff) ) /* from B10-B board: "NEC // JAPAN // X1202D-108 // D8041C 535" 8041 MCU @1C, handles cassette and other stuff; This info needs additional verification, as the d8041-535 mcu has not been dumped yet to prove code is the same. */
1351 
1352 
1353 
1354 #define DECOCASS_BIOS_MAIN \
1355 	ROM_REGION( 0x10000, "maincpu", 0 ) \
1356 	DECOCASS_BIOS_A_MAINCPU \
1357 	DECOCASS_BIOS_A0_MAINCPU \
1358 	DECOCASS_BIOS_B_MAINCPU \
1359 	DECOCASS_BIOS_B0_MAINCPU \
1360 	DECOCASS_BIOS_D_MAINCPU \
1361 	ROM_REGION( 0x10000, "audiocpu", 0 ) \
1362 	DECOCASS_BIOS_A_AUDIOCPU \
1363 	DECOCASS_BIOS_A0_AUDIOCPU \
1364 	DECOCASS_BIOS_B_AUDIOCPU \
1365 	DECOCASS_BIOS_B0_AUDIOCPU \
1366 	DECOCASS_BIOS_D_AUDIOCPU \
1367 	ROM_REGION( 0x00060, "proms", 0 ) \
1368 	DECOCASS_BIOS_A_PROMS \
1369 	DECOCASS_BIOS_A0_PROMS \
1370 	DECOCASS_BIOS_B_PROMS \
1371 	DECOCASS_BIOS_B0_PROMS \
1372 	DECOCASS_BIOS_D_PROMS \
1373 	ROM_REGION( 0x10000, "mcu", 0 )   /* 4k for the 8041 MCU (actually 1K ROM + 64 bytes RAM @ 0x800) */ \
1374 	DECOCASS_BIOS_MCU
1375 
1376 
1377 #define DECOCASS_BIOS_B_ROMS \
1378 	DECOCASS_BIOS_MAIN \
1379 	ROM_DEFAULT_BIOS( "b" )
1380 
1381 #define DECOCASS_BIOS_BO_ROMS   \
1382 	DECOCASS_BIOS_MAIN \
1383 	ROM_DEFAULT_BIOS( "b0" )
1384 
1385 #define DECOCASS_BIOS_A_ROMS \
1386 	DECOCASS_BIOS_MAIN \
1387 	ROM_DEFAULT_BIOS( "a" )
1388 
1389 #define DECOCASS_BIOS_AO_ROMS   \
1390 	DECOCASS_BIOS_MAIN \
1391 	ROM_DEFAULT_BIOS( "a0" )
1392 
1393 #define DECOCASS_BIOS_D_ROMS \
1394 	DECOCASS_BIOS_MAIN \
1395 	ROM_DEFAULT_BIOS( "d" )
1396 
ROM_START(decocass)1397 ROM_START( decocass )
1398 	DECOCASS_BIOS_MAIN
1399 ROM_END
1400 
1401 /* The Following use Dongle Type 1 (DE-0061)
1402     (dongle data same for each game)         */
1403 
1404 ROM_START( ctsttape )
1405 	DECOCASS_BIOS_B_ROMS
1406 
1407 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1408 	ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
1409 
1410 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1411 	ROM_LOAD( "testtape.cas", 0x0000, 0x2000, CRC(4f9d8efb) SHA1(5b77747dad1033e5703f06c0870441b54b4256c5) )
1412 ROM_END
1413 
1414 /* 01 Highway Chase */
1415 ROM_START( chwy )
1416 	DECOCASS_BIOS_B_ROMS
1417 
1418 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1419 	/* The dongle data is reverse engineered from manual decryption */
1420 	ROM_LOAD( "chwy.pro",   0x0000, 0x0020, BAD_DUMP CRC(2fae678e) SHA1(4a7de851442d4c1d690de03262f0e136a52fca35) )
1421 
1422 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1423 	ROM_LOAD( "chwy.cas",   0x0000, 0x8000, CRC(68a48064) SHA1(7e389737972fd0c54f398d296159c561f5ec3a93) )
1424 ROM_END
1425 
1426 /* 03 Manhatten */
1427 ROM_START( cmanhat )
1428 	DECOCASS_BIOS_A_ROMS
1429 
1430 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1431 	ROM_LOAD( "manhattan.pro",   0x0000, 0x0020, CRC(1bc9fccb) SHA1(ffc59c7660d5c87a8deca294f80260b6bc7c3027) ) // == a-0061.dgl
1432 
1433 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1434 	ROM_LOAD( "manhattan.cas", 0x000000, 0x006000, CRC(92dae2b1) SHA1(cc048ac6601553675078230290beb3d59775bfe0) )
1435 ROM_END
1436 
1437 /* 04 Terranean */
1438 ROM_START( cterrani )
1439 	DECOCASS_BIOS_B_ROMS
1440 
1441 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1442 	ROM_LOAD( "dp-1040.dgl", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
1443 
1444 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1445 	ROM_LOAD( "dt-1040.cas", 0x0000, 0x8000, CRC(eb71adbc) SHA1(67becfde39c034d4b8edc2eb100050de102773da) )
1446 ROM_END
1447 
1448 /* 07 Astro Fantasia */
1449 ROM_START( castfant )
1450 	DECOCASS_BIOS_B_ROMS
1451 
1452 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1453 	ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
1454 
1455 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1456 	ROM_LOAD( "castfant.cas", 0x0000, 0x8000, CRC(6d77d1b5) SHA1(821bd65fbe887cbeac9281a2ad3f88595918f886) )
1457 ROM_END
1458 
1459 /* 09 Super Astro Fighter */
1460 ROM_START( csuperas )
1461 	DECOCASS_BIOS_B_ROMS
1462 
1463 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1464 	ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
1465 
1466 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1467 	ROM_LOAD( "csuperas.cas", 0x0000, 0x8000, CRC(fabcd07f) SHA1(4070c668ad6725f0710cf7fe6df0d5f80272a449) )
1468 ROM_END
1469 
1470 /* 10 Ocean to Ocean (World) */
1471 ROM_START( cocean1a ) // version MD 1-A-0 verified, 061 blocks, decrypted main data CRC(b97ab3cb)
1472 	DECOCASS_BIOS_AO_ROMS
1473 
1474 	ROM_REGION( 0x10000, "cassette", 0 )  /* (max) 64k for cassette image */
1475 	ROM_LOAD( "dt-1101-a-0.cas", 0x0000, 0x3e00, CRC(db8ab848) SHA1(2b2acb249bf66e6c5e15d89b7ebd294ed2eee066) )
1476 
1477 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1478 	ROM_LOAD( "dp-1100-a.rom",   0x0000, 0x0020, CRC(1bc9fccb) SHA1(ffc59c7660d5c87a8deca294f80260b6bc7c3027) )
1479 ROM_END
1480 
1481 ROM_START( cocean6b ) // version MD 10-B-0 not verified, 068 blocks, decrypted main data CRC(410d1f19)
1482 	DECOCASS_BIOS_BO_ROMS
1483 
1484 	ROM_REGION( 0x10000, "cassette", 0 )  /* (max) 64k for cassette image */
1485 	ROM_LOAD( "dt-1106-b-0.cas", 0x0000, 0x4500, CRC(fa6ffc95) SHA1(95f881503aa8cd97d04b327abeb68891d053563f) )
1486 
1487 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1488 	ROM_LOAD( "dp-1100-b.rom",   0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
1489 ROM_END
1490 
1491 /* 11 Lock'n'Chase */
1492 ROM_START( clocknch )
1493 	DECOCASS_BIOS_B_ROMS
1494 
1495 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1496 	ROM_LOAD( "dp-1110_b.dgl", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
1497 
1498 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1499 	ROM_LOAD( "clocknch.cas",  0x0000, 0x8000, CRC(c9d163a4) SHA1(3ef55a8d8f603059e263776c08eb81f2cf18b75c) )
1500 ROM_END
1501 
1502 ROM_START( clocknchj )
1503 	DECOCASS_BIOS_A_ROMS
1504 
1505 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1506 	ROM_LOAD( "a-0061.dgl",   0x0000, 0x0020, CRC(1bc9fccb) SHA1(ffc59c7660d5c87a8deca294f80260b6bc7c3027) ) /* ? */
1507 
1508 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1509 	ROM_LOAD( "dt-1111-a-0.bin",  0x0000, 0x6300, CRC(9753e815) SHA1(fd0c8e4733e1548fe47a4d34a2f6ce48d9303e22) )
1510 ROM_END
1511 
1512 /* 12 Flash Boy (early vertical Japan version, then horizontal version), The Deco Kid (early vertical World version, then vertical version) */
1513 ROM_START( cfboy0a1 ) // version MD 0-A-1 verified, 105 blocks, decrypted main data CRC(7ca358f0)
1514 	DECOCASS_BIOS_AO_ROMS
1515 
1516 	ROM_REGION( 0x10000, "cassette", 0 )  /* (max) 64k for cassette image */
1517 	ROM_LOAD( "dt-1120-a-1.cas", 0x0000, 0x6a00, CRC(c6746dc0) SHA1(816ccb61dfa2745a9ef918d9a50d1cd91493c9ed) )
1518 
1519 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1520 	ROM_LOAD( "dp-1120-a.rom",   0x0000, 0x0020, CRC(1bc9fccb) SHA1(ffc59c7660d5c87a8deca294f80260b6bc7c3027) )
1521 ROM_END
1522 
1523 /* 13 */
1524 /* Photo of Dongle shows DP-1130B (the "B" is in a separate white box then the DP-1130 label) */
1525 ROM_START( cprogolf ) // version 9-B-0
1526 	DECOCASS_BIOS_B_ROMS
1527 
1528 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1529 	ROM_LOAD( "dp-1130_b.dgl", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
1530 
1531 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1532 	ROM_LOAD( "dt-1130_9b.cas",  0x0000, 0x8000, CRC(02123cd1) SHA1(e4c630ed293725f23d539cb43beb97953558dabd) )
1533 ROM_END
1534 
1535 ROM_START( cprogolfj ) // version 1-A
1536 	DECOCASS_BIOS_A_ROMS
1537 
1538 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1539 	ROM_LOAD( "a-0061.dgl",   0x0000, 0x0020, CRC(1bc9fccb) SHA1(ffc59c7660d5c87a8deca294f80260b6bc7c3027) ) /* Should be dp-1130a?? */
1540 
1541 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1542 	ROM_LOAD( "dt-113_a.cas",   0x0000, 0x8000, CRC(8408248f) SHA1(8b78c379bf6879916bc9b284d7a0956edfac78be) )
1543 ROM_END
1544 
1545 // version number is DT-1134-A-0 (Japanese, version 4 of Pro Golf, no revision number)
1546 ROM_START( cprogolf18 )
1547 	DECOCASS_BIOS_A_ROMS
1548 
1549 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1550 	ROM_LOAD( "de-0061-a-0.rom",   0x0000, 0x0020, CRC(1bc9fccb) SHA1(ffc59c7660d5c87a8deca294f80260b6bc7c3027) )
1551 
1552 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1553 	ROM_LOAD( "progolf18.cas",   0x0000, 0x6700, CRC(3024396c) SHA1(c49d878bae46bf8bf0b0b098a5d94d9ec68b526d) )
1554 ROM_END
1555 
1556 /* 14 */
1557 ROM_START( cdsteljn ) // version 4-A-3
1558 	DECOCASS_BIOS_A_ROMS
1559 
1560 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1561 	ROM_LOAD( "a-0061.dgl",   0x0000, 0x0020, CRC(1bc9fccb) SHA1(ffc59c7660d5c87a8deca294f80260b6bc7c3027) ) /* Should be dp-1144a?? */
1562 
1563 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1564 	ROM_LOAD( "dt-1144-a3.cas", 0x000000, 0x007300, CRC(1336a912) SHA1(0c64e069713b411da38b43f14306953621726d35) )
1565 ROM_END
1566 
1567 /* 15 Lucky Poker */
1568 /* Photo of Dongle shows DP-1150B (the "B" is in a separate white box then the DP-1150 label) */
1569 ROM_START( cluckypo )
1570 	DECOCASS_BIOS_B_ROMS
1571 
1572 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1573 	ROM_LOAD( "dp-1150_b.dgl", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
1574 
1575 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1576 	ROM_LOAD( "cluckypo.cas",  0x0000, 0x8000, CRC(2070c243) SHA1(cd3af309af8eb27937756c1fe6fd0504be5aaaf5) )
1577 ROM_END
1578 
1579 /* 16 Treasure Island */
1580 ROM_START( ctisland )
1581 	DECOCASS_BIOS_B_ROMS
1582 
1583 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1584 	ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
1585 
1586 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1587 	ROM_LOAD( "ctisland.cas", 0x0000, 0x8000, CRC(3f63b8f8) SHA1(2fd0679ef9750a228ebb098672ab6091fda75804) )
1588 
1589 	ROM_REGION( 0xa000, "user3", ROMREGION_ERASEFF )      /* roms from the overlay pcb */
1590 	ROM_LOAD( "deco-ti.x1",   0x0000, 0x1000, CRC(a7f8aeba) SHA1(0c9ba1a46d0636b36f40fad31638db89f374f778) )
1591 	ROM_LOAD( "deco-ti.x2",   0x1000, 0x1000, CRC(2a0d3c91) SHA1(552d08fcddddbea5b52fa1e8decd188ae49c86ea) )
1592 	ROM_LOAD( "deco-ti.x3",   0x2000, 0x1000, CRC(3a26b97c) SHA1(f57e76077806e149a9e455c85e5431eac2d42bc3) )
1593 	ROM_LOAD( "deco-ti.x4",   0x3000, 0x1000, CRC(1cbe43de) SHA1(8f26ad224e96c87da810c60d3dd88d415400b9fc) )
1594 ROM_END
1595 
1596 ROM_START( ctisland2 )
1597 	DECOCASS_BIOS_B_ROMS
1598 
1599 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1600 	ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
1601 
1602 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1603 	ROM_LOAD( "ctislnd2.cas", 0x0000, 0x8000, CRC(2854b4c0) SHA1(d3b4e0031dbb2340fbbe396a1ff9b8fbfd63663e) )
1604 
1605 	ROM_REGION( 0xa000, "user3", ROMREGION_ERASEFF )      /* roms from the overlay pcb */
1606 	ROM_LOAD( "deco-ti.x1",   0x0000, 0x1000, CRC(a7f8aeba) SHA1(0c9ba1a46d0636b36f40fad31638db89f374f778) )
1607 	ROM_LOAD( "deco-ti.x2",   0x1000, 0x1000, CRC(2a0d3c91) SHA1(552d08fcddddbea5b52fa1e8decd188ae49c86ea) )
1608 	ROM_LOAD( "deco-ti.x3",   0x2000, 0x1000, CRC(3a26b97c) SHA1(f57e76077806e149a9e455c85e5431eac2d42bc3) )
1609 	ROM_LOAD( "deco-ti.x4",   0x3000, 0x1000, CRC(1cbe43de) SHA1(8f26ad224e96c87da810c60d3dd88d415400b9fc) )
1610 ROM_END
1611 
1612 ROM_START( ctisland3 )
1613 	DECOCASS_BIOS_D_ROMS
1614 
1615 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1616 	ROM_LOAD( "ctisland3.pro", 0x0000, 0x0020, CRC(b87b56a7) SHA1(ca84cd61e53985cf24230d297967374ae3822b3b) ) // handcrafted
1617 
1618 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1619 	ROM_LOAD( "ctislnd3.cas", 0x0000, 0x8000, CRC(45464e1e) SHA1(03275694d963c7ab0e0f5525e248e69da5f9b591) )
1620 
1621 	ROM_REGION( 0xa000, "user3", ROMREGION_ERASEFF )      /* roms from the overlay pcb */
1622 	ROM_LOAD( "deco-ti.x1",   0x0000, 0x1000, CRC(a7f8aeba) SHA1(0c9ba1a46d0636b36f40fad31638db89f374f778) )
1623 	ROM_LOAD( "deco-ti.x2",   0x1000, 0x1000, CRC(2a0d3c91) SHA1(552d08fcddddbea5b52fa1e8decd188ae49c86ea) )
1624 	ROM_LOAD( "deco-ti.x3",   0x2000, 0x1000, CRC(3a26b97c) SHA1(f57e76077806e149a9e455c85e5431eac2d42bc3) )
1625 	ROM_LOAD( "deco-ti.x4",   0x3000, 0x1000, CRC(1cbe43de) SHA1(8f26ad224e96c87da810c60d3dd88d415400b9fc) )
1626 ROM_END
1627 
1628 /* 18 Explorer */
1629 /* Photo of Dongle shows DP-1180B (the "B" is in a separate white box then the DP-1180 label) */
1630 ROM_START( cexplore )
1631 	DECOCASS_BIOS_B_ROMS
1632 
1633 	ROM_REGION( 0x00020, "dongle", 0 )    /* dongle data */
1634 	/* The dongle data is reverse engineered by table analysis */
1635 	ROM_LOAD( "dp-1180_b.dgl", 0x0000, 0x0020, BAD_DUMP CRC(c7a9ac8f) SHA1(b0a566d948f71a4eddcde0dd5e9e69ca96f71c36) )
1636 
1637 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1638 	ROM_LOAD( "cexplore.cas", 0x0000, 0x8000, CRC(fae49c66) SHA1(4ae69e2f706fdf30204f0aa1277619395cacc21b) )
1639 
1640 	ROM_REGION( 0xa000, "user3", ROMREGION_ERASEFF )      /* roms from the DECO GRO DE-0091C-1 overlay pcb */
1641 	ROM_LOAD( "x1_made_in_japan_18.x1",   0x0000, 0x1000, CRC(f2ca58f0) SHA1(5c9faeca6247b70586dc2a3765805ac96960ac79) )
1642 	ROM_LOAD( "x2_made_in_japan_18.x2",   0x1000, 0x1000, CRC(75d999bf) SHA1(7c257285d5b69642ec542dc56defdbb1f2072454) )
1643 	ROM_LOAD( "x3_made_in_japan_18.x3",   0x2000, 0x1000, CRC(941539c6) SHA1(2e879107f56bf258ad90fb83c2ab278027acb0bb) ) // FIXED BITS (1xxxxxxx) (but correct?)
1644 	ROM_LOAD( "x4_made_in_japan_18.x4",   0x3000, 0x1000, CRC(73388544) SHA1(9c98f79e431d0881e20eac4c6c4177db8973ce20) ) // FIXED BITS (1xxxxxxx) (but correct?)
1645 	ROM_LOAD( "x5_made_in_japan_18.x5",   0x4000, 0x1000, CRC(b40699c5) SHA1(4934283d2845dbd3ea9a7fa349f663a34fcdfdf8) )
1646 	ROM_LOAD( "y1_made_in_japan_18.y1",   0x5000, 0x1000, CRC(d887dc50) SHA1(9321e40d208bd029657ab87eaf815f8a09e49b48) )
1647 	ROM_LOAD( "y2_made_in_japan_18.y2",   0x6000, 0x1000, CRC(fe325d0d) SHA1(3e4aaba87e2aa656346169d512d70083605692c6) )
1648 	ROM_LOAD( "y3_made_in_japan_18.y3",   0x7000, 0x1000, CRC(7a787ecf) SHA1(5261747823b58be3fabb8d1a8cb4069082f95b30) )
1649 	ROM_LOAD( "y4_made_in_japan_18.y4",   0x8000, 0x1000, CRC(ac30e8c7) SHA1(f8f53b982df356e5bf2624afe0f8a72635b3b4b3) )
1650 	ROM_LOAD( "y5_made_in_japan_18.y5",   0x9000, 0x1000, CRC(0a6b8f03) SHA1(09b477579a5fed4c45299b6366141ef4a8c9a410) )
1651 ROM_END
1652 
1653 /* The Following use Dongle Type 2 (CS82-007)
1654     (dongle data differs for each game)      */
1655 
1656 /* 19 Disco No.1 / Sweet Heart */
1657 ROM_START( cdiscon1 )
1658 /* Photo of Dongle shows DP-1190B (the "B" is in a separate white box then the DP-1190 label) */
1659 	DECOCASS_BIOS_B_ROMS
1660 
1661 	ROM_REGION( 0x00800, "dongle", 0 )    /* dongle data */
1662 	ROM_LOAD( "dp-1190_b.dgl", 0x0000, 0x0800, CRC(0f793fab) SHA1(331f1b1b482fcd10f42c388a503f9af62d705401) )
1663 
1664 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1665 	ROM_LOAD( "cdiscon1.cas", 0x0000, 0x8000, CRC(1429a397) SHA1(12f9e03fcda31dc6161a39bf5c3315a1e9e94565) )
1666 ROM_END
1667 
1668 ROM_START( csweetht )
1669 	DECOCASS_BIOS_B_ROMS
1670 
1671 	ROM_REGION( 0x00800, "dongle", 0 )   /* dongle data */
1672 	ROM_LOAD( "cdiscon1.pro", 0x0000, 0x0800, CRC(0f793fab) SHA1(331f1b1b482fcd10f42c388a503f9af62d705401) )
1673 
1674 	ROM_REGION( 0x10000, "cassette", 0 )   /* (max) 64k for cassette image */
1675 	ROM_LOAD( "csweetht.cas", 0x0000, 0x8000, CRC(175ef706) SHA1(49b86233f69d0daf54a6e59b86e69b8159e8f6cc) )
1676 ROM_END
1677 
1678 /* 20 Tornado */
1679 ROM_START( ctornado )
1680 	DECOCASS_BIOS_B_ROMS
1681 
1682 	ROM_REGION( 0x00800, "dongle", 0 )    /* dongle data */
1683 	ROM_LOAD( "ctornado.pro", 0x0000, 0x0800, CRC(c9a91697) SHA1(3f7163291edbdf1a596e3cd2b7a16bbb140ffb36) )
1684 
1685 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1686 	ROM_LOAD( "ctornado.cas", 0x0000, 0x8000, CRC(e4e36ce0) SHA1(48a11823121fb2e3de31ae08e453c0124fc4f7f3) )
1687 ROM_END
1688 
1689 /* 21 Mission-X */
1690 /* Photo of Dongle shows DP-121B with Cassette DT-1213B (the "3B" is in a separate white box then the DP-121 label) */
1691 ROM_START( cmissnx )
1692 	DECOCASS_BIOS_B_ROMS
1693 
1694 	ROM_REGION( 0x00800, "dongle", 0 )    /* dongle data */
1695 	ROM_LOAD( "dp-121_b.dgl", 0x0000, 0x0800, CRC(8a41c071) SHA1(7b16d933707bf21d25dcd11db6a6c28834b11c5b) )
1696 
1697 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1698 	ROM_LOAD( "cmissnx.cas",  0x0000, 0x8000, CRC(3a094e11) SHA1(c355fe14838187cbde19a799e5c60083c82615ac) ) /* Is this the 3B version? */
1699 ROM_END
1700 
1701 /* 22 Pro Tennis */
1702 ROM_START( cptennis )
1703 	DECOCASS_BIOS_B_ROMS
1704 
1705 	ROM_REGION( 0x00800, "dongle", 0 )    /* dongle data */
1706 	ROM_LOAD( "cptennis.pro", 0x0000, 0x0800, CRC(59b8cede) SHA1(514861a652b5256a11477fc357bc01dfd87f712b) )
1707 
1708 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1709 	ROM_LOAD( "cptennis.cas", 0x0000, 0x8000, CRC(6bb257fe) SHA1(7554bf1996bc9e9c04a276aab050708d70103f54) )
1710 ROM_END
1711 
1712 ROM_START( cptennisj )
1713 	DECOCASS_BIOS_A_ROMS
1714 
1715 	ROM_REGION( 0x00800, "dongle", 0 )    /* dongle data */
1716 	ROM_LOAD( "dp-1220-a-0.rom", 0x0000, 0x0800, CRC(1c603239) SHA1(6c97cfbb581f72e8c26a3fc5f06f9d6aa56883ba) )
1717 
1718 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1719 	ROM_LOAD( "dt-1222-a-0.bin", 0x0000, 0x6a00, CRC(ee29eba7) SHA1(fd3aebb81d83120d1afb4d9a216332363d695234) )
1720 ROM_END
1721 
1722 
1723 
1724 /* The Following use Dongle Type 3 (unknown part number?)
1725     (dongle data differs for each game)      */
1726 
1727 /* 25 Fishing / Angler Dangler */
1728 ROM_START( cadanglr ) // version 5-B-0
1729 	DECOCASS_BIOS_B_ROMS
1730 
1731 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1732 	ROM_LOAD( "dp-1250-a-0.dgl", 0x0000, 0x1000, CRC(92a3b387) SHA1(e17a155d02e9ed806590b23a845dc7806b6720b1) )
1733 
1734 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1735 	ROM_LOAD( "dt-1255-b-0.cas",   0x0000, 0x7400, CRC(eb985257) SHA1(1285724352a59c96cc4edf4f43e89dd6d8c585b2) )
1736 ROM_END
1737 
1738 ROM_START( cfishing )
1739 	DECOCASS_BIOS_A_ROMS
1740 
1741 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1742 	ROM_LOAD( "dp-1250-a-0.dgl", 0x0000, 0x1000, CRC(92a3b387) SHA1(e17a155d02e9ed806590b23a845dc7806b6720b1) )
1743 
1744 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1745 	ROM_LOAD( "dt-1250-a-0.cas",   0x0000, 0x7500, CRC(d4a16425) SHA1(25afaabdc8b2217d5e73606a36ea9ba408d7bc4b) )
1746 ROM_END
1747 
1748 
1749 /* 26 Hamburger / Burger Time */
1750 /* Photo of Dongle shows DP-126B with Cassette DT-1267B (the "7B" is in a separate white box then the DP-126 label) */
1751 ROM_START( cbtime ) // version 7-B-0
1752 	DECOCASS_BIOS_B_ROMS
1753 
1754 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1755 	ROM_LOAD( "dp-126_b.dgl", 0x0000, 0x1000, CRC(25bec0f0) SHA1(9fb1f9699f37937421e26d4fb8fdbcd21a5ddc5c) )
1756 
1757 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1758 	ROM_LOAD( "dt-126_7b.cas",   0x0000, 0x8000, CRC(56d7dc58) SHA1(34b2513c9ca7ab40f532b6d6d911aa3012113632) )
1759 ROM_END
1760 
1761 ROM_START( chamburger ) // version 0-A-0
1762 	DECOCASS_BIOS_A_ROMS
1763 
1764 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1765 	ROM_LOAD( "dp-126_a.dgl",   0x0000, 0x1000, CRC(25bec0f0) SHA1(9fb1f9699f37937421e26d4fb8fdbcd21a5ddc5c) )
1766 
1767 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1768 	ROM_LOAD( "dt-126_a.cas",   0x0000, 0x8000, CRC(334fb987) SHA1(c55906bf6059686dd8a587dabbe3fb4d59200ab9) )
1769 ROM_END
1770 
1771 /* 27 Burnin' Rubber / Bump 'n' Jump */
1772 /* Photo of Dongle shows DP-127B with Cassette DP-1275B (the "5B" is in a separate white box then the DP-127 label) */
1773 ROM_START( cburnrub )
1774 	DECOCASS_BIOS_B_ROMS
1775 
1776 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1777 	ROM_LOAD( "dp-127_b.pro",   0x0000, 0x1000, CRC(9f396832) SHA1(0e302fd094474ac792882948a018c73ce76e0759) )
1778 
1779 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1780 	ROM_LOAD( "cburnrub.cas",   0x0000, 0x8000, CRC(4528ac22) SHA1(dc0fcc5e5fd21c1c858a90f43c175e36a24b3c3d) ) /* Is this the 5B version? */
1781 ROM_END
1782 
1783 ROM_START( cburnrub2 )
1784 	DECOCASS_BIOS_B_ROMS
1785 
1786 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1787 	ROM_LOAD( "dp-127_b.pro",   0x0000, 0x1000, CRC(9f396832) SHA1(0e302fd094474ac792882948a018c73ce76e0759) )
1788 
1789 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1790 	ROM_LOAD( "cburnrb2.cas",   0x0000, 0x8000, CRC(84a9ed66) SHA1(a9c536e46b89fc6b9c6271776292fed1241d2f3f) ) /* Is this the 5B version? */
1791 ROM_END
1792 
1793 ROM_START( cbnj )
1794 	DECOCASS_BIOS_B_ROMS
1795 
1796 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1797 	ROM_LOAD( "dp-127_b.pro",   0x0000, 0x1000, CRC(9f396832) SHA1(0e302fd094474ac792882948a018c73ce76e0759) )
1798 
1799 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1800 	ROM_LOAD( "cbnj.cas",       0x0000, 0x8000, CRC(eed41560) SHA1(85d5df76efac33cd10427f659c4259afabb3daaf) )
1801 ROM_END
1802 
1803 ROM_START( cburnrubj )
1804 	DECOCASS_BIOS_A_ROMS
1805 
1806 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1807 	ROM_LOAD( "dp-127_b.pro",   0x0000, 0x1000, CRC(9f396832) SHA1(0e302fd094474ac792882948a018c73ce76e0759) )
1808 
1809 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1810 	ROM_LOAD( "dt-1271-a-0.bin",   0x0000, 0x7800, CRC(6bd0adab) SHA1(4c536991e4ec6cbdf4b74497dae9f0dba17ebb95) )
1811 ROM_END
1812 
1813 /* 28 Graplop / Cluster Buster */
1814 ROM_START( cgraplop )
1815 	DECOCASS_BIOS_B_ROMS
1816 
1817 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1818 	ROM_LOAD( "cgraplop.pro", 0x0000, 0x1000, CRC(ee93787d) SHA1(0c753d62fdce2fdbd5b329a5aa259a967d07a651) )
1819 
1820 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1821 	ROM_LOAD( "cgraplop.cas", 0x0000, 0x8000, CRC(d2c1c1bb) SHA1(db67304caa11540363735e7d4bf03507ccbe9980) )
1822 ROM_END
1823 
1824 ROM_START( cgraplopj )
1825 	DECOCASS_BIOS_A_ROMS
1826 
1827 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1828 	ROM_LOAD( "cgraplop.pro", 0x0000, 0x1000, CRC(ee93787d) SHA1(0c753d62fdce2fdbd5b329a5aa259a967d07a651) )
1829 
1830 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1831 	ROM_LOAD( "dt-1280-a-0.bin", 0x0000, 0x7800, CRC(a0d7d1a7) SHA1(4260edd19786b6cf4cd0c426783637f0c61ca007) )
1832 ROM_END
1833 
1834 ROM_START( cgraplop2 )
1835 	DECOCASS_BIOS_B_ROMS
1836 
1837 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1838 	ROM_LOAD( "cgraplop.pro", 0x0000, 0x1000, CRC(ee93787d) SHA1(0c753d62fdce2fdbd5b329a5aa259a967d07a651) ) /* is this right for this set? */
1839 
1840 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1841 	ROM_LOAD( "cgraplop2.cas", 0x0000, 0x8000, CRC(2e728981) SHA1(83ba90d95858d647315a1c311b8643672afea5f7) )
1842 ROM_END
1843 
1844 /* 29 La-Pa-Pa / Rootin' Tootin' */
1845 ROM_START( clapapa )
1846 	DECOCASS_BIOS_B_ROMS
1847 
1848 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1849 	ROM_LOAD( "clapapa.pro",  0x0000, 0x1000, CRC(e172819a) SHA1(3492775f4f0a0b31ce5a1a998076829b3f264e98) )
1850 
1851 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1852 	ROM_LOAD( "clapapa.cas",  0x0000, 0x8000, CRC(4ffbac24) SHA1(1ec0d7ac1886d4b430dc12be27f387e9d952d235) )
1853 ROM_END
1854 
1855 ROM_START( clapapa2 )
1856 	DECOCASS_BIOS_B_ROMS
1857 
1858 	ROM_REGION( 0x01000, "dongle", 0 )   /* dongle data */
1859 	ROM_LOAD( "clapapa.pro",  0x0000, 0x1000, CRC(e172819a) SHA1(3492775f4f0a0b31ce5a1a998076829b3f264e98) )
1860 
1861 	ROM_REGION( 0x10000, "cassette", 0 )   /* (max) 64k for cassette image */
1862 	ROM_LOAD( "clapapa2.cas",  0x0000, 0x8000, CRC(069dd3c4) SHA1(5a19392c7ac5aea979187c96267e73bf5126307e) )
1863 ROM_END
1864 
1865 /* 30 Skater */
1866 ROM_START( cskater )
1867 	DECOCASS_BIOS_A_ROMS
1868 
1869 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1870 	ROM_LOAD( "dp-130_a.dgl",   0x0000, 0x1000,  CRC(469e80a8) SHA1(f581cd534ce6faba010c6616538cdf9d96d787da) )
1871 
1872 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1873 	ROM_LOAD( "dt-130_a.cas",   0x0000, 0x8000,  CRC(1722e5e1) SHA1(e94066ead608df85d3f7310d4a81ba291da4bee6) )
1874 ROM_END
1875 
1876 /* 31 Pro Bowling */
1877 ROM_START( cprobowl )
1878 	DECOCASS_BIOS_B_ROMS
1879 
1880 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1881 	ROM_LOAD( "cprobowl.pro", 0x0000, 0x1000, CRC(e3a88e60) SHA1(e6e9a2e5ab26e0463c63201a15f7d5a429ec836e) )
1882 
1883 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1884 	ROM_LOAD( "cprobowl.cas", 0x0000, 0x8000, CRC(cb86c5e1) SHA1(66c467418cff2ed6d7c121a8b1650ee97ae48fe9) )
1885 ROM_END
1886 
1887 /* 32 Night Star */
1888 ROM_START( cnightst )
1889 	DECOCASS_BIOS_B_ROMS
1890 
1891 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1892 	ROM_LOAD( "cnightst.pro", 0x0000, 0x1000, CRC(553b0fbc) SHA1(2cdf4560992b62e59b6de760d7996be4ed25f505) )
1893 
1894 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1895 	ROM_LOAD( "cnightst.cas", 0x0000, 0x8000, CRC(c6f844cb) SHA1(5fc6154c20ee4e2f4049a78df6f3cacbb96b0dc0) )
1896 ROM_END
1897 
1898 ROM_START( cnightst2 )
1899 	DECOCASS_BIOS_B_ROMS
1900 
1901 	ROM_REGION( 0x01000, "dongle", 0 )   /* dongle data */
1902 	ROM_LOAD( "cnightst.pro", 0x0000, 0x1000, CRC(553b0fbc) SHA1(2cdf4560992b62e59b6de760d7996be4ed25f505) )
1903 
1904 	ROM_REGION( 0x10000, "cassette", 0 )   /* (max) 64k for cassette image */
1905 	ROM_LOAD( "cnights2.cas", 0x0000, 0x8000, CRC(1a28128c) SHA1(4b620a1919d02814f734aba995115c09dc2db930) )
1906 ROM_END
1907 
1908 /* 33 Pro Soccer */
1909 ROM_START( cpsoccer )
1910 	DECOCASS_BIOS_B_ROMS
1911 
1912 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1913 	ROM_LOAD( "cprosocc.pro", 0x0000, 0x1000,  CRC(919fabb2) SHA1(3d6a0676cea7b0be0fe69d06e04ca08c36b2851a) )
1914 
1915 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1916 	ROM_LOAD( "cprosocc.cas", 0x0000, 0x10000, CRC(76b1ad2c) SHA1(6188667e5bc001dfdf83deaf7251eae794de4702) )
1917 ROM_END
1918 
1919 ROM_START( cpsoccerj )
1920 	DECOCASS_BIOS_A_ROMS
1921 
1922 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1923 	ROM_LOAD( "dp-133_a.dgl",   0x0000, 0x1000,  CRC(919fabb2) SHA1(3d6a0676cea7b0be0fe69d06e04ca08c36b2851a) )
1924 
1925 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1926 	ROM_LOAD( "dt-133_a.cas",   0x0000, 0x10000, CRC(de682a29) SHA1(2ee0dd8cb7fb595020d730a9da5d9cccda3f1264) )
1927 ROM_END
1928 
1929 /* 34 Super Doubles Tennis */
1930 ROM_START( csdtenis )
1931 	DECOCASS_BIOS_A_ROMS
1932 
1933 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1934 	ROM_LOAD( "dp-134_a.dgl",   0x0000, 0x1000,  CRC(e484d2f5) SHA1(ee4e4c221933d391aeed8ff7182fa931a4e01466) )
1935 
1936 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1937 	ROM_LOAD( "dt-134_a.cas",   0x0000, 0x10000, CRC(9a69d961) SHA1(f88e267815ca0697708aca0ac9fa6f7664a0519c) )
1938 ROM_END
1939 
1940 /* 37 Zeroize */
1941 ROM_START( czeroize )
1942 	DECOCASS_BIOS_B_ROMS
1943 
1944 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1945 	ROM_LOAD( "czeroize.pro",  0x0000, 0x1000, NO_DUMP ) /* The Following have unknown Dongles (dongle data not read) */
1946 
1947 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1948 	ROM_LOAD( "czeroize.cas",   0x0000, 0x10000, CRC(3ef0a406) SHA1(645b34cd477e0bb5539c8fe937a7a2dbd8369003) )
1949 ROM_END
1950 
1951 /* 39 Peter Pepper's Ice Cream Factory */
1952 ROM_START( cppicf )
1953 	DECOCASS_BIOS_B_ROMS
1954 
1955 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1956 	ROM_LOAD( "cppicf.pro",   0x0000, 0x1000, CRC(0b1a1ecb) SHA1(2106da6837c78812c102b0eaaa1127fcc21ea780) )
1957 
1958 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1959 	ROM_LOAD( "cppicf.cas",   0x0000, 0x8000, CRC(8c02f160) SHA1(03430dd8d4b2e6ca931986dac4d39be6965ffa6f) )
1960 ROM_END
1961 
1962 ROM_START( cppicf2 )
1963 	DECOCASS_BIOS_B_ROMS
1964 
1965 	ROM_REGION( 0x01000, "dongle", 0 )   /* dongle data */
1966 	ROM_LOAD( "cppicf.pro",   0x0000, 0x1000, CRC(0b1a1ecb) SHA1(2106da6837c78812c102b0eaaa1127fcc21ea780) )
1967 
1968 	ROM_REGION( 0x10000, "cassette", 0 )   /* (max) 64k for cassette image */
1969 	ROM_LOAD( "cppicf2.cas",   0x0000, 0x8000, CRC(78ffa1bc) SHA1(d15f2a240ae7b45885d32b5f507243f82e820d4b) )
1970 ROM_END
1971 
1972 /* 40 Fighting Ice Hockey */
1973 ROM_START( cfghtice )
1974 	DECOCASS_BIOS_B_ROMS
1975 
1976 	ROM_REGION( 0x01000, "dongle", 0 )    /* dongle data */
1977 	ROM_LOAD( "cfghtice.pro", 0x0000, 0x1000, CRC(5abd27b5) SHA1(2ab1c171adffd491759036d6ce2433706654aad2) )
1978 
1979 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1980 	ROM_LOAD( "cfghtice.cas", 0x0000, 0x10000, CRC(906dd7fb) SHA1(894a7970d5476ed035edd15656e5cf10d6ddcf57) )
1981 ROM_END
1982 
1983 /* The Following use Dongle Type 4 (unknown part number?)
1984     (dongle data is used for most of the graphics) */
1985 
1986 /* 38 Scrum Try */
1987 ROM_START( cscrtry )
1988 	DECOCASS_BIOS_B_ROMS
1989 
1990 	ROM_REGION( 0x08000, "dongle", 0 )    /* dongle data */
1991 	ROM_LOAD( "cscrtry.pro",  0x0000, 0x8000, CRC(7bc3460b) SHA1(7c5668ff9a5073e27f4a83b02d79892eb4df6b92) )
1992 
1993 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
1994 	ROM_LOAD( "cscrtry.cas",  0x0000, 0x8000, CRC(5625f0ca) SHA1(f4b0a6f2ca908880386838f06b626479b4b74134) )
1995 ROM_END
1996 
1997 ROM_START( cscrtry2 )
1998 	DECOCASS_BIOS_B_ROMS
1999 
2000 	ROM_REGION( 0x08000, "dongle", 0 )   /* dongle data */
2001 	ROM_LOAD( "cscrtry.pro",  0x0000, 0x8000, CRC(7bc3460b) SHA1(7c5668ff9a5073e27f4a83b02d79892eb4df6b92) )
2002 
2003 	ROM_REGION( 0x10000, "cassette", 0 )   /* (max) 64k for cassette image */
2004 	ROM_LOAD( "cscrtry2.cas",  0x0000, 0x8000, CRC(04597842) SHA1(7f1fc3e06b61df880debe9056bdfbbb8600af739) )
2005 ROM_END
2006 
2007 /* 41 Oozumou - The Grand Sumo */
2008 ROM_START( coozumou )
2009 	DECOCASS_BIOS_A_ROMS
2010 
2011 	ROM_REGION( 0x08000, "dongle", 0 )    /* dongle data */
2012 	ROM_LOAD( "dp-141_a.dgl",   0x0000, 0x8000,  CRC(bc379d2c) SHA1(bab19dcb6d68fdbd547ebab1598353f436321157) )
2013 
2014 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
2015 	ROM_LOAD( "dt-141_1a.cas",  0x0000, 0x10000, CRC(20c2e86a) SHA1(a18248ba00b847a09df0bea7752a21162af8af76) )
2016 ROM_END
2017 
2018 /* 44 Boulder Dash */
2019 ROM_START( cbdash )
2020 	DECOCASS_BIOS_B_ROMS
2021 
2022 /*  ROM_REGION( 0x01000, "dongle", 0 ) */ /* (max) 4k for dongle data */
2023 	/* no proms */
2024 
2025 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
2026 	ROM_LOAD( "cbdash.cas",   0x0000, 0x8000, CRC(cba4c1af) SHA1(5d163d8e31c58b20679c6be06b1aa02df621822b) )
2027 ROM_END
2028 
2029 /* The Following have no Dongles at all */
2030 
2031 /* 35 Flying Ball*/
2032 ROM_START( cflyball )
2033 	DECOCASS_BIOS_B_ROMS
2034 
2035 	/* no dongle data */
2036 
2037 	ROM_REGION( 0x10000, "cassette", 0 )      /* (max) 64k for cassette image */
2038 	ROM_LOAD( "cflyball.cas",   0x0000, 0x10000, CRC(cb40d043) SHA1(57698bac7e0d552167efa99d08116bf19a3b29c9) )
2039 ROM_END
2040 
2041 ROM_START( decomult )
2042 	ROM_REGION( 0x10000, "maincpu", 0 )
2043 	ROM_LOAD( "widlbios.v0b",    0xf800, 0x0800, CRC(9ad7c451) SHA1(cda3513ca9904cd9f097a4a79226e3e30f83bb1c) )
2044 
2045 	ROM_REGION( 0x100000, "dongle", 0 )
2046 	ROM_LOAD( "widldeco.low",    0x00000, 0x80000, CRC(fd4dc36c) SHA1(1ef7f9e1dd333a1adc7b94e2b20eda41fe73a9f8) )
2047 	ROM_LOAD( "widldeco.hgh",    0x80000, 0x80000, CRC(a8a30112) SHA1(b4feaa3e68c5d347c97958bc3c06472dd66df2f7) )
2048 
2049 	ROM_REGION( 0x10000, "audiocpu", 0 )
2050 	ROM_LOAD( "v1-.5a",     0xf800, 0x0800, CRC(b66b2c2a) SHA1(0097f38beb4872e735e560148052e258a26b08fd) )
2051 
2052 	ROM_REGION( 0x00060, "proms", 0 )
2053 	ROM_LOAD( "v2.3m",      0x0000, 0x0020, CRC(238fdb40) SHA1(b88e8fabb82092105c3828154608ea067acbf2e5) )
2054 	ROM_LOAD( "v4.10d",     0x0020, 0x0020, CRC(3b5836b4) SHA1(b630bb277d9ec09d46ef26b944014dd6165b35d8) )
2055 	ROM_LOAD( "v3.3j",      0x0040, 0x0020, CRC(51eef657) SHA1(eaedce5caf55624ad6ae706aedf82c5717c60f1f) )
2056 
2057 	ROM_REGION( 0x10000, "mcu", 0 )
2058 	ROM_LOAD( "cassmcu.1c", 0x0000, 0x0400, CRC(a6df18fd) SHA1(1f9ea47e372d31767c936c15852b43df2b0ee8ff) )
2059 ROM_END
2060 
2061 
2062 void decocass_state::init_decocass()
2063 {
2064 	/* Call the state save setup code in machine/decocass.cpp */
2065 	decocass_machine_state_save_init();
2066 	/* and in video/decocass.cpp, too */
2067 	decocass_video_state_save_init();
2068 }
2069 
init_decocrom()2070 void decocass_state::init_decocrom()
2071 {
2072 	/* standard init */
2073 	init_decocass();
2074 
2075 	/* convert charram to a banked ROM */
2076 	m_maincpu->space(AS_PROGRAM).install_read_bank(0x6000, 0xafff, "bank1");
2077 	m_maincpu->space(AS_PROGRAM).install_write_handler(0x6000, 0xafff, write8sm_delegate(*this, FUNC(decocass_state::decocass_de0091_w)));
2078 	membank("bank1")->configure_entry(0, m_charram);
2079 	membank("bank1")->configure_entry(1, memregion("user3")->base());
2080 	membank("bank1")->configure_entry(2, memregion("user3")->base()+0x5000);
2081 	membank("bank1")->set_entry(0);
2082 
2083 	/* install the bank selector */
2084 	m_maincpu->space(AS_PROGRAM).install_write_handler(0xe900, 0xe900, write8smo_delegate(*this, FUNC(decocass_state::decocass_e900_w)));
2085 }
2086 
cdsteljn_input_r(offs_t offset)2087 uint8_t decocass_state::cdsteljn_input_r(offs_t offset)
2088 {
2089 	uint8_t res;
2090 	static const char *const portnames[2][4] = {
2091 		{"P1_MP0", "P1_MP1", "P1_MP2", "P1_MP3"},
2092 		{"P2_MP0", "P2_MP1", "P2_MP2", "P2_MP3"}         };
2093 
2094 	if(offset & 6)
2095 		return decocass_input_r(offset);
2096 
2097 	res = ioport(portnames[offset & 1][m_mux_data])->read();
2098 
2099 	return res;
2100 }
2101 
cdsteljn_mux_w(uint8_t data)2102 void decocass_state::cdsteljn_mux_w(uint8_t data)
2103 {
2104 	m_mux_data = (data & 0xc) >> 2;
2105 	/* bit 0 and 1 are p1/p2 lamps */
2106 
2107 	if(data & ~0xf)
2108 		printf("%02x\n",data);
2109 }
2110 
init_cdsteljn()2111 void decocass_state::init_cdsteljn()
2112 {
2113 	/* standard init */
2114 	init_decocass();
2115 
2116 	/* install custom mahjong panel */
2117 	m_maincpu->space(AS_PROGRAM).install_write_handler(0xe413, 0xe413, write8smo_delegate(*this, FUNC(decocass_state::cdsteljn_mux_w)));
2118 	m_maincpu->space(AS_PROGRAM).install_read_handler(0xe600, 0xe6ff, read8sm_delegate(*this, FUNC(decocass_state::cdsteljn_input_r)));
2119 }
2120 
2121 /* -- */ GAME( 1981, decocass,  0,        decocass, decocass, decocass_state,        init_decocass, ROT270, "Data East Corporation", "DECO Cassette System", MACHINE_IS_BIOS_ROOT )
2122 /* -- */ GAME( 1981, ctsttape,  decocass, ctsttape, decocass, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Test Tape (DECO Cassette) (US)", 0 )
2123 /* 01 */ GAME( 1980, chwy,      decocass, chwy,     chwy,     decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Highway Chase (DECO Cassette) (US)", 0 )
2124 /* 02 */ // 1980.12 Sengoku Ninjatai
2125 /* 03 */ GAME( 1981, cmanhat,   decocass, cmanhat,  cmanhat,  decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Manhattan (DECO Cassette) (Japan)", MACHINE_IMPERFECT_GRAPHICS )
2126 /* 04 */ GAME( 1981, cterrani,  decocass, cterrani, cterrani, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Terranean (DECO Cassette) (US)", 0 )
2127 /* 05 */ // 1981.?? Missile Sprinter
2128 /* 06 */ // 1980.12 Nebula
2129 /* 07 */ GAME( 1981, castfant,  decocass, castfant, castfant, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Astro Fantasia (DECO Cassette) (US)", 0 )
2130 /* 08 */ // 1981.03 The Tower
2131 /* 09 */ GAME( 1981, csuperas,  decocass, csuperas, csuperas, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Super Astro Fighter (DECO Cassette) (US)", 0 )
2132 /* 10 */ GAME( 1981, cocean1a,  decocass, cocean1a, cocean1a, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Ocean to Ocean (Medal) (DECO Cassette MD) (No.10/Ver.1,Japan)", 0 ) /* no lever, 1P/2P buttons used to switch player, cocktail mode not emulated */
2133 /*    */ GAME( 1981, cocean6b,  cocean1a, cocean1a, cocean1a, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Ocean to Ocean (Medal) (DECO Cassette MD) (No.10/Ver.6,US)", 0 ) /* lever, 1P/2P buttons used to switch player, cocktail mode not emulated */
2134 /* 11 */ GAME( 1981, clocknch,  decocass, clocknch, clocknch, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Lock'n'Chase (DECO Cassette) (US)", 0 )
2135 /*    */ GAME( 1981, clocknchj, clocknch, clocknchj,clocknchj,decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Lock'n'Chase (DECO Cassette) (Japan)", 0 )
2136 /* 12 */ GAME( 1981, cfboy0a1,  decocass, cfboy0a1, cfboy0a1, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Flash Boy (vertical) (DECO Cassette MD) (No.12/Ver.0/Set.1,Japan)", 0 )
2137 /* 13 */ GAME( 1981, cprogolf,  decocass, cprogolf, cprogolf, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Tournament Pro Golf (DECO Cassette) (US)", 0 )
2138 /*    */ GAME( 1981, cprogolfj, cprogolf, cprogolfj,cprogolf, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Tournament Pro Golf (DECO Cassette) (Japan)", 0 )
2139 /* 14 */ GAME( 1981, cdsteljn,  decocass, cdsteljn, cdsteljn, decocass_type1_state,  init_cdsteljn, ROT270, "Data East Corporation", "DS Telejan (DECO Cassette) (Japan)", 0 )
2140 /* 15 */ GAME( 1981, cluckypo,  decocass, cluckypo, cluckypo, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "Lucky Poker (DECO Cassette) (US)", 0 )
2141 /* 16 */ GAME( 1981, ctisland,  decocass, ctisland, ctisland, decocass_type1_state,  init_decocrom, ROT270, "Data East Corporation", "Treasure Island (DECO Cassette) (US) (set 1)", 0 )
2142 /*    */ GAME( 1981, ctisland2, ctisland, ctisland, ctisland, decocass_type1_state,  init_decocrom, ROT270, "Data East Corporation", "Treasure Island (DECO Cassette) (US) (set 2)", 0 ) /* newer? has instructions in attract */
2143 /*    */ GAME( 1981, ctisland3, ctisland, ctisland3,ctisland, decocass_type1_state,  init_decocrom, ROT270, "Data East Corporation", "Treasure Island (DECO Cassette) (Region D)", 0 ) /* region code 'D' unknown region */
2144 /* 17 */ // 1981.10 Bobbitto
2145 /* 18 */ GAME( 1982, cexplore,  decocass, cexplore, cexplore, decocass_type1_state,  init_decocrom, ROT270, "Data East Corporation", "Explorer (DECO Cassette) (US)", 0 )
2146 /* 19 */ GAME( 1982, cdiscon1,  decocass, decocass, cdiscon1, decocass_type2_state,  init_decocass, ROT270, "Data East Corporation", "Disco No.1 (DECO Cassette) (US)", 0 )
2147 /*    */ GAME( 1982, csweetht,  cdiscon1, decocass, csweetht, decocass_type2_state,  init_decocass, ROT270, "Data East Corporation", "Sweet Heart (DECO Cassette) (US)", 0 )
2148 /* 20 */ GAME( 1982, ctornado,  decocass, decocass, ctornado, decocass_type2_state,  init_decocass, ROT270, "Data East Corporation", "Tornado (DECO Cassette) (US)", 0 )
2149 /* 21 */ GAME( 1982, cmissnx,   decocass, decocass, cmissnx,  decocass_type2_state,  init_decocass, ROT270, "Data East Corporation", "Mission-X (DECO Cassette) (US)", 0 )
2150 /* 22 */ GAME( 1982, cptennis,  decocass, decocass, cptennis, decocass_type2_state,  init_decocass, ROT270, "Data East Corporation", "Pro Tennis (DECO Cassette) (US)", 0 )
2151 /*    */ GAME( 1982, cptennisj, cptennis, decocass, cptennis, decocass_type2_state,  init_decocass, ROT270, "Data East Corporation", "Pro Tennis (DECO Cassette) (Japan)", 0 )
2152 /* 23 */ GAME( 1982, cprogolf18,cprogolf, cprogolfj,cprogolf, decocass_type1_state,  init_decocass, ROT270, "Data East Corporation", "18 Challenge Pro Golf (DECO Cassette) (Japan)", 0 ) // 1982.?? 18 Hole Pro Golf
2153 /* 24 */ // 1982.07 Tsumego Kaisyou
2154 /* 25 */ GAME( 1982, cadanglr,  decocass, cfishing, cfishing, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Angler Dangler (DECO Cassette) (US)", 0 )
2155 /* 25 */ GAME( 1982, cfishing,  cadanglr, cfishing, cfishing, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Fishing (DECO Cassette) (Japan)", 0 )
2156 /* 26 */ GAME( 1983, cbtime,    decocass, cbtime,   cbtime,   decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Burger Time (DECO Cassette) (US)", 0 )
2157 /*    */ GAME( 1982, chamburger,cbtime,   cbtime,   cbtime,   decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Hamburger (DECO Cassette) (Japan)", 0 )
2158 /* 27 */ GAME( 1982, cburnrub,  decocass, cburnrub, cburnrub, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Burnin' Rubber (DECO Cassette) (US) (set 1)", 0 ) /* large stylized red title (newer release?) */
2159 /*    */ GAME( 1982, cburnrub2, cburnrub, cburnrub, cburnrub, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Burnin' Rubber (DECO Cassette) (US) (set 2)", 0 ) /* large monochrome title (original release?) */
2160 /*    */ GAME( 1982, cburnrubj, cburnrub, cburnrub, cburnrub, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Burnin' Rubber (DECO Cassette) (Japan)", 0 ) /* large monochrome title (original release?) */
2161 /*    */ GAME( 1982, cbnj,      cburnrub, cburnrub, cburnrub, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Bump 'n' Jump (DECO Cassette) (US)", 0 ) /* name was changed from Burnin' Rubber to Bump 'n' Jump (newest release?) */
2162 /* 28 */ GAME( 1983, cgraplop,  decocass, cgraplop, cgraplop, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Cluster Buster (DECO Cassette) (US)", 0 )
2163 /*    */ GAME( 1983, cgraplopj, cgraplop, cgraplop, cgraplop, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Graplop (DECO Cassette) (Japan)", 0 )
2164 /*    */ GAME( 1983, cgraplop2, cgraplop, cgraplop2,cgraplop, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Graplop (DECO Cassette) (US) (Prototype?)", 0 ) /* button 1 does nothing, infinite shield despite the attract mode claiming otherwise, no title screen (was marked Cluster Buster in a previous MAME release?), repetitive level design, most likely a proto unless the encryption is still an issue (unlikely) */
2165 /* 29 */ GAME( 1983, clapapa,   decocass, clapapa,  clapapa,  decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Rootin' Tootin' / La-Pa-Pa (DECO Cassette) (US)" , 0) /* Displays 'La-Pa-Pa during attract */
2166 /*    */ GAME( 1983, clapapa2,  clapapa,  clapapa,  clapapa,  decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Rootin' Tootin' (DECO Cassette) (US)" , 0) /* Displays 'Rootin' Tootin' during attract */
2167 /* 30 */ GAME( 1983, cskater,   decocass, cskater,  cskater,  decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Skater (DECO Cassette) (Japan)", 0 )
2168 /* 31 */ GAME( 1983, cprobowl,  decocass, cprobowl, cprobowl, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Pro Bowling (DECO Cassette) (US)", 0 )
2169 /* 32 */ GAME( 1983, cnightst,  decocass, cnightst, cnightst, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Night Star (DECO Cassette) (US) (set 1)", 0 )
2170 /*    */ GAME( 1983, cnightst2, cnightst, cnightst, cnightst, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Night Star (DECO Cassette) (US) (set 2)", 0 )
2171 /* 33 */ GAME( 1983, cpsoccer,  decocass, cpsoccer, cpsoccer, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Pro Soccer (DECO Cassette) (US)", 0 )
2172 /*    */ GAME( 1983, cpsoccerj, cpsoccer, cpsoccer, cpsoccer, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Pro Soccer (DECO Cassette) (Japan)", 0 )
2173 /* 34 */ GAME( 1983, csdtenis,  decocass, csdtenis, csdtenis, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Super Doubles Tennis (DECO Cassette) (Japan)", 0 )
2174 /* 35 */ GAME( 1985, cflyball,  decocass, decocass, cflyball, decocass_nodong_state, init_decocass, ROT270, "Data East Corporation", "Flying Ball (DECO Cassette) (US)", 0 )
2175 /* 36 */ // 1984.04 Genesis/Boomer Rang'r
2176 /* 37 */ GAME( 1983, czeroize,  decocass, czeroize, czeroize, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Zeroize (DECO Cassette) (US)", 0 )
2177 /* 38 */ GAME( 1984, cscrtry,   decocass, decocass, cscrtry,  decocass_type4_state,  init_decocass, ROT270, "Data East Corporation", "Scrum Try (DECO Cassette) (US) (set 1)", 0 )
2178 /*    */ GAME( 1984, cscrtry2,  cscrtry,  decocass, cscrtry,  decocass_type4_state,  init_decocass, ROT270, "Data East Corporation", "Scrum Try (DECO Cassette) (US) (set 2)", 0 )
2179 /* 39 */ GAME( 1984, cppicf,    decocass, cppicf,   cppicf,   decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Peter Pepper's Ice Cream Factory (DECO Cassette) (US) (set 1)", 0 )
2180 /*    */ GAME( 1984, cppicf2,   cppicf,   cppicf,   cppicf,   decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Peter Pepper's Ice Cream Factory (DECO Cassette) (US) (set 2)", 0 )
2181 /* 40 */ GAME( 1984, cfghtice,  decocass, cfghtice, cfghtice, decocass_type3_state,  init_decocass, ROT270, "Data East Corporation", "Fighting Ice Hockey (DECO Cassette) (US)", 0 )
2182 /* 41 */ GAME( 1984, coozumou,  decocass, decocass, cscrtry,  decocass_type4_state,  init_decocass, ROT270, "Data East Corporation", "Oozumou - The Grand Sumo (DECO Cassette) (Japan)", 0 )
2183 /* 42 */ // 1984.08 Hellow Gateball // not a typo, this is official spelling
2184 /* 43 */ // 1984.08 Yellow Cab
2185 /* 44 */ GAME( 1985, cbdash,    decocass, decocass, cbdash,   decocass_type5_state,  init_decocass, ROT270, "Data East Corporation", "Boulder Dash (DECO Cassette) (US)", 0 )
2186 
2187 /* UX7 */ // 1984.12 Tokyo MIE Clinic/Tokyo MIE Shinryoujo
2188 /* UX8 */ // 1985.01 Tokyo MIE Clinic/Tokyo MIE Shinryoujo Part 2
2189 /* UX9 */ // 1985.05 Geinoujin Shikaku Shiken
2190 
2191 /* xx */ GAME( 2008, decomult,  decocass, decocass, decocass, decocass_widel_state,  init_decocass, ROT270, "bootleg (David Widel)", "Deco Cassette System Multigame (ROM based)", 0 )
2192