summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author ajrhacker <ajrhacker@users.noreply.github.com>2020-09-24 19:48:16 -0400
committer GitHub <noreply@github.com>2020-09-24 19:48:16 -0400
commit673ee99a3e173a6a0624f97ed6133ac829534293 (patch)
treef2e73b15a2981a7f36fbf5e64af3f4127608f55f
parent733d81e788d9de33670a4c1e9132b2492dec1bd1 (diff)
parentfcee5f0f29730adfe0b0a5760b976488cb1179eb (diff)
Merge pull request #7288 from DavidHaywood/240920_2
small quality of life cleanups
-rw-r--r--src/devices/machine/bl_handhelds_menucontrol.cpp2
-rw-r--r--src/devices/machine/bl_handhelds_menucontrol.h14
-rw-r--r--src/mame/drivers/nes_vt.cpp36
3 files changed, 34 insertions, 18 deletions
diff --git a/src/devices/machine/bl_handhelds_menucontrol.cpp b/src/devices/machine/bl_handhelds_menucontrol.cpp
index 305f90ecfce..18982731069 100644
--- a/src/devices/machine/bl_handhelds_menucontrol.cpp
+++ b/src/devices/machine/bl_handhelds_menucontrol.cpp
@@ -206,7 +206,7 @@ void bl_handhelds_menucontrol_device::device_start()
save_item(NAME(m_response));
save_item(NAME(m_commandbit));
save_item(NAME(m_command));
- //save_item(NAME(m_menustate));
+ save_item(NAME(m_menustate));
}
void bl_handhelds_menucontrol_device::device_reset()
diff --git a/src/devices/machine/bl_handhelds_menucontrol.h b/src/devices/machine/bl_handhelds_menucontrol.h
index bb3d68677c9..419cea33550 100644
--- a/src/devices/machine/bl_handhelds_menucontrol.h
+++ b/src/devices/machine/bl_handhelds_menucontrol.h
@@ -32,21 +32,21 @@ private:
bool m_is_unsp_type_hack;
// internal state
- int m_menupos;
+ uint16_t m_menupos;
// command handling
- int m_clockstate;
- int m_datashifterpos;
+ uint8_t m_clockstate;
+ uint8_t m_datashifterpos;
- int m_responsebit;
+ uint8_t m_responsebit;
uint8_t m_response;
- int m_commandbit;
+ uint8_t m_commandbit;
uint8_t m_command;
void handle_command();
- enum menustate : const int
+ enum menustate : uint8_t
{
MENU_READY_FOR_COMMAND = 0,
@@ -58,7 +58,7 @@ private:
MENU_COMMAND_05_IN,
};
- menustate m_menustate;
+ uint8_t m_menustate;
};
#endif // MAME_MACHINE_BL_HANDHELDS_MENUCONTROL_H
diff --git a/src/mame/drivers/nes_vt.cpp b/src/mame/drivers/nes_vt.cpp
index a09f9e2ce79..1a8490646d1 100644
--- a/src/mame/drivers/nes_vt.cpp
+++ b/src/mame/drivers/nes_vt.cpp
@@ -34,8 +34,7 @@ public:
m_exin1(*this, "EXTRAIN1"),
m_exin2(*this, "EXTRAIN2"),
m_exin3(*this, "EXTRAIN3"),
- m_prgrom(*this, "mainrom"),
- m_previous_port0(0)
+ m_prgrom(*this, "mainrom")
{ }
protected:
@@ -48,17 +47,12 @@ protected:
void nes_vt_map(address_map& map);
-
optional_ioport m_io0;
optional_ioport m_io1;
+
uint8_t m_latch0;
uint8_t m_latch1;
-
- /* Misc */
- uint32_t m_ahigh; // external banking bits
- uint8_t m_4242;
- uint8_t m_411c;
- uint8_t m_411d;
+ uint8_t m_previous_port0;
optional_ioport m_cartsel;
optional_ioport m_exin0;
@@ -66,6 +60,12 @@ protected:
optional_ioport m_exin2;
optional_ioport m_exin3;
+ /* Misc */
+ uint32_t m_ahigh; // external banking bits
+ uint8_t m_4242;
+ uint8_t m_411c;
+ uint8_t m_411d;
+
required_region_ptr<uint8_t> m_prgrom;
uint8_t vt_rom_r(offs_t offset);
@@ -76,7 +76,6 @@ protected:
uint8_t upper_412c_r();
uint8_t upper_412d_r();
void upper_412c_w(uint8_t data);
- int m_previous_port0;
private:
/* APU handling */
@@ -649,6 +648,23 @@ void nes_vt_ablping_state::ablping_extraio_w(uint8_t data)
void nes_vt_base_state::machine_start()
{
+ m_latch0 = 0;
+ m_latch1 = 0;
+ m_previous_port0 = 0;
+
+ m_ahigh = 0;
+ m_4242 = 0;
+ m_411c = 0;
+ m_411d = 0;
+
+ save_item(NAME(m_latch0));
+ save_item(NAME(m_latch1));
+ save_item(NAME(m_previous_port0));
+
+ save_item(NAME(m_ahigh));
+ save_item(NAME(m_4242));
+ save_item(NAME(m_411c));
+ save_item(NAME(m_411d));
}
void nes_vt_base_state::machine_reset()