Use real prom dumps for Popeye Bootleg protection [Joe Magiera, recreativas.org, smf]

This commit is contained in:
smf- 2019-08-24 10:06:39 +01:00
parent 361a83d823
commit fee25e4380
2 changed files with 30 additions and 8 deletions

View File

@ -151,6 +151,12 @@ void tnx1_state::decrypt_rom()
void popeyebl_state::decrypt_rom()
{
uint8_t* rom = memregion("blprot")->base();
for (int i = 0; i < 0x80; i++)
{
rom[i + 0x00] ^= 0xf; // opcodes
rom[i + 0x80] ^= 0x3; // data
}
}
void tpp2_state::decrypt_rom()
@ -254,11 +260,11 @@ WRITE8_MEMBER(tnx1_state::protection_w)
void tnx1_state::maincpu_program_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0x87ff).ram();
map(0x0000, 0x7fff).rom().region("maincpu",0);
map(0x8000, 0x87ff).ram().share("ramlow");
map(0x8800, 0x8bff).nopw(); // Attempts to initialize this area with 00 on boot
map(0x8c00, 0x8e7f).ram().share("dmasource");
map(0x8e80, 0x8fff).ram();
map(0x8e80, 0x8fff).ram().share("ramhigh");
map(0xa000, 0xa3ff).w(FUNC(tnx1_state::popeye_videoram_w)).share("videoram");
map(0xa400, 0xa7ff).w(FUNC(tnx1_state::popeye_colorram_w)).share("colorram");
map(0xc000, 0xcfff).w(FUNC(tnx1_state::background_w));
@ -269,7 +275,7 @@ void tpp2_state::maincpu_program_map(address_map &map)
{
tpp1_state::maincpu_program_map(map);
map(0x8000, 0x87ff).unmaprw(); // 7f (unpopulated)
map(0x8800, 0x8bff).ram(); // 7h
map(0x8800, 0x8bff).ram().share("ramlow"); // 7h
map(0xc000, 0xdfff).w(FUNC(tpp2_state::background_w));
}
@ -280,6 +286,12 @@ void tpp2_noalu_state::maincpu_program_map(address_map &map)
}
void popeyebl_state::maincpu_program_map(address_map &map)
{
tnx1_state::maincpu_program_map(map);
map(0xe000, 0xe01f).rom().region("blprot", 0x80);
}
void popeyebl_state::decrypted_opcodes_map(address_map& map)
{
tnx1_state::maincpu_program_map(map);
map(0xe000, 0xe01f).rom().region("blprot", 0);
@ -639,6 +651,13 @@ void tpp2_state::config(machine_config &config)
NETLIST_STREAM_OUTPUT(config, "snd_nl:cout0", 0, "ROUT.1").set_mult_offset(30000.0, -65000.0);
}
void popeyebl_state::config(machine_config& config)
{
tpp1_state::config(config);
m_maincpu->set_addrmap(AS_OPCODES, &popeyebl_state::decrypted_opcodes_map);
}
/***************************************************************************
@ -799,8 +818,8 @@ ROM_START( popeyebl )
ROM_LOAD_NIB_HIGH( "4.2s.24s10", 0x0000, 0x0100, CRC(cab9bc53) SHA1(e63ba8856190187996e405f6fcee254c8ca6e81f) ) /* sprite palette - high 4 bits */
ROM_REGION( 0x0100, "blprot", 0 )
ROM_LOAD_NIB_LOW( "1.1d.24s10", 0x0000, 0x0100, BAD_DUMP CRC(bb63b2a6) SHA1(0201cf37161b9b0cbf48f1d1248afee91276eb2a) )
ROM_LOAD_NIB_HIGH( "2.1e.24s10", 0x0000, 0x0100, BAD_DUMP CRC(29d7bd87) SHA1(0f139a7c1c747cc0bd99792851c5c46c01142e62) )
ROM_LOAD_NIB_LOW( "1.1d.24s10", 0x0000, 0x0100, CRC(2e1b143a) SHA1(7e0fd19328ccd6f2b2148739ef64703ade585060) )
ROM_LOAD_NIB_HIGH( "2.1e.24s10", 0x0000, 0x0100, CRC(978b1c63) SHA1(ae67a4ac554e84c970c0acc82f4bc6a490f9d6ef) )
ROM_REGION(0x0100, "timing", 0)
ROM_LOAD( "7.11s.24s10", 0x0000, 0x0100, CRC(1c5c8dea) SHA1(5738303b2a9c79b7d06bcf20fdb4d9b29f6e2d96) ) /* video timing prom */
@ -832,8 +851,8 @@ ROM_START( popeyeb2 )
ROM_LOAD_NIB_HIGH( "popeye.pr4", 0x0000, 0x0100, CRC(cab9bc53) SHA1(e63ba8856190187996e405f6fcee254c8ca6e81f) ) /* sprite palette - high 4 bits */
ROM_REGION( 0x0100, "blprot", 0 )
ROM_LOAD_NIB_LOW( "popeye.d1", 0x0000, 0x0100, BAD_DUMP CRC(bb63b2a6) SHA1(0201cf37161b9b0cbf48f1d1248afee91276eb2a) )
ROM_LOAD_NIB_HIGH( "popeye.e1", 0x0000, 0x0100, BAD_DUMP CRC(29d7bd87) SHA1(0f139a7c1c747cc0bd99792851c5c46c01142e62) )
ROM_LOAD_NIB_LOW( "popeye.d1", 0x0000, 0x0100, CRC(2e1b143a) SHA1(7e0fd19328ccd6f2b2148739ef64703ade585060) )
ROM_LOAD_NIB_HIGH( "popeye.e1", 0x0000, 0x0100, CRC(978b1c63) SHA1(ae67a4ac554e84c970c0acc82f4bc6a490f9d6ef) )
ROM_END
ROM_START( popeyeb3 )

View File

@ -104,9 +104,12 @@ protected:
class popeyebl_state : public tpp1_state
{
using tpp1_state::tpp1_state;
public:
virtual void config(machine_config& config) override;
protected:
virtual void decrypt_rom() override;
virtual void maincpu_program_map(address_map &map) override;
void decrypted_opcodes_map(address_map& map);
virtual bool bootleg_sprites() const override { return true; }
};