This hooks-up the preliminary decryption code for Tarzan, I'd guess that

isn't complete?

-----Messaggio originale-----
Da: David Haywood [mailto:neohaze@nildram.co.uk] 
Inviato: venerdi 9 gennaio 2009 9.42
A: Angelo Salese
Oggetto: tarzan

I don't think the decryption is complete.. the graphics are also 
encrypted.. so don't decode properly.

i guess sar might need to take a 2nd look at it.
This commit is contained in:
Aaron Giles 2009-01-14 06:02:23 +00:00
parent 81fce8af37
commit 45ba56b76f

View File

@ -1,74 +1,16 @@
/* Old IGS game called Tarzan, don't know much about it, could be gambling */ /* Old IGS game called Tarzan, don't know much about it, could be gambling */
/* CPU might not be z80 */ /* CPU might not be z80 (maybe z180)
decryption is incomplete?, first part of code doesn't seem right?
graphics area also encrypted
*/
#include "driver.h" #include "driver.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#if 0
static UINT16 *file1_data;
static int file1_size;
static UINT16 *result_data;
static int decrypt_tarzan()
{
int fd;
int i;
char msg[512];
if(argc != 3) {
fprintf(stderr, "Usage:\n%s <file1.bin> <result.bin>\n", argv[0]);
exit(1);
}
sprintf(msg, "Open %s", argv[1]);
fd = open(argv[1], O_RDONLY);
if(fd<0) {
perror(msg);
exit(2);
}
file1_size = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
file1_data = malloc_or_die(file1_size);
read(fd, file1_data, file1_size);
close(fd);
result_data = malloc_or_die(file1_size);
for(i=0; i<file1_size/2; i++) {
UINT16 x = file1_data[i];
if((i & 0x10c0) == 0x0000)
x ^= 0x0001;
if((i & 0x0010) == 0x0010 || (i & 0x0130) == 0x0020)
x ^= 0x0404;
if((i & 0x00d0) != 0x0010)
x ^= 0x1010;
if(((i & 0x0008) == 0x0008)^((i & 0x10c0) == 0x0000))
x ^= 0x0100;
result_data[i] = x;
}
sprintf(msg, "Open %s", argv[2]);
fd = open(argv[2], O_RDWR|O_CREAT|O_TRUNC, 0666);
if(fd<0) {
perror(msg);
exit(2);
}
write(fd, result_data, file1_size);
close(fd);
return 0;
}
#endif
static VIDEO_START(tarzan) static VIDEO_START(tarzan)
{ {
@ -89,6 +31,26 @@ static INPUT_PORTS_START( tarzan )
INPUT_PORTS_END INPUT_PORTS_END
static const gfx_layout tarzan_layout =
{
8,8,
RGN_FRAC(1,1),
4,
{ 0*8,1*8,2*8,3*8 },
{ 0,1,2,3,4,5,6,7 },
{ 0*8, 4*8, 8*8,12*8,16*8,20*8,24*8,28*8},
32*8
};
static GFXDECODE_START( tarzan )
GFXDECODE_ENTRY( "gfx1", 0, tarzan_layout, 0x0, 2 )
GFXDECODE_ENTRY( "gfx2", 0, tarzan_layout, 0x0, 2 )
GFXDECODE_END
static MACHINE_DRIVER_START( tarzan ) static MACHINE_DRIVER_START( tarzan )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("main", Z80,8000000) /* ? */ MDRV_CPU_ADD("main", Z80,8000000) /* ? */
@ -103,24 +65,63 @@ static MACHINE_DRIVER_START( tarzan )
MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1) MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
MDRV_PALETTE_LENGTH(0x100) MDRV_PALETTE_LENGTH(0x100)
MDRV_GFXDECODE(tarzan)
MDRV_VIDEO_START(tarzan) MDRV_VIDEO_START(tarzan)
MDRV_VIDEO_UPDATE(tarzan) MDRV_VIDEO_UPDATE(tarzan)
MACHINE_DRIVER_END MACHINE_DRIVER_END
DRIVER_INIT( tarzan )
{
UINT16* ROM = (UINT16*)memory_region(machine,"main");
int i;
int size = 0x040000;
for(i=0; i<size/2; i++)
{
UINT16 x = ROM[i];
if((i & 0x10c0) == 0x0000)
x ^= 0x0001;
if((i & 0x0010) == 0x0010 || (i & 0x0130) == 0x0020)
x ^= 0x0404;
if((i & 0x00d0) != 0x0010)
x ^= 0x1010;
if(((i & 0x0008) == 0x0008)^((i & 0x10c0) == 0x0000))
x ^= 0x0100;
ROM[i] = x;
}
#if 0
{
FILE *fp;
char filename[256];
sprintf(filename,"decrypted_%s", machine->gamedrv->name);
fp=fopen(filename, "w+b");
if (fp)
{
fwrite(ROM, 0x40000, 1, fp);
fclose(fp);
}
}
#endif
}
ROM_START( tarzan ) ROM_START( tarzan )
ROM_REGION( 0x040000, "main", 0 ) ROM_REGION( 0x040000, "main", 0 )
ROM_LOAD( "0228-u16.bin", 0x00000, 0x040000, CRC(e6c552a5) SHA1(f156de9459833474c85a1f5b35917881b390d34c) ) ROM_LOAD( "0228-u16.bin", 0x00000, 0x040000, CRC(e6c552a5) SHA1(f156de9459833474c85a1f5b35917881b390d34c) )
ROM_REGION( 0x080000, "user1", 0 ) ROM_REGION( 0x080000, "gfx1", 0 )
ROM_LOAD( "0228-u21.bin", 0x00000, 0x080000, CRC(80aaece4) SHA1(07cad92492c5de36c3915867ed4c6544b1a30c07) ) ROM_LOAD( "0228-u21.bin", 0x00000, 0x080000, CRC(80aaece4) SHA1(07cad92492c5de36c3915867ed4c6544b1a30c07) )
ROM_REGION( 0x080000, "user2", 0 ) ROM_REGION( 0x080000, "gfx2", 0 )
ROM_LOAD( "0228-u6.bin", 0x00000, 0x080000, CRC(55e94832) SHA1(b15409f4f1264b6d1218d5dc51c5bd1de2e40284) ) ROM_LOAD( "0228-u6.bin", 0x00000, 0x080000, CRC(55e94832) SHA1(b15409f4f1264b6d1218d5dc51c5bd1de2e40284) )
ROM_END ROM_END
GAME( 199?, tarzan, 0, tarzan, tarzan, 0, ROT0, "IGS", "Tarzan",GAME_NOT_WORKING|GAME_NO_SOUND ) GAME( 199?, tarzan, 0, tarzan, tarzan, tarzan, ROT0, "IGS", "Tarzan",GAME_NOT_WORKING|GAME_NO_SOUND )