From b96c3204b09d564b997cefd508070aa0ad1560f9 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Wed, 6 Feb 2013 09:22:37 +0000 Subject: [PATCH] started looking at fruit fresh, looks straightforward enough (nw) --- .gitattributes | 1 + src/mame/drivers/fresh.c | 186 +++++++++++++++++++++++++++++++++++ src/mame/drivers/goldstar.c | 77 +++++++++++++++ src/mame/includes/goldstar.h | 2 + src/mame/mame.lst | 2 + src/mame/mame.mak | 1 + 6 files changed, 269 insertions(+) create mode 100644 src/mame/drivers/fresh.c diff --git a/.gitattributes b/.gitattributes index f2d074ec43c..9e0f3428865 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2875,6 +2875,7 @@ src/mame/drivers/foodf.c svneol=native#text/plain src/mame/drivers/forte2.c svneol=native#text/plain src/mame/drivers/fortecar.c svneol=native#text/plain src/mame/drivers/freekick.c svneol=native#text/plain +src/mame/drivers/fresh.c svneol=native#text/plain src/mame/drivers/fromanc2.c svneol=native#text/plain src/mame/drivers/fromance.c svneol=native#text/plain src/mame/drivers/funkball.c svneol=native#text/plain diff --git a/src/mame/drivers/fresh.c b/src/mame/drivers/fresh.c new file mode 100644 index 00000000000..01e742e65b9 --- /dev/null +++ b/src/mame/drivers/fresh.c @@ -0,0 +1,186 @@ + +/* + +fruit fresh by chain leisure electronic co., ltd. + +cpu 68000 xtal 24Mhz + +4* 8 dipswitchs + +2 jumpers HOP or SSR positions + +SW1 for reset? + +2x Altera epm7064lc84 + +rom 5 and 6 are prg roms + +*/ + +#include "emu.h" +#include "cpu/m68000/m68000.h" + + + + + +class fresh_state : public driver_device +{ +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_paletteram_1(*this, "paletteram_1"), + m_paletteram_2(*this, "paletteram_2") + + { } + + tilemap_t *m_bg_tilemap; + tilemap_t *m_fg_tilemap; + + required_shared_ptr m_bg_videoram; + required_shared_ptr m_bg_videoram_2; + + 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_READ16_MEMBER( unk_r ) + { + return machine().rand(); + } + DECLARE_READ16_MEMBER( unk2_r ) + { + return 0x10; + } + + + virtual void video_start(); + UINT32 screen_update_fresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +}; + + +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); +} + + +WRITE16_MEMBER(fresh_state::fresh_bg_videoram_w) +{ + COMBINE_DATA(&m_bg_videoram[offset]); + m_bg_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_fg_tilemap->set_transparent_pen(255); +} + +UINT32 fresh_state::screen_update_fresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(bitmap, cliprect, 0, 0); +// m_fg_tilemap->draw(bitmap, cliprect, 0, 0); + + return 0; +} + + +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(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") + + + // 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(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 ) +INPUT_PORTS_END + +static const gfx_layout tiles8x8_layout = +{ + 8,8, + RGN_FRAC(1,1), + 8, + { 0,1, 2,3, 4,5,6,7 }, + { 0, 8, 16, 24, 32, 40, 48, 56 }, + { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64 }, + 64*8 +}; + + +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 + +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 + + /* video hardware */ + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_REFRESH_RATE(60) + MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) + MCFG_SCREEN_SIZE(64*8, 32*8) + MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1) + MCFG_SCREEN_UPDATE_DRIVER(fresh_state, screen_update_fresh) + + MCFG_PALETTE_LENGTH(0x200) + MCFG_GFXDECODE(fresh) + + /* sound hw? */ +MACHINE_CONFIG_END + + +ROM_START( fresh ) + ROM_REGION( 0x40000, "maincpu", 0 ) /* 68k */ + 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_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-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_END + + + + +GAME( 199?, fresh, 0, fresh, fresh, driver_device, 0, ROT0, "Chain Leisure", "Fruit Fresh", GAME_NOT_WORKING|GAME_NO_SOUND ) diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c index d37cd8ae943..d0f954e8600 100644 --- a/src/mame/drivers/goldstar.c +++ b/src/mame/drivers/goldstar.c @@ -9928,6 +9928,80 @@ ROM_END +ROM_START( fb2010 ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD( "fb2013r.bin", 0x00000, 0x1000, CRC(9cc75315) SHA1(f77fbce1037dbf38ddaa4ce79266d62e5cc7989e) ) + ROM_CONTINUE(0x4000, 0x1000) + ROM_CONTINUE(0x3000, 0x1000) + ROM_CONTINUE(0x7000, 0x1000) + ROM_CONTINUE(0x1000, 0x1000) + ROM_CONTINUE(0x6000, 0x1000) + ROM_CONTINUE(0x2000, 0x1000) + ROM_CONTINUE(0x5000, 0x1000) + ROM_CONTINUE(0x8000, 0x1000) + ROM_CONTINUE(0x9000, 0x1000) + ROM_CONTINUE(0xa000, 0x1000) + ROM_CONTINUE(0xb000, 0x1000) + ROM_CONTINUE(0xc000, 0x1000) + ROM_CONTINUE(0xd000, 0x1000) + ROM_CONTINUE(0xe000, 0x1000) + ROM_CONTINUE(0xf000, 0x1000) + ROM_REGION( 0x20000, "graphics", 0 ) + ROM_LOAD( "gfx", 0x00000, 0x20000, NO_DUMP ) + + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_COPY( "graphics", 0x18000, 0x00000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x08000, 0x08000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x04000, 0x10000, 0x4000 ) // 1 + ROM_COPY( "graphics", 0x1c000, 0x04000, 0x4000 ) // 2 + ROM_COPY( "graphics", 0x0c000, 0x0c000, 0x4000 ) // 2 + ROM_COPY( "graphics", 0x14000, 0x14000, 0x4000 ) // 2 + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_COPY( "graphics", 0x02000, 0x00000, 0x2000 ) + ROM_COPY( "graphics", 0x12000, 0x02000, 0x2000 ) + ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 ) + ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 ) + + ROM_REGION( 0x200, "proms", 0 ) // palette + ROM_LOAD( "proms", 0x0000, 0x0200, NO_DUMP ) + + ROM_REGION( 0x80000, "oki", 0 ) // samples + ROM_LOAD( "samples", 0x00000, 0x20000, NO_DUMP ) +ROM_END + + +READ8_MEMBER(goldstar_state::fixedval7d_r ) +{ + return ~0x7d; +} + + +DRIVER_INIT_MEMBER(goldstar_state,fb2010) +{ + int i; + UINT8 *ROM = machine().root_device().memregion("maincpu")->base(); + for (i = 0;i < 0x10000;i++) + { + UINT8 x = ROM[i]; + + switch(i & 0x22) + { + case 0x00: x = BITSWAP8(x^0x4c^0xff, 0,4,7,6,5,1,3,2); break; + case 0x02: x = BITSWAP8(x^0xc0^0xff, 7,6,0,5,3,2,1,4); break; // 67053214 + case 0x20: x = BITSWAP8(x^0x6b^0xff, 4,3,2,7,5,6,0,1); break; + case 0x22: x = BITSWAP8(x^0x23^0xff, 0,6,1,3,4,5,2,7); break; + } + + ROM[i] = x; + } + + machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x1e, 0x1e, read8_delegate(FUNC(goldstar_state::fixedval7d_r),this)); + +} + + + /* descrambled by looking at CALLs @@ -11543,6 +11617,7 @@ GAME( 1998, skill98, 0, amcoe1, schery97, goldstar_state, skill98, GAME( 1997, pokonl97, 0, amcoe1, pokonl97, goldstar_state, po33, ROT0, "Amcoe", "Poker Only '97 (ver. 3.3)", 0 ) /* ver. 3.3 */ GAME( 1998, match98, 0, amcoe1a, match98, goldstar_state, match133, ROT0, "Amcoe", "Match '98 (ver. 1.33)", 0 ) + /* The Sub-PCB has a printed sticker denoting C1, C2, D or DK for the type of FPGA decryption chip used */ /* There is known to be a special IOWA version running on the Texas C2 hardware with roms FB96P IA, FB96L IA & FB96H IA with a (c) 2000 Amcoe */ GAME( 1996, nfb96, 0, amcoe2, nfb96, goldstar_state, nfb96_c1, ROT0, "Amcoe", "New Fruit Bonus '96 Special Edition (v3.63, C1 PCB)", 0 ) /* ver. 02-3.63 C1 Sub-PCB */ @@ -11557,6 +11632,8 @@ GAME( 1996, nc96b, nc96, amcoe2, nfb96, goldstar_state, nfb96_d, GAME( 1996, nc96c, nc96, amcoe2, nfb96, goldstar_state, nfb96_dk, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.62, DK PCB)", 0 ) /* DK Sub-PCB */ GAME( 2000, nc96txt, nc96, amcoe2, nfb96tx, goldstar_state, nfb96_c2, ROT0, "Amcoe", "New Cherry '96 Special Edition (v1.32 Texas XT, C2 PCB)", 0 ) /* ver. tc1.32axt C2 Sub-PCB */ +GAME( 2009, fb2010, skill98, amcoe2, nfb96tx, goldstar_state, fb2010, ROT0, "Amcoe", "Fruit Bonus 2010", GAME_NOT_WORKING ) // no gfx dumped + GAME( 1996, roypok96, 0, amcoe2, roypok96, goldstar_state, rp35, ROT0, "Amcoe", "Royal Poker '96 (set 1)", 0 ) /* ver. 97-3.5 */ GAME( 1996, roypok96a, roypok96, amcoe2, roypok96a, goldstar_state, rp36, ROT0, "Amcoe", "Royal Poker '96 (set 2)", 0 ) /* ver. 98-3.6 */ GAME( 1996, roypok96b, roypok96, amcoe2, roypok96a, goldstar_state, rp36c3, ROT0, "Amcoe", "Royal Poker '96 (set 3)", 0 ) /* ver. 98-3.6 ??? */ diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h index 42dd3b14653..240db5510d1 100644 --- a/src/mame/includes/goldstar.h +++ b/src/mame/includes/goldstar.h @@ -79,6 +79,7 @@ public: DECLARE_READ8_MEMBER(fixedval74_r); DECLARE_READ8_MEMBER(fixedvale4_r); DECLARE_READ8_MEMBER(fixedvalc7_r); + DECLARE_READ8_MEMBER(fixedval7d_r); DECLARE_WRITE8_MEMBER(cm_girl_scroll_w); DECLARE_WRITE8_MEMBER(cm_outport0_w); DECLARE_WRITE8_MEMBER(goldstar_fg_vidram_w); @@ -123,6 +124,7 @@ public: DECLARE_DRIVER_INIT(rp36c3); DECLARE_DRIVER_INIT(magoddsc); DECLARE_DRIVER_INIT(nfb96_c1); + DECLARE_DRIVER_INIT(fb2010); TILE_GET_INFO_MEMBER(get_goldstar_fg_tile_info); TILE_GET_INFO_MEMBER(get_magical_fg_tile_info); TILE_GET_INFO_MEMBER(get_cherrym_fg_tile_info); diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 92941b6eddc..2d1965b132a 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -9848,6 +9848,7 @@ quake // (c) 19?? Lazer-Tron / iD Software majorpkr // (c) 1994 PAL System. su2000 // (c) 1993 Virtuality boonggab // (c) 2001 Taff System +fresh // (c) Chain Leisure // Success tonton // (c) 199? Success / Taiyo Jidoki. @@ -10700,6 +10701,7 @@ nfb96a // (c) 1996 Amcoe nfb96b // (c) 1996 Amcoe nfb96c // (c) 1996 Amcoe nfb96txt // (c) 2000 Amcoe +fb2010 // (c) 2009 Amcoe nfb96se // bootleg nfb96sea // bootleg nfb96seb // bootleg diff --git a/src/mame/mame.mak b/src/mame/mame.mak index a189155cdac..01b89cd782e 100644 --- a/src/mame/mame.mak +++ b/src/mame/mame.mak @@ -1791,6 +1791,7 @@ $(MAMEOBJ)/misc.a: \ $(DRIVERS)/flipjack.o \ $(DRIVERS)/flower.o $(AUDIO)/flower.o $(VIDEO)/flower.o \ $(DRIVERS)/fortecar.o \ + $(DRIVERS)/fresh.o \ $(DRIVERS)/freekick.o $(VIDEO)/freekick.o \ $(DRIVERS)/funkball.o \ $(DRIVERS)/galaxi.o \