mirror of
https://github.com/holub/mame
synced 2025-06-21 11:46:49 +03:00
jaguar.cpp: Use ioport finders for joysticks/buttons (nw)
This commit is contained in:
parent
04cd6a61b7
commit
b447f8cd91
@ -702,12 +702,6 @@ READ32_MEMBER(jaguar_state::joystick_r)
|
|||||||
{
|
{
|
||||||
uint16_t joystick_result = 0xfffe;
|
uint16_t joystick_result = 0xfffe;
|
||||||
uint16_t joybuts_result = 0xffef;
|
uint16_t joybuts_result = 0xffef;
|
||||||
int i;
|
|
||||||
static const char *const keynames[2][8] =
|
|
||||||
{
|
|
||||||
{ "JOY0", "JOY1", "JOY2", "JOY3", "JOY4", "JOY5", "JOY6", "JOY7" },
|
|
||||||
{ "BUTTONS0", "BUTTONS1", "BUTTONS2", "BUTTONS3", "BUTTONS4", "BUTTONS5", "BUTTONS6", "BUTTONS7" }
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 16 12 8 4 0
|
* 16 12 8 4 0
|
||||||
@ -723,12 +717,12 @@ READ32_MEMBER(jaguar_state::joystick_r)
|
|||||||
* to the buttons.
|
* to the buttons.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
if ((m_joystick_data & (0x10000 << i)) == 0)
|
if ((m_joystick_data & (0x10000 << i)) == 0)
|
||||||
{
|
{
|
||||||
joystick_result &= ioport(keynames[0][i])->read();
|
joystick_result &= m_joy[i]->read();
|
||||||
joybuts_result &= ioport(keynames[1][i])->read();
|
joybuts_result &= m_buttons[i]->read();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,6 +52,8 @@ public:
|
|||||||
, m_mainsndbank(*this, "mainsndbank")
|
, m_mainsndbank(*this, "mainsndbank")
|
||||||
, m_dspsndbank(*this, "dspsndbank")
|
, m_dspsndbank(*this, "dspsndbank")
|
||||||
, m_config_io(*this, "CONFIG")
|
, m_config_io(*this, "CONFIG")
|
||||||
|
, m_joy(*this, "JOY%u", 0U)
|
||||||
|
, m_buttons(*this, "BUTTONS%u", 0U)
|
||||||
, m_is_r3000(false)
|
, m_is_r3000(false)
|
||||||
, m_is_cojag(false)
|
, m_is_cojag(false)
|
||||||
, m_hacks_enabled(false)
|
, m_hacks_enabled(false)
|
||||||
@ -101,6 +103,8 @@ public:
|
|||||||
optional_memory_bank m_mainsndbank;
|
optional_memory_bank m_mainsndbank;
|
||||||
optional_memory_bank m_dspsndbank;
|
optional_memory_bank m_dspsndbank;
|
||||||
optional_ioport m_config_io;
|
optional_ioport m_config_io;
|
||||||
|
optional_ioport_array<8> m_joy;
|
||||||
|
optional_ioport_array<8> m_buttons;
|
||||||
|
|
||||||
// configuration
|
// configuration
|
||||||
bool m_is_r3000;
|
bool m_is_r3000;
|
||||||
|
Loading…
Reference in New Issue
Block a user