mirror of
https://github.com/holub/mame
synced 2025-04-26 10:13:37 +03:00
merged nova2001, ninjakun, pkunwar, raiders5; misc cleanup
This commit is contained in:
parent
163bb74a8f
commit
06dece135f
7
.gitattributes
vendored
7
.gitattributes
vendored
@ -1696,7 +1696,6 @@ src/mame/drivers/neodrvr.c svneol=native#text/plain
|
||||
src/mame/drivers/neogeo.c svneol=native#text/plain
|
||||
src/mame/drivers/news.c svneol=native#text/plain
|
||||
src/mame/drivers/ninjakd2.c svneol=native#text/plain
|
||||
src/mame/drivers/ninjakun.c svneol=native#text/plain
|
||||
src/mame/drivers/ninjaw.c svneol=native#text/plain
|
||||
src/mame/drivers/nitedrvr.c svneol=native#text/plain
|
||||
src/mame/drivers/niyanpai.c svneol=native#text/plain
|
||||
@ -1743,7 +1742,6 @@ src/mame/drivers/pirates.c svneol=native#text/plain
|
||||
src/mame/drivers/pitnrun.c svneol=native#text/plain
|
||||
src/mame/drivers/pkscram.c svneol=native#text/plain
|
||||
src/mame/drivers/pktgaldx.c svneol=native#text/plain
|
||||
src/mame/drivers/pkunwar.c svneol=native#text/plain
|
||||
src/mame/drivers/playch10.c svneol=native#text/plain
|
||||
src/mame/drivers/playmark.c svneol=native#text/plain
|
||||
src/mame/drivers/plygonet.c svneol=native#text/plain
|
||||
@ -1782,7 +1780,6 @@ src/mame/drivers/r2dtank.c svneol=native#text/plain
|
||||
src/mame/drivers/rabbit.c svneol=native#text/plain
|
||||
src/mame/drivers/raiden.c svneol=native#text/plain
|
||||
src/mame/drivers/raiden2.c svneol=native#text/plain
|
||||
src/mame/drivers/raiders5.c svneol=native#text/plain
|
||||
src/mame/drivers/rainbow.c svneol=native#text/plain
|
||||
src/mame/drivers/rallyx.c svneol=native#text/plain
|
||||
src/mame/drivers/rampart.c svneol=native#text/plain
|
||||
@ -2238,6 +2235,7 @@ src/mame/includes/neogeo.h svneol=native#text/plain
|
||||
src/mame/includes/news.h svneol=native#text/plain
|
||||
src/mame/includes/ninjakd2.h svneol=native#text/plain
|
||||
src/mame/includes/nitedrvr.h svneol=native#text/plain
|
||||
src/mame/includes/nova2001.h svneol=native#text/plain
|
||||
src/mame/includes/offtwall.h svneol=native#text/plain
|
||||
src/mame/includes/orbit.h svneol=native#text/plain
|
||||
src/mame/includes/pacman.h svneol=native#text/plain
|
||||
@ -2962,7 +2960,6 @@ src/mame/video/nemesis.c svneol=native#text/plain
|
||||
src/mame/video/neogeo.c svneol=native#text/plain
|
||||
src/mame/video/news.c svneol=native#text/plain
|
||||
src/mame/video/ninjakd2.c svneol=native#text/plain
|
||||
src/mame/video/ninjakun.c svneol=native#text/plain
|
||||
src/mame/video/ninjaw.c svneol=native#text/plain
|
||||
src/mame/video/nitedrvr.c svneol=native#text/plain
|
||||
src/mame/video/niyanpai.c svneol=native#text/plain
|
||||
@ -2992,7 +2989,6 @@ src/mame/video/pingpong.c svneol=native#text/plain
|
||||
src/mame/video/pirates.c svneol=native#text/plain
|
||||
src/mame/video/pitnrun.c svneol=native#text/plain
|
||||
src/mame/video/pktgaldx.c svneol=native#text/plain
|
||||
src/mame/video/pkunwar.c svneol=native#text/plain
|
||||
src/mame/video/playch10.c svneol=native#text/plain
|
||||
src/mame/video/playmark.c svneol=native#text/plain
|
||||
src/mame/video/plygonet.c svneol=native#text/plain
|
||||
@ -3022,7 +3018,6 @@ src/mame/video/quasar.c svneol=native#text/plain
|
||||
src/mame/video/quizdna.c svneol=native#text/plain
|
||||
src/mame/video/quizpani.c svneol=native#text/plain
|
||||
src/mame/video/raiden.c svneol=native#text/plain
|
||||
src/mame/video/raiders5.c svneol=native#text/plain
|
||||
src/mame/video/rallyx.c svneol=native#text/plain
|
||||
src/mame/video/rampart.c svneol=native#text/plain
|
||||
src/mame/video/rastan.c svneol=native#text/plain
|
||||
|
@ -1,306 +0,0 @@
|
||||
/*******************************************************************************
|
||||
Ninja Kid / Ninjakun Majou no Bouken | (c) 1984 UPL / Taito
|
||||
********************************************************************************
|
||||
Driver by David Haywood
|
||||
with help from Steph and Phil Stroffolino
|
||||
|
||||
Last Changes: 21 Jan 2008
|
||||
|
||||
This driver was started after interest was shown in the game by a poster at
|
||||
various messageboards going under the name of 'ninjakun' I decided to attempt
|
||||
a driver for this game to gain some experience with Z80 & Multi-processor
|
||||
games.
|
||||
|
||||
Hold P1 Start after a reset to skip the startup memory tests.
|
||||
|
||||
Change Log:
|
||||
5 Mar - Added Saved State Support (DJH)
|
||||
8 Jun - Added palette animation, Fixed FG priority. (Uki)
|
||||
9 Jun - Fixed BG scroll handling, Fixed CPU clock.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
|
||||
extern UINT8 *ninjakun_fg_videoram;
|
||||
extern UINT8 *ninjakun_bg_videoram;
|
||||
|
||||
WRITE8_HANDLER( ninjakun_bg_videoram_w );
|
||||
WRITE8_HANDLER( ninjakun_fg_videoram_w );
|
||||
READ8_HANDLER( ninjakun_bg_videoram_r );
|
||||
|
||||
READ8_HANDLER( ninjakun_io_8000_r );
|
||||
WRITE8_HANDLER( ninjakun_io_8000_w );
|
||||
|
||||
VIDEO_START( ninjakun );
|
||||
VIDEO_UPDATE( ninjakun );
|
||||
WRITE8_HANDLER( ninjakun_flipscreen_w );
|
||||
|
||||
WRITE8_HANDLER( ninjakun_paletteram_w );
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
0xA000 Read / Write Handlers
|
||||
*******************************************************************************/
|
||||
|
||||
static UINT8 ninjakun_io_a002_ctrl;
|
||||
|
||||
static READ8_HANDLER( ninjakun_io_A002_r )
|
||||
{
|
||||
return ninjakun_io_a002_ctrl | readinputport(2); /* vblank */
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( ninjakun_cpu1_io_A002_w )
|
||||
{
|
||||
if( data == 0x80 ) ninjakun_io_a002_ctrl |= 0x04;
|
||||
if( data == 0x40 ) ninjakun_io_a002_ctrl &= ~0x08;
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( ninjakun_cpu2_io_A002_w )
|
||||
{
|
||||
if( data == 0x40 ) ninjakun_io_a002_ctrl |= 0x08;
|
||||
if( data == 0x80 ) ninjakun_io_a002_ctrl &= ~0x04;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
Init
|
||||
*******************************************************************************/
|
||||
|
||||
static MACHINE_START( ninjakun )
|
||||
{
|
||||
/* Save State Stuff */
|
||||
state_save_register_global(ninjakun_io_a002_ctrl);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
Memory Maps
|
||||
*******************************************************************************/
|
||||
|
||||
static ADDRESS_MAP_START( ninjakun_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x2000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x8003) AM_READWRITE(ninjakun_io_8000_r, ninjakun_io_8000_w)
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
|
||||
AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r)
|
||||
AM_RANGE(0xa002, 0xa002) AM_READWRITE(ninjakun_io_A002_r, ninjakun_cpu1_io_A002_w)
|
||||
AM_RANGE(0xa003, 0xa003) AM_WRITE(ninjakun_flipscreen_w)
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(MRA8_RAM, ninjakun_fg_videoram_w) AM_BASE(&ninjakun_fg_videoram) AM_SHARE(1)
|
||||
AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_BASE(&ninjakun_bg_videoram) AM_SHARE(2)
|
||||
AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SHARE(3)
|
||||
AM_RANGE(0xd800, 0xd9ff) AM_READWRITE(MRA8_RAM, ninjakun_paletteram_w) AM_BASE(&paletteram) AM_SHARE(4)
|
||||
AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE(5)
|
||||
AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE(6)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( ninjakun_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||
AM_RANGE(0x2000, 0x7fff) AM_ROM AM_REGION(REGION_CPU1, 0x2000)
|
||||
AM_RANGE(0x8000, 0x8003) AM_READWRITE(ninjakun_io_8000_r, ninjakun_io_8000_w)
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
|
||||
AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r)
|
||||
AM_RANGE(0xa002, 0xa002) AM_READWRITE(ninjakun_io_A002_r, ninjakun_cpu2_io_A002_w)
|
||||
AM_RANGE(0xa003, 0xa003) AM_WRITE(ninjakun_flipscreen_w)
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(MRA8_RAM, ninjakun_fg_videoram_w) AM_SHARE(1)
|
||||
AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_SHARE(2)
|
||||
AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE(3)
|
||||
AM_RANGE(0xd800, 0xd9ff) AM_READWRITE(MRA8_RAM, ninjakun_paletteram_w) AM_SHARE(4)
|
||||
AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE(6) /* swapped wrt CPU1 */
|
||||
AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE(5) /* swapped wrt CPU1 */
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/*******************************************************************************
|
||||
GFX Decoding Information
|
||||
*******************************************************************************/
|
||||
|
||||
static const gfx_layout tile_layout =
|
||||
{
|
||||
8,8, /* tile size */
|
||||
0x400, /* number of tiles */
|
||||
4, /* bits per pixel */
|
||||
{ 0, 1, 2, 3 }, /* plane offsets */
|
||||
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, /* x offsets */
|
||||
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, /* y offsets */
|
||||
256
|
||||
};
|
||||
|
||||
static const gfx_layout sprite_layout =
|
||||
{
|
||||
16,16, /* tile size */
|
||||
0x100, /* number of tiles */
|
||||
4, /* bits per pixel */
|
||||
{ 0, 1, 2, 3 }, /* plane offsets */
|
||||
{
|
||||
0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
|
||||
256+0*4, 256+1*4, 256+2*4, 256+3*4, 256+4*4, 256+5*4, 256+6*4, 256+7*4,
|
||||
}, /* x offsets */
|
||||
{
|
||||
0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
|
||||
512+0*32, 512+1*32, 512+2*32, 512+3*32, 512+4*32, 512+5*32, 512+6*32, 512+7*32
|
||||
}, /* y offsets */
|
||||
1024
|
||||
};
|
||||
|
||||
static GFXDECODE_START( ninjakun )
|
||||
GFXDECODE_ENTRY( REGION_GFX1, 0, tile_layout, 0x000, 0x10 )
|
||||
GFXDECODE_ENTRY( REGION_GFX2, 0, tile_layout, 0x100, 0x10 )
|
||||
GFXDECODE_ENTRY( REGION_GFX1, 0, sprite_layout, 0x200, 0x10 )
|
||||
GFXDECODE_END
|
||||
|
||||
/*******************************************************************************
|
||||
Machine Driver Structure(s)
|
||||
*******************************************************************************/
|
||||
|
||||
static MACHINE_DRIVER_START( ninjakun )
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD(Z80, 3000000) /* 3.00MHz */
|
||||
MDRV_CPU_PROGRAM_MAP(ninjakun_cpu1_map,0)
|
||||
MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
|
||||
|
||||
MDRV_CPU_ADD(Z80, 3000000) /* 3.00MHz */
|
||||
MDRV_CPU_PROGRAM_MAP(ninjakun_cpu2_map,0)
|
||||
MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* ? */
|
||||
|
||||
MDRV_SCREEN_REFRESH_RATE(60)
|
||||
|
||||
MDRV_MACHINE_START(ninjakun)
|
||||
MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
|
||||
MDRV_INTERLEAVE(100) /* 100 CPU slices per frame */
|
||||
|
||||
/* video hardware */
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
|
||||
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
||||
MDRV_SCREEN_SIZE(32*8, 32*8)
|
||||
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, (32-4)*8-1 )
|
||||
MDRV_GFXDECODE(ninjakun)
|
||||
MDRV_PALETTE_LENGTH(768)
|
||||
|
||||
MDRV_VIDEO_START(ninjakun)
|
||||
MDRV_VIDEO_UPDATE(ninjakun)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MDRV_SOUND_ADD(AY8910, 6000000/2)
|
||||
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
|
||||
MDRV_SOUND_ADD(AY8910, 6000000/2)
|
||||
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
/*******************************************************************************
|
||||
Rom Definitions
|
||||
*******************************************************************************/
|
||||
|
||||
ROM_START( ninjakun ) /* Original Board? */
|
||||
ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* Main CPU */
|
||||
ROM_LOAD( "ninja-1.7a", 0x0000, 0x02000, CRC(1c1dc141) SHA1(423d3ed35e73a8d5bfce075a889b0322b207bd0d) )
|
||||
ROM_LOAD( "ninja-2.7b", 0x2000, 0x02000, CRC(39cc7d37) SHA1(7f0d0e1e92cb6a57f15eb7fc51a67112f1c5fc8e) )
|
||||
ROM_LOAD( "ninja-3.7d", 0x4000, 0x02000, CRC(d542bfe3) SHA1(3814d8f5b1acda21438fff4f71670fa653dc7b30) )
|
||||
ROM_LOAD( "ninja-4.7e", 0x6000, 0x02000, CRC(a57385c6) SHA1(77925a281e64889bfe967c3d42a388529aaf7eb6) )
|
||||
|
||||
ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Secondary CPU */
|
||||
ROM_LOAD( "ninja-5.7h", 0x0000, 0x02000, CRC(164a42c4) SHA1(16b434b33b76b878514f67c23315d4c6da7bfc9e) )
|
||||
|
||||
ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) /* Graphics */
|
||||
ROM_LOAD16_BYTE( "ninja-6.7n", 0x0000, 0x02000, CRC(a74c4297) SHA1(87184d14c67331f2c8a2412e28f31427eddae799) )
|
||||
ROM_LOAD16_BYTE( "ninja-7.7p", 0x0001, 0x02000, CRC(53a72039) SHA1(d77d608ce9388a8956831369badd88a8eda8e102) )
|
||||
ROM_LOAD16_BYTE( "ninja-8.7s", 0x4000, 0x02000, CRC(4a99d857) SHA1(6aadb6a5c721a161a5c1bef5569c1e323e380cff) )
|
||||
ROM_LOAD16_BYTE( "ninja-9.7t", 0x4001, 0x02000, CRC(dede49e4) SHA1(8ce4bc02ec583b3885ca63fb5e2d5dad185fe192) )
|
||||
|
||||
ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE ) /* Graphics */
|
||||
ROM_LOAD16_BYTE( "ninja-10.2c", 0x0000, 0x02000, CRC(0d55664a) SHA1(955a607b4401ce9f3f807d53833a766152b0ef9b) )
|
||||
ROM_LOAD16_BYTE( "ninja-11.2d", 0x0001, 0x02000, CRC(12ff9597) SHA1(10b572844ab32e3ae54abe3600fecc1a811ac713) )
|
||||
ROM_LOAD16_BYTE( "ninja-12.4c", 0x4000, 0x02000, CRC(e9b75807) SHA1(cf4c8ac962f785e9de5502df58eab9b3725aaa28) )
|
||||
ROM_LOAD16_BYTE( "ninja-13.4d", 0x4001, 0x02000, CRC(1760ed2c) SHA1(ee4c8efcce483c8051873714856824a1a1e14b61) )
|
||||
ROM_END
|
||||
|
||||
/*******************************************************************************
|
||||
Input Ports
|
||||
********************************************************************************
|
||||
2 Sets of Controls
|
||||
2 Sets of Dipsiwtches
|
||||
*******************************************************************************/
|
||||
|
||||
static INPUT_PORTS_START( ninjakun )
|
||||
PORT_START_TAG("IN0") /* 0xa000 */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY /* "XPOS1" */
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
|
||||
|
||||
PORT_START_TAG("IN1") /* 0xa001 */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_2WAY PORT_COCKTAIL /* "YPOS1" */
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_2WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
|
||||
PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
|
||||
|
||||
PORT_START_TAG("IN2") /* 0xa002 */
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
|
||||
|
||||
PORT_START_TAG("DSW1")
|
||||
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) )
|
||||
PORT_DIPNAME( 0x06, 0x04, DEF_STR( Lives ) )
|
||||
PORT_DIPSETTING( 0x02, "2" )
|
||||
PORT_DIPSETTING( 0x04, "3" )
|
||||
PORT_DIPSETTING( 0x06, "4" )
|
||||
PORT_DIPSETTING( 0x00, "5" )
|
||||
PORT_DIPNAME( 0x08, 0x08, "First Bonus" )
|
||||
PORT_DIPSETTING( 0x08, "30000" )
|
||||
PORT_DIPSETTING( 0x00, "40000" )
|
||||
PORT_DIPNAME( 0x30, 0x30, "Second Bonus" )
|
||||
PORT_DIPSETTING( 0x00, "No Bonus" )
|
||||
PORT_DIPSETTING( 0x10, "Every 30000" )
|
||||
PORT_DIPSETTING( 0x30, "Every 50000" )
|
||||
PORT_DIPSETTING( 0x20, "Every 70000" )
|
||||
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( Normal ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
|
||||
|
||||
PORT_START_TAG("DSW2")
|
||||
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) )
|
||||
PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 4C_2C ) )
|
||||
PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( 3C_2C ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( 2C_2C ) )
|
||||
PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x03, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPNAME( 0x08, 0x08, "High Score Names" )
|
||||
PORT_DIPSETTING( 0x00, "3 Letters" )
|
||||
PORT_DIPSETTING( 0x08, "8 Letters" )
|
||||
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( No ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
|
||||
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )/* Probably Unused */
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x80, "Endless Game (If Free Play)" )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
INPUT_PORTS_END
|
||||
|
||||
/*******************************************************************************
|
||||
Game Drivers
|
||||
*******************************************************************************/
|
||||
|
||||
GAME( 1984, ninjakun, 0, ninjakun, ninjakun, 0, ROT0, "[UPL] (Taito license)", "Ninjakun Majou no Bouken", 0 )
|
File diff suppressed because it is too large
Load Diff
@ -1,252 +0,0 @@
|
||||
/***************************************************************************
|
||||
|
||||
Notes:
|
||||
- Currently the Flip Screen dip switch only flips the screen horizontally.
|
||||
This might not be the correct behaviour. Verification of the real board
|
||||
would be necessary to emulate this accurately.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
|
||||
PALETTE_INIT( nova2001 );
|
||||
WRITE8_HANDLER( pkunwar_flipscreen_w );
|
||||
VIDEO_UPDATE( pkunwar );
|
||||
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
|
||||
AM_RANGE(0x8000, 0x8fff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0xa001, 0xa001) AM_READ(AY8910_read_port_0_r)
|
||||
AM_RANGE(0xa003, 0xa003) AM_READ(AY8910_read_port_1_r)
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0xe000, 0xffff) AM_READ(MRA8_ROM)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
|
||||
AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
|
||||
AM_RANGE(0x8800, 0x8bff) AM_WRITE(MWA8_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
|
||||
AM_RANGE(0x8c00, 0x8fff) AM_WRITE(MWA8_RAM) AM_BASE(&colorram)
|
||||
AM_RANGE(0xa000, 0xa000) AM_WRITE(&AY8910_control_port_0_w)
|
||||
AM_RANGE(0xa001, 0xa001) AM_WRITE(&AY8910_write_port_0_w)
|
||||
AM_RANGE(0xa002, 0xa002) AM_WRITE(&AY8910_control_port_1_w)
|
||||
AM_RANGE(0xa003, 0xa003) AM_WRITE(&AY8910_write_port_1_w)
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0xe000, 0xffff) AM_WRITE(MWA8_ROM)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
|
||||
ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
|
||||
AM_RANGE(0x00, 0x00) AM_WRITE(pkunwar_flipscreen_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
|
||||
static INPUT_PORTS_START( pkunwar )
|
||||
PORT_START /* IN0 */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
|
||||
|
||||
PORT_START /* IN1 */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
|
||||
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
|
||||
PORT_START /* DSW0 */
|
||||
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
|
||||
PORT_START /* DSW1 */
|
||||
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( Cocktail ) )
|
||||
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( Easy ) )
|
||||
PORT_DIPSETTING( 0x30, DEF_STR( Medium ) )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( Hard ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
|
||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
|
||||
static const gfx_layout charlayout =
|
||||
{
|
||||
8,8, /* 8*8 characters */
|
||||
2048, /* 2048 characters */
|
||||
4, /* 4 bits per pixel */
|
||||
{ 0, 1, 2, 3 },
|
||||
{ 0*4, 1*4, 2048*16*8, 2048*16*8 + 4, 2*4, 3*4, 2048*16*8 + 8, 2048*16*8 + 12 },
|
||||
{ 0*8, 2*8, 4*8, 6*8, 8*8, 10*8, 12*8, 14*8 },
|
||||
16*8
|
||||
};
|
||||
|
||||
static const gfx_layout spritelayout =
|
||||
{
|
||||
16,16, /* 16*16 sprites */
|
||||
512, /* 512 sprites */
|
||||
4, /* 4 bits per pixel */
|
||||
{ 0, 1, 2, 3 },
|
||||
{ 0*4, 1*4, 512*64*8, 512*64*8 + 4, 2*4, 3*4, 512*64*8 + 8, 512*64*8 + 12,
|
||||
0*4+16*8, 1*4+16*8, 512*64*8+16*8, 512*64*8 + 4+16*8, 2*4+16*8, 3*4+16*8, 512*64*8 + 8 + 16*8, 512*64*8 + 12 + 16*8 },
|
||||
{ 0*8, 2*8, 4*8, 6*8, 8*8, 10*8, 12*8, 14*8,
|
||||
0*8+32*8, 2*8+32*8, 4*8+32*8, 6*8+32*8, 8*8+32*8, 10*8+32*8, 12*8+32*8, 14*8 + 32*8 },
|
||||
64*8
|
||||
};
|
||||
|
||||
static GFXDECODE_START( pkunwar )
|
||||
GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 16*16, 16 )
|
||||
GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 0, 16 )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
static const struct AY8910interface ay8910_interface_1 = {
|
||||
input_port_0_r,
|
||||
input_port_1_r
|
||||
};
|
||||
|
||||
static const struct AY8910interface ay8910_interface_2 = {
|
||||
input_port_2_r,
|
||||
input_port_3_r
|
||||
};
|
||||
|
||||
|
||||
|
||||
static MACHINE_DRIVER_START( pkunwar )
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD(Z80, 12000000/4) /* 3 MHz */
|
||||
MDRV_CPU_PROGRAM_MAP(readmem,writemem)
|
||||
MDRV_CPU_IO_MAP(0,writeport)
|
||||
MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
|
||||
|
||||
MDRV_SCREEN_REFRESH_RATE(60)
|
||||
MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
|
||||
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
||||
MDRV_SCREEN_SIZE(32*8, 32*8)
|
||||
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
|
||||
MDRV_GFXDECODE(pkunwar)
|
||||
MDRV_PALETTE_LENGTH(32)
|
||||
MDRV_COLORTABLE_LENGTH(32*16)
|
||||
|
||||
MDRV_PALETTE_INIT(nova2001)
|
||||
MDRV_VIDEO_UPDATE(pkunwar)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MDRV_SOUND_ADD(AY8910, 12000000/8)
|
||||
MDRV_SOUND_CONFIG(ay8910_interface_1)
|
||||
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
|
||||
|
||||
MDRV_SOUND_ADD(AY8910, 12000000/8)
|
||||
MDRV_SOUND_CONFIG(ay8910_interface_2)
|
||||
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Game driver(s)
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
ROM_START( pkunwar )
|
||||
ROM_REGION( 0x10000, REGION_CPU1, 0 )
|
||||
ROM_LOAD( "pkwar.01r", 0x0000, 0x4000, CRC(ce2d2c7b) SHA1(2ffe2eb339fd668ec4fe90eff66124a334db0693) )
|
||||
ROM_LOAD( "pkwar.02r", 0x4000, 0x4000, CRC(abc1f661) SHA1(c4bf4a345efd4271617de9f334303d81c6885aa5) )
|
||||
ROM_LOAD( "pkwar.03r", 0xe000, 0x2000, CRC(56faebea) SHA1(dd0406c723a08f5d1120655857a115ab8c2d2a11) )
|
||||
|
||||
ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
|
||||
ROM_LOAD( "pkwar.01y", 0x0000, 0x2000, CRC(428d3b92) SHA1(7fe11e8d785fe829d34e512f233bb9ccc70cd431) )
|
||||
ROM_CONTINUE( 0x8000, 0x2000 )
|
||||
ROM_LOAD( "pkwar.02y", 0x2000, 0x2000, CRC(ce1da7bc) SHA1(a2357b61703a689ce63aec7dd44702b119894f8e) )
|
||||
ROM_CONTINUE( 0xa000, 0x2000 )
|
||||
ROM_LOAD( "pkwar.03y", 0x4000, 0x2000, CRC(63204400) SHA1(1ba87ad3425c51150cb65408f04ee0147ef332d3) )
|
||||
ROM_CONTINUE( 0xc000, 0x2000 )
|
||||
ROM_LOAD( "pkwar.04y", 0x6000, 0x2000, CRC(061dfca8) SHA1(0a2dd8fc790d607195ca18dfc55575c2b9ddc58a) )
|
||||
ROM_CONTINUE( 0xe000, 0x2000 )
|
||||
|
||||
ROM_REGION( 0x0020, REGION_PROMS, 0 )
|
||||
ROM_LOAD( "pkwar.col", 0x0000, 0x0020, CRC(af0fc5e2) SHA1(480908bf893211b580ae19cfb40dc35ad1bbc343) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( pkunwarj )
|
||||
ROM_REGION( 0x10000, REGION_CPU1, 0 )
|
||||
ROM_LOAD( "pgunwar.6", 0x0000, 0x4000, CRC(357f3ef3) SHA1(bc651fb7701b395ae8cda1888814af5c5aa325a6) )
|
||||
ROM_LOAD( "pgunwar.5", 0x4000, 0x4000, CRC(0092e49e) SHA1(7945361036f7679e4f4bb6b94f60f3ca09c077dc) )
|
||||
ROM_LOAD( "pkwar.03r", 0xe000, 0x2000, CRC(56faebea) SHA1(dd0406c723a08f5d1120655857a115ab8c2d2a11) )
|
||||
|
||||
ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
|
||||
ROM_LOAD( "pkwar.01y", 0x0000, 0x2000, CRC(428d3b92) SHA1(7fe11e8d785fe829d34e512f233bb9ccc70cd431) )
|
||||
ROM_CONTINUE( 0x8000, 0x2000 )
|
||||
ROM_LOAD( "pkwar.02y", 0x2000, 0x2000, CRC(ce1da7bc) SHA1(a2357b61703a689ce63aec7dd44702b119894f8e) )
|
||||
ROM_CONTINUE( 0xa000, 0x2000 )
|
||||
ROM_LOAD( "pgunwar.2", 0x4000, 0x2000, CRC(a2a43443) SHA1(4e10569886d364eb2539928ea81dc1565b60b590) )
|
||||
ROM_CONTINUE( 0xc000, 0x2000 )
|
||||
ROM_LOAD( "pkwar.04y", 0x6000, 0x2000, CRC(061dfca8) SHA1(0a2dd8fc790d607195ca18dfc55575c2b9ddc58a) )
|
||||
ROM_CONTINUE( 0xe000, 0x2000 )
|
||||
|
||||
ROM_REGION( 0x0020, REGION_PROMS, 0 )
|
||||
ROM_LOAD( "pkwar.col", 0x0000, 0x0020, CRC(af0fc5e2) SHA1(480908bf893211b580ae19cfb40dc35ad1bbc343) )
|
||||
ROM_END
|
||||
|
||||
|
||||
|
||||
GAME( 1985?, pkunwar, 0, pkunwar, pkunwar, 0, ROT0, "UPL", "Penguin-Kun Wars (US)", 0 )
|
||||
GAME( 1985?, pkunwarj, pkunwar, pkunwar, pkunwar, 0, ROT0, "UPL", "Penguin-Kun Wars (Japan)", 0 )
|
@ -1,296 +0,0 @@
|
||||
/*****************************************************************************
|
||||
|
||||
Raiders5 (c) 1985 Taito / UPL
|
||||
|
||||
Driver by Uki
|
||||
|
||||
02/Jun/2001 -
|
||||
|
||||
******************************************************************************
|
||||
|
||||
Thanks to:
|
||||
|
||||
David Haywood for ninjakid driver.
|
||||
|
||||
Howie Cohen
|
||||
Frank Palazzolo
|
||||
Alex Pasadyn
|
||||
for nova2001 driver.
|
||||
|
||||
Notes:
|
||||
|
||||
"Free Play" does not work properly...?
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
|
||||
extern UINT8 *raiders5_foreground_videoram;
|
||||
extern UINT8 *raiders5_foreground_colorram;
|
||||
extern UINT8 *raiders5_background_videoram;
|
||||
extern UINT8 *raiders5_background_colorram;
|
||||
extern UINT8 *raiders5_spriteram;
|
||||
extern size_t raiders5_spriteram_size;
|
||||
extern UINT8 *raiders5_paletteram;
|
||||
|
||||
VIDEO_START( raiders5 );
|
||||
VIDEO_UPDATE( raiders5 );
|
||||
|
||||
WRITE8_HANDLER( raiders5_scroll_x_w );
|
||||
WRITE8_HANDLER( raiders5_scroll_y_w );
|
||||
WRITE8_HANDLER( raiders5_flip_screen_w );
|
||||
|
||||
WRITE8_HANDLER( raiders5_background_videoram_w );
|
||||
READ8_HANDLER( raiders5_background_videoram_r );
|
||||
WRITE8_HANDLER( raiders5_background_colorram_w );
|
||||
READ8_HANDLER( raiders5_background_colorram_r );
|
||||
WRITE8_HANDLER( raiders5_foreground_videoram_w );
|
||||
WRITE8_HANDLER( raiders5_foreground_colorram_w );
|
||||
|
||||
WRITE8_HANDLER( raiders5_paletteram_w );
|
||||
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( raiders5_map_1, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&raiders5_spriteram) AM_SIZE(&raiders5_spriteram_size)
|
||||
AM_RANGE(0x8800, 0x8bff) AM_READWRITE(MRA8_RAM, raiders5_foreground_videoram_w) AM_BASE(&raiders5_foreground_videoram)
|
||||
AM_RANGE(0x8c00, 0x8fff) AM_READWRITE(MRA8_RAM, raiders5_foreground_colorram_w) AM_BASE(&raiders5_foreground_colorram)
|
||||
AM_RANGE(0x9000, 0x93ff) AM_READWRITE(raiders5_background_videoram_r, raiders5_background_videoram_w) AM_BASE(&raiders5_background_videoram)
|
||||
AM_RANGE(0x9400, 0x97ff) AM_READWRITE(raiders5_background_colorram_r, raiders5_background_colorram_w) AM_BASE(&raiders5_background_colorram)
|
||||
AM_RANGE(0xa000, 0xa000) AM_WRITE(raiders5_scroll_x_w)
|
||||
AM_RANGE(0xa001, 0xa001) AM_WRITE(raiders5_scroll_y_w)
|
||||
AM_RANGE(0xa002, 0xa002) AM_WRITE(raiders5_flip_screen_w)
|
||||
AM_RANGE(0xc000, 0xc000) AM_WRITE(AY8910_control_port_0_w)
|
||||
AM_RANGE(0xc001, 0xc001) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
|
||||
AM_RANGE(0xc002, 0xc002) AM_WRITE(AY8910_control_port_1_w)
|
||||
AM_RANGE(0xc003, 0xc003) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
|
||||
AM_RANGE(0xd000, 0xd1ff) AM_READWRITE(MRA8_RAM, raiders5_paletteram_w) AM_BASE(&paletteram)
|
||||
AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE(1)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( raiders5_map_2, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x8000) AM_WRITE(AY8910_control_port_0_w)
|
||||
AM_RANGE(0x8001, 0x8001) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
|
||||
AM_RANGE(0x8002, 0x8002) AM_WRITE(AY8910_control_port_1_w)
|
||||
AM_RANGE(0x8003, 0x8003) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
|
||||
AM_RANGE(0x9000, 0x9000) AM_READ(MRA8_NOP) /* unknown */
|
||||
AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_SHARE(1)
|
||||
AM_RANGE(0xc000, 0xc000) AM_READ(MRA8_NOP) /* unknown */
|
||||
AM_RANGE(0xc800, 0xc800) AM_READ(MRA8_NOP) /* unknown */
|
||||
AM_RANGE(0xd000, 0xd000) AM_READ(MRA8_NOP) /* unknown */
|
||||
AM_RANGE(0xe000, 0xe000) AM_WRITE(raiders5_scroll_x_w)
|
||||
AM_RANGE(0xe001, 0xe001) AM_WRITE(raiders5_scroll_y_w)
|
||||
AM_RANGE(0xe002, 0xe002) AM_WRITE(raiders5_flip_screen_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( raiders5_io_map_1, ADDRESS_SPACE_IO, 8 )
|
||||
AM_RANGE(0x00, 0x00) AM_READ(MRA8_NOP) /* watchdog? */
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
|
||||
static INPUT_PORTS_START( raiders5 )
|
||||
PORT_START
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
|
||||
|
||||
PORT_START
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
|
||||
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
|
||||
|
||||
PORT_START /* DSW1 */
|
||||
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) )
|
||||
PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )
|
||||
PORT_DIPSETTING( 0x00, "2" )
|
||||
PORT_DIPSETTING( 0x06, "3" )
|
||||
PORT_DIPSETTING( 0x04, "4" )
|
||||
PORT_DIPSETTING( 0x02, "5" )
|
||||
PORT_DIPNAME( 0x08, 0x08, "1st Bonus" )
|
||||
PORT_DIPSETTING( 0x08, "30000" )
|
||||
PORT_DIPSETTING( 0x00, "40000" )
|
||||
PORT_DIPNAME( 0x30, 0x30, "2nd Bonus" )
|
||||
PORT_DIPSETTING( 0x30, "Every(?) 50000" )
|
||||
PORT_DIPSETTING( 0x20, "Every(?) 70000" )
|
||||
PORT_DIPSETTING( 0x10, "Every(?) 90000" )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
|
||||
PORT_DIPNAME( 0x40, 0x40, "Exercise" )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( Normal ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
|
||||
|
||||
PORT_START /* DSW2*/
|
||||
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) )
|
||||
PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 4C_2C ) )
|
||||
PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( 3C_2C ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( 2C_2C ) )
|
||||
PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x03, DEF_STR( 1C_2C ) )
|
||||
|
||||
PORT_DIPNAME( 0x08, 0x08, "High Score Names" )
|
||||
PORT_DIPSETTING( 0x00, "3 Letters" )
|
||||
PORT_DIPSETTING( 0x08, "8 Letters" )
|
||||
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( Yes ) )
|
||||
PORT_DIPNAME( 0x20, 0x20, "Unknown 2-6" )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x80, "Endless Game (If Free Play)" )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
|
||||
static const gfx_layout charlayout =
|
||||
{
|
||||
8,8,
|
||||
512,
|
||||
4,
|
||||
{0,1,2,3},
|
||||
{0,4,8192*8+0,8192*8+4,8,12,8192*8+8,8192*8+12},
|
||||
{16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7},
|
||||
16*8
|
||||
};
|
||||
|
||||
static const gfx_layout spritelayout =
|
||||
{
|
||||
16, 16,
|
||||
128,
|
||||
4,
|
||||
{0,1,2,3},
|
||||
{0,4,8192*8+0,8192*8+4,8,12,8192*8+8,8192*8+12,
|
||||
16*8+0,16*8+4,16*8+8192*8+0,16*8+8192*8+4,16*8+8,16*8+12,16*8+8192*8+8,16*8+8192*8+12},
|
||||
{16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7,
|
||||
16*16, 16*17, 16*18, 16*19, 16*20, 16*21, 16*22, 16*23},
|
||||
16*8*4
|
||||
};
|
||||
|
||||
|
||||
static GFXDECODE_START( raiders5 )
|
||||
GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout, 512, 16 ) /* sprite */
|
||||
GFXDECODE_ENTRY( REGION_GFX1, 0x4000, spritelayout, 512, 16 ) /* sprite */
|
||||
GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 16 ) /* FG */
|
||||
GFXDECODE_ENTRY( REGION_GFX1, 0x8000, charlayout, 256, 16 ) /* BG */
|
||||
GFXDECODE_ENTRY( REGION_GFX1, 0x4000, charlayout, 256, 16 ) /* BG (?)*/
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
static const struct AY8910interface ay8910_interface_1 =
|
||||
{
|
||||
input_port_0_r,
|
||||
input_port_1_r
|
||||
};
|
||||
|
||||
static const struct AY8910interface ay8910_interface_2 =
|
||||
{
|
||||
input_port_2_r,
|
||||
input_port_3_r
|
||||
};
|
||||
|
||||
|
||||
|
||||
static MACHINE_DRIVER_START( raiders5 )
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD(Z80,12000000/4) /* 3.0MHz? */
|
||||
MDRV_CPU_PROGRAM_MAP(raiders5_map_1,0)
|
||||
MDRV_CPU_IO_MAP(raiders5_io_map_1,0)
|
||||
MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
|
||||
|
||||
MDRV_CPU_ADD(Z80,12000000/4) /* 3.0MHz? */
|
||||
MDRV_CPU_PROGRAM_MAP(raiders5_map_2,0)
|
||||
MDRV_CPU_VBLANK_INT(irq0_line_hold,4)
|
||||
|
||||
MDRV_INTERLEAVE(400)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
|
||||
MDRV_PALETTE_LENGTH(768)
|
||||
MDRV_GFXDECODE(raiders5)
|
||||
MDRV_VIDEO_START(raiders5)
|
||||
MDRV_VIDEO_UPDATE(raiders5)
|
||||
|
||||
MDRV_SCREEN_ADD("main", 0)
|
||||
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
||||
MDRV_SCREEN_SIZE(32*8, 32*8)
|
||||
MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
|
||||
MDRV_SCREEN_REFRESH_RATE(60)
|
||||
MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MDRV_SOUND_ADD(AY8910, 12000000/8)
|
||||
MDRV_SOUND_CONFIG(ay8910_interface_1)
|
||||
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
|
||||
|
||||
MDRV_SOUND_ADD(AY8910, 12000000/8)
|
||||
MDRV_SOUND_CONFIG(ay8910_interface_2)
|
||||
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
|
||||
|
||||
ROM_START( raiders5 )
|
||||
ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* CPU1 */
|
||||
ROM_LOAD( "raiders5.1", 0x0000, 0x4000, CRC(47cea11f) SHA1(0499e6627ad9c16775fdc59f2ff56dfdfc23490a) )
|
||||
ROM_LOAD( "raiders5.2", 0x4000, 0x4000, CRC(eb2ff410) SHA1(5c995b66b6301cd3cd58efd173481deaa036f842) )
|
||||
|
||||
ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* CPU2 */
|
||||
ROM_LOAD( "raiders5.2", 0x0000, 0x4000, CRC(eb2ff410) SHA1(5c995b66b6301cd3cd58efd173481deaa036f842) )
|
||||
|
||||
ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
|
||||
ROM_LOAD( "raiders3.11f", 0x0000, 0x4000, CRC(30041d58) SHA1(a33087de7afb276925879898a96f418128a5a38c) )
|
||||
ROM_LOAD( "raiders4.11g", 0x4000, 0x4000, CRC(e441931c) SHA1(f39b4c25de779c671a6e2b02df64e7fed726f4da) )
|
||||
ROM_LOAD( "raiders5.11n", 0x8000, 0x4000, CRC(c0895090) SHA1(a3a1ae57ed66bc095ea9bfb26470290f67aab1fe) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( raidrs5t )
|
||||
ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* CPU1 */
|
||||
ROM_LOAD( "raiders1.4c", 0x0000, 0x4000, CRC(4e2d5679) SHA1(a1c1603ba98814a83b92ad024ca4422aea872111) )
|
||||
ROM_LOAD( "raiders2.4d", 0x4000, 0x4000, CRC(c8604be1) SHA1(6d23f26174bb9b2f7db3a5fa6b39674fe237135b) )
|
||||
|
||||
ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* CPU2 */
|
||||
ROM_LOAD( "raiders2.4d", 0x0000, 0x4000, CRC(c8604be1) SHA1(6d23f26174bb9b2f7db3a5fa6b39674fe237135b) )
|
||||
|
||||
ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
|
||||
ROM_LOAD( "raiders3.11f", 0x0000, 0x4000, CRC(30041d58) SHA1(a33087de7afb276925879898a96f418128a5a38c) )
|
||||
ROM_LOAD( "raiders4.11g", 0x4000, 0x4000, CRC(e441931c) SHA1(f39b4c25de779c671a6e2b02df64e7fed726f4da) )
|
||||
ROM_LOAD( "raiders5.11n", 0x8000, 0x4000, CRC(c0895090) SHA1(a3a1ae57ed66bc095ea9bfb26470290f67aab1fe) )
|
||||
ROM_END
|
||||
|
||||
|
||||
|
||||
GAME( 1985, raiders5, 0, raiders5, raiders5, 0, ROT0, "UPL", "Raiders5", 0 )
|
||||
GAME( 1985, raidrs5t, raiders5, raiders5, raiders5, 0, ROT0, "UPL (Taito license)", "Raiders5 (Japan)", 0 )
|
21
src/mame/includes/nova2001.h
Normal file
21
src/mame/includes/nova2001.h
Normal file
@ -0,0 +1,21 @@
|
||||
extern UINT8 *nova2001_fg_videoram, *nova2001_bg_videoram;
|
||||
|
||||
extern WRITE8_HANDLER( nova2001_fg_videoram_w );
|
||||
extern WRITE8_HANDLER( nova2001_bg_videoram_w );
|
||||
extern WRITE8_HANDLER( ninjakun_bg_videoram_w );
|
||||
extern READ8_HANDLER( ninjakun_bg_videoram_r );
|
||||
extern WRITE8_HANDLER( nova2001_scroll_x_w );
|
||||
extern WRITE8_HANDLER( nova2001_scroll_y_w );
|
||||
extern WRITE8_HANDLER( nova2001_flipscreen_w );
|
||||
extern WRITE8_HANDLER( pkunwar_flipscreen_w );
|
||||
extern WRITE8_HANDLER( ninjakun_paletteram_w );
|
||||
|
||||
extern PALETTE_INIT( nova2001 );
|
||||
extern VIDEO_START( nova2001 );
|
||||
extern VIDEO_UPDATE( nova2001 );
|
||||
extern VIDEO_START( ninjakun );
|
||||
extern VIDEO_UPDATE( ninjakun );
|
||||
extern VIDEO_START( pkunwar );
|
||||
extern VIDEO_UPDATE( pkunwar );
|
||||
extern VIDEO_START( raiders5 );
|
||||
extern VIDEO_UPDATE( raiders5 );
|
@ -1441,11 +1441,8 @@ $(MAMEOBJ)/univers.a: \
|
||||
|
||||
$(MAMEOBJ)/upl.a: \
|
||||
$(DRIVERS)/mouser.o $(VIDEO)/mouser.o \
|
||||
$(DRIVERS)/ninjakun.o $(VIDEO)/ninjakun.o \
|
||||
$(DRIVERS)/ninjakd2.o $(VIDEO)/ninjakd2.o \
|
||||
$(DRIVERS)/nova2001.o $(VIDEO)/nova2001.o \
|
||||
$(DRIVERS)/pkunwar.o $(VIDEO)/pkunwar.o \
|
||||
$(DRIVERS)/raiders5.o $(VIDEO)/raiders5.o \
|
||||
$(DRIVERS)/xxmissio.o $(VIDEO)/xxmissio.o \
|
||||
|
||||
$(MAMEOBJ)/valadon.a: \
|
||||
|
@ -25,6 +25,12 @@ static UINT8* robokid_bg1_videoram;
|
||||
static UINT8* robokid_bg2_videoram;
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Callbacks for the TileMap code
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static TILE_GET_INFO( get_fg_tile_info )
|
||||
{
|
||||
int const lo = ninjakd2_fg_videoram[(tile_index << 1)];
|
||||
@ -113,6 +119,12 @@ static TILE_GET_INFO( robokid_get_bg2_tile_info )
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video system start
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void videoram_alloc(const running_machine* const machine, int const size)
|
||||
{
|
||||
if (size)
|
||||
@ -194,6 +206,12 @@ VIDEO_START( omegaf )
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Memory handlers
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_HANDLER( ninjakd2_bgvideoram_w )
|
||||
{
|
||||
ninjakd2_bg_videoram[offset] = data;
|
||||
@ -310,6 +328,13 @@ WRITE8_HANDLER( ninjakd2_sprite_overdraw_w )
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video update
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void draw_sprites(running_machine* const machine, mame_bitmap* const bitmap, const rectangle* const cliprect)
|
||||
{
|
||||
const gfx_element* const gfx = machine->gfx[1];
|
||||
|
@ -1,305 +0,0 @@
|
||||
#include "driver.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
|
||||
UINT8 *ninjakun_fg_videoram;
|
||||
UINT8 *ninjakun_bg_videoram;
|
||||
static tilemap *bg_tilemap, *fg_tilemap;
|
||||
static UINT8 flipscreen;
|
||||
static UINT8 ninjakun_xscroll,ninjakun_yscroll;
|
||||
|
||||
static UINT8 ninjakun_io_8000_ctrl[4];
|
||||
// static UINT8 old_scroll;
|
||||
|
||||
/*******************************************************************************
|
||||
Tilemap Callbacks
|
||||
*******************************************************************************/
|
||||
|
||||
static TILE_GET_INFO( get_fg_tile_info ){
|
||||
UINT32 tile_number = ninjakun_fg_videoram[tile_index] & 0xFF;
|
||||
UINT8 attr = ninjakun_fg_videoram[tile_index+0x400];
|
||||
tile_number += (attr & 0x20) << 3; /* bank */
|
||||
SET_TILE_INFO(
|
||||
0,
|
||||
tile_number,
|
||||
(attr&0xf),
|
||||
0);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( get_bg_tile_info ){
|
||||
UINT32 tile_number = ninjakun_bg_videoram[tile_index] & 0xFF;
|
||||
UINT8 attr = ninjakun_bg_videoram[tile_index+0x400];
|
||||
tile_number += (attr & 0xC0) << 2; /* bank */
|
||||
SET_TILE_INFO(
|
||||
1,
|
||||
tile_number,
|
||||
(attr&0xf),
|
||||
0);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( ninjakun_fg_videoram_w ){
|
||||
ninjakun_fg_videoram[offset] = data;
|
||||
tilemap_mark_tile_dirty(fg_tilemap,offset&0x3ff);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( ninjakun_bg_videoram_w ){
|
||||
|
||||
int y = (offset + ((ninjakun_yscroll & 0xf8) << 2) ) & 0x3e0;
|
||||
int x = (offset + (ninjakun_xscroll >> 3) ) & 0x1f;
|
||||
int offs = x+y+(offset & 0x400);
|
||||
|
||||
ninjakun_bg_videoram[offs] = data;
|
||||
tilemap_mark_tile_dirty(bg_tilemap,x+y);
|
||||
}
|
||||
|
||||
READ8_HANDLER( ninjakun_bg_videoram_r )
|
||||
{
|
||||
int y = (offset + ((ninjakun_yscroll & 0xf8) << 2) ) & 0x3e0;
|
||||
int x = (offset + (ninjakun_xscroll >> 3) ) & 0x1f;
|
||||
int offs = x+y+(offset & 0x400);
|
||||
|
||||
return ninjakun_bg_videoram[offs];
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
WRITE8_HANDLER( ninjakun_flipscreen_w ){
|
||||
flipscreen = data?(TILEMAP_FLIPX|TILEMAP_FLIPY):0;
|
||||
tilemap_set_flip( ALL_TILEMAPS,flipscreen );
|
||||
}
|
||||
|
||||
READ8_HANDLER( ninjakun_io_8000_r ){
|
||||
switch( offset ){
|
||||
case 0: /* control */
|
||||
return AY8910_read_port_0_r( 0 );
|
||||
|
||||
case 1: /* input read */
|
||||
switch( ninjakun_io_8000_ctrl[0] ){
|
||||
case 0xf:
|
||||
return readinputport(4);
|
||||
case 0xe:
|
||||
return readinputport(3);
|
||||
default:
|
||||
return ninjakun_io_8000_ctrl[1];
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: /* control */
|
||||
return AY8910_read_port_1_r( 0 );
|
||||
|
||||
case 3: /* data */
|
||||
return ninjakun_io_8000_ctrl[3];
|
||||
}
|
||||
|
||||
// logerror("PC=%04x; RAM[0x800%d]\n",activecpu_get_pc(),offset);
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
/* static void handle_scrolly( UINT8 new_scroll ){ */
|
||||
|
||||
/* HACK!!!
|
||||
**
|
||||
** New rows are always written at fixed locations above and below the background
|
||||
** tilemaps, rather than at the logical screen boundaries with respect to scrolling.
|
||||
**
|
||||
** I don't know how this is handled by the actual NinjaKun hardware, but the
|
||||
** following is a crude approximation, yielding a playable game.
|
||||
*/
|
||||
|
||||
/*
|
||||
int old_row = old_scroll/8;
|
||||
int new_row = new_scroll/8;
|
||||
int i;
|
||||
if( new_scroll!=old_scroll ){
|
||||
tilemap_set_scrolly( bg_tilemap, 0, new_scroll&7 );
|
||||
|
||||
if ((new_row == ((old_row - 1) & 0xff)) || ((!old_row) && (new_row == 0x1f)))
|
||||
{
|
||||
for( i=0x400-0x21; i>=0; i-- ){
|
||||
ninjakun_bg_videoram_w( i+0x20, ninjakun_bg_videoram[i] );
|
||||
}
|
||||
}
|
||||
else if ((new_row == ((old_row + 1) & 0xff)) || ((old_row == 0x1f) && (!new_row)))
|
||||
{
|
||||
for( i=0x20; i<0x400; i++ ){
|
||||
ninjakun_bg_videoram_w( i-0x20, ninjakun_bg_videoram[i] );
|
||||
}
|
||||
}
|
||||
|
||||
old_scroll = new_scroll;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
WRITE8_HANDLER( ninjakun_io_8000_w ){
|
||||
switch( offset ){
|
||||
case 0x0: /* control#1 */
|
||||
ninjakun_io_8000_ctrl[0] = data;
|
||||
AY8910_control_port_0_w( 0, data );
|
||||
break;
|
||||
|
||||
case 0x1: /* data#1 */
|
||||
ninjakun_io_8000_ctrl[1] = data;
|
||||
switch( ninjakun_io_8000_ctrl[0] ){
|
||||
default:
|
||||
AY8910_write_port_0_w( 0,data );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x2: /* control#2 */
|
||||
ninjakun_io_8000_ctrl[2] = data;
|
||||
AY8910_control_port_1_w( 0, data );
|
||||
break;
|
||||
|
||||
case 0x3: /* data#2 */
|
||||
ninjakun_io_8000_ctrl[3] = data;
|
||||
switch( ninjakun_io_8000_ctrl[2] ){
|
||||
case 0xf:
|
||||
tilemap_set_scrolly( bg_tilemap, 0, data );
|
||||
ninjakun_yscroll = data;
|
||||
break;
|
||||
case 0xe:
|
||||
if (flipscreen == 0)
|
||||
tilemap_set_scrollx( bg_tilemap, 0, data-7 );
|
||||
else
|
||||
tilemap_set_scrollx( bg_tilemap, 0, data );
|
||||
ninjakun_xscroll = data;
|
||||
break;
|
||||
default:
|
||||
AY8910_write_port_1_w( 0,data );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( ninjakun_paletteram_w )
|
||||
{
|
||||
int i;
|
||||
|
||||
paletteram_BBGGRRII_w(offset,data);
|
||||
|
||||
if (offset > 15)
|
||||
return;
|
||||
|
||||
if (offset != 1)
|
||||
{
|
||||
for (i=0; i<16; i++)
|
||||
{
|
||||
paletteram_BBGGRRII_w(0x200+offset+i*16,data);
|
||||
}
|
||||
}
|
||||
paletteram_BBGGRRII_w(0x200+offset*16+1,data);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
Video Hardware Functions
|
||||
********************************************************************************
|
||||
vh_start / vh_refresh
|
||||
*******************************************************************************/
|
||||
|
||||
VIDEO_START( ninjakun ){
|
||||
fg_tilemap = tilemap_create( get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
|
||||
bg_tilemap = tilemap_create( get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
|
||||
tilemap_set_transparent_pen( fg_tilemap,0 );
|
||||
|
||||
/* Save State Support */
|
||||
|
||||
state_save_register_global_array(ninjakun_io_8000_ctrl);
|
||||
state_save_register_global(flipscreen);
|
||||
// state_save_register_global(old_scroll);
|
||||
}
|
||||
|
||||
static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect ){
|
||||
const UINT8 *source = spriteram;
|
||||
const UINT8 *finish = source+0x800;
|
||||
|
||||
const gfx_element *gfx = machine->gfx[2];
|
||||
|
||||
while( source<finish ){
|
||||
int tile_number = source[0];
|
||||
int sx = source[1];
|
||||
int sy = source[2];
|
||||
int attr = source[3];
|
||||
int flipx = attr&0x10;
|
||||
int flipy = attr&0x20;
|
||||
int color = attr&0x0f;
|
||||
|
||||
if( flipscreen ){
|
||||
sx = 240-sx;
|
||||
sy = 240-sy;
|
||||
flipx = !flipx;
|
||||
flipy = !flipy;
|
||||
}
|
||||
|
||||
drawgfx(
|
||||
bitmap,
|
||||
gfx,
|
||||
tile_number,
|
||||
color,
|
||||
flipx,flipy,
|
||||
sx,sy,
|
||||
cliprect,
|
||||
TRANSPARENCY_PEN,0
|
||||
);
|
||||
if (sx>240)
|
||||
drawgfx(
|
||||
bitmap,
|
||||
gfx,
|
||||
tile_number,
|
||||
color,
|
||||
flipx,flipy,
|
||||
sx-256,sy,
|
||||
cliprect,
|
||||
TRANSPARENCY_PEN,0
|
||||
);
|
||||
|
||||
source+=0x20;
|
||||
}
|
||||
}
|
||||
|
||||
VIDEO_UPDATE( ninjakun )
|
||||
{
|
||||
int offs,chr,col,px,py,x,y;
|
||||
|
||||
tilemap_draw( bitmap,cliprect,bg_tilemap,0,0 );
|
||||
tilemap_draw( bitmap,cliprect,fg_tilemap,0,0 );
|
||||
draw_sprites( machine, bitmap,cliprect );
|
||||
|
||||
for (y=4; y<28; y++)
|
||||
{
|
||||
for (x=0; x<32; x++)
|
||||
{
|
||||
offs = y*32+x;
|
||||
chr = ninjakun_fg_videoram[offs];
|
||||
col = ninjakun_fg_videoram[offs + 0x400];
|
||||
chr += (col & 0x20) << 3;
|
||||
|
||||
if ((col & 0x10) == 0)
|
||||
{
|
||||
|
||||
if (flipscreen==0)
|
||||
{
|
||||
px = 8*x;
|
||||
py = 8*y;
|
||||
}
|
||||
else
|
||||
{
|
||||
px = 248-8*x;
|
||||
py = 248-8*y;
|
||||
}
|
||||
|
||||
drawgfx(bitmap,machine->gfx[0],
|
||||
chr,
|
||||
col & 0x0f,
|
||||
flipscreen,flipscreen,
|
||||
px,py,
|
||||
cliprect,TRANSPARENCY_PEN,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,64 +1,20 @@
|
||||
/*******************************************************************************
|
||||
|
||||
Nova 2001 - Video Description:
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Foreground Playfield Chars (static)
|
||||
character code index from first set of chars
|
||||
Foreground Playfield color modifier RAM
|
||||
Char colors are normally taken from the first set of 16,
|
||||
This is the pen for "color 1" for this tile (from the first 16 pens)
|
||||
|
||||
Background Playfield Chars (scrolling)
|
||||
character code index from second set of chars
|
||||
Foreground Playfield color modifier RAM
|
||||
Char colors are normally taken from the second set of 16,
|
||||
This is the pen for "color 1" for this tile (from the second 16 pens)
|
||||
(Scrolling in controlled via the 8910 A and B port outputs)
|
||||
|
||||
Sprite memory is made of 32 byte records:
|
||||
|
||||
Sprite+0, 0x80 = Sprite Bank
|
||||
Sprite+0, 0x7f = Sprite Character Code
|
||||
Sprite+1, 0xff = X location
|
||||
Sprite+2, 0xff = Y location
|
||||
Sprite+3, 0x20 = Y Flip
|
||||
Sprite+3, 0x10 = X Flip
|
||||
Sprite+3, 0x0f = pen for "color 1" taken from the first 16 colors
|
||||
Sprite+3, 0x80
|
||||
Sprite+3, 0x40
|
||||
|
||||
All the rest are unknown and/or uneccessary.
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "nova2001.h"
|
||||
|
||||
UINT8 *nova2001_videoram2, *nova2001_colorram2;
|
||||
UINT8 *nova2001_fg_videoram, *nova2001_bg_videoram;
|
||||
|
||||
static tilemap *bg_tilemap, *fg_tilemap;
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Palette handling
|
||||
*
|
||||
*************************************/
|
||||
|
||||
PALETTE_INIT( nova2001 )
|
||||
{
|
||||
int i,j;
|
||||
|
||||
|
||||
for (i = 0;i < machine->drv->total_colors;i++)
|
||||
{
|
||||
int intensity,r,g,b;
|
||||
|
||||
|
||||
intensity = (*color_prom >> 0) & 0x03;
|
||||
/* red component */
|
||||
r = (((*color_prom >> 0) & 0x0c) | intensity) * 0x11;
|
||||
/* green component */
|
||||
g = (((*color_prom >> 2) & 0x0c) | intensity) * 0x11;
|
||||
/* blue component */
|
||||
b = (((*color_prom >> 4) & 0x0c) | intensity) * 0x11;
|
||||
|
||||
palette_set_color(machine,i,MAKE_RGB(r,g,b));
|
||||
color_prom++;
|
||||
}
|
||||
int i;
|
||||
|
||||
/* Color #1 is used for palette animation. */
|
||||
|
||||
@ -66,54 +22,215 @@ PALETTE_INIT( nova2001 )
|
||||
/* the primary 16 colors, while color entries 16-31 */
|
||||
/* are based on the secondary set. */
|
||||
|
||||
/* The only difference among 0-15 and 16-31 is that */
|
||||
/* The only difference between 0-15 and 16-31 is that */
|
||||
/* color #1 changes each time */
|
||||
|
||||
for (i = 0;i < 16;i++)
|
||||
for (i = 0; i < 0x200; ++i)
|
||||
{
|
||||
for (j = 0;j < 16;j++)
|
||||
int entry;
|
||||
int intensity,r,g,b;
|
||||
|
||||
if ((i & 0xf) == 1)
|
||||
{
|
||||
if (j == 1)
|
||||
entry = ((i & 0xf0) >> 4) | ((i & 0x100) >> 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = ((i & 0x0f) >> 0) | ((i & 0x100) >> 4);
|
||||
}
|
||||
|
||||
intensity = (color_prom[entry] >> 0) & 0x03;
|
||||
/* red component */
|
||||
r = (((color_prom[entry] >> 0) & 0x0c) | intensity) * 0x11;
|
||||
/* green component */
|
||||
g = (((color_prom[entry] >> 2) & 0x0c) | intensity) * 0x11;
|
||||
/* blue component */
|
||||
b = (((color_prom[entry] >> 4) & 0x0c) | intensity) * 0x11;
|
||||
|
||||
palette_set_color(machine,i,MAKE_RGB(r,g,b));
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( ninjakun_paletteram_w )
|
||||
{
|
||||
int i;
|
||||
|
||||
paletteram_BBGGRRII_w(offset,data);
|
||||
|
||||
// expand the sprite palette to full length
|
||||
if (offset < 16)
|
||||
{
|
||||
paletteram_BBGGRRII_w(0x200 + offset * 16 + 1, data);
|
||||
|
||||
if (offset != 1)
|
||||
{
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
colortable[16*i+1] = i;
|
||||
colortable[16*i+16*16+1] = i+16;
|
||||
}
|
||||
else
|
||||
{
|
||||
colortable[16*i+j] = j;
|
||||
colortable[16*i+16*16+j] = j+16;
|
||||
paletteram_BBGGRRII_w(0x200 + offset + i * 16, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( nova2001_videoram_w )
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Callbacks for the TileMap code
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static TILE_GET_INFO( nova2001_get_bg_tile_info )
|
||||
{
|
||||
videoram[offset] = data;
|
||||
tilemap_mark_tile_dirty(bg_tilemap, offset);
|
||||
int code = nova2001_bg_videoram[tile_index];
|
||||
int color = nova2001_bg_videoram[tile_index + 0x400] & 0x0f;
|
||||
|
||||
SET_TILE_INFO(2, code, color, 0);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( nova2001_colorram_w )
|
||||
static TILE_GET_INFO( nova2001_get_fg_tile_info )
|
||||
{
|
||||
colorram[offset] = data;
|
||||
tilemap_mark_tile_dirty(bg_tilemap, offset);
|
||||
int attr = nova2001_fg_videoram[tile_index + 0x400];
|
||||
int code = nova2001_fg_videoram[tile_index];
|
||||
int color = attr & 0x0f;
|
||||
|
||||
SET_TILE_INFO(1, code, color, 0);
|
||||
|
||||
tileinfo->category = (attr & 0x10) >> 4;
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( nova2001_videoram2_w )
|
||||
static TILE_GET_INFO( ninjakun_get_bg_tile_info )
|
||||
{
|
||||
nova2001_videoram2[offset] = data;
|
||||
tilemap_mark_tile_dirty(fg_tilemap, offset);
|
||||
int attr = nova2001_bg_videoram[tile_index+0x400];
|
||||
int code = nova2001_bg_videoram[tile_index] + ((attr & 0xc0) << 2);
|
||||
int color = attr & 0x0f;
|
||||
|
||||
SET_TILE_INFO(2, code, color, 0);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( nova2001_colorram2_w )
|
||||
static TILE_GET_INFO( ninjakun_get_fg_tile_info )
|
||||
{
|
||||
nova2001_colorram2[offset] = data;
|
||||
tilemap_mark_tile_dirty(fg_tilemap, offset);
|
||||
int attr = nova2001_fg_videoram[tile_index+0x400];
|
||||
int code = nova2001_fg_videoram[tile_index] + ((attr & 0x20) << 3);
|
||||
int color = attr & 0x0f;
|
||||
|
||||
SET_TILE_INFO(1, code, color, 0);
|
||||
|
||||
tileinfo->category = (attr & 0x10) >> 4;
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( pkunwar_get_bg_tile_info )
|
||||
{
|
||||
int attr = nova2001_bg_videoram[tile_index + 0x400];
|
||||
int code = nova2001_bg_videoram[tile_index] + ((attr & 0x07) << 8);
|
||||
int color = (attr & 0xf0) >> 4;
|
||||
|
||||
SET_TILE_INFO(1, code, color, 0);
|
||||
|
||||
tileinfo->category = (attr & 0x08) >> 3;
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( raiders5_get_bg_tile_info )
|
||||
{
|
||||
int attr = nova2001_bg_videoram[tile_index+0x400];
|
||||
int code = nova2001_bg_videoram[tile_index] + ((attr & 0x01) << 8);
|
||||
int color = (attr & 0xf0) >> 4;
|
||||
|
||||
SET_TILE_INFO(2, code, color, 0);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( raiders5_get_fg_tile_info )
|
||||
{
|
||||
int code = nova2001_fg_videoram[tile_index];
|
||||
int color = (nova2001_fg_videoram[tile_index + 0x400] & 0xf0) >> 4;
|
||||
|
||||
SET_TILE_INFO(1, code, color, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video system start
|
||||
*
|
||||
*************************************/
|
||||
|
||||
VIDEO_START( nova2001 )
|
||||
{
|
||||
bg_tilemap = tilemap_create(nova2001_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
|
||||
fg_tilemap = tilemap_create(nova2001_get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
|
||||
tilemap_set_transparent_pen(fg_tilemap, 0);
|
||||
tilemap_set_scrolldx(bg_tilemap, 0, -7);
|
||||
}
|
||||
|
||||
VIDEO_START( pkunwar )
|
||||
{
|
||||
bg_tilemap = tilemap_create(pkunwar_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
|
||||
tilemap_set_transparent_pen(bg_tilemap, 0);
|
||||
}
|
||||
|
||||
VIDEO_START( ninjakun )
|
||||
{
|
||||
bg_tilemap = tilemap_create(ninjakun_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
|
||||
fg_tilemap = tilemap_create(ninjakun_get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
|
||||
tilemap_set_transparent_pen(fg_tilemap, 0);
|
||||
tilemap_set_scrolldx(bg_tilemap, 7, 0);
|
||||
}
|
||||
|
||||
VIDEO_START( raiders5 )
|
||||
{
|
||||
bg_tilemap = tilemap_create(raiders5_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
|
||||
fg_tilemap = tilemap_create(raiders5_get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
|
||||
tilemap_set_transparent_pen(fg_tilemap, 0);
|
||||
tilemap_set_scrolldx(bg_tilemap, 7, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Memory handlers
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_HANDLER( nova2001_fg_videoram_w )
|
||||
{
|
||||
nova2001_fg_videoram[offset] = data;
|
||||
tilemap_mark_tile_dirty(fg_tilemap, offset & 0x3ff);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( nova2001_bg_videoram_w )
|
||||
{
|
||||
nova2001_bg_videoram[offset] = data;
|
||||
tilemap_mark_tile_dirty(bg_tilemap,offset & 0x3ff);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( ninjakun_bg_videoram_w )
|
||||
{
|
||||
int x = tilemap_get_scrollx(bg_tilemap, 0) >> 3;
|
||||
int y = tilemap_get_scrolly(bg_tilemap, 0) >> 3;
|
||||
|
||||
// add scroll registers to address
|
||||
offset = ((offset + x + (y << 5)) & 0x3ff) + (offset & 0x400);
|
||||
|
||||
nova2001_bg_videoram[offset] = data;
|
||||
tilemap_mark_tile_dirty(bg_tilemap,offset & 0x3ff);
|
||||
}
|
||||
|
||||
READ8_HANDLER( ninjakun_bg_videoram_r )
|
||||
{
|
||||
int x = tilemap_get_scrollx(bg_tilemap, 0) >> 3;
|
||||
int y = tilemap_get_scrolly(bg_tilemap, 0) >> 3;
|
||||
|
||||
// add scroll registers to address
|
||||
offset = ((offset + x + (y << 5)) & 0x3ff) + (offset & 0x400);
|
||||
|
||||
return nova2001_bg_videoram[offset];
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( nova2001_scroll_x_w )
|
||||
{
|
||||
tilemap_set_scrollx(bg_tilemap, 0, data - (flip_screen ? 0 : 7));
|
||||
tilemap_set_scrollx(bg_tilemap, 0, data);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( nova2001_scroll_y_w )
|
||||
@ -123,50 +240,42 @@ WRITE8_HANDLER( nova2001_scroll_y_w )
|
||||
|
||||
WRITE8_HANDLER( nova2001_flipscreen_w )
|
||||
{
|
||||
if (flip_screen != (~data & 0x01))
|
||||
{
|
||||
flip_screen_set(~data & 0x01);
|
||||
tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
|
||||
}
|
||||
// inverted
|
||||
flip_screen_set(~data & 1);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( get_bg_tile_info )
|
||||
WRITE8_HANDLER( pkunwar_flipscreen_w )
|
||||
{
|
||||
int code = videoram[tile_index];
|
||||
int color = colorram[tile_index] & 0x0f;
|
||||
|
||||
SET_TILE_INFO(1, code, color, 0);
|
||||
flip_screen_set(data & 1);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( get_fg_tile_info )
|
||||
{
|
||||
int code = nova2001_videoram2[tile_index];
|
||||
int color = nova2001_colorram2[tile_index] & 0x0f;
|
||||
|
||||
SET_TILE_INFO(0, code, color, 0);
|
||||
}
|
||||
|
||||
VIDEO_START( nova2001 )
|
||||
{
|
||||
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
|
||||
TILEMAP_TYPE_PEN, 8, 8, 32, 32);
|
||||
|
||||
fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
|
||||
TILEMAP_TYPE_PEN, 8, 8, 32, 32);
|
||||
|
||||
tilemap_set_transparent_pen(fg_tilemap, 0);
|
||||
}
|
||||
|
||||
static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video update
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void nova2001_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
|
||||
{
|
||||
const gfx_element *gfx = machine->gfx[0];
|
||||
int offs;
|
||||
|
||||
for (offs = 0;offs < spriteram_size;offs += 32)
|
||||
for (offs = 0; offs < 0x800; offs += 32)
|
||||
{
|
||||
int flipx = spriteram[offs+3] & 0x10;
|
||||
int flipy = spriteram[offs+3] & 0x20;
|
||||
int sx = spriteram[offs+1];
|
||||
int attr = spriteram[offs+3];
|
||||
int flipx = attr & 0x10;
|
||||
int flipy = attr & 0x20;
|
||||
int sx = spriteram[offs+1] - ((attr & 0x40) << 2); // high bit shown in schematics, not used by game
|
||||
int sy = spriteram[offs+2];
|
||||
int tile = spriteram[offs+0];
|
||||
int color = attr & 0x0f;
|
||||
|
||||
if (attr & 0x80) // disable bit shown in schematics, not used by game
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (flip_screen)
|
||||
{
|
||||
@ -176,19 +285,108 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re
|
||||
flipy = !flipy;
|
||||
}
|
||||
|
||||
drawgfx(bitmap,machine->gfx[2 + ((spriteram[offs+0] & 0x80) >> 7)],
|
||||
spriteram[offs+0] & 0x7f,
|
||||
spriteram[offs+3] & 0x0f,
|
||||
flipx,flipy,
|
||||
sx,sy,
|
||||
cliprect,TRANSPARENCY_PEN,0);
|
||||
drawgfx(bitmap, gfx,
|
||||
tile,
|
||||
color,
|
||||
flipx, flipy,
|
||||
sx, sy,
|
||||
cliprect, TRANSPARENCY_PEN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void pkunwar_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
|
||||
{
|
||||
const gfx_element *gfx = machine->gfx[0];
|
||||
int offs;
|
||||
|
||||
for (offs = 0; offs < 0x800; offs += 32)
|
||||
{
|
||||
int attr = spriteram[offs+3];
|
||||
int flipx = spriteram[offs+0] & 0x01;
|
||||
int flipy = spriteram[offs+0] & 0x02;
|
||||
int sx = spriteram[offs+1];
|
||||
int sy = spriteram[offs+2];
|
||||
int tile = ((spriteram[offs+0] & 0xfc) >> 2) + ((attr & 0x07) << 6);
|
||||
int color = (attr & 0xf0) >> 4;
|
||||
|
||||
if (attr & 0x08) // deducted by comparison, not used by game
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (flip_screen)
|
||||
{
|
||||
sx = 240 - sx;
|
||||
sy = 240 - sy;
|
||||
flipx = !flipx;
|
||||
flipy = !flipy;
|
||||
}
|
||||
|
||||
drawgfx(bitmap, gfx,
|
||||
tile,
|
||||
color,
|
||||
flipx, flipy,
|
||||
sx, sy,
|
||||
cliprect, TRANSPARENCY_PEN, 0);
|
||||
|
||||
// there's no X MSB, so draw with wraparound (fixes title screen)
|
||||
drawgfx(bitmap, gfx,
|
||||
tile,
|
||||
color,
|
||||
flipx, flipy,
|
||||
sx - 256, sy,
|
||||
cliprect, TRANSPARENCY_PEN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
VIDEO_UPDATE( nova2001 )
|
||||
{
|
||||
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
|
||||
draw_sprites(machine, bitmap, cliprect);
|
||||
|
||||
nova2001_draw_sprites(machine, bitmap, cliprect);
|
||||
|
||||
// according to the schematics, fg category 0 should be drawn behind sprites,
|
||||
// but it doesn't look right that way
|
||||
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
|
||||
tilemap_draw(bitmap, cliprect, fg_tilemap, 1, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
VIDEO_UPDATE( pkunwar )
|
||||
{
|
||||
tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0);
|
||||
tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 1, 0);
|
||||
|
||||
pkunwar_draw_sprites(machine, bitmap, cliprect);
|
||||
|
||||
tilemap_draw(bitmap, cliprect, bg_tilemap, 1, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
VIDEO_UPDATE( ninjakun )
|
||||
{
|
||||
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
|
||||
|
||||
tilemap_draw(bitmap, cliprect, fg_tilemap, 1, 0);
|
||||
|
||||
nova2001_draw_sprites(machine, bitmap, cliprect);
|
||||
|
||||
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
VIDEO_UPDATE( raiders5 )
|
||||
{
|
||||
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
|
||||
|
||||
pkunwar_draw_sprites(machine, bitmap, cliprect);
|
||||
|
||||
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,100 +0,0 @@
|
||||
/***************************************************************************
|
||||
|
||||
video.c
|
||||
|
||||
Functions to emulate the video hardware of the machine.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
|
||||
|
||||
static int flipscreen[2];
|
||||
|
||||
|
||||
WRITE8_HANDLER( pkunwar_flipscreen_w )
|
||||
{
|
||||
flipscreen[0] = data & 1;
|
||||
flipscreen[1] = data & 2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
VIDEO_UPDATE( pkunwar )
|
||||
{
|
||||
int offs;
|
||||
|
||||
|
||||
/* for every character in the Video RAM */
|
||||
for (offs = videoram_size - 1;offs >= 0;offs--)
|
||||
{
|
||||
int sx,sy;
|
||||
|
||||
|
||||
sx = offs % 32;
|
||||
sy = offs / 32;
|
||||
if (flipscreen[0]) sx = 31 - sx;
|
||||
if (flipscreen[1]) sy = 31 - sy;
|
||||
|
||||
drawgfx(bitmap,machine->gfx[0],
|
||||
videoram[offs] + ((colorram[offs] & 0x07) << 8),
|
||||
(colorram[offs] & 0xf0) >> 4,
|
||||
flipscreen[0],flipscreen[1],
|
||||
8*sx,8*sy,
|
||||
cliprect,TRANSPARENCY_NONE,0);
|
||||
}
|
||||
|
||||
|
||||
/* Draw the sprites. */
|
||||
for (offs = 0;offs < spriteram_size;offs += 32)
|
||||
{
|
||||
int sx,sy,flipx,flipy;
|
||||
|
||||
|
||||
sx = ((spriteram[offs + 1] + 8) & 0xff) - 8;
|
||||
sy = spriteram[offs + 2];
|
||||
flipx = spriteram[offs] & 0x01;
|
||||
flipy = spriteram[offs] & 0x02;
|
||||
if (flipscreen[0])
|
||||
{
|
||||
sx = 240 - sx;
|
||||
flipx = !flipx;
|
||||
}
|
||||
if (flipscreen[1])
|
||||
{
|
||||
sy = 240 - sy;
|
||||
flipy = !flipy;
|
||||
}
|
||||
|
||||
drawgfx(bitmap,machine->gfx[1],
|
||||
((spriteram[offs] & 0xfc) >> 2) + ((spriteram[offs + 3] & 0x07) << 6),
|
||||
(spriteram[offs + 3] & 0xf0) >> 4,
|
||||
flipx,flipy,
|
||||
sx,sy,
|
||||
&machine->screen[0].visarea,TRANSPARENCY_PEN,0);
|
||||
}
|
||||
|
||||
|
||||
/* redraw characters which have priority over sprites */
|
||||
for (offs = videoram_size - 1;offs >= 0;offs--)
|
||||
{
|
||||
if (colorram[offs] & 0x08)
|
||||
{
|
||||
int sx,sy;
|
||||
|
||||
|
||||
sx = offs % 32;
|
||||
sy = offs / 32;
|
||||
if (flipscreen[0]) sx = 31 - sx;
|
||||
if (flipscreen[1]) sy = 31 - sy;
|
||||
|
||||
drawgfx(bitmap,machine->gfx[0],
|
||||
videoram[offs] + ((colorram[offs] & 0x07) << 8),
|
||||
(colorram[offs] & 0xf0) >> 4,
|
||||
flipscreen[0],flipscreen[1],
|
||||
8*sx,8*sy,
|
||||
&machine->screen[0].visarea,TRANSPARENCY_PEN,0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,233 +0,0 @@
|
||||
/*******************************************************************************
|
||||
|
||||
Raiders5 (c) 1985 Taito / UPL
|
||||
|
||||
Video hardware driver by Uki
|
||||
|
||||
02/Jun/2001 -
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
|
||||
|
||||
UINT8 *raiders5_foreground_videoram;
|
||||
UINT8 *raiders5_foreground_colorram;
|
||||
UINT8 *raiders5_background_videoram;
|
||||
UINT8 *raiders5_background_colorram;
|
||||
UINT8 *raiders5_spriteram;
|
||||
size_t raiders5_spriteram_size;
|
||||
|
||||
|
||||
static UINT8 raiders5_scroll_x;
|
||||
static UINT8 raiders5_scroll_y;
|
||||
static UINT8 raiders5_flip_screen;
|
||||
|
||||
static tilemap *background_tilemap;
|
||||
static tilemap *foreground_tilemap;
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Callbacks for the TileMap code
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static TILE_GET_INFO( get_background_tile_info )
|
||||
{
|
||||
UINT8 bank = ((raiders5_background_colorram[tile_index] >> 1) & 0x01) + 3; /* ? */
|
||||
|
||||
UINT16 code = raiders5_background_videoram[tile_index] |
|
||||
((raiders5_background_colorram[tile_index] & 0x01) << 8);
|
||||
|
||||
UINT8 color = raiders5_background_colorram[tile_index] >> 4;
|
||||
|
||||
SET_TILE_INFO(bank, code, color, 0);
|
||||
}
|
||||
|
||||
|
||||
static TILE_GET_INFO( get_foreground_tile_info )
|
||||
{
|
||||
UINT16 code = raiders5_foreground_videoram[tile_index];
|
||||
|
||||
UINT8 color = raiders5_foreground_colorram[tile_index] >> 4;
|
||||
|
||||
SET_TILE_INFO(2, code, color, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video system start
|
||||
*
|
||||
*************************************/
|
||||
|
||||
VIDEO_START( raiders5 )
|
||||
{
|
||||
background_tilemap = tilemap_create(get_background_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
|
||||
foreground_tilemap = tilemap_create(get_foreground_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
|
||||
|
||||
tilemap_set_scrolldx(background_tilemap, 7, 0);
|
||||
|
||||
tilemap_set_transparent_pen(foreground_tilemap, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Memory handlers
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_HANDLER( raiders5_scroll_x_w )
|
||||
{
|
||||
raiders5_scroll_x = data;
|
||||
}
|
||||
|
||||
|
||||
WRITE8_HANDLER( raiders5_scroll_y_w )
|
||||
{
|
||||
raiders5_scroll_y = data;
|
||||
}
|
||||
|
||||
|
||||
WRITE8_HANDLER( raiders5_flip_screen_w )
|
||||
{
|
||||
raiders5_flip_screen = data & 0x01;
|
||||
|
||||
tilemap_set_flip(ALL_TILEMAPS, (raiders5_flip_screen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0));
|
||||
}
|
||||
|
||||
|
||||
WRITE8_HANDLER( raiders5_foreground_videoram_w )
|
||||
{
|
||||
raiders5_foreground_videoram[offset] = data;
|
||||
tilemap_mark_tile_dirty(foreground_tilemap, offset);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_HANDLER( raiders5_foreground_colorram_w )
|
||||
{
|
||||
raiders5_foreground_colorram[offset] = data;
|
||||
tilemap_mark_tile_dirty(foreground_tilemap, offset);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_HANDLER( raiders5_background_videoram_w )
|
||||
{
|
||||
offs_t y = (offset + ((raiders5_scroll_y & 0xf8) << 2)) & 0x3e0;
|
||||
offs_t x = (offset + (raiders5_scroll_x >> 3)) & 0x1f;
|
||||
|
||||
raiders5_background_videoram[y | x] = data;
|
||||
tilemap_mark_tile_dirty(background_tilemap, y | x);
|
||||
}
|
||||
|
||||
|
||||
READ8_HANDLER( raiders5_background_videoram_r )
|
||||
{
|
||||
offs_t y = (offset + ((raiders5_scroll_y & 0xf8) << 2)) & 0x3e0;
|
||||
offs_t x = (offset + (raiders5_scroll_x >> 3)) & 0x1f;
|
||||
|
||||
return raiders5_background_videoram[y | x];
|
||||
}
|
||||
|
||||
|
||||
WRITE8_HANDLER( raiders5_background_colorram_w )
|
||||
{
|
||||
offs_t y = (offset + ((raiders5_scroll_y & 0xf8) << 2)) & 0x3e0;
|
||||
offs_t x = (offset + (raiders5_scroll_x >> 3)) & 0x1f;
|
||||
|
||||
raiders5_background_colorram[y | x] = data;
|
||||
tilemap_mark_tile_dirty(background_tilemap, y | x);
|
||||
}
|
||||
|
||||
|
||||
READ8_HANDLER( raiders5_background_colorram_r )
|
||||
{
|
||||
offs_t y = (offset + ((raiders5_scroll_y & 0xf8) << 2)) & 0x3e0;
|
||||
offs_t x = (offset + (raiders5_scroll_x >> 3)) & 0x1f;
|
||||
|
||||
return raiders5_background_colorram[y | x];
|
||||
}
|
||||
|
||||
|
||||
WRITE8_HANDLER( raiders5_paletteram_w )
|
||||
{
|
||||
paletteram_BBGGRRII_w(offset, data);
|
||||
|
||||
if (offset < 0x10)
|
||||
{
|
||||
if (offset != 1)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 0x10; i++)
|
||||
{
|
||||
paletteram_BBGGRRII_w(offset + (i * 0x10) + 0x0200, data);
|
||||
}
|
||||
}
|
||||
|
||||
paletteram_BBGGRRII_w((offset * 0x10) + 0x0201, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video update
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
offs_t offs;
|
||||
|
||||
for (offs = 0; offs < raiders5_spriteram_size; offs += 32)
|
||||
{
|
||||
UINT8 bank = (raiders5_spriteram[offs + 3] >> 1) & 0x01;
|
||||
|
||||
UINT8 code = ((raiders5_spriteram[offs + 3] << 6) & 0x40) | (raiders5_spriteram[offs + 0] >> 2);
|
||||
|
||||
UINT8 color = raiders5_spriteram[offs + 3] >> 4;
|
||||
|
||||
int flip_y = ((raiders5_spriteram[offs + 0] >> 1) & 0x01) ^ raiders5_flip_screen;
|
||||
int flip_x = ((raiders5_spriteram[offs + 0] >> 0) & 0x01) ^ raiders5_flip_screen;
|
||||
|
||||
UINT8 y = raiders5_spriteram[offs + 2];
|
||||
UINT8 x = raiders5_spriteram[offs + 1];
|
||||
|
||||
if (raiders5_flip_screen)
|
||||
{
|
||||
y = 240 - y;
|
||||
x = 240 - x;
|
||||
}
|
||||
|
||||
drawgfx(bitmap,machine->gfx[bank],
|
||||
code, color, flip_x, flip_y,
|
||||
x, y, cliprect, TRANSPARENCY_PEN, 0);
|
||||
|
||||
/* draw it wrapped around */
|
||||
drawgfx(bitmap,machine->gfx[bank],
|
||||
code, color, flip_x, flip_y,
|
||||
x - 0x100, y, cliprect, TRANSPARENCY_PEN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VIDEO_UPDATE( raiders5 )
|
||||
{
|
||||
tilemap_set_scrolly(background_tilemap, 0, raiders5_scroll_y);
|
||||
tilemap_set_scrollx(background_tilemap, 0, raiders5_scroll_x);
|
||||
|
||||
tilemap_draw(bitmap, cliprect, background_tilemap, 0, 0);
|
||||
|
||||
draw_sprites(machine, bitmap, cliprect);
|
||||
|
||||
tilemap_draw(bitmap, cliprect, foreground_tilemap, 0, 0);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user