summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/tasman.cpp
blob: 9beb36406e3204d14d11bad1bcdb578bf6e1b139 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
// license:BSD-3-Clause
// copyright-holders:Philip Bennett, R. Belmont
/*
  Konami Gambling Games ("Tasman" hardware)
  System GX derivative

  68EC020 @ 25 MHz
  K056832 + K058143 : GX tilemaps
  K055673(x2) + K053246A : (extended?) GX sprites
  K055555 : GX mixer/blender

  68000 @ 16 MHz + YMZ280B for audio

  Thanks to palindrome for PCB scans.

    0x38606

  TODO:
  - dual port sound RAM;
  - interrupt sources / irq masking;
*/

#include "emu.h"
#include "video/konami_helper.h"
#include "cpu/m68000/m68000.h"
#include "machine/k053252.h"
#include "machine/timer.h"
#include "video/k053246_k053247_k055673.h"
#include "video/k054156_k054157_k056832.h"
#include "video/k055555.h"
#include "machine/eepromser.h"
#include "emupal.h"
#include "speaker.h"


#define CUSTOM_DRAW 1

class kongambl_state : public driver_device
{
public:
	kongambl_state(const machine_config &mconfig, device_type type, const char *tag) :
		driver_device(mconfig, type, tag),
		m_maincpu(*this,"maincpu"),
		m_k053252(*this, "k053252"),
		m_k055673(*this, "k055673"),
		m_k055555(*this, "k055555"),
		m_k056832(*this, "k056832"),
#if CUSTOM_DRAW
		m_gfxdecode(*this, "gfxdecode"),
#endif
		m_screen(*this, "screen"),
		m_palette(*this, "palette"),
		m_vram(*this, "vram")
	{ }

	void kongambl(machine_config &config);

	void init_kingtut();

private:
	required_device<cpu_device> m_maincpu;
	required_device<k053252_device> m_k053252;
	required_device<k055673_device> m_k055673;
	required_device<k055555_device> m_k055555;
	required_device<k056832_device> m_k056832;
#if CUSTOM_DRAW
	required_device<gfxdecode_device> m_gfxdecode;
#endif
	required_device<screen_device> m_screen;
	required_device<palette_device> m_palette;

	optional_shared_ptr<uint32_t> m_vram;
	DECLARE_READ32_MEMBER(eeprom_r);
	DECLARE_WRITE8_MEMBER(eeprom_w);
	DECLARE_WRITE8_MEMBER(kongambl_ff_w);
	DECLARE_READ32_MEMBER(test_r);
	// DECLARE_READ32_MEMBER(rng_r);

	DECLARE_VIDEO_START(kongambl);
	uint8_t m_irq_mask;

	virtual void machine_reset() override { m_irq_mask = 0; };
	uint32_t screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	WRITE_LINE_MEMBER(vblank_irq_ack_w);
	WRITE_LINE_MEMBER(hblank_irq_ack_w);
	TIMER_DEVICE_CALLBACK_MEMBER(kongambl_vblank);
	K056832_CB_MEMBER(tile_callback);
	K053246_CB_MEMBER(sprite_callback);

	void kongamaud_map(address_map &map);
	void kongambl_map(address_map &map);
};


VIDEO_START_MEMBER(kongambl_state,kongambl)
{
	#if CUSTOM_DRAW

	#else
	m_k056832->set_layer_association(0);
	m_k056832->set_layer_offs(0, -2, 0);
	m_k056832->set_layer_offs(1,  2, 0);
	m_k056832->set_layer_offs(2,  4, 0);
	m_k056832->set_layer_offs(3,  6, 0);
	#endif
}

uint32_t kongambl_state::screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	#if CUSTOM_DRAW
	gfx_element *gfx = m_gfxdecode->gfx(0);
	uint32_t count;

	count = 0;

	for (int y=0;y<64;y++)
	{
		for (int x=0;x<128;x++)
		{
			uint32_t tile = m_vram[count] & 0xffff;

			if(m_screen->visible_area().contains(x*8, y*8))
				gfx->opaque(bitmap,cliprect,tile,0,0,0,x*8,y*8);

			count++;
		}
	}

	count = 0x8000/4;

	for (int y=0;y<64;y++)
	{
		for (int x=0;x<128;x++)
		{
			uint32_t tile = m_vram[count] & 0xffff;

			if(m_screen->visible_area().contains(x*8, y*8))
				gfx->transpen(bitmap,cliprect,tile,0,0,0,x*8,y*8,0);

			count++;
		}
	}


	#else
	bitmap.fill(0, cliprect);
	screen.priority().fill(0, cliprect);

	m_k056832->tilemap_draw(screen, bitmap, cliprect, 3, 0, 0);
	m_k056832->tilemap_draw(screen, bitmap, cliprect, 2, 0, 0);
	m_k056832->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0);
	m_k056832->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0);
	#endif
	return 0;
}

READ32_MEMBER(kongambl_state::eeprom_r)
{
	//return machine().rand();
	uint32_t retval = 0;

	if (ACCESSING_BITS_24_31)
		retval |= ioport("IN0")->read() << 24; // bit 0 freezes the system if 1

	if (ACCESSING_BITS_16_23)
		retval |= ioport("EXT_PCB")->read() << 16; // ???

	if (ACCESSING_BITS_8_15)
		retval |= ioport("IN2")->read() << 8; // ???

	if (ACCESSING_BITS_0_7)
		retval |= (ioport("SYSTEM")->read());


//  printf("%08x\n",mem_mask);

	return retval;
}
WRITE8_MEMBER(kongambl_state::eeprom_w)
{
	// offset == 3 seems mux writes (active low)

	if (offset == 2)
	{
		ioport("EEPROMOUT")->write(data&0x7, 0xff);
		if(data & 0xf8)
			printf("Unused EEPROM bits %02x %02x\n",offset,data);
	}
	else
		printf("%02x %02x\n",offset,data);

	if(offset == 0)
		m_irq_mask = data;
}

READ32_MEMBER(kongambl_state::test_r)
{
	return -1;//machine().rand();
}

/*
 READ32_MEMBER(kongambl_state::rng_r)
{
    return machine().rand();
}
*/

WRITE8_MEMBER(kongambl_state::kongambl_ff_w)
{
	/* enables thru 0->1 */
	/* ---- x--- (related to OBJ ROM) */
	/* ---- -x-- k056832 upper ROM bank */
	/* ---- --x- k056832 related (enabled when testing ROM area) */
//  printf("%02x\n",data);
}

