summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Roberto Fresca <robertof@mamedev.org>2008-09-10 23:47:12 +0000
committer Roberto Fresca <robertof@mamedev.org>2008-09-10 23:47:12 +0000
commit1510ffd2e337e5b5885d59bf21d1c4da20089270 (patch)
tree59fe6a6c15b9f6e90d84b39ae3804d354cc1036c
parent98f430a552adf0aba5268ef95b8a4b9a050f51f7 (diff)
Improvements to Croupier (Playmark Roulette):
- Simulated the MCU communication/protection. The game seems to work properly, but is hard to win. I conserved the game flags till we have the MCU decapped, and emulated properly. - Added full sound support. - Added lamps support + layout.
-rw-r--r--.gitattributes1
-rw-r--r--src/mame/drivers/sderby.c103
-rw-r--r--src/mame/layout/pmroulet.lay42
-rw-r--r--src/mame/mame.mak1
4 files changed, 133 insertions, 14 deletions
diff --git a/.gitattributes b/.gitattributes
index b55ef058025..857333713f1 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2477,6 +2477,7 @@ src/mame/layout/pe_schip.lay svneol=native#text/plain
src/mame/layout/pe_slots.lay svneol=native#text/plain
src/mame/layout/peplus.lay svneol=native#text/plain
src/mame/layout/pmpoker.lay svneol=native#text/plain
+src/mame/layout/pmroulet.lay -text svneol=native#plain/text
src/mame/layout/poker41.lay svneol=native#text/plain
src/mame/layout/pokio.lay svneol=native#text/plain
src/mame/layout/pottnpkr.lay svneol=native#text/plain
diff --git a/src/mame/drivers/sderby.c b/src/mame/drivers/sderby.c
index 2a0086d3cef..27d5d0f14ac 100644
--- a/src/mame/drivers/sderby.c
+++ b/src/mame/drivers/sderby.c
@@ -62,6 +62,7 @@
#include "sound/okim6295.h"
#include "sderby.lh"
#include "spacewin.lh"
+#include "pmroulet.lh"
UINT16 *sderby_fg_videoram;
UINT16 *sderby_md_videoram;
@@ -99,17 +100,59 @@ static READ16_HANDLER( roulette_input_r )
{
switch (offset)
{
- case 0x00 >> 1:
- return input_port_read(machine, "IN0");
- case 0x02 >> 1:
- return input_port_read(machine, "IN1");
- case 0x04 >> 1:
- return input_port_read(machine, "IN2");
+ case 0x00 >> 1:
+ return input_port_read(machine, "IN0");
+ case 0x02 >> 1:
+ return input_port_read(machine, "IN1");
+ case 0x04 >> 1:
+ return input_port_read(machine, "IN2");
}
+
return 0xffff;
+}
+
+
+/***************************************************************
+
+ Roulette MCU communication.
+ ---------------------------
+
+ Defeating the 'always win' protection...
+
+ Offset: 0x70800e - 0x70800f.
+
+ Writes to the MCU are always the same values.
+ At begining, the code writes 3 values: 0x53, 0x5a and 0x0d.
+ Then, whith each placed bet the code normally writes 0x4e.
+ After that, there are 2 reads expecting the MCU response.
+ Most probably there is a shared RAM there for communication,
+ but for now, I temporarily simulated the MCU response till
+ we can get the MCU decapped.
+
+
+****************************************************************/
+
+static READ16_HANDLER( rprot_r )
+{
+ logerror("rprot_r : offset = %02x\n",activecpu_get_pc());
+
+/* This is the only mask I found that allow a normal play.
+ Using other values, the game hangs waiting for response,
+ or simply throw a deliberated losing number.
+
+ If someone more skilled in 68K code can help to trace it,
+ searching for an accurated response, I'll appreciate.
+*/
+ return mame_rand(machine) & 0x1f;
+}
+
+static WRITE16_HANDLER( rprot_w )
+{
+ logerror("rprot_w %02x\n", data);
}
+
/******************************
* Outputs / Lamps *
******************************/
@@ -207,6 +250,35 @@ static WRITE16_HANDLER( scmatto_out_w )
}
+static WRITE16_HANDLER( roulette_out_w )
+{
+/*
+ -----------------------------------
+ --- Croupier (Roulette) Outputs ---
+ -----------------------------------
+
+ 0x708006 - 0x708007
+ ===================
+
+ 0x0000 - Normal State (lamps off).
+ 0x0001 - Start lamp.
+ 0x0002 - Bet lamp.
+ 0x0008 - Unknown (always activated).
+
+
+ - Lbits -
+ 7654 3210
+ =========
+ ---- ---x Start lamp.
+ ---- --x- Bet lamp.
+ ---- x--- Unknown (always activated).
+
+*/
+ output_set_lamp_value(1, (data & 1)); /* Lamp 1 - START */
+ output_set_lamp_value(2, (data >> 1) & 1); /* Lamp 2 - BET */
+}
+
+
/***************************
* Memory Maps *
***************************/
@@ -257,10 +329,13 @@ static ADDRESS_MAP_START( roulette_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(sderby_md_videoram_w) AM_BASE(&sderby_md_videoram) /* mid */
AM_RANGE(0x502000, 0x503fff) AM_RAM_WRITE(sderby_fg_videoram_w) AM_BASE(&sderby_fg_videoram) /* fg */
AM_RANGE(0x504000, 0x50400b) AM_RAM_WRITE(sderby_scroll_w)
- AM_RANGE(0x50400e, 0x50400f) AM_WRITE( SMH_NOP )
+ AM_RANGE(0x50400e, 0x50400f) AM_WRITE(SMH_NOP)
- AM_RANGE(0x708000, 0x70800d) AM_READ(roulette_input_r) AM_WRITE(SMH_NOP) /* what are the writes? */
- AM_RANGE(0x70800e, 0x70800f) AM_READWRITE(okim6295_status_0_lsb_r, okim6295_data_0_lsb_w) /* ROM seems to be bad */
+ AM_RANGE(0x708000, 0x708009) AM_READ(roulette_input_r)
+ AM_RANGE(0x708006, 0x708007) AM_WRITE(roulette_out_w)
+ AM_RANGE(0x70800a, 0x70800b) AM_READWRITE(okim6295_status_0_lsb_r, okim6295_data_0_lsb_w)
+ AM_RANGE(0x70800c, 0x70800d) AM_WRITE(SMH_NOP) /* watchdog?? (0x0003) */
+ AM_RANGE(0x70800e, 0x70800f) AM_READWRITE(rprot_r, rprot_w) /* MCU communication */
AM_RANGE(0x780000, 0x780fff) AM_WRITE(paletteram16_RRRRRGGGGGBBBBBx_word_w) AM_BASE(&paletteram16)
AM_RANGE(0xff0000, 0xff07ff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
@@ -567,7 +642,7 @@ ROM_START( pmroulet )
ROM_LOAD16_BYTE( "2.bin", 0x00000, 0x20000, CRC(1677a2de) SHA1(4dcbb3c1ce9b65e06ba7e0cffa00c0c8016538f5))
ROM_LOAD16_BYTE( "3.bin", 0x00001, 0x20000, CRC(11acaac2) SHA1(19e7bbbf4356fc9a866f9f36d0568c42d6a36c07))
- ROM_REGION( 0x080000, "oki", 0 ) /* samples. seems to be wrong (only 6 samples?) */
+ ROM_REGION( 0x080000, "oki", 0 ) /* samples are ok */
ROM_LOAD( "1.bin", 0x00000, 0x40000, CRC(6673de85) SHA1(df390cd6268efc0e743a9020f19bc0cbeb757cfa))
ROM_REGION( 0x280000, "gfx1", 0 ) /* sprites */
@@ -583,8 +658,8 @@ ROM_END
* Game Drivers *
******************************/
-/* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */
-GAMEL( 1996, sderby, 0, sderby, sderby, 0, ROT0, "Playmark", "Super Derby", 0, layout_sderby )
-GAMEL( 1996, spacewin, 0, spacewin, spacewin, 0, ROT0, "Playmark", "Scacco Matto / Space Win", 0, layout_spacewin )
-GAME( 1997, pmroulet, 0, pmroulet, pmroulet, 0, ROT0, "Playmark", "Croupier (Playmark Roulette)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
+/* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */
+GAMEL( 1996, sderby, 0, sderby, sderby, 0, ROT0, "Playmark", "Super Derby", 0, layout_sderby )
+GAMEL( 1996, spacewin, 0, spacewin, spacewin, 0, ROT0, "Playmark", "Scacco Matto / Space Win", 0, layout_spacewin )
+GAMEL( 1997, pmroulet, 0, pmroulet, pmroulet, 0, ROT0, "Playmark", "Croupier (Playmark Roulette)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING, layout_pmroulet )
diff --git a/src/mame/layout/pmroulet.lay b/src/mame/layout/pmroulet.lay
new file mode 100644
index 00000000000..0c10c89c2a5
--- /dev/null
+++ b/src/mame/layout/pmroulet.lay
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+ <element name="L1" defstate="1">
+ <rect state="1">
+ <color red="1.0" green="1.0" blue="1.0" />
+ </rect>
+ <rect state="0">
+ <color red="0.3" green="0.3" blue="0.3" />
+ </rect>
+ <text string="START">
+ <color red="0.0" green="0.0" blue="0.0" />
+ <bounds x="0" y="0.1" width="1" height="0.8" />
+ </text>
+ </element>
+
+ <element name="L2" defstate="1">
+ <rect state="1">
+ <color red="1.0" green="1.0" blue="1.0" />
+ </rect>
+ <rect state="0">
+ <color red="0.3" green="0.3" blue="0.3" />
+ </rect>
+ <text string="BET">
+ <color red="0.0" green="0.0" blue="0.0" />
+ <bounds x="0" y="0.1" width="1" height="0.8" />
+ </text>
+ </element>
+
+
+ <view name="Button Lamps">
+ <screen index="0">
+ <bounds left="0" top="0" right="4" bottom="3" />
+ </screen>
+ <bezel name="lamp1" element="L1">
+ <bounds x="0" y="3.13" width="0.40" height="0.24" />
+ </bezel>
+ <bezel name="lamp2" element="L2">
+ <bounds x="0.5" y="3.13" width="0.40" height="0.24" />
+ </bezel>
+ </view>
+</mamelayout>
diff --git a/src/mame/mame.mak b/src/mame/mame.mak
index cca1aaa78bf..7a2fe790d47 100644
--- a/src/mame/mame.mak
+++ b/src/mame/mame.mak
@@ -1757,6 +1757,7 @@ $(DRIVERS)/sbrkout.o: $(LAYOUT)/sbrkout.lh
$(DRIVERS)/sderby.o: $(LAYOUT)/sderby.lh \
$(LAYOUT)/spacewin.lh \
+ $(LAYOUT)/pmroulet.lh \
$(DRIVERS)/snookr10.o: $(LAYOUT)/snookr10.lh