Haze: converted dark seal

This commit is contained in:
Angelo Salese 2011-03-26 20:38:39 +00:00
parent 10d5f2de67
commit ca8edd4cd8
3 changed files with 81 additions and 206 deletions

View File

@ -21,6 +21,7 @@
#include "sound/okim6295.h"
#include "includes/darkseal.h"
#include "video/decospr.h"
#include "video/deco16ic.h"
/******************************************************************************/
@ -65,14 +66,18 @@ static ADDRESS_MAP_START( darkseal_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE(darkseal_palette_24bit_rg_w) AM_BASE_GENERIC(paletteram)
AM_RANGE(0x141000, 0x141fff) AM_RAM_WRITE(darkseal_palette_24bit_b_w) AM_BASE_GENERIC(paletteram2)
AM_RANGE(0x180000, 0x18000f) AM_READWRITE(darkseal_control_r, darkseal_control_w)
AM_RANGE(0x200000, 0x200fff) AM_WRITE(darkseal_pf3b_data_w) /* 2nd half of pf3, only used on last level */
AM_RANGE(0x202000, 0x203fff) AM_WRITE(darkseal_pf3_data_w) AM_BASE_MEMBER(darkseal_state, pf3_data)
AM_RANGE(0x220000, 0x220fff) AM_RAM AM_BASE_MEMBER(darkseal_state, pf12_row)
AM_RANGE(0x222000, 0x222fff) AM_RAM AM_BASE_MEMBER(darkseal_state, pf34_row)
AM_RANGE(0x240000, 0x24000f) AM_WRITE(darkseal_control_0_w)
AM_RANGE(0x260000, 0x261fff) AM_WRITE(darkseal_pf2_data_w) AM_BASE_MEMBER(darkseal_state, pf2_data)
AM_RANGE(0x262000, 0x263fff) AM_WRITE(darkseal_pf1_data_w) AM_BASE_MEMBER(darkseal_state, pf1_data)
AM_RANGE(0x2a0000, 0x2a000f) AM_WRITE(darkseal_control_1_w)
AM_RANGE(0x200000, 0x201fff) AM_DEVREADWRITE("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
AM_RANGE(0x202000, 0x203fff) AM_DEVREADWRITE("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE("tilegen2", deco16ic_pf_control_w)
AM_RANGE(0x220000, 0x220fff) AM_RAM AM_BASE_MEMBER(darkseal_state, pf1_rowscroll)
// pf2 & 4 rowscrolls are where? (maybe don't exist?)
AM_RANGE(0x222000, 0x222fff) AM_RAM AM_BASE_MEMBER(darkseal_state, pf3_rowscroll)
AM_RANGE(0x260000, 0x261fff) AM_DEVREADWRITE("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w)
AM_RANGE(0x262000, 0x263fff) AM_DEVREADWRITE("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w)
AM_RANGE(0x2a0000, 0x2a000f) AM_DEVWRITE("tilegen1", deco16ic_pf_control_w)
ADDRESS_MAP_END
/******************************************************************************/
@ -210,6 +215,7 @@ static const gfx_layout seallayout2 =
static GFXDECODE_START( darkseal )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) /* Characters 8x8 */
GFXDECODE_ENTRY( "gfx2", 0, seallayout, 768, 16 ) /* Tiles 16x16 */
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) /* Characters 8x8 */
GFXDECODE_ENTRY( "gfx3", 0, seallayout, 1024, 16 ) /* Tiles 16x16 */
GFXDECODE_ENTRY( "gfx4", 0, seallayout2, 256, 32 ) /* Sprites 16x16 */
GFXDECODE_END
@ -226,6 +232,32 @@ static const ym2151_interface ym2151_config =
sound_irq
};
static const deco16ic_interface darkseal_deco16ic_tilegen1_intf =
{
"screen",
0, 3, // both these tilemaps need to be twice the y size of usual!
0x0f, 0x0f, /* trans masks (default values) */
0x00, 0x00, /* color base */
0x0f, 0x0f, /* color masks (default values) */
NULL,
NULL,
0,1
};
static const deco16ic_interface darkseal_deco16ic_tilegen2_intf =
{
"screen",
0, 1,
0x0f, 0x0f, /* trans masks (default values) */
0x00, 0x00, /* color base */
0x0f, 0x0f, /* color masks (default values) */
NULL,
NULL,
2,3
};
static MACHINE_CONFIG_START( darkseal, darkseal_state )
/* basic machine hardware */
@ -250,8 +282,14 @@ static MACHINE_CONFIG_START( darkseal, darkseal_state )
MCFG_GFXDECODE(darkseal)
MCFG_PALETTE_LENGTH(2048)
MCFG_DECO16IC_ADD("tilegen1", darkseal_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", darkseal_deco16ic_tilegen2_intf)
MCFG_DEVICE_ADD("spritegen", decospr_, 0)
decospr_device_config::set_gfx_region(device, 3);
decospr_device_config::set_gfx_region(device, 4);
MCFG_VIDEO_START(darkseal)

View File

@ -3,76 +3,12 @@
Dark Seal Video emulation - Bryan McPhail, mish@tendril.co.uk
****************************************************************************
Data East custom chip 55: Generates two playfields, playfield 1 is underneath
playfield 2. Dark Seal uses two of these chips. 1 playfield is _always_ off
in this game.
16 bytes of control registers per chip.
Word 0:
Mask 0x0080: Flip screen
Mask 0x007f: ?
Word 2:
Mask 0xffff: Playfield 2 X scroll (top playfield)
Word 4:
Mask 0xffff: Playfield 2 Y scroll (top playfield)
Word 6:
Mask 0xffff: Playfield 1 X scroll (bottom playfield)
Word 8:
Mask 0xffff: Playfield 1 Y scroll (bottom playfield)
Word 0xa:
Mask 0xc000: Playfield 1 shape??
Mask 0x3000: Playfield 1 rowscroll style (maybe mask 0x3800??)
Mask 0x0300: Playfield 1 colscroll style (maybe mask 0x0700??)?
Mask 0x00c0: Playfield 2 shape??
Mask 0x0030: Playfield 2 rowscroll style (maybe mask 0x0038??)
Mask 0x0003: Playfield 2 colscroll style (maybe mask 0x0007??)?
Word 0xc:
Mask 0x8000: Playfield 1 is 8*8 tiles else 16*16
Mask 0x4000: Playfield 1 rowscroll enabled
Mask 0x2000: Playfield 1 colscroll enabled
Mask 0x1f00: ?
Mask 0x0080: Playfield 2 is 8*8 tiles else 16*16
Mask 0x0040: Playfield 2 rowscroll enabled
Mask 0x0020: Playfield 2 colscroll enabled
Mask 0x001f: ?
Word 0xe:
??
Locations 0 & 0xe are mostly unknown:
0 14
Caveman Ninja (bottom): 0053 1100 (changes to 1111 later)
Caveman Ninja (top): 0010 0081
Two Crude (bottom): 0053 0000
Two Crude (top): 0010 0041
Dark Seal (bottom): 0010 0000
Dark Seal (top): 0053 4101
Tumblepop: 0010 0000
Super Burger Time: 0010 0000
Location 0xe looks like it could be a mirror of another byte..
uses 2x DECO55 tilemaps
**************************************************************************
Sprites - Data East custom chip 52
8 bytes per sprite, unknowns bits seem unused.
Word 0:
Mask 0x8000 - ?
Mask 0x4000 - Y flip
Mask 0x2000 - X flip
Mask 0x1000 - Sprite flash
Mask 0x0800 - ?
Mask 0x0600 - Sprite height (1x, 2x, 4x, 8x)
Mask 0x01ff - Y coordinate
Word 2:
Mask 0xffff - Sprite number
Sprite/Tilemap Priority Note (is this implemented?)
Word 4:
Mask 0x8000 - ?
@ -80,66 +16,15 @@ Sprites - Data East custom chip 52
Mask 0x3e00 - Colour (32 palettes, most games only use 16)
Mask 0x01ff - X coordinate
Word 6:
Always unused.
***************************************************************************/
#include "emu.h"
#include "includes/darkseal.h"
#include "video/decospr.h"
#include "video/deco16ic.h"
/***************************************************************************/
/* Function for all 16x16 1024x1024 layers */
static TILEMAP_MAPPER( darkseal_scan )
{
/* logical (col,row) -> memory offset */
return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) << 6);
}
INLINE void get_bg_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int gfx_bank,UINT16 *gfx_base)
{
int tile,color;
tile=gfx_base[tile_index];
color=tile >> 12;
tile=tile&0xfff;
SET_TILE_INFO(
gfx_bank,
tile,
color,
0);
}
static TILE_GET_INFO( get_bg_tile_info2 )
{
darkseal_state *state = machine->driver_data<darkseal_state>();
get_bg_tile_info(machine,tileinfo,tile_index,1,state->pf2_data);
}
static TILE_GET_INFO( get_bg_tile_info3 )
{
darkseal_state *state = machine->driver_data<darkseal_state>();
get_bg_tile_info(machine,tileinfo,tile_index,2,state->pf3_data);
}
static TILE_GET_INFO( get_fg_tile_info )
{
darkseal_state *state = machine->driver_data<darkseal_state>();
int tile=state->pf1_data[tile_index];
int color=tile >> 12;
tile=tile&0xfff;
SET_TILE_INFO(
0,
tile,
color,
0);
}
/******************************************************************************/
static void update_24bitcol(running_machine *machine, int offset)
@ -167,57 +52,9 @@ WRITE16_HANDLER( darkseal_palette_24bit_b_w )
/******************************************************************************/
/******************************************************************************/
WRITE16_HANDLER( darkseal_pf1_data_w )
{
darkseal_state *state = space->machine->driver_data<darkseal_state>();
COMBINE_DATA(&state->pf1_data[offset]);
tilemap_mark_tile_dirty(state->pf1_tilemap,offset);
}
WRITE16_HANDLER( darkseal_pf2_data_w )
{
darkseal_state *state = space->machine->driver_data<darkseal_state>();
COMBINE_DATA(&state->pf2_data[offset]);
tilemap_mark_tile_dirty(state->pf2_tilemap,offset);
}
WRITE16_HANDLER( darkseal_pf3_data_w )
{
darkseal_state *state = space->machine->driver_data<darkseal_state>();
COMBINE_DATA(&state->pf3_data[offset]);
tilemap_mark_tile_dirty(state->pf3_tilemap,offset);
}
WRITE16_HANDLER( darkseal_pf3b_data_w ) /* Mirror */
{
darkseal_pf3_data_w(space,offset+0x800,data,mem_mask);
}
WRITE16_HANDLER( darkseal_control_0_w )
{
darkseal_state *state = space->machine->driver_data<darkseal_state>();
COMBINE_DATA(&state->control_0[offset]);
}
WRITE16_HANDLER( darkseal_control_1_w )
{
darkseal_state *state = space->machine->driver_data<darkseal_state>();
COMBINE_DATA(&state->control_1[offset]);
}
/******************************************************************************/
VIDEO_START( darkseal )
{
darkseal_state *state = machine->driver_data<darkseal_state>();
state->pf1_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8,64,64);
state->pf2_tilemap = tilemap_create(machine, get_bg_tile_info2,darkseal_scan, 16,16,64,64);
state->pf3_tilemap = tilemap_create(machine, get_bg_tile_info3,darkseal_scan, 16,16,64,64);
tilemap_set_transparent_pen(state->pf1_tilemap,0);
tilemap_set_transparent_pen(state->pf2_tilemap,0);
}
/******************************************************************************/
@ -225,34 +62,20 @@ VIDEO_START( darkseal )
SCREEN_UPDATE( darkseal )
{
darkseal_state *state = screen->machine->driver_data<darkseal_state>();
state->flipscreen=!(state->control_0[0]&0x80);
tilemap_set_flip_all(screen->machine,state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
/* Update scroll registers */
tilemap_set_scrollx( state->pf1_tilemap,0, state->control_1[3] );
tilemap_set_scrolly( state->pf1_tilemap,0, state->control_1[4] );
tilemap_set_scrollx( state->pf2_tilemap,0, state->control_1[1]);
tilemap_set_scrolly( state->pf2_tilemap,0, state->control_1[2] );
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
if (state->control_0[6]&0x4000) { /* Rowscroll enable */
int offs,scrollx=state->control_0[3];
tilemap_set_scroll_rows(state->pf3_tilemap,512);
for (offs = 0;offs < 512;offs++)
tilemap_set_scrollx( state->pf3_tilemap,offs, scrollx + state->pf34_row[offs+0x40] );
}
else {
tilemap_set_scroll_rows(state->pf3_tilemap,1);
tilemap_set_scrollx( state->pf3_tilemap,0, state->control_0[3] );
}
tilemap_set_scrolly( state->pf3_tilemap,0, state->control_0[4] );
tilemap_draw(bitmap,cliprect,state->pf3_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->pf2_tilemap,0,0);
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf1_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf3_rowscroll);
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 0);
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, 0, 0);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0x400);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
tilemap_draw(bitmap,cliprect,state->pf1_tilemap,0,0);
return 0;
}

View File

@ -150,6 +150,12 @@ Rowscroll style:
- convert to c++ device
- should the decryption functions for the tilemap chips be here too?
it seems overall height / width of the tilemaps can be configured somehow
darkseal clearly needs 64 rows, whereas other games need 32.
width seems configurable in a similar way, with nitroball and lockload
needing narrower tilemaps. lockload/dragngun might be a good study case
as they run on the same harwdare, and both rely on different behavior.
***************************************************************************/
@ -554,7 +560,7 @@ WRITE16_DEVICE_HANDLER( deco16ic_pf1_data_w )
COMBINE_DATA(&deco16ic->pf1_data[offset]);
tilemap_mark_tile_dirty(deco16ic->pf1_tilemap_8x8, offset);
if (offset < 0x800)
// if (offset < 0x800)
tilemap_mark_tile_dirty(deco16ic->pf1_tilemap_16x16, offset);
}
@ -565,7 +571,7 @@ WRITE16_DEVICE_HANDLER( deco16ic_pf2_data_w )
COMBINE_DATA(&deco16ic->pf2_data[offset]);
tilemap_mark_tile_dirty(deco16ic->pf2_tilemap_8x8, offset);
if (offset < 0x800)
// if (offset < 0x800)
tilemap_mark_tile_dirty(deco16ic->pf2_tilemap_16x16, offset);
}
@ -912,21 +918,29 @@ static DEVICE_START( deco16ic )
deco16ic->pf1_colourmask = intf->col_mask1;
deco16ic->pf2_colourmask = intf->col_mask2;
deco16ic->pf1_tilemap_16x16 = tilemap_create_device(device, get_pf1_tile_info, deco16_scan_rows, 16, 16, intf->full_width12 ? 64 : 32, 32);
int fullheight = 0;
int fullwidth = 0;
if (intf->full_width12&2)
fullheight = 1;
if (intf->full_width12&1)
fullwidth = 1;
deco16ic->pf1_tilemap_16x16 = tilemap_create_device(device, get_pf1_tile_info, deco16_scan_rows, 16, 16, fullwidth ? 64 : 32, fullheight ?64 : 32);
// deco16ic->pf1_tilemap_8x8 = tilemap_create_device(device, get_pf1_tile_info_b, tilemap_scan_rows, 8, 8, intf->full_width12 ? 64 : 32, 32);
deco16ic->pf1_tilemap_8x8 = tilemap_create_device(device, get_pf1_tile_info_b, tilemap_scan_rows, 8, 8, 64 , 32); // nitroball
deco16ic->pf12_8x8_gfx_bank = intf->_8x8_gfxregion;
deco16ic->pf12_16x16_gfx_bank = intf->_16x16_gfxregion;
if (intf->split)
deco16ic->pf2_tilemap_16x16 = tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, intf->full_width12 ? 64 : 32, 32);
deco16ic->pf2_tilemap_16x16 = tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
else
deco16ic->pf2_tilemap_16x16 = tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, intf->full_width12 ? 64 : 32, 32);
deco16ic->pf2_tilemap_8x8 = tilemap_create_device(device, get_pf2_tile_info_b, tilemap_scan_rows, 8, 8, intf->full_width12 ? 64 : 32, 32);
deco16ic->pf2_tilemap_16x16 = tilemap_create_device(device, get_pf2_tile_info, deco16_scan_rows, 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
deco16ic->pf2_tilemap_8x8 = tilemap_create_device(device, get_pf2_tile_info_b, tilemap_scan_rows, 8, 8, fullwidth ? 64 : 32, fullheight ? 64 : 32);
tilemap_set_transparent_pen(deco16ic->pf1_tilemap_8x8, 0);
tilemap_set_transparent_pen(deco16ic->pf2_tilemap_8x8, 0);
tilemap_set_transparent_pen(deco16ic->pf1_tilemap_16x16, 0);