void kongambl_state::kongambl_map(address_map &map)
{
	map(0x000000, 0x0fffff).rom(); // main program
	map(0x100000, 0x11ffff).ram(); // work RAM

	map(0x200000, 0x207fff).ram(); // backup RAM 24F

	map(0x300000, 0x307fff).ram(); // backup RAM 24H

	// override konami chips with custom areas until that code is removed
	map(0x400000, 0x401fff).rom().region("k056832", 0);
	map(0x420000, 0x43ffff).ram().share("vram");
	//map(0x480000, 0x48003f).ram(); // vregs

	//0x400000 0x400001 "13M" even addresses
	//0x400002,0x400003 "13J" odd addresses
//  map(0x400000, 0x401fff).r(m_k056832, FUNC(k056832_device::rom_word_r));
//  map(0x420000, 0x43ffff).rw(m_k056832, FUNC(k056832_device::unpaged_ram_word_r), FUNC(k056832_device::unpaged_ram_word_w));
	map(0x480000, 0x48003f).w(m_k056832, FUNC(k056832_device::word_w));



	map(0x440000, 0x443fff).ram(); // OBJ RAM

	map(0x460000, 0x47ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette");

	map(0x4b0000, 0x4b001f).rw(m_k053252, FUNC(k053252_device::read), FUNC(k053252_device::write)).umask32(0xff00ff00);

	map(0x4c0000, 0x4c0007).w(m_k055673, FUNC(k055673_device::k053246_w));
	//map(0x4c4000, 0x4c4003).nopw();
	//map(0x4c4004, 0x4c4007).nopw();
	//map(0x4c801c, 0x4c801f).nopw();
	//map(0x4cc01c, 0x4cc01f).nopw();

	map(0x4cc000, 0x4cc00f).r(m_k055673, FUNC(k055673_device::k055673_rom_word_r));

	map(0x4d0000, 0x4d0000).w(FUNC(kongambl_state::kongambl_ff_w));

	map(0x500000, 0x5007ff).ram();
	map(0x500380, 0x500383).r(FUNC(kongambl_state::test_r));
//  map(0x500400, 0x500403).noprw(); //dual port?
//  map(0x500420, 0x500423).noprw(); //dual port?
//  map(0x500500, 0x500503).noprw(); // reads sound ROM in here, polled from m68k?
	map(0x580000, 0x580007).r(FUNC(kongambl_state::test_r));

	map(0x600000, 0x60000f).r(FUNC(kongambl_state::test_r));

	map(0x700000, 0x700003).r(FUNC(kongambl_state::eeprom_r));
	map(0x700004, 0x700007).portr("IN1");
	map(0x700008, 0x70000b).portr("IN3");
	map(0x780000, 0x780003).w(FUNC(kongambl_state::eeprom_w));
	//map(0x780004, 0x780007).nopw();
}

void kongambl_state::kongamaud_map(address_map &map)
{
	map(0x000000, 0x01ffff).rom(); // main program (mirrored?)
	map(0x100000, 0x10ffff).ram(); // work RAM
	map(0x180000, 0x180001).nopw();
	map(0x190000, 0x190001).nopw();
	map(0x1a0000, 0x1a0001).nopw();
	map(0x1b0000, 0x1b0001).nopr();
	map(0x1c0000, 0x1c0001).nopr();
	map(0x200000, 0x2000ff).ram(); // unknown (YMZ280b?  Shared with 68020?)
	map(0x280000, 0x2800ff).ram();
	map(0x300000, 0x3007ff).ram();
}



static INPUT_PORTS_START( kongambl )
	PORT_START( "SYSTEM" )
	PORT_DIPNAME( 0x01, 0x00, "SYSTEM" )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x01, DEF_STR( On ) )
	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x02, DEF_STR( On ) )
	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x80, DEF_STR( On ) )

	PORT_START( "IN0" )
	PORT_DIPNAME( 0x01, 0x00, "SYSA" )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x01, DEF_STR( On ) )
	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x02, DEF_STR( On ) )
	PORT_DIPNAME( 0x04, 0x00, "Reset Backup RAM" )
	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
	PORT_DIPSETTING(    0x04, DEF_STR( No ) )
	PORT_DIPNAME( 0x08, 0x08, "Reset Signal" )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x80, DEF_STR( On ) )

	PORT_START( "EXT_PCB" )
	PORT_DIPNAME( 0x01, 0x00, "SYSB" )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x01, DEF_STR( On ) )
	PORT_DIPNAME( 0x02, 0x02, "No Battery - 1" ) // "NO BATTERY"
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x02, DEF_STR( On ) )
	PORT_DIPNAME( 0x04, 0x04, "No Battery - 2" ) // "NO BATTERY"
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
	PORT_DIPNAME( 0x10, 0x00, "IFU signal" ) // IFU
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
	PORT_DIPNAME( 0x20, 0x00, "LCU signal" ) // LCU
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
	PORT_DIPNAME( 0x40, 0x00, "VSB signal" ) // VSB
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x80, DEF_STR( On ) )

	PORT_START( "IN1" )
	PORT_DIPNAME( 0x01, 0x00, "SYSC" )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x01, DEF_STR( On ) )
	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x02, DEF_STR( On ) )
	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
	PORT_DIPNAME( 0x0100, 0x0000, "SYSD" )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x0100, DEF_STR( On ) )
	PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x0200, DEF_STR( On ) )
	PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x0400, DEF_STR( On ) )
	PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x0800, DEF_STR( On ) )
	PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x1000, DEF_STR( On ) )
	PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x2000, DEF_STR( On ) )
	PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Service_Mode ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x4000, DEF_STR( On ) )
	PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x8000, DEF_STR( On ) )
	PORT_DIPNAME( 0x010000, 0x000000, "SYSE" )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x010000, DEF_STR( On ) )
	PORT_DIPNAME( 0x020000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x020000, DEF_STR( On ) )
	PORT_DIPNAME( 0x040000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x040000, DEF_STR( On ) )
	PORT_DIPNAME( 0x080000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x080000, DEF_STR( On ) )
	PORT_DIPNAME( 0x100000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x100000, DEF_STR( On ) )
	PORT_DIPNAME( 0x200000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x200000, DEF_STR( On ) )
	PORT_DIPNAME( 0x400000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x400000, DEF_STR( On ) )
	PORT_DIPNAME( 0x800000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x800000, DEF_STR( On ) )
	PORT_DIPNAME( 0x01000000, 0x00000000, "SYSF" )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x01000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x02000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x02000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x04000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x04000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x08000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x08000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x10000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x10000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x20000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x20000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x40000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x40000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x80000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x80000000, DEF_STR( On ) )

	PORT_START( "IN2" )
	PORT_DIPNAME( 0x01, 0x00, "SYSG" )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x01, DEF_STR( On ) )
	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x02, DEF_STR( On ) )
	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x80, DEF_STR( On ) )

	PORT_START( "IN3" )
	PORT_DIPNAME( 0x01, 0x01, "SYSC" )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x01, DEF_STR( On ) )
	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x02, DEF_STR( On ) )
	PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
	PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
	PORT_DIPNAME( 0x0100, 0x0000, "SYSD" )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x0100, DEF_STR( On ) )
	PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x0200, DEF_STR( On ) )
	PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x0400, DEF_STR( On ) )
	PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x0800, DEF_STR( On ) )
	PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x1000, DEF_STR( On ) )
	PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x2000, DEF_STR( On ) )
	PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x4000, DEF_STR( On ) )
	PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x0000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x8000, DEF_STR( On ) )
	PORT_DIPNAME( 0x010000, 0x000000, "SYSE" )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x010000, DEF_STR( On ) )
	PORT_DIPNAME( 0x020000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x020000, DEF_STR( On ) )
	PORT_DIPNAME( 0x040000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x040000, DEF_STR( On ) )
	PORT_DIPNAME( 0x080000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x080000, DEF_STR( On ) )
	PORT_DIPNAME( 0x100000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x100000, DEF_STR( On ) )
	PORT_DIPNAME( 0x200000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x200000, DEF_STR( On ) )
	PORT_DIPNAME( 0x400000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x400000, DEF_STR( On ) )
	PORT_DIPNAME( 0x800000, 0x000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x800000, DEF_STR( On ) )
	PORT_DIPNAME( 0x01000000, 0x00000000, "SYSF" )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x01000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x02000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x02000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x04000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x04000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x08000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x08000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x10000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x10000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x20000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x20000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x40000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x40000000, DEF_STR( On ) )
	PORT_DIPNAME( 0x80000000, 0x00000000, DEF_STR( Unknown ) )
	PORT_DIPSETTING(    0x00000000, DEF_STR( Off ) )
	PORT_DIPSETTING(    0x80000000, DEF_STR( On ) )

	PORT_START( "EEPROMOUT" )
	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, di_write)
	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, clk_write)
	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, cs_write)
