summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/drivers/ssystem3.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mess/drivers/ssystem3.c')
-rw-r--r--src/mess/drivers/ssystem3.c224
1 files changed, 112 insertions, 112 deletions
diff --git a/src/mess/drivers/ssystem3.c b/src/mess/drivers/ssystem3.c
index 06c9a3a408c..4d124483f70 100644
--- a/src/mess/drivers/ssystem3.c
+++ b/src/mess/drivers/ssystem3.c
@@ -45,68 +45,68 @@ backup of playfield rom and picture/description of its board
void ssystem3_playfield_getfigure(running_machine &machine, int x, int y, int *figure, int *black)
{
ssystem3_state *state = machine.driver_data<ssystem3_state>();
- int d;
- if (x&1)
- d=state->m_playfield.u.s.field[y][x/2]&0xf;
- else
- d=state->m_playfield.u.s.field[y][x/2]>>4;
-
- *figure=d&7;
- *black=d&8;
+ int d;
+ if (x&1)
+ d=state->m_playfield.u.s.field[y][x/2]&0xf;
+ else
+ d=state->m_playfield.u.s.field[y][x/2]>>4;
+
+ *figure=d&7;
+ *black=d&8;
}
static void ssystem3_playfield_reset(running_machine &machine)
{
ssystem3_state *state = machine.driver_data<ssystem3_state>();
- memset(&state->m_playfield, 0, sizeof(state->m_playfield));
- state->m_playfield.signal=FALSE;
- // state->m_playfield.on=TRUE; //machine.root_device().ioport("Configuration")->read()&1;
+ memset(&state->m_playfield, 0, sizeof(state->m_playfield));
+ state->m_playfield.signal=FALSE;
+ // state->m_playfield.on=TRUE; //machine.root_device().ioport("Configuration")->read()&1;
}
static void ssystem3_playfield_write(running_machine &machine, int reset, int signal)
{
ssystem3_state *state = machine.driver_data<ssystem3_state>();
- int d=FALSE;
-
- if (!reset) {
- state->m_playfield.count=0;
- state->m_playfield.bit=0;
- state->m_playfield.started=FALSE;
- state->m_playfield.signal=signal;
- state->m_playfield.time=machine.time();
- }
- if (!signal && state->m_playfield.signal) {
- attotime t=machine.time();
- state->m_playfield.high_time=t - state->m_playfield.time;
- state->m_playfield.time=t;
-
- // logerror("%.4x playfield %d lowtime %s hightime %s\n",(int)activecpu_get_pc(), state->m_playfield.count,
- // state->m_playfield.low_time.as_string(7), state->m_playfield.high_time.as_string(7) );
-
- if (state->m_playfield.started) {
- // 0 twice as long low
- // 1 twice as long high
- if (state->m_playfield.low_time > state->m_playfield.high_time) d=TRUE;
-
- state->m_playfield.data&=~(1<<(state->m_playfield.bit^7));
- if (d) state->m_playfield.data|=1<<(state->m_playfield.bit^7);
- state->m_playfield.bit++;
- if (state->m_playfield.bit==8) {
+ int d=FALSE;
+
+ if (!reset) {
+ state->m_playfield.count=0;
+ state->m_playfield.bit=0;
+ state->m_playfield.started=FALSE;
+ state->m_playfield.signal=signal;
+ state->m_playfield.time=machine.time();
+ }
+ if (!signal && state->m_playfield.signal) {
+ attotime t=machine.time();
+ state->m_playfield.high_time=t - state->m_playfield.time;
+ state->m_playfield.time=t;
+
+ // logerror("%.4x playfield %d lowtime %s hightime %s\n",(int)activecpu_get_pc(), state->m_playfield.count,
+ // state->m_playfield.low_time.as_string(7), state->m_playfield.high_time.as_string(7) );
+
+ if (state->m_playfield.started) {
+ // 0 twice as long low
+ // 1 twice as long high
+ if (state->m_playfield.low_time > state->m_playfield.high_time) d=TRUE;
+
+ state->m_playfield.data&=~(1<<(state->m_playfield.bit^7));
+ if (d) state->m_playfield.data|=1<<(state->m_playfield.bit^7);
+ state->m_playfield.bit++;
+ if (state->m_playfield.bit==8) {
logerror("%.4x playfield wrote %d %02x\n", (int)machine.device("maincpu")->safe_pc(), state->m_playfield.count, state->m_playfield.data);
state->m_playfield.u.data[state->m_playfield.count]=state->m_playfield.data;
state->m_playfield.bit=0;
state->m_playfield.count=(state->m_playfield.count+1)%ARRAY_LENGTH(state->m_playfield.u.data);
if (state->m_playfield.count==0) state->m_playfield.started=FALSE;
- }
- }
-
- } else if (signal && !state->m_playfield.signal) {
- attotime t=machine.time();
- state->m_playfield.low_time= t - state->m_playfield.time;
- state->m_playfield.time=t;
- state->m_playfield.started=TRUE;
- }
- state->m_playfield.signal=signal;
+ }
+ }
+
+ } else if (signal && !state->m_playfield.signal) {
+ attotime t=machine.time();
+ state->m_playfield.low_time= t - state->m_playfield.time;
+ state->m_playfield.time=t;
+ state->m_playfield.started=TRUE;
+ }
+ state->m_playfield.signal=signal;
}
static void ssystem3_playfield_read(running_machine &machine, int *on, int *ready)
@@ -120,49 +120,49 @@ static void ssystem3_playfield_read(running_machine &machine, int *on, int *read
WRITE8_MEMBER(ssystem3_state::ssystem3_via_write_a)
{
m_porta=data;
- // logerror("%.4x via port a write %02x\n",(int)activecpu_get_pc(), data);
+ // logerror("%.4x via port a write %02x\n",(int)activecpu_get_pc(), data);
}
READ8_MEMBER(ssystem3_state::ssystem3_via_read_a)
{
- UINT8 data=0xff;
+ UINT8 data=0xff;
#if 1 // time switch
- if (!(m_porta&0x10)) data&=machine().root_device().ioport("matrix1")->read()|0xf1;
- if (!(m_porta&0x20)) data&=machine().root_device().ioport("matrix2")->read()|0xf1;
- if (!(m_porta&0x40)) data&=machine().root_device().ioport("matrix3")->read()|0xf1;
- if (!(m_porta&0x80)) data&=machine().root_device().ioport("matrix4")->read()|0xf1;
+ if (!(m_porta&0x10)) data&=machine().root_device().ioport("matrix1")->read()|0xf1;
+ if (!(m_porta&0x20)) data&=machine().root_device().ioport("matrix2")->read()|0xf1;
+ if (!(m_porta&0x40)) data&=machine().root_device().ioport("matrix3")->read()|0xf1;
+ if (!(m_porta&0x80)) data&=machine().root_device().ioport("matrix4")->read()|0xf1;
#else
- if (!(m_porta&0x10)) data&=machine().root_device().ioport("matrix1")->read()|0xf0;
- if (!(m_porta&0x20)) data&=machine().root_device().ioport("matrix2")->read()|0xf0;
- if (!(m_porta&0x40)) data&=machine().root_device().ioport("matrix3")->read()|0xf0;
- if (!(m_porta&0x80)) data&=machine().root_device().ioport("matrix4")->read()|0xf0;
+ if (!(m_porta&0x10)) data&=machine().root_device().ioport("matrix1")->read()|0xf0;
+ if (!(m_porta&0x20)) data&=machine().root_device().ioport("matrix2")->read()|0xf0;
+ if (!(m_porta&0x40)) data&=machine().root_device().ioport("matrix3")->read()|0xf0;
+ if (!(m_porta&0x80)) data&=machine().root_device().ioport("matrix4")->read()|0xf0;
#endif
- if (!(m_porta&1)) {
- if (!(machine().root_device().ioport("matrix1")->read()&1)) data&=~0x10;
- if (!(machine().root_device().ioport("matrix2")->read()&1)) data&=~0x20;
- if (!(machine().root_device().ioport("matrix3")->read()&1)) data&=~0x40;
- if (!(ioport("matrix4")->read()&1)) data&=~0x80;
- }
- if (!(m_porta&2)) {
- if (!(machine().root_device().ioport("matrix1")->read()&2)) data&=~0x10;
- if (!(machine().root_device().ioport("matrix2")->read()&2)) data&=~0x20;
- if (!(machine().root_device().ioport("matrix3")->read()&2)) data&=~0x40;
- if (!(machine().root_device().ioport("matrix4")->read()&2)) data&=~0x80;
- }
- if (!(m_porta&4)) {
- if (!(machine().root_device().ioport("matrix1")->read()&4)) data&=~0x10;
- if (!(machine().root_device().ioport("matrix2")->read()&4)) data&=~0x20;
- if (!(machine().root_device().ioport("matrix3")->read()&4)) data&=~0x40;
- if (!(machine().root_device().ioport("matrix4")->read()&4)) data&=~0x80;
- }
- if (!(m_porta&8)) {
- if (!(machine().root_device().ioport("matrix1")->read()&8)) data&=~0x10;
- if (!(machine().root_device().ioport("matrix2")->read()&8)) data&=~0x20;
- if (!(machine().root_device().ioport("matrix3")->read()&8)) data&=~0x40;
- if (!(machine().root_device().ioport("matrix4")->read()&8)) data&=~0x80;
- }
- // logerror("%.4x via port a read %02x\n",(int)activecpu_get_pc(), data);
- return data;
+ if (!(m_porta&1)) {
+ if (!(machine().root_device().ioport("matrix1")->read()&1)) data&=~0x10;
+ if (!(machine().root_device().ioport("matrix2")->read()&1)) data&=~0x20;
+ if (!(machine().root_device().ioport("matrix3")->read()&1)) data&=~0x40;
+ if (!(ioport("matrix4")->read()&1)) data&=~0x80;
+ }
+ if (!(m_porta&2)) {
+ if (!(machine().root_device().ioport("matrix1")->read()&2)) data&=~0x10;
+ if (!(machine().root_device().ioport("matrix2")->read()&2)) data&=~0x20;
+ if (!(machine().root_device().ioport("matrix3")->read()&2)) data&=~0x40;
+ if (!(machine().root_device().ioport("matrix4")->read()&2)) data&=~0x80;
+ }
+ if (!(m_porta&4)) {
+ if (!(machine().root_device().ioport("matrix1")->read()&4)) data&=~0x10;
+ if (!(machine().root_device().ioport("matrix2")->read()&4)) data&=~0x20;
+ if (!(machine().root_device().ioport("matrix3")->read()&4)) data&=~0x40;
+ if (!(machine().root_device().ioport("matrix4")->read()&4)) data&=~0x80;
+ }
+ if (!(m_porta&8)) {
+ if (!(machine().root_device().ioport("matrix1")->read()&8)) data&=~0x10;
+ if (!(machine().root_device().ioport("matrix2")->read()&8)) data&=~0x20;
+ if (!(machine().root_device().ioport("matrix3")->read()&8)) data&=~0x40;
+ if (!(machine().root_device().ioport("matrix4")->read()&8)) data&=~0x80;
+ }
+ // logerror("%.4x via port a read %02x\n",(int)activecpu_get_pc(), data);
+ return data;
}
@@ -234,9 +234,9 @@ DRIVER_INIT_MEMBER(ssystem3_state,ssystem3)
static ADDRESS_MAP_START( ssystem3_map , AS_PROGRAM, 8, ssystem3_state )
AM_RANGE( 0x0000, 0x03ff) AM_RAM
- /*
+ /*
67-de playfield ($40 means white, $80 black)
- */
+ */
// AM_RANGE( 0x4000, 0x40ff) AM_NOP
/*
probably zusatzger??t memory (battery powered ram 256x4? at 0x4000)
@@ -259,34 +259,34 @@ static INPUT_PORTS_START( ssystem3 )
*/
- PORT_START( "Switches" )
+ PORT_START( "Switches" )
//PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("NEW GAME") PORT_CODE(KEYCODE_F3) // seems to be direct wired to reset
// PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("?CLEAR") PORT_CODE(KEYCODE_F1)
// PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("?ENTER") PORT_CODE(KEYCODE_ENTER)
- PORT_START( "matrix1" )
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?1") PORT_CODE(KEYCODE_1_PAD)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 C SQ EP") PORT_CODE(KEYCODE_9)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER?") PORT_CODE(KEYCODE_ENTER)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 C BOARD MD") PORT_CODE(KEYCODE_0)
- PORT_START( "matrix2" )
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?2") PORT_CODE(KEYCODE_2_PAD)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 F springer zeitvorgabe") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_F)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 E laeufer ruecknahme") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_E)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CE interrupt") PORT_CODE(KEYCODE_BACKSPACE)
- PORT_START( "matrix3" )
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?3") PORT_CODE(KEYCODE_3_PAD)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 G bauer zugvorschlaege") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_G)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 D turm #") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_D)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 A white") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_A)
- PORT_START( "matrix4" )
- PORT_DIPNAME( 0x01, 0, "Time") PORT_CODE(KEYCODE_T) PORT_TOGGLE PORT_DIPSETTING( 0, DEF_STR(Off) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) )
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 H black") PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_H)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 C dame #50") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_C)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 B koenig FP") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_B)
- PORT_START( "Configuration" )
- PORT_DIPNAME( 0x0001, 0, "Schachbrett") PORT_TOGGLE
- PORT_DIPSETTING( 0, DEF_STR( Off ) )
- PORT_DIPSETTING( 1, "angeschlossen" )
+ PORT_START( "matrix1" )
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?1") PORT_CODE(KEYCODE_1_PAD)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 C SQ EP") PORT_CODE(KEYCODE_9)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER?") PORT_CODE(KEYCODE_ENTER)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 C BOARD MD") PORT_CODE(KEYCODE_0)
+ PORT_START( "matrix2" )
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?2") PORT_CODE(KEYCODE_2_PAD)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 F springer zeitvorgabe") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_F)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 E laeufer ruecknahme") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_E)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CE interrupt") PORT_CODE(KEYCODE_BACKSPACE)
+ PORT_START( "matrix3" )
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?3") PORT_CODE(KEYCODE_3_PAD)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 G bauer zugvorschlaege") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_G)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 D turm #") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_D)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 A white") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_A)
+ PORT_START( "matrix4" )
+ PORT_DIPNAME( 0x01, 0, "Time") PORT_CODE(KEYCODE_T) PORT_TOGGLE PORT_DIPSETTING( 0, DEF_STR(Off) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) )
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 H black") PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_H)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 C dame #50") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_C)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 B koenig FP") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_B)
+ PORT_START( "Configuration" )
+ PORT_DIPNAME( 0x0001, 0, "Schachbrett") PORT_TOGGLE
+ PORT_DIPSETTING( 0, DEF_STR( Off ) )
+ PORT_DIPSETTING( 1, "angeschlossen" )
#if 0
PORT_DIPNAME( 0x0002, 0, "Memory") PORT_TOGGLE
PORT_DIPSETTING( 0, DEF_STR( Off ) )
@@ -305,7 +305,7 @@ static MACHINE_CONFIG_START( ssystem3, ssystem3_state )
MCFG_CPU_PROGRAM_MAP(ssystem3_map)
MCFG_QUANTUM_TIME(attotime::from_hz(60))
- /* video hardware */
+ /* video hardware */
MCFG_SCREEN_ADD("screen", LCD)
MCFG_SCREEN_REFRESH_RATE(LCD_FRAMES_PER_SECOND)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
@@ -341,5 +341,5 @@ ROM_END
***************************************************************************/
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */
-CONS( 1979, ssystem3, 0, 0, ssystem3, ssystem3, ssystem3_state, ssystem3, "NOVAG Industries Ltd", "Chess Champion Super System III", GAME_NOT_WORKING | GAME_NO_SOUND)
+CONS( 1979, ssystem3, 0, 0, ssystem3, ssystem3, ssystem3_state, ssystem3, "NOVAG Industries Ltd", "Chess Champion Super System III", GAME_NOT_WORKING | GAME_NO_SOUND)
//chess champion MK III in germany