Skip to content

Commit

Permalink
Added dilith.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbbert committed Aug 15, 2024
1 parent 84194c5 commit 07e73fd
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/release/docs/hbnew.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

New Games
---------------------------------
- [dilith] Dilithium Lift
- [dkongjr01] Donkey Kong Junior (bugfixed)
- [kof94s40] Kof'94 (Team Edit Edition v1.4.0)
- [sf2ce59] Street Fighter II' (Golden Magic)
Expand Down
15 changes: 15 additions & 0 deletions src/hbmame/drivers/maketrax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,20 @@ ROM_START( deathstar2 ) // No text, no scores. From level 3, you need to use a 2
PACMAN_PROMS
ROM_END

ROM_START( dilith ) // freeplay
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "dilith.6e", 0x0000, 0x1000, CRC(9b955235) SHA1(be2287a344f86d9ec74489203dec21426bb6e051) )
ROM_LOAD( "dilith.6f", 0x1000, 0x1000, CRC(c4e6c1d8) SHA1(485aa91e2f69997ac1ed5cdc374977eb03bac32b) )
ROM_LOAD( "pollen.6h", 0x2000, 0x1000, CRC(04108eb0) SHA1(4773af22762b2da2f992867bee706325a999c2b0) )
ROM_LOAD_OPTIONAL( "100doors.6j", 0x3000, 0x1000, CRC(c71c0011) SHA1(1ceaf73df40e531df3bfb26b4fb7cd95fb7bff1d) ) // empty

ROM_REGION( 0x2000, "gfx1", 0 )
ROM_LOAD( "dilith.5e", 0x0000, 0x1000, CRC(db98f530) SHA1(420a9d7c2888867c13ce2f1d4d43091e0443922b) )
ROM_LOAD( "dilith.5f", 0x1000, 0x1000, CRC(081a59fc) SHA1(d363324e9b0a6bcfc2812dc747803088d0f15d3c) )

PACMAN_PROMS
ROM_END

ROM_START( eyes )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "eyes.7d", 0x0000, 0x1000, CRC(3b09ac89) SHA1(a8f1c918da74495bb73172f39364dada38ae4713) )
Expand Down Expand Up @@ -943,6 +957,7 @@ GAME( 2017, scroller, puckman, pacman, pacman0, puckman_state, empty_init,
GAME( 2019, snakes, puckman, pacman, pacman0, puckman_state, empty_init, ROT90, "Stefano Bodrato", "Snakes", MACHINE_SUPPORTS_SAVE )
GAME( 2021, 100doors, puckman, pacman, pacman0, puckman_state, empty_init, ROT90, "Hurray Banana", "100 doors", MACHINE_SUPPORTS_SAVE )
GAME( 2023, pollen, puckman, pacman, pacman0, puckman_state, empty_init, ROT90, "Arlasoft", "Pollen Angel", MACHINE_SUPPORTS_SAVE )
GAME( 2023, dilith, puckman, pacman, pacman0, puckman_state, empty_init, ROT90, "Arlasoft", "Dilithium Lift", MACHINE_SUPPORTS_SAVE )


/*************************************************************************************************************************/
Expand Down
83 changes: 83 additions & 0 deletions src/hbmame/drivers/mnw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24727,4 +24727,87 @@ ROM_END
// Corrupt characters (eg E in CREDIT)
GAME( 2000, nitd10, nitd, neogeo_noslot, neogeo, neogeo_state, init_cmc42sfix, ROT0, "hack", "Nightmare in the Dark (VF: NEO-ARC Traduction)" , MACHINE_SUPPORTS_SAVE )

// m72.cpp - fix for lohtb which eventually broke -------------- removed 2024-08-06 --------------

void init_lohtb(); // MAMEFX, unknown author who fixed lohtb
void loht_sample_trigger_w(offs_t offset, u16 data, u16 mem_mask = ~0);

// MAMEFX start, (c) unknown author who fixed lohtb, code added by Robbbert
// 2024-08-06 stopped compiling, found that it hasn't worked for a while, so no longer used.

static const u8 lohtb_code[CODE_LEN] =
{
0x68,0x00,0xa0, // push 0a000h
0x1f, // pop ds
0xc6,0x06,0x3c,0x38,0x47, // mov [383ch], byte 047h
0xc6,0x06,0x3d,0x38,0x47, // mov [383dh], byte 047h
0xc6,0x06,0x42,0x38,0x44, // mov [3842h], byte 044h
0xc6,0x06,0x43,0x38,0x44, // mov [3843h], byte 044h
0x68,0x00,0xb0, // push 0b000h
0x1f, // pop ds
0xc6,0x06,0x00,0x09,0x49^0xff, // mov [0900h], byte 049h
0xc6,0x06,0x00,0x0a,0x49^0xff, // mov [0a00h], byte 049h
0xc6,0x06,0x00,0x0b,0x49^0xff, // mov [0b00h], byte 049h
0x68,0x00,0xd0, // push 0d000h // Japan set only
0x1f, // pop ds // Japan set only
0xc6,0x06,0x70,0x16,0x57, // mov [1670h], byte 057h // Japan set only - checks this (W) of WARNING
0xea,0x5d,0x01,0x40,0x00 // jmp 0040:$015d
};

static const u8 loht_crc[CRC_LEN] = { 0x39, 0, 0x82, 0xae, 0x2c, 0x9d, 0x4b, 0x73, 0xfb, 0xac, 0xd4, 0x6d, 0x6d, 0x5b, 0x77, 0xc0, 0, 0 };

void m72_state::init_lohtb()
{
install_protection_handler(lohtb_code, loht_crc);

// this function removed by devs
m_maincpu->space(AS_IO).install_write_handler(0xc0, 0xc1, write16s_delegate(*this, FUNC(m72_state::loht_sample_trigger_w)));

/* since we skip the startup tests, clear video RAM to prevent garbage on title screen */
memset(m_videoram[1], 0, 0x4000);

u8 *rom = (u8 *)memregion("maincpu")->base();

// Hack the program rom to work for now
const u8 patch[216] = {
0xFA, 0xB9, 0xFF, 0xFF, 0xE2, 0xFE, 0xB8, 0x17, 0x00, 0xE7, 0x40, 0xB8, 0x20, 0x00, 0xE7, 0x42,
0xB8, 0x0F, 0x00, 0xE7, 0x42, 0xB8, 0x00, 0xA0, 0x8E, 0xD0, 0x8E, 0xD8, 0xBE, 0x00, 0x3F, 0xB0,
0x00, 0x88, 0x04, 0x3A, 0x04, 0x75, 0x08, 0x46, 0xFE, 0xC0, 0x75, 0xF5, 0xE9, 0x18, 0x00, 0x33,
0xF6, 0xE9, 0x03, 0x00, 0xBE, 0x40, 0x00, 0xB8, 0x00, 0xB0, 0x8E, 0xD8, 0xC7, 0x06, 0xFE, 0x0F,
0x00, 0x00, 0xEA, 0x62, 0x11, 0x00, 0x00, 0xE5, 0x04, 0x0F, 0x19, 0xC0, 0x0F, 0x74, 0xE0, 0xBC,
0x00, 0x40, 0x33, 0xDB, 0xB9, 0x00, 0x10, 0xB8, 0x00, 0xB0, 0x8E, 0xD8, 0x8A, 0xC3, 0x02, 0xC7,
0x88, 0x07, 0x43, 0xE2, 0xF7, 0x33, 0xC9, 0xFE, 0xC9, 0x75, 0xFC, 0xFE, 0xCD, 0x75, 0xF8, 0x33,
0xDB, 0xB9, 0x00, 0x10, 0x8A, 0xC3, 0x02, 0xC7, 0x34, 0xFF, 0x3A, 0x07, 0x75, 0xB6, 0x43, 0xE2,
0xF3, 0x33, 0xDB, 0xB9, 0xFC, 0x0F, 0xFE, 0x07, 0x43, 0xE2, 0xFB, 0x90, 0x90, 0x90, 0x9A, 0x00,
0x00, 0x00, 0xB0, 0x73, 0xF6, 0x90, 0x90, 0x90, 0xB8, 0x00, 0xB0, 0x8E, 0xC0, 0x33, 0xD2, 0x42,
0x81, 0xE2, 0x01, 0x00, 0xBF, 0xB2, 0x04, 0xE8, 0x7B, 0x00, 0xE8, 0x3E, 0x00, 0xEB, 0xF0, 0x90,
0x90, 0x90, 0x0B, 0x38, 0x29, 0x43, 0x4F, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x31,
0x39, 0x38, 0x39, 0x20, 0x49, 0x52, 0x45, 0x4D, 0x20, 0x43, 0x4F, 0x52, 0x50, 0x4F, 0x52, 0x41,
0x54, 0x49, 0x4F, 0x4E, 0x0B, 0x50, 0x2B, 0x41
};
memcpy(rom + 0x000400, patch, 216);

const int patch2[62][2] = {
{ 0x0003FC, 0x88 }, { 0x0003FD, 0x05 }, { 0x000B42, 0x1E }, { 0x000B43, 0x06 }, { 0x000B44, 0xB8 },
{ 0x00405B, 0x05 }, { 0x004066, 0x05 }, { 0x0103DA, 0xB0 }, { 0x0103DD, 0xFE }, { 0x0103DE, 0x06 },
{ 0x0103DF, 0xFE }, { 0x0103E0, 0x0F }, { 0x0103E1, 0xE5 }, { 0x0103E2, 0x02 }, { 0x0103E3, 0xA9 },
{ 0x0103E4, 0x20 }, { 0x0103E5, 0x00 }, { 0x0103E6, 0x75 }, { 0x0103E7, 0x05 }, { 0x0103E8, 0xEA },
{ 0x0103E9, 0x2F }, { 0x0103EA, 0x04 }, { 0x0103EB, 0x00 }, { 0x0103EC, 0x00 }, { 0x0103ED, 0xB8 },
{ 0x010459, 0xE7 }, { 0x01045A, 0x04 }, { 0x01045B, 0xE5 }, { 0x01045C, 0x02 }, { 0x01045D, 0x25 },
{ 0x01045E, 0x80 }, { 0x01045F, 0x00 }, { 0x010460, 0x74 }, { 0x010461, 0xF9 }, { 0x010462, 0x36 },
{ 0x010463, 0xA1 }, { 0x010464, 0xB2 }, { 0x010465, 0x23 }, { 0x010466, 0xE7 }, { 0x010467, 0x82 },
{ 0x010468, 0x36 }, { 0x010469, 0xA1 }, { 0x01046A, 0xB6 }, { 0x01046B, 0x23 }, { 0x01046C, 0xE7 },
{ 0x0104B4, 0x32 }, { 0x0104B5, 0xE4 }, { 0x0104B6, 0x3C }, { 0x0104B7, 0x7F }, { 0x0104B8, 0x72 },
{ 0x010577, 0x47 }, { 0x010578, 0xDC }, { 0x010585, 0x61 }, { 0x010586, 0x07 }, { 0x010587, 0x1F },
{ 0x010599, 0x00 }, { 0x010793, 0xE7 }, { 0x010794, 0x02 }, { 0x01E1C0, 0xBA }, { 0x01EA29, 0xE7 },
{ 0x01EA2A, 0x02 }, { -1, -1 }
};
for (int i = 0; patch2[i][0] >= 0; i++)
rom[patch2[i][0]] = patch2[i][1];
}

//GAME( 1989, lohtb, loht, lohtb, loht, m72_state, init_lohtb, ROT0, "Playmark", "Legend of Hero Tonma (Playmark unprotected bootleg)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
// MAMEFX end
//GAME( 1989, lohtb, loht, lohtb, loht, m72_state, empty_init, ROT0, "bootleg (Playmark)", "Legend of Hero Tonma (Playmark unprotected bootleg)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )


1 change: 1 addition & 0 deletions src/hbmame/hbmame.lst
Original file line number Diff line number Diff line change
Expand Up @@ -4266,6 +4266,7 @@ crashh /* HB - PacMAME Hacks */
deathstar // HB
deathstar2 // HB
dderby /* HB - Widel Games */
dilith
eyesb
ghohunt // HB - Hurray Banana
kangaroh /* HB - Widel Games */
Expand Down

0 comments on commit 07e73fd

Please sign in to comment.