INPUT_PORTS_END


K053246_CB_MEMBER(kongambl_state::sprite_callback)
{
}

K056832_CB_MEMBER(kongambl_state::tile_callback)
{
}


static const gfx_layout charlayout8_tasman =
{
	8,8,
	RGN_FRAC(1,1),
	8,
	// 0,8,16,24,32,40,48,56
	{ 56,24,40,8,48,16,32,0 },
	{ 0,1,2,3,4,5,6,7 },
	{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64},
	8*64
};

static GFXDECODE_START( gfx_tasman )
	GFXDECODE_ENTRY( "k056832", 0, charlayout8_tasman, 0, 0x8000/(1 << 8) )
GFXDECODE_END


WRITE_LINE_MEMBER(kongambl_state::vblank_irq_ack_w)
{
	m_maincpu->set_input_line(1, CLEAR_LINE);
}

WRITE_LINE_MEMBER(kongambl_state::hblank_irq_ack_w)
{
	m_maincpu->set_input_line(2, CLEAR_LINE);
}

TIMER_DEVICE_CALLBACK_MEMBER(kongambl_state::kongambl_vblank)
{
	int scanline = param;

	// disabled for now since it interferes with the ROM tests
	if(scanline == 384 && m_irq_mask & 1)
		m_maincpu->set_input_line(1, HOLD_LINE); // vblank?

	//if(scanline == 256 && m_irq_mask & 2)
	//  m_maincpu->set_input_line(2, HOLD_LINE); // unknown (jumps to work RAM via a branch or returns lv 2 exception error, extension board?)

	if(scanline == 0 && m_irq_mask & 4)
		m_maincpu->set_input_line(3, HOLD_LINE); // sprite irq?

	if(scanline == 128 && m_irq_mask & 8)
		m_maincpu->set_input_line(4, HOLD_LINE); // sound irq

}

void kongambl_state::kongambl(machine_config &config)
{
	M68EC020(config, m_maincpu, 25000000);
	m_maincpu->set_addrmap(AS_PROGRAM, &kongambl_state::kongambl_map);
	TIMER(config, "scantimer").configure_scanline(FUNC(kongambl_state::kongambl_vblank), "screen", 0, 1);

	m68000_device &sndcpu(M68000(config, "sndcpu", 16000000));
	sndcpu.set_addrmap(AS_PROGRAM, &kongambl_state::kongamaud_map);
	sndcpu.set_periodic_int(FUNC(kongambl_state::irq2_line_hold), attotime::from_hz(480));

	K053252(config, m_k053252, 25000000);
	m_k053252->set_offsets(0, 16); // TBD
	m_k053252->int1_ack().set(FUNC(kongambl_state::vblank_irq_ack_w));
	m_k053252->int2_ack().set(FUNC(kongambl_state::hblank_irq_ack_w));
	m_k053252->set_screen(m_screen);

	EEPROM_93C46_16BIT(config, "eeprom");

	SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
	m_screen->set_raw(25000000, 288+16+32+48, 0, 287, 224+16+8+16, 0, 223); // fake, they'll be changed by CCU anyway, TBD
	m_screen->set_screen_update(FUNC(kongambl_state::screen_update_kongambl));
	m_screen->set_palette(m_palette);

	PALETTE(config, m_palette).set_format(palette_device::xRGB_888, 32768);

	MCFG_VIDEO_START_OVERRIDE(kongambl_state,kongambl)

	K055555(config, m_k055555, 0);

	K055673(config, m_k055673, 0);
	m_k055673->set_sprite_callback(FUNC(kongambl_state::sprite_callback), this);
	m_k055673->set_config(K055673_LAYOUT_LE2, -48+1, -23);
	m_k055673->set_palette(m_palette);

#if CUSTOM_DRAW
	GFXDECODE(config, m_gfxdecode, m_palette, gfx_tasman);
#endif

	K056832(config, m_k056832, 0);
	m_k056832->set_tile_callback(FUNC(kongambl_state::tile_callback), this);
	m_k056832->set_config(K056832_BPP_8TASMAN, 0, 0);
	m_k056832->set_palette(m_palette);

	SPEAKER(config, "lspeaker").front_left();
	SPEAKER(config, "rspeaker").front_right();
}


ROM_START( kingtut )
	ROM_REGION( 0x100000, "maincpu", 0 ) /* 68EC020 Code */
	ROM_LOAD32_WORD_SWAP( "kitp1b37_l.02", 0x000002, 0x40000, CRC(95c6da28) SHA1(3ef33f5d0748c80be82d33c21f0f8bb71909884e) )
	ROM_RELOAD(0x080002, 0x40000)
	ROM_LOAD32_WORD_SWAP( "kitp1b37_h.01", 0x000000, 0x40000, CRC(16709625) SHA1(6b818a85724f87fed23a26978dd26b079f814134) )
	ROM_RELOAD(0x080000, 0x40000)

	ROM_REGION( 0x80000, "sndcpu", 0 ) /* 68000 sound program */
	ROM_LOAD16_WORD_SWAP( "n12prog_ifu.41", 0x00000, 0x08000, CRC(dbb8a7e8) SHA1(9662b34e9332385d20e17ee1c92fd91935d4c3b2) )

	ROM_REGION( 0x100000, "k056832", 0 ) // 8x8x8 tiles
	ROM_LOAD16_BYTE( "kit11_l1_vrm.21", 0x000000, 0x80000, CRC(431eb89f) SHA1(377c96f615b4b76314aeecad4e868edb66c72f33) )
	ROM_LOAD16_BYTE( "kit11_h1_vrm.23", 0x000001, 0x80000, CRC(7aa2f1bc) SHA1(d8aead9dedcc83d3dc574122103aaa2074011197) )

	ROM_REGION( 0x200000, "k055673", 0 ) // 16x16x8 sprites
	ROM_LOAD64_WORD( "kit11ll1_obj.17", 0x000000, 0x80000, CRC(a19338b8) SHA1(1aa68596e5bf493cb360495f1174dc1323086ad2) )
	ROM_LOAD64_WORD( "kit11lm1_obj.15", 0x000002, 0x80000, CRC(1aea3f4d) SHA1(52fd1a7ffeeb3acce176ad3812a2ca146e02c324) )
	ROM_LOAD64_WORD( "kit11hm1_obj.13", 0x000004, 0x80000, CRC(21cc4e40) SHA1(9e3735fc8cd53f7e831dc76697911216bd8bbc70) )
	ROM_LOAD64_WORD( "kit11hh1_obj.11", 0x000006, 0x80000, CRC(a64d2382) SHA1(bb745a26ef6c076f3aa3ec476589a95915b359ed) )

	ROM_REGION( 0x100000, "snd", 0 )
	ROM_LOAD( "snd12sd1_snd.31", 0x000000, 0x80000, CRC(f4121baa) SHA1(723c6d96ecef5ef510d085f443d44bad07aa19e5) )
	ROM_LOAD( "kit11sd2_snd.32", 0x080000, 0x80000, CRC(647c6e2e) SHA1(e013239a73553e2993adabeda103f5b1cfee0f6c) )
