From dd55931072bad4f41eac66ea7da50619a2105a92 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 20 Apr 2021 13:28:40 +0200 Subject: basf7100: Improve video rendering --- src/mame/drivers/basf7100.cpp | 71 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 57 insertions(+), 14 deletions(-) diff --git a/src/mame/drivers/basf7100.cpp b/src/mame/drivers/basf7100.cpp index 498d8934213..a52dd6b0487 100644 --- a/src/mame/drivers/basf7100.cpp +++ b/src/mame/drivers/basf7100.cpp @@ -267,7 +267,6 @@ void basf7100_state::highlight_w(uint8_t data) void basf7100_state::roll_offset_w(uint8_t data) { - logerror("roll offset = %02x\n", data); m_roll_offset = data; } @@ -294,10 +293,13 @@ void basf7100_state::vblank_w(int state) uint32_t basf7100_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { + const rgb_t *palette = m_palette->palette()->entry_list_raw(); uint16_t addr = m_sod + (m_roll_offset * 16); for (int y = 0; y < 24; y++) { + uint8_t line_attr = 0x00; + for (int x = 0; x < 80; x++) { if (addr >= (m_sod + 0x780)) @@ -310,22 +312,63 @@ uint32_t basf7100_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm { uint8_t data = m_chargen[(((code & 0x7f) << 4) + i)]; - // wrong - if (BIT(code, 7)) + // character attributes + bool inverse = false; + bool half = false; + bool underline = false; + bool blink = false; + + // global attributes + if (BIT(m_highlight, 3) && BIT(code, 7)) + { + inverse = bool(BIT(m_highlight, 4)); + half = bool(BIT(m_highlight, 5)); + underline = bool(BIT(m_highlight, 6)); + blink = bool(BIT(m_highlight, 7)); + } + + // line attribute + if (BIT(m_highlight, 1)) + { + // control characters + if ((code & 0x70) == 0x10) + line_attr = code & 0x0f; + + inverse = bool(BIT(line_attr, 0)); + half = bool(BIT(line_attr, 1)); + underline = bool(BIT(line_attr, 2)); + blink = bool(BIT(line_attr, 3)); + } + + // correct some issues because of the wrong charrom + if ((code & 0x7f) == 0 || ((code & 0x7f) >= 0x10 && (code & 0x7f) <= 0x14)) + data = 0x00; + + // display of control characters + if (BIT(m_highlight, 0) == 0 && (code & 0x60) == 0) + data = 0x00; + + if (underline && i == 10) + data = 0xff; + + if (blink && m_screen->frame_number() & 0x08) // timing? + data = 0x00; + + if (inverse) data ^= 0xff; - if (y == m_cursor_row && x == m_cursor_col) - data ^= 0xff; + if (y == m_cursor_row && x == m_cursor_col && m_screen->frame_number() & 0x08) + data = 0xff; // 8 pixels of the character - bitmap.pix(y * 12 + i, x * 8 + 0) = BIT(data, 7) ? rgb_t::white() : rgb_t::black(); - bitmap.pix(y * 12 + i, x * 8 + 1) = BIT(data, 6) ? rgb_t::white() : rgb_t::black(); - bitmap.pix(y * 12 + i, x * 8 + 2) = BIT(data, 5) ? rgb_t::white() : rgb_t::black(); - bitmap.pix(y * 12 + i, x * 8 + 3) = BIT(data, 4) ? rgb_t::white() : rgb_t::black(); - bitmap.pix(y * 12 + i, x * 8 + 4) = BIT(data, 3) ? rgb_t::white() : rgb_t::black(); - bitmap.pix(y * 12 + i, x * 8 + 5) = BIT(data, 2) ? rgb_t::white() : rgb_t::black(); - bitmap.pix(y * 12 + i, x * 8 + 6) = BIT(data, 1) ? rgb_t::white() : rgb_t::black(); - bitmap.pix(y * 12 + i, x * 8 + 7) = BIT(data, 0) ? rgb_t::white() : rgb_t::black(); + bitmap.pix(y * 12 + i, x * 8 + 0) = palette[BIT(data, 7) ? 2 - (half ? 1 : 0) : 0]; + bitmap.pix(y * 12 + i, x * 8 + 1) = palette[BIT(data, 6) ? 2 - (half ? 1 : 0) : 0]; + bitmap.pix(y * 12 + i, x * 8 + 2) = palette[BIT(data, 5) ? 2 - (half ? 1 : 0) : 0]; + bitmap.pix(y * 12 + i, x * 8 + 3) = palette[BIT(data, 4) ? 2 - (half ? 1 : 0) : 0]; + bitmap.pix(y * 12 + i, x * 8 + 4) = palette[BIT(data, 3) ? 2 - (half ? 1 : 0) : 0]; + bitmap.pix(y * 12 + i, x * 8 + 5) = palette[BIT(data, 2) ? 2 - (half ? 1 : 0) : 0]; + bitmap.pix(y * 12 + i, x * 8 + 6) = palette[BIT(data, 1) ? 2 - (half ? 1 : 0) : 0]; + bitmap.pix(y * 12 + i, x * 8 + 7) = palette[BIT(data, 0) ? 2 - (half ? 1 : 0) : 0]; } // next char @@ -510,7 +553,7 @@ void basf7100_state::basf7100(machine_config &config) GFXDECODE(config, "gfxdecode", "palette", gfx_crt8002); - PALETTE(config, m_palette, palette_device::MONOCHROME); + PALETTE(config, m_palette, palette_device::MONOCHROME_HIGHLIGHT); // floppy FD1791(config, m_fdc, 1000000); -- cgit v1.2.3 From cb41f89eeb00b0984c3364da2c9157400b05b676 Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 20 Apr 2021 10:06:33 -0400 Subject: rx01: Preliminary, untested host interface --- src/devices/cpu/rx01/rx01.cpp | 170 +++++++++++++++++++++++++++++++++----- src/devices/cpu/rx01/rx01.h | 24 ++++++ src/devices/cpu/rx01/rx01dasm.cpp | 2 +- 3 files changed, 176 insertions(+), 20 deletions(-) diff --git a/src/devices/cpu/rx01/rx01.cpp b/src/devices/cpu/rx01/rx01.cpp index 58f90dba842..86876ef6363 100644 --- a/src/devices/cpu/rx01/rx01.cpp +++ b/src/devices/cpu/rx01/rx01.cpp @@ -39,6 +39,7 @@ rx01_cpu_device::rx01_cpu_device(const machine_config &mconfig, const char *tag, : cpu_device(mconfig, RX01_CPU, tag, owner, clock) , m_inst_config("program", ENDIANNESS_LITTLE, 8, 12, 0) , m_data_config("sector data", ENDIANNESS_LITTLE, 8, 10, 0) // actually 1 bit wide + , m_interface_callback(*this) , m_pc(0) , m_ppc(0) , m_mb(0) @@ -51,6 +52,9 @@ rx01_cpu_device::rx01_cpu_device(const machine_config &mconfig, const char *tag, , m_bar(0) , m_crc(0) , m_flags(0) + , m_run(false) + , m_12_bit(false) + , m_data_in(false) , m_unit(false) , m_load_head(false) , m_syn_index(false) @@ -73,6 +77,11 @@ device_memory_interface::space_config_vector rx01_cpu_device::memory_space_confi }; } +void rx01_cpu_device::device_resolve_objects() +{ + m_interface_callback.resolve_all_safe(); +} + void rx01_cpu_device::device_start() { space(AS_PROGRAM).cache(m_inst_cache); @@ -109,6 +118,9 @@ void rx01_cpu_device::device_start() save_item(NAME(m_bar)); save_item(NAME(m_crc)); save_item(NAME(m_flags)); + save_item(NAME(m_run)); + save_item(NAME(m_12_bit)); + save_item(NAME(m_data_in)); save_item(NAME(m_unit)); save_item(NAME(m_load_head)); save_item(NAME(m_syn_index)); @@ -128,6 +140,29 @@ void rx01_cpu_device::device_reset() m_flags = 0; m_unit = false; m_load_head = false; + + // Clear interface outputs (inactive high) + for (auto &cb : m_interface_callback) + cb(1); +} + +void rx01_cpu_device::execute_set_input(int linenum, int state) +{ + // All inputs (and outputs) are active low + switch (linenum) + { + case RX_RUN: + m_run = (state == ASSERT_LINE); + break; + + case RX_12_BIT: + m_12_bit = (state == ASSERT_LINE); + break; + + case RX_DATA: + m_data_in = (state == ASSERT_LINE); + break; + } } u8 rx01_cpu_device::mux_out() @@ -140,8 +175,17 @@ u8 rx01_cpu_device::mux_out() bool rx01_cpu_device::data_in() { - // TODO - return false; + if (m_data_in) + return true; + else if (m_flags & FF_IOB3) + { + if (m_flags & FF_IOB6) + return bool(m_data_cache.read_byte(m_bar)); + else + return BIT(m_sr, 7); + } + else + return false; } bool rx01_cpu_device::sep_data() @@ -181,8 +225,8 @@ bool rx01_cpu_device::test_condition() switch (m_mb & 074) { case 000: - // Interface transfer request or command pending (TODO) - return false; + // Interface transfer request or command pending + return m_run; case 004: // Output buffer bit 3 @@ -221,8 +265,8 @@ bool rx01_cpu_device::test_condition() return sep_clk(); case 050: - // 12-bit interface mode selected (TODO) - return false; + // 12-bit interface mode selected + return m_12_bit; case 054: // Separated data equals shift register MSB @@ -241,7 +285,7 @@ bool rx01_cpu_device::test_condition() if (m_flags & FF_WRTBUF) return sec_buf_in(); else - return m_data_cache.read_byte(m_bar) & 1; + return bool(m_data_cache.read_byte(m_bar)); case 074: // Flag state equals one @@ -327,52 +371,140 @@ void rx01_cpu_device::execute_run() else switch (m_mb & 074) { case 000: - if (BIT(m_mb, 1)) + if (BIT(m_mb, 1) && (m_flags & FF_IOB0) == 0) + { + LOG("%04o: Drive bus selected\n", m_ppc); m_flags |= FF_IOB0; - else + for (int i = 0; i < 5; i++) + if (m_flags & (FF_IOB1 << i)) + m_interface_callback[i](1); + } + else if (!BIT(m_mb, 1) && (m_flags & FF_IOB0) != 0) + { + LOG("%04o: Interface bus selected\n", m_ppc); m_flags &= ~FF_IOB0; + for (int i = 0; i < 5; i++) + if (m_flags & (FF_IOB1 << i)) + m_interface_callback[i](0); + } break; case 004: - if (BIT(m_mb, 1)) + if (BIT(m_mb, 1) && (m_flags & FF_IOB1) == 0) + { m_flags |= FF_IOB1; - else + if ((m_flags & FF_IOB0) == 0) + { + LOG("%04o: RX ERROR asserted\n", m_ppc); + m_interface_callback[0](0); + } + } + else if (!BIT(m_mb, 1) && (m_flags & FF_IOB1) != 0) + { m_flags &= ~FF_IOB1; + if ((m_flags & FF_IOB0) == 0) + { + LOG("%04o: RX ERROR cleared\n", m_ppc); + m_interface_callback[0](1); + } + } break; case 010: - if (BIT(m_mb, 1)) + if (BIT(m_mb, 1) && (m_flags & FF_IOB2) == 0) + { m_flags |= FF_IOB2; - else + if ((m_flags & FF_IOB0) == 0) + { + LOG("%04o: RX TRANSFER REQUEST asserted\n", m_ppc); + m_interface_callback[1](0); + } + } + else if (!BIT(m_mb, 1) && (m_flags & FF_IOB2) != 0) + { m_flags &= ~FF_IOB2; + if ((m_flags & FF_IOB0) == 0) + { + LOG("%04o: RX TRANSFER REQUEST cleared\n", m_ppc); + m_interface_callback[1](1); + } + } break; case 014: - if (BIT(m_mb, 1)) + if (BIT(m_mb, 1) && (m_flags & FF_IOB3) == 0) + { m_flags |= FF_IOB3; - else + if ((m_flags & FF_IOB0) == 0) + { + LOG("%04o: RX OUT mode selected\n", m_ppc); + m_interface_callback[2](0); + } + } + else if (!BIT(m_mb, 1) && (m_flags & FF_IOB3) != 0) + { m_flags &= ~FF_IOB3; + if ((m_flags & FF_IOB0) == 0) + { + LOG("%04o: RX IN mode selected\n", m_ppc); + m_interface_callback[2](1); + } + } break; case 020: - if (BIT(m_mb, 1)) + if (BIT(m_mb, 1) && (m_flags & FF_IOB4) == 0) + { m_flags |= FF_IOB4; - else + if ((m_flags & FF_IOB0) == 0) + { + LOG("%04o: RX DONE asserted\n", m_ppc); + m_interface_callback[3](0); + } + } + else if (!BIT(m_mb, 1) && (m_flags & FF_IOB4) != 0) + { m_flags &= ~FF_IOB4; + if ((m_flags & FF_IOB0) == 0) + { + LOG("%04o: RX DONE cleared\n", m_ppc); + m_interface_callback[3](1); + } + } break; case 024: - if (BIT(m_mb, 1)) + if (BIT(m_mb, 1) && (m_flags & FF_IOB5) == 0) + { m_flags |= FF_IOB5; - else + if ((m_flags & FF_IOB0) == 0) + { + LOG("%04o: RX SHIFT asserted\n", m_ppc); + m_interface_callback[4](0); + } + } + else if (!BIT(m_mb, 1) && (m_flags & FF_IOB5) != 0) + { m_flags &= ~FF_IOB5; + if ((m_flags & FF_IOB0) == 0) + { + LOG("%04o: RX SHIFT cleared\n", m_ppc); + m_interface_callback[4](1); + } + } break; case 030: if (BIT(m_mb, 1)) + { + LOG("%04o: SEC BUF selected for output\n", m_ppc); m_flags |= FF_IOB6; + } else + { + LOG("%04o: SR selected for output\n", m_ppc); m_flags &= ~FF_IOB6; + } break; case 034: diff --git a/src/devices/cpu/rx01/rx01.h b/src/devices/cpu/rx01/rx01.h index 2b990e96867..b8806c354f3 100644 --- a/src/devices/cpu/rx01/rx01.h +++ b/src/devices/cpu/rx01/rx01.h @@ -31,17 +31,35 @@ public: FF_FLAG = 1 << 8 }; + enum { + RX_RUN = 0, + RX_12_BIT, + RX_DATA + }; + // device type constructor rx01_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + // callback configuration + auto error_callback() { return m_interface_callback[0].bind(); } + auto transfer_request_callback() { return m_interface_callback[1].bind(); } + auto out_callback() { return m_interface_callback[2].bind(); } + auto done_callback() { return m_interface_callback[3].bind(); } + auto shift_callback() { return m_interface_callback[4].bind(); } + + // serial input for controller + DECLARE_READ_LINE_MEMBER(data_r) { return !data_in(); } + protected: // device-level overrides + virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; // device_execute_interface overrides virtual u64 execute_clocks_to_cycles(u64 clocks) const noexcept override { return (clocks + 4 - 1) / 4; } virtual u64 execute_cycles_to_clocks(u64 cycles) const noexcept override { return (cycles * 4); } + virtual void execute_set_input(int linenum, int state) override; virtual void execute_run() override; // device_disasm_interface overrides @@ -73,6 +91,9 @@ private: memory_access<12, 0, 0, ENDIANNESS_LITTLE>::cache m_inst_cache; memory_access<10, 0, 0, ENDIANNESS_LITTLE>::cache m_data_cache; + // interface output callbacks + devcb_write_line::array<5> m_interface_callback; + // internal state u16 m_pc; u16 m_ppc; @@ -87,6 +108,9 @@ private: u16 m_bar; u16 m_crc; u16 m_flags; + bool m_run; + bool m_12_bit; + bool m_data_in; bool m_unit; bool m_load_head; bool m_syn_index; diff --git a/src/devices/cpu/rx01/rx01dasm.cpp b/src/devices/cpu/rx01/rx01dasm.cpp index 978d9398014..1e8d8692a66 100644 --- a/src/devices/cpu/rx01/rx01dasm.cpp +++ b/src/devices/cpu/rx01/rx01dasm.cpp @@ -60,7 +60,7 @@ offs_t rx01_disassembler::disassemble(std::ostream &stream, offs_t pc, const rx0 util::stream_format(stream, "%sBR %s ", BIT(opcode, 7) ? "W" : "", s_conditions[(opcode & 074) >> 2]); - if ((opcode & 074) == 020) + if ((opcode & 074) == 010 || (opcode & 074) == 020) stream << s_0_or_1[BIT(opcode, 1)]; else stream << (BIT(opcode, 1) ? "T" : "F"); -- cgit v1.2.3 From 62b9a513bcc3d8c259e4f63e7692feadebd3eeda Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 20 Apr 2021 17:06:30 +0200 Subject: New working software list additions ----------------------------------- ibm5170: SmartBoard Driver (DOS), SmartBoard Driver SDK (Win32) [hap] --- hash/ibm5170.xml | 31 ++++++++++++++++++++++++++++++- src/devices/machine/smartboard.cpp | 11 +++++++---- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/hash/ibm5170.xml b/hash/ibm5170.xml index 6d782f75c9f..60fced9d55d 100644 --- a/hash/ibm5170.xml +++ b/hash/ibm5170.xml @@ -5202,8 +5202,8 @@ license:CC0 - + CD-ROM God Boot Disk Version 5.5 BETA2 1998 Kristopher Marciniak @@ -5816,6 +5816,21 @@ license:CC0 + + + + + SmartBoard Driver (DOS) + 1995 + + Tasc + + + + + + + SN-3200 PCI Ethernet Adapter Driver (Jun 15 1998) 1999 @@ -8386,6 +8401,20 @@ license:CC0 + + + + SmartBoard Driver SDK (Win32) + 1998 + Tasc + + + + + + + + Windows 1.03 SDK 1986 diff --git a/src/devices/machine/smartboard.cpp b/src/devices/machine/smartboard.cpp index 07190d7d4e2..674568c5365 100644 --- a/src/devices/machine/smartboard.cpp +++ b/src/devices/machine/smartboard.cpp @@ -6,13 +6,16 @@ Tasc SmartBoard SB30 Chessboard controller for use with Tasc R30 chesscomputer, or as PC peripheral. -SB30 (81 LEDs) is "SmartBoard I" -SB20 (64 LEDs) is "SmartBoard II" - The SmartBoard can detect which piece is present on a specific square, more info on the technology used in the piece recognition system can be found in the US patent 5,129,654 +SB30 (81 LEDs) is "SmartBoard I" +SB20 (64 LEDs) is "SmartBoard II" + +SB20 is not emulated. It's on different hardware, with embedded CPU to reduce +I/O overhead. Note, SB20 is not compatible with old versions of Tasc R30. + ******************************************************************************/ #include "emu.h" @@ -304,7 +307,7 @@ void tasc_sb30_device::data0_w(int state) if (m_led_out.isnull()) m_out_leds[m_pos & 7][m_pos >> 3 & 7] = m_data1; else - m_led_out(m_pos & 0x3f, m_pos >> 6 & 1); + m_led_out(m_pos & 0x3f, m_data1); } } -- cgit v1.2.3 From 3bc91699263d56f2a3958483b34c09e174cd086b Mon Sep 17 00:00:00 2001 From: Robbbert Date: Wed, 21 Apr 2021 02:07:27 +1000 Subject: trs80: used array of floppy drives --- src/mame/drivers/lnw80.cpp | 8 ++++---- src/mame/drivers/radionic.cpp | 8 ++++---- src/mame/drivers/trs80.cpp | 8 ++++---- src/mame/drivers/trs80m3.cpp | 4 ++-- src/mame/includes/trs80.h | 14 ++++---------- src/mame/includes/trs80m3.h | 10 ++++------ src/mame/machine/trs80.cpp | 21 ++++++++++----------- src/mame/machine/trs80m3.cpp | 20 ++++++++++---------- 8 files changed, 42 insertions(+), 51 deletions(-) diff --git a/src/mame/drivers/lnw80.cpp b/src/mame/drivers/lnw80.cpp index efcc022b165..1c97fe4a70a 100644 --- a/src/mame/drivers/lnw80.cpp +++ b/src/mame/drivers/lnw80.cpp @@ -603,10 +603,10 @@ void lnw80_state::lnw80(machine_config &config) FD1771(config, m_fdc, 4_MHz_XTAL / 4); m_fdc->intrq_wr_callback().set(FUNC(lnw80_state::intrq_w)); - FLOPPY_CONNECTOR(config, "fdc:0", lnw80_floppies, "sssd", lnw80_state::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:1", lnw80_floppies, "sssd", lnw80_state::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:2", lnw80_floppies, nullptr, lnw80_state::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:3", lnw80_floppies, nullptr, lnw80_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[0], lnw80_floppies, "sssd", lnw80_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[1], lnw80_floppies, "sssd", lnw80_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[2], lnw80_floppies, nullptr, lnw80_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[3], lnw80_floppies, nullptr, lnw80_state::floppy_formats).enable_sound(true); CENTRONICS(config, m_centronics, centronics_devices, "printer"); m_centronics->busy_handler().set(m_cent_status_in, FUNC(input_buffer_device::write_bit7)); diff --git a/src/mame/drivers/radionic.cpp b/src/mame/drivers/radionic.cpp index 11b24ca81a0..eb84efa7a22 100644 --- a/src/mame/drivers/radionic.cpp +++ b/src/mame/drivers/radionic.cpp @@ -372,10 +372,10 @@ void radionic_state::radionic(machine_config &config) FD1771(config, m_fdc, 4_MHz_XTAL / 4); m_fdc->intrq_wr_callback().set(FUNC(radionic_state::intrq_w)); - FLOPPY_CONNECTOR(config, "fdc:0", radionic_floppies, "80t_qd", radionic_state::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:1", radionic_floppies, "80t_qd", radionic_state::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:2", radionic_floppies, nullptr, radionic_state::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:3", radionic_floppies, nullptr, radionic_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[0], radionic_floppies, "80t_qd", radionic_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[1], radionic_floppies, "80t_qd", radionic_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[2], radionic_floppies, nullptr, radionic_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[3], radionic_floppies, nullptr, radionic_state::floppy_formats).enable_sound(true); CENTRONICS(config, m_centronics, centronics_devices, "printer"); m_centronics->busy_handler().set(m_cent_status_in, FUNC(input_buffer_device::write_bit7)); diff --git a/src/mame/drivers/trs80.cpp b/src/mame/drivers/trs80.cpp index 0ea4c8373a5..f7766def498 100644 --- a/src/mame/drivers/trs80.cpp +++ b/src/mame/drivers/trs80.cpp @@ -460,10 +460,10 @@ void trs80_state::model1(machine_config &config) // model I, level II FD1771(config, m_fdc, 4_MHz_XTAL / 4); m_fdc->intrq_wr_callback().set(FUNC(trs80_state::intrq_w)); - FLOPPY_CONNECTOR(config, "fdc:0", trs80_floppies, "80t_qd", trs80_state::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:1", trs80_floppies, "80t_qd", trs80_state::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:2", trs80_floppies, nullptr, trs80_state::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:3", trs80_floppies, nullptr, trs80_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[0], trs80_floppies, "80t_qd", trs80_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[1], trs80_floppies, "80t_qd", trs80_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[2], trs80_floppies, nullptr, trs80_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[3], trs80_floppies, nullptr, trs80_state::floppy_formats).enable_sound(true); CENTRONICS(config, m_centronics, centronics_devices, "printer"); m_centronics->busy_handler().set(m_cent_status_in, FUNC(input_buffer_device::write_bit7)); diff --git a/src/mame/drivers/trs80m3.cpp b/src/mame/drivers/trs80m3.cpp index 011bb2e8782..0e70d31d686 100644 --- a/src/mame/drivers/trs80m3.cpp +++ b/src/mame/drivers/trs80m3.cpp @@ -384,8 +384,8 @@ void trs80m3_state::model3(machine_config &config) m_fdc->drq_wr_callback().set(FUNC(trs80m3_state::drq_w)); // Internal drives - FLOPPY_CONNECTOR(config, "fdc:0", trs80_floppies, "40t_dd", trs80m3_state::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "fdc:1", trs80_floppies, "40t_dd", trs80m3_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[0], trs80_floppies, "40t_dd", trs80m3_state::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, m_floppy[1], trs80_floppies, "40t_dd", trs80m3_state::floppy_formats).enable_sound(true); CENTRONICS(config, m_centronics, centronics_devices, "printer"); m_centronics->busy_handler().set(m_cent_status_in, FUNC(input_buffer_device::write_bit7)); diff --git a/src/mame/includes/trs80.h b/src/mame/includes/trs80.h index 937acda5552..41e41b9f62b 100644 --- a/src/mame/includes/trs80.h +++ b/src/mame/includes/trs80.h @@ -41,15 +41,12 @@ public: , m_uart(*this, "uart") , m_uart_clock(*this, "uart_clock") , m_fdc(*this, "fdc") - , m_floppy0(*this, "fdc:0") - , m_floppy1(*this, "fdc:1") - , m_floppy2(*this, "fdc:2") - , m_floppy3(*this, "fdc:3") + , m_floppy(*this, "flop%u", 0U) , m_speaker(*this, "speaker") , m_cassette(*this, "cassette") , m_io_baud(*this, "BAUD") , m_io_config(*this, "CONFIG") - , m_io_keyboard(*this, "LINE%u", 0) + , m_io_keyboard(*this, "LINE%u", 0U) { } void sys80(machine_config &config); @@ -99,7 +96,7 @@ protected: double m_old_cassette_val; uint8_t m_size_store; uint16_t m_timeout; - floppy_image_device *m_floppy; + floppy_image_device *m_fdd; required_device m_maincpu; required_memory_region m_region_maincpu; required_region_ptr m_p_chargen; @@ -110,10 +107,7 @@ protected: optional_device m_uart; optional_device m_uart_clock; optional_device m_fdc; - optional_device m_floppy0; - optional_device m_floppy1; - optional_device m_floppy2; - optional_device m_floppy3; + optional_device_array m_floppy; required_device m_speaker; required_device m_cassette; optional_ioport m_io_baud; diff --git a/src/mame/includes/trs80m3.h b/src/mame/includes/trs80m3.h index 6c59507bb5e..f3e72c65024 100644 --- a/src/mame/includes/trs80m3.h +++ b/src/mame/includes/trs80m3.h @@ -41,12 +41,11 @@ public: , m_uart(*this, "uart") , m_brg(*this, "brg") , m_fdc(*this, "fdc") - , m_floppy0(*this, "fdc:0") - , m_floppy1(*this, "fdc:1") + , m_floppy(*this, "fdc%u", 0U) , m_speaker(*this, "speaker") , m_cassette(*this, "cassette") , m_io_config(*this, "CONFIG") - , m_io_keyboard(*this, "LINE%u", 0) + , m_io_keyboard(*this, "LINE%u", 0U) , m_mainram(*this, RAM_TAG) , m_m4_bank(*this, "m4_banked_mem") , m_m4p_bank(*this, "m4p_banked_mem") @@ -130,7 +129,7 @@ private: bool m_wait; bool m_drq_off; bool m_intrq_off; - floppy_image_device *m_floppy; + floppy_image_device *m_fdd; required_device m_maincpu; required_memory_region m_region_maincpu; required_region_ptr m_p_chargen; @@ -142,8 +141,7 @@ private: optional_device m_uart; optional_device m_brg; optional_device m_fdc; - optional_device m_floppy0; - optional_device m_floppy1; + optional_device_array m_floppy; required_device m_speaker; optional_device m_cassette; optional_ioport m_io_config; diff --git a/src/mame/machine/trs80.cpp b/src/mame/machine/trs80.cpp index 0d9ccc97f9e..27c8e016ec4 100644 --- a/src/mame/machine/trs80.cpp +++ b/src/mame/machine/trs80.cpp @@ -203,8 +203,8 @@ INTERRUPT_GEN_MEMBER(trs80_state::rtc_interrupt) // { // m_timeout--; // if (m_timeout == 0) -// if (m_floppy) -// m_floppy->mon_w(1); // motor off +// if (m_fdd) +// m_fdd->mon_w(1); // motor off // } } @@ -279,19 +279,18 @@ uint8_t trs80_state::irq_status_r() void trs80_state::motor_w(uint8_t data) { - m_floppy = nullptr; + m_fdd = nullptr; - if (BIT(data, 0)) m_floppy = m_floppy0->get_device(); - if (BIT(data, 1)) m_floppy = m_floppy1->get_device(); - if (BIT(data, 2)) m_floppy = m_floppy2->get_device(); - if (BIT(data, 3)) m_floppy = m_floppy3->get_device(); + for (u8 i = 0; i < 4; i++) + if (BIT(data, i)) + m_fdd = m_floppy[i]->get_device(); - m_fdc->set_floppy(m_floppy); + m_fdc->set_floppy(m_fdd); - if (m_floppy) + if (m_fdd) { - m_floppy->mon_w(0); - m_floppy->ss_w(BIT(data, 4)); + m_fdd->mon_w(0); + m_fdd->ss_w(BIT(data, 4)); m_timeout = 200; } diff --git a/src/mame/machine/trs80m3.cpp b/src/mame/machine/trs80m3.cpp index 3ab8e597985..85c81ba4d0e 100644 --- a/src/mame/machine/trs80m3.cpp +++ b/src/mame/machine/trs80m3.cpp @@ -389,17 +389,17 @@ void trs80m3_state::port_f4_w(uint8_t data) m_wait = false; } - m_floppy = nullptr; + m_fdd = nullptr; - if (BIT(data, 0)) m_floppy = m_floppy0->get_device(); - if (BIT(data, 1)) m_floppy = m_floppy1->get_device(); + if (BIT(data, 0)) m_fdd = m_floppy[0]->get_device(); + if (BIT(data, 1)) m_fdd = m_floppy[1]->get_device(); - m_fdc->set_floppy(m_floppy); + m_fdc->set_floppy(m_fdd); - if (m_floppy) + if (m_fdd) { - m_floppy->mon_w(0); - m_floppy->ss_w(BIT(data, 4)); + m_fdd->mon_w(0); + m_fdd->ss_w(BIT(data, 4)); m_timeout = 1600; } @@ -443,8 +443,8 @@ INTERRUPT_GEN_MEMBER(trs80m3_state::rtc_interrupt) { m_timeout--; if (m_timeout == 0) - if (m_floppy) - m_floppy->mon_w(1); // motor off + if (m_fdd) + m_fdd->mon_w(1); // motor off } // Also, if cpu is in wait, unlock it and trigger NMI // Don't, it breaks disk loading @@ -625,7 +625,7 @@ void trs80m3_state::machine_reset() if (m_model4 & 6) port_84_w(0); // 4 & 4P - switch in devices - m_floppy = nullptr; + m_fdd = nullptr; } -- cgit v1.2.3 From e1bd766620fd8abc0662bc705901f1177a6472b4 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Tue, 20 Apr 2021 09:28:17 -0700 Subject: twinspri: Fix missing samples by masking the ADPCM-A end address properly. --- src/devices/sound/ymadpcm.cpp | 78 ++++++++++++++++++++++++++++--------------- src/devices/sound/ymfm.cpp | 16 +++++++++ 2 files changed, 68 insertions(+), 26 deletions(-) diff --git a/src/devices/sound/ymadpcm.cpp b/src/devices/sound/ymadpcm.cpp index c8dd5df0cca..30743ebc16a 100644 --- a/src/devices/sound/ymadpcm.cpp +++ b/src/devices/sound/ymadpcm.cpp @@ -4,11 +4,21 @@ #include "emu.h" #include "ymadpcm.h" -#define VERBOSE 1 +//#define VERBOSE 1 #define LOG_OUTPUT_FUNC osd_printf_verbose #include "logmacro.h" +//********************************************************* +// DEBUGGING +//********************************************************* + +// set this to only play certain channels: bits 0-5 are ADPCM-A +// channels and bit 0x80 is the ADPCM-B channel +constexpr u8 global_chanmask = 0xff; + + + //********************************************************* // MACROS //********************************************************* @@ -117,13 +127,16 @@ void ymadpcm_a_channel::keyonoff(bool on) m_curbyte = 0; m_accumulator = 0; m_step_index = 0; - LOG("KeyOn ADPCM-A%d: pan=%d%d start=%04X end=%04X level=%02X\n", - m_choffs, - m_regs.ch_pan_left(m_choffs), - m_regs.ch_pan_right(m_choffs), - m_regs.ch_start(m_choffs), - m_regs.ch_end(m_choffs), - m_regs.ch_instrument_level(m_choffs)); + + // don't log masked channels + if (((global_chanmask >> m_choffs) & 1) != 0) + LOG("KeyOn ADPCM-A%d: pan=%d%d start=%04X end=%04X level=%02X\n", + m_choffs, + m_regs.ch_pan_left(m_choffs), + m_regs.ch_pan_right(m_choffs), + m_regs.ch_start(m_choffs), + m_regs.ch_end(m_choffs), + m_regs.ch_instrument_level(m_choffs)); } } @@ -141,8 +154,11 @@ bool ymadpcm_a_channel::clock() return false; } - // stop when we hit the end address - if ((m_curaddress >> m_address_shift) >= m_regs.ch_end(m_choffs)) + // stop when we hit the end address; apparently only low 20 bits are used for + // comparison on the YM2610: this affects sample playback in some games, for + // example twinspri character select screen music will skip some samples if + // this is not correct + if (((m_curaddress ^ (m_regs.ch_end(m_choffs) << m_address_shift)) & 0xfffff) == 0) { m_playing = m_accumulator = 0; return true; @@ -292,6 +308,9 @@ u32 ymadpcm_a_engine::clock(u32 chanmask) void ymadpcm_a_engine::output(s32 outputs[2], u32 chanmask) { + // mask out some channels for debug purposes + chanmask &= global_chanmask; + // compute the output of each channel for (int chnum = 0; chnum < std::size(m_channel); chnum++) if (BIT(chanmask, chnum)) @@ -494,6 +513,10 @@ void ymadpcm_b_channel::clock() void ymadpcm_b_channel::output(s32 outputs[2], u32 rshift) const { + // mask out some channels for debug purposes + if ((global_chanmask & 0x80) == 0) + return; + // do a linear interpolation between samples s32 result = (m_prev_accum * s32((m_position ^ 0xffff) + 1) + m_accumulator * s32(m_position)) >> 16; @@ -557,22 +580,25 @@ void ymadpcm_b_channel::write(u32 regnum, u8 value) if (m_regs.execute()) { load_start(); - LOG("KeyOn ADPCM-B: rep=%d spk=%d pan=%d%d dac=%d 8b=%d rom=%d ext=%d rec=%d start=%04X end=%04X pre=%04X dn=%04X lvl=%02X lim=%04X\n", - m_regs.repeat(), - m_regs.speaker(), - m_regs.pan_left(), - m_regs.pan_right(), - m_regs.dac_enable(), - m_regs.dram_8bit(), - m_regs.rom_ram(), - m_regs.external(), - m_regs.record(), - m_regs.start(), - m_regs.end(), - m_regs.prescale(), - m_regs.delta_n(), - m_regs.level(), - m_regs.limit()); + + // don't log masked channels + if ((global_chanmask & 0x80) != 0) + LOG("KeyOn ADPCM-B: rep=%d spk=%d pan=%d%d dac=%d 8b=%d rom=%d ext=%d rec=%d start=%04X end=%04X pre=%04X dn=%04X lvl=%02X lim=%04X\n", + m_regs.repeat(), + m_regs.speaker(), + m_regs.pan_left(), + m_regs.pan_right(), + m_regs.dac_enable(), + m_regs.dram_8bit(), + m_regs.rom_ram(), + m_regs.external(), + m_regs.record(), + m_regs.start(), + m_regs.end(), + m_regs.prescale(), + m_regs.delta_n(), + m_regs.level(), + m_regs.limit()); } else m_status &= ~STATUS_EOS; diff --git a/src/devices/sound/ymfm.cpp b/src/devices/sound/ymfm.cpp index 44a869bc1fd..df9d87584ab 100644 --- a/src/devices/sound/ymfm.cpp +++ b/src/devices/sound/ymfm.cpp @@ -8,6 +8,15 @@ #define LOG_OUTPUT_FUNC osd_printf_verbose #include "logmacro.h" + +//********************************************************* +// DEBUGGING +//********************************************************* + +// set this mask to only play certain channels +constexpr u32 global_chanmask = 0xffffffff; + + // // ONE FM CORE TO RULE THEM ALL // @@ -1012,6 +1021,10 @@ void ymopm_registers::log_keyon(u32 choffs, u32 opoffs) u32 chnum = choffs; u32 opnum = opoffs; + // don't log masked channels + if (((global_chanmask >> chnum) & 1) == 0) + return; + LOG("%d.%02d freq=%04X dt2=%d dt=%d fb=%d alg=%X mul=%X tl=%02X ksr=%d adsr=%02X/%02X/%02X/%X sl=%X out=%c%c", chnum, opnum, ch_block_freq(choffs), @@ -3009,6 +3022,9 @@ u32 ymfm_engine_base::clock(u32 chanmask) template void ymfm_engine_base::output(s32 outputs[RegisterType::OUTPUTS], u32 rshift, s32 clipmax, u32 chanmask) const { + // mask out some channels for debug purposes + chanmask &= global_chanmask; + // mask out inactive channels chanmask &= m_active_channels; -- cgit v1.2.3 From 63aae42c2c95eda7f94822f6fd93db41d2f5c22c Mon Sep 17 00:00:00 2001 From: Brian Johnson Date: Tue, 20 Apr 2021 12:36:52 -0400 Subject: upd7220: Fixed mixed mode display area partition parsing --- src/devices/video/upd7220.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/devices/video/upd7220.cpp b/src/devices/video/upd7220.cpp index 19bd0c083a1..b09cee24651 100644 --- a/src/devices/video/upd7220.cpp +++ b/src/devices/video/upd7220.cpp @@ -21,7 +21,6 @@ - read data - modify data - write data - - QX-10 diagnostic test has positioning bugs with the bitmap display test; - QX-10 diagnostic test misses the zooming factor (external pin); - compis2 SAD address for bitmap is 0x20000 for whatever reason (presumably missing banking); - A5105 has a FIFO bug with the RDAT, should be a lot larger when it scrolls up. @@ -1648,8 +1647,6 @@ void upd7220_device::update_graphics(bitmap_rgb32 &bitmap, const rectangle &clip if (im || force_bitmap) { - //get_graphics_partition(area, &sad, &len, &im, &wd); - if(area >= 3) // TODO: most likely to be correct, Quarth (PC-98xx) definitely draws with area 2. We might see an area 3 someday ... break; @@ -1670,8 +1667,6 @@ void upd7220_device::update_graphics(bitmap_rgb32 &bitmap, const rectangle &clip } else { - get_text_partition(area, &sad, &len, &im, &wd); - if(m_lr) { for (y = 0; y < len; y+=m_lr) -- cgit v1.2.3 From 7c1ed8c6e065b78238edaae427343e3b5b0fb9b8 Mon Sep 17 00:00:00 2001 From: Brian Johnson Date: Tue, 20 Apr 2021 12:37:20 -0400 Subject: upd7220: Support DMAW and DMAR commands --- src/devices/video/upd7220.cpp | 193 +++++++++++++++++++++++++++++------------- src/devices/video/upd7220.h | 13 ++- src/mame/drivers/qx10.cpp | 21 +---- 3 files changed, 151 insertions(+), 76 deletions(-) diff --git a/src/devices/video/upd7220.cpp b/src/devices/video/upd7220.cpp index b09cee24651..0d20e578cc4 100644 --- a/src/devices/video/upd7220.cpp +++ b/src/devices/video/upd7220.cpp @@ -11,9 +11,6 @@ TODO: - implement FIFO as ring buffer - - commands - - DMAR - - DMAW - incomplete / unimplemented FIGD / GCHRD draw modes - FIGD character - slanted character @@ -456,9 +453,20 @@ inline void upd7220_device::reset_figs_param() //------------------------------------------------- // read_vram - //------------------------------------------------- +inline uint16_t upd7220_device::read_vram() +{ + uint16_t data; + + data = readword(m_ead*2); + m_ead += x_dir[m_figs.m_dir] + (y_dir[m_figs.m_dir] * m_pitch); + m_ead &= 0x3ffff; + + return data; +} -inline void upd7220_device::read_vram(uint8_t type, uint8_t mod) +inline void upd7220_device::rdat(uint8_t type, uint8_t mod) { + uint16_t data; if (type == 1) { LOG("uPD7220 invalid type 1 RDAT parameter\n"); @@ -470,35 +478,74 @@ inline void upd7220_device::read_vram(uint8_t type, uint8_t mod) while (m_figs.m_dc && m_fifo_ptr < (type ? 15 : 14)) { + data = read_vram(); switch(type) { case 0: - queue(readbyte(m_ead*2), 0); - queue(readbyte(m_ead*2+1), 0); + queue(data & 0xff, 0); + queue((data >> 8) & 0xff, 0); break; case 2: - queue(readbyte(m_ead*2), 0); + queue(data & 0xff, 0); break; case 3: - queue(readbyte(m_ead*2+1), 0); + queue((data >> 8) & 0xff, 0); break; } m_figs.m_dc--; - m_ead += x_dir[m_figs.m_dir] + (y_dir[m_figs.m_dir] * m_pitch); - m_ead &= 0x3ffff; } if (m_figs.m_dc == 0) reset_figs_param(); } - //------------------------------------------------- // write_vram - //------------------------------------------------- +inline void upd7220_device::write_vram(uint8_t type, uint8_t mod, uint16_t data) +{ + switch(mod & 3) + { + case 0x00: //replace + if(type == 0) + writeword(m_ead*2+0, data); + if(type == 2) + writebyte(m_ead*2+0, data & 0xff); + if(type == 3) + writebyte(m_ead*2+1, data >> 8); + break; + case 0x01: //complement + if(type == 0) + writeword(m_ead*2+0, readword(m_ead*2+0) ^ data); + if(type == 2) + writebyte(m_ead*2+0, readbyte(m_ead*2+0) ^ (data & 0xff)); + if(type == 3) + writebyte(m_ead*2+1, readbyte(m_ead*2+1) ^ (data >> 8)); + break; + case 0x02: //reset to zero + if(type == 0) + writeword(m_ead*2+0, readword(m_ead*2+0) & ~data); + if(type == 2) + writebyte(m_ead*2+0, readbyte(m_ead*2+0) & ~(data & 0xff)); + if(type == 3) + writebyte(m_ead*2+1, readbyte(m_ead*2+1) & ~(data >> 8)); + break; + case 0x03: //set to one + if(type == 0) + writeword(m_ead*2+0, readword(m_ead*2+0) | data); + if(type == 2) + writebyte(m_ead*2+0, readbyte(m_ead*2+0) | (data & 0xff)); + if(type == 3) + writebyte(m_ead*2+1, readbyte(m_ead*2+1) | (data >> 8)); + break; + } + + m_ead += x_dir[m_figs.m_dir] + (y_dir[m_figs.m_dir] * m_pitch); + m_ead &= 0x3ffff; +} -inline void upd7220_device::write_vram(uint8_t type, uint8_t mod) +inline void upd7220_device::wdat(uint8_t type, uint8_t mod) { uint16_t result; @@ -535,44 +582,7 @@ inline void upd7220_device::write_vram(uint8_t type, uint8_t mod) for(int i = 0; i < m_figs.m_dc + 1; i++) { - switch(mod & 3) - { - case 0x00: //replace - if(type == 0) - writeword(m_ead*2+0, result); - if(type == 2) - writebyte(m_ead*2+0, result & 0xff); - if(type == 3) - writebyte(m_ead*2+1, result >> 8); - break; - case 0x01: //complement - if(type == 0) - writeword(m_ead*2+0, readword(m_ead*2+0) ^ result); - if(type == 2) - writebyte(m_ead*2+0, readbyte(m_ead*2+0) ^ (result & 0xff)); - if(type == 3) - writebyte(m_ead*2+1, readbyte(m_ead*2+1) ^ (result >> 8)); - break; - case 0x02: //reset to zero - if(type == 0) - writeword(m_ead*2+0, readword(m_ead*2+0) & ~result); - if(type == 2) - writebyte(m_ead*2+0, readbyte(m_ead*2+0) & ~(result & 0xff)); - if(type == 3) - writebyte(m_ead*2+1, readbyte(m_ead*2+1) & ~(result >> 8)); - break; - case 0x03: //set to one - if(type == 0) - writeword(m_ead*2+0, readword(m_ead*2+0) | result); - if(type == 2) - writebyte(m_ead*2+0, readbyte(m_ead*2+0) | (result & 0xff)); - if(type == 3) - writebyte(m_ead*2+1, readbyte(m_ead*2+1) | (result >> 8)); - break; - } - - m_ead += x_dir[m_figs.m_dir] + (y_dir[m_figs.m_dir] * m_pitch); - m_ead &= 0x3ffff; + write_vram(type, mod, result); } } @@ -1334,7 +1344,7 @@ void upd7220_device::process_fifo() LOG("%02x = %02x %02x (%c) %06x %04x\n",m_cr,m_pr[2],m_pr[1],m_pr[1]?m_pr[1]:' ',m_ead,m_figs.m_dc); fifo_set_direction(FIFO_WRITE); - write_vram((m_cr & 0x18) >> 3,m_cr & 3); + wdat((m_cr & 0x18) >> 3,m_cr & 3); reset_figs_param(); m_param_ptr = 1; } @@ -1413,7 +1423,7 @@ void upd7220_device::process_fifo() case COMMAND_RDAT: /* read data from display memory */ fifo_set_direction(FIFO_READ); - read_vram((m_cr & 0x18) >> 3,m_cr & 3); + rdat((m_cr & 0x18) >> 3,m_cr & 3); m_sr |= UPD7220_SR_DATA_READY; break; @@ -1445,11 +1455,17 @@ void upd7220_device::process_fifo() break; case COMMAND_DMAR: /* DMA read request */ - logerror("uPD7220 Unimplemented command DMAR\n"); + m_dma_type = (m_cr >> 3) & 3; + m_dma_mod = m_cr & 3; + m_dma_transfer_length = (m_figs.m_dc + 1) * (m_figs.m_d + 2); + start_dma(); break; case COMMAND_DMAW: /* DMA write request */ - logerror("uPD7220 Unimplemented command DMAW\n"); + m_dma_type = (m_cr >> 3) & 3; + m_dma_mod = m_cr & 3; + m_dma_transfer_length = (m_figs.m_dc + 1) * (m_figs.m_d + 1); + start_dma(); break; } } @@ -1464,7 +1480,7 @@ void upd7220_device::continue_command() // continue RDAT command when data to read are larger than the FIFO (a5105 and dmv text scrolling) if (m_figs.m_dc && translate_command(m_cr) == COMMAND_RDAT) { - read_vram((m_cr & 0x18) >> 3, m_cr & 3); + rdat((m_cr & 0x18) >> 3, m_cr & 3); m_sr |= UPD7220_SR_DATA_READY; } } @@ -1494,7 +1510,6 @@ uint8_t upd7220_device::read(offs_t offset) /* TODO: timing of these */ m_sr &= ~UPD7220_SR_DRAWING_IN_PROGRESS; - m_sr &= ~UPD7220_SR_DMA_EXECUTE; } return data; @@ -1530,7 +1545,31 @@ void upd7220_device::write(offs_t offset, uint8_t data) uint8_t upd7220_device::dack_r() { - return 0; + uint8_t result = 0; + switch(m_dma_type) { + case 0: + if (m_dma_transfer_length % 2 == 0) { + m_dma_data = read_vram(); + result = m_dma_data & 0xff; + } else { + result = (m_dma_data >> 8) & 0xff; + } + break; + case 2: + m_dma_data = read_vram(); + result = m_dma_data & 0xff; + break; + case 3: + m_dma_data = read_vram(); + result = (m_dma_data >> 8) & 0xff; + break; + default: + logerror("uPD7220 Invalid DMA Transfer Type\n"); + } + if (--m_dma_transfer_length == 0) { + stop_dma(); + } + return result; } @@ -1540,6 +1579,46 @@ uint8_t upd7220_device::dack_r() void upd7220_device::dack_w(uint8_t data) { + switch(m_dma_type) { + case 0: + if (m_dma_transfer_length % 2) { + m_dma_data = ((m_dma_data & 0xff) | data << 8) & m_mask; + write_vram(m_dma_type, m_dma_mod, m_dma_data); + } else { + m_dma_data = (m_dma_data & 0xff00) | data; + } + break; + case 2: + m_dma_data = data & (m_mask & 0xff); + write_vram(m_dma_type, m_dma_mod, m_dma_data); + break; + case 3: + m_dma_data = (data << 8) & (m_mask & 0xff); + write_vram(m_dma_type, m_dma_mod, m_dma_data); + break; + default: + logerror("uPD7220 Invalid DMA Transfer Type\n"); + } + if (--m_dma_transfer_length == 0) { + stop_dma(); + } +} + +void upd7220_device::start_dma() +{ + if ((m_sr & UPD7220_SR_DMA_EXECUTE) == 0) { + m_write_drq(ASSERT_LINE); + m_sr |= UPD7220_SR_DMA_EXECUTE; + } +} + +void upd7220_device::stop_dma() +{ + if ((m_sr & UPD7220_SR_DMA_EXECUTE) == UPD7220_SR_DMA_EXECUTE) { + m_write_drq(CLEAR_LINE); + m_sr &= ~UPD7220_SR_DMA_EXECUTE; + reset_figs_param(); + } } diff --git a/src/devices/video/upd7220.h b/src/devices/video/upd7220.h index d1f8806c6ac..77011958ec5 100644 --- a/src/devices/video/upd7220.h +++ b/src/devices/video/upd7220.h @@ -90,6 +90,8 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; virtual space_config_vector memory_space_config() const override; + void start_dma(); + void stop_dma(); private: enum { @@ -112,8 +114,10 @@ private: inline void update_blank_timer(int state); inline void recompute_parameters(); inline void reset_figs_param(); - inline void read_vram(uint8_t type, uint8_t mod); - inline void write_vram(uint8_t type, uint8_t mod); + inline void rdat(uint8_t type, uint8_t mod); + inline uint16_t read_vram(); + inline void wdat(uint8_t type, uint8_t mod); + inline void write_vram(uint8_t type, uint8_t mod, uint16_t data); inline void get_text_partition(int index, uint32_t *sad, uint16_t *len, int *im, int *wd); inline void get_graphics_partition(int index, uint32_t *sad, uint16_t *len, int *im, int *wd); @@ -139,6 +143,11 @@ private: devcb_write_line m_write_vsync; devcb_write_line m_write_blank; + uint8_t m_dma_type; // DMA transfer type + uint8_t m_dma_mod; // DMA transfer mode + uint16_t m_dma_data; // current word transferred via DMA + uint32_t m_dma_transfer_length; // DMA transfer length in bytes + uint16_t m_mask; // mask register uint8_t m_pitch; // number of word addresses in display memory in the horizontal direction uint32_t m_ead; // execute word address diff --git a/src/mame/drivers/qx10.cpp b/src/mame/drivers/qx10.cpp index b2e413679ad..4e51c18afc9 100644 --- a/src/mame/drivers/qx10.cpp +++ b/src/mame/drivers/qx10.cpp @@ -112,8 +112,6 @@ private: DECLARE_WRITE_LINE_MEMBER( qx10_upd765_interrupt ); void fdd_motor_w(uint8_t data); uint8_t qx10_30_r(); - uint8_t gdc_dack_r(); - void gdc_dack_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER( tc_w ); uint8_t mc146818_r(offs_t offset); void mc146818_w(offs_t offset, uint8_t data); @@ -445,17 +443,6 @@ WRITE_LINE_MEMBER(qx10_state::dma_hrq_changed) m_dma_1->hack_w(state); } -uint8_t qx10_state::gdc_dack_r() -{ - logerror("GDC DACK read\n"); - return 0; -} - -void qx10_state::gdc_dack_w(uint8_t data) -{ - logerror("GDC DACK write %02x\n", data); -} - WRITE_LINE_MEMBER( qx10_state::tc_w ) { /* floppy terminal count */ @@ -674,6 +661,7 @@ void qx10_state::machine_start() void qx10_state::machine_reset() { m_dma_1->dreq0_w(1); + m_dma_1->dreq1_w(1); m_spkr_enable = 0; m_pit1_out0 = 1; @@ -836,11 +824,9 @@ void qx10_state::qx10(machine_config &config) m_dma_1->in_memr_callback().set(FUNC(qx10_state::memory_read_byte)); m_dma_1->out_memw_callback().set(FUNC(qx10_state::memory_write_byte)); m_dma_1->in_ior_callback<0>().set(m_fdc, FUNC(upd765a_device::dma_r)); - m_dma_1->in_ior_callback<1>().set(FUNC(qx10_state::gdc_dack_r)); - //m_dma_1->in_ior_callback<2>().set(m_hgdc, FUNC(upd7220_device::dack_r)); + m_dma_1->in_ior_callback<1>().set(m_hgdc, FUNC(upd7220_device::dack_r)); m_dma_1->out_iow_callback<0>().set(m_fdc, FUNC(upd765a_device::dma_w)); - m_dma_1->out_iow_callback<1>().set(FUNC(qx10_state::gdc_dack_w)); - //m_dma_1->out_iow_callback<2>().set(m_hgdc, FUNC(upd7220_device::dack_w)); + m_dma_1->out_iow_callback<1>().set(m_hgdc, FUNC(upd7220_device::dack_w)); AM9517A(config, m_dma_2, MAIN_CLK/4); I8255(config, m_ppi, 0); @@ -849,6 +835,7 @@ void qx10_state::qx10(machine_config &config) m_hgdc->set_addrmap(0, &qx10_state::upd7220_map); m_hgdc->set_display_pixels(FUNC(qx10_state::hgdc_display_pixels)); m_hgdc->set_draw_text(FUNC(qx10_state::hgdc_draw_text)); + m_hgdc->drq_wr_callback().set(m_dma_1, FUNC(am9517a_device::dreq1_w)).invert(); m_hgdc->set_screen("screen"); MC146818(config, m_rtc, 32.768_kHz_XTAL); -- cgit v1.2.3 From 9484211f22d594cdb3ddce40f0376e78be018655 Mon Sep 17 00:00:00 2001 From: ClawGrip Date: Tue, 20 Apr 2021 20:19:12 +0200 Subject: rfslots8085.cpp: The PCB only has 6 dipswitches (#7983) * rfslots8085.cpp: The PCB only has 6 dipswitches * Add anonymous namespace --- src/mame/drivers/rfslots8085.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/rfslots8085.cpp b/src/mame/drivers/rfslots8085.cpp index 94eae5ecc82..c5cfa538d00 100644 --- a/src/mame/drivers/rfslots8085.cpp +++ b/src/mame/drivers/rfslots8085.cpp @@ -38,6 +38,9 @@ Recreativos Franco used this hardware from 1987 to 1992 on several machines, inc #include "sound/ay8910.h" #include "speaker.h" +namespace +{ + class rfslots8085_state : public driver_device { public: @@ -89,8 +92,6 @@ void rfslots8085_state::sound_io_map(address_map &map) static INPUT_PORTS_START(unkrfslt) PORT_START("DSW") // 1 x 6-dips bank - PORT_BIT(0x80, 0x80, IPT_UNKNOWN) - PORT_BIT(0x40, 0x40, IPT_UNKNOWN) PORT_BIT(0x20, 0x20, IPT_UNKNOWN) PORT_BIT(0x10, 0x10, IPT_UNKNOWN) PORT_BIT(0x08, 0x08, IPT_UNKNOWN) @@ -184,5 +185,7 @@ ROM_START(unkrfslt) ROM_IGNORE( 0x3000 ) // 0xff filled and it's outside of the 8035's global address mask (fff) ROM_END +} // anonymous namespace + // Date "25-05-87" engraved on the PCB GAME( 1987?, unkrfslt, 0, unkrfslt, unkrfslt, rfslots8085_state, empty_init, ROT0, "Recreativos Franco", "unknown Recreativos Franco slot machine", MACHINE_IS_SKELETON_MECHANICAL ) -- cgit v1.2.3 From 5c3ded77a778232ffc8c9fd31bbd5cd902a3046d Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 20 Apr 2021 21:01:55 +0200 Subject: ibm5170: fix validity error --- hash/ibm5170.xml | 2 +- src/devices/machine/chessmachine.cpp | 4 ---- src/devices/machine/chessmachine.h | 4 ++-- src/devices/machine/smartboard.cpp | 7 ------- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/hash/ibm5170.xml b/hash/ibm5170.xml index 60fced9d55d..f016676d463 100644 --- a/hash/ibm5170.xml +++ b/hash/ibm5170.xml @@ -5822,8 +5822,8 @@ license:CC0 SmartBoard Driver (DOS) 1995 - Tasc + diff --git a/src/devices/machine/chessmachine.cpp b/src/devices/machine/chessmachine.cpp index 08e45ebb581..cd80fce19e5 100644 --- a/src/devices/machine/chessmachine.cpp +++ b/src/devices/machine/chessmachine.cpp @@ -62,10 +62,6 @@ void chessmachine_device::device_start() // resolve callbacks m_data_out.resolve_safe(); - // zerofill - m_bootrom_enabled = false; - m_latch[0] = m_latch[1] = 0; - // register for savestates save_item(NAME(m_bootrom_enabled)); save_item(NAME(m_latch)); diff --git a/src/devices/machine/chessmachine.h b/src/devices/machine/chessmachine.h index db670ff8dc6..b1a11b459f1 100644 --- a/src/devices/machine/chessmachine.h +++ b/src/devices/machine/chessmachine.h @@ -46,11 +46,11 @@ private: devcb_write_line m_data_out; - u8 m_latch[2]; + u8 m_latch[2] = { 0, 0 }; void sync0_callback(void *ptr, s32 param); void sync1_callback(void *ptr, s32 param); - bool m_bootrom_enabled; + bool m_bootrom_enabled = false; void install_bootrom(bool enable); TIMER_DEVICE_CALLBACK_MEMBER(disable_bootrom) { install_bootrom(false); } u32 disable_bootrom_r(); diff --git a/src/devices/machine/smartboard.cpp b/src/devices/machine/smartboard.cpp index 674568c5365..fe1dc0b5d08 100644 --- a/src/devices/machine/smartboard.cpp +++ b/src/devices/machine/smartboard.cpp @@ -58,16 +58,9 @@ enum SB30_BLACK_PAWN8 }; -//************************************************************************** -// DEVICE DEFINITIONS -//************************************************************************** DEFINE_DEVICE_TYPE(TASC_SB30, tasc_sb30_device, "tasc_sb30", "Tasc SmartBoard SB30") -//************************************************************************** -// LIVE DEVICE -//************************************************************************** - //------------------------------------------------- // tasc_sb30_device - constructor //------------------------------------------------- -- cgit v1.2.3 From 937b1fd8079946d1d2e6ad6f0ecb3c7d3d73a274 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Wed, 21 Apr 2021 05:56:52 +1000 Subject: radionic: fixed rtc, and floppy reading. Confirmed crystals. --- src/mame/drivers/radionic.cpp | 53 +++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/src/mame/drivers/radionic.cpp b/src/mame/drivers/radionic.cpp index eb84efa7a22..772105d3cf2 100644 --- a/src/mame/drivers/radionic.cpp +++ b/src/mame/drivers/radionic.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Robbbert /*************************************************************************** -Komtek 1 (Radionic) memory map +Komtek 1 (Radionic R1001) memory map 0000-37ff ROM R D0-D7 37de UART status R/W D0-D7 @@ -28,10 +28,6 @@ Komtek 1 (Radionic) memory map 3c00-3fff video RAM R/W D0-D5,D7 (or D0-D7) 4000-ffff RAM -Interrupts: -IRQ mode 1 -NMI - Printer: Level II usually 37e8 Cassette baud rate: 500 baud @@ -44,7 +40,7 @@ FF: - bit 6 remembers the 32/64 screen mode (inverted) - bit 7 is for reading from a cassette -Shift and Right-arrow will enable 32 cpl, if the hardware allows it. +Shift and Right-arrow will enable 32 cpl. SYSTEM commands: - Press Break (End key) to quit @@ -55,7 +51,7 @@ SYSTEM commands: About the RTC - The time is incremented while ever the cursor is flashing. It is stored in a series of bytes in the computer's work area. The bytes are in a certain order, this is: - seconds, minutes, hours, year, day, month. The seconds are stored at 0x4041. + seconds, minutes, hours, days. The seconds are stored at 0x4041. A reboot always sets the time to zero. Radionic has 16 colours with a byte at 350B controlling the operation. See manual. @@ -71,8 +67,8 @@ To Do / Status: - Writing to floppy is problematic; freezing/crashing are common issues. radionic: works - floppy not working (@6C0, DRQ never gets set) - add colour + add colour (no schematic; manual says jumpers set the Auto-Colour, but this isn't + documented anywhere). expansion-box? uart @@ -81,6 +77,7 @@ radionic: works #include "emu.h" #include "includes/trs80.h" #include "machine/i8255.h" +#define MASTER_XTAL 12164800 class radionic_state : public trs80_state @@ -94,6 +91,7 @@ public: void radionic(machine_config &config); private: + INTERRUPT_GEN_MEMBER(rtc_via_nmi); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void mem_map(address_map &map); @@ -236,10 +234,14 @@ static INPUT_PORTS_START( radionic ) PORT_BIT(0xfe, 0x00, IPT_UNUSED) PORT_START("CONFIG") - PORT_CONFNAME( 0x80, 0x00, "Floppy Disc Drives") - PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) - PORT_CONFSETTING( 0x80, DEF_STR( On ) ) - PORT_BIT(0x7f, 0x7f, IPT_UNUSED) + PORT_CONFNAME( 0xc0, 0x00, "Floppy and RTC") // Floppy doesn't work if RTC is on, so interlink them. + PORT_CONFSETTING( 0x00, "Both Off" ) + PORT_CONFSETTING( 0x80, "RTC off, Floppy On" ) + PORT_CONFSETTING( 0x40, "RTC on, Floppy Off" ) + PORT_CONFNAME( 0x30, 0x00, "Colour") // This isn't hooked up yet + PORT_CONFSETTING( 0x00, "Monochrome" ) + PORT_CONFSETTING( 0x10, "Auto Colour" ) + PORT_CONFSETTING( 0x30, "Programmable Colour" ) PORT_START("E9") // these are the power-on uart settings PORT_BIT(0x07, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -318,6 +320,12 @@ uint32_t radionic_state::screen_update(screen_device &screen, bitmap_ind16 &bitm return 0; } +INTERRUPT_GEN_MEMBER(radionic_state::rtc_via_nmi) +{ + if (BIT(m_io_config->read(), 6)) + m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::from_nsec(1)); +} + void radionic_state::floppy_formats(format_registration &fr) { fr.add(FLOPPY_JV1_FORMAT); @@ -334,23 +342,18 @@ static void radionic_floppies(device_slot_interface &device) device.option_add("80t_qd", FLOPPY_525_QD); } - void radionic_state::radionic(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 3579000 / 2); - //m_maincpu->set_clock(12_MHz_XTAL / 6); // or 3.579MHz / 2 (selectable?) + // Photos from Incog show 12.1648, and 3.579545 xtals. The schematic seems to just approximate these values. + Z80(config, m_maincpu, 3.579545_MHz_XTAL / 2); + //m_maincpu->set_clock(MASTER_XTAL / 6); // or 3.579545_MHz_XTAL / 2 (selectable?) m_maincpu->set_addrmap(AS_PROGRAM, &radionic_state::mem_map); m_maincpu->set_addrmap(AS_IO, &radionic_state::io_map); - // Komtek I "User Friendly Manual" calls for "Z80 running at 1.97 MHz." This likely refers to an alternate NTSC version - // whose master clock was approximately 11.8005 MHz (6 times ~1.966 MHz and 750 times 15.734 kHz). Though the schematics - // provide the main XTAL frequency as 12 MHz, that they also include a 3.579 MHz XTAL suggests this possibility. - m_maincpu->set_periodic_int(FUNC(radionic_state::rtc_interrupt), attotime::from_hz(40)); - m_maincpu->set_periodic_int(FUNC(radionic_state::nmi_line_pulse), attotime::from_hz(12_MHz_XTAL / 12 / 16384)); + m_maincpu->set_periodic_int(FUNC(radionic_state::rtc_via_nmi), attotime::from_hz(MASTER_XTAL / 12 / 16384)); // breaks floppy /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(12_MHz_XTAL, 768, 0, 512, 312, 0, 256); + screen.set_raw(MASTER_XTAL, 768, 0, 512, 312, 0, 256); screen.set_screen_update(FUNC(radionic_state::screen_update)); screen.set_palette("palette"); @@ -427,5 +430,5 @@ ROM_START(radionic) ROM_END -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1983, radionic, 0, trs80l2, radionic, radionic, radionic_state, empty_init, "Komtek", "Radionic", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1983, radionic, 0, trs80l2, radionic, radionic, radionic_state, empty_init, "Komtek", "Radionic R1001/Komtek 1", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -- cgit v1.2.3 From 11ae1bb49316fa9ccd0bfc1f9d06feb8f54db0be Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 20 Apr 2021 22:27:51 +0200 Subject: clifront: -romident has no use for mediapath, but it does use hashpath --- src/frontend/mame/clifront.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index 2adb4e3ecc1..661337e4b51 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -1442,7 +1442,7 @@ void cli_frontend::romident(const std::vector &args) // create our own copy of options for the purposes of ROM identification // so we are not "polluted" with driver-specific slot/image options emu_options options; - options.set_value(OPTION_MEDIAPATH, m_options.media_path(), OPTION_PRIORITY_DEFAULT); + options.set_value(OPTION_HASHPATH, m_options.hash_path(), OPTION_PRIORITY_DEFAULT); media_identifier ident(options); -- cgit v1.2.3 From 1c48809459f24f96e864290887493af6612fb0fd Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 20 Apr 2021 22:54:21 +0200 Subject: media_ident: add space to prevent long strings concat when printing results --- src/frontend/mame/media_ident.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/mame/media_ident.cpp b/src/frontend/mame/media_ident.cpp index b5ae8ef578a..690996145b2 100644 --- a/src/frontend/mame/media_ident.cpp +++ b/src/frontend/mame/media_ident.cpp @@ -209,12 +209,12 @@ void media_identifier::digest_file(std::vector &info, char const *pat m_total++; if (err != CHDERR_NONE) { - osd_printf_info("%-20sNOT A CHD\n", core_filename_extract_base(path)); + osd_printf_info("%-20s NOT A CHD\n", core_filename_extract_base(path)); m_nonroms++; } else if (!chd.compressed()) { - osd_printf_info("%-20sis a writeable CHD\n", core_filename_extract_base(path)); + osd_printf_info("%-20s is a writeable CHD\n", core_filename_extract_base(path)); } else { @@ -404,7 +404,7 @@ void media_identifier::print_results(std::vector const &info) { for (file_info const &file : info) { - osd_printf_info("%-20s", core_filename_extract_base(file.name())); + osd_printf_info("%-20s ", core_filename_extract_base(file.name())); if (file.matches().empty()) { osd_printf_info("NO MATCH\n"); @@ -416,10 +416,10 @@ void media_identifier::print_results(std::vector const &info) for (match_data const &match : file.matches()) { if (!first) - osd_printf_info("%-20s", ""); + osd_printf_info("%-20s ", ""); first = false; osd_printf_info( - "= %s%-20s %-10s %s%s\n", + "= %s%-20s %-10s %s%s\n", match.bad() ? "(BAD) " : "", match.romname().c_str(), match.shortname().c_str(), -- cgit v1.2.3 From f2bc78e831c1b1cf986ef8ae9f532f83e985555f Mon Sep 17 00:00:00 2001 From: Brian Johnson Date: Wed, 21 Apr 2021 00:22:18 -0400 Subject: qx10: allocate enough vram for color mode --- src/mame/drivers/qx10.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/qx10.cpp b/src/mame/drivers/qx10.cpp index 4e51c18afc9..91ba7edad9c 100644 --- a/src/mame/drivers/qx10.cpp +++ b/src/mame/drivers/qx10.cpp @@ -715,7 +715,7 @@ GFXDECODE_END void qx10_state::video_start() { // allocate memory - m_video_ram = make_unique_clear(0x30000); + m_video_ram = make_unique_clear(0x60000); } void qx10_state::qx10_palette(palette_device &palette) const -- cgit v1.2.3 From 782d8276708eedae93374967dbef05f20d4a9bb3 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Wed, 21 Apr 2021 02:34:15 -0700 Subject: ymfm: Check for decay->sustain transitions even if we just transitioned from attack->decay. Affects the cymbal sounds in shinobi. --- src/devices/sound/ymfm.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/devices/sound/ymfm.cpp b/src/devices/sound/ymfm.cpp index df9d87584ab..abea6fa365a 100644 --- a/src/devices/sound/ymfm.cpp +++ b/src/devices/sound/ymfm.cpp @@ -2406,10 +2406,16 @@ void ymfm_operator::clock_ssg_eg_state() template void ymfm_operator::clock_envelope(u32 env_counter) { - // handle attack->decay and decay->sustain transitions + // handle attack->decay transitions if (m_env_state == YMFM_ENV_ATTACK && m_env_attenuation == 0) m_env_state = YMFM_ENV_DECAY; - else if (m_env_state == YMFM_ENV_DECAY && m_env_attenuation >= m_cache.eg_sustain) + + // handle decay->sustain transitions; it is important to do this immediately + // after the attack->decay transition above in the event that the sustain level + // is set to 0 (in which case we will skip right to sustain without doing any + // decay); as an example where this can be heard, check the cymbals sound + // in channel 0 of shinobi's test mode sound #5 + if (m_env_state == YMFM_ENV_DECAY && m_env_attenuation >= m_cache.eg_sustain) m_env_state = YMFM_ENV_SUSTAIN; // fetch the appropriate 6-bit rate value from the cache -- cgit v1.2.3 From 7f64e4fd7e2b2c442de7974d9ea3a1d0af489a30 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Wed, 21 Apr 2021 23:20:27 +1000 Subject: radionic: added colour --- src/mame/drivers/radionic.cpp | 156 +++++++++++++++++++++++++++++++++--------- src/mame/includes/trs80.h | 2 +- 2 files changed, 126 insertions(+), 32 deletions(-) diff --git a/src/mame/drivers/radionic.cpp b/src/mame/drivers/radionic.cpp index 772105d3cf2..2375715fe1d 100644 --- a/src/mame/drivers/radionic.cpp +++ b/src/mame/drivers/radionic.cpp @@ -25,8 +25,8 @@ Komtek 1 (Radionic R1001) memory map 37ef data R/W D0-D7 3800-38ff keyboard matrix R D0-D7 3900-3bff unused - kbd mirrored -3c00-3fff video RAM R/W D0-D5,D7 (or D0-D7) -4000-ffff RAM +3c00-3fff static video RAM and colour ram, banked +4000-ffff dynamic main RAM Printer: Level II usually 37e8 @@ -54,23 +54,39 @@ About the RTC - The time is incremented while ever the cursor is flashing. It is seconds, minutes, hours, days. The seconds are stored at 0x4041. A reboot always sets the time to zero. -Radionic has 16 colours with a byte at 350B controlling the operation. See manual. - +About colours - The computer has 16 colours with a byte at 350B controlling the operation. + POKE 13579,2 : monochrome + POKE 13579,4 : programmable colour + POKE 13579,12 : automatic colour + There's no schematic or documentation of the Colour Board, however some more information... + - It doesn't have to be 350B (13579), anything in the 35xx range will do. + - d0 : write of vram goes to vram (0 = yes, 1 = no) + - d1 : write of vram goes to colour ram (0 = yes, 1 = no) + - d2 : colour enable (0 = monochrome, 1 = colour) + - d3 : programmable or automatic (0 = programmable, 1 = automatic) + List of colour codes: + 0 = off white; 1 = light green; 2 = red; 3 = dark green; 4 = blue; 5 = greenish blue; + 6 = rose red; 7 = dusty blue; 8 = greenish yellow; 9 = light yellow (greenish); 10 = golden red + 11 = grey; 12 = reddish green; 13 = pale yellow; 14 = orange; 15 = ogre green. + As you can see, the descriptions are quite vague, and appear to be background only. The foreground + is assumed to always be white. + Automatic is a preset colour set by internal jumpers. + - No schematic or technical info for the colour board + - No information on the settings of the Automatic mode + - The "User Friendly Manual" has a bunch of mistakes (page 15). + - When reading video ram, it is not known how this is affected if colour ram is enabled + - No colour programs exist in the wild, so nothing can be verified. + So, some guesswork has been done. ******************************************************************************************************** To Do / Status: -------------- -- For those machines that allow it, add cass2 as an image device and hook it up. - Difficulty loading real tapes. - Writing to floppy is problematic; freezing/crashing are common issues. - -radionic: works - add colour (no schematic; manual says jumpers set the Auto-Colour, but this isn't - documented anywhere). - expansion-box? - uart +- Add rs232 board +- Add fdc doubler (only some info available) *******************************************************************************************************/ @@ -92,13 +108,18 @@ public: private: INTERRUPT_GEN_MEMBER(rtc_via_nmi); + void radionic_palette(palette_device &palette) const; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - + std::unique_ptr m_vram; // video ram + std::unique_ptr m_cram; // colour ram + void machine_start() override; + void cctrl_w(offs_t offset, u8 data); + void video_w(offs_t offset, u8 data); + u8 video_r(offs_t offset); void mem_map(address_map &map); void io_map(address_map &map); - static void floppy_formats(format_registration &fr); - + u8 m_cctrl = 0; required_device m_ppi; }; @@ -107,8 +128,7 @@ void radionic_state::mem_map(address_map &map) map(0x0000, 0x37ff).rom(); // Optional external RS232 module with 8251 //map(0x3400, 0x3401).mirror(0xfe).rw("uart2", FUNC(i8251_device::read), FUNC(i8251_device::write)); - // Internal colour controls (need details) - //map(0x3500, 0x35ff).w(FUNC(radionic_state::colour_w)); + map(0x3500, 0x35ff).w(FUNC(radionic_state::cctrl_w)); // Internal interface to external slots map(0x3600, 0x3603).mirror(0xfc).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0x37de, 0x37de).rw(FUNC(radionic_state::sys80_f9_r), FUNC(radionic_state::sys80_f8_w)); @@ -118,7 +138,7 @@ void radionic_state::mem_map(address_map &map) map(0x37e8, 0x37eb).rw(FUNC(radionic_state::printer_r), FUNC(radionic_state::printer_w)); map(0x37ec, 0x37ef).rw(FUNC(radionic_state::fdc_r), FUNC(radionic_state::fdc_w)); map(0x3800, 0x3bff).r(FUNC(radionic_state::keyboard_r)); - map(0x3c00, 0x3fff).ram().share(m_p_videoram); + map(0x3c00, 0x3fff).rw(FUNC(radionic_state::video_r), FUNC(radionic_state::video_w)); map(0x4000, 0xffff).ram(); } @@ -238,7 +258,7 @@ static INPUT_PORTS_START( radionic ) PORT_CONFSETTING( 0x00, "Both Off" ) PORT_CONFSETTING( 0x80, "RTC off, Floppy On" ) PORT_CONFSETTING( 0x40, "RTC on, Floppy Off" ) - PORT_CONFNAME( 0x30, 0x00, "Colour") // This isn't hooked up yet + PORT_CONFNAME( 0x30, 0x00, "Colour") // 2 switches on the side PORT_CONFSETTING( 0x00, "Monochrome" ) PORT_CONFSETTING( 0x10, "Auto Colour" ) PORT_CONFSETTING( 0x30, "Programmable Colour" ) @@ -260,6 +280,36 @@ static INPUT_PORTS_START( radionic ) INPUT_PORTS_END +/* Levels are unknown - guessing */ +static constexpr rgb_t radionic_pens[] = +{ + // colour + { 200, 200, 200 }, // 0 off white + { 0, 255, 0 }, // 1 light green + { 255, 0, 0 }, // 2 red + { 0, 128, 0 }, // 3 dark green + { 0, 0, 255 }, // 4 blue + { 0, 255, 255 }, // 5 greenish blue + { 255, 3, 62 }, // 6 rose red + { 136, 155, 174 }, // 7 dusty blue + { 200, 200, 0 }, // 8 greenish yellow + { 173, 255, 47 }, // 9 light yellow (greenish) + { 207, 33, 33 }, // 10 golden red + { 128, 128, 128 }, // 11 grey + { 220, 255, 0 }, // 12 reddish green + { 255, 255, 191 }, // 13 pale yellow + { 247, 170, 0 }, // 14 orange + { 90, 156, 57 }, // 15 ogre green + // monochrome + { 250, 250, 250 }, // 16 white + { 0, 0, 0 } // 17 black +}; + +void radionic_state::radionic_palette(palette_device &palette) const +{ + palette.set_pen_colors(0, radionic_pens); +} + /**************************** F4 CHARACTER DISPLAYER ***********************************************************/ static const gfx_layout radionic_charlayout = { @@ -284,6 +334,12 @@ uint32_t radionic_state::screen_update(screen_device &screen, bitmap_ind16 &bitm uint16_t sy=0,ma=0; uint8_t cols = BIT(m_mode, 0) ? 32 : 64; uint8_t skip = BIT(m_mode, 0) ? 2 : 1; + // colours have to be enabled both by a poke and by switches on the side of the unit + bool col_en = BIT(m_cctrl, 2) && BIT(m_io_config->read(), 4); + bool auto_en = BIT(m_cctrl, 3) || !BIT(m_io_config->read(), 5); + u8 fg = 16, bg = 17; // monochrome + if (col_en && auto_en) + bg = 4; // automatic colour if (m_mode != m_size_store) { @@ -299,20 +355,22 @@ uint32_t radionic_state::screen_update(screen_device &screen, bitmap_ind16 &bitm for (uint16_t x = ma; x < ma + 64; x+=skip) { - uint8_t chr = m_p_videoram[x]; + uint8_t chr = m_vram[x]; + if (col_en && !auto_en) + bg = m_cram[x] & 15; /* get pattern of pixels for that character scanline */ uint8_t gfx = m_p_chargen[(chr<<3) | (ra & 7) | (ra & 8) << 8]; /* Display a scanline of a character (8 pixels) */ - *p++ = BIT(gfx, 0); - *p++ = BIT(gfx, 1); - *p++ = BIT(gfx, 2); - *p++ = BIT(gfx, 3); - *p++ = BIT(gfx, 4); - *p++ = BIT(gfx, 5); - *p++ = BIT(gfx, 6); - *p++ = BIT(gfx, 7); + *p++ = BIT(gfx, 0) ? fg : bg; + *p++ = BIT(gfx, 1) ? fg : bg; + *p++ = BIT(gfx, 2) ? fg : bg; + *p++ = BIT(gfx, 3) ? fg : bg; + *p++ = BIT(gfx, 4) ? fg : bg; + *p++ = BIT(gfx, 5) ? fg : bg; + *p++ = BIT(gfx, 6) ? fg : bg; + *p++ = BIT(gfx, 7) ? fg : bg; } } ma+=64; @@ -320,10 +378,46 @@ uint32_t radionic_state::screen_update(screen_device &screen, bitmap_ind16 &bitm return 0; } +void radionic_state::machine_start() +{ + trs80_state::machine_start(); + save_item(NAME(m_cctrl)); + + // video ram + m_vram = make_unique_clear(0x0800); + save_pointer(NAME(m_vram), 0x0800); + + // colour + m_cram = make_unique_clear(0x0800); + save_pointer(NAME(m_cram), 0x0800); +} + INTERRUPT_GEN_MEMBER(radionic_state::rtc_via_nmi) { if (BIT(m_io_config->read(), 6)) - m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::from_nsec(1)); + m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::from_usec(100)); +} + +u8 radionic_state::video_r(offs_t offset) +{ + // undocumented; guessing + if ((m_cctrl & 3) == 2) + return m_cram[offset]; + else + return m_vram[offset]; +} + +void radionic_state::video_w(offs_t offset, u8 data) +{ + if (!BIT(m_cctrl, 0)) + m_vram[offset] = data; + if (!BIT(m_cctrl, 1)) + m_cram[offset] = data; +} + +void radionic_state::cctrl_w(offs_t offset, u8 data) +{ + m_cctrl = data & 15; } void radionic_state::floppy_formats(format_registration &fr) @@ -346,10 +440,10 @@ void radionic_state::radionic(machine_config &config) { // Photos from Incog show 12.1648, and 3.579545 xtals. The schematic seems to just approximate these values. Z80(config, m_maincpu, 3.579545_MHz_XTAL / 2); - //m_maincpu->set_clock(MASTER_XTAL / 6); // or 3.579545_MHz_XTAL / 2 (selectable?) + //m_maincpu->set_clock(MASTER_XTAL / 6); // early machines only, before the floppy interface was added m_maincpu->set_addrmap(AS_PROGRAM, &radionic_state::mem_map); m_maincpu->set_addrmap(AS_IO, &radionic_state::io_map); - m_maincpu->set_periodic_int(FUNC(radionic_state::rtc_via_nmi), attotime::from_hz(MASTER_XTAL / 12 / 16384)); // breaks floppy + m_maincpu->set_periodic_int(FUNC(radionic_state::rtc_via_nmi), attotime::from_hz(MASTER_XTAL / 12 / 16384)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -358,7 +452,7 @@ void radionic_state::radionic(machine_config &config) screen.set_palette("palette"); GFXDECODE(config, "gfxdecode", "palette", gfx_radionic); - PALETTE(config, "palette", palette_device::MONOCHROME); + PALETTE(config, "palette", FUNC(radionic_state::radionic_palette), 18); // 16 colours + monochrome /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/includes/trs80.h b/src/mame/includes/trs80.h index 41e41b9f62b..712f22f09c4 100644 --- a/src/mame/includes/trs80.h +++ b/src/mame/includes/trs80.h @@ -100,7 +100,7 @@ protected: required_device m_maincpu; required_memory_region m_region_maincpu; required_region_ptr m_p_chargen; - required_shared_ptr m_p_videoram; + optional_shared_ptr m_p_videoram; optional_device m_centronics; optional_device m_cent_data_out; optional_device m_cent_status_in; -- cgit v1.2.3 From 94f305a9b085107f726afc9c87193afd427d741e Mon Sep 17 00:00:00 2001 From: ksherlock Date: Wed, 21 Apr 2021 09:22:05 -0400 Subject: kp = should be 0x106 (#7973) --- src/mame/drivers/apple2gs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp index 46bf3640bad..43c1846c8d5 100644 --- a/src/mame/drivers/apple2gs.cpp +++ b/src/mame/drivers/apple2gs.cpp @@ -836,7 +836,7 @@ WRITE_LINE_MEMBER(apple2gs_state::ay3600_data_ready_w) trans |= (special & 0x01) ? 0x0000 : 0x0200; // caps lock is bit 9 (active low) // hack in keypad equals because we can't find it in the IIe keymap (Sather doesn't show it in the matrix, but it's clearly on real platinum IIes) - if (m_lastchar == 0x146) + if (m_lastchar == 0x106) { m_transchar = '='; } @@ -2457,7 +2457,7 @@ u8 apple2gs_state::c000_r(offs_t offset) { ret |= 0x10; } - else if ((m_lastchar >= 0x109 && m_lastchar <= 0x10a) || (m_lastchar == 0x146)) + else if ((m_lastchar >= 0x109 && m_lastchar <= 0x10a) || (m_lastchar == 0x106)) { ret |= 0x10; } -- cgit v1.2.3 From 25b6d1fa977138e0d3be2daa8310343932c772c6 Mon Sep 17 00:00:00 2001 From: ClawGrip Date: Wed, 21 Apr 2021 15:23:22 +0200 Subject: rfslots8085.cpp: fix typo on game name (#7982) --- src/mame/drivers/rfslots8085.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/rfslots8085.cpp b/src/mame/drivers/rfslots8085.cpp index c5cfa538d00..ba971e9c5b1 100644 --- a/src/mame/drivers/rfslots8085.cpp +++ b/src/mame/drivers/rfslots8085.cpp @@ -21,7 +21,7 @@ Recreativos Franco used this hardware from 1987 to 1992 on several machines, inc -Baby Formula -Limon y Baby -Limon y Baby 100 - -Baby Afrojin Dakar 3 + -Baby Ajofrin Dakar 3 -El Tren -Baby Derby Etc. -- cgit v1.2.3 From be14bfe226bd90aba78a43860f17eff2860484a7 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Thu, 22 Apr 2021 01:27:56 +1000 Subject: radionic: added rs232 --- src/mame/drivers/radionic.cpp | 100 ++++++++++++++++++++---------------------- src/mame/includes/trs80.h | 2 +- 2 files changed, 48 insertions(+), 54 deletions(-) diff --git a/src/mame/drivers/radionic.cpp b/src/mame/drivers/radionic.cpp index 2375715fe1d..1fa698aaffc 100644 --- a/src/mame/drivers/radionic.cpp +++ b/src/mame/drivers/radionic.cpp @@ -92,7 +92,10 @@ To Do / Status: #include "emu.h" #include "includes/trs80.h" +#include "machine/i8251.h" #include "machine/i8255.h" +#include "machine/clock.h" +#include "bus/rs232/rs232.h" #define MASTER_XTAL 12164800 @@ -102,6 +105,8 @@ public: radionic_state(const machine_config &mconfig, device_type type, const char *tag) : trs80_state(mconfig, type, tag) , m_ppi(*this, "ppi") + , m_uart2(*this, "uart2") + , m_clock(*this, "uclock") { } void radionic(machine_config &config); @@ -113,28 +118,25 @@ private: std::unique_ptr m_vram; // video ram std::unique_ptr m_cram; // colour ram void machine_start() override; + void machine_reset() override; void cctrl_w(offs_t offset, u8 data); void video_w(offs_t offset, u8 data); u8 video_r(offs_t offset); void mem_map(address_map &map); - void io_map(address_map &map); static void floppy_formats(format_registration &fr); - u8 m_cctrl = 0; + u8 m_cctrl = 2; required_device m_ppi; + required_device m_uart2; + required_device m_clock; }; void radionic_state::mem_map(address_map &map) { map(0x0000, 0x37ff).rom(); - // Optional external RS232 module with 8251 - //map(0x3400, 0x3401).mirror(0xfe).rw("uart2", FUNC(i8251_device::read), FUNC(i8251_device::write)); + map(0x3400, 0x3401).mirror(0xfe).rw("uart2", FUNC(i8251_device::read), FUNC(i8251_device::write)); // optional RS-232 map(0x3500, 0x35ff).w(FUNC(radionic_state::cctrl_w)); - // Internal interface to external slots - map(0x3600, 0x3603).mirror(0xfc).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); - map(0x37de, 0x37de).rw(FUNC(radionic_state::sys80_f9_r), FUNC(radionic_state::sys80_f8_w)); - map(0x37df, 0x37df).rw(m_uart, FUNC(ay31015_device::receive), FUNC(ay31015_device::transmit)); + map(0x3600, 0x3603).mirror(0xfc).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write)); // interface to external sensors map(0x37e0, 0x37e3).rw(FUNC(radionic_state::irq_status_r), FUNC(radionic_state::motor_w)); - map(0x37e4, 0x37e7).w(FUNC(radionic_state::cassunit_w)); map(0x37e8, 0x37eb).rw(FUNC(radionic_state::printer_r), FUNC(radionic_state::printer_w)); map(0x37ec, 0x37ef).rw(FUNC(radionic_state::fdc_r), FUNC(radionic_state::fdc_w)); map(0x3800, 0x3bff).r(FUNC(radionic_state::keyboard_r)); @@ -142,17 +144,6 @@ void radionic_state::mem_map(address_map &map) map(0x4000, 0xffff).ram(); } -void radionic_state::io_map(address_map &map) -{ - map.global_mask(0xff); - map.unmap_value_high(); - map(0xe8, 0xe8).rw(FUNC(radionic_state::port_e8_r), FUNC(radionic_state::port_e8_w)); - map(0xe9, 0xe9).portr("E9").w("brg", FUNC(com8116_device::stt_str_w)); - map(0xea, 0xea).rw(FUNC(radionic_state::port_ea_r), FUNC(radionic_state::port_ea_w)); - map(0xeb, 0xeb).rw(m_uart, FUNC(ay31015_device::receive), FUNC(ay31015_device::transmit)); - map(0xff, 0xff).rw(FUNC(radionic_state::port_ff_r), FUNC(radionic_state::port_ff_w)); -} - /************************************************************************** w/o SHIFT with SHIFT +-------------------------------+ +-------------------------------+ @@ -254,29 +245,20 @@ static INPUT_PORTS_START( radionic ) PORT_BIT(0xfe, 0x00, IPT_UNUSED) PORT_START("CONFIG") - PORT_CONFNAME( 0xc0, 0x00, "Floppy and RTC") // Floppy doesn't work if RTC is on, so interlink them. + PORT_CONFNAME( 0xc0, 0x00, "Floppy and RTC") // Floppy doesn't work if RTC is on, so interlink them. PORT_CONFSETTING( 0x00, "Both Off" ) PORT_CONFSETTING( 0x80, "RTC off, Floppy On" ) PORT_CONFSETTING( 0x40, "RTC on, Floppy Off" ) - PORT_CONFNAME( 0x30, 0x00, "Colour") // 2 switches on the side + PORT_CONFNAME( 0x30, 0x00, "Colour") // 2 switches on the side PORT_CONFSETTING( 0x00, "Monochrome" ) PORT_CONFSETTING( 0x10, "Auto Colour" ) PORT_CONFSETTING( 0x30, "Programmable Colour" ) - - PORT_START("E9") // these are the power-on uart settings - PORT_BIT(0x07, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_DIPNAME( 0x88, 0x08, "Parity") - PORT_DIPSETTING( 0x08, DEF_STR(None)) - PORT_DIPSETTING( 0x00, "Odd") - PORT_DIPSETTING( 0x80, "Even") - PORT_DIPNAME( 0x10, 0x10, "Stop Bits") - PORT_DIPSETTING( 0x10, "2") - PORT_DIPSETTING( 0x00, "1") - PORT_DIPNAME( 0x60, 0x60, "Bits") - PORT_DIPSETTING( 0x00, "5") - PORT_DIPSETTING( 0x20, "6") - PORT_DIPSETTING( 0x40, "7") - PORT_DIPSETTING( 0x60, "8") + PORT_CONFNAME( 0x07, 0x00, "Serial Port" ) // a jumper on the board? (not documented) + PORT_CONFSETTING( 0x00, "300 baud" ) + PORT_CONFSETTING( 0x01, "600 baud" ) + PORT_CONFSETTING( 0x02, "1200 baud" ) + PORT_CONFSETTING( 0x03, "2400 baud" ) + PORT_CONFSETTING( 0x04, "4800 baud" ) INPUT_PORTS_END @@ -392,6 +374,19 @@ void radionic_state::machine_start() save_pointer(NAME(m_cram), 0x0800); } +void radionic_state::machine_reset() +{ + trs80_state::machine_reset(); + m_cctrl = 2; + + u8 sw = m_io_config->read() & 7; + u16 baud = 300; + for (u8 i = 0; i < sw; i++) + baud <<= 1; + m_clock->set_unscaled_clock(baud*16); // It's designed on the assumption that the uart will divide by 16 + //printf("%d\n",baud); +} + INTERRUPT_GEN_MEMBER(radionic_state::rtc_via_nmi) { if (BIT(m_io_config->read(), 6)) @@ -400,11 +395,7 @@ INTERRUPT_GEN_MEMBER(radionic_state::rtc_via_nmi) u8 radionic_state::video_r(offs_t offset) { - // undocumented; guessing - if ((m_cctrl & 3) == 2) - return m_cram[offset]; - else - return m_vram[offset]; + return m_vram[offset]; } void radionic_state::video_w(offs_t offset, u8 data) @@ -442,7 +433,7 @@ void radionic_state::radionic(machine_config &config) Z80(config, m_maincpu, 3.579545_MHz_XTAL / 2); //m_maincpu->set_clock(MASTER_XTAL / 6); // early machines only, before the floppy interface was added m_maincpu->set_addrmap(AS_PROGRAM, &radionic_state::mem_map); - m_maincpu->set_addrmap(AS_IO, &radionic_state::io_map); + m_maincpu->set_addrmap(AS_IO, &radionic_state::trs80_io); m_maincpu->set_periodic_int(FUNC(radionic_state::rtc_via_nmi), attotime::from_hz(MASTER_XTAL / 12 / 16384)); /* video hardware */ @@ -466,7 +457,7 @@ void radionic_state::radionic(machine_config &config) QUICKLOAD(config, "quickload", "cmd", attotime::from_seconds(1)).set_load_callback(FUNC(radionic_state::quickload_cb)); - FD1771(config, m_fdc, 4_MHz_XTAL / 4); + FD1771(config, m_fdc, 16_MHz_XTAL / 16); m_fdc->intrq_wr_callback().set(FUNC(radionic_state::intrq_w)); FLOPPY_CONNECTOR(config, m_floppy[0], radionic_floppies, "80t_qd", radionic_state::floppy_formats).enable_sound(true); @@ -485,16 +476,19 @@ void radionic_state::radionic(machine_config &config) OUTPUT_LATCH(config, m_cent_data_out); m_centronics->set_output_latch(*m_cent_data_out); - com8116_device &brg(COM8116(config, "brg", 5.0688_MHz_XTAL)); // BR1941L - brg.fr_handler().set(m_uart, FUNC(ay31015_device::write_rcp)); - brg.ft_handler().set(m_uart, FUNC(ay31015_device::write_tcp)); + CLOCK(config, m_clock, 4'800); + m_clock->signal_handler().set(m_uart2, FUNC(i8251_device::write_txc)); + m_clock->signal_handler().set(m_uart2, FUNC(i8251_device::write_rxc)); + + // RS232 port: the schematic is missing most of the info, so guessing + I8251(config, m_uart2, 3.579545_MHz_XTAL / 2 ); + m_uart2->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); + m_uart2->dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr)); + m_uart2->rts_handler().set("rs232", FUNC(rs232_port_device::write_rts)); - AY31015(config, m_uart); - m_uart->read_si_callback().set("rs232", FUNC(rs232_port_device::rxd_r)); - m_uart->write_so_callback().set("rs232", FUNC(rs232_port_device::write_txd)); - //MCFG_AY31015_WRITE_DAV_CB(WRITELINE( , , )) - m_uart->set_auto_rdav(true); - RS232_PORT(config, "rs232", default_rs232_devices, nullptr); + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr)); + rs232.rxd_handler().set(m_uart2, FUNC(i8251_device::write_rxd)); + rs232.dsr_handler().set(m_uart2, FUNC(i8251_device::write_dsr)); // Interface to external circuits I8255(config, m_ppi); diff --git a/src/mame/includes/trs80.h b/src/mame/includes/trs80.h index 712f22f09c4..1c78e7e50c6 100644 --- a/src/mame/includes/trs80.h +++ b/src/mame/includes/trs80.h @@ -96,6 +96,7 @@ protected: double m_old_cassette_val; uint8_t m_size_store; uint16_t m_timeout; + void trs80_io(address_map &map); floppy_image_device *m_fdd; required_device m_maincpu; required_memory_region m_region_maincpu; @@ -118,7 +119,6 @@ private: void m1_io(address_map &map); void m1_mem(address_map &map); void sys80_io(address_map &map); - void trs80_io(address_map &map); void trs80_mem(address_map &map); void ht1080z_io(address_map &map); -- cgit v1.2.3 From c61bd7299c8feb785f49ce76035d39e3a883ddc2 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Thu, 22 Apr 2021 03:06:31 +1000 Subject: radionic: PPI and documentation. --- src/mame/drivers/radionic.cpp | 85 ++++++++++++++++++++++++++++++++++--------- src/mame/drivers/trs80.cpp | 1 - 2 files changed, 67 insertions(+), 19 deletions(-) diff --git a/src/mame/drivers/radionic.cpp b/src/mame/drivers/radionic.cpp index 1fa698aaffc..ae7115f3f26 100644 --- a/src/mame/drivers/radionic.cpp +++ b/src/mame/drivers/radionic.cpp @@ -28,7 +28,7 @@ Komtek 1 (Radionic R1001) memory map 3c00-3fff static video RAM and colour ram, banked 4000-ffff dynamic main RAM -Printer: Level II usually 37e8 +Printer: Usually 37e8, but you can use the PPI instead. Cassette baud rate: 500 baud @@ -49,35 +49,53 @@ SYSTEM commands: - / to execute last program loaded - /nnnnn to execute program at nnnnn (decimal) -About the RTC - The time is incremented while ever the cursor is flashing. It is stored in a series - of bytes in the computer's work area. The bytes are in a certain order, this is: - seconds, minutes, hours, days. The seconds are stored at 0x4041. - A reboot always sets the time to zero. +Inbuilt Monitor - its existence is not revealed to the user. + - SYSTEM then /12710 = enter machine-language monitor + Monitor commands: + - B : return to Basic + - Dnnnn : Dump hex to screen. Press down-arrow for more. Press enter to quit. + - Mnnnn : Modify memory. Enter new byte and it increments to next address. X to quit. + - Gnnnn : Execute program at nnnn + - Gnnnn,tttt : as above, breakpoint at tttt + - R : modify registers + The monitor appears to end at 33D3, however the rom contains more code through to 35EB. + But, the 34xx area is overwitten by the optional RS-232 expansion box. + +About the RTC - The time is incremented while it is enabled via the Machine Configuration. The time + is stored in a series of bytes in the computer's work area. The bytes are in a certain order, + this being: seconds, minutes, hours, days. The seconds are stored at 0x4041. A reboot always + sets the time to zero. About colours - The computer has 16 colours with a byte at 350B controlling the operation. POKE 13579,2 : monochrome POKE 13579,4 : programmable colour POKE 13579,12 : automatic colour - There's no schematic or documentation of the Colour Board, however some more information... + More information was discovered, this being - It doesn't have to be 350B (13579), anything in the 35xx range will do. - d0 : write of vram goes to vram (0 = yes, 1 = no) - d1 : write of vram goes to colour ram (0 = yes, 1 = no) - d2 : colour enable (0 = monochrome, 1 = colour) - d3 : programmable or automatic (0 = programmable, 1 = automatic) - List of colour codes: - 0 = off white; 1 = light green; 2 = red; 3 = dark green; 4 = blue; 5 = greenish blue; - 6 = rose red; 7 = dusty blue; 8 = greenish yellow; 9 = light yellow (greenish); 10 = golden red - 11 = grey; 12 = reddish green; 13 = pale yellow; 14 = orange; 15 = ogre green. - As you can see, the descriptions are quite vague, and appear to be background only. The foreground - is assumed to always be white. + The colour codes and names are listed in the palette below. The descriptions are quite vague, + and appear to be background only. The foreground is assumed to always be white. Automatic is a preset colour set by internal jumpers. - No schematic or technical info for the colour board - No information on the settings of the Automatic mode - The "User Friendly Manual" has a bunch of mistakes (page 15). - - When reading video ram, it is not known how this is affected if colour ram is enabled + - It's not known if colour ram can be read. But LDOS won't scroll if it can't always read vram. - No colour programs exist in the wild, so nothing can be verified. So, some guesswork has been done. +About the PPI - A selling point of this computer was the ability to sense and control external gadgets. + For example, it could join to a temperature sensor, and when the temperature reached a certain value + the computer could instruct a device to turn on or off. There's 4 input jacks and 6 output jacks. + The PPI can also control a parallel printer. To enable this, enter SYSTEM then /12367 . + +About the RS-232 unit - This is an external box that plugs into the expansion port. It takes over memory + region 3400-34FF, although it only uses 3400 and 3401. It has a baud generator consisting of 2x 74LS163 + and a dipswitch block to choose one of 5 possible rates. The UART and RS-232 parts are conventional. + There's no programming of the unit from the inbuilt roms; you need to write your own. + ******************************************************************************************************** To Do / Status: @@ -85,7 +103,6 @@ To Do / Status: - Difficulty loading real tapes. - Writing to floppy is problematic; freezing/crashing are common issues. -- Add rs232 board - Add fdc doubler (only some info available) *******************************************************************************************************/ @@ -122,6 +139,10 @@ private: void cctrl_w(offs_t offset, u8 data); void video_w(offs_t offset, u8 data); u8 video_r(offs_t offset); + void ppi_pa_w(offs_t offset, u8 data); + void ppi_pb_w(offs_t offset, u8 data); + void ppi_pc_w(offs_t offset, u8 data); + u8 ppi_pc_r(offs_t offset); void mem_map(address_map &map); static void floppy_formats(format_registration &fr); u8 m_cctrl = 2; @@ -411,6 +432,34 @@ void radionic_state::cctrl_w(offs_t offset, u8 data) m_cctrl = data & 15; } +void radionic_state::ppi_pa_w(offs_t offset, u8 data) +{ + // d0-7: Data to extra printer +} + +void radionic_state::ppi_pb_w(offs_t offset, u8 data) +{ + // d0-7: Outputs to control jacks (only 6 connected up by default) +} + +void radionic_state::ppi_pc_w(offs_t offset, u8 data) +{ + // Printer control + // d0: Strobe +} + +u8 radionic_state::ppi_pc_r(offs_t offset) +{ + // Printer Status + // d1: Busy + // d2: out of paper + // d3: Unit select + + // Sensor Status + // d4-7: sensing inputs + return 0xFF; +} + void radionic_state::floppy_formats(format_registration &fr) { fr.add(FLOPPY_JV1_FORMAT); @@ -492,10 +541,10 @@ void radionic_state::radionic(machine_config &config) // Interface to external circuits I8255(config, m_ppi); - //m_ppi->in_pc_callback().set(FUNC(pulsar_state::ppi_pc_r)); // Sensing from external and printer status - //m_ppi->out_pa_callback().set(FUNC(pulsar_state::ppi_pa_w)); // Data for external plugin printer module - //m_ppi->out_pb_callback().set(FUNC(pulsar_state::ppi_pb_w)); // Control data to external - //m_ppi->out_pc_callback().set(FUNC(pulsar_state::ppi_pc_w)); // Printer strobe + m_ppi->in_pc_callback().set(FUNC(radionic_state::ppi_pc_r)); // Sensing from external and printer status + m_ppi->out_pa_callback().set(FUNC(radionic_state::ppi_pa_w)); // Data for external plugin printer module + m_ppi->out_pb_callback().set(FUNC(radionic_state::ppi_pb_w)); // Control data to external + m_ppi->out_pc_callback().set(FUNC(radionic_state::ppi_pc_w)); // Printer strobe } diff --git a/src/mame/drivers/trs80.cpp b/src/mame/drivers/trs80.cpp index f7766def498..8b354f05a32 100644 --- a/src/mame/drivers/trs80.cpp +++ b/src/mame/drivers/trs80.cpp @@ -89,7 +89,6 @@ About the system80 - Asian version of trs80l2, known as EACA Video Genie. In USA - Gnnnn : Execute program at nnnn - Gnnnn,tttt : as above, breakpoint at tttt - R : modify registers - The monitor works on the radionic too. About the ht1080z - This was made for schools in Hungary. Each comes with a BASIC extension roms which activated Hungarian features. To activate - start emulation - enter SYSTEM -- cgit v1.2.3 From 83d1b46ff578ac366e44e8b088416f7e3357fffe Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 21 Apr 2021 19:34:48 +0200 Subject: New working clones ------------------ Compact Computer 40 Plus (prototype) [hap, Jon Guidry] --- hash/cc40_cart.xml | 18 ++-- hash/microvision.xml | 1 + hash/ti74_cart.xml | 13 ++- hash/ti95_cart.xml | 13 ++- src/devices/bus/odyssey2/homecomp.cpp | 2 +- src/mame/drivers/cc40.cpp | 178 +++++++++++++++++++++++----------- src/mame/drivers/dai3wksi.cpp | 4 +- src/mame/drivers/mephisto_mm2.cpp | 4 +- src/mame/drivers/tasc.cpp | 8 +- src/mame/drivers/ti74.cpp | 68 ++++++------- src/mame/layout/cc40.lay | 62 ++++++------ src/mame/layout/saitek_risc2500.lay | 10 +- src/mame/layout/ti74.lay | 56 +++++------ src/mame/layout/ti95.lay | 70 ++++++------- src/mame/mame.lst | 1 + 15 files changed, 291 insertions(+), 217 deletions(-) diff --git a/hash/cc40_cart.xml b/hash/cc40_cart.xml index e55f33a6d52..c0723e9a2af 100644 --- a/hash/cc40_cart.xml +++ b/hash/cc40_cart.xml @@ -4,21 +4,21 @@ license:CC0 --> - - + + Advanced Electrical Engineering 1983 diff --git a/hash/microvision.xml b/hash/microvision.xml index 82414a93454..1e6ad7c22e4 100644 --- a/hash/microvision.xml +++ b/hash/microvision.xml @@ -27,6 +27,7 @@ The "clock" feature is used to indicate MCU clock frequency The "pla" feature is for TMS1100 output PLA type The "paddle" feature is used to indicate if paddle circuitry exists on the PCB The "butmask" feature indicates cartridge button restrict mask (active-low) + --> diff --git a/hash/ti74_cart.xml b/hash/ti74_cart.xml index 51dc51e77b1..e750df78ece 100644 --- a/hash/ti74_cart.xml +++ b/hash/ti74_cart.xml @@ -2,13 +2,16 @@ + + diff --git a/hash/ti95_cart.xml b/hash/ti95_cart.xml index 813063efd63..563ad1315ce 100644 --- a/hash/ti95_cart.xml +++ b/hash/ti95_cart.xml @@ -2,14 +2,17 @@ + + diff --git a/src/devices/bus/odyssey2/homecomp.cpp b/src/devices/bus/odyssey2/homecomp.cpp index 3357bec193d..7de27efaeed 100644 --- a/src/devices/bus/odyssey2/homecomp.cpp +++ b/src/devices/bus/odyssey2/homecomp.cpp @@ -169,7 +169,7 @@ void o2_homecomp_device::device_add_mconfig(machine_config &config) // cassette CASSETTE(config, m_cass); - m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_DISABLED); + m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_MUTED | CASSETTE_MOTOR_DISABLED); SPEAKER(config, "cass_output").front_center(); // on data recorder m_cass->add_route(ALL_OUTPUTS, "cass_output", 0.05); } diff --git a/src/mame/drivers/cc40.cpp b/src/mame/drivers/cc40.cpp index 669d2536155..502689403bf 100644 --- a/src/mame/drivers/cc40.cpp +++ b/src/mame/drivers/cc40.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause // copyright-holders:hap +// thanks-to:Jon Guidry /*************************************************************************** Texas Instruments Compact Computer 40 (aka CC-40) @@ -38,7 +39,7 @@ --------- HM6116LP-4 - Hitachi 2KB SRAM (newer 18KB version has two HM6264 8KB chips) - HN61256PC09 - Hitachi DIP-28 32KB CMOS Mask PROM + HN61256PC09 - Hitachi DIP-28 32KB CMOS Mask PROM (also seen with HN61256PB02, earlier version?) TMX70C20N2L - Texas Instruments TMS70C20 CPU (128 bytes RAM, 2KB ROM) @ 2.5MHz, 40 pins - "X" implies prototype AMI 1041036-1 - 68-pin QFP AMI Gate Array HD44100H - 60-pin QFP Hitachi HD44100 LCD Driver @@ -59,6 +60,15 @@ can be loaded. Load a program by pressing the [RUN] key while viewing the list, or manually with the command RUN "" + As for the CC-40+, the product was finalized, but in the end it wasn't released. + The hardware is very similar to CC-40. The main differences are the CPU: + a TMS70C40 (twice larger internal ROM), and a cassette port separate from Hexbus. + The controller chip is a TI TP0373 this time, it appears that the basic functionality + is the same as the one by AMI. Like the CC-40, it had either 6KB or 18KB RAM. + + The CC-40+ cassette device number is 1, eg. SAVE"1.FILENAME" to save, and + OLD"1.FILENAME" to load. + TODO: - external RAM cartridge (bus_control_w cartridge memory addressing) @@ -73,9 +83,11 @@ ***************************************************************************/ #include "emu.h" + #include "bus/generic/slot.h" #include "bus/generic/carts.h" #include "cpu/tms7000/tms7000.h" +#include "imagedev/cassette.h" #include "machine/nvram.h" #include "sound/dac.h" #include "video/hd44780.h" @@ -88,17 +100,21 @@ #include "cc40.lh" +namespace { + class cc40_state : public driver_device { public: cc40_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_nvram(*this, "sysram.%u", 1U), + m_sysbank(*this, "sysbank"), + m_cartbank(*this, "cartbank"), m_cart(*this, "cartslot"), + m_cass(*this, "cassette"), m_key_matrix(*this, "IN.%u", 0), - m_battery_inp(*this, "BATTERY"), - m_nvram(*this, "sysram.%u", 1U), - m_lamps(*this, "lamp%u", 0U) + m_segs(*this, "seg%u", 0U) { m_sysram[0] = nullptr; m_sysram[1] = nullptr; @@ -107,13 +123,14 @@ public: DECLARE_INPUT_CHANGED_MEMBER(sysram_size_changed); void cc40(machine_config &config); + void cc40p(machine_config &config); protected: virtual void machine_reset() override; virtual void machine_start() override; + virtual void device_post_load() override; private: - void postload(); void init_sysram(int chip, u16 size); void update_lcd_indicator(u8 y, u8 x, int state); void update_clock_divider(); @@ -122,41 +139,46 @@ private: void sysram_w(offs_t offset, u8 data); u8 bus_control_r(); void bus_control_w(u8 data); + u8 power_r(); void power_w(u8 data); - u8 battery_r(); u8 bankswitch_r(); void bankswitch_w(u8 data); u8 clock_control_r(); void clock_control_w(u8 data); u8 keyboard_r(); void keyboard_w(u8 data); + u8 cass_r(); + void cass_w(u8 data); void cc40_palette(palette_device &palette) const; DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); HD44780_PIXEL_UPDATE(cc40_pixel_update); - void main_map(address_map &map); + void cc40_map(address_map &map); + void cc40p_map(address_map &map); - required_device m_maincpu; + required_device m_maincpu; + required_device_array m_nvram; + required_memory_bank m_sysbank; + required_memory_bank m_cartbank; required_device m_cart; + optional_device m_cass; required_ioport_array<8> m_key_matrix; - required_ioport m_battery_inp; - required_device_array m_nvram; + output_finder<80> m_segs; memory_region *m_cart_rom; - u8 m_bus_control; - u8 m_power; - u8 m_banks; - u8 m_clock_control; - u8 m_clock_divider; - u8 m_key_select; + u8 m_bus_control = 0; + u8 m_power = 0; + u8 m_banks = 0; + u8 m_clock_control = 0; + u8 m_clock_divider = 0; + u8 m_key_select = 0; std::unique_ptr m_sysram[2]; u16 m_sysram_size[2]; u16 m_sysram_end[2]; u16 m_sysram_mask[2]; - output_finder<80> m_lamps; }; @@ -195,7 +217,7 @@ DEVICE_IMAGE_LOAD_MEMBER(cc40_state::cart_load) void cc40_state::cc40_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(138, 146, 148)); // background - palette.set_pen_color(1, rgb_t(92, 83, 88)); // lcd pixel on + palette.set_pen_color(1, rgb_t(50, 45, 60)); // lcd pixel on palette.set_pen_color(2, rgb_t(131, 136, 139)); // lcd pixel off } @@ -207,7 +229,7 @@ void cc40_state::update_lcd_indicator(u8 y, u8 x, int state) // ---- raw lcd screen here ---- // under | ERROR v v v v v v _LOW // output# | 60 61 62 63 50 51 52 53 - m_lamps[y * 10 + x] = state ? 1 : 0; + m_segs[y * 10 + x] = state ? 1 : 0; } HD44780_PIXEL_UPDATE(cc40_state::cc40_pixel_update) @@ -290,6 +312,11 @@ void cc40_state::bus_control_w(u8 data) m_bus_control = data; } +u8 cc40_state::power_r() +{ + return m_power; +} + void cc40_state::power_w(u8 data) { // d0: power-on hold latch @@ -300,12 +327,6 @@ void cc40_state::power_w(u8 data) m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } -u8 cc40_state::battery_r() -{ - // d0: low battery sense line (0 = low power) - return m_battery_inp->read(); -} - u8 cc40_state::bankswitch_r() { return m_banks; @@ -316,11 +337,11 @@ void cc40_state::bankswitch_w(u8 data) data &= 0x0f; // d0-d1: system rom bankswitch - membank("sysbank")->set_entry(data & 3); + m_sysbank->set_entry(data & 3); // d2-d3: cartridge 32KB page bankswitch if (m_cart_rom) - membank("cartbank")->set_entry(data >> 2 & 3); + m_cartbank->set_entry(data >> 2 & 3); m_banks = data; } @@ -353,35 +374,50 @@ void cc40_state::clock_control_w(u8 data) u8 cc40_state::keyboard_r() { - u8 ret = 0; + u8 data = 0; // read selected keyboard rows for (int i = 0; i < 8; i++) { if (m_key_select >> i & 1) - ret |= m_key_matrix[i]->read(); + data |= m_key_matrix[i]->read(); } - return ret; + return data; } void cc40_state::keyboard_w(u8 data) { - // d(0-7): select keyboard column + // d0-d7: select keyboard column m_key_select = data; } -void cc40_state::main_map(address_map &map) +u8 cc40_state::cass_r() +{ + // d3: cass data in + return (m_cass->input() > 0.04) ? 8 : 0; +} + +void cc40_state::cass_w(u8 data) +{ + // d4: cass motor + m_cass->set_motor((data & 0x10) ? 1 : 0); + + // d3: cass data out + m_cass->output((data & 8) ? +1.0 : -1.0); +} + +void cc40_state::cc40_map(address_map &map) { map.unmap_value_high(); map(0x0110, 0x0110).rw(FUNC(cc40_state::bus_control_r), FUNC(cc40_state::bus_control_w)); - map(0x0111, 0x0111).w(FUNC(cc40_state::power_w)); + map(0x0111, 0x0111).rw(FUNC(cc40_state::power_r), FUNC(cc40_state::power_w)); map(0x0112, 0x0112).noprw(); // d0-d3: Hexbus data map(0x0113, 0x0113).noprw(); // d0: Hexbus available map(0x0114, 0x0114).noprw(); // d0,d1: Hexbus handshake - map(0x0115, 0x0115).w("dac", FUNC(dac_bit_interface::data_w)); // d0: piezo control - map(0x0116, 0x0116).r(FUNC(cc40_state::battery_r)); + map(0x0115, 0x0115).w("dac", FUNC(dac_bit_interface::data_w)); + map(0x0116, 0x0116).portr("BATTERY"); map(0x0119, 0x0119).rw(FUNC(cc40_state::bankswitch_r), FUNC(cc40_state::bankswitch_w)); map(0x011a, 0x011a).rw(FUNC(cc40_state::clock_control_r), FUNC(cc40_state::clock_control_w)); map(0x011e, 0x011f).rw("hd44780", FUNC(hd44780_device::read), FUNC(hd44780_device::write)); @@ -392,6 +428,12 @@ void cc40_state::main_map(address_map &map) map(0xd000, 0xefff).bankr("sysbank"); } +void cc40_state::cc40p_map(address_map &map) +{ + cc40_map(map); + map(0x0121, 0x0121).rw(FUNC(cc40_state::cass_r), FUNC(cc40_state::cass_w)); +} + /*************************************************************************** @@ -518,7 +560,6 @@ void cc40_state::machine_reset() m_power = 1; update_clock_divider(); - bankswitch_w(0); } @@ -539,7 +580,7 @@ void cc40_state::init_sysram(int chip, u16 size) m_sysram_size[chip] = size; } -void cc40_state::postload() +void cc40_state::device_post_load() { init_sysram(0, m_sysram_size[0]); init_sysram(1, m_sysram_size[1]); @@ -550,15 +591,15 @@ void cc40_state::postload() void cc40_state::machine_start() { // init - m_lamps.resolve(); + m_segs.resolve(); std::string region_tag; m_cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); - membank("sysbank")->configure_entries(0, 4, memregion("system")->base(), 0x2000); + m_sysbank->configure_entries(0, 4, memregion("system")->base(), 0x2000); if (m_cart_rom) - membank("cartbank")->configure_entries(0, 4, m_cart_rom->base(), 0x8000); + m_cartbank->configure_entries(0, 4, m_cart_rom->base(), 0x8000); else - membank("cartbank")->set_base(memregion("maincpu")->base() + 0x5000); + m_cartbank->set_base(memregion("maincpu")->base() + 0x5000); init_sysram(0, 0x800); // default to 6KB init_sysram(1, 0x800); // " @@ -566,11 +607,6 @@ void cc40_state::machine_start() bus_control_w(0); bankswitch_w(0); - // zerofill other - m_power = 0; - m_clock_control = 0; - m_key_select = 0; - // register for savestates save_item(NAME(m_bus_control)); save_item(NAME(m_power)); @@ -578,15 +614,13 @@ void cc40_state::machine_start() save_item(NAME(m_clock_control)); save_item(NAME(m_clock_divider)); save_item(NAME(m_key_select)); - - machine().save().register_postload(save_prepost_delegate(FUNC(cc40_state::postload), this)); } void cc40_state::cc40(machine_config &config) { - /* basic machine hardware */ - TMS70C20(config, m_maincpu, XTAL(5'000'000) / 2); - m_maincpu->set_addrmap(AS_PROGRAM, &cc40_state::main_map); + // basic machine hardware + TMS70C20(config, m_maincpu, 5_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &cc40_state::cc40_map); m_maincpu->in_porta().set(FUNC(cc40_state::keyboard_r)); m_maincpu->out_portb().set(FUNC(cc40_state::keyboard_w)); @@ -594,7 +628,7 @@ void cc40_state::cc40(machine_config &config) NVRAM(config, "sysram.1", nvram_device::DEFAULT_ALL_0); NVRAM(config, "sysram.2", nvram_device::DEFAULT_ALL_0); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); screen.set_refresh_hz(60); // arbitrary screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); @@ -610,15 +644,32 @@ void cc40_state::cc40(machine_config &config) hd44780.set_lcd_size(2, 16); // 2*16 internal hd44780.set_pixel_update_cb(FUNC(cc40_state::cc40_pixel_update)); - /* sound hardware */ + // sound hardware SPEAKER(config, "speaker").front_center(); DAC_1BIT(config, "dac").add_route(ALL_OUTPUTS, "speaker", 0.25); - /* cartridge */ + // cartridge GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "cc40_cart", "bin,rom,256").set_device_load(FUNC(cc40_state::cart_load)); SOFTWARE_LIST(config, "cart_list").set_original("cc40_cart"); } +void cc40_state::cc40p(machine_config &config) +{ + cc40(config); + + // basic machine hardware + TMS70C40(config.replace(), m_maincpu, 5_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &cc40_state::cc40p_map); + m_maincpu->in_porta().set(FUNC(cc40_state::keyboard_r)); + m_maincpu->out_portb().set(FUNC(cc40_state::keyboard_w)); + + // cassette + CASSETTE(config, m_cass); + m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_MUTED | CASSETTE_MOTOR_DISABLED); + SPEAKER(config, "cass_output").front_center(); // on data recorder + m_cass->add_route(ALL_OUTPUTS, "cass_output", 0.05); +} + /*************************************************************************** @@ -628,13 +679,24 @@ void cc40_state::cc40(machine_config &config) ***************************************************************************/ ROM_START( cc40 ) - ROM_REGION( 0x800, "maincpu", 0 ) - ROM_LOAD( "tms70c20.bin", 0x000, 0x800, CRC(a21bf6ab) SHA1(3da8435ecbee143e7fa149ee8e1c92949bade1d8) ) // internal cpu rom + ROM_REGION( 0x0800, "maincpu", 0 ) + ROM_LOAD( "c11002", 0x0000, 0x0800, CRC(a21bf6ab) SHA1(3da8435ecbee143e7fa149ee8e1c92949bade1d8) ) // internal cpu rom ROM_REGION( 0x8000, "system", 0 ) - ROM_LOAD( "hn61256pc09.bin", 0x0000, 0x8000, CRC(f5322fab) SHA1(1b5c4052a53654363c458f75eac7a27f0752def6) ) // system rom, banked + ROM_LOAD( "hn61256pc09", 0x0000, 0x8000, CRC(f5322fab) SHA1(1b5c4052a53654363c458f75eac7a27f0752def6) ) // system rom, banked ROM_END +ROM_START( cc40p ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD( "75305.u200", 0x0000, 0x1000, CRC(42bb6af2) SHA1(642dede16cb4ef2c5b9eaae79e28054f1111eef8) ) // internal cpu rom + + ROM_REGION( 0x8000, "system", 0 ) + ROM_LOAD( "hn61256pc09.u205", 0x0000, 0x8000, CRC(f5322fab) SHA1(1b5c4052a53654363c458f75eac7a27f0752def6) ) // system rom, banked +ROM_END + +} // anonymous namespace + // YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1983, cc40, 0, 0, cc40, cc40, cc40_state, empty_init, "Texas Instruments", "Compact Computer 40", MACHINE_SUPPORTS_SAVE ) +COMP( 1983, cc40, 0, 0, cc40, cc40, cc40_state, empty_init, "Texas Instruments", "Compact Computer 40", MACHINE_SUPPORTS_SAVE ) +COMP( 1984, cc40p, cc40, 0, cc40p, cc40, cc40_state, empty_init, "Texas Instruments", "Compact Computer 40 Plus (prototype)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/dai3wksi.cpp b/src/mame/drivers/dai3wksi.cpp index 22b7552fbb1..12db34f3d76 100644 --- a/src/mame/drivers/dai3wksi.cpp +++ b/src/mame/drivers/dai3wksi.cpp @@ -382,8 +382,8 @@ void dai3wksi_state::main_map(address_map &map) { map(0x0000, 0x1bff).rom(); map(0x2000, 0x23ff).ram(); - map(0x2400, 0x24ff).mirror(0x100).portr("IN0"); - map(0x2800, 0x28ff).mirror(0x100).portr("IN1"); + map(0x2400, 0x2400).mirror(0x1ff).portr("IN0"); + map(0x2800, 0x2800).mirror(0x1ff).portr("IN1"); map(0x3000, 0x3000).w(FUNC(dai3wksi_state::audio_1_w)); map(0x3400, 0x3400).w(FUNC(dai3wksi_state::audio_2_w)); map(0x3800, 0x3800).w(FUNC(dai3wksi_state::audio_3_w)); diff --git a/src/mame/drivers/mephisto_mm2.cpp b/src/mame/drivers/mephisto_mm2.cpp index 2299218ec0f..0116edea644 100644 --- a/src/mame/drivers/mephisto_mm2.cpp +++ b/src/mame/drivers/mephisto_mm2.cpp @@ -76,7 +76,7 @@ Mephisto 4 Turbo Kit 18mhz - (mm4tk) The MM V prototype was the program that Ed Schroeder participated with as "Rebel" at the 1989 WMCCC in Portorose. It was used with the TK20 TurboKit. -http://chesseval.com/ChessEvalJournal/PrototypeMMV.htm +For more information, see: http://chesseval.com/ChessEvalJournal/PrototypeMMV.htm MM VI (Saitek, 1994) is on different hardware, H8 CPU. @@ -514,4 +514,4 @@ CONS( 1987, mm4tk, mm4, 0, mm4tk, mm2, mm2_state, empty_init, "ha CONS( 1990, mm5, 0, 0, mm5, mm2, mm2_state, empty_init, "Hegener + Glaser", "Mephisto MM V (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1990, mm5a, mm5, 0, mm5, mm2, mm2_state, empty_init, "Hegener + Glaser", "Mephisto MM V (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1989, mm5p, mm5, 0, mm5p, mm2, mm2_state, empty_init, "Hegener + Glaser", "Mephisto MM V (Portorose TM version)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_TIMING ) +CONS( 1989, mm5p, mm5, 0, mm5p, mm2, mm2_state, empty_init, "Hegener + Glaser", "Mephisto MM V (Portorose TM version)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_TIMING ) // aka Rebel diff --git a/src/mame/drivers/tasc.cpp b/src/mame/drivers/tasc.cpp index be31fbf38e2..348fea94dfb 100644 --- a/src/mame/drivers/tasc.cpp +++ b/src/mame/drivers/tasc.cpp @@ -8,12 +8,16 @@ Commonly known as Tasc R30, it's basically a dedicated ChessMachine. The King chess engines are also compatible with Tasc's The ChessMachine software on PC, however the prototype Gideon 2.1(internally: Rebel 2.01) is not. +The King 2.23 version was not released to the public. It has an opening book +meant for chesscomputer competitions. +For more information, see: http://chesseval.com/ChessEvalJournal/R30v223.htm + R30 hardware notes: - ARM6 CPU(P60ARM/CG) @ 30MHz - 256KB system ROM (2*27C010) - 512KB program RAM (4*MT5C1008), 128KB permanent RAM (KM681000ALP-7L) - Toshiba LCD drivers (3*T7778A, T7900, T6963C), TC5565AFL-15 -- SB20 or SB30 "Smartboard" chessboard with piece recognition +- SB20 or SB30 "SmartBoard" chessboard with piece recognition R40 hardware notes: - ARM6 CPU(VY86C061PSTC) @ 40MHz @@ -305,5 +309,5 @@ ROM_END // YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS CONS( 1995, tascr30, 0, 0, tasc, tasc, tasc_state, empty_init, "Tasc", "ChessSystem R30 (The King 2.50)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND ) CONS( 1993, tascr30a, tascr30, 0, tasc, tasc, tasc_state, empty_init, "Tasc", "ChessSystem R30 (The King 2.20)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND ) -CONS( 1993, tascr30b, tascr30, 0, tasc, tasc, tasc_state, empty_init, "Tasc", "ChessSystem R30 (The King 2.23, unreleased)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND ) +CONS( 1993, tascr30b, tascr30, 0, tasc, tasc, tasc_state, empty_init, "Tasc", "ChessSystem R30 (The King 2.23, TM version)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND ) // competed in several chesscomputer tournaments CONS( 1993, tascr30g, tascr30, 0, tasc, tasc, tasc_state, empty_init, "Tasc", "ChessSystem R30 (Gideon 2.1, prototype)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_IMPERFECT_SOUND ) // made in 1993, later released in 2012 diff --git a/src/mame/drivers/ti74.cpp b/src/mame/drivers/ti74.cpp index d473b040492..3047da4e1b1 100644 --- a/src/mame/drivers/ti74.cpp +++ b/src/mame/drivers/ti74.cpp @@ -51,9 +51,8 @@ Overall, the hardware is very similar to TI CC-40. A lot has been shuffled around - to cut down on complexity (and probably for protection too). To reduce power usage - even more, the OS often idles while waiting for any keypress that triggers an interrupt - and wakes the processor up. + to cut down on complexity. To reduce power usage even more, the OS often idles while + waiting for any keypress that triggers an interrupt and wakes the processor up. The machine is powered by 4 AAA batteries. These will also save internal RAM, provided that the machine is turned off properly. @@ -70,11 +69,13 @@ ***************************************************************************/ #include "emu.h" + #include "bus/generic/carts.h" #include "bus/generic/slot.h" #include "cpu/tms7000/tms7000.h" #include "machine/nvram.h" #include "video/hd44780.h" + #include "emupal.h" #include "screen.h" #include "softlist.h" @@ -83,16 +84,19 @@ #include "ti95.lh" +namespace { + class ti74_state : public driver_device { public: ti74_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_sysbank(*this, "sysbank"), m_cart(*this, "cartslot"), m_key_matrix(*this, "IN.%u", 0), m_battery_inp(*this, "BATTERY"), - m_lamps(*this, "lamp%u", 0U) + m_segs(*this, "seg%u", 0U) { } void ti74(machine_config &config); @@ -119,14 +123,14 @@ private: void main_map(address_map &map); required_device m_maincpu; + required_memory_bank m_sysbank; required_device m_cart; required_ioport_array<8> m_key_matrix; required_ioport m_battery_inp; + output_finder<80> m_segs; - u8 m_key_select; - u8 m_power; - - output_finder<80> m_lamps; + u8 m_key_select = 0; + u8 m_power = 0; }; @@ -165,7 +169,7 @@ DEVICE_IMAGE_LOAD_MEMBER(ti74_state::cart_load) void ti74_state::ti74_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(138, 146, 148)); // background - palette.set_pen_color(1, rgb_t(92, 83, 88)); // LCD pixel on + palette.set_pen_color(1, rgb_t(50, 45, 60)); // LCD pixel on palette.set_pen_color(2, rgb_t(131, 136, 139)); // LCD pixel off } @@ -183,7 +187,7 @@ void ti74_state::update_lcd_indicator(u8 y, u8 x, int state) // above | _LOW _ERROR 2nd INV ALPHA LC INS DEGRAD HEX OCT I/O // screen- | _P{70} <{71} RUN{3} // area . SYS{4} - m_lamps[y * 10 + x] = state ? 1 : 0; + m_segs[y * 10 + x] = state ? 1 : 0; } HD44780_PIXEL_UPDATE(ti74_state::ti74_pixel_update) @@ -242,28 +246,28 @@ HD44780_PIXEL_UPDATE(ti74_state::ti95_pixel_update) u8 ti74_state::keyboard_r() { - u8 ret = 0; + u8 data = 0; // read selected keyboard rows for (int i = 0; i < 8; i++) { if (m_key_select >> i & 1) - ret |= m_key_matrix[i]->read(); + data |= m_key_matrix[i]->read(); } - return ret; + return data; } void ti74_state::keyboard_w(u8 data) { - // d(0-7): select keyboard column + // d0-d7: select keyboard column m_key_select = data; } void ti74_state::bankswitch_w(u8 data) { // d0-d1: system rom bankswitch - membank("sysbank")->set_entry(data & 3); + m_sysbank->set_entry(data & 3); // d2: power-on latch if (~data & 4 && m_power) @@ -496,22 +500,18 @@ void ti74_state::machine_reset() { m_power = 1; + m_sysbank->set_entry(0); update_battery_status(m_battery_inp->read()); } void ti74_state::machine_start() { - m_lamps.resolve(); + m_segs.resolve(); if (m_cart->exists()) m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0xbfff, read8sm_delegate(*m_cart, FUNC(generic_slot_device::read_rom))); - membank("sysbank")->configure_entries(0, 4, memregion("system")->base(), 0x2000); - membank("sysbank")->set_entry(0); - - // zerofill - m_key_select = 0; - m_power = 0; + m_sysbank->configure_entries(0, 4, memregion("system")->base(), 0x2000); // register for savestates save_item(NAME(m_key_select)); @@ -520,8 +520,8 @@ void ti74_state::machine_start() void ti74_state::ti74(machine_config &config) { - /* basic machine hardware */ - TMS70C46(config, m_maincpu, XTAL(4'000'000)); + // basic machine hardware + TMS70C46(config, m_maincpu, 4_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &ti74_state::main_map); m_maincpu->in_porta().set(FUNC(ti74_state::keyboard_r)); m_maincpu->out_portb().set(FUNC(ti74_state::bankswitch_w)); @@ -529,7 +529,7 @@ void ti74_state::ti74(machine_config &config) NVRAM(config, "sysram.ic3", nvram_device::DEFAULT_ALL_0); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); screen.set_refresh_hz(60); // arbitrary screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); @@ -546,16 +546,15 @@ void ti74_state::ti74(machine_config &config) hd44780.set_lcd_size(2, 16); // 2*16 internal hd44780.set_pixel_update_cb(FUNC(ti74_state::ti74_pixel_update)); - /* cartridge */ + // cartridge GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "ti74_cart", "bin,rom,256").set_device_load(FUNC(ti74_state::cart_load)); - SOFTWARE_LIST(config, "cart_list").set_original("ti74_cart"); } void ti74_state::ti95(machine_config &config) { - /* basic machine hardware */ - TMS70C46(config, m_maincpu, XTAL(4'000'000)); + // basic machine hardware + TMS70C46(config, m_maincpu, 4_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &ti74_state::main_map); m_maincpu->in_porta().set(FUNC(ti74_state::keyboard_r)); m_maincpu->out_portb().set(FUNC(ti74_state::bankswitch_w)); @@ -563,7 +562,7 @@ void ti74_state::ti95(machine_config &config) NVRAM(config, "sysram.ic3", nvram_device::DEFAULT_ALL_0); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); screen.set_refresh_hz(60); // arbitrary screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); @@ -580,9 +579,8 @@ void ti74_state::ti95(machine_config &config) hd44780.set_lcd_size(2, 16); hd44780.set_pixel_update_cb(FUNC(ti74_state::ti95_pixel_update)); - /* cartridge */ + // cartridge GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "ti95_cart", "bin,rom,256").set_device_load(FUNC(ti74_state::cart_load)); - SOFTWARE_LIST(config, "cart_list").set_original("ti95_cart"); } @@ -611,7 +609,9 @@ ROM_START( ti95 ) ROM_LOAD( "hn61256pc95.ic1", 0x0000, 0x8000, CRC(c46d29ae) SHA1(c653f08590dbc28241a9f5a6c2541641bdb0208b) ) // system rom, banked ROM_END +} // anonymous namespace + // YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1985, ti74, 0, 0, ti74, ti74, ti74_state, empty_init, "Texas Instruments", "TI-74 BASICALC", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) -COMP( 1986, ti95, 0, 0, ti95, ti95, ti74_state, empty_init, "Texas Instruments", "TI-95 PROCALC", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +COMP( 1985, ti74, 0, 0, ti74, ti74, ti74_state, empty_init, "Texas Instruments", "TI-74 Basicalc", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +COMP( 1986, ti95, 0, 0, ti95, ti95, ti74_state, empty_init, "Texas Instruments", "TI-95 Procalc", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) diff --git a/src/mame/layout/cc40.lay b/src/mame/layout/cc40.lay index 04cef47a1e1..bc7f338727c 100644 --- a/src/mame/layout/cc40.lay +++ b/src/mame/layout/cc40.lay @@ -16,7 +16,7 @@ license:CC0 - + @@ -26,7 +26,7 @@ license:CC0 - + @@ -36,7 +36,7 @@ license:CC0 - + @@ -46,7 +46,7 @@ license:CC0 - + @@ -56,7 +56,7 @@ license:CC0 - + @@ -66,7 +66,7 @@ license:CC0 - + @@ -76,7 +76,7 @@ license:CC0 - + @@ -86,7 +86,7 @@ license:CC0 - + @@ -96,7 +96,7 @@ license:CC0 - + @@ -106,7 +106,7 @@ license:CC0 - + @@ -116,7 +116,7 @@ license:CC0 - + @@ -126,13 +126,13 @@ license:CC0 - + - + @@ -164,65 +164,65 @@ license:CC0 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/mame/layout/saitek_risc2500.lay b/src/mame/layout/saitek_risc2500.lay index 179179907d3..265c42ed573 100644 --- a/src/mame/layout/saitek_risc2500.lay +++ b/src/mame/layout/saitek_risc2500.lay @@ -8,7 +8,7 @@ license:CC0 - + @@ -66,22 +66,22 @@ license:CC0 - + - + - + - + diff --git a/src/mame/layout/ti74.lay b/src/mame/layout/ti74.lay index faee228c2c3..40bb7196daf 100644 --- a/src/mame/layout/ti74.lay +++ b/src/mame/layout/ti74.lay @@ -16,7 +16,7 @@ license:CC0 - + @@ -26,7 +26,7 @@ license:CC0 - + @@ -36,7 +36,7 @@ license:CC0 - + @@ -46,7 +46,7 @@ license:CC0 - + @@ -56,7 +56,7 @@ license:CC0 - + @@ -66,7 +66,7 @@ license:CC0 - + @@ -76,7 +76,7 @@ license:CC0 - + @@ -86,7 +86,7 @@ license:CC0 - + @@ -96,7 +96,7 @@ license:CC0 - + @@ -106,7 +106,7 @@ license:CC0 - + @@ -116,7 +116,7 @@ license:CC0 - + @@ -126,7 +126,7 @@ license:CC0 - + @@ -136,13 +136,13 @@ license:CC0 - + - + @@ -174,51 +174,51 @@ license:CC0 - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/mame/layout/ti95.lay b/src/mame/layout/ti95.lay index a0e5f7596f5..44c760dc542 100644 --- a/src/mame/layout/ti95.lay +++ b/src/mame/layout/ti95.lay @@ -11,14 +11,14 @@ license:CC0 - + - + @@ -26,7 +26,7 @@ license:CC0 - + @@ -34,7 +34,7 @@ license:CC0 - + @@ -46,7 +46,7 @@ license:CC0 - + @@ -56,7 +56,7 @@ license:CC0 - + @@ -66,7 +66,7 @@ license:CC0 - + @@ -76,7 +76,7 @@ license:CC0 - + @@ -86,7 +86,7 @@ license:CC0 - + @@ -96,7 +96,7 @@ license:CC0 - + @@ -106,7 +106,7 @@ license:CC0 - + @@ -116,7 +116,7 @@ license:CC0 - + @@ -126,7 +126,7 @@ license:CC0 - + @@ -136,7 +136,7 @@ license:CC0 - + @@ -146,7 +146,7 @@ license:CC0 - + @@ -156,7 +156,7 @@ license:CC0 - + @@ -166,7 +166,7 @@ license:CC0 - + @@ -176,7 +176,7 @@ license:CC0 - + @@ -258,68 +258,68 @@ license:CC0 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index b21a816b2bb..f0cc2708fe4 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -10058,6 +10058,7 @@ twocrudea // MAB (c) 1990 Data East USA (US) @source:cc40.cpp cc40 // 1983 TI CC-40 +cc40p // 1983 TI CC-40+ @source:ccastles.cpp ccastles // 136022 (c) 1983 -- cgit v1.2.3 From c115cf1c8e1f85918cb6040b2a7fc1fd085ef2cc Mon Sep 17 00:00:00 2001 From: David Haywood <28625134+DavidHaywood@users.noreply.github.com> Date: Wed, 21 Apr 2021 19:11:37 +0100 Subject: travrusa.cpp - hold vblank interrupt for the whole of the vblank period, allowing it to retrigger in some cases - improves shtrider countdown sync at start of race (#7989) --- src/mame/drivers/travrusa.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mame/drivers/travrusa.cpp b/src/mame/drivers/travrusa.cpp index 10eccf660e8..2b4dbe8bc1b 100644 --- a/src/mame/drivers/travrusa.cpp +++ b/src/mame/drivers/travrusa.cpp @@ -309,7 +309,6 @@ void travrusa_state::travrusa(machine_config &config) /* basic machine hardware */ Z80(config, m_maincpu, 4000000); /* 4 MHz (?) */ m_maincpu->set_addrmap(AS_PROGRAM, &travrusa_state::main_map); - m_maincpu->set_vblank_int("screen", FUNC(travrusa_state::irq0_line_hold)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -321,6 +320,8 @@ void travrusa_state::travrusa(machine_config &config) screen.set_visarea(1*8, 31*8-1, 0*8, 32*8-1); screen.set_screen_update(FUNC(travrusa_state::screen_update_travrusa)); screen.set_palette(m_palette); + // Race start countdown in shtrider needs multiple interrupts per frame to sync, mustache.cpp has the same, and is also a Seibu game + screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_IRQ0); GFXDECODE(config, m_gfxdecode, m_palette, gfx_travrusa); PALETTE(config, m_palette, FUNC(travrusa_state::travrusa_palette), 16*8+16*8, 128+16); -- cgit v1.2.3 From 6b8a176ac27d38904e970ee1a29a726f8f663bb8 Mon Sep 17 00:00:00 2001 From: David Haywood <28625134+DavidHaywood@users.noreply.github.com> Date: Wed, 21 Apr 2021 19:13:13 +0100 Subject: segas16a/sega16b tweaks - change when video is updated (for fantzone) - bump quantum time for 16a cases with MCU (for quartet stage 18) (#7987) --- src/mame/drivers/segas16a.cpp | 6 ++++++ src/mame/drivers/segas16b.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp index 39938a46248..c0b7fff6256 100644 --- a/src/mame/drivers/segas16a.cpp +++ b/src/mame/drivers/segas16a.cpp @@ -1995,6 +1995,9 @@ void segas16a_state::system16a(machine_config &config) m_screen->set_visarea(0*8, 40*8-1, 0*8, 28*8-1); m_screen->set_screen_update(FUNC(segas16a_state::screen_update)); m_screen->set_palette(m_palette); + // see MT1852 (glitch in fantzone after stage intro text vanishes) + // this is a hack, but the scroll values must be latched at some point, when is unknown + m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); SEGA_SYS16A_SPRITES(config, m_sprites, 0); SEGAIC16VID(config, m_segaic16vid, 0, "gfxdecode"); @@ -2056,6 +2059,9 @@ void segas16a_state::system16a_i8751(machine_config &config) m_mcu->port_out_cb<1>().set(FUNC(segas16a_state::mcu_control_w)); m_screen->screen_vblank().set(FUNC(segas16a_state::i8751_main_cpu_vblank_w)); + + // prevent glitchy background scroll on quartet stage 18 + config.set_maximum_quantum(attotime::from_hz(6000)); } void segas16a_state::system16a_no7751(machine_config &config) diff --git a/src/mame/drivers/segas16b.cpp b/src/mame/drivers/segas16b.cpp index 1552c323884..e992716ce8f 100644 --- a/src/mame/drivers/segas16b.cpp +++ b/src/mame/drivers/segas16b.cpp @@ -3974,6 +3974,8 @@ void segas16b_state::system16b(machine_config &config) m_screen->set_raw(MASTER_CLOCK_25MHz/4, 400, 0, 320, 262, 0, 224); m_screen->set_screen_update(FUNC(segas16b_state::screen_update)); m_screen->set_palette(m_palette); + // see note in segas16a.cpp, also used here for consistency + m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); SEGA_SYS16B_SPRITES(config, m_sprites, 0); SEGAIC16VID(config, m_segaic16vid, 0, m_gfxdecode); @@ -4198,6 +4200,8 @@ void segas16b_state::lockonph(machine_config &config) m_screen->set_raw(MASTER_CLOCK_25MHz/4, 400, 0, 320, 262, 0, 224); // wrong, other XTAL seems to be 17Mhz? m_screen->set_screen_update(FUNC(segas16b_state::screen_update)); m_screen->set_palette(m_palette); + // see note in segas16a.cpp, also used here for consistency + m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); SEGA_SYS16B_SPRITES(config, m_sprites, 0); SEGAIC16VID(config, m_segaic16vid, 0, m_gfxdecode); -- cgit v1.2.3 From a1a6ff7087af43adc4b739f8ffdccd77354d7e4f Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 22 Apr 2021 04:14:19 +1000 Subject: laserbat.cpp: Quantise area effect 2/shell effect for catnmous. (#7964) --- src/mame/audio/laserbat.cpp | 6 +-- src/mame/drivers/laserbat.cpp | 24 ++++++--- src/mame/includes/laserbat.h | 117 ++++++++++++++++++------------------------ src/mame/video/laserbat.cpp | 26 +++------- 4 files changed, 75 insertions(+), 98 deletions(-) diff --git a/src/mame/audio/laserbat.cpp b/src/mame/audio/laserbat.cpp index 864b0c11c1f..66ec4dc2c10 100644 --- a/src/mame/audio/laserbat.cpp +++ b/src/mame/audio/laserbat.cpp @@ -130,7 +130,7 @@ void laserbat_state_base::csound2_w(uint8_t data) void laserbat_state::csound2_w(uint8_t data) { // there are a bunch of edge-triggered things, so grab changes - unsigned const diff = data ^ m_csound2; + uint8_t const diff = data ^ m_csound2; // SN76477 and distortion control if (data & diff & 0x01) @@ -317,10 +317,10 @@ void catnmous_state::csound1_w(uint8_t data) void catnmous_state::csound2_w(uint8_t data) { // the bottom bit is used for sprite banking, of all things - m_gfx2 = memregion("gfx2")->base() + ((data & 0x01) ? 0x0800 : 0x0000); + m_gfx2_base = uint16_t(BIT(data, 0)) << 11; // the top bit is called RESET on the wiring diagram - m_audiopcb->reset_w((data & 0x80) ? 1 : 0); + m_audiopcb->reset_w(BIT(data, 7)); m_csound2 = data; } diff --git a/src/mame/drivers/laserbat.cpp b/src/mame/drivers/laserbat.cpp index 2bd84687d19..833ff5806b0 100644 --- a/src/mame/drivers/laserbat.cpp +++ b/src/mame/drivers/laserbat.cpp @@ -65,6 +65,11 @@ * The sprite ROM is twice the size as Laser Battle with the bank selected using bit 9 of the 16-bit sound interface (there's a wire making this connection visible on the component side of the PCB) + * At least some boards have IC13I pins 8, 9, 10 and 11 bent out of + the socket, tied together, and pulled high via a 4k7 resistor, + which quantises the shell/area effect 2 to four-pixel boundaries + (implemented as m_eff2_mask) - would be good to see whether this + mod is present on all boards * If demo sounds are enabled (using DIP switches), background music is played every sixth time through the attract loop * Sound board emulation is based on tracing the program and guessing @@ -412,9 +417,14 @@ INTERRUPT_GEN_MEMBER(laserbat_state_base::laserbat_interrupt) m_maincpu->set_input_line(0, ASSERT_LINE); } -void laserbat_state_base::init_laserbat() +void laserbat_state_base::machine_start() { + // start rendering scanlines + m_screen->register_screen_bitmap(m_bitmap); m_scanline_timer = timer_alloc(TIMER_SCANLINE); + m_scanline_timer->adjust(m_screen->time_until_pos(1, 0)); + + save_item(NAME(m_gfx2_base)); save_item(NAME(m_input_mux)); save_item(NAME(m_mpx_p_1_2)); @@ -436,10 +446,10 @@ void laserbat_state_base::init_laserbat() save_item(NAME(m_neg1)); save_item(NAME(m_neg2)); - save_item(NAME(m_csound1)); - save_item(NAME(m_csound2)); save_item(NAME(m_rhsc)); save_item(NAME(m_whsc)); + save_item(NAME(m_csound1)); + save_item(NAME(m_csound2)); } void laserbat_state::machine_start() @@ -732,7 +742,7 @@ ROM_START( catnmousa ) ROM_END -GAME( 1981, laserbat, 0, laserbat, laserbat, laserbat_state, init_laserbat, ROT0, "Zaccaria", "Laser Battle", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1981, lazarian, laserbat, laserbat, lazarian, laserbat_state, init_laserbat, ROT0, "Zaccaria (Bally Midway license)", "Lazarian", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, catnmous, 0, catnmous, catnmous, catnmous_state, init_laserbat, ROT90, "Zaccaria", "Cat and Mouse (type 02 program)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1982, catnmousa, catnmous, catnmous, catnmous, catnmous_state, init_laserbat, ROT90, "Zaccaria", "Cat and Mouse (type 01 program)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, laserbat, 0, laserbat, laserbat, laserbat_state, empty_init, ROT0, "Zaccaria", "Laser Battle", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, lazarian, laserbat, laserbat, lazarian, laserbat_state, empty_init, ROT0, "Zaccaria (Bally Midway license)", "Lazarian", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, catnmous, 0, catnmous, catnmous, catnmous_state, empty_init, ROT90, "Zaccaria", "Cat and Mouse (type 02 program)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1982, catnmousa, catnmous, catnmous, catnmous, catnmous_state, empty_init, ROT90, "Zaccaria", "Cat and Mouse (type 01 program)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/laserbat.h b/src/mame/includes/laserbat.h index 621c10838d3..66aa0a955c9 100644 --- a/src/mame/includes/laserbat.h +++ b/src/mame/includes/laserbat.h @@ -29,7 +29,14 @@ class laserbat_state_base : public driver_device { public: - laserbat_state_base(const machine_config &mconfig, device_type type, const char *tag) + void laserbat_base(machine_config &config); + void laserbat_io_map(address_map &map); + void laserbat_map(address_map &map); + +protected: + enum { TIMER_SCANLINE }; + + laserbat_state_base(const machine_config &mconfig, device_type type, const char *tag, uint8_t eff2_mask) : driver_device(mconfig, type, tag) , m_mux_ports(*this, {"ROW0", "ROW1", "SW1", "SW2"}) , m_row1(*this, "ROW1") @@ -40,39 +47,12 @@ public: , m_gfxmix(*this, "gfxmix") , m_pvi(*this, "pvi%u", 1U) , m_gfxdecode(*this, "gfxdecode") - , m_scanline_timer(nullptr) - , m_gfx1(nullptr) - , m_gfx2(nullptr) - , m_input_mux(0) - , m_mpx_p_1_2(false) - , m_mpx_bkeff(false) - , m_nave(false) - , m_clr_lum(0) - , m_shp(0) - , m_wcoh(0) - , m_wcov(0) - , m_abeff1(false) - , m_abeff2(false) - , m_mpx_eff2_sh(false) - , m_coleff(0) - , m_neg1(false) - , m_neg2(false) - , m_rhsc(0) - , m_whsc(0) - , m_csound1(0) - , m_csound2(0) + , m_gfx1(*this, "gfx1") + , m_gfx2(*this, "gfx2") + , m_eff2_mask(eff2_mask) { } - void init_laserbat(); - - void laserbat_base(machine_config &config); - void laserbat_io_map(address_map &map); - void laserbat_map(address_map &map); - -protected: - enum { TIMER_SCANLINE }; - // control ports void ct_io_w(uint8_t data); uint8_t rrowx_r(); @@ -93,7 +73,7 @@ protected: virtual void csound2_w(uint8_t data); // running the video - virtual void video_start() override; + virtual void machine_start() override; uint32_t screen_update_laserbat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -102,55 +82,57 @@ protected: TIMER_CALLBACK_MEMBER(video_line); // input lines - required_ioport_array<4> m_mux_ports; - required_ioport m_row1; - required_ioport m_row2; + required_ioport_array<4> m_mux_ports; + required_ioport m_row1; + required_ioport m_row2; // main CPU device - required_device m_maincpu; + required_device m_maincpu; // video devices - required_device m_screen; - required_device m_palette; - required_device m_gfxmix; - required_device_array m_pvi; - required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + required_device m_gfxmix; + required_device_array m_pvi; + required_device m_gfxdecode; // stuff for rendering video - emu_timer *m_scanline_timer; - bitmap_ind16 m_bitmap; - uint8_t const *m_gfx1; - uint8_t const *m_gfx2; + required_region_ptr m_gfx1; + required_region_ptr m_gfx2; + emu_timer *m_scanline_timer = nullptr; + bitmap_ind16 m_bitmap; + uint16_t m_gfx2_base = 0; + uint8_t const m_eff2_mask; // control lines - unsigned m_input_mux; + uint8_t m_input_mux; bool m_mpx_p_1_2; // RAM used by TTL video hardware, writable by CPU - uint8_t m_bg_ram[0x400]; // background tilemap - uint8_t m_eff_ram[0x400]; // per-scanline effects (A8 not wired meaning only half is usable) - bool m_mpx_bkeff; // select between writing background and effects memory + uint8_t m_bg_ram[0x400]; // background tilemap + uint8_t m_eff_ram[0x400]; // per-scanline effects (A8 not wired meaning only half is usable) + bool m_mpx_bkeff = false; // select between writing background and effects memory // signals affecting the TTL-generated 32x32 sprite - bool m_nave; // 1-bit enable - unsigned m_clr_lum; // 3-bit colour/luminance - unsigned m_shp; // 3-bit shape - unsigned m_wcoh; // 8-bit offset horizontal - unsigned m_wcov; // 8-bit offset vertical + bool m_nave = false; // 1-bit enable + uint8_t m_clr_lum = 0; // 3-bit colour/luminance + uint8_t m_shp = 0; // 3-bit shape + uint8_t m_wcoh = 0; // 8-bit offset horizontal + uint8_t m_wcov = 0; // 8-bit offset vertical // video effects signals - bool m_abeff1; // 1-bit effect enable - bool m_abeff2; // 1-bit effect enable - bool m_mpx_eff2_sh; // 1-bit effect selection - unsigned m_coleff; // 2-bit colour effect - bool m_neg1; // 1-bit area selection - bool m_neg2; // 1-bit area selection + bool m_abeff1 = false; // 1-bit effect enable + bool m_abeff2 = false; // 1-bit effect enable + bool m_mpx_eff2_sh = false; // 1-bit effect selection + uint8_t m_coleff = 0; // 2-bit colour effect + bool m_neg1 = false; // 1-bit area selection + bool m_neg2 = false; // 1-bit area selection // sound board I/O signals - unsigned m_rhsc; // 8-bit input from J7 - unsigned m_whsc; // 8-bit output to J7 - unsigned m_csound1; // bits 1-8 on J3 - unsigned m_csound2; // bits 9-16 on J3 + uint8_t m_rhsc = 0; // 8-bit input from J7 + uint8_t m_whsc = 0; // 8-bit output to J7 + uint8_t m_csound1 = 0; // bits 1-8 on J3 + uint8_t m_csound2 = 0; // bits 9-16 on J3 }; @@ -158,11 +140,10 @@ class laserbat_state : public laserbat_state_base { public: laserbat_state(const machine_config &mconfig, device_type type, const char *tag) - : laserbat_state_base(mconfig, type, tag) + : laserbat_state_base(mconfig, type, tag, 0x00) , m_csg(*this, "csg") , m_synth_low(*this, "synth_low") , m_synth_high(*this, "synth_high") - , m_keys(0) { } @@ -184,7 +165,7 @@ protected: required_device m_synth_high; // register state - unsigned m_keys; // low octave keys 1-13 and high octave keys 2-12 (24 bits) + uint32_t m_keys = 0; // low octave keys 1-13 and high octave keys 2-12 (24 bits) }; @@ -192,7 +173,7 @@ class catnmous_state : public laserbat_state_base { public: catnmous_state(const machine_config &mconfig, device_type type, const char *tag) - : laserbat_state_base(mconfig, type, tag) + : laserbat_state_base(mconfig, type, tag, 0x03) , m_audiopcb(*this, "audiopcb") { } diff --git a/src/mame/video/laserbat.cpp b/src/mame/video/laserbat.cpp index 09af495c61b..efcd021d2ad 100644 --- a/src/mame/video/laserbat.cpp +++ b/src/mame/video/laserbat.cpp @@ -157,18 +157,6 @@ void laserbat_state_base::cnt_nav_w(uint8_t data) } -void laserbat_state_base::video_start() -{ - // we render straight from ROM - m_gfx1 = memregion("gfx1")->base(); - m_gfx2 = memregion("gfx2")->base(); - - // start rendering scanlines - m_screen->register_screen_bitmap(m_bitmap); - m_scanline_timer->adjust(m_screen->time_until_pos(1, 0)); -} - - uint32_t laserbat_state_base::screen_update_laserbat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bool const flip_y = flip_screen_y(), flip_x = flip_screen_x(); @@ -281,16 +269,14 @@ TIMER_CALLBACK_MEMBER(laserbat_state_base::video_line) for (int x = 0, px = x_offset; max_x >= px; x++) { // calculate area effects - // I have no idea where the magical x offset comes from but it's necessary - bool const right_half = bool((x + 0) & 0x80); - bool const eff1_cmp = right_half ? (uint8_t((x + 0) & 0x7f) < (eff1_val & 0x7f)) : (uint8_t((x + 0) & 0x7f) > (~eff1_val & 0x7f)); - bool const eff2_cmp = right_half ? (uint8_t((x + 0) & 0x7f) < (eff2_val & 0x7f)) : (uint8_t((x + 0) & 0x7f) > (~eff2_val & 0x7f)); + bool const right_half = bool(x & 0x80); + bool const eff1_cmp = right_half ? (uint8_t(x & 0x7f) < (eff1_val & 0x7f)) : (uint8_t(x & 0x7f) > (~eff1_val & 0x7f)); + bool const eff2_cmp = right_half ? ((uint8_t(x & 0x7f) | m_eff2_mask) < ((eff2_val & 0x7f) | m_eff2_mask)) : ((uint8_t(x & 0x7f) | m_eff2_mask) > ((~eff2_val & 0x7f) | m_eff2_mask)); bool const eff1 = m_abeff1 && (m_neg1 ? !eff1_cmp : eff1_cmp); bool const eff2 = m_abeff2 && (m_neg2 ? !eff2_cmp : eff2_cmp) && m_mpx_eff2_sh; // calculate shell point effect - // using the same magical offset as the area effects - bool const shell = m_abeff2 && (uint8_t((x + 0) & 0xff) == (eff2_val & 0xff)) && !m_mpx_eff2_sh; + bool const shell = m_abeff2 && ((uint8_t(x & 0xff) | m_eff2_mask) == ((eff2_val & 0xff) | m_eff2_mask)) && !m_mpx_eff2_sh; // set effect bits, and mix in PVI graphics while we're here uint16_t const effect_bits = (shell ? 0x0800 : 0x0000) | (eff1 ? 0x1000 : 0x0000) | (eff2 ? 0x2000 : 0x0000); @@ -305,7 +291,7 @@ TIMER_CALLBACK_MEMBER(laserbat_state_base::video_line) } // render the TTL-generated sprite - // more magic offsets here I don't understand the source of + // magic offsets here I don't understand the source of if (m_nave) { int const sprite_row = y + y_offset - ((256 - m_wcov) & 0x0ff); @@ -313,7 +299,7 @@ TIMER_CALLBACK_MEMBER(laserbat_state_base::video_line) { for (unsigned byte = 0, x = x_offset + (3 * ((256 - m_wcoh + 5) & 0x0ff)); 8 > byte; byte++) { - uint8_t bits = m_gfx2[((m_shp << 8) & 0x700) | ((sprite_row << 3) & 0x0f8) | (byte & 0x07)]; + uint8_t bits = m_gfx2[m_gfx2_base | ((m_shp << 8) & 0x700) | ((sprite_row << 3) & 0x0f8) | (byte & 0x07)]; for (unsigned pixel = 0; 4 > pixel; pixel++, bits <<= 2) { if (max_x >= x) row[x++] |= (bits >> 6) & 0x03; -- cgit v1.2.3 From 2de93e31ea2f98039451fb8ee366d0ffea3a1f5b Mon Sep 17 00:00:00 2001 From: Robbbert Date: Thu, 22 Apr 2021 05:09:27 +1000 Subject: lnw80: added HI-LO switch; enabled CAS files. --- src/mame/drivers/lnw80.cpp | 92 +++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 47 deletions(-) diff --git a/src/mame/drivers/lnw80.cpp b/src/mame/drivers/lnw80.cpp index 1c97fe4a70a..5ca2c4af041 100644 --- a/src/mame/drivers/lnw80.cpp +++ b/src/mame/drivers/lnw80.cpp @@ -50,7 +50,7 @@ FE: - bit 2 enables colour on a lnw80 - bit 3 is for selecting roms (low) or 16k hires area (high) on a lnw80 -Shift and Right-arrow will enable 32 cpl, if the hardware allows it. +Shift and Right-arrow will enable 32 cpl. SYSTEM commands: - Press Break (End key) to quit @@ -59,10 +59,8 @@ SYSTEM commands: - / to execute last program loaded - /nnnnn to execute program at nnnnn (decimal) -About the RTC - The time is incremented while ever the cursor is flashing. It is stored in a series - of bytes in the computer's work area. The bytes are in a certain order, this is: - seconds, minutes, hours, year, day, month. The seconds are stored at 0x4041. - A reboot always sets the time to zero. +About the RTC - The hardware side exists, but special software is needed to get the clock to work. + By default, nothing happens. ******************************************************************************************************** @@ -70,8 +68,6 @@ To Do / Status: -------------- - basically works -- add 1.77 / 4 MHz switch -- find out if it really did support 32-cpl mode or not - hi-res and colour are coded but do not work - investigate expansion-box - none of my collection of lnw80-specific floppies will work; some crash MAME @@ -123,7 +119,9 @@ void lnw80_state::lnw80_mem(address_map &map) void lnw80_state::lnw_banked_mem(address_map &map) { map(0x0000, 0x2fff).rom().region("maincpu", 0); + map(0x37de, 0x37de).rw(FUNC(lnw80_state::sys80_f9_r), FUNC(lnw80_state::sys80_f8_w)); map(0x37e0, 0x37e3).rw(FUNC(lnw80_state::irq_status_r), FUNC(lnw80_state::motor_w)); + map(0x37e4, 0x37e7).w(FUNC(lnw80_state::cassunit_w)); map(0x37e8, 0x37eb).rw(FUNC(lnw80_state::printer_r), FUNC(lnw80_state::printer_w)); map(0x37ec, 0x37ef).rw(FUNC(lnw80_state::fdc_r), FUNC(lnw80_state::fdc_w)); map(0x3800, 0x3bff).r(FUNC(lnw80_state::keyboard_r)); @@ -202,29 +200,24 @@ static INPUT_PORTS_START( lnw80 ) PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x') PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z') - // These keys produce output on all systems, the shift key having no effect. They display arrow symbols and underscore. - // On original lnw80, shift cancels all keys except F3 which becomes backspace. - // On the radionic, Shift works, and the symbols display correctly. - // PORT_CHAR('_') is correct for all systems, however the others are only for radionic. - PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("[") PORT_CODE(KEYCODE_F1) PORT_CHAR('[') PORT_CHAR('{') // radionic: F1 - PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("\\") PORT_CODE(KEYCODE_F2) PORT_CHAR('\\') PORT_CHAR('}') // radionic: F2 ; sys80 mkII: F2 ; lnw80: F1 - PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("]") PORT_CODE(KEYCODE_F3) PORT_CHAR(']') PORT_CHAR('|') // radionic: F3 ; sys80 mkII: F3 - PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("^") PORT_CODE(KEYCODE_F4) PORT_CHAR('^') // radionic: F4 ; sys80 mkII: F4 ; lnw80: F2 - PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("_") PORT_CODE(KEYCODE_F5) PORT_CHAR('_') // radionic: LF ; sys80 mkII: F1 ; lnw80: _ - - PORT_START("LINE4") // Number pad: System 80 Mk II only - PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('0') - PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1') PORT_CHAR('!') - PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('2') PORT_CHAR('"') - PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR('3') PORT_CHAR('#') - PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR('4') PORT_CHAR('$') - PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR('5') PORT_CHAR('%') - PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6') PORT_CHAR('&') - PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7') PORT_CHAR('\'') + PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) + PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) + PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("_") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('_') + PORT_BIT(0x28, 0x00, IPT_UNUSED) + + PORT_START("LINE4") + PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') + PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') PORT_START("LINE5") - PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('8') PORT_CHAR('(') - PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') + PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME(": *") PORT_CODE(KEYCODE_MINUS) PORT_CHAR(':') PORT_CHAR('*') PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("; +") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') @@ -234,25 +227,27 @@ static INPUT_PORTS_START( lnw80 ) PORT_START("LINE6") PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(13) - PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("Clear") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(F8)) // Missing from early System 80 + PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("Clear") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(F8)) PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("Break") PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(F9)) PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) /* backspace do the same as cursor left */ PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) - PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) // Missing from early System 80 + PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_START("LINE7") - PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) // LNW80 only + PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_BIT(0xee, 0x00, IPT_UNUSED) PORT_START("CONFIG") PORT_CONFNAME( 0x80, 0x00, "Floppy Disc Drives") PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) PORT_CONFSETTING( 0x80, DEF_STR( On ) ) - PORT_BIT(0x7f, 0x7f, IPT_UNUSED) + PORT_CONFNAME( 0x40, 0x00, "CPU Speed") + PORT_CONFSETTING( 0x00, "1.77 MHz" ) + PORT_CONFSETTING( 0x40, "4 MHz" ) PORT_START("E9") // these are the power-on uart settings PORT_BIT(0x07, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -341,6 +336,7 @@ void lnw80_state::machine_reset() u16 s_clock = s_bauds[m_io_baud->read()] << 4; m_uart_clock->set_unscaled_clock(s_clock); + m_maincpu->set_unscaled_clock(BIT(m_io_config->read(), 6) ? (16_MHz_XTAL / 4) : (16_MHz_XTAL / 9)); // HI-LO switch m_reg_load = 1; m_lnw_mode = 0; lnw80_fe_w(0); @@ -352,11 +348,13 @@ uint32_t lnw80_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, static const uint16_t rows[] = { 0, 0x200, 0x100, 0x300, 1, 0x201, 0x101, 0x301 }; uint16_t sy=0,ma=0; uint8_t cols = BIT(m_lnw_mode, 1) ? 80 : 64; + uint8_t skip = BIT(m_mode, 0) ? 2 : 1; + if (BIT(m_mode, 0)) + cols >>= 1; - /* Although the OS can select 32-character mode, it is not supported by hardware */ - if (m_lnw_mode != m_size_store) + if (cols != m_size_store) { - m_size_store = m_lnw_mode; + m_size_store = cols; screen.set_visible_area(0, cols*6-1, 0, 16*12-1); } @@ -376,7 +374,7 @@ uint32_t lnw80_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, { uint16_t *p = &bitmap.pix(sy++); - for (uint16_t x = ma; x < ma + 64; x++) + for (uint16_t x = ma; x < ma + 64; x+=skip) { uint8_t chr = m_p_videoram[x]; @@ -576,7 +574,6 @@ void lnw80_state::lnw80(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 16_MHz_XTAL / 9); - //m_maincpu->set_clock(16_MHz_XTAL / 4); // or 16MHz / 9; 4MHz or 1.77MHz operation selected by HI/LO switch m_maincpu->set_addrmap(AS_PROGRAM, &lnw80_state::lnw80_mem); m_maincpu->set_addrmap(AS_IO, &lnw80_state::lnw80_io); @@ -595,8 +592,9 @@ void lnw80_state::lnw80(machine_config &config) /* devices */ CASSETTE(config, m_cassette); - m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); + m_cassette->set_formats(trs80l2_cassette_formats); m_cassette->set_default_state(CASSETTE_PLAY); + m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); QUICKLOAD(config, "quickload", "cmd", attotime::from_seconds(1)).set_load_callback(FUNC(lnw80_state::quickload_cb)); @@ -645,16 +643,16 @@ void lnw80_state::lnw80(machine_config &config) ***************************************************************************/ ROM_START(lnw80) - ROM_REGION(0x3800, "maincpu",0) - ROM_LOAD("lnw_a.bin", 0x0000, 0x0800, CRC(e09f7e91) SHA1(cd28e72efcfebde6cf1c7dbec4a4880a69e683da)) - ROM_LOAD("lnw_a1.bin", 0x0800, 0x0800, CRC(ac297d99) SHA1(ccf31d3f9d02c3b68a0ee3be4984424df0e83ab0)) - ROM_LOAD("lnw_b.bin", 0x1000, 0x0800, CRC(c4303568) SHA1(13e3d81c6f0de0e93956fa58c465b5368ea51682)) - ROM_LOAD("lnw_b1.bin", 0x1800, 0x0800, CRC(3a5ea239) SHA1(8c489670977892d7f2bfb098f5df0b4dfa8fbba6)) - ROM_LOAD("lnw_c.bin", 0x2000, 0x0800, CRC(2ba025d7) SHA1(232efbe23c3f5c2c6655466ebc0a51cf3697be9b)) - ROM_LOAD("lnw_c1.bin", 0x2800, 0x0800, CRC(ed547445) SHA1(20102de89a3ee4a65366bc2d62be94da984a156b)) + ROM_REGION(0x3000, "maincpu",0) + ROM_LOAD("lnw_a.u78", 0x0000, 0x0800, CRC(e09f7e91) SHA1(cd28e72efcfebde6cf1c7dbec4a4880a69e683da)) + ROM_LOAD("lnw_a1.u75", 0x0800, 0x0800, CRC(ac297d99) SHA1(ccf31d3f9d02c3b68a0ee3be4984424df0e83ab0)) + ROM_LOAD("lnw_b.u79", 0x1000, 0x0800, CRC(c4303568) SHA1(13e3d81c6f0de0e93956fa58c465b5368ea51682)) + ROM_LOAD("lnw_b1.u76", 0x1800, 0x0800, CRC(3a5ea239) SHA1(8c489670977892d7f2bfb098f5df0b4dfa8fbba6)) + ROM_LOAD("lnw_c.u80", 0x2000, 0x0800, CRC(2ba025d7) SHA1(232efbe23c3f5c2c6655466ebc0a51cf3697be9b)) + ROM_LOAD("lnw_c1.u77", 0x2800, 0x0800, CRC(ed547445) SHA1(20102de89a3ee4a65366bc2d62be94da984a156b)) ROM_REGION(0x0800, "chargen",0) - ROM_LOAD("lnw_chr.bin", 0x0000, 0x0800, CRC(c89b27df) SHA1(be2a009a07e4378d070002a558705e9a0de59389)) + ROM_LOAD("lnw_chr.u100", 0x0000, 0x0800, CRC(c89b27df) SHA1(be2a009a07e4378d070002a558705e9a0de59389)) ROM_END -- cgit v1.2.3 From d82c2d1c65360dbe7612938175c39a3213b9ddf5 Mon Sep 17 00:00:00 2001 From: sasuke-arcade <58130089+sasuke-arcade@users.noreply.github.com> Date: Thu, 22 Apr 2021 04:12:57 +0900 Subject: cyclemb.cpp: Improve input, sound, flip screen, and dip switches (#7979) * cyclemb.cpp: Improve input, sound, flip screen, and dip switches - Support for correct input of Cycle Maaboh roller controller. Previous inputs did not work correctly. This made it impossible to clear stage 3 and later, which requires roller inputs. - Fixed possibly incorrect handling of sound latch. Fixed issue where Cycle Maaboh would not play the stage music. Previously, command to get input was being overwritten by sound latch. - Support I/O input for hiding screen. Screen switching at start of a stage is now correct. - Fixed position of tilemap in flip screen of Cycle Maaboh. - Added support for Sky Destroyer flipscreen. - Fixed dipswitches. Removed definition of unused bits for non-dipswitch inputs. Added some dipswitch definitions. - Implemented work RAM switching for sprites. Games on this board used to switch two sprites work RAM every frame. This implementation improved the frame rate of the sprites. --- src/mame/drivers/cyclemb.cpp | 480 +++++++++++++++++++++++-------------------- 1 file changed, 253 insertions(+), 227 deletions(-) diff --git a/src/mame/drivers/cyclemb.cpp b/src/mame/drivers/cyclemb.cpp index 5557cd51bc3..0d1a8fdec4d 100644 --- a/src/mame/drivers/cyclemb.cpp +++ b/src/mame/drivers/cyclemb.cpp @@ -2,20 +2,21 @@ // copyright-holders:Angelo Salese /*************************************************************************************************** - Cycle Maabou (c) 1984 Taito Corporation / Seta - Sky Destroyer (c) 1985 Taito Corporation +Cycle Maabou (c) 1984 Taito Corporation / Seta +Sky Destroyer (c) 1985 Taito Corporation - appears to be in the exact middle between the gsword / josvolly HW and the ppking / gladiator HW +appears to be in the exact middle between the gsword / josvolly HW and the ppking / gladiator HW - driver by Angelo Salese +driver by Angelo Salese - TODO: - - inputs in Cycle Maabou (weird dial/positional input); - - sound (controlled by three i8741); - - add flipscreen; - - color prom resistor network is guessed, cyclemb yellows are more reddish on pcb video and photos; +TODO: +- separate driver into 2 classes +- reduce tagmap lookups +- sound (controlled by three i8741); +- coinage (controlled by i8741, like Gladiator / Ougon no Shiro); +- color prom resistor network is guessed, cyclemb yellows are more reddish on pcb video and photos; - BTANB verified on pcb: cyclemb standing cones are reddish-yellow/black instead of red/white +BTANB verified on pcb: cyclemb standing cones are reddish-yellow/black instead of red/white ===================================================================================================== @@ -63,7 +64,6 @@ P0_3.11T [be89c1f7] 82S129 P0_4.11U [4886d832] / - --- Team Japump!!! --- Dumped by Chack'n 27/Nov/2009 @@ -96,7 +96,7 @@ public: m_obj1_ram(*this, "obj1_ram"), m_obj2_ram(*this, "obj2_ram"), m_obj3_ram(*this, "obj3_ram"), - m_pad(*this, "PAD_P%u", 1U) + m_dial(*this, "DIAL_P%u", 1U) { } required_device m_maincpu; @@ -111,7 +111,12 @@ public: required_shared_ptr m_obj2_ram; required_shared_ptr m_obj3_ram; - optional_ioport_array<2> m_pad; + optional_ioport_array<2> m_dial; + struct + { + uint8_t current_value; + bool reverse; + } m_dial_status[2]; struct { @@ -123,8 +128,13 @@ public: } m_mcu[2]; uint16_t m_dsw_pc_hack; + bool m_use_dial; + bool m_screen_display; + int m_sprite_page; void cyclemb_bankswitch_w(uint8_t data); + void skydest_bankswitch_w(uint8_t data); + void cyclemb_screen_display_w(uint8_t data); // uint8_t mcu_status_r(); // void sound_cmd_w(uint8_t data); void cyclemb_flip_w(uint8_t data); @@ -134,7 +144,8 @@ public: void skydest_i8741_1_w(offs_t offset, uint8_t data); // DECLARE_WRITE_LINE_MEMBER(ym_irq); - template DECLARE_CUSTOM_INPUT_MEMBER(pad_r); + void update_dial(int P); + template DECLARE_CUSTOM_INPUT_MEMBER(dial_r); void init_skydest(); void init_cyclemb(); @@ -149,6 +160,7 @@ public: void skydest_draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void skydest_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void skydest_i8741_reset(); + void cyclemb_dial_reset(); void cyclemb(machine_config &config); void skydest(machine_config &config); void cyclemb_io(address_map &map); @@ -211,9 +223,9 @@ void cyclemb_state::cyclemb_draw_tilemap(screen_device &screen, bitmap_ind16 &bi if(flip_screen()) { - gfx->opaque(bitmap,cliprect,tile,color,1,1,512-(x*8)-scrollx,256-(y*8)); + gfx->opaque(bitmap,cliprect,tile,color,1,1,504-(x*8)-scrollx,248-(y*8)); /* wrap-around */ - gfx->opaque(bitmap,cliprect,tile,color,1,1,512-(x*8)-scrollx+512,256-(y*8)); + gfx->opaque(bitmap,cliprect,tile,color,1,1,504-(x*8)-scrollx+512,248-(y*8)); } else { @@ -228,16 +240,6 @@ void cyclemb_state::cyclemb_draw_tilemap(screen_device &screen, bitmap_ind16 &bi } - /* - bank 1 - xxxx xxxx [0] sprite offset - ---x xxxx [1] color offset - bank 2 - xxxx xxxx [0] y offs - xxxx xxxx [1] x offs - bank 3 - ---- ---x [1] sprite enable flag? - */ void cyclemb_state::cyclemb_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { uint8_t col,fx,fy,region; @@ -253,8 +255,24 @@ void cyclemb_state::cyclemb_draw_sprites(screen_device &screen, bitmap_ind16 &bi 0x27 cone (0x13 0x00) */ - for(i=0;i<0x80;i+=2) + int page_start = m_sprite_page * 0x80; + + for(i=0+page_start;i<0x80+page_start;i+=2) { + /*** sprite format: *** + + bank 1 + xxxx xxxx [0] sprite offset + ---x xxxx [1] color offset + + bank 2 + xxxx xxxx [0] y offs + xxxx xxxx [1] x offs + + bank 3 + ---- ---x [1] sprite enable flag? + */ + y = 0xf1 - m_obj2_ram[i]; x = m_obj2_ram[i+1] - 56; spr_offs = (m_obj1_ram[i+0]); @@ -290,7 +308,6 @@ void cyclemb_state::skydest_draw_tilemap(screen_device &screen, bitmap_ind16 &bi gfx_element *gfx = m_gfxdecode->gfx(0); int x,y; - for (y=0;y<32;y++) { for (x=2;x<62;x++) @@ -317,27 +334,22 @@ void cyclemb_state::skydest_draw_tilemap(screen_device &screen, bitmap_ind16 &bi else scrolly = m_vram[(x-32)*64+1]; - - gfx->opaque(bitmap,cliprect,tile,color,0,0,x*8+scrollx,((y*8)-scrolly)&0xff); - gfx->opaque(bitmap,cliprect,tile,color,0,0,x*8+scrollx-480,((y*8)-scrolly)&0xff); - gfx->opaque(bitmap,cliprect,tile,color,0,0,x*8+scrollx+480,((y*8)-scrolly)&0xff); - - + if (flip_screen()) + { + gfx->opaque(bitmap,cliprect,tile,color,1,1,504-x*8+scrollx, 248-(((y*8)-scrolly)&0xff)); + gfx->opaque(bitmap,cliprect,tile,color,1,1,504-x*8+scrollx-480, 248-(((y*8)-scrolly)&0xff)); + gfx->opaque(bitmap,cliprect,tile,color,1,1,504-x*8+scrollx+480, 248-(((y*8)-scrolly)&0xff)); + } + else + { + gfx->opaque(bitmap,cliprect,tile,color,0,0,x*8+scrollx,((y*8)-scrolly)&0xff); + gfx->opaque(bitmap,cliprect,tile,color,0,0,x*8+scrollx-480,((y*8)-scrolly)&0xff); + gfx->opaque(bitmap,cliprect,tile,color,0,0,x*8+scrollx+480,((y*8)-scrolly)&0xff); + } } } } -/* - bank 1 - xxxx xxxx [0] sprite offset - ---x xxxx [1] color offset - bank 2 - xxxx xxxx [0] y offs - xxxx xxxx [1] x offs - bank 3 - ---- ---x [1] sprite enable flag? -*/ - void cyclemb_state::skydest_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { uint8_t col,fx,fy,region; @@ -346,8 +358,24 @@ void cyclemb_state::skydest_draw_sprites(screen_device &screen, bitmap_ind16 &bi // popmessage("%d %d",m_obj2_ram[0x0d], 0xf1 - m_obj2_ram[0x0c+1] + 68); - for(i=0;i<0x80;i+=2) + int page_start = m_sprite_page * 0x80; + + for(i=0+page_start;i<0x80+page_start;i+=2) { + /*** sprite format *** + + bank 1 + xxxx xxxx [0] sprite offset + ---x xxxx [1] color offset + + bank 2 + xxxx xxxx [0] y offs + xxxx xxxx [1] x offs + + bank 3 + ---- ---x [1] sprite enable flag? + */ + y = m_obj2_ram[i] - 1; x = m_obj2_ram[i+1]; @@ -367,7 +395,6 @@ void cyclemb_state::skydest_draw_sprites(screen_device &screen, bitmap_ind16 &bi x-=16; } - fx = (m_obj3_ram[i+0] & 4) >> 2; fy = (m_obj3_ram[i+0] & 8) >> 3; @@ -382,8 +409,13 @@ void cyclemb_state::skydest_draw_sprites(screen_device &screen, bitmap_ind16 &bi uint32_t cyclemb_state::screen_update_cyclemb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - cyclemb_draw_tilemap(screen,bitmap,cliprect); - cyclemb_draw_sprites(screen,bitmap,cliprect); + bitmap.fill(0, cliprect); + + if (m_screen_display) + { + cyclemb_draw_tilemap(screen,bitmap,cliprect); + cyclemb_draw_sprites(screen,bitmap,cliprect); + } return 0; } @@ -391,14 +423,30 @@ uint32_t cyclemb_state::screen_update_skydest(screen_device &screen, bitmap_ind1 { bitmap.fill(0, cliprect); - skydest_draw_tilemap(screen,bitmap,cliprect); - skydest_draw_sprites(screen,bitmap,cliprect); + if (m_screen_display) + { + skydest_draw_tilemap(screen,bitmap,cliprect); + skydest_draw_sprites(screen,bitmap,cliprect); + } return 0; } void cyclemb_state::cyclemb_bankswitch_w(uint8_t data) { - membank("bank1")->set_entry(data & 3); + membank("bank1")->set_entry(data & 0x03); + m_sprite_page = (data & 0x04) >> 2; +} + +void cyclemb_state::skydest_bankswitch_w(uint8_t data) +{ + membank("bank1")->set_entry(data & 0x03); + m_sprite_page = (data & 0x04) >> 2; + flip_screen_set((data & 0x40) == 0); +} + +void cyclemb_state::cyclemb_screen_display_w(uint8_t data) +{ + m_screen_display = (data & 0x01) != 0; } #if 0 @@ -439,6 +487,15 @@ void cyclemb_state::skydest_i8741_reset() m_mcu[0].packet_type = 0; } +void cyclemb_state::cyclemb_dial_reset() +{ + for (int i = 0; i < 2; i++) + { + m_dial_status[i].current_value = 0; + m_dial_status[i].reverse = false; + } +} + uint8_t cyclemb_state::skydest_i8741_0_r(offs_t offset) { if(offset == 1) //status port @@ -476,6 +533,7 @@ uint8_t cyclemb_state::skydest_i8741_0_r(offs_t offset) m_mcu[0].packet_type^=0x20; if(m_mcu[0].packet_type & 0x20) { + update_dial(0); m_mcu[0].rxd = ((ioport("P1_1")->read()) & 0x9f) | (m_mcu[0].packet_type); } else @@ -489,7 +547,10 @@ uint8_t cyclemb_state::skydest_i8741_0_r(offs_t offset) { m_mcu[0].packet_type^=0x20; if(m_mcu[0].packet_type & 0x20) + { + update_dial(1); m_mcu[0].rxd = ((ioport("P2_1")->read()) & 0x9f) | (m_mcu[0].packet_type); + } else { m_mcu[0].rxd = ((ioport("P2_0")->read()) & 0x1f) | (m_mcu[0].packet_type); @@ -561,7 +622,6 @@ void cyclemb_state::skydest_i8741_0_w(offs_t offset, uint8_t data) m_mcu[0].txd = data; m_mcu[1].rst = 0; - m_soundlatch->write(data & 0xff); if(m_mcu[0].txd == 0x41) m_mcu[0].state = 1; @@ -571,6 +631,7 @@ void cyclemb_state::skydest_i8741_0_w(offs_t offset, uint8_t data) m_mcu[0].state = 3; else { + m_soundlatch->write(data & 0xff); //m_audiocpu->set_input_line(0, HOLD_LINE); } @@ -594,7 +655,7 @@ void cyclemb_state::cyclemb_io(address_map &map) { // map.global_mask(0xff); map(0xc000, 0xc000).w(FUNC(cyclemb_state::cyclemb_bankswitch_w)); - //map(0xc020, 0xc020).nopw(); // ? + map(0xc020, 0xc020).w(FUNC(cyclemb_state::cyclemb_screen_display_w)); map(0xc09e, 0xc09f).rw(FUNC(cyclemb_state::skydest_i8741_0_r), FUNC(cyclemb_state::skydest_i8741_0_w)); map(0xc0bf, 0xc0bf).w(FUNC(cyclemb_state::cyclemb_flip_w)); //flip screen } @@ -603,11 +664,11 @@ void cyclemb_state::cyclemb_io(address_map &map) void cyclemb_state::skydest_io(address_map &map) { // map.global_mask(0xff); - map(0xc000, 0xc000).w(FUNC(cyclemb_state::cyclemb_bankswitch_w)); - //map(0xc020, 0xc020).nopw(); // ? + map(0xc000, 0xc000).w(FUNC(cyclemb_state::skydest_bankswitch_w)); + map(0xc020, 0xc020).w(FUNC(cyclemb_state::cyclemb_screen_display_w)); map(0xc080, 0xc081).rw(FUNC(cyclemb_state::skydest_i8741_0_r), FUNC(cyclemb_state::skydest_i8741_0_w)); //map(0xc0a0, 0xc0a0).nopw(); // ? - map(0xc0bf, 0xc0bf).w(FUNC(cyclemb_state::cyclemb_flip_w)); //flip screen + //map(0xc0bf, 0xc0bf).w(FUNC(cyclemb_state::cyclemb_flip_w)); //flip screen } @@ -627,7 +688,10 @@ uint8_t cyclemb_state::skydest_i8741_1_r(offs_t offset) if(m_mcu[1].rst == 1) return 0x40; - return m_soundlatch->read(); + uint8_t ret = m_soundlatch->read(); + m_soundlatch->clear_w(); + + return ret; } void cyclemb_state::skydest_i8741_1_w(offs_t offset, uint8_t data) @@ -661,17 +725,48 @@ void cyclemb_state::machine_start() save_item(NAME(m_mcu[i].state), i); save_item(NAME(m_mcu[i].packet_type), i); } + + for (int i = 0; i < 2; i++) + { + save_item(NAME(m_dial_status[i].current_value), i); + save_item(NAME(m_dial_status[i].reverse), i); + } + + save_item(NAME(m_screen_display)); + save_item(NAME(m_sprite_page)); + + cyclemb_dial_reset(); + m_screen_display = true; + m_sprite_page = 0; } void cyclemb_state::machine_reset() { skydest_i8741_reset(); + cyclemb_dial_reset(); +} + +void cyclemb_state::update_dial(int P) +{ + if (!m_use_dial) + { + return; + } + + int8_t input_value = m_dial[P]->read(); + int delta = std::clamp((int)input_value, -0x1f, 0x1f); + + if (delta != 0) + { + m_dial_status[P].reverse = (delta < 0); + m_dial_status[P].current_value = (m_dial_status[P].current_value + (uint8_t)abs(delta)) & 0x1f; + } } template -CUSTOM_INPUT_MEMBER(cyclemb_state::pad_r) +CUSTOM_INPUT_MEMBER(cyclemb_state::dial_r) { - return m_pad[P]->read(); + return m_dial_status[P].current_value | (m_dial_status[P].reverse ? 0x80 : 0x00); } @@ -679,95 +774,59 @@ static INPUT_PORTS_START( cyclemb ) PORT_START("SYSTEM") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_DIPNAME( 0x04, 0x00, "SYSTEM" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x7c, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2) PORT_START("P1_0") - PORT_DIPNAME( 0x01, 0x00, "IN1" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("P1_1") - PORT_BIT( 0x9f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(cyclemb_state, pad_r<0>) - PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(cyclemb_state, dial_r<0>) - PORT_START("PAD_P1") - PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(16) PORT_PLAYER(1) + PORT_START("DIAL_P1") + PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(20) PORT_KEYDELTA(16) PORT_PLAYER(1) PORT_RESET PORT_REVERSE PORT_START("P2_0") - PORT_DIPNAME( 0x01, 0x00, "IN1" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("P2_1") - PORT_BIT( 0x9f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(cyclemb_state, pad_r<1>) + PORT_BIT( 0x9f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(cyclemb_state, dial_r<1>) PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_START("PAD_P2") - PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(15) PORT_KEYDELTA(8) PORT_PLAYER(2) + PORT_START("DIAL_P2") + PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(20) PORT_KEYDELTA(16) PORT_PLAYER(2) PORT_RESET PORT_REVERSE PORT_COCKTAIL PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x00, "DSW1" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x03, 0x02, "Difficulty (Stage 1-3)" ) + PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) + PORT_DIPNAME( 0x0c, 0x08, "Difficulty (Stage 4-5)" ) + PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x08, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x00, "DSW2" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) + PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( 2C_1C ) ) PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) ) PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) ) @@ -775,16 +834,16 @@ static INPUT_PORTS_START( cyclemb ) PORT_START("DSW3") PORT_DIPNAME( 0x01, 0x00, DEF_STR( Free_Play ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Yes ) ) PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Yes ) ) PORT_DIPNAME( 0x02, 0x00, "Disallow Game Over (Cheat)" ) - PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPNAME( 0x0c, 0x00, "Stage Start" ) - PORT_DIPSETTING( 0x00, "Tutorial" ) - PORT_DIPSETTING( 0x04, "1" ) - PORT_DIPSETTING( 0x08, "2" ) - PORT_DIPSETTING( 0x0c, "Bonus Game" ) + PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x0c, 0x00, "Starting Stage" ) + PORT_DIPSETTING( 0x00, "Stage 1" ) + PORT_DIPSETTING( 0x04, "Stage 3" ) + PORT_DIPSETTING( 0x08, "Stage 4" ) + PORT_DIPSETTING( 0x0c, "Bonus Game Only" ) PORT_DIPNAME( 0x10, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x10, DEF_STR( On ) ) @@ -798,135 +857,90 @@ static INPUT_PORTS_START( skydest ) PORT_START("SYSTEM") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_DIPNAME( 0x04, 0x00, "SYSTEM" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x7c, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2) PORT_START("P1_0") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) - PORT_DIPNAME( 0x04, 0x00, "P1_0" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("P1_1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_DIPNAME( 0x04, 0x00, "P1_1" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) - PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("P2_0") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) - PORT_DIPNAME( 0x04, 0x00, "P1_0" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("P2_1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_DIPNAME( 0x04, 0x00, "P1_1" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) - PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, "DSW1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) + PORT_DIPSETTING( 0x07, "1 (Easiest)" ) + PORT_DIPSETTING( 0x06, "2" ) + PORT_DIPSETTING( 0x05, "3" ) + PORT_DIPSETTING( 0x04, "4" ) + PORT_DIPSETTING( 0x03, "5" ) + PORT_DIPSETTING( 0x02, "6" ) + PORT_DIPSETTING( 0x01, "7" ) + PORT_DIPSETTING( 0x00, "8 (Hardest)" ) PORT_DIPNAME( 0x18, 0x10, DEF_STR( Lives ) ) - PORT_DIPSETTING( 0x00, "4" ) - PORT_DIPSETTING( 0x08, "3" ) - PORT_DIPSETTING( 0x10, "2" ) - PORT_DIPSETTING( 0x18, "1" ) + PORT_DIPSETTING( 0x18, "2" ) + PORT_DIPSETTING( 0x10, "3" ) + PORT_DIPSETTING( 0x08, "4" ) + PORT_DIPSETTING( 0x00, "5" ) PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "DSW2" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) + PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( 2C_1C ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) ) + PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("DSW3") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x00, DEF_STR( Free_Play ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_DIPNAME( 0x80, 0x00, "Invincibility (Cheat)" ) - PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - - + PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) INPUT_PORTS_END static const gfx_layout charlayout = @@ -1045,6 +1059,12 @@ ROM_START( cyclemb ) ROM_LOAD( "p0_15.10c", 0x0000, 0x2000, CRC(9cc52c32) SHA1(05d4e7c8ce8fdfc995013c0ed693b4d4778acc25) ) ROM_LOAD( "p0_16.10d", 0x2000, 0x2000, CRC(8d03227e) SHA1(7e90437cbe5e854025e799348bb2cbca98368bd9) ) + ROM_REGION( 0x0400, "mcu1", 0 ) + ROM_LOAD( "ap_002.7b", 0x00000, 0x0400, NO_DUMP ) + + ROM_REGION( 0x0400, "mcu2", 0 ) + ROM_LOAD( "ap-003.7c", 0x00000, 0x0400, NO_DUMP ) + ROM_REGION( 0x4000, "tilemap_data", 0 ) ROM_LOAD( "p0_21.3e", 0x0000, 0x2000, CRC(a7dab6d8) SHA1(c5802e76abd394a2ce1526815bfbfc12e5e57587) ) ROM_LOAD( "p0_20.3d", 0x2000, 0x2000, CRC(53e3a36e) SHA1(d95c1dfe216bb8b1f3e14c72a480eb2befa9d1dd) ) @@ -1116,6 +1136,8 @@ void cyclemb_state::init_cyclemb() rom[0xa36] = 0x00; rom[0xa37] = 0x00; rom[0xa38] = 0x00; + + m_use_dial = true; } void cyclemb_state::init_skydest() @@ -1132,7 +1154,11 @@ void cyclemb_state::init_skydest() rom[0xa36] = 0x00; rom[0xa37] = 0x00; rom[0xa38] = 0x00; + + m_use_dial = false; } -GAME( 1984, cyclemb, 0, cyclemb, cyclemb, cyclemb_state, init_cyclemb, ROT0, "Taito Corporation", "Cycle Maabou (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, skydest, 0, skydest, skydest, cyclemb_state, init_skydest, ROT0, "Taito Corporation", "Sky Destroyer (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) + +// year name parent machine input class init rot company fullname flags +GAME( 1984, cyclemb, 0, cyclemb, cyclemb, cyclemb_state, init_cyclemb, ROT0, "Taito Corporation", "Cycle Maabou (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, skydest, 0, skydest, skydest, cyclemb_state, init_skydest, ROT0, "Taito Corporation", "Sky Destroyer (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -- cgit v1.2.3