📄 dkong.c
字号:
4,
dkong3_sound2_readmem,dkong3_sound2_writemem,0,0,
nmi_interrupt,1
}
},
60, DEFAULT_60HZ_VBLANK_DURATION, /* frames per second, vblank duration */
1, /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
0,
/* video hardware */
32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
dkong3_gfxdecodeinfo,
256, 64*4,
dkong3_vh_convert_color_prom,
VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
0,
dkong_vh_start,
generic_vh_stop,
dkong_vh_screenrefresh,
/* sound hardware */
0,0,0,0,
{
{
SOUND_NES,
&nes_interface
},
{
SOUND_DAC,
&dkong3_dac_interface
}
}
};
/***************************************************************************
Game driver(s)
***************************************************************************/
ROM_START( radarscp_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "trs2c5fc", 0x0000, 0x1000, 0x40949e0d )
ROM_LOAD( "trs2c5gc", 0x1000, 0x1000, 0xafa8c49f )
ROM_LOAD( "trs2c5hc", 0x2000, 0x1000, 0x51b8263d )
ROM_LOAD( "trs2c5kc", 0x3000, 0x1000, 0x1f0101f7 )
/* space for diagnostic ROM */
ROM_REGION_DISPOSE(0x3000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "trs2v3gc", 0x0000, 0x0800, 0xf095330e )
ROM_LOAD( "trs2v3hc", 0x0800, 0x0800, 0x15a316f0 )
ROM_LOAD( "trs2v3dc", 0x1000, 0x0800, 0xe0bb0db9 )
ROM_LOAD( "trs2v3cc", 0x1800, 0x0800, 0x6c4e7dad )
ROM_LOAD( "trs2v3bc", 0x2000, 0x0800, 0x6fdd63f1 )
ROM_LOAD( "trs2v3ac", 0x2800, 0x0800, 0xb7ad0ba7 )
ROM_REGION(0x0300) /* color/lookup proms */
ROM_LOAD( "rs2-x.xxx", 0x0000, 0x0100, 0x54609d61 ) /* palette low 4 bits (inverted) */
ROM_LOAD( "rs2-c.xxx", 0x0100, 0x0100, 0x79a7d831 ) /* palette high 4 bits (inverted) */
ROM_LOAD( "rs2-v.1hc", 0x0200, 0x0100, 0x1b828315 ) /* character color codes on a per-column basis */
ROM_REGION(0x1000) /* sound */
ROM_LOAD( "trs2s3i", 0x0000, 0x0800, 0x78034f14 ) /* ??? */
ROM_LOAD( "trs2v3ec", 0x0800, 0x0800, 0x0eca8d6b ) /* ??? */
ROM_END
static void radarscp_unprotect(void)
{
unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
/* Radarscope does some checks with bit 6 of 7d00 which prevent it from working. */
/* It's probably a copy protection. We comment it out. */
RAM[0x1e9c] = 0xc3;
RAM[0x1e9d] = 0xbd;
}
ROM_START( dkong_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "dk.5e", 0x0000, 0x1000, 0xba70b88b )
ROM_LOAD( "dk.5c", 0x1000, 0x1000, 0x5ec461ec )
ROM_LOAD( "dk.5b", 0x2000, 0x1000, 0x1c97d324 )
ROM_LOAD( "dk.5a", 0x3000, 0x1000, 0xb9005ac0 )
/* space for diagnostic ROM */
ROM_REGION_DISPOSE(0x3000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "dk.3n", 0x0000, 0x0800, 0x12c8c95d )
ROM_LOAD( "dk.3p", 0x0800, 0x0800, 0x15e9c5e9 )
ROM_LOAD( "dk.7c", 0x1000, 0x0800, 0x59f8054d )
ROM_LOAD( "dk.7d", 0x1800, 0x0800, 0x672e4714 )
ROM_LOAD( "dk.7e", 0x2000, 0x0800, 0xfeaa59ee )
ROM_LOAD( "dk.7f", 0x2800, 0x0800, 0x20f2ef7e )
ROM_REGION(0x300) /* color/lookup proms */
ROM_LOAD( "dkong.2k", 0x0000, 0x0100, 0x1e82d375 ) /* palette low 4 bits (inverted) */
ROM_LOAD( "dkong.2j", 0x0100, 0x0100, 0x2ab01dc8 ) /* palette high 4 bits (inverted) */
ROM_LOAD( "dkong.5f", 0x0200, 0x0100, 0x44988665 ) /* character color codes on a per-column basis */
ROM_REGION(0x1000) /* sound */
ROM_LOAD( "dk.3h", 0x0000, 0x0800, 0x45a4ed06 )
ROM_LOAD( "dk.3f", 0x0800, 0x0800, 0x4743fe92 )
ROM_END
ROM_START( dkongjp_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "5f.cpu", 0x0000, 0x1000, 0x424f2b11 )
ROM_LOAD( "5g.cpu", 0x1000, 0x1000, 0xd326599b )
ROM_LOAD( "5h.cpu", 0x2000, 0x1000, 0xff31ac89 )
ROM_LOAD( "5k.cpu", 0x3000, 0x1000, 0x394d6007 )
ROM_REGION_DISPOSE(0x3000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "dk.3n", 0x0000, 0x0800, 0x12c8c95d )
ROM_LOAD( "5k.vid", 0x0800, 0x0800, 0x3684f914 )
ROM_LOAD( "dk.7c", 0x1000, 0x0800, 0x59f8054d )
ROM_LOAD( "dk.7d", 0x1800, 0x0800, 0x672e4714 )
ROM_LOAD( "dk.7e", 0x2000, 0x0800, 0xfeaa59ee )
ROM_LOAD( "dk.7f", 0x2800, 0x0800, 0x20f2ef7e )
ROM_REGION(0x0300) /* color/lookup proms */
ROM_LOAD( "dkong.2k", 0x0000, 0x0100, 0x1e82d375 ) /* palette low 4 bits (inverted) */
ROM_LOAD( "dkong.2j", 0x0100, 0x0100, 0x2ab01dc8 ) /* palette high 4 bits (inverted) */
ROM_LOAD( "dkong.5f", 0x0200, 0x0100, 0x44988665 ) /* character color codes on a per-column basis */
ROM_REGION(0x1000) /* sound */
ROM_LOAD( "dk.3h", 0x0000, 0x0800, 0x45a4ed06 )
ROM_LOAD( "dk.3f", 0x0800, 0x0800, 0x4743fe92 )
ROM_END
ROM_START( dkongjr_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "dkj.5b", 0x0000, 0x1000, 0xdea28158 )
ROM_CONTINUE( 0x3000, 0x1000 )
ROM_LOAD( "dkj.5c", 0x2000, 0x0800, 0x6fb5faf6 )
ROM_CONTINUE( 0x4800, 0x0800 )
ROM_CONTINUE( 0x1000, 0x0800 )
ROM_CONTINUE( 0x5800, 0x0800 )
ROM_LOAD( "dkj.5e", 0x4000, 0x0800, 0xd042b6a8 )
ROM_CONTINUE( 0x2800, 0x0800 )
ROM_CONTINUE( 0x5000, 0x0800 )
ROM_CONTINUE( 0x1800, 0x0800 )
ROM_REGION_DISPOSE(0x4000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "dkj.3n", 0x0000, 0x1000, 0x8d51aca9 )
ROM_LOAD( "dkj.3p", 0x1000, 0x1000, 0x4ef64ba5 )
ROM_LOAD( "dkj.7c", 0x2000, 0x0800, 0xdc7f4164 )
ROM_LOAD( "dkj.7d", 0x2800, 0x0800, 0x0ce7dcf6 )
ROM_LOAD( "dkj.7e", 0x3000, 0x0800, 0x24d1ff17 )
ROM_LOAD( "dkj.7f", 0x3800, 0x0800, 0x0f8c083f )
ROM_REGION(0x0300) /* color PROMs */
ROM_LOAD( "dkjrprom.2e", 0x0000, 0x0100, 0x463dc7ad ) /* palette low 4 bits (inverted) */
ROM_LOAD( "dkjrprom.2f", 0x0100, 0x0100, 0x47ba0042 ) /* palette high 4 bits (inverted) */
ROM_LOAD( "dkjrprom.2n", 0x0200, 0x0100, 0xdbf185bf ) /* character color codes on a per-column basis */
ROM_REGION(0x1000) /* sound? */
ROM_LOAD( "dkj.3h", 0x0000, 0x1000, 0x715da5f8 )
ROM_END
ROM_START( dkngjrjp_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "dkjr1", 0x0000, 0x1000, 0xec7e097f )
ROM_CONTINUE( 0x3000, 0x1000 )
ROM_LOAD( "dkjr2", 0x2000, 0x0800, 0xc0a18f0d )
ROM_CONTINUE( 0x4800, 0x0800 )
ROM_CONTINUE( 0x1000, 0x0800 )
ROM_CONTINUE( 0x5800, 0x0800 )
ROM_LOAD( "dkjr3", 0x4000, 0x0800, 0xa81dd00c )
ROM_CONTINUE( 0x2800, 0x0800 )
ROM_CONTINUE( 0x5000, 0x0800 )
ROM_CONTINUE( 0x1800, 0x0800 )
ROM_REGION_DISPOSE(0x6000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "dkjr9", 0x0000, 0x1000, 0xa95c4c63 )
ROM_LOAD( "dkjr10", 0x1000, 0x1000, 0xadc11322 )
ROM_LOAD( "dkj.7c", 0x2000, 0x0800, 0xdc7f4164 )
ROM_LOAD( "dkj.7d", 0x2800, 0x0800, 0x0ce7dcf6 )
ROM_LOAD( "dkj.7e", 0x3000, 0x0800, 0x24d1ff17 )
ROM_LOAD( "dkj.7f", 0x3800, 0x0800, 0x0f8c083f )
ROM_REGION(0x0300) /* color PROMs */
ROM_LOAD( "dkjrprom.2e", 0x0000, 0x0100, 0x463dc7ad ) /* palette low 4 bits (inverted) */
ROM_LOAD( "dkjrprom.2f", 0x0100, 0x0100, 0x47ba0042 ) /* palette high 4 bits (inverted) */
ROM_LOAD( "dkjrprom.2n", 0x0200, 0x0100, 0xdbf185bf ) /* character color codes on a per-column basis */
ROM_REGION(0x1000) /* sound? */
ROM_LOAD( "dkj.3h", 0x0000, 0x1000, 0x715da5f8 )
ROM_END
ROM_START( dkjrjp_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "dkjp.5b", 0x0000, 0x1000, 0x7b48870b )
ROM_CONTINUE( 0x3000, 0x1000 )
ROM_LOAD( "dkjp.5c", 0x2000, 0x0800, 0x12391665 )
ROM_CONTINUE( 0x4800, 0x0800 )
ROM_CONTINUE( 0x1000, 0x0800 )
ROM_CONTINUE( 0x5800, 0x0800 )
ROM_LOAD( "dkjp.5e", 0x4000, 0x0800, 0x6c9f9103 )
ROM_CONTINUE( 0x2800, 0x0800 )
ROM_CONTINUE( 0x5000, 0x0800 )
ROM_CONTINUE( 0x1800, 0x0800 )
ROM_REGION_DISPOSE(0x4000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "dkj.3n", 0x0000, 0x1000, 0x8d51aca9 )
ROM_LOAD( "dkj.3p", 0x1000, 0x1000, 0x4ef64ba5 )
ROM_LOAD( "dkj.7c", 0x2000, 0x0800, 0xdc7f4164 )
ROM_LOAD( "dkj.7d", 0x2800, 0x0800, 0x0ce7dcf6 )
ROM_LOAD( "dkj.7e", 0x3000, 0x0800, 0x24d1ff17 )
ROM_LOAD( "dkj.7f", 0x3800, 0x0800, 0x0f8c083f )
ROM_REGION(0x0300) /* color PROMs */
ROM_LOAD( "dkjrprom.2e", 0x0000, 0x0100, 0x463dc7ad ) /* palette low 4 bits (inverted) */
ROM_LOAD( "dkjrprom.2f", 0x0100, 0x0100, 0x47ba0042 ) /* palette high 4 bits (inverted) */
ROM_LOAD( "dkjrprom.2n", 0x0200, 0x0100, 0xdbf185bf ) /* character color codes on a per-column basis */
ROM_REGION(0x1000) /* sound? */
ROM_LOAD( "dkj.3h", 0x0000, 0x1000, 0x715da5f8 )
ROM_END
ROM_START( dkjrbl_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "djr1-c.5b", 0x0000, 0x1000, 0xffe9e1a5 )
ROM_CONTINUE( 0x3000, 0x1000 )
ROM_LOAD( "djr1-c.5c", 0x2000, 0x0800, 0x982e30e8 )
ROM_CONTINUE( 0x4800, 0x0800 )
ROM_CONTINUE( 0x1000, 0x0800 )
ROM_CONTINUE( 0x5800, 0x0800 )
ROM_LOAD( "djr1-c.5e", 0x4000, 0x0800, 0x24c3d325 )
ROM_CONTINUE( 0x2800, 0x0800 )
ROM_CONTINUE( 0x5000, 0x0800 )
ROM_CONTINUE( 0x1800, 0x0800 )
ROM_LOAD( "djr1-c.5a", 0x8000, 0x1000, 0xbb5f5180 )
ROM_REGION_DISPOSE(0x4000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "dkj.3n", 0x0000, 0x1000, 0x8d51aca9 )
ROM_LOAD( "dkj.3p", 0x1000, 0x1000, 0x4ef64ba5 )
ROM_LOAD( "dkj.7c", 0x2000, 0x0800, 0xdc7f4164 )
ROM_LOAD( "dkj.7d", 0x2800, 0x0800, 0x0ce7dcf6 )
ROM_LOAD( "dkj.7e", 0x3000, 0x0800, 0x24d1ff17 )
ROM_LOAD( "dkj.7f", 0x3800, 0x0800, 0x0f8c083f )
ROM_REGION(0x0300) /* color PROMs */
ROM_LOAD( "dkjrprom.2e", 0x0000, 0x0100, 0x463dc7ad ) /* palette low 4 bits (inverted) */
ROM_LOAD( "dkjrprom.2f", 0x0100, 0x0100, 0x47ba0042 ) /* palette high 4 bits (inverted) */
ROM_LOAD( "dkjrprom.2n", 0x0200, 0x0100, 0xdbf185bf ) /* character color codes on a per-column basis */
ROM_REGION(0x1000) /* sound? */
ROM_LOAD( "dkj.3h", 0x0000, 0x1000, 0x715da5f8 )
ROM_END
ROM_START( dkong3_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "dk3c.7b", 0x0000, 0x2000, 0x38d5f38e )
ROM_LOAD( "dk3c.7c", 0x2000, 0x2000, 0xc9134379 )
ROM_LOAD( "dk3c.7d", 0x4000, 0x2000, 0xd22e2921 )
ROM_LOAD( "dk3c.7e", 0x8000, 0x2000, 0x615f14b7 )
ROM_REGION_DISPOSE(0x6000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "dk3v.3n", 0x0000, 0x1000, 0x415a99c7 )
ROM_LOAD( "dk3v.3p", 0x1000, 0x1000, 0x25744ea0 )
ROM_LOAD( "dk3v.7c", 0x2000, 0x1000, 0x8ffa1737 )
ROM_LOAD( "dk3v.7d", 0x3000, 0x1000, 0x9ac84686 )
ROM_LOAD( "dk3v.7e", 0x4000, 0x1000, 0x0c0af3fb )
ROM_LOAD( "dk3v.7f", 0x5000, 0x1000, 0x55c58662 )
ROM_REGION(0x0300) /* color proms */
ROM_LOAD( "dkc1-c.1d", 0x0000, 0x0200, 0xdf54befc ) /* palette red & green component */
ROM_LOAD( "dkc1-c.1c", 0x0100, 0x0200, 0x66a77f40 ) /* palette blue component */
ROM_LOAD( "dkc1-v.2n", 0x0200, 0x0100, 0x50e33434 ) /* character color codes on a per-column basis */
ROM_REGION(0x10000) /* sound #1 */
ROM_LOAD( "dk3c.5l", 0xe000, 0x2000, 0x7ff88885 )
ROM_REGION(0x10000) /* sound #2 */
ROM_LOAD( "dk3c.6h", 0xe000, 0x2000, 0x36d7200c )
ROM_END
ROM_START( hunchy_rom )
ROM_REGION(0x10000) /* 64k for code */
/* the following is all wrong. Hunchback runs on a modified Donkey */
/* Kong Jr. board, but with a twist: it uses a Signetics 2650 CPU */
/* The chip is chip labeled MAB2650A CRG3243MOY. */
/* The db also has various 74LS chips and a couple proms (soldered), */
/* and a VERY strange looking flat chip. */
ROM_LOAD( "1b.bin", 0x0000, 0x1000, 0x0 )
ROM_LOAD( "2a.bin", 0x1000, 0x1000, 0x0 )
ROM_LOAD( "3a.bin", 0x2000, 0x1000, 0x0 )
ROM_LOAD( "4c.bin", 0x3000, 0x1000, 0x0 )
ROM_LOAD( "5a.bin", 0x4000, 0x1000, 0x0 )
ROM_LOAD( "6c.bin", 0x5000, 0x1000, 0x0 )
ROM_LOAD( "8a.bin", 0x8000, 0x0800, 0x0 )
ROM_REGION_DISPOSE(0x4000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "11a.bin", 0x0000, 0x0800, 0x0 )
ROM_LOAD( "9b.bin", 0x0800, 0x0800, 0x0 )
/* 1000-17ff empty */
ROM_LOAD( "10b.bin", 0x1800, 0x0800, 0x0 )
/* 2000-3fff empty */
ROM_REGION(0x10000) /* 64k for the audio CPU */
ROM_LOAD( "5b_snd.bin", 0x0000, 0x0800, 0x0 )
ROM_END
ROM_START( herocast_rom )
ROM_REGION(0x10000) /* 64k for code */
/* the loading addresses are most likely wrong */
/* the ROMs are probably not conriguous. */
/* For example there's a table which suddenly stops at */
/* 1dff and resumes at 3e00 */
ROM_LOAD( "red-dot.rgt", 0x0000, 0x2000, 0x9c4af229 ) /* encrypted */
ROM_LOAD( "wht-dot.lft", 0x2000, 0x2000, 0xc10f9235 ) /* encrypted */
/* space for diagnostic ROM */
ROM_LOAD( "2532.3f", 0x4000, 0x1000, 0x553b89bb ) /* ??? contains unencrypted */
/* code mapped at 3000 */
ROM_REGION_DISPOSE(0x3000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "pnk.3n", 0x0000, 0x0800, 0x574dfd7a )
ROM_LOAD( "blk.3p", 0x0800, 0x0800, 0x16f7c040 )
ROM_LOAD( "gold.7c", 0x1000, 0x0800, 0x5f5282ed )
ROM_LOAD( "orange.7d", 0x1800, 0x0800, 0x075d99f5 )
ROM_LOAD( "yellow.7e", 0x2000, 0x0800, 0xf6272e96 )
ROM_LOAD( "violet.7f", 0x2800, 0x0800, 0xca020685 )
ROM_REGION(0x300) /* color/lookup proms */
ROM_LOAD( "82s126.2e", 0x0000, 0x0100, 0x463dc7ad ) /* palette low 4 bits (inverted) */
ROM_LOAD( "82s126.2f", 0x0100, 0x0100, 0x47ba0042 ) /* palette high 4 bits (inverted) */
ROM_LOAD( "82s126.2n", 0x0200, 0x0100, 0x37aece4b ) /* character color codes on a per-column basis */
ROM_REGION(0x1000) /* sound */
ROM_LOAD( "silver.3h", 0x0000, 0x0800, 0x67863ce9 )
ROM_END
static void herocast_decode(void)
{
int A;
unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
/* swap data lines D3 and D4, this fixes the text but nothing more. */
for (A = 0;A < 0x4000;A++)
{
int v;
v = RAM[A];
RAM[A] = (v & 0xe7) | ((v & 0x10) >> 1) | ((v & 0x08) << 1);
}
}
static const char *sample_names[] =
{
"*dkong",
"effect00.sam",
"effect01.sam",
"effect02.sam",
0 /* end of array */
};
static const char *dkongjr_sample_names[] =
{
"*dkongjr",
"death.sam",
"drop.sam",
"roar.sam",
"jump.sam", /* HC */
"walk.sam", /* HC */
"land.sam", /* HC */
"climb.sam", /* HC */
0 /* end of array */
};
static int radarscp_hiload(void)
{
unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
/* check if the hi score table has already been initialized */
if ( memcmp(&RAM[0x6307],"\x00\x00\x07",3) == 0 &&
memcmp(&RAM[0x631c],"\x00\x50\x76",3) == 0 &&
memcmp(&RAM[0x63a7],"\x00\xfc\x76",3) == 0 &&
memcmp(&RAM[0x60a8],"\x50\x76\x00",3) == 0) /* high score */
{
void *f;
if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
{
osd_fread(f,&RAM[0x6307],162);
osd_fclose(f);
RAM[0x60a7] = RAM[0x631d];
RAM[0x60a8] = RAM[0x631e];
RAM[0x60a9] = RAM[0x631f];
/* also have to copy the score to video ram so it displays on startup */
RAM[0x7641] = RAM[0x6307];
RAM[0x7621] = RAM[0x6308];
RAM[0x7601] = RAM[0x6309];
RAM[0x75e1] = RAM[0x630a];
RAM[0x75c1] = RAM[0x630b];
RAM[0x75a1] = RAM[0x630c];
}
return 1;
}
else return 0; /* we can't load the hi scores yet */
}
static void radarscp_hisave(void)
{
void *f;
unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -