mirror of
https://github.com/holub/mame
synced 2025-05-25 23:35:26 +03:00
Added driver data class and save states to: paradise.c, pasha2.c and pbaction.c
Enabled saves states in pass.c (everything was already saved)
This commit is contained in:
parent
e0347e2fa3
commit
462128d7a8
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -2725,6 +2725,7 @@ src/mame/includes/pandoras.h svneol=native#text/plain
|
||||
src/mame/includes/paradise.h svneol=native#text/plain
|
||||
src/mame/includes/parodius.h svneol=native#text/plain
|
||||
src/mame/includes/pass.h svneol=native#text/plain
|
||||
src/mame/includes/pbaction.h svneol=native#text/plain
|
||||
src/mame/includes/pgm.h svneol=native#text/plain
|
||||
src/mame/includes/phoenix.h svneol=native#text/plain
|
||||
src/mame/includes/pitnrun.h svneol=native#text/plain
|
||||
|
@ -1,8 +1,8 @@
|
||||
/***************************************************************************
|
||||
|
||||
-= Paradise / Target Ball / Torus =-
|
||||
-= Paradise / Target Ball / Torus =-
|
||||
|
||||
driver by Luca Elia (l.elia@tin.it)
|
||||
driver by Luca Elia (l.elia@tin.it)
|
||||
|
||||
|
||||
CPU : Z8400B
|
||||
@ -44,20 +44,21 @@ paradise: I'm not sure it's working correctly:
|
||||
static WRITE8_HANDLER( paradise_rombank_w )
|
||||
{
|
||||
int bank = data;
|
||||
int bank_n = memory_region_length(space->machine, "maincpu")/0x4000 - 1;
|
||||
int bank_n = memory_region_length(space->machine, "maincpu") / 0x4000 - 1;
|
||||
|
||||
if (bank >= bank_n)
|
||||
{
|
||||
logerror("PC %04X - invalid rom bank %x\n",cpu_get_pc(space->cpu),bank);
|
||||
logerror("PC %04X - invalid rom bank %x\n", cpu_get_pc(space->cpu), bank);
|
||||
bank %= bank_n;
|
||||
}
|
||||
|
||||
if (bank >= 3) bank+=1;
|
||||
memory_set_bankptr(space->machine, "bank1", memory_region(space->machine, "maincpu") + bank * 0x4000);
|
||||
memory_set_bank(space->machine, "bank1", bank);
|
||||
}
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( paradise_okibank_w )
|
||||
{
|
||||
if (data & ~0x02) logerror("%s: unknown oki bank bits %02X\n",cpuexec_describe_context(device->machine),data);
|
||||
if (data & ~0x02)
|
||||
logerror("%s: unknown oki bank bits %02X\n", cpuexec_describe_context(device->machine), data);
|
||||
|
||||
okim6295_set_bank_base(device, (data & 0x02) ? 0x40000 : 0);
|
||||
}
|
||||
@ -70,61 +71,61 @@ static WRITE8_HANDLER( torus_coin_counter_w )
|
||||
#define STANDARD_MAP \
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM */ \
|
||||
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") /* ROM (banked) */ \
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(paradise_vram_2_w) AM_BASE(¶dise_vram_2 ) /* Background */ \
|
||||
AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(paradise_vram_1_w) AM_BASE(¶dise_vram_1 ) /* Midground */ \
|
||||
AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(paradise_vram_0_w) AM_BASE(¶dise_vram_0 ) /* Foreground */ \
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(paradise_vram_2_w) AM_BASE_MEMBER(paradise_state, vram_2) /* Background */ \
|
||||
AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(paradise_vram_1_w) AM_BASE_MEMBER(paradise_state, vram_1) /* Midground */ \
|
||||
AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(paradise_vram_0_w) AM_BASE_MEMBER(paradise_state, vram_0) /* Foreground */ \
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( paradise_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
STANDARD_MAP
|
||||
AM_RANGE(0xd800, 0xd8ff) AM_RAM // RAM
|
||||
AM_RANGE(0xd900, 0xe0ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) // Sprites
|
||||
AM_RANGE(0xd900, 0xe0ff) AM_RAM AM_BASE_SIZE_MEMBER(paradise_state, spriteram, spriteram_size) // Sprites
|
||||
AM_RANGE(0xe100, 0xffff) AM_RAM // RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( tgtball_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
STANDARD_MAP
|
||||
AM_RANGE(0xd800, 0xd8ff) AM_RAM // RAM
|
||||
AM_RANGE(0xd900, 0xd9ff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) // Sprites
|
||||
AM_RANGE(0xd900, 0xd9ff) AM_RAM AM_BASE_SIZE_MEMBER(paradise_state, spriteram, spriteram_size) // Sprites
|
||||
AM_RANGE(0xda00, 0xffff) AM_RAM // RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( torus_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
STANDARD_MAP
|
||||
AM_RANGE(0xd800, 0xdfff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) // Sprites
|
||||
AM_RANGE(0xd800, 0xdfff) AM_RAM AM_BASE_SIZE_MEMBER(paradise_state, spriteram, spriteram_size) // Sprites
|
||||
AM_RANGE(0xe000, 0xffff) AM_RAM // RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( paradise_io_map, ADDRESS_SPACE_IO, 8 )
|
||||
AM_RANGE(0x0000, 0x17ff) AM_RAM_WRITE(paradise_palette_w) AM_BASE_GENERIC(paletteram) // Palette
|
||||
AM_RANGE(0x1800, 0x1800) AM_WRITE(paradise_priority_w ) // Layers priority
|
||||
AM_RANGE(0x2001, 0x2001) AM_WRITE(paradise_flipscreen_w ) // Flip Screen
|
||||
AM_RANGE(0x2004, 0x2004) AM_WRITE(paradise_palbank_w ) // Layers palette bank
|
||||
AM_RANGE(0x2006, 0x2006) AM_WRITE(paradise_rombank_w ) // ROM bank
|
||||
AM_RANGE(0x2007, 0x2007) AM_DEVWRITE("oki2", paradise_okibank_w ) // OKI 1 samples bank
|
||||
AM_RANGE(0x0000, 0x17ff) AM_RAM_WRITE(paradise_palette_w) AM_BASE_MEMBER(paradise_state, paletteram) // Palette
|
||||
AM_RANGE(0x1800, 0x1800) AM_WRITE(paradise_priority_w) // Layers priority
|
||||
AM_RANGE(0x2001, 0x2001) AM_WRITE(paradise_flipscreen_w) // Flip Screen
|
||||
AM_RANGE(0x2004, 0x2004) AM_WRITE(paradise_palbank_w) // Layers palette bank
|
||||
AM_RANGE(0x2006, 0x2006) AM_WRITE(paradise_rombank_w) // ROM bank
|
||||
AM_RANGE(0x2007, 0x2007) AM_DEVWRITE("oki2", paradise_okibank_w) // OKI 1 samples bank
|
||||
AM_RANGE(0x2010, 0x2010) AM_DEVREADWRITE("oki1", okim6295_r, okim6295_w) // OKI 0
|
||||
AM_RANGE(0x2020, 0x2020) AM_READ_PORT("DSW1" )
|
||||
AM_RANGE(0x2021, 0x2021) AM_READ_PORT("DSW2" )
|
||||
AM_RANGE(0x2022, 0x2022) AM_READ_PORT("P1" )
|
||||
AM_RANGE(0x2023, 0x2023) AM_READ_PORT("P2" )
|
||||
AM_RANGE(0x2024, 0x2024) AM_READ_PORT("SYSTEM" )
|
||||
AM_RANGE(0x2020, 0x2020) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0x2021, 0x2021) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0x2022, 0x2022) AM_READ_PORT("P1")
|
||||
AM_RANGE(0x2023, 0x2023) AM_READ_PORT("P2")
|
||||
AM_RANGE(0x2024, 0x2024) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0x2030, 0x2030) AM_DEVREADWRITE("oki2", okim6295_r, okim6295_w) // OKI 1
|
||||
AM_RANGE(0x8000, 0xffff) AM_RAM_WRITE(paradise_pixmap_w ) AM_BASE_GENERIC(videoram) // Pixmap
|
||||
AM_RANGE(0x8000, 0xffff) AM_RAM_WRITE(paradise_pixmap_w) AM_BASE_MEMBER(paradise_state, videoram) // Pixmap
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( torus_io_map, ADDRESS_SPACE_IO, 8 )
|
||||
AM_RANGE(0x0000, 0x17ff) AM_RAM_WRITE(paradise_palette_w) AM_BASE_GENERIC(paletteram) // Palette
|
||||
AM_RANGE(0x1800, 0x1800) AM_WRITE(paradise_priority_w ) // Layers priority
|
||||
AM_RANGE(0x2001, 0x2001) AM_WRITE(paradise_flipscreen_w ) // Flip Screen
|
||||
AM_RANGE(0x2004, 0x2004) AM_WRITE(paradise_palbank_w ) // Layers palette bank
|
||||
AM_RANGE(0x2006, 0x2006) AM_WRITE(paradise_rombank_w ) // ROM bank
|
||||
AM_RANGE(0x0000, 0x17ff) AM_RAM_WRITE(paradise_palette_w) AM_BASE_MEMBER(paradise_state, paletteram) // Palette
|
||||
AM_RANGE(0x1800, 0x1800) AM_WRITE(paradise_priority_w) // Layers priority
|
||||
AM_RANGE(0x2001, 0x2001) AM_WRITE(paradise_flipscreen_w) // Flip Screen
|
||||
AM_RANGE(0x2004, 0x2004) AM_WRITE(paradise_palbank_w) // Layers palette bank
|
||||
AM_RANGE(0x2006, 0x2006) AM_WRITE(paradise_rombank_w) // ROM bank
|
||||
AM_RANGE(0x2010, 0x2010) AM_DEVREADWRITE("oki1", okim6295_r, okim6295_w) // OKI 0
|
||||
AM_RANGE(0x2020, 0x2020) AM_READ_PORT("DSW1" )
|
||||
AM_RANGE(0x2021, 0x2021) AM_READ_PORT("DSW2" )
|
||||
AM_RANGE(0x2022, 0x2022) AM_READ_PORT("P1" )
|
||||
AM_RANGE(0x2023, 0x2023) AM_READ_PORT("P2" )
|
||||
AM_RANGE(0x2024, 0x2024) AM_READ_PORT("SYSTEM" )
|
||||
AM_RANGE(0x8000, 0xffff) AM_RAM_WRITE(paradise_pixmap_w ) AM_BASE_GENERIC(videoram) // Pixmap
|
||||
AM_RANGE(0x2020, 0x2020) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0x2021, 0x2021) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0x2022, 0x2022) AM_READ_PORT("P1")
|
||||
AM_RANGE(0x2023, 0x2023) AM_READ_PORT("P2")
|
||||
AM_RANGE(0x2024, 0x2024) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0x8000, 0xffff) AM_RAM_WRITE(paradise_pixmap_w) AM_BASE_MEMBER(paradise_state, videoram) // Pixmap
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
@ -540,14 +541,41 @@ GFXDECODE_END
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
static MACHINE_START( paradise )
|
||||
{
|
||||
paradise_state *state = (paradise_state *)machine->driver_data;
|
||||
int bank_n = memory_region_length(machine, "maincpu") / 0x4000 - 1;
|
||||
UINT8 *ROM = memory_region(machine, "maincpu");
|
||||
|
||||
memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x00000], 0x4000);
|
||||
memory_configure_bank(machine, "bank1", 3, bank_n - 4, &ROM[0x10000], 0x4000);
|
||||
|
||||
state_save_register_global(machine, state->palbank);
|
||||
state_save_register_global(machine, state->priority);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( paradise )
|
||||
{
|
||||
paradise_state *state = (paradise_state *)machine->driver_data;
|
||||
|
||||
state->palbank = 0;
|
||||
state->priority = 0;
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( paradise )
|
||||
|
||||
/* driver data */
|
||||
MDRV_DRIVER_DATA(paradise_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) /* Z8400B - 6mhz Verified */
|
||||
MDRV_CPU_PROGRAM_MAP(paradise_map)
|
||||
MDRV_CPU_IO_MAP(paradise_io_map)
|
||||
MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) /* No nmi routine */
|
||||
|
||||
MDRV_MACHINE_START(paradise)
|
||||
MDRV_MACHINE_RESET(paradise)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_SCREEN_ADD("screen", RASTER)
|
||||
MDRV_SCREEN_REFRESH_RATE(54) /* 54 verified */
|
||||
@ -1017,19 +1045,22 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT (paradise)
|
||||
{
|
||||
paradise_sprite_inc = 0x20;
|
||||
paradise_state *state = (paradise_state *)machine->driver_data;
|
||||
state->sprite_inc = 0x20;
|
||||
}
|
||||
|
||||
// Inverted flipscreen and sprites are packed in less memory (same number though)
|
||||
static DRIVER_INIT (tgtball)
|
||||
{
|
||||
paradise_sprite_inc = 4;
|
||||
paradise_state *state = (paradise_state *)machine->driver_data;
|
||||
state->sprite_inc = 4;
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x2001, 0x2001, 0, 0, tgtball_flipscreen_w );
|
||||
}
|
||||
|
||||
static DRIVER_INIT (torus)
|
||||
{
|
||||
paradise_sprite_inc = 4;
|
||||
paradise_state *state = (paradise_state *)machine->driver_data;
|
||||
state->sprite_inc = 4;
|
||||
memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x2070, 0x2070, 0, 0, torus_coin_counter_w);
|
||||
}
|
||||
|
||||
@ -1040,11 +1071,11 @@ static DRIVER_INIT (torus)
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
GAME( 1994+, paradise, 0, paradise, paradise, paradise, ROT90, "Yun Sung", "Paradise", 0 )
|
||||
GAME( 1994+, paradlx, 0, paradise, paradise, paradise, ROT90, "Yun Sung", "Paradise Deluxe", GAME_IMPERFECT_GRAPHICS )
|
||||
GAME( 1994+, para2dx , 0, paradise, paradise, paradise, ROT90, "Yun Sung", "Paradise 2 Deluxe", GAME_IMPERFECT_GRAPHICS )
|
||||
GAME( 1995, tgtball, 0, tgtball, tgtball, tgtball, ROT0, "Yun Sung", "Target Ball (Nude)", 0 )
|
||||
GAME( 1995, tgtballa, tgtball, tgtball, tgtball, tgtball, ROT0, "Yun Sung", "Target Ball", 0 )
|
||||
GAME( 1996, torus, 0, torus, torus, torus, ROT90, "Yun Sung", "Torus", 0 )
|
||||
GAME( 1998, madball, 0, madball, madball, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0", 0 )
|
||||
GAME( 1997, madballn, madball, madball, madball, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0 (With Nudity)", 0 )
|
||||
GAME( 1994+, paradise, 0, paradise, paradise, paradise, ROT90, "Yun Sung", "Paradise", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1994+, paradlx, 0, paradise, paradise, paradise, ROT90, "Yun Sung", "Paradise Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
|
||||
GAME( 1994+, para2dx , 0, paradise, paradise, paradise, ROT90, "Yun Sung", "Paradise 2 Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
|
||||
GAME( 1995, tgtball, 0, tgtball, tgtball, tgtball, ROT0, "Yun Sung", "Target Ball (Nude)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1995, tgtballa, tgtball, tgtball, tgtball, tgtball, ROT0, "Yun Sung", "Target Ball", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1996, torus, 0, torus, torus, torus, ROT90, "Yun Sung", "Torus", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1998, madball, 0, madball, madball, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1997, madballn, madball, madball, madball, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0 (With Nudity)", GAME_SUPPORTS_SAVE )
|
||||
|
@ -76,23 +76,40 @@ Notes:
|
||||
#include "machine/eeprom.h"
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
static UINT16 *bitmap0, *bitmap1, *wram;
|
||||
static int vbuffer = 0;
|
||||
static int old_bank;
|
||||
class pasha2_state
|
||||
{
|
||||
public:
|
||||
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, pasha2_state(machine)); }
|
||||
|
||||
pasha2_state(running_machine &machine) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT16 * bitmap0;
|
||||
UINT16 * bitmap1;
|
||||
UINT16 * paletteram;
|
||||
UINT16 * wram;
|
||||
|
||||
/* video-related */
|
||||
int vbuffer;
|
||||
int old_bank;
|
||||
};
|
||||
|
||||
|
||||
static WRITE16_HANDLER( pasha2_misc_w )
|
||||
{
|
||||
if(offset)
|
||||
pasha2_state *state = (pasha2_state *)space->machine->driver_data;
|
||||
|
||||
if (offset)
|
||||
{
|
||||
if(data & 0x0800)
|
||||
if (data & 0x0800)
|
||||
{
|
||||
int bank = data & 0xf000;
|
||||
|
||||
if(bank != old_bank)
|
||||
if (bank != state->old_bank)
|
||||
{
|
||||
old_bank = bank;
|
||||
state->old_bank = bank;
|
||||
|
||||
switch(bank)
|
||||
switch (bank)
|
||||
{
|
||||
case 0x8000:
|
||||
case 0x9000:
|
||||
@ -109,60 +126,67 @@ static WRITE16_HANDLER( pasha2_misc_w )
|
||||
|
||||
static WRITE16_HANDLER( pasha2_palette_w )
|
||||
{
|
||||
pasha2_state *state = (pasha2_state *)space->machine->driver_data;
|
||||
int color;
|
||||
COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
|
||||
|
||||
COMBINE_DATA(&state->paletteram[offset]);
|
||||
|
||||
offset &= 0xff;
|
||||
|
||||
color = (space->machine->generic.paletteram.u16[offset] >> 8) | (space->machine->generic.paletteram.u16[offset+0x100] & 0xff00);
|
||||
palette_set_color_rgb(space->machine,offset*2+0,pal5bit(color),pal5bit(color >> 5),pal5bit(color >> 10));
|
||||
color = (state->paletteram[offset] >> 8) | (state->paletteram[offset + 0x100] & 0xff00);
|
||||
palette_set_color_rgb(space->machine, offset * 2 + 0, pal5bit(color), pal5bit(color >> 5), pal5bit(color >> 10));
|
||||
|
||||
color = (space->machine->generic.paletteram.u16[offset] & 0xff) | ((space->machine->generic.paletteram.u16[offset+0x100] & 0xff) << 8);
|
||||
palette_set_color_rgb(space->machine,offset*2+1,pal5bit(color),pal5bit(color >> 5),pal5bit(color >> 10));
|
||||
color = (state->paletteram[offset] & 0xff) | ((state->paletteram[offset + 0x100] & 0xff) << 8);
|
||||
palette_set_color_rgb(space->machine, offset * 2 + 1, pal5bit(color), pal5bit(color >> 5), pal5bit(color >> 10));
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( vbuffer_set_w )
|
||||
{
|
||||
vbuffer = 1;
|
||||
pasha2_state *state = (pasha2_state *)space->machine->driver_data;
|
||||
state->vbuffer = 1;
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( vbuffer_clear_w )
|
||||
{
|
||||
vbuffer = 0;
|
||||
pasha2_state *state = (pasha2_state *)space->machine->driver_data;
|
||||
state->vbuffer = 0;
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( bitmap_0_w )
|
||||
{
|
||||
COMBINE_DATA(&bitmap0[offset + vbuffer*0x20000/2]);
|
||||
pasha2_state *state = (pasha2_state *)space->machine->driver_data;
|
||||
COMBINE_DATA(&state->bitmap0[offset + state->vbuffer * 0x20000 / 2]);
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( bitmap_1_w )
|
||||
{
|
||||
pasha2_state *state = (pasha2_state *)space->machine->driver_data;
|
||||
|
||||
// handle overlapping pixels without writing them
|
||||
switch(mem_mask)
|
||||
switch (mem_mask)
|
||||
{
|
||||
case 0xffff:
|
||||
bitmap_1_w(space,offset,data,0xff00);
|
||||
bitmap_1_w(space,offset,data,0x00ff);
|
||||
bitmap_1_w(space, offset, data, 0xff00);
|
||||
bitmap_1_w(space, offset, data, 0x00ff);
|
||||
return;
|
||||
|
||||
case 0xff00:
|
||||
if((data & 0xff00) == 0xff00)
|
||||
if ((data & 0xff00) == 0xff00)
|
||||
return;
|
||||
break;
|
||||
|
||||
case 0x00ff:
|
||||
if((data & 0x00ff) == 0x00ff)
|
||||
if ((data & 0x00ff) == 0x00ff)
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
COMBINE_DATA(&bitmap1[offset + vbuffer*0x20000/2]);
|
||||
COMBINE_DATA(&state->bitmap1[offset + state->vbuffer * 0x20000 / 2]);
|
||||
}
|
||||
|
||||
static READ16_DEVICE_HANDLER( oki_r )
|
||||
{
|
||||
if(offset)
|
||||
if (offset)
|
||||
return okim6295_r(device, 0);
|
||||
else
|
||||
return 0;
|
||||
@ -170,19 +194,19 @@ static READ16_DEVICE_HANDLER( oki_r )
|
||||
|
||||
static WRITE16_DEVICE_HANDLER( oki_w )
|
||||
{
|
||||
if(offset)
|
||||
if (offset)
|
||||
okim6295_w(device, 0, data);
|
||||
}
|
||||
|
||||
static WRITE16_DEVICE_HANDLER( oki_bank_w )
|
||||
{
|
||||
if(offset)
|
||||
if (offset)
|
||||
okim6295_set_bank_base(device, (data & 1) * 0x40000);
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( pasha2_lamps_w )
|
||||
{
|
||||
if(data)
|
||||
if (data)
|
||||
popmessage("1P: %c%c%c 2P: %c%c%c 3P: %c%c%c",
|
||||
(data & 0x001) ? 'R' : '-',
|
||||
(data & 0x002) ? 'G' : '-',
|
||||
@ -196,7 +220,7 @@ static WRITE16_HANDLER( pasha2_lamps_w )
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( pasha2_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE(&wram)
|
||||
AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_BASE_MEMBER(pasha2_state, wram)
|
||||
AM_RANGE(0x40000000, 0x4001ffff) AM_RAM_WRITE(bitmap_0_w)
|
||||
AM_RANGE(0x40020000, 0x4003ffff) AM_RAM_WRITE(bitmap_1_w)
|
||||
AM_RANGE(0x40060000, 0x40060001) AM_WRITENOP
|
||||
@ -207,7 +231,7 @@ static ADDRESS_MAP_START( pasha2_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x40074000, 0x40074001) AM_WRITE(vbuffer_set_w)
|
||||
AM_RANGE(0x40078000, 0x40078001) AM_WRITENOP //once at startup -> to disable the eeprom?
|
||||
AM_RANGE(0x80000000, 0x803fffff) AM_ROMBANK("bank1")
|
||||
AM_RANGE(0xe0000000, 0xe00003ff) AM_RAM_WRITE(pasha2_palette_w) AM_BASE_GENERIC(paletteram) //tilemap? palette?
|
||||
AM_RANGE(0xe0000000, 0xe00003ff) AM_RAM_WRITE(pasha2_palette_w) AM_BASE_MEMBER(pasha2_state, paletteram) //tilemap? palette?
|
||||
AM_RANGE(0xfff80000, 0xffffffff) AM_ROM AM_REGION("user1",0)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -315,29 +339,34 @@ INPUT_PORTS_END
|
||||
|
||||
static VIDEO_START( pasha2 )
|
||||
{
|
||||
bitmap0 = auto_alloc_array(machine, UINT16, 0x40000/2);
|
||||
bitmap1 = auto_alloc_array(machine, UINT16, 0x40000/2);
|
||||
pasha2_state *state = (pasha2_state *)machine->driver_data;
|
||||
state->bitmap0 = auto_alloc_array(machine, UINT16, 0x40000/2);
|
||||
state->bitmap1 = auto_alloc_array(machine, UINT16, 0x40000/2);
|
||||
|
||||
state_save_register_global_pointer(machine, state->bitmap0, 0x40000/2);
|
||||
state_save_register_global_pointer(machine, state->bitmap1, 0x40000/2);
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE( pasha2 )
|
||||
{
|
||||
int x,y,count;
|
||||
pasha2_state *state = (pasha2_state *)screen->machine->driver_data;
|
||||
int x, y, count;
|
||||
int color;
|
||||
|
||||
/* 2 512x256 bitmaps */
|
||||
|
||||
count = 0;
|
||||
for (y=0;y <= cliprect->max_y;y++)
|
||||
for (y = 0; y <= cliprect->max_y; y++)
|
||||
{
|
||||
for (x=0;x < 512/2;x++)
|
||||
for (x = 0; x < 512 / 2; x++)
|
||||
{
|
||||
if(x*2 < cliprect->max_x)
|
||||
if (x * 2 < cliprect->max_x)
|
||||
{
|
||||
color = (bitmap0[count + (vbuffer^1)*0x20000/2] & 0xff00) >> 8;
|
||||
*BITMAP_ADDR16(bitmap, y, x*2 + 0) = color + 0x100;
|
||||
color = (state->bitmap0[count + (state->vbuffer ^ 1) * 0x20000 / 2] & 0xff00) >> 8;
|
||||
*BITMAP_ADDR16(bitmap, y, x * 2 + 0) = color + 0x100;
|
||||
|
||||
color = bitmap0[count + (vbuffer^1)*0x20000/2] & 0xff;
|
||||
*BITMAP_ADDR16(bitmap, y, x*2 + 1) = color + 0x100;
|
||||
color = state->bitmap0[count + (state->vbuffer ^ 1) * 0x20000 / 2] & 0xff;
|
||||
*BITMAP_ADDR16(bitmap, y, x * 2 + 1) = color + 0x100;
|
||||
}
|
||||
|
||||
count++;
|
||||
@ -345,19 +374,19 @@ static VIDEO_UPDATE( pasha2 )
|
||||
}
|
||||
|
||||
count = 0;
|
||||
for (y=0;y <= cliprect->max_y;y++)
|
||||
for (y = 0; y <= cliprect->max_y; y++)
|
||||
{
|
||||
for (x=0;x < 512/2;x++)
|
||||
for (x = 0; x < 512 / 2; x++)
|
||||
{
|
||||
if(x*2 < cliprect->max_x)
|
||||
if (x * 2 < cliprect->max_x)
|
||||
{
|
||||
color = bitmap1[count + (vbuffer^1)*0x20000/2] & 0xff;
|
||||
if(color != 0)
|
||||
*BITMAP_ADDR16(bitmap, y, x*2 + 1) = color;
|
||||
color = state->bitmap1[count + (state->vbuffer ^ 1) * 0x20000 / 2] & 0xff;
|
||||
if (color != 0)
|
||||
*BITMAP_ADDR16(bitmap, y, x * 2 + 1) = color;
|
||||
|
||||
color = (bitmap1[count + (vbuffer^1)*0x20000/2] & 0xff00) >> 8;
|
||||
if(color != 0)
|
||||
*BITMAP_ADDR16(bitmap, y, x*2 + 0) = color;
|
||||
color = (state->bitmap1[count + (state->vbuffer ^ 1) * 0x20000 / 2] & 0xff00) >> 8;
|
||||
if (color != 0)
|
||||
*BITMAP_ADDR16(bitmap, y, x * 2 + 0) = color;
|
||||
}
|
||||
|
||||
count++;
|
||||
@ -367,18 +396,34 @@ static VIDEO_UPDATE( pasha2 )
|
||||
return 0;
|
||||
}
|
||||
|
||||
static MACHINE_START( pasha2 )
|
||||
{
|
||||
pasha2_state *state = (pasha2_state *)machine->driver_data;
|
||||
|
||||
state_save_register_global(machine, state->old_bank);
|
||||
state_save_register_global(machine, state->vbuffer);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( pasha2 )
|
||||
{
|
||||
old_bank = -1;
|
||||
vbuffer = 0;
|
||||
pasha2_state *state = (pasha2_state *)machine->driver_data;
|
||||
|
||||
state->old_bank = -1;
|
||||
state->vbuffer = 0;
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( pasha2 )
|
||||
|
||||
/* driver data */
|
||||
MDRV_DRIVER_DATA(pasha2_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", E116XT, 20000000*4) /* 4x internal multiplier */
|
||||
MDRV_CPU_PROGRAM_MAP(pasha2_map)
|
||||
MDRV_CPU_IO_MAP(pasha2_io)
|
||||
MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
|
||||
|
||||
MDRV_MACHINE_START(pasha2)
|
||||
MDRV_MACHINE_RESET(pasha2)
|
||||
MDRV_EEPROM_93C46_ADD("eeprom")
|
||||
|
||||
@ -435,12 +480,12 @@ ROM_END
|
||||
|
||||
static READ16_HANDLER( pasha2_speedup_r )
|
||||
{
|
||||
if(cpu_get_pc(space->cpu) == 0x8302)
|
||||
{
|
||||
cpu_spinuntil_int(space->cpu);
|
||||
}
|
||||
pasha2_state *state = (pasha2_state *)space->machine->driver_data;
|
||||
|
||||
return wram[(0x95744/2)+offset];
|
||||
if(cpu_get_pc(space->cpu) == 0x8302)
|
||||
cpu_spinuntil_int(space->cpu);
|
||||
|
||||
return state->wram[(0x95744 / 2) + offset];
|
||||
}
|
||||
|
||||
static DRIVER_INIT( pasha2 )
|
||||
@ -450,4 +495,4 @@ static DRIVER_INIT( pasha2 )
|
||||
memory_set_bankptr(machine, "bank1", memory_region(machine, "user2"));
|
||||
}
|
||||
|
||||
GAME( 1998, pasha2, 0, pasha2, pasha2, pasha2, ROT0, "Dong Sung", "Pasha Pasha 2", GAME_IMPERFECT_SOUND )
|
||||
GAME( 1998, pasha2, 0, pasha2, pasha2, pasha2, ROT0, "Dong Sung", "Pasha Pasha 2", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
|
||||
|
@ -111,8 +111,8 @@
|
||||
static ADDRESS_MAP_START( pass_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
||||
AM_RANGE(0x080000, 0x083fff) AM_RAM
|
||||
AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(pass_bg_videoram_w) AM_BASE_MEMBER(pass_state,bg_videoram) // Background
|
||||
AM_RANGE(0x210000, 0x213fff) AM_RAM_WRITE(pass_fg_videoram_w) AM_BASE_MEMBER(pass_state,fg_videoram) // Foreground
|
||||
AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(pass_bg_videoram_w) AM_BASE_MEMBER(pass_state, bg_videoram) // Background
|
||||
AM_RANGE(0x210000, 0x213fff) AM_RAM_WRITE(pass_fg_videoram_w) AM_BASE_MEMBER(pass_state, fg_videoram) // Foreground
|
||||
AM_RANGE(0x220000, 0x2203ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0x230000, 0x230001) AM_WRITE(soundlatch_word_w)
|
||||
AM_RANGE(0x230100, 0x230101) AM_READ_PORT("DSW")
|
||||
@ -294,5 +294,4 @@ ROM_START( pass )
|
||||
ROM_END
|
||||
|
||||
|
||||
GAME( 1992, pass, 0, pass, pass, 0, ROT0, "Oksan", "Pass", 0)
|
||||
|
||||
GAME( 1992, pass, 0, pass, pass, 0, ROT0, "Oksan", "Pass", GAME_SUPPORTS_SAVE )
|
||||
|
@ -68,41 +68,26 @@ Stephh's notes (based on the game Z80 code and some tests) :
|
||||
#include "deprecat.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "machine/segacrpt.h"
|
||||
|
||||
|
||||
extern UINT8 *pbaction_videoram,*pbaction_colorram;
|
||||
extern UINT8 *pbaction_videoram2,*pbaction_colorram2;
|
||||
|
||||
extern WRITE8_HANDLER( pbaction_videoram_w );
|
||||
extern WRITE8_HANDLER( pbaction_colorram_w );
|
||||
extern WRITE8_HANDLER( pbaction_videoram2_w );
|
||||
extern WRITE8_HANDLER( pbaction_colorram2_w );
|
||||
extern WRITE8_HANDLER( pbaction_flipscreen_w );
|
||||
extern WRITE8_HANDLER( pbaction_scroll_w );
|
||||
|
||||
extern VIDEO_START( pbaction );
|
||||
extern VIDEO_UPDATE( pbaction );
|
||||
#include "includes/pbaction.h"
|
||||
|
||||
|
||||
static WRITE8_HANDLER( pbaction_sh_command_w )
|
||||
{
|
||||
soundlatch_w(space,offset,data);
|
||||
cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, HOLD_LINE, 0x00);
|
||||
pbaction_state *state = (pbaction_state *)space->machine->driver_data;
|
||||
soundlatch_w(space, offset, data);
|
||||
cpu_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0x00);
|
||||
}
|
||||
|
||||
|
||||
static UINT8 *work_ram;
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( pbaction_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xbfff) AM_ROM
|
||||
AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE(&work_ram)
|
||||
AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(pbaction_videoram2_w) AM_BASE(&pbaction_videoram2)
|
||||
AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(pbaction_colorram2_w) AM_BASE(&pbaction_colorram2)
|
||||
AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(pbaction_videoram_w) AM_BASE(&pbaction_videoram)
|
||||
AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(pbaction_colorram_w) AM_BASE(&pbaction_colorram)
|
||||
AM_RANGE(0xe000, 0xe07f) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
|
||||
AM_RANGE(0xc000, 0xcfff) AM_RAM AM_BASE_MEMBER(pbaction_state, work_ram)
|
||||
AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(pbaction_videoram2_w) AM_BASE_MEMBER(pbaction_state, videoram2)
|
||||
AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(pbaction_colorram2_w) AM_BASE_MEMBER(pbaction_state, colorram2)
|
||||
AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(pbaction_videoram_w) AM_BASE_MEMBER(pbaction_state, videoram)
|
||||
AM_RANGE(0xdc00, 0xdfff) AM_RAM_WRITE(pbaction_colorram_w) AM_BASE_MEMBER(pbaction_state, colorram)
|
||||
AM_RANGE(0xe000, 0xe07f) AM_RAM AM_BASE_SIZE_MEMBER(pbaction_state, spriteram, spriteram_size)
|
||||
AM_RANGE(0xe400, 0xe5ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE_GENERIC(paletteram)
|
||||
AM_RANGE(0xe600, 0xe600) AM_READ_PORT("P1") AM_WRITE(interrupt_enable_w)
|
||||
AM_RANGE(0xe601, 0xe601) AM_READ_PORT("P2")
|
||||
@ -267,8 +252,28 @@ static INTERRUPT_GEN( pbaction_interrupt )
|
||||
}
|
||||
|
||||
|
||||
static MACHINE_START( pbaction )
|
||||
{
|
||||
pbaction_state *state = (pbaction_state *)machine->driver_data;
|
||||
|
||||
state->maincpu = devtag_get_device(machine, "maincpu");
|
||||
state->audiocpu = devtag_get_device(machine, "audiocpu");
|
||||
|
||||
state_save_register_global(machine, state->scroll);
|
||||
}
|
||||
|
||||
static MACHINE_RESET( pbaction )
|
||||
{
|
||||
pbaction_state *state = (pbaction_state *)machine->driver_data;
|
||||
|
||||
state->scroll = 0;
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( pbaction )
|
||||
|
||||
/* driver data */
|
||||
MDRV_DRIVER_DATA(pbaction_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", Z80, 4000000) /* 4 MHz? */
|
||||
MDRV_CPU_PROGRAM_MAP(pbaction_map)
|
||||
@ -280,6 +285,9 @@ static MACHINE_DRIVER_START( pbaction )
|
||||
MDRV_CPU_VBLANK_INT_HACK(pbaction_interrupt,2) /* ??? */
|
||||
/* IRQs are caused by the main CPU */
|
||||
|
||||
MDRV_MACHINE_START(pbaction)
|
||||
MDRV_MACHINE_RESET(pbaction)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_SCREEN_ADD("screen", RASTER)
|
||||
MDRV_SCREEN_REFRESH_RATE(60)
|
||||
@ -455,11 +463,13 @@ ROM_END
|
||||
|
||||
static READ8_HANDLER( pbactio3_prot_kludge_r )
|
||||
{
|
||||
pbaction_state *state = (pbaction_state *)space->machine->driver_data;
|
||||
|
||||
/* on startup, the game expect this location to NOT act as RAM */
|
||||
if (cpu_get_pc(space->cpu) == 0xab80)
|
||||
return 0;
|
||||
|
||||
return work_ram[0];
|
||||
return state->work_ram[0];
|
||||
}
|
||||
|
||||
static DRIVER_INIT( pbactio3 )
|
||||
@ -468,7 +478,7 @@ static DRIVER_INIT( pbactio3 )
|
||||
UINT8 *rom = memory_region(machine, "maincpu");
|
||||
|
||||
/* first of all, do a simple bitswap */
|
||||
for (i = 0;i < 0xc000;i++)
|
||||
for (i = 0; i < 0xc000; i++)
|
||||
{
|
||||
rom[i] = BITSWAP8(rom[i], 7,6,5,4,1,2,3,0);
|
||||
}
|
||||
@ -488,8 +498,8 @@ static DRIVER_INIT( pbactio4 )
|
||||
|
||||
|
||||
|
||||
GAME( 1985, pbaction, 0, pbaction, pbaction, 0, ROT90, "Tehkan", "Pinball Action (set 1)", 0 )
|
||||
GAME( 1985, pbaction2,pbaction, pbaction, pbaction, 0, ROT90, "Tehkan", "Pinball Action (set 2)", 0 )
|
||||
GAME( 1985, pbaction3,pbaction, pbaction, pbaction, pbactio3, ROT90, "Tehkan", "Pinball Action (set 3, encrypted)", 0 )
|
||||
GAME( 1985, pbaction4,pbaction, pbaction, pbaction, pbactio4, ROT90, "Tehkan", "Pinball Action (set 4, encrypted)", 0 )
|
||||
GAME( 1985, pbaction5,pbaction, pbaction, pbaction, pbactio4, ROT90, "Tehkan", "Pinball Action (set 5, encrypted)", 0 )
|
||||
GAME( 1985, pbaction, 0, pbaction, pbaction, 0, ROT90, "Tehkan", "Pinball Action (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1985, pbaction2, pbaction, pbaction, pbaction, 0, ROT90, "Tehkan", "Pinball Action (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1985, pbaction3, pbaction, pbaction, pbaction, pbactio3, ROT90, "Tehkan", "Pinball Action (set 3, encrypted)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1985, pbaction4, pbaction, pbaction, pbaction, pbactio4, ROT90, "Tehkan", "Pinball Action (set 4, encrypted)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1985, pbaction5, pbaction, pbaction, pbaction, pbactio4, ROT90, "Tehkan", "Pinball Action (set 5, encrypted)", GAME_SUPPORTS_SAVE )
|
||||
|
@ -1,7 +1,28 @@
|
||||
/*----------- defined in video/paradise.c -----------*/
|
||||
|
||||
extern UINT8 *paradise_vram_0,*paradise_vram_1,*paradise_vram_2;
|
||||
extern int paradise_sprite_inc;
|
||||
class paradise_state
|
||||
{
|
||||
public:
|
||||
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, paradise_state(machine)); }
|
||||
|
||||
paradise_state(running_machine &machine) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * vram_0;
|
||||
UINT8 * vram_1;
|
||||
UINT8 * vram_2;
|
||||
UINT8 * videoram;
|
||||
UINT8 * paletteram;
|
||||
UINT8 * spriteram;
|
||||
size_t spriteram_size;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *tilemap_0, *tilemap_1, *tilemap_2;
|
||||
bitmap_t *tmpbitmap;
|
||||
UINT8 palbank, priority;
|
||||
int sprite_inc;
|
||||
};
|
||||
|
||||
/*----------- defined in video/paradise.c -----------*/
|
||||
|
||||
WRITE8_HANDLER( paradise_vram_0_w );
|
||||
WRITE8_HANDLER( paradise_vram_1_w );
|
||||
@ -16,6 +37,7 @@ WRITE8_HANDLER( paradise_priority_w );
|
||||
WRITE8_HANDLER( paradise_palbank_w );
|
||||
|
||||
VIDEO_START( paradise );
|
||||
|
||||
VIDEO_UPDATE( paradise );
|
||||
VIDEO_UPDATE( torus );
|
||||
VIDEO_UPDATE( madball );
|
||||
|
@ -15,7 +15,8 @@ public:
|
||||
|
||||
/*----------- defined in video/pass.c -----------*/
|
||||
|
||||
VIDEO_START( pass );
|
||||
VIDEO_UPDATE( pass );
|
||||
WRITE16_HANDLER( pass_fg_videoram_w );
|
||||
WRITE16_HANDLER( pass_bg_videoram_w );
|
||||
|
||||
VIDEO_START( pass );
|
||||
VIDEO_UPDATE( pass );
|
||||
|
44
src/mame/includes/pbaction.h
Normal file
44
src/mame/includes/pbaction.h
Normal file
@ -0,0 +1,44 @@
|
||||
/*************************************************************************
|
||||
|
||||
Pinball Action
|
||||
|
||||
*************************************************************************/
|
||||
|
||||
class pbaction_state
|
||||
{
|
||||
public:
|
||||
static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, pbaction_state(machine)); }
|
||||
|
||||
pbaction_state(running_machine &machine) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * videoram;
|
||||
UINT8 * videoram2;
|
||||
UINT8 * colorram;
|
||||
UINT8 * colorram2;
|
||||
UINT8 * work_ram;
|
||||
UINT8 * spriteram;
|
||||
// UINT8 * paletteram; // currently this uses generic palette handling
|
||||
size_t spriteram_size;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *bg_tilemap, *fg_tilemap;
|
||||
int scroll;
|
||||
|
||||
/* devices */
|
||||
running_device *maincpu;
|
||||
running_device *audiocpu;
|
||||
};
|
||||
|
||||
|
||||
/*----------- defined in video/pbaction.c -----------*/
|
||||
|
||||
extern WRITE8_HANDLER( pbaction_videoram_w );
|
||||
extern WRITE8_HANDLER( pbaction_colorram_w );
|
||||
extern WRITE8_HANDLER( pbaction_videoram2_w );
|
||||
extern WRITE8_HANDLER( pbaction_colorram2_w );
|
||||
extern WRITE8_HANDLER( pbaction_flipscreen_w );
|
||||
extern WRITE8_HANDLER( pbaction_scroll_w );
|
||||
|
||||
extern VIDEO_START( pbaction );
|
||||
extern VIDEO_UPDATE( pbaction );
|
@ -1,8 +1,8 @@
|
||||
/***************************************************************************
|
||||
|
||||
-= Paradise / Target Ball / Torus =-
|
||||
-= Paradise / Target Ball / Torus =-
|
||||
|
||||
driver by Luca Elia (l.elia@tin.it)
|
||||
driver by Luca Elia (l.elia@tin.it)
|
||||
|
||||
|
||||
Note: if MAME_DEBUG is defined, pressing Z with:
|
||||
@ -28,15 +28,6 @@ Note: if MAME_DEBUG is defined, pressing Z with:
|
||||
#include "emu.h"
|
||||
#include "includes/paradise.h"
|
||||
|
||||
/* Variables that driver has access to: */
|
||||
|
||||
UINT8 *paradise_vram_0,*paradise_vram_1,*paradise_vram_2;
|
||||
int paradise_sprite_inc;
|
||||
|
||||
/* Variables only used here */
|
||||
|
||||
static UINT8 paradise_palbank, paradise_priority;
|
||||
|
||||
WRITE8_HANDLER( paradise_flipscreen_w )
|
||||
{
|
||||
flip_screen_set(space->machine, data ? 0 : 1);
|
||||
@ -51,11 +42,11 @@ WRITE8_HANDLER( tgtball_flipscreen_w )
|
||||
/* 800 bytes for red, followed by 800 bytes for green & 800 bytes for blue */
|
||||
WRITE8_HANDLER( paradise_palette_w )
|
||||
{
|
||||
space->machine->generic.paletteram.u8[offset] = data;
|
||||
paradise_state *state = (paradise_state *)space->machine->driver_data;
|
||||
state->paletteram[offset] = data;
|
||||
offset %= 0x800;
|
||||
palette_set_color_rgb(space->machine,offset, space->machine->generic.paletteram.u8[offset + 0x800 * 0],
|
||||
space->machine->generic.paletteram.u8[offset + 0x800 * 1],
|
||||
space->machine->generic.paletteram.u8[offset + 0x800 * 2] );
|
||||
palette_set_color_rgb(space->machine, offset, state->paletteram[offset + 0x800 * 0], state->paletteram[offset + 0x800 * 1],
|
||||
state->paletteram[offset + 0x800 * 2]);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
@ -69,50 +60,53 @@ WRITE8_HANDLER( paradise_palette_w )
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
static tilemap_t *tilemap_0,*tilemap_1,*tilemap_2;
|
||||
|
||||
/* Background */
|
||||
WRITE8_HANDLER( paradise_vram_0_w )
|
||||
{
|
||||
paradise_vram_0[offset] = data;
|
||||
tilemap_mark_tile_dirty(tilemap_0, offset % 0x400);
|
||||
paradise_state *state = (paradise_state *)space->machine->driver_data;
|
||||
state->vram_0[offset] = data;
|
||||
tilemap_mark_tile_dirty(state->tilemap_0, offset % 0x400);
|
||||
}
|
||||
|
||||
/* 16 color tiles with paradise_palbank as color code */
|
||||
WRITE8_HANDLER( paradise_palbank_w )
|
||||
{
|
||||
paradise_state *state = (paradise_state *)space->machine->driver_data;
|
||||
int i;
|
||||
int bank1 = (data & 0x0e) | 1;
|
||||
int bank2 = (data & 0xf0);
|
||||
|
||||
for (i = 0; i < 15; i++)
|
||||
palette_set_color_rgb(space->machine,0x800+i, space->machine->generic.paletteram.u8[0x200 + bank2 + i + 0x800 * 0],
|
||||
space->machine->generic.paletteram.u8[0x200 + bank2 + i + 0x800 * 1],
|
||||
space->machine->generic.paletteram.u8[0x200 + bank2 + i + 0x800 * 2] );
|
||||
if (paradise_palbank != bank1)
|
||||
palette_set_color_rgb(space->machine, 0x800 + i, state->paletteram[0x200 + bank2 + i + 0x800 * 0], state->paletteram[0x200 + bank2 + i + 0x800 * 1],
|
||||
state->paletteram[0x200 + bank2 + i + 0x800 * 2]);
|
||||
|
||||
if (state->palbank != bank1)
|
||||
{
|
||||
paradise_palbank = bank1;
|
||||
tilemap_mark_all_tiles_dirty(tilemap_0);
|
||||
state->palbank = bank1;
|
||||
tilemap_mark_all_tiles_dirty(state->tilemap_0);
|
||||
}
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( get_tile_info_0 )
|
||||
{
|
||||
int code = paradise_vram_0[tile_index] + (paradise_vram_0[tile_index + 0x400] << 8);
|
||||
SET_TILE_INFO(1, code, paradise_palbank, 0);
|
||||
paradise_state *state = (paradise_state *)machine->driver_data;
|
||||
int code = state->vram_0[tile_index] + (state->vram_0[tile_index + 0x400] << 8);
|
||||
SET_TILE_INFO(1, code, state->palbank, 0);
|
||||
}
|
||||
|
||||
|
||||
/* Midground */
|
||||
WRITE8_HANDLER( paradise_vram_1_w )
|
||||
{
|
||||
paradise_vram_1[offset] = data;
|
||||
tilemap_mark_tile_dirty(tilemap_1, offset % 0x400);
|
||||
paradise_state *state = (paradise_state *)space->machine->driver_data;
|
||||
state->vram_1[offset] = data;
|
||||
tilemap_mark_tile_dirty(state->tilemap_1, offset % 0x400);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( get_tile_info_1 )
|
||||
{
|
||||
int code = paradise_vram_1[tile_index] + (paradise_vram_1[tile_index + 0x400] << 8);
|
||||
paradise_state *state = (paradise_state *)machine->driver_data;
|
||||
int code = state->vram_1[tile_index] + (state->vram_1[tile_index + 0x400] << 8);
|
||||
SET_TILE_INFO(2, code, 0, 0);
|
||||
}
|
||||
|
||||
@ -120,13 +114,15 @@ static TILE_GET_INFO( get_tile_info_1 )
|
||||
/* Foreground */
|
||||
WRITE8_HANDLER( paradise_vram_2_w )
|
||||
{
|
||||
paradise_vram_2[offset] = data;
|
||||
tilemap_mark_tile_dirty(tilemap_2, offset % 0x400);
|
||||
paradise_state *state = (paradise_state *)space->machine->driver_data;
|
||||
state->vram_2[offset] = data;
|
||||
tilemap_mark_tile_dirty(state->tilemap_2, offset % 0x400);
|
||||
}
|
||||
|
||||
static TILE_GET_INFO( get_tile_info_2 )
|
||||
{
|
||||
int code = paradise_vram_2[tile_index] + (paradise_vram_2[tile_index + 0x400] << 8);
|
||||
paradise_state *state = (paradise_state *)machine->driver_data;
|
||||
int code = state->vram_2[tile_index] + (state->vram_2[tile_index + 0x400] << 8);
|
||||
SET_TILE_INFO(3, code, 0, 0);
|
||||
}
|
||||
|
||||
@ -134,15 +130,16 @@ static TILE_GET_INFO( get_tile_info_2 )
|
||||
|
||||
WRITE8_HANDLER( paradise_pixmap_w )
|
||||
{
|
||||
int x,y;
|
||||
paradise_state *state = (paradise_state *)space->machine->driver_data;
|
||||
int x, y;
|
||||
|
||||
space->machine->generic.videoram.u8[offset] = data;
|
||||
state->videoram[offset] = data;
|
||||
|
||||
x = (offset & 0x7f) << 1;
|
||||
y = (offset >> 7);
|
||||
|
||||
*BITMAP_ADDR16(space->machine->generic.tmpbitmap, y, x+0) = 0x80f - (data >> 4);
|
||||
*BITMAP_ADDR16(space->machine->generic.tmpbitmap, y, x+1) = 0x80f - (data & 0x0f);
|
||||
*BITMAP_ADDR16(state->tmpbitmap, y, x + 0) = 0x80f - (data >> 4);
|
||||
*BITMAP_ADDR16(state->tmpbitmap, y, x + 1) = 0x80f - (data & 0x0f);
|
||||
}
|
||||
|
||||
|
||||
@ -154,16 +151,20 @@ WRITE8_HANDLER( paradise_pixmap_w )
|
||||
|
||||
VIDEO_START( paradise )
|
||||
{
|
||||
tilemap_0 = tilemap_create( machine, get_tile_info_0, tilemap_scan_rows, 8,8, 0x20,0x20 );
|
||||
tilemap_1 = tilemap_create( machine, get_tile_info_1, tilemap_scan_rows, 8,8, 0x20,0x20 );
|
||||
tilemap_2 = tilemap_create( machine, get_tile_info_2, tilemap_scan_rows, 8,8, 0x20,0x20 );
|
||||
paradise_state *state = (paradise_state *)machine->driver_data;
|
||||
|
||||
state->tilemap_0 = tilemap_create(machine, get_tile_info_0, tilemap_scan_rows, 8, 8, 0x20, 0x20);
|
||||
state->tilemap_1 = tilemap_create(machine, get_tile_info_1, tilemap_scan_rows, 8, 8, 0x20, 0x20);
|
||||
state->tilemap_2 = tilemap_create(machine, get_tile_info_2, tilemap_scan_rows, 8, 8, 0x20, 0x20);
|
||||
|
||||
/* pixmap */
|
||||
machine->generic.tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||
state->tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||
|
||||
tilemap_set_transparent_pen(tilemap_0,0x0f);
|
||||
tilemap_set_transparent_pen(tilemap_1,0xff);
|
||||
tilemap_set_transparent_pen(tilemap_2,0xff);
|
||||
tilemap_set_transparent_pen(state->tilemap_0, 0x0f);
|
||||
tilemap_set_transparent_pen(state->tilemap_1, 0xff);
|
||||
tilemap_set_transparent_pen(state->tilemap_2, 0xff);
|
||||
|
||||
state_save_register_global_bitmap(machine, state->tmpbitmap);
|
||||
}
|
||||
|
||||
|
||||
@ -176,22 +177,24 @@ VIDEO_START( paradise )
|
||||
/* Sprites / Layers priority */
|
||||
WRITE8_HANDLER( paradise_priority_w )
|
||||
{
|
||||
paradise_priority = data;
|
||||
paradise_state *state = (paradise_state *)space->machine->driver_data;
|
||||
state->priority = data;
|
||||
}
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
|
||||
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
|
||||
{
|
||||
UINT8 *spriteram = machine->generic.spriteram.u8;
|
||||
paradise_state *state = (paradise_state *)machine->driver_data;
|
||||
UINT8 *spriteram = state->spriteram;
|
||||
int i;
|
||||
for (i = 0; i < machine->generic.spriteram_size ; i += paradise_sprite_inc)
|
||||
for (i = 0; i < state->spriteram_size ; i += state->sprite_inc)
|
||||
{
|
||||
int code = spriteram[i+0];
|
||||
int x = spriteram[i+1];
|
||||
int y = spriteram[i+2] - 2;
|
||||
int attr = spriteram[i+3];
|
||||
int code = spriteram[i + 0];
|
||||
int x = spriteram[i + 1];
|
||||
int y = spriteram[i + 2] - 2;
|
||||
int attr = spriteram[i + 3];
|
||||
|
||||
int flipx = 0; // ?
|
||||
int flipy = 0;
|
||||
int flipx = 0; // ?
|
||||
int flipy = 0;
|
||||
|
||||
if (flip_screen_get(machine))
|
||||
{
|
||||
@ -229,6 +232,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
|
||||
VIDEO_UPDATE( paradise )
|
||||
{
|
||||
paradise_state *state = (paradise_state *)screen->machine->driver_data;
|
||||
int layers_ctrl = -1;
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
@ -244,29 +248,34 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
|
||||
}
|
||||
#endif
|
||||
|
||||
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
|
||||
bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
|
||||
|
||||
if (!(paradise_priority & 4)) /* Screen blanking */
|
||||
if (!(state->priority & 4)) /* Screen blanking */
|
||||
return 0;
|
||||
|
||||
if (paradise_priority & 1)
|
||||
if (layers_ctrl&16) draw_sprites(screen->machine,bitmap,cliprect);
|
||||
if (state->priority & 1)
|
||||
if (layers_ctrl & 16)
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
|
||||
if (layers_ctrl&1) tilemap_draw(bitmap,cliprect, tilemap_0, 0,0);
|
||||
if (layers_ctrl&2) tilemap_draw(bitmap,cliprect, tilemap_1, 0,0);
|
||||
if (layers_ctrl&4) copybitmap_trans(bitmap,screen->machine->generic.tmpbitmap,flip_screen_get(screen->machine),flip_screen_get(screen->machine),0,0,cliprect, 0x80f);
|
||||
if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->tilemap_0, 0, 0);
|
||||
if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->tilemap_1, 0, 0);
|
||||
if (layers_ctrl & 4) copybitmap_trans(bitmap, state->tmpbitmap, flip_screen_get(screen->machine), flip_screen_get(screen->machine), 0, 0, cliprect, 0x80f);
|
||||
|
||||
if (paradise_priority & 2)
|
||||
if (state->priority & 2)
|
||||
{
|
||||
if (!(paradise_priority & 1))
|
||||
if (layers_ctrl&16) draw_sprites(screen->machine, bitmap,cliprect);
|
||||
if (layers_ctrl&8) tilemap_draw(bitmap,cliprect, tilemap_2, 0,0);
|
||||
if (!(state->priority & 1))
|
||||
if (layers_ctrl & 16)
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
if (layers_ctrl & 8)
|
||||
tilemap_draw(bitmap,cliprect, state->tilemap_2, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (layers_ctrl&8) tilemap_draw(bitmap,cliprect, tilemap_2, 0,0);
|
||||
if (!(paradise_priority & 1))
|
||||
if (layers_ctrl&16) draw_sprites(screen->machine, bitmap,cliprect);
|
||||
if (layers_ctrl & 8)
|
||||
tilemap_draw(bitmap, cliprect, state->tilemap_2, 0, 0);
|
||||
if (!(state->priority & 1))
|
||||
if (layers_ctrl & 16)
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -274,28 +283,30 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
|
||||
/* no pix layer, no tilemap_0, different priority bits */
|
||||
VIDEO_UPDATE( torus )
|
||||
{
|
||||
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
|
||||
paradise_state *state = (paradise_state *)screen->machine->driver_data;
|
||||
|
||||
if (!(paradise_priority & 2)) /* Screen blanking */
|
||||
bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
|
||||
|
||||
if (!(state->priority & 2)) /* Screen blanking */
|
||||
return 0;
|
||||
|
||||
if (paradise_priority & 1)
|
||||
draw_sprites(screen->machine, bitmap,cliprect);
|
||||
if (state->priority & 1)
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
|
||||
tilemap_draw(bitmap,cliprect, tilemap_1, 0,0);
|
||||
tilemap_draw(bitmap, cliprect, state->tilemap_1, 0,0);
|
||||
|
||||
if(paradise_priority & 4)
|
||||
if (state->priority & 4)
|
||||
{
|
||||
if (!(paradise_priority & 1))
|
||||
draw_sprites(screen->machine, bitmap,cliprect);
|
||||
if (!(state->priority & 1))
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
|
||||
tilemap_draw(bitmap,cliprect, tilemap_2, 0,0);
|
||||
tilemap_draw(bitmap, cliprect, state->tilemap_2, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
tilemap_draw(bitmap,cliprect, tilemap_2, 0,0);
|
||||
tilemap_draw(bitmap, cliprect, state->tilemap_2, 0, 0);
|
||||
|
||||
if (!(paradise_priority & 1))
|
||||
if (!(state->priority & 1))
|
||||
draw_sprites(screen->machine, bitmap,cliprect);
|
||||
}
|
||||
return 0;
|
||||
@ -304,12 +315,12 @@ VIDEO_UPDATE( torus )
|
||||
/* I don't know how the priority bits work on this one */
|
||||
VIDEO_UPDATE( madball )
|
||||
{
|
||||
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
|
||||
tilemap_draw(bitmap,cliprect, tilemap_0, 0,0);
|
||||
tilemap_draw(bitmap,cliprect, tilemap_1, 0,0);
|
||||
tilemap_draw(bitmap,cliprect, tilemap_2, 0,0);
|
||||
draw_sprites(screen->machine, bitmap,cliprect);
|
||||
paradise_state *state = (paradise_state *)screen->machine->driver_data;
|
||||
|
||||
bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
|
||||
tilemap_draw(bitmap, cliprect, state->tilemap_0, 0, 0);
|
||||
tilemap_draw(bitmap, cliprect, state->tilemap_1, 0, 0);
|
||||
tilemap_draw(bitmap, cliprect, state->tilemap_2, 0, 0);
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,11 +8,11 @@
|
||||
static TILE_GET_INFO( get_pass_bg_tile_info )
|
||||
{
|
||||
pass_state *state = (pass_state *)machine->driver_data;
|
||||
int tileno,fx;
|
||||
int tileno, fx;
|
||||
|
||||
tileno = state->bg_videoram[tile_index] & 0x1fff;
|
||||
fx = (state->bg_videoram[tile_index] & 0xc000) >> 14;
|
||||
SET_TILE_INFO(1,tileno,0,TILE_FLIPYX(fx));
|
||||
SET_TILE_INFO(1, tileno, 0, TILE_FLIPYX(fx));
|
||||
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ WRITE16_HANDLER( pass_bg_videoram_w )
|
||||
pass_state *state = (pass_state *)space->machine->driver_data;
|
||||
|
||||
state->bg_videoram[offset] = data;
|
||||
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
|
||||
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
|
||||
}
|
||||
|
||||
/* foreground 'sprites' tilemap stuff */
|
||||
@ -34,7 +34,7 @@ static TILE_GET_INFO( get_pass_fg_tile_info )
|
||||
tileno = state->fg_videoram[tile_index] & 0x3fff;
|
||||
flip = (state->fg_videoram[tile_index] & 0xc000) >>14;
|
||||
|
||||
SET_TILE_INFO(0,tileno,0,TILE_FLIPYX(flip));
|
||||
SET_TILE_INFO(0, tileno, 0, TILE_FLIPYX(flip));
|
||||
|
||||
}
|
||||
|
||||
@ -42,27 +42,27 @@ WRITE16_HANDLER( pass_fg_videoram_w )
|
||||
{
|
||||
pass_state *state = (pass_state *)space->machine->driver_data;
|
||||
state->fg_videoram[offset] = data;
|
||||
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
|
||||
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
|
||||
}
|
||||
|
||||
/* video update / start */
|
||||
|
||||
VIDEO_UPDATE( pass )
|
||||
{
|
||||
pass_state *state = (pass_state *)screen->machine->driver_data;
|
||||
|
||||
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
|
||||
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
VIDEO_START( pass )
|
||||
{
|
||||
pass_state *state = (pass_state *)machine->driver_data;
|
||||
|
||||
state->bg_tilemap = tilemap_create(machine, get_pass_bg_tile_info,tilemap_scan_rows, 8, 8,64,32);
|
||||
state->fg_tilemap = tilemap_create(machine, get_pass_fg_tile_info,tilemap_scan_rows, 4, 4,128,64);
|
||||
state->bg_tilemap = tilemap_create(machine, get_pass_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
|
||||
state->fg_tilemap = tilemap_create(machine, get_pass_fg_tile_info, tilemap_scan_rows, 4, 4, 128, 64);
|
||||
|
||||
tilemap_set_transparent_pen(state->fg_tilemap,255);
|
||||
tilemap_set_transparent_pen(state->fg_tilemap, 255);
|
||||
}
|
||||
|
||||
VIDEO_UPDATE( pass )
|
||||
{
|
||||
pass_state *state = (pass_state *)screen->machine->driver_data;
|
||||
|
||||
tilemap_draw(bitmap,cliprect,state->bg_tilemap, 0, 0);
|
||||
tilemap_draw(bitmap,cliprect,state->fg_tilemap, 0, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -7,44 +7,45 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
UINT8 *pbaction_videoram, *pbaction_colorram;
|
||||
UINT8 *pbaction_videoram2, *pbaction_colorram2;
|
||||
|
||||
static int scroll;
|
||||
|
||||
static tilemap_t *bg_tilemap, *fg_tilemap;
|
||||
#include "includes/pbaction.h"
|
||||
|
||||
WRITE8_HANDLER( pbaction_videoram_w )
|
||||
{
|
||||
pbaction_videoram[offset] = data;
|
||||
tilemap_mark_tile_dirty(bg_tilemap, offset);
|
||||
pbaction_state *state = (pbaction_state *)space->machine->driver_data;
|
||||
state->videoram[offset] = data;
|
||||
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( pbaction_colorram_w )
|
||||
{
|
||||
pbaction_colorram[offset] = data;
|
||||
tilemap_mark_tile_dirty(bg_tilemap, offset);
|
||||
pbaction_state *state = (pbaction_state *)space->machine->driver_data;
|
||||
state->colorram[offset] = data;
|
||||
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( pbaction_videoram2_w )
|
||||
{
|
||||
pbaction_videoram2[offset] = data;
|
||||
tilemap_mark_tile_dirty(fg_tilemap, offset);
|
||||
pbaction_state *state = (pbaction_state *)space->machine->driver_data;
|
||||
state->videoram2[offset] = data;
|
||||
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( pbaction_colorram2_w )
|
||||
{
|
||||
pbaction_colorram2[offset] = data;
|
||||
tilemap_mark_tile_dirty(fg_tilemap, offset);
|
||||
pbaction_state *state = (pbaction_state *)space->machine->driver_data;
|
||||
state->colorram2[offset] = data;
|
||||
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( pbaction_scroll_w )
|
||||
{
|
||||
scroll = data - 3;
|
||||
if (flip_screen_get(space->machine)) scroll = -scroll;
|
||||
tilemap_set_scrollx(bg_tilemap, 0, scroll);
|
||||
tilemap_set_scrollx(fg_tilemap, 0, scroll);
|
||||
pbaction_state *state = (pbaction_state *)space->machine->driver_data;
|
||||
state->scroll = data - 3;
|
||||
if (flip_screen_get(space->machine))
|
||||
state->scroll = -state->scroll;
|
||||
|
||||
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll);
|
||||
tilemap_set_scrollx(state->fg_tilemap, 0, state->scroll);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( pbaction_flipscreen_w )
|
||||
@ -54,8 +55,9 @@ WRITE8_HANDLER( pbaction_flipscreen_w )
|
||||
|
||||
static TILE_GET_INFO( get_bg_tile_info )
|
||||
{
|
||||
int attr = pbaction_colorram[tile_index];
|
||||
int code = pbaction_videoram[tile_index] + 0x10 * (attr & 0x70);
|
||||
pbaction_state *state = (pbaction_state *)machine->driver_data;
|
||||
int attr = state->colorram[tile_index];
|
||||
int code = state->videoram[tile_index] + 0x10 * (attr & 0x70);
|
||||
int color = attr & 0x07;
|
||||
int flags = (attr & 0x80) ? TILE_FLIPY : 0;
|
||||
|
||||
@ -64,8 +66,9 @@ static TILE_GET_INFO( get_bg_tile_info )
|
||||
|
||||
static TILE_GET_INFO( get_fg_tile_info )
|
||||
{
|
||||
int attr = pbaction_colorram2[tile_index];
|
||||
int code = pbaction_videoram2[tile_index] + 0x10 * (attr & 0x30);
|
||||
pbaction_state *state = (pbaction_state *)machine->driver_data;
|
||||
int attr = state->colorram2[tile_index];
|
||||
int code = state->videoram2[tile_index] + 0x10 * (attr & 0x30);
|
||||
int color = attr & 0x0f;
|
||||
int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
|
||||
|
||||
@ -74,34 +77,37 @@ static TILE_GET_INFO( get_fg_tile_info )
|
||||
|
||||
VIDEO_START( pbaction )
|
||||
{
|
||||
bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
|
||||
8, 8, 32, 32);
|
||||
pbaction_state *state = (pbaction_state *)machine->driver_data;
|
||||
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
|
||||
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
|
||||
|
||||
fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows,
|
||||
8, 8, 32, 32);
|
||||
|
||||
tilemap_set_transparent_pen(fg_tilemap, 0);
|
||||
tilemap_set_transparent_pen(state->fg_tilemap, 0);
|
||||
}
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
|
||||
{
|
||||
UINT8 *spriteram = machine->generic.spriteram.u8;
|
||||
pbaction_state *state = (pbaction_state *)machine->driver_data;
|
||||
UINT8 *spriteram = state->spriteram;
|
||||
int offs;
|
||||
|
||||
for (offs = machine->generic.spriteram_size - 4;offs >= 0;offs -= 4)
|
||||
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
|
||||
{
|
||||
int sx,sy,flipx,flipy;
|
||||
int sx, sy, flipx, flipy;
|
||||
|
||||
/* if next sprite is double size, skip this one */
|
||||
if (offs > 0 && spriteram[offs - 4] & 0x80) continue;
|
||||
if (offs > 0 && spriteram[offs - 4] & 0x80)
|
||||
continue;
|
||||
|
||||
sx = spriteram[offs + 3];
|
||||
|
||||
sx = spriteram[offs+3];
|
||||
if (spriteram[offs] & 0x80)
|
||||
sy = 225-spriteram[offs+2];
|
||||
sy = 225 - spriteram[offs + 2];
|
||||
else
|
||||
sy = 241-spriteram[offs+2];
|
||||
flipx = spriteram[offs+1] & 0x40;
|
||||
flipy = spriteram[offs+1] & 0x80;
|
||||
sy = 241 - spriteram[offs + 2];
|
||||
|
||||
flipx = spriteram[offs + 1] & 0x40;
|
||||
flipy = spriteram[offs + 1] & 0x80;
|
||||
|
||||
if (flip_screen_get(machine))
|
||||
{
|
||||
if (spriteram[offs] & 0x80)
|
||||
@ -122,14 +128,16 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
spriteram[offs],
|
||||
spriteram[offs + 1] & 0x0f,
|
||||
flipx,flipy,
|
||||
sx + (flip_screen_get(machine) ? scroll : -scroll), sy,0);
|
||||
sx + (flip_screen_get(machine) ? state->scroll : -state->scroll), sy,0);
|
||||
}
|
||||
}
|
||||
|
||||
VIDEO_UPDATE( pbaction )
|
||||
{
|
||||
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
|
||||
pbaction_state *state = (pbaction_state *)screen->machine->driver_data;
|
||||
|
||||
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
|
||||
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user