diff --git a/src/devices/cpu/drcbearm64.cpp b/src/devices/cpu/drcbearm64.cpp index 71002364461..5929c53583b 100644 --- a/src/devices/cpu/drcbearm64.cpp +++ b/src/devices/cpu/drcbearm64.cpp @@ -47,10 +47,10 @@ FP -> SP + 0x00 previous FP Stack layout in nested generated code subroutine call frame: -SP -> SP + 0x00 previous FP +SP -> SP + 0x00 saved FP SP + 0x08 return address ... - FP - 0x10 previous FP + FP - 0x10 saved FP FP - 0x08 return address FP -> FP + 0x00 previous FP FP + 0x08 top-level return address @@ -492,6 +492,20 @@ void drcbe_arm64::get_imm_relative(a64::Assembler &a, const a64::Gp ®, const return; } + const uint64_t pagebase = codeoffs & ~make_bitmask(12); + const int64_t pagerel = (int64_t)ptr - pagebase; + if (is_valid_immediate_signed(pagerel, 33)) + { + const uint64_t targetpage = (uint64_t)ptr & ~make_bitmask(12); + const uint64_t pageoffs = (uint64_t)ptr & util::make_bitmask(12); + + a.adrp(reg, targetpage); + if (pageoffs != 0) + a.add(reg, reg, pageoffs); + + return; + } + a.mov(reg, ptr); } @@ -953,7 +967,7 @@ drcbe_arm64::drcbe_arm64(drcuml_state &drcuml, device_t &device, drc_cache &cach , m_entry(nullptr) , m_exit(nullptr) , m_nocode(nullptr) - , m_baseptr(cache.near() + 0x80) + , m_baseptr(cache.near() + 0x100) , m_near(*(near_state *)cache.alloc_near(sizeof(m_near))) { m_near.emulated_flags = 0; @@ -1611,6 +1625,7 @@ void drcbe_arm64::op_recover(a64::Assembler &a, const uml::instruction &inst) get_imm_relative(a, REG_PARAM1, m_drcmap_get_value.obj); a.ldr(REG_PARAM2, arm::Mem(a64::x29, -8)); // saved LR (x30) from first level CALLH/EXH or failed hash jump + a.sub(REG_PARAM2, REG_PARAM2, 4); a.mov(REG_PARAM3, inst.param(1).mapvar()); call_arm_addr(a, m_drcmap_get_value.func); diff --git a/src/devices/cpu/drcbec.cpp b/src/devices/cpu/drcbec.cpp index 8758b1989c7..d2fa0e744ab 100644 --- a/src/devices/cpu/drcbec.cpp +++ b/src/devices/cpu/drcbec.cpp @@ -676,7 +676,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_RECOVER, 4, 0): // RECOVER dst,mapvar assert(sp > 0); - PARAM0 = m_map.get_value((drccodeptr)callstack[0], MAPVAR_M0 + PARAM1); + PARAM0 = m_map.get_value(drccodeptr(callstack[0] - 1), PARAM1); break; diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp index b57c48828d1..7538ee25b83 100644 --- a/src/devices/cpu/drcbex64.cpp +++ b/src/devices/cpu/drcbex64.cpp @@ -1287,7 +1287,13 @@ void drcbe_x64::mov_r64_imm(Assembler &a, Gp const ®, uint64_t const imm) else if (s32(imm) == imm) a.mov(reg.r64(), s32(imm)); else - a.mov(reg.r64(), imm); + { + const int64_t delta = imm - (a.code()->baseAddress() + a.offset() + 7); + if (short_immediate(delta)) + a.lea(reg.r64(), ptr(rip, delta)); + else + a.mov(reg.r64(), imm); + } } diff --git a/src/devices/cpu/z80/z80.h b/src/devices/cpu/z80/z80.h index 0db8b93c759..eadaae4ba07 100644 --- a/src/devices/cpu/z80/z80.h +++ b/src/devices/cpu/z80/z80.h @@ -49,6 +49,10 @@ public: auto irqfetch_cb() { return m_irqfetch_cb.bind(); } auto reti_cb() { return m_reti_cb.bind(); } + // output pins state + int halt_r() { return m_halt; } + int busack_r() { return m_busack_state; } + protected: z80_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); diff --git a/src/devices/cpu/z80/z80.lst b/src/devices/cpu/z80/z80.lst index 360401242cc..95427589e92 100644 --- a/src/devices/cpu/z80/z80.lst +++ b/src/devices/cpu/z80/z80.lst @@ -85,13 +85,13 @@ macro push macro jp call arg16 PC = TDAT; WZ = PC; - m_branch_cb(true); + m_branch_cb(1); macro jp_cond if (TDAT8) { call arg16 PC = TDAT; WZ = PC; - m_branch_cb(true); + m_branch_cb(1); } else { // implicit do PC += 2 call arg16 @@ -103,7 +103,7 @@ macro jr TADR = PC-1; 5 * call nomreq_addr PC += (s8)TDAT8; WZ = PC; - m_branch_cb(true); + m_branch_cb(1); macro r800:jr call arg @@ -167,7 +167,7 @@ macro z80n:retn macro reti call pop PC = TDAT; WZ = PC; m_iff1 = m_iff2; - m_reti_cb(true); + m_reti_cb(1); daisy_call_reti_device(); macro ld_r_a @@ -535,11 +535,11 @@ macro take_interrupt m_iff1 = m_iff2 = 0; // say hi // Not precise in all cases. z80 must finish current instruction (NOP) to reach this state - in such case frame timings are shifter from cb event if calculated based on it. - m_irqack_cb(true); + m_irqack_cb(1); m_r++; { // fetch the IRQ vector - m_irqfetch_cb(true); + m_irqfetch_cb(1); device_z80daisy_interface *intf = daisy_get_irq_device(); m_tmp_irq_vector = (intf != nullptr) ? intf->z80daisy_irq_ack() : standard_irq_callback(0, m_pc.w); LOGMASKED(LOG_INT, "single INT m_tmp_irq_vector $%02x\n", m_tmp_irq_vector); diff --git a/src/mame/amiga/agnus_copper.cpp b/src/mame/amiga/agnus_copper.cpp index 0af24767947..6de9b35b2c6 100644 --- a/src/mame/amiga/agnus_copper.cpp +++ b/src/mame/amiga/agnus_copper.cpp @@ -97,6 +97,7 @@ void agnus_copper_device::device_start() save_item(NAME(m_waitmask)); save_item(NAME(m_pending_data)); save_item(NAME(m_pending_offset)); + save_item(NAME(m_xpos_state)); } @@ -235,6 +236,21 @@ void agnus_copper_device::copins_w(u16 data) void agnus_copper_device::vblank_sync() { set_pc(0, true); + m_xpos_state = 0; +} + +// check current copper cycle at end of scanline +// - auntaadv (gameplay), WAITs with $xxd9 +void agnus_copper_device::suspend_offset(int xpos, int hblank_width) +{ + m_xpos_state = (xpos == 511) ? 0 : xpos - hblank_width; +// std::assert(m_xpos_state > 0); +} + +// restore at start +int agnus_copper_device::restore_offset() +{ + return m_xpos_state; } // TODO: h/vblank checks against xpos/vpos diff --git a/src/mame/amiga/agnus_copper.h b/src/mame/amiga/agnus_copper.h index 06b0c866047..064b7ee6e80 100644 --- a/src/mame/amiga/agnus_copper.h +++ b/src/mame/amiga/agnus_copper.h @@ -34,6 +34,8 @@ public: // getters/setters void vblank_sync(); int execute_next(int xpos, int ypos, bool is_blitter_busy, int num_planes); + void suspend_offset(int xpos, int hblank_width); + int restore_offset(); protected: // device-level overrides @@ -69,6 +71,7 @@ private: u16 m_waitmask; u16 m_pending_offset; u16 m_pending_data; + u16 m_xpos_state; }; diff --git a/src/mame/amiga/amiga_v.cpp b/src/mame/amiga/amiga_v.cpp index 557ebd9c419..552e9686da0 100644 --- a/src/mame/amiga/amiga_v.cpp +++ b/src/mame/amiga/amiga_v.cpp @@ -537,7 +537,7 @@ void amiga_state::render_scanline(bitmap_rgb32 &bitmap, int scanline) /* loop over the line */ // TODO: copper runs on odd timeslots - next_copper_x = 0; + next_copper_x = m_copper->restore_offset(); // FIXME: without the add this increment will skip bitplane ops // ddf_stop_pixel_max = 0xd8 * 2 = 432 + 17 + 15 + 1(*) = 465 > width / 2 (455) // (*) because there's a comparison with <= in the bitplane code. @@ -880,6 +880,8 @@ void amiga_state::render_scanline(bitmap_rgb32 &bitmap, int scanline) CUSTOM_REG_LONG(REG_BPL1PTH + pl * 2) += CUSTOM_REG_SIGNED(REG_BPL2MOD); } + m_copper->suspend_offset(next_copper_x, amiga_state::SCREEN_WIDTH / 2); + // restore color00 CUSTOM_REG(REG_COLOR00) = save_color0; diff --git a/src/mame/amiga/amigaaga.cpp b/src/mame/amiga/amigaaga.cpp index d94333433be..30a51d902d1 100644 --- a/src/mame/amiga/amigaaga.cpp +++ b/src/mame/amiga/amigaaga.cpp @@ -528,7 +528,7 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline) /* loop over the line */ // TODO: copper runs on odd timeslots - next_copper_x = 0; + next_copper_x = m_copper->restore_offset(); // TODO: verify where we're missing pixels here for the GFX pitch bitplane corruptions // - wbenc30 scrolling in lores mode (fmode=3, expects a +58!, verify ddfstrt) // - roadkill title (fmode=3, max +14), gameplay uses fmode=1 @@ -876,6 +876,7 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline) pri = (sprpix >> 12); /* sprite has priority */ + // TODO: porting OCS alfred fix to AGA will break OCS rodland status bar (!?) if (sprpix && pf1pri > pri) { dst[x*2+0] = @@ -946,6 +947,8 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline) } } + m_copper->suspend_offset(next_copper_x, amiga_state::SCREEN_WIDTH / 2); + /* restore color00 */ CUSTOM_REG(REG_COLOR00) = save_color0; diff --git a/src/mame/galaxian/galaxold.cpp b/src/mame/galaxian/galaxold.cpp index 9c2e21e91b3..32ebed4a744 100644 --- a/src/mame/galaxian/galaxold.cpp +++ b/src/mame/galaxian/galaxold.cpp @@ -326,10 +326,7 @@ void galaxold_state::_4in1_map(address_map &map) map(0x6003, 0x6003).w(FUNC(galaxold_state::galaxold_coin_counter_w)); map(0x6004, 0x6007).w("cust", FUNC(galaxian_sound_device::lfo_freq_w)); map(0x6800, 0x6800).portr("IN1"); - map(0x6800, 0x6802).w("cust", FUNC(galaxian_sound_device::background_enable_w)); -// map(0x6803, 0x6803).w(FUNC(galaxold_state::galaxian_noise_enable_w)); // not hooked up? - map(0x6805, 0x6805).w("cust", FUNC(galaxian_sound_device::fire_enable_w)); - map(0x6806, 0x6807).w("cust", FUNC(galaxian_sound_device::vol_w)); + map(0x6800, 0x6807).w("cust", FUNC(galaxian_sound_device::sound_w)); map(0x7000, 0x7000).portr("DSW0"); map(0x7001, 0x7001).w(FUNC(galaxold_state::galaxold_nmi_enable_w)); map(0x7004, 0x7004).w(FUNC(galaxold_state::galaxold_stars_enable_w)); @@ -524,14 +521,11 @@ void galaxold_state::drivfrcg_program(address_map &map) map(0x1500, 0x1500).mirror(0x6000).portr("IN0"); map(0x1503, 0x1503).mirror(0x6000).w(FUNC(galaxold_state::galaxold_coin_counter_w)); map(0x1580, 0x1580).mirror(0x6000).portr("IN1"); - map(0x1580, 0x1582).mirror(0x6000).w("cust", FUNC(galaxian_sound_device::background_enable_w)); - map(0x1583, 0x1583).mirror(0x6000).nopw(); - map(0x1585, 0x1585).mirror(0x6000).nopw(); - map(0x1586, 0x1587).mirror(0x6000).w("cust", FUNC(galaxian_sound_device::lfo_freq_w)); + map(0x1580, 0x1587).mirror(0x6000).w("cust", FUNC(galaxian_sound_device::sound_w)); map(0x1600, 0x1600).mirror(0x6000).portr("DSW0").w("cust", FUNC(galaxian_sound_device::pitch_w)); map(0x1700, 0x1700).mirror(0x6000).portr("DSW1").nopw(); map(0x1701, 0x1701).mirror(0x6000).nopw(); - map(0x1704, 0x1707).mirror(0x6000).w("cust", FUNC(galaxian_sound_device::vol_w)); + map(0x1704, 0x1707).mirror(0x6000).w("cust", FUNC(galaxian_sound_device::lfo_freq_w)); map(0x1800, 0x1bff).mirror(0x6000).w(FUNC(galaxold_state::galaxold_videoram_w)).share("videoram"); map(0x1c00, 0x1fff).mirror(0x6000).ram(); map(0x2000, 0x2fff).rom(); @@ -1863,7 +1857,7 @@ void galaxold_state::superbikg(machine_config &config) { galaxold_base(config); - s2650_device &s2650(S2650(config.replace(), m_maincpu, 1'500'000)); // 1.53292 MHz measured with logic analyzer + s2650_device &s2650(S2650(config.replace(), m_maincpu, PIXEL_CLOCK / 4)); // 1.53292 MHz measured with logic analyzer s2650.set_addrmap(AS_PROGRAM, &galaxold_state::superbikg_map); s2650.set_addrmap(AS_IO, &galaxold_state::superbikg_io); s2650.set_addrmap(AS_DATA, &galaxold_state::superbikg_data); @@ -2311,8 +2305,8 @@ ROM_START( spcwarp ) ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD( "swarpt7f.bin", 0x0000, 0x1000, CRC(04d744e3) SHA1(db8218510052a05670cb0b722b73d3f10464788c) ) ROM_LOAD( "swarpt7h.bin", 0x2000, 0x1000, CRC(34a36536) SHA1(bc438515618683b2a7c29637871ee00ed95ad7f8) ) - // missing ROM at $4000 - ROM_LOAD( "swarpt7m.bin", 0x6000, 0x1000, BAD_DUMP CRC(a2dff6c8) SHA1(d1c72848450dc5ff386dc94a26e4bf704ccc7121) ) // ROMCMP reports "BADADDR xxxxxx-xxxxx". Observed data sequence repeated every 32 bytes + ROM_LOAD( "swarpt7k.bin", 0x4000, 0x1000, NO_DUMP ) + ROM_LOAD( "swarpt7m.bin", 0x6000, 0x1000, BAD_DUMP CRC(a2dff6c8) SHA1(d1c72848450dc5ff386dc94a26e4bf704ccc7121) ) // ROMCMP reports "BADADDR xxxxxx-xxxxx". Observed data sequence repeated every 32 bytes ROM_REGION( 0x1000, "gfx1", 0 ) ROM_LOAD( "swarpb1h.bin", 0x0000, 0x0800, CRC(6ee3b5f7) SHA1(8150f2ecd59d3a165c0541b550664c56d049edd5) ) @@ -2324,7 +2318,8 @@ ROM_START( spcwarp ) ROM_END // GX-01 main PCB + MV-2 ROM board + HB CPU board -// In-game it still shows the Century copyright but the PCB has no sign of being an original +// In-game it still shows the Century copyright but the PCB has no sign of being an original. +// Though PCB manufacture quality doesn't apply since it was sold as a Galaxian conversion kit. ROM_START( superbikg ) ROM_REGION( 0x8000, "maincpu", 0 ) ROM_LOAD( "moto1-2516.bin", 0x0000, 0x0800, CRC(2903f8c8) SHA1(288401a941853751caa8d1d69e6908dbfbcfb5ac) ) @@ -2652,7 +2647,7 @@ GAME( 1981, froggerv, frogger, videotron, froggerv, galaxold_state, empty_ini GAME( 1983, hunchbkg, hunchbak, hunchbkg, hunchbkg, galaxold_state, empty_init, ROT90, "Century Electronics", "Hunchback (Galaxian hardware)", MACHINE_SUPPORTS_SAVE ) GAME( 1983, hunchbgb, hunchbak, hunchbkg, hunchbkg, galaxold_state, empty_init, ROT90, "bootleg (FAR S.A.)", "Hunchback (FAR S.A. bootleg on Galaxian hardware)", MACHINE_SUPPORTS_SAVE ) GAME( 1983, spcwarp, 0, spcwarp, hunchbkg, galaxold_state, empty_init, ROT90, "Century Electronics", "Space Warp? (Cosmos conversion on Galaxian hardware)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_WRONG_COLORS ) // bad dump -GAME( 1983, superbikg, superbik, superbikg, superbikg, galaxold_state, init_superbikg, ROT90, "bootleg", "Superbike (bootleg on Galaxian hardware)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // colors look strange but match real hw video +GAME( 1983, superbikg, superbik, superbikg, superbikg, galaxold_state, init_superbikg, ROT90, "Century Electronics", "Superbike (Galaxian hardware)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // colors look strange but match real hw video GAME( 1984, drivfrcg, drivfrcp, drivfrcg, drivfrcg, galaxold_state, empty_init, ROT90, "Shinkai Inc. (Magic Electronics USA license)", "Driving Force (Galaxian conversion)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, drivfrct, drivfrcp, drivfrcg, drivfrcg, galaxold_state, empty_init, ROT90, "bootleg (EMT Germany)", "Top Racer (bootleg of Driving Force)", MACHINE_SUPPORTS_SAVE ) // Video Klein PCB GAME( 1985, drivfrcb, drivfrcp, drivfrcg, drivfrcg, galaxold_state, empty_init, ROT90, "bootleg (Elsys Software)", "Driving Force (Galaxian conversion bootleg)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/igs/goldstar.cpp b/src/mame/igs/goldstar.cpp index a60acbc9b78..a44f7018fd1 100644 --- a/src/mame/igs/goldstar.cpp +++ b/src/mame/igs/goldstar.cpp @@ -334,6 +334,7 @@ public: void goldstar(machine_config &config); void goldstbl(machine_config &config); void feverch(machine_config &config); + void megaline(machine_config &config); void bonusch_portmap(address_map &map) ATTR_COLD; void feverch_portmap(address_map &map) ATTR_COLD; void feverch_map(address_map &map) ATTR_COLD; @@ -348,6 +349,7 @@ public: void common_decrypted_opcodes_map(address_map &map) ATTR_COLD; void super972_decrypted_opcodes_map(address_map &map) ATTR_COLD; void mbstar_map(address_map &map) ATTR_COLD; + void megaline_map(address_map &map) ATTR_COLD; void megaline_portmap(address_map &map) ATTR_COLD; void ncb3_readwriteport(address_map &map) ATTR_COLD; void nfm_map(address_map &map) ATTR_COLD; @@ -459,6 +461,7 @@ public: void init_cll(); void init_animalhs(); void init_eldoraddoa(); + void init_cmezspina(); template void init_tsk(); uint32_t screen_update_amcoe1a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -686,13 +689,11 @@ public: void vblank_irq(int state); - void megaline(machine_config &config); void unkch(machine_config &config); void bonusch(machine_config &config); void rolling(machine_config &config); void bonusch_map(address_map &map) ATTR_COLD; - void megaline_map(address_map &map) ATTR_COLD; void unkch_map(address_map &map) ATTR_COLD; void unkch_portmap(address_map &map) ATTR_COLD; protected: @@ -2778,47 +2779,43 @@ void unkch_state::unkch_portmap(address_map &map) } -void unkch_state::megaline_map(address_map &map) +void goldstar_state::megaline_map(address_map &map) { -/* Reels stuff are there just as placeholder, and obviously in wrong offset */ map(0x0000, 0x9fff).rom(); - map(0xd000, 0xd7ff).ram(); //.share("nvram"); + map(0xd000, 0xd03f).ram().share("reel1_scroll"); + map(0xd200, 0xd23f).ram().share("reel2_scroll"); + map(0xd400, 0xd43f).ram().share("reel3_scroll"); - map(0xd840, 0xd87f).ram().share("reel1_scroll"); - map(0xd880, 0xd8bf).ram().share("reel2_scroll"); - map(0xd900, 0xd93f).ram().share("reel3_scroll"); - map(0xdfc0, 0xdfff).ram(); + map(0xd800, 0xd9ff).ram().w(FUNC(goldstar_state::goldstar_reel1_ram_w)).share("reel1_ram"); + map(0xda00, 0xdbff).ram().w(FUNC(goldstar_state::goldstar_reel2_ram_w)).share("reel2_ram"); + map(0xdc00, 0xddff).ram().w(FUNC(goldstar_state::goldstar_reel3_ram_w)).share("reel3_ram"); + map(0xde00, 0xdfff).ram(); - map(0xe000, 0xe7ff).ram().w(FUNC(unkch_state::fg_vidram_w)).share("fg_vidram"); - map(0xe800, 0xefff).ram().w(FUNC(unkch_state::fg_atrram_w)).share("fg_atrram"); - - map(0xf000, 0xf1ff).ram().w(FUNC(unkch_state::goldstar_reel1_ram_w)).share("reel1_ram"); - map(0xf200, 0xf3ff).ram().w(FUNC(unkch_state::goldstar_reel2_ram_w)).share("reel2_ram"); - map(0xf400, 0xf5ff).ram().w(FUNC(unkch_state::goldstar_reel3_ram_w)).share("reel3_ram"); - map(0xf600, 0xf7ff).ram(); - map(0xf800, 0xf9ff).ram().w(FUNC(unkch_state::reel1_attrram_w)).share("reel1_attrram"); - map(0xfa00, 0xfbff).ram().w(FUNC(unkch_state::reel2_attrram_w)).share("reel2_attrram"); - map(0xfc00, 0xfdff).ram().w(FUNC(unkch_state::reel3_attrram_w)).share("reel3_attrram"); - map(0xfe00, 0xffff).ram(); + map(0xe000, 0xe7ff).ram().w(FUNC(goldstar_state::fg_vidram_w)).share("fg_vidram"); + map(0xe800, 0xefff).ram().w(FUNC(goldstar_state::fg_atrram_w)).share("fg_atrram"); + map(0xf000, 0xf7ff).ram(); + map(0xf800, 0xffff).ram(); } /* unknown I/O byte R/W PSGs: A0 - C0 - E0 - AY8910?: 60 - 80 */ -void goldstar_state::megaline_portmap(address_map &map) +void goldstar_state::megaline_portmap(address_map &map) // TODO: verify everything. Strange reads at 0x0f and 0x07- { map.global_mask(0xff); - map(0xa0, 0xa0).w("sn1", FUNC(sn76489_device::write)); /* SN76489 #1 */ - map(0xc0, 0xc0).w("sn2", FUNC(sn76489_device::write)); /* SN76489 #2 */ - map(0xe0, 0xe0).w("sn3", FUNC(sn76489_device::write)); /* SN76489 #3 */ - map(0x60, 0x60).w("aysnd", FUNC(ay8910_device::address_w)); /* AY8910 control? */ - map(0x80, 0x80).rw("aysnd", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); /* AY8910 Input? */ -// map(0x01, 0x01).r("aysnd", FUNC(ay8910_device::data_r)); -// map(0x02, 0x03).w("aysnd", FUNC(ay8910_device::data_address_w)); + map(0x20, 0x20).portr("IN0").nopw(); // ?? + map(0x40, 0x40).portr("IN1").nopw(); // ?? + map(0x60, 0x60).portr("IN2").nopw(); // ?? + map(0x80, 0x80).portr("IN3").nopw(); // ?? + map(0xa0, 0xa0).portr("IN4").w("sn1", FUNC(sn76489_device::write)); + map(0xc0, 0xc0).portr("DSW1").w("sn2", FUNC(sn76489_device::write)); + map(0xe0, 0xe0).portr("DSW2").w("sn3", FUNC(sn76489_device::write)); + map(0xe1, 0xe1).portr("DSW3"); + map(0xe2, 0xe2).portr("DSW4"); + //map(0xe3, 0xe3).portr("DSW5"); } @@ -11354,16 +11351,12 @@ void cmaster_state::eldoraddoa(machine_config &config) m_maincpu->set_addrmap(AS_IO, &cmaster_state::eldoraddoa_portmap); } -void unkch_state::megaline(machine_config &config) +void goldstar_state::megaline(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, CPU_CLOCK); - m_maincpu->set_addrmap(AS_PROGRAM, &unkch_state::megaline_map); - m_maincpu->set_addrmap(AS_IO, &unkch_state::megaline_portmap); - - //I8255A(config, m_ppi[0], 0); - //I8255A(config, m_ppi[1], 0); - //I8255A(config, m_ppi[2], 0); + m_maincpu->set_addrmap(AS_PROGRAM, &goldstar_state::megaline_map); + m_maincpu->set_addrmap(AS_IO, &goldstar_state::megaline_portmap); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -11388,13 +11381,6 @@ void unkch_state::megaline(machine_config &config) SN76489(config, "sn2", PSG_CLOCK).add_route(ALL_OUTPUTS, "mono", 0.80); SN76489(config, "sn3", PSG_CLOCK).add_route(ALL_OUTPUTS, "mono", 0.80); - - ay8910_device &aysnd(AY8910(config, "aysnd", AY_CLOCK)); - aysnd.port_a_read_callback().set_ioport("DSW3"); - aysnd.port_b_read_callback().set_ioport("DSW4"); - aysnd.port_a_write_callback().set(FUNC(goldstar_state::ay8910_outputa_w)); - aysnd.port_b_write_callback().set(FUNC(goldstar_state::ay8910_outputb_w)); - aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); } @@ -12853,6 +12839,76 @@ ROM_START( cmezspin ) ROM_END +ROM_START( cmezspina ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "ezspinhcv2.rom", 0x0000, 0x1000, CRC(5203f088) SHA1(2ac2e32350661dc54fb78cff5543d68bda072614) ) + ROM_CONTINUE( 0x4000, 0x1000 ) + ROM_CONTINUE( 0x3000, 0x1000 ) + ROM_CONTINUE( 0x7000, 0x1000 ) + ROM_CONTINUE( 0x1000, 0x1000 ) + ROM_CONTINUE( 0x6000, 0x1000 ) + ROM_CONTINUE( 0x2000, 0x1000 ) + ROM_CONTINUE( 0x5000, 0x1000 ) + + // only the program ROM was provided, but dumper's readme says everything else matches cmezspin set + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_LOAD( "u16.7", 0x00000, 0x8000, CRC(19cc1d67) SHA1(47487f9362bfb36a32100ed772960628844462bf) ) + ROM_LOAD( "u11.6", 0x08000, 0x8000, CRC(c1466efa) SHA1(d725fc507c77e66bde93d0c33bf469add15f39b9) ) + ROM_LOAD( "u4.5", 0x10000, 0x8000, CRC(e39fff9c) SHA1(22fdc517fa478441622c6245cecb5728c5595757) ) + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_LOAD( "u15.4", 0x0000, 0x2000, CRC(8607ffd9) SHA1(9bc94715554aa2473ae2ed249a47f29c7886b3dc) ) + ROM_LOAD( "u10.3", 0x2000, 0x2000, CRC(c32367be) SHA1(ff217021b9c58e23b2226f8b0a7f5da966225715) ) + ROM_LOAD( "u14.2", 0x4000, 0x2000, CRC(6dfcb188) SHA1(22430429c798954d9d979e62699b58feae7fdbf4) ) + ROM_LOAD( "u9.1", 0x6000, 0x2000, CRC(9678ead2) SHA1(e80aefa98b2363fe9e6b2415762695ace272e4d3) ) + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "u53.8", 0x0000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "82s129.u84", 0x0000, 0x0100, CRC(0489b760) SHA1(78f8632b17a76335183c5c204cdec856988368b0) ) + ROM_LOAD( "82s129.u79", 0x0100, 0x0100, CRC(21eb5b19) SHA1(9b8425bdb97f11f4855c998c7792c3291fd07470) ) + + ROM_REGION( 0x100, "proms2", 0 ) + ROM_LOAD( "82s129.u46", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) ) +ROM_END + + +ROM_START( cmezspinb ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "ezspinhcv3.rom", 0x0000, 0x1000, CRC(1c7538f8) SHA1(ca458e45161284e6cb7ad7a66d799cd93bfdeb93) ) + ROM_CONTINUE( 0x4000, 0x1000 ) + ROM_CONTINUE( 0x3000, 0x1000 ) + ROM_CONTINUE( 0x7000, 0x1000 ) + ROM_CONTINUE( 0x1000, 0x1000 ) + ROM_CONTINUE( 0x6000, 0x1000 ) + ROM_CONTINUE( 0x2000, 0x1000 ) + ROM_CONTINUE( 0x5000, 0x1000 ) + + // only the program ROM was provided, but dumper's readme says everything else matches cmezspin set + ROM_REGION( 0x18000, "gfx1", 0 ) + ROM_LOAD( "u16.7", 0x00000, 0x8000, CRC(19cc1d67) SHA1(47487f9362bfb36a32100ed772960628844462bf) ) + ROM_LOAD( "u11.6", 0x08000, 0x8000, CRC(c1466efa) SHA1(d725fc507c77e66bde93d0c33bf469add15f39b9) ) + ROM_LOAD( "u4.5", 0x10000, 0x8000, CRC(e39fff9c) SHA1(22fdc517fa478441622c6245cecb5728c5595757) ) + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_LOAD( "u15.4", 0x0000, 0x2000, CRC(8607ffd9) SHA1(9bc94715554aa2473ae2ed249a47f29c7886b3dc) ) + ROM_LOAD( "u10.3", 0x2000, 0x2000, CRC(c32367be) SHA1(ff217021b9c58e23b2226f8b0a7f5da966225715) ) + ROM_LOAD( "u14.2", 0x4000, 0x2000, CRC(6dfcb188) SHA1(22430429c798954d9d979e62699b58feae7fdbf4) ) + ROM_LOAD( "u9.1", 0x6000, 0x2000, CRC(9678ead2) SHA1(e80aefa98b2363fe9e6b2415762695ace272e4d3) ) + + ROM_REGION( 0x10000, "user1", 0 ) + ROM_LOAD( "u53.8", 0x0000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "82s129.u84", 0x0000, 0x0100, CRC(0489b760) SHA1(78f8632b17a76335183c5c204cdec856988368b0) ) + ROM_LOAD( "82s129.u79", 0x0100, 0x0100, CRC(21eb5b19) SHA1(9b8425bdb97f11f4855c998c7792c3291fd07470) ) + + ROM_REGION( 0x100, "proms2", 0 ) + ROM_LOAD( "82s129.u46", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) ) +ROM_END + + ROM_START( cmasterc ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "msii841.u81", 0x3000, 0x1000, CRC(977db602) SHA1(0fd3d6781b654ac6befdc9278f84ca708d5d448c) ) @@ -19832,6 +19888,56 @@ ROM_START( megaline ) ROM_LOAD( "tbp24s10.m3", 0x0000, 0x0100, CRC(7edb311b) SHA1(8e7f933313dc7a1f2a5e8803c26953ced3f798d0) ) ROM_END +ROM_START( skillch ) // same PCB as megaline + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "16.r1", 0x00000, 0x10000, CRC(c0fee794) SHA1(0f0c268dc4e9370929948e66e4db4fb95108a00b) ) + + ROM_REGION( 0x20000, "gfx1", 0 ) + ROM_LOAD( "1.b1", 0x00000, 0x10000, CRC(c2554538) SHA1(ecb5ab7f611b937a5ff6dc26c6b0cb18b82acd93) ) + ROM_LOAD( "2.d1", 0x10000, 0x10000, CRC(a7eb57bf) SHA1(1346b03f9540d9235c5ca41f328c39b9ac9c3b17) ) + + ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_LOAD( "3.j1", 0x0000, 0x8000, CRC(1cbaaae6) SHA1(d56bb5a6a466bc74d5bbb2ba6f52a5ae8b0748a3) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x8000 ) + ROM_LOAD( "4.k1", 0x8000, 0x8000, CRC(9640841d) SHA1(421c78148884029e15a126652679fde990a24064) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x8000 ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "tbp24s10n.f4", 0x0000, 0x0100, CRC(d864b6f1) SHA1(6edc1941fe49cf53f073bf4acc466cd28b788146) ) + ROM_LOAD( "tbp24s10n.h4", 0x0100, 0x0100, CRC(4acd5887) SHA1(dca1187a74d9f4abc53b77a1590ec726f682dd91) ) + + ROM_REGION( 0x100, "proms2", 0 ) + ROM_LOAD( "tbp18s030n.j4", 0x0000, 0x0020, CRC(abda0acb) SHA1(b1781f4c2a54e40eb83ea315d23b3f3f0019aaf8) ) + + ROM_REGION( 0x100, "unkprom", 0 ) + ROM_LOAD( "tbp24s10n.m3", 0x0000, 0x0100, CRC(7edb311b) SHA1(8e7f933313dc7a1f2a5e8803c26953ced3f798d0) ) +ROM_END + +ROM_START( skillcha ) // same PCB as megaline + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "16.r1", 0x00000, 0x10000, CRC(7364624f) SHA1(55b54d92bc76060d88f78aca98e935953a7c9e22) ) + + ROM_REGION( 0x20000, "gfx1", 0 ) + ROM_LOAD( "1.b1", 0x00000, 0x10000, CRC(c2554538) SHA1(ecb5ab7f611b937a5ff6dc26c6b0cb18b82acd93) ) + ROM_LOAD( "2.d1", 0x10000, 0x10000, CRC(a7eb57bf) SHA1(1346b03f9540d9235c5ca41f328c39b9ac9c3b17) ) + + ROM_REGION( 0x10000, "gfx2", 0 ) + ROM_LOAD( "3.j1", 0x0000, 0x8000, CRC(1cbaaae6) SHA1(d56bb5a6a466bc74d5bbb2ba6f52a5ae8b0748a3) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x8000 ) + ROM_LOAD( "4.k1", 0x8000, 0x8000, CRC(9640841d) SHA1(421c78148884029e15a126652679fde990a24064) ) // 1ST AND 2ND HALF IDENTICAL + ROM_IGNORE( 0x8000 ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "tbp24s10n.f4", 0x0000, 0x0100, CRC(d864b6f1) SHA1(6edc1941fe49cf53f073bf4acc466cd28b788146) ) + ROM_LOAD( "tbp24s10n.h4", 0x0100, 0x0100, CRC(4acd5887) SHA1(dca1187a74d9f4abc53b77a1590ec726f682dd91) ) + + ROM_REGION( 0x100, "proms2", 0 ) + ROM_LOAD( "tbp18s030n.j4", 0x0000, 0x0020, CRC(abda0acb) SHA1(b1781f4c2a54e40eb83ea315d23b3f3f0019aaf8) ) + + ROM_REGION( 0x100, "unkprom", 0 ) + ROM_LOAD( "tbp24s10n.m3", 0x0000, 0x0100, CRC(7edb311b) SHA1(8e7f933313dc7a1f2a5e8803c26953ced3f798d0) ) +ROM_END + /* Bonus Chance (W-8). Wing Co. Ltd. @@ -23177,6 +23283,26 @@ void wingco_state::init_cb2() rom[a] = bitswap<8>(rom[a], 6, 7, 5, 4, 3, 2, 1, 0); } +void cmaster_state::init_cmezspina() +{ + uint8_t *rom = memregion("maincpu")->base(); + for (int i = 0; i < 0x8000; i++) + { + uint8_t x = rom[i]; + switch (i & 0x12) + { + case 0x00: x = bitswap<8>(x ^ 0x24, 2, 1, 0, 7, 6, 5, 4, 3); break; + case 0x02: x = bitswap<8>(x ^ 0x4d, 0, 7, 6, 5, 4, 3, 2, 1); break; + case 0x10: x = bitswap<8>(x ^ 0x3e, 1, 0, 7, 6, 5, 4, 3, 2); break; + case 0x12: x = bitswap<8>(x ^ 0xbb, 4, 3, 2, 1, 0, 7, 6, 5); break; + } + + rom[i] = x; + } + + init_cmv4(); +} + } // anonymous namespace @@ -23240,6 +23366,8 @@ GAMEL( 1995, 3cdpokera, 3cdpoker, cm, cmtetris, cmaster_state, empty_ini GAMEL( 1991, cmaster, 0, cm, cmaster, cmaster_state, empty_init, ROT0, "Dyna", "Cherry Master I (ver.1.01, set 1)", 0, layout_cmaster ) GAMEL( 1991, cmasterb, cmaster, cm, cmasterb, cmaster_state, init_cmv4, ROT0, "Dyna", "Cherry Master I (ver.1.01, set 2)", 0, layout_cmasterb ) GAMEL( 1991, cmezspin, cmaster, cm, cmezspin, cmaster_state, init_cmv4, ROT0, "Dyna", "Cherry Master I (E-Z Spin bootleg / hack)", 0, layout_cmezspin ) // CM Fruit Bonus 55 ver.2 bootleg/hack +GAMEL( 199?, cmezspina, cmaster, cm, cmezspin, cmaster_state, init_cmezspina, ROT0, "bootleg", "Cherry Master I (E-Z Spin Hands Count bootleg / hack, set 1)", 0, layout_cmezspin ) +GAMEL( 199?, cmezspinb, cmaster, cm, cmezspin, cmaster_state, init_cmezspina, ROT0, "bootleg", "Cherry Master I (E-Z Spin Hands Count bootleg / hack, set 2)", 0, layout_cmezspin ) GAMEL( 1991, cmasterc, cmaster, cmasterc, cmasterc, cmaster_state, init_cmv4, ROT0, "Dyna", "Cherry Master I (ver.1.01, set 3)", 0, layout_cmasterc ) GAMEL( 1991, cmasterbv, cmaster, cm, cmasterb, cmaster_state, init_cmv4, ROT0, "Dyna", "Cherry Master I (ver.1.01, set 4, with Blitz Poker ROM?)", MACHINE_NOT_WORKING, layout_cmasterb ) // Cherry Master works, but no idea how to use the Blitz ROM GAMEL( 1991, cmasterd, cmaster, cm, cmasterb, cmaster_state, init_cmv4, ROT0, "Dyna", "Cherry Master I (ver.1.01, set 5)", 0, layout_cmasterb ) @@ -23337,7 +23465,6 @@ GAMEL( 1990, cbaai, 0, lucky8, lucky8, wingco_state, empty_ini GAMEL( 199?, ttactoe, 0, lucky8, lucky8, wingco_state, empty_init, ROT0, "bootleg (Sundance)","Tic Tac Toe (Sundance bootleg of New Lucky 8 Lines)", MACHINE_NOT_WORKING, layout_lucky8 ) // I/O need to be checked, seems reasonably working GAME( 1985, luckylad, 0, luckylad, luckylad, wingco_state, empty_init, ROT0, "Wing Co., Ltd.", "Lucky Lady (Wing, encrypted)", MACHINE_NOT_WORKING | MACHINE_WRONG_COLORS ) // controls / dips, colors not correctly decoded -GAME( 1991, megaline, 0, megaline, megaline, unkch_state, empty_init, ROT0, "Fun World", "Mega Lines", MACHINE_NOT_WORKING ) GAMEL( 1993, bingowng, 0, bingowng, bingowng, wingco_state, empty_init, ROT0, "Wing Co., Ltd.", "Bingo (set 1)", 0, layout_bingowng ) GAMEL( 1993, bingownga, bingowng, bingownga,bingownga,wingco_state, empty_init, ROT0, "Wing Co., Ltd.", "Bingo (set 2)", 0, layout_bingowng ) @@ -23359,6 +23486,10 @@ GAME( 1986, feverch, 0, feverch, feverch, goldstar_state, empty_ini GAME( 1986, fevercha, feverch, feverch, feverch, goldstar_state, empty_init, ROT0, "Wing Co., Ltd.", "Fever Chance (W-6, Japan, set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // unimplemented arithmetic chip, reels scrolling, I/O GAME( 1986, feverchtw, feverch, feverch, feverch, goldstar_state, empty_init, ROT0, "Yamate", "Fever Chance (W-6, Taiwan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // reels scrolling, I/O +// --- Wing W-7 hardware --- +GAME( 1986, skillch, 0, megaline, megaline, goldstar_state, empty_init, ROT0, "Wing Co., Ltd.", "Skill Chance (W-7, set 1)", MACHINE_NOT_WORKING ) // not looked at yet +GAME( 1986, skillcha, skillch, megaline, megaline, goldstar_state, empty_init, ROT0, "Wing Co., Ltd.", "Skill Chance (W-7, set 2)", MACHINE_NOT_WORKING ) // " +GAME( 1991, megaline, 0, megaline, megaline, goldstar_state, empty_init, ROT0, "Fun World", "Mega Lines", MACHINE_NOT_WORKING ) // " // --- Wing W-8 hardware --- GAME( 1990, bonusch, 0, bonusch, bonusch, unkch_state, empty_init, ROT0, "Wing Co., Ltd.", "Bonus Chance (W-8, set 1)", MACHINE_NOT_WORKING ) // M80C51F MCU diff --git a/src/mame/mame.lst b/src/mame/mame.lst index d6222863af6..b8bd65c2d4d 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -20204,7 +20204,9 @@ cmasteri // (c) 1991 Dyna Electronics cmasterj // (c) 1991 Dyna Electronics cmasterk // (c) 1991 Dyna Electronics cmasterl // (c) 1991 Dyna Electronics -cmezspin // (c) 1991 Dyna Electronics +cmezspin // bootleg +cmezspina // bootleg +cmezspinb // bootleg cmfb55 // bootleg cmfun // (c) 1995 Dyna Electronics cmpacman // @@ -20349,6 +20351,8 @@ schery97 // (c) 1998 Amcoe schery97a // (c) 1998 Amcoe scmaster // 1994, unknown skill98 // (c) 1998 Amcoe +skillch // +skillcha // srmagic // bootleg ss2001 // bootleg / hack star100 // (c) 199? Sang Ho diff --git a/src/mame/mg1/mg1.cpp b/src/mame/mg1/mg1.cpp index e6efa832898..a43af1e9da0 100644 --- a/src/mame/mg1/mg1.cpp +++ b/src/mame/mg1/mg1.cpp @@ -12,7 +12,9 @@ */ /* * WIP - * - boots 42nix from hard disk image, but can't operate GUI without mouse + * - boots 42nix from hard disk image + * - cursor sometimes "trapped" + * - keyboard intermittently outputs garbage */ #include "emu.h" @@ -81,7 +83,8 @@ public: , m_kbd(*this, "kbd") , m_buzzer(*this, "buzzer") , m_buzzen(*this, "buzzer_enable") - , m_mouse_buttons(*this, "mouse_buttons") + , m_mouse_buttons(*this, "MOUSE_B") + , m_mouse_axis(*this, "MOUSE_%c", 'X') , m_led_err(*this, "led_err") , m_led_fdd(*this, "led_fdd") { @@ -102,6 +105,9 @@ protected: private: MC6845_UPDATE_ROW(update_row); + MC6845_END_UPDATE(draw_cursor); + + template u8 mouse_axis_r(); // devices required_device m_cpu; @@ -137,24 +143,88 @@ private: required_device m_buzzen; required_ioport m_mouse_buttons; + required_ioport_array<2> m_mouse_axis; output_finder<> m_led_err; output_finder<> m_led_fdd; u8 m_sem[6] = { 0xc0, 0x80, 0xc0, 0xc0, 0xc0, 0xc0 }; u8 m_iop_p2; + + s16 m_mouse[2]; + + struct cursor_cnt + { + bool partial; + u16 data; + s16 value; + } + m_cursor_cnt[2]; + + u8 m_cursor_reg; // cursor page number and x offset + bool m_cursor_fn; // cursor function (1=nor, 0=xnor) }; void mg1_state::machine_start() { m_led_err.resolve(); m_led_fdd.resolve(); + + save_item(NAME(m_sem)); + save_item(NAME(m_iop_p2)); + save_item(NAME(m_mouse)); + save_item(STRUCT_MEMBER(m_cursor_cnt, partial)); + save_item(STRUCT_MEMBER(m_cursor_cnt, data)); + save_item(STRUCT_MEMBER(m_cursor_cnt, value)); + save_item(NAME(m_cursor_reg)); + save_item(NAME(m_cursor_fn)); } void mg1_state::machine_reset() { m_fdc->set_floppy(m_fdd); m_iop_p2 = 0; + + m_mouse[0] = 0; + m_mouse[1] = 0; + + for (cursor_cnt &c : m_cursor_cnt) + { + c.partial = false; + c.data = 0; + c.value = 0; + } + + m_cursor_reg = 0; + m_cursor_fn = false; + + // HACK: capture the counter 1 and 2 values which control the hardware cursor location + m_iop->space(0).install_write_tap(0x20e1, 0x20e2, "cursor_cnt_w", + [this](offs_t offset, u8 &data, u8 mem_mask) + { + cursor_cnt &c = m_cursor_cnt[(offset & 3) - 1]; + + // data is written least-significant byte first + c.data = u16(data) << 8 | (c.data >> 8); + c.partial = !c.partial; + + // convert counter values to pixel coordinates after each update + if (!c.partial) + { + switch (offset & 3) + { + case 1: + // counter 1 holds cursor y position multiplied by number of characters + // per line (20), plus an offset (0x4d); except for lines <1 + c.value = (c.data > 0x4c) ? (c.data - 0x4d) / 0x14 : (c.data - 0x4d); + break; + case 2: + // counter 2 holds cursor x position in character columns (+1) + c.value = (c.data - 1) * 64; + break; + } + } + }); } template void mg1_state::cpu_map(address_map &map) @@ -250,14 +320,17 @@ void mg1_state::iop_map(address_map &map) }, "iop_sem_w"); // i/o area - map(0x2000, 0x201f).mirror(0x1e00).lw8([this](u8 data) { m_buzzen->in_w<1>(BIT(data, 0)); }, "mouse_x"); // mouse x counter/buzzer enable + map(0x2000, 0x201f).mirror(0x1e00).r(FUNC(mg1_state::mouse_axis_r<0>)); + map(0x2000, 0x201f).mirror(0x1e00).lw8([this](u8 data) { m_buzzen->in_w<1>(BIT(data, 0)); }, "buzzer_w"); map(0x2020, 0x2020).mirror(0x1e00).lw8([this](offs_t offset, u8 data) { logerror("host reset %x,0x%02x\n", offset, data); }, "host_reset").select(0x0100); - //map(0x2040, 0x205f).mirror(0x1e00).lw8([this](u8 data) { logerror("cursor 0x%02x\n", data); }, "cursor"); // cursor pixel offset & cursor number - map(0x2060, 0x207f).mirror(0x1e00).lw8([this](u8 data) { m_icu->ir_w<10>(0); }, "iopint"); + map(0x2040, 0x205f).mirror(0x1e00).lw8([this](u8 data) { m_cursor_reg = data; }, "cursor_reg_w"); + map(0x2060, 0x207f).mirror(0x1e00).lw8([this](u8 data) { m_icu->ir_w<10>(1); m_icu->ir_w<10>(0); }, "iopint"); map(0x2080, 0x2080).mirror(0x1e00).rw(m_crtc, FUNC(mc6845_device::status_r), FUNC(mc6845_device::address_w)); map(0x2081, 0x2081).mirror(0x1e00).rw(m_crtc, FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w)); - map(0x20a0, 0x20bf).mirror(0x1e00).lr8([this]() { return m_mouse_buttons->read(); }, "mouse_b"); // mouse buttons - //map(0x20c0, 0x20df).mirror(0x1e00).lw8([this](u8 data) { logerror("mouse y counter 0x%02x\n", data); }, "mouse_y"); // mouse y counter + map(0x20a0, 0x20bf).mirror(0x1e00).lrw8( + [this]() { return m_mouse_buttons->read(); }, "mouse_b_r", + [this](u8 data) { m_cursor_fn = BIT(data, 0); }, "cursor_fn_w"); + map(0x20c0, 0x20df).mirror(0x1e00).r(FUNC(mg1_state::mouse_axis_r<1>)); map(0x20e0, 0x20ff).mirror(0x1e00).rw(m_iop_ctc, FUNC(pit8253_device::read), FUNC(pit8253_device::write)); map(0x4000, 0x47ff).mirror(0x3800).ram().share("iop_sram"); // D4016C-3 2048x8 SRAM @@ -272,11 +345,27 @@ void mg1_state::dma_map(address_map &map) [this](offs_t offset, u16 data, u16 mem_mask) { m_cpu->space(0).write_word(offset << 1, swapendian_int16(data), swapendian_int16(mem_mask)); }, "dma_w"); } +template u8 mg1_state::mouse_axis_r() +{ + s16 const value = m_mouse_axis[Axis]->read(); + s8 const delta = std::clamp(value - m_mouse[Axis], -128, 127); + + m_mouse[Axis] = value; + + return delta; +} + static INPUT_PORTS_START(mg1) - PORT_START("mouse_buttons") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Left Button") PORT_CODE(MOUSECODE_BUTTON1) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Mouse Middle Button") PORT_CODE(MOUSECODE_BUTTON3) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Mouse Right Button") PORT_CODE(MOUSECODE_BUTTON2) + PORT_START("MOUSE_B") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Mouse Left Button") PORT_CODE(MOUSECODE_BUTTON1) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("Mouse Middle Button") PORT_CODE(MOUSECODE_BUTTON3) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("Mouse Right Button") PORT_CODE(MOUSECODE_BUTTON2) + + PORT_START("MOUSE_X") + PORT_BIT(0xffff, 0x0000, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) + + PORT_START("MOUSE_Y") + PORT_BIT(0xffff, 0x0000, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) INPUT_PORTS_END MC6845_UPDATE_ROW(mg1_state::update_row) @@ -307,6 +396,42 @@ MC6845_UPDATE_ROW(mg1_state::update_row) } } +MC6845_END_UPDATE(mg1_state::draw_cursor) +{ + s32 const cursor_y = m_cursor_cnt[0].value; + s32 const cursor_x = m_cursor_cnt[1].value - BIT(m_cursor_reg, 2, 6); + + rectangle cursor(cursor_x, cursor_x + 63, cursor_y, cursor_y + 63); + cursor &= cliprect; + + for (s32 y = cursor.top(); y <= cursor.bottom(); y++) + { + // vma0-5 from counter, vma6-7 from register, vma8-15 high, vma16 low + u16 const vma = 0xff00 | BIT(m_cursor_reg, 0, 2) << 6; + u32 const va = (u32(m_vmram[vma >> 6]) << 6) + y - cursor_y; + + // read first displayed byte of cursor data + unsigned bit = cursor.left() - cursor_x; + u8 data = m_ram->read((va << 3) | BYTE8_XOR_LE(bit >> 3)); + + for (s32 x = cursor.left(); x <= cursor.right(); x++) + { + // apply cursor function + if (BIT(data, bit++ & 7)) + { + if (m_cursor_fn) + bitmap.pix(y, x) = rgb_t::black(); + else + bitmap.pix(y, x) ^= rgb_t::white(); + } + + // read next byte of cursor data + if (!(bit & 7) && (bit < 64)) + data = m_ram->read((va << 3) | BYTE8_XOR_LE(bit >> 3)); + } + } +} + static void floppy_formats(format_registration &fr) { fr.add_mfm_containers(); @@ -404,6 +529,7 @@ void mg1_state::mg1(machine_config &config) m_crtc->set_show_border_area(false); m_crtc->set_hpixels_per_column(64); m_crtc->set_update_row_callback(FUNC(mg1_state::update_row)); + m_crtc->set_end_update_callback(FUNC(mg1_state::draw_cursor)); m_crtc->out_vsync_callback().set(m_iop_ctc, FUNC(pit8253_device::write_gate1)); m_crtc->out_hsync_callback().set(m_iop_ctc, FUNC(pit8253_device::write_gate2)); @@ -412,6 +538,7 @@ void mg1_state::mg1(machine_config &config) SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(60_MHz_XTAL, 20*64, 1*64, 17*64, 51*16 + 4, 0, 50*16); m_screen->set_screen_update(m_crtc, FUNC(mc6845_device::screen_update)); + m_screen->screen_vblank().set_inputline(m_iop, M6801_TIN_LINE); AM7990(config, m_net); m_net->intr_out().set(m_icu, FUNC(ns32202_device::ir_w<6>)); diff --git a/src/mame/toaplan/gp9001.cpp b/src/mame/toaplan/gp9001.cpp index 32d49d7cb68..5062ea61639 100644 --- a/src/mame/toaplan/gp9001.cpp +++ b/src/mame/toaplan/gp9001.cpp @@ -389,22 +389,22 @@ u16 gp9001vdp_device::vdpcount_r() int vpos = screen().vpos(); - u16 video_status = 0xff00; // Set signals inactive + u16 video_status = 0xff00; // Set signals inactive vpos = (vpos + 15) % 262; - if (hsync_r()) + if (!hsync_r()) video_status &= ~0x8000; - if (vsync_r()) + if (!vsync_r()) video_status &= ~0x4000; - if (fblank_r()) + if (!fblank_r()) video_status &= ~0x0100; if (vpos < 256) video_status |= (vpos & 0xff); else video_status |= 0xff; -// logerror("VC: vpos=%04x hpos=%04x VBL=%04x\n",vpos,hpos,m_screen->vblank()); + //logerror("VC: vpos=%04x hpos=%04x VBL=%04x\n",vpos,hpos,m_screen->vblank()); return video_status; } diff --git a/src/mame/toaplan/raizing.cpp b/src/mame/toaplan/raizing.cpp index 35857f08b3a..813745dde78 100644 --- a/src/mame/toaplan/raizing.cpp +++ b/src/mame/toaplan/raizing.cpp @@ -222,7 +222,7 @@ void raizing_base_state::raizing_oki_bankswitch_w(offs_t offset, u8 data) m_raizing_okibank[(offset & 4) >> 2][4 + (offset & 3)]->set_entry(data & 0xf); } -void raizing_base_state::common_bgaregga_reset() +void raizing_base_state::raizing_oki_reset() { for (int chip = 0; chip < 2; chip++) { @@ -747,7 +747,7 @@ void bgaregga_state::machine_reset() { raizing_base_state::machine_reset(); - common_bgaregga_reset(); + raizing_oki_reset(); } void sstriker_state::mahoudai_68k_mem(address_map &map) diff --git a/src/mame/toaplan/raizing.h b/src/mame/toaplan/raizing.h index 55810770738..61b8c6ef9d6 100644 --- a/src/mame/toaplan/raizing.h +++ b/src/mame/toaplan/raizing.h @@ -60,7 +60,7 @@ protected: void raizing_z80_bankswitch_w(u8 data); void raizing_oki_bankswitch_w(offs_t offset, u8 data); void install_raizing_okibank(int chip); - void common_bgaregga_reset(); + void raizing_oki_reset(); void common_mem(address_map &map, offs_t rom_limit) ATTR_COLD; @@ -100,7 +100,7 @@ protected: optional_memory_bank_array<8> m_raizing_okibank[2]; optional_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU required_device m_maincpu; - optional_device m_audiocpu; + optional_device m_audiocpu; required_device m_vdp; optional_device_array m_oki; optional_device m_gfxdecode; diff --git a/src/mame/toaplan/raizing_batrider.cpp b/src/mame/toaplan/raizing_batrider.cpp index 2d06f9dde6b..7a6db395071 100644 --- a/src/mame/toaplan/raizing_batrider.cpp +++ b/src/mame/toaplan/raizing_batrider.cpp @@ -159,7 +159,6 @@ public: void init_batrider() ATTR_COLD; protected: - virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; virtual void video_start() override ATTR_COLD; @@ -174,8 +173,8 @@ protected: void batrider_soundlatch_w(u8 data); void batrider_soundlatch2_w(u8 data); void batrider_unknown_sound_w(u16 data); - void batrider_clear_sndirq_w(u16 data); - void batrider_sndirq_w(u8 data); + template void batrider_clear_sndirq_w(u16 data); + template void batrider_sndirq_w(u8 data); void batrider_clear_nmi_w(u8 data); void batrider_tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask = ~0); void batrider_textdata_dma_w(u16 data); @@ -183,14 +182,11 @@ protected: void batrider_objectbank_w(offs_t offset, u8 data); void batrider_bank_cb(u8 layer, u32 &code); - required_device m_dma_space; required_shared_ptr m_mainram; optional_region_ptr m_z80_rom; - u16 m_gfxrom_bank[8]{}; /* Batrider object bank */ - u8 m_sndirq_line = 0; /* IRQ4 for batrider, IRQ2 for bbakraid */ - u8 m_z80_busreq = 0; + u16 m_gfxrom_bank[8] = { }; // Batrider object bank }; @@ -205,8 +201,6 @@ public: void bbakraid(machine_config &config) ATTR_COLD; - void init_bbakraid() ATTR_COLD; - private: void bbakraid_68k_mem(address_map &map) ATTR_COLD; void bbakraid_sound_z80_mem(address_map &map) ATTR_COLD; @@ -240,7 +234,6 @@ private: void batrider_state::batrider_tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask) { /*** Dynamic GFX decoding for Batrider / Battle Bakraid ***/ - const u16 oldword = m_tx_gfxram[offset]; if (oldword != data) @@ -298,29 +291,28 @@ void batrider_state::video_start() m_vdp->disable_sprite_buffer(); // disable buffering on this game - /* Create the Text tilemap for this game */ + // Create the Text tilemap for this game m_gfxdecode->gfx(0)->set_source(reinterpret_cast(m_tx_gfxram.target())); create_tx_tilemap(0x1d4, 0x16b); - /* Has special banking */ + // Has special banking save_item(NAME(m_gfxrom_bank)); } u16 batrider_state::batrider_z80_busack_r() { - // Bit 0x01 returns the status of BUSAK from the Z80. - // These accesses are made when the 68K wants to read the Z80 - // ROM code. Failure to return the correct status incurrs a Sound Error. - - return m_z80_busreq; // Loop BUSRQ to BUSAK + // bit 0x01 returns the status of BUSACK from the Z80 + return m_audiocpu->busack_r(); } void batrider_state::batrider_z80_busreq_w(u8 data) { - m_z80_busreq = (data & 0x01); // see batrider_z80_busack_r above + // bit 0x01 sets Z80 BUSRQ, when the 68K wants to read the Z80 ROM code + m_audiocpu->set_input_line(Z80_INPUT_LINE_BUSRQ, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); + machine().scheduler().perfect_quantum(attotime::from_usec(10)); } @@ -332,14 +324,14 @@ u16 batrider_state::batrider_z80rom_r(offs_t offset) // these two latches are always written together, via a single move.l instruction void batrider_state::batrider_soundlatch_w(u8 data) { - m_soundlatch[0]->write(data & 0xff); + m_soundlatch[0]->write(data); m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } void batrider_state::batrider_soundlatch2_w(u8 data) { - m_soundlatch[1]->write(data & 0xff); + m_soundlatch[1]->write(data); m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); } @@ -349,19 +341,18 @@ void batrider_state::batrider_unknown_sound_w(u16 data) // for bbakraid this is on every sound command; for batrider, only on certain commands } - +template void batrider_state::batrider_clear_sndirq_w(u16 data) { - // not sure whether this is correct - // the 68K writes here during the sound IRQ handler, and nowhere else... - m_maincpu->set_input_line(m_sndirq_line, CLEAR_LINE); + // not sure whether this is correct, the 68K writes here during the sound IRQ handler, and nowhere else... + m_maincpu->set_input_line(Line, CLEAR_LINE); } - +template void batrider_state::batrider_sndirq_w(u8 data) { - // if batrider_clear_sndirq_w() is correct, should this be ASSERT_LINE? - m_maincpu->set_input_line(m_sndirq_line, HOLD_LINE); + // IRQ4 for batrider, IRQ2 for bbakraid + m_maincpu->set_input_line(Line, ASSERT_LINE); } @@ -373,16 +364,8 @@ void batrider_state::batrider_clear_nmi_w(u8 data) u16 bbakraid_state::bbakraid_eeprom_r() { - // Bit 0x01 returns the status of BUSAK from the Z80. - // BUSRQ is activated via bit 0x10 on the EEPROM write port. - // These accesses are made when the 68K wants to read the Z80 - // ROM code. Failure to return the correct status incurrs a Sound Error. - - u8 data; - data = ((m_eeprom->do_read() & 0x01) << 4); - data |= ((m_z80_busreq >> 4) & 0x01); // Loop BUSRQ to BUSAK - - return data; + // bit 0x01 returns the status of BUSACK from the Z80 + return ((m_eeprom->do_read() & 0x01) << 4) | m_audiocpu->busack_r(); } @@ -393,14 +376,9 @@ void bbakraid_state::bbakraid_eeprom_w(u8 data) m_eepromout->write(data, 0xff); - m_z80_busreq = data & 0x10; // see bbakraid_eeprom_r above -} - -void batrider_state::machine_start() -{ - raizing_base_state::machine_start(); - - save_item(NAME(m_z80_busreq)); + // bit 0x10 sets Z80 BUSRQ, when the 68K wants to read the Z80 ROM code + m_audiocpu->set_input_line(Z80_INPUT_LINE_BUSRQ, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE); + machine().scheduler().perfect_quantum(attotime::from_usec(10)); } @@ -413,7 +391,7 @@ void batrider_state::machine_reset() { raizing_base_state::machine_reset(); - common_bgaregga_reset(); + raizing_oki_reset(); } static INPUT_PORTS_START( batrider ) @@ -512,7 +490,7 @@ static INPUT_PORTS_START( batrider ) PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW3:!4") PORT_DIPSETTING( 0x0800, DEF_STR( No ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x1000, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW3:!5") + PORT_DIPNAME( 0x1000, 0x0000, "Invulnerability (Cheat)" ) PORT_DIPLOCATION("SW3:!5") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) // These dips are shown only when Coin_A is set to Free_Play, but they work in normal play mode too @@ -549,7 +527,7 @@ static INPUT_PORTS_START( bbakraid ) PORT_INCLUDE( batrider ) PORT_MODIFY("DSW") // DSWA and DSWB - PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!7,!8") + PORT_DIPNAME( 0xc000, 0x0000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!7,!8") PORT_DIPSETTING( 0xc000, DEF_STR( None ) ) PORT_DIPSETTING( 0x8000, "Every 4000k" ) PORT_DIPSETTING( 0x4000, "Every 3000k" ) @@ -672,7 +650,7 @@ void batrider_state::batrider_68k_mem(address_map &map) map(0x500021, 0x500021).w(FUNC(batrider_state::batrider_soundlatch_w)); map(0x500023, 0x500023).w(FUNC(batrider_state::batrider_soundlatch2_w)); map(0x500024, 0x500025).w(FUNC(batrider_state::batrider_unknown_sound_w)); - map(0x500026, 0x500027).w(FUNC(batrider_state::batrider_clear_sndirq_w)); + map(0x500026, 0x500027).w(FUNC(batrider_state::batrider_clear_sndirq_w)); map(0x500061, 0x500061).w(FUNC(batrider_state::batrider_z80_busreq_w)); map(0x500080, 0x500081).w(FUNC(batrider_state::batrider_textdata_dma_w)); map(0x500082, 0x500083).w(FUNC(batrider_state::batrider_pal_text_dma_w)); @@ -701,7 +679,7 @@ void bbakraid_state::bbakraid_68k_mem(address_map &map) map(0x500017, 0x500017).w(FUNC(bbakraid_state::batrider_soundlatch2_w)); map(0x500018, 0x500019).r(FUNC(bbakraid_state::bbakraid_eeprom_r)); map(0x50001a, 0x50001b).w(FUNC(bbakraid_state::batrider_unknown_sound_w)); - map(0x50001c, 0x50001d).w(FUNC(bbakraid_state::batrider_clear_sndirq_w)); + map(0x50001c, 0x50001d).w(FUNC(bbakraid_state::batrider_clear_sndirq_w)); map(0x50001f, 0x50001f).w(FUNC(bbakraid_state::bbakraid_eeprom_w)); map(0x500080, 0x500081).w(FUNC(bbakraid_state::batrider_textdata_dma_w)); map(0x500082, 0x500083).w(FUNC(bbakraid_state::batrider_pal_text_dma_w)); @@ -744,7 +722,7 @@ void batrider_state::batrider_sound_z80_port(address_map &map) map.global_mask(0xff); map(0x40, 0x40).w(m_soundlatch[2], FUNC(generic_latch_8_device::write)); map(0x42, 0x42).w(m_soundlatch[3], FUNC(generic_latch_8_device::write)); - map(0x44, 0x44).w(FUNC(batrider_state::batrider_sndirq_w)); + map(0x44, 0x44).w(FUNC(batrider_state::batrider_sndirq_w)); map(0x46, 0x46).w(FUNC(batrider_state::batrider_clear_nmi_w)); map(0x48, 0x48).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); map(0x4a, 0x4a).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); @@ -758,7 +736,7 @@ void batrider_state::batrider_sound_z80_port(address_map &map) void bbakraid_state::bbakraid_sound_z80_mem(address_map &map) { - map(0x0000, 0xbfff).rom(); // No banking? ROM only contains code and data up to 0x28DC + map(0x0000, 0xbfff).rom(); // No banking? ROM only contains code and data up to 0x28DC map(0xc000, 0xffff).ram(); } @@ -768,7 +746,7 @@ void bbakraid_state::bbakraid_sound_z80_port(address_map &map) map.global_mask(0xff); map(0x40, 0x40).w(m_soundlatch[2], FUNC(generic_latch_8_device::write)); map(0x42, 0x42).w(m_soundlatch[3], FUNC(generic_latch_8_device::write)); - map(0x44, 0x44).w(FUNC(bbakraid_state::batrider_sndirq_w)); + map(0x44, 0x44).w(FUNC(bbakraid_state::batrider_sndirq_w)); map(0x46, 0x46).w(FUNC(bbakraid_state::batrider_clear_nmi_w)); map(0x48, 0x48).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); map(0x4a, 0x4a).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); @@ -796,18 +774,18 @@ GFXDECODE_END void batrider_state::batrider(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator (verified) + // basic machine hardware + M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator (verified) m_maincpu->set_addrmap(AS_PROGRAM, &batrider_state::batrider_68k_mem); m_maincpu->reset_cb().set(FUNC(batrider_state::reset_audiocpu)); - Z80(config, m_audiocpu, 32_MHz_XTAL/6); // 5.333MHz, 32MHz Oscillator (verified) + Z80(config, m_audiocpu, 32_MHz_XTAL/6); // 5.333MHz, 32MHz Oscillator (verified) m_audiocpu->set_addrmap(AS_PROGRAM, &batrider_state::batrider_sound_z80_mem); m_audiocpu->set_addrmap(AS_IO, &batrider_state::batrider_sound_z80_port); TOAPLAN_COINCOUNTER(config, m_coincounter, 0); - config.set_maximum_quantum(attotime::from_hz(600)); + config.set_maximum_quantum(attotime::from_hz(6000)); ADDRESS_MAP_BANK(config, m_dma_space, 0); m_dma_space->set_addrmap(0, &batrider_state::batrider_dma_mem); @@ -816,7 +794,7 @@ void batrider_state::batrider(machine_config &config) m_dma_space->set_addr_width(16); m_dma_space->set_stride(0x8000); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); @@ -832,10 +810,10 @@ void batrider_state::batrider(machine_config &config) m_vdp->set_tile_callback(FUNC(batrider_state::batrider_bank_cb)); m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - // these two latches are always written together, via a single move.l instruction + // first two latches are always written together, via a single move.l instruction GENERIC_LATCH_8(config, m_soundlatch[0]); GENERIC_LATCH_8(config, m_soundlatch[1]); GENERIC_LATCH_8(config, m_soundlatch[2]); @@ -855,19 +833,21 @@ void batrider_state::batrider(machine_config &config) void bbakraid_state::bbakraid(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator + // basic machine hardware + M68000(config, m_maincpu, 32_MHz_XTAL/2); // 16MHz, 32MHz Oscillator m_maincpu->set_addrmap(AS_PROGRAM, &bbakraid_state::bbakraid_68k_mem); m_maincpu->reset_cb().set(FUNC(bbakraid_state::reset_audiocpu)); - Z80(config, m_audiocpu, XTAL(32'000'000)/6); /* 5.3333MHz , 32MHz Oscillator */ + Z80(config, m_audiocpu, 32_MHz_XTAL/6); // 5.3333MHz, 32MHz Oscillator m_audiocpu->set_addrmap(AS_PROGRAM, &bbakraid_state::bbakraid_sound_z80_mem); m_audiocpu->set_addrmap(AS_IO, &bbakraid_state::bbakraid_sound_z80_port); - m_audiocpu->set_periodic_int(FUNC(bbakraid_state::bbakraid_snd_interrupt), attotime::from_hz(XTAL(32'000'000) / 6 / 12000)); // sound CPU clock (divider unverified) + + attotime snd_irq_period = attotime::from_hz(32_MHz_XTAL / 6 / 12000); // from sound CPU clock? (divider unverified) + m_audiocpu->set_periodic_int(FUNC(bbakraid_state::bbakraid_snd_interrupt), snd_irq_period); TOAPLAN_COINCOUNTER(config, m_coincounter, 0); - config.set_maximum_quantum(attotime::from_hz(600)); + config.set_maximum_quantum(attotime::from_hz(6000)); EEPROM_93C66_8BIT(config, m_eeprom); @@ -878,7 +858,7 @@ void bbakraid_state::bbakraid(machine_config &config) m_dma_space->set_addr_width(16); m_dma_space->set_stride(0x8000); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); m_screen->set_raw(27_MHz_XTAL/4, 432, 0, 320, 262, 0, 240); @@ -894,10 +874,10 @@ void bbakraid_state::bbakraid(machine_config &config) m_vdp->set_tile_callback(FUNC(bbakraid_state::batrider_bank_cb)); m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_1); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - // these two latches are always written together, via a single move.l instruction + // first two latches are always written together, via a single move.l instruction GENERIC_LATCH_8(config, m_soundlatch[0]); GENERIC_LATCH_8(config, m_soundlatch[1]); GENERIC_LATCH_8(config, m_soundlatch[2]); @@ -911,7 +891,7 @@ void bbakraid_state::bbakraid(machine_config &config) void nprobowl_state::nprobowl(machine_config &config) { // basic machine hardware - M68000(config, m_maincpu, 32_MHz_XTAL / 2); // 32MHz Oscillator, divisor not verified + M68000(config, m_maincpu, 32_MHz_XTAL / 2); // 32MHz Oscillator, divisor not verified m_maincpu->set_addrmap(AS_PROGRAM, &nprobowl_state::nprobowl_68k_mem); m_maincpu->reset_cb().set(FUNC(nprobowl_state::reset_audiocpu)); @@ -952,13 +932,6 @@ void batrider_state::init_batrider() m_audiobank->configure_entries(0, 16, &m_z80_rom[0], 0x4000); install_raizing_okibank(0); install_raizing_okibank(1); - m_sndirq_line = 4; -} - - -void bbakraid_state::init_bbakraid() -{ - m_sndirq_line = 2; } @@ -1413,24 +1386,24 @@ ROM_END } // anonymous namespace // these are all based on Version B, even if only the Japan version states 'version B' -GAME( 1998, batrider, 0, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Europe) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batrideru, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (USA) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batriderc, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (China) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batriderj, batrider, batrider, batriderj, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Japan, B version) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batriderk, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Korea) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batrider, 0, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Europe) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batrideru, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (USA) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batriderc, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (China) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batriderj, batrider, batrider, batriderj, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Japan, B version) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batriderk, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Korea) (Fri Feb 13 1998)", MACHINE_SUPPORTS_SAVE ) // older revision of the code -GAME( 1998, batriderja, batrider, batrider, batriderj, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Japan, older version) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batriderhk, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Hong Kong) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, batridert, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Taiwan) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batriderja, batrider, batrider, batriderj, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Japan, older version) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batriderhk, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Hong Kong) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, batridert, batrider, batrider, batrider, batrider_state, init_batrider, ROT270, "Raizing / Eighting", "Armed Police Batrider (Taiwan) (Mon Dec 22 1997)", MACHINE_SUPPORTS_SAVE ) // Battle Bakraid // the 'unlimited' version is a newer revision of the code -GAME( 1999, bbakraid, 0, bbakraid, bbakraid, bbakraid_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (USA) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, bbakraidc, bbakraid, bbakraid, bbakraid, bbakraid_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (China) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, bbakraidj, bbakraid, bbakraid, bbakraid, bbakraid_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (Japan) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, bbakraid, 0, bbakraid, bbakraid, bbakraid_state, empty_init, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (USA) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, bbakraidc, bbakraid, bbakraid, bbakraid, bbakraid_state, empty_init, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (China) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, bbakraidj, bbakraid, bbakraid, bbakraid, bbakraid_state, empty_init, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (Japan) (Tue Jun 8 1999)", MACHINE_SUPPORTS_SAVE ) // older revision of the code -GAME( 1999, bbakraidja, bbakraid, bbakraid, bbakraid, bbakraid_state, init_bbakraid, ROT270, "Eighting", "Battle Bakraid (Japan) (Wed Apr 7 1999)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, bbakraidja, bbakraid, bbakraid, bbakraid, bbakraid_state, empty_init, ROT270, "Eighting", "Battle Bakraid (Japan) (Wed Apr 7 1999)", MACHINE_SUPPORTS_SAVE ) // dedicated PCB -GAME( 1996, nprobowl, 0, nprobowl, nprobowl, nprobowl_state, empty_init, ROT0, "Zuck / Able Corp", "New Pro Bowl", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // bad GFXs, no sound banking, controls, etc -GAME( 1996, probowl2, nprobowl, nprobowl, nprobowl, nprobowl_state, empty_init, ROT0, "Zuck / Able Corp", "Pro Bowl 2", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // bad GFXs, no sound banking, controls, etc +GAME( 1996, nprobowl, 0, nprobowl, nprobowl, nprobowl_state, empty_init, ROT0, "Zuck / Able Corp", "New Pro Bowl", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // bad GFXs, no sound banking, controls, etc +GAME( 1996, probowl2, nprobowl, nprobowl, nprobowl, nprobowl_state, empty_init, ROT0, "Zuck / Able Corp", "Pro Bowl 2", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) // bad GFXs, no sound banking, controls, etc