General cleanup of PGM code [David Haywood]

Removed ROM Patch in Killing Blade and replaced with correct IGS025 return sequence fo China region (other sequences still unknown) [XingXing]

 new not working 
 ---------------  
 Photo Y2K 2 [Guru]
This commit is contained in:
Angelo Salese 2010-05-12 14:05:56 +00:00
parent aaf9b40492
commit e1f1732dc4
5 changed files with 486 additions and 575 deletions

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,7 @@ public:
int kb_cmd;
int kb_reg;
int kb_ptr;
int kb_region_sequence_position;
UINT32 kb_regs[0x10];
UINT16 olds_bs, olds_cmd3;
// pstars
@ -80,7 +81,8 @@ void pgm_kov2_decrypt(running_machine *machine);
void pgm_kov2p_decrypt(running_machine *machine);
void pgm_mm_decrypt(running_machine *machine);
void pgm_dw2_decrypt(running_machine *machine);
void pgm_djlzz_decrypt(running_machine *machine);
void pgm_photoy2k_decrypt(running_machine *machine);
void pgm_py2k2_decrypt(running_machine *machine);
void pgm_dw3_decrypt(running_machine *machine);
void pgm_killbld_decrypt(running_machine *machine);
void pgm_pstar_decrypt(running_machine *machine);

View File

@ -149,7 +149,7 @@ void pgm_dw2_decrypt(running_machine *machine)
}
}
static const UINT8 djlzz_tab[256] = {
static const UINT8 photoy2k_tab[256] = {
0xd9, 0x92, 0xb2, 0xbc, 0xa5, 0x88, 0xe3, 0x48, 0x7d, 0xeb, 0xc5, 0x4d, 0x31, 0xe4, 0x82, 0xbc,
0x82, 0xcf, 0xe7, 0xf3, 0x15, 0xde, 0x8f, 0x91, 0xef, 0xc6, 0xb8, 0x81, 0x97, 0xe3, 0xdf, 0x4d,
0x88, 0xbf, 0xe4, 0x05, 0x25, 0x73, 0x1e, 0xd0, 0xcf, 0x1e, 0xeb, 0x4d, 0x18, 0x4e, 0x6f, 0x9f,
@ -168,7 +168,7 @@ static const UINT8 djlzz_tab[256] = {
0x92, 0x14, 0x23, 0xae, 0x4b, 0x80, 0xae, 0x6a, 0x56, 0x01, 0xac, 0x55, 0xf7, 0x6d, 0x9b, 0x6d,
};
void pgm_djlzz_decrypt(running_machine *machine)
void pgm_photoy2k_decrypt(running_machine *machine)
{
int i;
@ -203,7 +203,7 @@ void pgm_djlzz_decrypt(running_machine *machine)
if((i & 0x04820) == 0x04820)
x ^= 0x0080;
x ^= djlzz_tab[i & 0xff] << 8;
x ^= photoy2k_tab[i & 0xff] << 8;
src[i] = x;
}
@ -1003,3 +1003,65 @@ void pgm_dw2001_decrypt(running_machine *machine)
}
}
/* todo: */
static const UINT8 py2k2_tab[256] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
void pgm_py2k2_decrypt(running_machine *machine)
{
int i;
UINT16 *src = (UINT16 *) (memory_region(machine, "maincpu")+0x100000);
int rom_size = 0x400000;
for(i=0; i<rom_size/2; i++) {
UINT16 x = src[i];
/*
if((i & 0x40080) != 0x00080)
x ^= 0x0001;
if((i & 0x84008) == 0x84008)
x ^= 0x0002;
if((i & 0x00030) == 0x00010)
x ^= 0x0004;
if((i & 0x00242) != 0x00042)
x ^= 0x0008;
if((i & 0x48100) == 0x48000)
x ^= 0x0010;
if((i & 0x02004) != 0x00004)
x ^= 0x0020;
if((i & 0x01800) != 0x00000)
x ^= 0x0040;
if((i & 0x04820) == 0x04820)
x ^= 0x0080;
*/
x ^= py2k2_tab[i & 0xff] << 8;
src[i] = x;
}
}

View File

@ -8434,6 +8434,7 @@ Other Sun games
DRIVER( theglad ) /* (c) 2001 */
DRIVER( theglada ) /* (c) 2001 */
DRIVER( dw2001 ) /* (c) 2001 */
DRIVER( py2k2 ) /* (c) 2001 */
DRIVER( dmnfrnt ) /* (c) 2002 */
DRIVER( dmnfrnta ) /* (c) 2002 */
DRIVER( kovshp )

View File

@ -10,8 +10,8 @@
static void pgm_prepare_sprite( running_machine *machine, int wide, int high, int palt, int boffset )
{
pgm_state *state = (pgm_state *)machine->driver_data;
UINT8 *bdata = memory_region(machine, "gfx4");
size_t bdatasize = memory_region_length(machine, "gfx4") - 1;
UINT8 *bdata = memory_region(machine, "sprmask");
size_t bdatasize = memory_region_length(machine, "sprmask") - 1;
UINT8 *adata = state->sprite_a_region;
size_t adatasize = state->sprite_a_region_size - 1;
int xcnt, ycnt;