ROM_END

ROM_START( moneybnk )
	ROM_REGION( 0x100000, "maincpu", 0 ) /* 68EC020 Code */
	ROM_LOAD32_WORD_SWAP( "mobn6l29_l.02", 0x000002, 0x40000, CRC(9cd2754a) SHA1(2eb695cb4abab4a448711b8acf3f5b1bb169eb6f) )
	ROM_RELOAD(0x080002, 0x40000)
	ROM_LOAD32_WORD_SWAP( "mobn6l29_h.01", 0x000000, 0x40000, CRC(952c376b) SHA1(0fc0499f5570b920c600ddd6a15751d72345c83e) )
	ROM_RELOAD(0x080000, 0x40000)

	ROM_REGION( 0x80000, "sndcpu", 0 ) /* 68000 sound program */
	ROM_LOAD16_WORD_SWAP( "n12prog_ifu.41", 0x00000, 0x08000, CRC(dbb8a7e8) SHA1(9662b34e9332385d20e17ee1c92fd91935d4c3b2) ) // some kind of bios? same on both games

	ROM_REGION( 0x100000, "k056832", 0 ) // 8x8x8 tiles
	ROM_LOAD16_BYTE( "mob11_l1_vrm.21", 0x000000, 0x80000, CRC(926fbd3b) SHA1(4f85ea63faff1508d5abf0ca0ebd16e802f8f45c) )
	ROM_LOAD16_BYTE( "mob11_h1_vrm.23", 0x000001, 0x80000, CRC(a119feaa) SHA1(567e319dfddb9ec04b9302af782e9baccab4f5a6) )

	ROM_REGION( 0x200000, "k055673", 0 ) // 16x16x8 sprites
	ROM_LOAD64_WORD( "mob11ll1_obj.17", 0x000000, 0x80000, CRC(5c5959a3) SHA1(1eea6bf4c34aa05f45b2737eb6035f2762277cfb) )
	ROM_LOAD64_WORD( "mob11lm1_obj.15", 0x000002, 0x80000, CRC(0b0e4e9b) SHA1(cbbbde7470f96e9f93fa848371e19ebfeea7fe4d) )
	ROM_LOAD64_WORD( "mob11hm1_obj.13", 0x000004, 0x80000, CRC(6f84c287) SHA1(edccefa96d97c6f67a9cd02f70cf61385d70daae) )
	ROM_LOAD64_WORD( "mob11hh1_obj.11", 0x000006, 0x80000, CRC(fc2ebc0a) SHA1(7c61d05ae1644a2aafc2f81725658b29ce69a091) )

	ROM_REGION( 0x100000, "snd", 0 )
	ROM_LOAD( "snd11sd1_snd.31", 0x000000, 0x80000, CRC(cce53e79) SHA1(970507fcef309c6c81f7e1a8e90afa64f3f6e2ae) )
	ROM_LOAD( "mob11sd2_snd.32", 0x080000, 0x80000, CRC(71ecc441) SHA1(4c94fa3a4ab872b2b841d98b73da89eaec0f46f0) )
ROM_END



ROM_START( dragsphr )
	ROM_REGION( 0x100000, "maincpu", 0 ) /* 68EC020 Code */
	ROM_LOAD32_WORD_SWAP( "u2.bin", 0x00002, 0x080000, CRC(1fec9ead) SHA1(55c1420b22781ee985ce5369186a236e235c55d1) )
	ROM_LOAD32_WORD_SWAP( "u1.bin", 0x00000, 0x080000, CRC(581acba9) SHA1(157157130c009ab5c4329e4f0dad7419176ff51a) )

	ROM_REGION( 0x80000, "sndcpu", 0 ) /* 68000 sound program */
	ROM_LOAD16_WORD_SWAP( "u41_c06chex", 0x0000, 0x020000, CRC(adac17b1) SHA1(8e92dfd112f15ee0dbca215e265f479fb19d4be4) )

	ROM_REGION( 0x100000, "k056832", 0 ) // 8x8x8 tiles
	ROM_LOAD16_BYTE( "u21.bin", 0x00000, 0x080000, CRC(83fc3afe) SHA1(09cc89567b985685ed206b273915157fc46212f9) )
	ROM_LOAD16_BYTE( "u23.bin", 0x00001, 0x080000, CRC(a29a777f) SHA1(1ca37e468f31246cbcbd2e1799e5a0137d19d0b9) )

	ROM_REGION( 0x200000, "k055673", 0 ) // 16x16x8 sprites
	ROM_LOAD64_WORD( "u17.bin", 0x000000, 0x080000, CRC(9352f279) SHA1(1795df2331fde6de06b7d910d74a3fde69379943) )
	ROM_LOAD64_WORD( "u15.bin", 0x000002, 0x080000, CRC(4a7bc71a) SHA1(7b6bfc2b83ea6189a629b64cae295071b52c5fab) )
	ROM_LOAD64_WORD( "u13.bin", 0x000004, 0x080000, CRC(a4a60822) SHA1(6f49ae6b40185a0b0dc796b32cdbd048bfcbd3de) )
	ROM_LOAD64_WORD( "u11.bin", 0x000006, 0x080000, CRC(97efac6c) SHA1(e317834e3e9b32fb8a8343e58c047a427b3111f0) )

	ROM_REGION( 0x100000, "snd", 0 )
	ROM_LOAD( "snd11sd1_snd.31", 0x000000, 0x80000, CRC(cce53e79) SHA1(970507fcef309c6c81f7e1a8e90afa64f3f6e2ae) ) // same as moneybnk
	/* no rom 32? missing or unused? */
ROM_END



ROM_START( ivorytsk )
	ROM_REGION( 0x100000, "maincpu", 0 ) /* 68EC020 Code */
	ROM_LOAD32_WORD_SWAP( "u2_5ff4hex", 0x00002, 0x080000, CRC(0af976ba) SHA1(23dbaa6d8eaa501436aecc4f4d2875b3cf1ce4d9) )
	ROM_LOAD32_WORD_SWAP( "u1_a3d6hex", 0x00000, 0x080000, CRC(4e37c7dc) SHA1(52afb1989cb720b4757c8adb12240b493165c145) )

	ROM_REGION( 0x80000, "sndcpu", 0 ) /* 68000 sound program */
	ROM_LOAD16_WORD_SWAP( "u41_c06chex", 0x0000, 0x020000, CRC(adac17b1) SHA1(8e92dfd112f15ee0dbca215e265f479fb19d4be4) )

	ROM_REGION( 0x100000, "k056832", 0 ) // 8x8x8 tiles
	ROM_LOAD16_BYTE( "u21_ba6dhex", 0x00000, 0x080000, CRC(d14efb82) SHA1(420bf5d807d59e6d17ee113125046b979e1d12f4) )
	ROM_LOAD16_BYTE( "u23_9297hex", 0x00001, 0x080000, CRC(5e36ff5f) SHA1(9be65015217affc1e28d9ce855cd22f9cb147258) )

	ROM_REGION( 0x200000, "k055673", 0 ) // 16x16x8 sprites
	ROM_LOAD64_WORD( "u17_cof8hex", 0x000000, 0x080000, CRC(1ace8891) SHA1(91115680b50d6e31cdbac81ae439eeacb7a5f812) )
	ROM_LOAD64_WORD( "u15_8e23hex", 0x000002, 0x080000, CRC(174114cb) SHA1(3f9151e5785482aebfcb6787ddd63d32e0225ad2) )
	ROM_LOAD64_WORD( "u13_29fbhex", 0x000004, 0x080000, CRC(8f21cbb9) SHA1(a0e82e9f29f9eedabcd79a72db7187180e64a076) )
	ROM_LOAD64_WORD( "u11_17fbhex", 0x000006, 0x080000, CRC(82e8e69b) SHA1(9aab64be470b07340d4f39de04b3b790821b3ce7) )

	ROM_REGION( 0x100000, "snd", 0 )
	ROM_LOAD( "snd11sd1_snd.31", 0x000000, 0x80000, CRC(cce53e79) SHA1(970507fcef309c6c81f7e1a8e90afa64f3f6e2ae) ) // same as moneybnk
	ROM_LOAD( "u32_c20fbin.hex", 0x080000, 0x080000, CRC(38a50800) SHA1(a7a70638d021a039070c9173a42095f7603b57c2) )
