Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions src/mame/seibu/legionna.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,7 @@ ROM_START( heatbrl )
ROM_REGION( 0x200, "proms", 0 ) /* Priority */
ROM_LOAD( "heat07.u0910", 0x000000, 0x000200, CRC(265eccc8) SHA1(cf650c69f97b887251b5079e5518497721692af3) ) /* N82S147N type BPROM */

ROM_REGION( 0x080000, "user1", 0 ) /* SEI300 data rom */
ROM_REGION( 0x080000, "copx", 0 ) /* SEI300 data rom */
ROM_LOAD( "copx-d2.u0339", 0x000000, 0x080000, CRC(7c52581b) SHA1(7e668476f886806b0c06fa0bcf4bbc955878c87c) ) /* not dumped from this PCB assumed to be the same */
ROM_END

Expand Down Expand Up @@ -1739,7 +1739,7 @@ ROM_START( heatbrl2 )
ROM_REGION( 0x200, "proms", 0 ) /* Priority */
ROM_LOAD( "heat07.u0910", 0x000000, 0x000200, CRC(265eccc8) SHA1(cf650c69f97b887251b5079e5518497721692af3) ) /* N82S147N type BPROM */

ROM_REGION( 0x080000, "user1", 0 ) /* SEI300 data rom */
ROM_REGION( 0x080000, "copx", 0 ) /* SEI300 data rom */
ROM_LOAD( "copx-d2.u0339", 0x000000, 0x080000, CRC(7c52581b) SHA1(7e668476f886806b0c06fa0bcf4bbc955878c87c) ) /* not dumped from this PCB assumed to be the same */
ROM_END

Expand Down Expand Up @@ -1778,7 +1778,7 @@ ROM_START( heatbrl3 ) // only the maincpu and audiocpu ROMs were provided for th
ROM_REGION( 0x200, "proms", 0 ) /* Priority */
ROM_LOAD( "heat07.u0910", 0x000000, 0x000200, CRC(265eccc8) SHA1(cf650c69f97b887251b5079e5518497721692af3) ) /* N82S147N type BPROM */

ROM_REGION( 0x080000, "user1", 0 ) /* SEI300 data rom */
ROM_REGION( 0x080000, "copx", 0 ) /* SEI300 data rom */
ROM_LOAD( "copx-d2.u0339", 0x000000, 0x080000, CRC(7c52581b) SHA1(7e668476f886806b0c06fa0bcf4bbc955878c87c) ) /* not dumped from this PCB assumed to be the same */
ROM_END

Expand Down Expand Up @@ -1822,7 +1822,7 @@ barrel1,2,3,4.BG */
ROM_REGION( 0x200, "proms", 0 ) /* Priority */
ROM_LOAD( "heat07.u0910", 0x000000, 0x000200, CRC(265eccc8) SHA1(cf650c69f97b887251b5079e5518497721692af3) ) /* N82S147N type BPROM */

ROM_REGION( 0x080000, "user1", 0 ) /* SEI300 data rom */
ROM_REGION( 0x080000, "copx", 0 ) /* SEI300 data rom */
ROM_LOAD( "copx-d2.u0339", 0x000000, 0x080000, CRC(7c52581b) SHA1(7e668476f886806b0c06fa0bcf4bbc955878c87c) ) /* not dumped from this PCB assumed to be the same */
ROM_END

Expand Down Expand Up @@ -1861,7 +1861,7 @@ ROM_START( heatbrlu )
ROM_REGION( 0x200, "proms", 0 ) /* Priority */
ROM_LOAD( "heat07.u0910", 0x000000, 0x000200, CRC(265eccc8) SHA1(cf650c69f97b887251b5079e5518497721692af3) ) /* N82S147N type BPROM */

ROM_REGION( 0x080000, "user1", 0 ) /* SEI300 data rom */
ROM_REGION( 0x080000, "copx", 0 ) /* SEI300 data rom */
ROM_LOAD( "copx-d2.u0339", 0x000000, 0x080000, CRC(7c52581b) SHA1(7e668476f886806b0c06fa0bcf4bbc955878c87c) ) /* not dumped from this PCB assumed to be the same */
ROM_END

Expand Down Expand Up @@ -1904,7 +1904,7 @@ ROM_START( heatbrle )
ROM_REGION( 0x200, "proms", 0 ) /* Priority */
ROM_LOAD( "heat07.u0910", 0x000000, 0x000200, CRC(265eccc8) SHA1(cf650c69f97b887251b5079e5518497721692af3) ) /* N82S147N type BPROM */

ROM_REGION( 0x080000, "user1", 0 ) /* SEI300 data rom */
ROM_REGION( 0x080000, "copx", 0 ) /* SEI300 data rom */
ROM_LOAD( "copx-d2.u0339", 0x000000, 0x080000, CRC(7c52581b) SHA1(7e668476f886806b0c06fa0bcf4bbc955878c87c) ) /* not dumped from this PCB assumed to be the same */
ROM_END

Expand Down Expand Up @@ -1993,7 +1993,7 @@ ROM_START( godzilla )
ROM_REGION( 0x200, "proms", 0 )
ROM_LOAD( "s68e08.844", 0x000000, 0x000200, CRC(96f7646e) SHA1(400a831b83d6ac4d2a46ef95b97b1ee237099e44) ) /* Priority */

ROM_REGION( 0x080000, "user1", 0 )
ROM_REGION( 0x080000, "copx", 0 )
ROM_LOAD( "copx-d2.313", 0x000000, 0x080000, CRC(7c52581b) SHA1(7e668476f886806b0c06fa0bcf4bbc955878c87c) )
ROM_END

Expand Down Expand Up @@ -2042,7 +2042,7 @@ ROM_START( denjinmk )
ROM_REGION( 0x200, "proms", 0 )
ROM_LOAD( "s68e08.844", 0x000000, 0x000200, CRC(96f7646e) SHA1(400a831b83d6ac4d2a46ef95b97b1ee237099e44) ) /* Priority */

ROM_REGION( 0x080000, "user1", 0 )
ROM_REGION( 0x080000, "copx", 0 )
ROM_LOAD( "copx-d2.313", 0x000000, 0x080000, CRC(7c52581b) SHA1(7e668476f886806b0c06fa0bcf4bbc955878c87c) )
ROM_END

Expand Down Expand Up @@ -2157,7 +2157,7 @@ ROM_START( denjinmka )
ROM_REGION( 0x200, "proms", 0 )
ROM_LOAD( "s68e08.844", 0x000000, 0x000200, CRC(96f7646e) SHA1(400a831b83d6ac4d2a46ef95b97b1ee237099e44) ) /* Priority */

ROM_REGION( 0x080000, "user1", 0 )
ROM_REGION( 0x080000, "copx", 0 )
ROM_LOAD( "copx-d2.313", 0x000000, 0x080000, CRC(7c52581b) SHA1(7e668476f886806b0c06fa0bcf4bbc955878c87c) )
ROM_END

Expand Down Expand Up @@ -2308,7 +2308,7 @@ ROM_START( cupsoc )
ROM_REGION( 0x040000, "oki", 0 ) /* ADPCM samples */
ROM_LOAD( "seibu8.7a", 0x000000, 0x040000, CRC(6f594808) SHA1(218aa12068aa587c7656355f6a6b86d97c868774) )

ROM_REGION( 0x080000, "user1", 0 )
ROM_REGION( 0x080000, "copx", 0 )
ROM_LOAD( "copx-d1.bin", 0x000000, 0x080000, CRC(029bc402) SHA1(0f64e4c32d95abfa3920b39ed3cf0cc6eb50191b) )

ROM_REGION( 0x200, "proms", 0 )
Expand Down Expand Up @@ -2343,7 +2343,7 @@ ROM_START( cupsoca )
ROM_REGION( 0x040000, "oki", 0 ) /* ADPCM samples */
ROM_LOAD( "seibu8.7a", 0x000000, 0x040000, CRC(6f594808) SHA1(218aa12068aa587c7656355f6a6b86d97c868774) )

ROM_REGION( 0x080000, "user1", 0 )
ROM_REGION( 0x080000, "copx", 0 )
ROM_LOAD( "copx-d1.bin", 0x000000, 0x080000, CRC(029bc402) SHA1(0f64e4c32d95abfa3920b39ed3cf0cc6eb50191b) )

ROM_REGION( 0x200, "proms", 0 )
Expand Down Expand Up @@ -2378,7 +2378,7 @@ ROM_START( cupsocb )
ROM_REGION( 0x040000, "oki", 0 ) /* ADPCM samples */
ROM_LOAD( "seibu8.7a", 0x000000, 0x040000, CRC(6f594808) SHA1(218aa12068aa587c7656355f6a6b86d97c868774) )

ROM_REGION( 0x080000, "user1", 0 )
ROM_REGION( 0x080000, "copx", 0 )
ROM_LOAD( "copx-d1.bin", 0x000000, 0x080000, CRC(029bc402) SHA1(0f64e4c32d95abfa3920b39ed3cf0cc6eb50191b) )

ROM_REGION( 0x200, "proms", 0 )
Expand Down Expand Up @@ -2413,7 +2413,7 @@ ROM_START( cupsocs )
ROM_REGION( 0x040000, "oki", 0 ) /* ADPCM samples */
ROM_LOAD( "8_7a.bin", 0x000000, 0x040000, CRC(6f594808) SHA1(218aa12068aa587c7656355f6a6b86d97c868774) )

ROM_REGION( 0x080000, "user1", 0 )
ROM_REGION( 0x080000, "copx", 0 )
ROM_LOAD( "copx-d1.bin", 0x000000, 0x080000, CRC(029bc402) SHA1(0f64e4c32d95abfa3920b39ed3cf0cc6eb50191b) )

ROM_REGION( 0x200, "proms", 0 )
Expand Down Expand Up @@ -2450,7 +2450,7 @@ ROM_START( cupsocs2 )
ROM_REGION( 0x040000, "oki", 0 ) /* ADPCM samples */
ROM_LOAD( "seibu8.7a", 0x000000, 0x040000, CRC(6f594808) SHA1(218aa12068aa587c7656355f6a6b86d97c868774) )

ROM_REGION( 0x080000, "user1", 0 )
ROM_REGION( 0x080000, "copx", 0 )
ROM_LOAD( "copx-d1.bin", 0x000000, 0x080000, CRC(029bc402) SHA1(0f64e4c32d95abfa3920b39ed3cf0cc6eb50191b) )

ROM_REGION( 0x200, "proms", 0 )
Expand Down Expand Up @@ -2485,7 +2485,7 @@ ROM_START( olysoc92 )
ROM_REGION( 0x040000, "oki", 0 ) /* ADPCM samples */
ROM_LOAD( "seibu8.7a", 0x000000, 0x040000, CRC(6f594808) SHA1(218aa12068aa587c7656355f6a6b86d97c868774) )

ROM_REGION( 0x080000, "user1", 0 )
ROM_REGION( 0x080000, "copx", 0 )
ROM_LOAD( "copx-d1.bin", 0x000000, 0x080000, CRC(029bc402) SHA1(0f64e4c32d95abfa3920b39ed3cf0cc6eb50191b) )

ROM_REGION( 0x200, "proms", 0 )
Expand Down Expand Up @@ -2520,7 +2520,7 @@ ROM_START( olysoc92a )
ROM_REGION( 0x040000, "oki", 0 ) /* ADPCM samples */
ROM_LOAD( "seibu8.7a", 0x000000, 0x040000, CRC(6f594808) SHA1(218aa12068aa587c7656355f6a6b86d97c868774) )

ROM_REGION( 0x080000, "user1", 0 )
ROM_REGION( 0x080000, "copx", 0 )
ROM_LOAD( "copx-d1.bin", 0x000000, 0x080000, CRC(029bc402) SHA1(0f64e4c32d95abfa3920b39ed3cf0cc6eb50191b) )

ROM_REGION( 0x200, "proms", 0 )
Expand Down Expand Up @@ -2556,7 +2556,7 @@ ROM_START( olysoc92b )
ROM_REGION( 0x040000, "oki", 0 ) /* ADPCM samples */
ROM_LOAD( "8", 0x000000, 0x040000, CRC(6f594808) SHA1(218aa12068aa587c7656355f6a6b86d97c868774) )

ROM_REGION( 0x080000, "user1", 0 )
ROM_REGION( 0x080000, "copx", 0 )
ROM_LOAD( "copx-d1.bin", 0x000000, 0x080000, CRC(029bc402) SHA1(0f64e4c32d95abfa3920b39ed3cf0cc6eb50191b) )

ROM_REGION( 0x200, "proms", 0 )
Expand Down
41 changes: 19 additions & 22 deletions src/mame/seibu/r2crypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
/* Raiden 2 Sprite Decryption */

#include "emu.h"
#include "raiden2.h"
#include "seibuspi_m.h"
#include "seibu_helper.h"


/*
Expand Down Expand Up @@ -193,12 +192,12 @@ static const uint16_t x11_zt[512] = {

static uint16_t gm(int i4)
{
uint16_t x=0;
uint16_t x = 0;

for (int i=0; i<4; ++i)
for (int i = 0; i < 4; ++i)
{
if (BIT(i4,i))
x ^= 0xf << (i<<2);
if (BIT(i4, i))
x ^= 0xf << (i << 2);
}

return x;
Expand All @@ -207,24 +206,23 @@ static uint16_t gm(int i4)
static uint32_t core_decrypt(uint32_t ciphertext, int i1, int i2, int i3, int i4,
const uint8_t *rotate, const uint8_t *x5, const uint16_t *x11, uint32_t preXor, uint32_t carryMask, uint32_t postXor)
{
uint32_t v1 = bitswap<32>(rotl_32(ciphertext, rotate[i1]), 25,28,15,19, 6,0,3,24, 11,1,2,30, 16,7,22,17, 31,14,23,9, 27,18,4,10, 13,20,5,12, 8,29,26,21);
const uint32_t v1 = bitswap<32>(rotl_32(ciphertext, rotate[i1]), 25,28,15,19, 6,0,3,24, 11,1,2,30, 16,7,22,17, 31,14,23,9, 27,18,4,10, 13,20,5,12, 8,29,26,21);

uint16_t x1Low = (x5[i2]<<11) ^ x11[i3] ^ gm(i4);
uint32_t x1 = x1Low | (bitswap<16>(x1Low, 0,8,1,9, 2,10,3,11, 4,12,5,13, 6,14,7,15)<<16);
const uint16_t x1Low = (x5[i2]<<11) ^ x11[i3] ^ gm(i4);
const uint32_t x1 = x1Low | (bitswap<16>(x1Low, 0,8,1,9, 2,10,3,11, 4,12,5,13, 6,14,7,15)<<16);

return partial_carry_sum32(v1, x1^preXor, carryMask) ^ postXor;
return partial_carry_sum32(v1, x1 ^ preXor, carryMask) ^ postXor;
}

void raiden2_decrypt_sprites(running_machine &machine)
void raiden2_decrypt_sprites(uint32_t *data, uint32_t size)
{
uint32_t *data = (uint32_t *)machine.root_device().memregion("gfx3")->base();
for(int i=0; i<0x800000/4; i++)
for (uint32_t i = 0; i < size; i++)
{
data[i] = core_decrypt(data[i],
(i&0xff) ^ BIT(i,15) ^ (BIT(i,20)<<8),
(i&0xff) ^ BIT(i,15),
(i>>8) & 0xff,
(i>>16) & 0xf,
(i & 0xff) ^ BIT(i, 15) ^ (BIT(i, 20) << 8),
(i & 0xff) ^ BIT(i, 15),
(i >> 8) & 0xff,
(i >> 16) & 0xf,
rotate_r2,
x5_r2,
x11_r2,
Expand All @@ -235,16 +233,15 @@ void raiden2_decrypt_sprites(running_machine &machine)
}
}

void zeroteam_decrypt_sprites(running_machine &machine)
void zeroteam_decrypt_sprites(uint32_t *data, uint32_t size)
{
uint32_t *data = (uint32_t *)machine.root_device().memregion("gfx3")->base();
for(int i=0; i<0x400000/4; i++)
for (uint32_t i = 0; i < size; i++)
{
data[i] = core_decrypt(data[i],
i & 0xff,
i & 0xff,
(i>>7) & 0x1ff,
(i>>16) & 0xf,
(i >> 7) & 0x1ff,
(i >> 16) & 0xf,
rotate_zt,
x5_zt,
x11_zt,
Expand Down
6 changes: 2 additions & 4 deletions src/mame/seibu/r2crypt.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// license:LGPL-2.1+
// copyright-holders:Olivier Galibert, Angelo Salese, David Haywood, Tomasz Slanina

#include "seibuspi_m.h"

void raiden2_decrypt_sprites(running_machine &machine);
void zeroteam_decrypt_sprites(running_machine &machine);
void raiden2_decrypt_sprites(uint32_t *data, uint32_t size);
void zeroteam_decrypt_sprites(uint32_t *data, uint32_t size);
Loading
Loading