Not for the release branch: remove all ioport and address map macros from tranz330 driver, just as a test to play around with, (nw)

This commit is contained in:
therealmogminer@gmail.com 2016-10-25 13:34:55 +02:00
parent 9f7819cb35
commit 5611934cf2
3 changed files with 111 additions and 79 deletions

View File

@ -2997,7 +2997,7 @@ const char *ioport_configurer::string_from_token(const char *string)
// port_alloc - allocate a new port // port_alloc - allocate a new port
//------------------------------------------------- //-------------------------------------------------
void ioport_configurer::port_alloc(const char *tag) ioport_configurer& ioport_configurer::port_alloc(const char *tag)
{ {
// create the full tag // create the full tag
std::string fulltag = m_owner.subtag(tag); std::string fulltag = m_owner.subtag(tag);
@ -3008,6 +3008,7 @@ void ioport_configurer::port_alloc(const char *tag)
m_curport = m_portlist.find(fulltag)->second.get(); m_curport = m_portlist.find(fulltag)->second.get();
m_curfield = nullptr; m_curfield = nullptr;
m_cursetting = nullptr; m_cursetting = nullptr;
return *this;
} }
@ -3016,7 +3017,7 @@ void ioport_configurer::port_alloc(const char *tag)
// modify it // modify it
//------------------------------------------------- //-------------------------------------------------
void ioport_configurer::port_modify(const char *tag) ioport_configurer& ioport_configurer::port_modify(const char *tag)
{ {
// create the full tag // create the full tag
std::string fulltag = m_owner.subtag(tag); std::string fulltag = m_owner.subtag(tag);
@ -3030,6 +3031,7 @@ void ioport_configurer::port_modify(const char *tag)
m_curport->m_modcount++; m_curport->m_modcount++;
m_curfield = nullptr; m_curfield = nullptr;
m_cursetting = nullptr; m_cursetting = nullptr;
return *this;
} }
@ -3037,7 +3039,7 @@ void ioport_configurer::port_modify(const char *tag)
// field_alloc - allocate a new field // field_alloc - allocate a new field
//------------------------------------------------- //-------------------------------------------------
void ioport_configurer::field_alloc(ioport_type type, ioport_value defval, ioport_value mask, const char *name) ioport_configurer& ioport_configurer::field_alloc(ioport_type type, ioport_value defval, ioport_value mask, const char *name)
{ {
// make sure we have a port // make sure we have a port
if (m_curport == nullptr) if (m_curport == nullptr)
@ -3049,6 +3051,7 @@ void ioport_configurer::field_alloc(ioport_type type, ioport_value defval, iopor
// reset the current setting // reset the current setting
m_cursetting = nullptr; m_cursetting = nullptr;
return *this;
} }
@ -3056,13 +3059,13 @@ void ioport_configurer::field_alloc(ioport_type type, ioport_value defval, iopor
// field_add_char - add a character to a field // field_add_char - add a character to a field
//------------------------------------------------- //-------------------------------------------------
void ioport_configurer::field_add_char(char32_t ch) ioport_configurer& ioport_configurer::field_add_char(char32_t ch)
{ {
for (int index = 0; index < ARRAY_LENGTH(m_curfield->m_chars); index++) for (int index = 0; index < ARRAY_LENGTH(m_curfield->m_chars); index++)
if (m_curfield->m_chars[index] == 0) if (m_curfield->m_chars[index] == 0)
{ {
m_curfield->m_chars[index] = ch; m_curfield->m_chars[index] = ch;
return; return *this;
} }
throw emu_fatalerror("PORT_CHAR(%d) could not be added - maximum amount exceeded\n", ch); throw emu_fatalerror("PORT_CHAR(%d) could not be added - maximum amount exceeded\n", ch);
@ -3073,9 +3076,10 @@ void ioport_configurer::field_add_char(char32_t ch)
// field_add_code - add a character to a field // field_add_code - add a character to a field
//------------------------------------------------- //-------------------------------------------------
void ioport_configurer::field_add_code(input_seq_type which, input_code code) ioport_configurer& ioport_configurer::field_add_code(input_seq_type which, input_code code)
{ {
m_curfield->m_seq[which] |= code; m_curfield->m_seq[which] |= code;
return *this;
} }
@ -3083,7 +3087,7 @@ void ioport_configurer::field_add_code(input_seq_type which, input_code code)
// setting_alloc - allocate a new setting // setting_alloc - allocate a new setting
//------------------------------------------------- //-------------------------------------------------
void ioport_configurer::setting_alloc(ioport_value value, const char *name) ioport_configurer& ioport_configurer::setting_alloc(ioport_value value, const char *name)
{ {
// make sure we have a field // make sure we have a field
if (m_curfield == nullptr) if (m_curfield == nullptr)
@ -3092,6 +3096,7 @@ void ioport_configurer::setting_alloc(ioport_value value, const char *name)
m_cursetting = global_alloc(ioport_setting(*m_curfield, value & m_curfield->mask(), string_from_token(name))); m_cursetting = global_alloc(ioport_setting(*m_curfield, value & m_curfield->mask(), string_from_token(name)));
// append a new setting // append a new setting
m_curfield->m_settinglist.append(*m_cursetting); m_curfield->m_settinglist.append(*m_cursetting);
return *this;
} }
@ -3100,10 +3105,11 @@ void ioport_configurer::setting_alloc(ioport_value value, const char *name)
// the current setting or field // the current setting or field
//------------------------------------------------- //-------------------------------------------------
void ioport_configurer::set_condition(ioport_condition::condition_t condition, const char *tag, ioport_value mask, ioport_value value) ioport_configurer& ioport_configurer::set_condition(ioport_condition::condition_t condition, const char *tag, ioport_value mask, ioport_value value)
{ {
ioport_condition &target = (m_cursetting != nullptr) ? m_cursetting->condition() : m_curfield->condition(); ioport_condition &target = (m_cursetting != nullptr) ? m_cursetting->condition() : m_curfield->condition();
target.set(condition, tag, mask, value); target.set(condition, tag, mask, value);
return *this;
} }
@ -3111,7 +3117,7 @@ void ioport_configurer::set_condition(ioport_condition::condition_t condition, c
// onoff_alloc - allocate an on/off DIP switch // onoff_alloc - allocate an on/off DIP switch
//------------------------------------------------- //-------------------------------------------------
void ioport_configurer::onoff_alloc(const char *name, ioport_value defval, ioport_value mask, const char *diplocation) ioport_configurer& ioport_configurer::onoff_alloc(const char *name, ioport_value defval, ioport_value mask, const char *diplocation)
{ {
// allocate a field normally // allocate a field normally
field_alloc(IPT_DIPSWITCH, defval, mask, name); field_alloc(IPT_DIPSWITCH, defval, mask, name);
@ -3132,6 +3138,7 @@ void ioport_configurer::onoff_alloc(const char *name, ioport_value defval, iopor
setting_alloc(~defval & mask, DEF_STR(On)); setting_alloc(~defval & mask, DEF_STR(On));
// clear cursettings set by setting_alloc // clear cursettings set by setting_alloc
m_cursetting = nullptr; m_cursetting = nullptr;
return *this;
} }

View File

@ -1508,43 +1508,43 @@ public:
static const char *string_from_token(const char *string); static const char *string_from_token(const char *string);
// port helpers // port helpers
void port_alloc(const char *tag); ioport_configurer& port_alloc(const char *tag);
void port_modify(const char *tag); ioport_configurer& port_modify(const char *tag);
// field helpers // field helpers
void field_alloc(ioport_type type, ioport_value defval, ioport_value mask, const char *name = nullptr); ioport_configurer& field_alloc(ioport_type type, ioport_value defval, ioport_value mask, const char *name = nullptr);
void field_add_char(char32_t ch); ioport_configurer& field_add_char(char32_t ch);
void field_add_code(input_seq_type which, input_code code); ioport_configurer& field_add_code(input_seq_type which, input_code code);
void field_set_way(int way) const { m_curfield->m_way = way; } ioport_configurer& field_set_way(int way) { m_curfield->m_way = way; return *this; }
void field_set_rotated() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_ROTATED; } ioport_configurer& field_set_rotated() { m_curfield->m_flags |= ioport_field::FIELD_FLAG_ROTATED; return *this; }
void field_set_name(const char *name) const { m_curfield->m_name = string_from_token(name); } ioport_configurer& field_set_name(const char *name) { m_curfield->m_name = string_from_token(name); return *this; }
void field_set_player(int player) const { m_curfield->m_player = player - 1; } ioport_configurer& field_set_player(int player) { m_curfield->m_player = player - 1; return *this; }
void field_set_cocktail() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_COCKTAIL; field_set_player(2); } ioport_configurer& field_set_cocktail() { m_curfield->m_flags |= ioport_field::FIELD_FLAG_COCKTAIL; field_set_player(2); return *this; }
void field_set_toggle() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_TOGGLE; } ioport_configurer& field_set_toggle() { m_curfield->m_flags |= ioport_field::FIELD_FLAG_TOGGLE; return *this; }
void field_set_impulse(uint8_t impulse) const { m_curfield->m_impulse = impulse; } ioport_configurer& field_set_impulse(uint8_t impulse) { m_curfield->m_impulse = impulse; return *this; }
void field_set_analog_reverse() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_REVERSE; } ioport_configurer& field_set_analog_reverse() { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_REVERSE; return *this; }
void field_set_analog_reset() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_RESET; } ioport_configurer& field_set_analog_reset() { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_RESET; return *this; }
void field_set_optional() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_OPTIONAL; } ioport_configurer& field_set_optional() { m_curfield->m_flags |= ioport_field::FIELD_FLAG_OPTIONAL; return *this; }
void field_set_min_max(ioport_value minval, ioport_value maxval) const { m_curfield->m_min = minval; m_curfield->m_max = maxval; } ioport_configurer& field_set_min_max(ioport_value minval, ioport_value maxval) { m_curfield->m_min = minval; m_curfield->m_max = maxval; return *this; }
void field_set_sensitivity(int32_t sensitivity) const { m_curfield->m_sensitivity = sensitivity; } ioport_configurer& field_set_sensitivity(int32_t sensitivity) { m_curfield->m_sensitivity = sensitivity; return *this; }
void field_set_delta(int32_t delta) const { m_curfield->m_centerdelta = m_curfield->m_delta = delta; } ioport_configurer& field_set_delta(int32_t delta) { m_curfield->m_centerdelta = m_curfield->m_delta = delta; return *this; }
void field_set_centerdelta(int32_t delta) const { m_curfield->m_centerdelta = delta; } ioport_configurer& field_set_centerdelta(int32_t delta) { m_curfield->m_centerdelta = delta; return *this; }
void field_set_crosshair(crosshair_axis_t axis, double altaxis, double scale, double offset) const { m_curfield->m_crosshair_axis = axis; m_curfield->m_crosshair_altaxis = altaxis; m_curfield->m_crosshair_scale = scale; m_curfield->m_crosshair_offset = offset; } ioport_configurer& field_set_crosshair(crosshair_axis_t axis, double altaxis, double scale, double offset) { m_curfield->m_crosshair_axis = axis; m_curfield->m_crosshair_altaxis = altaxis; m_curfield->m_crosshair_scale = scale; m_curfield->m_crosshair_offset = offset; return *this; }
void field_set_crossmapper(ioport_field_crossmap_delegate callback) const { m_curfield->m_crosshair_mapper = callback; } ioport_configurer& field_set_crossmapper(ioport_field_crossmap_delegate callback) { m_curfield->m_crosshair_mapper = callback; return *this; }
void field_set_full_turn_count(uint16_t count) const { m_curfield->m_full_turn_count = count; } ioport_configurer& field_set_full_turn_count(uint16_t count) { m_curfield->m_full_turn_count = count; return *this; }
void field_set_analog_wraps() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_WRAPS; } ioport_configurer& field_set_analog_wraps() { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_WRAPS; return *this; }
void field_set_remap_table(const ioport_value *table) { m_curfield->m_remap_table = table; } ioport_configurer& field_set_remap_table(const ioport_value *table) { m_curfield->m_remap_table = table; return *this; }
void field_set_analog_invert() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_INVERT; } ioport_configurer& field_set_analog_invert() { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_INVERT; return *this; }
void field_set_dynamic_read(ioport_field_read_delegate delegate, void *param = nullptr) const { m_curfield->m_read = delegate; m_curfield->m_read_param = param; } ioport_configurer& field_set_dynamic_read(ioport_field_read_delegate delegate, void *param = nullptr) { m_curfield->m_read = delegate; m_curfield->m_read_param = param; return *this; }
void field_set_dynamic_write(ioport_field_write_delegate delegate, void *param = nullptr) const { m_curfield->m_write = delegate; m_curfield->m_write_param = param; } ioport_configurer& field_set_dynamic_write(ioport_field_write_delegate delegate, void *param = nullptr) { m_curfield->m_write = delegate; m_curfield->m_write_param = param; return *this; }
void field_set_diplocation(const char *location) const { m_curfield->expand_diplocation(location, m_errorbuf); } ioport_configurer& field_set_diplocation(const char *location) { m_curfield->expand_diplocation(location, m_errorbuf); return *this; }
// setting helpers // setting helpers
void setting_alloc(ioport_value value, const char *name); ioport_configurer& setting_alloc(ioport_value value, const char *name);
// misc helpers // misc helpers
void set_condition(ioport_condition::condition_t condition, const char *tag, ioport_value mask, ioport_value value); ioport_configurer& set_condition(ioport_condition::condition_t condition, const char *tag, ioport_value mask, ioport_value value);
void onoff_alloc(const char *name, ioport_value defval, ioport_value mask, const char *diplocation); ioport_configurer& onoff_alloc(const char *name, ioport_value defval, ioport_value mask, const char *diplocation);
private: private:
// internal state // internal state

View File

@ -23,45 +23,70 @@
#include "includes/tranz330.h" #include "includes/tranz330.h"
#include "tranz330.lh" #include "tranz330.lh"
static ADDRESS_MAP_START( tranz330_mem, AS_PROGRAM, 8, tranz330_state ) static void construct_address_map_tranz330_mem(address_map &map, device_t &device)
AM_RANGE(0x0000, 0x7fff) AM_ROM {
AM_RANGE(0x8000, 0xffff) AM_RAM map.configure(AS_PROGRAM, 8);
ADDRESS_MAP_END
static ADDRESS_MAP_START( tranz330_io, AS_IO, 8, tranz330_state ) address_map_entry8 *curentry = nullptr;
ADDRESS_MAP_GLOBAL_MASK(0xff) curentry = map.add(device, 0x0000, 0x7fff, curentry);
AM_RANGE(0x00, 0x03) AM_DEVREADWRITE(PIO_TAG, z80pio_device, read_alt, write_alt) curentry->set_read_type(AMH_ROM);
AM_RANGE(0x10, 0x13) AM_DEVREADWRITE(CTC_TAG, z80ctc_device, read, write)
AM_RANGE(0x20, 0x23) AM_DEVREADWRITE(DART_TAG, z80dart_device, ba_cd_r, ba_cd_w)
AM_RANGE(0x30, 0x3f) AM_DEVREADWRITE(RTC_TAG, msm6242_device, read, write)
ADDRESS_MAP_END
curentry = map.add(device, 0x8000, 0xffff, curentry);
curentry->set_read_type(AMH_RAM);
curentry->set_write_type(AMH_RAM);
}
static INPUT_PORTS_START( tranz330 ) static void construct_address_map_tranz330_io(address_map &map, device_t &device)
PORT_START("COL.0") {
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_1) PORT_NAME("1 QZ.") map.configure(AS_IO, 8);
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_4) PORT_NAME("4 GHI") map.set_global_mask(0xff);
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_7) PORT_NAME("7 PRS")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME("* ,'\"")
PORT_START("COL.1") address_map_entry8 *curentry = nullptr;
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_2) PORT_NAME("2 ABC") curentry = map.add(device, 0x00, 0x03, curentry);
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_CODE(KEYCODE_5) PORT_NAME("5 JKL") curentry->set_handler(read8_delegate(&z80pio_device::read_alt, "z80pio_device::read_alt", PIO_TAG, (z80pio_device *)nullptr),
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_CODE(KEYCODE_8) PORT_NAME("8 TUV") write8_delegate(&z80pio_device::write_alt, "z80pio_device::write_alt", PIO_TAG, (z80pio_device *)nullptr));
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_CODE(KEYCODE_0) PORT_NAME("0 -SP")
PORT_START("COL.2") curentry = map.add(device, 0x10, 0x13, curentry);
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_CODE(KEYCODE_3) PORT_NAME("3 DEF") curentry->set_handler(read8_delegate(&z80ctc_device::read, "z80ctc_device::read", CTC_TAG, (z80ctc_device *)nullptr),
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_CODE(KEYCODE_6) PORT_NAME("6 MNO") write8_delegate(&z80ctc_device::write, "z80ctc_device::write", CTC_TAG, (z80ctc_device *)nullptr));
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_CODE(KEYCODE_9) PORT_NAME("9 WXY")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_CODE(KEYCODE_H) PORT_NAME("#") // KEYCODE_H for 'hash mark'
PORT_START("COL.3") curentry = map.add(device, 0x20, 0x23, curentry);
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_CODE(KEYCODE_C) PORT_NAME("CLEAR") // KEYCODE_C so as to not collide with potentially-used UI keys curentry->set_handler(read8_delegate(&z80dart_device::ba_cd_r, "z80dart_device::ba_cd_r", DART_TAG, (z80dart_device *)nullptr),
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("BACK SPACE") write8_delegate(&z80dart_device::ba_cd_w, "z80dart_device::ba_cd_w", DART_TAG, (z80dart_device *)nullptr));
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON16 ) PORT_CODE(KEYCODE_A) PORT_NAME("ALPHA")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_CODE(KEYCODE_ENTER) PORT_NAME("FUNC | ENTER") curentry = map.add(device, 0x30, 0x3f, curentry);
INPUT_PORTS_END curentry->set_handler(read8_delegate(&msm6242_device::read, "msm6242_device::read", RTC_TAG, (msm6242_device *)nullptr),
write8_delegate(&msm6242_device::write, "msm6242_device::write", RTC_TAG, (msm6242_device *)nullptr));
}
static void construct_ioport_tranz330(device_t &owner, ioport_list &portlist, std::string &errorbuf)
{
ioport_configurer configurer(owner, portlist, errorbuf);
configurer.port_alloc("COL.0");
configurer.field_alloc(IPT_BUTTON1, IP_ACTIVE_LOW, 0x01).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_1).field_set_name("1 QZ.");
configurer.field_alloc(IPT_BUTTON2, IP_ACTIVE_LOW, 0x02).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_4).field_set_name("4 GHI");
configurer.field_alloc(IPT_BUTTON3, IP_ACTIVE_LOW, 0x04).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_7).field_set_name("7 PRS");
configurer.field_alloc(IPT_BUTTON4, IP_ACTIVE_LOW, 0x08).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_ASTERISK).field_set_name("* ,'\"");
configurer.port_alloc("COL.1");
configurer.field_alloc(IPT_BUTTON5, IP_ACTIVE_LOW, 0x01).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_2).field_set_name("2 ABC");
configurer.field_alloc(IPT_BUTTON6, IP_ACTIVE_LOW, 0x02).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_5).field_set_name("5 JKL");
configurer.field_alloc(IPT_BUTTON7, IP_ACTIVE_LOW, 0x04).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_8).field_set_name("8 TUV");
configurer.field_alloc(IPT_BUTTON8, IP_ACTIVE_LOW, 0x08).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_0).field_set_name("0 -SP");
configurer.port_alloc("COL.2");
configurer.field_alloc(IPT_BUTTON9, IP_ACTIVE_LOW, 0x01).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_3).field_set_name("3 DEF");
configurer.field_alloc(IPT_BUTTON10, IP_ACTIVE_LOW, 0x02).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_6).field_set_name("6 MNO");
configurer.field_alloc(IPT_BUTTON11, IP_ACTIVE_LOW, 0x04).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_9).field_set_name("9 WXY");
configurer.field_alloc(IPT_BUTTON12, IP_ACTIVE_LOW, 0x08).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_H).field_set_name("#"); // KEYCODE_H for 'hash mark'
configurer.port_alloc("COL.3");
configurer.field_alloc(IPT_BUTTON13, IP_ACTIVE_LOW, 0x01).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_C) .field_set_name("CLEAR"); // KEYCODE_C so as to not collide with potentially-used UI keys like DEL
configurer.field_alloc(IPT_BUTTON14, IP_ACTIVE_LOW, 0x02).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_BACKSPACE).field_set_name("BACK SPACE");
configurer.field_alloc(IPT_BUTTON15, IP_ACTIVE_LOW, 0x04).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_A) .field_set_name("ALPHA");
configurer.field_alloc(IPT_START1, IP_ACTIVE_LOW, 0x08).field_add_code(SEQ_TYPE_STANDARD, KEYCODE_ENTER) .field_set_name("FUNC | ENTER"); // KEYCODE_H for 'hash mark'
}
void tranz330_state::machine_start() void tranz330_state::machine_start()
@ -72,17 +97,17 @@ void tranz330_state::machine_reset()
{ {
} }
WRITE_LINE_MEMBER( tranz330_state::syncb_w ) void tranz330_state::syncb_w(int state)
{ {
} }
WRITE_LINE_MEMBER( tranz330_state::sound_w ) void tranz330_state::sound_w(int state)
{ {
m_speaker->level_w(state); m_speaker->level_w(state);
m_ctc->trg3(state); m_ctc->trg3(state);
} }
WRITE_LINE_MEMBER( tranz330_state::clock_w ) void tranz330_state::clock_w(int state)
{ {
// Ch 0 and 1 might be DART Ch A & B baud clocks // Ch 0 and 1 might be DART Ch A & B baud clocks
//m_ctc->trg0(state); //m_ctc->trg0(state);
@ -91,7 +116,7 @@ WRITE_LINE_MEMBER( tranz330_state::clock_w )
m_ctc->trg2(state); m_ctc->trg2(state);
} }
READ8_MEMBER( tranz330_state::card_r ) uint8_t tranz330_state::card_r(address_space &space, offs_t offset, uint8_t mem_mask)
{ {
// return 0xff for a magstripe 0, return 0x00 for a magstripe 1. // return 0xff for a magstripe 0, return 0x00 for a magstripe 1.
// an interrupt should be triggered on the Z80 when magstripe reading begins. // an interrupt should be triggered on the Z80 when magstripe reading begins.
@ -99,7 +124,7 @@ READ8_MEMBER( tranz330_state::card_r )
return 0xff; return 0xff;
} }
WRITE8_MEMBER( tranz330_state::pio_a_w ) void tranz330_state::pio_a_w(address_space &space, offs_t offset, uint8_t data, uint8_t mem_mask)
{ {
m_keypad_col_mask = data & 0xf; m_keypad_col_mask = data & 0xf;
m_vfd->por ((data >> 4) & 1); m_vfd->por ((data >> 4) & 1);
@ -107,7 +132,7 @@ WRITE8_MEMBER( tranz330_state::pio_a_w )
m_vfd->sclk((data >> 6) & 1); m_vfd->sclk((data >> 6) & 1);
} }
READ8_MEMBER( tranz330_state::pio_b_r ) uint8_t tranz330_state::pio_b_r(address_space &space, offs_t offset, uint8_t mem_mask)
{ {
uint8_t input_mask = 0xf; uint8_t input_mask = 0xf;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)