Sandii' games improvements:

- Switched the color system to RESNET calculations.
 - Hooked the infamous bit7 of Input Port 0x3004 in parallel to DIP switch 1.
   This allow to use the PAYOUT button to trigger the Super Game instead of STOP 5.
 - Demultiplexed lamps matrix.
 - Added lamps support, but is still imperfect.
 - Updated technical notes.
This commit is contained in:
Roberto Fresca 2008-05-29 17:57:17 +00:00
parent 9824000cfe
commit 6736fbc2a5
5 changed files with 264 additions and 59 deletions

1
.gitattributes vendored
View File

@ -2408,6 +2408,7 @@ src/mame/layout/sigmapkr.lay svneol=native#text/plain
src/mame/layout/slots.lay svneol=native#text/plain
src/mame/layout/sltblgpo.lay svneol=native#text/plain
src/mame/layout/sltblgtk.lay svneol=native#text/plain
src/mame/layout/snookr10.lay svneol=native#text/plain
src/mame/layout/solarq.lay svneol=native#text/plain
src/mame/layout/sos.lay svneol=native#text/plain
src/mame/layout/sspeedr.lay svneol=native#text/plain

View File

@ -108,8 +108,15 @@
You have 1 attempt for each 100 earned points. If you lose the game, you lose the points.
NOTE: Bit 7 of input port 0x3004 is tied to bit 7 of input port 0x3003 (DIP switch 1).
This allow to use the PAYOUT button to trigger the Supper Game instead of STOP 5.
***** Issues / Protection *****
***************************************************************************************
Issues / Protection
-------------------
* Apple 10
@ -275,7 +282,7 @@
$3001 - $3001 Input Port 1 ;R
$3002 - $3002 Input Port 2 ;R
$3003 - $3003 Input Port 3 ;R , DIP switches.
$3004 - $3004 (unknown) ;R , the code is constantly polling bit 7.
$3004 - $3004 Input Port 4 ;R , bit 7 in parallel with DIP switch 1.
$5000 - $5000 Output Port A ;W , lamps.
$5001 - $5001 Output Port B ;W , lamps.
$6000 - $6FFF Video RAM
@ -289,6 +296,14 @@
*** Driver Updates ***
[2008/06/01]
- Switched the color system to RESNET calculations.
- Hooked the infamous bit7 of Input Port 0x3004 in parallel to DIP switch 1.
This allow to use the PAYOUT button to trigger the Super Game instead of STOP 5.
- Demultiplexed lamps matrix.
- Added lamps support, but is still imperfect.
- Updated technical notes.
[2008/05/22]
- Confirmed the CPU clock after some PCB measurements.
- Changed the SND clock to 1MHz to match the PCB measurement.
@ -326,9 +341,7 @@
*** TO DO ***
- Figure out the unknown reads to offset $3004, bit 7.
- Hook lamps.
- Turn the color system to resnet calculation.
- Fix lamps.
***********************************************************************************/
@ -338,6 +351,7 @@
#include "driver.h"
#include "sound/okim6295.h"
#include "snookr10.lh"
/* from video */
@ -350,18 +364,44 @@ VIDEO_START( apple10 );
VIDEO_UPDATE( snookr10 );
/**********************
* Read/Write Handlers *
* - Input Ports - *
**********************/
static READ8_HANDLER( dsw_port_1_r )
/*-----------------------------------
PORT 0x3004 ;INPUT PORT 4
-------------------------------------
BIT 0 =
BIT 1 =
BIT 2 =
BIT 3 =
BIT 4 =
BIT 5 =
BIT 6 =
BIT 7 = Complement of DS1, bit 7
------------------------------------*/
{
return input_port_read_indexed(machine,3);
}
/**********************
* Read/Write Handlers *
* - Output Ports - *
***********************
**********************/
/* Lamps are multiplexed using a 5 bit matrix.
The first 4 bits are from Port A, and the
remaining one is from Port B.
LAMPS components:
START = bit1 & bit3
CANCEL = bit0 & bit3
STOP1 = bit1
STOP1 = bit1 only
STOP2 = bit1 & bit2
STOP3 = bit1
STOP3 = bit1 only
STOP4 = bit1 & bit4
STOP5 = bit0 & bit4
*/
@ -371,26 +411,35 @@ static WRITE8_HANDLER( output_port_0_w )
PORT 0x5000 ;OUTPUT PORT A
-------------------------------
BIT 0 =
BIT 1 = Lamps, bit0
BIT 1 = Lamps matrix, bit0
BIT 2 =
BIT 3 = Lamps, bit1
BIT 3 = Lamps matrix, bit1
BIT 4 =
BIT 5 = Lamps, bit2
BIT 5 = Lamps matrix, bit2
BIT 6 =
BIT 7 = Lamps, bit3
BIT 7 = Lamps matrix, bit3
------------------------------*/
{
// (data >> 1) & 1; /* lamps, bit0 */
// (data >> 3) & 1; /* lamps, bit1 */
// (data >> 5) & 1; /* lamps, bit2 */
// (data >> 7) & 1; /* lamps, bit3 */
int bit0, bit1, bit2, bit3, bit4;
bit0 = (data >> 1) & 1;
bit1 = (data >> 3) & 1;
bit2 = (data >> 5) & 1;
bit3 = (data >> 7) & 1;
bit4 = (input_port_read_indexed(machine,5) & 1);
output_set_lamp_value(1, (bit1 & bit3)); /* Lamp 1 - START */
output_set_lamp_value(2, (bit0 & bit3)); /* Lamp 2 - CANCEL */
output_set_lamp_value(3, (bit1 | bit3)); /* Lamp 3 - STOP1 */
output_set_lamp_value(4, (bit1 & bit2)); /* Lamp 4 - STOP2 */
output_set_lamp_value(5, (bit1 | bit3)); /* Lamp 5 - STOP3 */
}
static WRITE8_HANDLER( output_port_1_w )
/*-----------------------------
PORT 0x5001 ;OUTPUT PORT B
-------------------------------
BIT 0 = Lamps, bit4
BIT 0 = Lamps matrix, bit4
BIT 1 =
BIT 2 =
BIT 3 =
@ -400,7 +449,14 @@ static WRITE8_HANDLER( output_port_1_w )
BIT 7 =
------------------------------*/
{
// (data & 1); /* lamps, bit4 */
int bit0, bit1, bit4;
bit0 = (input_port_read_indexed(machine,4) >> 1) & 1;
bit1 = (input_port_read_indexed(machine,4) >> 3) & 1;
bit4 = (data & 1);
output_set_lamp_value(6, (bit1 & bit4)); /* Lamp 6 - STOP4 */
output_set_lamp_value(7, (bit0 & bit4)); /* Lamp 7 - STOP5 */
}
@ -415,7 +471,7 @@ static ADDRESS_MAP_START( snookr10_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x3001, 0x3001) AM_READ(input_port_1_r) /* IN1 */
AM_RANGE(0x3002, 0x3002) AM_READ(input_port_2_r) /* IN2 */
AM_RANGE(0x3003, 0x3003) AM_READ(input_port_3_r) /* DS1 */
AM_RANGE(0x3004, 0x3004) AM_READNOP /* unknown reads comparing bit 7 */
AM_RANGE(0x3004, 0x3004) AM_READ(dsw_port_1_r) /* complement of DS1, bit 7 */
AM_RANGE(0x5000, 0x5000) AM_WRITE(output_port_0_w) /* OUT0 */
AM_RANGE(0x5001, 0x5001) AM_WRITE(output_port_1_w) /* OUT1 */
AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(snookr10_videoram_w) AM_BASE(&videoram)
@ -442,8 +498,8 @@ ADDRESS_MAP_END
* Input ports *
*************************/
/* Do the stops & cancel buttons need PORT_IMPULSE
to just trigger only 1 sound each time they are pressed? */
/* Eliminated all PORT_IMPULSE limitations.
All Hold & Cancel buttons have a rattle sound in the real PCB. */
static INPUT_PORTS_START( snookr10 )
PORT_START_TAG("IN0")
@ -495,12 +551,16 @@ static INPUT_PORTS_START( snookr10 )
PORT_DIPSETTING( 0x20, "Manual - Coins" )
PORT_DIPSETTING( 0x40, "Manual - Tickets" )
PORT_DIPSETTING( 0x60, "Automatic" )
PORT_DIPNAME( 0x80, 0x80, "Super Game" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, "Super Game Button" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x00, "PAYOUT button" )
PORT_DIPSETTING( 0x80, "STOP 5 button" )
INPUT_PORTS_END
static INPUT_PORTS_START( apple10 )
/* Eliminated all PORT_IMPULSE limitations.
All Hold & Cancel buttons have a rattle sound in the real PCB. */
PORT_START_TAG("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Remote x100") PORT_CODE(KEYCODE_Q)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Stop 1") PORT_CODE(KEYCODE_Z) /* Input Test in stats mode */
@ -550,12 +610,16 @@ static INPUT_PORTS_START( apple10 )
PORT_DIPSETTING( 0x20, "Manual - Coins 2" )
PORT_DIPSETTING( 0x40, "Disable Payment/Game" )
PORT_DIPSETTING( 0x60, "Automatic" )
PORT_DIPNAME( 0x80, 0x80, "Super Game" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, "Super Game Button" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x00, "PAYOUT button" )
PORT_DIPSETTING( 0x80, "STOP 5 button" )
INPUT_PORTS_END
static INPUT_PORTS_START( tenballs )
/* Eliminated all PORT_IMPULSE limitations.
All Hold & Cancel buttons have a rattle sound in the real PCB. */
PORT_START_TAG("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Remote x100") PORT_CODE(KEYCODE_Q)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Stop 1") PORT_CODE(KEYCODE_Z) /* no Input Test in stats mode */
@ -669,7 +733,7 @@ static MACHINE_DRIVER_START( snookr10 )
MDRV_GFXDECODE(snookr10)
MDRV_PALETTE_LENGTH(0x100)
MDRV_PALETTE_LENGTH(256)
MDRV_PALETTE_INIT(snookr10)
MDRV_VIDEO_START(snookr10)
MDRV_VIDEO_UPDATE(snookr10)
@ -677,7 +741,7 @@ static MACHINE_DRIVER_START( snookr10 )
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")
MDRV_SOUND_ADD(OKIM6295, MASTER_CLOCK/16) /* 1 MHz (995.5 kHz measured) */
MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) /* pin7 checked on PCB */
MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7high) /* pin7 checked HIGH on PCB */
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.8)
MACHINE_DRIVER_END
@ -760,7 +824,7 @@ ROM_END
* Game Drivers *
*************************/
/* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */
GAME( 1998, snookr10, 0, snookr10, snookr10, 0, ROT0, "Sandii'", "Snooker 10 (Ver 1.11)", 0 )
GAME( 1998, apple10, 0, apple10, apple10, 0, ROT0, "Sandii'", "Apple 10 (Ver 1.21)", 0 )
GAME( 1997, tenballs, snookr10, tenballs, tenballs, 0, ROT0, "unknown", "Ten Balls (Ver 1.05)", 0 )
/* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */
GAMEL( 1998, snookr10, 0, snookr10, snookr10, 0, ROT0, "Sandii'", "Snooker 10 (Ver 1.11)", 0, layout_snookr10 )
GAMEL( 1998, apple10, 0, apple10, apple10, 0, ROT0, "Sandii'", "Apple 10 (Ver 1.21)", 0, layout_snookr10 )
GAMEL( 1997, tenballs, snookr10, tenballs, tenballs, 0, ROT0, "unknown", "Ten Balls (Ver 1.05)", 0, layout_snookr10 )

View File

@ -0,0 +1,99 @@
<?xml version="1.0"?>
<mamelayout version="2">
<element name="L0" defstate="1">
<rect>
<color red="1.0" green="1.0" blue="1.0" />
</rect>
<text string="START" state="1">
<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="L1" defstate="1">
<rect>
<color red="1.0" green="1.0" blue="1.0" />
</rect>
<text string="CANCEL" state="1">
<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>
<color red="1.0" green="0.0" blue="0.0" />
</rect>
<text string="STOP1" state="1">
<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="L3" defstate="1">
<rect>
<color red="1.0" green="0.0" blue="0.0" />
</rect>
<text string="STOP2" state="1">
<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="L4" defstate="1">
<rect>
<color red="1.0" green="0.0" blue="0.0" />
</rect>
<text string="STOP3" state="1">
<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="L5" defstate="1">
<rect>
<color red="1.0" green="0.0" blue="0.0" />
</rect>
<text string="STOP4" state="1">
<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="L6" defstate="1">
<rect>
<color red="1.0" green="0.0" blue="0.0" />
</rect>
<text string="STOP5" state="1">
<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="lamp0" element="L0">
<bounds x="0" y="3.13" width="0.40" height="0.24" />
</bezel>
<bezel name="lamp1" element="L1">
<bounds x="0.5" y="3.13" width="0.40" height="0.24" />
</bezel>
<bezel name="lamp2" element="L2">
<bounds x="1.5" y="3.13" width="0.40" height="0.24" />
</bezel>
<bezel name="lamp3" element="L3">
<bounds x="2.0" y="3.13" width="0.40" height="0.24" />
</bezel>
<bezel name="lamp4" element="L4">
<bounds x="2.5" y="3.13" width="0.40" height="0.24" />
</bezel>
<bezel name="lamp5" element="L5">
<bounds x="3.0" y="3.13" width="0.40" height="0.24" />
</bezel>
<bezel name="lamp6" element="L6">
<bounds x="3.5" y="3.13" width="0.40" height="0.24" />
</bezel>
</view>
</mamelayout>

