diff options
Diffstat (limited to 'src/devices/bus/ti99/peb/pcode.cpp')
-rw-r--r-- | src/devices/bus/ti99/peb/pcode.cpp | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/src/devices/bus/ti99/peb/pcode.cpp b/src/devices/bus/ti99/peb/pcode.cpp index 9b711c6bfc6..75152d8e6bc 100644 --- a/src/devices/bus/ti99/peb/pcode.cpp +++ b/src/devices/bus/ti99/peb/pcode.cpp @@ -75,20 +75,20 @@ #include "emu.h" #include "pcode.h" -#define LOG_WARN (1U<<1) // Warnings -#define LOG_CONFIG (1U<<2) // Configuration -#define LOG_ROM (1U<<3) -#define LOG_GROM (1U<<4) -#define LOG_SWITCH (1U<<5) -#define LOG_CRU (1U<<6) +#define LOG_WARN (1U << 1) // Warnings +#define LOG_CONFIG (1U << 2) // Configuration +#define LOG_ROM (1U << 3) +#define LOG_GROM (1U << 4) +#define LOG_SWITCH (1U << 5) +#define LOG_CRU (1U << 6) -#define VERBOSE ( LOG_CONFIG | LOG_WARN ) +#define VERBOSE (LOG_CONFIG | LOG_WARN) #include "logmacro.h" -DEFINE_DEVICE_TYPE_NS(TI99_P_CODE, bus::ti99::peb, ti_pcode_card_device, "ti99_pcode", "TI-99 P-Code Card") +DEFINE_DEVICE_TYPE(TI99_P_CODE, bus::ti99::peb::ti_pcode_card_device, "ti99_pcode", "TI-99 P-Code Card") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define PCODE_GROM_TAG "pcode_grom" #define PCODE_ROM_TAG "pcode_rom" @@ -115,10 +115,10 @@ ti_pcode_card_device::ti_pcode_card_device(const machine_config &mconfig, const { } -SETADDRESS_DBIN_MEMBER( ti_pcode_card_device::setaddress_dbin ) +void ti_pcode_card_device::setaddress_dbin(offs_t offset, int state) { m_address = offset; - m_inDsrArea = ((m_address & m_select_mask)==m_select_value); + m_inDsrArea = in_dsr_space(offset, true); line_state a14 = ((m_address & 2)!=0)? ASSERT_LINE : CLEAR_LINE; @@ -142,25 +142,26 @@ SETADDRESS_DBIN_MEMBER( ti_pcode_card_device::setaddress_dbin ) } } -void ti_pcode_card_device::debugger_read(uint16_t offset, uint8_t& value) +void ti_pcode_card_device::debugger_read(offs_t offset, uint8_t& value) { // The debuger does not call setaddress - if (m_active && ((offset & m_select_mask)==m_select_value)) + if (m_active && in_dsr_space(offset, true)) { bool isrom0 = ((offset & 0xf000)==0x4000); bool isrom12 = ((offset & 0xf000)==0x5000); - if (isrom0) value = m_rom[m_address & 0x0fff]; + if (isrom0) value = m_rom[offset & 0x0fff]; else if (isrom12) value = m_rom[(m_bank_select<<12) | (offset & 0x0fff)]; } } -READ8Z_MEMBER( ti_pcode_card_device::readz ) +void ti_pcode_card_device::readz(offs_t offset, uint8_t *value) { // Care for debugger if (machine().side_effects_disabled()) { debugger_read(offset, *value); + return; } if (m_active && m_inDsrArea && m_selected) @@ -213,7 +214,7 @@ void ti_pcode_card_device::write(offs_t offset, uint8_t data) /* Common READY* line from the GROMs. */ -WRITE_LINE_MEMBER( ti_pcode_card_device::ready_line ) +void ti_pcode_card_device::ready_line(int state) { m_slot->set_ready(state); } @@ -223,7 +224,7 @@ WRITE_LINE_MEMBER( ti_pcode_card_device::ready_line ) clock input for the GROMs, which are thus running at a lower rate than those in the console driven by the VDP (477 kHz). */ -WRITE_LINE_MEMBER( ti_pcode_card_device::clock_in) +void ti_pcode_card_device::clock_in(int state) { m_clock_count = (m_clock_count+1) & 0x03; // four pulses high, four pulses low if (m_clock_count==0) @@ -240,7 +241,7 @@ WRITE_LINE_MEMBER( ti_pcode_card_device::clock_in) we just ignore any request. (Note that CRU lines are not like memory; you may be able to write to them, but not necessarily read them again.) */ -READ8Z_MEMBER(ti_pcode_card_device::crureadz) +void ti_pcode_card_device::crureadz(offs_t offset, uint8_t *value) { } @@ -259,12 +260,12 @@ void ti_pcode_card_device::cruwrite(offs_t offset, uint8_t data) m_crulatch->write_bit((offset & 0x80) >> 5 | (offset & 0x06) >> 1, data); } -WRITE_LINE_MEMBER(ti_pcode_card_device::pcpage_w) +void ti_pcode_card_device::pcpage_w(int state) { m_selected = state; } -WRITE_LINE_MEMBER(ti_pcode_card_device::ekrpg_w) +void ti_pcode_card_device::ekrpg_w(int state) { m_bank_select = state ? 2 : 1; // we're calling this bank 1 and bank 2 LOGMASKED(LOG_CRU, "Select rom bank %d\n", m_bank_select); @@ -287,16 +288,6 @@ void ti_pcode_card_device::device_start() void ti_pcode_card_device::device_reset() { - if (m_genmod) - { - m_select_mask = 0x1fe000; - m_select_value = 0x174000; - } - else - { - m_select_mask = 0x7e000; - m_select_value = 0x74000; - } m_bank_select = 1; m_selected = false; m_clock_count = 0; @@ -323,7 +314,7 @@ INPUT_CHANGED_MEMBER( ti_pcode_card_device::switch_changed ) INPUT_PORTS_START( ti99_pcode ) PORT_START( ACTIVE_TAG ) - PORT_DIPNAME( 0x01, 0x00, "P-Code activation switch" ) PORT_CHANGED_MEMBER(DEVICE_SELF, ti_pcode_card_device, switch_changed, 0) + PORT_DIPNAME( 0x01, 0x00, "P-Code activation switch" ) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(ti_pcode_card_device::switch_changed), 0) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) INPUT_PORTS_END @@ -366,4 +357,4 @@ ioport_constructor ti_pcode_card_device::device_input_ports() const return INPUT_PORTS_NAME( ti99_pcode ); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb |