diff options
author | 2022-06-14 16:33:21 +1000 | |
---|---|---|
committer | 2022-06-14 16:33:21 +1000 | |
commit | 1f26ec6836364ef523aa4e375c63186bd8fe323f (patch) | |
tree | 883f691395a7fbe71865a624844942d28124d7a8 /src | |
parent | 4a4b718bc9d32b4cd55a90762c960165be2f6043 (diff) | |
parent | 6741eca4d61627072710dc86f458f34a3acf7c5c (diff) |
Merge remote-tracking branch 'upstream/master'
# Conflicts:
# scripts/build/verinfo.py
# scripts/resources/windows/mame/mame.rc
# scripts/src/main.lua
# src/mame/drivers/8080bw.cpp
Diffstat (limited to 'src')
58 files changed, 4359 insertions, 2970 deletions
diff --git a/src/devices/bus/ti99/peb/myarcfdc.cpp b/src/devices/bus/ti99/peb/myarcfdc.cpp index b4e535038df..7df7cf0d261 100644 --- a/src/devices/bus/ti99/peb/myarcfdc.cpp +++ b/src/devices/bus/ti99/peb/myarcfdc.cpp @@ -95,19 +95,23 @@ offs_t myarc_fdc_device::get_address() void myarc_fdc_device::debug_read(offs_t offset, uint8_t* value) { offs_t addrcopy = m_address; - m_address = offset; - if (m_pal->ramsel()) - { - *value = m_buffer_ram->pointer()[m_address & 0x07ff]; - } - if (m_pal->romen()) + if (!m_dec_high || amabc_is_set(offset)) { - // EPROM selected - offs_t base = m_banksel? 0x1000 : 0; - *value = m_dsrrom[base | (m_address & 0x0fff)]; + m_address = offset; + if (m_pal->ramsel()) + { + *value = m_buffer_ram->pointer()[m_address & 0x07ff]; + } + + if (m_pal->romen()) + { + // EPROM selected + offs_t base = m_banksel? 0x1000 : 0; + *value = m_dsrrom[base | (m_address & 0x0fff)]; + } + m_address = addrcopy; } - m_address = addrcopy; } /* @@ -116,12 +120,16 @@ void myarc_fdc_device::debug_read(offs_t offset, uint8_t* value) void myarc_fdc_device::debug_write(offs_t offset, uint8_t data) { offs_t addrcopy = m_address; - m_address = offset; - if (m_pal->ramsel()) + + if (!m_dec_high || amabc_is_set(offset)) { - m_buffer_ram->pointer()[m_address & 0x07ff] = data; + m_address = offset; + if (m_pal->ramsel()) + { + m_buffer_ram->pointer()[m_address & 0x07ff] = data; + } + m_address = addrcopy; } - m_address = addrcopy; } /* @@ -135,6 +143,9 @@ void myarc_fdc_device::readz(offs_t offset, uint8_t *value) return; } + // If we have an AMA/B/C decoder and it delivers false, exit here + if (m_dec_high && !amabc_is_set(offset)) return; + if (m_pal->ramsel()) { // SRAM selected @@ -175,6 +186,9 @@ void myarc_fdc_device::write(offs_t offset, uint8_t data) return; } + // If we have an AMA/B/C decoder and it delivers false, exit here + if (m_dec_high && !amabc_is_set(offset)) return; + if (m_pal->ramsel()) { // SRAM selected @@ -346,6 +360,8 @@ void myarc_fdc_device::device_reset() m_wdc = m_wd1770; else m_wdc = m_wd1772; + + m_dec_high = (ioport("AMADECODE")->read()!=0); } void myarc_fdc_device::device_config_complete() @@ -366,7 +382,7 @@ void myarc_fdc_device::floppy_formats(format_registration &fr) fr.add(FLOPPY_TI99_TDF_FORMAT); } -static void ccfdc_floppies(device_slot_interface &device) +static void myarc_ddcc_floppies(device_slot_interface &device) { device.option_add("525dd", FLOPPY_525_DD); // 40 tracks device.option_add("525qd", FLOPPY_525_QD); // 80 tracks @@ -397,6 +413,11 @@ INPUT_PORTS_START(myarc_ddcc ) PORT_DIPNAME( 0x08, 0x00, "DSK4 head step time" ) PORT_DIPSETTING( 0x00, "6ms") PORT_DIPSETTING( 0x08, "20ms/2ms") + + PORT_START( "AMADECODE" ) + PORT_CONFNAME( 0x01, 0x01, "Decode AMA/AMB/AMC lines" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off )) + PORT_CONFSETTING( 0x01, DEF_STR( On )) INPUT_PORTS_END @@ -438,10 +459,10 @@ void myarc_fdc_device::device_add_mconfig(machine_config& config) DDCC1_PAL(config, PAL_TAG, 0); // Floppy drives - FLOPPY_CONNECTOR(config, "0", ccfdc_floppies, "525dd", myarc_fdc_device::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "1", ccfdc_floppies, "525dd", myarc_fdc_device::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "2", ccfdc_floppies, nullptr, myarc_fdc_device::floppy_formats).enable_sound(true); - FLOPPY_CONNECTOR(config, "3", ccfdc_floppies, nullptr, myarc_fdc_device::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, "0", myarc_ddcc_floppies, "525dd", myarc_fdc_device::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, "1", myarc_ddcc_floppies, "525dd", myarc_fdc_device::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, "2", myarc_ddcc_floppies, nullptr, myarc_fdc_device::floppy_formats).enable_sound(true); + FLOPPY_CONNECTOR(config, "3", myarc_ddcc_floppies, nullptr, myarc_fdc_device::floppy_formats).enable_sound(true); } ioport_constructor myarc_fdc_device::device_input_ports() const diff --git a/src/devices/bus/ti99/peb/myarcfdc.h b/src/devices/bus/ti99/peb/myarcfdc.h index 7eacdd79f26..89106b73e5a 100644 --- a/src/devices/bus/ti99/peb/myarcfdc.h +++ b/src/devices/bus/ti99/peb/myarcfdc.h @@ -103,6 +103,9 @@ private: // Recent address int m_address; + + // AMA/B/C decoding active + bool m_dec_high; }; // =========== Decoder PAL circuit ================ diff --git a/src/devices/bus/ti99/peb/peribox.cpp b/src/devices/bus/ti99/peb/peribox.cpp index 152ede1b310..cc8b07500f0 100644 --- a/src/devices/bus/ti99/peb/peribox.cpp +++ b/src/devices/bus/ti99/peb/peribox.cpp @@ -796,18 +796,18 @@ void device_ti99_peribox_card_interface::interface_config_complete() bool device_ti99_peribox_card_interface::in_dsr_space(offs_t offset, bool amadec) { - if (amadec) - return (offset & 0x7e000)==0x74000; - else - return (offset & 0x0e000)==0x04000; + if (amadec && !amabc_is_set(offset)) return false; + return (offset & 0x0e000)==0x04000; } -bool device_ti99_peribox_card_interface::in_cart_space(offs_t offset, bool amadec) +/* + Some cards do not decode the additional address lines AMA, AMB, AMC. + This leads to errors when using the card with Genmod. The typical procedure + to decode the lines is the same for each card. +*/ +bool device_ti99_peribox_card_interface::amabc_is_set(offs_t offset) { - if (amadec) - return (offset & 0x7e000)==0x76000; - else - return (offset & 0x0e000)==0x06000; + return (((offset >> 16)&0x07)==0x07); } } // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/peribox.h b/src/devices/bus/ti99/peb/peribox.h index 157c2099106..b54467f1055 100644 --- a/src/devices/bus/ti99/peb/peribox.h +++ b/src/devices/bus/ti99/peb/peribox.h @@ -202,9 +202,9 @@ protected: int m_cru_base; // Methods to decide whether we are acccessing the 4000-5fff region (DSR) - // or the cartridge region - static bool in_dsr_space(offs_t offset, bool amadec); - static bool in_cart_space(offs_t offset, bool amadec); + bool in_dsr_space(offs_t offset, bool amadec); + + bool amabc_is_set(offs_t offset); }; /***************************************************************************** diff --git a/src/devices/cpu/mips/r4000.cpp b/src/devices/cpu/mips/r4000.cpp index 1cf885379cc..15f161b32c3 100644 --- a/src/devices/cpu/mips/r4000.cpp +++ b/src/devices/cpu/mips/r4000.cpp @@ -55,6 +55,8 @@ // experimental primary instruction cache #define ICACHE 0 +#define SCACHE !(m_cp0[CP0_Config] & CONFIG_SC) + #include "logmacro.h" #define USE_ABI_REG_NAMES 1 @@ -197,6 +199,9 @@ void r4000_base_device::device_start() m_icache_data = std::make_unique<u32 []>((0x1000U << config_ic) >> 2); R4000_ENDIAN_LE_BE(accessors(m_le), accessors(m_be)); + + if (SCACHE) + save_pointer(NAME(m_scache_tag), m_scache_tag_size); } void r4000_base_device::device_reset() @@ -945,75 +950,7 @@ void r4000_base_device::cpu_execute(u32 const op) cpu_swr(op); break; case 0x2f: // CACHE - if ((SR & SR_KSU) && !(SR & SR_CU0) && !(SR & (SR_EXL | SR_ERL))) - { - cpu_exception(EXCEPTION_CP0); - break; - } - - switch ((op >> 16) & 0x1f) - { - case 0x00: // index invalidate (I) - if (ICACHE) - { - m_icache_tag[(ADDR(m_r[RSREG], s16(op)) & m_icache_mask_hi) >> m_icache_shift] &= ~ICACHE_V; - break; - } - [[fallthrough]]; - case 0x04: // index load tag (I) - if (ICACHE) - { - u32 const tag = m_icache_tag[(ADDR(m_r[RSREG], s16(op)) & m_icache_mask_hi) >> m_icache_shift]; - - m_cp0[CP0_TagLo] = ((tag & ICACHE_PTAG) << 8) | ((tag & ICACHE_V) >> 18) | ((tag & ICACHE_P) >> 25); - m_cp0[CP0_ECC] = 0; // data ecc or parity - - break; - } - [[fallthrough]]; - case 0x08: // index store tag (I) - if (ICACHE) - { - // FIXME: compute parity - m_icache_tag[(ADDR(m_r[RSREG], s16(op)) & m_icache_mask_hi) >> m_icache_shift] = - (m_cp0[CP0_TagLo] & TAGLO_PTAGLO) >> 8 | (m_cp0[CP0_TagLo] & TAGLO_PSTATE) << 18; - - break; - } - [[fallthrough]]; - case 0x01: // index writeback invalidate (D) - case 0x02: // index invalidate (SI) - case 0x03: // index writeback invalidate (SD) - - case 0x05: // index load tag (D) - case 0x06: // index load tag (SI) - case 0x07: // index load tag (SI) - - case 0x09: // index store tag (D) - case 0x0a: // index store tag (SI) - case 0x0b: // index store tag (SD) - - case 0x0d: // create dirty exclusive (D) - case 0x0f: // create dirty exclusive (SD) - - case 0x10: // hit invalidate (I) - case 0x11: // hit invalidate (D) - case 0x12: // hit invalidate (SI) - case 0x13: // hit invalidate (SD) - - case 0x14: // fill (I) - case 0x15: // hit writeback invalidate (D) - case 0x17: // hit writeback invalidate (SD) - - case 0x18: // hit writeback (I) - case 0x19: // hit writeback (D) - case 0x1b: // hit writeback (SD) - - case 0x1e: // hit set virtual (SI) - case 0x1f: // hit set virtual (SD) - //LOGMASKED(LOG_CACHE, "cache 0x%08x unimplemented (%s)\n", op, machine().describe_context()); - break; - } + cp0_cache(op); break; case 0x30: // LL load_linked<u32>(ADDR(m_r[RSREG], s16(op)), @@ -1263,6 +1200,128 @@ void r4000_base_device::cpu_sdr(u32 const op) store<u64, false>(offset, m_r[RTREG] << shift, ~u64(0) << shift); } +void r4000_base_device::cp0_cache(u32 const op) +{ + if ((SR & SR_KSU) && !(SR & SR_CU0) && !(SR & (SR_EXL | SR_ERL))) + { + cpu_exception(EXCEPTION_CP0); + return; + } + + switch ((op >> 16) & 0x1f) + { + case 0x00: // index invalidate (I) + if (ICACHE) + { + m_icache_tag[(ADDR(m_r[RSREG], s16(op)) & m_icache_mask_hi) >> m_icache_shift] &= ~ICACHE_V; + break; + } + [[fallthrough]]; + case 0x04: // index load tag (I) + if (ICACHE) + { + u32 const tag = m_icache_tag[(ADDR(m_r[RSREG], s16(op)) & m_icache_mask_hi) >> m_icache_shift]; + + m_cp0[CP0_TagLo] = ((tag & ICACHE_PTAG) << 8) | ((tag & ICACHE_V) >> 18) | ((tag & ICACHE_P) >> 25); + m_cp0[CP0_ECC] = 0; // data ecc or parity + + break; + } + [[fallthrough]]; + case 0x08: // index store tag (I) + if (ICACHE) + { + // FIXME: compute parity + m_icache_tag[(ADDR(m_r[RSREG], s16(op)) & m_icache_mask_hi) >> m_icache_shift] = + (m_cp0[CP0_TagLo] & TAGLO_PTAGLO) >> 8 | (m_cp0[CP0_TagLo] & TAGLO_PSTATE) << 18; + break; + } + [[fallthrough]]; + case 0x01: // index writeback invalidate (D) + case 0x02: // index invalidate (SI) + case 0x03: // index writeback invalidate (SD) + case 0x05: // index load tag (D) + //LOGMASKED(LOG_CACHE, "cache 0x%08x unimplemented (%s)\n", op, machine().describe_context()); + break; + case 0x06: // index load tag (SI) + case 0x07: // index load tag (SD) + if (SCACHE) + { + // TODO: translation type for CACHE instruction? Read seems reasonable since only the tag is changing here + u64 physical_address = ADDR(m_r[RSREG], s16(op)); + translate_result const t = translate(TRANSLATE_READ, physical_address); + if (t == ERROR || t == MISS) + return; + + u32 const index = (physical_address & m_scache_tag_mask) >> m_scache_line_index; + if (index < m_scache_tag_size) + { + // TODO: Load the ECC register here + u32 const tag = m_scache_tag[index]; + u32 const cs = (tag & SCACHE_CS) >> 22; + u32 const stag = tag & SCACHE_STAG; + u32 const pidx = (tag & SCACHE_PIDX) >> 19; + m_cp0[CP0_TagLo] = (stag << 13) | (cs << 10) | (pidx << 7); + } + else + fatalerror("r4000 scache load tag index out of range!"); + } + else + LOGMASKED(LOG_CACHE, "cache 0x%08x called without scache enabled (%s)\n", op, machine().describe_context()); + break; + case 0x09: // index store tag (D) + //LOGMASKED(LOG_CACHE, "cache 0x%08x unimplemented (%s)\n", op, machine().describe_context()); + break; + case 0x0a: // index store tag (SI) + case 0x0b: // index store tag (SD) + if (SCACHE) + { + // TODO: translation type for CACHE instruction? Read seems reasonable since only the tag is changing here + u64 const virtual_address = ADDR(m_r[RSREG], s16(op)); + u64 physical_address = virtual_address; + translate_result const t = translate(TRANSLATE_READ, physical_address); + if (t == ERROR || t == MISS) + return; + + u64 const index = (physical_address & m_scache_tag_mask) >> m_scache_line_index; + if (index < m_scache_tag_size) + { + // TODO: Calculate ECC bits here + u64 const tag_lo = m_cp0[CP0_TagLo]; + u32 const cs = (tag_lo & TAGLO_CS) >> 10; + u32 const stag = (tag_lo & TAGLO_STAG) >> 13; + u32 const pidx = (virtual_address & 0x7000) >> 12; + m_scache_tag[index] = cs << 22 | pidx << 19 | stag; + } + else + fatalerror("r4000 scache store tag index out of range!"); + } + else + LOGMASKED(LOG_CACHE, "cache 0x%08x called without scache enabled (%s)\n", op, machine().describe_context()); + break; + case 0x0d: // create dirty exclusive (D) + case 0x0f: // create dirty exclusive (SD) + + case 0x10: // hit invalidate (I) + case 0x11: // hit invalidate (D) + case 0x12: // hit invalidate (SI) + case 0x13: // hit invalidate (SD) + + case 0x14: // fill (I) + case 0x15: // hit writeback invalidate (D) + case 0x17: // hit writeback invalidate (SD) + + case 0x18: // hit writeback (I) + case 0x19: // hit writeback (D) + case 0x1b: // hit writeback (SD) + + case 0x1e: // hit set virtual (SI) + case 0x1f: // hit set virtual (SD) + //LOGMASKED(LOG_CACHE, "cache 0x%08x unimplemented (%s)\n", op, machine().describe_context()); + break; + } +} + void r4000_base_device::cp0_execute(u32 const op) { if ((SR & SR_KSU) && !(SR & SR_CU0) && !(SR & (SR_EXL | SR_ERL))) @@ -4021,3 +4080,46 @@ std::string r4000_base_device::debug_unicode_string(u64 unicode_string_pointer) return utf8_from_wstring(result); } + +void r4000_base_device::configure_scache() +{ + if (m_scache_size > 0) + { + /* + * Secondary cache tag size depends on the cache line size + * (how many bytes are transferred with one cache operation) and the + * size of the cache itself. + * For example, the Sony NEWS NWS-5000X has a 1MB secondary cache + * and a cache line size of 16 words. So, the slice of the physical + * address used to index into the cache is bits 19:6. + * See chapter 11 of the R4000 user manual for more details. + */ + if (m_scache_line_size == 0) + fatalerror("SCACHE size set but line size was not set!"); + + if (m_scache_line_size <= 0x10) + m_scache_line_index = 4; + else if (m_scache_line_size <= 0x20) + { + m_scache_line_index = 5; + m_cp0[CP0_Config] |= 1 << 22; + } + else if (m_scache_line_size <= 0x40) + { + m_scache_line_index = 6; + m_cp0[CP0_Config] |= 2 << 22; + } + else + { + m_scache_line_index = 7; + m_cp0[CP0_Config] |= 3 << 22; + } + + m_scache_tag_size = m_scache_size >> m_scache_line_index; + m_scache_tag_mask = m_scache_size - 1; + + m_scache_tag = std::make_unique<u32[]>(m_scache_tag_size); + } + else + m_cp0[CP0_Config] |= CONFIG_SC; +} diff --git a/src/devices/cpu/mips/r4000.h b/src/devices/cpu/mips/r4000.h index f4a015e9c77..adc9ccd1f3d 100644 --- a/src/devices/cpu/mips/r4000.h +++ b/src/devices/cpu/mips/r4000.h @@ -291,6 +291,8 @@ protected: TAGLO_PTAGLO = 0xffffff00, // physical adddress bits 35:12 TAGLO_PSTATE = 0x000000c0, // primary cache state TAGLO_P = 0x00000001, // primary tag even parity + TAGLO_CS = 0x00001c00, // scache status + TAGLO_STAG = 0xffffe000, // scache tag }; enum icache_mask : u32 { @@ -306,6 +308,12 @@ protected: DCACHE_W = 0x02000000, // write-back DCACHE_WP = 0x02000000, // even parity for write-back }; + enum scache_mask : u32 + { + SCACHE_CS = 0x01c00000, // cache state + SCACHE_STAG = 0x0007ffff, // physical tag + SCACHE_PIDX = 0x00380000, // primary cache index + }; // device_t overrides virtual void device_start() override; @@ -342,6 +350,7 @@ protected: void cpu_sdr(u32 const op); // cp0 implementation + void cp0_cache(u32 const op); void cp0_execute(u32 const op); u64 cp0_get(unsigned const reg); void cp0_set(unsigned const reg, u64 const data); @@ -383,6 +392,9 @@ protected: std::string debug_string_array(u64 array_pointer); std::string debug_unicode_string(u64 unicode_string_pointer); + // configuration helpers + void configure_scache(); + // device configuration state address_space_config m_program_config_le; address_space_config m_program_config_be; @@ -458,6 +470,14 @@ protected: std::unique_ptr<u32[]> m_icache_tag; std::unique_ptr<u32[]> m_icache_data; + // experimental scache state + u32 m_scache_size; // Size in bytes + u8 m_scache_line_size; + u32 m_scache_line_index; // Secondary cache line shift + u32 m_scache_tag_mask; // Mask for extracting the tag from a physical address + u32 m_scache_tag_size; + std::unique_ptr<u32[]> m_scache_tag; + // statistics u64 m_tlb_scans; u64 m_tlb_loops; @@ -485,15 +505,16 @@ public: class r4400_device : public r4000_base_device { public: - r4400_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, bool timer_interrupt_disabled) + r4400_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, bool timer_interrupt_disabled, u32 scache_size, u8 scache_line_size) : r4000_base_device(mconfig, R4400, tag, owner, clock, 0x0440, 0x0500, CACHE_16K, CACHE_16K, 10, 20, 69, 133, timer_interrupt_disabled) { - // no secondary cache - m_cp0[CP0_Config] |= CONFIG_SC; + m_scache_size = scache_size; + m_scache_line_size = scache_line_size; + configure_scache(); } r4400_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : r4400_device(mconfig, tag, owner, clock, false) + : r4400_device(mconfig, tag, owner, clock, false, 0, 0) { } }; diff --git a/src/devices/cpu/patinhofeio/patinho_feio.cpp b/src/devices/cpu/patinhofeio/patinho_feio.cpp index 1e2b9f966fd..d017ff8a318 100644 --- a/src/devices/cpu/patinhofeio/patinho_feio.cpp +++ b/src/devices/cpu/patinhofeio/patinho_feio.cpp @@ -7,7 +7,6 @@ #include "emu.h" #include "patinhofeio_cpu.h" #include "patinho_feio_dasm.h" -#include "includes/patinhofeio.h" // FIXME: this is a dependency from devices on MAME #define PC m_pc //The program counter is called "contador de instrucoes" (IC) in portuguese #define ACC m_acc @@ -60,6 +59,7 @@ void patinho_feio_cpu_device::prog_8bit(address_map &map) patinho_feio_cpu_device::patinho_feio_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, PATO_FEIO_CPU, tag, owner, clock) , m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, address_map_constructor(FUNC(patinho_feio_cpu_device::prog_8bit), this)) + , m_update_panel_cb(*this) , m_icount(0) , m_rc_read_cb(*this) , m_buttons_read_cb(*this) @@ -94,6 +94,7 @@ void patinho_feio_cpu_device::transfer_byte_from_external_device(uint8_t channel void patinho_feio_cpu_device::device_start() { m_program = &space(AS_PROGRAM); + m_update_panel_cb.resolve(); //TODO: implement handling of these special purpose registers // which are also mapped to the first few main memory positions: @@ -158,7 +159,8 @@ void patinho_feio_cpu_device::device_reset() m_addr = 0; m_opcode = 0; m_mode = ADDRESSING_MODE; - ((patinho_feio_state*) owner())->update_panel(ACC, m_opcode, READ_BYTE_PATINHO(m_addr), m_addr, PC, FLAGS, RC, m_mode); + if (!m_update_panel_cb.isnull()) + m_update_panel_cb(ACC, m_opcode, READ_BYTE_PATINHO(m_addr), m_addr, PC, FLAGS, RC, m_mode); } /* execute instructions on this CPU until icount expires */ @@ -167,7 +169,8 @@ void patinho_feio_cpu_device::execute_run() { read_panel_keys_register(); m_ext = READ_ACC_EXTENSION_REG(); m_idx = READ_INDEX_REG(); - ((patinho_feio_state*) owner())->update_panel(ACC, READ_BYTE_PATINHO(PC), READ_BYTE_PATINHO(m_addr), m_addr, PC, FLAGS, RC, m_mode); + if (!m_update_panel_cb.isnull()) + m_update_panel_cb(ACC, READ_BYTE_PATINHO(PC), READ_BYTE_PATINHO(m_addr), m_addr, PC, FLAGS, RC, m_mode); debugger_instruction_hook(PC); if (!m_run){ diff --git a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h index 3799465af92..1ba4a39fdb6 100644 --- a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h +++ b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h @@ -41,6 +41,8 @@ enum class patinho_feio_cpu_device : public cpu_device { public: + using update_panel_cb = device_delegate<void (uint8_t ACC, uint8_t opcode, uint8_t mem_data, uint16_t mem_addr, uint16_t PC, uint8_t FLAGS, uint16_t RC, uint8_t mode)>; + // construction/destruction patinho_feio_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); @@ -49,6 +51,7 @@ public: template <std::size_t DevNumber> auto iodev_read() { return m_iodev_read_cb[DevNumber].bind(); } template <std::size_t DevNumber> auto iodev_write() { return m_iodev_write_cb[DevNumber].bind(); } template <std::size_t DevNumber> auto iodev_status() { return m_iodev_status_cb[DevNumber].bind(); } + template <typename... T> void set_update_panel_cb(T &&... args) { m_update_panel_cb.set(std::forward<T>(args)...); } void transfer_byte_from_external_device(uint8_t channel, uint8_t data); void set_iodev_status(uint8_t channel, bool status) { m_iodev_status[channel] = status; } @@ -60,6 +63,7 @@ protected: virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; address_space_config m_program_config; + update_panel_cb m_update_panel_cb; offs_t m_addr; unsigned char m_opcode; diff --git a/src/devices/cpu/rw5000/b5000.cpp b/src/devices/cpu/rw5000/b5000.cpp index 41e636780a3..685fb1b5190 100644 --- a/src/devices/cpu/rw5000/b5000.cpp +++ b/src/devices/cpu/rw5000/b5000.cpp @@ -58,7 +58,7 @@ std::unique_ptr<util::disasm_interface> b5000_cpu_device::create_disassembler() // digit segment decoder u16 b5000_cpu_device::decode_digit(u8 data) { - static u8 lut_segs[0x10] = + static const u8 lut_segs[0x10] = { // 0-9 ok (6 and 9 have tails) 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, diff --git a/src/devices/cpu/rw5000/b6000.cpp b/src/devices/cpu/rw5000/b6000.cpp index f41ebfbbf48..3b18d4793b0 100644 --- a/src/devices/cpu/rw5000/b6000.cpp +++ b/src/devices/cpu/rw5000/b6000.cpp @@ -68,7 +68,7 @@ void b6000_cpu_device::device_reset() // digit segment decoder u16 b6000_cpu_device::decode_digit(u8 data) { - static u8 lut_segs[0x10] = + static const u8 lut_segs[0x10] = { // 0-9 same as B5000 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, diff --git a/src/devices/cpu/rw5000/b6100.cpp b/src/devices/cpu/rw5000/b6100.cpp index 17bc17b9f25..67723657ab1 100644 --- a/src/devices/cpu/rw5000/b6100.cpp +++ b/src/devices/cpu/rw5000/b6100.cpp @@ -47,7 +47,7 @@ std::unique_ptr<util::disasm_interface> b6100_cpu_device::create_disassembler() // digit segment decoder u16 b6100_cpu_device::decode_digit(u8 data) { - static u16 lut_segs[0x10] = + static const u16 lut_segs[0x10] = { // 0-9 same as B6000 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, diff --git a/src/mame/machine/archimedes_keyb.cpp b/src/devices/machine/archimedes_keyb.cpp index a6aa8278969..a6aa8278969 100644 --- a/src/mame/machine/archimedes_keyb.cpp +++ b/src/devices/machine/archimedes_keyb.cpp diff --git a/src/mame/machine/archimedes_keyb.h b/src/devices/machine/archimedes_keyb.h index 7acf6ae8d59..7acf6ae8d59 100644 --- a/src/mame/machine/archimedes_keyb.h +++ b/src/devices/machine/archimedes_keyb.h diff --git a/src/devices/machine/dp83932c.cpp b/src/devices/machine/dp83932c.cpp index efe877ca4d2..e6ddf1c11c3 100644 --- a/src/devices/machine/dp83932c.cpp +++ b/src/devices/machine/dp83932c.cpp @@ -149,7 +149,7 @@ int dp83932c_device::recv_start_cb(u8 *buf, int length) if (m_reg[CRDA] & 1) { // re-read the previous descriptor link field - m_reg[CRDA] = m_bus->read_word(EA(m_reg[URDA], m_reg[LLFA])); + m_reg[CRDA] = read_bus_word(EA(m_reg[URDA], m_reg[LLFA])); if (m_reg[CRDA] & 1) { logerror("no receive descriptor available\n"); @@ -182,19 +182,19 @@ int dp83932c_device::recv_start_cb(u8 *buf, int length) // write status to rda // TODO: don't write the rda if rba limit exceeded (buffer overflow) offs_t const rda = EA(m_reg[URDA], m_reg[CRDA]); - m_bus->write_word(rda + 0 * width, m_reg[RCR]); - m_bus->write_word(rda + 1 * width, length); - m_bus->write_word(rda + 2 * width, m_reg[CRBA0]); - m_bus->write_word(rda + 3 * width, m_reg[CRBA1]); - m_bus->write_word(rda + 4 * width, m_reg[RSC]); + write_bus_word(rda + 0 * width, m_reg[RCR]); + write_bus_word(rda + 1 * width, length); + write_bus_word(rda + 2 * width, m_reg[CRBA0]); + write_bus_word(rda + 3 * width, m_reg[CRBA1]); + write_bus_word(rda + 4 * width, m_reg[RSC]); m_reg[LLFA] = m_reg[CRDA] + 5 * width; - m_reg[CRDA] = m_bus->read_word(rda + 5 * width); + m_reg[CRDA] = read_bus_word(rda + 5 * width); // check for end of list if (m_reg[CRDA] & 1) m_reg[ISR] |= ISR_RDE; else - m_bus->write_word(rda + 6 * width, 0); + write_bus_word(rda + 6 * width, 0); // handle buffer exhaustion if (rbwc < m_reg[EOBC]) @@ -231,11 +231,8 @@ void dp83932c_device::reg_w(offs_t offset, u16 data) m_reg[CR] &= ~CR_RST; } - - return; } - - if (data & CR_RST) + else if (data & CR_RST) { LOGMASKED(LOG_COMMAND, "enter software reset\n"); @@ -243,12 +240,22 @@ void dp83932c_device::reg_w(offs_t offset, u16 data) m_reg[CR] &= ~(CR_LCAM | CR_RRRA | CR_TXP | CR_HTX); m_reg[CR] |= (CR_RST | CR_RXDIS); - - return; } - - m_reg[offset] |= data & regmask[offset]; - m_command->adjust(attotime::zero, data & regmask[offset]); + else + { + u16 cmd_to_run = data & regmask[offset]; + if (m_reg[CR] & CR_TXP) + { + // Per section 3.5.4 in the datasheet, TDAs can be dynamically added. + // The TXP command will be re-sent by the host, but doesn't do anything + // unless the SONIC finished the last commmand right before the TDA was + // appended to the list. So, null the CR_TXP bit if it was already set + // so we don't smash the currently running transmission. + cmd_to_run &= ~CR_TXP; + } + m_reg[offset] |= data & regmask[offset]; + m_command->adjust(attotime::zero, cmd_to_run); + } break; case RCR: @@ -349,9 +356,9 @@ void dp83932c_device::transmit() // read control information from tda and load registers u16 const tcr = m_reg[TCR]; - m_reg[TCR] = m_bus->read_word(tda + word++ * width) & TCR_TPC; - m_reg[TPS] = m_bus->read_word(tda + word++ * width); - m_reg[TFC] = m_bus->read_word(tda + word++ * width); + m_reg[TCR] = read_bus_word(tda + word++ * width) & TCR_TPC; + m_reg[TPS] = read_bus_word(tda + word++ * width); + m_reg[TFC] = read_bus_word(tda + word++ * width); // check for programmable interrupt if ((m_reg[TCR] & TCR_PINT) && !(tcr & TCR_PINT)) @@ -365,9 +372,9 @@ void dp83932c_device::transmit() for (unsigned fragment = 0; fragment < m_reg[TFC]; fragment++) { // read fragment address and size - m_reg[TSA0] = m_bus->read_word(tda + word++ * width); - m_reg[TSA1] = m_bus->read_word(tda + word++ * width); - m_reg[TFS] = m_bus->read_word(tda + word++ * width); + m_reg[TSA0] = read_bus_word(tda + word++ * width); + m_reg[TSA1] = read_bus_word(tda + word++ * width); + m_reg[TFS] = read_bus_word(tda + word++ * width); offs_t const tsa = EA(m_reg[TSA1], m_reg[TSA0]); @@ -407,13 +414,13 @@ void dp83932c_device::send_complete_cb(int result) } // write descriptor status - m_bus->write_word(EA(m_reg[UTDA], m_reg[TTDA]), m_reg[TCR] & TCR_TPS); + write_bus_word(EA(m_reg[UTDA], m_reg[TTDA]), m_reg[TCR] & TCR_TPS); // check for halt if (!(m_reg[CR] & CR_HTX)) { // load next descriptor address - m_reg[CTDA] = m_bus->read_word(EA(m_reg[UTDA], m_reg[CTDA])); + m_reg[CTDA] = read_bus_word(EA(m_reg[UTDA], m_reg[CTDA])); // check for end of list if (m_reg[CTDA] & 1) @@ -440,10 +447,10 @@ void dp83932c_device::read_rra(bool command) offs_t const rrp = EA(m_reg[URRA], m_reg[RRP]); - m_reg[CRBA0] = m_bus->read_word(rrp + 0 * width); - m_reg[CRBA1] = m_bus->read_word(rrp + 1 * width); - m_reg[RBWC0] = m_bus->read_word(rrp + 2 * width); - m_reg[RBWC1] = m_bus->read_word(rrp + 3 * width); + m_reg[CRBA0] = read_bus_word(rrp + 0 * width); + m_reg[CRBA1] = read_bus_word(rrp + 1 * width); + m_reg[RBWC0] = read_bus_word(rrp + 2 * width); + m_reg[RBWC1] = read_bus_word(rrp + 3 * width); LOG("read_rra crba 0x%08x rbwc 0x%08x\n", EA(m_reg[CRBA1], m_reg[CRBA0]), EA(m_reg[RBWC1], m_reg[RBWC0])); @@ -472,10 +479,10 @@ void dp83932c_device::load_cam() { offs_t const cdp = EA(m_reg[URRA], m_reg[CDP]); - u16 const cep = m_bus->read_word(cdp + 0 * width) & 0xf; - u16 const cap0 = m_bus->read_word(cdp + 1 * width); - u16 const cap1 = m_bus->read_word(cdp + 2 * width); - u16 const cap2 = m_bus->read_word(cdp + 3 * width); + u16 const cep = read_bus_word(cdp + 0 * width) & 0xf; + u16 const cap0 = read_bus_word(cdp + 1 * width); + u16 const cap1 = read_bus_word(cdp + 2 * width); + u16 const cap2 = read_bus_word(cdp + 3 * width); // FIXME: documented byte/word order doesn't match emulation @@ -491,7 +498,7 @@ void dp83932c_device::load_cam() } // read cam enable - m_reg[CE] = m_bus->read_word(EA(m_reg[URRA], m_reg[CDP])); + m_reg[CE] = read_bus_word(EA(m_reg[URRA], m_reg[CDP])); LOG("load_cam enable 0x%04x\n", m_reg[CE]); m_reg[CR] &= ~CR_LCAM; @@ -572,3 +579,16 @@ void dp83932c_device::dump_bytes(u8 *buf, int length) buf[i * 8 + 4], buf[i * 8 + 5], buf[i * 8 + 6], buf[i * 8 + 7]); } } + +u16 dp83932c_device::read_bus_word(offs_t address) +{ + return (m_reg[DCR] & DCR_DW) ? m_bus->read_dword(address) : m_bus->read_word(address); +} + +void dp83932c_device::write_bus_word(offs_t address, u16 data) +{ + if (m_reg[DCR] & DCR_DW) + m_bus->write_dword(address, data); + else + m_bus->write_word(address, data); +} diff --git a/src/devices/machine/dp83932c.h b/src/devices/machine/dp83932c.h index 1b379bcceeb..ef91d08313d 100644 --- a/src/devices/machine/dp83932c.h +++ b/src/devices/machine/dp83932c.h @@ -207,6 +207,10 @@ private: bool m_int_state; u16 m_reg[64]; u64 m_cam[16]; + + // These wrappers handle 16-bit data stored on 32-bit word boundaries when in 32-bit mode + u16 read_bus_word(offs_t address); + void write_bus_word(offs_t address, u16 data); }; DECLARE_DEVICE_TYPE(DP83932C, dp83932c_device) diff --git a/src/mame/machine/fm_scsi.cpp b/src/devices/machine/fm_scsi.cpp index d2b8fcd266f..d2b8fcd266f 100644 --- a/src/mame/machine/fm_scsi.cpp +++ b/src/devices/machine/fm_scsi.cpp diff --git a/src/mame/machine/fm_scsi.h b/src/devices/machine/fm_scsi.h index 9a3df8c0ba6..9a3df8c0ba6 100644 --- a/src/mame/machine/fm_scsi.h +++ b/src/devices/machine/fm_scsi.h diff --git a/src/devices/machine/genpc.h b/src/devices/machine/genpc.h index 8462f1fde88..8e836aae807 100644 --- a/src/devices/machine/genpc.h +++ b/src/devices/machine/genpc.h @@ -223,6 +223,8 @@ public: void map(address_map &map); + uint8_t pc_ppi_portb_r(); + protected: pc_noppi_mb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -231,7 +233,6 @@ protected: private: uint8_t pc_ppi_porta_r(); - uint8_t pc_ppi_portb_r(); }; DECLARE_DEVICE_TYPE(PCNOPPI_MOTHERBOARD, pc_noppi_mb_device) diff --git a/src/emu/debug/debugcon.cpp b/src/emu/debug/debugcon.cpp index 508c2377f54..92f62c9909b 100644 --- a/src/emu/debug/debugcon.cpp +++ b/src/emu/debug/debugcon.cpp @@ -388,7 +388,9 @@ CMDERR debugger_console::internal_parse_command(std::string_view command, bool e { try { - parsed_expression(visible_symtable(), command_or_expr).execute(); + parsed_expression expr(visible_symtable(), command_or_expr); + if (execute) + expr.execute(); } catch (expression_error &err) { diff --git a/src/frontend/mame/ui/inputopts.cpp b/src/frontend/mame/ui/inputopts.cpp index 6884574c6a5..ff433e72e7e 100644 --- a/src/frontend/mame/ui/inputopts.cpp +++ b/src/frontend/mame/ui/inputopts.cpp @@ -92,7 +92,7 @@ void menu_input_options::populate(float &customtop, float &custombottom) bool inputmap, analog, toggle; scan_inputs(machine(), inputmap, analog, toggle); - item_append(_("menu-inputopts", "Input Assignments (general)"), 0, (void *)INPUTMAP_GENERAL); + // system-specific stuff if (inputmap) item_append(_("menu-inputopts", "Input Assignments (this system)"), 0, (void *)INPUTMAP_MACHINE); if (analog) @@ -101,11 +101,12 @@ void menu_input_options::populate(float &customtop, float &custombottom) item_append(_("menu-inputopts", "Keyboard Selection"), 0, (void *)KEYBOARD); if (toggle) item_append(_("menu-inputopts", "Toggle Inputs"), 0, (void *)TOGGLES); + if (inputmap || analog || machine().natkeyboard().keyboard_count() || toggle) + item_append(menu_item_type::SEPARATOR); - item_append(menu_item_type::SEPARATOR); - + // general stuff + item_append(_("menu-inputopts", "Input Assignments (general)"), 0, (void *)INPUTMAP_GENERAL); item_append(_("menu-inputopts", "Input Devices"), 0, (void *)INPUTDEV); - item_append(menu_item_type::SEPARATOR); } diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp index 58792ef56c8..55a2aab986f 100644 --- a/src/frontend/mame/ui/miscmenu.cpp +++ b/src/frontend/mame/ui/miscmenu.cpp @@ -453,8 +453,8 @@ void menu_crosshair::populate(float &customtop, float &custombottom) // Make sure to keep these matched to the CROSSHAIR_VISIBILITY_xxx types static char const *const vis_text[] = { - N_p("menu-crosshair", "Always"), N_p("menu-crosshair", "Never"), + N_p("menu-crosshair", "Always"), N_p("menu-crosshair", "When moved") }; bool use_auto = false; diff --git a/src/lib/formats/fs_oric_jasmin.cpp b/src/lib/formats/fs_oric_jasmin.cpp index 28c13ab634f..361f40332ea 100644 --- a/src/lib/formats/fs_oric_jasmin.cpp +++ b/src/lib/formats/fs_oric_jasmin.cpp @@ -286,10 +286,10 @@ std::vector<dir_entry> impl::root_dir::contents() std::string fname = read_file_name(bdir.rodata()+off+3); bool system = ref == 0 && id == 0 && bdir.r32b(off+0xb) == 0x2e535953; if(system) - res.emplace_back(dir_entry(fname, dir_entry_type::system_file, 0)); + res.emplace_back(dir_entry(std::move(fname), dir_entry_type::system_file, 0)); else if(m_fs.ref_valid(ref)) - res.emplace_back(dir_entry(fname, dir_entry_type::file, id)); + res.emplace_back(dir_entry(std::move(fname), dir_entry_type::file, id)); id++; } diff --git a/src/lib/formats/fs_prodos.cpp b/src/lib/formats/fs_prodos.cpp index df13d0a4caa..2ce67301999 100644 --- a/src/lib/formats/fs_prodos.cpp +++ b/src/lib/formats/fs_prodos.cpp @@ -351,9 +351,9 @@ std::vector<dir_entry> impl::root_dir::contents() auto name = blk.rstr(off+1, type & 0xf); type >>= 4; if(type == 0xd) - res.emplace_back(dir_entry(name, dir_entry_type::dir, id)); + res.emplace_back(dir_entry(std::move(name), dir_entry_type::dir, id)); else if(type != 0) - res.emplace_back(dir_entry(name, dir_entry_type::file, id)); + res.emplace_back(dir_entry(std::move(name), dir_entry_type::file, id)); off += 39; id ++; } diff --git a/src/lib/formats/fs_vtech.cpp b/src/lib/formats/fs_vtech.cpp index e294e657801..7b8edf53f63 100644 --- a/src/lib/formats/fs_vtech.cpp +++ b/src/lib/formats/fs_vtech.cpp @@ -137,7 +137,7 @@ std::vector<dir_entry> vtech_image::impl::root_dir::contents() if(bdir.r8(off+1) != ':') continue; std::string fname = trim_end_spaces(bdir.rstr(off+2, 8)); - res.emplace_back(dir_entry(fname, dir_entry_type::file, id)); + res.emplace_back(dir_entry(std::move(fname), dir_entry_type::file, id)); id++; } } diff --git a/src/lib/formats/fsmgr.h b/src/lib/formats/fsmgr.h index 9859f929e9d..201dfe389bb 100644 --- a/src/lib/formats/fsmgr.h +++ b/src/lib/formats/fsmgr.h @@ -126,7 +126,7 @@ struct dir_entry { dir_entry_type m_type; u64 m_key; - dir_entry(const std::string &name, dir_entry_type type, u64 key) : m_name(name), m_type(type), m_key(key) {} + dir_entry(std::string &&name, dir_entry_type type, u64 key) : m_name(std::move(name)), m_type(type), m_key(key) {} }; class fsblk_t { diff --git a/src/mame/drivers/8080bw.cpp b/src/mame/drivers/8080bw.cpp index 48bf062c00b..1afa1d26777 100644 --- a/src/mame/drivers/8080bw.cpp +++ b/src/mame/drivers/8080bw.cpp @@ -313,7 +313,6 @@ static INPUT_PORTS_START( sicv ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END ->>>>>>> upstream/master /*******************************************************/ @@ -1379,32 +1378,104 @@ void _8080bw_state::cosmicmo(machine_config &config) /* */ /*******************************************************/ +void invasion_state::io_map(address_map &map) +{ + map.global_mask(0x7); + + map(0x00, 0x00).mirror(0x04).portr("IN0"); + map(0x01, 0x01).mirror(0x04).portr("IN1"); + map(0x02, 0x02).mirror(0x04).portr("IN2"); + map(0x03, 0x03).mirror(0x04).portr("IN3"); + + map(0x03, 0x03).w("soundboard", FUNC(invaders_audio_device::p1_w)); + map(0x05, 0x05).w("soundboard", FUNC(invaders_audio_device::p2_w)); + map(0x06, 0x06).w(m_watchdog, FUNC(watchdog_timer_device::reset_w)); +} + + static INPUT_PORTS_START( invasion ) - PORT_INCLUDE( sicv_base ) + // * DIP switch defaults confirmed from manual. + // * Tilt/slam switch causes a watchdog reset - it isn't handled in software. + // * Coin counter is driven by logic connected to the coin inputs, not software. + // * The code supports cocktail cabinets, but Sidam apparently made no boards with the necessary inputs/outputs. - PORT_MODIFY("IN1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_START("IN0") + PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW1:8" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW1:7" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x00, "SW1:6" ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) // floating + PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(invaders_state, invaders_in1_control_r) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW1:5" ) - PORT_MODIFY("IN2") - /* SW1:5-8 Unused according to manual. */ - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4,3") /* Default is OFF, OFF (6) */ + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // pulled high via a 1k resistor + PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(invaders_state, invaders_in1_control_r) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) + + PORT_START("IN2") + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4,3") PORT_DIPSETTING( 0x00, "3" ) PORT_DIPSETTING( 0x01, "4" ) PORT_DIPSETTING( 0x02, "5" ) PORT_DIPSETTING( 0x03, "6" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:8" ) /* Default OFF */ - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:2") /* Default is ON (2500) */ + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) // tied to ground + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x08, "1500" ) PORT_DIPSETTING( 0x00, "2500" ) - /* SW1:5,6,7 Default ON */ - PORT_DIPNAME( 0x80, 0x80, "Laser Bonus Info" ) PORT_DIPLOCATION("SW1:1") /* Default is OFF (Info on) */ - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(invaders_state, invaders_in1_control_r) + PORT_DIPNAME( 0x80, 0x80, "Laser Bonus Info" ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + /* + Bit 1 connected to pin 12B on edge connector, called "SPARE" in SIDAM user + manual. CPU halted on boot if high. + + Bit 2 Coin counter protection: If coin counter is disconnected, the game + stops. Described in the SIDAM user manual: + + 4. Protezione contatore: il microprocessore controlla che il contatore + sia inserito e funzioni regolarmente. Nel caso il contatore venga + staccato il programma si arresta e non riprende finchè il contatore non + viene regolar-mente ricollegato. + + Driven by a transistor connected between pins 16A and 22A on the edge + connector. Handled by the code at address $0079. + */ + PORT_START("IN3") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_TOGGLE PORT_NAME("Spare") + PORT_CONFNAME( 0x04, 0x04, "Coin counter" ) + PORT_CONFSETTING( 0x00, "Disconnected" ) + PORT_CONFSETTING( 0x04, "Connected" ) + PORT_BIT( 0xf9, IP_ACTIVE_LOW, IPT_UNUSED ) // these bits all go to unpopulated RRC networks + + // P1 controls (connected to IN0, IN1 and IN2) + INVADERS_CONTROL_PORT_P1 INPUT_PORTS_END +void invasion_state::invasion(machine_config &config) +{ + mw8080bw_root(config); + + // basic machine hardware + m_maincpu->set_addrmap(AS_IO, &invasion_state::io_map); + + // 60 Hz signal clocks two cascaded 'LS161s, terminal count output resets the CPU + WATCHDOG_TIMER(config, m_watchdog).set_vblank_count("screen", 255); + + // video hardware + m_screen->set_screen_update(FUNC(invasion_state::screen_update_invaders)); + + // wrong - Sidam Invasion uses totally redesigned sound hardware + INVADERS_AUDIO(config, "soundboard"); +} + #endif + /*******************************************************/ /* */ /* bootleg "Super Invaders" */ @@ -5844,12 +5915,12 @@ GAMEL(1978, cosmicin, invaders, invaders, sicv, sisv_state, empty_i GAMEL(1978, galmonst, invaders, invaders, sicv, sisv_state, empty_init, ROT270, "bootleg (Laguna S.A.)", "Galaxy Monsters (Laguna S.A. Spanish bootleg of Space Invaders)", MACHINE_SUPPORTS_SAVE, layout_invaders ) GAMEL(1979, spacecom, invaders, spacecom, spacecom, spacecom_state, init_spacecom, ROT270, "bootleg", "Space Combat (bootleg of Space Invaders)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_spacecom ) GAME( 1978, spacerng, invaders, spacerng, sitv, _8080bw_state, empty_init, ROT90, "bootleg (Leisure Time Electronics)", "Space Ranger", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) // Many modifications -GAMEL(19??, invasion, invaders, invaders, invasion, invaders_state, empty_init, ROT270, "bootleg (Sidam)", "Invasion (Sidam)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_invaders ) -GAMEL(1979, invasiona, invaders, invaders, invasion, invaders_state, empty_init, ROT270, "bootleg", "UFO Robot Attack (bootleg of Invasion, newer set)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Has Sidam replaced with 'UFO Monster Attack' and standard GFX -GAMEL(1979, invasiona2, invaders, invaders, invasion, invaders_state, empty_init, ROT270, "bootleg", "UFO Robot Attack (bootleg of Invasion, older set)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Has Sidam replaced with 'UFO Monster Attack' and standard GFX -GAMEL(1979, invasionb, invaders, invaders, invasion, invaders_state, empty_init, ROT270, "bootleg", "Invasion (Italian bootleg)", MACHINE_SUPPORTS_SAVE, layout_invaders ) -GAMEL(1979, invasionrz, invaders, invaders, invasion, invaders_state, empty_init, ROT270, "bootleg (R Z SRL Bologna)", "Invasion (bootleg set 1, R Z SRL Bologna)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING, layout_invaders ) -GAMEL(1979, invasionrza, invaders, invaders, invasion, invaders_state, empty_init, ROT270, "bootleg (R Z SRL Bologna)", "Invasion (bootleg set 2, R Z SRL Bologna)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING, layout_invaders ) +GAMEL(19??, invasion, invaders, invasion, invasion, invasion_state, empty_init, ROT270, "bootleg (Sidam)", "Invasion (Sidam)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_invaders ) +GAMEL(1979, invasiona, invaders, invasion, invasion, invasion_state, empty_init, ROT270, "bootleg", "UFO Robot Attack (bootleg of Invasion, newer set)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_invaders ) // Has Sidam replaced with 'UFO Monster Attack' and standard GFX +GAMEL(1979, invasiona2, invaders, invasion, invasion, invasion_state, empty_init, ROT270, "bootleg", "UFO Robot Attack (bootleg of Invasion, older set)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_invaders ) // Has Sidam replaced with 'UFO Monster Attack' and standard GFX +GAMEL(1979, invasionb, invaders, invasion, invasion, invasion_state, empty_init, ROT270, "bootleg", "Invasion (Italian bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_invaders ) +GAMEL(1979, invasionrz, invaders, invasion, invasion, invasion_state, empty_init, ROT270, "bootleg (R Z SRL Bologna)", "Invasion (bootleg set 1, R Z SRL Bologna)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_invaders ) +GAMEL(1979, invasionrza, invaders, invasion, invasion, invasion_state, empty_init, ROT270, "bootleg (R Z SRL Bologna)", "Invasion (bootleg set 2, R Z SRL Bologna)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_invaders ) GAMEL(19??, invadersem, invaders, invaders, sitv, sisv_state, empty_init, ROT270, "Electromar", "Space Invaders (Electromar, Spanish)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Possibly licensed GAMEL(1978, superinv, invaders, invaders, superinv, invaders_state, empty_init, ROT270, "bootleg", "Super Invaders (bootleg set 1)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Not related to Zenitone-Microsec version GAMEL(1978, sinvemag, invaders, invaders, sinvemag, invaders_state, empty_init, ROT270, "bootleg (Emag)", "Super Invaders (bootleg set 2)", MACHINE_SUPPORTS_SAVE, layout_invaders ) // Not related to Zenitone-Microsec version diff --git a/src/mame/drivers/compc.cpp b/src/mame/drivers/compc.cpp index 380753479e8..8f0f43ae3af 100644 --- a/src/mame/drivers/compc.cpp +++ b/src/mame/drivers/compc.cpp @@ -32,9 +32,10 @@ Options: 8087 FPU #include "emu.h" #include "cpu/i86/i86.h" +#include "bus/pc_kbd/keyboards.h" +#include "bus/pc_kbd/pc_kbdc.h" #include "machine/genpc.h" #include "machine/nvram.h" -#include "machine/pckeybrd.h" #include "softlist_dev.h" @@ -45,19 +46,18 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_mb(*this, "mb"), - m_keyboard(*this, "pc_keyboard") + m_dsw0(*this, "DSW0") { } required_device<cpu_device> m_maincpu; required_device<pc_noppi_mb_device> m_mb; - required_device<pc_keyboard_device> m_keyboard; + required_ioport m_dsw0; void machine_reset() override; - void pioiii_w(offs_t offset, u8 data); - u8 pioiii_r(offs_t offset); - void pio_w(offs_t offset, u8 data); - u8 pio_r(offs_t offset); + u8 pioiii_portc_r(); + void pioiii_portc_w(u8 data); + u8 pio_portc_r(); void compc(machine_config &config); void pc10iii(machine_config &config); @@ -66,99 +66,48 @@ public: void compc_map(address_map &map); void compciii_io(address_map &map); private: - u8 m_portb = 0, m_dips = 0; + u8 m_dips = 0; }; void compc_state::machine_reset() { - m_portb = 0; m_dips = 0; } -void compc_state::pio_w(offs_t offset, u8 data) + +u8 compc_state::pio_portc_r() { - switch (offset) + u8 data; + if(BIT(m_mb->pc_ppi_portb_r(), 3)) { - case 1: - m_portb = data; - m_mb->m_pit8253->write_gate2(BIT(data, 0)); - m_mb->pc_speaker_set_spkrdata(BIT(data, 1)); - m_keyboard->enable(BIT(data, 6)); - if(data & 0x80) - m_mb->m_pic8259->ir1_w(0); - break; + /* read hi nibble of S2 */ + data = (m_dsw0->read() >> 4) & 0x0f; } -} - - -u8 compc_state::pio_r(offs_t offset) -{ - int data = 0; - switch (offset) + else { - case 0: - data = m_keyboard->read(); - break; - case 1: - data = m_portb; - break; - case 2: - if(BIT(m_portb, 3)) - { - /* read hi nibble of S2 */ - data = (ioport("DSW0")->read() >> 4) & 0x0f; - } - else - { - /* read lo nibble of S2 */ - data = ioport("DSW0")->read() & 0x0f; - } - if(m_mb->pit_out2()) - data |= 0x20; - break; + /* read lo nibble of S2 */ + data = m_dsw0->read() & 0x0f; } + if(m_mb->pit_out2()) + data |= 0x20; return data; } -void compc_state::pioiii_w(offs_t offset, u8 data) +void compc_state::pioiii_portc_w(u8 data) { - switch (offset) - { - case 1: - m_portb = data; - m_mb->m_pit8253->write_gate2(BIT(data, 0)); - m_mb->pc_speaker_set_spkrdata(BIT(data, 1)); - m_keyboard->enable(BIT(data, 6)); - if(data & 0x80) - m_mb->m_pic8259->ir1_w(0); - break; - case 2: - m_dips = (data & ~0x30) | ioport("DSW0")->read(); - break; - } + m_dips = (data & ~0x30) | m_dsw0->read(); } -u8 compc_state::pioiii_r(offs_t offset) +u8 compc_state::pioiii_portc_r() { - int data = 0; - switch (offset) - { - case 0: - data = m_keyboard->read(); - break; - case 1: - data = m_portb; - break; - case 2: - if(!BIT(m_portb, 2)) - data = (m_dips >> 4) & 0x0f; - else - data = m_dips & 0x0f; - if(m_mb->pit_out2()) - data |= 0x30; - break; - } + u8 data; + if(!BIT(m_mb->pc_ppi_portb_r(), 2)) + data = (m_dips >> 4) & 0x0f; + else + data = m_dips & 0x0f; + if(m_mb->pit_out2()) + data |= 0x30; return data; } @@ -206,14 +155,14 @@ void compc_state::compc_io(address_map &map) { map.unmap_value_high(); map(0x0000, 0x00ff).m(m_mb, FUNC(pc_noppi_mb_device::map)); - map(0x0060, 0x0063).rw(FUNC(compc_state::pio_r), FUNC(compc_state::pio_w)); + map(0x0062, 0x0062).r(FUNC(compc_state::pio_portc_r)); } void compc_state::compciii_io(address_map &map) { map.unmap_value_high(); map(0x0000, 0x00ff).m(m_mb, FUNC(pc_noppi_mb_device::map)); - map(0x0060, 0x0063).rw(FUNC(compc_state::pioiii_r), FUNC(compc_state::pioiii_w)); + map(0x0062, 0x0062).rw(FUNC(compc_state::pioiii_portc_r), FUNC(compc_state::pioiii_portc_w)); } void compc_state::compc(machine_config &config) @@ -226,6 +175,8 @@ void compc_state::compc(machine_config &config) PCNOPPI_MOTHERBOARD(config, m_mb, 0).set_cputag(m_maincpu); m_mb->int_callback().set_inputline(m_maincpu, 0); m_mb->nmi_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); + m_mb->kbdclk_callback().set("keyboard", FUNC(pc_kbdc_device::clock_write_from_mb)); + m_mb->kbddata_callback().set("keyboard", FUNC(pc_kbdc_device::data_write_from_mb)); config.device_remove("mb:pit8253"); fe2010_pit_device &pit(FE2010_PIT(config, "mb:pit8253", 0)); pit.set_clk<0>(XTAL(14'318'181)/12.0); /* heartbeat IRQ */ @@ -241,8 +192,9 @@ void compc_state::compc(machine_config &config) ISA8_SLOT(config, "isa3", 0, "mb:isa", pc_isa8_cards, "com", false); ISA8_SLOT(config, "isa4", 0, "mb:isa", pc_isa8_cards, "fdc_xt", false); - PC_KEYB(config, m_keyboard); - m_keyboard->keypress().set("mb:pic8259", FUNC(pic8259_device::ir1_w)); + pc_kbdc_device &pc_kbdc(PC_KBDC(config, "keyboard", pc_xt_keyboards, STR_KBD_IBM_PC_XT_83)); + pc_kbdc.out_clock_cb().set(m_mb, FUNC(pc_noppi_mb_device::keyboard_clock_w)); + pc_kbdc.out_data_cb().set(m_mb, FUNC(pc_noppi_mb_device::keyboard_data_w)); /* internal ram */ RAM(config, RAM_TAG).set_default_size("256K").set_extra_options("512K, 640K"); diff --git a/src/mame/drivers/d9final.cpp b/src/mame/drivers/d9final.cpp index a7e715bf37f..b888d770dd3 100644 --- a/src/mame/drivers/d9final.cpp +++ b/src/mame/drivers/d9final.cpp @@ -353,7 +353,20 @@ ROM_START( d9final ) ROM_LOAD16_BYTE( "4.15h", 0x00000, 0x40000, CRC(859b7105) SHA1(1b36f84706473afaa50b6546d7373a2ee6602b9a) ) ROM_END +ROM_START( rpanic ) + ROM_REGION( 0x30000, "maincpu", 0 ) + ROM_LOAD( "2.4h", 0x00000, 0x8000, CRC(f3496b10) SHA1(84f33ab519a1f55213d0069d161c07bc99844035) ) + ROM_CONTINUE( 0x10000, 0x08000 ) + ROM_COPY( "maincpu", 0x10000, 0x18000, 0x08000 ) //or just 0xff + ROM_LOAD( "1.2h", 0x20000, 0x10000, CRC(901281ec) SHA1(7b4cae343f1b025d988a507141c0fa8229a0fea1) ) + + ROM_REGION( 0x80000, "tiles", 0 ) + ROM_LOAD16_BYTE( "3.13h", 0x00001, 0x40000, CRC(a907fd4a) SHA1(15590b8c9c1a791f5f995b909df9035ba3721446) ) + ROM_LOAD16_BYTE( "4.15h", 0x00000, 0x40000, CRC(c5b4d37f) SHA1(e5dbc0251ff288d52637bef93561705403fbe2e2) ) +ROM_END + } // Anonymous namespace -GAME( 1992, d9final, 0, d9final, d9final, d9final_state, empty_init, ROT0, "Excellent System", "Dream 9 Final (v2.24)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, rpanic, 0, d9final, d9final, d9final_state, empty_init, ROT0, "Excellent System / Jaleco", "Rolling Panic (v2.33)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, d9final, rpanic, d9final, d9final, d9final_state, empty_init, ROT0, "Excellent System", "Dream 9 Final (v2.24)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/dotrikun.cpp b/src/mame/drivers/dotrikun.cpp index ced36b69baa..e24a2dbe88e 100644 --- a/src/mame/drivers/dotrikun.cpp +++ b/src/mame/drivers/dotrikun.cpp @@ -50,7 +50,6 @@ public: void dotrikun(machine_config &config); protected: - required_device<cpu_device> m_maincpu; required_device<screen_device> m_screen; required_shared_ptr<uint8_t> m_vram; @@ -227,20 +226,21 @@ void dotrikun_state::dotrikun(machine_config &config) ROM_START( dotrikun ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "14479a.mpr", 0x0000, 0x4000, CRC(b77a50db) SHA1(2a5d812d39f0f58f5c3e1b46f80aca75aa225115) ) + ROM_LOAD( "mpr-14479a.ic2", 0x0000, 0x4000, CRC(b77a50db) SHA1(2a5d812d39f0f58f5c3e1b46f80aca75aa225115) ) ROM_END ROM_START( dotrikun2 ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "epr-13141.ic2", 0x0000, 0x4000, CRC(a6aa7fa5) SHA1(4dbea33fb3541fdacf2195355751078a33bb30d5) ) + ROM_LOAD( "mpr-14479.ic2", 0x0000, 0x4000, CRC(a6aa7fa5) SHA1(4dbea33fb3541fdacf2195355751078a33bb30d5) ) // also seen with EPR-13141 (same ROM contents) ROM_END ROM_START( dotriman ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "14479a.mpr", 0x0000, 0x4000, CRC(4ba6d2f5) SHA1(db805e9121ecbd41fac4593b58d7f071e7dbc720) ) + ROM_LOAD( "dotriman.bin", 0x0000, 0x4000, CRC(4ba6d2f5) SHA1(db805e9121ecbd41fac4593b58d7f071e7dbc720) ) ROM_END GAME( 1990, dotrikun, 0, dotrikun, dotrikun, dotrikun_state, empty_init, ROT0, "Sega", "Dottori Kun (new version)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) GAME( 1990, dotrikun2, dotrikun, dotrikun, dotrikun, dotrikun_state, empty_init, ROT0, "Sega", "Dottori Kun (old version)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) + GAME( 2016, dotriman, dotrikun, dotrikun, dotrikun, dotrikun_state, empty_init, ROT0, "hack (Chris Covell)", "Dottori-Man Jr.", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) diff --git a/src/mame/drivers/ds90.cpp b/src/mame/drivers/ds90.cpp new file mode 100644 index 00000000000..df22f89892f --- /dev/null +++ b/src/mame/drivers/ds90.cpp @@ -0,0 +1,66 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder + +/* + + Luxor X37 prototype + + (Luxor DS90-10 + ABC 1600 video) + +*/ + +#include "emu.h" +#include "softlist_dev.h" +#include "cpu/m68000/m68000.h" +#include "video/abc1600.h" + +class x37_state : public driver_device +{ +public: + x37_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void x37(machine_config &config); + +private: + required_device<m68000_base_device> m_maincpu; + + void program_map(address_map &map); + void cpu_space_map(address_map &map); +}; + +void x37_state::program_map(address_map &map) +{ + map(0x000000, 0x007fff).rom().region("maincpu", 0); +} + +void x37_state::cpu_space_map(address_map &map) +{ + map(0xffff0, 0xfffff).m(m_maincpu, FUNC(m68010_device::autovectors_map)); +} + +static INPUT_PORTS_START( x37 ) +INPUT_PORTS_END + +void x37_state::x37(machine_config &config) +{ + // basic machine hardware + M68010(config, m_maincpu, 10000000); + m_maincpu->set_addrmap(AS_PROGRAM, &x37_state::program_map); + m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &x37_state::cpu_space_map); + + // video hardware + ABC1600_MOVER(config, ABC1600_MOVER_TAG, 0); + + // software list + SOFTWARE_LIST(config, "flop_list").set_original("x37_flop"); +} + +ROM_START( x37 ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD( "x37.rom", 0x0000, 0x8000, CRC(d505e7e7) SHA1(a3ad839e47b1f71c394e5ce28bce199e5e4810d2) ) +ROM_END + +COMP( 1985, x37, 0, 0, x37, x37, x37_state, empty_init, "Luxor", "X37 (prototype)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) diff --git a/src/mame/drivers/exidy.cpp b/src/mame/drivers/exidy.cpp index cd723f659e6..08435cc607c 100644 --- a/src/mame/drivers/exidy.cpp +++ b/src/mame/drivers/exidy.cpp @@ -15,6 +15,9 @@ * Hard Hat * Fax and Fax 2 + TODO: + * check whether games besides Venture have coin counter outputs + Known bugs: * none at this time @@ -206,6 +209,7 @@ public: void pepper2(machine_config &config); DECLARE_CUSTOM_INPUT_MEMBER(intsource_coins_r); + DECLARE_INPUT_CHANGED_MEMBER(coin_count_w); protected: virtual void machine_start() override; @@ -438,10 +442,21 @@ CUSTOM_INPUT_MEMBER(teetert_state::teetert_input_r) } +/************************************* + * + * Special inputs + * + *************************************/ + +INPUT_CHANGED_MEMBER(exidy_state::coin_count_w) +{ + machine().bookkeeping().coin_counter_w(param, newval); +} + /************************************* * - * Bankswitcher + * Bank switching * *************************************/ @@ -462,6 +477,7 @@ void exidy_state::mtrap_ocl_w(uint8_t data) // Mouse Trap (possibly others) set output().set_value("led1", !BIT(data, 4)); } + /************************************* * * Main CPU memory handlers @@ -819,7 +835,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( venture ) PORT_START("DSW") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, exidy_state, coin_count_w, 1) PORT_DIPNAME( 0x06, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:2,3") PORT_DIPSETTING( 0x00, "20000" ) PORT_DIPSETTING( 0x02, "30000" ) @@ -847,7 +863,7 @@ static INPUT_PORTS_START( venture ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, exidy_state, coin_count_w, 0) PORT_START("INTSOURCE") /* diff --git a/src/mame/drivers/igs017.cpp b/src/mame/drivers/igs017.cpp index bc5cedc85a9..174e072896f 100644 --- a/src/mame/drivers/igs017.cpp +++ b/src/mame/drivers/igs017.cpp @@ -9,41 +9,42 @@ CPU: Z180 or 68000 Video: IGS017 or IGS031 (2 tilemaps, variable size sprites, protection) Other: IGS025 (8255), IGS022 (protection, MCU), IGS029 (protection) -Sound: M6295 + [YM2413] - -------------------------------------------------------------------------------------------------------------- -Year + Game PCB CPU Sound Custom Other -------------------------------------------------------------------------------------------------------------- -96 Shuzi Leyuan NO-0131-4 Z180 M6295 YM2413 IGS017 8255 Battery -97 Mj Super Da Man Guan II NO-0147-6 68000 M6295 IGS031 8255 Battery -97 Mj Tian Jiang Shen Bing NO-0157-2 Z180 M6295 YM2413 IGS017 IGS025 Battery -97 Mj Man Guan Daheng NO-0252 68000 M6295 IGS031 IGS025 IGS???* Battery -98 Genius 6 NO-0131-4 Z180 M6295 YM2413 IGS017 IGS003c Battery -98 Mj Long Hu Zhengba 2 NO-0206 68000 M6295 IGS031 IGS025 IGS022* Battery -98 Mj Shuang Long Qiang Zhu 2 NO-0207 68000 M6295 IGS031 IGS025 IGS022 Battery -98 Mj Man Guan Caishen NO-0192-1 68000 M6295 IGS017 IGS025 IGS029 Battery -99 Tarzan (V107) NO-0228? Z180 M6295 IGS031 IGS025 IGS029 Battery -99 Tarzan (V109C) NO-0248-1 Z180 M6295 IGS031 IGS025 Battery -00? Super Tarzan (V100I) NO-0230-1 Z180 M6295 IGS031 IGS025 Battery -01? Happy Skill (V611) NO-0281 Z180 M6295 (K668) IGS031 IGS025 Battery -01? unknown (V100A) unreadable Z180 M6295 IGS031 IGS025 Battery -?? Super Poker / Formosa NO-0187 Z180 M6295 YM2413 IGS017 IGS025 Battery -------------------------------------------------------------------------------------------------------------- - * not present in one set +Sound: M6295(K668/AR17961) + [YM2413(U3567)] + +-------------------------------------------------------------------------------------------------------- +Year + Game PCB CPU Sound Custom Other +-------------------------------------------------------------------------------------------------------- +96 Shuzi Leyuan (V127M) NO-0131-4 Z180 AR17961 U3567 IGS017 8255 Battery +97 Super Da Man Guan II (V754C) NO-0147-6 68000 K668 IGS031 8255 Battery +97 Tian Jiang Shen Bing (V137C) NO-0157-2 Z180 AR17961 U3567 IGS017 IGS025 Battery +97 Man Guan Daheng (V123T1) NO-0252 68000 M6295 IGS031 IGS025 IGS???* Battery +98 Genius 6 (V110F) NO-0131-4 Z180 K668 U3567 IGS017 IGS003c Battery +98 Long Hu Zhengba 2 (set 1) NO-0206 68000 K668 IGS031 IGS025 IGS022* Battery +98 Shuang Long Qiang Zhu 2 VS (VS203J) NO-0207 68000 K668 IGS031 IGS025 IGS022 Battery +98 Man Guan Caishen (V103CS) NO-0192-1 68000 K668 IGS017 IGS025 IGS029 Battery +99 Tarzan (V107) NO-0228? Z180 U6295 IGS031 IGS025 IGS029 Battery +99 Tarzan (V109C) NO-0248-1 Z180 U6295 IGS031 IGS025 Battery +00? Super Tarzan (V100I) NO-0230-1 Z180 K668 IGS031 IGS025 Battery +00? Happy Skill (V611IT) NO-0281 Z180 K668 IGS031 IGS025 Battery +00? Champion Poker 2 (V100A) unreadable Z180 M6295 IGS031 IGS025 Battery +00? Super Poker (V100xD03) / Formosa NO-0187 Z180 K668 U3567 IGS017 IGS025 Battery +-------------------------------------------------------------------------------------------------------- + not present in another set * To Do: - Protection emulation in some games, instead of patching the roms. - NVRAM. -- mgcs: implement joystick inputs. Finish IGS029 protection simulation. +- mgcs: Finish IGS029 protection simulation. Notes: -- iqblocka: keep start pressed during boot for DSWs & input test. Keep test (F2) pressed for book-keeping / setup [pass: press Play (2)] -- iqblockf/genius6: for gambling, press service1 (9) then press Play (2) eight times. Then test (F2) enters book-keeping / setup -- lhzb2, mgcs, tjsb: press service + stats during test mode for sound test. -- mgdh: press A + B during test mode for sound test (B1+B2+B3 when using a joystick). -- mgdh: test mode is accessed by keeping test pressed during boot (as usual), but pressing F2+F3 in MAME - does not actually work. It does work if F2 is pressed in the debug window at boot, and held while closing it. +- Test mode is usually accessed by keeping test (F2) pressed during boot. +- iqblocka: keep start (1) pressed during boot for DSWs & input test. Keep test (F2) pressed for book-keeping / setup [pass: press deal (2)]. +- iqblockf/genius6: press service1 (9) then press deal (2) eight times to switch to gambling. Then test (F2) enters book-keeping / setup. +- lhzb2, mgcs, slqz2, tjsb: press test (F2) + book (0) during inputs test for sound test. +- mgdh, sdmg2: press keys A + B during test mode for sound test (B1 + B2 + B3 when using a joystick in mgdh). +- spkrform: to switch from poker to Formosa press service1 (9). To switch back, press in sequence: + service3 (right of 0) then Bet (M) then press "Hold 1".."Hold 5" (Z, X, C, V, B) ************************************************************************************************************/ @@ -52,18 +53,232 @@ Notes: #include "cpu/m68000/m68000.h" #include "cpu/z180/z180.h" #include "machine/i8255.h" -#include "sound/okim6295.h" -#include "sound/ymopl.h" -#include "machine/igs025.h" #include "machine/igs022.h" #include "machine/ticket.h" #include "machine/timer.h" +#include "sound/okim6295.h" +#include "sound/ymopl.h" #include "video/igs017_igs031.h" #include "emupal.h" #include "screen.h" #include "speaker.h" +#include "igspoker.lh" +#include "igsslot.lh" + +#define LOG_PROT_STRING (1U << 1) +#define LOG_PROT_BITSWAP (1U << 2) +#define LOG_PROT_INCDEC (1U << 3) +#define LOG_PROT_INC (1U << 4) +#define LOG_PROT_SCRAMBLE (1U << 5) +#define LOG_PROT_REMAP (1U << 6) +#define LOG_PROT_IGS022 (1U << 7) +#define LOG_PROT_IGS029 (1U << 8) + +//#define VERBOSE (LOG_GENERAL | LOG_PROT_STRING | LOG_PROT_BITSWAP | LOG_PROT_INCDEC | LOG_PROT_INC | LOG_PROT_SCRAMBLE | LOG_PROT_REMAP | LOG_PROT_IGS022 | LOG_PROT_IGS029) +#define VERBOSE (0) +#include "logmacro.h" + +/*************************************************************************** + + ---- IGS Multiplexer ---- + +***************************************************************************/ + +class igs_mux_device : + public device_t, + public device_memory_interface +{ +public: + igs_mux_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + void address_w(u8 data); + void data_w(u8 data); + u8 data_r(); + +protected: + virtual void device_start() override; + virtual void device_reset() override; + + virtual space_config_vector memory_space_config() const override; + +private: + address_space_config m_space_config; + u8 m_address = 0; +}; + +device_memory_interface::space_config_vector igs_mux_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(0, &m_space_config) + }; +} + +DEFINE_DEVICE_TYPE(IGS_MUX, igs_mux_device, "igs_mux", "IGS I/O Multiplexer") + +igs_mux_device::igs_mux_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, IGS_MUX, tag, owner, clock) + , device_memory_interface(mconfig, *this) + , m_space_config("igs_mux", ENDIANNESS_LITTLE, 8, 8, 0) +{ } + +void igs_mux_device::device_start() +{ + save_item(NAME(m_address)); +} + +void igs_mux_device::device_reset() +{ +} + +void igs_mux_device::address_w(u8 data) +{ + m_address = data; +} + +void igs_mux_device::data_w(u8 data) +{ + space().write_byte(m_address, data); +} + +u8 igs_mux_device::data_r() +{ + return space().read_byte(m_address); +} + +/*************************************************************************** + + ---- IGS String Protection ---- + +***************************************************************************/ + +class igs_string_device : public device_t +{ +public: + igs_string_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + u8 result_r(); // 0x05: result_r + void do_bitswap_w(offs_t offset, u8 data); // 0x20-0x27: do_bitswap_w + u8 advance_string_offs_r(address_space &space); // 0x40: advance_string_offs_r + + // Call after decryption, e.g. at the end of init_<gamename> + void dump(const char *filename, u32 string_addr, u32 xor_addr, bool is_16bits) const; + +protected: + virtual void device_start() override; + virtual void device_reset() override; + +private: + required_memory_region m_region_key; + + u16 m_string_word = 0, m_word = 0; + u8 m_string_offs = 0; +}; + +DEFINE_DEVICE_TYPE(IGS_STRING, igs_string_device, "igs_string", "IGS String Protection") + +igs_string_device::igs_string_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, IGS_STRING, tag, owner, clock) + , m_region_key(*this, DEVICE_SELF) +{ } + +void igs_string_device::dump(const char *filename, u32 string_addr, u32 xor_addr, bool is_16bits) const +{ + FILE *f = fopen(filename, "wb"); + if (!f) + { + printf("Error opening igs_string dump file %s\n", filename); + fclose(f); + return; + } + + printf("igs_string addr = %x, %x (%d bits)\n", string_addr, xor_addr, is_16bits ? 16 : 8); + + const u8 * const string_base = (const u8 *)memregion(":maincpu")->base() + string_addr; + const u8 * const xor_base = (const u8 *)memregion(":maincpu")->base() + xor_addr; + for (u32 i = 0; i < 0xec; ++i) + { + const u32 addr = is_16bits ? BYTE_XOR_BE(i) : i; + const u8 data = string_base[addr] ^ xor_base[addr]; + fwrite(&data, 1, 1, f); + } + + fclose(f); +} + +void igs_string_device::device_start() +{ + save_item(NAME(m_string_offs)); + save_item(NAME(m_string_word)); + save_item(NAME(m_word)); +} + +void igs_string_device::device_reset() +{ + m_string_word = m_word = 0; + m_string_offs = 0; +} + +u8 igs_string_device::result_r() +{ + const u8 res = bitswap<8>(m_word, 5, 2, 9, 7, 10, 13, 12, 15); + LOGMASKED(LOG_PROT_STRING, "%s: read bitswap - word %04x -> %02x\n", machine().describe_context(), m_word, res); + return res; +} + +void igs_string_device::do_bitswap_w(offs_t offset, u8 data) +{ + const u16 x = m_word; + + m_word = 0; + + m_word |= (BIT( x, 0) ^ BIT(m_string_word, 0)) << 1; // bit 1 + m_word |= (BIT(~x, 1) ^ BIT(m_string_word, 1)) << 2; // bit 2 + m_word |= (BIT(~x, 2) ^ BIT(m_string_word, 2)) << 3; // bit 3 + m_word |= (BIT(~x, 13) ^ BIT( x, 3)) << 4; // bit 4 + m_word |= (BIT(~x, 4) ^ BIT(m_string_word, 4)) << 5; // bit 5 + m_word |= (BIT( x, 5) ^ BIT(m_string_word, 5)) << 6; // bit 6 + m_word |= (BIT(~x, 6) ^ BIT(m_string_word, 6)) << 7; // bit 7 + m_word |= (BIT(~x, 7) ^ BIT(m_string_word, 7)) << 8; // bit 8 + m_word |= (BIT(~x, 8) ^ BIT(m_string_word, 8)) << 9; // bit 9 + m_word |= (BIT( x, 9) ^ BIT(m_string_word, 9)) << 10; // bit 10 + m_word |= (BIT(~x, 10) ^ BIT( x, 3)) << 11; // bit 11 + m_word |= (BIT( x, 11) ^ BIT(m_string_word, 11)) << 12; // bit 12 + m_word |= (BIT(~x, 12) ^ BIT(m_string_word, 12)) << 13; // bit 13 + m_word |= (BIT( x, 13) ^ BIT(m_string_word, 13)) << 14; // bit 14 + m_word |= (BIT( x, 14) ^ BIT(m_string_word, 14)) << 15; // bit 15 + + // bit 0 + const u16 bit0 = BIT(~x, 15) ^ BIT(x, 7); + + // bit 0 is further xor'd with bit x of the data written to this address + const u16 xor0 = BIT(data, offset & 7); + m_word |= bit0 ^ xor0; + + LOGMASKED(LOG_PROT_STRING, "%s: exec bitswap on port %02x = %02x - bit0 %x, xor0 %x, word %04x -> %04x\n", machine().describe_context(), + offset, data, bit0, xor0, x, m_word); +} + +u8 igs_string_device::advance_string_offs_r(address_space &space) +{ + const u8 next_string_offs = ((m_string_offs + 1) < 0xec ? (m_string_offs + 1) : 0); + + const u8 shift = (next_string_offs & 1) ? 8 : 0; + + const u8 next_string_byte = m_region_key ? m_region_key->base()[next_string_offs] : 0; + + const u16 next_string_word = (m_string_word & (0xff << (8 - shift))) | (next_string_byte << shift); + + LOGMASKED(LOG_PROT_STRING, "%s: advance string offs %02x -> %02x, string data = %02x, string word %04x -> %04x\n", machine().describe_context(), + m_string_offs, next_string_offs, next_string_byte, m_string_word, next_string_word); + + m_string_offs = next_string_offs; + m_string_word = next_string_word; + + return space.unmap(); +} + // Similar protection to that found in igs011.cpp: /*************************************************************************** @@ -88,18 +303,12 @@ class igs_bitswap_device : public device_t public: igs_bitswap_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - auto in_pa_callback() { return m_in_pa_cb.bind(); } - auto in_pb_callback() { return m_in_pb_cb.bind(); } - auto in_pc_callback() { return m_in_pc_cb.bind(); } - - auto out_pa_callback() { return m_out_pa_cb.bind(); } - auto out_pb_callback() { return m_out_pb_cb.bind(); } - auto out_pc_callback() { return m_out_pc_cb.bind(); } - auto out_pd_callback() { return m_out_pd_cb.bind(); } - - void address_w(u8 data); - void data_w(u8 data); - u8 data_r(); + u8 result_r(); // 0x03: result_r + void word_w(u8 data); // 0x40-0x47: word_w + void mode_f_w(u8 data); // 0x48: mode_f_w + void mode_3_w(u8 data); // 0x50: mode_3_w + void do_bitswap_w(offs_t offset, u8 data); // 0x80-0x87: do_bitswap_w + void reset_w(u8 data); // 0xa0: reset_w template <unsigned N> void set_m3_bits(u8 b0, u8 b1, u8 b2, u8 b3); void set_mf_bits(u8 b0, u8 b1, u8 b2, u8 b3); @@ -110,21 +319,12 @@ protected: virtual void device_reset() override; private: - devcb_read8 m_in_pa_cb; - devcb_read8 m_in_pb_cb; - devcb_read8 m_in_pc_cb; + u8 m_m3 = 0, m_mf = 0; + u16 m_val = 0, m_word = 0; - devcb_write8 m_out_pa_cb; - devcb_write8 m_out_pb_cb; - devcb_write8 m_out_pc_cb; - devcb_write8 m_out_pd_cb; - - u8 m_address, m_m3, m_mf; - u16 m_val, m_word; - - u8 m_m3_bits[4][4]; - u8 m_mf_bits[4]; - u16 m_val_xor; + u8 m_m3_bits[4][4] = { {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0} }; + u8 m_mf_bits[4] = {0,0,0,0}; + u16 m_val_xor = 0; }; template <unsigned N> void igs_bitswap_device::set_m3_bits(u8 b0, u8 b1, u8 b2, u8 b3) @@ -135,11 +335,11 @@ template <unsigned N> void igs_bitswap_device::set_m3_bits(u8 b0, u8 b1, u8 b2, m_m3_bits[N][3] = b3; #if 0 - printf("igs_bitswap: INIT m3_bits[%x] =", m3); + printf("igs_bitswap: INIT m3_bits[%x] =", N); for (int i = 0; i < 4; ++i) { - u8 bit = m_m3_bits[m3][i]; - printf(" %c%d", (bit & 0x80) ? '~' : ' ', (bit & 0x80) ? (bit ^ 0xff) : bit); + u8 bit = m_m3_bits[N][i]; + printf(" %c%d", BIT(bit, 7) ? '~' : ' ', BIT(bit, 7) ? (bit ^ 0xff) : bit); } printf("\n"); #endif @@ -168,31 +368,12 @@ void igs_bitswap_device::set_val_xor(u16 val_xor) DEFINE_DEVICE_TYPE(IGS_BITSWAP, igs_bitswap_device, "igs_bitswap", "IGS Bitswap Protection") -igs_bitswap_device::igs_bitswap_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - device_t(mconfig, IGS_BITSWAP, tag, owner, clock), - m_in_pa_cb(*this), - m_in_pb_cb(*this), - m_in_pc_cb(*this), - m_out_pa_cb(*this), - m_out_pb_cb(*this), - m_out_pc_cb(*this), - m_out_pd_cb(*this) -{ -} +igs_bitswap_device::igs_bitswap_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, IGS_BITSWAP, tag, owner, clock) +{ } void igs_bitswap_device::device_start() { - // resolve callbacks - m_in_pa_cb.resolve(); - m_in_pb_cb.resolve(); - m_in_pc_cb.resolve(); - m_out_pa_cb.resolve(); - m_out_pb_cb.resolve(); - m_out_pc_cb.resolve(); - m_out_pd_cb.resolve(); - - // register for save states - save_item(NAME(m_address)); save_item(NAME(m_m3)); save_item(NAME(m_mf)); save_item(NAME(m_val)); @@ -201,197 +382,90 @@ void igs_bitswap_device::device_start() void igs_bitswap_device::device_reset() { - m_address = m_m3 = m_mf = 0; + m_m3 = m_mf = 0; m_val = m_word = 0; } -void igs_bitswap_device::address_w(u8 data) +u8 igs_bitswap_device::result_r() { - m_address = data; + u8 res = bitswap<8>(m_val, 5, 2, 9, 7, 10, 13, 12, 15); + LOGMASKED(LOG_PROT_BITSWAP, "%s: read bitswap - val %04x -> %02x\n", machine().describe_context(), m_val, res); + return res; } -void igs_bitswap_device::data_w(u8 data) +void igs_bitswap_device::word_w(u8 data) { - switch (m_address) - { - case 0x00: - if (!m_out_pa_cb.isnull()) - { - m_out_pa_cb(data); - return; - } - break; - case 0x01: - if (!m_out_pb_cb.isnull()) - { - m_out_pb_cb(data); - return; - } - break; - case 0x02: - if (!m_out_pc_cb.isnull()) - { - m_out_pc_cb(data); - return; - } - break; - case 0x03: - if (!m_out_pd_cb.isnull()) - { - m_out_pd_cb(data); - return; - } - break; - - case 0x40: // word - { - m_word = (m_word << 8) | data; - logerror("%s: word = %02x\n", machine().describe_context(), m_word); - return; - } - case 0x41: - case 0x42: - case 0x43: - case 0x44: - case 0x45: - case 0x46: - case 0x47: - // same value as address 0x40 - return; - - case 0x48: // mode_f - { - m_mf = 0; - if ((m_word & 0x0f00) != 0x0a00) m_mf |= 0x08; - if ((m_word & 0xf000) != 0x9000) m_mf |= 0x04; - if ((m_word & 0x000f) != 0x0006) m_mf |= 0x02; - if ((m_word & 0x00f0) != 0x0090) m_mf |= 0x01; - - logerror("%s: mode_f = %x (word = %04x)\n", machine().describe_context(), m_mf, m_word); - return; - } - - case 0x50: // mode_3 - { - m_m3 = 0; - if ((m_word & 0x000f) != 0x0003) m_m3 |= 0x02; - if ((m_word & 0x00f0) != 0x0050) m_m3 |= 0x01; - - logerror("%s: mode_3 = %x (word = %04x)\n", machine().describe_context(), m_m3, m_word); - return; - } - - case 0x80: // do bitswap - case 0x81: - case 0x82: - case 0x83: - case 0x84: - case 0x85: - case 0x86: - case 0x87: - { - u16 x = m_val; - - // bits 1-15 come from inverting some bits, xor-ing 4 bits (they change per game) with the mf bits, then shifting to the left - m_val ^= m_val_xor; - for (int i = 0; i < 4; ++i) - m_val ^= BIT(m_mf, i) << m_mf_bits[i]; - m_val <<= 1; - - // bit 0 is the xor of 4 bits from val (some inverted). The 4 bits are picked based on m3 (and they change per game) - u16 bit0 = 0; - for (int i = 0; i < 4; ++i) - { - u8 bit = m_m3_bits[m_m3][i]; - bit0 ^= (bit & 0x80) ? (BIT(x, bit ^ 0xff) ^ 1) : BIT(x, bit); - } + m_word = (m_word << 8) | data; + LOGMASKED(LOG_PROT_BITSWAP, "%s: word = %02x\n", machine().describe_context(), m_word); +} - // bit 0 is further xor'd with bit x of the data written to this address (8x) - u16 xor0 = BIT(data, m_address & 7); - m_val |= bit0 ^ xor0; +void igs_bitswap_device::mode_f_w(u8 data) +{ + m_mf = 0; + if ((m_word & 0x0f00) != 0x0a00) m_mf |= 0x08; + if ((m_word & 0xf000) != 0x9000) m_mf |= 0x04; + if ((m_word & 0x000f) != 0x0006) m_mf |= 0x02; + if ((m_word & 0x00f0) != 0x0090) m_mf |= 0x01; - logerror("%s: exec bitswap on port %02x = %02x - mode_3 %02x, mode_f %02x, bit0 %x, xor0 %x, val %04x -> %04x\n", machine().describe_context(), m_address, data, m_m3, m_mf, bit0, xor0, x, m_val); - return; - } + LOGMASKED(LOG_PROT_BITSWAP, "%s: mode_f = %x (word = %04x)\n", machine().describe_context(), m_mf, m_word); +} - case 0xa0: // reset - { - logerror("%s: reset bitswap - val %04x -> 0\n", machine().describe_context(), m_val); - m_val = 0; - return; - } - } +void igs_bitswap_device::mode_3_w(u8 data) +{ + m_m3 = 0; + if ((m_word & 0x000f) != 0x0003) m_m3 |= 0x02; + if ((m_word & 0x00f0) != 0x0050) m_m3 |= 0x01; - logerror("%s: warning, writing to address %02x = %02x\n", machine().describe_context(), m_address, data); + LOGMASKED(LOG_PROT_BITSWAP, "%s: mode_3 = %x (word = %04x)\n", machine().describe_context(), m_m3, m_word); } -u8 igs_bitswap_device::data_r() +void igs_bitswap_device::do_bitswap_w(offs_t offset, u8 data) { - switch (m_address) - { - case 0x00: - if (!m_in_pa_cb.isnull()) - return m_in_pa_cb(); - break; - case 0x01: - if (!m_in_pb_cb.isnull()) - return m_in_pb_cb(); - break; - case 0x02: - if (!m_in_pc_cb.isnull()) - return m_in_pc_cb(); - break; + u16 x = m_val; - case 0x03: // result - { - u8 res = bitswap<16>(m_val, 0,0,0,0,0,0,0,0, 5,2,9,7,10,13,12,15) & 0xff; - logerror("%s: read bitswap - val %04x -> %02x\n", machine().describe_context(), m_val, res); - return res; - } + // bits 1-15 come from inverting some bits, xor-ing 4 bits (they change per game) with the mf bits, then shifting to the left + m_val ^= m_val_xor; + for (int i = 0; i < 4; ++i) + m_val ^= BIT(m_mf, i) << m_mf_bits[i]; + m_val <<= 1; - case 0x20: return 0x49; // 'I' - case 0x21: return 0x47; // 'G' - case 0x22: return 0x53; // 'S' - - case 0x24: return 0x41; - case 0x25: return 0x41; - case 0x26: return 0x7f; - case 0x27: return 0x41; - case 0x28: return 0x41; - - case 0x2a: return 0x3e; - case 0x2b: return 0x41; - case 0x2c: return 0x49; - case 0x2d: return 0xf9; - case 0x2e: return 0x0a; - - case 0x30: return 0x26; - case 0x31: return 0x49; - case 0x32: return 0x49; - case 0x33: return 0x49; - case 0x34: return 0x32; + // bit 0 is the xor of 4 bits from val (some inverted). The 4 bits are picked based on m3 (and they change per game) + u16 bit0 = 0; + for (int i = 0; i < 4; ++i) + { + u8 bit = m_m3_bits[m_m3][i]; + bit0 ^= BIT(bit, 7) ? (BIT(x, bit ^ 0xff) ^ 1) : BIT(x, bit); } - logerror("%s: warning, reading with address = %02x\n", machine().describe_context(), m_address); - return 0xff; + // bit 0 is further xor'd with bit x of the data written to this address (8x) + u16 xor0 = BIT(data, offset & 7); + m_val |= bit0 ^ xor0; + + LOGMASKED(LOG_PROT_BITSWAP, "%s: exec bitswap on port %02x = %02x - mode_3 %02x, mode_f %02x, bit0 %x, xor0 %x, val %04x -> %04x\n", machine().describe_context(), offset, data, m_m3, m_mf, bit0, xor0, x, m_val); + return; } +void igs_bitswap_device::reset_w(u8 data) +{ + LOGMASKED(LOG_PROT_BITSWAP, "%s: reset bitswap - val %04x -> 0\n", machine().describe_context(), m_val); + m_val = 0; +} /*************************************************************************** ---- IGS Inc/Dec Protection ---- - The chip holds an internal 8-bit (or less) value. It is manipulated by issuing commands, + The chip holds an internal 4-bit value. It is manipulated by issuing commands, where each command is assigned a specific address range, and is triggered by writing to that range. Possible commands: - - INC: increment value - - DEC: decrement value - - RESET: value = 0 + - [offset 0] RESET: value = 0 + - [offset 1] DEC: decrement value + - [offset 3] INC: increment value The protection value is read from an additional address range: - - READ: read bitswap(value). Only 4 bits are checked. + - [offset 5] READ: read bitswap(value). Only 4 bits are checked (0-32-1--, i.e. mask $B4) ***************************************************************************/ @@ -400,10 +474,10 @@ class igs_incdec_device : public device_t public: igs_incdec_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - void reset_w(u8 data = 0); - void inc_w(u8 data = 0); - void dec_w(u8 data = 0); - u8 val_r(); + u8 result_r(); + void reset_w(u8 data); + void inc_w(u8 data); + void dec_w(u8 data); protected: virtual void device_start() override; @@ -413,110 +487,182 @@ private: u8 m_val = 0; }; +u8 igs_incdec_device::result_r() +{ + u8 res = (BIT(m_val, 0) << 7) | + (BIT(m_val, 3) << 5) | + (BIT(m_val, 2) << 4) | + (BIT(m_val, 1) << 2) ; + + LOGMASKED(LOG_PROT_INCDEC, "%s: value read, %02x -> %02x\n", machine().describe_context(), m_val, res); + return res; +} + void igs_incdec_device::reset_w(u8 data) { m_val = 0x00; - logerror("%s: reset -> %02x\n", machine().describe_context(), m_val); + LOGMASKED(LOG_PROT_INCDEC, "%s: reset -> %02x\n", machine().describe_context(), m_val); } void igs_incdec_device::inc_w(u8 data) { m_val++; - logerror("%s: inc -> %02x\n", machine().describe_context(), m_val); + LOGMASKED(LOG_PROT_INCDEC, "%s: inc -> %02x\n", machine().describe_context(), m_val); } void igs_incdec_device::dec_w(u8 data) { m_val--; - logerror("%s: dec -> %02x\n", machine().describe_context(), m_val); + LOGMASKED(LOG_PROT_INCDEC, "%s: dec -> %02x\n", machine().describe_context(), m_val); +} + +DEFINE_DEVICE_TYPE(IGS_INCDEC, igs_incdec_device, "igs_incdec", "IGS Inc/Dec Protection") + +igs_incdec_device::igs_incdec_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, IGS_INCDEC, tag, owner, clock) +{ } + +void igs_incdec_device::device_start() +{ + save_item(NAME(m_val)); +} + +void igs_incdec_device::device_reset() +{ + m_val = 0; } -u8 igs_incdec_device::val_r() +/*************************************************************************** + + ---- IGS Inc Protection ---- + +***************************************************************************/ + +class igs_inc_device : public device_t +{ +public: + igs_inc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + u8 result_r(); + void reset_w(u8 data); + void inc_w(u8 data); + +protected: + virtual void device_start() override; + virtual void device_reset() override; + +private: + u8 m_val = 0; +}; + +u8 igs_inc_device::result_r() { - u8 res = (BIT(m_val, 0) << 7) | - (BIT(m_val, 3) << 5) | - (BIT(m_val, 2) << 4) | - (BIT(m_val, 1) << 2) ; + const u8 res = (BIT(~m_val, 0) | (BIT(m_val, 1) & BIT(m_val, 2))) << 5; - logerror("%s: value read, %02x -> %02x\n", machine().describe_context(), m_val, res); + LOGMASKED(LOG_PROT_INC, "%s: value read, %02x -> %02x\n", machine().describe_context(), m_val, res); return res; } -DEFINE_DEVICE_TYPE(IGS_INCDEC, igs_incdec_device, "igs_incdec", "IGS Inc/Dec Protection") +void igs_inc_device::reset_w(u8 data) +{ + m_val = 0x00; + LOGMASKED(LOG_PROT_INC, "%s: reset -> %02x\n", machine().describe_context(), m_val); +} -igs_incdec_device::igs_incdec_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : - device_t(mconfig, IGS_INCDEC, tag, owner, clock) +void igs_inc_device::inc_w(u8 data) { + m_val++; + LOGMASKED(LOG_PROT_INC, "%s: inc -> %02x\n", machine().describe_context(), m_val); } -void igs_incdec_device::device_start() +DEFINE_DEVICE_TYPE(IGS_INC, igs_inc_device, "igs_inc", "IGS Inc Protection") + +igs_inc_device::igs_inc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, IGS_INC, tag, owner, clock) +{ } + +void igs_inc_device::device_start() { - // register for save states save_item(NAME(m_val)); } -void igs_incdec_device::device_reset() +void igs_inc_device::device_reset() { m_val = 0; } +namespace { + // igs017_state class igs017_state : public driver_device { public: - igs017_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_remap_addr(-1), - m_maincpu(*this, "maincpu"), - m_oki(*this, "oki"), - m_hopperdev(*this, "hopper"), - m_igs025(*this,"igs025"), - m_igs022(*this,"igs022"), - m_screen(*this, "screen"), - m_decrypted_opcodes(*this, "decrypted_opcodes"), - m_igs017_igs031(*this, "igs017_igs031"), - m_igs_bitswap(*this, "igs_bitswap"), - m_igs_incdec(*this, "igs_incdec"), - m_io_coins(*this, "COINS"), - m_io_buttons(*this, "BUTTONS"), - m_io_player1(*this, "PLAYER1"), - m_io_player2(*this, "PLAYER2"), - m_io_hopper(*this, "HOPPER"), - m_io_key(*this, "KEY%u", 0U), - m_io_dsw(*this, "DSW%u", 1U) + igs017_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_remap_addr(-1) + , m_maincpu(*this, "maincpu") + , m_screen(*this, "screen") + , m_igs017_igs031(*this, "igs017_igs031") + , m_oki(*this, "oki") + , m_igs_mux(*this, "igs_mux") + , m_ppi(*this, "ppi8255") + // Optional shared pointers + , m_decrypted_opcodes(*this, "decrypted_opcodes") + // Optional devices + , m_hopper(*this, "hopper") + , m_igs_bitswap(*this, "igs_bitswap") + , m_igs_string(*this, "igs_string") + , m_igs_incdec(*this, "igs_incdec") + , m_igs_inc(*this, "igs_inc") + , m_igs022(*this,"igs022") + // Optional I/O + , m_io_coins(*this, "COINS") + , m_io_joy(*this, "JOY") + , m_io_key(*this, "KEY%u", 0U) + , m_io_dsw(*this, "DSW%u", 1U) + , m_lamps(*this, "lamp%u", 1U) { } - void mgcs(machine_config &config); - void mgdha(machine_config &config); - void tjsb(machine_config &config); - void lhzb2a(machine_config &config); - void slqz2(machine_config &config); + // Construct + void base_machine_oki(machine_config &config, const XTAL &xtal_oki); + // Z180 + void cpoker2(machine_config &config); + void genius6(machine_config &config); + void happyskl(machine_config &config); void iqblocka(machine_config &config); void iqblockf(machine_config &config); - void genius6(machine_config &config); - void lhzb2(machine_config &config); - void starzan(machine_config &config); void spkrform(machine_config &config); - void sdmg2(machine_config &config); + void starzan(machine_config &config); void tarzan(machine_config &config); + void tjsb(machine_config &config); + // 68000 + void lhzb2(machine_config &config); + void lhzb2a(machine_config &config); + void mgcs(machine_config &config); + void mgdh(machine_config &config); + void mgdha(machine_config &config); + void sdmg2(machine_config &config); + void slqz2(machine_config &config); + // Init + void init_cpoker2(); + void init_happyskl(); void init_iqblocka(); - void init_mgdh(); - void init_slqz2(); void init_lhzb2(); - void init_starzan(); + void init_lhzb2a(); void init_mgcs(); - void init_tjsb(); - void init_spkrform(); + void init_mgdh(); + void init_mgdha(); void init_sdmg2(); + void init_slqz2(); + void init_spkrform(); + void init_starzan(); void init_tarzan(); void init_tarzana(); - void init_lhzb2a(); - void init_mgdha(); - void init_happyskl(); - void init_unkigs(); + void init_tarzanc(); + void init_tjsb(); protected: virtual void machine_start() override; @@ -526,34 +672,35 @@ protected: private: int m_remap_addr; required_device<cpu_device> m_maincpu; - - required_device<okim6295_device> m_oki; - optional_device<ticket_dispenser_device> m_hopperdev; - optional_device<igs025_device> m_igs025; // Mj Shuang Long Qiang Zhu 2 - optional_device<igs022_device> m_igs022; // Mj Shuang Long Qiang Zhu 2 required_device<screen_device> m_screen; - optional_shared_ptr<u8> m_decrypted_opcodes; required_device<igs017_igs031_device> m_igs017_igs031; + required_device<okim6295_device> m_oki; + required_device<igs_mux_device> m_igs_mux; + required_device<i8255_device> m_ppi; + + // Optional shared pointers + optional_shared_ptr<u8> m_decrypted_opcodes; + + // Optional devices + optional_device<hopper_device> m_hopper; optional_device<igs_bitswap_device> m_igs_bitswap; + optional_device<igs_string_device> m_igs_string; optional_device<igs_incdec_device> m_igs_incdec; + optional_device<igs_inc_device> m_igs_inc; + optional_device<igs022_device> m_igs022; + // Optional I/O optional_ioport m_io_coins; - optional_ioport m_io_buttons; - optional_ioport m_io_player1; - optional_ioport m_io_player2; - optional_ioport m_io_hopper; + optional_ioport m_io_joy; optional_ioport_array<5> m_io_key; optional_ioport_array<3> m_io_dsw; - void igs025_to_igs022_callback(void); + output_finder<6> m_lamps; u8 m_input_select; - u8 m_hopper; - u16 m_igs_magic; - u8 m_scramble_data; - u8 m_dsw_select; - u8 m_i8255_portc_mux; + u8 m_scramble_data; + u8 m_igs022_latch; // IGS029 protection (communication) u8 m_igs029_send_data, m_igs029_recv_data; @@ -562,97 +709,194 @@ private: // IGS029 protection (mgcs) u32 m_igs029_mgcs_long; - void input_select_w(u8 data); + void dsw_select_w(u8 data); + u8 dsw_r(); + + template<u8 WarnMask> + void input_select_w(u8 data) + { + m_input_select = data; - void iqblocka_keyin_w(u8 data); - void iqblockf_keyout_w(u8 data); - void iqblocka_remap_addr_w(offs_t offset, u8 data); + if (data & WarnMask) + logerror("%s: warning, unknown bits written in input_select_w = %02x\n", machine().describe_context(), data); + } - u16 mgcs_palette_bitswap(u16 bgr) const; + template<u8 Bit, u8 WarnMask> + void oki_sound_bank_w(u8 data) + { + m_oki->set_rom_bank(BIT(data, Bit)); + + if (data & WarnMask) + logerror("%s: warning, unknown bits written in oki_sound_bank_w = %02x\n", machine().describe_context(), data); + } + + template<u8 Bit, u8 WarnMask> + void hopper_motor_w(u8 data) + { + m_hopper->motor_w(BIT(data, Bit)); + + if (data & WarnMask) + logerror("%s: warning, unknown bits written in hopper_motor_w = %02x\n", machine().describe_context(), data); + } + + template<u8 Bit, u8 WarnMask, int Counter> + void counter_w(u8 data) + { + machine().bookkeeping().coin_counter_w(Counter, BIT(data, Bit)); +// popmessage("COUNTER %d: %02X", Counter, data); + if (data & WarnMask) + logerror("%s: warning, unknown bits written in counter_w = %02x\n", machine().describe_context(), data); + } + + template<u8 Bit, u8 WarnMask> + void igs022_execute_w(u8 data) + { + if (!BIT(m_igs022_latch, Bit) && BIT(data, Bit)) // 0 -> 1 executes + { + m_igs022->handle_command(); + + const u8 new_scramble_data = (m_scramble_data + 1) & 0x7f; + LOGMASKED(LOG_PROT_IGS022, "%s: IGS022 scrambled data %02x -> %02x\n", machine().describe_context(), m_scramble_data, new_scramble_data); + m_scramble_data = new_scramble_data; + } + + if (data & WarnMask) + logerror("%s: warning, unknown bits written in igs022_execute_w = %02x\n", machine().describe_context(), data); + + m_igs022_latch = data; + } + + // Palette u16 lhzb2a_palette_bitswap(u16 bgr) const; - u16 tjsb_palette_bitswap(u16 bgr) const; + u16 mgcs_palette_bitswap(u16 bgr) const; u16 slqz2_palette_bitswap(u16 bgr) const; + u16 tarzan_palette_bitswap(u16 bgr) const; + u16 tjsb_palette_bitswap(u16 bgr) const; - void magic_w(offs_t offset, u16 data, u16 mem_mask = ~0); - u16 magic_r(); - - void mgcs_magic_w(offs_t offset, u16 data, u16 mem_mask = ~0); - u16 mgcs_magic_r(); + // Game Specific I/O + void incdec_remap_addr_w(offs_t offset, u8 data); - u8 sdmg2_keys_r(); - void sdmg2_magic_w(offs_t offset, u16 data, u16 mem_mask = ~0); - u16 sdmg2_magic_r(); + void cpoker2_lamps_sound_w(u8 data); - u8 mgdh_keys_r(); - void mgdha_magic_w(offs_t offset, u16 data, u16 mem_mask = ~0); - u16 mgdha_magic_r(); + void happyskl_lamps_sound_w(u8 data); - void tjsb_output_w(u8 data); - u8 tjsb_input_r(); - u8 spkrform_input_r(); + u8 lhzb2_keys_r(); + void lhzb2_keys_hopper_w(u8 data); + u8 lhzb2_scramble_data_r(); + void lhzb2_igs022_execute_w(u8 data); - void lhzb2a_input_select_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void lhzb2a_keys_hopper_w(offs_t offset, u16 data, u16 mem_mask = ~0); u16 lhzb2a_input_r(offs_t offset); void lhzb2a_remap_addr_w(address_space &space, u16 data); - void lhzb2_magic_w(offs_t offset, u16 data, u16 mem_mask = ~0); - u16 lhzb2_magic_r(); + u8 mgcs_keys_joy_r(); + void mgcs_keys_hopper_igs029_w(u8 data); + u8 mgcs_scramble_data_r(); + void mgcs_scramble_data_w(u8 data); + u8 mgcs_igs029_data_r(); + void mgcs_igs029_data_w(u8 data); - void slqz2_magic_w(offs_t offset, u16 data, u16 mem_mask = ~0); - u16 slqz2_magic_r(); - u8 mgcs_keys_r(); + u8 mgdh_keys_r(); + void mgdh_keys_hopper_w(u8 data); + void mgdh_counter_w(u8 data); + + u8 sdmg2_keys_joy_r(); + void sdmg2_keys_hopper_w(u8 data); + + void slqz2_sound_hopper_w(u8 data); + u8 slqz2_scramble_data_r(); - u8 i8255_port_c_mux_r(); // starzan, happyskl, unkigs (maybe tarzanc and clones, too) + void starzan_counter_w(u8 data); + void starzan_lamps_sound_w(u8 data); - DECLARE_MACHINE_RESET(iqblocka); - DECLARE_MACHINE_RESET(mgcs); + u8 tarzan_keys_joy_r(); + void tarzan_counter_w(u8 data); + void tarzan_dsw_sound_w(u8 data); + void tarzan_incdec_remap_addr_w(offs_t offset, u8 data); + + // Machine DECLARE_MACHINE_RESET(lhzb2a); + TIMER_DEVICE_CALLBACK_MEMBER(iqblocka_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(mgcs_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(mgdh_interrupt); + // Decrypt void decrypt_program_rom(int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0); - void tjsb_decrypt_sprites(); + + void lhzb2_decrypt_sprites(); + void lhzb2_decrypt_tiles(); void mgcs_decrypt_program_rom(); void mgcs_decrypt_tiles(); void mgcs_flip_sprites(); - void mgcs_patch_rom(); void mgcs_igs029_run(); - void tarzan_decrypt_tiles(); - void tarzan_decrypt_program_rom(); - void tarzana_decrypt_program_rom(); - void starzan_decrypt_program_rom(); - void lhzb2_patch_rom(); - void lhzb2_decrypt_tiles(); - void lhzb2_decrypt_sprites(); - void slqz2_patch_rom(); void slqz2_decrypt_tiles(); void spkrform_decrypt_sprites(); + void starzan_decrypt_program_rom(); + void starzan_decrypt_sprites(); + void tarzan_decrypt_program_rom(); + void tarzan_decrypt_sprites(size_t max_size); + void tarzan_decrypt_tiles(int address_xor); + void tarzana_decrypt_program_rom(); + void tjsb_decrypt_sprites(); + // ROM Patches +// void lhzb2_patch_rom(); +// void mgcs_patch_rom(); +// void slqz2_patch_rom(); + void mgdh_patch_rom(); + void spkrform_patch_rom(); + + // Memory maps void decrypted_opcodes_map(address_map &map); + + void igs_bitswap_mux_map(address_map &map); + void igs_fixed_data_mux_map(address_map &map); + void igs_string_mux_map(address_map &map); + + void cpoker2_io(address_map &map); + void cpoker2_map(address_map &map); + void cpoker2_mux_map(address_map &map); + void happyskl_io(address_map &map); + void happyskl_mux_map(address_map &map); void iqblocka_io(address_map &map); void iqblocka_map(address_map &map); + void iqblocka_mux_map(address_map &map); + void iqblockf_mux_map(address_map &map); void lhzb2_map(address_map &map); + void lhzb2_mux_map(address_map &map); void lhzb2a_map(address_map &map); + void lhzb2a_mux_map(address_map &map); void mgcs_map(address_map &map); - void mgdha_map(address_map &map); + void mgcs_mux_map(address_map &map); + void mgdh_mux_map(address_map &map); + void mgdh_map(address_map &map); + void mgdha_mux_map(address_map &map); void sdmg2_map(address_map &map); + void sdmg2_mux_map(address_map &map); void slqz2_map(address_map &map); + void slqz2_mux_map(address_map &map); void spkrform_io(address_map &map); - void spkrform_map(address_map &map); + void spkrform_mux_map(address_map &map); + void starzan_io(address_map &map); + void starzan_mux_map(address_map &map); + void tarzan_io(address_map &map); + void tarzan_mux_map(address_map &map); void tjsb_io(address_map &map); void tjsb_map(address_map &map); + void tjsb_mux_map(address_map &map); }; void igs017_state::machine_start() { + m_lamps.resolve(); + save_item(NAME(m_remap_addr)); save_item(NAME(m_input_select)); - save_item(NAME(m_hopper)); - save_item(NAME(m_igs_magic)); - save_item(NAME(m_scramble_data)); save_item(NAME(m_dsw_select)); - save_item(NAME(m_i8255_portc_mux)); + save_item(NAME(m_scramble_data)); + save_item(NAME(m_igs022_latch)); + save_item(NAME(m_igs029_send_data)); save_item(NAME(m_igs029_recv_data)); save_item(NAME(m_igs029_send_buf)); @@ -664,7 +908,25 @@ void igs017_state::machine_start() void igs017_state::machine_reset() { + m_input_select = m_dsw_select = 0xff; + m_scramble_data = 0; + m_igs029_send_len = m_igs029_recv_len = 0; + m_igs029_mgcs_long = 0; +} + +void igs017_state::dsw_select_w(u8 data) +{ + m_dsw_select = data; +} + +u8 igs017_state::dsw_r() +{ + u8 ret = 0xff; + if (!BIT(m_dsw_select, 0)) ret &= m_io_dsw[0]->read(); + if (!BIT(m_dsw_select, 1)) ret &= m_io_dsw[1]->read(); + if (!BIT(m_dsw_select, 2)) ret &= m_io_dsw[2]->read(); + return ret; } /*************************************************************************** @@ -686,13 +948,11 @@ u16 igs017_state::mgcs_palette_bitswap(u16 bgr) const u16 igs017_state::lhzb2a_palette_bitswap(u16 bgr) const { -// bgr = ((bgr & 0xff00) >> 8) | ((bgr & 0x00ff) << 8); return bitswap<16>(bgr, 15,9,13,12,11,5,4,8,7,6,0,14,3,2,1,10); } u16 igs017_state::tjsb_palette_bitswap(u16 bgr) const { - // bitswap return bitswap<16>(bgr, 15,12,3,6,10,5,4,2,9,13,8,7,11,1,0,14); } @@ -701,22 +961,32 @@ u16 igs017_state::slqz2_palette_bitswap(u16 bgr) const return bitswap<16>(bgr, 15,14,9,4,11,10,12,3,7,6,5,8,13,2,1,0); } - +u16 igs017_state::tarzan_palette_bitswap(u16 bgr) const +{ + return bitswap<16>(bgr, 15, 0,1,2,3,4, 10,11,12,13,14, 5,6,7,8,9); +} /*************************************************************************** Decryption ***************************************************************************/ +[[maybe_unused]] void save_decrypted_rom(const u8 * const rom, int rom_size) +{ + FILE *f = fopen("igs017_decrypted.bin", "wb"); + fwrite(rom, 1, rom_size, f); + fclose(f); +} + void igs017_state::decrypt_program_rom(int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0) { - int length = memregion("maincpu")->bytes(); - u8 *rom = memregion("maincpu")->base(); - std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(length); + const int rom_size = memregion("maincpu")->bytes(); + u8 * const rom = memregion("maincpu")->base(); + std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(rom_size); // decrypt the program ROM // XOR layer - for (int i = 0; i < length; i++) + for (int i = 0; i < rom_size; i++) { if (i & 0x2000) { @@ -746,23 +1016,18 @@ void igs017_state::decrypt_program_rom(int mask, int a7, int a6, int a5, int a4, } } - memcpy(tmp.get(),rom,length); + memcpy(tmp.get(),rom,rom_size); // address lines swap - for (int i = 0; i < length; i++) + for (int i = 0; i < rom_size; i++) { int addr = (i & ~0xff) | bitswap<8>(i,a7,a6,a5,a4,a3,a2,a1,a0); rom[i] = tmp[addr]; } -#if 0 - FILE *f = fopen("igs017_decrypted.bin", "wb"); - fwrite(rom, 1, length, f); - fclose(f); -#endif +// save_decrypted_rom(rom, rom_size); } - // iqblocka, iqblockf, genius6 void igs017_state::init_iqblocka() @@ -774,22 +1039,22 @@ void igs017_state::init_iqblocka() void igs017_state::tjsb_decrypt_sprites() { - int length = memregion("igs017_igs031:sprites")->bytes(); - u8 *rom = memregion("igs017_igs031:sprites")->base(); - std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(length); + const int rom_size = memregion("igs017_igs031:sprites")->bytes(); + u8 * const rom = memregion("igs017_igs031:sprites")->base(); + std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(rom_size); // address lines swap - memcpy(tmp.get(), rom, length); - for (int i = 0; i < length; i++) + memcpy(tmp.get(), rom, rom_size); + for (int i = 0; i < rom_size; i++) { int addr = (i & ~0xff) | bitswap<8>(i,7,6,5,2,1,4,3,0); rom[i] = tmp[addr]; } // data lines swap - for (int i = 0; i < length; i += 2) + for (int i = 0; i < rom_size; i += 2) { - u16 data = (rom[i+1] << 8) | rom[i+0]; // x-22222-11111-00000 + u16 data = (rom[i+1] << 8) | rom[i+0]; // x-22222-11111-00000 data = bitswap<16>(data, 15, 14,13,12,11,10, 9,1,7,6,5, 4,3,2,8,0); rom[i+0] = data; rom[i+1] = data >> 8; @@ -801,6 +1066,8 @@ void igs017_state::init_tjsb() decrypt_program_rom(0x05, 7, 6, 3, 2, 5, 4, 1, 0); tjsb_decrypt_sprites(); + +// m_igs_string->dump("tjsb_string.key", 0x1d24a, 0x1db4, false); } @@ -808,15 +1075,14 @@ void igs017_state::init_tjsb() void igs017_state::mgcs_decrypt_program_rom() { - u16 *src = (u16 *)memregion("maincpu")->base(); - - int rom_size = 0x80000; + const int rom_size = memregion("maincpu")->bytes(); + u16 * const rom = (u16 *)memregion("maincpu")->base(); - for (int i=0; i<rom_size/2; i++) + for (int i = 0; i < rom_size / 2; i++) { - u16 x = src[i]; + u16 x = rom[i]; - /* bit 0 xor layer */ + // bit 0 xor layer if (i & 0x20/2) { @@ -834,7 +1100,7 @@ void igs017_state::mgcs_decrypt_program_rom() } } - /* bit 8 xor layer */ + // bit 8 xor layer if ((i & 0x2000/2) || !(i & 0x80/2)) { @@ -851,18 +1117,18 @@ void igs017_state::mgcs_decrypt_program_rom() x ^= 0x0100; } - src[i] = x; + rom[i] = x; } } void igs017_state::mgcs_decrypt_tiles() { - int length = memregion("igs017_igs031:tilemaps")->bytes(); - u8 *rom = memregion("igs017_igs031:tilemaps")->base(); - std::vector<u8> tmp(length); + const int rom_size = memregion("igs017_igs031:tilemaps")->bytes(); + u8 * const rom = memregion("igs017_igs031:tilemaps")->base(); + std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(rom_size); - memcpy(&tmp[0],rom,length); - for (int i = 0; i < length; i++) + memcpy(&tmp[0], rom, rom_size); + for (int i = 0; i < rom_size; i++) { int addr = (i & ~0xffff) | bitswap<16>(i,15,14,13,12,11,10,6,7,8,9,5,4,3,2,1,0); rom[i^1] = bitswap<8>(tmp[addr],0,1,2,3,4,5,6,7); @@ -871,10 +1137,10 @@ void igs017_state::mgcs_decrypt_tiles() void igs017_state::mgcs_flip_sprites() { - int length = memregion("igs017_igs031:sprites")->bytes(); - u8 *rom = memregion("igs017_igs031:sprites")->base(); + const int rom_size = memregion("igs017_igs031:sprites")->bytes(); + u8 * const rom = memregion("igs017_igs031:sprites")->base(); - for (int i = 0; i < length; i+=2) + for (int i = 0; i < rom_size; i+=2) { u16 pixels = (rom[i+1] << 8) | rom[i+0]; @@ -889,50 +1155,54 @@ void igs017_state::mgcs_flip_sprites() } } +#if 0 void igs017_state::mgcs_patch_rom() { -// u16 *rom = (u16 *)memregion("maincpu")->base(); + u16 * const rom = (u16 *)memregion("maincpu")->base(); -// rom[0x20666/2] = 0x601e; // 020666: 671E beq $20686 (rom check) + rom[0x20666/2] = 0x601e; // 020666: 671E beq $20686 (rom check) // IGS029 send command -// rom[0x4dfce/2] = 0x6010; // 04DFCE: 6610 bne $4dfe0 -// rom[0x4e00e/2] = 0x4e75; -// rom[0x4e036/2] = 0x6006; // 04E036: 6306 bls $4e03e + rom[0x4dfce/2] = 0x6010; // 04DFCE: 6610 bne $4dfe0 + rom[0x4e00e/2] = 0x4e75; + rom[0x4e036/2] = 0x6006; // 04E036: 6306 bls $4e03e } +#endif void igs017_state::init_mgcs() { mgcs_decrypt_program_rom(); - mgcs_patch_rom(); +// mgcs_patch_rom(); mgcs_decrypt_tiles(); mgcs_flip_sprites(); + +// m_igs_string->dump("mgcs_string.key", 0x1424, 0x1338, true); } // tarzan, tarzana -void igs017_state::tarzan_decrypt_tiles() +void igs017_state::tarzan_decrypt_tiles(int address_xor) { - int length = memregion("igs017_igs031:tilemaps")->bytes(); - u8 *rom = memregion("igs017_igs031:tilemaps")->base(); - std::vector<u8> tmp(length); + const int rom_size = memregion("igs017_igs031:tilemaps")->bytes(); + u8 * const rom = memregion("igs017_igs031:tilemaps")->base(); + std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(rom_size); - memcpy(&tmp[0],rom,length); - for (int i = 0; i < length; i++) + memcpy(&tmp[0], rom, rom_size); + for (int i = 0; i < rom_size; i++) { - int addr = (i & ~0xffff) | bitswap<16>(i,15,14,13,12,11,7,8,6,10,9,5,4,3,2,1,0); + int addr = (i & ~0xffff) | (bitswap<16>(i,15,14,13,12,11, 7,8,6,10,9, 5,4,3,2,1,0) ^ address_xor); rom[i] = bitswap<8>(tmp[addr],0,1,2,3,4,5,6,7); } } -// decryption should be good void igs017_state::tarzan_decrypt_program_rom() { - u8 *rom = memregion("maincpu")->base(); + const int rom_size = memregion("maincpu")->bytes(); + u8 * const rom = memregion("maincpu")->base(); - for (int i = 0; i < 0x40000; i++) + for (int i = 0; i < rom_size; i++) { u8 x = rom[i]; @@ -945,7 +1215,7 @@ void igs017_state::tarzan_decrypt_program_rom() m_decrypted_opcodes[i] = x; } - for (int i = 0; i < 0x40000; i++) + for (int i = 0; i < rom_size; i++) { u8 x = rom[i]; @@ -958,17 +1228,21 @@ void igs017_state::tarzan_decrypt_program_rom() } } -void igs017_state::init_tarzan() +void igs017_state::init_tarzanc() { tarzan_decrypt_program_rom(); - tarzan_decrypt_tiles(); + tarzan_decrypt_tiles(1); + tarzan_decrypt_sprites(0); + +// m_igs_string->dump("tarzan_string.key", 0xa98a, 0xab01, false); // tarzan / tarzanc (same program rom) } void igs017_state::tarzana_decrypt_program_rom() { - u8 *rom = memregion("maincpu")->base(); + const int rom_size = memregion("maincpu")->bytes(); + u8 * const rom = memregion("maincpu")->base(); - for (int i = 0; i < 0x40000; i++) + for (int i = 0; i < rom_size; i++) { u8 x = rom[i]; @@ -982,7 +1256,7 @@ void igs017_state::tarzana_decrypt_program_rom() m_decrypted_opcodes[i] = x; } - for (int i = 0; i < 0x40000; i++) // by iq_132 + for (int i = 0; i < rom_size; i++) // by iq_132 { u8 x = rom[i]; @@ -990,16 +1264,29 @@ void igs017_state::tarzana_decrypt_program_rom() if ((i & 0x02180) == 0x00000) x ^= 0x01; if ((i & 0x001a0) != 0x00020) x ^= 0x20; if ((i & 0x00260) != 0x00200) x ^= 0x40; - if ((i & 0x00060) != 0x00000 && (i & 0x00260) != 0x00240) x ^= 0x80; + if ((i & 0x00060) != 0x00000 && (i & 0x00260) != 0x00240) x ^= 0x80; rom[i] = x; } + +// save_decrypted_rom(rom, rom_size); +// save_decrypted_rom(m_decrypted_opcodes, rom_size); +} + +void igs017_state::init_tarzan() +{ + tarzan_decrypt_program_rom(); + tarzan_decrypt_tiles(0); + +// m_igs_string->dump("tarzan_string.key", 0xa98a, 0xab01, false); // tarzan / tarzanc (same program rom) } void igs017_state::init_tarzana() { tarzana_decrypt_program_rom(); -// tarzana_decrypt_tiles(); // to do when dumped + tarzan_decrypt_tiles(0); + +// m_igs_string->dump("tarzana_string.key", 0xaa64, 0xabdb, false); // same data as tarzan / tarzanc } @@ -1007,9 +1294,10 @@ void igs017_state::init_tarzana() void igs017_state::starzan_decrypt_program_rom() { - u8 *rom = memregion("maincpu")->base(); + const int rom_size = memregion("maincpu")->bytes(); + u8 * const rom = memregion("maincpu")->base(); - for (int i = 0; i < 0x40000; i++) + for (int i = 0; i < rom_size; i++) { u8 x = rom[i]; @@ -1023,7 +1311,7 @@ void igs017_state::starzan_decrypt_program_rom() m_decrypted_opcodes[i] = x; } - for (int i = 0; i < 0x40000; i++) // by iq_132 + for (int i = 0; i < rom_size; i++) // by iq_132 { u8 x = rom[i]; @@ -1043,16 +1331,55 @@ void igs017_state::starzan_decrypt_program_rom() void igs017_state::init_starzan() { starzan_decrypt_program_rom(); - tarzan_decrypt_tiles(); - mgcs_flip_sprites(); // ? + tarzan_decrypt_tiles(1); + starzan_decrypt_sprites(); + +// m_igs_string->dump("starzan_string.key", 0xa86f, 0xa966, false); +} + + +void igs017_state::tarzan_decrypt_sprites(size_t max_size) +{ + mgcs_flip_sprites(); + + const int rom_size = max_size ? max_size : memregion("igs017_igs031:sprites")->bytes(); + u8 *rom = memregion("igs017_igs031:sprites")->base(); + std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(rom_size); + + // address lines swap + memcpy(tmp.get(), rom, rom_size); + for (int i = 0; i < rom_size; i++) + { + int addr = (i & ~0xffff) | bitswap<16>(i,15,14,13, 9,10,11,12, 5,6,7,8, 4,3,2,1,0); + rom[i] = tmp[addr]; + } } +void igs017_state::starzan_decrypt_sprites() +{ + tarzan_decrypt_sprites(0x200000); + + // Overlay rom: + + const int rom_size = 0x80000; + u8 *rom = memregion("igs017_igs031:sprites")->base() + 0x200000; + std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(rom_size); + + // address lines swap + memcpy(tmp.get(), rom, rom_size); + for (int i = 0; i < rom_size; i++) + { + int addr = (i & ~0xffff) | bitswap<16>(i,15,14,13,12,11,10,9, 6,5, 8,7, 1,2,3,4, 0); + rom[i] = tmp[addr]; + } +} void igs017_state::init_happyskl() { - u8 *rom = memregion("maincpu")->base(); + const int rom_size = memregion("maincpu")->bytes(); + u8 * const rom = memregion("maincpu")->base(); - for (int i = 0; i < 0x40000; i++) + for (int i = 0; i < rom_size; i++) { u8 x = rom[i]; @@ -1066,7 +1393,7 @@ void igs017_state::init_happyskl() m_decrypted_opcodes[i] = x; } - for (int i = 0; i < 0x40000; i++) // adapted from starzan, seems ok + for (int i = 0; i < rom_size; i++) // adapted from starzan { u8 x = rom[i]; @@ -1082,15 +1409,17 @@ void igs017_state::init_happyskl() rom[i] = x; } - tarzan_decrypt_tiles(); // enough for chars + tarzan_decrypt_tiles(1); + starzan_decrypt_sprites(); } -void igs017_state::init_unkigs() +void igs017_state::init_cpoker2() { - u8 *rom = memregion("maincpu")->base(); + const int rom_size = memregion("maincpu")->bytes(); + u8 * const rom = memregion("maincpu")->base(); - for (int i = 0; i < 0x40000; i++) + for (int i = 0; i < rom_size; i++) { u8 x = rom[i]; @@ -1101,12 +1430,12 @@ void igs017_state::init_unkigs() if ((i & 0x00020) == 0x00020) x ^= 0x80; if ((i & 0x00260) == 0x00240) x ^= 0x80; - // this hasn't got split data / opcodes encryption like happyskl, but let's keep the same machine_config for easier testing - m_decrypted_opcodes[i] = x; + // this hasn't got split data / opcodes encryption rom[i] = x; } - tarzan_decrypt_tiles(); // enough for chars + tarzan_decrypt_tiles(1); + tarzan_decrypt_sprites(0); } @@ -1114,13 +1443,14 @@ void igs017_state::init_unkigs() void igs017_state::init_sdmg2() { - u16 *src = (u16 *)memregion("maincpu")->base(); - int rom_size = 0x80000; + const int rom_size = memregion("maincpu")->bytes(); + u16 * const rom = (u16 *)memregion("maincpu")->base(); + for (int i = 0; i < rom_size / 2; i++) { - u16 x = src[i]; + u16 x = rom[i]; - /* bit 0 xor layer */ + // bit 0 xor layer if (i & 0x20/2) { @@ -1138,7 +1468,7 @@ void igs017_state::init_sdmg2() } } - /* bit 9 xor layer */ + // bit 9 xor layer if (i & 0x20000/2) { x ^= 0x0200; @@ -1151,13 +1481,13 @@ void igs017_state::init_sdmg2() } } - /* bit 12 xor layer */ + // bit 12 xor layer if (i & 0x20000/2) { x ^= 0x1000; } - src[i] = x; + rom[i] = x; } } @@ -1166,11 +1496,12 @@ void igs017_state::init_sdmg2() void igs017_state::init_mgdha() { - u16 *src = (u16 *)memregion("maincpu")->base(); - int rom_size = 0x80000; + const int rom_size = memregion("maincpu")->bytes(); + u16 * const rom = (u16 *)memregion("maincpu")->base(); + for (int i = 0; i < rom_size / 2; i++) { - u16 x = src[i]; + u16 x = rom[i]; if ((i & 0x20/2) && (i & 0x02/2)) { @@ -1189,44 +1520,53 @@ void igs017_state::init_mgdha() if ((i & 0x1000/2) || ((i & 0x4000/2) && (i & 0x40/2) && (i & 0x80/2)) || ((i & 0x2000/2) && (i & 0x400/2))) x ^= 0x0800; - src[i] = x; + rom[i] = x; } mgcs_flip_sprites(); + +// m_igs_string->dump("mgdh_string.key", 0x7b214, 0x7b128, true); // mgdh, mgdha (0x7c5ba, ???) +} + +void igs017_state::mgdh_patch_rom() +{ + u16 * const rom = (u16 *)memregion("maincpu")->base(); + + // game id check + rom[0x4ad50/2] = 0x4e71; } void igs017_state::init_mgdh() { init_mgdha(); - u16 *rom = (u16 *)memregion("maincpu")->base(); - - // additional protection - rom[0x4ad50/2] = 0x4e71; + mgdh_patch_rom(); } // lhzb2 +#if 0 void igs017_state::lhzb2_patch_rom() { - u16 *rom = (u16 *)memregion("maincpu")->base(); + u16 * const rom = (u16 *)memregion("maincpu")->base(); // Prot. checks: - rom[0x14786/2] = 0x6044; // 014786: 6744 beq $147cc + rom[0x14786/2] = 0x6044; // 014786: 6744 beq $147cc // ROM check: - rom[0x0b48a/2] = 0x604e; // 00B48A: 674E beq $b4da + rom[0x0b48a/2] = 0x604e; // 00B48A: 674E beq $b4da } +#endif void igs017_state::lhzb2_decrypt_tiles() { - int length = memregion("igs017_igs031:tilemaps")->bytes(); - u8 *rom = memregion("igs017_igs031:tilemaps")->base(); - std::vector<u8> tmp(length); + const int rom_size = memregion("igs017_igs031:tilemaps")->bytes(); + u8 * const rom = memregion("igs017_igs031:tilemaps")->base(); + std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(rom_size); - memcpy(&tmp[0], rom, length); - for (int i = 0; i < length; i++) + memcpy(&tmp[0], rom, rom_size); + for (int i = 0; i < rom_size; i++) { int addr = (i & ~0xffffff) | bitswap<24>(i,23,22,21,20,19,18,17,1,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,0); rom[i] = tmp[addr]; @@ -1235,42 +1575,38 @@ void igs017_state::lhzb2_decrypt_tiles() void igs017_state::lhzb2_decrypt_sprites() { - int length = memregion("igs017_igs031:sprites")->bytes(); - u8 *rom = memregion("igs017_igs031:sprites")->base(); - std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(length); + const int rom_size = memregion("igs017_igs031:sprites")->bytes(); + u8 * const rom = memregion("igs017_igs031:sprites")->base(); + std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(rom_size); // address lines swap - memcpy(tmp.get(), rom, length); - for (int i = 0; i < length; i++) + memcpy(tmp.get(), rom, rom_size); + for (int i = 0; i < rom_size; i++) { int addr = (i & ~0xffff) | bitswap<16>(i,15,14,13,6,7,10,9,8,11,12,5,4,3,2,1,0); rom[i] = tmp[addr]; } // data lines swap - for (int i = 0; i < length; i+=2) + for (int i = 0; i < rom_size; i+=2) { - u16 data = (rom[i+1] << 8) | rom[i+0]; // x-22222-11111-00000 + u16 data = (rom[i+1] << 8) | rom[i+0]; // x-22222-11111-00000 data = bitswap<16>(data, 15, 7,6,5,4,3, 2,1,0,14,13, 12,11,10,9,8); rom[i+0] = data; rom[i+1] = data >> 8; } } -void igs017_state::igs025_to_igs022_callback(void) -{ - m_igs022->IGS022_handle_command(); -} - void igs017_state::init_lhzb2() { - u16 *src = (u16 *) (memregion("maincpu")->base()); - int rom_size = 0x80000; + const int rom_size = memregion("maincpu")->bytes(); + u16 * const rom = (u16 *)memregion("maincpu")->base(); + for (int i = 0; i < rom_size / 2; i++) { - u16 x = src[i]; + u16 x = rom[i]; - /* bit 0 xor layer */ + // bit 0 xor layer if (i & 0x20/2) { if (i & 0x02/2) @@ -1287,7 +1623,7 @@ void igs017_state::init_lhzb2() } } - /* bit 13 xor layer */ + // bit 13 xor layer if (!(i & 0x1000/2)) { @@ -1341,18 +1677,15 @@ void igs017_state::init_lhzb2() } } - src[i] = x; + rom[i] = x; } lhzb2_decrypt_tiles(); lhzb2_decrypt_sprites(); - lhzb2_patch_rom(); - // install and configure protection device(s) -// m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xda5610, 0xda5613, read16_delegate(*m_igs025, FUNC(igs025_device::killbld_igs025_prot_r)), write16_delegate(*m_igs025, FUNC(igs025_device::killbld_igs025_prot_w))); -// m_igs025->m_kb_source_data = dw3_source_data; -// m_igs025->m_kb_source_data_offset = 0; -// m_igs025->m_kb_game_id = 0x00060000; +// lhzb2_patch_rom(); + +// m_igs_string->dump("lhzb2_string.key", 0x7b214, 0x7b128, true); } @@ -1360,13 +1693,14 @@ void igs017_state::init_lhzb2() void igs017_state::init_lhzb2a() { - u16 *src = (u16 *) (memregion("maincpu")->base()); - int rom_size = 0x80000; + const int rom_size = memregion("maincpu")->bytes(); + u16 * const rom = (u16 *)memregion("maincpu")->base(); + for (int i = 0; i < rom_size / 2; i++) { - u16 x = src[i]; + u16 x = rom[i]; - /* bit 0 xor layer */ + // bit 0 xor layer if (i & 0x20/2) { if (i & 0x02/2) @@ -1383,7 +1717,7 @@ void igs017_state::init_lhzb2a() } } - /* bit 5 xor layer */ + // bit 5 xor layer if (i & 0x4000/2) { @@ -1409,35 +1743,39 @@ void igs017_state::init_lhzb2a() } } - src[i] = x; + rom[i] = x; } lhzb2_decrypt_tiles(); lhzb2_decrypt_sprites(); + +// m_igs_string->dump("lhzb2a_string.key", 0x6e11c, 0x6e030, true); // same data as lhzb2 } // slqz2 +#if 0 void igs017_state::slqz2_patch_rom() { - u16 *rom = (u16 *)memregion("maincpu")->base(); + u16 * const rom = (u16 *)memregion("maincpu")->base(); // Prot. checks: - rom[0x1489c/2] = 0x6044; // 01489C: 6744 beq $148e2 + rom[0x1489c/2] = 0x6044; // 01489C: 6744 beq $148e2 // ROM check: - rom[0x0b77a/2] = 0x604e; // 00B77A: 674E beq $b7ca + rom[0x0b77a/2] = 0x604e; // 00B77A: 674E beq $b7ca } +#endif void igs017_state::slqz2_decrypt_tiles() { - int length = memregion("igs017_igs031:tilemaps")->bytes(); - u8 *rom = memregion("igs017_igs031:tilemaps")->base(); - std::vector<u8> tmp(length); + const int rom_size = memregion("igs017_igs031:tilemaps")->bytes(); + u8 * const rom = memregion("igs017_igs031:tilemaps")->base(); + std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(rom_size); - memcpy(&tmp[0],rom,length); - for (int i = 0; i < length; i++) + memcpy(&tmp[0], rom, rom_size); + for (int i = 0; i < rom_size; i++) { int addr = (i & ~0xff) | bitswap<8>(i,7,4,5,6,3,2,1,0); rom[i] = tmp[addr]; @@ -1446,13 +1784,14 @@ void igs017_state::slqz2_decrypt_tiles() void igs017_state::init_slqz2() { - u16 *src = (u16 *) (memregion("maincpu")->base()); - int rom_size = 0x80000; + const int rom_size = memregion("maincpu")->bytes(); + u16 * const rom = (u16 *)memregion("maincpu")->base(); + for (int i = 0; i < rom_size / 2; i++) { - u16 x = src[i]; + u16 x = rom[i]; - /* bit 0 xor layer */ + // bit 0 xor layer if (i & 0x20/2) { @@ -1470,7 +1809,7 @@ void igs017_state::init_slqz2() } } - /* bit 14 xor layer */ + // bit 14 xor layer if (i & 0x1000/2) { @@ -1514,18 +1853,15 @@ void igs017_state::init_slqz2() } } - src[i] = x; + rom[i] = x; } slqz2_decrypt_tiles(); lhzb2_decrypt_sprites(); - slqz2_patch_rom(); - // install and configure protection device(s) -// m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xda5610, 0xda5613, read16_delegate(*m_igs025, FUNC(igs025_device::killbld_igs025_prot_r)), write16_delegate(*m_igs025, FUNC(igs025_device::killbld_igs025_prot_w))); -// m_igs025->m_kb_source_data = dw3_source_data; -// m_igs025->m_kb_source_data_offset = 0; -// m_igs025->m_kb_game_id = 0x00060000; +// slqz2_patch_rom(); + +// m_igs_string->dump("slqz2_string.key", 0x7b214, 0x7b128, true); } @@ -1533,13 +1869,13 @@ void igs017_state::init_slqz2() void igs017_state::spkrform_decrypt_sprites() { - int length = memregion("igs017_igs031:sprites")->bytes(); - u8 *rom = memregion("igs017_igs031:sprites")->base(); - std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(length); + const int rom_size = memregion("igs017_igs031:sprites")->bytes(); + u8 * const rom = memregion("igs017_igs031:sprites")->base(); + std::unique_ptr<u8[]> tmp = std::make_unique<u8[]>(rom_size); // address lines swap - memcpy(tmp.get(), rom, length); - for (int i = 0; i < length; i++) + memcpy(tmp.get(), rom, rom_size); + for (int i = 0; i < rom_size; i++) { int addr; if (i & 0x80000) @@ -1551,55 +1887,77 @@ void igs017_state::spkrform_decrypt_sprites() } } +void igs017_state::spkrform_patch_rom() +{ + u8 * const rom = memregion("maincpu")->base(); + + rom[0x32ea9] = 0; // enable poker ($e9be = 0) + rom[0x32ef9] = 0; // start with poker ($e9bf = 0) +} + void igs017_state::init_spkrform() { decrypt_program_rom(0x14, 7, 6, 5, 4, 3, 0, 1, 2); spkrform_decrypt_sprites(); -} + spkrform_patch_rom(); + +// m_igs_string->dump("spkrform_string.key", 0x9dec, 0x9d00, false); +} /*************************************************************************** Memory Maps ***************************************************************************/ -// iqblocka, iqblockf, genius6 +// Common MUX maps -void igs017_state::iqblocka_map(address_map &map) +// 0x03 r, 0x40 - 0x47 w, 0x48 w, 0x50 w, 0x80 - 0x87 w, 0xa0 w +void igs017_state::igs_bitswap_mux_map(address_map &map) { - map(0x00000, 0x0dfff).rom(); - map(0x0e000, 0x0efff).ram(); - map(0x0f000, 0x0ffff).ram(); - map(0x10000, 0x3ffff).rom(); + map(0x03, 0x03).r(m_igs_bitswap, FUNC(igs_bitswap_device::result_r)); + map(0x40, 0x40).w(m_igs_bitswap, FUNC(igs_bitswap_device::word_w)); + map(0x41, 0x47).nopw(); + map(0x48, 0x48).w(m_igs_bitswap, FUNC(igs_bitswap_device::mode_f_w)); + map(0x50, 0x50).w(m_igs_bitswap, FUNC(igs_bitswap_device::mode_3_w)); + map(0x80, 0x87).w(m_igs_bitswap, FUNC(igs_bitswap_device::do_bitswap_w)); + map(0xa0, 0xa0).w(m_igs_bitswap, FUNC(igs_bitswap_device::reset_w)); } -void igs017_state::decrypted_opcodes_map(address_map &map) +// 0x05 r, 0x20 - 0x27 w, 0x40 r +void igs017_state::igs_string_mux_map(address_map &map) { - map(0x00000, 0x3ffff).rom().share("decrypted_opcodes"); + map(0x05, 0x05).r(m_igs_string, FUNC(igs_string_device::result_r)); + map(0x20, 0x27).w(m_igs_string, FUNC(igs_string_device::do_bitswap_w)); + map(0x40, 0x40).r(m_igs_string, FUNC(igs_string_device::advance_string_offs_r)); } -void igs017_state::input_select_w(u8 data) +// 0x20 - 0x34: read fixed data +void igs017_state::igs_fixed_data_mux_map(address_map &map) { - m_input_select = data; + map(0x20, 0x34).rom().region("igs_fixed_data", 0); + map(0x23, 0x23).unmapr(); + map(0x29, 0x29).unmapr(); + map(0x2f, 0x2f).unmapr(); } -void igs017_state::iqblocka_keyin_w(u8 data) + +// iqblocka, iqblockf, genius6 + +void igs017_state::iqblocka_map(address_map &map) { - machine().bookkeeping().coin_counter_w(0, data & 0x80); // key in (in gambling mode) -// popmessage("PORT0 %02X", data); - if (data & ~0x80) - logerror("%s: warning, unknown bits written in keyin_w = %02x\n", machine().describe_context(), data); + map(0x00000, 0x0dfff).rom(); + map(0x0e000, 0x0efff).ram(); + map(0x0f000, 0x0ffff).ram(); + map(0x10000, 0x3ffff).rom(); } -void igs017_state::iqblockf_keyout_w(u8 data) +void igs017_state::decrypted_opcodes_map(address_map &map) { - machine().bookkeeping().coin_counter_w(1, data & 0x80); // key out (in gambling mode, only iqblockf/genius6) -// popmessage("PORT1 %02X", data); - if (data & ~0x80) - logerror("%s: warning, unknown bits written in keyout_w = %02x\n", machine().describe_context(), data); + map(0x00000, 0x3ffff).readonly().share(m_decrypted_opcodes); } -void igs017_state::iqblocka_remap_addr_w(offs_t offset, u8 data) +void igs017_state::incdec_remap_addr_w(offs_t offset, u8 data) { if (offset == 0) { @@ -1612,7 +1970,7 @@ void igs017_state::iqblocka_remap_addr_w(offs_t offset, u8 data) prg_space.unmap_write(m_remap_addr + 0x3, m_remap_addr + 0x3); prg_space.unmap_read (m_remap_addr + 0x5, m_remap_addr + 0x5); - logerror("%s: incdec protection unmapped from %04x\n", machine().describe_context(), m_remap_addr); + LOGMASKED(LOG_PROT_REMAP, "%s: incdec protection unmapped from %04x\n", machine().describe_context(), m_remap_addr); } m_remap_addr = (m_remap_addr & 0xff00) | data; @@ -1626,22 +1984,21 @@ void igs017_state::iqblocka_remap_addr_w(offs_t offset, u8 data) prg_space.install_write_handler(m_remap_addr + 0x0, m_remap_addr + 0x0, write8smo_delegate(*m_igs_incdec, FUNC(igs_incdec_device::reset_w))); prg_space.install_write_handler(m_remap_addr + 0x1, m_remap_addr + 0x1, write8smo_delegate(*m_igs_incdec, FUNC(igs_incdec_device::dec_w))); prg_space.install_write_handler(m_remap_addr + 0x3, m_remap_addr + 0x3, write8smo_delegate(*m_igs_incdec, FUNC(igs_incdec_device::inc_w))); - prg_space.install_read_handler (m_remap_addr + 0x5, m_remap_addr + 0x5, read8smo_delegate (*m_igs_incdec, FUNC(igs_incdec_device::val_r))); + prg_space.install_read_handler (m_remap_addr + 0x5, m_remap_addr + 0x5, read8smo_delegate (*m_igs_incdec, FUNC(igs_incdec_device::result_r))); - logerror("%s: incdec protection remapped at %04x\n", machine().describe_context(), m_remap_addr); + LOGMASKED(LOG_PROT_REMAP, "%s: incdec protection remapped at %04x\n", machine().describe_context(), m_remap_addr); } } void igs017_state::iqblocka_io(address_map &map) { map(0x0000, 0x7fff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)); - map(0x0000, 0x003f).ram(); // internal regs - map(0x2010, 0x2011).w(FUNC(igs017_state::iqblocka_remap_addr_w)); + map(0x2010, 0x2011).w(FUNC(igs017_state::incdec_remap_addr_w)); - map(0x8000, 0x8000).w ("igs_bitswap", FUNC(igs_bitswap_device::address_w)); - map(0x8001, 0x8001).rw("igs_bitswap", FUNC(igs_bitswap_device::data_r), FUNC(igs_bitswap_device::data_w)); + map(0x8000, 0x8000).w (m_igs_mux, FUNC(igs_mux_device::address_w)); + map(0x8001, 0x8001).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)); map(0x9000, 0x9000).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); @@ -1650,6 +2007,230 @@ void igs017_state::iqblocka_io(address_map &map) map(0xb000, 0xb001).w("ymsnd", FUNC(ym2413_device::write)); } +void igs017_state::iqblocka_mux_map(address_map &map) +{ + map(0x00, 0x00).portr("PLAYER1").w(NAME((&igs017_state::counter_w<7, 0x7f, 0>))); // coin in + map(0x01, 0x01).portr("PLAYER2"); + map(0x02, 0x02).portr("COINS"); + + igs_bitswap_mux_map(map); // 0x03 r, 0x40 - 0x47 w, 0x48 w, 0x50 w, 0x80 - 0x87 w, 0xa0 w + + igs_fixed_data_mux_map(map); // 0x20 - 0x34: read fixed data +} + +void igs017_state::iqblockf_mux_map(address_map &map) +{ + iqblocka_mux_map(map); + + map(0x01, 0x01).w(NAME((&igs017_state::counter_w<7, 0x7f, 1>))); // coin out (in gambling mode, only iqblockf/genius6) +} + +// starzan + +void igs017_state::starzan_io(address_map &map) +{ + map(0x0000, 0x7fff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)); + map(0x0000, 0x003f).ram(); // internal regs + + map(0x2010, 0x2011).w(FUNC(igs017_state::incdec_remap_addr_w)); + + map(0x8000, 0x8000).w (m_igs_mux, FUNC(igs_mux_device::address_w)); + map(0x8001, 0x8001).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)); + + map(0x9000, 0x9000).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); +} + +// cpoker2, happyksl, starzan +void igs017_state::starzan_counter_w(u8 data) +{ + // BIT(data, 0) // always on in cpoker2/happyskl? + m_hopper->motor_w( BIT(data, 1)); // hopper + // BIT(data, 2) // unused? + machine().bookkeeping().coin_counter_w(0, BIT(data, 3)); // key out + machine().bookkeeping().coin_counter_w(1, BIT(data, 4)); // payout + machine().bookkeeping().coin_counter_w(2, BIT(data, 5)); // coin C + machine().bookkeeping().coin_counter_w(3, BIT(data, 6)); // key in + machine().bookkeeping().coin_counter_w(4, BIT(data, 7)); // coin A +// popmessage("COUNTER %02X", data); + if (BIT(data, 2)) + logerror("%s: warning, unknown bits written in counter_w = %02x\n", machine().describe_context(), data); +} + +void igs017_state::starzan_lamps_sound_w(u8 data) +{ + m_lamps[0] = BIT(data, 2); // stop 1 + m_lamps[1] = BIT(data, 0); // stop 2 + m_lamps[2] = BIT(data, 4); // stop 3 + m_lamps[3] = BIT(data, 1); // stop 4 + m_lamps[4] = BIT(data, 3); // bet/stop + m_lamps[5] = BIT(data, 5); // start +// BIT(data, 6); // unused? + m_oki->set_rom_bank(BIT(data, 7)); + +// popmessage("LAMPS/SOUND %02X", data); + + if (BIT(data, 6)) + logerror("%s: warning, unknown bits written in lamps_sound_w = %02x\n", machine().describe_context(), data); +} + +void igs017_state::starzan_mux_map(address_map &map) +{ + map(0x00, 0x00).w(FUNC(igs017_state::starzan_counter_w)); + map(0x01, 0x01).portr("PLAYER2"); + map(0x02, 0x02).w(FUNC(igs017_state::starzan_lamps_sound_w)); + map(0x03, 0x03).w(FUNC(igs017_state::dsw_select_w)); + + igs_string_mux_map(map); // 0x05 r, 0x20 - 0x27 w, 0x40 r +} + + +// happyksl + +void igs017_state::happyskl_io(address_map &map) +{ + map(0x0000, 0x7fff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)); + map(0x0000, 0x003f).ram(); // internal regs + + map(0x8000, 0x8000).w (m_igs_mux, FUNC(igs_mux_device::address_w)); + map(0x8001, 0x8001).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)); + + map(0x9000, 0x9000).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); +} + +void igs017_state::happyskl_lamps_sound_w(u8 data) +{ + m_lamps[0] = BIT(data, 4); // hold 1 + m_lamps[1] = BIT(data, 0); // hold 2 + m_lamps[2] = BIT(data, 1); // hold 3 + m_lamps[3] = BIT(data, 2); // hold 4 + m_lamps[4] = BIT(data, 3); // hold 5 + m_lamps[5] = BIT(data, 5); // start +// BIT(data, 6); // unused? + m_oki->set_rom_bank(BIT(data, 7)); + +// popmessage("LAMPS/SOUND %02X", data); + + if (BIT(data, 6)) + logerror("%s: warning, unknown bits written in lamps_sound_w = %02x\n", machine().describe_context(), data); +} + +void igs017_state::happyskl_mux_map(address_map &map) +{ + map(0x00, 0x00).w(FUNC(igs017_state::starzan_counter_w)); + map(0x01, 0x01).portr("PLAYER2"); + map(0x02, 0x02).w(FUNC(igs017_state::happyskl_lamps_sound_w)); + map(0x03, 0x03).w(FUNC(igs017_state::dsw_select_w)); +} + + +// cpoker2 + +void igs017_state::cpoker2_map(address_map &map) +{ + iqblocka_map(map); + + map(0x0a400, 0x0a400).w(m_igs_inc, FUNC(igs_inc_device::inc_w)); + map(0x0a420, 0x0a420).w(m_igs_inc, FUNC(igs_inc_device::reset_w)); + map(0x0a460, 0x0a460).r(m_igs_inc, FUNC(igs_inc_device::result_r)); +} + +void igs017_state::cpoker2_io(address_map &map) +{ + map(0x0000, 0x7fff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)); + map(0x0000, 0x003f).ram(); // internal regs + + map(0x2010, 0x2011).w(FUNC(igs017_state::incdec_remap_addr_w)); + + map(0x8000, 0x8000).w (m_igs_mux, FUNC(igs_mux_device::address_w)); + map(0x8001, 0x8001).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)); + + map(0x9000, 0x9000).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); +} + +void igs017_state::cpoker2_lamps_sound_w(u8 data) +{ + m_lamps[0] = BIT(data, 0); // hold 1 + m_lamps[1] = BIT(data, 1); // hold 2 + m_lamps[2] = BIT(data, 4); // hold 3 + m_lamps[3] = BIT(data, 2); // hold 4 + m_lamps[4] = BIT(data, 3); // hold 5 + m_lamps[5] = BIT(data, 5); // start +// BIT(data, 6); // unused? + m_oki->set_rom_bank(BIT(data, 7)); + +// popmessage("LAMPS/SOUND %02X", data); + + if (BIT(data, 6)) + logerror("%s: warning, unknown bits written in lamps_sound_w = %02x\n", machine().describe_context(), data); +} + +void igs017_state::cpoker2_mux_map(address_map &map) +{ + map(0x00, 0x00).w(FUNC(igs017_state::starzan_counter_w)); + map(0x01, 0x01).portr("PLAYER2"); + map(0x02, 0x02).w(FUNC(igs017_state::cpoker2_lamps_sound_w)); + map(0x03, 0x03).w(FUNC(igs017_state::dsw_select_w)); +} + + +// tarzan + +void igs017_state::tarzan_incdec_remap_addr_w(offs_t offset, u8 data) +{ + incdec_remap_addr_w(offset, data ^ ((offset == 1) ? 0x40 : 0)); +} + +void igs017_state::tarzan_io(address_map &map) +{ + starzan_io(map); + + map(0x2010, 0x2011).w(FUNC(igs017_state::tarzan_incdec_remap_addr_w)); +} + +u8 igs017_state::tarzan_keys_joy_r() +{ + if (BIT(m_input_select, 3, 5) == 0x1f) return m_io_joy->read(); // f8 (joystick mode) + + u8 ret = 0xff; + if (!BIT(m_input_select, 3)) ret &= m_io_key[0]->read(); // f0 (keyboard mode) + if (!BIT(m_input_select, 4)) ret &= m_io_key[1]->read(); // e8 "" + if (!BIT(m_input_select, 5)) ret &= m_io_key[2]->read(); // d8 "" + if (!BIT(m_input_select, 6)) ret &= m_io_key[3]->read(); // b8 "" + if (!BIT(m_input_select, 7)) ret &= m_io_key[4]->read(); // 78 "" (unused) + return ret; +} + +void igs017_state::tarzan_counter_w(u8 data) +{ + m_hopper->motor_w( BIT(data, 1)); // hopper + machine().bookkeeping().coin_counter_w(0, BIT(data, 2)); // key out + machine().bookkeeping().coin_counter_w(1, BIT(data, 3)); // key in +// popmessage("COUNTER %02X", data); + if (data & ~0x0c) + logerror("%s: warning, unknown bits written in counter_w = %02x\n", machine().describe_context(), data); +} + +void igs017_state::tarzan_dsw_sound_w(u8 data) +{ + // bits 0,1,2: DSW select + // bit 7: Sound bank + m_dsw_select = data; + m_oki->set_rom_bank(BIT(data, 7)); +// popmessage("DSW %02X", data); + if (data & ~0x87) + logerror("%s: warning, unknown bits written in dsw_sound_w = %02x\n", machine().describe_context(), data); +} + +void igs017_state::tarzan_mux_map(address_map &map) +{ + map(0x00, 0x00).w(FUNC(igs017_state::input_select_w<0x07>)); + map(0x01, 0x01).w(FUNC(igs017_state::tarzan_counter_w)); + map(0x02, 0x02).r(FUNC(igs017_state::dsw_r)); + map(0x03, 0x03).w(FUNC(igs017_state::tarzan_dsw_sound_w)); + + igs_string_mux_map(map); // 0x05 r, 0x20 - 0x27 w, 0x40 r +} + // mgcs @@ -1657,23 +2238,23 @@ void igs017_state::iqblocka_io(address_map &map) // Sound banking and DSW are accessed through it. It also performs some game specific calculations. void igs017_state::mgcs_igs029_run() { - logerror("%s: running igs029 command ", machine().describe_context()); + LOGMASKED(LOG_PROT_IGS029, "%s: running igs029 command ", machine().describe_context()); for (int i = 0; i < m_igs029_send_len; i++) - logerror("%02x ", m_igs029_send_buf[i]); + LOGMASKED(LOG_PROT_IGS029, "%02x ", m_igs029_send_buf[i]); - if (m_igs029_send_buf[0] == 0x05 && m_igs029_send_buf[1] == 0x5a) + if (m_igs029_send_buf[0] == 0x05 && m_igs029_send_buf[1] == 0x5a) // 'Z' { u8 data = m_igs029_send_buf[2]; u8 port = m_igs029_send_buf[3]; - logerror("PORT %02x = %02x\n", port, data); + LOGMASKED(LOG_PROT_IGS029, "PORT %02x = %02x\n", port, data); switch (port) { case 0x01: - m_oki->set_rom_bank((data >> 4) & 1); - machine().bookkeeping().coin_counter_w(0, (~data) & 0x20); // coin in - machine().bookkeeping().coin_counter_w(1, (~data) & 0x40); // coin out + m_oki->set_rom_bank( BIT(data, 4)); // oki + machine().bookkeeping().coin_counter_w(0, !BIT(data, 5)); // coin in + machine().bookkeeping().coin_counter_w(1, !BIT(data, 6)); // coin out // popmessage("PORT1 %02X", data); @@ -1699,9 +2280,9 @@ void igs017_state::mgcs_igs029_run() m_igs029_recv_len = 0; m_igs029_recv_buf[m_igs029_recv_len++] = 0x01; } - else if (m_igs029_send_buf[0] == 0x03 && m_igs029_send_buf[1] == 0x55) + else if (m_igs029_send_buf[0] == 0x03 && m_igs029_send_buf[1] == 0x55) // 'U' { - logerror("MIN BET?\n"); + LOGMASKED(LOG_PROT_IGS029, "MIN BET?\n"); // No inputs. Returns 1 long @@ -1714,26 +2295,22 @@ void igs017_state::mgcs_igs029_run() m_igs029_recv_buf[m_igs029_recv_len++] = min_bets[ (~m_io_dsw[1]->read()) & 3 ]; m_igs029_recv_buf[m_igs029_recv_len++] = 0x05; } - else if (m_igs029_send_buf[0] == 0x03 && m_igs029_send_buf[1] == 0x39) + else if (m_igs029_send_buf[0] == 0x03 && m_igs029_send_buf[1] == 0x39) // '9' { - logerror("READ DSW\n"); + LOGMASKED(LOG_PROT_IGS029, "READ DSW\n"); - u8 ret; - if (~m_dsw_select & 0x01) ret = m_io_dsw[0]->read(); - else if (~m_dsw_select & 0x02) ret = m_io_dsw[1]->read(); - else - { - logerror("%s: warning, reading dsw with dsw_select = %02x\n", machine().describe_context(), m_dsw_select); - ret = 0xff; - } + u8 ret = 0xff; + if (!BIT(m_dsw_select, 0)) ret &= m_io_dsw[0]->read(); + else if (!BIT(m_dsw_select, 1)) ret &= m_io_dsw[1]->read(); + else logerror("%s: warning, reading dsw with dsw_select = %02x\n", machine().describe_context(), m_dsw_select); m_igs029_recv_len = 0; m_igs029_recv_buf[m_igs029_recv_len++] = ret; m_igs029_recv_buf[m_igs029_recv_len++] = 0x02; } - else if (m_igs029_send_buf[0] == 0x07 && m_igs029_send_buf[1] == 0x2c) + else if (m_igs029_send_buf[0] == 0x07 && m_igs029_send_buf[1] == 0x2c) // ',' { - logerror("?? (2C)\n"); // ?? + LOGMASKED(LOG_PROT_IGS029, "?? (2C)\n"); // ?? // 4 inputs. Returns 1 long @@ -1743,12 +2320,12 @@ void igs017_state::mgcs_igs029_run() m_igs029_recv_buf[m_igs029_recv_len++] = 0x00; m_igs029_recv_buf[m_igs029_recv_len++] = 0x00; m_igs029_recv_buf[m_igs029_recv_len++] = 0x00; - m_igs029_recv_buf[m_igs029_recv_len++] = 0x01; // ?? + m_igs029_recv_buf[m_igs029_recv_len++] = 0x01; // ?? m_igs029_recv_buf[m_igs029_recv_len++] = 0x05; } else if (m_igs029_send_buf[0] == 0x07 && m_igs029_send_buf[1] == 0x15) { - logerror("SET LONG\n"); + LOGMASKED(LOG_PROT_IGS029, "SET LONG\n"); m_igs029_mgcs_long = (m_igs029_send_buf[2] << 24) | (m_igs029_send_buf[3] << 16) | (m_igs029_send_buf[4] << 8) | m_igs029_send_buf[5]; @@ -1757,7 +2334,7 @@ void igs017_state::mgcs_igs029_run() } else if (m_igs029_send_buf[0] == 0x03 && m_igs029_send_buf[1] == 0x04) { - logerror("GET LONG\n"); + LOGMASKED(LOG_PROT_IGS029, "GET LONG\n"); m_igs029_recv_len = 0; m_igs029_recv_buf[m_igs029_recv_len++] = (m_igs029_mgcs_long >> 0) & 0xff; @@ -1768,7 +2345,7 @@ void igs017_state::mgcs_igs029_run() } else { - logerror("UNKNOWN\n"); + LOGMASKED(LOG_PROT_IGS029, "UNKNOWN\n"); m_igs029_recv_len = 0; m_igs029_recv_buf[m_igs029_recv_len++] = 0x01; @@ -1777,394 +2354,234 @@ void igs017_state::mgcs_igs029_run() m_igs029_send_len = 0; } -void igs017_state::magic_w(offs_t offset, u16 data, u16 mem_mask) -{ - COMBINE_DATA(&m_igs_magic); -} - -u16 igs017_state::magic_r() +void igs017_state::mgcs_keys_hopper_igs029_w(u8 data) { - return m_igs_magic; -} + // 7654 3--- Keys + // ---- -2-- IRQ on IGS029 + // ---- --1- + // ---- ---0 Hopper Motor + const bool igs029_irq = !BIT(m_input_select, 2) && BIT(data, 2); // 0 -> 1 + m_input_select = data; + m_hopper->motor_w(BIT(data, 0)); -void igs017_state::mgcs_magic_w(offs_t offset, u16 data, u16 mem_mask) -{ - switch (m_igs_magic) + if (igs029_irq) { - case 0x00: - if (ACCESSING_BITS_0_7) - { - bool igs029_irq = !(m_input_select & 0x04) && (data & 0x04); // 0->1 - - // 7654 3--- Keys - // ---- -2-- IRQ on IGS029 - // ---- --1- - // ---- ---0 Hopper Motor - m_input_select = data & 0xff; - - m_hopperdev->motor_w(BIT(data, 0)); - - if (igs029_irq) - { - if (!m_igs029_recv_len) - { - // SEND - if (m_igs029_send_len < sizeof(m_igs029_send_buf)) - m_igs029_send_buf[m_igs029_send_len++] = m_igs029_send_data; - - logerror("%s: igs029 send ", machine().describe_context()); - for (int i = 0; i < m_igs029_send_len; i++) - logerror("%02x ", m_igs029_send_buf[i]); - logerror("\n"); - - if (m_igs029_send_buf[0] == m_igs029_send_len) - mgcs_igs029_run(); - } - - if (m_igs029_recv_len) - { - // RECV - logerror("%s: igs029 recv ", machine().describe_context()); - for (int i = 0; i < m_igs029_recv_len; i++) - logerror("%02x ", m_igs029_recv_buf[i]); - logerror("\n"); - - if (m_igs029_recv_len) - --m_igs029_recv_len; - - m_igs029_recv_data = m_igs029_recv_buf[m_igs029_recv_len]; - } - } - } - - if (m_input_select & ~0xfd) - logerror("%s: warning, unknown bits written in input_select = %02x\n", machine().describe_context(), m_input_select); - - break; - - case 0x01: - if (ACCESSING_BITS_0_7) - { - m_scramble_data = data & 0xff; -// logerror("%s: writing %02x to igs_magic = %02x\n", machine().describe_context(), data & 0xff, m_igs_magic); - } - break; - - // case 0x02: ? - - case 0x03: - if (ACCESSING_BITS_0_7) - { - m_igs029_send_data = data & 0xff; -// logerror("%s: writing %02x to igs_magic = %02x\n", machine().describe_context(), data & 0xff, m_igs_magic); - } - break; + if (!m_igs029_recv_len) + { + // SEND + if (m_igs029_send_len < sizeof(m_igs029_send_buf)) + m_igs029_send_buf[m_igs029_send_len++] = m_igs029_send_data; - default: - logerror("%s: warning, writing to igs_magic %02x = %02x\n", machine().describe_context(), m_igs_magic, data); - } -} + LOGMASKED(LOG_PROT_IGS029, "%s: igs029 send", machine().describe_context()); + for (int i = 0; i < m_igs029_send_len; i++) + LOGMASKED(LOG_PROT_IGS029, " %02x", m_igs029_send_buf[i]); + LOGMASKED(LOG_PROT_IGS029, "\n"); -u16 igs017_state::mgcs_magic_r() -{ - switch (m_igs_magic) - { - case 0x00: - return m_input_select | 0x02; - - case 0x01: - { - u16 ret = bitswap<8>( (bitswap<8>(m_scramble_data, 0,1,2,3,4,5,6,7) + 1) & 3, 4,5,6,7, 0,1,2,3); - logerror("%s: reading %02x from igs_magic = %02x\n", machine().describe_context(), ret, m_igs_magic); - return ret; + if (m_igs029_send_buf[0] == m_igs029_send_len) + mgcs_igs029_run(); } - case 0x02: + if (m_igs029_recv_len) { - u8 ret = m_igs029_recv_data; - logerror("%s: reading %02x from igs_magic = %02x\n", machine().describe_context(), ret, m_igs_magic); - return ret; - } + // RECV + LOGMASKED(LOG_PROT_IGS029, "%s: igs029 recv", machine().describe_context()); + for (int i = 0; i < m_igs029_recv_len; i++) + LOGMASKED(LOG_PROT_IGS029, " %02x", m_igs029_recv_buf[i]); + LOGMASKED(LOG_PROT_IGS029, "\n"); -// case 0x05: ??? + if (m_igs029_recv_len) + --m_igs029_recv_len; - default: - logerror("%s: warning, reading with igs_magic = %02x\n", machine().describe_context(), m_igs_magic); - break; + m_igs029_recv_data = m_igs029_recv_buf[m_igs029_recv_len]; + } } - return 0xffff; + if (m_input_select & ~0xfd) + logerror("%s: warning, unknown bits written in input_select = %02x\n", machine().describe_context(), m_input_select); } -u8 igs017_state::mgcs_keys_r() +void igs017_state::mgcs_scramble_data_w(u8 data) { - if (~m_input_select & 0x08) return m_io_key[0]->read(); - if (~m_input_select & 0x10) return m_io_key[1]->read(); - if (~m_input_select & 0x20) return m_io_key[2]->read(); - if (~m_input_select & 0x40) return m_io_key[3]->read(); - if (~m_input_select & 0x80) return m_io_key[4]->read(); - - logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select); - return 0xff; + m_scramble_data = data; + LOGMASKED(LOG_PROT_SCRAMBLE, "%s: writing scrambled data %02x to igs_mux\n", machine().describe_context(), data); } -void igs017_state::mgcs_map(address_map &map) +u8 igs017_state::mgcs_scramble_data_r() { - map(0x000000, 0x07ffff).rom(); - map(0x300000, 0x303fff).ram(); - map(0x49c000, 0x49c001).rw(FUNC(igs017_state::magic_r), FUNC(igs017_state::magic_w)); - map(0x49c002, 0x49c003).rw(FUNC(igs017_state::mgcs_magic_r), FUNC(igs017_state::mgcs_magic_w)); - - map(0xa00000, 0xa0ffff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)).umask16(0x00ff); - - map(0xa12001, 0xa12001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - // oki banking through protection (code at $1a350)? + u8 ret = bitswap<8>( (bitswap<8>(m_scramble_data, 0,1,2,3,4,5,6,7) + 1) & 3, 4,5,6,7, 0,1,2,3 ); + LOGMASKED(LOG_PROT_SCRAMBLE, "%s: reading scrambled data %02x from igs_mux\n", machine().describe_context(), ret); + return ret; } - -// sdmg2 - -u8 igs017_state::sdmg2_keys_r() +u8 igs017_state::mgcs_igs029_data_r() { - if (~m_input_select & 0x01) return m_io_key[0]->read(); - if (~m_input_select & 0x02) return m_io_key[1]->read(); - if (~m_input_select & 0x04) return m_io_key[2]->read(); - if (~m_input_select & 0x08) return m_io_key[3]->read(); - if (~m_input_select & 0x10) return m_io_key[4]->read(); + u8 ret = m_igs029_recv_data; + LOGMASKED(LOG_PROT_IGS029, "%s: reading IGS029 data %02x from igs_mux\n", machine().describe_context(), ret); + return ret; +} - if (m_input_select == 0x1f) return m_io_key[0]->read(); // in joystick mode +void igs017_state::mgcs_igs029_data_w(u8 data) +{ + m_igs029_send_data = data; + LOGMASKED(LOG_PROT_IGS029, "%s: writing %02x to igs_mux\n", machine().describe_context(), data & 0xff); +} - logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select); - return 0xff; +u8 igs017_state::mgcs_keys_joy_r() +{ + u8 ret = 0xff; + if (!BIT(m_input_select, 0, 3)) ret &= (m_io_joy->read() | 0x3f); // f8 (joystick mode, top 2 bits) + if (!BIT(m_input_select, 3)) ret &= m_io_key[0]->read(); // f7 (keyboard mode) + if (!BIT(m_input_select, 4)) ret &= m_io_key[1]->read(); // ef "" + if (!BIT(m_input_select, 5)) ret &= m_io_key[2]->read(); // df "" + if (!BIT(m_input_select, 6)) ret &= m_io_key[3]->read(); // bf "" + if (!BIT(m_input_select, 7)) ret &= m_io_key[4]->read(); // f7 "" + return ret; } -void igs017_state::sdmg2_magic_w(offs_t offset, u16 data, u16 mem_mask) +void igs017_state::mgcs_map(address_map &map) { - switch (m_igs_magic) - { - // case 0x00: ? 0x80 + map(0x000000, 0x07ffff).rom(); + map(0x300000, 0x303fff).ram(); - case 0x01: - if (ACCESSING_BITS_0_7) - { - m_input_select = data & 0x1f; - machine().bookkeeping().coin_counter_w(0, data & 0x20); - // coin out data & 0x40 - m_hopper = data & 0x80; - } - break; + map(0x49c000, 0x49c001).nopr().w(m_igs_mux, FUNC(igs_mux_device::address_w)).umask16(0x00ff); // clr.w dummy read + map(0x49c002, 0x49c003).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)).umask16(0x00ff); - case 0x02: - if (ACCESSING_BITS_0_7) - { - m_oki->set_rom_bank((data >> 7) & 1); - } - break; + map(0xa00000, 0xa0ffff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)).umask16(0x00ff); - default: - logerror("%s: warning, writing to igs_magic %02x = %02x\n", machine().describe_context(), m_igs_magic, data); - } + map(0xa12001, 0xa12001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + // oki banking through protection (code at $1a350) } -u16 igs017_state::sdmg2_magic_r() +void igs017_state::mgcs_mux_map(address_map &map) { - switch (m_igs_magic) - { - case 0x00: - { - u16 hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001; - return m_io_coins->read() | hopper_bit; - } + map(0x00, 0x00).lr8(NAME([this](){ return m_input_select | 0x02; })).w(FUNC(igs017_state::mgcs_keys_hopper_igs029_w)); + map(0x01, 0x01).r(FUNC(igs017_state::mgcs_scramble_data_r)).w(FUNC(igs017_state::mgcs_scramble_data_w)); + map(0x02, 0x02).r(FUNC(igs017_state::mgcs_igs029_data_r)); + map(0x03, 0x03).w(FUNC(igs017_state::mgcs_igs029_data_w)); - case 0x02: - return sdmg2_keys_r(); + igs_string_mux_map(map); // 0x05 r, 0x20 - 0x27 w, 0x40 r +} - default: - logerror("%s: warning, reading with igs_magic = %02x\n", machine().describe_context(), m_igs_magic); - break; - } - return 0xffff; -} +// sdmg2 void igs017_state::sdmg2_map(address_map &map) { map(0x000000, 0x07ffff).rom(); + + // incdec protection + map(0x002001, 0x002001).w(m_igs_incdec, FUNC(igs_incdec_device::reset_w)); + map(0x002003, 0x002003).w(m_igs_incdec, FUNC(igs_incdec_device::dec_w)); + map(0x002007, 0x002007).w(m_igs_incdec, FUNC(igs_incdec_device::inc_w)); + map(0x00200b, 0x00200b).r(m_igs_incdec, FUNC(igs_incdec_device::result_r)); + map(0x1f0000, 0x1fffff).ram(); map(0x200000, 0x20ffff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)).umask16(0x00ff); map(0x210001, 0x210001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x300000, 0x300001).w(FUNC(igs017_state::magic_w)); - map(0x300002, 0x300003).rw(FUNC(igs017_state::sdmg2_magic_r), FUNC(igs017_state::sdmg2_magic_w)); -} - -// mgdh, mgdha + map(0x300000, 0x300001).nopr().w(m_igs_mux, FUNC(igs_mux_device::address_w)).umask16(0x00ff); // clr.w dummy read + map(0x300002, 0x300003).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)).umask16(0x00ff); +} -u8 igs017_state::mgdh_keys_r() +u8 igs017_state::sdmg2_keys_joy_r() { - if (~m_input_select & 0x04) return m_io_key[0]->read(); - if (~m_input_select & 0x08) return m_io_key[1]->read(); - if (~m_input_select & 0x10) return m_io_key[2]->read(); - if (~m_input_select & 0x20) return m_io_key[3]->read(); - if (~m_input_select & 0x40) return m_io_key[4]->read(); - - if ((m_input_select & 0xfc) == 0xfc) return m_io_dsw[0]->read(); - - logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select); - return 0xff; + if (BIT(m_input_select, 0, 5) == 0x1f) return m_io_joy->read(); // 1f/uninitialized in test screen (joystick mode) + + u8 ret = 0xff; + if (!BIT(m_input_select, 0)) ret &= m_io_key[0]->read(); // 1e (keyboard mode) + if (!BIT(m_input_select, 1)) ret &= m_io_key[1]->read(); // 1d "" + if (!BIT(m_input_select, 2)) ret &= m_io_key[2]->read(); // 1b "" + if (!BIT(m_input_select, 3)) ret &= m_io_key[3]->read(); // 17 "" + if (!BIT(m_input_select, 4)) ret &= m_io_key[4]->read(); // 0f "" + return ret; } -void igs017_state::mgdha_magic_w(offs_t offset, u16 data, u16 mem_mask) +void igs017_state::sdmg2_keys_hopper_w(u8 data) { - switch (m_igs_magic) - { - case 0x00: - if (ACCESSING_BITS_0_7) - { - // coin out data & 0x40 - machine().bookkeeping().coin_counter_w(0, data & 0x80); - } - - if (data & ~0xc0) - logerror("%s: warning, unknown bits written to igs_magic 00 = %02x\n", machine().describe_context(), data); - - break; - - case 0x01: - if (ACCESSING_BITS_0_7) - { - m_input_select = data & 0xff; - m_hopper = data & 0x01; - } - - if (m_input_select & ~0xfd) - logerror("%s: warning, unknown bits written in input_select = %02x\n", machine().describe_context(), m_input_select); - - break; - - case 0x03: - if (ACCESSING_BITS_0_7) - { - // bit 7? - m_oki->set_rom_bank((data >> 6) & 1); - } - break; - - default: -/* - 04aba0: warning, writing to igs_magic 08 = d0 - 04abb0: warning, writing to igs_magic 09 = 76 - 04abc0: warning, writing to igs_magic 0a = 97 - 04abd0: warning, writing to igs_magic 0b = bf - 04abe0: warning, writing to igs_magic 0c = ff - 04abf0: warning, writing to igs_magic 04 = 3f - 04ac00: warning, writing to igs_magic 05 = 82 - 04ac10: warning, writing to igs_magic 06 = ff - 04ac20: warning, writing to igs_magic 07 = 3f -*/ - logerror("%s: warning, writing to igs_magic %02x = %02x\n", machine().describe_context(), m_igs_magic, data); - } + m_input_select = BIT(data, 0, 5); // keys + machine().bookkeeping().coin_counter_w(0, BIT(data, 5)); // coin in + machine().bookkeeping().coin_counter_w(1, BIT(data, 6)); // coin out + m_hopper->motor_w( BIT(data, 7)); // hopper } -u16 igs017_state::mgdha_magic_r() +void igs017_state::sdmg2_mux_map(address_map &map) { - switch (m_igs_magic) - { - case 0x00: - return mgdh_keys_r(); - - case 0x01: - return m_io_buttons->read(); - - case 0x02: - return bitswap<8>(m_io_dsw[1]->read(), 0,1,2,3,4,5,6,7); - - case 0x03: - { - u16 hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001; - return m_io_coins->read() | hopper_bit; - } - - default: - logerror("%s: warning, reading with igs_magic = %02x\n", machine().describe_context(), m_igs_magic); - break; - } - - return 0xffff; + map(0x00, 0x00).portr("COINS"); + map(0x01, 0x01).w(FUNC(igs017_state::sdmg2_keys_hopper_w)); + map(0x02, 0x02).r(FUNC(igs017_state::sdmg2_keys_joy_r)).w(NAME((&igs017_state::oki_sound_bank_w<7, 0x7f>))); } -void igs017_state::mgdha_map(address_map &map) +// mgdh, mgdha + +void igs017_state::mgdh_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x600000, 0x603fff).ram(); - map(0x876000, 0x876001).w(FUNC(igs017_state::magic_w)); - map(0x876002, 0x876003).rw(FUNC(igs017_state::mgdha_magic_r), FUNC(igs017_state::mgdha_magic_w)); + + map(0x876000, 0x876001).nopr().w(m_igs_mux, FUNC(igs_mux_device::address_w)).umask16(0x00ff); // clr.w dummy read + map(0x876002, 0x876003).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)).umask16(0x00ff); map(0xa00000, 0xa0ffff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)).umask16(0x00ff); map(0xa10001, 0xa10001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); } +u8 igs017_state::mgdh_keys_r() +{ + u8 ret = 0xff; + if (!BIT(m_input_select, 2)) ret &= m_io_key[0]->read(); // f8 (keyboard mode / joystick mode) + if (!BIT(m_input_select, 3)) ret &= m_io_key[1]->read(); // f4 (keyboard mode) + if (!BIT(m_input_select, 4)) ret &= m_io_key[2]->read(); // ec "" + if (!BIT(m_input_select, 5)) ret &= m_io_key[3]->read(); // dc "" + if (!BIT(m_input_select, 6)) ret &= m_io_key[4]->read(); // bc "" + return ret; +} -// tjsb +void igs017_state::mgdh_keys_hopper_w(u8 data) +{ + m_input_select = data; + m_hopper->motor_w(BIT(data, 0)); -void igs017_state::tjsb_output_w(u8 data) + if (m_input_select & ~0xfd) + logerror("%s: warning, unknown bits written in keys_hopper_w = %02x\n", machine().describe_context(), data); +} + +void igs017_state::mgdh_counter_w(u8 data) { - switch (m_input_select) - { - case 0x00: - machine().bookkeeping().coin_counter_w(0, data & 0x80); // coin in - if (!(data & ~0x80)) - return; - break; - - case 0x01: - machine().bookkeeping().coin_counter_w(1, data & 0x01); // coin out - if (!(data & ~0x01)) - return; - break; + machine().bookkeeping().coin_counter_w(0, BIT(data, 6)); // coin out + machine().bookkeeping().coin_counter_w(1, BIT(data, 7)); // coin in - case 0x02: - m_oki->set_rom_bank((data >> 4) & 1); // oki bank (0x20/0x30) - if (!(data & ~0x30)) - return; - break; - - case 0x03: - m_hopper = data & 0x40; - if (!(data & ~0x40)) - return; - break; - } - logerror("%s: warning, writing to igs_magic %02x = %02x\n", machine().describe_context(), m_input_select, data); + if (data & ~0xc0) + logerror("%s: warning, unknown bits written in counter_w = %02x\n", machine().describe_context(), data); } -u8 igs017_state::tjsb_input_r() +void igs017_state::mgdha_mux_map(address_map &map) { - switch (m_input_select) - { - case 0x00: return m_io_player1->read(); - case 0x01: return m_io_player2->read(); - case 0x02: return m_io_coins->read(); - case 0x03: - { - u8 hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x00 : 0x20; - return m_io_hopper->read() | hopper_bit; - } + map(0x00, 0x00).r(FUNC(igs017_state::mgdh_keys_r)).w(FUNC(igs017_state::mgdh_counter_w)); + map(0x01, 0x01).portr("BUTTONS").w(FUNC(igs017_state::mgdh_keys_hopper_w)); + map(0x02, 0x02).lr8(NAME([this](){ return bitswap<8>(m_io_dsw[1]->read(), 0,1,2,3,4,5,6,7); })); + map(0x03, 0x03).portr("COINS").w(NAME((&igs017_state::oki_sound_bank_w<6, 0x3f>))); // bit 7? always on +} - default: - logerror("%s: input %02x read\n", machine().describe_context(), m_input_select); - return 0xff; - } +void igs017_state::mgdh_mux_map(address_map &map) +{ + mgdha_mux_map(map); + +// igs_string_mux_map(map); // 0x05 r, 0x20 - 0x27 w, 0x40 r (actually unused except for the game id check?) } + +// tjsb + void igs017_state::tjsb_map(address_map &map) { map(0x00000, 0x0dfff).rom(); - map(0x0e000, 0x0e000).w(FUNC(igs017_state::input_select_w)); - map(0x0e001, 0x0e001).rw(FUNC(igs017_state::tjsb_input_r), FUNC(igs017_state::tjsb_output_w)); + + map(0x0e000, 0x0e000).w (m_igs_mux, FUNC(igs_mux_device::address_w)); + map(0x0e001, 0x0e001).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)); + map(0x0e002, 0x0efff).ram(); map(0x0f000, 0x0ffff).ram(); map(0x10000, 0x3ffff).rom(); @@ -2173,7 +2590,6 @@ void igs017_state::tjsb_map(address_map &map) void igs017_state::tjsb_io(address_map &map) { map(0x0000, 0x7fff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)); - map(0x0000, 0x003f).ram(); // internal regs map(0x9000, 0x9000).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); @@ -2181,119 +2597,106 @@ void igs017_state::tjsb_io(address_map &map) map(0xb000, 0xb001).w("ymsnd", FUNC(ym2413_device::write)); } - -// spkrform - -void igs017_state::spkrform_map(address_map &map) +void igs017_state::tjsb_mux_map(address_map &map) { - map(0x00000, 0x0dfff).rom(); - map(0x0e000, 0x0efff).ram(); - map(0x0e9bf, 0x0e9bf).noprw(); // hack: uncomment to switch to Formosa - map(0x0f000, 0x0ffff).ram(); - map(0x10000, 0x3ffff).rom(); + map(0x00, 0x00).portr("PLAYER1").w(NAME((&igs017_state::counter_w<7, 0x7f, 0>))); // coin in + map(0x01, 0x01).portr("PLAYER2").w(NAME((&igs017_state::counter_w<0, 0xfe, 1>))); // coin out + map(0x02, 0x02).portr("COINS").w(NAME((&igs017_state::oki_sound_bank_w<4, 0xcf>))); // oki bank (0x20/0x30) + map(0x03, 0x03).portr("BUTTONS").w(NAME((&igs017_state::hopper_motor_w<6, 0xbf>))); + + // used ? + igs_string_mux_map(map); // 0x05 r, 0x20 - 0x27 w, 0x40 r } -u8 igs017_state::spkrform_input_r() -{ - switch (m_input_select) - { - case 0x00: return m_io_player1->read(); - case 0x01: return m_io_player2->read(); - case 0x02: return m_io_coins->read(); - case 0x03: - { - return m_io_buttons->read(); - } - default: - logerror("%s: input %02x read\n", machine().describe_context(), m_input_select); - return 0xff; - } -} +// spkrform void igs017_state::spkrform_io(address_map &map) { map(0x0000, 0x7fff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)); - map(0x0000, 0x003f).ram(); // internal regs + map(0x2010, 0x2011).w(FUNC(igs017_state::incdec_remap_addr_w)); + map(0x8000, 0x8000).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x9000, 0x9001).w("ymsnd", FUNC(ym2413_device::write)); - map(0xa000, 0xa000).portr("A000"); // Game selection - map(0xa001, 0xa001).portr("A001"); +// map(0xa000, 0xa0??).ram(); // read/written during poker game enabling at boot (patched out) - map(0xb000, 0xb000).w(FUNC(igs017_state::input_select_w)); - map(0xb001, 0xb001).r(FUNC(igs017_state::spkrform_input_r)); + map(0xb000, 0xb000).w (m_igs_mux, FUNC(igs_mux_device::address_w)); + map(0xb001, 0xb001).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)); +} + +void igs017_state::spkrform_mux_map(address_map &map) +{ + map(0x00, 0x00).portr("PLAYER1").w(NAME((&igs017_state::counter_w<7, 0x7f, 0>))); // coin in + map(0x01, 0x01).portr("PLAYER2").w(NAME((&igs017_state::counter_w<7, 0x7f, 1>))); // coin out + map(0x02, 0x02).portr("COINS").w(NAME((&igs017_state::hopper_motor_w<4, 0xef>))); // bit 5 is related to poker game enabling + map(0x03, 0x03).portr("BUTTONS"); + + igs_string_mux_map(map); // 0x05 r, 0x20 - 0x27 w, 0x40 r } // lhzb2 -void igs017_state::lhzb2_magic_w(offs_t offset, u16 data, u16 mem_mask) +void igs017_state::lhzb2_map(address_map &map) { - switch (m_igs_magic) - { - case 0x00: - if (ACCESSING_BITS_0_7) - { - m_input_select = data & 0xff; - } + map(0x000000, 0x07ffff).rom(); - if (m_input_select & ~0x1f) - logerror("%s: warning, unknown bits written in input_select = %02x\n", machine().describe_context(), m_input_select); - break; + map(0x100000, 0x103fff).ram().share("igs022:sharedprotram"); // Shared with protection device - case 0x01: - if (ACCESSING_BITS_0_7) - { - m_oki->set_rom_bank((data >> 7) & 1); + map(0x500000, 0x503fff).ram(); - if (data & 0x7f) - logerror("%s: warning, unknown bits written in oki bank = %04x\n", machine().describe_context(), data); - } - break; + map(0x910000, 0x910001).nopr().w(m_igs_mux, FUNC(igs_mux_device::address_w)).umask16(0x00ff); // clr.w dummy read + map(0x910002, 0x910003).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)).umask16(0x00ff); - default: - logerror("%s: warning, writing to igs_magic %02x = %02x\n", machine().describe_context(), m_igs_magic, data); - } + map(0xb00000, 0xb0ffff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)).umask16(0x00ff); + + map(0xb10001, 0xb10001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); } -u16 igs017_state::lhzb2_magic_r() +u8 igs017_state::lhzb2_keys_r() { - switch (m_igs_magic) - { - case 0x01: - { - if (~m_input_select & 0x01) return m_io_key[0]->read(); - if (~m_input_select & 0x02) return m_io_key[1]->read(); - if (~m_input_select & 0x04) return m_io_key[2]->read(); - if (~m_input_select & 0x08) return m_io_key[3]->read(); - if (~m_input_select & 0x10) return m_io_key[4]->read(); - - logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select); - return 0xffff; - } + u8 ret = 0xff; + if (!BIT(m_input_select, 0)) ret &= m_io_key[0]->read(); + if (!BIT(m_input_select, 1)) ret &= m_io_key[1]->read(); + if (!BIT(m_input_select, 2)) ret &= m_io_key[2]->read(); + if (!BIT(m_input_select, 3)) ret &= m_io_key[3]->read(); + if (!BIT(m_input_select, 4)) ret &= m_io_key[4]->read(); + return ret; +} - default: - logerror("%s: warning, reading with igs_magic = %02x\n", machine().describe_context(), m_igs_magic); - break; - } +void igs017_state::lhzb2_keys_hopper_w(u8 data) +{ + m_input_select = BIT(data, 0, 5); // keys + m_hopper->motor_w( BIT(data, 5)); // hopper + machine().bookkeeping().coin_counter_w(1, BIT(data, 6)); // coin out counter + machine().bookkeeping().coin_counter_w(0, BIT(data, 7)); // coin in counter +} - return 0xffff; +u8 igs017_state::lhzb2_scramble_data_r() +{ + u8 ret = bitswap<8>(m_scramble_data, 0,1,2,3,4,5,6,7); + LOGMASKED(LOG_PROT_SCRAMBLE, "%s: reading scrambled data %02x from igs_mux\n", machine().describe_context(), ret); + return ret; } -void igs017_state::lhzb2_map(address_map &map) +void igs017_state::lhzb2_igs022_execute_w(u8 data) { - map(0x000000, 0x07ffff).rom(); - map(0x500000, 0x503fff).ram(); - map(0x910000, 0x910001).w(FUNC(igs017_state::magic_w)); - map(0x910002, 0x910003).rw(FUNC(igs017_state::lhzb2_magic_r), FUNC(igs017_state::lhzb2_magic_w)); + m_oki->set_rom_bank(BIT(data, 7)); + igs022_execute_w<6, 0x3f>(data); +} - map(0xb00000, 0xb0ffff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)).umask16(0x00ff); +void igs017_state::lhzb2_mux_map(address_map &map) +{ + map(0x00, 0x00).w(FUNC(igs017_state::lhzb2_keys_hopper_w)); + map(0x01, 0x01).r(FUNC(igs017_state::lhzb2_keys_r)).w(FUNC(igs017_state::lhzb2_igs022_execute_w)); + map(0x02, 0x02).r(FUNC(igs017_state::lhzb2_scramble_data_r)); + map(0x03, 0x03).w(FUNC(igs017_state::mgcs_scramble_data_w)); - map(0xb10001, 0xb10001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + igs_string_mux_map(map); // 0x05 r, 0x20 - 0x27 w, 0x40 r } @@ -2302,28 +2705,16 @@ void igs017_state::lhzb2_map(address_map &map) u16 igs017_state::lhzb2a_input_r(offs_t offset) { - switch (offset*2) + switch (offset * 2) { - case 0x00: // Keys - { - if (~m_input_select & 0x01) return m_io_key[0]->read() << 8; - if (~m_input_select & 0x02) return m_io_key[1]->read() << 8; - if (~m_input_select & 0x04) return m_io_key[2]->read() << 8; - if (~m_input_select & 0x08) return m_io_key[3]->read() << 8; - if (~m_input_select & 0x10) return m_io_key[4]->read() << 8; - - logerror("%s: warning, reading key with input_select = %02x\n", machine().describe_context(), m_input_select); - return 0xffff; - } + case 0x00: // Keys + return (lhzb2_keys_r() << 8) | 0xff; case 0x02: - { - u16 hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x0000 : 0x0002; - return (m_io_dsw[0]->read() << 8) | m_io_coins->read() | hopper_bit; - } + return (m_io_dsw[0]->read() << 8) | m_io_coins->read(); case 0x04: - return m_io_dsw[1]->read(); + return 0xff00 | m_io_dsw[1]->read(); } return 0xffff; @@ -2333,7 +2724,7 @@ u16 igs017_state::lhzb2a_input_r(offs_t offset) An address base register (xx = F0 at reset) determines where the bitswap protection device, as well as game inputs and the address base register itself are mapped in memory: - inputs are mapped at xx8000, protection at xx4000 and base register at xxc000. + inputs are mapped at xx8000, protection at xx4000 and address base register at xxc000. ***************************************************************************/ @@ -2352,30 +2743,30 @@ void igs017_state::lhzb2a_remap_addr_w(address_space &space, u16 data) m_remap_addr = data & 0xff; // Add new memory ranges - space.install_write_handler (m_remap_addr * 0x10000 + 0x4001, m_remap_addr * 0x10000 + 0x4001, write8smo_delegate(*m_igs_bitswap, FUNC(igs_bitswap_device::address_w))); - space.install_readwrite_handler(m_remap_addr * 0x10000 + 0x4003, m_remap_addr * 0x10000 + 0x4003, read8smo_delegate (*m_igs_bitswap, FUNC(igs_bitswap_device::data_r)), write8smo_delegate(*m_igs_bitswap, FUNC(igs_bitswap_device::data_w))); + space.install_write_handler (m_remap_addr * 0x10000 + 0x4001, m_remap_addr * 0x10000 + 0x4001, write8smo_delegate(*m_igs_mux, FUNC(igs_mux_device::address_w))); + space.install_readwrite_handler(m_remap_addr * 0x10000 + 0x4003, m_remap_addr * 0x10000 + 0x4003, read8smo_delegate (*m_igs_mux, FUNC(igs_mux_device::data_r)), write8smo_delegate(*m_igs_mux, FUNC(igs_mux_device::data_w))); space.install_read_handler (m_remap_addr * 0x10000 + 0x8000, m_remap_addr * 0x10000 + 0x8005, read16sm_delegate (*this, FUNC(igs017_state::lhzb2a_input_r))); space.install_write_handler (m_remap_addr * 0x10000 + 0xc000, m_remap_addr * 0x10000 + 0xc001, write16mo_delegate(*this, FUNC(igs017_state::lhzb2a_remap_addr_w))); - logerror("%s: inputs and protection remapped at %02xxxxx\n", machine().describe_context(), m_remap_addr); + LOGMASKED(LOG_PROT_REMAP, "%s: inputs and protection remapped at %02xxxxx\n", machine().describe_context(), m_remap_addr); } -void igs017_state::lhzb2a_input_select_w(offs_t offset, u16 data, u16 mem_mask) +void igs017_state::lhzb2a_keys_hopper_w(offs_t offset, u16 data, u16 mem_mask) { if (ACCESSING_BITS_0_7) { - m_input_select = data & 0x1f; // keys - m_hopper = data & 0x20; // hopper motor - machine().bookkeeping().coin_counter_w(1, data & 0x40); // coin out counter - machine().bookkeeping().coin_counter_w(0, data & 0x80); // coin in counter + m_input_select = BIT(data, 0, 5); // keys + m_hopper->motor_w( BIT(data, 5)); // hopper + machine().bookkeeping().coin_counter_w(0, BIT(data, 6)); // coin out counter + machine().bookkeeping().coin_counter_w(1, BIT(data, 7)); // coin in counter } if (ACCESSING_BITS_8_15) { - m_oki->set_rom_bank((data >> 8) & 1); + m_oki->set_rom_bank(BIT(data, 7)); if (data & 0xfe00) - logerror("%s: warning, unknown bits written in input_select = %04x\n", machine().describe_context(), data); + logerror("%s: warning, unknown bits written in keys_hopper_w = %04x\n", machine().describe_context(), data); } } @@ -2384,10 +2775,10 @@ void igs017_state::lhzb2a_map(address_map &map) map(0x000000, 0x07ffff).rom(); // incdec protection - map(0x003200, 0x003201).w(m_igs_incdec, FUNC(igs_incdec_device::reset_w)); - map(0x003202, 0x003203).w(m_igs_incdec, FUNC(igs_incdec_device::dec_w)); - map(0x003206, 0x003207).w(m_igs_incdec, FUNC(igs_incdec_device::inc_w)); - map(0x00320a, 0x00320b).r(m_igs_incdec, FUNC(igs_incdec_device::val_r)); + map(0x003201, 0x003201).w(m_igs_incdec, FUNC(igs_incdec_device::reset_w)); + map(0x003203, 0x003203).w(m_igs_incdec, FUNC(igs_incdec_device::dec_w)); + map(0x003207, 0x003207).w(m_igs_incdec, FUNC(igs_incdec_device::inc_w)); + map(0x00320b, 0x00320b).r(m_igs_incdec, FUNC(igs_incdec_device::result_r)); map(0x500000, 0x503fff).ram(); // map(0x910000, 0x910003) accesses appear to be from leftover code where the final checks were disabled @@ -2395,78 +2786,65 @@ void igs017_state::lhzb2a_map(address_map &map) map(0xb00000, 0xb0ffff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)).umask16(0x00ff); map(0xb10001, 0xb10001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0xb12000, 0xb12001).w(FUNC(igs017_state::lhzb2a_input_select_w)); - // Inputs dynamically mapped at xx8000, protection at xx4000 (xx = f0 initially). xx written to xxc000 -} + map(0xb12000, 0xb12001).w(FUNC(igs017_state::lhzb2a_keys_hopper_w)); + // Inputs dynamically mapped at xx8000, protection at xx4000 (xx = f0 initially). xx written to xxc000 +} -// slqz2 - -void igs017_state::slqz2_magic_w(offs_t offset, u16 data, u16 mem_mask) +void igs017_state::lhzb2a_mux_map(address_map &map) { - switch (m_igs_magic) - { - case 0x00: - if (ACCESSING_BITS_0_7) - { - m_oki->set_rom_bank(data & 0x01); - -// m_hopper = data & 0x20; // hopper motor -// machine().bookkeeping().coin_counter_w(1, data & 0x40); // coin out counter - machine().bookkeeping().coin_counter_w(0, data & 0x80); // coin in counter + igs_bitswap_mux_map(map); // 0x03 r, 0x40 - 0x47 w, 0x48 w, 0x50 w, 0x80 - 0x87 w, 0xa0 w - if (data & 0x7e) - logerror("%s: warning, unknown bits written in oki bank = %04x\n", machine().describe_context(), data); - } - break; - - default: - logerror("%s: warning, writing to igs_magic %02x = %02x\n", machine().describe_context(), m_igs_magic, data); - } + // used ? + igs_string_mux_map(map); // 0x05 r, 0x20 - 0x27 w, 0x40 r } -u16 igs017_state::slqz2_magic_r() -{ - switch (m_igs_magic) - { - case 0x00: - return m_io_player2->read(); - case 0x01: - return m_io_player1->read(); - case 0x02: - return m_io_buttons->read(); - - default: - logerror("%s: warning, reading with igs_magic = %02x\n", machine().describe_context(), m_igs_magic); - break; - } - return 0xffff; -} +// slqz2 void igs017_state::slqz2_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x100000, 0x103fff).ram(); - map(0x602000, 0x602001).w(FUNC(igs017_state::magic_w)); - map(0x602002, 0x602003).rw(FUNC(igs017_state::slqz2_magic_r), FUNC(igs017_state::slqz2_magic_w)); + + map(0x300000, 0x303fff).ram().share("igs022:sharedprotram"); // Shared with protection device + + map(0x602000, 0x602001).nopr().w(m_igs_mux, FUNC(igs_mux_device::address_w)).umask16(0x00ff); // clr.w dummy read + map(0x602002, 0x602003).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)).umask16(0x00ff); map(0x900000, 0x90ffff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)).umask16(0x00ff); map(0x910001, 0x910001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); } -u8 igs017_state::i8255_port_c_mux_r() +void igs017_state::slqz2_sound_hopper_w(u8 data) { - switch(m_i8255_portc_mux) - { - case 0x01: return m_io_dsw[2]->read(); - case 0x02: return m_io_dsw[1]->read(); - case 0x03: return m_io_dsw[0]->read(); - } + m_oki->set_rom_bank( BIT(data, 0)); + // + m_hopper->motor_w( BIT(data, 5)); // hopper + machine().bookkeeping().coin_counter_w(1, BIT(data, 6)); // coin out counter + machine().bookkeeping().coin_counter_w(0, BIT(data, 7)); // coin in counter + + if (data & 0x1e) + logerror("%s: warning, unknown bits written in sound_hopper_w = %04x\n", machine().describe_context(), data); +} + +u8 igs017_state::slqz2_scramble_data_r() +{ + u8 ret = m_scramble_data; + LOGMASKED(LOG_PROT_SCRAMBLE, "%s: reading scrambled data %02x from igs_mux\n", machine().describe_context(), ret); + return ret; +} + +void igs017_state::slqz2_mux_map(address_map &map) +{ + map(0x00, 0x00).portr("PLAYER2").w(FUNC(igs017_state::slqz2_sound_hopper_w)); + map(0x01, 0x01).portr("PLAYER1").w(NAME((&igs017_state::igs022_execute_w<6, 0xbf>))); + map(0x02, 0x02).r(FUNC(igs017_state::slqz2_scramble_data_r)); + map(0x03, 0x03).w(FUNC(igs017_state::mgcs_scramble_data_w)); - return 0xff; + igs_string_mux_map(map); // 0x05 r, 0x20 - 0x27 w, 0x40 r } @@ -2476,16 +2854,16 @@ u8 igs017_state::i8255_port_c_mux_r() static INPUT_PORTS_START( iqblocka ) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "Hold Mode" ) + PORT_DIPNAME( 0x02, 0x02, "Hold Mode" ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x02, "In Win" ) PORT_DIPSETTING( 0x00, "Always" ) - PORT_DIPNAME( 0x04, 0x04, "Max Credit" ) + PORT_DIPNAME( 0x04, 0x04, "Max Credit" ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x04, "4000" ) PORT_DIPSETTING( 0x00, DEF_STR( None ) ) - PORT_DIPNAME( 0x38, 0x38, "Cigarette Bet" ) + PORT_DIPNAME( 0x38, 0x38, "Cigarette Bet" ) PORT_DIPLOCATION("SW1:4,5,6") PORT_DIPSETTING( 0x38, "1" ) PORT_DIPSETTING( 0x30, "10" ) PORT_DIPSETTING( 0x28, "20" ) @@ -2494,14 +2872,14 @@ static INPUT_PORTS_START( iqblocka ) PORT_DIPSETTING( 0x10, "100" ) PORT_DIPSETTING( 0x08, "120" ) PORT_DIPSETTING( 0x00, "150" ) - PORT_DIPNAME( 0xc0, 0xc0, "Min Bet" ) + PORT_DIPNAME( 0xc0, 0xc0, "Minimum Bet" ) PORT_DIPLOCATION("SW1:7,8") PORT_DIPSETTING( 0xc0, "1" ) PORT_DIPSETTING( 0x80, "10" ) PORT_DIPSETTING( 0x40, "20" ) PORT_DIPSETTING( 0x00, "50" ) PORT_START("DSW2") - PORT_DIPNAME( 0x07, 0x07, "Key In" ) + PORT_DIPNAME( 0x07, 0x07, "Key In" ) PORT_DIPLOCATION("SW2:1,2,3") PORT_DIPSETTING( 0x07, "10" ) PORT_DIPSETTING( 0x06, "20" ) PORT_DIPSETTING( 0x05, "40" ) @@ -2510,63 +2888,63 @@ static INPUT_PORTS_START( iqblocka ) PORT_DIPSETTING( 0x02, "200" ) PORT_DIPSETTING( 0x01, "250" ) PORT_DIPSETTING( 0x00, "500" ) - PORT_DIPNAME( 0x08, 0x08, "Key Out" ) + PORT_DIPNAME( 0x08, 0x08, "Key Out" ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x08, "10" ) PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x10, 0x10, "Open Mode" ) - PORT_DIPSETTING( 0x10, "Gaming" ) + PORT_DIPNAME( 0x10, 0x10, "Open Mode" ) PORT_DIPLOCATION("SW2:5") + PORT_DIPSETTING( 0x10, "Gaming (Gambling)" ) PORT_DIPSETTING( 0x00, "Amuse" ) - PORT_DIPNAME( 0x20, 0x00, "Demo Game" ) + PORT_DIPNAME( 0x20, 0x00, "Demo Game" ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0xc0, 0xc0, "Bonus Base" ) + PORT_DIPNAME( 0xc0, 0xc0, "Bonus Base" ) PORT_DIPLOCATION("SW2:7,8") PORT_DIPSETTING( 0xc0, "100" ) PORT_DIPSETTING( 0x80, "200" ) PORT_DIPSETTING( 0x40, "300" ) PORT_DIPSETTING( 0x00, "400" ) PORT_START("DSW3") - PORT_DIPNAME( 0x03, 0x03, "Win Up Pool" ) + PORT_DIPNAME( 0x03, 0x03, "Win Up Pool" ) PORT_DIPLOCATION("SW3:1,2") PORT_DIPSETTING( 0x03, "300" ) PORT_DIPSETTING( 0x02, "500" ) PORT_DIPSETTING( 0x01, "800" ) PORT_DIPSETTING( 0x00, "1000" ) - PORT_DIPNAME( 0x0c, 0x0c, "Max Double Up" ) + PORT_DIPNAME( 0x0c, 0x0c, "Max Double Up" ) PORT_DIPLOCATION("SW3:3,4") PORT_DIPSETTING( 0x0c, "20000" ) PORT_DIPSETTING( 0x08, "30000" ) PORT_DIPSETTING( 0x04, "40000" ) PORT_DIPSETTING( 0x00, "50000" ) - PORT_DIPNAME( 0x10, 0x10, "Cards" ) + PORT_DIPNAME( 0x10, 0x10, "Number Type" ) PORT_DIPLOCATION("SW3:5") PORT_DIPSETTING( 0x10, "A,J,Q,K" ) PORT_DIPSETTING( 0x00, "Number" ) - PORT_DIPNAME( 0x20, 0x20, "Title Name" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Double Up" ) + PORT_DIPNAME( 0x20, 0x20, "Show Title" ) PORT_DIPLOCATION("SW3:6") + PORT_DIPSETTING( 0x20, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPNAME( 0x40, 0x40, "Double Up" ) PORT_DIPLOCATION("SW3:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "CG Select" ) + PORT_DIPNAME( 0x80, 0x80, "CG Select" ) PORT_DIPLOCATION("SW3:8") // Switches CG ROM (sprites). Unpopulated in this set PORT_DIPSETTING( 0x80, DEF_STR( Low ) ) PORT_DIPSETTING( 0x00, DEF_STR( High ) ) PORT_START("PLAYER1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME( "Start" ) // start, in videogame mode (keep pressed while booting for DSW and inputs test) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) // start, in videogame mode (keep pressed while booting for DSW and inputs test) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME( "Down / Collect Win" ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_NAME("%p Down / Collect Win") PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Hold 1 / Big / Help" ) // help = next tile becomes a wildcard (in videogame mode) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Hold 2 / Double Up" ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Hold 1 / Big / Help") // (1P A in test mode) help = next tile becomes a wildcard (in videogame mode) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Hold 2 / Double Up") // (1P B in test mode) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("PLAYER2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME( "Play / Last Bet" ) // play current bet or, if null, bet as last time (2P C in test mode) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Deal / Last Bet") // play current bet or, if null, the last bet (START2 in test mode) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) // unused? shown in test mode PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) // "" PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // "" PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // "" - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME( "Hold 4 / Half Double" ) // (2P A in test mode) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME( "Hold 5 / Tile in Double Up?" ) // (2P B in test mode) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Hold 4 / Half Double") // (2P A in test mode) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Hold 5 / Tile in Double Up?") // (2P B in test mode) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("COINS") @@ -2577,15 +2955,15 @@ static INPUT_PORTS_START( iqblocka ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW ) // keep pressed while booting - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME( "Toggle Gambling" ) // this toggles between videogame and gambling + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Toggle Gambling") // this toggles between videogame and gambling PORT_START("BUTTONS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Hold 3 / Small" ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // no coin. Hopper sensor? impulse prevents coin error in gambling mode (1P D in test mode) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) // unused? (1P E in test mode) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 ) PORT_NAME( "Bet" ) // Bet 1 credit (2P C in test mode) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) // unused? (2P D in test mode) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) // unused? (2P E in test mode) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Hold 3 / Small") // (1P C in test mode) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // no coin. Hopper sensor? impulse prevents coin error in gambling mode (1P D in test mode) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) // unused? (1P E in test mode) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) // Bet 1 credit (2P C in test mode) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) // unused? (2P D in test mode) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) // unused? (2P E in test mode) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END @@ -2594,195 +2972,200 @@ static INPUT_PORTS_START( iqblockf ) PORT_INCLUDE( iqblocka ) PORT_MODIFY("DSW1") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "Hold Mode" ) + PORT_DIPNAME( 0x02, 0x02, "Hold Mode" ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x02, "In Win" ) PORT_DIPSETTING( 0x00, "Always" ) - PORT_DIPNAME( 0x0c, 0x0c, "Coin In" ) + PORT_DIPNAME( 0x0c, 0x0c, "Coin In" ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x0c, "1" ) PORT_DIPSETTING( 0x08, "5" ) PORT_DIPSETTING( 0x04, "10" ) PORT_DIPSETTING( 0x00, "20" ) - PORT_DIPNAME( 0x30, 0x30, "Key In" ) + PORT_DIPNAME( 0x30, 0x30, "Key In" ) PORT_DIPLOCATION("SW1:5,6") PORT_DIPSETTING( 0x30, "10" ) PORT_DIPSETTING( 0x20, "100" ) PORT_DIPSETTING( 0x10, "200" ) PORT_DIPSETTING( 0x00, "500" ) - PORT_DIPNAME( 0xc0, 0xc0, "Min Bet" ) + PORT_DIPNAME( 0xc0, 0xc0, "Minimum Bet" ) PORT_DIPLOCATION("SW1:7,8") PORT_DIPSETTING( 0xc0, "1" ) PORT_DIPSETTING( 0x80, "2" ) PORT_DIPSETTING( 0x40, "5" ) PORT_DIPSETTING( 0x00, "10" ) PORT_MODIFY("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Max Bet" ) + PORT_DIPNAME( 0x03, 0x03, "Max Bet" ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, "5" ) PORT_DIPSETTING( 0x02, "10" ) PORT_DIPSETTING( 0x01, "20" ) PORT_DIPSETTING( 0x00, "50" ) - PORT_DIPNAME( 0x04, 0x04, "Register" ) + PORT_DIPNAME( 0x04, 0x04, "Register" ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "Key Out Base" ) + PORT_DIPNAME( 0x08, 0x08, "Key Out Base" ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x08, "1" ) PORT_DIPSETTING( 0x00, "10" ) - PORT_DIPNAME( 0x10, 0x10, "Open Mode" ) - PORT_DIPSETTING( 0x10, "Gaming" ) + PORT_DIPNAME( 0x10, 0x10, "Open Mode" ) PORT_DIPLOCATION("SW2:5") + PORT_DIPSETTING( 0x10, "Gaming (Gambling)" ) PORT_DIPSETTING( 0x00, "Amuse" ) - PORT_DIPNAME( 0x20, 0x00, "Demo Game" ) + PORT_DIPNAME( 0x20, 0x00, "Demo Game" ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPUNUSED( 0x40, 0x40 ) - PORT_DIPUNUSED( 0x80, 0x80 ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) PORT_MODIFY("DSW3") - PORT_DIPUNUSED( 0x01, 0x01 ) - PORT_DIPUNUSED( 0x02, 0x02 ) - PORT_DIPUNUSED( 0x04, 0x04 ) - PORT_DIPUNUSED( 0x08, 0x08 ) - PORT_DIPNAME( 0x10, 0x10, "Cards" ) + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPNAME( 0x10, 0x10, "Number Type" ) PORT_DIPLOCATION("SW3:5") PORT_DIPSETTING( 0x10, "A,J,Q,K" ) PORT_DIPSETTING( 0x00, "Number" ) - PORT_DIPUNUSED( 0x20, 0x20 ) - PORT_DIPUNUSED( 0x40, 0x40 ) - PORT_DIPNAME( 0x80, 0x80, "CG Select" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPNAME( 0x80, 0x80, "CG Select" ) PORT_DIPLOCATION("SW3:8") // Switches CG ROM (sprites). Unpopulated in this set PORT_DIPSETTING( 0x80, DEF_STR( Low ) ) PORT_DIPSETTING( 0x00, DEF_STR( High ) ) PORT_MODIFY("PLAYER2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME( "Play / Last Bet / Toggle Gambling (8 Times)" ) // play current bet or, if null, bet as last time (2P C in test mode) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Deal / Last Bet / Toggle Gambling (8 Times)") // play current bet or, if null, bet as last time (START2 in test mode) PORT_MODIFY("COINS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // impulse prevents coin error in gambling mode PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) - // - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME( "Start Gambling Toggle" ) // this starts toggling between videogame and gambling + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW ) // book-keeping after switching to gambling (TEST in test mode) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Start Gambling Toggle (Then Deal x 8)") // this starts toggling between videogame and gambling PORT_MODIFY("BUTTONS") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // (2P E in test mode) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // (1P E in test mode) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // (2P E in test mode) INPUT_PORTS_END static INPUT_PORTS_START( genius6 ) PORT_INCLUDE( iqblockf ) PORT_MODIFY("DSW1") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "Auto Hold" ) + PORT_DIPNAME( 0x02, 0x02, "Auto Hold" ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x02, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x0c, 0x0c, "Coin In" ) + PORT_DIPNAME( 0x0c, 0x0c, "Coin In" ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x0c, "1" ) PORT_DIPSETTING( 0x08, "10" ) PORT_DIPSETTING( 0x04, "20" ) PORT_DIPSETTING( 0x00, "50" ) - PORT_DIPNAME( 0x30, 0x30, "Key In" ) + PORT_DIPNAME( 0x30, 0x30, "Key In" ) PORT_DIPLOCATION("SW1:5,6") PORT_DIPSETTING( 0x30, "10" ) PORT_DIPSETTING( 0x20, "100" ) PORT_DIPSETTING( 0x10, "200" ) PORT_DIPSETTING( 0x00, "500" ) - PORT_DIPNAME( 0xc0, 0xc0, "Min Bet" ) + PORT_DIPNAME( 0xc0, 0xc0, "Minimum Bet" ) PORT_DIPLOCATION("SW1:7,8") PORT_DIPSETTING( 0xc0, "1" ) PORT_DIPSETTING( 0x80, "2" ) PORT_DIPSETTING( 0x40, "5" ) PORT_DIPSETTING( 0x00, "10" ) PORT_MODIFY("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Max Bet" ) + PORT_DIPNAME( 0x03, 0x03, "Max Bet" ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, "5" ) PORT_DIPSETTING( 0x02, "10" ) PORT_DIPSETTING( 0x01, "20" ) PORT_DIPSETTING( 0x00, "50" ) - PORT_DIPUNUSED( 0x04, 0x04 ) - PORT_DIPNAME( 0x08, 0x08, "Key Out" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPNAME( 0x08, 0x08, "Key Out" ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x08, "1" ) PORT_DIPSETTING( 0x00, "10" ) - PORT_DIPNAME( 0x10, 0x10, "Open Mode" ) - PORT_DIPSETTING( 0x10, "Gaming" ) + PORT_DIPNAME( 0x10, 0x10, "Open Mode" ) PORT_DIPLOCATION("SW2:5") + PORT_DIPSETTING( 0x10, "Gaming (Gambling)" ) PORT_DIPSETTING( 0x00, "Amuse" ) - PORT_DIPNAME( 0x20, 0x00, "Demo Game" ) + PORT_DIPNAME( 0x20, 0x00, "Demo Game" ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPUNUSED( 0x40, 0x40 ) - PORT_DIPUNUSED( 0x80, 0x80 ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) PORT_MODIFY("DSW3") - PORT_DIPUNUSED( 0x01, 0x01 ) - PORT_DIPUNUSED( 0x02, 0x02 ) - PORT_DIPUNUSED( 0x04, 0x04 ) - PORT_DIPUNUSED( 0x08, 0x08 ) - PORT_DIPNAME( 0x10, 0x10, "Cards" ) + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW3:1" ) // the input test screen prints garbage when not all off + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) // "" + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW3:3" ) // "" + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) // "" + PORT_DIPNAME( 0x10, 0x10, "Number Type" ) PORT_DIPLOCATION("SW3:5") PORT_DIPSETTING( 0x10, "A,J,Q,K" ) PORT_DIPSETTING( 0x00, "Number" ) - PORT_DIPUNUSED( 0x20, 0x20 ) - PORT_DIPUNUSED( 0x40, 0x40 ) - PORT_DIPUNUSED( 0x80, 0x80 ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" ) PORT_MODIFY("PLAYER2") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME( "Hold 5" ) // (2P B in test mode) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) // (2P B in test mode) INPUT_PORTS_END static INPUT_PORTS_START( lhzb2 ) PORT_START("DSW1") - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) + PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x0c, "10" ) PORT_DIPSETTING( 0x08, "20" ) PORT_DIPSETTING( 0x04, "50" ) PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) + PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x10, "1000" ) PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0x20, 0x20, "Money Type" ) + PORT_DIPNAME( 0x20, 0x20, "Money Type" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) + PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x40, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x80, DEF_STR( On ) ) PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Min Bet" ) + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, "500" ) PORT_DIPSETTING( 0x02, "1000" ) PORT_DIPSETTING( 0x01, "1500" ) PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0c, "1" ) - PORT_DIPSETTING( 0x08, "2" ) - PORT_DIPSETTING( 0x04, "3" ) - PORT_DIPSETTING( 0x00, "5" ) - PORT_DIPNAME( 0x10, 0x10, "Bonus Round" ) + PORT_DIPNAME( 0x0c, 0x0c, "Minimum Bet" ) PORT_DIPLOCATION("SW2:3,4") + PORT_DIPSETTING( 0x0c, "1 (1)" ) + PORT_DIPSETTING( 0x08, "1 (2)" ) + PORT_DIPSETTING( 0x04, "1 (3)" ) + PORT_DIPSETTING( 0x00, "1 (4)" ) + PORT_DIPNAME( 0x10, 0x10, "Bonus Round" ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x20, 0x20, "Number Type" ) + PORT_DIPNAME( 0x20, 0x20, "Number Type" ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x20, "Number" ) PORT_DIPSETTING( 0x00, "Dice" ) - PORT_DIPNAME( 0x40, 0x40, "Symbols" ) + PORT_DIPNAME( 0x40, 0x40, "Symbols" ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) // pigs, apples - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) // pigs, apples + PORT_DIPNAME( 0x80, 0x80, "Hide Gambling" ) PORT_DIPLOCATION("SW2:8") // press "Hide Gambling" to hide credits and bets PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) // hopper switch (unimplemented) - PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // service mode (keep pressed during boot too) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Statistics") // press with the above for sound test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 ) // ? (shown in service mode) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("KEY0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) @@ -2836,175 +3219,94 @@ static INPUT_PORTS_START( lhzb2 ) INPUT_PORTS_END static INPUT_PORTS_START( lhzb2a ) - PORT_START("DSW1") - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) - PORT_DIPSETTING( 0x0c, "10" ) - PORT_DIPSETTING( 0x08, "20" ) - PORT_DIPSETTING( 0x04, "50" ) - PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) - PORT_DIPSETTING( 0x10, "1000" ) - PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0x20, 0x20, "Money Type" ) - PORT_DIPSETTING( 0x20, "Coins" ) - PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) - PORT_DIPSETTING( 0x40, "Coins" ) - PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Min Bet" ) - PORT_DIPSETTING( 0x03, "500" ) - PORT_DIPSETTING( 0x02, "1000" ) - PORT_DIPSETTING( 0x01, "1500" ) - PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0c, "1" ) - PORT_DIPSETTING( 0x08, "2" ) - PORT_DIPSETTING( 0x04, "3" ) - PORT_DIPSETTING( 0x00, "5" ) - PORT_DIPNAME( 0x10, 0x10, "Bonus Round" ) - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x20, 0x20, "Number Type" ) - PORT_DIPSETTING( 0x20, "Number" ) - PORT_DIPSETTING( 0x00, "Dice" ) - PORT_DIPNAME( 0x40, 0x40, "Symbols" ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) // pigs, apples - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) // hopper switch - PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Statistics") // press with the above for sound test - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 ) // shown in test mode - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_INCLUDE( lhzb2 ) - PORT_START("KEY0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_MODIFY("COINS") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( mgcs ) - // DSWs are read through a protection device (IGS029). See code at 1CF16 + // DSWs are read through a protection device (IGS029). See code at $1cf16 - PORT_START("DSW1") // $3009e2 - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) + PORT_START("DSW1") // $3009e2 + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) + PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x0c, "10" ) PORT_DIPSETTING( 0x08, "20" ) PORT_DIPSETTING( 0x04, "50" ) PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) + PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x10, "500" ) PORT_DIPSETTING( 0x00, "1000" ) - PORT_DIPNAME( 0x20, 0x20, "Money Type" ) + PORT_DIPNAME( 0x20, 0x20, "Money Type" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) + PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x40, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x80, 0x80, "Double Up Limit" ) + PORT_DIPNAME( 0x80, 0x80, "Double Up Limit" ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x80, "1000" ) PORT_DIPSETTING( 0x00, "2000" ) - PORT_START("DSW2") // $3009e3 - PORT_DIPNAME( 0x03, 0x03, "Min Bet" ) + PORT_START("DSW2") // $3009e3 + PORT_DIPNAME( 0x03, 0x03, "Minimum Bet" ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, "1" ) PORT_DIPSETTING( 0x02, "2" ) PORT_DIPSETTING( 0x01, "3" ) PORT_DIPSETTING( 0x00, "5" ) - PORT_DIPNAME( 0x04, 0x04, "Double Up" ) + PORT_DIPNAME( 0x04, 0x04, "Double Up" ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Controls ) ) + PORT_DIPNAME( 0x08, 0x08, "Continue To Play" ) PORT_DIPLOCATION("SW2:4") + PORT_DIPSETTING( 0x08, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x10, "Keyboard" ) PORT_DIPSETTING( 0x00, DEF_STR( Joystick ) ) - PORT_DIPNAME( 0x20, 0x20, "Number Type" ) + PORT_DIPNAME( 0x20, 0x20, "Number Type" ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x20, "Number" ) PORT_DIPSETTING( 0x00, "Tile" ) - PORT_DIPNAME( 0x40, 0x40, "Double Up Type" ) - PORT_DIPSETTING( 0x40, "Double" ) - PORT_DIPSETTING( 0x00, DEF_STR( Single ) ) - PORT_DIPNAME( 0x80, 0x80, "Bet Number" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Hide Gambling" ) PORT_DIPLOCATION("SW2:7") // press "Hide Gambling" to hide credits and bets + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) - // the top 2 bits of COINS (port A) and KEYx (port B) are read and combined with the bottom 4 bits read from port C (see code at 1C83A) + // Joystick mode: the top 2 bits of COINS (i8255 port A) and JOY (i8255 port B) are read and combined with the bottom 4 bits read from port C (see code at $1c83a) + + PORT_START("JOY") + // Joystick mode: + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) // take tile or throw (as N in mahjong keyboard) + // i8255 port C input is 4 bits + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper switch - PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // service mode (keep pressed during boot too) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Statistics") // press with the above for sound test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE3 ) // ? must be high to display numbers (shown in service mode) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除) + // Keyboard mode: + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x10,EQUALS,0x10) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x10,EQUALS,0x10) + // Joystick mode: + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("DSW2",0x10,EQUALS,0x00) // bet + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CONDITION("DSW2",0x10,EQUALS,0x00) // function PORT_START("KEY0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) @@ -3059,87 +3361,85 @@ INPUT_PORTS_END static INPUT_PORTS_START( sdmg2 ) PORT_START("DSW1") - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) + PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x0c, "10" ) PORT_DIPSETTING( 0x08, "20" ) PORT_DIPSETTING( 0x04, "50" ) PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) + PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x10, "2000" ) PORT_DIPSETTING( 0x00, "29999" ) - PORT_DIPNAME( 0x20, 0x20, "Money Type" ) + PORT_DIPNAME( 0x20, 0x20, "Money Type" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) + PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x40, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x80, DEF_STR( On ) ) PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Min Bet" ) + PORT_DIPNAME( 0x03, 0x03, "Minimum Bet" ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, "500" ) PORT_DIPSETTING( 0x02, "1000" ) PORT_DIPSETTING( 0x01, "1500" ) PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3,4") PORT_DIPSETTING( 0x0c, "1" ) PORT_DIPSETTING( 0x08, "2" ) PORT_DIPSETTING( 0x04, "3" ) PORT_DIPSETTING( 0x00, "5" ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Controls ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x40, "Keyboard" ) PORT_DIPSETTING( 0x00, DEF_STR( Joystick ) ) - PORT_DIPNAME( 0x80, 0x80, "Number Type" ) + PORT_DIPNAME( 0x80, 0x80, "Number Type" ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x80, "Number" ) PORT_DIPSETTING( 0x00, "Tile" ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) // hopper switch - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) // shown in test mode - PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Statistics") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除), does not work in game? + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // Keyboard mode: - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) // shown in test mode + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) // shown in test mode ('O' appears, or it might be a 0) // Joystick mode: - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) - - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("JOY") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // related to joystick BUTTON3 PORT_START("KEY0") - // Keyboard mode: - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,EQUALS,0x40) - // Joystick mode: - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x40,EQUALS,0x00) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("KEY1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) @@ -3184,45 +3484,45 @@ INPUT_PORTS_END static INPUT_PORTS_START( mgdh ) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x06, 0x06, "Credits Per Note" ) + PORT_DIPNAME( 0x06, 0x06, "Credits Per Note" ) PORT_DIPLOCATION("SW1:2,3") PORT_DIPSETTING( 0x06, "5" ) PORT_DIPSETTING( 0x04, "10" ) PORT_DIPSETTING( 0x02, "50" ) PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x08, 0x08, "Max Note Credits" ) + PORT_DIPNAME( 0x08, 0x08, "Max Note Credits" ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x08, "100" ) PORT_DIPSETTING( 0x00, "500" ) - PORT_DIPNAME( 0x10, 0x10, "Money Type" ) + PORT_DIPNAME( 0x10, 0x10, "Money Type" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x10, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x20, 0x20, "Pay Out Type" ) + PORT_DIPNAME( 0x20, 0x20, "Pay Out Type" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0xc0, 0xc0, "Min Bet" ) + PORT_DIPNAME( 0xc0, 0xc0, "Minimum Bet" ) PORT_DIPLOCATION("SW1:7,8") PORT_DIPSETTING( 0xc0, "1" ) PORT_DIPSETTING( 0x80, "2" ) PORT_DIPSETTING( 0x40, "3" ) PORT_DIPSETTING( 0x00, "5" ) - PORT_START("DSW2") // bitswapped - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) + PORT_START("DSW2") // bitswapped + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Controls ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW2:2") PORT_DIPSETTING( 0x02, "Keyboard" ) PORT_DIPSETTING( 0x00, DEF_STR( Joystick ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0x04, 0x04, "Continue To Play" ) PORT_DIPLOCATION("SW2:3") + PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:4,5") PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) - PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6,7,8") PORT_DIPSETTING( 0xe0, "1" ) PORT_DIPSETTING( 0xc0, "2" ) PORT_DIPSETTING( 0xa0, "5" ) @@ -3233,34 +3533,34 @@ static INPUT_PORTS_START( mgdh ) PORT_DIPSETTING( 0x00, "10" ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) // hopper switch - PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // service mode (keep pressed during boot too) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Statistics") // press with the above for sound test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 ) // ? (shown in service mode) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除), does not work in game? + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("KEY0") // Keyboard mode: - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x02) // Joystick mode: - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x02,EQUALS,0x00) PORT_START("KEY1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) @@ -3315,62 +3615,62 @@ INPUT_PORTS_END static INPUT_PORTS_START( slqz2 ) PORT_START("DSW1") - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) + PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x0c, "10" ) PORT_DIPSETTING( 0x08, "20" ) PORT_DIPSETTING( 0x04, "50" ) PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) + PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x10, "1000" ) PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0x20, 0x20, "Money Type" ) + PORT_DIPNAME( 0x20, 0x20, "Money Type" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) + PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x40, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x80, DEF_STR( On ) ) PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Min Bet" ) + PORT_DIPNAME( 0x03, 0x03, "Double Up Limit" ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, "500" ) PORT_DIPSETTING( 0x02, "1000" ) PORT_DIPSETTING( 0x01, "1500" ) PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x0c, 0x0c, "Minimum Bet" ) PORT_DIPLOCATION("SW2:3,4") PORT_DIPSETTING( 0x0c, "1" ) PORT_DIPSETTING( 0x08, "2" ) PORT_DIPSETTING( 0x04, "3" ) PORT_DIPSETTING( 0x00, "5" ) - PORT_DIPNAME( 0x10, 0x10, "Bonus Round" ) + PORT_DIPNAME( 0x10, 0x10, "Bonus Round" ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x20, 0x20, "Number Type" ) + PORT_DIPNAME( 0x20, 0x20, "Number Type" ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x20, "Number" ) PORT_DIPSETTING( 0x00, "Dice" ) - PORT_DIPNAME( 0x40, 0x40, "Symbols" ) + PORT_DIPNAME( 0x40, 0x40, "Symbols" ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) // pigs, apples - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) // pigs, apples + PORT_DIPNAME( 0x80, 0x80, "Hide Gambling" ) PORT_DIPLOCATION("SW2:8") // press "Hide Gambling" to hide credits and bets PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) // hopper switch (unimplemented) - PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // service mode (keep pressed during boot too) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Statistics") // press with the above for sound test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // needs to be 0 for "clear" input below to work + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_START("PLAYER1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start / Don Den") @@ -3378,82 +3678,72 @@ static INPUT_PORTS_START( slqz2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Help / Big" ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Help / Big") PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("PLAYER2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME( "Bet" ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) - - PORT_START("BUTTONS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0") PORT_CODE(KEYCODE_1_PAD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0") PORT_CODE(KEYCODE_2_PAD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0") PORT_CODE(KEYCODE_3_PAD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0") PORT_CODE(KEYCODE_4_PAD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0") PORT_CODE(KEYCODE_5_PAD) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0") PORT_CODE(KEYCODE_6_PAD) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0") PORT_CODE(KEYCODE_7_PAD) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0") PORT_CODE(KEYCODE_8_PAD) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( tjsb ) PORT_START("DSW1") - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) + PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x0c, "10" ) PORT_DIPSETTING( 0x08, "20" ) PORT_DIPSETTING( 0x04, "50" ) PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) + PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x10, "1000" ) PORT_DIPSETTING( 0x00, "5000" ) - PORT_DIPNAME( 0x20, 0x20, "Money Type" ) + PORT_DIPNAME( 0x20, 0x20, "Money Type" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) // 2/4 + PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) PORT_DIPLOCATION("SW1:7") // 2/4 PORT_DIPSETTING( 0x40, "Coins" ) PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x80, DEF_STR( On ) ) PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, "Min Bet" ) + PORT_DIPNAME( 0x03, 0x03, "Minimum Bet" ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x03, "1000" ) PORT_DIPSETTING( 0x02, "2000" ) PORT_DIPSETTING( 0x01, "3000" ) PORT_DIPSETTING( 0x00, "4000" ) - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3,4") PORT_DIPSETTING( 0x0c, "1" ) PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x04, "5" ) PORT_DIPSETTING( 0x00, "10" ) - PORT_DIPNAME( 0x10, 0x10, "Bonus Round" ) // show bonus round in demo mode -> protection check + PORT_DIPNAME( 0x10, 0x10, "Bonus Round" ) PORT_DIPLOCATION("SW2:5") // show bonus round in demo mode -> protection check PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x20, 0x20, "Number Type" ) + PORT_DIPNAME( 0x20, 0x20, "Number Type" ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x20, "Number" ) PORT_DIPSETTING( 0x00, "Dice" ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("DSW3") // check: (val^ff) & 9a == 0a - PORT_DIPNAME( 0xff, 0xf5, "Bonus Round Protection Check" ) + PORT_START("DSW3") // the protection check is skipped if (DSW3 ^ 0xff) & 0x9a == 0x0a + PORT_DIPNAME( 0xff, 0xf5, "Bonus Round Protection Check" ) PORT_DIPLOCATION("SW3:1,2,3,4,5,6,7,8") PORT_DIPSETTING( 0xf5, DEF_STR( Off ) ) PORT_DIPSETTING( 0xff, DEF_STR( On ) ) @@ -3478,141 +3768,299 @@ static INPUT_PORTS_START( tjsb ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Statistics") - PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // keep pressed while booting - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) - - PORT_START("HOPPER") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ? shown in test mode - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_CUSTOM ) // hopper switch - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // keep pressed while booting + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) + + PORT_START("BUTTONS") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除), does not work in game? + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END -// to do: static INPUT_PORTS_START( spkrform ) PORT_START("DSW1") - PORT_DIPUNKNOWN( 0x01, 0x01 ) - PORT_DIPUNKNOWN( 0x02, 0x02 ) - PORT_DIPUNKNOWN( 0x04, 0x04 ) - PORT_DIPUNKNOWN( 0x08, 0x08 ) - PORT_DIPUNKNOWN( 0x10, 0x10 ) - PORT_DIPUNKNOWN( 0x20, 0x20 ) - PORT_DIPUNKNOWN( 0x40, 0x40 ) - PORT_DIPUNKNOWN( 0x80, 0x80 ) + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" ) + PORT_DIPNAME( 0x01c, 0x1c, "Credits Per Coin" ) PORT_DIPLOCATION("SW1:3,4,5") + PORT_DIPSETTING( 0x1c, "1" ) + PORT_DIPSETTING( 0x18, "4" ) + PORT_DIPSETTING( 0x14, "5" ) + PORT_DIPSETTING( 0x10, "10" ) + PORT_DIPSETTING( 0x0c, "20" ) + PORT_DIPSETTING( 0x08, "40" ) + PORT_DIPSETTING( 0x04, "50" ) + PORT_DIPSETTING( 0x00, "100" ) + PORT_DIPNAME( 0x20, 0x20, "Hopper" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x20, DEF_STR( No ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) PORT_START("DSW2") - PORT_DIPUNKNOWN( 0x01, 0x01 ) - PORT_DIPUNKNOWN( 0x02, 0x02 ) - PORT_DIPUNKNOWN( 0x04, 0x04 ) - PORT_DIPUNKNOWN( 0x08, 0x08 ) - PORT_DIPUNKNOWN( 0x10, 0x10 ) - PORT_DIPUNKNOWN( 0x20, 0x20 ) - PORT_DIPUNKNOWN( 0x40, 0x40 ) - PORT_DIPUNKNOWN( 0x80, 0x80 ) + PORT_DIPNAME( 0x03, 0x03, "Minimum Bet" ) PORT_DIPLOCATION("SW2:1,2") + PORT_DIPSETTING( 0x03, "1" ) + PORT_DIPSETTING( 0x02, "5" ) + PORT_DIPSETTING( 0x01, "10" ) + PORT_DIPSETTING( 0x00, "20" ) + PORT_DIPNAME( 0x1c, 0x1c, "Credits Per Note" ) PORT_DIPLOCATION("SW2:3,4,5") + PORT_DIPSETTING( 0x1c, "10" ) + PORT_DIPSETTING( 0x18, "20" ) + PORT_DIPSETTING( 0x14, "40" ) + PORT_DIPSETTING( 0x10, "50" ) + PORT_DIPSETTING( 0x0c, "100" ) + PORT_DIPSETTING( 0x08, "200" ) + PORT_DIPSETTING( 0x04, "250" ) + PORT_DIPSETTING( 0x00, "500" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) PORT_START("DSW3") - PORT_DIPNAME( 0x03, 0x03, "Win Up Pool" ) - PORT_DIPSETTING( 0x03, "300" ) - PORT_DIPSETTING( 0x02, "500" ) - PORT_DIPSETTING( 0x01, "800" ) - PORT_DIPSETTING( 0x00, "800" ) - PORT_DIPUNKNOWN( 0x04, 0x04 ) - PORT_DIPUNKNOWN( 0x08, 0x08 ) - PORT_DIPUNKNOWN( 0x10, 0x10 ) - PORT_DIPUNKNOWN( 0x20, 0x20 ) - PORT_DIPUNKNOWN( 0x40, 0x40 ) - PORT_DIPUNKNOWN( 0x80, 0x80 ) + PORT_DIPNAME( 0x03, 0x03, "?" ) PORT_DIPLOCATION("SW3:1,2") + PORT_DIPSETTING( 0x03, "100" ) + PORT_DIPSETTING( 0x02, "200" ) + PORT_DIPSETTING( 0x01, "300" ) + PORT_DIPSETTING( 0x00, "400" ) + PORT_DIPNAME( 0x0c, 0x0c, "Win Up Pool" ) PORT_DIPLOCATION("SW3:3,4") + PORT_DIPSETTING( 0x0c, "300" ) + PORT_DIPSETTING( 0x08, "500" ) + PORT_DIPSETTING( 0x04, "800 (1)" ) + PORT_DIPSETTING( 0x00, "800 (2)" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) PORT_START("PLAYER1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // ?? exit poker - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) // start (formosa) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) // up - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) // down / start - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Hide Gambling (Switch To Formosa)") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Start (Formosa)") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // up (Formosa) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START ) PORT_NAME("Start / Draw / Take / %p Down (Formosa)") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("PLAYER2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // right / bet - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // button1 / hold1 - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) // hold2 - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Hold 4 / Half") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) // hold 5 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Bet / W-Up") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // right (Formosa) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Hold 1 / High / Button (Formosa)") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Hold 2 / Double Up") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) // left - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) // hold3 - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 ) // credit in - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 ) // credit out - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4 ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // left (Formosa) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Hold 3 / Low") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // key in + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // key out + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("BUTTONS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) // coin (coin error) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) // coin (coin error) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE4 ) // hopper error - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1") PORT_CODE(KEYCODE_1_PAD) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2") PORT_CODE(KEYCODE_2_PAD) // record - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("3") PORT_CODE(KEYCODE_3_PAD) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("4") PORT_CODE(KEYCODE_4_PAD) - - PORT_START("A000") - PORT_DIPNAME( 0xff, 0xff, "A000" ) - PORT_DIPSETTING( 0xff, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin 1 (impulse prevents coin error in gambling mode) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // coin 2 "" + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // payout + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Return To Gambling (From Formosa). Then Bet, Hold 1..5") // To switch back to poker from Formosa, start the sequence pressing this key (memory $f4a3 holds the sequence number) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // book + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END - PORT_START("A001") - PORT_DIPNAME( 0xff, 0xff, "A001" ) - PORT_DIPSETTING( 0xff, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +static INPUT_PORTS_START( tarzan ) + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x0e, 0x0e, "Coin Value" ) PORT_DIPLOCATION("SW1:2,3,4") + PORT_DIPSETTING( 0x0e, "1" ) + PORT_DIPSETTING( 0x0c, "2" ) + PORT_DIPSETTING( 0x0a, "4" ) + PORT_DIPSETTING( 0x08, "5" ) + PORT_DIPSETTING( 0x06, "10" ) + PORT_DIPSETTING( 0x04, "20" ) + PORT_DIPSETTING( 0x02, "50" ) + PORT_DIPSETTING( 0x00, "100" ) + PORT_DIPNAME( 0x30, 0x30, "Key Value" ) PORT_DIPLOCATION("SW1:5,6") + PORT_DIPSETTING( 0x30, "100" ) + PORT_DIPSETTING( 0x20, "200" ) + PORT_DIPSETTING( 0x10, "500" ) + PORT_DIPSETTING( 0x00, "1000" ) + PORT_DIPNAME( 0xc0, 0xc0, "Point Value" ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0xc0, "1" ) + PORT_DIPSETTING( 0x80, "10" ) + PORT_DIPSETTING( 0x40, "100" ) + PORT_DIPSETTING( 0x00, "100 (2)" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "Coin Type" ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x01, "Coin" ) + PORT_DIPSETTING( 0x00, "Key" ) + PORT_DIPNAME( 0x0e, 0x0e, "Minimum Bet" ) PORT_DIPLOCATION("SW2:2,3,4") + PORT_DIPSETTING( 0x0e, "5" ) + PORT_DIPSETTING( 0x0c, "25" ) + PORT_DIPSETTING( 0x0a, "50" ) + PORT_DIPSETTING( 0x08, "75" ) + PORT_DIPSETTING( 0x06, "100" ) + PORT_DIPSETTING( 0x04, "125" ) + PORT_DIPSETTING( 0x02, "125 (2)" ) + PORT_DIPSETTING( 0x00, "125 (3)" ) + PORT_DIPNAME( 0x30, 0x30, "Bonus Bet" ) PORT_DIPLOCATION("SW2:5,6") + PORT_DIPSETTING( 0x30, "75" ) + PORT_DIPSETTING( 0x20, "125" ) + PORT_DIPSETTING( 0x10, "200" ) + PORT_DIPSETTING( 0x00, "250" ) + PORT_DIPNAME( 0xc0, 0xc0, "Continue To Play" ) PORT_DIPLOCATION("SW2:7,8") + PORT_DIPSETTING( 0xc0, "50k" ) + PORT_DIPSETTING( 0x80, "100k" ) + PORT_DIPSETTING( 0x40, "150k" ) + PORT_DIPSETTING( 0x00, "200k" ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW3:1") + PORT_DIPSETTING( 0x01, "Keyboard" ) + PORT_DIPSETTING( 0x00, DEF_STR( Joystick ) ) + PORT_DIPNAME( 0x02, 0x00, "Back Color" ) PORT_DIPLOCATION("SW3:2") + PORT_DIPSETTING( 0x02, "Black" ) + PORT_DIPSETTING( 0x00, "Color" ) + PORT_DIPNAME( 0x04, 0x04, "Hide Gambling" ) PORT_DIPLOCATION("SW3:3") // Press "Hide Gambling" to hide credits and bets + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, "Number Type" ) PORT_DIPLOCATION("SW3:4") + PORT_DIPSETTING( 0x08, "Number" ) + PORT_DIPSETTING( 0x00, "Mahjong Tile" ) + PORT_DIPNAME( 0x10, 0x10, "Continue To Play" ) PORT_DIPLOCATION("SW3:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, "Payout" ) PORT_DIPLOCATION("SW3:6") + PORT_DIPSETTING( 0x20, "Hopper" ) + PORT_DIPSETTING( 0x00, "Points" ) + PORT_DIPUNUSED_DIPLOC(0x40, 0x40, "SW3:7") + PORT_DIPUNUSED_DIPLOC(0x80, 0x80, "SW3:8") + + PORT_START("COINS") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // Service + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // Book + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // Coin/Key in (coin error in coin mode) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // Coin/Key out + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除) + // Keyboard mode: + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW3",0x01,EQUALS,0x01) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW3",0x01,EQUALS,0x01) + // Joystick mode: + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("DSW3",0x01,EQUALS,0x00) PORT_NAME("%p Button 2 / Bet / Same Double Up" ) // Button B (test mode) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CONDITION("DSW3",0x01,EQUALS,0x00) PORT_NAME("%p Button 3 / Small / Half Double Up") // Button C (test mode) + + PORT_START("JOY") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start / Take") // Exit (test mode) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // Up (test mode) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // Down (test mode) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // Left (test mode) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // Right (test mode) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("%p Button 1 / Help / Big / Double Up") // Button A (test mode) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("KEY0") + // Keyboard mode: + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_NAME("%p Mahjong A / Help / Double Up") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_NAME("%p Mahjong M / Small") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START ) PORT_NAME("%p Mahjong Start / Take") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("KEY1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) // B (test mode) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) // Bet + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("KEY2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_NAME("%p Mahjong C / Half Double Up") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_NAME("%p Mahjong K / Big") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("KEY3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("KEY4") // never read and not shown in test mode + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( starzan ) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "System Limit" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPNAME( 0x02, 0x02, "System Limit" ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x02, "Unlimited" ) PORT_DIPSETTING( 0x00, "Limited" ) - PORT_DIPNAME( 0x04, 0x04, "W-Up Game" ) PORT_DIPLOCATION("SW1:3") + PORT_DIPNAME( 0x04, 0x04, "W-Up Game" ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "Back Color" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPNAME( 0x08, 0x00, "Back Color" ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x08, "Black" ) PORT_DIPSETTING( 0x00, "Color" ) - PORT_DIPNAME( 0x10, 0x10, "Stop Status" ) PORT_DIPLOCATION("SW1:5") + PORT_DIPNAME( 0x10, 0x10, "Stop Status" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x10, "Non Stop" ) PORT_DIPSETTING( 0x00, "Auto Stop" ) - PORT_DIPNAME( 0x20, 0x20, "Key" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPNAME( 0x20, 0x20, "Key" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, "Mode 1" ) - PORT_DIPSETTING( 0x00, "Mode 2" ) - PORT_DIPNAME( 0x40, 0x40, "Credit Level" ) PORT_DIPLOCATION("SW1:7") + PORT_DIPSETTING( 0x00, "Mode 2" ) // To Do + PORT_DIPNAME( 0x40, 0x40, "Credit Level" ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Odds Table" ) PORT_DIPLOCATION("SW1:8") + PORT_DIPNAME( 0x80, 0x80, "Odds Table" ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x80, "Show" ) PORT_DIPSETTING( 0x00, "No Show" ) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Normal Level" ) PORT_DIPLOCATION("SW2:1") + PORT_DIPNAME( 0x01, 0x01, "Normal Level" ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x01, DEF_STR( Low ) ) PORT_DIPSETTING( 0x00, DEF_STR( High ) ) PORT_DIPUNUSED_DIPLOC(0x02, 0x02, "SW2:2") // not used from here on according to test mode, PCB does have 3 8-dip banks @@ -3634,97 +4082,94 @@ static INPUT_PORTS_START( starzan ) PORT_DIPUNUSED_DIPLOC(0x80, 0x80, "SW3:8") PORT_START("PLAYER1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "HP SW" ) // called like this in key test, not clear what it does - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start / HW-Up") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop Reel 3 / Low") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Stop All Reels / Bet / 2W-Up") PORT_START("PLAYER2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop Reel 2 / High") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_NAME("Stop Reel 4 / W-Up") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop Reel 1 / Take") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // 'gettone C' - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // 'gettone A' - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) - PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) // keep pressed while booting - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // enters book-keeping menu - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - - PORT_START("BUTTONS") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // 'coin C' + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // 'coin A' + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) // keep pressed while booting + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // enters book-keeping menu + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test INPUT_PORTS_END -// Test mode is in Italian (probably machine translated given how literal it is). +// Test mode is in Italian (probably machine translated given how literal it is) static INPUT_PORTS_START( happyskl ) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") // 'demo audio' + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") // 'demo audio' PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "System Limit" ) PORT_DIPLOCATION("SW1:2") // 'lim. sistema' + PORT_DIPNAME( 0x02, 0x02, "System Limit" ) PORT_DIPLOCATION("SW1:2") // 'lim. sistema' PORT_DIPSETTING( 0x02, "Unlimited" ) PORT_DIPSETTING( 0x00, "Limited" ) - PORT_DIPNAME( 0x04, 0x04, "W-Up Game" ) PORT_DIPLOCATION("SW1:3") // 'gioco radd.' + PORT_DIPNAME( 0x04, 0x04, "W-Up Game" ) PORT_DIPLOCATION("SW1:3") // 'gioco radd.' PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "Game Speed" ) PORT_DIPLOCATION("SW1:4") // 'velocitá gioco' + PORT_DIPNAME( 0x08, 0x08, "Game Speed" ) PORT_DIPLOCATION("SW1:4") // 'velocitá gioco' PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x00, "Quick" ) - PORT_DIPNAME( 0x10, 0x10, "Replay Game" ) PORT_DIPLOCATION("SW1:5") // not translated for some reason + PORT_DIPNAME( 0x10, 0x10, "Replay Game" ) PORT_DIPLOCATION("SW1:5") // not translated for some reason PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "Show Table" ) PORT_DIPLOCATION("SW1:6") // 'vedi tabella' + PORT_DIPNAME( 0x20, 0x20, "Show Table" ) PORT_DIPLOCATION("SW1:6") // 'vedi tabella' PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Skill" ) PORT_DIPLOCATION("SW1:7") // 'abilitá' + PORT_DIPNAME( 0x40, 0x40, "Skill" ) PORT_DIPLOCATION("SW1:7") // 'abilitá' PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Payment Type" ) PORT_DIPLOCATION("SW1:8") // 'tipo pagam.' + PORT_DIPNAME( 0x80, 0x80, "Payment Type" ) PORT_DIPLOCATION("SW1:8") // 'tipo pagam.' PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x00, "Automatic" ) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Auto Payment" ) PORT_DIPLOCATION("SW2:1") // 'pagam. autom.' + PORT_DIPNAME( 0x01, 0x01, "Auto Payment" ) PORT_DIPLOCATION("SW2:1") // 'pagam. autom.' PORT_DIPSETTING( 0x01, "1" ) PORT_DIPSETTING( 0x00, "10" ) - PORT_DIPNAME( 0x06, 0x06, "Enable Payment" ) PORT_DIPLOCATION("SW2:2,3") // 'abilitá pagam.', they probably meant "abilita" instead of "abilitá" + PORT_DIPNAME( 0x06, 0x06, "Enable Payment" ) PORT_DIPLOCATION("SW2:2,3") // 'abilitá pagam.', they probably meant "abilita" instead of "abilitá" PORT_DIPSETTING( 0x06, "Everything" ) // 'tutto' PORT_DIPSETTING( 0x04, "1/Tickets" ) PORT_DIPSETTING( 0x02, "10/Tickets" ) PORT_DIPSETTING( 0x00, "1/Tickets" ) // same as 0x04, why? - PORT_DIPNAME( 0x08, 0x08, "Select Balls" ) PORT_DIPLOCATION("SW2:4") // 'sel. palloni' + PORT_DIPNAME( 0x08, 0x08, "Select Balls" ) PORT_DIPLOCATION("SW2:4") // 'sel. palloni' PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "Select Cubes" ) PORT_DIPLOCATION("SW2:5") // 'sel. cubi' + PORT_DIPNAME( 0x10, 0x10, "Select Cubes" ) PORT_DIPLOCATION("SW2:5") // 'sel. cubi' PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "Select Cans" ) PORT_DIPLOCATION("SW2:6") // 'sel. lattine' + PORT_DIPNAME( 0x20, 0x20, "Select Cans" ) PORT_DIPLOCATION("SW2:6") // 'sel. lattine' PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "Select Cards" ) PORT_DIPLOCATION("SW2:7") // 'sel. carte' + PORT_DIPNAME( 0x40, 0x40, "Select Cards" ) PORT_DIPLOCATION("SW2:7") // 'sel. carte' PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Credit Limit" ) PORT_DIPLOCATION("SW2:8") // 'lim. crediti' + PORT_DIPNAME( 0x80, 0x80, "Credit Limit" ) PORT_DIPLOCATION("SW2:8") // 'lim. crediti' PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW3") - PORT_DIPNAME( 0x01, 0x01, "Level Limit" ) PORT_DIPLOCATION("SW3:1") // 'lim. livello' + PORT_DIPNAME( 0x01, 0x01, "Level Limit" ) PORT_DIPLOCATION("SW3:1") // 'lim. livello' PORT_DIPSETTING( 0x01, DEF_STR( Low ) ) PORT_DIPSETTING( 0x00, DEF_STR( High ) ) - PORT_DIPNAME( 0x02, 0x02, "Background" ) PORT_DIPLOCATION("SW3:2") // 'sfondo' + PORT_DIPNAME( 0x02, 0x02, "Background" ) PORT_DIPLOCATION("SW3:2") // 'sfondo' PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPUNUSED_DIPLOC(0x04, 0x04, "SW3:3") // not used from here on according to test mode @@ -3735,40 +4180,37 @@ static INPUT_PORTS_START( happyskl ) PORT_DIPUNUSED_DIPLOC(0x80, 0x80, "SW3:8") PORT_START("PLAYER1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "HP SW" ) // called like this in key test, not clear what it does - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_START("PLAYER2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // 'gettone C' - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // 'gettone A' - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) - PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) // keep pressed while booting - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // enters book-keeping menu - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test - - PORT_START("BUTTONS") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // 'gettone C' (shows 'ricarica in corso') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // 'gettone A' + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) // keep pressed while booting + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // enters book-keeping menu + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test INPUT_PORTS_END -static INPUT_PORTS_START( unkigs ) +static INPUT_PORTS_START( cpoker2 ) PORT_INCLUDE(happyskl) PORT_MODIFY("PLAYER1") @@ -3780,38 +4222,38 @@ static INPUT_PORTS_START( unkigs ) // dips definitions taken from test mode, to be verified when the game will be playable PORT_MODIFY("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "System Limit" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPNAME( 0x02, 0x02, "System Limit" ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x02, "Unlimited" ) PORT_DIPSETTING( 0x00, "Limited" ) - PORT_DIPNAME( 0x04, 0x04, "W-Up Game" ) PORT_DIPLOCATION("SW1:3") + PORT_DIPNAME( 0x04, 0x04, "W-Up Game" ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "W-Up Type" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPNAME( 0x08, 0x08, "W-Up Type" ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x08, "Big-Small" ) PORT_DIPSETTING( 0x00, "Red-Black" ) - PORT_DIPNAME( 0x10, 0x10, "Game Speed" ) PORT_DIPLOCATION("SW1:5") + PORT_DIPNAME( 0x10, 0x10, "Game Speed" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x10, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x00, "Quick" ) - PORT_DIPNAME( 0x20, 0x20, "Card Type" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPNAME( 0x20, 0x20, "Card Type" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, "Poker" ) PORT_DIPSETTING( 0x00, "Symbol" ) - PORT_DIPNAME( 0x40, 0x40, "Sexy Girl" ) PORT_DIPLOCATION("SW1:7") + PORT_DIPNAME( 0x40, 0x40, "Sexy Girl" ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Title Name" ) PORT_DIPLOCATION("SW1:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "Show Title" ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x80, DEF_STR( No ) ) PORT_MODIFY("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Show Hold" ) PORT_DIPLOCATION("SW2:1") + PORT_DIPNAME( 0x01, 0x01, "Show Hold" ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "Number Type" ) PORT_DIPLOCATION("SW2:2") + PORT_DIPNAME( 0x02, 0x02, "Number Type" ) PORT_DIPLOCATION("SW2:2") PORT_DIPSETTING( 0x02, "Number" ) - PORT_DIPSETTING( 0x00, "AJQK" ) + PORT_DIPSETTING( 0x00, "A,J,Q,K" ) PORT_DIPUNUSED_DIPLOC(0x04, 0x04, "SW2:3") // not used from here on according to test mode, PCB does have 3 8-dip banks PORT_DIPUNUSED_DIPLOC(0x08, 0x08, "SW2:4") PORT_DIPUNUSED_DIPLOC(0x10, 0x10, "SW2:5") @@ -3823,10 +4265,38 @@ static INPUT_PORTS_START( unkigs ) PORT_DIPUNUSED_DIPLOC(0x01, 0x01, "SW3:1") PORT_DIPUNUSED_DIPLOC(0x02, 0x02, "SW3:2") INPUT_PORTS_END + /*************************************************************************** Machine Drivers ***************************************************************************/ +void igs017_state::base_machine_oki(machine_config &config, const XTAL &xtal_oki) +{ + // i/o + IGS_MUX(config, m_igs_mux, 0); + + I8255A(config, m_ppi); + + // video + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(512, 256); + m_screen->set_visarea(0, 512-1, 0, 240-1); + m_screen->set_screen_update("igs017_igs031", FUNC(igs017_igs031_device::screen_update)); + m_screen->set_palette("igs017_igs031:palette"); + + IGS017_IGS031(config, m_igs017_igs031, 0); + m_igs017_igs031->set_i8255_tag("ppi8255"); + + // sound + SPEAKER(config, "mono").front_center(); + OKIM6295(config, m_oki, xtal_oki, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); +} + + +// iqblocka, iqblockf, genius6 + TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::iqblocka_interrupt) { int scanline = param; @@ -3838,33 +4308,24 @@ TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::iqblocka_interrupt) m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); } -MACHINE_RESET_MEMBER(igs017_state,iqblocka) -{ - machine_reset(); - m_input_select = 0; -} - void igs017_state::iqblocka(machine_config &config) { - HD64180RP(config, m_maincpu, XTAL(16'000'000)); + base_machine_oki(config, 16_MHz_XTAL / 16); + + HD64180RP(config, m_maincpu, 16_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::iqblocka_map); m_maincpu->set_addrmap(AS_IO, &igs017_state::iqblocka_io); TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::iqblocka_interrupt), "screen", 0, 1); - MCFG_MACHINE_RESET_OVERRIDE(igs017_state,iqblocka) - // i/o - i8255_device &ppi(I8255A(config, "ppi8255")); - ppi.in_pa_callback().set_ioport("DSW1"); - ppi.in_pb_callback().set_ioport("DSW2"); - ppi.in_pc_callback().set_ioport("DSW3"); + m_igs_mux->set_addrmap(0, &igs017_state::iqblocka_mux_map); + + m_ppi->in_pa_callback().set_ioport("DSW1"); + m_ppi->in_pb_callback().set_ioport("DSW2"); + m_ppi->in_pc_callback().set_ioport("DSW3"); // protection IGS_BITSWAP(config, m_igs_bitswap, 0); - m_igs_bitswap->in_pa_callback().set_ioport("PLAYER1"); - m_igs_bitswap->in_pb_callback().set_ioport("PLAYER2"); - m_igs_bitswap->in_pc_callback().set_ioport("COINS"); - m_igs_bitswap->out_pa_callback().set(FUNC(igs017_state::iqblocka_keyin_w)); m_igs_bitswap->set_val_xor(0x15d6); m_igs_bitswap->set_mf_bits(3, 5, 9, 11); m_igs_bitswap->set_m3_bits<0>(~5, 8, ~10, ~15); @@ -3874,31 +4335,17 @@ void igs017_state::iqblocka(machine_config &config) IGS_INCDEC(config, m_igs_incdec, 0); - // video - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(512, 256); - m_screen->set_visarea(0, 512-1, 0, 240-1); - m_screen->set_screen_update("igs017_igs031", FUNC(igs017_igs031_device::screen_update)); - m_screen->set_palette("igs017_igs031:palette"); - - IGS017_IGS031(config, m_igs017_igs031, 0); - m_igs017_igs031->set_i8255_tag("ppi8255"); - // sound - SPEAKER(config, "mono").front_center(); - YM2413(config, "ymsnd", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.5); - - OKIM6295(config, m_oki, XTAL(16'000'000) / 16, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); + YM2413(config, "ymsnd", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 0.5); } void igs017_state::iqblockf(machine_config &config) { iqblocka(config); + m_igs_mux->set_addrmap(0, &igs017_state::iqblockf_mux_map); + // tweaked protection bitswap - m_igs_bitswap->out_pb_callback().set(FUNC(igs017_state::iqblockf_keyout_w)); m_igs_bitswap->set_mf_bits(0, 5, 9, 13); } @@ -3914,26 +4361,191 @@ void igs017_state::genius6(machine_config &config) m_igs_bitswap->set_m3_bits<3>( 3, ~5, ~6, ~15); } + +// tarzan + void igs017_state::tarzan(machine_config &config) { - iqblocka(config); + base_machine_oki(config, 16_MHz_XTAL / 16); + HD64180RP(config, m_maincpu, 16_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::iqblocka_map); + m_maincpu->set_addrmap(AS_IO, &igs017_state::tarzan_io); m_maincpu->set_addrmap(AS_OPCODES, &igs017_state::decrypted_opcodes_map); + TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::iqblocka_interrupt), "screen", 0, 1); + + // i/o + m_igs_mux->set_addrmap(0, &igs017_state::tarzan_mux_map); + + m_ppi->in_pa_callback().set_ioport("COINS"); + m_ppi->in_pb_callback().set(FUNC(igs017_state::tarzan_keys_joy_r)); + + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + + // protection + IGS_STRING(config, m_igs_string, 0); + + IGS_INCDEC(config, m_igs_incdec, 0); + + // video + m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::tarzan_palette_bitswap)); + + // sound + YM2413(config, "ymsnd", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 0.5); } + +// starzan + void igs017_state::starzan(machine_config &config) { - tarzan(config); + base_machine_oki(config, 16_MHz_XTAL / 16); + + HD64180RP(config, m_maincpu, 16_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::iqblocka_map); + m_maincpu->set_addrmap(AS_IO, &igs017_state::starzan_io); + m_maincpu->set_addrmap(AS_OPCODES, &igs017_state::decrypted_opcodes_map); + TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::iqblocka_interrupt), "screen", 0, 1); + + // i/o + m_igs_mux->set_addrmap(0, &igs017_state::starzan_mux_map); + + m_ppi->in_pa_callback().set_ioport("COINS"); + m_ppi->in_pb_callback().set_ioport("PLAYER1"); + m_ppi->in_pc_callback().set(FUNC(igs017_state::dsw_r)); + + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + + // protection + IGS_STRING(config, m_igs_string, 0); + + IGS_INCDEC(config, m_igs_incdec, 0); + + // video + m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::tarzan_palette_bitswap)); + + // sound + YM2413(config, "ymsnd", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 0.5); +} + + +// happyskl + +void igs017_state::happyskl(machine_config &config) +{ + base_machine_oki(config, 16_MHz_XTAL / 16); + + HD64180RP(config, m_maincpu, 16_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::iqblocka_map); + m_maincpu->set_addrmap(AS_IO, &igs017_state::happyskl_io); + m_maincpu->set_addrmap(AS_OPCODES, &igs017_state::decrypted_opcodes_map); + TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::iqblocka_interrupt), "screen", 0, 1); + + // i/o + m_igs_mux->set_addrmap(0, &igs017_state::happyskl_mux_map); + + m_ppi->in_pa_callback().set_ioport("COINS"); + m_ppi->in_pb_callback().set_ioport("PLAYER1"); + m_ppi->in_pc_callback().set(FUNC(igs017_state::dsw_r)); + + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + + // video + m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::tarzan_palette_bitswap)); +} + + +// cpoker2 + +void igs017_state::cpoker2(machine_config &config) +{ + base_machine_oki(config, 16_MHz_XTAL / 16); + + HD64180RP(config, m_maincpu, 16_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::cpoker2_map); + m_maincpu->set_addrmap(AS_IO, &igs017_state::cpoker2_io); + TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::iqblocka_interrupt), "screen", 0, 1); + + // i/o + m_igs_mux->set_addrmap(0, &igs017_state::cpoker2_mux_map); + + m_ppi->in_pa_callback().set_ioport("COINS"); + m_ppi->in_pb_callback().set_ioport("PLAYER1"); + m_ppi->in_pc_callback().set(FUNC(igs017_state::dsw_r)); + + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + + // protection + IGS_INCDEC(config, m_igs_incdec, 0); + + IGS_INC(config, m_igs_inc, 0); + + // video + m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::tarzan_palette_bitswap)); +} + + +// tjsb + +void igs017_state::tjsb(machine_config &config) +{ + base_machine_oki(config, 16_MHz_XTAL / 16); + + HD64180RP(config, m_maincpu, 16_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::tjsb_map); + m_maincpu->set_addrmap(AS_IO, &igs017_state::tjsb_io); + TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::iqblocka_interrupt), "screen", 0, 1); + + // i/o + m_igs_mux->set_addrmap(0, &igs017_state::tjsb_mux_map); + + m_ppi->in_pa_callback().set_ioport("DSW1"); + m_ppi->in_pb_callback().set_ioport("DSW2"); + m_ppi->in_pc_callback().set_ioport("DSW3"); + + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + + // protection + IGS_STRING(config, m_igs_string, 0); + + // video + m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::tjsb_palette_bitswap)); + + // sound + YM2413(config, "ymsnd", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 0.5); +} + + +// spkrform + +void igs017_state::spkrform(machine_config &config) +{ + base_machine_oki(config, 16_MHz_XTAL / 16); + + HD64180RP(config, m_maincpu, 16_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::iqblocka_map); + m_maincpu->set_addrmap(AS_IO, &igs017_state::spkrform_io); + TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::iqblocka_interrupt), "screen", 0, 1); + + // i/o + m_igs_mux->set_addrmap(0, &igs017_state::spkrform_mux_map); - subdevice<i8255_device>("ppi8255")->in_pa_callback().set_ioport("COINS"); - subdevice<i8255_device>("ppi8255")->in_pb_callback().set_ioport("PLAYER1"); - subdevice<i8255_device>("ppi8255")->in_pc_callback().set(FUNC(igs017_state::i8255_port_c_mux_r)); + m_ppi->in_pa_callback().set_ioport("DSW1"); + m_ppi->in_pb_callback().set_ioport("DSW2"); + m_ppi->in_pc_callback().set_ioport("DSW3"); - m_igs_bitswap->in_pa_callback().set_constant(0xff); - m_igs_bitswap->in_pc_callback().set_constant(0xff); - m_igs_bitswap->out_pd_callback().set([this](u8 data){ m_i8255_portc_mux = data >> 1; }); + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + + // protection + IGS_STRING(config, m_igs_string, 0); + + IGS_INCDEC(config, m_igs_incdec, 0); + + // sound + YM2413(config, "ymsnd", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 0.5); } + // mgcs TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::mgcs_interrupt) @@ -3947,45 +4559,28 @@ TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::mgcs_interrupt) m_maincpu->set_input_line(2, HOLD_LINE); } -MACHINE_RESET_MEMBER(igs017_state,mgcs) -{ - MACHINE_RESET_CALL_MEMBER( iqblocka ); - - m_scramble_data = 0; - m_igs_magic = 0; -} - void igs017_state::mgcs(machine_config &config) { - M68000(config, m_maincpu, XTAL(22'000'000) / 2); + base_machine_oki(config, 8_MHz_XTAL / 8); + + M68000(config, m_maincpu, 22_MHz_XTAL / 2); m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::mgcs_map); TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::mgcs_interrupt), "screen", 0, 1); - MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) - // i/o - i8255_device &ppi(I8255A(config, "ppi8255")); - ppi.in_pa_callback().set_ioport("COINS"); - ppi.in_pb_callback().set(FUNC(igs017_state::mgcs_keys_r)); + m_igs_mux->set_addrmap(0, &igs017_state::mgcs_mux_map); - TICKET_DISPENSER(config, m_hopperdev, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ); + m_ppi->in_pa_callback().set_ioport("COINS"); + m_ppi->in_pb_callback().set(FUNC(igs017_state::mgcs_keys_joy_r)); + m_ppi->in_pc_callback().set_ioport("JOY"); - // video - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(512, 256); - m_screen->set_visarea(0, 512-1, 0, 240-1); - m_screen->set_screen_update("igs017_igs031", FUNC(igs017_igs031_device::screen_update)); - m_screen->set_palette("igs017_igs031:palette"); + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); - IGS017_IGS031(config, m_igs017_igs031, 0); - m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::mgcs_palette_bitswap)); - m_igs017_igs031->set_i8255_tag("ppi8255"); + // protection + IGS_STRING(config, m_igs_string, 0); - // sound - SPEAKER(config, "mono").front_center(); - OKIM6295(config, m_oki, XTAL(8'000'000) / 8, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); + // video + m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::mgcs_palette_bitswap)); } @@ -3993,63 +4588,59 @@ void igs017_state::mgcs(machine_config &config) void igs017_state::lhzb2(machine_config &config) { - M68000(config, m_maincpu, XTAL(22'000'000) / 2); + base_machine_oki(config, 8_MHz_XTAL / 8); + + M68000(config, m_maincpu, 22_MHz_XTAL / 2); m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::lhzb2_map); TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::mgcs_interrupt), "screen", 0, 1); - MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) - // i/o - i8255_device &ppi(I8255A(config, "ppi8255")); - ppi.in_pa_callback().set_ioport("COINS"); - ppi.in_pb_callback().set_ioport("DSW1"); - ppi.in_pc_callback().set_ioport("DSW2"); + m_igs_mux->set_addrmap(0, &igs017_state::lhzb2_mux_map); + + m_ppi->in_pa_callback().set_ioport("COINS"); + m_ppi->in_pb_callback().set_ioport("DSW1"); + m_ppi->in_pc_callback().set_ioport("DSW2"); + + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); // protection - IGS025(config, m_igs025, 0); - m_igs025->set_external_cb(FUNC(igs017_state::igs025_to_igs022_callback)); + IGS_STRING(config, m_igs_string, 0); IGS022(config, m_igs022, 0); // video - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(512, 256); - m_screen->set_visarea(0, 512-1, 0, 240-1); - m_screen->set_screen_update("igs017_igs031", FUNC(igs017_igs031_device::screen_update)); - m_screen->set_palette("igs017_igs031:palette"); - - IGS017_IGS031(config, m_igs017_igs031, 0); m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::lhzb2a_palette_bitswap)); - m_igs017_igs031->set_i8255_tag("ppi8255"); - - // sound - SPEAKER(config, "mono").front_center(); - OKIM6295(config, m_oki, XTAL(8'000'000) / 8, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); } // lhzb2a -MACHINE_RESET_MEMBER(igs017_state,lhzb2a) +MACHINE_RESET_MEMBER(igs017_state, lhzb2a) { - MACHINE_RESET_CALL_MEMBER( mgcs ); + machine_reset(); lhzb2a_remap_addr_w(m_maincpu->space(AS_PROGRAM), 0xf0); } void igs017_state::lhzb2a(machine_config &config) { - M68000(config, m_maincpu, XTAL(22'000'000) / 2); + base_machine_oki(config, 8_MHz_XTAL / 8); + + M68000(config, m_maincpu, 22_MHz_XTAL / 2); m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::lhzb2a_map); TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::mgcs_interrupt), "screen", 0, 1); - MCFG_MACHINE_RESET_OVERRIDE(igs017_state,lhzb2a) + MCFG_MACHINE_RESET_OVERRIDE(igs017_state, lhzb2a) // i/o -// I8255A(config, "ppi8255", 0); + m_igs_mux->set_addrmap(0, &igs017_state::lhzb2a_mux_map); + + // ppi8255 not used for i/o (just video enable)? + + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); // protection + IGS_STRING(config, m_igs_string, 0); + IGS_BITSWAP(config, m_igs_bitswap, 0); m_igs_bitswap->set_val_xor(0x289a); m_igs_bitswap->set_mf_bits(4, 7, 10, 13); @@ -4061,21 +4652,7 @@ void igs017_state::lhzb2a(machine_config &config) IGS_INCDEC(config, m_igs_incdec, 0); // video - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); // VSync 60Hz, HSync 15.3kHz - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(512, 256); - m_screen->set_visarea(0, 512-1, 0, 256-16-1); - m_screen->set_screen_update("igs017_igs031", FUNC(igs017_igs031_device::screen_update)); - m_screen->set_palette("igs017_igs031:palette"); - - IGS017_IGS031(config, m_igs017_igs031, 0); m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::lhzb2a_palette_bitswap)); -// m_igs017_igs031->set_i8255_tag("ppi8255"); - - // sound - SPEAKER(config, "mono").front_center(); - OKIM6295(config, m_oki, XTAL(22'000'000) / 22, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); } @@ -4083,40 +4660,28 @@ void igs017_state::lhzb2a(machine_config &config) void igs017_state::slqz2(machine_config &config) { - M68000(config, m_maincpu, XTAL(22'000'000) / 2); + base_machine_oki(config, 8_MHz_XTAL / 8); + + M68000(config, m_maincpu, 22_MHz_XTAL / 2); m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::slqz2_map); TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::mgcs_interrupt), "screen", 0, 1); - MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) - // i/o - i8255_device &ppi(I8255A(config, "ppi8255")); - ppi.in_pa_callback().set_ioport("COINS"); - ppi.in_pb_callback().set_ioport("DSW1"); - ppi.in_pc_callback().set_ioport("DSW2"); + m_igs_mux->set_addrmap(0, &igs017_state::slqz2_mux_map); + + m_ppi->in_pa_callback().set_ioport("COINS"); + m_ppi->in_pb_callback().set_ioport("DSW1"); + m_ppi->in_pc_callback().set_ioport("DSW2"); + + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); // protection - IGS025(config, m_igs025, 0); - m_igs025->set_external_cb(FUNC(igs017_state::igs025_to_igs022_callback)); + IGS_STRING(config, m_igs_string, 0); IGS022(config, m_igs022, 0); // video - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(512, 256); - m_screen->set_visarea(0, 512-1, 0, 240-1); - m_screen->set_screen_update("igs017_igs031", FUNC(igs017_igs031_device::screen_update)); - m_screen->set_palette("igs017_igs031:palette"); - - IGS017_IGS031(config, m_igs017_igs031, 0); m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::slqz2_palette_bitswap)); - m_igs017_igs031->set_i8255_tag("ppi8255"); - - // sound - SPEAKER(config, "mono").front_center(); - OKIM6295(config, m_oki, XTAL(8'000'000) / 8, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); } @@ -4124,36 +4689,27 @@ void igs017_state::slqz2(machine_config &config) void igs017_state::sdmg2(machine_config &config) { - M68000(config, m_maincpu, XTAL(22'000'000) / 2); + base_machine_oki(config, 22_MHz_XTAL / 22); + + M68000(config, m_maincpu, 22_MHz_XTAL / 2); m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::sdmg2_map); TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::mgcs_interrupt), "screen", 0, 1); - MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) - // i/o - i8255_device &ppi(I8255A(config, "ppi8255")); - ppi.in_pa_callback().set_ioport("DSW1"); - ppi.in_pb_callback().set_ioport("DSW2"); + m_igs_mux->set_addrmap(0, &igs017_state::sdmg2_mux_map); - // video - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); // VSync 60Hz, HSync 15.3kHz - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(512, 256); - m_screen->set_visarea(0, 512-1, 0, 256-16-1); - m_screen->set_screen_update("igs017_igs031", FUNC(igs017_igs031_device::screen_update)); - m_screen->set_palette("igs017_igs031:palette"); + m_ppi->in_pa_callback().set_ioport("DSW1"); + m_ppi->in_pb_callback().set_ioport("DSW2"); + // DSW3 is read but unused (it's not populated on the PCB) - IGS017_IGS031(config, m_igs017_igs031, 0); - m_igs017_igs031->set_i8255_tag("ppi8255"); + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); - // sound - SPEAKER(config, "mono").front_center(); - OKIM6295(config, m_oki, XTAL(22'000'000) / 22, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); + // protection + IGS_INCDEC(config, m_igs_incdec, 0); } -// mgdh +// mgdh, mgdha TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::mgdh_interrupt) { @@ -4168,106 +4724,28 @@ TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::mgdh_interrupt) void igs017_state::mgdha(machine_config &config) { - M68000(config, m_maincpu, XTAL(22'000'000) / 2); - m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::mgdha_map); - TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::mgdh_interrupt), "screen", 0, 1); + base_machine_oki(config, 22_MHz_XTAL / 22); - MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) + M68000(config, m_maincpu, 22_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::mgdh_map); + TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::mgdh_interrupt), "screen", 0, 1); // i/o - i8255_device &ppi(I8255A(config, "ppi8255")); - ppi.in_pa_callback().set_ioport("DSW1"); + m_igs_mux->set_addrmap(0, &igs017_state::mgdha_mux_map); - // video - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(512, 256); - m_screen->set_visarea(0, 512-1, 0, 256-16-1); - m_screen->set_screen_update("igs017_igs031", FUNC(igs017_igs031_device::screen_update)); - m_screen->set_palette("igs017_igs031:palette"); + m_ppi->in_pa_callback().set_ioport("DSW1"); - IGS017_IGS031(config, m_igs017_igs031, 0); - m_igs017_igs031->set_i8255_tag("ppi8255"); - - // sound - SPEAKER(config, "mono").front_center(); - OKIM6295(config, m_oki, XTAL(22'000'000) / 22, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); } - -// tjsb - -void igs017_state::tjsb(machine_config &config) +void igs017_state::mgdh(machine_config &config) { - HD64180RP(config, m_maincpu, XTAL(16'000'000)); - m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::tjsb_map); - m_maincpu->set_addrmap(AS_IO, &igs017_state::tjsb_io); - TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::iqblocka_interrupt), "screen", 0, 1); - - MCFG_MACHINE_RESET_OVERRIDE(igs017_state,iqblocka) - - // i/o - i8255_device &ppi(I8255A(config, "ppi8255")); - ppi.in_pa_callback().set_ioport("DSW1"); - ppi.in_pb_callback().set_ioport("DSW2"); - ppi.in_pc_callback().set_ioport("DSW3"); - - // video - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(512, 256); - m_screen->set_visarea(0, 512-1, 0, 240-1); - m_screen->set_screen_update("igs017_igs031", FUNC(igs017_igs031_device::screen_update)); - m_screen->set_palette("igs017_igs031:palette"); - - IGS017_IGS031(config, m_igs017_igs031, 0); - m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::tjsb_palette_bitswap)); - m_igs017_igs031->set_i8255_tag("ppi8255"); + mgdha(config); - // sound - SPEAKER(config, "mono").front_center(); - YM2413(config, "ymsnd", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.5); + m_igs_mux->set_addrmap(0, &igs017_state::mgdh_mux_map); - OKIM6295(config, m_oki, XTAL(16'000'000) / 16, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); -} - - -// spkrform - -void igs017_state::spkrform(machine_config &config) -{ - HD64180RP(config, m_maincpu, XTAL(16'000'000)); - m_maincpu->set_addrmap(AS_PROGRAM, &igs017_state::spkrform_map); - m_maincpu->set_addrmap(AS_IO, &igs017_state::spkrform_io); - TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::iqblocka_interrupt), "screen", 0, 1); - - MCFG_MACHINE_RESET_OVERRIDE(igs017_state,iqblocka) - - // i/o - i8255_device &ppi(I8255A(config, "ppi8255")); - ppi.in_pa_callback().set_ioport("DSW1"); - ppi.in_pb_callback().set_ioport("DSW2"); - ppi.in_pc_callback().set_ioport("DSW3"); - - // video - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); - m_screen->set_size(512, 256); - m_screen->set_visarea(0, 512-1, 0, 240-1); - m_screen->set_screen_update("igs017_igs031", FUNC(igs017_igs031_device::screen_update)); - m_screen->set_palette("igs017_igs031:palette"); - - IGS017_IGS031(config, m_igs017_igs031, 0); - m_igs017_igs031->set_i8255_tag("ppi8255"); - - // sound - SPEAKER(config, "mono").front_center(); - YM2413(config, "ymsnd", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.5); - - OKIM6295(config, m_oki, XTAL(16'000'000) / 16, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); + // protection (only used for the game id check?) +// IGS_STRING(config, m_igs_string, 0); } @@ -4279,13 +4757,14 @@ void igs017_state::spkrform(machine_config &config) /*************************************************************************** -數字樂園 (Shùzì Lèyuán, V127M) +Shuzi Leyuan (V127M) +數字樂園 (Shùzì Lèyuán) IGS, 1996 PCB Layout ---------- -IGS PCB N0- 0131-4 +IGS PCB NO-0131-4 |---------------------------------------| |uPD1242H VOL U3567 3.579545MHz| | AR17961 | @@ -4325,14 +4804,21 @@ ROM_START( iqblocka ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD( "v.u18", 0x00000, 0x40000, CRC(2e2b7d43) SHA1(cc73f4c8f9a6e2219ee04c9910725558a80b4eb2) ) - ROM_REGION( 0x80000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "cg.u7", 0x000000, 0x080000, CRC(cb48a66e) SHA1(6d597193d1333a97957d5ceec8179a24bedfd928) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + ROM_REGION( 0x100000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "cg.u7", 0x000000, 0x080000, CRC(cb48a66e) SHA1(6d597193d1333a97957d5ceec8179a24bedfd928) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + ROM_FILL( 0x080000, 0x080000, 0xff ) // unpopulated ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0) ROM_LOAD( "text.u8", 0x000000, 0x080000, CRC(48c4f4e6) SHA1(b1e1ca62cf6a99c11a5cc56705eef7e22a3b2740) ) ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "speech.u17", 0x00000, 0x40000, CRC(d9e3d39f) SHA1(bec85d1ac2dfca77453cbca0e7dd53fee8fb438b) ) + + ROM_REGION( 0x2dd, "pld", ROMREGION_ERASE ) + ROM_LOAD( "cq.u24", 0x000, 0x2dd, NO_DUMP ) // PAL22CV10 + + ROM_REGION( 0x15, "igs_fixed_data", 0 ) + ROM_LOAD( "igs_fixed_data.key", 0x00, 0x15, CRC(9159ecbf) SHA1(b6bdb1f327944dfc7f6f71565a24e89517607490) ) ROM_END // English title (IQ Block) and year 1997: @@ -4341,22 +4827,31 @@ ROM_START( iqblockf ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD( "v113fr.u18", 0x00000, 0x40000, CRC(346c68af) SHA1(ceae4c0143c288dc9c1dd1e8a51f1e3371ffa439) ) - ROM_REGION( 0x80000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "cg.u7", 0x000000, 0x080000, CRC(cb48a66e) SHA1(6d597193d1333a97957d5ceec8179a24bedfd928) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + ROM_REGION( 0x100000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "cg.u7", 0x000000, 0x080000, CRC(cb48a66e) SHA1(6d597193d1333a97957d5ceec8179a24bedfd928) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + ROM_FILL( 0x080000, 0x080000, 0xff ) // unpopulated ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "text.u8", 0x000000, 0x080000, CRC(48c4f4e6) SHA1(b1e1ca62cf6a99c11a5cc56705eef7e22a3b2740) ) ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "sp.u17", 0x00000, 0x40000, CRC(71357845) SHA1(25f4f7aebdcc0706018f041d3696322df569b0a3) ) + + ROM_REGION( 0x2dd, "pld", ROMREGION_ERASE ) + ROM_LOAD( "cq.u24", 0x000, 0x2dd, NO_DUMP ) // PAL22CV10 + + ROM_REGION( 0x15, "igs_fixed_data", 0 ) + ROM_LOAD( "igs_fixed_data.key", 0x00, 0x15, CRC(9159ecbf) SHA1(b6bdb1f327944dfc7f6f71565a24e89517607490) ) ROM_END +// IQ Block V110F also exists (undumped) with IGS003e (not 8255) + /*************************************************************************** -Genius 6 +Genius 6 (V110F) IGS, 1998 -IGS PCB N0- 0131-4 +IGS PCB NO-0131-4 |---------------------------------------| |uPD1242H VOL U3567 3.579545MHz| | K668 | @@ -4388,13 +4883,19 @@ ROM_START( genius6 ) ROM_LOAD( "genius6_v110f.u18", 0x00000, 0x40000, CRC(2630ad44) SHA1(37002fa913ad60c59145f5a7692eef8862b9d6eb) ) ROM_REGION( 0x80000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "genius6_cg.u7", 0x000000, 0x080000, CRC(1842d021) SHA1(78bfb5108741d39bd19b603cc97623fba7b2a31e) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + ROM_LOAD( "genius6_cg.u7", 0x000000, 0x080000, CRC(1842d021) SHA1(78bfb5108741d39bd19b603cc97623fba7b2a31e) ) // FIXED BITS (xxxxxxxx0xxxxxxx) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "text.u8", 0x000000, 0x080000, CRC(48c4f4e6) SHA1(b1e1ca62cf6a99c11a5cc56705eef7e22a3b2740) ) // same as iqblocka ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "speech.u17", 0x00000, 0x40000, CRC(d9e3d39f) SHA1(bec85d1ac2dfca77453cbca0e7dd53fee8fb438b) ) // same as iqblocka + + ROM_REGION( 0x2dd, "pld", ROMREGION_ERASE ) + ROM_LOAD( "cq.u24", 0x000, 0x2dd, NO_DUMP ) // PAL22CV10 + + ROM_REGION( 0x15, "igs_fixed_data", 0 ) + ROM_LOAD( "igs_fixed_data.key", 0x00, 0x15, CRC(9159ecbf) SHA1(b6bdb1f327944dfc7f6f71565a24e89517607490) ) ROM_END // strangely identifies as V133F and has 1997 copyright, while the parent is V110F but with 1998 copyright @@ -4403,16 +4904,22 @@ ROM_START( genius6a ) ROM_LOAD( "genius6_v133.u18", 0x00000, 0x40000, CRC(b34ce8c6) SHA1(845e6c4f5b1f06229a4046cf085ce08802458bd8) ) ROM_REGION( 0x80000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "genius6_cg.u7", 0x000000, 0x080000, CRC(1842d021) SHA1(78bfb5108741d39bd19b603cc97623fba7b2a31e) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + ROM_LOAD( "genius6_cg.u7", 0x000000, 0x080000, CRC(1842d021) SHA1(78bfb5108741d39bd19b603cc97623fba7b2a31e) ) // FIXED BITS (xxxxxxxx0xxxxxxx) - ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD( "text.u8", 0x000000, 0x040000, CRC(7716b601) SHA1(363cddd930fdec4821ebfaced64276f8fa943eae) ) // half sized if compared to the parent and identical to its 1st half, confirmed correct + ROM_REGION( 0x40000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD( "text.u8", 0x000000, 0x040000, CRC(7716b601) SHA1(363cddd930fdec4821ebfaced64276f8fa943eae) ) // half sized if compared to the parent and identical to its 1st half, confirmed correct (27c2048) ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "speech.u17", 0x00000, 0x40000, CRC(d9e3d39f) SHA1(bec85d1ac2dfca77453cbca0e7dd53fee8fb438b) ) // same as iqblocka + + ROM_REGION( 0x2dd, "pld", ROMREGION_ERASE ) + ROM_LOAD( "cq.u24", 0x000, 0x2dd, NO_DUMP ) // PAL22CV10 + + ROM_REGION( 0x15, "igs_fixed_data", 0 ) + ROM_LOAD( "igs_fixed_data.key", 0x00, 0x15, CRC(9159ecbf) SHA1(b6bdb1f327944dfc7f6f71565a24e89517607490) ) ROM_END -ROM_START( genius6b ) // PCB N0 - 0132, identical to V133F but for the main CPU ROM +ROM_START( genius6b ) // PCB NO-0132, identical to V133F but for the main CPU ROM ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD( "genius6_v-132f.u18", 0x00000, 0x40000, CRC(231be791) SHA1(1684395dc93902893dca32952c236617ccdbc269) ) @@ -4424,12 +4931,17 @@ ROM_START( genius6b ) // PCB N0 - 0132, identical to V133F but for the main CPU ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "speech.u17", 0x00000, 0x40000, CRC(d9e3d39f) SHA1(bec85d1ac2dfca77453cbca0e7dd53fee8fb438b) ) -ROM_END + ROM_REGION( 0x2dd, "pld", ROMREGION_ERASE ) + ROM_LOAD( "cq.u24", 0x000, 0x2dd, NO_DUMP ) // PAL22CV10 + + ROM_REGION( 0x15, "igs_fixed_data", 0 ) + ROM_LOAD( "igs_fixed_data.key", 0x00, 0x15, CRC(9159ecbf) SHA1(b6bdb1f327944dfc7f6f71565a24e89517607490) ) +ROM_END /*************************************************************************** -Mahjong Tian Jiang Shen Bing +Tian Jiang Shen Bing (V137C) 天將神兵 (Tiān Jiāng Shén Bīng) IGS, 1997 @@ -4439,7 +4951,7 @@ but the 8255 has been replaced with the IGS025 IC PCB Layout ---------- -IGS PCB N0- 0157-2 +IGS PCB NO-0157-2 |---------------------------------------| |uPD1242H VOL U3567 3.579545MHz| | AR17961 | @@ -4484,15 +4996,18 @@ ROM_START( tjsb ) ROM_LOAD( "a0701.u3", 0x00000, 0x400000, CRC(27502a0a) SHA1(cca79e253697f47b688ef781b1b6de9d2945f199) ) // FIXED BITS (xxxxxxxx0xxxxxxx) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD( "text.u6", 0x00000, 0x80000, CRC(3be886b8) SHA1(15b3624ed076640c1828d065b01306a8656f5a9b) ) // BADADDR --xxxxxxxxxxxxxxxxx + ROM_LOAD( "text.u6", 0x00000, 0x80000, CRC(3be886b8) SHA1(15b3624ed076640c1828d065b01306a8656f5a9b) ) // BADADDR --xxxxxxxxxxxxxxxxx ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "s0703.u15", 0x00000, 0x80000, CRC(c6f94d29) SHA1(ec413580240711fc4977dd3c96c288501aa7ef6c) ) + + ROM_REGION( 0xec, "igs_string", 0 ) + ROM_LOAD( "tjsb_string.key", 0x00, 0xec, CRC(412c83a0) SHA1(c09618aabecdde4c77d2b5695799fc89dfb325bc) ) ROM_END /*************************************************************************** -Mahjong Man Guan Caishen +Man Guan Caishen (V103CS) 满贯财神 (Mǎn Guàn Cáishén) IGS, 1998 @@ -4539,18 +5054,21 @@ ROM_START( mgcs ) ROM_LOAD16_WORD_SWAP( "p1500.u8", 0x00000, 0x80000, CRC(a8cb5905) SHA1(37be7d926a1352869632d43943763accd4dec4b7) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "m1501.u23", 0x000000, 0x400000, CRC(96fce058) SHA1(6b87f47d646bad9b3061bdc8a9af65467fdbbc9f) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + ROM_LOAD( "m1501.u23", 0x000000, 0x400000, CRC(96fce058) SHA1(6b87f47d646bad9b3061bdc8a9af65467fdbbc9f) ) // FIXED BITS (xxxxxxx0xxxxxxxx) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "text.u25", 0x00000, 0x80000, CRC(a37f9613) SHA1(812f060ca98a34540c48a180c359c3d0f1c0b5bb) ) ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "s1502.u10", 0x00000, 0x80000, CRC(a8a6ba58) SHA1(59276a8ab4a31812600816c2a43b74bd71394419) ) + + ROM_REGION( 0xec, "igs_string", 0 ) + ROM_LOAD( "mgcs_string.key", 0x00, 0xec, CRC(6cdadd19) SHA1(c2b4ced5d45d0af1ddeeabd0e352fd5383995d32) ) ROM_END /*************************************************************************** -Mahjong Super Da Man Guan 2 +Super Da Man Guan II (China, V754C) IGS, 1997 PCB Layout @@ -4596,8 +5114,8 @@ ROM_START( sdmg2 ) ROM_LOAD16_WORD_SWAP( "p0900.u25", 0x00000, 0x80000,CRC(43366f51) SHA1(48dd965dceff7de15b43c2140226a8b17a792dbc) ) ROM_REGION( 0x280000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "m0901.u5", 0x000000, 0x200000, CRC(9699db24) SHA1(50fc2f173c20b48d10595f01f1e9545f1b13a61b) ) // FIXED BITS (xxxxxxxx0xxxxxxx) - ROM_LOAD( "m0902.u4", 0x200000, 0x080000, CRC(3298b13b) SHA1(13b21ddeed368b7f4fea1408c8fc511244342faf) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + ROM_LOAD( "m0901.u5", 0x000000, 0x200000, CRC(9699db24) SHA1(50fc2f173c20b48d10595f01f1e9545f1b13a61b) ) // FIXED BITS (xxxxxxxx0xxxxxxx) + ROM_LOAD( "m0902.u4", 0x200000, 0x080000, CRC(3298b13b) SHA1(13b21ddeed368b7f4fea1408c8fc511244342faf) ) // FIXED BITS (xxxxxxxx0xxxxxxx) ROM_REGION( 0x20000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "text.u6", 0x000000, 0x020000, CRC(cb34cbc0) SHA1(ceedbdda085fd1acc9a575502bdf7cf998f54f05) ) @@ -4608,7 +5126,7 @@ ROM_END /*************************************************************************** -Mahjong Long Hu Zhengba 2 +Long Hu Zhengba 2 (set 1) 龙虎争霸 (Lóng Hǔ Zhēngbà) IGS, 1998 @@ -4654,38 +5172,44 @@ ROM_START( lhzb2 ) ROM_REGION( 0x80000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "p1100.u30", 0x00000, 0x80000, CRC(68102b25) SHA1(6c1e8d204be0efda0e9b6c2f49b5c6760712475f) ) - ROM_REGION( 0x10000, "igs022", 0 ) // INTERNATIONAL GAMES SYSTEM CO.,LTD - ROM_LOAD( "m1104.u11",0x0000, 0x10000, CRC(794d0276) SHA1(ac903d2faa3fb315438dc8da22c5337611a8790d) ) + ROM_REGION( 0x10000, "igs022", 0 ) + ROM_LOAD( "m1104.u11",0x0000, 0x10000, CRC(794d0276) SHA1(ac903d2faa3fb315438dc8da22c5337611a8790d) ) // INTERNATIONAL GAMES SYSTEM CO.,LTD - ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) // address scrambling - ROM_LOAD16_WORD_SWAP( "m1101.u6", 0x000000, 0x400000, CRC(0114e9d1) SHA1(5b16170d3cd8b8e1662c949b7234fbdd2ca927f7) ) // FIXED BITS (0xxxxxxxxxxxxxxx) + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD16_WORD_SWAP( "m1101.u6", 0x000000, 0x400000, CRC(0114e9d1) SHA1(5b16170d3cd8b8e1662c949b7234fbdd2ca927f7) ) // FIXED BITS (0xxxxxxxxxxxxxxx) - ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) // address scrambling + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD16_WORD_SWAP( "m1103.u8", 0x00000, 0x80000, CRC(4d3776b4) SHA1(fa9b311b1a6ad56e136b66d090bc62ed5003b2f2) ) ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "s1102.u23", 0x00000, 0x80000, CRC(51ffe245) SHA1(849011b186096add657ab20d49d260ec23363ef3) ) + + ROM_REGION( 0xec, "igs_string", 0 ) + ROM_LOAD( "lhzb2_string.key", 0x00, 0xec, CRC(c964dc35) SHA1(81036e0dfa9abad123701ae8939d0d5b6f91b015) ) ROM_END -/* alt hardware, no IGS022 (protection) chip */ +// VS221M: alt hardware, no IGS022 protection chip ROM_START( lhzb2a ) ROM_REGION( 0x80000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "p-4096", 0x00000, 0x80000, CRC(41293f32) SHA1(df4e993f4a458729ade13981e58f32d8116c0082) ) - ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) // address scrambling - ROM_LOAD16_WORD_SWAP( "m1101.u6", 0x000000, 0x400000, CRC(0114e9d1) SHA1(5b16170d3cd8b8e1662c949b7234fbdd2ca927f7) ) // FIXED BITS (0xxxxxxxxxxxxxxx) + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD16_WORD_SWAP( "m1101.u6", 0x000000, 0x400000, CRC(0114e9d1) SHA1(5b16170d3cd8b8e1662c949b7234fbdd2ca927f7) ) // FIXED BITS (0xxxxxxxxxxxxxxx) - ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) // address scrambling + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD16_WORD_SWAP( "m1103.u8", 0x00000, 0x80000, CRC(4d3776b4) SHA1(fa9b311b1a6ad56e136b66d090bc62ed5003b2f2) ) ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "s1102.u23", 0x00000, 0x80000, CRC(51ffe245) SHA1(849011b186096add657ab20d49d260ec23363ef3) ) + + ROM_REGION( 0xec, "igs_string", 0 ) + ROM_LOAD( "lhzb2_string.key", 0x00, 0xec, CRC(c964dc35) SHA1(81036e0dfa9abad123701ae8939d0d5b6f91b015) ) ROM_END /*************************************************************************** -Mahjong Shuang Long Qiang Zhu 2 +Shuang Long Qiang Zhu 2 VS (China, VS203J) 双龙抢珠 (Shuāng Lóng Qiǎng Zhū) IGS, 1998 @@ -4730,29 +5254,32 @@ ROM_START( slqz2 ) ROM_REGION( 0x80000, "maincpu", 0 ) ROM_LOAD16_WORD_SWAP( "p1100.u28", 0x00000, 0x80000, CRC(0b8e5c9e) SHA1(16572bd1163bba4da8a76b10649d2f71e50ad369) ) - ROM_REGION( 0x10000, "igs022", 0 ) // INTERNATIONAL GAMES SYSTEM CO.,LTD - ROM_LOAD( "m1103.u12", 0x00000, 0x10000, CRC(9f3b8d65) SHA1(5ee1ad025474399c2826f21d970e76f25d0fa1fd) ) + ROM_REGION( 0x10000, "igs022", 0 ) + ROM_LOAD( "m1103.u12", 0x00000, 0x10000, CRC(9f3b8d65) SHA1(5ee1ad025474399c2826f21d970e76f25d0fa1fd) ) // INTERNATIONAL GAMES SYSTEM CO.,LTD - ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) // address scrambling - ROM_LOAD16_WORD_SWAP( "m1101.u4", 0x000000, 0x400000, CRC(0114e9d1) SHA1(5b16170d3cd8b8e1662c949b7234fbdd2ca927f7) ) // FIXED BITS (0xxxxxxxxxxxxxxx) + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD16_WORD_SWAP( "m1101.u4", 0x000000, 0x400000, CRC(0114e9d1) SHA1(5b16170d3cd8b8e1662c949b7234fbdd2ca927f7) ) // FIXED BITS (0xxxxxxxxxxxxxxx) - ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) // light address scrambling + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "text.u6", 0x00000, 0x80000, CRC(40d21adf) SHA1(18b202d6330ac89026bec2c9c8224b52540dd48d) ) ROM_REGION( 0x80000, "oki", 0 ) - ROM_LOAD( "s1102.u20", 0x00000, 0x80000, CRC(51ffe245) SHA1(849011b186096add657ab20d49d260ec23363ef3) ) // = s1102.u23 Mahjong Long Hu Zhengba 2 + ROM_LOAD( "s1102.u20", 0x00000, 0x80000, CRC(51ffe245) SHA1(849011b186096add657ab20d49d260ec23363ef3) ) // = s1102.u23 Long Hu Zhengba 2 + + ROM_REGION( 0xec, "igs_string", 0 ) + ROM_LOAD( "slqz2_string.key", 0x00, 0xec, CRC(5ca22f9d) SHA1(a795415016fdcb6329623786dc992ac7b0877ddf) ) ROM_END /*************************************************************************** -Mahjong Man Guan Daheng (V123T1) +Man Guan Daheng (V123T1) 滿貫大亨 (Mǎn Guàn Dàhēng) (c) 1997 IGS PCB Layout ---------- -IGS PCB NO- 0252 +IGS PCB NO-0252 |----------------------------------| | S1002.U22 6264 62256 SW | |TDA1020 FLASH.U19 PAL BATT| @@ -4789,7 +5316,7 @@ ROM_START( mgdha ) ROM_LOAD16_WORD_SWAP( "flash.u19", 0x00000, 0x80000, CRC(ff3aed2c) SHA1(829140e6fc7e4dfc039b0e7b647ce26d59b23b3d) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "m1001.u4", 0x000000, 0x400000, CRC(0cfb60d6) SHA1(e099aca730e7fd91a72915c27e569ad3d21f0d8f) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + ROM_LOAD( "m1001.u4", 0x000000, 0x400000, CRC(0cfb60d6) SHA1(e099aca730e7fd91a72915c27e569ad3d21f0d8f) ) // FIXED BITS (xxxxxxx0xxxxxxxx) ROM_REGION( 0x20000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD16_WORD_SWAP( "text.u6", 0x00000, 0x20000, CRC(db50f8fc) SHA1(e2ce4a42f5bdc0b4b7988ad9e8d14661f17c3d51) ) @@ -4800,12 +5327,12 @@ ROM_END /*************************************************************************** -Mahjong Man Guan Da Heng (V125T1) +Man Guan Daheng (V125T1) 滿貫大亨 (Mǎn Guàn Dàhēng) (c) 1997 IGS No hardware info, no sprites rom for this set. -It has additional protection. +It has an additional game id check at the start. ***************************************************************************/ @@ -4815,10 +5342,10 @@ ROM_START( mgdh ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) // not in this set - ROM_LOAD( "m1001.u4", 0x000000, 0x400000, CRC(0cfb60d6) SHA1(e099aca730e7fd91a72915c27e569ad3d21f0d8f) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + ROM_LOAD( "m1001.u4", 0x000000, 0x400000, CRC(0cfb60d6) SHA1(e099aca730e7fd91a72915c27e569ad3d21f0d8f) ) // FIXED BITS (xxxxxxx0xxxxxxxx) ROM_REGION( 0x20000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD( "igs_512e.u6", 0x00000, 0x20000, CRC(db50f8fc) SHA1(e2ce4a42f5bdc0b4b7988ad9e8d14661f17c3d51) ) // == text.u6 + ROM_LOAD( "igs_512e.u6", 0x00000, 0x20000, CRC(db50f8fc) SHA1(e2ce4a42f5bdc0b4b7988ad9e8d14661f17c3d51) ) // == text.u6 ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "ig2_8836.u14", 0x00000, 0x80000, CRC(ac1f4da8) SHA1(789a2e0b58750292909dabca42c7e5ad72af3db5) ) @@ -4826,7 +5353,7 @@ ROM_END /*************************************************************************** -Taishan (Tarzan) Chuang Tian Guan +Taishan (Tarzan) Chuang Tian Guan (V109C) IGS 1999 PCB Layout @@ -4881,9 +5408,12 @@ ROM_START( tarzanc ) ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "igs_s2102_sp_v102.u14", 0x00000, 0x80000, CRC(90dda82d) SHA1(67fbc1e8d76b85e124136e2f1df09c8b6c5a8f97) ) - ROM_REGION( 0x2dd * 2, "plds", 0 ) + ROM_REGION( 0x2dd * 2, "plds", ROMREGION_ERASE ) ROM_LOAD( "eg.u20", 0x000, 0x2dd, NO_DUMP ) ROM_LOAD( "eg.u21", 0x2dd, 0x2dd, NO_DUMP ) + + ROM_REGION( 0xec, "igs_string", 0 ) + ROM_LOAD( "tarzan_string.key", 0x00, 0xec, CRC(595fe40c) SHA1(0b46983400d237d8bde97a72eaa99b718a03387e) ) ROM_END // sets below are guesswork, assembled from partial dumps... @@ -4893,7 +5423,7 @@ ROM_START( tarzan ) ROM_REGION( 0x40000, "maincpu", 0 ) // V109C TARZAN C (same as tarzanc set) ROM_LOAD( "0228-u16.bin", 0x00000, 0x40000, CRC(e6c552a5) SHA1(f156de9459833474c85a1f5b35917881b390d34c) ) - ROM_REGION( 0x80000, "igs017_igs031:sprites", 0 ) + ROM_REGION( 0x80000, "igs017_igs031:sprites", ROMREGION_ERASE ) ROM_LOAD( "sprites.u15", 0x00000, 0x80000, NO_DUMP ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) @@ -4905,14 +5435,18 @@ ROM_START( tarzan ) ROM_REGION( 0x2dd * 2, "plds", 0 ) ROM_LOAD( "pal1", 0x000, 0x2dd, NO_DUMP ) ROM_LOAD( "pal2", 0x2dd, 0x2dd, NO_DUMP ) + + ROM_REGION( 0xec, "igs_string", 0 ) + ROM_LOAD( "tarzan_string.key", 0x00, 0xec, CRC(595fe40c) SHA1(0b46983400d237d8bde97a72eaa99b718a03387e) ) ROM_END -// IGS NO-0228? +// IGS NO-0228? This allegedly has IGS029 protection ROM_START( tarzana ) - ROM_REGION( 0x80000, "maincpu", 0 ) // V107 TAISAN - ROM_LOAD( "0228-u21.bin", 0x00000, 0x80000, CRC(80aaece4) SHA1(07cad92492c5de36c3915867ed4c6544b1a30c07) ) // 1ST AND 2ND HALF IDENTICAL + ROM_REGION( 0x40000, "maincpu", 0 ) // V107 TAISAN + ROM_LOAD( "0228-u21.bin", 0x00000, 0x40000, CRC(80aaece4) SHA1(07cad92492c5de36c3915867ed4c6544b1a30c07) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x40000 ) - ROM_REGION( 0x80000, "igs017_igs031:sprites", 0 ) + ROM_REGION( 0x80000, "igs017_igs031:sprites", ROMREGION_ERASE ) ROM_LOAD( "sprites.u17", 0x00000, 0x80000, NO_DUMP ) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) @@ -4921,9 +5455,12 @@ ROM_START( tarzana ) ROM_REGION( 0x40000, "oki", ROMREGION_ERASE ) ROM_LOAD( "sound.u16", 0x00000, 0x40000, NO_DUMP ) - ROM_REGION( 0x2dd * 2, "plds", 0 ) + ROM_REGION( 0x2dd * 2, "plds", ROMREGION_ERASE ) ROM_LOAD( "pal1", 0x000, 0x2dd, NO_DUMP ) ROM_LOAD( "pal2", 0x2dd, 0x2dd, NO_DUMP ) + + ROM_REGION( 0xec, "igs_string", 0 ) + ROM_LOAD( "tarzan_string.key", 0x00, 0xec, CRC(595fe40c) SHA1(0b46983400d237d8bde97a72eaa99b718a03387e) ) ROM_END /*************************************************************************** @@ -4977,37 +5514,48 @@ IGS PCB NO-0230-1 ROM_START( starzan ) ROM_REGION( 0x40000, "maincpu", 0 ) - ROM_LOAD( "v100i.u9", 0x00000, 0x40000, CRC(64180bff) SHA1(b08dbe8a17ca33024442ebee41f111c8f98a2109) ) + ROM_LOAD( "sp_tarzan_v100i.u9", 0x00000, 0x40000, CRC(64180bff) SHA1(b08dbe8a17ca33024442ebee41f111c8f98a2109) ) - ROM_REGION( 0x400000, "igs017_igs031:sprites", ROMREGION_ERASEFF ) - ROM_LOAD( "c0057209.u3", 0x00000, 0x400000, NO_DUMP ) // this is also probably the same as tarzanc. Current theory is the 0x400000 mask ROM at u3 is the same for all games of the same type, with EPROM at u2 providing an overlay for game specific sprites - ROM_LOAD( "cg.u2", 0x00000, 0x080000, CRC(884f95f5) SHA1(2e526aa966e90dc696a8b392a5a99e14f03c4bd4) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "igs_a2104_cg_v110.u3", 0x000000, 0x400000, BAD_DUMP CRC(dcbff16f) SHA1(2bf77ef4448c26124c8d8d18bb7ffe4105cfa940) ) // FIXED BITS (xxxxxxx0xxxxxxxx), not dumped for this board, but same label as the one from tarzanc, assuming same contents for now + ROM_LOAD( "sp_tarzan_cg.u2", 0x200000, 0x080000, CRC(884f95f5) SHA1(2e526aa966e90dc696a8b392a5a99e14f03c4bd4) ) // FIXED BITS (xxxxxxx0xxxxxxxx), overlay (handwritten label) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD( "t2105_cg_v110.u11", 0x00000, 0x80000, BAD_DUMP CRC(1d4be260) SHA1(6374c61735144b3ff54d5e490f26adac4a10b14d) ) // not dumped for this board, but same label as the one from tarzanc, assuming same contents for now + ROM_LOAD( "igs_t2105_cg_v110.u11", 0x00000, 0x80000, BAD_DUMP CRC(1d4be260) SHA1(6374c61735144b3ff54d5e490f26adac4a10b14d) ) // not dumped for this board, but same label as the one from tarzanc, assuming same contents for now ROM_REGION( 0x80000, "oki", 0 ) - ROM_LOAD( "s2102_sp_v102.u8", 0x00000, 0x80000, BAD_DUMP CRC(90dda82d) SHA1(67fbc1e8d76b85e124136e2f1df09c8b6c5a8f97) ) // not dumped for this board, but same label as the one from tarzanc, assuming same contents for now + ROM_LOAD( "igs_s2102_sp_v102.u8", 0x00000, 0x80000, BAD_DUMP CRC(90dda82d) SHA1(67fbc1e8d76b85e124136e2f1df09c8b6c5a8f97) ) // not dumped for this board, but same label as the one from tarzanc, assuming same contents for now - ROM_REGION( 0x2dd * 2, "plds", 0 ) - ROM_LOAD( "palce22v10h_tar97_u10-1.u10", 0x000, 0x2dd, NO_DUMP ) - ROM_LOAD( "palce22v10h_tar97_u20.u20", 0x2dd, 0x2dd, NO_DUMP ) + ROM_REGION( 0x2dd * 2, "plds", ROMREGION_ERASE ) + ROM_LOAD( "palce22v10h_tar97_u10-1.u10", 0x000, 0x2dd, NO_DUMP ) // read protected + ROM_LOAD( "palce22v10h_tar97_u20.u20", 0x2dd, 0x2dd, NO_DUMP ) // "" + + ROM_REGION( 0xec, "igs_string", 0 ) + ROM_LOAD( "starzan_string.key", 0x00, 0xec, CRC(b33f5050) SHA1(900d3c48944dbdd95d9e48d74c355e82e00ac012) ) ROM_END -// IGS PCB NO-0281 -// Main CPU is a Zilog Z180 clocked @16MHz (XTAL and EXTAL pins directly tied to a 16MHz crystal) -// OKI MSM6295 (actually a rebadged one marked 'K668 0003') clocked @1MHz, pin 7 is HIGH -// A QFP208 custom ASIC marked 'IGS 031' -// A PLCC68 custom IC marked 'IGS025 A9B2201 9931' -// A Ni-MH 3.6V battery as seen in other IGS hardware +/*************************************************************************** + +Happy Skill (Italy, V611IT) + +IGS PCB NO-0281 + +Main CPU is a Zilog Z180 clocked @16MHz (XTAL and EXTAL pins directly tied to a 16MHz crystal) +OKI MSM6295 (actually a rebadged one marked 'K668 0003') clocked @1MHz, pin 7 is HIGH +A QFP208 custom ASIC marked 'IGS 031' +A PLCC68 custom IC marked 'IGS025 A9B2201 9931' (label: '590H/S V300') +A Ni-MH 3.6V battery as seen in other IGS hardware + +***************************************************************************/ + ROM_START( happyskl ) ROM_REGION( 0x40000, "maincpu", 0 ) - ROM_LOAD( "v611.u8", 0x00000, 0x40000, CRC(1fb3da98) SHA1(60674af9f5c53298b8ef856f1986c905b9bd7b96) ) + ROM_LOAD( "v611.u9", 0x00000, 0x40000, CRC(1fb3da98) SHA1(60674af9f5c53298b8ef856f1986c905b9bd7b96) ) // handwritten label ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "igs_a2701_cg_v100.u3", 0x00000, 0x400000, CRC(f3756a51) SHA1(8dd4677584f309cec4b068be9f9370a7a172a031) ) // FIXED BITS (xxxxxxx0xxxxxxxx) - 1xxxxxxxxxxxxxxxxxxxxx = 0x00 - ROM_LOAD( "happyskill_cg.u2", 0x00000, 0x080000, CRC(297a1893) SHA1(9be9e2cdaba1615ea376f3fb7087bf990e68b3b4) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + ROM_LOAD( "igs_a2701_cg_v100.u3", 0x000000, 0x400000, CRC(f3756a51) SHA1(8dd4677584f309cec4b068be9f9370a7a172a031) ) // FIXED BITS (xxxxxxx0xxxxxxxx) - 1xxxxxxxxxxxxxxxxxxxxx = 0x00 + ROM_LOAD( "happyskill_cg.u2", 0x200000, 0x080000, CRC(297a1893) SHA1(9be9e2cdaba1615ea376f3fb7087bf990e68b3b4) ) // FIXED BITS (xxxxxxx0xxxxxxxx) ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "happyskill_text.u11", 0x00000, 0x80000, CRC(c6f51041) SHA1(81a9a03e92c1c67f299113dec9e05ba77395ea31) ) @@ -5015,55 +5563,56 @@ ROM_START( happyskl ) ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "igs_s2702_sp_v100.u8", 0x00000, 0x80000, CRC(0ec9b1b5) SHA1(b8c7e068ddf6777a184339e6796be33e442a3df4) ) - ROM_REGION( 0x2dd * 2, "plds", 0 ) - ROM_LOAD( "atf22v10c.u10", 0x000, 0x2dd, NO_DUMP ) - ROM_LOAD( "peel22cv10a.u20", 0x2dd, 0x2dd, NO_DUMP ) + ROM_REGION( 0x2dd * 2, "plds", ROMREGION_ERASE ) + ROM_LOAD( "atf22v10c.u10", 0x000, 0x2dd, NO_DUMP ) + ROM_LOAD( "et_u20-c.u20", 0x2dd, 0x2dd, NO_DUMP ) // peel22cv10a ROM_END // PCB was heavily corroded and not working -ROM_START( unkigs ) +ROM_START( cpoker2 ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD( "u9.bin", 0x00000, 0x40000, CRC(8d79eb4d) SHA1(9cad09013f83335ec78c3ff78715bc5d9a989eb7) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) // the following ROM wasn't readable on this PCB, but it's the same as the one in happyskl. Assuming same contents for now ROM_LOAD( "igs_a2701_cg_v100.u3", 0x00000, 0x400000, BAD_DUMP CRC(f3756a51) SHA1(8dd4677584f309cec4b068be9f9370a7a172a031) ) // FIXED BITS (xxxxxxx0xxxxxxxx) - 1xxxxxxxxxxxxxxxxxxxxx = 0x00 - //ROM_LOAD( "u2", 0x00000, 0x080000, NO_DUMP ) // not populated. Never there or removed? Possibly never there, current theory is the 0x400000 mask ROM at u3 is the same for all games of the same type, with EPROM at u2 providing an overlay for game specific sprites + // U2 (overlay) not populated - ROM_REGION( 0x40000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD( "u11.bin", 0x00000, 0x40000, CRC(34475c83) SHA1(376ff68d89c25471483b074dcf7542f42f954e67) ) - ROM_IGNORE(0x040000) // 1xxxxxxxxxxxxxxxxxx = 0x00 + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD( "u11.bin", 0x00000, 0x80000, CRC(34475c83) SHA1(376ff68d89c25471483b074dcf7542f42f954e67) ) // 1xxxxxxxxxxxxxxxxxx = 0x00 - ROM_REGION( 0x80000, "oki", 0 ) // same as happyskl - ROM_LOAD( "igs_s2702_sp_v100.u8", 0x00000, 0x80000, CRC(0ec9b1b5) SHA1(b8c7e068ddf6777a184339e6796be33e442a3df4) ) + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "igs_s2702_sp_v100.u8", 0x00000, 0x80000, CRC(0ec9b1b5) SHA1(b8c7e068ddf6777a184339e6796be33e442a3df4) ) // same as happyskl - ROM_REGION( 0x2dd * 2, "plds", 0 ) - ROM_LOAD( "peel22cv10h.u10", 0x000, 0x2dd, NO_DUMP ) - ROM_LOAD( "peel22cv10h.u20", 0x2dd, 0x2dd, NO_DUMP ) + ROM_REGION( 0x2dd * 2, "plds", ROMREGION_ERASE ) + ROM_LOAD( "peel22cv10h.u10", 0x000, 0x2dd, NO_DUMP ) // PALCE22V10H-25P + ROM_LOAD( "peel22cv10h.u20", 0x2dd, 0x2dd, NO_DUMP ) // PALCE22V10H-25P ROM_END /*************************************************************************** -Super Poker (v100xD03) / Formosa +Super Poker (V100xD03) / Formosa PCB NO-0187 CPU Z8018008psc IGS017 -IGS025 +IGS025 (labels: B2 / FORMOSA) K668 (AD-65) UM3567 (YM2413) -Audio Xtal 3.579545 -CPU Xtal 16Mhz -3 x DSW8 +Audio Xtal 3.579545 MHz +CPU Xtal 16 MHz +3 x DSW8 (SW1-SW3) +Push Button (SW4) +3.6V Battery + Toggle Switch (SW5) ***************************************************************************/ ROM_START( spkrform ) ROM_REGION( 0x40000, "maincpu", 0 ) - ROM_LOAD( "super2in1-v100xd03.u29", 0x00000, 0x40000, CRC(e8f7476c) SHA1(e20241d68d22ee01a65f5d7921fe2291077f081f) ) + ROM_LOAD( "super2in1_v100xd03.u29", 0x00000, 0x40000, CRC(e8f7476c) SHA1(e20241d68d22ee01a65f5d7921fe2291077f081f) ) ROM_REGION( 0x100000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "super2in1.u26", 0x00000, 0x80000, CRC(af3b1d9d) SHA1(ce84b076939d2c9d959cd430d4f5664f32735d60) ) // FIXED BITS (xxxxxxxx0xxxxxxx) @@ -5073,29 +5622,34 @@ ROM_START( spkrform ) ROM_LOAD( "super2in1.u24", 0x00000, 0x40000, CRC(54d68c49) SHA1(faad78779c3a5b4ecb1c733192d9477ce3324f71) ) ROM_REGION( 0x40000, "oki", 0 ) - ROM_LOAD( "super2in1sp.u28", 0x00000, 0x40000, CRC(33e6089d) SHA1(cd1ad01e92c18bbeab3fe3ea9152f8b0a3eb1b29) ) -ROM_END + ROM_LOAD( "super2in1_sp.u28", 0x00000, 0x40000, CRC(33e6089d) SHA1(cd1ad01e92c18bbeab3fe3ea9152f8b0a3eb1b29) ) + ROM_REGION( 0x2dd, "plds", ROMREGION_ERASE ) + ROM_LOAD( "dn.u18", 0x000, 0x2dd, NO_DUMP ) + + ROM_REGION( 0xec, "igs_string", 0 ) + ROM_LOAD( "spkrform_string.key", 0x00, 0xec, CRC(17a9021a) SHA1(41943e08f9c9be49fc3705e6f2702d504ec6d078) ) +ROM_END -GAME( 1996, iqblocka, iqblock, iqblocka, iqblocka, igs017_state, init_iqblocka, ROT0, "IGS", "Shuzi Leyuan (V127M, gambling)", 0 ) -GAME( 1997, iqblockf, iqblock, iqblockf, iqblockf, igs017_state, init_iqblocka, ROT0, "IGS", "IQ Block (V113FR, gambling)", 0 ) -GAME( 1997, mgdh, 0, mgdha, mgdh, igs017_state, init_mgdh, ROT0, "IGS", "Mahjong Man Guan Daheng (Taiwan, V125T1)", MACHINE_IMPERFECT_COLORS ) // wrong colors in betting screen -GAME( 1997, mgdha, mgdh, mgdha, mgdh , igs017_state, init_mgdha, ROT0, "IGS", "Mahjong Man Guan Daheng (Taiwan, V123T1)", 0 ) -GAME( 1997, sdmg2, 0, sdmg2, sdmg2, igs017_state, init_sdmg2, ROT0, "IGS", "Mahjong Super Da Man Guan II (China, V754C)", 0 ) -GAME( 1997, tjsb, 0, tjsb, tjsb, igs017_state, init_tjsb, ROT0, "IGS", "Mahjong Tian Jiang Shen Bing (V137C)", MACHINE_UNEMULATED_PROTECTION ) -GAME( 1998, genius6, 0, genius6, genius6, igs017_state, init_iqblocka, ROT0, "IGS", "Genius 6 (V110F)", 0 ) -GAME( 1997, genius6a, genius6, genius6, genius6, igs017_state, init_iqblocka, ROT0, "IGS", "Genius 6 (V133F)", 0 ) // clone because it has older copyright year -GAME( 1997, genius6b, genius6, genius6, genius6, igs017_state, init_iqblocka, ROT0, "IGS", "Genius 6 (V132F)", 0 ) // " -GAME( 1998, mgcs, 0, mgcs, mgcs, igs017_state, init_mgcs, ROT0, "IGS", "Mahjong Man Guan Caishen (V103CS)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND ) -GAME( 1998, lhzb2, 0, lhzb2, lhzb2, igs017_state, init_lhzb2, ROT0, "IGS", "Mahjong Long Hu Zhengba 2 (set 1)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // 龙虎争霸2 -GAME( 1998, lhzb2a, lhzb2, lhzb2a, lhzb2a, igs017_state, init_lhzb2a, ROT0, "IGS", "Mahjong Long Hu Zhengba 2 (VS221M)", 0 ) // 龙虎争霸2 -GAME( 1998, slqz2, 0, slqz2, slqz2, igs017_state, init_slqz2, ROT0, "IGS", "Mahjong Shuang Long Qiang Zhu 2 (VS203J)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) -GAME( 1999, tarzanc, 0, tarzan, iqblocka, igs017_state, init_tarzan, ROT0, "IGS", "Tarzan Chuang Tian Guan (V109C, set 1)", MACHINE_NOT_WORKING ) // IGS031 protection's game specific parameters not emulated yet, sprites' decryption missing, inputs to be done -GAME( 1999, tarzan, tarzanc, tarzan, iqblocka, igs017_state, init_tarzan, ROT0, "IGS", "Tarzan Chuang Tian Guan (V109C, set 2)", MACHINE_NOT_WORKING ) // IGS031 protection's game specific parameters not emulated yet, sprites' decryption missing, inputs to be done -GAME( 1999, tarzana, tarzanc, tarzan, iqblocka, igs017_state, init_tarzana, ROT0, "IGS", "Tarzan (V107)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // IGS029 needs to be emulated, sprites' decryption missing, inputs to be done -GAME( 2000?, starzan, 0, starzan, starzan, igs017_state, init_starzan, ROT0, "IGS (G.F. Gioca license)", "Super Tarzan (Italy, V100I)", MACHINE_NOT_WORKING ) // IGS031 protection's game specific parameters not emulated yet, incomplete dump, sprites' decryption missing -GAME( 2001?, happyskl, 0, starzan, happyskl, igs017_state, init_happyskl, ROT0, "IGS", "Happy Skill (Italy, V611IT)", MACHINE_NOT_WORKING ) // IGS031 protection's game specific parameters not emulated yet, sprites' decryption missing -GAME( 2001?, unkigs, happyskl, starzan, unkigs, igs017_state, init_unkigs, ROT0, "IGS", "unknown IGS game (V100A)", MACHINE_NOT_WORKING ) // possibly titled 'Champion 2', definitely derived from Happy Skill or vice versa, missing ROM, IGS031 protection's game specific parameters not emulated yet, sprites' decryption missing - -// Parent spk306us in driver spoker.cpp. Move this set to that driver? -GAME( ????, spkrform, spk306us, spkrform, spkrform, igs017_state, init_spkrform, ROT0, "IGS", "Super Poker (v100xD03) / Formosa", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) +} // anonymous namespace + +GAME ( 1996, iqblocka, iqblock, iqblocka, iqblocka, igs017_state, init_iqblocka, ROT0, "IGS", "Shuzi Leyuan (China, V127M, gambling)", 0 ) // 數字樂園 +GAME ( 1997, iqblockf, iqblock, iqblockf, iqblockf, igs017_state, init_iqblocka, ROT0, "IGS", "IQ Block (V113FR, gambling)", 0 ) +GAME ( 1997, mgdh, 0, mgdh, mgdh, igs017_state, init_mgdh, ROT0, "IGS", "Man Guan Daheng (Taiwan, V125T1)", MACHINE_IMPERFECT_COLORS | MACHINE_UNEMULATED_PROTECTION) // 滿貫大亨, wrong colors in betting screen, game id check (patched out) +GAME ( 1997, mgdha, mgdh, mgdha, mgdh, igs017_state, init_mgdha, ROT0, "IGS", "Man Guan Daheng (Taiwan, V123T1)", 0 ) // 滿貫大亨 +GAME ( 1997, sdmg2, 0, sdmg2, sdmg2, igs017_state, init_sdmg2, ROT0, "IGS", "Super Da Man Guan II (China, V754C)", 0 ) +GAME ( 1997, tjsb, 0, tjsb, tjsb, igs017_state, init_tjsb, ROT0, "IGS", "Tian Jiang Shen Bing (China, V137C)", MACHINE_UNEMULATED_PROTECTION ) // 天將神兵, fails the bonus round protection check (if enabled via DSW), see e.g. demo mode +GAME ( 1998, genius6, 0, genius6, genius6, igs017_state, init_iqblocka, ROT0, "IGS", "Genius 6 (V110F)", 0 ) // shows chinese text in puzzle game +GAME ( 1997, genius6a, genius6, genius6, genius6, igs017_state, init_iqblocka, ROT0, "IGS", "Genius 6 (V133F)", 0 ) // clone because it has older copyright year +GAME ( 1997, genius6b, genius6, genius6, genius6, igs017_state, init_iqblocka, ROT0, "IGS", "Genius 6 (V132F)", 0 ) // " +GAME ( 1998, mgcs, 0, mgcs, mgcs, igs017_state, init_mgcs, ROT0, "IGS", "Man Guan Caishen (China, V103CS)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // 满贯财神, finish IGS029 protection +GAME ( 1998, lhzb2, 0, lhzb2, lhzb2, igs017_state, init_lhzb2, ROT0, "IGS", "Long Hu Zhengba 2 (China, set 1)", MACHINE_UNEMULATED_PROTECTION ) // 龙虎争霸2, finish IGS022 protection +GAME ( 1998, lhzb2a, lhzb2, lhzb2a, lhzb2a, igs017_state, init_lhzb2a, ROT0, "IGS", "Long Hu Zhengba 2 (China, VS221M)", 0 ) // 龙虎争霸2 +GAME ( 1998, slqz2, 0, slqz2, slqz2, igs017_state, init_slqz2, ROT0, "IGS", "Shuang Long Qiang Zhu 2 VS (China, VS203J)", MACHINE_UNEMULATED_PROTECTION ) // 双龙抢珠, finish IGS022 protection +GAME ( 1999, tarzanc, 0, tarzan, tarzan, igs017_state, init_tarzanc, ROT0, "IGS", "Tarzan Chuang Tian Guan (China, V109C, set 1)", 0 ) +GAME ( 1999, tarzan, tarzanc, tarzan, tarzan, igs017_state, init_tarzan, ROT0, "IGS", "Tarzan Chuang Tian Guan (China, V109C, set 2)", MACHINE_NOT_WORKING ) // missing sprites and sound rom, imperfect tiles decryption +GAME ( 1999, tarzana, tarzanc, tarzan, tarzan, igs017_state, init_tarzana, ROT0, "IGS", "Tarzan (V107)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // missing IGS029 protection, missing sprites and sound rom +GAMEL( 2000?, starzan, 0, starzan, starzan, igs017_state, init_starzan, ROT0, "IGS (G.F. Gioca license)", "Super Tarzan (Italy, V100I)", 0, layout_igsslot ) +GAMEL( 2000?, happyskl, 0, happyskl, happyskl, igs017_state, init_happyskl, ROT0, "IGS", "Happy Skill (Italy, V611IT)", 0, layout_igspoker ) +GAMEL( 2000?, cpoker2, 0, cpoker2, cpoker2, igs017_state, init_cpoker2, ROT0, "IGS", "Champion Poker 2 (V100A)", 0, layout_igspoker ) +GAME ( 2000?, spkrform, spk306us, spkrform, spkrform, igs017_state, init_spkrform, ROT0, "IGS", "Super Poker (V100xD03) / Formosa", MACHINE_UNEMULATED_PROTECTION ) // poker game enabling forced with a patch. Parent spk306us in driver spoker.cpp diff --git a/src/mame/drivers/macquadra700.cpp b/src/mame/drivers/macquadra700.cpp index eec06d4d949..82e9d692cc5 100644 --- a/src/mame/drivers/macquadra700.cpp +++ b/src/mame/drivers/macquadra700.cpp @@ -249,6 +249,31 @@ void macquadra_state::machine_start() m_6015_timer = timer_alloc(FUNC(macquadra_state::mac_6015_tick), this); m_6015_timer->adjust(attotime::never); + + save_item(NAME(m_cursor_line)); + save_item(NAME(m_dafb_int_status)); + save_item(NAME(m_dafb_scsi1_drq)); + save_item(NAME(m_dafb_scsi2_drq)); + save_item(NAME(m_dafb_mode)); + save_item(NAME(m_dafb_base)); + save_item(NAME(m_dafb_stride)); + save_item(NAME(m_dafb_colors)); + save_item(NAME(m_dafb_count)); + save_item(NAME(m_dafb_clutoffs)); + save_item(NAME(m_dafb_montype)); + save_item(NAME(m_dafb_vbltime)); + save_item(NAME(m_dafb_palette)); + save_item(NAME(m_via2_ca1_hack)); + save_item(NAME(m_nubus_irq_state)); + save_item(NAME(m_adb_irq_pending)); + save_item(NAME(m_hdsel)); + save_item(NAME(m_via_interrupt)); + save_item(NAME(m_via2_interrupt)); + save_item(NAME(m_scc_interrupt)); + save_item(NAME(m_last_taken_interrupt)); + save_item(NAME(m_irq_count)); + save_item(NAME(m_ca2_data)); + save_item(NAME(m_overlay)); } void macquadra_state::machine_reset() @@ -1038,4 +1063,4 @@ ROM_START( macqd700 ) ROM_LOAD( "420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212) ) ROM_END -COMP( 1991, macqd700, 0, 0, macqd700, macadb, macquadra_state, init_macqd700, "Apple Computer", "Macintosh Quadra 700", MACHINE_NOT_WORKING ) +COMP( 1991, macqd700, 0, 0, macqd700, macadb, macquadra_state, init_macqd700, "Apple Computer", "Macintosh Quadra 700", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) diff --git a/src/mame/drivers/namcos10.cpp b/src/mame/drivers/namcos10.cpp index a68163c213d..369f9c6003e 100644 --- a/src/mame/drivers/namcos10.cpp +++ b/src/mame/drivers/namcos10.cpp @@ -1276,6 +1276,18 @@ ROM_START( sekaikh ) ROM_FILL( 0x0000000, 0x400000, 0x55 ) ROM_REGION16_LE( 0x2100000, "user2", 0 ) /* main prg */ + ROM_LOAD( "0.8e", 0x0000000, 0x1080000, CRC(b0cc4a4f) SHA1(41974931901090811e07f18c04e2af853c308f88) ) + ROM_LOAD( "1.8d", 0x1080000, 0x1080000, CRC(65c4a8b4) SHA1(c7fefc32604bb47519a05cdb6c8b0f50034e0efd) ) + + ROM_REGION( 0x8000, "mgexio", 0 ) + ROM_LOAD( "m48z35y.ic11", 0x0000, 0x8000, CRC(e0e52ffc) SHA1(557490e2f286773a945851f44ed0214de731cd75) ) +ROM_END + +ROM_START( sekaikha ) + ROM_REGION32_LE( 0x400000, "maincpu:rom", 0 ) /* bios */ + ROM_FILL( 0x0000000, 0x400000, 0x55 ) + + ROM_REGION16_LE( 0x2100000, "user2", 0 ) /* main prg */ ROM_LOAD( "0.8e", 0x0000000, 0x1080000, CRC(e32c36ac) SHA1(d762723b6ecf65c8cb7c85c25d9a1fbbcdcfd27a) ) ROM_LOAD( "1.8d", 0x1080000, 0x1080000, CRC(7cb38ece) SHA1(e21fbc9ff09ca51e1857e32318b95107ae4b3f0b) ) @@ -1368,7 +1380,8 @@ GAME( 2002, gamsharaj, gamshara, ns10_gamshara, namcos10, namcos10_state, i GAME( 2003, nflclsfb, 0, ns10_nflclsfb, namcos10, namcos10_state, init_nflclsfb, ROT0, "Namco", "NFL Classic Football (US, NCF3 Ver.A.)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) GAME( 2003, pacmball, 0, namcos10_memn, namcos10, namcos10_state, empty_init, ROT0, "Namco", "Pacman BALL (PMB2 Ver.A.)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) GAME( 2003, konotako, 0, ns10_konotako, namcos10, namcos10_state, init_konotako, ROT0, "Mitchell", "Kono Tako (10021 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) -GAME( 2004, sekaikh, 0, namcos10_memn, namcos10, namcos10_state, empty_init, ROT0, "Namco", "Sekai Kaseki Hakken (Japan, SKH1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) +GAME( 2004, sekaikh, 0, namcos10_memn, namcos10, namcos10_state, empty_init, ROT0, "Namco", "Sekai Kaseki Hakken (Japan, SKH1 Ver.B)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) +GAME( 2004, sekaikha, sekaikh, namcos10_memn, namcos10, namcos10_state, empty_init, ROT0, "Namco", "Sekai Kaseki Hakken (Japan, SKH1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) GAME( 2004, taiko6, 0, namcos10_memn, namcos10, namcos10_state, empty_init, ROT0, "Namco", "Taiko no Tatsujin 6 (Japan, TK61 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) GAME( 2006, keroro, 0, namcos10_memn, namcos10, namcos10_state, empty_init, ROT0, "Namco", "Keroro Gunso Chikyu Shinryaku Shirei Dearimasu! (KRG1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) // ケロロ軍曹 地球侵略指令…であります! GAME( 2007, gegemdb, 0, namcos10_memn, namcos10, namcos10_state, empty_init, ROT0, "Namco", "Gegege no Kitaro Yokai Yokocho Matsuri De Batoru Ja (GYM1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) // ゲゲゲの鬼太郎 妖怪横丁まつりでバトルじゃ diff --git a/src/mame/drivers/patinho_feio.cpp b/src/mame/drivers/patinho_feio.cpp index dc52a3bf575..51d423f8f3f 100644 --- a/src/mame/drivers/patinho_feio.cpp +++ b/src/mame/drivers/patinho_feio.cpp @@ -248,6 +248,7 @@ void patinho_feio_state::patinho_feio(machine_config &config) PATO_FEIO_CPU(config, m_maincpu, 500000); m_maincpu->rc_read().set_ioport("RC"); m_maincpu->buttons_read().set_ioport("BUTTONS"); + m_maincpu->set_update_panel_cb(FUNC(patinho_feio_state::update_panel)); /* Printer */ // m_maincpu->iodev_write<5>().set(FUNC(patinho_feio_state::printer_data_w)); diff --git a/src/mame/drivers/punchout.cpp b/src/mame/drivers/punchout.cpp index 23887ed219d..dcc456f951f 100644 --- a/src/mame/drivers/punchout.cpp +++ b/src/mame/drivers/punchout.cpp @@ -286,8 +286,8 @@ static INPUT_PORTS_START( punchout ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // this should be COIN2? only works on Italian bootleg though + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_START("DSW2") @@ -343,6 +343,9 @@ static INPUT_PORTS_START( spnchout ) PORT_MODIFY("IN0") PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON4 ) + PORT_MODIFY("IN1") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_MODIFY("DSW1") PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:!1,!2,!3,!4") PORT_DIPSETTING( 0x08, DEF_STR( 6C_1C ) ) /* Not documented */ @@ -377,7 +380,6 @@ static INPUT_PORTS_START( armwrest ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 ) /* Coinage: diff --git a/src/mame/drivers/pwrview.cpp b/src/mame/drivers/pwrview.cpp index 77648b5bb18..93bbaaf677d 100644 --- a/src/mame/drivers/pwrview.cpp +++ b/src/mame/drivers/pwrview.cpp @@ -88,7 +88,7 @@ private: u8 m_c080; u8 m_errcode; u16 m_vramwin[2]; - bool m_dtr; + bool m_dtr, m_rtsa, m_rtsb; bool m_rts; emu_timer *m_tmr0ext; emu_timer *m_tmrkbd; @@ -300,6 +300,9 @@ u8 pwrview_state::unk3_r(offs_t offset) case 2: ret = (m_rts ? 0 : 0x40) | (m_dtr ? 0 : 0x80) | 0x20; break; + case 3: + ret = m_sio->m1_r(); + break; } return ret; } @@ -483,7 +486,6 @@ void pwrview_state::pwrview(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &pwrview_state::pwrview_map); m_maincpu->set_addrmap(AS_OPCODES, &pwrview_state::pwrview_fetch_map); m_maincpu->set_addrmap(AS_IO, &pwrview_state::pwrview_io); - m_maincpu->irqa_cb().set([this] (int state) { if(state) m_sio->m1_r(); }); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_physical_aspect(3, 4); // Portrait CRT @@ -494,10 +496,10 @@ void pwrview_state::pwrview(machine_config &config) m_pit->set_clk<0>(XTAL(16'000'000)/16); // clocks unknown, fix above when found m_pit->set_clk<1>(XTAL(16'000'000)/16); m_pit->set_clk<2>(XTAL(16'000'000)/16); - m_pit->out_handler<1>().set(m_sio, FUNC(z80sio_device::rxca_w)); - m_pit->out_handler<1>().append(m_sio, FUNC(z80sio_device::rxcb_w)); - m_pit->out_handler<1>().append(m_sio, FUNC(z80sio_device::txca_w)); - m_pit->out_handler<1>().append(m_sio, FUNC(z80sio_device::txcb_w)); + m_pit->out_handler<1>().set([this](int state){ if (!m_rtsa) m_sio->rxca_w(state); }); //HACK: prevent sdlc_receive from finding sync immediately because wr7 is 0 when rx is enabled + m_pit->out_handler<1>().append([this](int state){ if (!m_rtsb) m_sio->rxcb_w(state); }); + m_pit->out_handler<1>().append([this](int state){ if (!m_rtsa) m_sio->txca_w(state); }); + m_pit->out_handler<1>().append([this](int state){ if (!m_rtsb) m_sio->txcb_w(state); }); // floppy disk controller UPD765A(config, "fdc", 8'000'000, true, true); // Rockwell R7675P @@ -514,6 +516,12 @@ void pwrview_state::pwrview(machine_config &config) Z80SIO(config, m_sio, 4000000); // Z8442BPS (SIO/2) m_sio->out_int_callback().set(m_maincpu, FUNC(i80186_cpu_device::int2_w)); + m_sio->out_txda_callback().set([this](int state){ m_sio->rxa_w(state); }); // TODO: find loopback control reg + m_sio->out_rtsa_callback().set([this](int state){ m_rtsa = state; }); + m_sio->out_txdb_callback().set([this](int state){ m_sio->rxb_w(state); }); + m_sio->out_rtsb_callback().set([this](int state){ m_rtsb = state; }); + m_sio->out_wrdya_callback().set(m_maincpu, FUNC(i80186_cpu_device::drq1_w)).invert(); + m_sio->out_wrdyb_callback().set(m_maincpu, FUNC(i80186_cpu_device::drq1_w)).invert(); hd6845s_device &crtc(HD6845S(config, "crtc", XTAL(64'000'000)/64)); // clock unknown crtc.set_char_width(62); diff --git a/src/mame/drivers/sderby.cpp b/src/mame/drivers/sderby.cpp index 7008cbc210a..d57425e71e5 100644 --- a/src/mame/drivers/sderby.cpp +++ b/src/mame/drivers/sderby.cpp @@ -11,9 +11,12 @@ Supported games: - Super Derby, 1996, Playmark. - Scacco Matto / Space Win, 1996, Playmark. - Croupier (Playmark Roulette), 1997, Playmark. + Lucky Boom 1996, Playmark. + Scacco Matto / Space Win, 1996, Playmark. + Shiny Golds, 1996, Playmark. + Super Derby (2 sets), 1996, Playmark. + Croupier (Playmark Roulette) (2 sets), 1997, Playmark. + Magic Touch, 1998, Playmark. ******************************************************************************************** @@ -54,71 +57,269 @@ TO DO : - - figure out the reads from 0x308002.w and 0x30800e.w (see sderby_input_r read handler) - (by default, demo sounds are OFF, so change this in the "test mode") - + - figure out the reads from 0x308002.w and 0x30800e.w (see input_r read handler) + (by default, demo sounds are OFF, so change this in the "test mode"); + - dump and hook up the MCU for croupier; + - almost everything for magictch. To enter gameplay just do PC=29c2 when it enters a loop at 0x29c0 *******************************************************************************************/ #include "emu.h" -#include "includes/sderby.h" #include "cpu/m68000/m68000.h" #include "machine/nvram.h" #include "sound/okim6295.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" #include "pmroulet.lh" #include "sderby.lh" #include "spacewin.lh" -/*************************** -* R/W Handlers * -***************************/ +// configurable logging +#define LOG_INPUTS (1U << 1) +#define LOG_CROUPIER_MCU (1U << 2) + +//#define VERBOSE (LOG_GENERAL | LOG_INPUTS | LOG_CROUPIER_MCU) + +#include "logmacro.h" -uint16_t sderby_state::sderby_input_r(offs_t offset) +#define LOGINPUTS(...) LOGMASKED(LOG_INPUTS, __VA_ARGS__) +#define LOGCROUPIERMCU(...) LOGMASKED(LOG_CROUPIER_MCU, __VA_ARGS__) + + +namespace { + +class sderby_state : public driver_device { - switch (offset) +public: + sderby_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_bg_videoram(*this, "bg_videoram"), + m_md_videoram(*this, "md_videoram"), + m_fg_videoram(*this, "fg_videoram"), + m_spriteram(*this, "spriteram"), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_in(*this, "IN%u", 0U), + m_lamps(*this, "lamp%u", 1U) + { } + + + void luckboom(machine_config &config); + void magictch(machine_config &config); + void pmroulet(machine_config &config); + void sderby(machine_config &config); + void sderbya(machine_config &config); + void shinygld(machine_config &config); + void spacewin(machine_config &config); + +protected: + virtual void machine_start() override { m_lamps.resolve(); } + virtual void video_start() override; + +private: + required_shared_ptr<uint16_t> m_bg_videoram; + required_shared_ptr<uint16_t> m_md_videoram; + required_shared_ptr<uint16_t> m_fg_videoram; + required_shared_ptr<uint16_t> m_spriteram; + + required_device<cpu_device> m_maincpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; + + optional_ioport_array<3> m_in; + output_finder<7> m_lamps; + + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_md_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + + uint16_t m_scroll[6]{}; + + uint16_t input_r(offs_t offset); + uint16_t roulette_input_r(offs_t offset); + uint16_t rprot_r(); + void rprot_w(uint16_t data); + void sderby_out_w(uint16_t data); + void scmatto_out_w(uint16_t data); + void roulette_out_w(uint16_t data); + void bg_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void md_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void fg_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_md_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pmroulet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void luckboom_map(address_map &map); + void magictch_map(address_map &map); + void roulette_map(address_map &map); + void sderby_map(address_map &map); + void sderbya_map(address_map &map); + void shinygld_map(address_map &map); + void spacewin_map(address_map &map); +}; + +// video + + +TILE_GET_INFO_MEMBER(sderby_state::get_bg_tile_info) +{ + int tileno = m_bg_videoram[tile_index * 2]; + int colour = m_bg_videoram[tile_index * 2 + 1] & 0x0f; + + tileinfo.set(1, tileno, colour, 0); +} + +void sderby_state::bg_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_bg_videoram[offset]); + m_bg_tilemap->mark_tile_dirty(offset / 2); +} + + +TILE_GET_INFO_MEMBER(sderby_state::get_md_tile_info) +{ + int tileno = m_md_videoram[tile_index * 2]; + int colour = m_md_videoram[tile_index * 2 + 1] & 0x0f; + + tileinfo.set(1, tileno, colour + 16, 0); +} + +void sderby_state::md_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_md_videoram[offset]); + m_md_tilemap->mark_tile_dirty(offset / 2); +} + + +TILE_GET_INFO_MEMBER(sderby_state::get_fg_tile_info) +{ + int tileno = m_fg_videoram[tile_index * 2]; + int colour = m_fg_videoram[tile_index * 2 + 1] & 0x0f; + + tileinfo.set(0, tileno, colour + 32, 0); +} + +void sderby_state::fg_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + COMBINE_DATA(&m_fg_videoram[offset]); + m_fg_tilemap->mark_tile_dirty(offset / 2); +} + + +void sderby_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int height = m_gfxdecode->gfx(0)->height(); + int colordiv = m_gfxdecode->gfx(0)->granularity() / 16; + + for (int offs = 4; offs < m_spriteram.bytes() / 2; offs += 4) { - case 0x00 >> 1: - return ioport("IN0")->read(); - case 0x02 >> 1: - return 0xffff; // to avoid game to reset (needs more work) + int sy = m_spriteram[offs + 3 - 4]; // -4? what the... ??? + if (sy == 0x2000) return; // end of list marker + + int flipx = sy & 0x4000; + int sx = (m_spriteram[offs + 1] & 0x01ff) - 16 - 7; + sy = (256 - 8 - height - sy) & 0xff; + int code = m_spriteram[offs + 2]; + int color = (m_spriteram[offs + 1] & 0x3e00) >> 9; + + m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, + code, + color / colordiv + 48, + flipx, 0, + sx, sy, 0); } +} - logerror("sderby_input_r : offset = %x - PC = %06x\n",offset*2,m_maincpu->pc()); - return 0xffff; +void sderby_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sderby_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); + m_md_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sderby_state::get_md_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); + + m_md_tilemap->set_transparent_pen(0); + + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sderby_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_fg_tilemap->set_transparent_pen(0); + + save_item(NAME(m_scroll)); +} + +uint32_t sderby_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); + m_md_tilemap->draw(screen, bitmap, cliprect, 0, 0); + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + return 0; } -uint16_t sderby_state::sderbya_input_r(offs_t offset) +uint32_t sderby_state::screen_update_pmroulet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + m_md_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} + + +void sderby_state::scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + data = COMBINE_DATA(&m_scroll[offset]); + + switch (offset) + { + case 0: m_fg_tilemap->set_scrollx(0, data + 2); break; + case 1: m_fg_tilemap->set_scrolly(0, data - 8); break; + case 2: m_md_tilemap->set_scrollx(0, data + 4); break; + case 3: m_md_tilemap->set_scrolly(0, data - 8); break; + case 4: m_bg_tilemap->set_scrollx(0, data + 6); break; + case 5: m_bg_tilemap->set_scrolly(0, data - 8); break; + } +} + + +// machine + +/*************************** +* R/W Handlers * +***************************/ + +uint16_t sderby_state::input_r(offs_t offset) { switch (offset) { case 0x00 >> 1: - return ioport("IN0")->read(); + return m_in[0]->read(); case 0x02 >> 1: return 0xffff; // to avoid game to reset (needs more work) } - logerror("sderby_input_r : offset = %x - PC = %06x\n",offset*2,m_maincpu->pc()); + LOGINPUTS("input_r : offset = %x - PC = %06x\n", offset * 2, m_maincpu->pc()); return 0xffff; } - uint16_t sderby_state::roulette_input_r(offs_t offset) { switch (offset) { case 0x00 >> 1: - return ioport("IN0")->read(); + return m_in[0]->read(); case 0x02 >> 1: - return ioport("IN1")->read(); + return m_in[1]->read(); case 0x04 >> 1: - return ioport("IN2")->read(); + return m_in[2]->read(); } return 0xffff; @@ -136,7 +337,7 @@ uint16_t sderby_state::roulette_input_r(offs_t offset) Writes to the MCU are always the same values. At beginning, the code writes 3 values: 0x53, 0x5a and 0x0d. - Then, whith each placed bet the code normally writes 0x4e. + Then, with each placed bet the code normally writes 0x4e. After that, there are 2 reads expecting the MCU response. Most probably there is a shared RAM there for communication, @@ -148,7 +349,7 @@ uint16_t sderby_state::roulette_input_r(offs_t offset) uint16_t sderby_state::rprot_r() { - logerror("rprot_r : offset = %02x\n",m_maincpu->pc()); + LOGCROUPIERMCU("rprot_r : offset = %02x\n", m_maincpu->pc()); /* This is the only mask I found that allow a normal play. Using other values, the game hangs waiting for response, @@ -162,7 +363,7 @@ uint16_t sderby_state::rprot_r() void sderby_state::rprot_w(uint16_t data) { - logerror("rprot_w %02x\n", data); + LOGCROUPIERMCU("rprot_w %02x\n", data); } @@ -206,9 +407,9 @@ void sderby_state::sderby_out_w(uint16_t data) x--- ---- End of Race lamp. */ - m_lamps[0] = BIT(data, 0); /* Lamp 1 - START */ - m_lamps[1] = BIT(data, 1); /* Lamp 2 - BET */ - m_lamps[2] = BIT(data, 15); /* Lamp 3 - END OF RACE */ + m_lamps[0] = BIT(data, 0); // Lamp 1 - START + m_lamps[1] = BIT(data, 1); // Lamp 2 - BET + m_lamps[2] = BIT(data, 15); // Lamp 3 - END OF RACE machine().bookkeeping().coin_counter_w(0, data & 0x2000); } @@ -251,13 +452,13 @@ void sderby_state::scmatto_out_w(uint16_t data) --x- ---- Coin counter. */ - m_lamps[0] = BIT(data, 0); /* Lamp 1 - HOLD 1 */ - m_lamps[1] = BIT(data, 1); /* Lamp 2 - HOLD 2 */ - m_lamps[2] = BIT(data, 2); /* Lamp 3 - HOLD 3 */ - m_lamps[3] = BIT(data, 3); /* Lamp 4 - HOLD 4 */ - m_lamps[4] = BIT(data, 4); /* Lamp 5 - HOLD 5 */ - m_lamps[5] = BIT(data, 5); /* Lamp 6 - START */ - m_lamps[6] = BIT(data, 6); /* Lamp 7 - BET */ + m_lamps[0] = BIT(data, 0); // Lamp 1 - HOLD 1 + m_lamps[1] = BIT(data, 1); // Lamp 2 - HOLD 2 + m_lamps[2] = BIT(data, 2); // Lamp 3 - HOLD 3 + m_lamps[3] = BIT(data, 3); // Lamp 4 - HOLD 4 + m_lamps[4] = BIT(data, 4); // Lamp 5 - HOLD 5 + m_lamps[5] = BIT(data, 5); // Lamp 6 - START + m_lamps[6] = BIT(data, 6); // Lamp 7 - BET machine().bookkeeping().coin_counter_w(0, data & 0x2000); } @@ -287,8 +488,8 @@ void sderby_state::roulette_out_w(uint16_t data) ---- x--- Unknown (always activated). */ - m_lamps[0] = BIT(data, 0); /* Lamp 1 - START */ - m_lamps[1] = BIT(data, 1); /* Lamp 2 - BET */ + m_lamps[0] = BIT(data, 0); // Lamp 1 - START + m_lamps[1] = BIT(data, 1); // Lamp 2 - BET } @@ -299,18 +500,18 @@ void sderby_state::roulette_out_w(uint16_t data) void sderby_state::sderby_map(address_map &map) { map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x100fff).ram().w(FUNC(sderby_state::sderby_videoram_w)).share("videoram"); /* bg */ - map(0x101000, 0x101fff).ram().w(FUNC(sderby_state::sderby_md_videoram_w)).share("md_videoram"); /* mid */ - map(0x102000, 0x103fff).ram().w(FUNC(sderby_state::sderby_fg_videoram_w)).share("fg_videoram"); /* fg */ - map(0x104000, 0x10400b).w(FUNC(sderby_state::sderby_scroll_w)); - map(0x10400c, 0x10400d).nopw(); /* ??? - check code at 0x000456 (executed once at startup) */ - map(0x10400e, 0x10400f).nopw(); /* ??? - check code at 0x000524 (executed once at startup) */ - map(0x200000, 0x200fff).ram().share("spriteram"); - map(0x308000, 0x30800d).r(FUNC(sderby_state::sderby_input_r)); - map(0x308008, 0x308009).w(FUNC(sderby_state::sderby_out_w)); /* output port */ + map(0x100000, 0x100fff).ram().w(FUNC(sderby_state::bg_videoram_w)).share(m_bg_videoram); + map(0x101000, 0x101fff).ram().w(FUNC(sderby_state::md_videoram_w)).share(m_md_videoram); + map(0x102000, 0x103fff).ram().w(FUNC(sderby_state::fg_videoram_w)).share(m_fg_videoram); + map(0x104000, 0x10400b).w(FUNC(sderby_state::scroll_w)); + map(0x10400c, 0x10400d).nopw(); // ??? - check code at 0x000456 (executed once at startup) + map(0x10400e, 0x10400f).nopw(); // ??? - check code at 0x000524 (executed once at startup) + map(0x200000, 0x200fff).ram().share(m_spriteram); + map(0x308000, 0x30800d).r(FUNC(sderby_state::input_r)); + map(0x308008, 0x308009).w(FUNC(sderby_state::sderby_out_w)); map(0x30800f, 0x30800f).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x380000, 0x380fff).w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x500000, 0x500001).nopw(); /* unknown... write 0x01 in game, and 0x00 on reset */ + map(0x500000, 0x500001).nopw(); map(0xd00000, 0xd007ff).ram().share("nvram"); map(0xffc000, 0xffffff).ram(); } @@ -318,18 +519,18 @@ void sderby_state::sderby_map(address_map &map) void sderby_state::sderbya_map(address_map &map) { map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x100fff).ram().w(FUNC(sderby_state::sderby_videoram_w)).share("videoram"); /* bg */ - map(0x101000, 0x101fff).ram().w(FUNC(sderby_state::sderby_md_videoram_w)).share("md_videoram"); /* mid */ - map(0x102000, 0x103fff).ram().w(FUNC(sderby_state::sderby_fg_videoram_w)).share("fg_videoram"); /* fg */ - map(0x104000, 0x10400b).w(FUNC(sderby_state::sderby_scroll_w)); - map(0x10400c, 0x10400d).nopw(); /* ??? - check code at 0x000456 (executed once at startup) */ - map(0x10400e, 0x10400f).nopw(); /* ??? - check code at 0x000524 (executed once at startup) */ - map(0x200000, 0x200fff).ram().share("spriteram"); - map(0x308000, 0x30800d).r(FUNC(sderby_state::sderbya_input_r)); - map(0x308008, 0x308009).w(FUNC(sderby_state::sderby_out_w)); /* output port */ + map(0x100000, 0x100fff).ram().w(FUNC(sderby_state::bg_videoram_w)).share(m_bg_videoram); + map(0x101000, 0x101fff).ram().w(FUNC(sderby_state::md_videoram_w)).share(m_md_videoram); + map(0x102000, 0x103fff).ram().w(FUNC(sderby_state::fg_videoram_w)).share(m_fg_videoram); + map(0x104000, 0x10400b).w(FUNC(sderby_state::scroll_w)); + map(0x10400c, 0x10400d).nopw(); // ??? - check code at 0x000456 (executed once at startup) + map(0x10400e, 0x10400f).nopw(); // ??? - check code at 0x000524 (executed once at startup) + map(0x200000, 0x200fff).ram().share(m_spriteram); + map(0x308000, 0x30800d).r(FUNC(sderby_state::input_r)); + map(0x308008, 0x308009).w(FUNC(sderby_state::sderby_out_w)); map(0x30800f, 0x30800f).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x380000, 0x380fff).w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x300000, 0x300001).nopw(); /* unknown... write 0x01 in game, and 0x00 on reset */ //MOD + map(0x300000, 0x300001).nopw(); // unknown... write 0x01 in game, and 0x00 on reset //MOD map(0xcf0000, 0xcf07ff).ram().share("nvram"); map(0xcfc000, 0xcfffff).ram(); //MOD } @@ -338,18 +539,18 @@ void sderby_state::sderbya_map(address_map &map) void sderby_state::luckboom_map(address_map &map) { map(0x000000, 0x07ffff).rom(); - map(0x100000, 0x100fff).ram().w(FUNC(sderby_state::sderby_videoram_w)).share("videoram"); /* bg */ - map(0x101000, 0x101fff).ram().w(FUNC(sderby_state::sderby_md_videoram_w)).share("md_videoram"); /* mid */ - map(0x102000, 0x103fff).ram().w(FUNC(sderby_state::sderby_fg_videoram_w)).share("fg_videoram"); /* fg */ - map(0x104000, 0x10400b).w(FUNC(sderby_state::sderby_scroll_w)); - map(0x10400c, 0x10400d).nopw(); /* ??? - check code at 0x000456 (executed once at startup) */ - map(0x10400e, 0x10400f).nopw(); /* ??? - check code at 0x000524 (executed once at startup) */ - map(0x200000, 0x200fff).ram().share("spriteram"); - map(0x308000, 0x30800d).r(FUNC(sderby_state::sderby_input_r)); - map(0x308008, 0x308009).w(FUNC(sderby_state::sderby_out_w)); /* output port */ + map(0x100000, 0x100fff).ram().w(FUNC(sderby_state::bg_videoram_w)).share(m_bg_videoram); + map(0x101000, 0x101fff).ram().w(FUNC(sderby_state::md_videoram_w)).share(m_md_videoram); + map(0x102000, 0x103fff).ram().w(FUNC(sderby_state::fg_videoram_w)).share(m_fg_videoram); + map(0x104000, 0x10400b).w(FUNC(sderby_state::scroll_w)); + map(0x10400c, 0x10400d).nopw(); // ??? - check code at 0x000456 (executed once at startup) + map(0x10400e, 0x10400f).nopw(); // ??? - check code at 0x000524 (executed once at startup) + map(0x200000, 0x200fff).ram().share(m_spriteram); + map(0x308000, 0x30800d).r(FUNC(sderby_state::input_r)); + map(0x308008, 0x308009).w(FUNC(sderby_state::sderby_out_w)); map(0x30800f, 0x30800f).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x380000, 0x380fff).w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x500000, 0x500001).nopw(); /* unknown... write 0x01 in game, and 0x00 on reset */ + map(0x500000, 0x500001).nopw(); // unknown... write 0x01 in game, and 0x00 on reset map(0xe00000, 0xe007ff).ram().share("nvram"); map(0xff0000, 0xffffff).ram(); } @@ -357,67 +558,83 @@ void sderby_state::luckboom_map(address_map &map) void sderby_state::spacewin_map(address_map &map) { map(0x000000, 0x03ffff).rom(); - map(0x100000, 0x100fff).ram().w(FUNC(sderby_state::sderby_videoram_w)).share("videoram"); /* bg */ - map(0x101000, 0x101fff).ram().w(FUNC(sderby_state::sderby_md_videoram_w)).share("md_videoram"); /* mid */ - map(0x102000, 0x103fff).ram().w(FUNC(sderby_state::sderby_fg_videoram_w)).share("fg_videoram"); /* fg */ - map(0x104000, 0x10400b).w(FUNC(sderby_state::sderby_scroll_w)); /* tilemaps offset control */ - map(0x10400c, 0x10400d).nopw(); /* seems another video register. constantly used */ - map(0x10400e, 0x10400f).nopw(); /* seems another video register. constantly used */ - map(0x104010, 0x105fff).nopw(); /* unknown */ - map(0x300000, 0x300001).nopw(); /* unknown... write 0x01 in game, and 0x00 on reset */ - map(0x308000, 0x30800d).r(FUNC(sderby_state::sderby_input_r)); - map(0x308008, 0x308009).w(FUNC(sderby_state::scmatto_out_w)); /* output port */ + map(0x100000, 0x100fff).ram().w(FUNC(sderby_state::bg_videoram_w)).share(m_bg_videoram); + map(0x101000, 0x101fff).ram().w(FUNC(sderby_state::md_videoram_w)).share(m_md_videoram); + map(0x102000, 0x103fff).ram().w(FUNC(sderby_state::fg_videoram_w)).share(m_fg_videoram); + map(0x104000, 0x10400b).w(FUNC(sderby_state::scroll_w)); + map(0x10400c, 0x10400d).nopw(); // seems another video register. constantly used + map(0x10400e, 0x10400f).nopw(); // seems another video register. constantly used + map(0x104010, 0x105fff).nopw(); // unknown + map(0x300000, 0x300001).nopw(); // unknown... write 0x01 in game, and 0x00 on reset + map(0x308000, 0x30800d).r(FUNC(sderby_state::input_r)); + map(0x308008, 0x308009).w(FUNC(sderby_state::scmatto_out_w)); map(0x30800f, 0x30800f).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x380000, 0x380fff).w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0xd00000, 0xd001ff).ram(); - map(0x800000, 0x800fff).ram().share("spriteram"); - map(0x801000, 0x80100d).nopw(); /* unknown */ - map(0x8f0000, 0x8f07ff).ram().share("nvram"); /* 16K Dallas DS1220Y-200 NVRAM */ + map(0x800000, 0x800fff).ram().share(m_spriteram); + map(0x801000, 0x80100d).nopw(); // unknown + map(0x8f0000, 0x8f07ff).ram().share("nvram"); // 16K Dallas DS1220Y-200 NVRAM map(0x8fc000, 0x8fffff).ram(); } void sderby_state::shinygld_map(address_map &map) { map(0x000000, 0x03ffff).rom(); - map(0x100000, 0x100fff).ram().w(FUNC(sderby_state::sderby_videoram_w)).share("videoram"); /* bg */ - map(0x101000, 0x101fff).ram().w(FUNC(sderby_state::sderby_md_videoram_w)).share("md_videoram"); /* mid */ - map(0x102000, 0x103fff).ram().w(FUNC(sderby_state::sderby_fg_videoram_w)).share("fg_videoram"); /* fg */ - map(0x104000, 0x10400b).w(FUNC(sderby_state::sderby_scroll_w)); /* tilemaps offset control */ - map(0x10400c, 0x10400d).nopw(); /* seems another video register. constantly used */ - map(0x10400e, 0x10400f).nopw(); /* seems another video register. constantly used */ - map(0x104010, 0x105fff).nopw(); /* unknown */ - map(0x300000, 0x300001).nopw(); /* unknown... write 0x01 in game, and 0x00 on reset */ - map(0x308000, 0x30800d).r(FUNC(sderby_state::sderby_input_r)); - map(0x308008, 0x308009).nopw(); /* output port */ + map(0x100000, 0x100fff).ram().w(FUNC(sderby_state::bg_videoram_w)).share(m_bg_videoram); + map(0x101000, 0x101fff).ram().w(FUNC(sderby_state::md_videoram_w)).share(m_md_videoram); + map(0x102000, 0x103fff).ram().w(FUNC(sderby_state::fg_videoram_w)).share(m_fg_videoram); + map(0x104000, 0x10400b).w(FUNC(sderby_state::scroll_w)); + map(0x10400c, 0x10400d).nopw(); // seems another video register. constantly used + map(0x10400e, 0x10400f).nopw(); // seems another video register. constantly used + map(0x104010, 0x105fff).nopw(); // unknown + map(0x300000, 0x300001).nopw(); // unknown... write 0x01 in game, and 0x00 on reset + map(0x308000, 0x30800d).r(FUNC(sderby_state::input_r)); + map(0x308008, 0x308009).nopw(); map(0x30800f, 0x30800f).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x380000, 0x380fff).w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x400000, 0x400fff).ram().share("spriteram"); - map(0x401000, 0x40100d).nopw(); /* unknown */ - map(0x700000, 0x7007ff).ram().share("nvram"); /* 16K Dallas DS1220Y-200 NVRAM */ + map(0x400000, 0x400fff).ram().share(m_spriteram); + map(0x401000, 0x40100d).nopw(); // unknown + map(0x700000, 0x7007ff).ram().share("nvram"); // 16K Dallas DS1220Y-200 NVRAM map(0x7f0000, 0x7fffff).ram(); } void sderby_state::roulette_map(address_map &map) { map(0x000000, 0x03ffff).rom(); - map(0x440000, 0x440fff).writeonly().share("spriteram"); - map(0x500000, 0x500fff).ram().w(FUNC(sderby_state::sderby_videoram_w)).share("videoram"); /* bg */ - map(0x501000, 0x501fff).ram().w(FUNC(sderby_state::sderby_md_videoram_w)).share("md_videoram"); /* mid */ - map(0x502000, 0x503fff).ram().w(FUNC(sderby_state::sderby_fg_videoram_w)).share("fg_videoram"); /* fg */ - map(0x504000, 0x50400b).ram().w(FUNC(sderby_state::sderby_scroll_w)); + map(0x440000, 0x440fff).writeonly().share(m_spriteram); + map(0x500000, 0x500fff).ram().w(FUNC(sderby_state::bg_videoram_w)).share(m_bg_videoram); + map(0x501000, 0x501fff).ram().w(FUNC(sderby_state::md_videoram_w)).share(m_md_videoram); + map(0x502000, 0x503fff).ram().w(FUNC(sderby_state::fg_videoram_w)).share(m_fg_videoram); + map(0x504000, 0x50400b).ram().w(FUNC(sderby_state::scroll_w)); map(0x50400e, 0x50400f).nopw(); map(0x708000, 0x708009).r(FUNC(sderby_state::roulette_input_r)); map(0x708006, 0x708007).w(FUNC(sderby_state::roulette_out_w)); map(0x70800b, 0x70800b).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x70800c, 0x70800d).nopw(); /* watchdog?? (0x0003) */ - map(0x70800e, 0x70800f).rw(FUNC(sderby_state::rprot_r), FUNC(sderby_state::rprot_w)); /* MCU communication */ + map(0x70800c, 0x70800d).nopw(); // watchdog?? (0x0003) + map(0x70800e, 0x70800f).rw(FUNC(sderby_state::rprot_r), FUNC(sderby_state::rprot_w)); // MCU communication map(0x780000, 0x780fff).w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0xff0000, 0xff07ff).ram().share("nvram"); map(0xffc000, 0xffffff).ram(); } +void sderby_state::magictch_map(address_map &map) // memory map is very similar to the above roulette_map. TODO: verify if deriving makes sense once everything's figured out +{ + map(0x000000, 0x03ffff).rom(); + map(0x440000, 0x440fff).writeonly().share(m_spriteram); + map(0x500000, 0x500fff).ram().w(FUNC(sderby_state::bg_videoram_w)).share(m_bg_videoram); + map(0x501000, 0x501fff).ram().w(FUNC(sderby_state::md_videoram_w)).share(m_md_videoram); + map(0x502000, 0x503fff).ram().w(FUNC(sderby_state::fg_videoram_w)).share(m_fg_videoram); + map(0x504000, 0x50400b).ram().w(FUNC(sderby_state::scroll_w)); + map(0x50400e, 0x50400f).nopw(); + map(0x708000, 0x70800d).r(FUNC(sderby_state::input_r)); + //map(0x708008, 0x708009).w(FUNC(sderby_state::magictch_out_w)); // TODO + map(0x70800f, 0x70800f).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x780000, 0x780fff).w(m_palette, FUNC(palette_device::write16)).share("palette"); + map(0xf00000, 0xf007ff).ram().share("nvram"); + map(0xff0000, 0xffffff).ram(); +} /*************************** @@ -425,7 +642,7 @@ void sderby_state::roulette_map(address_map &map) ***************************/ static INPUT_PORTS_START( sderby ) - PORT_START("IN0") /* 0x308000.w */ + PORT_START("IN0") // 0x308000.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY @@ -445,7 +662,7 @@ static INPUT_PORTS_START( sderby ) INPUT_PORTS_END static INPUT_PORTS_START( sderbya ) - PORT_START("IN0") /* 0x308000.w */ + PORT_START("IN0") // 0x308000.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY @@ -465,7 +682,7 @@ static INPUT_PORTS_START( sderbya ) INPUT_PORTS_END static INPUT_PORTS_START( luckboom ) - PORT_START("IN0") /* 0x308000.w */ + PORT_START("IN0") // 0x308000.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) @@ -485,7 +702,7 @@ static INPUT_PORTS_START( luckboom ) INPUT_PORTS_END static INPUT_PORTS_START( spacewin ) - PORT_START("IN0") /* 0x308000.w */ + PORT_START("IN0") // 0x308000.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) @@ -505,7 +722,7 @@ static INPUT_PORTS_START( spacewin ) INPUT_PORTS_END static INPUT_PORTS_START( shinygld ) - PORT_START("IN0") /* 0x308000.w */ + PORT_START("IN0") // 0x308000.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) @@ -527,7 +744,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( pmroulet ) PORT_START("IN0") PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* it must be toggled to boot anyway */ + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // it must be toggled to boot anyway PORT_SERVICE_NO_TOGGLE(0x0020, IP_ACTIVE_LOW) PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -547,7 +764,7 @@ static INPUT_PORTS_START( pmroulet ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* to cancel bets in 3-button mode */ + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) // to cancel bets in 3-button mode PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -590,8 +807,8 @@ static const gfx_layout tiles16x16_layout = ****************************/ static GFXDECODE_START( gfx_sderby ) - GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0x000, 256 ) /* sprites */ - GFXDECODE_ENTRY( "gfx1", 0, tiles16x16_layout, 0x000, 256 ) /* sprites */ + GFXDECODE_ENTRY( "gfx", 0, tiles8x8_layout, 0x000, 256 ) + GFXDECODE_ENTRY( "gfx", 0, tiles16x16_layout, 0x000, 256 ) GFXDECODE_END @@ -612,14 +829,14 @@ void sderby_state::sderby(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(64*8, 64*8); screen.set_visarea(4*8, 44*8-1, 3*8, 33*8-1); - screen.set_screen_update(FUNC(sderby_state::screen_update_sderby)); + screen.set_screen_update(FUNC(sderby_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_sderby); PALETTE(config, m_palette).set_format(palette_device::RGBx_555, 0x1000); SPEAKER(config, "mono").front_center(); - OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); /* clock frequency & pin 7 not verified */ + OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // clock frequency & pin 7 not verified } void sderby_state::sderbya(machine_config &config) @@ -635,14 +852,14 @@ void sderby_state::sderbya(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(64*8, 64*8); screen.set_visarea(4*8, 44*8-1, 3*8, 33*8-1); - screen.set_screen_update(FUNC(sderby_state::screen_update_sderby)); + screen.set_screen_update(FUNC(sderby_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_sderby); PALETTE(config, m_palette).set_format(palette_device::RGBx_555, 0x1000); SPEAKER(config, "mono").front_center(); - OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); /* clock frequency & pin 7 not verified */ + OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // clock frequency & pin 7 not verified } void sderby_state::luckboom(machine_config &config) @@ -658,14 +875,14 @@ void sderby_state::luckboom(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(64*8, 64*8); screen.set_visarea(4*8, 44*8-1, 3*8, 33*8-1); - screen.set_screen_update(FUNC(sderby_state::screen_update_sderby)); + screen.set_screen_update(FUNC(sderby_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_sderby); PALETTE(config, m_palette).set_format(palette_device::RGBx_555, 0x1000); SPEAKER(config, "mono").front_center(); - OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); /* clock frequency & pin 7 not verified */ + OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // clock frequency & pin 7 not verified } void sderby_state::spacewin(machine_config &config) @@ -688,7 +905,7 @@ void sderby_state::spacewin(machine_config &config) PALETTE(config, m_palette).set_format(palette_device::RGBx_555, 0x1000); SPEAKER(config, "mono").front_center(); - OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); /* clock frequency & pin 7 not verified */ + OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // clock frequency & pin 7 not verified } void sderby_state::shinygld(machine_config &config) @@ -704,14 +921,14 @@ void sderby_state::shinygld(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(64*8, 64*8); screen.set_visarea(4*8, 44*8-1, 3*8, 33*8-1); - screen.set_screen_update(FUNC(sderby_state::screen_update_sderby)); + screen.set_screen_update(FUNC(sderby_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_sderby); PALETTE(config, m_palette).set_format(palette_device::RGBx_555, 0x1000); SPEAKER(config, "mono").front_center(); - OKIM6295(config, "oki", 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); /* clock frequency & pin 7 verified */ + OKIM6295(config, "oki", 1.056_MHz_XTAL, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // clock frequency & pin 7 verified } void sderby_state::pmroulet(machine_config &config) @@ -724,7 +941,30 @@ void sderby_state::pmroulet(machine_config &config) screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate + screen.set_size(64*8, 64*8); + screen.set_visarea(4*8, 44*8-1, 3*8, 33*8-1); + screen.set_screen_update(FUNC(sderby_state::screen_update_pmroulet)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_sderby); + PALETTE(config, m_palette).set_format(palette_device::RGBx_555, 0x1000); + + SPEAKER(config, "mono").front_center(); + OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // clock frequency & pin 7 not verified +} + +void sderby_state::magictch(machine_config &config) +{ + M68000(config, m_maincpu, 12_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &sderby_state::magictch_map); + m_maincpu->set_vblank_int("screen", FUNC(sderby_state::irq2_line_hold)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(64*8, 64*8); screen.set_visarea(4*8, 44*8-1, 3*8, 33*8-1); screen.set_screen_update(FUNC(sderby_state::screen_update_pmroulet)); @@ -734,7 +974,7 @@ void sderby_state::pmroulet(machine_config &config) PALETTE(config, m_palette).set_format(palette_device::RGBx_555, 0x1000); SPEAKER(config, "mono").front_center(); - OKIM6295(config, "oki", 1056000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); /* clock frequency & pin 7 not verified */ + OKIM6295(config, "oki", 1_MHz_XTAL, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); // clock frequency & pin 7 verified } @@ -768,14 +1008,14 @@ two FPGA chips - one labelled 'Playmark 010412' */ ROM_START( sderby ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 Code ROM_LOAD16_BYTE( "22.bin", 0x00000, 0x20000, CRC(a319f1e0) SHA1(d932cc7e990aa87308dcd9ffa5af2aaea333aa9a) ) ROM_LOAD16_BYTE( "23.bin", 0x00001, 0x20000, CRC(1d6e2321) SHA1(3bb32021cc9ee6bd6d1fd79a89159fef70f34f41) ) - ROM_REGION( 0x080000, "oki", 0 ) /* Samples */ + ROM_REGION( 0x080000, "oki", 0 ) ROM_LOAD( "21.bin", 0x00000, 0x80000, CRC(6f9f2f2b) SHA1(9778439979bc21b3e49f0c16353488a33b93c01b) ) - ROM_REGION( 0xa0000, "gfx1", 0 ) /* Sprites */ + ROM_REGION( 0xa0000, "gfx", 0 ) ROM_LOAD( "24.bin", 0x00000, 0x20000, CRC(93c917df) SHA1(dc2fa5e29749ec92871c66146c0412a23f47e316) ) ROM_LOAD( "25.bin", 0x20000, 0x20000, CRC(7ba485cd) SHA1(b0170614d713af9d1556251c76ae762de872abe6) ) ROM_LOAD( "26.bin", 0x40000, 0x20000, CRC(beabe4f7) SHA1(a5615450fae930cb2408f201a9faa12551de0d70) ) @@ -784,14 +1024,14 @@ ROM_START( sderby ) ROM_END ROM_START( sderbya ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 Code ROM_LOAD16_BYTE( "22.u16", 0x00000, 0x20000, CRC(5baadc33) SHA1(475843d3f99f5a6aa25bdba75b251ad6be32802f) ) ROM_LOAD16_BYTE( "23.u15", 0x00001, 0x20000, CRC(04518b8c) SHA1(97598c43c1cb0a757bca70c0a498838144b2302b) ) - ROM_REGION( 0x080000, "oki", 0 ) /* Samples */ + ROM_REGION( 0x080000, "oki", 0 ) ROM_LOAD( "274001.u147", 0x00000, 0x80000, CRC(6f9f2f2b) SHA1(9778439979bc21b3e49f0c16353488a33b93c01b) ) - ROM_REGION( 0x140000, "gfx1", 0 ) /* Sprites */ + ROM_REGION( 0x140000, "gfx", 0 ) ROM_LOAD( "24.u141", 0x000000, 0x40000, CRC(54234f72) SHA1(c2e3e547255174daa9a6acad743c210b92ded385) ) ROM_LOAD( "25.u142", 0x040000, 0x40000, CRC(1bd98cf7) SHA1(67143a16e2cf01868fac3d8d6d9db423f77d09b9) ) ROM_LOAD( "26.u143", 0x080000, 0x40000, CRC(21bf2004) SHA1(7f7cbdcd89807c9e8ca64023a0060b18ef9b6536) ) @@ -838,14 +1078,14 @@ Title depends on graphics type in test mode. */ ROM_START( spacewin ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 Code ROM_LOAD16_BYTE( "2.u16", 0x00000, 0x20000, CRC(2d17c2ab) SHA1(833ab39081fbc3d114103055e3a3f2ea2a28f158) ) ROM_LOAD16_BYTE( "3.u15", 0x00001, 0x20000, CRC(fd6f93ef) SHA1(1dc35fd92a0185434b44aa3c7da47a408fb2ce27) ) - ROM_REGION( 0x080000, "oki", 0 ) /* Samples */ + ROM_REGION( 0x080000, "oki", 0 ) ROM_LOAD( "1.u147", 0x00000, 0x40000, CRC(eedc7090) SHA1(fc8cabf7a11a1de3ccc3b8860afd8f32669608b8) ) - ROM_REGION( 0xa0000, "gfx1", 0 ) /* Sprites */ + ROM_REGION( 0xa0000, "gfx", 0 ) ROM_LOAD( "4.u141", 0x000000, 0x20000, CRC(ce20c599) SHA1(93358c3a891c66ca944eb684bd47e9c25bfcb88d) ) ROM_LOAD( "5.u142", 0x020000, 0x20000, CRC(ae4f8e06) SHA1(cb3b941c67ae5c9df005d9f8b2105dc5a114f19f) ) ROM_LOAD( "6.u143", 0x040000, 0x20000, CRC(b99afc96) SHA1(589270dbd5022db2d032da85a9813c271fa71a90) ) @@ -855,14 +1095,14 @@ ROM_END // This board seems very similar to the spacewin's one. ROM_START( shinygld ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 Code ROM_LOAD16_BYTE( "16.u16", 0x00000, 0x20000, CRC(4b08a668) SHA1(8444e7624a40e14eca73c425db1cd574c2bf02e0) ) // 27C1001 ROM_LOAD16_BYTE( "17.u15", 0x00001, 0x20000, CRC(eb126e19) SHA1(d02ba03551f71f3ca46bee49291e4423daeea0ce) ) // 27C1001 - ROM_REGION( 0x080000, "oki", 0 ) /* Samples */ + ROM_REGION( 0x080000, "oki", 0 ) ROM_LOAD( "15.u147", 0x00000, 0x40000, CRC(66db6b15) SHA1(4a1ca962c61d60db8ff66c81253131d067bec8c6) ) // 27C2001 - ROM_REGION( 0xa0000, "gfx1", 0 ) /* Sprites */ + ROM_REGION( 0xa0000, "gfx", 0 ) ROM_LOAD( "18.u141", 0x000000, 0x20000, CRC(a905c02d) SHA1(07a0a70424aa759e4c552408154c2d1515f512d5) ) // 27C1001 ROM_LOAD( "19.u142", 0x020000, 0x20000, CRC(8db53f3b) SHA1(aeb2da8bb065bb49edae1de51f6db9a7a02989c3) ) // 27C1001 ROM_LOAD( "20.u143", 0x040000, 0x20000, CRC(be54ae86) SHA1(23c8a01aa05204a6cd186a59269e515a068e23c4) ) // 27C1001 @@ -871,12 +1111,12 @@ ROM_START( shinygld ) /* Dumper's note: Board carries five PLDs : one GAL22V10 near the 68000 CPU (which most likely acts as main address decoder), three PALCE22V10H (two are near the GFX ROMs, probably for enabling them), one PALCE16V8H.*/ - ROM_REGION( 0x1000, "plds", 0) - ROM_LOAD( "gal22v10.bin", 0x0400, 0x02e5, NO_DUMP ) // soldered - ROM_LOAD( "palce22v10_1.bin", 0x2dd, 0x2dd, NO_DUMP ) // soldered - ROM_LOAD( "palce22v10_2.bin", 0x2dd, 0x2dd, NO_DUMP ) // soldered - ROM_LOAD( "palce22v10_3.bin", 0x2dd, 0x2dd, NO_DUMP ) // soldered - ROM_LOAD( "palce16v8h.bin", 0x0200, 0x0117, NO_DUMP ) // soldered + ROM_REGION( 0xd00, "plds", 0) + ROM_LOAD( "gal22v10.bin", 0x000, 0x2e5, NO_DUMP ) // soldered + ROM_LOAD( "palce22v10_1.bin", 0x300, 0x2dd, NO_DUMP ) // soldered + ROM_LOAD( "palce22v10_2.bin", 0x600, 0x2dd, NO_DUMP ) // soldered + ROM_LOAD( "palce22v10_3.bin", 0x900, 0x2dd, NO_DUMP ) // soldered + ROM_LOAD( "palce16v8h.bin", 0xb00, 0x117, NO_DUMP ) // soldered ROM_END /* @@ -940,17 +1180,17 @@ CRC-32 : D4C2B7DAh */ ROM_START( croupier ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */ + ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "2.bin", 0x00000, 0x20000, CRC(e7941975) SHA1(ea32cd51b8d87205a1d6c6a83ebf8b50e03c55fc)) ROM_LOAD16_BYTE( "3.bin", 0x00001, 0x20000, CRC(29d06a38) SHA1(c6fdca1a31fad9abf854e521e593f3ec8018ae6d)) ROM_REGION( 0x4008, "pic16c74", 0 ) ROM_LOAD( "pic16c74.u39", 0x00000, 0x4008, CRC(9cb88e5b) SHA1(3c6b371efeda757f2bcab6c860e7585b628c210a)) - ROM_REGION( 0x080000, "oki", 0 ) /* samples are ok */ + ROM_REGION( 0x080000, "oki", 0 ) ROM_LOAD( "1.bin", 0x00000, 0x40000, CRC(6673de85) SHA1(df390cd6268efc0e743a9020f19bc0cbeb757cfa)) - ROM_REGION( 0x280000, "gfx1", 0 ) /* sprites */ + ROM_REGION( 0x280000, "gfx", 0 ) ROM_LOAD( "4.bin", 0x000000, 0x80000, CRC(efcddac9) SHA1(72435ec478b70a067d47f3daf7c224169ee5827a)) ROM_LOAD( "5.bin", 0x080000, 0x80000, CRC(bc75ef8f) SHA1(1f3dc457e5ae143d53cfef0e1fcb4586dceefb67)) ROM_LOAD( "6.bin", 0x100000, 0x80000, CRC(e47d5f55) SHA1(a341e24f98125265cb3986f8c7ce84eedd056b71)) @@ -959,17 +1199,17 @@ ROM_START( croupier ) ROM_END ROM_START( croupiera ) - ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */ + ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "2.bin", 0x00000, 0x20000, CRC(1677a2de) SHA1(4dcbb3c1ce9b65e06ba7e0cffa00c0c8016538f5)) // sldh ROM_LOAD16_BYTE( "3.bin", 0x00001, 0x20000, CRC(11acaac2) SHA1(19e7bbbf4356fc9a866f9f36d0568c42d6a36c07)) // sldh ROM_REGION( 0x4008, "pic16c74", 0 ) ROM_LOAD( "pic16c74.u39", 0x00000, 0x4008, CRC(9cb88e5b) SHA1(3c6b371efeda757f2bcab6c860e7585b628c210a)) - ROM_REGION( 0x080000, "oki", 0 ) /* samples are ok */ + ROM_REGION( 0x080000, "oki", 0 ) ROM_LOAD( "1.bin", 0x00000, 0x40000, CRC(6673de85) SHA1(df390cd6268efc0e743a9020f19bc0cbeb757cfa)) - ROM_REGION( 0x280000, "gfx1", 0 ) /* sprites */ + ROM_REGION( 0x280000, "gfx", 0 ) ROM_LOAD( "4.bin", 0x000000, 0x80000, CRC(efcddac9) SHA1(72435ec478b70a067d47f3daf7c224169ee5827a)) ROM_LOAD( "5.bin", 0x080000, 0x80000, CRC(bc75ef8f) SHA1(1f3dc457e5ae143d53cfef0e1fcb4586dceefb67)) ROM_LOAD( "6.bin", 0x100000, 0x80000, CRC(e47d5f55) SHA1(a341e24f98125265cb3986f8c7ce84eedd056b71)) @@ -1009,14 +1249,14 @@ QTY Type position status ROM_START( luckboom ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 Code ROM_LOAD16_BYTE( "2.u16", 0x00000, 0x20000, CRC(0a20eaca) SHA1(edd325b60b3a3ce84e89f8be91b9e19f82d15317) ) ROM_LOAD16_BYTE( "3.u15", 0x00001, 0x20000, CRC(0d3bb24c) SHA1(31826ec29650aa8b70e1b713678401113e008832) ) - ROM_REGION( 0x080000, "oki", 0 ) /* Samples */ + ROM_REGION( 0x080000, "oki", 0 ) ROM_LOAD( "1.u147", 0x00000, 0x40000, CRC(0d42c0a3) SHA1(1b1d4c7dcbb063e8bf133063770b753947d1a017) ) - ROM_REGION( 0xa0000, "gfx1", 0 ) /* Sprites */ + ROM_REGION( 0xa0000, "gfx", 0 ) ROM_LOAD( "4.u141", 0x000000, 0x20000, CRC(3aeccad7) SHA1(4104dd3ae928c1a876ac9b460fe18b58ce1206f7) ) ROM_LOAD( "5.u142", 0x020000, 0x20000, CRC(4e4f9ac6) SHA1(e9b0c48195d8b21cdab16d66423ff43e6292ef2c) ) ROM_LOAD( "6.u143", 0x040000, 0x20000, CRC(d1b4910e) SHA1(cfcb14bcd992bceaa634b20eb2d446caa62b6d82) ) @@ -1025,6 +1265,40 @@ ROM_START( luckboom ) ROM_END +/* +ZW3 PCB with 'MAGIC' sticker +1x MC68000FN12 +1x scratched off DIP-40 chip near the main CPU +1x M48Z02-150PC1 ZEROPOWER RAM +1x 12 MHz XTAL +1x 14.318180 MHz XTAL +3x Actel A1020B FPGA +1x Oki M6295 +1x 1.000J blue resonator +*/ + +ROM_START( magictch ) + ROM_REGION( 0x40000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "22.u43", 0x00000, 0x20000, CRC(47f047b1) SHA1(f47ab9734f6bb1dc50baf159bca144fa79eac1a5) ) // TMS27C010A + ROM_LOAD16_BYTE( "23.u42", 0x00001, 0x20000, CRC(f63e31bf) SHA1(e96da519a8d6488d600e031ac48f5ce1a8a376f5) ) // TMS27C010A + + ROM_REGION( 0x040000, "oki", 0 ) + ROM_LOAD( "21.u16", 0x00000, 0x40000, CRC(e06a023f) SHA1(b4cd64f6c97e9c3e50a9658e171d748cb9f1c4ef) ) // ST M27C2001, 1xxxxxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0xa0000, "gfx", 0 ) + ROM_LOAD( "28.u76", 0x000000, 0x20000, CRC(ca49b54c) SHA1(69d6a3b32ebc357231b22ded40468971ba9ef8c3) ) // TMS27C010A + ROM_LOAD( "27.u77", 0x020000, 0x20000, CRC(55b10fe5) SHA1(caf16512afe1b3fa66018075598cbc2626a63b3e) ) // TMS27C010A + ROM_LOAD( "26.u78", 0x040000, 0x20000, CRC(d7974bd9) SHA1(b49678697e30d104a88adcc8e2c09cd62233c7b4) ) // TMS27C010A + ROM_LOAD( "25.u79", 0x060000, 0x20000, CRC(f825cb9d) SHA1(10ffa614ac82e5c625c36095b298a8acfc7465bf) ) // TMS27C010A + ROM_LOAD( "24.u80", 0x080000, 0x20000, CRC(3bdaea12) SHA1(8d9493ab80f96e6f941039ce6d1b8f1ed3c78379) ) // TMS27C010A + + ROM_REGION( 0x300, "plds", 0) + ROM_LOAD( "gal22cv10-15lnc.u40", 0x000, 0x2e5, NO_DUMP ) // soldered +ROM_END + +} // anonymous namespace + + /****************************** * Game Drivers * ******************************/ @@ -1037,3 +1311,4 @@ GAME( 1996, shinygld, 0, shinygld, shinygld, sderby_state, empty_init, GAMEL( 1997, croupier, 0, pmroulet, pmroulet, sderby_state, empty_init, ROT0, "Playmark", "Croupier (Playmark Roulette v.20.05)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING, layout_pmroulet ) GAMEL( 1997, croupiera, croupier, pmroulet, pmroulet, sderby_state, empty_init, ROT0, "Playmark", "Croupier (Playmark Roulette v.09.04)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING, layout_pmroulet ) GAME( 1996, luckboom, 0, luckboom, luckboom, sderby_state, empty_init, ROT0, "Playmark", "Lucky Boom", 0 ) +GAME( 1998, magictch, 0, magictch, spacewin, sderby_state, empty_init, ROT0, "Playmark", "Magic Touch", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) // wrong text layer hook up, stops during boot and needs debugger help to go in game, inputs aren't done, some scroll offsets are wrong diff --git a/src/mame/drivers/segas16b.cpp b/src/mame/drivers/segas16b.cpp index 708f90b8ca4..402eb581b83 100644 --- a/src/mame/drivers/segas16b.cpp +++ b/src/mame/drivers/segas16b.cpp @@ -2773,8 +2773,8 @@ static INPUT_PORTS_START( goldnaxe ) PORT_DIPNAME( 0x3c, 0x3c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4,5,6") // Definition according to manual PORT_DIPSETTING( 0x00, "Special" ) PORT_DIPSETTING( 0x14, DEF_STR( Easiest ) ) - PORT_DIPSETTING( 0x1c, DEF_STR( Easier ) ) - PORT_DIPSETTING( 0x34, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x34, DEF_STR( Easier ) ) + PORT_DIPSETTING( 0x1c, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x3c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x38, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x2c, DEF_STR( Harder ) ) diff --git a/src/mame/drivers/segaufo.cpp b/src/mame/drivers/segaufo.cpp index 4c751eaac17..bcdc1740f6d 100644 --- a/src/mame/drivers/segaufo.cpp +++ b/src/mame/drivers/segaufo.cpp @@ -15,7 +15,7 @@ - # UFO Catcher DX II (1987) 3rd gen - UFO brd - * Z80, 2 Sega 315-5296(I/O), YM3438, NEC uPD71054C + * Z80 (sticker obscures label), 16MHz XTAL, 2 Sega 315-5296(I/O), YM3438, NEC uPD71054C - # Dream Town (1990) - New UFO Catcher (1991) (2P) - probably the most popular cabinet of all UFO Catcher series - UFO Catcher Mini (1991) (1P) @@ -23,7 +23,8 @@ - # School Kids (1993) 4th gen - EX brd - * Z80, 2 Sega 315-5296(I/O), 315-5338A, YM3438, NEC uPD71054C, optional NEC uPD7759C + * Z80 Z0840008PSC, 8MHz XTAL, 32MHz XTAL, 2 Sega 315-5296(I/O), 315-5338A, YM3438, + NEC uPD71054C, optional NEC uPD7759C - # Dream Palace (1992) - # Dream Kitchen (1994) - # UFO Catcher Excellent (1994) @@ -916,21 +917,21 @@ ROM_END ROM_START( ufomini ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "epr-14355.bin", 0x000000, 0x010000, CRC(fbc969c5) SHA1(4a99dcd36bc48b6472988e0bc679fd61af17359c) ) + ROM_LOAD( "epr-14355.ic21", 0x000000, 0x010000, CRC(fbc969c5) SHA1(4a99dcd36bc48b6472988e0bc679fd61af17359c) ) ROM_END ROM_START( ufo21 ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "epr-19063a.bin", 0x000000, 0x010000, CRC(2e13e3e9) SHA1(6908f7db79c1a1da4ebc0456afc50ff18f2e8cf3) ) + ROM_LOAD( "epr-19063a.ic33", 0x000000, 0x010000, CRC(2e13e3e9) SHA1(6908f7db79c1a1da4ebc0456afc50ff18f2e8cf3) ) ROM_REGION( 0x40000, "upd", 0 ) - ROM_LOAD( "epr-19064.bin", 0x000000, 0x040000, CRC(ab62c1f0) SHA1(8791a88546ae69e710e128ffc2ea6e9b464f0631) ) + ROM_LOAD( "epr-19064.ic32", 0x000000, 0x040000, CRC(ab62c1f0) SHA1(8791a88546ae69e710e128ffc2ea6e9b464f0631) ) ROM_END ROM_START( ufo800 ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "epr-20413a.bin", 0x000000, 0x010000, CRC(36e9da6d) SHA1(8e1dbf8b24bc31be7de28f4d562838c291af7c7b) ) + ROM_LOAD( "epr-20413a.ic33", 0x000000, 0x010000, CRC(36e9da6d) SHA1(8e1dbf8b24bc31be7de28f4d562838c291af7c7b) ) ROM_END diff --git a/src/mame/drivers/supstarf.cpp b/src/mame/drivers/supstarf.cpp index 541046117d5..1f55ed60fb0 100644 --- a/src/mame/drivers/supstarf.cpp +++ b/src/mame/drivers/supstarf.cpp @@ -7,10 +7,6 @@ Super Star (Recreativos Franco) Skeleton driver for 8085-based pinball hardware. TODO: -- The ROM for the sound cpu is a bad dump. The 8035 should set itself up, - then signal a rst(call 0024) to the 8085 which in turn sets up key - indicators in RAM and enabling the machine to begin. With the bad dump, - none of that can happen. - Display circuits: i8259, 74164, 74159 and other bits. - Default layout - Outputs (solenoids, lamps) @@ -263,11 +259,21 @@ INPUT_PORTS_END ROM_START(supstarf) ROM_REGION(0x4000, "maincpu", 0) + ROM_LOAD("m31-a-01187.ic19", 0x0000, 0x4000, CRC(ab8b1148) SHA1(496d3c9664386ae64e94462db2fdd36811a68a87)) + // IC14 for second program ROM is unpopulated + + ROM_REGION(0x1000, "soundcpu", 0) + ROM_LOAD("2532.ic4", 0x0000, 0x1000, CRC(d6d7eee2) SHA1(60e497c8845320eea01662d894d0b16349ebb7e4)) +ROM_END + +ROM_START(supstarfa) + ROM_REGION(0x4000, "maincpu", 0) ROM_LOAD("27c128.ic19", 0x0000, 0x4000, CRC(9a440461) SHA1(e2f8dcf95084f755d3a34d77ba2649602687a610)) // IC14 for second program ROM is unpopulated ROM_REGION(0x1000, "soundcpu", 0) - ROM_LOAD("2532.ic4", 0x0000, 0x1000, CRC(b6ef3c7a) SHA1(aabb6f8569685fc3a917a7bb5ebfcc4b20086b15) BAD_DUMP) // D6 stuck high and probably totally garbage + ROM_LOAD("2532.ic4", 0x0000, 0x1000, BAD_DUMP CRC(b6ef3c7a) SHA1(aabb6f8569685fc3a917a7bb5ebfcc4b20086b15)) // D6 stuck high and probably totally garbage ROM_END -GAME( 1986, supstarf, 0, supstarf, supstarf, supstarf_state, empty_init, ROT0, "Recreativos Franco", "Super Star (Recreativos Franco)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, supstarf, 0, supstarf, supstarf, supstarf_state, empty_init, ROT0, "Recreativos Franco", "Super Star (Recreativos Franco, set 1)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, supstarfa, supstarf, supstarf, supstarf, supstarf_state, empty_init, ROT0, "Recreativos Franco", "Super Star (Recreativos Franco, set 2)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/system16.cpp b/src/mame/drivers/system16.cpp index 0c2f7a5c5db..621fd1affe0 100644 --- a/src/mame/drivers/system16.cpp +++ b/src/mame/drivers/system16.cpp @@ -1674,8 +1674,8 @@ static INPUT_PORTS_START( goldnaxe ) PORT_DIPNAME( 0x3c, 0x3c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4,5,6") /* Definition according to manual */ PORT_DIPSETTING( 0x00, "Special" ) PORT_DIPSETTING( 0x14, DEF_STR( Easiest ) ) - PORT_DIPSETTING( 0x1c, DEF_STR( Easier ) ) - PORT_DIPSETTING( 0x34, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x34, DEF_STR( Easier ) ) + PORT_DIPSETTING( 0x1c, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x3c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x38, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x2c, DEF_STR( Harder ) ) diff --git a/src/mame/drivers/tickee.cpp b/src/mame/drivers/tickee.cpp index 9f4603f2a40..842c334dea0 100644 --- a/src/mame/drivers/tickee.cpp +++ b/src/mame/drivers/tickee.cpp @@ -22,6 +22,7 @@ ***************************************************************************/ #include "emu.h" + #include "cpu/tms34010/tms34010.h" #include "machine/nvram.h" #include "machine/ticket.h" @@ -29,81 +30,120 @@ #include "sound/ay8910.h" #include "sound/okim6295.h" #include "video/tlc34076.h" + #include "screen.h" #include "speaker.h" +namespace { + class tickee_state : public driver_device { public: - tickee_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + tickee_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_vram(*this, "vram"), + m_control(*this, "control"), m_maincpu(*this, "maincpu"), - m_oki(*this, "oki"), m_screen(*this, "screen"), + m_oki(*this, "oki"), m_tlc34076(*this, "tlc34076"), - m_ticket(*this, "ticket%u", 1), - m_vram(*this, "vram"), - m_control(*this, "control") { } + m_ticket(*this, "ticket%u", 1) + { + } - void rapidfir(machine_config &config); - void ghoshunt(machine_config &config); - void tickee(machine_config &config); + // Machine drivers void mouseatk(machine_config &config); -private: - enum - { - TIMER_TRIGGER_GUN_INTERRUPT, - TIMER_CLEAR_GUN_INTERRUPT, - TIMER_SETUP_GUN_INTERRUPTS - }; +protected: + required_shared_ptr<uint16_t> m_vram; + optional_shared_ptr<uint16_t> m_control; required_device<tms34010_device> m_maincpu; - optional_device<okim6295_device> m_oki; required_device<screen_device> m_screen; + + optional_device<okim6295_device> m_oki; required_device<tlc34076_device> m_tlc34076; optional_device_array<ticket_dispenser_device, 2> m_ticket; - required_shared_ptr<uint16_t> m_vram; - optional_shared_ptr<uint16_t> m_control; + // Video update + TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update); + + // Miscellaneous control bits + void tickee_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + +private: + // Memory maps + void mouseatk_map(address_map &map); +}; + + +class tickee_gun_state : public tickee_state +{ +public: + tickee_gun_state(const machine_config &mconfig, device_type type, const char *tag) : + tickee_state(mconfig, type, tag), + m_gun_axis_x(*this, "GUNX%u", 1U), + m_gun_axis_y(*this, "GUNY%u", 1U) + { + } + + // Machine drivers + void tickee(machine_config &config); + void ghoshunt(machine_config &config); + void rapidfir(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + required_ioport_array<2> m_gun_axis_x; + required_ioport_array<2> m_gun_axis_y; + + emu_timer *m_setup_gun_timer; + emu_timer *m_set_gun_int_timer[2]; + emu_timer *m_clear_gun_int_timer[2]; - emu_timer *m_setup_gun_timer = nullptr; - emu_timer *m_set_gun_int_timer[2]{}; - emu_timer *m_clear_gun_int_timer[2]{}; int m_beamxadd = 0; int m_beamyadd = 0; - int m_palette_bank = 0; - uint8_t m_gunx[2]{}; + int m_palette_bank; + uint8_t m_gunx[2]; + + void set_beamadd(int x, int y) { m_beamxadd = x; m_beamyadd = y; } + + // Compute X/Y coordinates void get_crosshair_xy(int player, int &x, int &y); + // Light gun interrupts + TIMER_CALLBACK_MEMBER(trigger_gun_interrupt); + TIMER_CALLBACK_MEMBER(clear_gun_interrupt); + TIMER_CALLBACK_MEMBER(setup_gun_interrupts); + + // Video update + TMS340X0_SCANLINE_RGB32_CB_MEMBER(rapidfir_scanline_update); + + // Video related void rapidfir_transparent_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t rapidfir_transparent_r(offs_t offset); - void tickee_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + TMS340X0_TO_SHIFTREG_CB_MEMBER(rapidfir_to_shiftreg); + TMS340X0_FROM_SHIFTREG_CB_MEMBER(rapidfir_from_shiftreg); + + // Unknowns uint16_t ffff_r(); uint16_t rapidfir_gun1_r(); uint16_t rapidfir_gun2_r(); uint16_t ff7f_r(); void ff7f_w(uint16_t data); void rapidfir_control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void sound_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - DECLARE_MACHINE_RESET(tickee); - DECLARE_VIDEO_START(tickee); - DECLARE_VIDEO_RESET(tickee); - DECLARE_MACHINE_RESET(rapidfir); - TIMER_CALLBACK_MEMBER(trigger_gun_interrupt); - TIMER_CALLBACK_MEMBER(clear_gun_interrupt); - TIMER_CALLBACK_MEMBER(setup_gun_interrupts); - TMS340X0_TO_SHIFTREG_CB_MEMBER(rapidfir_to_shiftreg); - TMS340X0_FROM_SHIFTREG_CB_MEMBER(rapidfir_from_shiftreg); - TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update); - TMS340X0_SCANLINE_RGB32_CB_MEMBER(rapidfir_scanline_update); + // Sound + void sound_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + // Memory maps + void tickee_map(address_map &map); void ghoshunt_map(address_map &map); - void mouseatk_map(address_map &map); void rapidfir_map(address_map &map); - void tickee_map(address_map &map); }; @@ -118,12 +158,12 @@ private: * *************************************/ -inline void tickee_state::get_crosshair_xy(int player, int &x, int &y) +inline void tickee_gun_state::get_crosshair_xy(int player, int &x, int &y) { const rectangle &visarea = m_screen->visible_area(); - x = (((ioport(player ? "GUNX2" : "GUNX1")->read() & 0xff) * visarea.width()) >> 8) + visarea.min_x; - y = (((ioport(player ? "GUNY2" : "GUNY1")->read() & 0xff) * visarea.height()) >> 8) + visarea.min_y; + x = (((m_gun_axis_x[player]->read() & 0xff) * visarea.width()) >> 8) + visarea.min_x; + y = (((m_gun_axis_y[player]->read() & 0xff) * visarea.height()) >> 8) + visarea.min_y; } @@ -134,10 +174,10 @@ inline void tickee_state::get_crosshair_xy(int player, int &x, int &y) * *************************************/ -TIMER_CALLBACK_MEMBER(tickee_state::trigger_gun_interrupt) +TIMER_CALLBACK_MEMBER(tickee_gun_state::trigger_gun_interrupt) { - int which = param & 1; - int beamx = (m_screen->hpos()/2)-58; + int const which = param & 1; + int const beamx = (m_screen->hpos() / 2) - 58; /* once we're ready to fire, set the X coordinate and assert the line */ m_gunx[which] = beamx; @@ -147,34 +187,33 @@ TIMER_CALLBACK_MEMBER(tickee_state::trigger_gun_interrupt) } -TIMER_CALLBACK_MEMBER(tickee_state::clear_gun_interrupt) +TIMER_CALLBACK_MEMBER(tickee_gun_state::clear_gun_interrupt) { /* clear the IRQ on the next scanline? */ m_maincpu->set_input_line(param, CLEAR_LINE); } -TIMER_CALLBACK_MEMBER(tickee_state::setup_gun_interrupts) +TIMER_CALLBACK_MEMBER(tickee_gun_state::setup_gun_interrupts) { - int beamx, beamy; - /* set a timer to do this again next frame */ m_setup_gun_timer->adjust(m_screen->time_until_pos(0)); /* only do work if the palette is flashed */ - if (m_control) - if (!m_control[2]) - return; - - /* generate interrupts for player 1's gun */ - get_crosshair_xy(0, beamx, beamy); - m_set_gun_int_timer[0]->adjust(m_screen->time_until_pos(beamy + m_beamyadd, beamx + m_beamxadd), 0); - m_clear_gun_int_timer[0]->adjust(m_screen->time_until_pos(beamy + m_beamyadd + 1, beamx + m_beamxadd), 0); - - /* generate interrupts for player 2's gun */ - get_crosshair_xy(1, beamx, beamy); - m_set_gun_int_timer[1]->adjust(m_screen->time_until_pos(beamy + m_beamyadd, beamx + m_beamxadd), 1); - m_clear_gun_int_timer[1]->adjust(m_screen->time_until_pos(beamy + m_beamyadd + 1, beamx + m_beamxadd), 1); + if (!m_control || m_control[2]) + { + int beamx, beamy; + + /* generate interrupts for player 1's gun */ + get_crosshair_xy(0, beamx, beamy); + m_set_gun_int_timer[0]->adjust(m_screen->time_until_pos(beamy + m_beamyadd, beamx + m_beamxadd), 0); + m_clear_gun_int_timer[0]->adjust(m_screen->time_until_pos(beamy + m_beamyadd + 1, beamx + m_beamxadd), 0); + + /* generate interrupts for player 2's gun */ + get_crosshair_xy(1, beamx, beamy); + m_set_gun_int_timer[1]->adjust(m_screen->time_until_pos(beamy + m_beamyadd, beamx + m_beamxadd), 1); + m_clear_gun_int_timer[1]->adjust(m_screen->time_until_pos(beamy + m_beamyadd + 1, beamx + m_beamxadd), 1); + } } @@ -185,20 +224,30 @@ TIMER_CALLBACK_MEMBER(tickee_state::setup_gun_interrupts) * *************************************/ -VIDEO_START_MEMBER(tickee_state,tickee) +void tickee_gun_state::machine_start() { + tickee_state::machine_start(); + /* start a timer going on the first scanline of every frame */ - m_setup_gun_timer = timer_alloc(FUNC(tickee_state::setup_gun_interrupts), this); + m_setup_gun_timer = timer_alloc(FUNC(tickee_gun_state::setup_gun_interrupts), this); /* initialize gun set/clear interrupts for both players */ - m_set_gun_int_timer[0] = timer_alloc(FUNC(tickee_state::trigger_gun_interrupt), this); - m_set_gun_int_timer[1] = timer_alloc(FUNC(tickee_state::trigger_gun_interrupt), this); - m_clear_gun_int_timer[0] = timer_alloc(FUNC(tickee_state::clear_gun_interrupt), this); - m_clear_gun_int_timer[1] = timer_alloc(FUNC(tickee_state::clear_gun_interrupt), this); + m_set_gun_int_timer[0] = timer_alloc(FUNC(tickee_gun_state::trigger_gun_interrupt), this); + m_set_gun_int_timer[1] = timer_alloc(FUNC(tickee_gun_state::trigger_gun_interrupt), this); + m_clear_gun_int_timer[0] = timer_alloc(FUNC(tickee_gun_state::clear_gun_interrupt), this); + m_clear_gun_int_timer[1] = timer_alloc(FUNC(tickee_gun_state::clear_gun_interrupt), this); + + m_palette_bank = 0; + std::fill(std::begin(m_gunx), std::end(m_gunx), 0); + + save_item(NAME(m_palette_bank)); + save_item(NAME(m_gunx)); } -VIDEO_RESET_MEMBER(tickee_state,tickee) +void tickee_gun_state::machine_reset() { + tickee_state::machine_reset(); + m_setup_gun_timer->adjust(m_screen->time_until_pos(0)); m_set_gun_int_timer[0]->adjust(attotime::never); @@ -228,6 +277,7 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_state::scanline_update) dest[x] = pens[0xff]; } else + { /* copy the non-blanked portions of this scanline */ for (int x = params->heblnk; x < params->hsblnk; x += 2) { @@ -235,10 +285,11 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_state::scanline_update) dest[x + 0] = pens[pixels & 0xff]; dest[x + 1] = pens[pixels >> 8]; } + } } -TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_state::rapidfir_scanline_update) +TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_gun_state::rapidfir_scanline_update) { uint16_t const *const src = &m_vram[(params->rowaddr << 8) & 0x3ff00]; uint32_t *const dest = &bitmap.pix(scanline); @@ -269,30 +320,11 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_state::rapidfir_scanline_update) /************************************* * - * Machine init - * - *************************************/ - -MACHINE_RESET_MEMBER(tickee_state,tickee) -{ - m_beamxadd = 50; - m_beamyadd = 0; -} - -MACHINE_RESET_MEMBER(tickee_state,rapidfir) -{ - m_beamxadd = 0; - m_beamyadd = -5; -} - - -/************************************* - * * Video related * *************************************/ -void tickee_state::rapidfir_transparent_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void tickee_gun_state::rapidfir_transparent_w(offs_t offset, uint16_t data, uint16_t mem_mask) { if (!(data & 0xff00)) mem_mask &= 0x00ff; if (!(data & 0x00ff)) mem_mask &= 0xff00; @@ -300,20 +332,20 @@ void tickee_state::rapidfir_transparent_w(offs_t offset, uint16_t data, uint16_t } -uint16_t tickee_state::rapidfir_transparent_r(offs_t offset) +uint16_t tickee_gun_state::rapidfir_transparent_r(offs_t offset) { return m_vram[offset]; } -TMS340X0_TO_SHIFTREG_CB_MEMBER(tickee_state::rapidfir_to_shiftreg) +TMS340X0_TO_SHIFTREG_CB_MEMBER(tickee_gun_state::rapidfir_to_shiftreg) { if (address < 0x800000) memcpy(shiftreg, &m_vram[address >> 4], 0x400); } -TMS340X0_FROM_SHIFTREG_CB_MEMBER(tickee_state::rapidfir_from_shiftreg) +TMS340X0_FROM_SHIFTREG_CB_MEMBER(tickee_gun_state::rapidfir_from_shiftreg) { if (address < 0x800000) memcpy(&m_vram[address >> 4], shiftreg, 0x400); @@ -358,36 +390,36 @@ void tickee_state::tickee_control_w(offs_t offset, uint16_t data, uint16_t mem_m * *************************************/ -uint16_t tickee_state::ffff_r() +uint16_t tickee_gun_state::ffff_r() { return 0xffff; } -uint16_t tickee_state::rapidfir_gun1_r() +uint16_t tickee_gun_state::rapidfir_gun1_r() { return m_gunx[0]; } -uint16_t tickee_state::rapidfir_gun2_r() +uint16_t tickee_gun_state::rapidfir_gun2_r() { return m_gunx[1]; } -uint16_t tickee_state::ff7f_r() +uint16_t tickee_gun_state::ff7f_r() { /* Ticket dispenser status? */ return 0xff7f; } -void tickee_state::ff7f_w(uint16_t data) +void tickee_gun_state::ff7f_w(uint16_t data) { /* Ticket dispenser output? */ } -void tickee_state::rapidfir_control_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void tickee_gun_state::rapidfir_control_w(offs_t offset, uint16_t data, uint16_t mem_mask) { /* other bits like control on tickee? */ if (ACCESSING_BITS_0_7) @@ -402,7 +434,7 @@ void tickee_state::rapidfir_control_w(offs_t offset, uint16_t data, uint16_t mem * *************************************/ -void tickee_state::sound_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void tickee_gun_state::sound_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) { switch (data & 0xff) { @@ -436,7 +468,7 @@ void tickee_state::sound_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) * *************************************/ -void tickee_state::tickee_map(address_map &map) +void tickee_gun_state::tickee_map(address_map &map) { map(0x00000000, 0x003fffff).ram().share("vram"); map(0x02000000, 0x02ffffff).rom().region("user1", 0); @@ -446,7 +478,7 @@ void tickee_state::tickee_map(address_map &map) map(0x04200000, 0x0420001f).w("ym1", FUNC(ay8910_device::address_data_w)).umask16(0x00ff); map(0x04200100, 0x0420010f).r("ym2", FUNC(ay8910_device::data_r)).umask16(0x00ff); map(0x04200100, 0x0420011f).w("ym2", FUNC(ay8910_device::address_data_w)).umask16(0x00ff); - map(0x04400000, 0x0440007f).w(FUNC(tickee_state::tickee_control_w)).share("control"); + map(0x04400000, 0x0440007f).w(FUNC(tickee_gun_state::tickee_control_w)).share(m_control); map(0x04400040, 0x0440004f).portr("IN2"); map(0xc0000240, 0xc000025f).nopw(); /* seems to be a bug in their code */ map(0xff000000, 0xffffffff).rom().region("user1", 0); @@ -454,7 +486,7 @@ void tickee_state::tickee_map(address_map &map) /* addreses in the 04x range shifted slightly...*/ -void tickee_state::ghoshunt_map(address_map &map) +void tickee_gun_state::ghoshunt_map(address_map &map) { map(0x00000000, 0x003fffff).ram().share("vram"); map(0x02000000, 0x02ffffff).rom().region("user1", 0); @@ -464,7 +496,7 @@ void tickee_state::ghoshunt_map(address_map &map) map(0x04300000, 0x0430001f).w("ym1", FUNC(ay8910_device::address_data_w)).umask16(0x00ff); map(0x04300100, 0x0430010f).r("ym2", FUNC(ay8910_device::data_r)).umask16(0x00ff); map(0x04300100, 0x0430011f).w("ym2", FUNC(ay8910_device::address_data_w)).umask16(0x00ff); - map(0x04500000, 0x0450007f).w(FUNC(tickee_state::tickee_control_w)).share("control"); + map(0x04500000, 0x0450007f).w(FUNC(tickee_gun_state::tickee_control_w)).share(m_control); map(0xc0000240, 0xc000025f).nopw(); /* seems to be a bug in their code */ map(0xff000000, 0xffffffff).rom().region("user1", 0); } @@ -479,7 +511,7 @@ void tickee_state::mouseatk_map(address_map &map) map(0x04200000, 0x0420000f).r("ym", FUNC(ay8910_device::data_r)).umask16(0x00ff); map(0x04200000, 0x0420000f).w("ym", FUNC(ay8910_device::address_data_w)).umask16(0x00ff); map(0x04200100, 0x0420010f).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff); - map(0x04400000, 0x0440007f).w(FUNC(tickee_state::tickee_control_w)).share("control"); + map(0x04400000, 0x0440007f).w(FUNC(tickee_state::tickee_control_w)).share(m_control); map(0x04400040, 0x0440004f).portr("IN2"); // ? map(0xc0000240, 0xc000025f).nopw(); /* seems to be a bug in their code */ map(0xff000000, 0xffffffff).rom().region("user1", 0); @@ -487,16 +519,16 @@ void tickee_state::mouseatk_map(address_map &map) /* newer hardware */ -void tickee_state::rapidfir_map(address_map &map) +void tickee_gun_state::rapidfir_map(address_map &map) { map(0x00000000, 0x007fffff).ram().share("vram"); - map(0x02000000, 0x027fffff).rw(FUNC(tickee_state::rapidfir_transparent_r), FUNC(tickee_state::rapidfir_transparent_w)); - map(0xfc000000, 0xfc00000f).r(FUNC(tickee_state::rapidfir_gun1_r)); - map(0xfc000100, 0xfc00010f).r(FUNC(tickee_state::rapidfir_gun2_r)); - map(0xfc000400, 0xfc00040f).r(FUNC(tickee_state::ffff_r)); + map(0x02000000, 0x027fffff).rw(FUNC(tickee_gun_state::rapidfir_transparent_r), FUNC(tickee_gun_state::rapidfir_transparent_w)); + map(0xfc000000, 0xfc00000f).r(FUNC(tickee_gun_state::rapidfir_gun1_r)); + map(0xfc000100, 0xfc00010f).r(FUNC(tickee_gun_state::rapidfir_gun2_r)); + map(0xfc000400, 0xfc00040f).r(FUNC(tickee_gun_state::ffff_r)); map(0xfc000500, 0xfc00050f).noprw(); - map(0xfc000600, 0xfc00060f).w(FUNC(tickee_state::rapidfir_control_w)); - map(0xfc000700, 0xfc00070f).w(FUNC(tickee_state::sound_bank_w)); + map(0xfc000600, 0xfc00060f).w(FUNC(tickee_gun_state::rapidfir_control_w)); + map(0xfc000700, 0xfc00070f).w(FUNC(tickee_gun_state::sound_bank_w)); map(0xfc000800, 0xfc00080f).portr("IN0"); map(0xfc000900, 0xfc00090f).portr("IN1"); map(0xfc000a00, 0xfc000a0f).portr("IN2"); @@ -506,7 +538,7 @@ void tickee_state::rapidfir_map(address_map &map) map(0xfc100000, 0xfc1000ff).mirror(0x80000).rw(m_tlc34076, FUNC(tlc34076_device::read), FUNC(tlc34076_device::write)).umask16(0x00ff); map(0xfc200000, 0xfc207fff).ram().share("nvram"); map(0xfc300000, 0xfc30000f).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff); - map(0xfc400010, 0xfc40001f).rw(FUNC(tickee_state::ff7f_r), FUNC(tickee_state::ff7f_w)); + map(0xfc400010, 0xfc40001f).rw(FUNC(tickee_gun_state::ff7f_r), FUNC(tickee_gun_state::ff7f_w)); map(0xfe000000, 0xffffffff).rom().region("user1", 0); } @@ -742,23 +774,24 @@ static INPUT_PORTS_START( rapidfir ) PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) PORT_PLAYER(2) INPUT_PORTS_END + /************************************* * * Machine drivers * *************************************/ -void tickee_state::tickee(machine_config &config) +void tickee_gun_state::tickee(machine_config &config) { /* basic machine hardware */ TMS34010(config, m_maincpu, XTAL(40'000'000)); - m_maincpu->set_addrmap(AS_PROGRAM, &tickee_state::tickee_map); + m_maincpu->set_addrmap(AS_PROGRAM, &tickee_gun_state::tickee_map); m_maincpu->set_halt_on_reset(false); m_maincpu->set_pixel_clock(VIDEO_CLOCK/2); m_maincpu->set_pixels_per_clock(1); - m_maincpu->set_scanline_rgb32_callback(FUNC(tickee_state::scanline_update)); + m_maincpu->set_scanline_rgb32_callback(FUNC(tickee_gun_state::scanline_update)); - MCFG_MACHINE_RESET_OVERRIDE(tickee_state,tickee) + set_beamadd(50, 0); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); @@ -767,9 +800,6 @@ void tickee_state::tickee(machine_config &config) /* video hardware */ TLC34076(config, m_tlc34076, tlc34076_device::TLC34076_6_BIT); - MCFG_VIDEO_START_OVERRIDE(tickee_state,tickee) - MCFG_VIDEO_RESET_OVERRIDE(tickee_state,tickee) - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(VIDEO_CLOCK/2, 444, 0, 320, 233, 0, 200); m_screen->set_screen_update("maincpu", FUNC(tms34010_device::tms340x0_rgb32)); @@ -789,28 +819,28 @@ void tickee_state::tickee(machine_config &config) } -void tickee_state::ghoshunt(machine_config &config) +void tickee_gun_state::ghoshunt(machine_config &config) { tickee(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &tickee_state::ghoshunt_map); + m_maincpu->set_addrmap(AS_PROGRAM, &tickee_gun_state::ghoshunt_map); } -void tickee_state::rapidfir(machine_config &config) +void tickee_gun_state::rapidfir(machine_config &config) { /* basic machine hardware */ TMS34010(config, m_maincpu, XTAL(50'000'000)); - m_maincpu->set_addrmap(AS_PROGRAM, &tickee_state::rapidfir_map); + m_maincpu->set_addrmap(AS_PROGRAM, &tickee_gun_state::rapidfir_map); m_maincpu->set_halt_on_reset(false); m_maincpu->set_pixel_clock(VIDEO_CLOCK/2); m_maincpu->set_pixels_per_clock(1); - m_maincpu->set_scanline_rgb32_callback(FUNC(tickee_state::rapidfir_scanline_update)); - m_maincpu->set_shiftreg_in_callback(FUNC(tickee_state::rapidfir_to_shiftreg)); - m_maincpu->set_shiftreg_out_callback(FUNC(tickee_state::rapidfir_from_shiftreg)); + m_maincpu->set_scanline_rgb32_callback(FUNC(tickee_gun_state::rapidfir_scanline_update)); + m_maincpu->set_shiftreg_in_callback(FUNC(tickee_gun_state::rapidfir_to_shiftreg)); + m_maincpu->set_shiftreg_out_callback(FUNC(tickee_gun_state::rapidfir_from_shiftreg)); - MCFG_MACHINE_RESET_OVERRIDE(tickee_state,rapidfir) + set_beamadd(0, -5); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); WATCHDOG_TIMER(config, "watchdog"); @@ -818,8 +848,6 @@ void tickee_state::rapidfir(machine_config &config) /* video hardware */ TLC34076(config, m_tlc34076, tlc34076_device::TLC34076_6_BIT); - MCFG_VIDEO_START_OVERRIDE(tickee_state,tickee) - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(VIDEO_CLOCK/2, 444, 0, 320, 233, 0, 200); m_screen->set_screen_update("maincpu", FUNC(tms34010_device::tms340x0_rgb32)); @@ -841,7 +869,6 @@ void tickee_state::mouseatk(machine_config &config) m_maincpu->set_pixels_per_clock(1); m_maincpu->set_scanline_rgb32_callback(FUNC(tickee_state::scanline_update)); - MCFG_MACHINE_RESET_OVERRIDE(tickee_state,tickee) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); @@ -1150,6 +1177,8 @@ ROM_START( maletmad ) /* Version 2.1 */ /* U510 not populated */ ROM_END +} // anonymous namespace + /************************************* * @@ -1157,11 +1186,11 @@ ROM_END * *************************************/ -GAME( 1994, tickee, 0, tickee, tickee, tickee_state, empty_init, ROT0, "Raster Elite", "Tickee Tickats", 0 ) -GAME( 1996, ghoshunt, 0, ghoshunt, ghoshunt, tickee_state, empty_init, ROT0, "Hanaho Games", "Ghost Hunter", 0 ) -GAME( 1996, tutstomb, 0, ghoshunt, ghoshunt, tickee_state, empty_init, ROT0, "Island Design", "Tut's Tomb", 0 ) -GAME( 1996, mouseatk, 0, mouseatk, mouseatk, tickee_state, empty_init, ROT0, "ICE", "Mouse Attack", 0 ) -GAME( 1998, rapidfir, 0, rapidfir, rapidfir, tickee_state, empty_init, ROT0, "Hanaho Games", "Rapid Fire v1.1 (Build 239)", 0 ) -GAME( 1998, rapidfira, rapidfir, rapidfir, rapidfir, tickee_state, empty_init, ROT0, "Hanaho Games", "Rapid Fire v1.1 (Build 238)", 0 ) -GAME( 1998, rapidfire, rapidfir, rapidfir, rapidfir, tickee_state, empty_init, ROT0, "Hanaho Games", "Rapid Fire v1.0 (Build 236)", 0 ) -GAME( 1999, maletmad, 0, rapidfir, rapidfir, tickee_state, empty_init, ROT0, "Hanaho Games", "Mallet Madness v2.1", 0 ) +GAME( 1994, tickee, 0, tickee, tickee, tickee_gun_state, empty_init, ROT0, "Raster Elite", "Tickee Tickats", 0 ) +GAME( 1996, ghoshunt, 0, ghoshunt, ghoshunt, tickee_gun_state, empty_init, ROT0, "Hanaho Games", "Ghost Hunter", 0 ) +GAME( 1996, tutstomb, 0, ghoshunt, ghoshunt, tickee_gun_state, empty_init, ROT0, "Island Design", "Tut's Tomb", 0 ) +GAME( 1996, mouseatk, 0, mouseatk, mouseatk, tickee_state, empty_init, ROT0, "ICE", "Mouse Attack", 0 ) +GAME( 1998, rapidfir, 0, rapidfir, rapidfir, tickee_gun_state, empty_init, ROT0, "Hanaho Games", "Rapid Fire v1.1 (Build 239)", 0 ) +GAME( 1998, rapidfira, rapidfir, rapidfir, rapidfir, tickee_gun_state, empty_init, ROT0, "Hanaho Games", "Rapid Fire v1.1 (Build 238)", 0 ) +GAME( 1998, rapidfire, rapidfir, rapidfir, rapidfir, tickee_gun_state, empty_init, ROT0, "Hanaho Games", "Rapid Fire v1.0 (Build 236)", 0 ) +GAME( 1999, maletmad, 0, rapidfir, rapidfir, tickee_gun_state, empty_init, ROT0, "Hanaho Games", "Mallet Madness v2.1", 0 ) diff --git a/src/mame/drivers/toaplan2.cpp b/src/mame/drivers/toaplan2.cpp index 409d572b991..6718856c6bf 100644 --- a/src/mame/drivers/toaplan2.cpp +++ b/src/mame/drivers/toaplan2.cpp @@ -3423,19 +3423,19 @@ static const u8 nitro_decryption_table[256] = { /*a*//*r*//*r*//*r*//*x*//*r*//*r*//*r*/ /*W*//*r*//*W*//*W*//*a*//*r*//*a*//*r*/ 0x86,0x8b,0xd1,0x3e,0x8d,0x3e,0x58,0xfb, 0xc3,0x79,0xbd,0xb7,0x8a,0xe8,0x0f,0x81, /* 30 */ /*a*//*a*//*a*//*a*//*r*//*r*//*a*//*r*/ /*r*//*a*//*a*//*W*//*r*//*r*//*r*//*r*/ - 0xb7,0xd0,0x8b,0xeb,0xff,0xb8,0x90,0x8b, 0x5e,0xa2,0x90,0x90,0xab,0xb4,0x80,0x59, /* 40 */ + 0xb7,0xd0,0x8b,0xeb,0xff,0xb8,0x90,0x8b, 0x5e,0xa2,0x90,0xc1,0xab,0xb4,0x80,0x59, /* 40 */ /*r*//*r*//*a*//*r*//*a*//*x*/ /*a*/ /*W*//*W*/ /*r*//*W*//*r*//*a*/ 0x87,0x72,0xb5,0xbd,0xb0,0x88,0x50,0x0f, 0xfe,0xd2,0xc3,0x90,0x8a,0x90,0xf9,0x75, /* 50 */ /*W*//*a*//*a*//*r*//*r*//*a*//*a*//*a*/ /*r*//*W*//*r*/ /*r*/ /*W*//*r*/ 0x1a,0xb3,0x74,0x0a,0x68,0x24,0xbb,0x90, 0x75,0x47,0xfe,0x2c,0xbe,0xc3,0x88,0xd2, /* 60 */ /*W*//*r*//*a*//*r*//*a*//*a*//*W*/ /*r*//*a*//*r*//*W*//*W*//*a*//*r*//*a*/ - 0x3e,0xc1,0x8c,0x33,0x0f,0x90,0x8b,0x90, 0xb9,0x1e,0xff,0xa2,0x3e,0x22,0xbe,0x57, /* 70 */ + 0x3e,0xc1,0x8c,0x33,0x0f,0x4f,0x8b,0x90, 0xb9,0x1e,0xff,0xa2,0x3e,0x22,0xbe,0x57, /* 70 */ /*r*//*W*//*r*//*r*//*a*/ /*a*/ /*r*//*r*//*a*//*r*//*a*//*W*//*r*//*a*/ 0x81,0x3a,0xf6,0x88,0xeb,0xb1,0x89,0x8a, 0x32,0x80,0x0f,0xb1,0x48,0xc3,0x68,0x72, /* 80 */ /*r*//*r*//*r*//*r*//*a*//*W*//*a*//*r*/ /*r*//*r*//*r*//*a*//*x*//*a*//*a*//*r*/ 0x53,0x02,0xc0,0x02,0xe8,0xb4,0x74,0xbc, 0x90,0x58,0x0a,0xf3,0x75,0xc6,0x90,0xe8, /* 90 */ /*a*//*W*//*r*//*W*//*r*//*r*//*r*//*x*/ /*a*//*r*//*r*//*r*//*x*/ /*r*/ - 0x26,0x50,0xfc,0x8c,0x90,0xb1,0xc3,0xd1, 0xeb,0x83,0xa4,0xbf,0x26,0x4b,0x46,0xfe, /* a0 */ + 0x26,0x50,0xfc,0x8c,0x06,0xb1,0xc3,0xd1, 0xeb,0x83,0xa4,0xbf,0x26,0x4b,0x46,0xfe, /* a0 */ /*r*//*a*//*a*//*r*/ /*a*//*r*//*W*/ /*a*//*r*//*r*//*r*//*r*//*W*//*a*//*r*/ 0xe2,0x89,0xb3,0x88,0x03,0x56,0x0f,0x38, 0xbb,0x0c,0x90,0x0f,0x07,0x8a,0x8a,0x33, /* b0 */ /*r*//*a*//*W*//*r*//*a*//*W*//*r*//*W*/ /*W*//*W*/ /*a*//*r*//*r*//*r*//*x*/ @@ -3443,7 +3443,7 @@ static const u8 nitro_decryption_table[256] = { /*r*//*W*//*r*//*r*//*r*//*r*//*W*//*r*/ /*r*//*W*//*x*//*x*//*r*//*?*//*r*//*r*/ 0x90,0xeb,0x55,0xf6,0x8a,0xb0,0x5d,0xc0, 0xbb,0x8d,0xf6,0xd0,0xd1,0x88,0x4d,0x90, /* d0 */ /*a*//*r*//*r*//*a*//*a*//*r*//*W*/ /*x*//*r*//*r*//*a*//*W*//*r*//*W*/ - 0x51,0x51,0x74,0xbd,0x32,0xd1,0x90,0xd2, 0x53,0xc7,0xab,0x36,0x50,0xe9,0x33,0xb3, /* e0 */ + 0x51,0x51,0x74,0xbd,0x32,0xd1,0xc6,0xd2, 0x53,0xc7,0xab,0x36,0x50,0xe9,0x33,0xb3, /* e0 */ /*r*//*a*//*r*//*r*//*r*//*W*/ /*a*/ /*r*//*x*//*r*//*r*//*W*//*a*//*r*//*W*/ 0x2e,0x05,0x88,0x59,0x74,0x74,0x22,0x8e, 0x8a,0x8a,0x36,0x08,0x0f,0x45,0x90,0x2e, /* f0 */ /*r*//*W*//*r*//*r*//*a*//*a*//*W*//*x*/ /*r*//*r*//*x*//*a*//*r*//*a*/ /*r*/ @@ -4522,6 +4522,42 @@ ROM_START( kbashk ) ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM Samples */ ROM_LOAD( "tp023_7.bin", 0x00000, 0x40000, CRC(3732318f) SHA1(f0768459f5ad2dee53d408a0a5ae3a314864e667) ) ROM_END + +// all labels handwritten. Given the AOU on the audio ROM, maybe a prototype destined to be showed there? +// GFX ROMs are on 4 riser boards. They are smaller but contain the same data as the final version. +// Only different ROMs are the main and audio CPU ones +ROM_START( kbashp ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "2-19.u52", 0x000000, 0x080000, CRC(60dfdfec) SHA1(ca61433c8f7b1b765a699c375c946f113beeccc4) ) // actually 2/19 + + /* Secondary CPU is a Toaplan marked chip, (NITRO TOA PLAN 509) */ + /* It's a NEC V25 (PLCC94) (encrypted) */ + + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "aou-nb-sound.u34", 0x0000, 0x8000, CRC(26ba8fb1) SHA1(4259c4704f0fea0c8befa2e60a0838280b23a507) ) + + ROM_REGION( 0x800000, "gp9001_0", 0 ) + ROM_LOAD( "0.u1", 0x000000, 0x080000, CRC(1b87ffa5) SHA1(fbd5ac9e9635c1f5b1b896a3d504b827c0a99679) ) + ROM_LOAD( "2.u2", 0x080000, 0x080000, CRC(a411457e) SHA1(6b515e6524aa4fb1785d99556fefb0434368de84) ) + ROM_LOAD( "4.u3", 0x100000, 0x080000, CRC(631f770d) SHA1(0f0c11bc5549ed68d20dfc6ae51c3caec65aab88) ) + ROM_LOAD( "6.u4", 0x180000, 0x080000, CRC(5a46d262) SHA1(56d5180196b5acf76b700e627878998e88a21f3c) ) + ROM_LOAD( "8.u1", 0x200000, 0x080000, CRC(11b1c986) SHA1(05260c6cc5ab4239b52549e0dcda8853fc1fcd3a) ) + ROM_LOAD( "a.u2", 0x280000, 0x080000, CRC(4c4b47ce) SHA1(a41a27ac96bd9eb57bc4bd8b6592b70e86ad16d3) ) + ROM_LOAD( "c.u3", 0x300000, 0x080000, CRC(1ccc6a19) SHA1(d5735c2f075d81018021ec9e8642104227b67ace) ) + ROM_LOAD( "e.u4", 0x380000, 0x080000, CRC(731ad154) SHA1(78efce53000d170098b57342641299aacb7a82aa) ) + ROM_LOAD( "3.u1", 0x400000, 0x080000, CRC(7fbe0452) SHA1(c9b8c0d7126382fcdf8b5fa9a4466292954c88f7) ) + ROM_LOAD( "1.u2", 0x480000, 0x080000, CRC(6cd94e90) SHA1(9957ad69f8e80370dbf2cd863d0646241236f6b4) ) + ROM_LOAD( "5.u3", 0x500000, 0x080000, CRC(9cb4884e) SHA1(f596902b7740de4c262b4b18ac17eccca566ea77) ) + ROM_LOAD( "7.u4", 0x580000, 0x080000, CRC(53c2e0b6) SHA1(ee1128ad41ae3c68ef32d4211dd5205a9a5bb216) ) + ROM_LOAD( "g.u1", 0x600000, 0x080000, CRC(a63c795c) SHA1(30d3bb29cd73b31e233229f9304e3b87feaf01f3) ) + ROM_LOAD( "b.u2", 0x680000, 0x080000, CRC(32f8c39b) SHA1(a9029910c0b4fc3693081056a0afb9bcf9c0e699) ) + ROM_LOAD( "d.u3", 0x700000, 0x080000, CRC(40ac17d5) SHA1(140c67cf86ce545469fbe899b1f38c3a070908c9) ) + ROM_LOAD( "f.u4", 0x780000, 0x080000, CRC(2ca4eb83) SHA1(0d7c4242a82aba49cafd96ee5b051918d1b23b08) ) + + ROM_REGION( 0x40000, "oki1", 0 ) + ROM_LOAD( "2m-nb-pcm.u40", 0x00000, 0x40000, CRC(3732318f) SHA1(f0768459f5ad2dee53d408a0a5ae3a314864e667) ) +ROM_END + /* Knuckle Bash 2 This is a hacked version of Knuckle Bash on bootleg/Korean/Chinese @@ -5969,8 +6005,9 @@ GAME( 1992, dogyuuna, dogyuun, dogyuun, dogyuuna, toaplan2_state, ini GAME( 1992, dogyuunb, dogyuun, dogyuun, dogyuunt, toaplan2_state, init_dogyuun, ROT270, "Toaplan", "Dogyuun (oldest set)", MACHINE_SUPPORTS_SAVE ) // maybe a newer location test version, instead GAME( 1992, dogyuunt, dogyuun, dogyuun, dogyuunt, toaplan2_state, init_dogyuun, ROT270, "Toaplan", "Dogyuun (location test)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, kbash, 0, kbash, kbash, toaplan2_state, empty_init, ROT0, "Toaplan / Atari", "Knuckle Bash", MACHINE_SUPPORTS_SAVE ) // Atari license shown for some regions. -GAME( 1993, kbashk, kbash, kbash, kbashk, toaplan2_state, empty_init, ROT0, "Toaplan / Taito", "Knuckle Bash (Korean PCB)", MACHINE_SUPPORTS_SAVE ) // Japan region has optional Taito license, maybe the original Japan release? +GAME( 1993, kbash, 0, kbash, kbash, toaplan2_state, empty_init, ROT0, "Toaplan / Atari", "Knuckle Bash", MACHINE_SUPPORTS_SAVE ) // Atari license shown for some regions. +GAME( 1993, kbashk, kbash, kbash, kbashk, toaplan2_state, empty_init, ROT0, "Toaplan / Taito", "Knuckle Bash (Korean PCB)", MACHINE_SUPPORTS_SAVE ) // Japan region has optional Taito license, maybe the original Japan release? +GAME( 1993, kbashp, kbash, kbash, kbash, toaplan2_state, empty_init, ROT0, "Toaplan / Taito", "Knuckle Bash (location test)", MACHINE_SUPPORTS_SAVE ) GAME( 1999, kbash2, 0, kbash2, kbash2, toaplan2_state, empty_init, ROT0, "bootleg", "Knuckle Bash 2 (bootleg)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/warpwarp.cpp b/src/mame/drivers/warpwarp.cpp index 839f90769a8..2563bb06d06 100644 --- a/src/mame/drivers/warpwarp.cpp +++ b/src/mame/drivers/warpwarp.cpp @@ -130,6 +130,73 @@ Notes: numbers are in cyan and text in red (and this arrangement doesn't make much sense, different version maybe?). + +Bomb Bee (Namco, 1979) +Hardware info by Guru +--------------------- + +Bomb Bee is Namco's 2nd game board (the first board was Gee Bee). +Bomb Bee is essentially the color version of Gee Bee with some playfield +layout changes and real color (Gee Bee is a b/w game with a color overlay). +To power the board this game requires 8VAC and 12VAC. These pass through +on-board bridge rectifiers then go to linear regulators to make all the +DC voltages. +The controls are.... +5k-ohm potentiometer for the paddle +Button to serve. If not pressed, the ball launches automatically after a few seconds. +Button to start a player 1 game +Button to start a player 2 game +In test mode the paddle VOL range is 5 to 211 +A play demo of the real arcade PCB can be seen here.... +https://www.youtube.com/watch?v=3-vIXC09nDA + +NAMCO +21059211 +|------------------------------------------------------------------------| +| LS163 LS368 LS174 LS194 LS157 LS00 18.432MHz SW1| +| 7905 7812 LS163 LS367 LS174 LS04 LS194 LS74 LS107 | +| LS393 LS367 8212 TMM334.4C LS366 LS32 8224 |---| | +| LS153 8212 LS368 LS08 | 8 | | +| 4066 LS367 LS367 LS157 LS139 | 0 | | +| 2114 2114 LS367 LS157 LS367 | 8 | | +| 2114 2114 LS367 LS157 LS367 | 0 | | +| LS08 LS138 LS86 LS157 |---| | +|4 LS08 LS393 LS86 LS157 TMM333.2K TMM333.1K| +|4 MB3712 LS259 LS393 LS86 LS157 | +|W 10K_VOL LS251 LS92 LS86 LS253 DIP24.2M DIP24.1M | +|A LM311 LS128 LS08 LS74 LS00 | +|Y 4066 LS138 LS74 LS30 LS367 DIP24.2P DIP24.1P | +| LS74 LS283 LS365 | +| NE556 LS10 LS283 LS365 DIP24.2R DIP24.1R | +| UA78MGU1C LS151 LS163 LS273 | +| |-----------------| SW3 LS175 LS163 LS273 DIP24.2T DIP24.1T | +|FUSE| D568 | LS251 LS164 LS08 LS366 TMM314| +| |ON LARGE HEATSINK| LS164 LS175 LS368 TMM314| +|----|-----------------|-------------------------------------------------| +Notes: (All ICs shown above) + 8080 - NEC D8080AFC Microprocessor. Clock 2.048MHz [18.432/9] + HSync - 15.2880kHz + VSync - 60.5610Hz + MB3712 - Fujitsu 5.7W Audio Power Amplifier + LM311 - Texas Instruments LM311 Differential Comparator + 4066 - Motorola MC14066 CMOS Quad Bilateral Switch + UA78MGU1C - Fairchild UA78MGU1C 4-terminal Adjustable 500mA Voltage Regulator + 7812 - Texas Instruments LM7812 +12V Linear Regulator + 7905 - Texas Instruments LM7905 -5V Linear Regulator + D568 - NEC D568 60V 7A NPN Transistor + NE566 - Signetics NE556 Dual Precision Timer + SW1 - Push button for reset + SW3 - 8-position DIP Switch + 10K_VOL - 10k-ohm volume potentiometer + DIP24.* - Unpopulated DIP24 positions for ROMs + 8212 - NEC uPB8212C 8-bit Input/Output Port + 8224 - NEC uPB8224C Clock Generator and Driver for 8080 CPU + 2114 - NEC uPD2114 1kBx4-bit SRAM (video RAM) + TMM314 - Toshiba TMM314 1kBx4-bit SRAM (main program RAM) + TMM334.4C - Toshiba TMM334 2kBx8-bit mask ROM (graphics) + TMM333.1K \ + TMM333.2K / Toshiba TMM333 4kBx8-bit mask ROM (main program) + ***************************************************************************/ #include "emu.h" @@ -906,10 +973,11 @@ ROM_END ROM_START( bombbee ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "bombbee.1k", 0x0000, 0x2000, CRC(9f8cd7af) SHA1(0d6e1ee5519660d1498eb7a093872ed5034423f2) ) + ROM_LOAD( "tmm333.2k", 0x0000, 0x1000, CRC(a442f22b) SHA1(c31a2a44e71fd0e8b6460a415b9bd8b298e68d6c) ) + ROM_LOAD( "tmm333.1k", 0x1000, 0x1000, CRC(81f805b3) SHA1(380d68c016400ae5d7f271813bc9726d9be639d1) ) ROM_REGION( 0x800, "gfx1", 0 ) - ROM_LOAD( "bombbee.4c", 0x0000, 0x0800, CRC(5f37d569) SHA1(d5e3fb4c5a1612a6e568c8970161b0290b88993f) ) + ROM_LOAD( "tmm334.4c", 0x0000, 0x0800, CRC(5f37d569) SHA1(d5e3fb4c5a1612a6e568c8970161b0290b88993f) ) ROM_END ROM_START( cutieq ) diff --git a/src/mame/includes/8080bw.h b/src/mame/includes/8080bw.h index 806b7c1385d..f399bf0cf85 100644 --- a/src/mame/includes/8080bw.h +++ b/src/mame/includes/8080bw.h @@ -255,6 +255,25 @@ DISCRETE_SOUND_EXTERN( schaser_discrete ); /*******************************************************/ +/* Sidam Invasion */ +/*******************************************************/ + +class invasion_state : public invaders_state +{ +public: + invasion_state(machine_config const &mconfig, device_type type, char const *tag) : + invaders_state(mconfig, type, tag) + { + } + + void invasion(machine_config &config); + +private: + void io_map(address_map &map); +}; + + +/*******************************************************/ /* Darth Vader bootleg */ /*******************************************************/ diff --git a/src/mame/includes/sderby.h b/src/mame/includes/sderby.h deleted file mode 100644 index 0b2485421a0..00000000000 --- a/src/mame/includes/sderby.h +++ /dev/null @@ -1,78 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood, Roberto Fresca -#ifndef MAME_INCLUDES_SDERBY_H -#define MAME_INCLUDES_SDERBY_H - -#pragma once - -#include "emupal.h" -#include "tilemap.h" - -class sderby_state : public driver_device -{ -public: - sderby_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_md_videoram(*this, "md_videoram"), - m_fg_videoram(*this, "fg_videoram"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_lamps(*this, "lamp%u", 1U) - { } - - void spacewin(machine_config &config); - void sderbya(machine_config &config); - void pmroulet(machine_config &config); - void shinygld(machine_config &config); - void sderby(machine_config &config); - void luckboom(machine_config &config); - -private: - uint16_t sderby_input_r(offs_t offset); - uint16_t sderbya_input_r(offs_t offset); - uint16_t roulette_input_r(offs_t offset); - uint16_t rprot_r(); - void rprot_w(uint16_t data); - void sderby_out_w(uint16_t data); - void scmatto_out_w(uint16_t data); - void roulette_out_w(uint16_t data); - void sderby_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void sderby_md_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void sderby_fg_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void sderby_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - TILE_GET_INFO_MEMBER(get_sderby_tile_info); - TILE_GET_INFO_MEMBER(get_sderby_md_tile_info); - TILE_GET_INFO_MEMBER(get_sderby_fg_tile_info); - uint32_t screen_update_sderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_pmroulet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int codeshift); - void luckboom_map(address_map &map); - void roulette_map(address_map &map); - void sderby_map(address_map &map); - void sderbya_map(address_map &map); - void shinygld_map(address_map &map); - void spacewin_map(address_map &map); - - virtual void machine_start() override { m_lamps.resolve(); } - virtual void video_start() override; - - required_shared_ptr<uint16_t> m_videoram; - required_shared_ptr<uint16_t> m_md_videoram; - required_shared_ptr<uint16_t> m_fg_videoram; - required_shared_ptr<uint16_t> m_spriteram; - - tilemap_t *m_tilemap = nullptr; - tilemap_t *m_md_tilemap = nullptr; - tilemap_t *m_fg_tilemap = nullptr; - - uint16_t m_scroll[6]{}; - required_device<cpu_device> m_maincpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; - output_finder<7> m_lamps; -}; - -#endif // MAME_INCLUDES_SDERBY_H diff --git a/src/mame/layout/igsslot.lay b/src/mame/layout/igsslot.lay new file mode 100644 index 00000000000..8949bd86859 --- /dev/null +++ b/src/mame/layout/igsslot.lay @@ -0,0 +1,132 @@ +<?xml version="1.0"?> +<!-- +license:CC0 +--> +<mamelayout version="2"> + <element name="L1" defstate="1"> + <rect state="1"> + <color red="0.0" green="1.0" blue="0.0" /> + </rect> + <rect state="0"> + <color red="0.0" green="0.2" blue="0.0" /> + </rect> + <text string="TAKE"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.1" width="1" height="0.4" /> + </text> + <text string="STOP1"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.5" width="1" height="0.4" /> + </text> + </element> + + <element name="L2" defstate="1"> + <rect state="1"> + <color red="0.0" green="1.0" blue="0.0" /> + </rect> + <rect state="0"> + <color red="0.0" green="0.2" blue="0.0" /> + </rect> + <text string="HIGH"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.1" width="1" height="0.4" /> + </text> + <text string="STOP2"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.5" width="1" height="0.4" /> + </text> + </element> + + <element name="L3" defstate="1"> + <rect state="1"> + <color red="0.0" green="1.0" blue="0.0" /> + </rect> + <rect state="0"> + <color red="0.0" green="0.2" blue="0.0" /> + </rect> + <text string="LOW"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.1" width="1" height="0.4" /> + </text> + <text string="STOP3"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.5" width="1" height="0.4" /> + </text> + </element> + + <element name="L4" defstate="1"> + <rect state="1"> + <color red="0.0" green="1.0" blue="0.0" /> + </rect> + <rect state="0"> + <color red="0.0" green="0.2" blue="0.0" /> + </rect> + <text string="W-UP"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.1" width="1" height="0.4" /> + </text> + <text string="STOP4"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.5" width="1" height="0.4" /> + </text> + </element> + + <element name="L5" defstate="1"> + <rect state="1"> + <color red="0.0" green="1.0" blue="0.0" /> + </rect> + <rect state="0"> + <color red="0.0" green="0.2" blue="0.0" /> + </rect> + <text string="BET / 2W-UP"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.1" width="1" height="0.4" /> + </text> + <text string="STOP ALL"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.5" width="1" height="0.4" /> + </text> + </element> + + <element name="L6" defstate="1"> + <rect state="1"> + <color red="1.0" green="0.0" blue="0.0" /> + </rect> + <rect state="0"> + <color red="0.3" green="0.0" blue="0.0" /> + </rect> + <text string="HW-UP"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.1" width="1" height="0.4" /> + </text> + <text string="START"> + <color red="0.0" green="0.0" blue="0.0" /> + <bounds x="0" y="0.5" width="1" height="0.4" /> + </text> + </element> + + + <view name="Button Lamps"> + <screen index="0"> + <bounds left="0" top="0" right="4" bottom="3" /> + </screen> + <element name="lamp1" ref="L1"> + <bounds x="0.5" y="3.13" width="0.40" height="0.24" /> + </element> + <element name="lamp2" ref="L2"> + <bounds x="1.0" y="3.13" width="0.40" height="0.24" /> + </element> + <element name="lamp3" ref="L3"> + <bounds x="1.5" y="3.13" width="0.40" height="0.24" /> + </element> + <element name="lamp4" ref="L4"> + <bounds x="2.0" y="3.13" width="0.40" height="0.24" /> + </element> + <element name="lamp5" ref="L5"> + <bounds x="2.5" y="3.13" width="0.40" height="0.24" /> + </element> + <element name="lamp6" ref="L6"> + <bounds x="3.0" y="3.13" width="0.40" height="0.24" /> + </element> + </view> +</mamelayout> diff --git a/src/mame/machine/igs022.cpp b/src/mame/machine/igs022.cpp index 0fabcd00383..d6adb617ea8 100644 --- a/src/mame/machine/igs022.cpp +++ b/src/mame/machine/igs022.cpp @@ -1,17 +1,23 @@ // license:BSD-3-Clause // copyright-holders:David Haywood, ElSemi -/* +/************************************************************************************************************ - IGS022 is an encrypted DMA device, most likely an MCU of some sort - it can safely be swapped between games so doesn't appear to have - any kind of game specific programming + IGS022 is an encrypted DMA device, most likely an MCU of some sort. + It can safely be swapped between games, so doesn't appear to have any kind of game specific programming. -*/ +************************************************************************************************************/ #include "emu.h" #include "igs022.h" +#include <sstream> -#include <algorithm> +#define LOG_DMA (1U << 1) +#define LOG_STACK (1U << 2) +#define LOG_CMD_6D (1U << 3) + +//#define VERBOSE (LOG_GENERAL | LOG_DMA | LOG_STACK | LOG_CMD_6D) +#define VERBOSE (0) +#include "logmacro.h" igs022_device::igs022_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, IGS022, tag, owner, clock) @@ -22,76 +28,105 @@ igs022_device::igs022_device(const machine_config &mconfig, const char *tag, dev void igs022_device::device_start() { - // Reset stuff - std::fill(std::begin(m_kb_regs), std::end(m_kb_regs), 0); - - save_item(NAME(m_kb_regs)); + save_item(NAME(m_regs)); + save_item(NAME(m_stack)); + save_item(NAME(m_stack_ptr)); } void igs022_device::device_reset() { - //printf("igs022_device::device_reset()"); - if (!m_sharedprotram) - { - logerror("m_sharedprotram was not set\n"); - return; - } - IGS022_reset(); + fatalerror("%s: IGS022 sharedprotram was not set!\n", machine().describe_context()); - std::fill(std::begin(m_kb_regs), std::end(m_kb_regs), 0); -} + // the internal MCU boot code automatically does this DMA + // and puts the version # of the data rom in ram + // reset regs and stack + std::fill(std::begin(m_regs), std::end(m_regs), 0); + std::fill(std::begin(m_stack), std::end(m_stack), 0); + m_stack_ptr = 0; -void igs022_device::IGS022_do_dma(u16 src, u16 dst, u16 size, u16 mode) -{ - //printf("igs022_device::IGS022_do_dma\n"); + // fill ram with 0xa55a pattern + for (int i = 0; i < 0x4000 / 2; i++) + m_sharedprotram[i] = 0xa55a; - /* - P_SRC =0x300290 (offset from prot rom base) - P_DST =0x300292 (words from 0x300000) - P_SIZE=0x300294 (words) - P_MODE=0x300296 + // the initial auto-DMA + const u16 * const PROTROM = (u16 *)m_rom->base(); + + u16 src = PROTROM[0x100 / 2]; + const u32 dst = PROTROM[0x102 / 2]; + const u16 size = PROTROM[0x104 / 2]; + u16 mode = PROTROM[0x106 / 2]; - Mode 5 direct - Mode 6 swap nibbles and bytes + mode = (mode >> 8) | (mode << 8); + + src >>= 1; - 1,2,3 table based ops + do_dma(src, dst, size, mode); + + // there is also a version ID? (or is it some kind of checksum) that is stored in the data rom, and gets copied.. + // Dragon World 3 checks it + // Setting 0x3002a0 to #3 causes Dragon World 3 to skip this check + m_sharedprotram[0x2a2 / 2] = PROTROM[0x114 / 2]; +} + +// From IGS022 ROM to shared protection RAM +void igs022_device::do_dma(u16 src, u16 dst, u16 size, u16 mode) +{ + LOGMASKED(LOG_DMA, "%s: IGS022 DMA src %04x, dst %04x, size %04x, mode %04x\n", machine().describe_context(), src, dst, size, mode); + + /* + P_SRC = 0x300290 (offset from prot rom base) + P_DST = 0x300292 (words from 0x300000) + P_SIZE = 0x300294 (words) + P_MODE = 0x300296 + + Mode 0 plain copy + Mode 1,2,3 rom table based ops + Mode 4 fixed data ('IGS ') based ops + Mode 5 swap bytes + Mode 6 swap nibbles */ const u16 param = mode >> 8; - // the initial DMA on kilbld has 0x10 set, drgw3 has 0x18 set, not sure how they affect the operation. - if (mode & 0x00f8) printf("IGS022_do_dma mode bits %04x set\n", mode & 0x00f8); + // the initial auto-DMA on killbld/slqz2/lhzb2 has 0x10 set, drgw3 has 0x18 set, not sure how they affect the operation. + if (mode & 0x00f8) + logerror("%s: IGS022 unknown DMA mode bits %04x set\n", machine().describe_context(), mode & 0x00f8); - mode &= 0x7; // what are the other bits? + mode &= 0x7; // what are the other bits? - if ((mode == 0) || (mode == 1) || (mode == 2) || (mode == 3) || (mode == 4)) - { - /* mode3 applies a xor from a 0x100 byte table to the data being - transferred + const u16 * const PROTROM = (u16 *)m_rom->base(); - the table is stored at the start of the protection rom. + switch (mode) + { + case 0: case 1: case 2: case 3: case 4: + /* + modes 1-3 modify the data being transferred using a 0x100 byte table stored at the start of the protection rom. - the param used with the mode gives a start offset into the table + The param used with the mode gives a start offset into the table. - odd offsets cause an overflow + Odd offsets cause an overflow. */ - - const u16 *PROTROM = (u16*)m_rom->base(); - for (int x = 0; x < size; x++) { - u16 dat2 = PROTROM[src + x]; + u16 dat = PROTROM[src + x]; + + const u8 extraoffset = param & 0xff; + const u8 * const dectable = (u8 *)m_rom->base(); // the basic decryption table is at the start of the mcu data rom! + const u8 taboff = ((x * 2) + extraoffset) & 0xff; // must allow for overflow in instances of odd offsets - const u8 extraoffset = param & 0xff; - const u8* dectable = (u8*)m_rom->base(); // the basic decryption table is at the start of the mcu data rom! - const u8 taboff = ((x * 2) + extraoffset) & 0xff; // must allow for overflow in instances of odd offsets - u16 extraxor = ((dectable[taboff + 1]) << 8) | (dectable[taboff + 0] << 0); + u16 extraxor = ((dectable[taboff + 1]) << 8) | (dectable[taboff + 0] << 0); - if (mode == 4) + switch (mode) { +// case 0: plain copy + case 1: dat -= extraxor; break; + case 2: dat += extraxor; break; + case 3: dat ^= extraxor; break; + case 4: extraxor = 0; + if ((x & 0x003) == 0x000) extraxor |= 0x0049; // 'I' if ((x & 0x003) == 0x001) extraxor |= 0x0047; // 'G' if ((x & 0x003) == 0x002) extraxor |= 0x0053; // 'S' @@ -101,166 +136,273 @@ void igs022_device::IGS022_do_dma(u16 src, u16 dst, u16 size, u16 mode) if ((x & 0x300) == 0x100) extraxor |= 0x4700; // 'G' if ((x & 0x300) == 0x200) extraxor |= 0x5300; // 'S' if ((x & 0x300) == 0x300) extraxor |= 0x2000; // ' ' - } - - // mode == 0 plain - if (mode == 3) dat2 ^= extraxor; - if (mode == 2) dat2 += extraxor; - if (mode == 1) dat2 -= extraxor; - if (mode == 4) - { - //printf("%06x | %04x (%04x)\n", (dst+x)*2, dat2, (u16)(dat2-extraxor)); + LOGMASKED(LOG_DMA, "%s: IGS022 DMA mode 4 -> %06x | %04x (%04x)\n", machine().describe_context(), (dst + x) * 2, dat, (u16)(dat - extraxor)); - dat2 -= extraxor; + dat -= extraxor; + break; } - m_sharedprotram[dst + x] = dat2; + m_sharedprotram[dst + x] = dat; } - } - else if (mode == 5) - { - /* mode 5 seems to be a byteswapped copy */ - const u16 *PROTROM = (u16*)m_rom->base(); + break; + + case 5: // byteswapped copy for (int x = 0; x < size; x++) { u16 dat = PROTROM[src + x]; + dat = ((dat &0x00ff) << 8) | ((dat &0xff00) >> 8); m_sharedprotram[dst + x] = dat; } - } - else if (mode == 6) - { - /* mode 6 seems to be a nibble swapped copy */ - const u16 *PROTROM = (u16*)m_rom->base(); + break; + + case 6: // nibble swapped copy for (int x = 0; x < size; x++) { u16 dat = PROTROM[src + x]; - dat = ((dat & 0xf0f0) >> 4)| - ((dat & 0x0f0f) << 4); + dat = ((dat & 0xf0f0) >> 4) | ((dat & 0x0f0f) << 4); m_sharedprotram[dst + x] = dat; } + break; + + case 7: + logerror("%s: IGS022 DMA unhandled copy mode %04x!\n", machine().describe_context(), mode); + // not used by killbld + // weird mode, the params get left in memory? - maybe it's a NOP? + break; + + default: + logerror("%s: IGS022 DMA unhandled copy mode!: %d, src: %04x, dst: %04x, size: %04x, param: %02x\n", machine().describe_context(), mode, src, dst, size, param); + // not used by killbld + // invalid? + } +} + +void igs022_device::push_stack(u32 data) +{ + if (m_stack_ptr < STACK_SIZE - 1) + ++m_stack_ptr; + + m_stack[m_stack_ptr] = data; +} + +u32 igs022_device::pop_stack() +{ + const u32 data = m_stack[m_stack_ptr]; + + if (m_stack_ptr > 0) + --m_stack_ptr; + + return data; +} + +std::string igs022_device::stack_as_string() const +{ + std::ostringstream stream; + stream << "stack:"; + + for (int i = 0; i <= m_stack_ptr; ++i) + util::stream_format(stream, " %08x", m_stack[i]); + + return std::move(stream).str(); +} + +u32 igs022_device::read_reg(u16 offset) +{ + if (offset < NUM_REGS) + { + return m_regs[offset]; } - else if (mode == 7) + else if (offset == 0x400) { - printf("unhandled copy mode %04x!\n", mode); - // not used by killing blade - /* weird mode, the params get left in memory? - maybe it's a NOP? */ + return pop_stack(); } else { - osd_printf_debug("unhandled copy mode %04x!\n", mode); - printf ("DMA MODE: %d, src: %4.4x, dst: %4.4x, size: %4.4x, param: %2.2x\n", mode, src, dst, size, param); - // not used by killing blade - /* invalid? */ + return 0; // Invalid! } } -// the internal MCU boot code automatically does this DMA -// and puts the version # of the data rom in ram -void igs022_device::IGS022_reset() +void igs022_device::write_reg(u16 offset, u32 data) { - const u16 *PROTROM = (u16*)m_rom->base(); + if (offset < NUM_REGS) + { + m_regs[offset] = data; + } + else if (offset == 0x300) + { + push_stack(data); + } + else + { + // Invalid! + } +} - // fill ram with A5 patern - for (int i = 0; i < 0x4000/2; i++) - m_sharedprotram[i] = 0xa55a; +// What does this do? write the completion byte for now... +void igs022_device::handle_incomplete_command(u16 cmd, u16 res) +{ + logerror("%s: IGS022 command %04x: INCOMPLETE (NOP)\n", machine().describe_context(), cmd); + m_sharedprotram[0x202 / 2] = res; +} - // the auto-dma - u16 src = PROTROM[0x100 / 2]; - const u32 dst = PROTROM[0x102 / 2]; - const u16 size = PROTROM[0x104 / 2]; - u16 mode = PROTROM[0x106 / 2]; +void igs022_device::handle_command() +{ + const u16 cmd = m_sharedprotram[0x200 / 2]; - mode &= 0xff; + switch (cmd) + { + case 0x12: // Push + { + const u32 data = (m_sharedprotram[0x288 / 2] << 16) + m_sharedprotram[0x28a / 2]; - src >>= 1; + push_stack(data); - IGS022_do_dma(src,dst,size,mode); + LOGMASKED(LOG_STACK, "%s: IGS022 command %04x: PUSH {288, 28a} (%08x) %s\n", machine().describe_context(), cmd, data, stack_as_string()); - // there is also a version ID? (or is it some kind of checksum) that is stored in the data rom, and gets copied.. - // Dragon World 3 checks it - // Setting $3002a0 to #3 causes Dragon World 3 to skip this check - m_sharedprotram[0x2a2/2] = PROTROM[0x114/2]; -} + m_sharedprotram[0x202 / 2] = 0x23; // this mode complete? + break; + } -void igs022_device::IGS022_handle_command() -{ - //printf("igs022_device::IGS022_handle_command\n"); + case 0x2d: handle_incomplete_command(cmd, 0x3c); break; // killbld - const u16 cmd = m_sharedprotram[0x200/2]; +// case 0x42: break; // killbld - if (cmd == 0x6d) // Store values to asic ram - { - const u32 p1 = (m_sharedprotram[0x298/2] << 16) | m_sharedprotram[0x29a/2]; - const u32 p2 = (m_sharedprotram[0x29c/2] << 16) | m_sharedprotram[0x29e/2]; + case 0x45: // Pop + { + const u32 data = pop_stack(); + + m_sharedprotram[0x28c / 2] = (data >> 16) & 0xffff; + m_sharedprotram[0x28e / 2] = data & 0xffff; + + LOGMASKED(LOG_STACK, "%s: IGS022 command %04x: POP {28c, 28e} (%08x) %s\n", machine().describe_context(), cmd, data, stack_as_string()); + + m_sharedprotram[0x202 / 2] = 0x56; // this mode complete? + break; + } - if ((p2 & 0xffff) == 0x9) // Set value +// case 0x47: // NOP? slqz2/lhzb2 +// break; + + case 0x4f: // DMA from protection ROM (memcpy with encryption / scrambling) { - const int reg = (p2 >> 16) & 0xffff; + LOGMASKED(LOG_DMA, "%s: IGS022 command %04x: DMA\n", machine().describe_context(), cmd); - if (reg & 0x300) { // 300?? killbld expects 0x200, drgw3 expects 0x100? - m_kb_regs[reg & 0xff] = p1; - } + const u16 src = m_sharedprotram[0x290 / 2] >> 1; // External mcu data is 8 bit and addressed as such + const u32 dst = m_sharedprotram[0x292 / 2]; + const u16 size = m_sharedprotram[0x294 / 2]; + const u16 mode = m_sharedprotram[0x296 / 2]; + + do_dma(src, dst, size, mode); + + m_sharedprotram[0x202 / 2] = 0x5e; // this mode complete? + break; } - if ((p2 & 0xffff) == 0x6) // Add value + case 0x5a: handle_incomplete_command(cmd, 0x4b); break; // killbld, uses {284} as input + + case 0x6d: // Set/Get values to/from ASIC RAM, arithmetic operations on them + handle_command_6d(); + break; + + default: + logerror("%s: IGS022 command %04x: UNKNOWN!\n", machine().describe_context(), cmd); + } +} + +// Set/Get values to/from ASIC RAM, arithmetic operations on them +void igs022_device::handle_command_6d() +{ + const u32 p1 = (m_sharedprotram[0x298 / 2] << 16) | m_sharedprotram[0x29a / 2]; + const u32 p2 = (m_sharedprotram[0x29c / 2] << 16) | m_sharedprotram[0x29e / 2]; + + std::ostringstream stream; + util::stream_format(stream, "%s: IGS022 command 006d: ASIC RAM %04x %04x %04x %04x ~ ", machine().describe_context(), + (p1 >> 16) & 0xffff, (p1 >> 0) & 0xffff, (p2 >> 16) & 0xffff, (p2 >> 0) & 0xffff + ); + + switch (p2 & 0xffff) + { + case 0x0: // Add values { - const int src1 = (p1 >> 16) & 0xff; - const int src2 = (p1 >> 0) & 0xff; - const int dst = (p2 >> 16) & 0xff; + const u16 src1 = p1 >> 16; + const u16 src2 = p1 >> 0; + const u16 dst = p2 >> 16; + + const u32 data1 = read_reg(src1); + const u32 data2 = read_reg(src2); + const u32 res = data1 + data2; + + write_reg(dst, res); - m_kb_regs[dst] = m_kb_regs[src2] - m_kb_regs[src1]; + util::stream_format(stream, "ADD [%04x] = [%04x] + [%04x] (%08x)\n", dst, src1, src2, res); + break; } - if ((p2 & 0xffff) == 0x1) // Add Imm? + case 0x1: // Sub values (src1 - src2) { - const int reg = (p2 >> 16) & 0xff; - const int imm = (p1 >> 0) & 0xffff; + const u16 src1 = p1 >> 16; + const u16 src2 = p1 >> 0; + const u16 dst = p2 >> 16; - m_kb_regs[reg] += imm; + const u32 data1 = read_reg(src1); + const u32 data2 = read_reg(src2); + const u32 res = data1 - data2; + + write_reg(dst, res); + + util::stream_format(stream, "SUB1 [%04x] = [%04x] - [%04x] (%08x)\n", dst, src1, src2, res); + break; } - if ((p2 & 0xffff) == 0xa) // Get value + case 0x6: // Sub values (src2 - src1) { - const int reg = (p1 >> 16) & 0xFF; + const u16 src1 = p1 >> 16; + const u16 src2 = p1 >> 0; + const u16 dst = p2 >> 16; + + const u32 data1 = read_reg(src1); + const u32 data2 = read_reg(src2); + const u32 res = data2 - data1; + + write_reg(dst, res); - m_sharedprotram[0x29c/2] = (m_kb_regs[reg] >> 16) & 0xffff; - m_sharedprotram[0x29e/2] = m_kb_regs[reg] & 0xffff; + util::stream_format(stream, "SUB2 [%04x] = [%04x] - [%04x] (%08x)\n", dst, src2, src1, res); + break; } - m_sharedprotram[0x202 / 2] = 0x7c; // this mode complete? - } + case 0x9: // Set value (Shared Protection RAM -> ASIC RAM) + { + const u16 dst = p2 >> 16; - // Is this actually what this is suppose to do? Complete guess. - if (cmd == 0x12) // copy?? - { - m_sharedprotram[0x28c / 2] = m_sharedprotram[0x288 / 2]; - m_sharedprotram[0x28e / 2] = m_sharedprotram[0x28a / 2]; + const u32 data = p1; - m_sharedprotram[0x202 / 2] = 0x23; // this mode complete? - } + write_reg(dst, data); - // what do these do? write the completion byte for now... - if (cmd == 0x45) m_sharedprotram[0x202 / 2] = 0x56; - if (cmd == 0x5a) m_sharedprotram[0x202 / 2] = 0x4b; - if (cmd == 0x2d) m_sharedprotram[0x202 / 2] = 0x3c; + util::stream_format(stream, "SET [%04x] = {298, 29a} (%08x)\n", dst, data); + break; + } - if (cmd == 0x4f) // memcpy with encryption / scrambling - { - const u16 src = m_sharedprotram[0x290 / 2] >> 1; // External mcu data is 8 bit and addressed as such - const u32 dst = m_sharedprotram[0x292 / 2]; - const u16 size = m_sharedprotram[0x294 / 2]; - const u16 mode = m_sharedprotram[0x296 / 2]; + case 0xa: // Get value (ASIC RAM -> Shared Protection RAM) + { + const u16 src = p1 >> 16; + + const u32 data = m_regs[src]; - IGS022_do_dma(src,dst,size,mode); + m_sharedprotram[0x29c / 2] = (data >> 16) & 0xffff; + m_sharedprotram[0x29e / 2] = data & 0xffff; - m_sharedprotram[0x202 / 2] = 0x5e; // this mode complete? + util::stream_format(stream, "GET {29c, 29e} = [%04x] (%08x)\n", src, data); + break; + } } -} + LOGMASKED(LOG_CMD_6D, "%s", stream.str()); + m_sharedprotram[0x202 / 2] = 0x7c; // this mode complete? +} -DEFINE_DEVICE_TYPE(IGS022, igs022_device, "igs022", "IGS022") +DEFINE_DEVICE_TYPE(IGS022, igs022_device, "igs022", "IGS022 encrypted DMA device") diff --git a/src/mame/machine/igs022.h b/src/mame/machine/igs022.h index 619b7a0fc86..5fb2bd9115c 100644 --- a/src/mame/machine/igs022.h +++ b/src/mame/machine/igs022.h @@ -1,33 +1,42 @@ // license:BSD-3-Clause // copyright-holders:David Haywood, ElSemi -/* IGS022 */ #ifndef MAME_MACHINE_IGS022_H #define MAME_MACHINE_IGS022_H #pragma once - class igs022_device : public device_t { public: igs022_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - void IGS022_handle_command(); + void handle_command(); protected: virtual void device_start() override; virtual void device_reset() override; - u32 m_kb_regs[0x100]; - - void IGS022_do_dma(u16 src, u16 dst, u16 size, u16 mode); - void IGS022_reset(); - private: + static constexpr u16 NUM_REGS = 0x300, STACK_SIZE = 0x100; + u32 m_regs[NUM_REGS]; + u32 m_stack[STACK_SIZE]; + u8 m_stack_ptr; + optional_shared_ptr<u16> m_sharedprotram; required_memory_region m_rom; -}; + u32 read_reg(u16 offset); + void write_reg(u16 offset, u32 data); + + void push_stack(u32 data); + u32 pop_stack(); + std::string stack_as_string() const; + + void do_dma(u16 src, u16 dst, u16 size, u16 mode); + + void handle_command_6d(); + void handle_incomplete_command(u16 cmd, u16 res); +}; DECLARE_DEVICE_TYPE(IGS022, igs022_device) diff --git a/src/mame/machine/pgmprot_igs025_igs022.cpp b/src/mame/machine/pgmprot_igs025_igs022.cpp index 29bc98c34a4..0bba9402785 100644 --- a/src/mame/machine/pgmprot_igs025_igs022.cpp +++ b/src/mame/machine/pgmprot_igs025_igs022.cpp @@ -4,25 +4,22 @@ PGM 022 + 025 PGM protection emulation this file contains the game / pgm specifc hookups for the IGS022/IGS025 - protection chips, actual simulation is in igs025_igs022.c + protection chips, actual simulation is in igs022.cpp/igs025.cpp - sed by + Used by: The Killing Blade Dragon World 3 Dragon World 3 EX - ---- - - - - ***********************************************************************/ +************************************************************************/ #include "emu.h" #include "includes/pgm.h" #include "machine/pgmprot_igs025_igs022.h" -/* The IGS022 is an MCU which performs encrypted DMA used by +/* + The IGS022 is an MCU which performs encrypted DMA used by: - The Killing Blade - Dragon World 3 - Dragon World 3 Ex @@ -32,7 +29,7 @@ */ -/* NON-device stuff, game specific, keep here */ +// NON-device stuff, game specific, keep here void pgm_022_025_state::pgm_dw3_decrypt() { @@ -337,7 +334,7 @@ MACHINE_RESET_MEMBER(pgm_022_025_state, dw3) void pgm_022_025_state::igs025_to_igs022_callback( void ) { // printf("igs025_to_igs022_callback\n"); - m_igs022->IGS022_handle_command(); + m_igs022->handle_command(); } @@ -380,7 +377,6 @@ void pgm_022_025_state::pgm_022_025(machine_config &config) m_igs025->set_external_cb(FUNC(pgm_022_025_state::igs025_to_igs022_callback)); IGS022(config, m_igs022, 0); - } void pgm_022_025_state::pgm_022_025_dw3(machine_config &config) @@ -415,6 +411,7 @@ INPUT_PORTS_START( killbld ) PORT_DIPSETTING( 0x0021, DEF_STR( World ) ) INPUT_PORTS_END + INPUT_PORTS_START( dw3 ) PORT_INCLUDE ( pgm ) @@ -428,7 +425,6 @@ INPUT_PORTS_START( dw3 ) PORT_CONFSETTING( 0x0005, DEF_STR( China ) ) PORT_CONFSETTING( 0x0006, DEF_STR( World ) ) PORT_CONFSETTING( 0x0007, "Singapore" ) - INPUT_PORTS_END @@ -445,5 +441,4 @@ INPUT_PORTS_START( dw3j ) // for dw3100 set // PORT_CONFSETTING( 0x0005, DEF_STR( China ) ) // PORT_CONFSETTING( 0x0006, DEF_STR( World ) ) // PORT_CONFSETTING( 0x0007, "Singapore" ) - INPUT_PORTS_END diff --git a/src/mame/mame.cpp b/src/mame/mame.cpp index 217651fd510..c3fba77d580 100644 --- a/src/mame/mame.cpp +++ b/src/mame/mame.cpp @@ -13,8 +13,8 @@ #define APPNAME "MAME" #define APPNAME_LOWER "mame" #define CONFIGNAME "mame" -#define COPYRIGHT "Copyright Nicola Salmoria\nand the MAME team\nhttps://mamedev.org" -#define COPYRIGHT_INFO "Copyright Nicola Salmoria and the MAME team" +#define COPYRIGHT "Copyright MAMEdev and contributors\nhttps://mamedev.org" +#define COPYRIGHT_INFO "Copyright MAMEdev and contributors" const char * emulator_info::get_appname() { return APPNAME;} const char * emulator_info::get_appname_lower() { return APPNAME_LOWER;} diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 66ad012bdc1..78cad5ba820 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -11805,6 +11805,7 @@ d6809 // @source:d9final.cpp d9final // (c) 1992 Excellent System +rpanic // (c) 1992 Excellent System / Jaleco @source:dacholer.cpp dacholer // (c) 1983 @@ -12778,6 +12779,9 @@ drumsta // drw80pk2 // (c) 1983 IGT drw80pkr // (c) 1982 IGT +@source:ds90.cpp +x37 // + @source:dsb46.cpp dsb46 // @@ -17299,10 +17303,11 @@ wlcc // (c) 1996 xymg // (c) 1996 @source:igs017.cpp +cpoker2 // (c) 2000? genius6 // (c) 1998 genius6a // (c) 1997 genius6b // (c) 1997 -happyskl // (c) 2001? +happyskl // (c) 2000? iqblocka // (c) 1996 iqblockf // (c) 1996 lhzb2 // (c) 1998 @@ -17312,13 +17317,12 @@ mgdh // (c) 1997 mgdha // (c) 1997 sdmg2 // (c) 1997 slqz2 // (c) 1998 -spkrform // (c) ???? +spkrform // (c) 2000? starzan // (c) 2000? tarzan // (c) 1999 tarzana // (c) 1999 tarzanc // (c) 1999 tjsb // (c) 1997 -unkigs // (c) 2001? @source:igspc.cpp eztouch // (c) 200? @@ -32149,7 +32153,8 @@ nflclsfb // 2003.?? NFL Classic Football pacmball // 2003.?? Pacman Ball panikuru // 2002.03 Panicuru Panekuru ptblank3 // 2000.12 Point Blank 3 (GNN2 Ver.A) -sekaikh // 2004.04 Sekai Kaseki Hakken (Japan, SKH1 Ver.A) +sekaikh // 2004.0? Sekai Kaseki Hakken (Japan, SKH1 Ver.B) +sekaikha // 2004.04 Sekai Kaseki Hakken (Japan, SKH1 Ver.A) startrgn // 2002.07 Star Trigon (STT1 Ver.A) taiko6 // 2004.?? Taiko no Tatsujin 6 (Japan, TK61 Ver.A) unks10md // 200?.?? unknown Namco System 10 medal game (MTL1 SPRB0) @@ -37691,6 +37696,7 @@ scyclone // (c) 1980 Taito Corporation croupier // (c) 1997 Playmark croupiera // (c) 1997 Playmark luckboom // +magictch // sderby // (c) 1996 sderbya // (c) 1996 shinygld // @@ -38265,7 +38271,7 @@ titlefu // 1993.04 Title Fight (US) @source:segasm1.cpp tinkerbl // (c) 1990 Sega -blicks // (c) 1991 Sega +blicks // (c) 1991 Sega unkm1 // (c) 1992 Sega bingpty // (c) 1994 Sega @@ -40487,7 +40493,8 @@ suprridr // (c) 1983 Venture Line + Taito license suprslam // (c) 1995 Banpresto @source:supstarf.cpp -supstarf // +supstarf // (c) 1986 Recreativos Franco +supstarfa // (c) 1986 Recreativos Franco @source:surpratk.cpp suratk // GX911 (c) 1990 (World) @@ -41947,6 +41954,7 @@ grindstma // TP-027 (c) 1993 Toaplan + Unite Trading licen kbash // TP-023 (c) 1993 Toaplan kbash2 // bootleg kbashk // TP-023 (c) 1993 Toaplan +kbashp // TP-023 (c) 1993 Toaplan kingdmgp // (c) 1994 Raizing/8ing mahoudai // (c) 1993 Raizing + Able license nprobowl // (c) 1996 Zuck + Able license diff --git a/src/mame/mess.cpp b/src/mame/mess.cpp deleted file mode 100644 index ab1c26b59c5..00000000000 --- a/src/mame/mess.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -/*************************************************************************** - - mess.cpp - - Specific (per target) constants - -****************************************************************************/ - -#include "emu.h" - -#define APPNAME "MESS" -#define APPNAME_LOWER "mess" -#define CONFIGNAME "mess" -#define COPYRIGHT "Copyright Nicola Salmoria\nand the MAME team\nhttps://mamedev.org" -#define COPYRIGHT_INFO "Copyright Nicola Salmoria and the MAME team" - -const char * emulator_info::get_appname() { return APPNAME;} -const char * emulator_info::get_appname_lower() { return APPNAME_LOWER;} -const char * emulator_info::get_configname() { return CONFIGNAME;} -const char * emulator_info::get_copyright() { return COPYRIGHT;} -const char * emulator_info::get_copyright_info() { return COPYRIGHT_INFO;} diff --git a/src/mame/mess.flt b/src/mame/mess.flt index 7686ad91358..316c6427b3e 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -257,6 +257,7 @@ dps1.cpp dpsv55.cpp dragon.cpp drumsta.cpp +ds90.cpp dsb46.cpp dual68.cpp duet16.cpp diff --git a/src/mame/video/igs017_igs031.cpp b/src/mame/video/igs017_igs031.cpp index 2e07c242f63..67acf4e8c0b 100644 --- a/src/mame/video/igs017_igs031.cpp +++ b/src/mame/video/igs017_igs031.cpp @@ -6,7 +6,7 @@ IGS017 / IGS031 video device what's the difference between IGS017 and IGS031? encryption? -all the known IGS017 / IGS031 games use same memory map, is the IGS017 / IGS031 +all the known IGS017 / IGS031 games use the same memory map, is the IGS017 / IGS031 providing the interface to the 8255, or is it coincidence? */ @@ -17,7 +17,6 @@ providing the interface to the 8255, or is it coincidence? void igs017_igs031_device::map(address_map &map) { map(0x1000, 0x17ff).ram().share("spriteram"); -// map(0x1800, 0x1bff).ram() //.w("palette", FUNC(palette_device::write).share("palette"); map(0x1800, 0x1bff).ram().w(FUNC(igs017_igs031_device::palram_w)).share("palram"); map(0x1c00, 0x1fff).ram(); @@ -29,7 +28,6 @@ void igs017_igs031_device::map(address_map &map) map(0x4000, 0x5fff).ram().w(FUNC(igs017_igs031_device::fg_w)).share("fg_videoram"); map(0x6000, 0x7fff).ram().w(FUNC(igs017_igs031_device::bg_w)).share("bg_videoram"); - } u8 igs017_igs031_device::i8255_r(offs_t offset) @@ -260,7 +258,7 @@ void igs017_igs031_device::draw_sprite(bitmap_ind16 &bitmap, const rectangle &cl if (addr + dimx * dimy >= m_sprites_gfx_size) return; - /* Start drawing */ + // Start drawing const u16 pal = 0x100 + (color << 5); const u8 *source_base = &m_sprites_gfx[addr]; const u8 transparent_color = 0x1f; @@ -389,7 +387,7 @@ int igs017_igs031_device::debug_viewer(bitmap_ind16 &bitmap,const rectangle &cli popmessage("a: %08X w: %03X p: %02x-%02x-%02x",a,w,m_sprites_gfx[a/3*3+0],m_sprites_gfx[a/3*3+1],m_sprites_gfx[a/3*3+2]); m_debug_addr = a; m_debug_width = w; - osd_sleep(osd_ticks_per_second() / 1000 * 200); + osd_sleep(osd_ticks_per_second() / 1000 * 200 / 4); return 1; } #endif diff --git a/src/mame/video/sderby.cpp b/src/mame/video/sderby.cpp deleted file mode 100644 index 150cea7a7cf..00000000000 --- a/src/mame/video/sderby.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood, Roberto Fresca -#include "emu.h" -#include "includes/sderby.h" - -/* BG Layer */ - -TILE_GET_INFO_MEMBER(sderby_state::get_sderby_tile_info) -{ - int tileno,colour; - - tileno = m_videoram[tile_index*2]; - colour = m_videoram[tile_index*2+1] & 0x0f; - - tileinfo.set(1,tileno,colour,0); -} - -void sderby_state::sderby_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_videoram[offset]); - m_tilemap->mark_tile_dirty(offset/2); -} - -/* MD Layer */ - -TILE_GET_INFO_MEMBER(sderby_state::get_sderby_md_tile_info) -{ - int tileno,colour; - - tileno = m_md_videoram[tile_index*2]; - colour = m_md_videoram[tile_index*2+1] & 0x0f; - - tileinfo.set(1,tileno,colour+16,0); -} - -void sderby_state::sderby_md_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_md_videoram[offset]); - m_md_tilemap->mark_tile_dirty(offset/2); -} - -/* FG Layer */ - -TILE_GET_INFO_MEMBER(sderby_state::get_sderby_fg_tile_info) -{ - int tileno,colour; - - tileno = m_fg_videoram[tile_index*2]; - colour = m_fg_videoram[tile_index*2+1] & 0x0f; - - tileinfo.set(0,tileno,colour+32,0); -} - -void sderby_state::sderby_fg_videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - COMBINE_DATA(&m_fg_videoram[offset]); - m_fg_tilemap->mark_tile_dirty(offset/2); -} - - -void sderby_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int codeshift) -{ - uint16_t *spriteram16 = m_spriteram; - int offs; - int height = m_gfxdecode->gfx(0)->height(); - int colordiv = m_gfxdecode->gfx(0)->granularity() / 16; - - for (offs = 4;offs < m_spriteram.bytes()/2;offs += 4) - { - int sx,sy,code,color,flipx; - - sy = spriteram16[offs+3-4]; /* -4? what the... ??? */ - if (sy == 0x2000) return; /* end of list marker */ - - flipx = sy & 0x4000; - sx = (spriteram16[offs+1] & 0x01ff) - 16-7; - sy = (256-8-height - sy) & 0xff; - code = spriteram16[offs+2] >> codeshift; - color = (spriteram16[offs+1] & 0x3e00) >> 9; - - m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, - code, - color/colordiv+48, - flipx,0, - sx,sy,0); - } -} - - -void sderby_state::video_start() -{ - m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sderby_state::get_sderby_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); - m_md_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sderby_state::get_sderby_md_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); - - m_md_tilemap->set_transparent_pen(0); - - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sderby_state::get_sderby_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_fg_tilemap->set_transparent_pen(0); -} - -uint32_t sderby_state::screen_update_sderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_tilemap->draw(screen, bitmap, cliprect, 0,0); - draw_sprites(bitmap,cliprect,0); - m_md_tilemap->draw(screen, bitmap, cliprect, 0,0); - m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0); - return 0; -} - -uint32_t sderby_state::screen_update_pmroulet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_tilemap->draw(screen, bitmap, cliprect, 0,0); - m_md_tilemap->draw(screen, bitmap, cliprect, 0,0); - draw_sprites(bitmap,cliprect,0); - m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0); - return 0; -} - - -void sderby_state::sderby_scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - data = COMBINE_DATA(&m_scroll[offset]); - - switch (offset) - { - case 0: m_fg_tilemap->set_scrollx(0,data+2);break; - case 1: m_fg_tilemap->set_scrolly(0,data-8);break; - case 2: m_md_tilemap->set_scrollx(0,data+4);break; - case 3: m_md_tilemap->set_scrolly(0,data-8);break; - case 4: m_tilemap->set_scrollx(0,data+6); break; - case 5: m_tilemap->set_scrolly(0,data-8); break; - } -} diff --git a/src/osd/modules/debugger/qt/deviceswindow.cpp b/src/osd/modules/debugger/qt/deviceswindow.cpp index b1b0be2a507..0e7a94ceb97 100644 --- a/src/osd/modules/debugger/qt/deviceswindow.cpp +++ b/src/osd/modules/debugger/qt/deviceswindow.cpp @@ -31,7 +31,7 @@ QVariant DevicesWindowModel::data(const QModelIndex &index, int role) const Qt::ItemFlags DevicesWindowModel::flags(const QModelIndex &index) const { if (!index.isValid()) - return 0; + return Qt::NoItemFlags; return QAbstractItemModel::flags(index); } |