/*
       Disco Boy

Similar to mitchell.c / egghunt.c .. clearly derived from that hardware

PCB Layout
----------

SOFT ART CO. 1993 NO - 1021
PROGRAM NO-93-01-14-0024
+------------------------------------------+
| YM3014 YM3812 10MHz            5.u94     |
|       6116                    6.u124     |
|       1.u45                    7.u95     |
| M5205 2.u28                   8.u125     |
|J     Z8400B                          6116|
|A          6116          6116 TPC1020AFN  |
|M          6116                       6116|
|M    DSW2                                 |
|A DSW1                          6264      |
|      6264                       u80  u81 |
|12MHz  u2                       u50  u5   |
|      u18                        u78  u79 |
|    Z0840004PSC                 u46  u49  |
+------------------------------------------+

Notes:
  Zilog Z0840004PSC (Z80 cpu, main program CPU)
  Goldstar Z8400B PS (Z80 cpu, sound CPU)
  Yamaha YM3014/YM3812 (rebadged as 83142/5A12)
  OKI M5205
  TI TPC1020AFN-084C
  10.000MHz & 12.000MHz OSCs

*/


#include "driver.h"
#include "sound/msm5205.h"

UINT8* discoboy_ram_part1;
UINT8* discoboy_ram_part2;
UINT8* discoboy_ram_part3;
UINT8* discoboy_ram_part4;
UINT8* discoboy_ram_att;

UINT8 discoboy_ram_bank;
static UINT8 port_00;
UINT8 discoboy_gfxbank;

VIDEO_START( discoboy )
{
}

static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
{
	int flipscreen = 0;
	int offs,sx,sy;

	for (offs = 0x1000-0x40;offs >= 0;offs -= 0x20)
	{
		int code = discoboy_ram_part4[offs];
		int attr = discoboy_ram_part4[offs+1];
		int color = attr & 0x0f;
		sx = discoboy_ram_part4[offs+3] + ((attr & 0x10) << 4);
		sy = ((discoboy_ram_part4[offs+2] + 8) & 0xff) - 8;
		code += (attr & 0xe0) << 3;

		if (code>=0x400)
		{
			if ((discoboy_gfxbank&0x30) == 0x00)
			{
				code = 0x400 + (code & 0x3ff);
			}
			else if ((discoboy_gfxbank&0x30) == 0x10)
			{
				code = 0x400 + (code & 0x3ff) + 0x400;
			}
			else if ((discoboy_gfxbank&0x30) == 0x20)
			{
				code = 0x400 + (code & 0x3ff) + 0x800;
			}
			else if ((discoboy_gfxbank&0x30) == 0x30)
			{
				code = 0x400 + (code & 0x3ff) + 0xc00;
			}
			else
			{
				code = mame_rand(machine);
			}
		}

		drawgfx(bitmap,machine->gfx[0],
				 code,
				 color,
				 flipscreen,0,
				 sx,sy,
				 cliprect,TRANSPARENCY_PEN,15);
	}
}



VIDEO_UPDATE( discoboy )
{
	UINT16 x,y;
	int i;
	int count;
	count = 0;

	for (i=0;i<0x800;i+=2)
	{
		UINT16 pal;
		int r,g,b;
		pal = discoboy_ram_part1[i] | (discoboy_ram_part1[i+1] << 8);

		b = ((pal >> 0) & 0xf) << 4;
		g = ((pal >> 4) & 0xf) << 4;
		r = ((pal >> 8) & 0xf) << 4;

		palette_set_color(machine, i/2, MAKE_RGB(r, g, b));
	}

	for (i=0;i<0x800;i+=2)
	{
		UINT16 pal;
		int r,g,b;
		pal = discoboy_ram_part2[i] | (discoboy_ram_part2[i+1] << 8);

		b = ((pal >> 0) & 0xf) << 4;
		g = ((pal >> 4) & 0xf) << 4;
		r = ((pal >> 8) & 0xf) << 4;

		palette_set_color(machine, (i/2)+0x400, MAKE_RGB(r, g, b));
	}

	fillbitmap(bitmap, 0x3ff, cliprect);

	for (y=0;y<32;y++)
	{
		for (x=0;x<64;x++)
		{
			UINT16 tileno = discoboy_ram_part3[count]|(discoboy_ram_part3[count+1]<<8);

			if (tileno>0x2000)
			{
				if ((discoboy_gfxbank & 0x40) == 0x40)
					tileno = 0x2000 + (tileno&0x1fff) + 0x2000;
				else
					tileno = 0x2000 + (tileno&0x1fff) + 0x0000;


			}

			drawgfx(bitmap,machine->gfx[1], tileno ,discoboy_ram_att[count/2],0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
			count+=2;
		}
	}

	draw_sprites(machine,bitmap,cliprect);

	return 0;
}

void discoboy_setrombank(UINT8 data)
{
	UINT8 *ROM = memory_region(REGION_CPU1);
	data &=0x2f;
	memory_set_bankptr(1, &ROM[0x6000+(data*0x1000)] );
}

static WRITE8_HANDLER( rambank_select_w )
{
	discoboy_ram_bank = data;
	if (data&=0x83) logerror("rambank_select_w !!!!!");
}

static WRITE8_HANDLER( discoboy_port_00_w )
{
	if (data & 0xfe) logerror("unk discoboy_port_00_w %02x\n",data);
	port_00 = data;
}

static WRITE8_HANDLER( discoboy_port_01_w )
{
	UINT8 *ROM = memory_region(REGION_CPU1);
	int rombank;

	// 00 10 20 30 during gameplay  1,2,3 other times?? title screen bit 0x40 toggle
 	//printf("unk discoboy_port_01_w %02x\n",data);
	// discoboy gfxbank
	discoboy_gfxbank = data&0xf0;
	rombank = data&0x07;

	memory_set_bankptr(1, &ROM[0x10000 + rombank * 0x4000] );
}

static WRITE8_HANDLER( discoboy_port_03_w ) // sfx? (to sound cpu)
{
//  printf("unk discoboy_port_03_w %02x\n",data);
//  cpunum_set_input_line(1,INPUT_LINE_NMI,HOLD_LINE);
	soundlatch_w(0,data);
	cpunum_set_input_line(1,0,HOLD_LINE);
}

static WRITE8_HANDLER( discoboy_port_06_w )
{
	//printf("unk discoboy_port_06_w %02x\n",data);
	if (data!=0) logerror("port 06!!!! %02x\n",data);
}


static WRITE8_HANDLER( rambank_w )
{
	if (discoboy_ram_bank&0x20)
	{
		discoboy_ram_part2[offset] = data;
	}
	else
	{
		discoboy_ram_part1[offset] = data;
	}
}

static READ8_HANDLER( rambank_r )
{
	if (discoboy_ram_bank&0x20)
	{
		return discoboy_ram_part2[offset];
	}
	else
	{
		return discoboy_ram_part1[offset];
	}
}

static READ8_HANDLER( rambank2_r )
{
	if (port_00 == 0x00)
	{
		return discoboy_ram_part3[offset];
	}
	else if (port_00 == 0x01)
	{
		return discoboy_ram_part4[offset];
	}
	else
	{
		printf( "unk rb2_r\n");
	}

	return mame_rand(Machine);
}

static WRITE8_HANDLER( rambank2_w )
{

	if (port_00 == 0x00)
	{
		discoboy_ram_part3[offset] = data;
	}
	else if (port_00 == 0x01)
	{
		discoboy_ram_part4[offset] = data;
	}
	else
	{
		printf( "unk rb2_w\n");
	}
}

static READ8_HANDLER( discoboy_ram_att_r )
{
	return discoboy_ram_att[offset];
}

static WRITE8_HANDLER( discoboy_ram_att_w )
{
	discoboy_ram_att[offset] = data;
}

static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
	AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
	AM_RANGE(0x8000, 0xbfff) AM_READ(MRA8_BANK1)
	AM_RANGE(0xc000, 0xc7ff) AM_READ(rambank_r)
	AM_RANGE(0xc800, 0xcfff) AM_READ(discoboy_ram_att_r)
	AM_RANGE(0xd000, 0xdfff) AM_READ(rambank2_r)
	AM_RANGE(0xe000, 0xefff) AM_READ(MRA8_RAM)
	AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_RAM)
ADDRESS_MAP_END

static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
	AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM)
	AM_RANGE(0xc000, 0xc7ff) AM_WRITE(rambank_w)
	AM_RANGE(0xc800, 0xcfff) AM_WRITE(discoboy_ram_att_w)
	AM_RANGE(0xd000, 0xdfff) AM_WRITE(rambank2_w)
	AM_RANGE(0xe000, 0xefff) AM_WRITE(MWA8_RAM)
	AM_RANGE(0xf000, 0xffff) AM_WRITE(MWA8_RAM)
ADDRESS_MAP_END

READ8_HANDLER( discoboy_port_06_r )
{
	return 0x00;
}

static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
	ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
	AM_RANGE(0x00, 0x00) AM_READ(input_port_0_r) // DSWA
	AM_RANGE(0x01, 0x01) AM_READ(input_port_1_r) // Coins
	AM_RANGE(0x02, 0x02) AM_READ(input_port_2_r) // P1
	AM_RANGE(0x03, 0x03) AM_READ(input_port_3_r) // P2
	AM_RANGE(0x04, 0x04) AM_READ(input_port_4_r) // DSWB

	AM_RANGE(0x06, 0x06) AM_READ(discoboy_port_06_r) // ???
ADDRESS_MAP_END

static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
	ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
	AM_RANGE(0x00, 0x00) AM_WRITE(discoboy_port_00_w)
	AM_RANGE(0x01, 0x01) AM_WRITE(discoboy_port_01_w)

	AM_RANGE(0x03, 0x03) AM_WRITE(discoboy_port_03_w)
	AM_RANGE(0x06, 0x06) AM_WRITE(discoboy_port_06_w) // ?? unk

	AM_RANGE(0x07, 0x07) AM_WRITE(rambank_select_w) // 0x20 is palette bank bit.. others?
ADDRESS_MAP_END

/* Sound */

static int adpcm_data = 0x80;

//static WRITE8_HANDLER( splash_adpcm_data_w ){
//  adpcm_data = data;
//}

static void splash_msm5205_int(int data)
{
	MSM5205_data_w(0,adpcm_data >> 4);
//  adpcm_data = (adpcm_data << 4) & 0xf0;
}



static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
	AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
	AM_RANGE(0xf000, 0xf7ff) AM_READ(MRA8_RAM)
	AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r)
ADDRESS_MAP_END

static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
	AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
	AM_RANGE(0xf000, 0xf7ff) AM_WRITE(MWA8_RAM)
ADDRESS_MAP_END

static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
	ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
ADDRESS_MAP_END

static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
	ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
ADDRESS_MAP_END



INPUT_PORTS_START( discoboy )
    PORT_START      /* DSWA */
	PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )          PORT_DIPLOCATION("SWA:6,7,8")
    PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
    PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
    PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
    PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
    PORT_DIPSETTING(    0x02, DEF_STR( 2C_3C ) )
    PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
    PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
    PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )       PORT_DIPLOCATION("SWA:5")
    PORT_DIPSETTING(    0x08, "Every 150000" )
    PORT_DIPSETTING(    0x00, "Every 300000" )
    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Lives ) )            PORT_DIPLOCATION("SWA:4")
    PORT_DIPSETTING(    0x10, "3" )
    PORT_DIPSETTING(    0x00, "4" )
    PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )       PORT_DIPLOCATION("SWA:2,3")
    PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
    PORT_DIPSETTING(    0x60, DEF_STR( Normal ) )
    PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
    PORT_DIPSETTING(    0x20, DEF_STR( Hardest ) )
	PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWA:1" )

    PORT_START
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )

	PORT_START      /* IN1 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)

	PORT_START      /* IN2 */
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)

    PORT_START      /* DSWB */
	PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_LOW, "SWB:8" )
	PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SWB:7" )
	PORT_DIPUNUSED_DIPLOC( 0x04, IP_ACTIVE_LOW, "SWB:6" )
	PORT_DIPUNUSED_DIPLOC( 0x08, IP_ACTIVE_LOW, "SWB:5" )
	PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_LOW, "SWB:4" )
	PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SWB:3" )
	PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_LOW, "SWB:2" )
    PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SWB:1")
    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
INPUT_PORTS_END


static const gfx_layout tiles8x8_layout =
{
	16,16,
	RGN_FRAC(1,2),
	4,
	{ RGN_FRAC(1,2)+4,RGN_FRAC(1,2),  RGN_FRAC(0,2)+4,RGN_FRAC(0,2) },
	{ 0, 1, 2, 3, 8, 9, 10, 11, 256, 257, 258, 259, 264,265,266,267  },
	{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
	16*32
};

static const gfx_layout tiles8x8_layout2 =
{
	8,8,
	RGN_FRAC(1,4),
	4,
	{ RGN_FRAC(1,4), RGN_FRAC(0,4),RGN_FRAC(3,4),RGN_FRAC(2,4) },
	{ 0, 1, 2, 3, 4, 5, 6, 7 },
	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
	8*8
};

static const gfx_decode gfxdecodeinfo[] =
{
	{ REGION_GFX1, 0, &tiles8x8_layout, 0x000, 128 },
	{ REGION_GFX2, 0, &tiles8x8_layout2, 0x000, 128 },

	{ -1 }
};



static struct MSM5205interface discoboy_msm5205_interface =
{
	splash_msm5205_int,	/* IRQ handler */
	MSM5205_S48_4B		/* ??? unknown hz */
};


static MACHINE_DRIVER_START( discoboy )
	/* basic machine hardware */
	MDRV_CPU_ADD(Z80,12000000/2)		 /* 6 MHz? */
	MDRV_CPU_PROGRAM_MAP(readmem,writemem)
	MDRV_CPU_IO_MAP(readport,writeport)
	MDRV_CPU_VBLANK_INT(irq0_line_hold,1)

	MDRV_CPU_ADD(Z80,10000000/2)		 /* 5 MHz? */
	MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
	MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
//  MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
	MDRV_CPU_VBLANK_INT(nmi_line_pulse,4)

	/* video hardware */
	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
	MDRV_SCREEN_SIZE(512, 256)
	MDRV_SCREEN_VISIBLE_AREA(8*8, 512-1-8*8, 0+8, 256-1-8)
	MDRV_GFXDECODE(gfxdecodeinfo)
	MDRV_PALETTE_LENGTH(0x1000)

	MDRV_VIDEO_START(discoboy)
	MDRV_VIDEO_UPDATE(discoboy)

	/* sound hardware */
	MDRV_SPEAKER_STANDARD_MONO("mono")

	MDRV_SOUND_ADD(MSM5205, 384000) // ???? unknown
	MDRV_SOUND_CONFIG(discoboy_msm5205_interface)
	MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)

MACHINE_DRIVER_END

DRIVER_INIT( discoboy )
{
	UINT8 *ROM = memory_region(REGION_CPU1);

	discoboy_ram_part1 = auto_malloc(0x800);
	discoboy_ram_part2 = auto_malloc(0x800);
	discoboy_ram_att = auto_malloc(0x800);

	discoboy_ram_part3 = auto_malloc(0x1000);
	discoboy_ram_part4 = auto_malloc(0x1000);

	memset(discoboy_ram_part1,0,0x800);
	memset(discoboy_ram_part2,0,0x800);
	memset(discoboy_ram_att,0,0x800);
	memset(discoboy_ram_part3,0,0x1000);
	memset(discoboy_ram_part4,0,0x1000);


	state_save_register_global_pointer(discoboy_ram_part1, 0x800);
	state_save_register_global_pointer(discoboy_ram_part2, 0x800);
	state_save_register_global_pointer(discoboy_ram_att, 0x800);
	state_save_register_global_pointer(discoboy_ram_part3, 0x1000);
	state_save_register_global_pointer(discoboy_ram_part4, 0x1000);

	discoboy_ram_bank = 0;

	memory_set_bankptr(1, &ROM[0x10000] );
}

ROM_START( discoboy )
	ROM_REGION( 0x30000, REGION_CPU1, 0 )
	ROM_LOAD( "u2",  0x00000, 0x10000, CRC(44a4fefa) SHA1(29b74bb739afffb7baefb5ed4da09cdb1559b011) )
	ROM_LOAD( "u18", 0x10000, 0x20000, CRC(88d1282d) SHA1(1f11dad0f577198c54a1dc182ba7502e398b998f) )

	ROM_REGION( 0x20000, REGION_CPU2, 0 )
	ROM_LOAD( "2.u28",  0x00000, 0x10000, CRC(7c2ed174) SHA1(ace209dc4cc7a4ffca062842defd84cefc5b10d2))
	ROM_LOAD( "1.u45",  0x10000, 0x10000, CRC(c266c6df) SHA1(f76e38ded43f56a486cf6569c679ddb57a4165fb) )

	ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_INVERT )
	ROM_LOAD( "5.u94",   0x00000, 0x10000, CRC(dbd20836) SHA1(d97651626b1dc16b93f8aed28bac19fd177e626f) )
	ROM_LOAD( "6.u124",  0x10000, 0x40000, CRC(e20d41f8) SHA1(792294a34840867072bc484d6f3cae3502c8bc28) )
	ROM_LOAD( "7.u95",   0x80000, 0x10000, CRC(1d5617a2) SHA1(6b6bd50c1984748dc8bf6600431d9bb6fe443873) )
	ROM_LOAD( "8.u125",  0x90000, 0x40000, CRC(30be1340) SHA1(e4765b75c8f774c6f7f7b5496a50c33ee3950550) )

	ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_INVERT )
	ROM_LOAD( "u80",   0x00000, 0x10000, CRC(4cc642ae) SHA1(2a59ebc8ab27bf7c3c1aa389ea32fb01d5cfdce8) )
	ROM_LOAD( "u50",   0x10000, 0x20000, CRC(1557ca92) SHA1(5a0afbeede6f0ae1c75bdec446132c673aeb0fe7) )
	ROM_LOAD( "u81",   0x40000, 0x10000, CRC(9e04274e) SHA1(70c28212b242335353e6dd48b7eb176146bec457) )
	ROM_LOAD( "u5",    0x50000, 0x20000, CRC(a07df669) SHA1(7f09b2508b9bffed7a4cd191f707af3c0c2a1de2) )
	ROM_LOAD( "u78",   0x80000, 0x10000, CRC(04571f70) SHA1(afdc7d84f7804c2ced413d13e6985a05f841e79e) )
	ROM_LOAD( "u46",   0x90000, 0x20000, CRC(764ffde4) SHA1(637df403a6ac73456892add3f2403a92afb67f19) )
	ROM_LOAD( "u79",   0xc0000, 0x10000, CRC(646f0f83) SHA1(d5cd050872d4b8c2fc89c3c0f434b1d66e5f1c59) )
	ROM_LOAD( "u49",   0xd0000, 0x20000, CRC(0b6c0d8d) SHA1(820a12c84af4fd5a04e1eca3cbace0002d3024b6) )
ROM_END


GAME( 1993, discoboy,  0,    discoboy, discoboy, discoboy, ROT270, "Soft Art Co.", "Disco Boy", GAME_NO_SOUND )
