diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2019-02-14 20:28:42 -0500 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2019-02-14 20:29:43 -0500 |
commit | f09d5d384942616dd619dee9411f998cf2e066d5 (patch) | |
tree | ec9e4074921c4ae76cb0e24c5fa52b4cafe0805e | |
parent | 33383cdaa727deb627bf65f865515327947a0720 (diff) |
sms.cpp: Eliminate remaining uses of machine().device (nw)
-rw-r--r-- | src/mame/includes/sms.h | 13 | ||||
-rw-r--r-- | src/mame/machine/sms.cpp | 9 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/mame/includes/sms.h b/src/mame/includes/sms.h index e1c4e5e595d..d754fb66f62 100644 --- a/src/mame/includes/sms.h +++ b/src/mame/includes/sms.h @@ -68,7 +68,11 @@ public: m_has_bios_2000(false), m_has_bios_full(false), m_has_jpn_sms_cart_slot(false), - m_has_pwr_led(false) + m_has_pwr_led(false), + m_slot(*this, "slot"), + m_cardslot(*this, "mycard"), + m_smsexpslot(*this, "smsexp"), + m_sgexpslot(*this, "sgexp") { } void sms_base(machine_config &config); @@ -250,9 +254,10 @@ protected: // slot devices sega8_cart_slot_device *m_cartslot; - sega8_card_slot_device *m_cardslot; - sms_expansion_slot_device *m_smsexpslot; - sg1000_expansion_slot_device *m_sgexpslot; + optional_device<sega8_cart_slot_device> m_slot; + optional_device<sega8_card_slot_device> m_cardslot; + optional_device<sms_expansion_slot_device> m_smsexpslot; + optional_device<sg1000_expansion_slot_device> m_sgexpslot; }; class smssdisp_state : public sms_state diff --git a/src/mame/machine/sms.cpp b/src/mame/machine/sms.cpp index 2f915a111a4..4d45f92448a 100644 --- a/src/mame/machine/sms.cpp +++ b/src/mame/machine/sms.cpp @@ -1033,10 +1033,7 @@ void sms_state::machine_start() m_led_pwr = 1; } - m_cartslot = machine().device<sega8_cart_slot_device>("slot"); - m_cardslot = machine().device<sega8_card_slot_device>("mycard"); - m_smsexpslot = machine().device<sms_expansion_slot_device>("smsexp"); - m_sgexpslot = machine().device<sg1000_expansion_slot_device>("sgexp"); + m_cartslot = m_slot.target(); m_space = &m_maincpu->space(AS_PROGRAM); if (m_mainram == nullptr) @@ -1158,11 +1155,11 @@ void sms_state::machine_reset() void smssdisp_state::machine_reset() { - sms_state::machine_reset(); - m_store_control = 0; m_store_cart_selection_data = 0; store_select_cart(m_store_cart_selection_data); + + sms_state::machine_reset(); } READ8_MEMBER(smssdisp_state::sms_store_cart_select_r) |