diff options
| author | 2014-12-31 07:53:27 +0100 | |
|---|---|---|
| committer | 2014-12-31 07:53:27 +0100 | |
| commit | e6f78d5ed281850d9e8b391c049b8bf696e140bf (patch) | |
| tree | c76def6dc672e2b56d3a9b3fb61fec02f0b21f8c /src/emu/machine | |
| parent | bfd87ef73a6850f475e2020c2c2935993f932c56 (diff) | |
Cleanups and version bumpmame0157
Diffstat (limited to 'src/emu/machine')
| -rw-r--r-- | src/emu/machine/am9517a.c | 2 | ||||
| -rw-r--r-- | src/emu/machine/e05a30.c | 1 | ||||
| -rw-r--r-- | src/emu/machine/i6300esb.c | 8 | ||||
| -rw-r--r-- | src/emu/machine/i82875p.h | 2 | ||||
| -rw-r--r-- | src/emu/machine/r10696.c | 202 | ||||
| -rw-r--r-- | src/emu/machine/r10696.h | 32 | ||||
| -rw-r--r-- | src/emu/machine/r10788.c | 240 | ||||
| -rw-r--r-- | src/emu/machine/r10788.h | 74 | ||||
| -rw-r--r-- | src/emu/machine/ra17xx.c | 68 | ||||
| -rw-r--r-- | src/emu/machine/ra17xx.h | 34 | ||||
| -rw-r--r-- | src/emu/machine/smpc.c | 6 | ||||
| -rw-r--r-- | src/emu/machine/steppers.c | 2 | ||||
| -rw-r--r-- | src/emu/machine/steppers.h | 40 |
13 files changed, 354 insertions, 357 deletions
diff --git a/src/emu/machine/am9517a.c b/src/emu/machine/am9517a.c index 7e473f8b59d..2e20fd8a475 100644 --- a/src/emu/machine/am9517a.c +++ b/src/emu/machine/am9517a.c @@ -523,7 +523,7 @@ void am9517a_device::device_start() save_item(NAME(m_status)); save_item(NAME(m_temp)); save_item(NAME(m_request)); - + for (int i = 0; i < 4; i++) { save_item(NAME(m_channel[i].m_address), i); diff --git a/src/emu/machine/e05a30.c b/src/emu/machine/e05a30.c index 5e3de355336..804b46ccbe3 100644 --- a/src/emu/machine/e05a30.c +++ b/src/emu/machine/e05a30.c @@ -151,7 +151,6 @@ void e05a30_device::update_cr_stepper(UINT8 data) WRITE_LINE_MEMBER( e05a30_device::centronics_input_strobe ) { if (m_centronics_strobe == TRUE && state == FALSE && !m_centronics_busy) { - m_centronics_data_latch = m_centronics_data; m_centronics_data_latched = TRUE; diff --git a/src/emu/machine/i6300esb.c b/src/emu/machine/i6300esb.c index 04592dccf1b..7619cb3eda0 100644 --- a/src/emu/machine/i6300esb.c +++ b/src/emu/machine/i6300esb.c @@ -83,12 +83,12 @@ DEVICE_ADDRESS_MAP_START(internal_io_map, 32, i6300esb_lpc_device) AM_RANGE(0x00ec, 0x00ef) AM_WRITE8( nop_w, 0x0000ff00) // Non-existing, used for delays by the bios/os ADDRESS_MAP_END - + i6300esb_lpc_device::i6300esb_lpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : pci_device(mconfig, I6300ESB_LPC, "i6300ESB southbridge ISA/LPC bridge", tag, owner, clock, "i6300esb_lpc", __FILE__), - acpi(*this, "acpi"), - rtc (*this, "rtc"), - pit (*this, "pit") + acpi(*this, "acpi"), + rtc (*this, "rtc"), + pit (*this, "pit") { } diff --git a/src/emu/machine/i82875p.h b/src/emu/machine/i82875p.h index bf8c8f841ba..2fa14253b66 100644 --- a/src/emu/machine/i82875p.h +++ b/src/emu/machine/i82875p.h @@ -107,7 +107,7 @@ class i82875p_overflow_device : public pci_device { public: i82875p_overflow_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + DECLARE_READ8_MEMBER (dram_row_boundary_r); DECLARE_WRITE8_MEMBER (dram_row_boundary_w); DECLARE_READ8_MEMBER (dram_row_attribute_r); diff --git a/src/emu/machine/r10696.c b/src/emu/machine/r10696.c index 50191c0ede7..7dca19866f6 100644 --- a/src/emu/machine/r10696.c +++ b/src/emu/machine/r10696.c @@ -34,7 +34,7 @@ #include "emu.h" #include "machine/r10696.h" -#define VERBOSE 1 +#define VERBOSE 1 #if VERBOSE #define LOG(x) logerror x #else @@ -50,9 +50,9 @@ const device_type R10696 = &device_creator<r10696_device>; r10696_device::r10696_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, R10696, "Rockwell 10696", tag, owner, clock, "r10696", __FILE__), - m_io_a(0), m_io_b(0), m_io_c(0), - m_iord(*this), m_iowr(*this) + : device_t(mconfig, R10696, "Rockwell 10696", tag, owner, clock, "r10696", __FILE__), + m_io_a(0), m_io_b(0), m_io_c(0), + m_iord(*this), m_iowr(*this) { } @@ -61,12 +61,12 @@ r10696_device::r10696_device(const machine_config &mconfig, const char *tag, dev */ void r10696_device::device_start() { - m_iord.resolve(); - m_iowr.resolve(); + m_iord.resolve(); + m_iowr.resolve(); - save_item(NAME(m_io_a)); - save_item(NAME(m_io_b)); - save_item(NAME(m_io_c)); + save_item(NAME(m_io_a)); + save_item(NAME(m_io_b)); + save_item(NAME(m_io_c)); } /** @@ -87,101 +87,101 @@ void r10696_device::device_reset() WRITE8_MEMBER( r10696_device::io_w ) { - assert(offset < 16); - const UINT8 io_a = m_io_a; - const UINT8 io_b = m_io_b; - const UINT8 io_c = m_io_c; - switch (offset) - { - case 0x0A: // Read Group A - case 0x09: // Read Group B - case 0x03: // Read Group C - case 0x00: // Read Groups A | B | C - case 0x01: // Read Groups B | C - case 0x02: // Read Groups A | C - case 0x08: // Read Groups A | B - break; - - case 0x0E: // Set Group A - m_io_a = data & 0x0f; - break; - case 0x0D: // Set Group B - m_io_b = data & 0x0f; - break; - case 0x07: // Set Group C - m_io_c = data & 0x0f; - break; - case 0x04: // Set Groups A, B and C - m_io_a = m_io_b = m_io_c = data & 0x0f; - break; - case 0x05: // Set Groups B and C - m_io_b = m_io_c = data & 0x0f; - break; - case 0x06: // Set Groups A and C - m_io_a = m_io_c = data & 0x0f; - break; - case 0x0C: // Set Groups A and B - m_io_a = m_io_b = data & 0x0f; - break; - } - if (io_a != m_io_a) - m_iowr(0, m_io_a, 0x0f); - if (io_b != m_io_b) - m_iowr(1, m_io_b, 0x0f); - if (io_c != m_io_c) - m_iowr(2, m_io_c, 0x0f); + assert(offset < 16); + const UINT8 io_a = m_io_a; + const UINT8 io_b = m_io_b; + const UINT8 io_c = m_io_c; + switch (offset) + { + case 0x0A: // Read Group A + case 0x09: // Read Group B + case 0x03: // Read Group C + case 0x00: // Read Groups A | B | C + case 0x01: // Read Groups B | C + case 0x02: // Read Groups A | C + case 0x08: // Read Groups A | B + break; + + case 0x0E: // Set Group A + m_io_a = data & 0x0f; + break; + case 0x0D: // Set Group B + m_io_b = data & 0x0f; + break; + case 0x07: // Set Group C + m_io_c = data & 0x0f; + break; + case 0x04: // Set Groups A, B and C + m_io_a = m_io_b = m_io_c = data & 0x0f; + break; + case 0x05: // Set Groups B and C + m_io_b = m_io_c = data & 0x0f; + break; + case 0x06: // Set Groups A and C + m_io_a = m_io_c = data & 0x0f; + break; + case 0x0C: // Set Groups A and B + m_io_a = m_io_b = data & 0x0f; + break; + } + if (io_a != m_io_a) + m_iowr(0, m_io_a, 0x0f); + if (io_b != m_io_b) + m_iowr(1, m_io_b, 0x0f); + if (io_c != m_io_c) + m_iowr(2, m_io_c, 0x0f); } READ8_MEMBER( r10696_device::io_r ) { - assert(offset < 16); - UINT8 io_a, io_b, io_c; - UINT8 data = 0xf; - switch (offset) - { - case 0x0A: // Read Group A - io_a = m_iord(0); - data = io_a & 0x0f; - break; - case 0x09: // Read Group B - io_b = m_iord(1); - data = io_b & 0x0f; - break; - case 0x03: // Read Group C - io_c = m_iord(2); - data = io_c & 0x0f; - break; - case 0x00: // Read Groups A | B | C - io_a = m_iord(0); - io_b = m_iord(1); - io_c = m_iord(2); - data = (io_a | io_b | io_a) & 0x0f; - break; - case 0x01: // Read Groups B | C - io_b = m_iord(1); - io_c = m_iord(2); - data = (io_b | io_c) & 0x0f; - break; - case 0x02: // Read Groups A | C - io_a = m_iord(0); - io_c = m_iord(2); - data = (io_a | io_c) & 0x0f; - break; - case 0x08: // Read Groups A | B - io_a = m_iord(0); - io_b = m_iord(1); - data = (io_a | io_b) & 0x0f; - break; - - case 0x0E: // Set Group A - case 0x0D: // Set Group B - case 0x07: // Set Group C - case 0x04: // Set Groups A, B and C - case 0x05: // Set Groups B and C - case 0x06: // Set Groups A and C - case 0x0C: // Set Groups A and B - break; - } - return data; + assert(offset < 16); + UINT8 io_a, io_b, io_c; + UINT8 data = 0xf; + switch (offset) + { + case 0x0A: // Read Group A + io_a = m_iord(0); + data = io_a & 0x0f; + break; + case 0x09: // Read Group B + io_b = m_iord(1); + data = io_b & 0x0f; + break; + case 0x03: // Read Group C + io_c = m_iord(2); + data = io_c & 0x0f; + break; + case 0x00: // Read Groups A | B | C + io_a = m_iord(0); + io_b = m_iord(1); + io_c = m_iord(2); + data = (io_a | io_b | io_a) & 0x0f; + break; + case 0x01: // Read Groups B | C + io_b = m_iord(1); + io_c = m_iord(2); + data = (io_b | io_c) & 0x0f; + break; + case 0x02: // Read Groups A | C + io_a = m_iord(0); + io_c = m_iord(2); + data = (io_a | io_c) & 0x0f; + break; + case 0x08: // Read Groups A | B + io_a = m_iord(0); + io_b = m_iord(1); + data = (io_a | io_b) & 0x0f; + break; + + case 0x0E: // Set Group A + case 0x0D: // Set Group B + case 0x07: // Set Group C + case 0x04: // Set Groups A, B and C + case 0x05: // Set Groups B and C + case 0x06: // Set Groups A and C + case 0x0C: // Set Groups A and B + break; + } + return data; } diff --git a/src/emu/machine/r10696.h b/src/emu/machine/r10696.h index 996a7d43365..a151a4846dd 100644 --- a/src/emu/machine/r10696.h +++ b/src/emu/machine/r10696.h @@ -24,31 +24,31 @@ /* Set the read and write group (4-bit; nibble) delegates */ #define MCFG_R10696_IO(_devcb_rd,_devcb_wr) \ - r10696_device::set_iord(*device, DEVCB_##_devcb_rd); \ - r10696_device::set_iowr(*device, DEVCB_##_devcb_wr); + r10696_device::set_iord(*device, DEVCB_##_devcb_rd); \ + r10696_device::set_iowr(*device, DEVCB_##_devcb_wr); class r10696_device : public device_t { public: - r10696_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ~r10696_device() {} + r10696_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ~r10696_device() {} - DECLARE_READ8_MEMBER ( io_r ); - DECLARE_WRITE8_MEMBER( io_w ); + DECLARE_READ8_MEMBER ( io_r ); + DECLARE_WRITE8_MEMBER( io_w ); - template<class _Object> static devcb_base &set_iord(device_t &device, _Object object) { return downcast<r10696_device &>(device).m_iord.set_callback(object); } - template<class _Object> static devcb_base &set_iowr(device_t &device, _Object object) { return downcast<r10696_device &>(device).m_iowr.set_callback(object); } + template<class _Object> static devcb_base &set_iord(device_t &device, _Object object) { return downcast<r10696_device &>(device).m_iord.set_callback(object); } + template<class _Object> static devcb_base &set_iowr(device_t &device, _Object object) { return downcast<r10696_device &>(device).m_iowr.set_callback(object); } protected: - // device-level overrides - virtual void device_start(); - virtual void device_reset(); + // device-level overrides + virtual void device_start(); + virtual void device_reset(); private: - UINT8 m_io_a; //!< input/output flip-flops group A - UINT8 m_io_b; //!< input/output flip-flops group B - UINT8 m_io_c; //!< input/output flip-flops group C - devcb_read8 m_iord; //!< input line (read, offset = group, data = 4 bits) - devcb_write8 m_iowr; //!< output line (write, offset = group, data = 4 bits) + UINT8 m_io_a; //!< input/output flip-flops group A + UINT8 m_io_b; //!< input/output flip-flops group B + UINT8 m_io_c; //!< input/output flip-flops group C + devcb_read8 m_iord; //!< input line (read, offset = group, data = 4 bits) + devcb_write8 m_iowr; //!< output line (write, offset = group, data = 4 bits) }; extern const device_type R10696; diff --git a/src/emu/machine/r10788.c b/src/emu/machine/r10788.c index 10f46ab621a..128314903fe 100644 --- a/src/emu/machine/r10788.c +++ b/src/emu/machine/r10788.c @@ -41,7 +41,7 @@ #include "emu.h" #include "machine/r10788.h" -#define VERBOSE 0 +#define VERBOSE 0 #if VERBOSE #define LOG(x) logerror x #else @@ -57,10 +57,10 @@ const device_type R10788 = &device_creator<r10788_device>; r10788_device::r10788_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, R10788, "Rockwell 10788", tag, owner, clock, "r10788", __FILE__), - m_ktr(0), m_kts(0), m_kla(0), m_klb(0), m_mask_a(15), m_mask_b(15), m_ker(0), - m_io_counter(0), m_scan_counter(0), - m_display(*this) + : device_t(mconfig, R10788, "Rockwell 10788", tag, owner, clock, "r10788", __FILE__), + m_ktr(0), m_kts(0), m_kla(0), m_klb(0), m_mask_a(15), m_mask_b(15), m_ker(0), + m_io_counter(0), m_scan_counter(0), + m_display(*this) { } @@ -69,22 +69,22 @@ r10788_device::r10788_device(const machine_config &mconfig, const char *tag, dev */ void r10788_device::device_start() { - m_display.resolve(); - - save_item(NAME(m_reg)); - save_item(NAME(m_ktr)); - save_item(NAME(m_kts)); - save_item(NAME(m_kla)); - save_item(NAME(m_klb)); - save_item(NAME(m_mask_a)); - save_item(NAME(m_mask_b)); - save_item(NAME(m_ker)); - save_item(NAME(m_io_counter)); - save_item(NAME(m_scan_counter)); - - m_timer = timer_alloc(TIMER_DISPLAY); - // recurring timer every 36 cycles - m_timer->adjust(clocks_to_attotime(36), 0, clocks_to_attotime(36)); + m_display.resolve(); + + save_item(NAME(m_reg)); + save_item(NAME(m_ktr)); + save_item(NAME(m_kts)); + save_item(NAME(m_kla)); + save_item(NAME(m_klb)); + save_item(NAME(m_mask_a)); + save_item(NAME(m_mask_b)); + save_item(NAME(m_ker)); + save_item(NAME(m_io_counter)); + save_item(NAME(m_scan_counter)); + + m_timer = timer_alloc(TIMER_DISPLAY); + // recurring timer every 36 cycles + m_timer->adjust(clocks_to_attotime(36), 0, clocks_to_attotime(36)); } /** @@ -93,14 +93,14 @@ void r10788_device::device_start() void r10788_device::device_reset() { memset(m_reg, 0x00, sizeof(m_reg)); - m_ktr = 0; - m_kts = 0; - m_kla = 0; - m_klb = 0; - m_mask_a = 15; - m_mask_b = 15; - m_ker = 0; - m_scan_counter = 0; + m_ktr = 0; + m_kts = 0; + m_kla = 0; + m_klb = 0; + m_mask_a = 15; + m_mask_b = 15; + m_ker = 0; + m_scan_counter = 0; } @@ -113,19 +113,19 @@ void r10788_device::device_reset() */ void r10788_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - UINT8 data; - switch (id) - { - case TIMER_DISPLAY: - data = (m_reg[0][m_scan_counter] & m_mask_a) + - 16 * (m_reg[1][m_scan_counter] & m_mask_b); - LOG(("%s: scan counter:%2d data:%02x\n", __FUNCTION__, m_scan_counter, data)); - m_display(m_scan_counter, data, 0xff); - break; - default: - LOG(("%s: invalid timer id:%d\n", __FUNCTION__, id)); - } - m_scan_counter = (m_scan_counter + 1) % 16; + UINT8 data; + switch (id) + { + case TIMER_DISPLAY: + data = (m_reg[0][m_scan_counter] & m_mask_a) + + 16 * (m_reg[1][m_scan_counter] & m_mask_b); + LOG(("%s: scan counter:%2d data:%02x\n", __FUNCTION__, m_scan_counter, data)); + m_display(m_scan_counter, data, 0xff); + break; + default: + LOG(("%s: invalid timer id:%d\n", __FUNCTION__, id)); + } + m_scan_counter = (m_scan_counter + 1) % 16; } /************************************* @@ -142,87 +142,87 @@ void r10788_device::device_timer(emu_timer &timer, device_timer_id id, int param WRITE8_MEMBER( r10788_device::io_w ) { - assert(offset < 16); - switch (offset) - { - case KTR: // Transfer Keyboard Return - LOG(("%s: KTR data:%02x\n", __FUNCTION__, data)); - m_ktr = data; - break; - case KTS: // Transfer Keyboard Strobe - LOG(("%s: KTS data:%02x\n", __FUNCTION__, data)); - m_kts = data; - break; - case KLA: // Load Display Register A - LOG(("%s: KLA [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); - m_kla = data; - m_reg[0][m_io_counter] = m_kla; - break; - case KLB: // Load Display Register B - LOG(("%s: KLB [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); - m_klb = data; - m_reg[1][m_io_counter] = m_kla; - break; - case KDN: // Turn On Display - LOG(("%s: KDN data:%02x\n", __FUNCTION__, data)); - m_mask_a = 15; - m_mask_b = 15; - break; - case KAF: // Turn Off A - LOG(("%s: KAF data:%02x\n", __FUNCTION__, data)); - m_mask_a = 0; - m_mask_b &= ~3; - break; - case KBF: // Turn Off B - LOG(("%s: KBF data:%02x\n", __FUNCTION__, data)); - m_mask_b &= ~12; - break; - case KER: // Reset Keyboard Error - LOG(("%s: KER data:%02x\n", __FUNCTION__, data)); - m_ker = 10; - break; - } + assert(offset < 16); + switch (offset) + { + case KTR: // Transfer Keyboard Return + LOG(("%s: KTR data:%02x\n", __FUNCTION__, data)); + m_ktr = data; + break; + case KTS: // Transfer Keyboard Strobe + LOG(("%s: KTS data:%02x\n", __FUNCTION__, data)); + m_kts = data; + break; + case KLA: // Load Display Register A + LOG(("%s: KLA [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); + m_kla = data; + m_reg[0][m_io_counter] = m_kla; + break; + case KLB: // Load Display Register B + LOG(("%s: KLB [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); + m_klb = data; + m_reg[1][m_io_counter] = m_kla; + break; + case KDN: // Turn On Display + LOG(("%s: KDN data:%02x\n", __FUNCTION__, data)); + m_mask_a = 15; + m_mask_b = 15; + break; + case KAF: // Turn Off A + LOG(("%s: KAF data:%02x\n", __FUNCTION__, data)); + m_mask_a = 0; + m_mask_b &= ~3; + break; + case KBF: // Turn Off B + LOG(("%s: KBF data:%02x\n", __FUNCTION__, data)); + m_mask_b &= ~12; + break; + case KER: // Reset Keyboard Error + LOG(("%s: KER data:%02x\n", __FUNCTION__, data)); + m_ker = 10; + break; + } } READ8_MEMBER( r10788_device::io_r ) { - assert(offset < 16); - UINT8 data = 0xf; - switch (offset) - { - case KTR: // Transfer Keyboard Return - data = m_ktr; - LOG(("%s: KTR data:%02x\n", __FUNCTION__, data)); - break; - case KTS: // Transfer Keyboard Strobe - data = m_kts; - LOG(("%s: KTS data:%02x\n", __FUNCTION__, data)); - break; - case KLA: // Load Display Register A - m_kla = m_reg[0][m_io_counter]; - data = m_kla; - LOG(("%s: KLA [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); - break; - case KLB: // Load Display Register B - m_klb = m_reg[1][m_io_counter]; - data = m_klb; - LOG(("%s: KLB [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); - // FIXME: does it automagically increment at KLB write? - m_io_counter = (m_io_counter + 1) % 16; - break; - case KDN: // Turn On Display - LOG(("%s: KDN data:%02x\n", __FUNCTION__, data)); - break; - case KAF: // Turn Off A - LOG(("%s: KAF data:%02x\n", __FUNCTION__, data)); - break; - case KBF: // Turn Off B - LOG(("%s: KBF data:%02x\n", __FUNCTION__, data)); - break; - case KER: // Reset Keyboard Error - LOG(("%s: KER data:%02x\n", __FUNCTION__, data)); - break; - } - return data; + assert(offset < 16); + UINT8 data = 0xf; + switch (offset) + { + case KTR: // Transfer Keyboard Return + data = m_ktr; + LOG(("%s: KTR data:%02x\n", __FUNCTION__, data)); + break; + case KTS: // Transfer Keyboard Strobe + data = m_kts; + LOG(("%s: KTS data:%02x\n", __FUNCTION__, data)); + break; + case KLA: // Load Display Register A + m_kla = m_reg[0][m_io_counter]; + data = m_kla; + LOG(("%s: KLA [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); + break; + case KLB: // Load Display Register B + m_klb = m_reg[1][m_io_counter]; + data = m_klb; + LOG(("%s: KLB [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); + // FIXME: does it automagically increment at KLB write? + m_io_counter = (m_io_counter + 1) % 16; + break; + case KDN: // Turn On Display + LOG(("%s: KDN data:%02x\n", __FUNCTION__, data)); + break; + case KAF: // Turn Off A + LOG(("%s: KAF data:%02x\n", __FUNCTION__, data)); + break; + case KBF: // Turn Off B + LOG(("%s: KBF data:%02x\n", __FUNCTION__, data)); + break; + case KER: // Reset Keyboard Error + LOG(("%s: KER data:%02x\n", __FUNCTION__, data)); + break; + } + return data; } diff --git a/src/emu/machine/r10788.h b/src/emu/machine/r10788.h index 51eb2577710..925e579f2c1 100644 --- a/src/emu/machine/r10788.h +++ b/src/emu/machine/r10788.h @@ -23,50 +23,50 @@ /* Set the writer used to update a display digit */ #define MCFG_R10788_UPDATE(_devcb) \ - r10788_device::set_update(*device, DEVCB_##_devcb); + r10788_device::set_update(*device, DEVCB_##_devcb); class r10788_device : public device_t { public: - r10788_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ~r10788_device() {} - - enum { - KTR = 0xc, //!< Transfer Keyboard Return - KTS = 0xa, //!< Transfer Keyboard Strobe - KLA = 0xe, //!< Load Display Register A - KLB = 0xd, //!< Load Display Register B - KDN = 0x3, //!< Turn On Display - KAF = 0xb, //!< Turn Off A - KBF = 0x7, //!< Turn Off B - KER = 0x6 //!< Reset Keyboard Error - }; - - DECLARE_READ8_MEMBER ( io_r ); - DECLARE_WRITE8_MEMBER( io_w ); - - template<class _Object> static devcb_base &set_update(device_t &device, _Object object) { return downcast<r10788_device &>(device).m_display.set_callback(object); } + r10788_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ~r10788_device() {} + + enum { + KTR = 0xc, //!< Transfer Keyboard Return + KTS = 0xa, //!< Transfer Keyboard Strobe + KLA = 0xe, //!< Load Display Register A + KLB = 0xd, //!< Load Display Register B + KDN = 0x3, //!< Turn On Display + KAF = 0xb, //!< Turn Off A + KBF = 0x7, //!< Turn Off B + KER = 0x6 //!< Reset Keyboard Error + }; + + DECLARE_READ8_MEMBER ( io_r ); + DECLARE_WRITE8_MEMBER( io_w ); + + template<class _Object> static devcb_base &set_update(device_t &device, _Object object) { return downcast<r10788_device &>(device).m_display.set_callback(object); } protected: - // device-level overrides - virtual void device_start(); - virtual void device_reset(); - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); private: - static const device_timer_id TIMER_DISPLAY = 0; - - UINT8 m_reg[2][16]; //!< display registers - UINT8 m_ktr; //!< transfer keyboard return value - UINT8 m_kts; //!< transfer keyboard strobe value - UINT8 m_kla; //!< display register A value - UINT8 m_klb; //!< display register B value - UINT8 m_mask_a; //!< display enable bits for A - UINT8 m_mask_b; //!< display enable bits for B - UINT8 m_ker; //!< keyboard error value - int m_io_counter; //!< current I/O register index - int m_scan_counter; //!< current display scan - devcb_write8 m_display; //!< display updater - emu_timer* m_timer; //!< timer running at clock / 18 / 36 + static const device_timer_id TIMER_DISPLAY = 0; + + UINT8 m_reg[2][16]; //!< display registers + UINT8 m_ktr; //!< transfer keyboard return value + UINT8 m_kts; //!< transfer keyboard strobe value + UINT8 m_kla; //!< display register A value + UINT8 m_klb; //!< display register B value + UINT8 m_mask_a; //!< display enable bits for A + UINT8 m_mask_b; //!< display enable bits for B + UINT8 m_ker; //!< keyboard error value + int m_io_counter; //!< current I/O register index + int m_scan_counter; //!< current display scan + devcb_write8 m_display; //!< display updater + emu_timer* m_timer; //!< timer running at clock / 18 / 36 }; extern const device_type R10788; diff --git a/src/emu/machine/ra17xx.c b/src/emu/machine/ra17xx.c index 0869016e562..2b143d0aa9c 100644 --- a/src/emu/machine/ra17xx.c +++ b/src/emu/machine/ra17xx.c @@ -40,7 +40,7 @@ #include "emu.h" #include "machine/ra17xx.h" -#define VERBOSE 1 +#define VERBOSE 1 #if VERBOSE #define LOG(x) logerror x #else @@ -56,10 +56,10 @@ const device_type RA17XX = &device_creator<ra17xx_device>; ra17xx_device::ra17xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, RA17XX, "Rockwell A17XX", tag, owner, clock, "ra17xx", __FILE__), - m_enable(false), - m_iord(*this), - m_iowr(*this) + : device_t(mconfig, RA17XX, "Rockwell A17XX", tag, owner, clock, "ra17xx", __FILE__), + m_enable(false), + m_iord(*this), + m_iowr(*this) { } @@ -68,10 +68,10 @@ ra17xx_device::ra17xx_device(const machine_config &mconfig, const char *tag, dev */ void ra17xx_device::device_start() { - m_iord.resolve(); - m_iowr.resolve(); + m_iord.resolve(); + m_iowr.resolve(); - save_item(NAME(m_line)); + save_item(NAME(m_line)); } /** @@ -79,7 +79,7 @@ void ra17xx_device::device_start() */ void ra17xx_device::device_reset() { - memset(m_line, 0, sizeof(m_line)); + memset(m_line, 0, sizeof(m_line)); } @@ -97,36 +97,36 @@ void ra17xx_device::device_reset() WRITE8_MEMBER( ra17xx_device::io_w ) { - assert(offset < 16); - m_bl = (data >> 4) & 15; // BL on the data bus most significant bits - if (offset & 1) { - // SOS command - if (data & (1 << 3)) { - m_line[m_bl] = 1; // enable output + assert(offset < 16); + m_bl = (data >> 4) & 15; // BL on the data bus most significant bits + if (offset & 1) { + // SOS command + if (data & (1 << 3)) { + m_line[m_bl] = 1; // enable output // if (m_enable) - m_iowr(m_bl, 1, 1); - } else { - m_line[m_bl] = 0; // disable output + m_iowr(m_bl, 1, 1); + } else { + m_line[m_bl] = 0; // disable output // if (m_enable) - m_iowr(m_bl, 0, 1); - } - } else { - // SES command - if (data & (1 << 3)) { - // enable all outputs - m_enable = true; - for (int i = 0; i < 16; i++) - m_iowr(i, m_line[i], 1); - } else { - // disable all outputs - m_enable = false; - } - } + m_iowr(m_bl, 0, 1); + } + } else { + // SES command + if (data & (1 << 3)) { + // enable all outputs + m_enable = true; + for (int i = 0; i < 16; i++) + m_iowr(i, m_line[i], 1); + } else { + // disable all outputs + m_enable = false; + } + } } READ8_MEMBER( ra17xx_device::io_r ) { - assert(offset < 16); - return (m_iord(m_bl) & 1) ? 0x0f : 0x07; + assert(offset < 16); + return (m_iord(m_bl) & 1) ? 0x0f : 0x07; } diff --git a/src/emu/machine/ra17xx.h b/src/emu/machine/ra17xx.h index 4833f5cb7c5..f771ca77590 100644 --- a/src/emu/machine/ra17xx.h +++ b/src/emu/machine/ra17xx.h @@ -23,34 +23,32 @@ /* Set the read line handler */ #define MCFG_RA17XX_READ(_devcb) \ - ra17xx_device::set_iord(*device, DEVCB_##_devcb); \ - + ra17xx_device::set_iord(*device, DEVCB_##_devcb); /* Set the write line handler */ #define MCFG_RA17XX_WRITE(_devcb) \ - ra17xx_device::set_iowr(*device, DEVCB_##_devcb); \ - + ra17xx_device::set_iowr(*device, DEVCB_##_devcb); class ra17xx_device : public device_t { public: - ra17xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ~ra17xx_device() {} + ra17xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ~ra17xx_device() {} - DECLARE_READ8_MEMBER ( io_r ); - DECLARE_WRITE8_MEMBER( io_w ); + DECLARE_READ8_MEMBER ( io_r ); + DECLARE_WRITE8_MEMBER( io_w ); - template<class _Object> static devcb_base &set_iord(device_t &device, _Object object) { return downcast<ra17xx_device &>(device).m_iord.set_callback(object); } - template<class _Object> static devcb_base &set_iowr(device_t &device, _Object object) { return downcast<ra17xx_device &>(device).m_iowr.set_callback(object); } + template<class _Object> static devcb_base &set_iord(device_t &device, _Object object) { return downcast<ra17xx_device &>(device).m_iord.set_callback(object); } + template<class _Object> static devcb_base &set_iowr(device_t &device, _Object object) { return downcast<ra17xx_device &>(device).m_iowr.set_callback(object); } protected: - // device-level overrides - virtual void device_start(); - virtual void device_reset(); + // device-level overrides + virtual void device_start(); + virtual void device_reset(); private: - UINT8 m_line[16]; //!< input/output flip-flops for 16 I/O lines - UINT8 m_bl; //!< value of BL during the most recent output - bool m_enable; //!< true if outputs are enabled - devcb_read8 m_iord; //!< input line (read, offset = line, data = 0/1) - devcb_write8 m_iowr; //!< output line (write, offset = line, data = 0/1) + UINT8 m_line[16]; //!< input/output flip-flops for 16 I/O lines + UINT8 m_bl; //!< value of BL during the most recent output + bool m_enable; //!< true if outputs are enabled + devcb_read8 m_iord; //!< input line (read, offset = line, data = 0/1) + devcb_write8 m_iowr; //!< output line (write, offset = line, data = 0/1) }; extern const device_type RA17XX; diff --git a/src/emu/machine/smpc.c b/src/emu/machine/smpc.c index 93ffa7a0533..955a409b308 100644 --- a/src/emu/machine/smpc.c +++ b/src/emu/machine/smpc.c @@ -393,7 +393,7 @@ void saturn_state::smpc_analog_pad( UINT8 pad_num, UINT8 offset, UINT8 id) void saturn_state::smpc_keyboard(UINT8 pad_num, UINT8 offset) { UINT16 game_key; - + game_key = 0xffff; game_key ^= ((ioport("KEYS_1")->read() & 0x80) << 8); // right @@ -415,8 +415,8 @@ void saturn_state::smpc_keyboard(UINT8 pad_num, UINT8 offset) m_smpc.OREG[2+pad_num*offset] = game_key>>8; // game buttons, TODO m_smpc.OREG[3+pad_num*offset] = game_key & 0xff; /* - Keyboard Status hook-up - TODO: how shift key actually works? EGWord uses it in order to switch between hiragana and katakana modes. + Keyboard Status hook-up + TODO: how shift key actually works? EGWord uses it in order to switch between hiragana and katakana modes. x--- ---- 0 -x-- ---- caps lock --x- ---- num lock diff --git a/src/emu/machine/steppers.c b/src/emu/machine/steppers.c index 5494caf2f3e..4bf3f80ba6e 100644 --- a/src/emu/machine/steppers.c +++ b/src/emu/machine/steppers.c @@ -46,7 +46,7 @@ stepper_device::stepper_device(const machine_config &mconfig, const char *tag, d m_optic_cb(*this) { m_max_steps=(48*2); - } + } /////////////////////////////////////////////////////////////////////////// void stepper_device::update_optic() diff --git a/src/emu/machine/steppers.h b/src/emu/machine/steppers.h index 4d1b49adfd4..6e7fd90c5a6 100644 --- a/src/emu/machine/steppers.h +++ b/src/emu/machine/steppers.h @@ -31,29 +31,29 @@ #define MCFG_STEPPER_ADD(_tag)\ MCFG_DEVICE_ADD(_tag, STEPPER, 0) - + #define MCFG_STEPPER_REEL_TYPE(_data) \ stepper_device::set_reel_type(*device, _data); /* total size of reel (in half steps) */ #define MCFG_STEPPER_MAX_STEPS(_write) \ - stepper_device::set_max_steps(*device, _write); - + stepper_device::set_max_steps(*device, _write); + /* start position of index (in half steps) */ #define MCFG_STEPPER_START_INDEX(_write) \ - stepper_device::set_start_index(*device, _write); + stepper_device::set_start_index(*device, _write); -/* end position of index (in half steps) */ +/* end position of index (in half steps) */ #define MCFG_STEPPER_END_INDEX(_write) \ - stepper_device::set_end_index(*device, _write); + stepper_device::set_end_index(*device, _write); -/* end position of index (in half steps) */ +/* end position of index (in half steps) */ #define MCFG_STEPPER_INDEX_PATTERN(_write) \ - stepper_device::set_index_pattern(*device, _write); - + stepper_device::set_index_pattern(*device, _write); + /* Phase at 0, for opto linkage */ #define MCFG_STEPPER_INIT_PHASE(_write) \ - stepper_device::set_init_phase(*device, _write); + stepper_device::set_init_phase(*device, _write); #define MCFG_STARPOINT_48STEP_ADD(_tag)\ MCFG_STEPPER_ADD(_tag)\ @@ -103,9 +103,9 @@ public: template<class _Object> static devcb_base &set_optic_handler(device_t &device, _Object object) { return downcast<stepper_device &>(device).m_optic_cb.set_callback(object); } - static void set_reel_type(device_t &device, UINT8 type) - { - downcast<stepper_device &>(device).m_type = type; + static void set_reel_type(device_t &device, UINT8 type) + { + downcast<stepper_device &>(device).m_type = type; switch ( type ) { default: case STARPOINT_48STEP_REEL: /* STARPOINT RMxxx */ @@ -127,17 +127,17 @@ public: case ECOIN_200STEP_REEL : downcast<stepper_device &>(device).m_max_steps = (200*2); break; - } + } } static void set_max_steps(device_t &device, INT16 steps) { downcast<stepper_device &>(device).m_max_steps = steps; } static void set_start_index(device_t &device, INT16 index) { downcast<stepper_device &>(device).m_index_start = index; } - static void set_end_index(device_t &device, INT16 index) { downcast<stepper_device &>(device).m_index_end = index; } - static void set_index_pattern(device_t &device, INT16 index) { downcast<stepper_device &>(device).m_index_patt = index; } - static void set_init_phase(device_t &device, UINT8 phase) + static void set_end_index(device_t &device, INT16 index) { downcast<stepper_device &>(device).m_index_end = index; } + static void set_index_pattern(device_t &device, INT16 index) { downcast<stepper_device &>(device).m_index_patt = index; } + static void set_init_phase(device_t &device, UINT8 phase) { - downcast<stepper_device &>(device).m_initphase = phase; - downcast<stepper_device &>(device).m_phase = phase; - downcast<stepper_device &>(device).m_old_phase = phase; + downcast<stepper_device &>(device).m_initphase = phase; + downcast<stepper_device &>(device).m_phase = phase; + downcast<stepper_device &>(device).m_old_phase = phase; } /* update a motor */ |