ROM_END



ROM_START( vikingt )
	ROM_REGION( 0x100000, "maincpu", 0 ) /* 68EC020 Code */
	ROM_LOAD32_WORD_SWAP( "u2.bin", 0x00002, 0x080000, CRC(09a14cb1) SHA1(f09338b43e89cb265c136965b01625a3458f3e41) )
	ROM_LOAD32_WORD_SWAP( "u1.bin", 0x00000, 0x080000, CRC(90b07cb4) SHA1(e9eb1601956fa6f5bfa3c4c9b7fccf6eab08dc09) )

	ROM_REGION( 0x80000, "sndcpu", 0 ) /* 68000 sound program */
	ROM_LOAD16_WORD_SWAP( "u41.bin", 0x0000, 0x020000, CRC(adac17b1) SHA1(8e92dfd112f15ee0dbca215e265f479fb19d4be4) )

	ROM_REGION( 0x100000, "k056832", 0 ) // 8x8x8 tiles
	ROM_LOAD16_BYTE( "u21.bin", 0x00000, 0x080000, CRC(789d7c41) SHA1(a04b7e8c894e08e9210c630fabd878b8389ee82c) )
	ROM_LOAD16_BYTE( "u23.bin", 0x00001, 0x080000, CRC(56ba968e) SHA1(100edc40748067683172480fc2b7d48f4dc89da7) )

	ROM_REGION( 0x200000, "k055673", 0 ) // 16x16x8 sprites
	ROM_LOAD64_WORD( "u17.bin", 0x000000, 0x080000, CRC(83e7f568) SHA1(0f82eadb3badb7074338099ff9f4d73216a1d5c7) )
	ROM_LOAD64_WORD( "u15.bin", 0x000002, 0x080000, CRC(f349b72b) SHA1(d8abc42bbc607e36004a76e45dd88b581db60d09) )
	ROM_LOAD64_WORD( "u13.bin", 0x000004, 0x080000, CRC(2cbda923) SHA1(888b3ef9fe91843b59b03b9dabc3fd32fb7fac20) )
	ROM_LOAD64_WORD( "u11.bin", 0x000006, 0x080000, CRC(c0bf7510) SHA1(aa0a6d8109452ddf6915a9bd33b7cbb5fbda2386) )

	ROM_REGION( 0x100000, "snd", 0 )
	ROM_LOAD( "snd12sd1_snd.31", 0x000000, 0x80000, CRC(f4121baa) SHA1(723c6d96ecef5ef510d085f443d44bad07aa19e5) ) // same as King Tut
	ROM_LOAD( "u32.bin",         0x080000, 0x080000, CRC(b162ecc7) SHA1(2d1bcbe692a579ed4b582472228021839fd5dab0) )
ROM_END


void kongambl_state::init_kingtut()
{
	//uint32_t *rom = (uint32_t*)memregion("maincpu")->base();

	//rom[0x3986c/4] = (rom[0x3986c/4] & 0xffff0000) | 0x600e; // patch ROM check
	//rom[0x2bfc8/4] = (rom[0x2bfc8/4] & 0xffff0000) | 0x6612; // patch VRAM ROM checks
	//rom[0x2acd0/4] = (rom[0x2acd0/4] & 0xffff) | 0x6612<<16; // patch OBJ ROM checks
	//rom[0x55e40/4] = (rom[0x55e40/4] & 0xffff0000) | 0x4e71; // goes away from the POST
}

GAME( 199?, kingtut,    0,        kongambl,    kongambl, kongambl_state, init_kingtut, ROT0,  "Konami", "King Tut (NSW, Australia)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
GAME( 199?, moneybnk,   0,        kongambl,    kongambl, kongambl_state, empty_init,   ROT0,  "Konami", "Money In The Bank (NSW, Australia)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
GAME( 199?, dragsphr,   0,        kongambl,    kongambl, kongambl_state, empty_init,   ROT0,  "Konami", "Dragon Sphere", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
GAME( 199?, ivorytsk,   0,        kongambl,    kongambl, kongambl_state, empty_init,   ROT0,  "Konami", "Ivory Tusk", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
GAME( 199?, vikingt,    0,        kongambl,    kongambl, kongambl_state, empty_init,   ROT0,  "Konami", "Viking Treasure", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )