Skip to content

Commit

Permalink
k054000.cpp: fix OTG hitboxes in Vendetta (#8454)
Browse files Browse the repository at this point in the history
* k054000.cpp: fixes MT 06393, MT 07839;

* k054000.cpp: convert access to address map;

* Convert all drivers using k054000 to access with address map, fix gaiapols and bucky ranges;

* vendetta.cpp: fix overdriven sound (noticeable on first boss);

* tmnt.cpp: fix Thunder Cross II overdriven sound;

* k054000.cpp: initialize variables at machine_reset time;

* k054000.cpp: move collision dump to a debug compile switch;

* tmnt.cpp: make thndrx2 to bypass protection checks via ROM patch, acknowledge it with 14D bad, demote it to MUP, describe rationale;

* k054000.cpp: srcclean;
  • Loading branch information
angelosa committed Dec 10, 2021
1 parent a1d6697 commit 4d1fdd2
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 71 deletions.
2 changes: 1 addition & 1 deletion src/mame/drivers/lethal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ void lethal_state::bank4000_map(address_map &map)
{
// VRD = 0 or 1, CBNK = 0
map(0x0840, 0x084f).mirror(0x8000).rw(m_k053244, FUNC(k05324x_device::k053244_r), FUNC(k05324x_device::k053244_w));
map(0x0880, 0x089f).mirror(0x8000).rw("k054000", FUNC(k054000_device::read), FUNC(k054000_device::write));
map(0x0880, 0x089f).mirror(0x8000).m("k054000", FUNC(k054000_device::map));
map(0x08c0, 0x08cf).m(m_k054321, FUNC(k054321_device::main_map));
map(0x1000, 0x17ff).mirror(0x8000).rw(m_k053244, FUNC(k05324x_device::k053245_r), FUNC(k05324x_device::k053245_w));

Expand Down
2 changes: 1 addition & 1 deletion src/mame/drivers/moo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ void moo_state::bucky_map(address_map &map)
map(0x0cc000, 0x0cc01f).w(m_k053251, FUNC(k053251_device::write)).umask16(0x00ff);
map(0x0ce000, 0x0ce01f).w(FUNC(moo_state::moo_prot_w));
map(0x0d0000, 0x0d001f).rw(m_k053252, FUNC(k053252_device::read), FUNC(k053252_device::write)).umask16(0x00ff); /* CCU regs (ignored) */
map(0x0d2000, 0x0d20ff).rw("k054000", FUNC(k054000_device::read), FUNC(k054000_device::write)).umask16(0x00ff);
map(0x0d2000, 0x0d203f).m("k054000", FUNC(k054000_device::map)).umask16(0x00ff);
map(0x0d4000, 0x0d4001).w(FUNC(moo_state::sound_irq_w));
map(0x0d6000, 0x0d601f).m(m_k054321, FUNC(k054321_device::main_map)).umask16(0x00ff);
map(0x0d8000, 0x0d8007).w(m_k056832, FUNC(k056832_device::b_word_w)); /* VSCCS regs */
Expand Down
2 changes: 1 addition & 1 deletion src/mame/drivers/mystwarr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ void mystwarr_state::gaiapols_map(address_map &map)
map(0x48e000, 0x48e001).portr("IN0_P1"); // bit 3 (0x8) is test switch
map(0x48e020, 0x48e021).r(FUNC(mystwarr_state::dddeeprom_r));
map(0x600000, 0x60ffff).ram().share("gx_workram");
map(0x660000, 0x6600ff).rw("k054000", FUNC(k054000_device::read), FUNC(k054000_device::write)).umask16(0x00ff);
map(0x660000, 0x66003f).m("k054000", FUNC(k054000_device::map)).umask16(0x00ff);
map(0x6a0000, 0x6a0001).w(FUNC(mystwarr_state::mmeeprom_w));
map(0x6c0000, 0x6c0001).w(FUNC(mystwarr_state::ddd_053936_enable_w));
map(0x6e0000, 0x6e0001).w(FUNC(mystwarr_state::sound_irq_w));
Expand Down
28 changes: 19 additions & 9 deletions src/mame/drivers/tmnt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ void tmnt_state::blswhstl_main_map(address_map &map)
map(0x204000, 0x207fff).ram(); /* main RAM */
map(0x300000, 0x303fff).rw(FUNC(tmnt_state::k053245_scattered_word_r), FUNC(tmnt_state::k053245_scattered_word_w)).share("spriteram");
map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0x500000, 0x50003f).rw(m_k054000, FUNC(k054000_device::read), FUNC(k054000_device::write)).umask16(0x00ff);
map(0x500000, 0x50003f).m(m_k054000, FUNC(k054000_device::map)).umask16(0x00ff);
map(0x680000, 0x68001f).rw(FUNC(tmnt_state::k053244_word_noA1_r), FUNC(tmnt_state::k053244_word_noA1_w));
map(0x700000, 0x700001).portr("P1");
map(0x700002, 0x700003).portr("P2");
Expand Down Expand Up @@ -982,7 +982,7 @@ void tmnt_state::thndrx2_main_map(address_map &map)
map(0x200000, 0x200fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0x300000, 0x30001f).w(m_k053251, FUNC(k053251_device::write)).umask16(0x00ff);
map(0x400000, 0x400003).rw(m_k053260, FUNC(k053260_device::main_read), FUNC(k053260_device::main_write)).umask16(0x00ff);
map(0x500000, 0x50003f).rw(m_k054000, FUNC(k054000_device::read), FUNC(k054000_device::write)).umask16(0x00ff);
map(0x500000, 0x50003f).m(m_k054000, FUNC(k054000_device::map)).umask16(0x00ff);
map(0x500100, 0x500101).w(FUNC(tmnt_state::thndrx2_eeprom_w));
map(0x500200, 0x500201).portr("P1_COINS");
map(0x500202, 0x500203).r(FUNC(tmnt_state::thndrx2_eeprom_r));
Expand Down Expand Up @@ -2587,18 +2587,18 @@ void tmnt_state::thndrx2(machine_config &config)
m_k051960->set_sprite_callback(FUNC(tmnt_state::thndrx2_sprite_callback));

K053251(config, m_k053251, 0);

K054000(config, m_k054000, 0);

/* sound hardware */
// NB: game defaults in mono
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();

YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 1.0).add_route(1, "rspeaker", 1.0);
YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 0.25).add_route(1, "rspeaker", 0.25);

K053260(config, m_k053260, XTAL(3'579'545));
m_k053260->add_route(0, "lspeaker", 0.75);
m_k053260->add_route(1, "rspeaker", 0.75);
m_k053260->add_route(0, "lspeaker", 0.50);
m_k053260->add_route(1, "rspeaker", 0.50);
}


Expand Down Expand Up @@ -4297,6 +4297,16 @@ void tmnt_state::init_cuebrick()
save_item(NAME(m_cuebrick_nvram));
}

void tmnt_state::init_thndrx2()
{
u16 *ROM = (u16 *)memregion("maincpu")->base();

// cfr. notes in k054000 device
// this makes 11C / 12C to return bad (for ROM checksum)
// but goes on instead of halting for 14D (the protection chip device)
ROM[0x16c0 / 2] = 0x4e71;
}

// YEAR NAME PARENT MACHINE INPUT STATE INIT MONITOR COMPANY FULLNAME,FLAGS
GAME( 1989, cuebrick, 0, cuebrick, cuebrick, tmnt_state, init_cuebrick,ROT0, "Konami", "Cue Brick (World, version D)", MACHINE_SUPPORTS_SAVE )

Expand Down Expand Up @@ -4361,9 +4371,9 @@ GAME( 1991, ssridersjbd, ssriders, ssriders, ssriders, tmnt_state, empty_init,
GAME( 1991, ssridersb, ssriders, sunsetbl, sunsetbl, tmnt_state, empty_init, ROT0, "bootleg", "Sunset Riders (bootleg 4 Players ver ADD)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1991, ssriders2, ssriders, sunsetbl, sunsetbl, tmnt_state, empty_init, ROT0, "bootleg", "Sunset Riders 2 (bootleg 4 Players ver ADD)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )

GAME( 1991, thndrx2, 0, thndrx2, thndrx2, tmnt_state, empty_init, ROT0, "Konami", "Thunder Cross II (World)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, thndrx2a, thndrx2, thndrx2, thndrx2, tmnt_state, empty_init, ROT0, "Konami", "Thunder Cross II (Asia)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, thndrx2j, thndrx2, thndrx2, thndrx2, tmnt_state, empty_init, ROT0, "Konami", "Thunder Cross II (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, thndrx2, 0, thndrx2, thndrx2, tmnt_state, init_thndrx2, ROT0, "Konami", "Thunder Cross II (World)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) // Fails k054000 unit tests, cfr. driver_init & device
GAME( 1991, thndrx2a, thndrx2, thndrx2, thndrx2, tmnt_state, init_thndrx2, ROT0, "Konami", "Thunder Cross II (Asia)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) // ^
GAME( 1991, thndrx2j, thndrx2, thndrx2, thndrx2, tmnt_state, init_thndrx2, ROT0, "Konami", "Thunder Cross II (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_UNEMULATED_PROTECTION ) // ^

GAME( 1993, prmrsocr, 0, prmrsocr, prmrsocr, prmrsocr_state, empty_init, ROT0, "Konami", "Premier Soccer (ver EAB)", MACHINE_SUPPORTS_SAVE )
GAME( 1993, prmrsocrj, prmrsocr, prmrsocr, prmrsocr, prmrsocr_state, empty_init, ROT0, "Konami", "Premier Soccer (ver JAB)", MACHINE_SUPPORTS_SAVE )
5 changes: 2 additions & 3 deletions src/mame/drivers/vendetta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void vendetta_state::main_map(address_map &map)
map(0x4000, 0x4fff).view(m_videoview0);
m_videoview0[0](0x4000, 0x4fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write));
m_videoview0[1](0x4000, 0x4fff).rw(m_k053246, FUNC(k053247_device::k053247_r), FUNC(k053247_device::k053247_w));
map(0x5f80, 0x5f9f).rw(m_k054000, FUNC(k054000_device::read), FUNC(k054000_device::write));
map(0x5f80, 0x5f9f).m(m_k054000, FUNC(k054000_device::map));
map(0x5fa0, 0x5faf).w(m_k053251, FUNC(k053251_device::write));
map(0x5fb0, 0x5fb7).w(m_k053246, FUNC(k053247_device::k053246_w));
map(0x5fc0, 0x5fc0).portr("P1");
Expand Down Expand Up @@ -457,14 +457,13 @@ void vendetta_state::vendetta(machine_config &config)
m_k053246->set_palette(m_palette);

K053251(config, m_k053251, 0);

K054000(config, m_k054000, 0);

/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();

YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 1.0).add_route(1, "rspeaker", 1.0); /* verified with PCB */
YM2151(config, "ymsnd", XTAL(3'579'545)).add_route(0, "lspeaker", 0.5).add_route(1, "rspeaker", 0.5); /* verified with PCB */

k053260_device &k053260(K053260(config, "k053260", XTAL(3'579'545))); /* verified with PCB */
k053260.add_route(0, "lspeaker", 0.75);
Expand Down
1 change: 1 addition & 0 deletions src/mame/includes/tmnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class tmnt_state : public driver_device
void init_mia();
void init_tmnt();
void init_cuebrick();
void init_thndrx2();

protected:
virtual void machine_start() override;
Expand Down
Loading

0 comments on commit 4d1fdd2

Please sign in to comment.