diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index f1869389ae2..01d9c14ed3d 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -4475,6 +4475,18 @@ if (MACHINES["PC87306"]~=null) then } end +--------------------------------------------------- +-- +--@src/devices/machine/w83787f.h,MACHINES["W83787F"] = true +--------------------------------------------------- + +if (MACHINES["W83787F"]~=null) then + files { + MAME_DIR .. "src/devices/machine/w83787f.cpp", + MAME_DIR .. "src/devices/machine/w83787f.h", + } +end + --------------------------------------------------- -- --@src/devices/machine/w83977tf.h,MACHINES["W83977TF"] = true diff --git a/src/devices/bus/isa/svga_cirrus.cpp b/src/devices/bus/isa/svga_cirrus.cpp index 42b5f37eb3d..2111b8c6e6b 100644 --- a/src/devices/bus/isa/svga_cirrus.cpp +++ b/src/devices/bus/isa/svga_cirrus.cpp @@ -353,7 +353,17 @@ void isa16_svga_cirrus_gd542x_device::device_start() m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(cirrus_gd5428_device::mem_r)), write8sm_delegate(*m_vga, FUNC(cirrus_gd5428_device::mem_w))); m_isa->install_device(0x03b0, 0x03df, *this, &isa16_svga_cirrus_gd542x_device::io_isa_map); +} +void isa16_svga_cirrus_gd542x_device::remap(int space_id, offs_t start, offs_t end) +{ + if (space_id == AS_PROGRAM) + { + m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(cirrus_gd5428_device::mem_r)), write8sm_delegate(*m_vga, FUNC(cirrus_gd5428_device::mem_w))); + m_isa->install_rom(this, 0xc0000, 0xc7fff, "clgd542x"); + } + else if (space_id == AS_IO) + m_isa->install_device(0x03b0, 0x03df, *this, &isa16_svga_cirrus_gd542x_device::io_isa_map); } //------------------------------------------------- diff --git a/src/devices/bus/isa/svga_cirrus.h b/src/devices/bus/isa/svga_cirrus.h index 0286d3d8510..dafb11c84d5 100644 --- a/src/devices/bus/isa/svga_cirrus.h +++ b/src/devices/bus/isa/svga_cirrus.h @@ -47,6 +47,7 @@ class isa16_svga_cirrus_gd542x_device : uint8_t input_port_0_r(); + virtual void remap(int space_id, offs_t start, offs_t end) override; protected: // device-level overrides virtual void device_start() override; diff --git a/src/devices/cpu/h8/h8.cpp b/src/devices/cpu/h8/h8.cpp index b1b342bedf2..fa6985f1e98 100644 --- a/src/devices/cpu/h8/h8.cpp +++ b/src/devices/cpu/h8/h8.cpp @@ -612,13 +612,14 @@ int h8_device::trapa_setup() u8 h8_device::do_addx8(u8 v1, u8 v2) { - u16 res = v1 + v2 + (m_CCR & F_C ? 1 : 0); + u8 c = m_CCR & F_C ? 1 : 0; + u16 res = v1 + v2 + c; m_CCR &= ~(F_N|F_V|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; - if(((v1 & 0xf) + (v2 & 0xf) + (m_CCR & F_C ? 1 : 0)) & 0x10) + if(m_has_hc) { + if(((v1 & 0xf) + (v2 & 0xf) + c) & 0x10) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(u8(res)) m_CCR &= ~F_Z; @@ -633,13 +634,14 @@ u8 h8_device::do_addx8(u8 v1, u8 v2) u8 h8_device::do_subx8(u8 v1, u8 v2) { - u16 res = v1 - v2 - (m_CCR & F_C ? 1 : 0); + u8 c = m_CCR & F_C ? 1 : 0; + u16 res = v1 - v2 - c; m_CCR &= ~(F_N|F_V|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; - if(((v1 & 0xf) - (v2 & 0xf) - (m_CCR & F_C ? 1 : 0)) & 0x10) + if(m_has_hc) { + if(((v1 & 0xf) - (v2 & 0xf) - c) & 0x10) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(u8(res)) m_CCR &= ~F_Z; @@ -695,11 +697,11 @@ u8 h8_device::do_add8(u8 v1, u8 v2) { u16 res = v1 + v2; m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xf) + (v2 & 0xf)) & 0x10) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u8(res)) m_CCR |= F_Z; @@ -716,11 +718,11 @@ u16 h8_device::do_add16(u16 v1, u16 v2) { u32 res = v1 + v2; m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xfff) + (v2 & 0xfff)) & 0x1000) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u16(res)) m_CCR |= F_Z; @@ -737,11 +739,11 @@ u32 h8_device::do_add32(u32 v1, u32 v2) { u64 res = u64(v1) + u64(v2); m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xfffffff) + (v2 & 0xfffffff)) & 0x10000000) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u32(res)) m_CCR |= F_Z; @@ -797,11 +799,11 @@ u8 h8_device::do_sub8(u8 v1, u8 v2) { u16 res = v1 - v2; m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xf) - (v2 & 0xf)) & 0x10) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u8(res)) m_CCR |= F_Z; @@ -818,11 +820,11 @@ u16 h8_device::do_sub16(u16 v1, u16 v2) { u32 res = v1 - v2; m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xfff) - (v2 & 0xfff)) & 0x1000) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u16(res)) m_CCR |= F_Z; @@ -839,11 +841,11 @@ u32 h8_device::do_sub32(u32 v1, u32 v2) { u64 res = u64(v1) - u64(v2); m_CCR &= ~(F_N|F_V|F_Z|F_C); - if(m_has_hc) - { - m_CCR &= ~F_H; + if(m_has_hc) { if(((v1 & 0xfffffff) - (v2 & 0xfffffff)) & 0x10000000) m_CCR |= F_H; + else + m_CCR &= ~F_H; } if(!u32(res)) m_CCR |= F_Z; diff --git a/src/devices/cpu/h8/h8.lst b/src/devices/cpu/h8/h8.lst index 92a9e03caca..20b01bf0e62 100644 --- a/src/devices/cpu/h8/h8.lst +++ b/src/devices/cpu/h8/h8.lst @@ -2874,7 +2874,7 @@ macro jsr32 %opc %spreg m_TMP2 = 0xffffff00 | m_IR[0]; m_TMP1 = read8(m_TMP2); prefetch_start - bst m_IR[0] >> 4 + bst m_IR[1] >> 4 write8(m_TMP2, m_TMP1); prefetch_done(); @@ -2882,7 +2882,7 @@ macro jsr32 %opc %spreg m_TMP2 = 0xffffff00 | m_IR[0]; m_TMP1 = read8(m_TMP2); prefetch_start - bist m_IR[0] >> 4 + bist m_IR[1] >> 4 write8(m_TMP2, m_TMP1); prefetch_done(); diff --git a/src/devices/cpu/h8/h8325.cpp b/src/devices/cpu/h8/h8325.cpp index cbed3c0321f..ff566aae1a2 100644 --- a/src/devices/cpu/h8/h8325.cpp +++ b/src/devices/cpu/h8/h8325.cpp @@ -97,8 +97,10 @@ void h8325_device::map(address_map &map) map(0xffc4, 0xffc4).rw(FUNC(h8325_device::syscr_r), FUNC(h8325_device::syscr_w)); map(0xffc5, 0xffc5).r(FUNC(h8325_device::mdcr_r)); - map(0xffc6, 0xffc6).rw(m_intc, FUNC(h8325_intc_device::iscr_r), FUNC(h8325_intc_device::iscr_w)); - map(0xffc7, 0xffc7).rw(m_intc, FUNC(h8325_intc_device::ier_r), FUNC(h8325_intc_device::ier_w)); + map(0xffc6, 0xffc6).lr8(NAME([this]() { return m_intc->iscr_r() | ~0x77; })); + map(0xffc6, 0xffc6).lw8(NAME([this](u8 data) { m_intc->iscr_w(data & 0x77); })); + map(0xffc7, 0xffc7).lr8(NAME([this]() { return m_intc->ier_r() | ~0x07; })); + map(0xffc7, 0xffc7).lw8(NAME([this](u8 data) { m_intc->ier_w(data & 0x07); })); map(0xffc8, 0xffc8).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w)); map(0xffc9, 0xffc9).rw(m_timer8[0], FUNC(h8_timer8_channel_device::tcsr_r), FUNC(h8_timer8_channel_device::tcsr_w)); diff --git a/src/devices/cpu/h8/h8_sci.cpp b/src/devices/cpu/h8/h8_sci.cpp index 22bea0c531d..9c6448d64d9 100644 --- a/src/devices/cpu/h8/h8_sci.cpp +++ b/src/devices/cpu/h8/h8_sci.cpp @@ -593,7 +593,7 @@ void h8_sci_device::tx_sync_tick() if(m_tx_clock_counter == 0) { tx_sync_step(); - if(m_clock_mode == INTERNAL_SYNC_OUT) + if(m_clock_mode == INTERNAL_SYNC_OUT && m_tx_state != ST_IDLE) m_cpu->do_sci_clk(m_id, 0); } else if(m_tx_clock_counter == 1 && m_clock_mode == INTERNAL_SYNC_OUT) @@ -605,7 +605,6 @@ void h8_sci_device::tx_sync_step() LOGMASKED(LOG_STATE, "tx_sync_step bit=%d\n", m_tx_bit); if(!m_tx_bit) { m_tx_state = ST_IDLE; - m_tx_bit = 0; clock_stop(CLK_TX); m_cpu->do_sci_tx(m_id, 1); m_ssr |= SSR_TEND; diff --git a/src/devices/cpu/h8/h8_timer16.cpp b/src/devices/cpu/h8/h8_timer16.cpp index 25cc6ac9fa5..f5c16c6f691 100644 --- a/src/devices/cpu/h8/h8_timer16.cpp +++ b/src/devices/cpu/h8/h8_timer16.cpp @@ -261,14 +261,14 @@ void h8_timer16_channel_device::update_counter(u64 cur_time) m_tcnt = tt % m_counter_cycle; for(int i = 0; i < m_tgr_count; i++) { - bool match = (tt == m_tgr[i] || m_tcnt == m_tgr[i]); + bool match = m_tcnt == m_tgr[i] || (tt == m_tgr[i] && tt == m_counter_cycle); if(!match) { // Need to do additional checks here for software that polls the flags with interrupts disabled, // since recalc_event only schedules IRQ events. if(prev >= m_counter_cycle) match = (m_tgr[i] > prev && tt >= m_tgr[i]) || (m_tgr[i] <= m_counter_cycle && m_tcnt < m_counter_cycle && (delta - (0x10000 - prev)) >= m_tgr[i]); else if(m_tgr[i] <= m_counter_cycle) - match = (delta >= m_counter_cycle) || (prev < m_tgr[i] && tt >= m_tgr[i]) || (m_tcnt <= prev && m_tcnt >= m_tgr[i]); + match = delta >= m_counter_cycle || (prev < m_tgr[i] && tt >= m_tgr[i]) || (m_tcnt <= prev && m_tcnt >= m_tgr[i]); if(match && BIT(m_ier, i) && m_interrupt[i] != -1) logerror("update_counter unexpected TGR %d IRQ\n, i"); diff --git a/src/devices/cpu/h8/h8_timer8.cpp b/src/devices/cpu/h8/h8_timer8.cpp index 33202c442c7..af0e1a27859 100644 --- a/src/devices/cpu/h8/h8_timer8.cpp +++ b/src/devices/cpu/h8/h8_timer8.cpp @@ -238,7 +238,7 @@ void h8_timer8_channel_device::update_counter(u64 cur_time) else m_tcnt = tt % m_counter_cycle; - if(tt == m_tcor[0] || m_tcnt == m_tcor[0]) { + if(m_tcnt == m_tcor[0] || (tt == m_tcor[0] && tt == m_counter_cycle)) { if(m_chained_timer) m_chained_timer->chained_timer_tcora(); diff --git a/src/devices/machine/sis85c496.cpp b/src/devices/machine/sis85c496.cpp index 45cc3c9ae66..89cd9e2b9d2 100644 --- a/src/devices/machine/sis85c496.cpp +++ b/src/devices/machine/sis85c496.cpp @@ -43,14 +43,15 @@ void sis85c496_host_device::internal_io_map(address_map &map) { pci_host_device::io_configuration_access_map(map); map(0x0000, 0x001f).rw("dma8237_1", FUNC(am9517a_device::read), FUNC(am9517a_device::write)); - map(0x0020, 0x003f).rw("pic8259_master", FUNC(pic8259_device::read), FUNC(pic8259_device::write)); + map(0x0020, 0x0021).rw("pic8259_master", FUNC(pic8259_device::read), FUNC(pic8259_device::write)); +// map(0x0022, 0x0023) 85C497 super I/O map(0x0040, 0x005f).rw("pit8254", FUNC(pit8254_device::read), FUNC(pit8254_device::write)); map(0x0060, 0x0063).rw(FUNC(sis85c496_host_device::at_keybc_r), FUNC(sis85c496_host_device::at_keybc_w)); map(0x0064, 0x0067).rw("keybc", FUNC(at_keyboard_controller_device::status_r), FUNC(at_keyboard_controller_device::command_w)); - map(0x0070, 0x007f).w(FUNC(sis85c496_host_device::rtc_nmi_w)).umask32(0x00ff00ff); - map(0x0070, 0x007f).rw("rtc", FUNC(ds12885_device::data_r), FUNC(ds12885_device::data_w)).umask32(0xff00ff00); + map(0x0070, 0x0070).lr8(NAME([this] () { return m_ds12885->get_address(); })).w(FUNC(sis85c496_host_device::rtc_address_nmi_w)); + map(0x0071, 0x0071).rw("rtc", FUNC(ds12885_device::data_r), FUNC(ds12885_device::data_w)); map(0x0080, 0x009f).rw(FUNC(sis85c496_host_device::at_page8_r), FUNC(sis85c496_host_device::at_page8_w)); - map(0x00a0, 0x00bf).rw("pic8259_slave", FUNC(pic8259_device::read), FUNC(pic8259_device::write)); + map(0x00a0, 0x00a1).rw("pic8259_slave", FUNC(pic8259_device::read), FUNC(pic8259_device::write)); map(0x00c0, 0x00df).rw(FUNC(sis85c496_host_device::at_dma8237_2_r), FUNC(sis85c496_host_device::at_dma8237_2_w)); map(0x00e0, 0x00ef).noprw(); } @@ -127,6 +128,25 @@ void sis85c496_host_device::device_add_mconfig(machine_config &config) ISA16(config, m_isabus, 0); m_isabus->set_memspace(m_maincpu, AS_PROGRAM); m_isabus->set_iospace(m_maincpu, AS_IO); + m_isabus->irq3_callback().set(FUNC(sis85c496_host_device::pc_irq3_w)); + m_isabus->irq4_callback().set(FUNC(sis85c496_host_device::pc_irq4_w)); + m_isabus->irq5_callback().set(FUNC(sis85c496_host_device::pc_irq5_w)); + m_isabus->irq6_callback().set(FUNC(sis85c496_host_device::pc_irq6_w)); + m_isabus->irq7_callback().set(FUNC(sis85c496_host_device::pc_irq7_w)); + m_isabus->irq2_callback().set(FUNC(sis85c496_host_device::pc_irq9_w)); + m_isabus->irq10_callback().set(FUNC(sis85c496_host_device::pc_irq10_w)); + m_isabus->irq11_callback().set(FUNC(sis85c496_host_device::pc_irq11_w)); + m_isabus->irq12_callback().set(FUNC(sis85c496_host_device::pc_irq12m_w)); + m_isabus->irq14_callback().set(FUNC(sis85c496_host_device::pc_irq14_w)); + m_isabus->irq15_callback().set(FUNC(sis85c496_host_device::pc_irq15_w)); + m_isabus->drq0_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq0_w)); + m_isabus->drq1_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq1_w)); + m_isabus->drq2_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq2_w)); + m_isabus->drq3_callback().set(m_dma8237_1, FUNC(am9517a_device::dreq3_w)); + m_isabus->drq5_callback().set(m_dma8237_2, FUNC(am9517a_device::dreq1_w)); + m_isabus->drq6_callback().set(m_dma8237_2, FUNC(am9517a_device::dreq2_w)); + m_isabus->drq7_callback().set(m_dma8237_2, FUNC(am9517a_device::dreq3_w)); + m_isabus->iochck_callback().set(FUNC(sis85c496_host_device::iochck_w)); IDE_CONTROLLER_32(config, m_ide[0]).options(ata_devices, "hdd", nullptr, false); m_ide[0]->irq_handler().set(m_pic8259_slave, FUNC(pic8259_device::ir6_w)); @@ -562,6 +582,20 @@ void sis85c496_host_device::pc_dack5_w(int state) { pc_select_dma_channel(5, sta void sis85c496_host_device::pc_dack6_w(int state) { pc_select_dma_channel(6, state); } void sis85c496_host_device::pc_dack7_w(int state) { pc_select_dma_channel(7, state); } +void sis85c496_host_device::pc_irq1_w(int state) { m_pic8259_master->ir1_w(state); } +void sis85c496_host_device::pc_irq3_w(int state) { m_pic8259_master->ir3_w(state); } +void sis85c496_host_device::pc_irq4_w(int state) { m_pic8259_master->ir4_w(state); } +void sis85c496_host_device::pc_irq5_w(int state) { m_pic8259_master->ir5_w(state); } +void sis85c496_host_device::pc_irq6_w(int state) { m_pic8259_master->ir6_w(state); } +void sis85c496_host_device::pc_irq7_w(int state) { m_pic8259_master->ir7_w(state); } +void sis85c496_host_device::pc_irq8n_w(int state) { m_pic8259_slave->ir0_w(state); } +void sis85c496_host_device::pc_irq9_w(int state) { m_pic8259_slave->ir1_w(state); } +void sis85c496_host_device::pc_irq10_w(int state) { m_pic8259_slave->ir2_w(state); } +void sis85c496_host_device::pc_irq11_w(int state) { m_pic8259_slave->ir3_w(state); } +void sis85c496_host_device::pc_irq12m_w(int state) { m_pic8259_slave->ir4_w(state); } +void sis85c496_host_device::pc_irq14_w(int state) { m_pic8259_slave->ir6_w(state); } +void sis85c496_host_device::pc_irq15_w(int state) { m_pic8259_slave->ir7_w(state); } + uint8_t sis85c496_host_device::at_portb_r() { uint8_t data = m_at_speaker; @@ -584,17 +618,24 @@ void sis85c496_host_device::at_portb_w(uint8_t data) m_pit8254->write_gate2(BIT(data, 0)); at_speaker_set_spkrdata( BIT(data, 1)); m_channel_check = BIT(data, 3); - //m_isabus->set_nmi_state((m_nmi_enabled==0) && (m_channel_check==0)); + if (m_channel_check) + m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); +} + +void sis85c496_host_device::iochck_w(int state) +{ + if (!state && !m_channel_check && m_nmi_enabled) + m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } uint8_t sis85c496_host_device::at_dma8237_2_r(offs_t offset) { - return m_dma8237_2->read( offset / 2); + return m_dma8237_2->read(offset / 2); } void sis85c496_host_device::at_dma8237_2_w(offs_t offset, uint8_t data) { - m_dma8237_2->write( offset / 2, data); + m_dma8237_2->write(offset / 2, data); } uint8_t sis85c496_host_device::at_keybc_r(offs_t offset) @@ -617,10 +658,9 @@ void sis85c496_host_device::at_keybc_w(offs_t offset, uint8_t data) } } - -void sis85c496_host_device::rtc_nmi_w(uint8_t data) +void sis85c496_host_device::rtc_address_nmi_w(uint8_t data) { - m_nmi_enabled = BIT(data,7); + m_nmi_enabled = BIT(data, 7); //m_isabus->set_nmi_state((m_nmi_enabled==0) && (m_channel_check==0)); m_ds12885->address_w(data); } diff --git a/src/devices/machine/sis85c496.h b/src/devices/machine/sis85c496.h index 1636b2177e0..f1ec6de304e 100644 --- a/src/devices/machine/sis85c496.h +++ b/src/devices/machine/sis85c496.h @@ -46,6 +46,20 @@ class sis85c496_host_device : public pci_host_device { void set_cpu_tag(const char *tag); void set_ram_size(int ram_size); + void pc_irq1_w(int state); + void pc_irq3_w(int state); + void pc_irq4_w(int state); + void pc_irq5_w(int state); + void pc_irq6_w(int state); + void pc_irq7_w(int state); + void pc_irq8n_w(int state); + void pc_irq9_w(int state); + void pc_irq10_w(int state); + void pc_irq11_w(int state); + void pc_irq12m_w(int state); + void pc_irq14_w(int state); + void pc_irq15_w(int state); + protected: virtual void device_start() override; virtual void device_reset() override; @@ -150,9 +164,11 @@ class sis85c496_host_device : public pci_host_device { void pc_dack7_w(int state); uint8_t at_dma8237_2_r(offs_t offset); void at_dma8237_2_w(offs_t offset, uint8_t data); + void iochck_w(int state); uint8_t at_keybc_r(offs_t offset); void at_keybc_w(offs_t offset, uint8_t data); - void rtc_nmi_w(uint8_t data); + u8 rtc_address_r(); + void rtc_address_nmi_w(uint8_t data); uint8_t pc_dma_read_byte(offs_t offset); void pc_dma_write_byte(offs_t offset, uint8_t data); uint8_t pc_dma_read_word(offs_t offset); diff --git a/src/devices/machine/w83787f.cpp b/src/devices/machine/w83787f.cpp new file mode 100644 index 00000000000..03ea4d93544 --- /dev/null +++ b/src/devices/machine/w83787f.cpp @@ -0,0 +1,346 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese +/************************************************************************************************** + +Winbond W83787IF / W83787F + +'F is the base, 'IF adds IrDA. +Looks similar in design to National PC87306 (including similar reg names) + +**************************************************************************************************/ + +#include "emu.h" +#include "bus/isa/isa.h" +#include "machine/w83787f.h" + +#define LOG_WARN (1U << 1) + +#define VERBOSE (LOG_GENERAL | LOG_WARN) +//#define LOG_OUTPUT_FUNC osd_printf_info +#include "logmacro.h" + +#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__) + +DEFINE_DEVICE_TYPE(W83787F, w83787f_device, "w83787f", "National Semiconductor W83787F Super I/O Enhanced Sidewinder Lite") + +w83787f_device::w83787f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, W83787F, tag, owner, clock) + , device_isa16_card_interface(mconfig, *this) + , device_memory_interface(mconfig, *this) + , m_space_config("superio_config_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(w83787f_device::config_map), this)) + , m_pc_com(*this, "uart%d", 0U) + , m_pc_lpt(*this, "lpta") + , m_irq1_callback(*this) + , m_irq8_callback(*this) + , m_irq9_callback(*this) + , m_txd1_callback(*this) + , m_ndtr1_callback(*this) + , m_nrts1_callback(*this) + , m_txd2_callback(*this) + , m_ndtr2_callback(*this) + , m_nrts2_callback(*this) +{ } + + +void w83787f_device::device_start() +{ + set_isa_device(); + //m_isa->set_dma_channel(0, this, true); + //m_isa->set_dma_channel(1, this, true); + //m_isa->set_dma_channel(2, this, true); + //m_isa->set_dma_channel(3, this, true); + remap(AS_IO, 0, 0x400); +} + +void w83787f_device::device_reset() +{ + m_locked_state = true; + m_cr1 = 0; +} + +device_memory_interface::space_config_vector w83787f_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(0, &m_space_config) + }; +} + +void w83787f_device::device_add_mconfig(machine_config &config) +{ + PC_LPT(config, m_pc_lpt); + m_pc_lpt->irq_handler().set(FUNC(w83787f_device::irq_parallel_w)); + + NS16550(config, m_pc_com[0], XTAL(1'843'200)); + m_pc_com[0]->out_int_callback().set(FUNC(w83787f_device::irq_serial1_w)); + m_pc_com[0]->out_tx_callback().set(FUNC(w83787f_device::txd_serial1_w)); + m_pc_com[0]->out_dtr_callback().set(FUNC(w83787f_device::dtr_serial1_w)); + m_pc_com[0]->out_rts_callback().set(FUNC(w83787f_device::rts_serial1_w)); + + NS16550(config, m_pc_com[1], XTAL(1'843'200)); + m_pc_com[1]->out_int_callback().set(FUNC(w83787f_device::irq_serial2_w)); + m_pc_com[1]->out_tx_callback().set(FUNC(w83787f_device::txd_serial2_w)); + m_pc_com[1]->out_dtr_callback().set(FUNC(w83787f_device::dtr_serial2_w)); + m_pc_com[1]->out_rts_callback().set(FUNC(w83787f_device::rts_serial2_w)); +} + +void w83787f_device::remap(int space_id, offs_t start, offs_t end) +{ + if (space_id == AS_IO) + { + m_isa->install_device(0x0250, 0x0252, read8sm_delegate(*this, FUNC(w83787f_device::read)), write8sm_delegate(*this, FUNC(w83787f_device::write))); + + //if (BIT(m_fer, 0)) + const u8 lpt_setting = (m_cr1 >> 4) & 3; + if (lpt_setting != 3) + { + const u16 lpt_port[3] = { 0x3bc, 0x278, 0x378 }; + const u16 lpt_addr = lpt_port[lpt_setting & 3]; + LOG("Map LPT1 to I/O port %04x-%04x\n", lpt_addr, lpt_addr + 3); + + m_isa->install_device(lpt_addr, lpt_addr + 3, read8sm_delegate(*m_pc_lpt, FUNC(pc_lpt_device::read)), write8sm_delegate(*m_pc_lpt, FUNC(pc_lpt_device::write))); + } + + for (int i = 0; i < 2; i++) + { + const u8 uart_setting = (BIT(m_cr1, 2 + i) >> 1) | (BIT(m_cr1, i)); + if (uart_setting != 3) + { + const u16 uart_port[3] = { 0x2e8, 0x3e8, 0x3f8 }; + const u16 uart_addr = uart_port[uart_setting & 3] ^ (i ? 0x100 : 0x000); + LOG("Map UART%c to I/O port %04x-%04x\n", i ? 'A' : 'B', uart_addr, uart_addr + 7); + m_isa->install_device(uart_addr, uart_addr + 7, read8sm_delegate(*m_pc_com[i], FUNC(ns16450_device::ins8250_r)), write8sm_delegate(*m_pc_com[i], FUNC(ns16450_device::ins8250_w))); + } + } + } +} + +u8 w83787f_device::read(offs_t offset) +{ + if (offset != 2 && !machine().side_effects_disabled()) + { + LOGWARN("Invalid %s access read\n", offset & 1 ? "EFIR" : "EFIR"); + return space().unmap(); + } + + if (m_locked_state) + return space().unmap(); + + return space().read_byte(m_index); +} + +void w83787f_device::write(offs_t offset, u8 data) +{ + switch (offset) + { + // EFER + // TODO: 0x89 with GMRD# pin + case 0: m_locked_state = (data != 0x88); break; + // EFIR + case 1: m_index = data; break; + // EFDR + case 2: + if (!m_locked_state) + space().write_byte(m_index, data); + break; + } +} + +// none of these regs have a real naming, they are all CR* +void w83787f_device::config_map(address_map &map) +{ +// map(0x00, 0x00) IDE & FDC + map(0x01, 0x01).lrw8( + NAME([this] (offs_t offset) { + return m_cr1; + }), + NAME([this] (offs_t offset, u8 data) { + m_cr1 = data; + remap(AS_IO, 0, 0x400); + }) + ); +// map(0x02, 0x02) extension adapter mode +// map(0x03, 0x03) game port, UART clocks +// map(0x04, 0x04) game port, UARTA/B power-down tristate +// map(0x05, 0x05) ECP FIFO threshold +// map(0x06, 0x06) 2x / x4 FDD select, FDC power-down tristate, IDE power-down tristate +// map(0x07, 0x07) FDDs type +// map(0x08, 0x08) automatic power-down, FDD write protect +// map(0x09, 0x09) CHIP ID, lock alias, operating mode +// map(0x0a, 0x0a) LPT pins +// map(0x0c, 0x0c) UARTA/B clock source, lock select +// map(0x0d, 0x0d) IrDA select +// map(0x0e, 0x0f) +// map(0x10, 0x10) GIO0 address select 7-0 +// map(0x11, 0x11) GIO0 address select 10-8, GI0 address MODE0-1 +// map(0x12, 0x12) GIO1 address select 7-0 +// map(0x13, 0x13) GIO1 address select 10-8, GI0 address MODE0-1 +// map(0x14, 0x14) GIO0 ddr/mode +// map(0x15, 0x15) GIO1 ddr/mode +} + +/* + * Serial + */ + +void w83787f_device::irq_serial1_w(int state) +{ + if ((m_cr1 & 0x05) == 0x05) + return; + request_irq(3, state ? ASSERT_LINE : CLEAR_LINE); +} + +void w83787f_device::irq_serial2_w(int state) +{ + if ((m_cr1 & 0x0a) == 0x0a) + return; + request_irq(4, state ? ASSERT_LINE : CLEAR_LINE); +} + +void w83787f_device::txd_serial1_w(int state) +{ + if ((m_cr1 & 0x05) == 0x05) + return; + m_txd1_callback(state); +} + +void w83787f_device::txd_serial2_w(int state) +{ + if ((m_cr1 & 0x0a) == 0x0a) + return; + m_txd2_callback(state); +} + +void w83787f_device::dtr_serial1_w(int state) +{ + if ((m_cr1 & 0x05) == 0x05) + return; + m_ndtr1_callback(state); +} + +void w83787f_device::dtr_serial2_w(int state) +{ + if ((m_cr1 & 0x0a) == 0x0a) + return; + m_ndtr2_callback(state); +} + +void w83787f_device::rts_serial1_w(int state) +{ + if ((m_cr1 & 0x05) == 0x05) + return; + m_nrts1_callback(state); +} + +void w83787f_device::rts_serial2_w(int state) +{ + if ((m_cr1 & 0x0a) == 0x0a) + return; + m_nrts2_callback(state); +} + +void w83787f_device::rxd1_w(int state) +{ + m_pc_com[0]->rx_w(state); +} + +void w83787f_device::ndcd1_w(int state) +{ + m_pc_com[0]->dcd_w(state); +} + +void w83787f_device::ndsr1_w(int state) +{ + m_pc_com[0]->dsr_w(state); +} + +void w83787f_device::nri1_w(int state) +{ + m_pc_com[0]->ri_w(state); +} + +void w83787f_device::ncts1_w(int state) +{ + m_pc_com[0]->cts_w(state); +} + +void w83787f_device::rxd2_w(int state) +{ + m_pc_com[1]->rx_w(state); +} + +void w83787f_device::ndcd2_w(int state) +{ + m_pc_com[1]->dcd_w(state); +} + +void w83787f_device::ndsr2_w(int state) +{ + m_pc_com[1]->dsr_w(state); +} + +void w83787f_device::nri2_w(int state) +{ + m_pc_com[1]->ri_w(state); +} + +void w83787f_device::ncts2_w(int state) +{ + m_pc_com[1]->cts_w(state); +} + +/* + * Parallel + */ + +void w83787f_device::irq_parallel_w(int state) +{ + if ((m_cr1 & 0x30) == 0x30) + return; + request_irq(5, state ? ASSERT_LINE : CLEAR_LINE); +} + +void w83787f_device::request_irq(int irq, int state) +{ + switch (irq) + { + case 1: + m_irq1_callback(state); + break; + case 3: + m_isa->irq3_w(state); + break; + case 4: + m_isa->irq4_w(state); + break; + case 5: + m_isa->irq5_w(state); + break; + case 6: + m_isa->irq6_w(state); + break; + case 7: + m_isa->irq7_w(state); + break; + case 8: + m_irq8_callback(state); + break; + case 9: + m_irq9_callback(state); + break; + case 10: + m_isa->irq10_w(state); + break; + case 11: + m_isa->irq11_w(state); + break; + case 12: + m_isa->irq12_w(state); + break; + case 14: + m_isa->irq14_w(state); + break; + case 15: + m_isa->irq15_w(state); + break; + } +} diff --git a/src/devices/machine/w83787f.h b/src/devices/machine/w83787f.h new file mode 100644 index 00000000000..3fa9e6e4b8c --- /dev/null +++ b/src/devices/machine/w83787f.h @@ -0,0 +1,95 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese + +#ifndef MAME_MACHINE_W83787F_H +#define MAME_MACHINE_W83787F_H + +#pragma once + +#include "bus/isa/isa.h" +#include "machine/ins8250.h" +#include "machine/pc_lpt.h" + +class w83787f_device : public device_t, + public device_isa16_card_interface, + public device_memory_interface +{ +public: + w83787f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ~w83787f_device() {} + + void remap(int space_id, offs_t start, offs_t end) override; + +// auto gp20_reset() { return m_gp20_reset_callback.bind(); } +// auto gp25_gatea20() { return m_gp25_gatea20_callback.bind(); } + auto irq1() { return m_irq1_callback.bind(); } + auto irq8() { return m_irq8_callback.bind(); } + auto irq9() { return m_irq9_callback.bind(); } + auto txd1() { return m_txd1_callback.bind(); } + auto ndtr1() { return m_ndtr1_callback.bind(); } + auto nrts1() { return m_nrts1_callback.bind(); } + auto txd2() { return m_txd2_callback.bind(); } + auto ndtr2() { return m_ndtr2_callback.bind(); } + auto nrts2() { return m_nrts2_callback.bind(); } + + void rxd1_w(int state); + void ndcd1_w(int state); + void ndsr1_w(int state); + void nri1_w(int state); + void ncts1_w(int state); + void rxd2_w(int state); + void ndcd2_w(int state); + void ndsr2_w(int state); + void nri2_w(int state); + void ncts2_w(int state); + +protected: + virtual void device_start() override; + virtual void device_reset() override; + + virtual space_config_vector memory_space_config() const override; + virtual void device_add_mconfig(machine_config &config) override; + +private: + const address_space_config m_space_config; + + required_device_array m_pc_com; + required_device m_pc_lpt; + + devcb_write_line m_irq1_callback; + devcb_write_line m_irq8_callback; + devcb_write_line m_irq9_callback; + devcb_write_line m_txd1_callback; + devcb_write_line m_ndtr1_callback; + devcb_write_line m_nrts1_callback; + devcb_write_line m_txd2_callback; + devcb_write_line m_ndtr2_callback; + devcb_write_line m_nrts2_callback; + + void request_irq(int irq, int state); + + u8 read(offs_t offset); + void write(offs_t offset, u8 data); + + void config_map(address_map &map); + + void irq_parallel_w(int state); + + void irq_serial1_w(int state); + void txd_serial1_w(int state); + void dtr_serial1_w(int state); + void rts_serial1_w(int state); + void irq_serial2_w(int state); + void txd_serial2_w(int state); + void dtr_serial2_w(int state); + void rts_serial2_w(int state); + + u8 m_index = 0; + + bool m_locked_state = true; + u8 m_cr1 = 0; +}; + +DECLARE_DEVICE_TYPE(W83787F, w83787f_device); + +#endif // MAME_MACHINE_W83787F_H diff --git a/src/devices/sound/okim6588.cpp b/src/devices/sound/okim6588.cpp index 4e28ddd1ee3..84b1a9a3033 100644 --- a/src/devices/sound/okim6588.cpp +++ b/src/devices/sound/okim6588.cpp @@ -105,7 +105,7 @@ TIMER_CALLBACK_MEMBER(okim6588_device::clock_adpcm) case RUN_PLAY_EXT: // strobe MON m_write_mon(1); - m_mon_timer->adjust(attotime::from_ticks(m_samp_fdiv / 4, clock())); + m_mon_timer->adjust(attotime::from_ticks(m_samp_fdiv / 4, clock()), 0); m_command_state = COMMAND_EXT; m_stream->update(); diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp index b3b8af01388..ed34dfa85b2 100644 --- a/src/devices/video/scn2674.cpp +++ b/src/devices/video/scn2674.cpp @@ -49,7 +49,7 @@ scn2674_device::scn2674_device(const machine_config &mconfig, device_type type, , m_mbc_char_cb(*this, 0) , m_mbc_attr_cb(*this, 0) , m_IR_pointer(0) - , m_screen1_address(0), m_screen2_address(0) + , m_screen1_address(0), m_screen2_address(0), m_screen2_address_start(0) , m_cursor_address(0) , m_irq_register(0), m_status_register(0), m_irq_mask(0) , m_gfx_enabled(false) @@ -121,6 +121,7 @@ void scn2674_device::device_start() save_item(NAME(m_linecounter)); save_item(NAME(m_screen1_address)); save_item(NAME(m_screen2_address)); + save_item(NAME(m_screen2_address_start)); save_item(NAME(m_cursor_address)); save_item(NAME(m_IR_pointer)); save_item(NAME(m_irq_register)); @@ -174,6 +175,7 @@ void scn2674_device::device_reset() { m_screen1_address = 0; m_screen2_address = 0; + m_screen2_address_start = 0; m_cursor_address = 0; m_irq_register = 0; m_status_register = 0; @@ -975,6 +977,7 @@ void scn2674_device::write_screen2_address(bool msb, uint8_t data) } else m_screen2_address = (m_screen2_address & 0x3f00) | data; + m_screen2_address_start = m_screen2_address; } void scn2672_device::write_screen2_address(bool msb, uint8_t data) @@ -1197,6 +1200,7 @@ TIMER_CALLBACK_MEMBER(scn2674_device::vblank_timer) m_irq_register |= 0x10; m_intr_cb(ASSERT_LINE); } + m_screen2_address = m_screen2_address_start; } uint32_t scn2674_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) diff --git a/src/devices/video/scn2674.h b/src/devices/video/scn2674.h index 0304982bbc0..8654cd839c4 100644 --- a/src/devices/video/scn2674.h +++ b/src/devices/video/scn2674.h @@ -62,6 +62,7 @@ class scn2674_device : public device_t, uint8_t m_IR_pointer; uint16_t m_screen1_address; uint16_t m_screen2_address; + uint16_t m_screen2_address_start; uint16_t m_cursor_address; uint8_t m_irq_register; uint8_t m_status_register; diff --git a/src/mame/appliedconcepts/ggm.cpp b/src/mame/appliedconcepts/ggm.cpp index c18609978a1..5451f8dcd8c 100644 --- a/src/mame/appliedconcepts/ggm.cpp +++ b/src/mame/appliedconcepts/ggm.cpp @@ -463,7 +463,7 @@ static INPUT_PORTS_START( overlay_lasvegas ) PORT_MODIFY("IN.3") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_L) PORT_NAME("Split") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_U) PORT_NAME("Shuffle Point") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_P) PORT_NAME("Shuffle Point") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_A) PORT_NAME("Audio") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_T) PORT_NAME("Total") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x04) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") @@ -485,7 +485,7 @@ static INPUT_PORTS_START( overlay_odin ) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_U) PORT_NAME("Audio") PORT_MODIFY("IN.2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_Y) PORT_NAME("Play / -") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_P) PORT_NAME("Play / -") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_W) PORT_NAME("B/W") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_K) PORT_NAME("Rank") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) OVERLAY(0x05) PORT_CODE(KEYCODE_T) PORT_NAME("Time") diff --git a/src/mame/chess/tasc.cpp b/src/mame/chess/tasc.cpp index 4cfc9ad5926..52b410b0738 100644 --- a/src/mame/chess/tasc.cpp +++ b/src/mame/chess/tasc.cpp @@ -267,23 +267,23 @@ void tasc_state::main_map(address_map &map) static INPUT_PORTS_START( tasc ) PORT_START("IN.0") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("PLAY") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_LEFT) PORT_NAME("LEFT") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_LEFT) PORT_NAME("Left") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_START("IN.1") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("BACK") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("RIGHT") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Back") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("Right") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) PORT_START("IN.2") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("MENU") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_UP) PORT_NAME("UP") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Menu") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_UP) PORT_NAME("Up") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Left Clock") PORT_START("IN.3") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("ENTER") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DOWN) PORT_NAME("DOWN") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DOWN) PORT_NAME("Down") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Right Clock") PORT_START("CPU") diff --git a/src/mame/chess/yeno_301xl.cpp b/src/mame/chess/yeno_301xl.cpp index a7b6bf350ca..51d3ad323b6 100644 --- a/src/mame/chess/yeno_301xl.cpp +++ b/src/mame/chess/yeno_301xl.cpp @@ -175,7 +175,7 @@ static INPUT_PORTS_START( y301xl ) PORT_START("IN.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Sound") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New") diff --git a/src/mame/chess/yeno_532xl.cpp b/src/mame/chess/yeno_532xl.cpp index 50121c4ba14..fd60cf1a8dd 100644 --- a/src/mame/chess/yeno_532xl.cpp +++ b/src/mame/chess/yeno_532xl.cpp @@ -204,7 +204,7 @@ static INPUT_PORTS_START( y532xl ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Show Move") PORT_START("IN.1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game / Clear Board") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Set Up") diff --git a/src/mame/cxg/professor.cpp b/src/mame/cxg/professor.cpp index f74b45cd9d1..c52a1b68739 100644 --- a/src/mame/cxg/professor.cpp +++ b/src/mame/cxg/professor.cpp @@ -170,7 +170,7 @@ static INPUT_PORTS_START( professor ) PORT_START("IN.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_N) PORT_NAME("Reset") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Position") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Position") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("Color") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Sound") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Test") diff --git a/src/mame/ddr/chessmstdm.cpp b/src/mame/ddr/chessmstdm.cpp index aaf92c7fa25..be9650a92d1 100644 --- a/src/mame/ddr/chessmstdm.cpp +++ b/src/mame/ddr/chessmstdm.cpp @@ -264,7 +264,7 @@ static INPUT_PORTS_START( chessmstdm ) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Move Back") PORT_CODE(KEYCODE_LEFT) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Board") PORT_CODE(KEYCODE_B) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Match / Time") PORT_CODE(KEYCODE_M) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Parameter / Information") PORT_CODE(KEYCODE_I) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Parameter / Information") PORT_CODE(KEYCODE_P) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Selection / Dialogue") PORT_CODE(KEYCODE_S) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Function / Notation") PORT_CODE(KEYCODE_F) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) diff --git a/src/mame/ddr/sc2.cpp b/src/mame/ddr/sc2.cpp index b998b7ac8a5..0014d620ce6 100644 --- a/src/mame/ddr/sc2.cpp +++ b/src/mame/ddr/sc2.cpp @@ -185,7 +185,7 @@ static INPUT_PORTS_START( sc2 ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHANGED_MEMBER(DEVICE_SELF, sc2_state, reset_button, 0) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("P") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("P") PORT_CODE(KEYCODE_P) INPUT_PORTS_END diff --git a/src/mame/fidelity/cc1.cpp b/src/mame/fidelity/cc1.cpp index 4217e0f22a1..0faec2b9180 100644 --- a/src/mame/fidelity/cc1.cpp +++ b/src/mame/fidelity/cc1.cpp @@ -243,7 +243,7 @@ static INPUT_PORTS_START( cc10c ) PORT_INCLUDE( cc3 ) PORT_MODIFY("IN.1") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DM / PB") PORT_CODE(KEYCODE_M) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DM / PB") PORT_CODE(KEYCODE_M) PORT_CODE(KEYCODE_P) INPUT_PORTS_END diff --git a/src/mame/fidelity/cc10.cpp b/src/mame/fidelity/cc10.cpp index 3ecfc7759f7..7f25925edd6 100644 --- a/src/mame/fidelity/cc10.cpp +++ b/src/mame/fidelity/cc10.cpp @@ -236,7 +236,7 @@ static INPUT_PORTS_START( ccx ) PORT_START("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("C3") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_C) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("G7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_G) diff --git a/src/mame/fidelity/cc7.cpp b/src/mame/fidelity/cc7.cpp index 969cbc5d3ca..4975e9266c5 100644 --- a/src/mame/fidelity/cc7.cpp +++ b/src/mame/fidelity/cc7.cpp @@ -174,12 +174,12 @@ static INPUT_PORTS_START( bcc ) PORT_START("IN.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("C3") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_C) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("G7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_G) PORT_START("IN.2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CB") PORT_CODE(KEYCODE_SPACE) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CB") PORT_CODE(KEYCODE_X) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("DM") PORT_CODE(KEYCODE_M) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("B2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CODE(KEYCODE_B) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("F6") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(KEYCODE_F) @@ -205,14 +205,14 @@ static INPUT_PORTS_START( bkc ) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_START("IN.2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("GM") PORT_CODE(KEYCODE_SPACE) + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("GM") PORT_CODE(KEYCODE_G) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_START("IN.3") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RE") PORT_CODE(KEYCODE_R) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PV") PORT_CODE(KEYCODE_V) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) INPUT_PORTS_END diff --git a/src/mame/fidelity/vcc.cpp b/src/mame/fidelity/vcc.cpp index 9606db35144..7d24b5ca225 100644 --- a/src/mame/fidelity/vcc.cpp +++ b/src/mame/fidelity/vcc.cpp @@ -302,7 +302,7 @@ static INPUT_PORTS_START( vcc ) PORT_START("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("C3") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_C) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("G7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_G) diff --git a/src/mame/handheld/hh_pps41.cpp b/src/mame/handheld/hh_pps41.cpp index 8b02c1ffe72..b2ef2c96cb2 100644 --- a/src/mame/handheld/hh_pps41.cpp +++ b/src/mame/handheld/hh_pps41.cpp @@ -388,7 +388,7 @@ static INPUT_PORTS_START( ftri1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Swing / S2 V") PORT_START("RESET") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CHANGED_MEMBER(DEVICE_SELF, ftri1_state, reset_button, 0) PORT_CODE(KEYCODE_F1) PORT_NAME("Game Reset") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_POWER_ON ) PORT_CHANGED_MEMBER(DEVICE_SELF, ftri1_state, reset_button, 0) PORT_NAME("Game Reset") INPUT_PORTS_END // config @@ -800,7 +800,7 @@ static INPUT_PORTS_START( memoquiz ) PORT_START("IN.3") // DIO3 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("?") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("PE") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("PE") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("CD") PORT_START("IN.4") @@ -1753,7 +1753,7 @@ static INPUT_PORTS_START( rdqa ) PORT_START("IN.3") // DIO3 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("Right") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("Wrong") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Pass") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("Pass") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Clear") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") diff --git a/src/mame/handheld/hh_tms1k.cpp b/src/mame/handheld/hh_tms1k.cpp index 2976a881ce4..e15073449da 100644 --- a/src/mame/handheld/hh_tms1k.cpp +++ b/src/mame/handheld/hh_tms1k.cpp @@ -1596,7 +1596,7 @@ static INPUT_PORTS_START( palmf31 ) PORT_START("IN.5") // R5 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_I) PORT_NAME(u8"π") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME(u8"π") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME(u8"x²") PORT_START("IN.6") // R6 @@ -2226,7 +2226,7 @@ u8 zodiac_state::read_k() // inputs -/* The physical button layout and labels are like this: +/* physical button layout and labels are like this: [P] [A] [ 1 ] [ 2 ] [ 3 ] @@ -2236,45 +2236,38 @@ u8 zodiac_state::read_k() [.__.__.__.] OFF H P A - -Despite that this layout features a typical digital keypad and distances -the letter buttons from it, the 8-character encoding for date input uses -letters and digits in combination. This fact and the use of the P key are -why the digit buttons are mapped here as keyboard inputs rather than as a -keypad. - */ static INPUT_PORTS_START( zodiac ) PORT_START("IN.0") // R0 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR('3') - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('2') - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1') - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('0') + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") PORT_START("IN.1") // R1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7') - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6') - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR('5') - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR('4') + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") PORT_START("IN.2") // R2 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR('9') - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('8') + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("D") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("A") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") PORT_START("IN.3") // R3 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("P") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_L) PORT_NAME("L") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("J") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("E") PORT_START("IN.4") // R4 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") PORT_CHAR(13) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("Clear") PORT_CHAR(8) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("Clear") PORT_START("IN.5") // R8 PORT_CONFNAME( 0x03, 0x01, "Mode") @@ -7818,7 +7811,7 @@ static INPUT_PORTS_START( starwbc ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_NAME("Basic Game") PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_NAME("Intermediate Game") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_NAME("Advanced Game") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_NAME("Player Number") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("Player Number") PORT_START("IN.1") // R1 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_NAME("Start Turn") @@ -10271,7 +10264,7 @@ static INPUT_PORTS_START( cnsector ) PORT_START("IN.2") // O2 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Recall") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("Evasive Sub") // expert button + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Evasive Sub") // expert button PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Fire") @@ -10279,7 +10272,7 @@ static INPUT_PORTS_START( cnsector ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Slower") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_M) PORT_NAME("Sub Finder") // expert button + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("Sub Finder") // expert button PORT_START("IN.4") // O4 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("Move Ship") @@ -14133,10 +14126,10 @@ class lilprofo_state : public hh_tms1k_state void lilprofoc(machine_config &config); protected: - virtual void write_o(u16 data); - virtual void write_o7(u16 data); - virtual void write_r(u32 data); - virtual u8 read_k(); + void write_o(u16 data); + void write_o7(u16 data); + void write_r(u32 data); + u8 read_k(); }; // handlers @@ -14626,10 +14619,10 @@ class dataman_state : public hh_tms1k_state void dataman(machine_config &config); protected: - virtual void update_display(); - virtual void write_o(u16 data); - virtual void write_r(u32 data); - virtual u8 read_k(); + void update_display(); + void write_o(u16 data); + void write_r(u32 data); + u8 read_k(); }; // handlers @@ -14758,21 +14751,9 @@ class mathmarv_state : public dataman_state { } void mathmarv(machine_config &config); - -private: - virtual void write_r(u32 data) override; }; -// handlers - -void mathmarv_state::write_r(u32 data) -{ - // R8: speaker out - m_speaker->level_w(data >> 8 & 1); - - // rest is same as dataman - dataman_state::write_r(data); -} +// handlers: uses the ones in dataman_state // inputs @@ -14797,7 +14778,7 @@ void mathmarv_state::mathmarv(machine_config &config) dataman(config); // basic machine hardware - m_maincpu->write_r().set(FUNC(mathmarv_state::write_r)); + m_maincpu->write_r().append(m_speaker, FUNC(speaker_sound_device::level_w)).bit(8); config.set_default_layout(layout_mathmarv); diff --git a/src/mame/handheld/pensebem.cpp b/src/mame/handheld/pensebem.cpp index ec2c3c229db..849e5e636c1 100644 --- a/src/mame/handheld/pensebem.cpp +++ b/src/mame/handheld/pensebem.cpp @@ -241,23 +241,23 @@ static INPUT_PORTS_START( pensebem2017 ) PORT_START("ROW1") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("1") PORT_CODE(KEYCODE_1) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Adicao") PORT_CODE(KEYCODE_Q) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Subtracao") PORT_CODE(KEYCODE_W) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH_PAD) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("*") PORT_CODE(KEYCODE_ASTERISK) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Adição") PORT_CODE(KEYCODE_Q) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Subtração") PORT_CODE(KEYCODE_W) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"÷") PORT_CODE(KEYCODE_SLASH_PAD) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"×") PORT_CODE(KEYCODE_ASTERISK) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS_PAD) PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("+") PORT_CODE(KEYCODE_PLUS_PAD) PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_START("ROW2") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Multiplicacao") PORT_CODE(KEYCODE_E) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Aritmetica") PORT_CODE(KEYCODE_T) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Divisao") PORT_CODE(KEYCODE_R) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Adivinhe o Número") PORT_CODE(KEYCODE_P) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Número do Meio") PORT_CODE(KEYCODE_O) - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Memória Tons") PORT_CODE(KEYCODE_I) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Siga-me") PORT_CODE(KEYCODE_U) - PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Operacao") PORT_CODE(KEYCODE_Y) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Multiplicação") PORT_CODE(KEYCODE_E) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Aritmética") PORT_CODE(KEYCODE_T) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Divisão") PORT_CODE(KEYCODE_R) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Adivinhe o Número") PORT_CODE(KEYCODE_P) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Número do Meio") PORT_CODE(KEYCODE_O) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Memória Tons") PORT_CODE(KEYCODE_I) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Siga-me") PORT_CODE(KEYCODE_U) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME(u8"Operação") PORT_CODE(KEYCODE_Y) PORT_START("ROW3") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("2") PORT_CODE(KEYCODE_2) diff --git a/src/mame/heathkit/h17_fdc.cpp b/src/mame/heathkit/h17_fdc.cpp new file mode 100644 index 00000000000..f1ac88de5f7 --- /dev/null +++ b/src/mame/heathkit/h17_fdc.cpp @@ -0,0 +1,295 @@ +// license:BSD-3-Clause +// copyright-holders:Mark Garlanger +/*************************************************************************** + + Heathkit H-17 Floppy controller + + This was an option for both the Heathkit H8 and H89 computer systems. + + TODO + - define hard-sectored disk format + - incoming floppy data should drive receive clock of the ami 2350. + +****************************************************************************/ + +#include "emu.h" + +#include "h17_fdc.h" + +// Register setup +#define LOG_REG (1U << 1) +// Control lines +#define LOG_LINES (1U << 2) +// Drive select +#define LOG_DRIVE (1U << 3) +// Function calls +#define LOG_FUNC (1U << 4) + +//#define VERBOSE (0xff) + +#include "logmacro.h" + +#define LOGREG(...) LOGMASKED(LOG_REG, __VA_ARGS__) +#define LOGLINES(...) LOGMASKED(LOG_LINES, __VA_ARGS__) +#define LOGDRIVE(...) LOGMASKED(LOG_DRIVE, __VA_ARGS__) +#define LOGFUNC(...) LOGMASKED(LOG_FUNC, __VA_ARGS__) + +#ifdef _MSC_VER +#define FUNCNAME __func__ +#else +#define FUNCNAME __PRETTY_FUNCTION__ +#endif + + +DEFINE_DEVICE_TYPE(HEATH_H17_FDC, heath_h17_fdc_device, "heath_h17_fdc", "Heath H-17 Hard-sectored Controller"); + + +heath_h17_fdc_device::heath_h17_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock): + device_t(mconfig, HEATH_H17_FDC, tag, owner, 0), + m_floppy_ram_wp(*this), + m_s2350(*this, "s2350"), + m_floppies(*this, "floppy%u", 0U), + m_tx_timer(*this, "tx_timer"), + m_floppy(nullptr) +{ +} + +void heath_h17_fdc_device::write(offs_t reg, u8 val) +{ + LOGFUNC("%s: reg: %d val: 0x%02x\n", FUNCNAME, reg, val); + + switch (reg) + { + case 0: // data port + m_s2350->transmitter_holding_reg_w(val); + break; + case 1: // fill character + m_s2350->transmit_fill_reg_w(val); + break; + case 2: // sync port + m_s2350->receiver_sync_reg_w(val); + break; + case 3: // control port + ctrl_w(val); + break; + } +} + +void heath_h17_fdc_device::set_floppy(floppy_image_device *floppy) +{ + if (m_floppy == floppy) + { + return; + } + + LOGDRIVE("%s: selecting new drive\n", FUNCNAME); + + m_floppy = floppy; + + // set any latched signals + { + m_floppy->ss_w(m_side); + } +} + +void heath_h17_fdc_device::side_select_w(int state) +{ + m_side = BIT(state, 0); + + if (m_floppy) + { + m_floppy->ss_w(m_side); + } +} + +void heath_h17_fdc_device::dir_w(int state) +{ + if (m_floppy) + { + LOGFUNC("%s: step dir: 0x%02x\n", FUNCNAME, state); + + m_floppy->dir_w(state); + } +} + +void heath_h17_fdc_device::step_w(int state) +{ + if (m_floppy) + { + LOGFUNC("%s: step dir: 0x%02x\n", FUNCNAME, state); + + m_floppy->stp_w(state); + } +} + +void heath_h17_fdc_device::set_motor(bool motor_on) +{ + if (m_motor_on == motor_on) + { + return; + } + + m_motor_on = motor_on; + + for (auto &elem : m_floppies) + { + floppy_image_device *floppy = elem->get_device(); + if (floppy) + { + LOGFUNC("%s: motor: %d\n", FUNCNAME, motor_on); + + floppy->mon_w(!motor_on); + } + } +} + +void heath_h17_fdc_device::ctrl_w(u8 val) +{ + m_write_gate = bool(BIT(val, CTRL_WRITE_GATE)); + + set_motor(bool(BIT(val, CTRL_MOTOR_ON))); + + if (BIT(val, CTRL_DRIVE_SELECT_0)) + { + LOGFUNC("%s: set drive 0\n", FUNCNAME); + + set_floppy(m_floppies[0]->get_device()); + } + else if (BIT(val, CTRL_DRIVE_SELECT_1)) + { + LOGFUNC("%s: set drive 1\n", FUNCNAME); + + set_floppy(m_floppies[1]->get_device()); + } + else if (BIT(val, CTRL_DRIVE_SELECT_2)) + { + LOGFUNC("%s: set drive 2\n", FUNCNAME); + + set_floppy(m_floppies[2]->get_device()); + } + else + { + LOGFUNC("%s: set drive none\n", FUNCNAME); + + set_floppy(nullptr); + } + + dir_w(!BIT(val, CTRL_DIRECTION)); + + step_w(!BIT(val, CTRL_STEP_COMMAND)); + + m_floppy_ram_wp(BIT(val, CTRL_WRITE_ENABLE_RAM)); +} + +u8 heath_h17_fdc_device::read(offs_t reg) +{ + // default return for the h89 + u8 val = 0xff; + + switch (reg) + { + case 0: // data port + val = m_s2350->receiver_output_reg_r(); + break; + case 1: // status port + val = m_s2350->status_word_r(); + break; + case 2: // sync port + val = m_s2350->receiver_sync_search(); + break; + case 3: // floppy status port + val = floppy_status_r(); + break; + } + + LOGREG("%s: reg: %d val: 0x%02x\n", FUNCNAME, reg, val); + + return val; +} + +u8 heath_h17_fdc_device::floppy_status_r() +{ + u8 val = 0; + + // statuses from the floppy drive + if (m_floppy) + { + // index/sector hole + val |= m_floppy->idx_r() ? 0x00 : 0x01; + + // track 0 + val |= m_floppy->trk00_r() ? 0x00 : 0x02; + + // disk is write-protected + val |= m_floppy->wpt_r() ? 0x00 : 0x04; + } + else + { + LOGREG("%s: no drive selected\n", FUNCNAME); + } + + // status from USRT + val |= m_sync_char_received ? 0x08 : 0x00; + + LOGFUNC("%s: val: 0x%02x\n", FUNCNAME, val); + + return val; +} + +void heath_h17_fdc_device::device_start() +{ + save_item(NAME(m_motor_on)); + save_item(NAME(m_write_gate)); + save_item(NAME(m_sync_char_received)); + save_item(NAME(m_step_direction)); + save_item(NAME(m_side)); +} + +void heath_h17_fdc_device::device_reset() +{ + LOGFUNC("%s\n", FUNCNAME); + + m_motor_on = false; + m_write_gate = false; + m_sync_char_received = false; + + m_tx_timer->adjust(attotime::from_hz(USRT_TX_CLOCK), 0, attotime::from_hz(USRT_TX_CLOCK)); +} + +static void h17_floppies(device_slot_interface &device) +{ + // H-17-1 + device.option_add("ssdd", FLOPPY_525_SSDD); + + // Future plans - test and verify higher capacity drives with LLC's BIOS-80 for CP/M and an HUG's enhanced HDOS driver + // - FLOPPY_525_SSQD + // - FLOPPY_525_DD + // - FLOPPY_525_QD (H-17-4) +} + +TIMER_DEVICE_CALLBACK_MEMBER(heath_h17_fdc_device::tx_timer_cb) +{ + m_s2350->tcp_w(); +} + +void heath_h17_fdc_device::device_add_mconfig(machine_config &config) +{ + S2350(config, m_s2350, 0); + m_s2350->sync_character_received_cb().set(FUNC(heath_h17_fdc_device::sync_character_received)); + + for (int i = 0; i < MAX_FLOPPY_DRIVES; i++) + { + // TODO -> add (and define) heath hard-sectored floppy formats. + FLOPPY_CONNECTOR(config, m_floppies[i], h17_floppies, "ssdd", floppy_image_device::default_fm_floppy_formats); + m_floppies[i]->enable_sound(true); + } + + TIMER(config, m_tx_timer).configure_generic(FUNC(heath_h17_fdc_device::tx_timer_cb)); +} + +void heath_h17_fdc_device::sync_character_received(int state) +{ + LOGFUNC("%s: state: %d\n", FUNCNAME, state); + + m_sync_char_received = bool(!BIT(state, 0)); +} diff --git a/src/mame/heathkit/h17_fdc.h b/src/mame/heathkit/h17_fdc.h new file mode 100644 index 00000000000..75dd4460e93 --- /dev/null +++ b/src/mame/heathkit/h17_fdc.h @@ -0,0 +1,90 @@ +// license:BSD-3-Clause +// copyright-holders:Mark Garlanger +/*************************************************************************** + + Heathkit H-17 Floppy Disk Controller + + + Model number: H-88-1 + + TODO + - Mame core must support hard-sectored disk images. + - used floppy clock bits to clock USRT received clock. + - Add support for a heath hard-sectored disk support (h17disk). + +****************************************************************************/ + +#ifndef MAME_HEATHKIT_H17_FDC_H +#define MAME_HEATHKIT_H17_FDC_H + +#pragma once + +#include "imagedev/floppy.h" +#include "machine/s2350.h" + + +class heath_h17_fdc_device : public device_t +{ +public: + heath_h17_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + + auto floppy_ram_wp_cb() { return m_floppy_ram_wp.bind(); } + + void write(offs_t reg, u8 val); + u8 read(offs_t reg); + + void side_select_w(int state); + +protected: + static constexpr u8 MAX_FLOPPY_DRIVES = 3; + + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override; + + void ctrl_w(u8 val); + u8 floppy_status_r(); + + void set_floppy(floppy_image_device *floppy); + void step_w(int state); + void dir_w(int state); + void set_motor(bool motor_on); + + void sync_character_received(int state); + + TIMER_DEVICE_CALLBACK_MEMBER(tx_timer_cb); + + devcb_write_line m_floppy_ram_wp; + + required_device m_s2350; + required_device_array m_floppies; + required_device m_tx_timer; + + bool m_motor_on; + bool m_write_gate; + bool m_sync_char_received; + u8 m_step_direction; + u8 m_side; + + floppy_image_device *m_floppy; + + /// write bit control port + static constexpr u8 CTRL_WRITE_GATE = 0; + static constexpr u8 CTRL_DRIVE_SELECT_0 = 1; + static constexpr u8 CTRL_DRIVE_SELECT_1 = 2; + static constexpr u8 CTRL_DRIVE_SELECT_2 = 3; + static constexpr u8 CTRL_MOTOR_ON = 4; // Controls all the drives + static constexpr u8 CTRL_DIRECTION = 5; // (0 = out) + static constexpr u8 CTRL_STEP_COMMAND = 6; // (Active high) + static constexpr u8 CTRL_WRITE_ENABLE_RAM = 7; // 0 - write protected + + // USRT clock + static constexpr XTAL USRT_BASE_CLOCK = XTAL(12'288'000) / 6 / 16; + static constexpr u32 USRT_TX_CLOCK = USRT_BASE_CLOCK.value(); +}; + + +DECLARE_DEVICE_TYPE(HEATH_H17_FDC, heath_h17_fdc_device) + + +#endif // MAME_HEATHKIT_H17_FDC_H diff --git a/src/mame/heathkit/h19.cpp b/src/mame/heathkit/h19.cpp index ed35cd43a40..aeb8a799027 100644 --- a/src/mame/heathkit/h19.cpp +++ b/src/mame/heathkit/h19.cpp @@ -14,6 +14,9 @@ #include "tlb.h" #include "bus/rs232/rs232.h" +#include "h19.lh" + + namespace { class h19_state : public driver_device @@ -45,6 +48,8 @@ static void tlb_options(device_slot_interface &device) void h19_state::h19(machine_config &config) { + config.set_default_layout(layout_h19); + HEATH_TLB_CONNECTOR(config, m_tlbc, tlb_options, "heath"); m_tlbc->serial_data_callback().set("dte", FUNC(rs232_port_device::write_txd)); m_tlbc->dtr_callback().set("dte", FUNC(rs232_port_device::write_dtr)); diff --git a/src/mame/heathkit/h89.cpp b/src/mame/heathkit/h89.cpp index 91a2757f0b5..7ed6861ee2a 100644 --- a/src/mame/heathkit/h89.cpp +++ b/src/mame/heathkit/h89.cpp @@ -56,6 +56,9 @@ #include "softlist_dev.h" +#include "h89.lh" + + // Single Step #define LOG_SS (1U << 1) @@ -834,6 +837,8 @@ static void intr_ctrl_options(device_slot_interface &device) void h89_base_state::h89_base(machine_config &config) { + config.set_default_layout(layout_h89); + // basic machine hardware Z80(config, m_maincpu, H89_CLOCK); m_maincpu->set_m1_map(&h89_base_state::map_fetch); diff --git a/src/mame/heathkit/tlb.cpp b/src/mame/heathkit/tlb.cpp index 363c5d043b3..bdf7eee926d 100644 --- a/src/mame/heathkit/tlb.cpp +++ b/src/mame/heathkit/tlb.cpp @@ -1074,7 +1074,7 @@ void heath_tlb_device::device_add_mconfig(machine_config &config) // MC 6845 uses a character clock, divide the DOT clock by 8. MC6845(config, m_crtc, BASE_DOT_CLOCK / 8); m_crtc->set_screen("screen"); - m_crtc->set_show_border_area(true); + m_crtc->set_show_border_area(false); m_crtc->set_char_width(8); m_crtc->set_update_row_callback(FUNC(heath_tlb_device::crtc_update_row)); // frame pulse diff --git a/src/mame/hegenerglaser/academy.cpp b/src/mame/hegenerglaser/academy.cpp index 4747486222e..6d92ab6537e 100644 --- a/src/mame/hegenerglaser/academy.cpp +++ b/src/mame/hegenerglaser/academy.cpp @@ -114,7 +114,7 @@ static INPUT_PORTS_START( academy ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("TRAIN") PORT_CODE(KEYCODE_T) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("FCT") PORT_CODE(KEYCODE_F) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine for NEW GAME diff --git a/src/mame/hegenerglaser/amsterdam.cpp b/src/mame/hegenerglaser/amsterdam.cpp index 740ec49e5f1..e097eae67d8 100644 --- a/src/mame/hegenerglaser/amsterdam.cpp +++ b/src/mame/hegenerglaser/amsterdam.cpp @@ -147,7 +147,7 @@ void amsterdam_state::dallas32_mem(address_map &map) static INPUT_PORTS_START( amsterdam ) PORT_START("KEY.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) diff --git a/src/mame/hegenerglaser/brikett.cpp b/src/mame/hegenerglaser/brikett.cpp index f2de6825cd7..2f03ba464c8 100644 --- a/src/mame/hegenerglaser/brikett.cpp +++ b/src/mame/hegenerglaser/brikett.cpp @@ -409,7 +409,7 @@ static INPUT_PORTS_START( mephisto3 ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("INFO") PORT_MODIFY("IN.2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("POS") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("POS") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CODE(KEYCODE_LEFT) PORT_NAME("Left / Black / 9") PORT_MODIFY("IN.3") diff --git a/src/mame/hegenerglaser/europa.cpp b/src/mame/hegenerglaser/europa.cpp index 5fd289f7328..f6b904ec22f 100644 --- a/src/mame/hegenerglaser/europa.cpp +++ b/src/mame/hegenerglaser/europa.cpp @@ -144,7 +144,7 @@ void europa_state::board_w(u8 data) static INPUT_PORTS_START( europa ) PORT_START("IN.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("PLAY") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("POS") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("POS") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("MEM") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("ENT") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("White / Black") diff --git a/src/mame/hegenerglaser/glasgow.cpp b/src/mame/hegenerglaser/glasgow.cpp index ae539b9f576..ea9d2e4c886 100644 --- a/src/mame/hegenerglaser/glasgow.cpp +++ b/src/mame/hegenerglaser/glasgow.cpp @@ -150,7 +150,7 @@ static INPUT_PORTS_START( glasgow ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("E / 5 / Rook") PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Right / White / 0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_RIGHT) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("H / 8") PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("G / 7 / King") PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) diff --git a/src/mame/hegenerglaser/milano.cpp b/src/mame/hegenerglaser/milano.cpp index f5c6df5eb60..b728a728695 100644 --- a/src/mame/hegenerglaser/milano.cpp +++ b/src/mame/hegenerglaser/milano.cpp @@ -147,7 +147,7 @@ static INPUT_PORTS_START( milano ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Training / Pawn") PORT_CODE(KEYCODE_T) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Info / Knight") PORT_CODE(KEYCODE_I) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Memory / Bishop") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Position / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Position / Rook") PORT_CODE(KEYCODE_P) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Level / Queen") PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Function / King") PORT_CODE(KEYCODE_F) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Enter / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine for NEW GAME diff --git a/src/mame/hegenerglaser/mm1.cpp b/src/mame/hegenerglaser/mm1.cpp index 3051677c02c..738bdb312fb 100644 --- a/src/mame/hegenerglaser/mm1.cpp +++ b/src/mame/hegenerglaser/mm1.cpp @@ -193,7 +193,7 @@ static INPUT_PORTS_START( mm1 ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("E / 5 / Rook") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("INFO") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("Right / White / 0") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("POS") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("POS") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("H / 8") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("LEV") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("G / 7 / King") diff --git a/src/mame/hegenerglaser/mm2.cpp b/src/mame/hegenerglaser/mm2.cpp index 0270b17feb4..0a8e626743e 100644 --- a/src/mame/hegenerglaser/mm2.cpp +++ b/src/mame/hegenerglaser/mm2.cpp @@ -267,7 +267,7 @@ void mm2_state::mm4_mem(address_map &map) static INPUT_PORTS_START( mm2 ) PORT_START("KEY.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) @@ -312,7 +312,7 @@ static INPUT_PORTS_START( bup ) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("BEST") PORT_CODE(KEYCODE_S) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MON") PORT_CODE(KEYCODE_N) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) INPUT_PORTS_END diff --git a/src/mame/hegenerglaser/modena.cpp b/src/mame/hegenerglaser/modena.cpp index 93363a36a3d..8b0786274e0 100644 --- a/src/mame/hegenerglaser/modena.cpp +++ b/src/mame/hegenerglaser/modena.cpp @@ -154,7 +154,7 @@ static INPUT_PORTS_START( modena ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Book / Pawn") PORT_CODE(KEYCODE_B) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Info / Knight") PORT_CODE(KEYCODE_I) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Memory / Bishop") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Position / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Position / Rook") PORT_CODE(KEYCODE_P) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Level / Queen") PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Function / King") PORT_CODE(KEYCODE_F) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Enter / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine for NEW GAME diff --git a/src/mame/hegenerglaser/mondial.cpp b/src/mame/hegenerglaser/mondial.cpp index 55198810442..709d36a992b 100644 --- a/src/mame/hegenerglaser/mondial.cpp +++ b/src/mame/hegenerglaser/mondial.cpp @@ -148,7 +148,7 @@ static INPUT_PORTS_START( mondial ) PORT_START("KEY.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PLAY") PORT_CODE(KEYCODE_Y) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) diff --git a/src/mame/hegenerglaser/mondial2.cpp b/src/mame/hegenerglaser/mondial2.cpp index 5de2f691c85..b91eab10fcc 100644 --- a/src/mame/hegenerglaser/mondial2.cpp +++ b/src/mame/hegenerglaser/mondial2.cpp @@ -155,7 +155,7 @@ static INPUT_PORTS_START( mondial2 ) PORT_START("KEY.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("PLAY") PORT_CODE(KEYCODE_Y) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) diff --git a/src/mame/hegenerglaser/mondial68k.cpp b/src/mame/hegenerglaser/mondial68k.cpp index e73eb1903bc..fa41e3f5f4b 100644 --- a/src/mame/hegenerglaser/mondial68k.cpp +++ b/src/mame/hegenerglaser/mondial68k.cpp @@ -178,7 +178,7 @@ static INPUT_PORTS_START( mondial68k ) PORT_START("IN.3") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("D / 4 / Bishop") PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("H / 8") PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine ENT/CL for NEW GAME PORT_START("CLICKABLE") // helper for clickable artwork diff --git a/src/mame/hegenerglaser/montec.cpp b/src/mame/hegenerglaser/montec.cpp index 276e084660a..6fbdca465a5 100644 --- a/src/mame/hegenerglaser/montec.cpp +++ b/src/mame/hegenerglaser/montec.cpp @@ -151,7 +151,7 @@ void montec_state::montec_mem(address_map &map) static INPUT_PORTS_START( montec ) PORT_START("KEY.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("BOOK / 9") PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CODE(KEYCODE_B) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / 0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / 0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) diff --git a/src/mame/hegenerglaser/polgar.cpp b/src/mame/hegenerglaser/polgar.cpp index 3719803f0f2..a88e604505c 100644 --- a/src/mame/hegenerglaser/polgar.cpp +++ b/src/mame/hegenerglaser/polgar.cpp @@ -92,7 +92,7 @@ static INPUT_PORTS_START( polgar ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("TRN / Pawn") PORT_CODE(KEYCODE_T) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO / Knight") PORT_CODE(KEYCODE_I) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM / Bishop") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_P) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV / Queen") PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("FCT / King") PORT_CODE(KEYCODE_F) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine for NEW GAME diff --git a/src/mame/hegenerglaser/risc.cpp b/src/mame/hegenerglaser/risc.cpp index bea66e69035..a79eb322052 100644 --- a/src/mame/hegenerglaser/risc.cpp +++ b/src/mame/hegenerglaser/risc.cpp @@ -128,7 +128,7 @@ static INPUT_PORTS_START( mrisc ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("TRN / Pawn") PORT_CODE(KEYCODE_T) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO / Knight") PORT_CODE(KEYCODE_I) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM / Bishop") PORT_CODE(KEYCODE_M) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_O) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_P) PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV / Queen") PORT_CODE(KEYCODE_L) PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("FCT / King") PORT_CODE(KEYCODE_F) PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_F1) // combine for NEW GAME diff --git a/src/mame/hegenerglaser/roma2.cpp b/src/mame/hegenerglaser/roma2.cpp index 3212782e81c..bab69bcb7fc 100644 --- a/src/mame/hegenerglaser/roma2.cpp +++ b/src/mame/hegenerglaser/roma2.cpp @@ -130,7 +130,7 @@ void roma2_state::main_map(address_map &map) static INPUT_PORTS_START( montreal ) PORT_START("IN.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO") PORT_CODE(KEYCODE_I) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) diff --git a/src/mame/hegenerglaser/smondial.cpp b/src/mame/hegenerglaser/smondial.cpp index c634cfc2c4e..7df1af35955 100644 --- a/src/mame/hegenerglaser/smondial.cpp +++ b/src/mame/hegenerglaser/smondial.cpp @@ -235,7 +235,7 @@ static INPUT_PORTS_START( smondial ) PORT_START("KEY.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Knight / 2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("King / 6") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / 0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_O) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / 0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_P) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) PORT_START("KEY.2") @@ -263,7 +263,7 @@ static INPUT_PORTS_START( smondial2 ) PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_MODIFY("KEY.2") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_P) PORT_MODIFY("KEY.3") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) diff --git a/src/mame/layout/h19.lay b/src/mame/layout/h19.lay new file mode 100644 index 00000000000..df0b8274210 --- /dev/null +++ b/src/mame/layout/h19.lay @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + ]]> + + + + + + + + + + + + + + diff --git a/src/mame/layout/h89.lay b/src/mame/layout/h89.lay new file mode 100644 index 00000000000..0904b630eb1 --- /dev/null +++ b/src/mame/layout/h89.lay @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + ]]> + + + + + + + + + + ]]> + + + + + + + + + + + + + + diff --git a/src/mame/novag/vip.cpp b/src/mame/novag/vip.cpp index b7249fc24df..13820328112 100644 --- a/src/mame/novag/vip.cpp +++ b/src/mame/novag/vip.cpp @@ -235,8 +235,8 @@ void vip_state::svip_map(address_map &map) static INPUT_PORTS_START( vip ) PORT_START("IN.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_SLASH) PORT_NAME("GO") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Restore") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Hint") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Restore") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Hint") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_NAME("C/CB") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Color") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_MINUS) PORT_NAME("Verify/Setup") @@ -277,8 +277,8 @@ static INPUT_PORTS_START( svip ) PORT_INCLUDE( vip ) PORT_MODIFY("IN.0") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Restore / Replay") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Hint / Human") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Restore / Replay") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Hint / Human") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Color / Video") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_COLON) PORT_NAME("Random / Autoclock") diff --git a/src/mame/pc/pcipc_sis.cpp b/src/mame/pc/pcipc_sis.cpp index b5574a5ed7a..1d14b594ae1 100644 --- a/src/mame/pc/pcipc_sis.cpp +++ b/src/mame/pc/pcipc_sis.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese /* - * Sandbox for SiS based x86 PCs, targeting the new PCI model + * Sandbox for SiS based 496/497 x86 PCs, targeting the new PCI model * * Notes: * - sis85c471 doesn't belong here, it's a full on ISA PC/AT @@ -16,11 +16,18 @@ #include "emu.h" #include "bus/isa/isa_cards.h" +#include "bus/rs232/hlemouse.h" +#include "bus/rs232/null_modem.h" +#include "bus/rs232/rs232.h" +#include "bus/rs232/sun_kbd.h" +#include "bus/rs232/terminal.h" #include "cpu/i386/i386.h" #include "machine/pci.h" #include "machine/sis85c496.h" +#include "machine/w83787f.h" #include "video/voodoo_pci.h" + class sis496_state : public driver_device { public: @@ -33,9 +40,12 @@ class sis496_state : public driver_device protected: required_device m_maincpu; + private: void main_io(address_map &map); void main_map(address_map &map); + + static void winbond_superio_config(device_t *device); }; #define PCI_ID_VIDEO "pci:09.0" @@ -66,6 +76,39 @@ void sis496_state::main_io(address_map &map) map.unmap_value_high(); } +static void isa_com(device_slot_interface &device) +{ + device.option_add("microsoft_mouse", MSFT_HLE_SERIAL_MOUSE); + device.option_add("logitech_mouse", LOGITECH_HLE_SERIAL_MOUSE); + device.option_add("wheel_mouse", WHEEL_HLE_SERIAL_MOUSE); + device.option_add("msystems_mouse", MSYSTEMS_HLE_SERIAL_MOUSE); + device.option_add("rotatable_mouse", ROTATABLE_HLE_SERIAL_MOUSE); + device.option_add("terminal", SERIAL_TERMINAL); + device.option_add("null_modem", NULL_MODEM); + device.option_add("sun_kbd", SUN_KBD_ADAPTOR); +} + +static void isa_internal_devices(device_slot_interface &device) +{ + device.option_add("w83787f", W83787F); +} + +void sis496_state::winbond_superio_config(device_t *device) +{ + w83787f_device &fdc = *downcast(device); +// fdc.set_sysopt_pin(1); +// fdc.gp20_reset().set_inputline(":maincpu", INPUT_LINE_RESET); +// fdc.gp25_gatea20().set_inputline(":maincpu", INPUT_LINE_A20); + fdc.irq1().set(":pci:05.0", FUNC(sis85c496_host_device::pc_irq1_w)); + fdc.irq8().set(":pci:05.0", FUNC(sis85c496_host_device::pc_irq8n_w)); + fdc.txd1().set(":serport0", FUNC(rs232_port_device::write_txd)); + fdc.ndtr1().set(":serport0", FUNC(rs232_port_device::write_dtr)); + fdc.nrts1().set(":serport0", FUNC(rs232_port_device::write_rts)); + fdc.txd2().set(":serport1", FUNC(rs232_port_device::write_txd)); + fdc.ndtr2().set(":serport1", FUNC(rs232_port_device::write_dtr)); + fdc.nrts2().set(":serport1", FUNC(rs232_port_device::write_rts)); +} + void sis496_state::sis496(machine_config &config) { // Basic machine hardware @@ -77,10 +120,25 @@ void sis496_state::sis496(machine_config &config) PCI_ROOT(config, "pci", 0); SIS85C496_HOST(config, "pci:05.0", 0, "maincpu", 32*1024*1024); + ISA16_SLOT(config, "board4", 0, "pci:05.0:isabus", isa_internal_devices, "w83787f", true).set_option_machine_config("w83787f", winbond_superio_config); ISA16_SLOT(config, "isa1", 0, "pci:05.0:isabus", pc_isa16_cards, "wd90c31_lr", false); ISA16_SLOT(config, "isa2", 0, "pci:05.0:isabus", pc_isa16_cards, nullptr, false); ISA16_SLOT(config, "isa3", 0, "pci:05.0:isabus", pc_isa16_cards, nullptr, false); + rs232_port_device& serport0(RS232_PORT(config, "serport0", isa_com, "logitech_mouse")); + serport0.rxd_handler().set("board4:w83787f", FUNC(w83787f_device::rxd1_w)); + serport0.dcd_handler().set("board4:w83787f", FUNC(w83787f_device::ndcd1_w)); + serport0.dsr_handler().set("board4:w83787f", FUNC(w83787f_device::ndsr1_w)); + serport0.ri_handler().set("board4:w83787f", FUNC(w83787f_device::nri1_w)); + serport0.cts_handler().set("board4:w83787f", FUNC(w83787f_device::ncts1_w)); + + rs232_port_device &serport1(RS232_PORT(config, "serport1", isa_com, nullptr)); + serport1.rxd_handler().set("board4:w83787f", FUNC(w83787f_device::rxd2_w)); + serport1.dcd_handler().set("board4:w83787f", FUNC(w83787f_device::ndcd2_w)); + serport1.dsr_handler().set("board4:w83787f", FUNC(w83787f_device::ndsr2_w)); + serport1.ri_handler().set("board4:w83787f", FUNC(w83787f_device::nri2_w)); + serport1.cts_handler().set("board4:w83787f", FUNC(w83787f_device::ncts2_w)); + // TODO: 9-10-11-12 for PCI_SLOT (according to BIOS) } @@ -91,6 +149,7 @@ void sis496_voodoo1_state::sis496_voodoo1(machine_config &config) VOODOO_1_PCI(config, m_voodoo, 0, m_maincpu, m_screen); m_voodoo->set_fbmem(2); m_voodoo->set_tmumem(4, 0); + // TODO: games are very annoyed with Direct3D 5 init/teardown fns around this. m_voodoo->set_status_cycles(1000); // TODO: wrong, needs VGA passthru @@ -105,14 +164,23 @@ void sis496_voodoo1_state::sis496_voodoo1(machine_config &config) // Funworld BIOS is temporary until we rewrite funworld/photoply.cpp ROM_START( sis85c496 ) ROM_REGION32_LE(0x20000, "pci:05.0", 0) - ROM_SYSTEM_BIOS(0, "funworld", "Award 486e BIOS with W83787") + ROM_SYSTEM_BIOS(0, "funworld", "Award 486e BIOS with W83787 (photoply)") // Photoplay BIOS + // Lucky Star LS-486EF REV:B ROMX_LOAD("funworld_award_486e_w83787.bin", 0x000000, 0x20000, BAD_DUMP CRC(af7ff1d4) SHA1(72eeecf798a03817ce7ba4d65cd4128ed3ef7e68), ROM_BIOS(0) ) // 486E 96/7/19 W83787 PLUG & PLAY BIOS, AT29C010A + // MegaTouch XL BIOSes + // 09/11/96-SiS-496-SMC665-2A4IBU41C-00 + ROM_SYSTEM_BIOS(1, "merit", "Award 486e BIOS Telco (mtouchxl)") + ROMX_LOAD( "094572516 bios - 486.bin", 0x000000, 0x020000, CRC(1c0b3ba0) SHA1(ff86dd6e476405e716ac7a4de4a216d2d2b49f15), ROM_BIOS(1) ) + // AMI BIOS, Jetway branded MB? + // 40-040B-001276-00101111-040493-OP495SLC-0 + //ROMX_LOAD("prom.mb", 0x10000, 0x10000, BAD_DUMP CRC(e44bfd3c) SHA1(c07ec94e11efa30e001f39560010112f73cc0016) ) + // Chipset: SiS 85C496/85C497 - CPU: Socket 3 - RAM: 2xSIMM72, Cache - Keyboard-BIOS: JETkey V5.0 // ISA16: 3, PCI: 3 - BIOS: SST29EE010 (128k) AMI 486DX ISA BIOS AA2558003 - screen remains blank - ROM_SYSTEM_BIOS(1, "4sim002", "AMI ISA BIOS (unknown)") - ROMX_LOAD( "4sim002.bin", 0x00000, 0x20000, BAD_DUMP CRC(ea898f85) SHA1(7236cd2fc985985f21979e4808cb708be8d0445f), ROM_BIOS(1) ) + ROM_SYSTEM_BIOS(2, "4sim002", "AMI ISA unknown BIOS") + ROMX_LOAD( "4sim002.bin", 0x00000, 0x20000, BAD_DUMP CRC(ea898f85) SHA1(7236cd2fc985985f21979e4808cb708be8d0445f), ROM_BIOS(2) ) ROM_END // A-Trend ATC-1425A - Chipset: SiS 85C496, 85C497 - RAM: 4xSIMM72, Cache: 4x32pin + TAG - ISA16: 4, PCI: 3 diff --git a/src/mame/saitek/chesstrv.cpp b/src/mame/saitek/chesstrv.cpp index ebbd883449d..c5c27363dd3 100644 --- a/src/mame/saitek/chesstrv.cpp +++ b/src/mame/saitek/chesstrv.cpp @@ -212,8 +212,8 @@ static INPUT_PORTS_START( chesstrv ) PORT_START("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("LV / CS") // level/clear square - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("FP") // find position - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("EP") // enter position + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("FP") // find position + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("EP") // enter position PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("CB") // clear board PORT_START("IN.3") @@ -233,8 +233,8 @@ static INPUT_PORTS_START( chesstrvi ) PORT_MODIFY("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level / CS") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("Find Position") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Enter Position") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Find Position") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Enter Position") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") PORT_MODIFY("IN.3") diff --git a/src/mame/saitek/companion2.cpp b/src/mame/saitek/companion2.cpp index 03889c6605a..9dcb5f61448 100644 --- a/src/mame/saitek/companion2.cpp +++ b/src/mame/saitek/companion2.cpp @@ -301,7 +301,7 @@ static INPUT_PORTS_START( expchess ) PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Bishop") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level / Sound") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play / PVP") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play / PVP") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Knight") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Pawn") PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Queen") @@ -319,7 +319,7 @@ static INPUT_PORTS_START( compan2 ) PORT_MODIFY("IN.1") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Enter Position") PORT_MODIFY("IN.2") diff --git a/src/mame/saitek/ecbackg.cpp b/src/mame/saitek/ecbackg.cpp index 074e8b2f720..047c8f32a68 100644 --- a/src/mame/saitek/ecbackg.cpp +++ b/src/mame/saitek/ecbackg.cpp @@ -446,7 +446,7 @@ static INPUT_PORTS_START( ecbackg ) PORT_START("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_A) PORT_NAME("Double / Accept") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Reject") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Game Option") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back") diff --git a/src/mame/saitek/gk2000.cpp b/src/mame/saitek/gk2000.cpp index 92916db5120..e57ccbe6152 100644 --- a/src/mame/saitek/gk2000.cpp +++ b/src/mame/saitek/gk2000.cpp @@ -87,6 +87,8 @@ class gk2000_state : public driver_device template void lcd_segs_w(u8 data); void lcd_com_w(u8 data); + void standby(int state); + void p2_w(u8 data); u8 p4_r(); void p5_w(offs_t offset, u8 data, u8 mem_mask); @@ -104,8 +106,8 @@ void gk2000_state::machine_start() INPUT_CHANGED_MEMBER(gk2000_state::change_cpu_freq) { - // only 20MHz and 14MHz versions are known to exist, but the software supports others (-1 is invalid) - static const int xm[9] = { 8, 20, 24, 28, 32, -1, -1, -1, 14 }; // XTAL in MHz + // only 20MHz and 14MHz versions are known to exist, but the software supports others + static const int xm[9] = { 8, 20, 24, 28, 32, -1, -1, -1, 14 }; // XTAL in MHz (-1 is invalid) int mhz = xm[(count_leading_zeros_32(bitswap<8>(newval,0,1,2,3,4,5,6,7)) - 24) % 9]; if (mhz > 0) @@ -118,6 +120,24 @@ INPUT_CHANGED_MEMBER(gk2000_state::change_cpu_freq) I/O *******************************************************************************/ +// power + +void gk2000_state::standby(int state) +{ + // clear display + if (state) + { + m_lcd_pwm->clear(); + m_led_pwm->clear(); + } +} + +INPUT_CHANGED_MEMBER(gk2000_state::go_button) +{ + m_maincpu->set_input_line(INPUT_LINE_IRQ0, newval ? ASSERT_LINE : CLEAR_LINE); +} + + // LCD void gk2000_state::lcd_pwm_w(offs_t offset, u8 data) @@ -155,11 +175,6 @@ void gk2000_state::lcd_com_w(u8 data) // misc -INPUT_CHANGED_MEMBER(gk2000_state::go_button) -{ - m_maincpu->set_input_line(INPUT_LINE_IRQ0, newval ? ASSERT_LINE : CLEAR_LINE); -} - void gk2000_state::p2_w(u8 data) { // P20-P27: input mux (chessboard), led data @@ -219,7 +234,7 @@ void gk2000_state::main_map(address_map &map) static INPUT_PORTS_START( gk2000 ) PORT_START("IN.0") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Position") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Position") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("Option") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Info") @@ -260,6 +275,7 @@ void gk2000_state::gk2000(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &gk2000_state::main_map); m_maincpu->nvram_enable_backup(true); m_maincpu->standby_cb().set(m_maincpu, FUNC(h8325_device::nvram_set_battery)); + m_maincpu->standby_cb().append(FUNC(gk2000_state::standby)); m_maincpu->write_port1().set(FUNC(gk2000_state::lcd_segs_w<0>)); m_maincpu->write_port2().set(FUNC(gk2000_state::p2_w)); m_maincpu->write_port3().set(FUNC(gk2000_state::lcd_segs_w<1>)); diff --git a/src/mame/saitek/intchess.cpp b/src/mame/saitek/intchess.cpp index 979111600d8..15c5be97055 100644 --- a/src/mame/saitek/intchess.cpp +++ b/src/mame/saitek/intchess.cpp @@ -253,7 +253,7 @@ static INPUT_PORTS_START( intchess ) // see comments for German version labels PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("D 4 / Rook") PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("H 8 / Black") PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("Record") // Speichern - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Place") // Setzen + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Place") // Setzen PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Step") // Vor PORT_START("RESET") diff --git a/src/mame/saitek/mark5.cpp b/src/mame/saitek/mark5.cpp index 510a36b99c4..9bd78ee7670 100644 --- a/src/mame/saitek/mark5.cpp +++ b/src/mame/saitek/mark5.cpp @@ -318,11 +318,11 @@ void mark5_state::mark6_map(address_map &map) static INPUT_PORTS_START( mark5 ) PORT_START("IN.0") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Enter Position") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Enter Position") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("Draw") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Peripheral") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Next Simult") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Next Simult") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Swap") PORT_START("IN.1") diff --git a/src/mame/saitek/minichess.cpp b/src/mame/saitek/minichess.cpp index 3018503cecf..404ac6ce35a 100644 --- a/src/mame/saitek/minichess.cpp +++ b/src/mame/saitek/minichess.cpp @@ -161,7 +161,7 @@ static INPUT_PORTS_START( smchess ) PORT_START("IN.2") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("G 7 / White") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("H 8 / Black") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME("FP") // find position + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("FP") // find position PORT_START("IN.3") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") diff --git a/src/mame/saitek/prisma.cpp b/src/mame/saitek/prisma.cpp index ede54634a5d..332426daa80 100644 --- a/src/mame/saitek/prisma.cpp +++ b/src/mame/saitek/prisma.cpp @@ -76,7 +76,7 @@ class prisma_state : public driver_device u8 m_lcd_data = 0; u8 m_lcd_address = 0; - u8 m_lcd_write = 0; + u8 m_lcd_control = 0; u8 m_inp_mux = 0; u8 m_led_select = 0; u8 m_led_direct = 0; @@ -92,6 +92,7 @@ class prisma_state : public driver_device void p1_w(u8 data); void p2_w(u8 data); + u8 p3_r(); void p3_w(u8 data); void p4_w(u8 data); u8 p5_r(); @@ -107,7 +108,7 @@ void prisma_state::machine_start() // register for savestates save_item(NAME(m_lcd_data)); save_item(NAME(m_lcd_address)); - save_item(NAME(m_lcd_write)); + save_item(NAME(m_lcd_control)); save_item(NAME(m_inp_mux)); save_item(NAME(m_led_select)); save_item(NAME(m_led_direct)); @@ -117,7 +118,7 @@ INPUT_CHANGED_MEMBER(prisma_state::change_cpu_freq) { // 12MHz and 24MHz versions don't exist, but the software supports it static const XTAL freq[4] = { 16_MHz_XTAL, 20_MHz_XTAL, 24_MHz_XTAL, 12_MHz_XTAL }; - m_maincpu->set_unscaled_clock(freq[bitswap<2>(newval,7,0)] / 2); + m_maincpu->set_unscaled_clock(freq[bitswap<2>(newval,7,0)]); } @@ -179,8 +180,7 @@ void prisma_state::p1_w(u8 data) // P14: speaker out m_dac->level_w(BIT(data, 4)); - // P16: ext power - // (no need to emulate it) + // P16: ext power (no need to emulate it) } void prisma_state::p2_w(u8 data) @@ -190,6 +190,13 @@ void prisma_state::p2_w(u8 data) update_leds(); } +u8 prisma_state::p3_r() +{ + // P30-P37: LCD data (never reads here) + logerror("read from LCD\n"); + return 0xff; +} + void prisma_state::p3_w(u8 data) { // P30-P37: LCD data @@ -201,16 +208,16 @@ void prisma_state::p4_w(u8 data) // P40: LCD CS // P41: LCD RD // P42: LCD WR - if (~data & m_lcd_write && ~data & 1) + if (~data & m_lcd_control & 4 && ~data & 1) m_lcd->write(m_lcd_address, m_lcd_data); - m_lcd_write = data & 4; + m_lcd_control = data; } u8 prisma_state::p5_r() { u8 data = 0; - // P50,P52: read buttons + // P50-P52: read buttons for (int i = 0; i < 3; i++) if (m_inp_mux & m_inputs[i]->read()) data |= 1 << i; @@ -321,6 +328,7 @@ void prisma_state::prisma(machine_config &config) m_maincpu->standby_cb().append(FUNC(prisma_state::standby)); m_maincpu->write_port1().set(FUNC(prisma_state::p1_w)); m_maincpu->write_port2().set(FUNC(prisma_state::p2_w)); + m_maincpu->read_port3().set(FUNC(prisma_state::p3_r)); m_maincpu->write_port3().set(FUNC(prisma_state::p3_w)); m_maincpu->read_port4().set_constant(0xff); m_maincpu->write_port4().set(FUNC(prisma_state::p4_w)); diff --git a/src/mame/saitek/risc2500.cpp b/src/mame/saitek/risc2500.cpp index 441c8115dcf..13bbe52792f 100644 --- a/src/mame/saitek/risc2500.cpp +++ b/src/mame/saitek/risc2500.cpp @@ -386,10 +386,10 @@ static INPUT_PORTS_START( risc2500 ) PORT_START("IN.5") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("King") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Play") PORT_CODE(KEYCODE_L) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Play") PORT_CODE(KEYCODE_P) PORT_START("IN.6") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("New Game") PORT_CODE(KEYCODE_N) PORT_START("IN.7") diff --git a/src/mame/saitek/turbo16k.cpp b/src/mame/saitek/turbo16k.cpp index 3e3d0e9a908..d2fd77444cd 100644 --- a/src/mame/saitek/turbo16k.cpp +++ b/src/mame/saitek/turbo16k.cpp @@ -328,7 +328,7 @@ static INPUT_PORTS_START( turbo16k ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("New Game") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Take Back") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Set Up") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Queen") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Multi Move") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME("Level") @@ -366,7 +366,7 @@ static INPUT_PORTS_START( conquist ) PORT_MODIFY("IN.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Non Auto") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Play") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME("Play") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("King") PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Pawn") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Bishop") diff --git a/src/mame/seta/seta2.cpp b/src/mame/seta/seta2.cpp index a4e970a46d5..b409a195a2c 100644 --- a/src/mame/seta/seta2.cpp +++ b/src/mame/seta/seta2.cpp @@ -113,9 +113,9 @@ funcube series: void seta2_state::machine_start() { - if (memregion( "x1snd" ) != nullptr) + if (memregion("x1snd") != nullptr) { - uint32_t const max = memregion( "x1snd" )->bytes() / 0x20000; + uint32_t const max = memregion("x1snd")->bytes() / 0x20000; for (int i = 0; i < 8; i++) { if (m_x1_bank[i] != nullptr) @@ -123,7 +123,7 @@ void seta2_state::machine_start() uint32_t ind = 0; while (ind < 256) { - m_x1_bank[i]->configure_entries(ind, max, memregion( "x1snd" )->base(), 0x20000); // TODO : Mirrored? + m_x1_bank[i]->configure_entries(ind, max, memregion("x1snd")->base(), 0x20000); // TODO : Mirrored? ind += max; } } @@ -161,7 +161,7 @@ void seta2_state::grdians_lockout_w(uint8_t data) // initially 0, then either $25 (coin 1) or $2a (coin 2) machine().bookkeeping().coin_counter_w(0,data & 0x01); // or 0x04 machine().bookkeeping().coin_counter_w(1,data & 0x02); // or 0x08 -// popmessage("%04X", data & 0xff); + //popmessage("%04X", data & 0xff); } void seta2_state::grdians_map(address_map &map) @@ -430,7 +430,7 @@ void seta2_state::reelquak_leds_w(offs_t offset, uint16_t data, uint16_t mem_mas m_dispenser->motor_w(BIT(data, 8)); // ticket dispenser } -// popmessage("LED %04X", data); + //popmessage("LED %04X", data); } void seta2_state::reelquak_coin_w(uint8_t data) @@ -439,9 +439,9 @@ void seta2_state::reelquak_coin_w(uint8_t data) machine().bookkeeping().coin_counter_w(1, data & 0x02); // coin in machine().bookkeeping().coin_counter_w(2, data & 0x04); // pay out machine().bookkeeping().coin_counter_w(3, data & 0x08); // key in - // data & 0x10); // Sound IRQ Ack.? 1->0 - // data & 0x20); // Vblank IRQ.? 1 -// popmessage("COIN %04X", data & 0xff); + // data & 0x10); // Sound IRQ Ack.? 1->0 + // data & 0x20); // Vblank IRQ.? 1 + //popmessage("COIN %04X", data & 0xff); } void seta2_state::reelquak_map(address_map &map) @@ -486,10 +486,11 @@ void seta2_state::samshoot_coin_w(uint8_t data) { machine().bookkeeping().coin_counter_w(0, data & 0x10); machine().bookkeeping().coin_counter_w(1, data & 0x20); + // Are these connected? They are set in I/O test machine().bookkeeping().coin_lockout_w(0,~data & 0x40); machine().bookkeeping().coin_lockout_w(1,~data & 0x80); -// popmessage("%04x",data); + //popmessage("%04x",data); } void seta2_state::samshoot_map(address_map &map) @@ -528,35 +529,35 @@ void seta2_state::samshoot_map(address_map &map) void staraudi_state::staraudi_debug_outputs() { -// popmessage("L1: %04X L2: %04X CAM: %04X", m_lamps1, m_lamps2, m_cam); + //popmessage("L1: %04X L2: %04X CAM: %04X", m_lamps1, m_lamps2, m_cam); } void staraudi_state::lamps1_w(offs_t offset, uint8_t data, uint8_t mem_mask) { COMBINE_DATA(&m_lamps1); - m_leds[0] = BIT(data, 0); // Lamp 1 | - m_leds[1] = BIT(data, 1); // Lamp 2 |- Camera Lamps - m_leds[2] = BIT(data, 2); // Lamp 3 | - // data & 0x08 ); // Degauss + m_leds[0] = BIT(data, 0); // Lamp 1 | + m_leds[1] = BIT(data, 1); // Lamp 2 |- Camera Lamps + m_leds[2] = BIT(data, 2); // Lamp 3 | + // data & 0x08 ); // Degauss staraudi_debug_outputs(); } void staraudi_state::lamps2_w(offs_t offset, uint8_t data, uint8_t mem_mask) { COMBINE_DATA(&m_lamps2); - // data & 0x20 ); // ? Always On - m_leds[3] = BIT(data, 6); // 2P Switch Lamp - m_leds[4] = BIT(data, 7); // 1P Switch Lamp + // data & 0x20 ); // ? Always On + m_leds[3] = BIT(data, 6); // 2P Switch Lamp + m_leds[4] = BIT(data, 7); // 1P Switch Lamp staraudi_debug_outputs(); } void staraudi_state::camera_w(offs_t offset, uint8_t data, uint8_t mem_mask) { COMBINE_DATA(&m_cam); - // data & 0x01 ); // ? Always On - // data & 0x02 ); // ? Print Test - // data & 0x08 ); // Camera On (Test Mode) - // data & 0x20 ); // ? + // data & 0x01 ); // ? Always On + // data & 0x02 ); // ? Print Test + // data & 0x08 ); // Camera On (Test Mode) + // data & 0x20 ); // ? staraudi_debug_outputs(); } @@ -622,7 +623,7 @@ void seta2_state::telpacfl_lamp1_w(uint8_t data) for (int i = 0; i <= 7; i++) m_lamps[i] = BIT(data, i); -// popmessage("LAMP1 %04X", data); + //popmessage("LAMP1 %04X", data); } void seta2_state::telpacfl_lamp2_w(uint8_t data) @@ -630,11 +631,11 @@ void seta2_state::telpacfl_lamp2_w(uint8_t data) m_lamps[8] = BIT(data, 0); // on/off lamp (throughout) m_lamps[9] = BIT(data, 1); // bet lamp m_lamps[10] = BIT(data, 2); // payout lamp - m_dispenser->motor_w( data & 0x08 ); // coin out motor - machine().bookkeeping().coin_counter_w(0, data & 0x10); // coin out counter - // data & 0x20 ); // on credit increase + m_dispenser->motor_w(data & 0x08); // coin out motor + machine().bookkeeping().coin_counter_w(0, data & 0x10); // coin out counter + // data & 0x20 ); // on credit increase -// popmessage("LAMP2 %04X", data); + //popmessage("LAMP2 %04X", data); } void seta2_state::telpacfl_lockout_w(uint8_t data) @@ -644,7 +645,7 @@ void seta2_state::telpacfl_lockout_w(uint8_t data) machine().bookkeeping().coin_lockout_w(1, ~data & 0x08); // 100yen blocker // bits 0x30 ? -// popmessage("LOCK %04X", data); + //popmessage("LOCK %04X", data); } void seta2_state::telpacfl_map(address_map &map) @@ -757,7 +758,8 @@ void funcube_touchscreen_device::device_reset() TIMER_CALLBACK_MEMBER(funcube_touchscreen_device::read_buttons) { uint8_t button_state = m_btn->read(); - if(m_button_state != button_state) { + if (m_button_state != button_state) + { m_button_state = button_state; m_serial[0] = button_state ? 0xfe : 0xfd; m_serial[1] = m_x->read(); @@ -770,7 +772,7 @@ TIMER_CALLBACK_MEMBER(funcube_touchscreen_device::read_buttons) void funcube_touchscreen_device::tra_complete() { - if(m_serial_pos != 4) + if (m_serial_pos != 4) transmit_register_setup(m_serial[m_serial_pos++]); } @@ -780,30 +782,8 @@ void funcube_touchscreen_device::tra_callback() } -// Bus conversion functions: - -// RAM shared with the sub CPU -uint32_t funcube_state::nvram_r(offs_t offset) -{ - uint16_t val = m_nvram[offset]; - return ((val & 0xff00) << 8) | (val & 0x00ff); -} - -void funcube_state::nvram_w(offs_t offset, uint32_t data, uint32_t mem_mask) -{ - if (ACCESSING_BITS_0_7) - { - m_nvram[offset] = (m_nvram[offset] & 0xff00) | (data & 0x000000ff); - } - if (ACCESSING_BITS_16_23) - { - m_nvram[offset] = (m_nvram[offset] & 0x00ff) | ((data & 0x00ff0000) >> 8); - } -} - // Main CPU - uint32_t funcube_state::debug_r() { uint32_t ret = ioport("DEBUG")->read(); @@ -830,7 +810,7 @@ void funcube_state::funcube_map(address_map &map) map(0x00840000, 0x0084ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); // Palette map(0x00860000, 0x0086003f).rw(FUNC(funcube_state::vregs_r), FUNC(funcube_state::vregs_w)); - map(0x00c00000, 0x00c002ff).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w)); + map(0x00c00000, 0x00c002ff).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w)).umask32(0x00ff00ff); map(0xf0000000, 0xf00001ff).rw("maincpu_onboard", FUNC(mcf5206e_peripheral_device::seta2_coldfire_regs_r), FUNC(mcf5206e_peripheral_device::seta2_coldfire_regs_w)); // technically this can be moved with MBAR map(0xffffe000, 0xffffffff).ram(); // SRAM @@ -851,7 +831,7 @@ void funcube_state::funcube2_map(address_map &map) map(0x00840000, 0x0084ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); map(0x00860000, 0x0086003f).rw(FUNC(funcube_state::vregs_r), FUNC(funcube_state::vregs_w)); - map(0x00c00000, 0x00c002ff).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w)); + map(0x00c00000, 0x00c002ff).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w)).umask32(0x00ff00ff); map(0xf0000000, 0xf00001ff).rw("maincpu_onboard", FUNC(mcf5206e_peripheral_device::seta2_coldfire_regs_r), FUNC(mcf5206e_peripheral_device::seta2_coldfire_regs_w)); // technically this can be moved with MBAR map(0xffffe000, 0xffffffff).ram(); // SRAM @@ -862,7 +842,7 @@ void funcube_state::funcube2_map(address_map &map) void funcube_state::funcube_sub_map(address_map &map) { map(0x000000, 0x01ffff).rom(); - map(0x200000, 0x20017f).ram().share("nvram"); + map(0x200000, 0x20017f).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w)).umask16(0xffff); } @@ -875,20 +855,20 @@ void funcube_state::funcube_sub_map(address_map &map) uint16_t funcube_state::coins_r() { uint8_t ret = ioport("SWITCH")->read(); - uint8_t coin_bit0 = 1; // active low + uint8_t coin_bit0 = 1; // active low uint8_t coin_bit1 = 1; - uint8_t hopper_bit = (m_hopper_motor && !(m_screen->frame_number()%20)) ? 1 : 0; + uint8_t hopper_bit = (m_hopper_motor && !(m_screen->frame_number() % 20)) ? 1 : 0; const uint64_t coin_total_cycles = FUNCUBE_SUB_CPU_CLOCK.value() / (1000/10); - if ( m_coin_start_cycles ) + if (m_coin_start_cycles) { uint64_t elapsed = m_sub->total_cycles() - m_coin_start_cycles; - if ( elapsed < coin_total_cycles/2 ) + if (elapsed < coin_total_cycles/2) coin_bit0 = 0; - else if ( elapsed < coin_total_cycles ) + else if (elapsed < coin_total_cycles) coin_bit1 = 0; else m_coin_start_cycles = 0; @@ -904,9 +884,7 @@ uint16_t funcube_state::coins_r() void funcube_state::funcube_debug_outputs() { -#ifdef MAME_DEBUG -// popmessage("LED: %02x OUT: %02x", m_funcube_leds, m_outputs); -#endif + //popmessage("LED: %02x OUT: %02x", m_funcube_leds, m_outputs); } void funcube_state::leds_w(uint16_t data) diff --git a/src/mame/seta/seta2.h b/src/mame/seta/seta2.h index b3d5f9850bc..9ac8fe56bff 100644 --- a/src/mame/seta/seta2.h +++ b/src/mame/seta/seta2.h @@ -35,7 +35,6 @@ class seta2_state : public driver_device m_dispenser(*this, "dispenser"), m_x1_bank(*this, "x1_bank_%u", 1U), - m_nvram(*this, "nvram"), m_spriteram(*this, "spriteram", 0x40000, ENDIANNESS_BIG), m_tileram(*this, "tileram"), m_vregs(*this, "vregs", 0x40, ENDIANNESS_BIG), @@ -127,7 +126,6 @@ class seta2_state : public driver_device optional_device m_dispenser; optional_memory_bank_array<8> m_x1_bank; - optional_shared_ptr m_nvram; memory_share_creator m_spriteram; optional_shared_ptr m_tileram; memory_share_creator m_vregs; @@ -168,6 +166,7 @@ class funcube_state : public seta2_state public: funcube_state(const machine_config &mconfig, device_type type, const char *tag) : seta2_state(mconfig, type, tag) + , m_nvram(*this, "nvram", 0x180, ENDIANNESS_BIG) { } void funcube(machine_config &config); @@ -179,11 +178,14 @@ class funcube_state : public seta2_state void init_funcube2(); private: + memory_share_creator m_nvram; + virtual void machine_start() override; virtual void machine_reset() override; - uint32_t nvram_r(offs_t offset); - void nvram_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); + uint8_t nvram_r(offs_t offset) { return m_nvram[offset]; } + void nvram_w(offs_t offset, uint8_t data) { m_nvram[offset] = data; } + uint32_t debug_r(); uint16_t coins_r(); void leds_w(uint16_t data); diff --git a/src/mame/seta/seta2_v.cpp b/src/mame/seta/seta2_v.cpp index ba167becb3f..7e6ae1e6509 100644 --- a/src/mame/seta/seta2_v.cpp +++ b/src/mame/seta/seta2_v.cpp @@ -565,7 +565,7 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr if (nozoom_fixedpalette_fixedposition) { use_shadow = 0; - // which_gfx = 4 << 8; + //which_gfx = 4 << 8; usedscanline = realscanline; // no zooming? usedxzoom = 0x10000; usedxoffset = 0; @@ -854,7 +854,7 @@ void seta2_state::draw_sprites(bitmap_ind16& bitmap, const rectangle& cliprect) yy &= 0x07ffffff; yy >>= 16; - // printf("line %04x yline requested %04x\n", y, yy); + //printf("line %04x yline requested %04x\n", y, yy); if (yy & 0x400) yy -= 0x800; @@ -899,7 +899,7 @@ uint32_t seta2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, // Black or pen 0? bitmap.fill(m_palette->pen(0), cliprect); - if ( (m_vregs[0x30/2] & 1) == 0 ) // 1 = BLANK SCREEN + if ((m_vregs[0x30/2] & 1) == 0) // 1 = BLANK SCREEN draw_sprites(bitmap, cliprect); return 0; diff --git a/src/mame/seta/srmp2.cpp b/src/mame/seta/srmp2.cpp index b9a4c4f2048..98a517e0029 100644 --- a/src/mame/seta/srmp2.cpp +++ b/src/mame/seta/srmp2.cpp @@ -58,17 +58,166 @@ Known issues : ****************************************************************************/ - #include "emu.h" -#include "srmp2.h" #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "machine/nvram.h" #include "sound/ay8910.h" +#include "sound/msm5205.h" +#include "video/x1_001.h" +#include "emupal.h" #include "screen.h" #include "speaker.h" +namespace { + +class srmp2_state : public driver_device +{ +public: + srmp2_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_spritegen(*this, "spritegen"), + m_msm(*this, "msm"), + m_adpcm_rom(*this, "adpcm"), + m_mainbank(*this, "mainbank"), + m_keys(*this, "KEY%u", 0U), + m_service(*this, "SERVICE") + { } + + void mjyuugi(machine_config &config); + void srmp2(machine_config &config); + void rmgoldyh(machine_config &config); + void srmp3(machine_config &config); + +private: + struct iox_t + { + int reset = 0, ff_event,ff_1 = 0, protcheck[4]{}, protlatch[4]{}; + uint8_t data = 0; + uint8_t mux = 0; + uint8_t ff = 0; + }; + + required_device m_maincpu; + required_device m_spritegen; + required_device m_msm; + required_region_ptr m_adpcm_rom; + optional_memory_bank m_mainbank; + required_ioport_array<8> m_keys; + required_ioport m_service; + + uint8_t m_color_bank = 0; + uint8_t m_gfx_bank = 0; + uint8_t m_adpcm_bank = 0; + int16_t m_adpcm_data = 0; + uint32_t m_adpcm_sptr = 0; + uint32_t m_adpcm_eptr = 0; + iox_t m_iox; + + // common + uint8_t vox_status_r(); + uint8_t iox_mux_r(); + uint8_t iox_status_r(); + void iox_command_w(uint8_t data); + void iox_data_w(uint8_t data); + void adpcm_int(int state); + + // mjuugi + void mjyuugi_flags_w(uint16_t data); + void mjyuugi_adpcm_bank_w(uint16_t data); + uint8_t mjyuugi_irq2_ack_r(address_space &space); + uint8_t mjyuugi_irq4_ack_r(address_space &space); + + // rmgoldyh + void rmgoldyh_rombank_w(uint8_t data); + + // srmp2 + void srmp2_irq2_ack_w(uint8_t data); + void srmp2_irq4_ack_w(uint8_t data); + void srmp2_flags_w(uint16_t data); + void adpcm_code_w(uint8_t data); + + // srmp3 + void srmp3_rombank_w(uint8_t data); + void srmp3_flags_w(uint8_t data); + void srmp3_irq_ack_w(uint8_t data); + + virtual void machine_start() override; + DECLARE_MACHINE_START(srmp2); + void srmp2_palette(palette_device &palette) const; + DECLARE_MACHINE_START(srmp3); + void srmp3_palette(palette_device &palette) const; + DECLARE_MACHINE_START(rmgoldyh); + DECLARE_MACHINE_START(mjyuugi); + + uint32_t screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + X1_001_SPRITE_GFXBANK_CB_MEMBER(srmp3_gfxbank_callback); + + uint8_t iox_key_matrix_calc(uint8_t p_side); + + void mjyuugi_map(address_map &map); + void rmgoldyh_io_map(address_map &map); + void rmgoldyh_map(address_map &map); + void srmp2_map(address_map &map); + void srmp3_io_map(address_map &map); + void srmp3_map(address_map &map); +}; + + +/*************************************************************************** + + Video hardware + +***************************************************************************/ + +void srmp2_state::srmp2_palette(palette_device &palette) const +{ + uint8_t const *const color_prom = memregion("proms")->base(); + for (int i = 0; i < palette.entries(); i++) + { + int const col = (color_prom[i] << 8) + color_prom[i + palette.entries()]; + palette.set_pen_color(i ^ 0x0f, pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0)); + } +} + + +void srmp2_state::srmp3_palette(palette_device &palette) const +{ + uint8_t const *const color_prom = memregion("proms")->base(); + for (int i = 0; i < palette.entries(); i++) + { + int const col = (color_prom[i] << 8) + color_prom[i + palette.entries()]; + palette.set_pen_color(i,pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0)); + } +} + +X1_001_SPRITE_GFXBANK_CB_MEMBER(srmp2_state::srmp3_gfxbank_callback) +{ + return (code & 0x3fff) + ((code & 0x2000) ? (m_gfx_bank<<13) : 0); +} + + +uint32_t srmp2_state::screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0x1ff, cliprect); + + m_spritegen->set_colorbase(m_color_bank<<5); + + m_spritegen->draw_sprites(screen,bitmap,cliprect,0x1000); + return 0; +} + +uint32_t srmp2_state::screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(0x1f0, cliprect); + + m_spritegen->draw_sprites(screen,bitmap,cliprect,0x1000); + return 0; +} + /*************************************************************************** @@ -1586,6 +1735,7 @@ ROM_START( ponchina ) ROM_LOAD( "um2_1_10.u63", 0x080000, 0x080000, CRC(53e643e9) SHA1(3b221217e8f846ae96a9a47149037cea19d97549) ) ROM_END +} // anonymous namespace GAME( 1987, srmp1, 0, srmp2, srmp2, srmp2_state, empty_init, ROT0, "Seta", "Super Real Mahjong Part 1 (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seta/srmp2.h b/src/mame/seta/srmp2.h deleted file mode 100644 index 0a551b916a5..00000000000 --- a/src/mame/seta/srmp2.h +++ /dev/null @@ -1,106 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Yochizo, Takahiro Nogi -#ifndef MAME_SETA_SRMP2_H -#define MAME_SETA_SRMP2_H - -#pragma once - -#include "sound/msm5205.h" -#include "video/x1_001.h" -#include "emupal.h" - -class srmp2_state : public driver_device -{ -public: - srmp2_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_spritegen(*this, "spritegen"), - m_msm(*this, "msm"), - m_adpcm_rom(*this, "adpcm"), - m_mainbank(*this, "mainbank"), - m_keys(*this, "KEY%u", 0U), - m_service(*this, "SERVICE") - { } - - void mjyuugi(machine_config &config); - void srmp2(machine_config &config); - void rmgoldyh(machine_config &config); - void srmp3(machine_config &config); - -private: - struct iox_t - { - int reset = 0, ff_event,ff_1 = 0, protcheck[4]{}, protlatch[4]{}; - uint8_t data = 0; - uint8_t mux = 0; - uint8_t ff = 0; - }; - - required_device m_maincpu; - required_device m_spritegen; - required_device m_msm; - required_region_ptr m_adpcm_rom; - optional_memory_bank m_mainbank; - required_ioport_array<8> m_keys; - required_ioport m_service; - - uint8_t m_color_bank = 0; - uint8_t m_gfx_bank = 0; - uint8_t m_adpcm_bank = 0; - int16_t m_adpcm_data = 0; - uint32_t m_adpcm_sptr = 0; - uint32_t m_adpcm_eptr = 0; - iox_t m_iox; - - // common - uint8_t vox_status_r(); - uint8_t iox_mux_r(); - uint8_t iox_status_r(); - void iox_command_w(uint8_t data); - void iox_data_w(uint8_t data); - void adpcm_int(int state); - - // mjuugi - void mjyuugi_flags_w(uint16_t data); - void mjyuugi_adpcm_bank_w(uint16_t data); - uint8_t mjyuugi_irq2_ack_r(address_space &space); - uint8_t mjyuugi_irq4_ack_r(address_space &space); - - // rmgoldyh - void rmgoldyh_rombank_w(uint8_t data); - - // srmp2 - void srmp2_irq2_ack_w(uint8_t data); - void srmp2_irq4_ack_w(uint8_t data); - void srmp2_flags_w(uint16_t data); - void adpcm_code_w(uint8_t data); - - // srmp3 - void srmp3_rombank_w(uint8_t data); - void srmp3_flags_w(uint8_t data); - void srmp3_irq_ack_w(uint8_t data); - - virtual void machine_start() override; - DECLARE_MACHINE_START(srmp2); - void srmp2_palette(palette_device &palette) const; - DECLARE_MACHINE_START(srmp3); - void srmp3_palette(palette_device &palette) const; - DECLARE_MACHINE_START(rmgoldyh); - DECLARE_MACHINE_START(mjyuugi); - - uint32_t screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - X1_001_SPRITE_GFXBANK_CB_MEMBER(srmp3_gfxbank_callback); - - uint8_t iox_key_matrix_calc(uint8_t p_side); - - void mjyuugi_map(address_map &map); - void rmgoldyh_io_map(address_map &map); - void rmgoldyh_map(address_map &map); - void srmp2_map(address_map &map); - void srmp3_io_map(address_map &map); - void srmp3_map(address_map &map); -}; - -#endif // MAME_SETA_SRMP2_H diff --git a/src/mame/seta/srmp2_v.cpp b/src/mame/seta/srmp2_v.cpp deleted file mode 100644 index 6f9046654f2..00000000000 --- a/src/mame/seta/srmp2_v.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Yochizo, Takahiro Nogi -/*************************************************************************** - -Functions to emulate the video hardware of the machine. - -***************************************************************************/ - - -#include "emu.h" -#include "srmp2.h" - -void srmp2_state::srmp2_palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("proms")->base(); - for (int i = 0; i < palette.entries(); i++) - { - int const col = (color_prom[i] << 8) + color_prom[i + palette.entries()]; - palette.set_pen_color(i ^ 0x0f, pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0)); - } -} - - -void srmp2_state::srmp3_palette(palette_device &palette) const -{ - uint8_t const *const color_prom = memregion("proms")->base(); - for (int i = 0; i < palette.entries(); i++) - { - int const col = (color_prom[i] << 8) + color_prom[i + palette.entries()]; - palette.set_pen_color(i,pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0)); - } -} - -X1_001_SPRITE_GFXBANK_CB_MEMBER(srmp2_state::srmp3_gfxbank_callback) -{ - return (code & 0x3fff) + ((code & 0x2000) ? (m_gfx_bank<<13) : 0); -} - - -uint32_t srmp2_state::screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(0x1ff, cliprect); - - m_spritegen->set_colorbase(m_color_bank<<5); - - m_spritegen->draw_sprites(screen,bitmap,cliprect,0x1000); - return 0; -} - -uint32_t srmp2_state::screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - bitmap.fill(0x1f0, cliprect); - - m_spritegen->draw_sprites(screen,bitmap,cliprect,0x1000); - return 0; -} diff --git a/src/mame/ti/snspellc.cpp b/src/mame/ti/snspellc.cpp index 371b68a1203..93d9636a554 100644 --- a/src/mame/ti/snspellc.cpp +++ b/src/mame/ti/snspellc.cpp @@ -601,56 +601,56 @@ static INPUT_PORTS_START( tntell ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_NAME("Grid 1-3") PORT_START("IN.1") // R1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Grid 2-1") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("Grid 2-2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("Grid 2-4") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Grid 2-3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_NAME("Grid 2-1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_NAME("Grid 2-2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_NAME("Grid 2-4") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("Grid 2-3") PORT_START("IN.2") // R2 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Grid 3-1") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Grid 3-2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Grid 3-4") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Grid 3-3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Grid 3-1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("Grid 3-2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("Grid 3-4") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Grid 3-3") PORT_START("IN.3") // R3 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Grid 4-1") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Grid 4-2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("Grid 4-4") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Grid 4-3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_U) PORT_NAME("Grid 4-1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_I) PORT_NAME("Grid 4-2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("Grid 4-4") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_O) PORT_NAME("Grid 4-3") PORT_START("IN.4") // R4 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_NAME("Grid 5-1") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_NAME("Grid 5-2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_U) PORT_NAME("Grid 5-4") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("Grid 5-3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Grid 5-1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Grid 5-2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Grid 5-4") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Grid 5-3") PORT_START("IN.5") // R5 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_O) PORT_NAME("Grid 5-6") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_COMMA) PORT_NAME("Grid 6-5") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_I) PORT_NAME("Grid 5-5") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_NAME("Grid 5-6") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_NAME("Grid 6-5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_NAME("Grid 5-5") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) // overlay code PORT_START("IN.6") // R6 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_NAME("Grid 3-5") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("Grid 2-5") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_NAME("Grid 4-5") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("Grid 3-5") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("Grid 2-5") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("Grid 4-5") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_NAME("Grid 1-5") PORT_START("IN.7") // R7 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_NAME("Grid 3-6") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Y) PORT_NAME("Grid 2-6") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_NAME("Grid 4-6") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Y) PORT_NAME("Grid 3-6") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Grid 2-6") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("Grid 4-6") PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_NAME("Grid 1-6") PORT_START("IN.8") // R8 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_CODE(KEYCODE_F2) PORT_NAME("Grid 6-1 (Off)") // -> auto_power_off - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_K) PORT_NAME("Grid 6-2") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_M) PORT_NAME("Grid 6-4") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_L) PORT_NAME("Grid 6-3") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_CODE(KEYCODE_F2) PORT_NAME("Grid 6-1 (Off)") // -> auto_power_off + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Grid 6-2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("Grid 6-4") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Grid 6-3") PORT_START("IN.9") // Vss PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_F1) PORT_NAME("Grid 6-6 (On)") PORT_CHANGED_MEMBER(DEVICE_SELF, tntell_state, power_on, 0) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_CODE(KEYCODE_F1) PORT_NAME("Grid 6-6 (On)") PORT_CHANGED_MEMBER(DEVICE_SELF, tntell_state, power_on, 0) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) // speech chip data PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END diff --git a/src/mame/ussr/debut.cpp b/src/mame/ussr/debut.cpp index d85dac7c100..0902b257351 100644 --- a/src/mame/ussr/debut.cpp +++ b/src/mame/ussr/debut.cpp @@ -209,7 +209,7 @@ static INPUT_PORTS_START( debutm ) PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME(u8"АН (Analysis)") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME(u8"ХОД (Force Move)") PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME(u8"ИНТ (Switch 1P/2P)") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME(u8"ПОЗ (Position Mode)") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME(u8"ПОЗ (Position Mode)") PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME(u8"ВФ (Select Piece)") PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME(u8"ВП (Take Back)") PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_L) PORT_NAME(u8"УР (Level)") diff --git a/src/mame/ussr/im01.cpp b/src/mame/ussr/im01.cpp index f5152f39792..d0942d2cec0 100644 --- a/src/mame/ussr/im01.cpp +++ b/src/mame/ussr/im01.cpp @@ -326,7 +326,7 @@ static INPUT_PORTS_START( im05 ) PORT_MODIFY("IN.1") PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Forward") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME(u8"ПХ (Hint)") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) PORT_NAME(u8"Р (Promotion)") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_P) PORT_NAME(u8"Р (Promotion)") PORT_MODIFY("IN.2") PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Confirm")