(MESS) sms.c: Restore selected cartridge when loading a save state for the store display unit. [Enik Land]

This commit is contained in:
Wilbert Pol 2014-07-31 19:44:45 +00:00
parent e6592159f5
commit 5e8603d43d
4 changed files with 18 additions and 9 deletions

View File

@ -633,10 +633,7 @@ WRITE8_MEMBER( sega315_5124_device::vram_write )
WRITE8_MEMBER( sega315_5124_device::register_write ) WRITE8_MEMBER( sega315_5124_device::register_write )
{ {
int reg_num; int reg_num, hpos;
int hpos = m_screen->hpos();
check_pending_flags();
if (m_pending_reg_write == 0) if (m_pending_reg_write == 0)
{ {
@ -670,12 +667,16 @@ WRITE8_MEMBER( sega315_5124_device::register_write )
if (reg_num == 0 || reg_num == 1) if (reg_num == 0 || reg_num == 1)
set_display_settings(); set_display_settings();
hpos = m_screen->hpos();
if (reg_num == 1 && hpos <= DISPLAY_DISABLED_HPOS) if (reg_num == 1 && hpos <= DISPLAY_DISABLED_HPOS)
m_display_disabled = !(m_reg[0x01] & 0x40); m_display_disabled = !(m_reg[0x01] & 0x40);
if (reg_num == 8 && hpos <= X_SCROLL_HPOS) if (reg_num == 8 && hpos <= X_SCROLL_HPOS)
m_reg8copy = m_reg[0x08]; m_reg8copy = m_reg[0x08];
check_pending_flags();
if ( ( reg_num == 0 && (m_status & STATUS_HINT) ) || if ( ( reg_num == 0 && (m_status & STATUS_HINT) ) ||
( reg_num == 1 && (m_status & STATUS_VINT) ) ) ( reg_num == 1 && (m_status & STATUS_VINT) ) )
{ {

View File

@ -17,7 +17,7 @@
- Sega Demo Unit II (kiosk expansion device) - Sega Demo Unit II (kiosk expansion device)
- SMS Disk System (floppy disk drive expansion device) - unreleased - SMS Disk System (floppy disk drive expansion device) - unreleased
- Sega Graphic Board (black version) - unreleased - Sega Graphic Board (black version) - unreleased
- Rapid button of japanese Master System - Rapid button of Japanese Master System
- Keyboard support for Sega Mark III (sg1000m3 driver) - Keyboard support for Sega Mark III (sg1000m3 driver)
- Link between two Mark III's through keyboard, supported by F-16 Fighting Falcon - Link between two Mark III's through keyboard, supported by F-16 Fighting Falcon
- Mark III expansion slot, used by keyboard and FM module - Mark III expansion slot, used by keyboard and FM module
@ -985,7 +985,7 @@ ROM_END
- built-in Alex Kidd in Miracle World - 1994 ? - built-in Alex Kidd in Miracle World - 1994 ?
- built-in World Cup Italia '90 (Super Futebol II) - 1994 - built-in World Cup Italia '90 (Super Futebol II) - 1994
- Tec Toy Master System Girl (no driver) - Tec Toy Master System Girl (no driver)
- built-in Monica no Castelo do Dragao - 199? - built-in Monica no Castelo do Dragao - 1994
- built-in Sonic the Hedgehog (T. Monica em O Resgate pack) - 199? - built-in Sonic the Hedgehog (T. Monica em O Resgate pack) - 199?
Notes about BR: Notes about BR:
- PAL-M has same frequency and line count of NTSC - PAL-M has same frequency and line count of NTSC

View File

@ -129,6 +129,7 @@ public:
UINT8 m_store_cart_selection_data; UINT8 m_store_cart_selection_data;
sega8_cart_slot_device *m_slots[16]; sega8_cart_slot_device *m_slots[16];
sega8_card_slot_device *m_cards[16]; sega8_card_slot_device *m_cards[16];
void store_post_load();
void store_select_cart(UINT8 data); void store_select_cart(UINT8 data);
/* Cartridge slot info */ /* Cartridge slot info */

View File

@ -86,7 +86,7 @@ void sms_state::sms_get_inputs( address_space &space )
m_port_dd_reg &= ~0x08 | (data2 >> 4); // TR (Button 2) m_port_dd_reg &= ~0x08 | (data2 >> 4); // TR (Button 2)
// Sega Mark III does not have TH line connected. // Sega Mark III does not have TH line connected.
// Also, the japanese Master System does not set port $dd with TH input. // Also, the Japanese Master System does not set port $dd with TH input.
if (!m_is_mark_iii && !m_is_smsj) if (!m_is_mark_iii && !m_is_smsj)
{ {
m_port_dd_reg &= ~0x40 | data1; // TH ctrl1 m_port_dd_reg &= ~0x40 | data1; // TH ctrl1
@ -278,7 +278,7 @@ READ8_MEMBER(sms_state::sms_input_port_dd_r)
if (m_is_smsj) if (m_is_smsj)
{ {
// For japanese Master System, set upper 4 bits with TH/TR // For Japanese Master System, set upper 4 bits with TH/TR
// direction bits of IO control register, according to Enri's // direction bits of IO control register, according to Enri's
// docs (http://www43.tok2.com/home/cmpslv/Sms/EnrSms.htm). // docs (http://www43.tok2.com/home/cmpslv/Sms/EnrSms.htm).
// This makes the console incapable of using the Light Phaser. // This makes the console incapable of using the Light Phaser.
@ -814,6 +814,8 @@ MACHINE_START_MEMBER(sms_state,sms)
if (m_is_sdisp) if (m_is_sdisp)
{ {
machine().save().register_postload(save_prepost_delegate(FUNC(sms_state::store_post_load), this));
save_item(NAME(m_store_control)); save_item(NAME(m_store_control));
save_item(NAME(m_store_cart_selection_data)); save_item(NAME(m_store_cart_selection_data));
@ -828,7 +830,6 @@ MACHINE_START_MEMBER(sms_state,sms)
sprintf(str,"slot%i",i + 16 + 1); sprintf(str,"slot%i",i + 16 + 1);
m_cards[i] = machine().device<sega8_card_slot_device>(str); m_cards[i] = machine().device<sega8_card_slot_device>(str);
} }
store_select_cart(m_store_cart_selection_data);
} }
} }
@ -884,6 +885,12 @@ WRITE8_MEMBER(smssdisp_state::sms_store_cart_select_w)
} }
void sms_state::store_post_load()
{
store_select_cart(m_store_cart_selection_data);
}
// There are two known models of the Store Display Unit: // There are two known models of the Store Display Unit:
// //
// - the one with 16 cart slots and 3 card slots; // - the one with 16 cart slots and 3 card slots;