1 // license:BSD-3-Clause
2 // copyright-holders:Olivier Galibert
3 /***************************************************************************
4 
5     G.I. Joe  (c) 1992 Konami
6 
7 
8 G.I. Joe
9 Konami 1992
10 
11 PCB Layout
12 ----------
13 GX069 PWB352065B
14 |--------------------------------------------------------|
15 |LA4705           069A04.1E      069A05.1H               |
16 |          84256                 069A06.2H               |
17 | 054986A          |------|      069A07.4H               |
18 |          Z80E    |054539|      069A08.6H               |
19 |CN6               |      |                              |
20 |          8416    |      |            |------| |------| |
21 | 051550           |------|            |053246| |053247A |
22 |          069A01.7C                   |      | |      | |
23 |                     32MHz            |      | |      | |
24 |J          ER5911.7D 18.432MHz        |      | |      | |
25 |A 052535       |------------|         |------| |------| |
26 |M              |   68000    |                           |
27 |M 052535       |            |         5168              |
28 |A              |------------|         5168              |
29 |  052535        84256                                   |
30 |                                                        |
31 |                069A12.13E            |------| |------| |
32 |          8416                        |054157| |054156| |
33 |                069UAB03.14E |------| |      | |      | |
34 |          8416               |053251| |      | |      | |
35 |  TEST_SW       84256        |      | |      | |      | |
36 |                             |------| |------| |------| |
37 |005273(X10)     069A11.16E                              |
38 |                                                   5168 |
39 |  CN9           069UAB02.18E           069A09.16J  5168 |
40 |  CN8   DSW(4)               24MHz     069A10.18J  5168 |
41 |--------------------------------------------------------|
42 Notes:
43       68000   - Clock 16.000MHz [32/2]
44       Z80E    - Clock 8.000MHz [32/4]
45       8416    - Fujitsu MB8416 2kx8 SRAM (DIP24)
46       84256   - Fujitsu MB84256 32kx8 SRAM (DIP28)
47       5168    - Sharp LH5168 8kx8 SRAM (DIP28)
48       ER5911  - EEPROM (128 bytes)
49       CN6     - 4 pin connector for stereo sound output
50       CN8/CN9 - 15 pin connectors for player 3 & player 4 controls
51       069*    - EPROM/mask ROM
52       LA4705  - 15W 2-channel BTL audio power AMP
53 
54       Custom Chips
55       ------------
56       053251  - Priority encoder
57       054157  \
58       054156  / Tilemap generators
59       053246  \
60       053247A / Sprite generators
61       054539  - 8-Channel ADPCM sound generator. Clock input 18.432MHz. Clock outputs 18.432/4 & 18.432/8
62       052535  - Video DAC (one for each R,G,B video signal)
63       051550  - EMI filter for credit/coin counter
64       005273  - Resistor array for player 3 & player 4 controls
65       054986A - Audio DAC/filter + sound latch + Z80 memory mapper/banker (large ceramic SDIP64 module)
66                 This module contains several surface mounted capacitors and resistors, 4558 OP amp,
67                 Analog Devices AD1868 dual 18-bit audio DAC and a Konami 054321 QFP44 IC.
68 
69       Sync Measurements
70       -----------------
71       HSync - 15.2036kHz
72       VSync - 59.6374Hz
73 
74 
75 ****************************************************************************
76 
77 Change Log
78 ----------
79 
80 AT070403:
81 
82 tilemap.h,tilemap.cpp
83 - added tilemap_get_transparency_data() for transparency cache manipulation
84 
85 video\konamiic.cpp
86 - added preliminary K056832 tilemap<->linemap switching and tileline code
87 
88 drivers\gijoe.cpp
89 - updated video settings, memory map and irq handler
90 - added object blitter
91 
92 video\gijoe.cpp
93 - completed K054157 to K056832 migration
94 - added ground scroll emulation
95 - fixed sprite and BG priority
96 - improved shadows and layer alignment
97 
98 
99 Known Issues
100 ------------
101 
102 - sprite gaps (K053247 zoom fraction rounding)
103 - shadow masking (eg. the shadow of Baroness' aircraft should not project on the sky)
104 
105 ***************************************************************************/
106 
107 #include "emu.h"
108 #include "includes/gijoe.h"
109 #include "includes/konamipt.h"
110 
111 #include "cpu/m68000/m68000.h"
112 #include "cpu/z80/z80.h"
113 #include "machine/eepromser.h"
114 #include "sound/k054539.h"
115 #include "speaker.h"
116 
117 
118 #define JOE_DEBUG 0
119 #define JOE_DMADELAY (attotime::from_nsec(42700 + 341300))
120 
121 
control2_r()122 uint16_t gijoe_state::control2_r()
123 {
124 	return m_cur_control2;
125 }
126 
control2_w(offs_t offset,uint16_t data,uint16_t mem_mask)127 void gijoe_state::control2_w(offs_t offset, uint16_t data, uint16_t mem_mask)
128 {
129 	if (ACCESSING_BITS_0_7)
130 	{
131 		/* bit 0  is data */
132 		/* bit 1  is cs (active low) */
133 		/* bit 2  is clock (active high) */
134 		/* bit 3  (unknown: coin) */
135 		/* bit 5  is enable irq 6 */
136 		/* bit 7  (unknown: enable irq 5?) */
137 		ioport("EEPROMOUT")->write(data, 0xff);
138 
139 		m_cur_control2 = data;
140 
141 		/* bit 6 = enable sprite ROM reading */
142 		m_k053246->k053246_set_objcha_line( (data & 0x0040) ? ASSERT_LINE : CLEAR_LINE);
143 	}
144 }
145 
gijoe_objdma()146 void gijoe_state::gijoe_objdma(  )
147 {
148 	uint16_t *src_head, *src_tail, *dst_head, *dst_tail;
149 
150 	src_head = m_spriteram;
151 	src_tail = m_spriteram + 255 * 8;
152 	m_k053246->k053247_get_ram( &dst_head);
153 	dst_tail = dst_head + 255 * 8;
154 
155 	for (; src_head <= src_tail; src_head += 8)
156 	{
157 		if (*src_head & 0x8000)
158 		{
159 			memcpy(dst_head, src_head, 0x10);
160 			dst_head += 8;
161 		}
162 		else
163 		{
164 			*dst_tail = 0;
165 			dst_tail -= 8;
166 		}
167 	}
168 }
169 
TIMER_CALLBACK_MEMBER(gijoe_state::dmaend_callback)170 TIMER_CALLBACK_MEMBER(gijoe_state::dmaend_callback)
171 {
172 	if (m_cur_control2 & 0x0020)
173 		m_maincpu->set_input_line(6, HOLD_LINE);
174 }
175 
INTERRUPT_GEN_MEMBER(gijoe_state::gijoe_interrupt)176 INTERRUPT_GEN_MEMBER(gijoe_state::gijoe_interrupt)
177 {
178 	// global interrupt masking (*this game only)
179 	if (!m_k056832->is_irq_enabled(0))
180 		return;
181 
182 	if (m_k053246->k053246_is_irq_enabled())
183 	{
184 		gijoe_objdma();
185 
186 		// 42.7us(clr) + 341.3us(xfer) delay at 6Mhz dotclock
187 		m_dmadelay_timer->adjust(JOE_DMADELAY);
188 	}
189 
190 	// trigger V-blank interrupt
191 	if (m_cur_control2 & 0x0080)
192 		device.execute().set_input_line(5, HOLD_LINE);
193 }
194 
sound_irq_w(uint16_t data)195 void gijoe_state::sound_irq_w(uint16_t data)
196 {
197 	m_audiocpu->set_input_line(0, HOLD_LINE);
198 }
199 
gijoe_map(address_map & map)200 void gijoe_state::gijoe_map(address_map &map)
201 {
202 	map(0x000000, 0x0fffff).rom();
203 	map(0x100000, 0x100fff).ram().share("spriteram");                               // Sprites
204 	map(0x110000, 0x110007).w(m_k053246, FUNC(k053247_device::k053246_w));
205 	map(0x120000, 0x121fff).rw(m_k056832, FUNC(k056832_device::ram_word_r), FUNC(k056832_device::ram_word_w));      // Graphic planes
206 	map(0x122000, 0x123fff).rw(m_k056832, FUNC(k056832_device::ram_word_r), FUNC(k056832_device::ram_word_w));      // Graphic planes mirror read
207 	map(0x130000, 0x131fff).r(m_k056832, FUNC(k056832_device::rom_word_r));                               // Passthrough to tile roms
208 	map(0x160000, 0x160007).w(m_k056832, FUNC(k056832_device::b_word_w));                                    // VSCCS (board dependent)
209 	map(0x170000, 0x170001).nopw();                                                // Watchdog
210 	map(0x180000, 0x18ffff).ram().share("workram");                 // Main RAM.  Spec. 180000-1803ff, 180400-187fff
211 	map(0x190000, 0x190fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
212 	map(0x1a0000, 0x1a001f).w(m_k053251, FUNC(k053251_device::write)).umask16(0x00ff);
213 	map(0x1b0000, 0x1b003f).w(m_k056832, FUNC(k056832_device::word_w));
214 	map(0x1c0000, 0x1c001f).m(m_k054321, FUNC(k054321_device::main_map)).umask16(0x00ff);
215 	map(0x1d0000, 0x1d0001).w(FUNC(gijoe_state::sound_irq_w));
216 	map(0x1e0000, 0x1e0001).portr("P1_P2");
217 	map(0x1e0002, 0x1e0003).portr("P3_P4");
218 	map(0x1e4000, 0x1e4001).portr("SYSTEM");
219 	map(0x1e4002, 0x1e4003).portr("START");
220 	map(0x1e8000, 0x1e8001).rw(FUNC(gijoe_state::control2_r), FUNC(gijoe_state::control2_w));
221 	map(0x1f0000, 0x1f0001).r(m_k053246, FUNC(k053247_device::k053246_r));
222 #if JOE_DEBUG
223 	map(0x110000, 0x110007).r(m_k053246, FUNC(k053247_device::k053246_read_register));
224 	map(0x160000, 0x160007).r(m_k056832, FUNC(k056832_device::b_word_r));
225 	map(0x1a0000, 0x1a001f).r(m_k053251, FUNC(k053251_device::read)).umask16(0x00ff);
226 	map(0x1b0000, 0x1b003f).r(m_k056832, FUNC(k056832_device::word_r));
227 #endif
228 }
229 
sound_map(address_map & map)230 void gijoe_state::sound_map(address_map &map)
231 {
232 	map(0xf000, 0xf7ff).ram();
233 	map(0xf800, 0xfa2f).rw(m_k054539, FUNC(k054539_device::read), FUNC(k054539_device::write));
234 	map(0xfc00, 0xfc03).m(m_k054321, FUNC(k054321_device::sound_map));
235 	map(0x0000, 0xefff).rom();
236 }
237 
238 static INPUT_PORTS_START( gijoe )
239 	PORT_START("START")
240 	PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_START1 )
241 	PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_START2 )
242 	PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_START3 )
243 	PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_START4 )
244 	PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, do_read)
245 	PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, ready_read)
246 	PORT_SERVICE_NO_TOGGLE( 0x0800, IP_ACTIVE_LOW )
247 
248 	PORT_START("EEPROMOUT")
249 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, di_write)
250 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, cs_write)
251 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, clk_write)
252 
253 	PORT_START("SYSTEM")
254 	PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1 )
255 	PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_COIN2 )
256 	PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_COIN3 )
257 	PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_COIN4 )
258 	PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_SERVICE1 )
259 	PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_SERVICE2 )
260 	PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_SERVICE3 )
261 	PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_SERVICE4 )
262 
263 	PORT_START("P1_P2")
264 	KONAMI16_LSB_40(1, IPT_BUTTON3 ) PORT_OPTIONAL
265 	PORT_DIPNAME( 0x0080, 0x0000, "Sound" )         PORT_DIPLOCATION("SW1:1")
DEF_STR(Mono)266 	PORT_DIPSETTING(      0x0080, DEF_STR( Mono ) )
267 	PORT_DIPSETTING(      0x0000, DEF_STR( Stereo ) )
268 	KONAMI16_MSB_40(2, IPT_BUTTON3 ) PORT_OPTIONAL
269 	PORT_DIPNAME( 0x8000, 0x8000, "Coin mechanism" )    PORT_DIPLOCATION("SW1:2")
270 	PORT_DIPSETTING(      0x8000, "Common" )
271 	PORT_DIPSETTING(      0x0000, "Independent" )
272 
273 	PORT_START("P3_P4")
274 	KONAMI16_LSB_40(3, IPT_BUTTON3 ) PORT_OPTIONAL
275 	PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Players ) )  PORT_DIPLOCATION("SW1:3")
276 	PORT_DIPSETTING(      0x0080, "2" )
277 	PORT_DIPSETTING(      0x0000, "4" )
278 	KONAMI16_MSB_40(4, IPT_BUTTON3 ) PORT_OPTIONAL
279 	PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW1:4" )    /* Listed as "Unused" */
280 INPUT_PORTS_END
281 
282 void gijoe_state::machine_start()
283 {
284 	m_dmadelay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gijoe_state::dmaend_callback),this));
285 
286 	save_item(NAME(m_cur_control2));
287 }
288 
machine_reset()289 void gijoe_state::machine_reset()
290 {
291 	m_cur_control2 = 0;
292 }
293 
gijoe(machine_config & config)294 void gijoe_state::gijoe(machine_config &config)
295 {
296 	/* basic machine hardware */
297 	M68000(config, m_maincpu, XTAL(32'000'000)/2);   /* 16MHz Confirmed */
298 	m_maincpu->set_addrmap(AS_PROGRAM, &gijoe_state::gijoe_map);
299 	m_maincpu->set_vblank_int("screen", FUNC(gijoe_state::gijoe_interrupt));
300 
301 	Z80(config, m_audiocpu, XTAL(32'000'000)/4);     /* Amuse & confirmed. Z80E at 8MHz */
302 	m_audiocpu->set_addrmap(AS_PROGRAM, &gijoe_state::sound_map);
303 
304 	EEPROM_ER5911_8BIT(config, "eeprom");
305 
306 	/* video hardware */
307 	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
308 	screen.set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK);
309 	screen.set_refresh_hz(60);
310 	screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
311 	screen.set_size(64*8, 32*8);
312 	screen.set_visarea(24, 24+288-1, 16, 16+224-1);
313 	screen.set_screen_update(FUNC(gijoe_state::screen_update_gijoe));
314 	screen.set_palette("palette");
315 
316 	PALETTE(config, "palette").set_format(palette_device::xBGR_555, 2048).enable_shadows();
317 
318 	K056832(config, m_k056832, 0);
319 	m_k056832->set_tile_callback(FUNC(gijoe_state::tile_callback));
320 	m_k056832->set_config(K056832_BPP_4, 1, 0);
321 	m_k056832->set_palette(m_palette);
322 
323 	K053246(config, m_k053246, 0);
324 	m_k053246->set_sprite_callback(FUNC(gijoe_state::sprite_callback));
325 	m_k053246->set_config(NORMAL_PLANE_ORDER, -37, 20);
326 	m_k053246->set_palette(m_palette);
327 
328 	K053251(config, m_k053251, 0);
329 
330 	/* sound hardware */
331 	SPEAKER(config, "lspeaker").front_left();
332 	SPEAKER(config, "rspeaker").front_right();
333 
334 	K054321(config, m_k054321, "lspeaker", "rspeaker");
335 
336 	k054539_device &k054539(K054539(config, "k054539", XTAL(18'432'000)));
337 	k054539.timer_handler().set_inputline("audiocpu", INPUT_LINE_NMI);
338 	k054539.add_route(0, "rspeaker", 1.0);
339 	k054539.add_route(1, "lspeaker", 1.0);
340 }
341 
342 
343 ROM_START( gijoe )
344 	ROM_REGION( 0x100000, "maincpu", 0 )
345 	ROM_LOAD16_BYTE( "069eab03.14e", 0x000000,  0x40000, CRC(dd2d533f) SHA1(6fc9f7a8fc89155ef2b9ee43fe5e456d9b574f8c) )
346 	ROM_LOAD16_BYTE( "069eab02.18e", 0x000001,  0x40000, CRC(6bb11c87) SHA1(86581d24f73f2e837f1d4fc5f1f2188f610c50b6) )
347 	ROM_LOAD16_BYTE( "069a12.13e",   0x080000,  0x40000, CRC(75a7585c) SHA1(443d6dee99edbe81ab1b7289e6cad403fe01cc0d) )
348 	ROM_LOAD16_BYTE( "069a11.16e",   0x080001,  0x40000, CRC(3153e788) SHA1(fde4543eac707ef24b431e64011cf0f923d4d3ac) )
349 
350 	ROM_REGION( 0x010000, "audiocpu", 0 )
351 	ROM_LOAD( "069a01.7c", 0x000000, 0x010000, CRC(74172b99) SHA1(f5e0e0d43317454fdacd3df7cd3035fcae4aef68) )
352 
353 	ROM_REGION( 0x200000, "k056832", 0 )
354 	ROM_LOAD32_WORD( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
355 	ROM_LOAD32_WORD( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
356 
357 	ROM_REGION( 0x400000, "k053246", 0 )
358 	ROM_LOAD64_WORD( "069a08.6h", 0x000000, 0x100000, CRC(325477d4) SHA1(140c57b0ac9e5cf702d788f416408a5eeb5d6d3c) )
359 	ROM_LOAD64_WORD( "069a05.1h", 0x000002, 0x100000, CRC(c4ab07ed) SHA1(dc806eff00937d9465b1726fae8fdc3022464a28) )
360 	ROM_LOAD64_WORD( "069a07.4h", 0x000004, 0x100000, CRC(ccaa3971) SHA1(16989cbbd65fe1b41c4a85fea02ba1e9880818a9) )
361 	ROM_LOAD64_WORD( "069a06.2h", 0x000006, 0x100000, CRC(63eba8e1) SHA1(aa318d356c2580765452106ea0d2228273a90523) )
362 
363 	ROM_REGION( 0x200000, "k054539", 0 )
364 	ROM_LOAD( "069a04.1e", 0x000000, 0x200000, CRC(11d6dcd6) SHA1(04cbff9f61cd8641db538db809ddf20da29fd5ac) )
365 
366 	ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
367 	ROM_LOAD( "er5911.7d", 0x0000, 0x080, CRC(a0d50a79) SHA1(972533ea45a0e84d9dd14c55f58cd7247926792e) )
368 ROM_END
369 
370 // this set is strange, instead of showing program OK it shows the location and checksums of the ROMs
371 // this doesn't indicate failure, as if you hack the parent set it will show the checksum and the word 'BAD' and refuse to boot
372 // It will boot as whatever version string is in the EEPROM.  If no version string is in the EEPROM it just shows a blank string
373 // If you factory default it you get the string 'EB8'
374 // the roms had no proper labels
375 // maybe it's some interim / test revision
376 ROM_START( gijoeea )
377 	ROM_REGION( 0x100000, "maincpu", 0 )
378 	ROM_LOAD16_BYTE( "rom3.14e",   0x000000,  0x40000, CRC(0a11f63a) SHA1(06174682907e718017146665b8636be20843b119) )
379 	ROM_LOAD16_BYTE( "rom2.18e",   0x000001,  0x40000, CRC(8313c559) SHA1(00ae945c65439d4092eaa1780a182dbe3753bb02) )
380 	ROM_LOAD16_BYTE( "069a12.13e", 0x080000,  0x40000, CRC(75a7585c) SHA1(443d6dee99edbe81ab1b7289e6cad403fe01cc0d) )
381 	ROM_LOAD16_BYTE( "069a11.16e", 0x080001,  0x40000, CRC(3153e788) SHA1(fde4543eac707ef24b431e64011cf0f923d4d3ac) )
382 
383 	ROM_REGION( 0x010000, "audiocpu", 0 )
384 	ROM_LOAD( "069a01.7c", 0x000000, 0x010000, CRC(74172b99) SHA1(f5e0e0d43317454fdacd3df7cd3035fcae4aef68) )
385 
386 	ROM_REGION( 0x200000, "k056832", 0 )
387 	ROM_LOAD32_WORD( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
388 	ROM_LOAD32_WORD( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
389 
390 	ROM_REGION( 0x400000, "k053246", 0 )
391 	ROM_LOAD64_WORD( "069a08.6h", 0x000000, 0x100000, CRC(325477d4) SHA1(140c57b0ac9e5cf702d788f416408a5eeb5d6d3c) )
392 	ROM_LOAD64_WORD( "069a05.1h", 0x000002, 0x100000, CRC(c4ab07ed) SHA1(dc806eff00937d9465b1726fae8fdc3022464a28) )
393 	ROM_LOAD64_WORD( "069a07.4h", 0x000004, 0x100000, CRC(ccaa3971) SHA1(16989cbbd65fe1b41c4a85fea02ba1e9880818a9) )
394 	ROM_LOAD64_WORD( "069a06.2h", 0x000006, 0x100000, CRC(63eba8e1) SHA1(aa318d356c2580765452106ea0d2228273a90523) )
395 
396 	ROM_REGION( 0x200000, "k054539", 0 )
397 	ROM_LOAD( "069a04.1e", 0x000000, 0x200000, CRC(11d6dcd6) SHA1(04cbff9f61cd8641db538db809ddf20da29fd5ac) )
398 
399 	ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom
400 	ROM_LOAD( "er5911.7d", 0x0000, 0x080, CRC(64f5c87b) SHA1(af81abc54eb59ef7d2250b5ab6cc9642fbd9bfb2) ) // sldh
401 ROM_END
402 
403 ROM_START( gijoeu )
404 	ROM_REGION( 0x100000, "maincpu", 0 )
405 	ROM_LOAD16_BYTE( "069uab03.14e", 0x000000,  0x40000, CRC(25ff77d2) SHA1(bea2ae975718806698fd35ef1217bd842b2b69ec) )
406 	ROM_LOAD16_BYTE( "069uab02.18e", 0x000001,  0x40000, CRC(31cced1c) SHA1(3df1def671966b3c3d8117ac1b68adeeef9d98c0) )
407 	ROM_LOAD16_BYTE( "069a12.13e",   0x080000,  0x40000, CRC(75a7585c) SHA1(443d6dee99edbe81ab1b7289e6cad403fe01cc0d) )
408 	ROM_LOAD16_BYTE( "069a11.16e",   0x080001,  0x40000, CRC(3153e788) SHA1(fde4543eac707ef24b431e64011cf0f923d4d3ac) )
409 
410 	ROM_REGION( 0x010000, "audiocpu", 0 )
411 	ROM_LOAD( "069a01.7c", 0x000000, 0x010000, CRC(74172b99) SHA1(f5e0e0d43317454fdacd3df7cd3035fcae4aef68) )
412 
413 	ROM_REGION( 0x200000, "k056832", 0 )
414 	ROM_LOAD32_WORD( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
415 	ROM_LOAD32_WORD( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
416 
417 	ROM_REGION( 0x400000, "k053246", 0 )
418 	ROM_LOAD64_WORD( "069a08.6h", 0x000000, 0x100000, CRC(325477d4) SHA1(140c57b0ac9e5cf702d788f416408a5eeb5d6d3c) )
419 	ROM_LOAD64_WORD( "069a05.1h", 0x000002, 0x100000, CRC(c4ab07ed) SHA1(dc806eff00937d9465b1726fae8fdc3022464a28) )
420 	ROM_LOAD64_WORD( "069a07.4h", 0x000004, 0x100000, CRC(ccaa3971) SHA1(16989cbbd65fe1b41c4a85fea02ba1e9880818a9) )
421 	ROM_LOAD64_WORD( "069a06.2h", 0x000006, 0x100000, CRC(63eba8e1) SHA1(aa318d356c2580765452106ea0d2228273a90523) )
422 
423 	ROM_REGION( 0x200000, "k054539", 0 )
424 	ROM_LOAD( "069a04.1e", 0x000000, 0x200000, CRC(11d6dcd6) SHA1(04cbff9f61cd8641db538db809ddf20da29fd5ac) )
425 
426 	ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
427 	ROM_LOAD( "er5911.7d", 0x0000, 0x080, CRC(ca966023) SHA1(6f07ece0f95213bc12387192986f468d23dfdfc8) ) // sldh
428 ROM_END
429 
430 ROM_START( gijoeua ) // this uses a standard GX069 main PCB, but the GFX ROMs are moved to the 'ROM BOARD MAX352M PWB 352673'
431 	ROM_REGION( 0x100000, "maincpu", 0 )
432 	ROM_LOAD16_BYTE( "069uaa03.14e", 0x000000,  0x40000, CRC(cfb1af44) SHA1(b4e68dbead19a5211778345330739cfcb37011ab) )
433 	ROM_LOAD16_BYTE( "069uaa02.18e", 0x000001,  0x40000, CRC(3e6a56cd) SHA1(df719197dc001e80be8d04ced68f8937a9d6d1fe) )
434 	ROM_LOAD16_BYTE( "069a12.13e",   0x080000,  0x40000, CRC(75a7585c) SHA1(443d6dee99edbe81ab1b7289e6cad403fe01cc0d) )
435 	ROM_LOAD16_BYTE( "069a11.16e",   0x080001,  0x40000, CRC(3153e788) SHA1(fde4543eac707ef24b431e64011cf0f923d4d3ac) )
436 
437 	ROM_REGION( 0x010000, "audiocpu", 0 )
438 	ROM_LOAD( "069a01.7c", 0x000000, 0x010000, CRC(74172b99) SHA1(f5e0e0d43317454fdacd3df7cd3035fcae4aef68) )
439 
440 	// the GFX ROMs are smaller and believed to have the same content as the other sets, in fact the game runs fine. Still better to have them dumped
441 	// only 4 GFX ROMs were dumped from this PCB because the others are soldered ant the dumper didn't want to risk damage
442 	ROM_REGION( 0x200000, "k056832", 0 )
443 	ROM_LOAD32_BYTE( "069a10al.d7", 0x000000, 0x40000, NO_DUMP )
444 	ROM_LOAD32_BYTE( "069a10ah.d9", 0x000001, 0x40000, NO_DUMP )
445 	ROM_LOAD32_BYTE( "069a09al.d3", 0x000002, 0x40000, NO_DUMP )
446 	ROM_LOAD32_BYTE( "069a09ah.d5", 0x000003, 0x40000, NO_DUMP )
447 	ROM_LOAD32_BYTE( "069a10bl.j7", 0x100000, 0x40000, CRC(087d8e25) SHA1(b26eca0f96c91c18143b5e7a77aaf3831e935d5e) )
448 	ROM_LOAD32_BYTE( "069a10bh.j9", 0x100001, 0x40000, CRC(fc7ad198) SHA1(ef9b834af04b78aa1c205e1c63da0fdec07783bb) )
449 	ROM_LOAD32_BYTE( "069a09bl.j3", 0x100002, 0x40000, CRC(385217cc) SHA1(3b1fa53fde8e500e5e06a16a2ae71457c23a73a4) )
450 	ROM_LOAD32_BYTE( "069a09bh.j5", 0x100003, 0x40000, CRC(c6d43c8a) SHA1(5bbb6c8d160e32097f2327ae3708037a9b9543f3) )
451 	// overlay standard ROMs for now
452 	ROM_LOAD32_WORD( "069a10.18j", 0x000000, 0x100000, BAD_DUMP CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
453 	ROM_LOAD32_WORD( "069a09.16j", 0x000002, 0x100000, BAD_DUMP CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
454 
455 	ROM_REGION( 0x400000, "k053246", 0 )
456 	ROM_LOAD64_BYTE( "069a08al.k3", 0x000000, 0x40000, NO_DUMP )
457 	ROM_LOAD64_BYTE( "069a08ah.n3", 0x000001, 0x40000, NO_DUMP )
458 	ROM_LOAD64_BYTE( "069a05al.k5", 0x000002, 0x40000, NO_DUMP )
459 	ROM_LOAD64_BYTE( "069a05ah.n5", 0x000003, 0x40000, NO_DUMP )
460 	ROM_LOAD64_BYTE( "069a07al.k7", 0x000004, 0x40000, NO_DUMP )
461 	ROM_LOAD64_BYTE( "069a07ah.n7", 0x000005, 0x40000, NO_DUMP )
462 	ROM_LOAD64_BYTE( "069a06al.k9", 0x000006, 0x40000, NO_DUMP )
463 	ROM_LOAD64_BYTE( "069a06ah.n9", 0x000007, 0x40000, NO_DUMP )
464 	ROM_LOAD64_BYTE( "069a08bl.l3", 0x200000, 0x40000, NO_DUMP )
465 	ROM_LOAD64_BYTE( "069a08bh.p3", 0x200001, 0x40000, NO_DUMP )
466 	ROM_LOAD64_BYTE( "069a05bl.l5", 0x200002, 0x40000, NO_DUMP )
467 	ROM_LOAD64_BYTE( "069a05bh.p5", 0x200003, 0x40000, NO_DUMP )
468 	ROM_LOAD64_BYTE( "069a07bl.l7", 0x200004, 0x40000, NO_DUMP )
469 	ROM_LOAD64_BYTE( "069a07bh.p7", 0x200005, 0x40000, NO_DUMP )
470 	ROM_LOAD64_BYTE( "069a06bl.l9", 0x200006, 0x40000, NO_DUMP )
471 	ROM_LOAD64_BYTE( "069a06bh.p9", 0x200007, 0x40000, NO_DUMP )
472 	// overlay standard ROMs for now
473 	ROM_LOAD64_WORD( "069a08.6h", 0x000000, 0x100000, BAD_DUMP CRC(325477d4) SHA1(140c57b0ac9e5cf702d788f416408a5eeb5d6d3c) )
474 	ROM_LOAD64_WORD( "069a05.1h", 0x000002, 0x100000, BAD_DUMP CRC(c4ab07ed) SHA1(dc806eff00937d9465b1726fae8fdc3022464a28) )
475 	ROM_LOAD64_WORD( "069a07.4h", 0x000004, 0x100000, BAD_DUMP CRC(ccaa3971) SHA1(16989cbbd65fe1b41c4a85fea02ba1e9880818a9) )
476 	ROM_LOAD64_WORD( "069a06.2h", 0x000006, 0x100000, BAD_DUMP CRC(63eba8e1) SHA1(aa318d356c2580765452106ea0d2228273a90523) )
477 
478 	ROM_REGION( 0x200000, "k054539", 0 )
479 	ROM_LOAD( "069a04a.g2", 0x000000, 0x40000, NO_DUMP )
480 	ROM_LOAD( "069a04b.j2", 0x040000, 0x40000, NO_DUMP )
481 	ROM_LOAD( "069a04c.k2", 0x080000, 0x40000, NO_DUMP )
482 	ROM_LOAD( "069a04d.l2", 0x0c0000, 0x40000, NO_DUMP )
483 	ROM_LOAD( "069a04e.n2", 0x100000, 0x40000, NO_DUMP )
484 	ROM_LOAD( "069a04f.p2", 0x140000, 0x40000, NO_DUMP )
485 	ROM_LOAD( "069a04g.r2", 0x180000, 0x40000, NO_DUMP )
486 	ROM_LOAD( "069a04h.s2", 0x1c0000, 0x40000, NO_DUMP )
487 	// overlay standard ROM for now
488 	ROM_LOAD( "069a04a.1e", 0x000000, 0x200000, BAD_DUMP CRC(11d6dcd6) SHA1(04cbff9f61cd8641db538db809ddf20da29fd5ac) )
489 
490 	ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
491 	ROM_LOAD( "er5911.7d", 0x0000, 0x080, CRC(33b07813) SHA1(aa4df1b4265e24cb79d1405dfdf5998689f6561e) ) // sldh
492 ROM_END
493 
494 ROM_START( gijoej )
495 	ROM_REGION( 0x100000, "maincpu", 0 )
496 	ROM_LOAD16_BYTE( "069jaa03.14e", 0x000000,  0x40000, CRC(4b398901) SHA1(98fcc6ae9cc69c67d82eb1a7ab0bb71e61aee623) )
497 	ROM_LOAD16_BYTE( "069jaa02.18e", 0x000001,  0x40000, CRC(8bb22392) SHA1(9f066ce2b529f7dad6f80a91fff266c478d56414) )
498 	ROM_LOAD16_BYTE( "069a12.13e",   0x080000,  0x40000, CRC(75a7585c) SHA1(443d6dee99edbe81ab1b7289e6cad403fe01cc0d) )
499 	ROM_LOAD16_BYTE( "069a11.16e",   0x080001,  0x40000, CRC(3153e788) SHA1(fde4543eac707ef24b431e64011cf0f923d4d3ac) )
500 
501 	ROM_REGION( 0x010000, "audiocpu", 0 )
502 	ROM_LOAD( "069a01.7c", 0x000000, 0x010000, CRC(74172b99) SHA1(f5e0e0d43317454fdacd3df7cd3035fcae4aef68) )
503 
504 	ROM_REGION( 0x200000, "k056832", 0 )
505 	ROM_LOAD32_WORD( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
506 	ROM_LOAD32_WORD( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
507 
508 	ROM_REGION( 0x400000, "k053246", 0 )
509 	ROM_LOAD64_WORD( "069a08.6h", 0x000000, 0x100000, CRC(325477d4) SHA1(140c57b0ac9e5cf702d788f416408a5eeb5d6d3c) )
510 	ROM_LOAD64_WORD( "069a05.1h", 0x000002, 0x100000, CRC(c4ab07ed) SHA1(dc806eff00937d9465b1726fae8fdc3022464a28) )
511 	ROM_LOAD64_WORD( "069a07.4h", 0x000004, 0x100000, CRC(ccaa3971) SHA1(16989cbbd65fe1b41c4a85fea02ba1e9880818a9) )
512 	ROM_LOAD64_WORD( "069a06.2h", 0x000006, 0x100000, CRC(63eba8e1) SHA1(aa318d356c2580765452106ea0d2228273a90523) )
513 
514 	ROM_REGION( 0x200000, "k054539", 0 )
515 	ROM_LOAD( "069a04.1e", 0x000000, 0x200000, CRC(11d6dcd6) SHA1(04cbff9f61cd8641db538db809ddf20da29fd5ac) )
516 
517 	ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
518 	ROM_LOAD( "er5911.7d", 0x0000, 0x080, CRC(c914fcf2) SHA1(b4f0a0b5d6d4075b004b061336d162336ce1a754) ) // sldh
519 ROM_END
520 
521 ROM_START( gijoea )
522 	ROM_REGION( 0x100000, "maincpu", 0 )
523 	ROM_LOAD16_BYTE( "069aa03.14e", 0x000000,  0x40000, CRC(74355c6e) SHA1(01d7b5994c5b9b6e87fb9a35ffed9cc540cfcd05) )
524 	ROM_LOAD16_BYTE( "069aa02.18e", 0x000001,  0x40000, CRC(d3dd0397) SHA1(6caac73d259ff6707ded2457b4968d3d0a3c4eb3) )
525 	ROM_LOAD16_BYTE( "069a12.13e",  0x080000,  0x40000, CRC(75a7585c) SHA1(443d6dee99edbe81ab1b7289e6cad403fe01cc0d) )
526 	ROM_LOAD16_BYTE( "069a11.16e",  0x080001,  0x40000, CRC(3153e788) SHA1(fde4543eac707ef24b431e64011cf0f923d4d3ac) )
527 
528 	ROM_REGION( 0x010000, "audiocpu", 0 )
529 	ROM_LOAD( "069a01.7c", 0x000000, 0x010000, CRC(74172b99) SHA1(f5e0e0d43317454fdacd3df7cd3035fcae4aef68) )
530 
531 	ROM_REGION( 0x200000, "k056832", 0 )
532 	ROM_LOAD32_WORD( "069a10.18j", 0x000000, 0x100000, CRC(4c6743ee) SHA1(fa94fbfb55955fdb40705e79b49103676961d919) )
533 	ROM_LOAD32_WORD( "069a09.16j", 0x000002, 0x100000, CRC(e6e36b05) SHA1(fecad503f2c285b2b0312e888c06dd6e87f95a07) )
534 
535 	ROM_REGION( 0x400000, "k053246", 0 )
536 	ROM_LOAD64_WORD( "069a08.6h", 0x000000, 0x100000, CRC(325477d4) SHA1(140c57b0ac9e5cf702d788f416408a5eeb5d6d3c) )
537 	ROM_LOAD64_WORD( "069a05.1h", 0x000002, 0x100000, CRC(c4ab07ed) SHA1(dc806eff00937d9465b1726fae8fdc3022464a28) )
538 	ROM_LOAD64_WORD( "069a07.4h", 0x000004, 0x100000, CRC(ccaa3971) SHA1(16989cbbd65fe1b41c4a85fea02ba1e9880818a9) )
539 	ROM_LOAD64_WORD( "069a06.2h", 0x000006, 0x100000, CRC(63eba8e1) SHA1(aa318d356c2580765452106ea0d2228273a90523) )
540 
541 	ROM_REGION( 0x200000, "k054539", 0 )
542 	ROM_LOAD( "069a04.1e", 0x000000, 0x200000, CRC(11d6dcd6) SHA1(04cbff9f61cd8641db538db809ddf20da29fd5ac) )
543 
544 	ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom
545 	ROM_LOAD( "er5911.7d", 0x0000, 0x080, CRC(6363513c) SHA1(181cbf2bd4960740d437c714dc70bb7e64c95348) ) // sldh
546 ROM_END
547 
548 
549 GAME( 1992, gijoe,   0,     gijoe, gijoe, gijoe_state, empty_init, ROT0, "Konami", "G.I. Joe (World, EAB, set 1)", MACHINE_SUPPORTS_SAVE )
550 GAME( 1992, gijoeea, gijoe, gijoe, gijoe, gijoe_state, empty_init, ROT0, "Konami", "G.I. Joe (World, EB8, prototype?)", MACHINE_SUPPORTS_SAVE )
551 GAME( 1992, gijoeu,  gijoe, gijoe, gijoe, gijoe_state, empty_init, ROT0, "Konami", "G.I. Joe (US, UAB)", MACHINE_SUPPORTS_SAVE )
552 GAME( 1992, gijoeua, gijoe, gijoe, gijoe, gijoe_state, empty_init, ROT0, "Konami", "G.I. Joe (US, UAA)", MACHINE_SUPPORTS_SAVE )
553 GAME( 1992, gijoej,  gijoe, gijoe, gijoe, gijoe_state, empty_init, ROT0, "Konami", "G.I. Joe (Japan, JAA)", MACHINE_SUPPORTS_SAVE )
554 GAME( 1992, gijoea,  gijoe, gijoe, gijoe, gijoe_state, empty_init, ROT0, "Konami", "G.I. Joe (Asia, AA)", MACHINE_SUPPORTS_SAVE )
555