diff options
Diffstat (limited to 'src/mame/machine/pgm2_memcard.cpp')
-rw-r--r-- | src/mame/machine/pgm2_memcard.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mame/machine/pgm2_memcard.cpp b/src/mame/machine/pgm2_memcard.cpp index 1897b90141b..3e52d7a4eb7 100644 --- a/src/mame/machine/pgm2_memcard.cpp +++ b/src/mame/machine/pgm2_memcard.cpp @@ -45,7 +45,7 @@ void pgm2_memcard_device::device_start() image_init_result pgm2_memcard_device::call_load() { - authenticated = false; + m_authenticated = false; if(length() != 0x108) return image_init_result::FAIL; @@ -65,7 +65,7 @@ image_init_result pgm2_memcard_device::call_load() void pgm2_memcard_device::call_unload() { - authenticated = false; + m_authenticated = false; fseek(0, SEEK_SET); fwrite(m_memcard_data, 0x100); fwrite(m_protection_data, 4); @@ -74,7 +74,7 @@ void pgm2_memcard_device::call_unload() image_init_result pgm2_memcard_device::call_create(int format_type, util::option_resolution *format_options) { - authenticated = false; + m_authenticated = false; // cards must contain valid defaults for each game / region or they don't work? memory_region *rgn = memregion("^default_card"); @@ -92,16 +92,16 @@ image_init_result pgm2_memcard_device::call_create(int format_type, util::option return image_init_result::PASS; } -void pgm2_memcard_device::auth(uint8_t p1, uint8_t p2, uint8_t p3) +void pgm2_memcard_device::auth(u8 p1, u8 p2, u8 p3) { if (m_security_data[0] & 7) { if (m_security_data[1] == p1 && m_security_data[2] == p2 && m_security_data[3] == p3) { - authenticated = true; + m_authenticated = true; m_security_data[0] = 7; } else { - authenticated = false; + m_authenticated = false; m_security_data[0] >>= 1; // hacky if (m_security_data[0] & 7) popmessage("Wrong IC Card password !!!\n"); @@ -111,39 +111,39 @@ void pgm2_memcard_device::auth(uint8_t p1, uint8_t p2, uint8_t p3) } } -READ8_MEMBER(pgm2_memcard_device::read) +u8 pgm2_memcard_device::read(offs_t offset) { return m_memcard_data[offset]; } -WRITE8_MEMBER(pgm2_memcard_device::write) +void pgm2_memcard_device::write(offs_t offset, u8 data) { - if (authenticated && (offset >= 0x20 || (m_protection_data[offset>>3] & (1 <<(offset & 7))))) + if (m_authenticated && (offset >= 0x20 || (m_protection_data[offset>>3] & (1 <<(offset & 7))))) { m_memcard_data[offset] = data; } } -READ8_MEMBER(pgm2_memcard_device::read_prot) +u8 pgm2_memcard_device::read_prot(offs_t offset) { return m_protection_data[offset]; } -WRITE8_MEMBER(pgm2_memcard_device::write_prot) +void pgm2_memcard_device::write_prot(offs_t offset, u8 data) { - if (authenticated) + if (m_authenticated) m_protection_data[offset] &= data; } -READ8_MEMBER(pgm2_memcard_device::read_sec) +u8 pgm2_memcard_device::read_sec(offs_t offset) { - if (!authenticated) + if (!m_authenticated) return 0xff; // guess return m_security_data[offset]; } -WRITE8_MEMBER(pgm2_memcard_device::write_sec) +void pgm2_memcard_device::write_sec(offs_t offset, u8 data) { - if (authenticated) + if (m_authenticated) m_security_data[offset] = data; } |