(MESS) smssdisp: implemented game selection. [Enik Land]

This commit is contained in:
Fabio Priuli 2014-04-08 07:36:15 +00:00
parent 35f03ba9d4
commit a71569d7df
3 changed files with 67 additions and 34 deletions

View File

@ -11,7 +11,6 @@
- SIO interface for Game Gear (needs netplay, I guess)
- Gear to Gear Port SMS Controller Adaptor
- SMS Store Display Unit (kiosk console)
- Sega Demo Unit II (kiosk expansion device)
- SMS Disk System (floppy disk drive expansion device) - unreleased
- Sega Graphic Board (black version) - unreleased
@ -203,11 +202,12 @@ SMS Store Unit memory map for the second CPU:
8000 - System Control Register (R/W)
Reading:
bit7 - ready (0 = ready, 1 = not ready)
bit6-bit5 - unknown
bit4-bit3 - timer selection bit switches
bit2-bit0 - unknown
bit6 - active timer bit switch (0 = selection 2, 1 = selection 1)
bit5 - unknown
bit4-bit3 - timer selection 2 bit switches (10s-25s)
bit2-bit0 - timer selection 1 bit switches (30s-135s)
Writing:
bit7-bit4 - unknown, maybe led of selected game to set?
bit7-bit4 - led of selected game to set
bit3 - unknown, 1 seems to be written all the time
bit2 - unknown, 1 seems to be written all the time
bit1 - reset signal for sms cpu, 0 = reset low, 1 = reset high
@ -259,10 +259,10 @@ static ADDRESS_MAP_START( sms_store_mem, AS_PROGRAM, 8, smssdisp_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM /* BIOS */
AM_RANGE(0x4000, 0x47ff) AM_RAM /* RAM */
AM_RANGE(0x6000, 0x7fff) AM_READ(store_cart_peek)
AM_RANGE(0x8000, 0x8000) AM_READWRITE(sms_store_control_r, sms_store_control_w) /* Control */
AM_RANGE(0x8000, 0x8000) AM_READ_PORT("DSW") AM_WRITE(sms_store_control_w) /* Control */
AM_RANGE(0xc000, 0xc000) AM_READWRITE(sms_store_cart_select_r, sms_store_cart_select_w) /* cartridge/card slot selector */
AM_RANGE(0xd800, 0xd800) AM_READ(sms_store_select1) /* Game selector port #1 */
AM_RANGE(0xdc00, 0xdc00) AM_READ(sms_store_select2) /* Game selector port #2 */
AM_RANGE(0xd800, 0xd800) AM_READ_PORT("GAMESEL1") /* Game selector port #1 */
AM_RANGE(0xdc00, 0xdc00) AM_READ_PORT("GAMESEL2") /* Game selector port #2 */
ADDRESS_MAP_END
// I/O ports $3E and $3F do not exist on Mark III
@ -381,6 +381,53 @@ static INPUT_PORTS_START( smsj )
//PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Rapid Button") /* Not implemented */
INPUT_PORTS_END
static INPUT_PORTS_START( smssdisp )
PORT_INCLUDE( sms )
PORT_START("DSW")
PORT_DIPNAME( 0x07, 0x07, "Time Selection 1" )
PORT_DIPSETTING( 0x00, "135s" )
PORT_DIPSETTING( 0x01, "120s" )
PORT_DIPSETTING( 0x02, "105s" )
PORT_DIPSETTING( 0x03, "90s" )
PORT_DIPSETTING( 0x04, "75s" )
PORT_DIPSETTING( 0x05, "60s" )
PORT_DIPSETTING( 0x06, "45s" )
PORT_DIPSETTING( 0x07, "30s" )
PORT_DIPNAME( 0x18, 0x18, "Time Selection 2" )
PORT_DIPSETTING( 0x00, "25s" )
PORT_DIPSETTING( 0x08, "20s" )
PORT_DIPSETTING( 0x10, "15s" )
PORT_DIPSETTING( 0x18, "10s" )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPNAME( 0x40, 0x40, "Active Time Selection" )
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x40, "1" )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // must be high
PORT_START("GAMESEL1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 03") PORT_CODE(KEYCODE_B)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 02") PORT_CODE(KEYCODE_G)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 01") PORT_CODE(KEYCODE_T)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 00") PORT_CODE(KEYCODE_5)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 07") PORT_CODE(KEYCODE_N)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 06") PORT_CODE(KEYCODE_H)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 05") PORT_CODE(KEYCODE_Y)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 04") PORT_CODE(KEYCODE_6)
PORT_START("GAMESEL2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 11") PORT_CODE(KEYCODE_M)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 10") PORT_CODE(KEYCODE_J)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 09") PORT_CODE(KEYCODE_U)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 08") PORT_CODE(KEYCODE_7)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 15") PORT_CODE(KEYCODE_COMMA)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 14") PORT_CODE(KEYCODE_K)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 13") PORT_CODE(KEYCODE_I)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 12") PORT_CODE(KEYCODE_8)
INPUT_PORTS_END
static INPUT_PORTS_START( gg )
PORT_START("GG_PORT_DC")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY
@ -988,7 +1035,7 @@ ROM_END
CONS( 1985, sg1000m3, sms, 0, sg1000m3, sg1000m3, sms_state, sg1000m3, "Sega", "SG-1000 Mark III", GAME_SUPPORTS_SAVE )
CONS( 1986, sms1, sms, 0, sms1_ntsc, sms1, sms_state, sms1, "Sega", "Master System I", GAME_SUPPORTS_SAVE )
CONS( 1986, sms1pal, sms, 0, sms1_pal, sms1, sms_state, sms1, "Sega", "Master System I (PAL)" , GAME_SUPPORTS_SAVE )
CONS( 1986, smssdisp, sms, 0, sms_sdisp, sms, smssdisp_state, smssdisp, "Sega", "Master System Store Display Unit", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
CONS( 1986, smssdisp, sms, 0, sms_sdisp, smssdisp, smssdisp_state, smssdisp, "Sega", "Master System Store Display Unit", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
CONS( 1987, smsj, sms, 0, smsj, smsj, sms_state, smsj, "Sega", "Master System (Japan)", GAME_SUPPORTS_SAVE )
CONS( 1990, sms, 0, 0, sms2_ntsc, sms, sms_state, sms1, "Sega", "Master System II", GAME_SUPPORTS_SAVE )
CONS( 1990, smspal, sms, 0, sms2_pal, sms, sms_state, sms1, "Sega", "Master System II (PAL)", GAME_SUPPORTS_SAVE )

View File

@ -200,9 +200,6 @@ public:
DECLARE_READ8_MEMBER(sms_store_cart_select_r);
DECLARE_WRITE8_MEMBER(sms_store_cart_select_w);
DECLARE_READ8_MEMBER(sms_store_select1);
DECLARE_READ8_MEMBER(sms_store_select2);
DECLARE_READ8_MEMBER(sms_store_control_r);
DECLARE_WRITE8_MEMBER(sms_store_control_w);
DECLARE_DRIVER_INIT(smssdisp);

View File

@ -804,6 +804,7 @@ MACHINE_START_MEMBER(sms_state,sms)
save_item(NAME(m_ctrl2_th_latch));
save_item(NAME(m_ctrl1_th_state));
save_item(NAME(m_ctrl2_th_state));
save_item(NAME(m_lphaser_x_offs));
}
if (m_is_gamegear)
@ -871,7 +872,7 @@ MACHINE_RESET_MEMBER(sms_state,sms)
READ8_MEMBER(smssdisp_state::sms_store_cart_select_r)
{
return 0xff;
return m_store_cart_selection_data;
}
@ -897,8 +898,8 @@ void sms_state::store_select_cart(UINT8 data)
UINT8 slot = data >> 4;
UINT8 slottype = data & 0x08;
// The SMS Store Display only uses the logical cartridge slot to map
// the active cartridge or card slot, of its multiple ones.
// The SMS Store Display Unit only uses the logical cartridge slot to
// map the active cartridge or card slot, of its multiple ones.
if (slottype == 0)
m_cartslot = m_slots[slot];
else
@ -907,28 +908,16 @@ void sms_state::store_select_cart(UINT8 data)
logerror("switching in part of %s slot #%d\n", slottype ? "card" : "cartridge", slot);
}
READ8_MEMBER(smssdisp_state::sms_store_select1)
{
return 0xff;
}
READ8_MEMBER(smssdisp_state::sms_store_select2)
{
return 0xff;
}
READ8_MEMBER(smssdisp_state::sms_store_control_r)
{
return m_store_control;
}
WRITE8_MEMBER(smssdisp_state::sms_store_control_w)
{
int led_number = data >> 4;
int led_column = led_number / 4;
int led_line = 3 - (led_number % 4);
int game_number = (4 * led_column) + led_line;
logerror("0x%04X: sms_store_control write 0x%02X\n", space.device().safe_pc(), data);
logerror("sms_store_control: LED #%d activated for game #%d\n", led_number, game_number);
if (data & 0x02)
{
m_maincpu->resume(SUSPEND_REASON_HALT);