diff --git a/src/mame/drivers/fresh.c b/src/mame/drivers/fresh.c index 01e742e65b9..8104dac4bb8 100644 --- a/src/mame/drivers/fresh.c +++ b/src/mame/drivers/fresh.c @@ -30,23 +30,25 @@ public: fresh_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_bg_videoram(*this, "bg_videoram"), - m_bg_videoram_2(*this, "bg_videoram_2"), + m_bg_2_videoram(*this, "bg_videoram_2"), m_paletteram_1(*this, "paletteram_1"), m_paletteram_2(*this, "paletteram_2") { } tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; + tilemap_t *m_bg_2_tilemap; required_shared_ptr m_bg_videoram; - required_shared_ptr m_bg_videoram_2; + required_shared_ptr m_bg_2_videoram; required_shared_ptr m_paletteram_1; required_shared_ptr m_paletteram_2; DECLARE_WRITE16_MEMBER(fresh_bg_videoram_w); TILE_GET_INFO_MEMBER(get_fresh_bg_tile_info); + DECLARE_WRITE16_MEMBER(fresh_bg_2_videoram_w); + TILE_GET_INFO_MEMBER(get_fresh_bg_2_tile_info); DECLARE_READ16_MEMBER( unk_r ) { @@ -56,7 +58,9 @@ public: { return 0x10; } - + + TIMER_DEVICE_CALLBACK_MEMBER(fake_scanline); + virtual void video_start(); UINT32 screen_update_fresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -67,7 +71,7 @@ TILE_GET_INFO_MEMBER(fresh_state::get_fresh_bg_tile_info) { int tileno; tileno = m_bg_videoram[tile_index]; - SET_TILE_INFO_MEMBER(2, tileno, 0, 0); + SET_TILE_INFO_MEMBER(1, tileno, 0, 0); } @@ -77,18 +81,34 @@ WRITE16_MEMBER(fresh_state::fresh_bg_videoram_w) m_bg_tilemap->mark_tile_dirty(offset); } +TILE_GET_INFO_MEMBER(fresh_state::get_fresh_bg_2_tile_info) +{ + int tileno; + tileno = m_bg_2_videoram[tile_index]; + SET_TILE_INFO_MEMBER(0, tileno, 0, 0); +} + + +WRITE16_MEMBER(fresh_state::fresh_bg_2_videoram_w) +{ + COMBINE_DATA(&m_bg_2_videoram[offset]); + m_bg_2_tilemap->mark_tile_dirty(offset); +} + + + void fresh_state::video_start() { m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fresh_state::get_fresh_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 512); -// m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fresh_state::get_fresh_fg_tile_info),this), TILEMAP_SCAN_ROWS, 4, 4, 128, 64); + m_bg_2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(fresh_state::get_fresh_bg_2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 512); -// m_fg_tilemap->set_transparent_pen(255); + m_bg_tilemap->set_transparent_pen(255); } UINT32 fresh_state::screen_update_fresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { + m_bg_2_tilemap->draw(bitmap, cliprect, 0, 0); m_bg_tilemap->draw(bitmap, cliprect, 0, 0); -// m_fg_tilemap->draw(bitmap, cliprect, 0, 0); return 0; } @@ -97,30 +117,432 @@ UINT32 fresh_state::screen_update_fresh(screen_device &screen, bitmap_ind16 &bit static ADDRESS_MAP_START( fresh_map, AS_PROGRAM, 16, fresh_state ) AM_RANGE(0x000000, 0x03ffff) AM_ROM - AM_RANGE(0xC00000, 0xC0ffff) AM_RAM + AM_RANGE(0xC00000, 0xC0ffff) AM_RAM_WRITE( fresh_bg_2_videoram_w ) AM_SHARE( "bg_videoram_2" ) AM_RANGE(0xC10000, 0xC1ffff) AM_RAM AM_RANGE(0xC20000, 0xC2ffff) AM_RAM_WRITE( fresh_bg_videoram_w ) AM_SHARE( "bg_videoram" ) - AM_RANGE(0xC30000, 0xC3ffff) AM_RAM AM_SHARE("bg_videoram_2") + AM_RANGE(0xC30000, 0xC3ffff) AM_RAM // written together AM_RANGE(0xC40000, 0xC417ff) AM_RAM AM_SHARE( "paletteram_1" ) // 16-bit AM_RANGE(0xC50000, 0xC517ff) AM_RAM AM_SHARE( "paletteram_2" ) // 8-bit - AM_RANGE(0xD40000, 0xD40001) AM_READ(unk_r) - AM_RANGE(0xD70000, 0xD70001) AM_READ(unk2_r) + AM_RANGE(0xD40000, 0xD40001) AM_READ_PORT("IN0") + AM_RANGE(0xD70000, 0xD70001) AM_READ_PORT("IN1") + + AM_RANGE(0xE00000, 0xE00001) AM_READ_PORT("IN2") + AM_RANGE(0xE20000, 0xE20001) AM_READ_PORT("IN3") + AM_RANGE(0xE40000, 0xE40001) AM_READ_PORT("IN4") + AM_RANGE(0xE60000, 0xE60001) AM_READ_PORT("IN5") + AM_RANGE(0xE80000, 0xE80001) AM_READ_PORT("IN6") + AM_RANGE(0xEE0000, 0xEE0001) AM_READ_PORT("IN7") + + AM_RANGE(0xF00000, 0xF0FFFF) AM_RAM - -// AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(fresh_bg_videoram_w) AM_SHARE("bg_videoram") // Background -// AM_RANGE(0x210000, 0x213fff) AM_RAM_WRITE(fresh_fg_videoram_w) AM_SHARE("fg_videoram") // Foreground -// AM_RANGE(0x220000, 0x2203ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") -// AM_RANGE(0x230000, 0x230001) AM_WRITE(soundlatch_word_w) -// AM_RANGE(0x230100, 0x230101) AM_READ_PORT("DSW") -// AM_RANGE(0x230200, 0x230201) AM_READ_PORT("INPUTS") + ADDRESS_MAP_END static INPUT_PORTS_START( fresh ) + PORT_START("IN0") + PORT_DIPNAME( 0x0001, 0x0000, "IN-0:0" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, "IN-0:1" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, "IN-0:2" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, "IN-0:3" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, "IN-0:4" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, "IN-0:5" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, "IN-0:6" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, "IN-0:7" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0000, "IN-0:8" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, "IN-0:9" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, "IN-0:a" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, "IN-0:b" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, "IN-0:c" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, "IN-0:d" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, "IN-0:e" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, "IN-0:f" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) + + PORT_START("IN1") + PORT_DIPNAME( 0x0001, 0x0000, "IN-1:0" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, "IN-1:1" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, "IN-1:2" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, "IN-1:3" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, "IN-1:4" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, "IN-1:5" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, "IN-1:6" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, "IN-1:7" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0000, "IN-1:8" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, "IN-1:9" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, "IN-1:a" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, "IN-1:b" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, "IN-1:c" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, "IN-1:d" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, "IN-1:e" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, "IN-1:f" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) + + PORT_START("IN2") + PORT_DIPNAME( 0x0001, 0x0000, "IN-2:0" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, "IN-2:1" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, "IN-2:2" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, "IN-2:3" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, "IN-2:4" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, "IN-2:5" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, "IN-2:6" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, "IN-2:7" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0000, "IN-2:8" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, "IN-2:9" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, "IN-2:a" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, "IN-2:b" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, "IN-2:c" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, "IN-2:d" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, "IN-2:e" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, "IN-2:f" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) + + PORT_START("IN3") + PORT_DIPNAME( 0x0001, 0x0000, "IN-3:0" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, "IN-3:1" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, "IN-3:2" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, "IN-3:3" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, "IN-3:4" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, "IN-3:5" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, "IN-3:6" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, "IN-3:7" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0000, "IN-3:8" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, "IN-3:9" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, "IN-3:a" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, "IN-3:b" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, "IN-3:c" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, "IN-3:d" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, "IN-3:e" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, "IN-3:f" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) + + PORT_START("IN4") + PORT_DIPNAME( 0x0001, 0x0000, "IN-4:0" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, "IN-4:1" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, "IN-4:2" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, "IN-4:3" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, "IN-4:4" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, "IN-4:5" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, "IN-4:6 (off)" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, "IN-4:7" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0000, "IN-4:8" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, "IN-4:9" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, "IN-4:a" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, "IN-4:b" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, "IN-4:c" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, "IN-4:d" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, "IN-4:e" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, "IN-4:f" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) + + PORT_START("IN5") + PORT_DIPNAME( 0x0001, 0x0001, "IN-5:0" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, "IN-5:1" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, "IN-5:2" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, "IN-5:3" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, "IN-5:4" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, "IN-5:5" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, "IN-5:6" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, "IN-5:7" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, "IN-5:8" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, "IN-5:9" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, "IN-5:a" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, "IN-5:b" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, "IN-5:c" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, "IN-5:d" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, "IN-5:e" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, "IN-5:f" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) + + PORT_START("IN6") + PORT_DIPNAME( 0x0001, 0x0001, "IN-6:0" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, "IN-6:1" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, "IN-6:2" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, "IN-6:3" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, "IN-6:4" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, "IN-6:5" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, "IN-6:6" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, "IN-6:7" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, "IN-6:8" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, "IN-6:9" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, "IN-6:a" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, "IN-6:b" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, "IN-6:c" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, "IN-6:d" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, "IN-6:e" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, "IN-6:f" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) + + PORT_START("IN7") + PORT_DIPNAME( 0x0001, 0x0001, "IN-7:0" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0002, "IN-7:1" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0004, "IN-7:2" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0008, "IN-7:3" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0010, "IN-7:4" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0020, "IN-7:5" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, "IN-7:6" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, "IN-7:7" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, "IN-7:8" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0200, "IN-7:9" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0400, "IN-7:a" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0800, "IN-7:b" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x1000, "IN-7:c" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x2000, "IN-7:d" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x4000, "IN-7:e" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x8000, "IN-7:f" ) + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) INPUT_PORTS_END static const gfx_layout tiles8x8_layout = @@ -138,16 +560,31 @@ static const gfx_layout tiles8x8_layout = static GFXDECODE_START( fresh ) GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 2 ) GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout, 0, 2 ) - GFXDECODE_ENTRY( "gfx3", 0, tiles8x8_layout, 0, 2 ) - GFXDECODE_ENTRY( "gfx4", 0, tiles8x8_layout, 0, 2 ) GFXDECODE_END + +TIMER_DEVICE_CALLBACK_MEMBER(fresh_state::fake_scanline) +{ + int scanline = param; + + if(scanline == 0) + machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE); + + if(scanline == 64) + machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); + + if(scanline == 128) // vbl? + machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE); + +} + + static MACHINE_CONFIG_START( fresh, fresh_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, 24000000/2 ) MCFG_CPU_PROGRAM_MAP(fresh_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", fresh_state, irq6_line_hold) // 4,5,6 valid + MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", fresh_state, fake_scanline, "screen", 0, 1) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -169,18 +606,15 @@ ROM_START( fresh ) ROM_LOAD16_BYTE( "fruit-fresh5.u44", 0x00001, 0x20000, CRC(cb37d3c5) SHA1(3b7797d475769d37ed1e9774df8d4b5899fb92a3) ) ROM_LOAD16_BYTE( "fruit-fresh6.u59", 0x00000, 0x20000, CRC(fc0290be) SHA1(02e3b3563b15ae585684a8f510f48a8c90b248fa) ) - ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "fruit-fresh1.u18", 0x00000, 0x80000, CRC(ee77cdcd) SHA1(8e162640d23bd1b5a2ed9305cc4b9df1cb0f3e80) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "fruit-fresh3.u19", 0x00000, 0x80000, CRC(80cc71b3) SHA1(89a2272266ccdbd01abbc85c1f8200fa9d8aa441) ) - ROM_REGION( 0x80000, "gfx3", 0 ) + ROM_LOAD( "fruit-fresh3.u19", 0x80000, 0x80000, CRC(80cc71b3) SHA1(89a2272266ccdbd01abbc85c1f8200fa9d8aa441) ) + ROM_REGION( 0x100000, "gfx2", 0 ) ROM_LOAD( "fruit-fresh2.u45", 0x00000, 0x80000, CRC(8a06a1ab) SHA1(4bc020e4a031df995e6ebaf49d62989004092b60) ) - ROM_REGION( 0x80000, "gfx4", 0 ) - ROM_LOAD( "fruit-fresh4.u46", 0x00000, 0x80000, CRC(9b6c7571) SHA1(649cf3c50e2cd8c02f0f730e5ded59cf0ea37c37) ) - + ROM_LOAD( "fruit-fresh4.u46", 0x80000, 0x80000, CRC(9b6c7571) SHA1(649cf3c50e2cd8c02f0f730e5ded59cf0ea37c37) ) ROM_END -GAME( 199?, fresh, 0, fresh, fresh, driver_device, 0, ROT0, "Chain Leisure", "Fruit Fresh", GAME_NOT_WORKING|GAME_NO_SOUND ) +GAME( 1996, fresh, 0, fresh, fresh, driver_device, 0, ROT0, "Chain Leisure", "Fruit Fresh", GAME_NOT_WORKING|GAME_NO_SOUND )