summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Luca Elia <lucaelia@mamedev.org>2010-05-16 14:04:49 +0000
committer Luca Elia <lucaelia@mamedev.org>2010-05-16 14:04:49 +0000
commitede9da11b2f8cc3bab6262bc58dfcabd55ca9a72 (patch)
treec92e89510e237e974f0d86afdf23e835486ec6aa
parentd99ab5cd26eea77c4423b2b5b8253d003a295d90 (diff)
New driver: sigmab98.c [Luca Elia]
New games added or promoted from NOT_WORKING status --------------------------------------------------- GeGeGe no Kitarou Youkai Slot [A. Hoekman, ranger_lennier, Smitdogg, The Dumping Union, Luca Elia] New games marked as GAME_NOT_WORKING ------------------------------------ Win Win Bingo (2 sets) [f205v, Filippo Tarderia] Zoo [Brian Troha, The Dumping Union]
-rw-r--r--.gitattributes1
-rw-r--r--src/emu/machine/eeprom.c24
-rw-r--r--src/emu/video/generic.c6
-rw-r--r--src/emu/video/generic.h1
-rw-r--r--src/mame/drivers/astrocorp.c202
-rw-r--r--src/mame/drivers/sigmab98.c582
-rw-r--r--src/mame/mame.mak1
-rw-r--r--src/mame/mamedriv.c9
8 files changed, 800 insertions, 26 deletions
diff --git a/.gitattributes b/.gitattributes
index 738e9fe738c..4df1c922fea 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2107,6 +2107,7 @@ src/mame/drivers/shuuz.c svneol=native#text/plain
src/mame/drivers/sidearms.c svneol=native#text/plain
src/mame/drivers/sidepckt.c svneol=native#text/plain
src/mame/drivers/sigmab52.c svneol=native#text/plain
+src/mame/drivers/sigmab98.c svneol=native#text/plain
src/mame/drivers/silkroad.c svneol=native#text/plain
src/mame/drivers/simpl156.c svneol=native#text/plain
src/mame/drivers/simpsons.c svneol=native#text/plain
diff --git a/src/emu/machine/eeprom.c b/src/emu/machine/eeprom.c
index 0f34e445021..fa2b869b757 100644
--- a/src/emu/machine/eeprom.c
+++ b/src/emu/machine/eeprom.c
@@ -106,23 +106,25 @@ const eeprom_interface eeprom_interface_93C46 =
"*111", // erase 1 11 aaaaaa
"*10000xxxx", // lock 1 00 00xxxx
"*10011xxxx", // unlock 1 00 11xxxx
- 1,
+ 1, // enable_multi_read
+ 0 // reset_delay
// "*10001xxxx" // write all 1 00 01xxxx dddddddddddddddd
// "*10010xxxx" // erase all 1 00 10xxxx
};
const eeprom_interface eeprom_interface_93C66B =
{
- 8, /* address bits */
- 16, /* data bits */
- "*110", /* read command */
- "*101", /* write command */
- "*111", /* erase command */
- "*10000xxxxxx", /* lock command */
- "*10011xxxxxx", /* unlock command */
- 1,
-// "*10001xxxxxx", /* write all */
-// "*10010xxxxxx", /* erase all */
+ 8, // address bits
+ 16, // data bits
+ "*110", // read command
+ "*101", // write command
+ "*111", // erase command
+ "*10000xxxxxx", // lock command
+ "*10011xxxxxx", // unlock command
+ 1, // enable_multi_read
+ 0 // reset_delay
+// "*10001xxxxxx", // write all
+// "*10010xxxxxx", // erase all
};
static void eeprom_write(running_device *device, int bit)
diff --git a/src/emu/video/generic.c b/src/emu/video/generic.c
index be425acc09d..69854e0420f 100644
--- a/src/emu/video/generic.c
+++ b/src/emu/video/generic.c
@@ -927,6 +927,12 @@ WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_le_w )
set_color_555(space->machine, offset / 2, 10, 5, 0, paletteram16_le(space->machine, offset));
}
+WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_be_w )
+{
+ space->machine->generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine, offset / 2, 10, 5, 0, paletteram16_be(space->machine, offset));
+}
+
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_split1_w )
{
space->machine->generic.paletteram.u8[offset] = data;
diff --git a/src/emu/video/generic.h b/src/emu/video/generic.h
index 9a048eb15cc..5eeb4facfc4 100644
--- a/src/emu/video/generic.h
+++ b/src/emu/video/generic.h
@@ -142,6 +142,7 @@ WRITE8_HANDLER( paletteram_xBBBBBRRRRRGGGGG_split1_w ); /* uses paletteram */
WRITE8_HANDLER( paletteram_xBBBBBRRRRRGGGGG_split2_w ); /* uses paletteram2 */
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_le_w );
+WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_be_w );
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_split1_w );
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_split2_w );
WRITE16_HANDLER( paletteram16_xRRRRRGGGGGBBBBB_word_w );
diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c
index 578433f6c16..b12f089b4ae 100644
--- a/src/mame/drivers/astrocorp.c
+++ b/src/mame/drivers/astrocorp.c
@@ -1,21 +1,31 @@
-/***************************************************************************
+/*************************************************************************************************************
- -= Astro Corp. Hardware =-
+ -= Astro Corp. CGA Hardware =-
- driver by Luca Elia (l.elia@tin.it)
+ driver by Luca Elia (l.elia@tin.it)
CPU: 68000
-GFX: ASTRO V01 0005 or ASTRO V02 0022
+GFX: ASTRO V01 or V02 or V06
SOUND: OKI M6295 (AD-65)
OTHER: EEPROM, Battery
512 sprites, each made of N x M tiles. Tiles are 16x16x8
+-------------------------------------------------------------------------------------------------------------------
+Year + Game PCB ID CPU Video Chips Notes
+-------------------------------------------------------------------------------------------------------------------
+00 Show Hand CHE-B50-4002A 68000 ASTRO V01 ASTRO 0001B (28 pins), pLSI1016-60LJ
+00 Wang Pai Dui J. CHE-B50-4002A 68000 ASTRO V01 MDT2020AP MCU (28 pins), pLSI1016
+02 Skill Drop GA None JX-1689F1028N ASTRO V02 pLSI1016-60LJ
+05? Zoo M1.1 ASTRO V102PX-005? ASTRO V06 ASTRO F02 2005-02-18 Encrypted
+05? Win Win Bingo M1.2 ASTRO V102PX-006? ASTRO V06 ASTRO F02 2005-09-17 Encrypted
+-------------------------------------------------------------------------------------------------------------------
+
To do:
- Find source of level 2 interrupt
-***************************************************************************/
+*************************************************************************************************************/
#include "emu.h"
#include "deprecat.h"
@@ -62,17 +72,19 @@ static VIDEO_START( astrocorp )
Offset: Bits: Value:
- 0.w f--- ---- ---- ---- Show This Sprite
+ 0 f--- ---- ---- ---- Show This Sprite
-edc ba98 7654 3210 X
- 1.w Code
+ 1 Code
- 2.w f--- ---- ---- ---- -
+ 2 f--- ---- ---- ---- -
-edc ba98 7654 3210 Y
- 3.w fedc ba98 ---- ---- X Size
+ 3 fedc ba98 ---- ---- X Size
---- ---- 7654 3210 Y Size
+ If the first two words are zero, the sprite list ends
+
***************************************************************************/
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
@@ -529,7 +541,7 @@ MACHINE_DRIVER_END
/***************************************************************************
Show Hand
-(C) 1999? Astro Corp.
+(C) 2000? Astro Corp.
PCB CHE-B50-4002A 88 94V-0 0002
@@ -687,6 +699,167 @@ ROM_START( skilldrp )
ROM_LOAD( "skilldrp.u6", 0x00, 0x80, CRC(57886a3d) SHA1(bad8fa2ec2262ccb5ef8ec50959aec3f3bf8b90b) )
ROM_END
+/***************************************************************************
+
+Win Win Bingo
+
+------------------------------------------------------------------------
+ASTRO M1.2
+
+ ------
+ | |
+ | os1|
+ | |
+ ------
+
+
+
+ --------- --------- ---------
+ | | | | | |
+ | U1 | | U24 | | U30 |
+ | | | | | |
+ | | | | | |
+ --------- --------- ---------
+
+ --------- ---------
+ | | | |
+ | U25 | | U26 |
+ | | | |
+ | | | |
+ --------- ---------
+ ------
+ | |
+ | U10 |
+ | |
+ ------
+
+
+ --------- ---------
+ | | | |
+ | U31 | | U32 |
+ | | | |
+ | | | |
+ --------- ---------
+
+
+ --------- ---------
+ | | | |
+ | U27 | | U35 |
+ | | | |
+ | | | |
+ --------- ---------
+
+ --------- --------- ---------
+ | | | | | |
+ | U28 | | U33 | | U39 |
+ | | | | | |
+ | | | | | |
+ --------- --------- ---------
+
+ --------- --------- ---------
+ | | | | | |
+ | U29 | | U34 | | U41 |
+ | | | | | |
+ | | | | | |
+ --------- --------- ---------
+--------------------------------------------------------------------
+
+U1= ASTRO F02 2005-09-17
+U10= ASTRO V102PX-006
+U32= ASTRO V06 0430
+OS1= QUARTZ 24.000MHZ
+U25= SYNCMOS F29C51001T
+U31= SYNCMOS F29C51001T
+U30= MX 29F1610MC
+U26= MX 29F1610MC
+U35= MX 27C4000PC-12
+U24= HMI HM62C64P
+U27= HMI HM62C64P
+U28= HMI HM6116P
+U29= HMI HM6116P
+U33= HMI HM6116P
+U34= HMI HM6116P
+U39= BSI BS62LV1023SC
+U41= BSI BS62LV1023SC
+
+***************************************************************************/
+
+ROM_START( winbingo )
+ ROM_REGION( 0x40000, "maincpu", 0 )
+ ROM_LOAD16_BYTE( "f29c51001t.u31", 0x00000, 0x20000, CRC(964cfdb5) SHA1(01109466e07f5e906be300bc69310171d34f2e6c) )
+ ROM_LOAD16_BYTE( "f29c51001t.u25", 0x00001, 0x20000, CRC(4ebeec72) SHA1(c603265e6319cff94a0c75017a12c6d86787f906) )
+
+ ROM_REGION( 0x400000, "sprites", ROMREGION_ERASE )
+ ROM_LOAD( "mxf291610mc.u26", 0x000000, 0x200000, CRC(ad1f61e7) SHA1(845aa01d49c50bcadaed16d76c0dd9131a425b46) )
+ ROM_LOAD( "mx29f1610mc.u30.bad.dump", 0x200000, 0x0a0000, BAD_DUMP CRC(6da439c5) SHA1(6afc0c800fe57b9b34ca317f4d1c040b11d3d988) )
+
+ ROM_REGION( 0x80000, "oki", 0 )
+ ROM_LOAD( "mx27c4000pc.u35", 0x00000, 0x80000, CRC(445d81c0) SHA1(cacb9c262740c31ea42f406e9f960a1edd1b3ead) )
+ROM_END
+
+ROM_START( winbingoa )
+ ROM_REGION( 0x40000, "maincpu", 0 )
+ ROM_LOAD16_BYTE( "f29c51001t.u31", 0x00000, 0x20000, CRC(c33676c3) SHA1(9f5b7d05d187cf59948a572f80c55cb8fa1f656f) )
+ ROM_LOAD16_BYTE( "f29c51001t.u25", 0x00001, 0x20000, CRC(43c7b2d8) SHA1(16ee79c34b7c485dfccecdf3e0ae9f18f8a20150) )
+
+ ROM_REGION( 0x400000, "sprites", 0 )
+ ROM_LOAD( "mx29f1610mc.u26", 0x000000, 0x200000, CRC(ad1f61e7) SHA1(845aa01d49c50bcadaed16d76c0dd9131a425b46) )
+ ROM_LOAD( "mx29f1610mc.u30", 0x200000, 0x200000, CRC(31613d99) SHA1(1c720f8d981c3e9cb9d9b3b27eb95e7f72ccfc93) )
+
+ ROM_REGION( 0x80000, "oki", 0 )
+ ROM_LOAD( "mx27c4000pc.u35", 0x00000, 0x80000, CRC(e48ed57d) SHA1(11995b90e70e010b292ba9db2da0af4ebf795c1a) )
+ROM_END
+
+/***************************************************************************
+
+Zoo by Astro
+
+Astro M1.1 PCB
+ Astro V06 0430 160pin PQFP ("ASTRO02" silkscreened under chip)
+ Astro V102PX-005 T042652846 at U10 (68K core? has direct connection to program roms)
+ Astro F02 2005-02-18 socketted FPGA type chip
+ OKI 6295 clone chip (AD-65)
+
+RAM:
+ 2 x KTC KT76C88-70LL
+ 4 x HM6116L-70
+ 2 x BSI BS62LV1025SC-70
+
+EEPROM
+ Atmel 93C46
+
+OSC
+ 26.824MHz
+
+Battery
+ 3.6V
+
+One push button for reset or test mode
+One VR pot for sound volume
+
+ZOO Z0.02.D at both U25 & U26 are Winbond W27C512 roms and are program code
+5 ZOO is a MX 27C4000 rom and is the sample rom
+29F1610mc at U26 (yes "U26" is present twice on the PCB) are the graphics
+
+***************************************************************************/
+
+ROM_START( zoo )
+ ROM_REGION( 0x20000, "maincpu", 0 )
+ ROM_LOAD16_BYTE( "zoo_zo.02.d.u25", 0x00000, 0x10000, CRC(8566aa21) SHA1(319192e2074f3bdda6001d8e9a4b97e98826d7ce) )
+ ROM_LOAD16_BYTE( "zoo_zo.02.d.u26", 0x00001, 0x10000, CRC(1a3be45a) SHA1(877be4c9e8d5e7c4644e7bcb9a6729443ed772a4) )
+
+ ROM_REGION( 0x200000, "sprites", 0 )
+ ROM_LOAD( "29f1610mc.u26", 0x000000, 0x200000, CRC(f5cfd915) SHA1(ec869b47d0762102509dcfc1349d94340037fad5) )
+
+ ROM_REGION( 0x80000, "oki", 0 )
+ ROM_LOAD( "5_zoo", 0x00000, 0x80000, CRC(b0c9f7aa) SHA1(99345ba0f8da3907f26c9bd29d70135f3ab7cd60) )
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD( "zoo_93c46", 0x00, 0x80, CRC(0053fcc4) SHA1(e67a495f9586dd3946f79d50506fba1ae913f6ec) )
+ROM_END
+
+
+
static DRIVER_INIT( showhand )
{
#if 0
@@ -716,6 +889,9 @@ static DRIVER_INIT( showhanc )
#endif
}
-GAME( 1999?, showhand, 0, showhand, showhand, showhand, ROT0, "Astro Corp.", "Show Hand (Italy)", GAME_SUPPORTS_SAVE )
-GAME( 1999?, showhanc, showhand, showhanc, showhanc, showhanc, ROT0, "Astro Corp.", "Wang Pai Dui Jue", GAME_SUPPORTS_SAVE )
-GAME( 2002, skilldrp, 0, skilldrp, skilldrp, 0, ROT0, "Astro Corp.", "Skill Drop Georgia", GAME_SUPPORTS_SAVE )
+GAME( 2000, showhand, 0, showhand, showhand, showhand, ROT0, "Astro Corp.", "Show Hand (Italy)", GAME_SUPPORTS_SAVE )
+GAME( 2000, showhanc, showhand, showhanc, showhanc, showhanc, ROT0, "Astro Corp.", "Wang Pai Dui Jue", GAME_SUPPORTS_SAVE )
+GAME( 2002, skilldrp, 0, skilldrp, skilldrp, 0, ROT0, "Astro Corp.", "Skill Drop Georgia", GAME_SUPPORTS_SAVE )
+GAME( 2005?, winbingo, 0, showhand, showhand, 0, ROT0, "Astro Corp.", "Win Win Bingo (set 1)", GAME_NOT_WORKING )
+GAME( 2005?, winbingoa, winbingo, showhand, showhand, 0, ROT0, "Astro Corp.", "Win Win Bingo (set 2)", GAME_NOT_WORKING )
+GAME( 2005?, zoo, 0, showhand, showhand, 0, ROT0, "Astro Corp.", "Zoo", GAME_NOT_WORKING )
diff --git a/src/mame/drivers/sigmab98.c b/src/mame/drivers/sigmab98.c
new file mode 100644
index 00000000000..cb6177e28f3
--- /dev/null
+++ b/src/mame/drivers/sigmab98.c
@@ -0,0 +1,582 @@
+/*************************************************************************************************************
+
+ -= Sigma B-98 Hardware =-
+
+ driver by Luca Elia
+
+CPU : Z80
+Custom : TAXAN KY-3211, TAXAN KY-80 (Yamaha)
+Sound : YMZ280B
+NVRAM : 93C46, Battery
+
+Graphics are made of sprites only.
+Each sprite is composed of X x Y tiles and can be zoomed / shrunk.
+Tiles can be 16x16x4 or 16x16x8.
+
+To Do:
+
+- Remove ROM patches from gegege
+- gegege checks the EEPROM output after reset, and wants a timed 0->1 transition or locks up while
+ saving setting in service mode. Using a reset_delay of 7 works, unless when "play style" is set
+ to "coin" (it probably changes the number of reads from port $C0).
+ I guess the reset_delay mechanism should be implemented with a timer in eeprom.c.
+
+*************************************************************************************************************/
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "sound/ymz280b.h"
+#include "machine/eeprom.h"
+#include "machine/ticket.h"
+
+/***************************************************************************
+
+ Video
+
+***************************************************************************/
+
+/***************************************************************************
+
+ Sprites
+
+ Offset: Bits: Value:
+
+ 0 7654 ----
+ ---- 3210 Color
+ 1 7--- ----
+ -6-- ---- 256 Color Sprite
+ --5- ----
+ ---4 ---- ?
+ ---- 3---
+ ---- -2-- Draw Sprite
+ ---- --10
+ 2 Tile Code (High)
+ 3 Tile Code (Low)
+ 4 7654 3--- Number of X Tiles - 1
+ ---- -210 X (High)
+ 5 X (Low)
+ 6 7654 3--- Number of Y Tiles - 1
+ ---- -210 Y (High)
+ 7 Y (Low)
+ 8 Zoom Factor (<< 8, High)
+ 9 Zoom Factor (<< 8, Low)
+ a
+ b
+ c 7654 3---
+ ---- -210 Delta X (High)
+ d Delta X (Low)
+ e 7654 3---
+ ---- -210 Delta Y (High)
+ f Delta Y (Low)
+
+***************************************************************************/
+
+static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+{
+ UINT8 *end = machine->generic.spriteram.u8 - 0x10;
+ UINT8 *s = end + machine->generic.spriteram_size;
+
+ for ( ; s != end; s -= 0x10 )
+ {
+ int gfx, code, color, zoom, dim, scale;
+ int sx, nx, x, x0, x1, dx, flipx;
+ int sy, ny, y, y0, y1, dy, flipy;
+
+ if ( (s[ 0x01 ] & 0x04) == 0)
+ continue;
+
+ color = s[ 0x00 ] & 0xf;
+
+ gfx = (s[ 0x01 ] & 0x40 ) ? 1 : 0;
+
+ code = s[ 0x02 ] * 256 + s[ 0x03 ];
+
+ nx = ((s[ 0x04 ] & 0xf8) >> 3) + 1;
+
+ sx = (s[ 0x04 ] & 0x03) * 256 + s[ 0x05 ];
+
+ ny = ((s[ 0x06 ] & 0xf8) >> 3) + 1;
+
+ sy = (s[ 0x06 ] & 0x03) * 256 + s[ 0x07 ];
+
+ zoom = (s[ 0x08 ] & 0xff) * 256 + s[ 0x09 ];
+
+ dx = (s[ 0x0c ] & 0x03) * 256 + s[ 0x0d ];
+ dy = (s[ 0x0e ] & 0x03) * 256 + s[ 0x0f ];
+
+ // Sign extend the position
+ sx = (sx & 0x1ff) - (sx & 0x200);
+ sy = (sy & 0x1ff) - (sy & 0x200);
+ dx = (dx & 0x1ff) - (dx & 0x200);
+ dy = (dy & 0x1ff) - (dy & 0x200);
+
+ // Add shift
+ sx += dx;
+ sy += dy;
+
+ // Use fixed point values (16.16), for accuracy
+ sx <<= 16;
+ sy <<= 16;
+
+ dim = (0x10 << 8) * zoom;
+ scale = dim / 0x10;
+
+ // Let's approximate to the nearest greater integer value
+ // to avoid holes in between tiles
+ if (scale & 0xffff) scale += (1<<16) / 0x10;
+
+ flipx = 0; // ?
+ flipy = 0; // ?
+
+ if ( flipx ) { x0 = nx - 1; x1 = -1; dx = -1; }
+ else { x0 = 0; x1 = nx; dx = +1; }
+
+ if ( flipy ) { y0 = ny - 1; y1 = -1; dy = -1; }
+ else { y0 = 0; y1 = ny; dy = +1; }
+
+ for (y = y0; y != y1; y += dy)
+ {
+ for (x = x0; x != x1; x += dx)
+ {
+ drawgfxzoom_transpen( bitmap, cliprect, machine->gfx[gfx],
+ code++, color,
+ flipx, flipy,
+ (sx + x * dim) / 0x10000, (sy + y * dim) / 0x10000,
+ scale, scale, 0 );
+ }
+ }
+ }
+}
+
+VIDEO_UPDATE(sigmab98)
+{
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ draw_sprites(screen->machine, bitmap, cliprect);
+ return 0;
+}
+
+
+/***************************************************************************
+
+ Memory Maps
+
+***************************************************************************/
+
+static UINT8 reg, rombank;
+static UINT8 reg2, rambank;
+
+// rombank
+static WRITE8_HANDLER( regs_w )
+{
+ if (offset == 0)
+ {
+ reg = data;
+ return;
+ }
+
+ switch ( reg )
+ {
+ case 0x1f:
+ rombank = data;
+ if (data >= 0x18)
+ logerror("%s: unknown rom bank = %02x\n", cpuexec_describe_context(space->machine), data);
+ else
+ memory_set_bank(space->machine, "rombank", data);
+ break;
+
+ default:
+ logerror("%s: unknown reg written: %02x = %02x\n", cpuexec_describe_context(space->machine), reg, data);
+ }
+}
+static READ8_HANDLER( regs_r )
+{
+ if (offset == 0)
+ return reg;
+
+ switch ( reg )
+ {
+ case 0x1f:
+ return rombank;
+
+ default:
+ logerror("%s: unknown reg read: %02x\n", cpuexec_describe_context(space->machine), reg);
+ return 0x00;
+ }
+}
+
+// rambank
+static WRITE8_HANDLER( regs2_w )
+{
+ if (offset == 0)
+ {
+ reg2 = data;
+ return;
+ }
+
+ switch ( reg2 )
+ {
+ case 0xb5:
+ rambank = data;
+ switch (data)
+ {
+ case 0x32:
+ memory_set_bank(space->machine, "rambank", 0);
+ break;
+ case 0x36:
+ memory_set_bank(space->machine, "rambank", 1);
+ break;
+ default:
+ logerror("%s: unknown ram bank = %02x\n", cpuexec_describe_context(space->machine), data);
+ }
+ break;
+
+ default:
+ logerror("%s: unknown reg2 written: %02x = %02x\n", cpuexec_describe_context(space->machine), reg2, data);
+ }
+}
+static READ8_HANDLER( regs2_r )
+{
+ if (offset == 0)
+ return reg2;
+
+ switch ( reg2 )
+ {
+ case 0xb5:
+ return rambank;
+
+ default:
+ logerror("%s: unknown reg2 read: %02x\n", cpuexec_describe_context(space->machine), reg2);
+ return 0x00;
+ }
+}
+
+
+// Outputs
+
+UINT8 c0,c4,c6,c8;
+static void show_outputs()
+{
+#ifdef MAME_DEBUG
+ popmessage("0: %02X 4: %02X 6: %02X 8: %02X",c0,c4,c6,c8);
+#endif
+}
+
+// Port c0
+static WRITE8_DEVICE_HANDLER( eeprom_w )
+{
+ // latch the bit
+ eeprom_write_bit(device, data & 0x40);
+
+ // reset line asserted: reset.
+// if ((c0 ^ data) & 0x20)
+ eeprom_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
+
+ // clock line asserted: write latch or select next bit to read
+ eeprom_set_clock_line(device, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
+
+ c0 = data;
+ show_outputs();
+}
+
+// Port c4
+// 10 led?
+static WRITE8_HANDLER( c4_w )
+{
+ set_led_status(space->machine, 0, (data & 0x10));
+
+ c4 = data;
+ show_outputs();
+}
+
+// Port c6
+// 03 lockout (active low, 02 is cleared when reaching 99 credits)
+// 04 pulsed on coin in
+// 08 always blinks
+// 10 led?
+// 20 blinks after coin up
+static WRITE8_HANDLER( c6_w )
+{
+ coin_lockout_w(space->machine, 0, (~data) & 0x02);
+
+ coin_counter_w(space->machine, 0, data & 0x04);
+
+ set_led_status(space->machine, 1, data & 0x08);
+ set_led_status(space->machine, 2, data & 0x10);
+ set_led_status(space->machine, 3, data & 0x20); //
+
+ c6 = data;
+ show_outputs();
+}
+
+// Port c8
+// 01 hopper enable?
+// 02 hopper motor on (active low)?
+static WRITE8_HANDLER( c8_w )
+{
+ ticket_dispenser_w(devtag_get_device(space->machine, "hopper"), 0, (!(data & 0x02) && (data & 0x01)) ? 0x00 : 0x80);
+
+ c8 = data;
+ show_outputs();
+}
+
+static ADDRESS_MAP_START( gegege_mem_map, ADDRESS_SPACE_PROGRAM, 8 )
+ AM_RANGE( 0x0000, 0x7fff ) AM_ROM
+ AM_RANGE( 0x8000, 0x9fff ) AM_ROMBANK("rombank")
+
+ AM_RANGE( 0xa000, 0xafff ) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
+
+ AM_RANGE( 0xc000, 0xc1ff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_be_w) AM_BASE_GENERIC(paletteram)
+
+ AM_RANGE( 0xc800, 0xc87f ) AM_RAM
+
+// AM_RANGE( 0xd001, 0xd021 ) AM_RAM
+ AM_RANGE( 0xd800, 0xdfff ) AM_RAMBANK("rambank")
+
+ AM_RANGE( 0xe000, 0xefff ) AM_RAM AM_BASE_SIZE_GENERIC(nvram) // battery
+
+ AM_RANGE( 0xf000, 0xffff ) AM_RAM
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( gegege_io_map, ADDRESS_SPACE_IO, 8 )
+ ADDRESS_MAP_GLOBAL_MASK(0xff)
+
+ AM_RANGE( 0x00, 0x01 ) AM_DEVWRITE( "ymz", ymz280b_w )
+
+ AM_RANGE( 0xa0, 0xa1 ) AM_READWRITE( regs_r, regs_w )
+// AM_RANGE( 0xa2, 0xa3 )
+ AM_RANGE( 0xa4, 0xa5 ) AM_READWRITE( regs2_r, regs2_w )
+
+ AM_RANGE( 0xc0, 0xc0 ) AM_READ_PORT( "EEPROM" )
+ AM_RANGE( 0xc0, 0xc0 ) AM_DEVWRITE("eeprom", eeprom_w)
+
+ AM_RANGE( 0xc2, 0xc2 ) AM_READ_PORT( "IN1" )
+
+ AM_RANGE( 0xc4, 0xc4 ) AM_READ_PORT( "IN2" )
+ AM_RANGE( 0xc4, 0xc4 ) AM_WRITE( c4_w )
+
+ AM_RANGE( 0xc6, 0xc6 ) AM_WRITE( c6_w )
+
+ AM_RANGE( 0xc8, 0xc8 ) AM_WRITE( c8_w )
+
+ AM_RANGE( 0xe5, 0xe5 ) AM_READNOP // during irq
+ADDRESS_MAP_END
+
+
+/***************************************************************************
+
+ Graphics Layout
+
+***************************************************************************/
+
+static const gfx_layout sigmab98_16x16x4_layout =
+{
+ 16,16,
+ RGN_FRAC(1,1),
+ 4,
+ { STEP4(0,1) },
+ { 4*1,4*0, 4*3,4*2, 4*5,4*4, 4*7,4*6, 4*9,4*8, 4*11,4*10, 4*13,4*12, 4*15,4*14 },
+ { STEP16(0,16*4) },
+ 16*16*4
+};
+
+static const gfx_layout sigmab98_16x16x8_layout =
+{
+ 16,16,
+ RGN_FRAC(1,1),
+ 8,
+ { STEP8(0,1) },
+ { STEP16(0,8) },
+ { STEP16(0,16*8) },
+ 16*16*8
+};
+
+static GFXDECODE_START( sigmab98 )
+ GFXDECODE_ENTRY( "sprites", 0, sigmab98_16x16x4_layout, 0, 0x100/16 )
+ GFXDECODE_ENTRY( "sprites", 0, sigmab98_16x16x8_layout, 0, 0x100/256 )
+GFXDECODE_END
+
+
+/***************************************************************************
+
+ Input Ports
+
+***************************************************************************/
+
+static INPUT_PORTS_START( gegege )
+
+ PORT_START("EEPROM")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) // protection? checks. Must be 0
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) // protection? checks. Must be 0
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("eeprom", eeprom_read_bit)
+
+ PORT_START("IN1")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // ? (coin error, pulses mask 4 of port c6)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin/medal in (coin error)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("hopper", ticket_dispenser_line_r)
+ PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Bet") // bet / select in test menu
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Play") // play game / select in test menu
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
+
+ PORT_START("IN2")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Pay Out") // pay out / change option in test menu
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
+
+INPUT_PORTS_END
+
+
+/***************************************************************************
+
+ Machine Drivers
+
+***************************************************************************/
+
+const eeprom_interface eeprom_intf =
+{
+ 6, // address bits 6
+ 16, // data bits 16
+ "*110", // read 1 10 aaaaaa
+ "*101", // write 1 01 aaaaaa dddddddddddddddd
+ "*111", // erase 1 11 aaaaaa
+ "*10000xxxx", // lock 1 00 00xxxx
+ "*10011xxxx", // unlock 1 00 11xxxx
+ 0, // enable_multi_read
+ 7 // reset_delay (otherwise gegege will hang when saving settings)
+};
+
+static INTERRUPT_GEN( gegege_vblank_interrupt )
+{
+ cpu_set_input_line_and_vector(device, 0, HOLD_LINE, 0x5a);
+}
+
+static MACHINE_DRIVER_START( gegege )
+ MDRV_CPU_ADD("maincpu", Z80, XTAL_27MHz / 4) // ?
+ MDRV_CPU_PROGRAM_MAP(gegege_mem_map)
+ MDRV_CPU_IO_MAP(gegege_io_map)
+ MDRV_CPU_VBLANK_INT("screen", gegege_vblank_interrupt)
+
+ MDRV_NVRAM_HANDLER(generic_0fill)
+ MDRV_EEPROM_ADD("eeprom", eeprom_intf)
+
+ MDRV_TICKET_DISPENSER_ADD("hopper", 200, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW )
+
+ MDRV_SCREEN_ADD("screen", RASTER)
+ MDRV_SCREEN_REFRESH_RATE(60) // ?
+ MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
+ MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
+ MDRV_SCREEN_SIZE(0x200, 0x200)
+ MDRV_SCREEN_VISIBLE_AREA(0,0x140-1, 0,0xf0-1)
+
+ MDRV_GFXDECODE(sigmab98)
+ MDRV_PALETTE_LENGTH(0x100)
+
+ MDRV_VIDEO_UPDATE(sigmab98)
+
+ // sound hardware
+ MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+
+ MDRV_SOUND_ADD("ymz", YMZ280B, XTAL_27MHz / 2) // ?
+ MDRV_SOUND_ROUTE(0, "lspeaker", 1.0)
+ MDRV_SOUND_ROUTE(1, "rspeaker", 1.0)
+MACHINE_DRIVER_END
+
+
+/***************************************************************************
+
+ ROMs Loading
+
+***************************************************************************/
+
+/***************************************************************************
+
+ GeGeGe no Kitarou Youkai Slot
+
+ (C) 1997 Banpresto, Sigma
+
+ PCB B-98-1 / 970703 (c) 1997 Sigma:
+
+ XTAL 27MHz
+
+ Battery
+
+ 93C46 EEPROM
+
+ YMZ280B
+
+ TAXAN Japan
+ KY-3211
+ 9722 AZGC
+ QFP(PULL), ASIC for TFT-LCD
+
+ TAXAN
+ KY-80
+ YAMAHA
+ 9650 AZGC
+ QFP(PULL) 50, Video IC for LCD
+
+***************************************************************************/
+
+ROM_START( gegege )
+ ROM_REGION( 0x20000, "maincpu", 0 )
+ ROM_LOAD( "b9804-1.ic7", 0x00000, 0x20000, CRC(f8b4f855) SHA1(598bd9f91123e9ab539ce3f33779bff2d072e731) )
+
+ ROM_REGION( 0x100000, "sprites", 0 )
+ ROM_LOAD( "b9804-2.ic12", 0x00000, 0x80000, CRC(4211079d) SHA1(d601c623fb909f1346fd02b8fb37b67956e2cd4e) )
+ ROM_LOAD( "b9804-3.ic13", 0x80000, 0x80000, CRC(54aeb2aa) SHA1(ccf939111f6288a889846d51bab47ff4e992c542) )
+
+ ROM_REGION( 0x80000, "ymz", 0 )
+ ROM_LOAD( "b9804-5.ic16", 0x00000, 0x80000, CRC(ddd7984c) SHA1(3558c495776671ffd3cd5c665b87827b3959b360) )
+ROM_END
+
+static DRIVER_INIT( gegege )
+{
+ UINT8 *rom = memory_region(machine, "maincpu");
+
+ // Protection?
+ rom[0xbd3] = 0x18;
+ rom[0xbd4] = 0x14;
+
+ rom[0xbef] = 0x18;
+ rom[0xbf0] = 0x14;
+
+ rom[0xdec] = 0x00;
+ rom[0xded] = 0x00;
+
+ // EEPROM timing checks
+ rom[0x8138] = 0x00;
+ rom[0x8139] = 0x00;
+
+ rom[0x8164] = 0x00;
+ rom[0x8165] = 0x00;
+
+ // ROM banks
+ memory_configure_bank(machine, "rombank", 0, 0x18, rom + 0x8000, 0x1000);
+ memory_set_bank(machine, "rombank", 0);
+
+ // RAM banks
+ UINT8 *bankedram = auto_alloc_array(machine, UINT8, 0x800 * 2);
+
+ memory_configure_bank(machine, "rambank", 0, 2, bankedram, 0x800);
+ memory_set_bank(machine, "rambank", 0);
+}
+
+
+/***************************************************************************
+
+ Game Drivers
+
+***************************************************************************/
+
+GAME( 1997, gegege, 0, gegege, gegege, gegege, ROT0, "Banpresto / Sigma", "GeGeGe no Kitarou Youkai Slot", 0 )
diff --git a/src/mame/mame.mak b/src/mame/mame.mak
index 4232c42ad43..6cceaade54b 100644
--- a/src/mame/mame.mak
+++ b/src/mame/mame.mak
@@ -1213,6 +1213,7 @@ $(MAMEOBJ)/sigma.a: \
$(DRIVERS)/nyny.o \
$(DRIVERS)/r2dtank.o \
$(DRIVERS)/sigmab52.o \
+ $(DRIVERS)/sigmab98.o \
$(DRIVERS)/spiders.o $(AUDIO)/spiders.o \
$(DRIVERS)/sub.o \
diff --git a/src/mame/mamedriv.c b/src/mame/mamedriv.c
index 9568edd278c..87494f45dd6 100644
--- a/src/mame/mamedriv.c
+++ b/src/mame/mamedriv.c
@@ -8308,6 +8308,9 @@ Other Sun games
DRIVER( jwildb52a ) /* (c) 199? Sigma */
DRIVER( jwildb52h ) /* (c) 199? Sigma */
+ /* Sigma B98 */
+ DRIVER( gegege ) /* (c) 1997 Banpresto / Sigma */
+
/* IGS games ( www.igs.com.tw ) */
DRIVER( goldstar ) /* (c) 198? IGS */
DRIVER( goldstbl ) /* (c) 198? IGS */
@@ -9568,9 +9571,11 @@ Other Sun games
DRIVER( supjolly ) /* (c) 200? unknown */
/* Astro Corp. */
- DRIVER( showhand ) /* (c) 1999? Astro Corp. */
- DRIVER( showhanc ) /* (c) 1999? Astro Corp. */
+ DRIVER( showhand ) /* (c) 2000 Astro Corp. */
+ DRIVER( showhanc ) /* (c) 2000 Astro Corp. */
DRIVER( skilldrp ) /* (c) 2002 Astro Corp. */
+ DRIVER( winbingo ) /* (c) 2005? Astro Corp. */
+ DRIVER( winbingoa ) /* (c) 2005? Astro Corp. */
/* Dyna */
DRIVER( ncb3 ) /* (c) 199? Dyna Electronics */