View File

@ -1723,6 +1723,8 @@ $(DRIVERS)/qix.o: $(LAYOUT)/elecyoyo.lh
$(DRIVERS)/sbrkout.o: $(LAYOUT)/sbrkout.lh
$(DRIVERS)/snookr10.o: $(LAYOUT)/snookr10.lh
$(DRIVERS)/sspeedr.o: $(LAYOUT)/sspeedr.lh
$(DRIVERS)/stactics.o: $(LAYOUT)/stactics.lh

View File

@ -13,10 +13,32 @@
* Ten Balls (Ver 1.05), unknown, 1997.
***********************************************************************************
Resistor Network for all PCBs:
74LS373
+-------+
| 02|--> 1 KOhms resistor --> \
| 05|--> 470 Ohms resistor --> > 100 Ohms pull-down resistor --> RED
| 06|--> 220 Ohms resistor --> /
| |
| 09|--> 1 KOhms resistor --> \
| 12|--> 470 Ohms resistor --> > 100 Ohms pull-down resistor --> BLUE
| 15|--> 220 Ohms resistor --> /
| |
| 16|--> 470 Ohms resistor --> \ 100 Ohms pull-down resistor --> GREEN
| 19|--> 220 Ohms resistor --> /
+-------+
**********************************************************************************/
#include "driver.h"
#include "video/resnet.h"
static tilemap *bg_tilemap;
@ -33,32 +55,40 @@ WRITE8_HANDLER( snookr10_colorram_w )
tilemap_mark_tile_dirty(bg_tilemap, offset);
}
PALETTE_INIT( snookr10 )
{
int i;
/* GGBBBRRR */
if (color_prom == 0) return;
for (i = 0;i < machine->config->total_colors;i++)
int i;
static const int resistances_rb[3] = { 1000, 470, 220 };
static const int resistances_g [2] = { 470, 220 };
double weights_r[3], weights_b[3], weights_g[2];
compute_resistor_weights(0, 255, -1.0,
3, resistances_rb, weights_r, 100, 0,
3, resistances_rb, weights_b, 100, 0,
2, resistances_g, weights_g, 100, 0);
for (i = 0; i < machine->config->total_colors; i++)
{
int bit0,bit1,bit2,r,g,b;
int bit0, bit1, bit2, r, g, b;
/* red component */
bit0 = (color_prom[i] >> 0) & 0x01;
bit1 = (color_prom[i] >> 1) & 0x01;
bit2 = (color_prom[i] >> 2) & 0x01;
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
r = combine_3_weights(weights_r, bit0, bit1, bit2);
/* blue component */
bit0 = (color_prom[i] >> 3) & 0x01;
bit1 = (color_prom[i] >> 4) & 0x01;
bit2 = (color_prom[i] >> 5) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
b = combine_3_weights(weights_b, bit0, bit1, bit2);
/* green component */
bit0 = 0;
bit1 = (color_prom[i] >> 6) & 0x01;
bit2 = (color_prom[i] >> 7) & 0x01;
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
bit0 = (color_prom[i] >> 6) & 0x01;
bit1 = (color_prom[i] >> 7) & 0x01;
g = combine_2_weights(weights_g, bit0, bit1);
palette_set_color(machine, i, MAKE_RGB(r,g,b));
}
@ -79,37 +109,45 @@ static TILE_GET_INFO( get_bg_tile_info )
SET_TILE_INFO(0, code, color, 0);
}
/*********************************************************
* Apple10 color and tile matrix are encrypted/scrambled. *
* For more information, see the driver notes. *
*********************************************************/
/**********************************************************
* Apple10 colors and tile matrix are encrypted/scrambled. *
* For more information, see the driver notes. *
**********************************************************/
PALETTE_INIT( apple10 )
{
int i;
/* GGBBBRRR */
if (color_prom == 0) return;
for (i = 0;i < machine->config->total_colors;i++)
int i, cn;
static const int resistances_rb[3] = { 1000, 470, 220 };
static const int resistances_g [2] = { 470, 220 };
double weights_r[3], weights_b[3], weights_g[2];
compute_resistor_weights(0, 255, -1.0,
3, resistances_rb, weights_r, 100, 0,
3, resistances_rb, weights_b, 100, 0,
2, resistances_g, weights_g, 100, 0);
for (i = 0; i < machine->config->total_colors; i++)
{
int bit0,bit1,bit2,r,g,b,cn;
int bit0, bit1, bit2, r, g, b;
/* red component */
bit0 = (color_prom[i] >> 0) & 0x01;
bit1 = (color_prom[i] >> 1) & 0x01;
bit2 = (color_prom[i] >> 2) & 0x01;
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
r = combine_3_weights(weights_r, bit0, bit1, bit2);
/* blue component */
bit0 = (color_prom[i] >> 3) & 0x01;
bit1 = (color_prom[i] >> 4) & 0x01;
bit2 = (color_prom[i] >> 5) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
b = combine_3_weights(weights_b, bit0, bit1, bit2);
/* green component */
bit0 = 0;
bit1 = (color_prom[i] >> 6) & 0x01;
bit2 = (color_prom[i] >> 7) & 0x01;
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
bit0 = (color_prom[i] >> 6) & 0x01;
bit1 = (color_prom[i] >> 7) & 0x01;
g = combine_2_weights(weights_g, bit0, bit1);
/* encrypted color matrix */
cn = BITSWAP8(i,4,5,6,7,2,3,0,1);
@ -133,6 +171,7 @@ static TILE_GET_INFO( apple10_get_bg_tile_info )
SET_TILE_INFO(0, code, color, 0);
}
VIDEO_START( snookr10 )
{
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 128, 32);