diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/sound/spkrdev.cpp | 2 | ||||
-rw-r--r-- | src/emu/sound.cpp | 2 | ||||
-rw-r--r-- | src/emu/sound.h | 6 | ||||
-rw-r--r-- | src/mame/bmc/koftball.cpp | 130 | ||||
-rw-r--r-- | src/mame/capcom/cps2.cpp | 22 |
5 files changed, 97 insertions, 65 deletions
diff --git a/src/devices/sound/spkrdev.cpp b/src/devices/sound/spkrdev.cpp index 841656ab4ac..16dc6199c2f 100644 --- a/src/devices/sound/spkrdev.cpp +++ b/src/devices/sound/spkrdev.cpp @@ -268,7 +268,7 @@ void speaker_sound_device::level_w(int new_level) /* This is redundant because time update has to be done within sound_stream_update() anyway, * however this ensures synchronization between the speaker and stream timing: */ - m_channel_last_sample_time = m_channel->sample_time(); + m_channel_last_sample_time = m_channel->end_time(); /* sample_time() may be ahead of us */ if (m_channel_last_sample_time > time) diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp index 696742a87e2..a393fcefb46 100644 --- a/src/emu/sound.cpp +++ b/src/emu/sound.cpp @@ -859,7 +859,7 @@ void sound_manager::after_devices_init() void sound_manager::input_get(int id, sound_stream &stream) { u32 samples = stream.samples(); - u64 end_pos = stream.sample_index(); + u64 end_pos = stream.end_index(); u32 skip = stream.output_count(); for(const auto &step : m_microphones[id].m_input_mixing_steps) { diff --git a/src/emu/sound.h b/src/emu/sound.h index 6d699dbb8d9..57c96683f0a 100644 --- a/src/emu/sound.h +++ b/src/emu/sound.h @@ -35,7 +35,7 @@ For example, if you have a 10Hz clock, and call stream.update() at t=0.91, it will compute 10 samples (for clock edges 0.0, 0.1, 0.2, ..., 0.7, 0.8, and 0.9). And then if you ask the stream what its - current end time is (via stream.sample_time()), it will say t=1.0, + current end time is (via stream.end_time()), it will say t=1.0, which is in the future, because it knows it will hold that last sample until 1.0s. @@ -210,11 +210,9 @@ public: // sample id and timing of the first and last sample of the current update block, and first of the next sample block u64 start_index() const { return m_output_buffer.write_sample(); } - u64 end_index() const { return m_output_buffer.write_sample() + samples() - 1; } - u64 sample_index() const { return m_output_buffer.write_sample() + samples(); } + u64 end_index() const { return m_output_buffer.write_sample() + samples(); } attotime start_time() const { return sample_to_time(start_index()); } attotime end_time() const { return sample_to_time(end_index()); } - attotime sample_time() const { return sample_to_time(sample_index()); } // convert from absolute sample index to time attotime sample_to_time(u64 index) const; diff --git a/src/mame/bmc/koftball.cpp b/src/mame/bmc/koftball.cpp index c986aa05b91..a028cee9a84 100644 --- a/src/mame/bmc/koftball.cpp +++ b/src/mame/bmc/koftball.cpp @@ -7,12 +7,17 @@ King Of Football (c)1995 BMC preliminary driver by Tomasz Slanina TODO: -- lots of unknown writes / reads; -- one of the customs could contain a VIA6522-like core. bmc/bmcbowl.cpp uses the VIA6522 and the - accesses are similar; -- probably jxzh also supports the mahjong keyboard. Check if one of the dips enable it and where it - is read; -- better understanding of the koftball protection. +- Lots of unknown writes/reads. +- One of the customs could contain a VIA6522-like core. bmc/bmcbowl.cpp + uses the VIA6522 and the accesses are similar. +- jxzh and kaimenhu show a full mahjong keyboard in their key tests - is + this actually supported or is it vestigial? +- jxzh and kaimenhu bookkeeping menus do not clear the background. +- jxzh stops responding to inputs properly after winning a hand if + stripping sequences are enabled. +- jxzh last chance tiles are not visible. +- kaimenhu will not let you play a hand. +- Better understanding of the koftball protection. -- @@ -59,6 +64,30 @@ key-in unit 200 上分單位 key-in limit 5000 上分上限 credit limit 50000 得分上限 + +jxzh and kaimenhu use an unusual control scheme: +* use Start to draw a tile +* use Big (left) and Small (right) to select a tile to discard +* use Start to discard the selected tile +* use Big (left) and Small (right) to select a tile to exchange during "first chance" +* use Flip Flop to exchange a tile during "first chance" +* use Start to end "first chance" +* use Start to select a tile during "last chance" +* use Flip Flop to stake winnings on the double up game +* use Ron to take winnings +* kan, pon, chi, reach and ron function as expected + + +jxzh/kaimenhu test menu: + +pon input test 碰:按鍵測試 +kan graphics test 槓:圖型測試 +reach sound test 聽:音樂測試 +ron memory test 胡:記憶體測試 +chi DIP switch test 吃:DIP 測試 +big last hand test 大:前手牌 +test exit 離開 按《測試》 + */ #include "emu.h" @@ -131,7 +160,7 @@ private: u8 m_gfx_ctrl = 0; u8 m_priority = 0; u8 m_backpen = 0; - std::unique_ptr<bitmap_ind16> m_pixbitmap; + bitmap_ind16 m_pixbitmap; u8 m_pixpal = 0; void irq_ack_w(u8 data); @@ -151,6 +180,7 @@ private: TIMER_DEVICE_CALLBACK_MEMBER(interrupt); + void common_mem(address_map &map) ATTR_COLD; void koftball_mem(address_map &map) ATTR_COLD; void jxzh_mem(address_map &map) ATTR_COLD; void kaimenhu_mem(address_map &map) ATTR_COLD; @@ -195,7 +225,7 @@ void koftball_state::video_start() m_tilemap[1]->set_transparent_pen(0); m_tilemap[3]->set_transparent_pen(0); - m_pixbitmap = std::make_unique<bitmap_ind16>(512, 256); + m_pixbitmap.allocate(512, 256); } // linear 512x256x4bpp @@ -247,13 +277,13 @@ u32 koftball_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c girl select after coin up prev screen prev screen over under 0x13 0x3a */ - m_pixbitmap->fill(0, cliprect); - draw_pixlayer(*m_pixbitmap, cliprect); + m_pixbitmap.fill(0, cliprect); + draw_pixlayer(m_pixbitmap, cliprect); bitmap.fill(m_backpen, cliprect); if (BIT(m_priority, 3)) - copyscrollbitmap_trans(bitmap, *m_pixbitmap, 0, 0, 0, 0, cliprect, 0); + copyscrollbitmap_trans(bitmap, m_pixbitmap, 0, 0, 0, 0, cliprect, 0); // TODO: or bit 1? if (BIT(m_gfx_ctrl, 5)) @@ -268,7 +298,7 @@ u32 koftball_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c } if (!BIT(m_priority, 3)) - copyscrollbitmap_trans(bitmap, *m_pixbitmap, 0, 0, 0, 0, cliprect, 0); + copyscrollbitmap_trans(bitmap, m_pixbitmap, 0, 0, 0, 0, cliprect, 0); return 0; } @@ -342,28 +372,25 @@ void koftball_state::kaimenhu_outputs_w(u8 data) // bit 7 always set? } -// FIXME: merge video maps -void koftball_state::koftball_mem(address_map &map) +void koftball_state::common_mem(address_map &map) { - map(0x000000, 0x01ffff).rom(); - map(0x220000, 0x22ffff).ram().share(m_main_ram); - map(0x260000, 0x260fff).ram().w(FUNC(koftball_state::videoram_w<0>)).share(m_videoram[0]); map(0x261000, 0x261fff).ram().w(FUNC(koftball_state::videoram_w<1>)).share(m_videoram[1]); map(0x262000, 0x262fff).ram().w(FUNC(koftball_state::videoram_w<2>)).share(m_videoram[2]); map(0x263000, 0x263fff).ram().w(FUNC(koftball_state::videoram_w<3>)).share(m_videoram[3]); + map(0x268000, 0x26ffff).ram(); map(0x280000, 0x29ffff).ram().share(m_pixram); + map(0x2a0007, 0x2a0007).w(FUNC(koftball_state::irq_ack_w)); map(0x2a0009, 0x2a0009).lw8(NAME([this] (u8 data) { m_irq_enable = data; })); map(0x2a000f, 0x2a000f).lw8(NAME([this] (u8 data) { m_priority = data; LOGGFX("GFX ctrl $2a000f (priority) %02x\n", data); })); map(0x2a0017, 0x2a0017).w(FUNC(koftball_state::pixpal_w)); map(0x2a0019, 0x2a0019).lw8(NAME([this] (u8 data) { m_backpen = data; LOGGFX("GFX ctrl $2a0019 (backpen) %02x\n", data); })); - map(0x2a001a, 0x2a001b).nopw(); - map(0x2a0000, 0x2a001f).r(FUNC(koftball_state::random_number_r)); + map(0x2b0000, 0x2b0001).portr("DSW"); - map(0x2d8000, 0x2d8001).r(FUNC(koftball_state::random_number_r)); + map(0x2da000, 0x2da003).w("ymsnd", FUNC(ym2413_device::write)).umask16(0xff00); map(0x2db001, 0x2db001).w("ramdac", FUNC(ramdac_device::index_w)); @@ -372,45 +399,43 @@ void koftball_state::koftball_mem(address_map &map) map(0x2db005, 0x2db005).w("ramdac", FUNC(ramdac_device::mask_w)); map(0x2dc000, 0x2dc000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x2f0000, 0x2f0003).portr("INPUTS"); - map(0x300001, 0x300001).w(FUNC(koftball_state::koftball_outputs_w)); + + map(0x2f0000, 0x2f0001).portr("INPUTS"); + map(0x320000, 0x320000).lw8(NAME([this] (u8 data) { m_gfx_ctrl = data; LOGGFX("GFX ctrl $320000 (layer enable) %02x\n", data); })); +} + +void koftball_state::koftball_mem(address_map &map) +{ + common_mem(map); + + map(0x000000, 0x01ffff).rom(); + map(0x220000, 0x22ffff).ram().share(m_main_ram); + + map(0x2a001a, 0x2a001b).nopw(); + map(0x2a0000, 0x2a001f).r(FUNC(koftball_state::random_number_r)); + map(0x2d8000, 0x2d8001).r(FUNC(koftball_state::random_number_r)); + + map(0x300001, 0x300001).w(FUNC(koftball_state::koftball_outputs_w)); + map(0x340000, 0x340001).r(FUNC(koftball_state::prot_r)); map(0x360000, 0x360001).w(FUNC(koftball_state::prot_w)); } void koftball_state::jxzh_mem(address_map &map) { + common_mem(map); + map(0x000000, 0x03ffff).rom(); map(0x200000, 0x200fff).ram().share("nvram"); - map(0x260000, 0x260fff).ram().w(FUNC(koftball_state::videoram_w<0>)).share(m_videoram[0]); - map(0x261000, 0x261fff).ram().w(FUNC(koftball_state::videoram_w<1>)).share(m_videoram[1]); - map(0x262000, 0x262fff).ram().w(FUNC(koftball_state::videoram_w<2>)).share(m_videoram[2]); - map(0x263000, 0x263fff).ram().w(FUNC(koftball_state::videoram_w<3>)).share(m_videoram[3]); map(0x264b00, 0x264dff).ram(); // TODO: writes here at least at girl selection after coin up. Some kind of effect? - map(0x268000, 0x26ffff).ram(); - map(0x280000, 0x29ffff).ram().share(m_pixram); - map(0x2a0007, 0x2a0007).w(FUNC(koftball_state::irq_ack_w)); - map(0x2a0009, 0x2a0009).lw8(NAME([this] (u8 data) { m_irq_enable = data; })); - map(0x2a000f, 0x2a000f).lw8(NAME([this] (u8 data) { m_priority = data; LOGGFX("GFX ctrl $2a000f (priority) %02x\n", data); })); - map(0x2a0017, 0x2a0017).w(FUNC(koftball_state::pixpal_w)); - map(0x2a0019, 0x2a0019).lw8(NAME([this] (u8 data) { m_backpen = data; LOGGFX("GFX ctrl $2a0019 (backpen) %02x\n", data); })); map(0x2a001a, 0x2a001d).nopw(); map(0x2a0000, 0x2a001f).r(FUNC(koftball_state::random_number_r)); - map(0x2b0000, 0x2b0001).portr("DSW"); - map(0x2da000, 0x2da003).umask16(0xff00).w("ymsnd", FUNC(ym2413_device::write)); - - map(0x2db001, 0x2db001).w("ramdac", FUNC(ramdac_device::index_w)); - map(0x2db002, 0x2db003).nopr(); // reads here during some scene changes - map(0x2db003, 0x2db003).w("ramdac", FUNC(ramdac_device::pal_w)); - map(0x2db005, 0x2db005).w("ramdac", FUNC(ramdac_device::mask_w)); - map(0x2dc000, 0x2dc000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x2f0000, 0x2f0001).portr("INPUTS"); map(0x300001, 0x300001).w(FUNC(koftball_state::kaimenhu_outputs_w)); - map(0x320000, 0x320000).lw8(NAME([this] (u8 data) { m_gfx_ctrl = data; LOGGFX("GFX ctrl $320000 (layer enable) %02x\n", data); })); + map(0x340000, 0x340001).r(FUNC(koftball_state::prot_r)); map(0x360000, 0x360001).w(FUNC(koftball_state::prot_w)); map(0x380000, 0x380001).w(FUNC(koftball_state::prot_w)); @@ -509,16 +534,16 @@ static INPUT_PORTS_START( kaimenhu ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_NAME("%p Mahjong Ron / Take Score" ) // called take score (得分) in key test PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_NAME("%p Mahjong Small / Right") - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_NAME("%p Mahjong Big / Left") - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP) PORT_NAME("%p Mahjong Double Up / Change Tile") + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_NAME("%p Mahjong Small / Right") + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_NAME("%p Mahjong Big / Left") + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_NAME("%p Mahjong Flip Flop / Double Up" ) // called double up (比倍) in key test PORT_START("DSW") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR(Unknown) ) PORT_DIPLOCATION("SW1:8") @@ -580,6 +605,15 @@ static INPUT_PORTS_START( jxzh ) PORT_DIPSETTING( 0x0002, "1 2 4 8 12 16 24 32" ) PORT_DIPSETTING( 0x0001, "1 2 3 5 8 15 30 50" ) PORT_DIPSETTING( 0x0000, "1 2 3 5 10 25 50 100" ) + PORT_DIPNAME( 0x0040, 0x0040, "Last Chance Type" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPSETTING( 0x0040, "A" ) // choose three of ten tiles + PORT_DIPSETTING( 0x0000, "B" ) // deal ten tiles + PORT_DIPNAME( 0x0080, 0x0080, "Double Up Game" ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x0080, DEF_STR(Off) ) + PORT_DIPSETTING( 0x0000, DEF_STR(On) ) // also seems to enable stripping sequences + PORT_DIPNAME( 0x2000, 0x0000, "Gal Voice" ) PORT_DIPLOCATION("SW2:3") + PORT_DIPSETTING( 0x2000, DEF_STR(Off) ) + PORT_DIPSETTING( 0x0000, DEF_STR(On) ) // calls discarded tiles INPUT_PORTS_END diff --git a/src/mame/capcom/cps2.cpp b/src/mame/capcom/cps2.cpp index 44c61e0a4e4..f7d6e36bdce 100644 --- a/src/mame/capcom/cps2.cpp +++ b/src/mame/capcom/cps2.cpp @@ -12893,17 +12893,17 @@ GAME( 2000, mmatrixj, mmatrix, cps2, cps2_2p1b, cps2_state, init_cps2, RO // Games released on CPS-2 hardware by Mitchell -GAME( 2000, mpang, 0, cps2, cps2_2p1b, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Mighty! Pang (Europe 001010)", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, mpangr1, mpang, cps2, cps2_2p1b, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Mighty! Pang (Europe 000925)", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, mpangu, mpang, cps2, cps2_2p1b, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Mighty! Pang (USA 001010)", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, mpangj, mpang, cps2, cps2_2p1b, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Mighty! Pang (Japan 001011)", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, mpanga, mpang, cps2, cps2_2p1b, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Mighty! Pang (Asia 001010)", MACHINE_SUPPORTS_SAVE ) -GAME( 2001, pzloop2, 0, cps2, pzloop2, cps2_state, init_pzloop2, ROT0, "Mitchell (Capcom license)", "Puzz Loop 2 (Europe 010302)", MACHINE_SUPPORTS_SAVE ) -GAME( 2001, pzloop2j, pzloop2, cps2, pzloop2, cps2_state, init_pzloop2, ROT0, "Mitchell (Capcom license)", "Puzz Loop 2 (Japan 010226)", MACHINE_SUPPORTS_SAVE ) -GAME( 2001, pzloop2jr1, pzloop2, cps2, pzloop2, cps2_state, init_pzloop2, ROT0, "Mitchell (Capcom license)", "Puzz Loop 2 (Japan 010205)", MACHINE_SUPPORTS_SAVE ) -GAME( 2001, pzloop2jp, pzloop2, dead_cps2, pzloop2,cps2_state, init_pzloop2,ROT0, "Mitchell (Capcom license)", "Puzz Loop 2 (Japan 010201 Publicity)", MACHINE_SUPPORTS_SAVE ) -GAME( 2001, choko, 0, cps2, choko, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Janpai Puzzle Choukou (Japan 010820)", MACHINE_SUPPORTS_SAVE ) -GAME( 2001, chokop, 0, dead_cps2, choko,cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Janpai Puzzle Choukou (Japan 010820 Publicity)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, mpang, 0, cps2, cps2_2p1b, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Mighty! Pang (Europe 001010)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, mpangr1, mpang, cps2, cps2_2p1b, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Mighty! Pang (Europe 000925)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, mpangu, mpang, cps2, cps2_2p1b, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Mighty! Pang (USA 001010)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, mpangj, mpang, cps2, cps2_2p1b, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Mighty! Pang (Japan 001011)", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, mpanga, mpang, cps2, cps2_2p1b, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Mighty! Pang (Asia 001010)", MACHINE_SUPPORTS_SAVE ) +GAME( 2001, pzloop2, 0, cps2, pzloop2, cps2_state, init_pzloop2, ROT0, "Mitchell (Capcom license)", "Puzz Loop 2 (Europe 010302)", MACHINE_SUPPORTS_SAVE ) +GAME( 2001, pzloop2j, pzloop2, cps2, pzloop2, cps2_state, init_pzloop2, ROT0, "Mitchell (Capcom license)", "Puzz Loop 2 (Japan 010226)", MACHINE_SUPPORTS_SAVE ) +GAME( 2001, pzloop2jr1, pzloop2, cps2, pzloop2, cps2_state, init_pzloop2, ROT0, "Mitchell (Capcom license)", "Puzz Loop 2 (Japan 010205)", MACHINE_SUPPORTS_SAVE ) +GAME( 2001, pzloop2jp, pzloop2, dead_cps2, pzloop2, cps2_state, init_pzloop2, ROT0, "Mitchell (Capcom license)", "Puzz Loop 2 (Japan 010201 Publicity)", MACHINE_SUPPORTS_SAVE ) +GAME( 2001, choko, 0, cps2, choko, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Janpai Puzzle Choukou (Japan 010820)", MACHINE_SUPPORTS_SAVE ) +GAME( 2001, chokop, choko, dead_cps2, choko, cps2_state, init_cps2, ROT0, "Mitchell (Capcom license)", "Janpai Puzzle Choukou (Japan 010820 Publicity)", MACHINE_SUPPORTS_SAVE ) // Games released on CPS-2 hardware by Eighting/Raizing |