diff --git a/hash/samcoupe_cass.xml b/hash/samcoupe_cass.xml index c42eeaa404b..25e50a17d91 100644 --- a/hash/samcoupe_cass.xml +++ b/hash/samcoupe_cass.xml @@ -23,8 +23,16 @@ + + + F-16 Combat Pilot (Demo) + 1991 + Digital Integration + + + + + + + - - - - diff --git a/hash/samcoupe_flop.xml b/hash/samcoupe_flop.xml index f90840a9be2..1a9bfb99393 100644 --- a/hash/samcoupe_flop.xml +++ b/hash/samcoupe_flop.xml @@ -3,6 +3,22 @@ @@ -17,8 +33,64 @@ + + Sam Coupe System Disk (SAMDOS v1.1) + 1990 + Miles Gordon Technology + + + + + + + + Sam Coupe System Disk (SAMDOS v2.0) + 1990 + Miles Gordon Technology + + + + + + + + Boing! + 1992 + Noesis Software + + + + + + + + Defenders Of The Earth + 1990 + Enigma Variations + + + + + + + + Sam Strikes Out! + 1990 + Enigma Variations + + + + + + + + Sphera + 1990 + Enigma Variations + + + + + + - - - - diff --git a/src/mame/drivers/samcoupe.cpp b/src/mame/drivers/samcoupe.cpp index 45457852d94..a95336bd29a 100644 --- a/src/mame/drivers/samcoupe.cpp +++ b/src/mame/drivers/samcoupe.cpp @@ -235,6 +235,10 @@ READ8_MEMBER(samcoupe_state::samcoupe_keyboard_r) /* bit 7, external memory */ data |= 1 << 7; + + /* joysticks */ + if (!BIT(offset, 12)) data &= m_joy1->read() | (0xff ^ 0x1f); + if (!BIT(offset, 11)) data &= m_joy2->read() | (0xff ^ 0x1f); return data; } @@ -458,6 +462,24 @@ static INPUT_PORTS_START( samcoupe ) PORT_CONFNAME(0x01, 0x00, "Real Time Clock") PORT_CONFSETTING( 0x00, DEF_STR(None)) PORT_CONFSETTING( 0x01, "SAMBUS") + + /* Sam Coupe has single 9-pin ATARI-compatible connector but supports 2 joysticks via a splitter, + this works by using a different ground for each stick (pin 8: stick 1 gnd, pin 9: stick 2 gnd.) + Joysticks overlay number keys 6-0 for the stick 1 and 1-5 for stick 2 (same scheme as ZX Spectrum) */ + + PORT_START("joy_1") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(1) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_8WAY PORT_PLAYER(1) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_8WAY PORT_PLAYER(1) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_8WAY PORT_PLAYER(1) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_8WAY PORT_PLAYER(1) + + PORT_START("joy_2") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_8WAY PORT_PLAYER(2) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_8WAY PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_8WAY PORT_PLAYER(2) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_8WAY PORT_PLAYER(2) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2) INPUT_PORTS_END diff --git a/src/mame/includes/samcoupe.h b/src/mame/includes/samcoupe.h index 52eed56b196..d467c7e8eee 100644 --- a/src/mame/includes/samcoupe.h +++ b/src/mame/includes/samcoupe.h @@ -74,7 +74,9 @@ public: m_mouse_buttons(*this, "mouse_buttons"), m_io_mouse_x(*this, "mouse_x"), m_io_mouse_y(*this, "mouse_y"), - m_config(*this, "config") + m_config(*this, "config"), + m_joy1(*this, "joy_1"), + m_joy2(*this, "joy_2") { sam_bank_read_ptr[0] = nullptr; sam_bank_write_ptr[0] = nullptr; @@ -192,6 +194,8 @@ private: required_ioport m_io_mouse_x; required_ioport m_io_mouse_y; required_ioport m_config; + required_ioport m_joy1; + required_ioport m_joy2; void draw_mode4_line(int y, int hpos); void draw_mode3_line(int y, int hpos); diff --git a/src/mame/video/samcoupe.cpp b/src/mame/video/samcoupe.cpp index 57e924ecde1..780f93ed1f1 100644 --- a/src/mame/video/samcoupe.cpp +++ b/src/mame/video/samcoupe.cpp @@ -18,7 +18,7 @@ #define BORDER_COLOR(x) ((x & 0x20) >> 2 | (x & 0x07)) /* foreground and background color from attribute byte in mode 1 and 2 */ -#define ATTR_BG(x) ((x >> 3) & 0x07) +#define ATTR_BG(x) ((x >> 3) & 0x0f) #define ATTR_FG(x) (((x >> 3) & 0x08) | (x & 0x07))