📄 junofrst.c
字号:
PORT_DIPSETTING( 0x0a, "1 Coin/6 Credits" )
PORT_DIPSETTING( 0x09, "1 Coin/7 Credits" )
PORT_DIPSETTING( 0x00, "Free Play" )
PORT_DIPNAME( 0xf0, 0xf0, "Coin B", IP_KEY_NONE )
PORT_DIPSETTING( 0x20, "4 Coins/1 Credit" )
PORT_DIPSETTING( 0x50, "3 Coins/1 Credit" )
PORT_DIPSETTING( 0x80, "2 Coins/1 Credit" )
PORT_DIPSETTING( 0x40, "3 Coins/2 Credits" )
PORT_DIPSETTING( 0x10, "4 Coins/3 Credits" )
PORT_DIPSETTING( 0xf0, "1 Coin/1 Credit" )
PORT_DIPSETTING( 0x30, "3 Coins/4 Credits" )
PORT_DIPSETTING( 0x70, "2 Coins/3 Credits" )
PORT_DIPSETTING( 0xe0, "1 Coin/2 Credits" )
PORT_DIPSETTING( 0x60, "2 Coins/5 Credits" )
PORT_DIPSETTING( 0xd0, "1 Coin/3 Credits" )
PORT_DIPSETTING( 0xc0, "1 Coin/4 Credits" )
PORT_DIPSETTING( 0xb0, "1 Coin/5 Credits" )
PORT_DIPSETTING( 0xa0, "1 Coin/6 Credits" )
PORT_DIPSETTING( 0x90, "1 Coin/7 Credits" )
PORT_DIPSETTING( 0x00, "Disabled" )
/* 0x00 not remmed out since the game makes the usual sound if you insert the coin */
INPUT_PORTS_END
static struct AY8910interface ay8910_interface =
{
1, /* 1 chip */
1789750, /* 1.78975 MHz ? (same as other Konami games) */
{ 255 },
{ junofrst_portA_r },
{ 0 },
{ 0 },
{ 0 } /* port B - shoot noise? */
};
static struct DACinterface dac_interface =
{
1,
{ 0x10ff }
};
static struct MachineDriver machine_driver =
{
/* basic machine hardware */
{
{
CPU_M6809,
1500000, /* 1.5 Mhz ??? */
0, /* memory region # 0 */
readmem,writemem,0,0,
interrupt,1
},
{
CPU_Z80 | CPU_AUDIO_CPU,
2100000, /* ??????? */
2, /* memory region #2 */
sound_readmem,sound_writemem,0,0,
ignore_interrupt,1 /* interrupts are triggered by the main CPU */
},
{
CPU_I8039 | CPU_AUDIO_CPU,
8000000/15, /* 8Mhz crystal???? */
3, /* memory region #3 */
i8039_readmem,i8039_writemem,i8039_readport,i8039_writeport,
ignore_interrupt,1
}
},
30, DEFAULT_30HZ_VBLANK_DURATION, /* frames per second, vblank duration */
1, /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
junofrst_init_machine, /* init machine routine */
/* video hardware */
32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 }, /* not sure about the visible area */
0, /* GfxDecodeInfo * */
16, /* total colors */
0, /* color table length */
0, /* convert color prom routine */
VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE,
0, /* vh_init routine */
generic_vh_start, /* vh_start routine */
generic_vh_stop, /* vh_stop routine */
tutankhm_vh_screenrefresh, /* vh_update routine */
/* sound hardware */
0,0,0,0,
{
{
SOUND_AY8910,
&ay8910_interface
},
{
SOUND_DAC,
&dac_interface
}
}
};
ROM_START( junofrst_rom )
ROM_REGION( 0x22000 ) /* 64k for M6809 CPU code + 64k for ROM banks */
ROM_LOAD( "jfa_b9.bin", 0x0a000, 0x2000, 0xf5a7ab9d ) /* program ROMs */
ROM_LOAD( "jfb_b10.bin", 0x0c000, 0x2000, 0xf20626e0 )
ROM_LOAD( "jfc_a10.bin", 0x0e000, 0x2000, 0x1e7744a7 )
ROM_LOAD( "jfc1_a4.bin", 0x10000, 0x2000, 0x03ccbf1d ) /* graphic and code ROMs (banked) */
ROM_LOAD( "jfc2_a5.bin", 0x12000, 0x2000, 0xcb372372 )
ROM_LOAD( "jfc3_a6.bin", 0x14000, 0x2000, 0x879d194b )
ROM_LOAD( "jfc4_a7.bin", 0x16000, 0x2000, 0xf28af80b )
ROM_LOAD( "jfc5_a8.bin", 0x18000, 0x2000, 0x0539f328 )
ROM_LOAD( "jfc6_a9.bin", 0x1a000, 0x2000, 0x1da2ad6e )
ROM_LOAD( "jfs3_c7.bin", 0x1c000, 0x2000, 0xaeacf6db )
ROM_LOAD( "jfs4_d7.bin", 0x1e000, 0x2000, 0x206d954c )
ROM_LOAD( "jfs5_e7.bin", 0x20000, 0x2000, 0x1eb87a6e )
ROM_REGION_DISPOSE( 0x1000 ) /* ROM Region 1 -- discarded */
/* empty memory region - not used by the game, but needed bacause the main */
/* core currently always frees region #1 after initialization. */
ROM_REGION( 0x10000 ) /* 64k for Z80 sound CPU code */
ROM_LOAD( "jfs1_j3.bin", 0x0000, 0x1000, 0x235a2893 )
ROM_REGION(0x1000) /* 8039 */
ROM_LOAD( "jfs2_p4.bin", 0x0000, 0x1000, 0xd0fa5d5f )
ROM_END
static void junofrst_decode(void)
{
int A;
unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
for (A = 0x6000;A < 0x1c000;A++)
{
ROM[A] = KonamiDecode(RAM[A],A);
}
}
/* Juno First Blitter Hardware emulation
Juno First can blit a 16x16 graphics which comes from un-memory mapped graphics roms
$8070->$8071 specifies the destination NIBBLE address
$8072->$8073 specifies the source NIBBLE address
Depending on bit 0 of the source address either the source pixels will be copied to
the destination address, or a zero will be written.
This allows the game to quickly clear the sprites from the screen
A lookup table is used to swap the source nibbles as they are the wrong way round in the
source data.
Bugs -
Currently only the even pixels will be written to. This is to speed up the blit routine
as it does not have to worry about shifting the source data.
This means that all destination X values will be rounded to even values.
In practice no one actaully notices this.
The clear works properly.
*/
void junofrst_blitter_w( int offset, int data )
{
static byte blitterdata[4];
unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
blitterdata[offset] = data;
/* Blitter is triggered by $8073 */
if (offset==3)
{
int i;
unsigned long srcaddress;
unsigned long destaddress;
byte srcflag;
byte destflag;
byte *JunoBLTRom = &RAM[0x1C000];
srcaddress = (blitterdata[0x2]<<8) | (blitterdata[0x3]);
srcflag = srcaddress & 1;
srcaddress >>= 1;
srcaddress &= 0x7FFE;
destaddress = (blitterdata[0x0]<<8) | (blitterdata[0x1]);
destflag = destaddress & 1;
destaddress >>= 1;
destaddress &= 0x7fff;
if (srcflag) {
for (i=0;i<16;i++) {
#define JUNOBLITPIXEL(x) \
if (JunoBLTRom[srcaddress+x]) \
tutankhm_videoram_w( destaddress+x, \
JunoNibbleSwapTable[ \
JunoBLTRom[srcaddress+x] \
]);
JUNOBLITPIXEL(0);
JUNOBLITPIXEL(1);
JUNOBLITPIXEL(2);
JUNOBLITPIXEL(3);
JUNOBLITPIXEL(4);
JUNOBLITPIXEL(5);
JUNOBLITPIXEL(6);
JUNOBLITPIXEL(7);
destaddress += 128;
srcaddress += 8;
}
} else {
for (i=0;i<16;i++) {
#define JUNOCLEARPIXEL(x) \
if ((JunoBLTRom[srcaddress+x] & 0xF0)) \
tutankhm_videoram_w( destaddress+x, \
RAM[destaddress+x] & 0xF0); \
if ((JunoBLTRom[srcaddress+x] & 0x0F)) \
tutankhm_videoram_w( destaddress+x, \
RAM[destaddress+x] & 0x0F);
JUNOCLEARPIXEL(0);
JUNOCLEARPIXEL(1);
JUNOCLEARPIXEL(2);
JUNOCLEARPIXEL(3);
JUNOCLEARPIXEL(4);
JUNOCLEARPIXEL(5);
JUNOCLEARPIXEL(6);
JUNOCLEARPIXEL(7);
destaddress += 128;
srcaddress+= 8;
}
}
}
}
static int hiload(void)
{
void *f;
unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
/* check if the hi score table has already been initialized */
if ( (RAM[0x8100]==0x01)
&& (RAM[0x8101]==0x00)
&& (RAM[0x8102]==0x00)
&& (RAM[0x8103]==0x02)
&& (RAM[0x8104]==0x41)
&& (RAM[0x8105]==0x41)
&& (RAM[0x8106]==0x41)
)
{
if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
{
osd_fread(f,&RAM[0x8100],0x81a8-0x8100);
osd_fclose(f);
}
return 1;
}
else return 0; /* we can't load the hi scores yet */
}
static void hisave(void)
{
void *f;
unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,1)) != 0)
{
osd_fwrite(f,&RAM[0x8100],0x81a8-0x8100);
osd_fclose(f);
}
}
struct GameDriver junofrst_driver =
{
__FILE__,
0,
"junofrst",
"Juno First",
"1983",
"Konami",
"Chris Hardy (MAME driver)\nMirko Buffoni (Tutankham driver)\nDavid Dahl (hardware info)\nAaron Giles\nMarco Cassili",
0,
&machine_driver,
0,
junofrst_rom,
0, junofrst_decode, /* ROM decode and opcode decode functions */
0, /* Sample names */
0, /* sound_prom */
input_ports,
0, 0, 0, /* colors, palette, colortable */
ORIENTATION_ROTATE_90,
hiload, hisave /* High score load and save */
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -