tilemap_create_device users modernized (no whatsnew)
This commit is contained in:
parent
95670260f4
commit
6c2d90f104
@ -433,7 +433,6 @@ typedef delegate<tilemap_memory_index (UINT32, UINT32, UINT32, UINT32)> tilemap_
|
|||||||
|
|
||||||
// legacy callbacks
|
// legacy callbacks
|
||||||
typedef void (*tile_get_info_func)(running_machine &machine, tile_data &tileinfo, tilemap_memory_index tile_index, void *param);
|
typedef void (*tile_get_info_func)(running_machine &machine, tile_data &tileinfo, tilemap_memory_index tile_index, void *param);
|
||||||
typedef void (*tile_get_info_device_func)(device_t *device, tile_data &tileinfo, tilemap_memory_index tile_index, void *param);
|
|
||||||
typedef tilemap_memory_index (*tilemap_mapper_func)(running_machine &machine, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
|
typedef tilemap_memory_index (*tilemap_mapper_func)(running_machine &machine, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows);
|
||||||
|
|
||||||
|
|
||||||
@ -676,7 +675,6 @@ private:
|
|||||||
// function definition for a get info callback
|
// function definition for a get info callback
|
||||||
#define TILE_GET_INFO(_name) void _name(running_machine &machine, tile_data &tileinfo, tilemap_memory_index tile_index, void *param)
|
#define TILE_GET_INFO(_name) void _name(running_machine &machine, tile_data &tileinfo, tilemap_memory_index tile_index, void *param)
|
||||||
#define TILE_GET_INFO_MEMBER(_name) void _name(tile_data &tileinfo, tilemap_memory_index tile_index, void *param)
|
#define TILE_GET_INFO_MEMBER(_name) void _name(tile_data &tileinfo, tilemap_memory_index tile_index, void *param)
|
||||||
#define TILE_GET_INFO_DEVICE(_name) void _name(device_t *device, tile_data &tileinfo, tilemap_memory_index tile_index, void *param)
|
|
||||||
|
|
||||||
// function definition for a logical-to-memory mapper
|
// function definition for a logical-to-memory mapper
|
||||||
#define TILEMAP_MAPPER(_name) tilemap_memory_index _name(running_machine &machine, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
|
#define TILEMAP_MAPPER(_name) tilemap_memory_index _name(running_machine &machine, UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows)
|
||||||
@ -685,7 +683,6 @@ private:
|
|||||||
// useful macro inside of a TILE_GET_INFO callback to set tile information
|
// useful macro inside of a TILE_GET_INFO callback to set tile information
|
||||||
#define SET_TILE_INFO(GFX,CODE,COLOR,FLAGS) tileinfo.set(machine, GFX, CODE, COLOR, FLAGS)
|
#define SET_TILE_INFO(GFX,CODE,COLOR,FLAGS) tileinfo.set(machine, GFX, CODE, COLOR, FLAGS)
|
||||||
#define SET_TILE_INFO_MEMBER(GFX,CODE,COLOR,FLAGS) tileinfo.set(machine(), GFX, CODE, COLOR, FLAGS)
|
#define SET_TILE_INFO_MEMBER(GFX,CODE,COLOR,FLAGS) tileinfo.set(machine(), GFX, CODE, COLOR, FLAGS)
|
||||||
#define SET_TILE_INFO_DEVICE(GFX,CODE,COLOR,FLAGS) tileinfo.set(device->machine(), GFX, CODE, COLOR, FLAGS)
|
|
||||||
|
|
||||||
// Macros for setting tile attributes in the TILE_GET_INFO callback:
|
// Macros for setting tile attributes in the TILE_GET_INFO callback:
|
||||||
// TILE_FLIP_YX assumes that flipy is in bit 1 and flipx is in bit 0
|
// TILE_FLIP_YX assumes that flipy is in bit 1 and flipx is in bit 0
|
||||||
@ -709,14 +706,6 @@ inline tilemap_t *tilemap_create(running_machine &machine, tile_get_info_func ti
|
|||||||
inline tilemap_t *tilemap_create(running_machine &machine, tile_get_info_func tile_get_info, tilemap_standard_mapper mapper, int tilewidth, int tileheight, int cols, int rows)
|
inline tilemap_t *tilemap_create(running_machine &machine, tile_get_info_func tile_get_info, tilemap_standard_mapper mapper, int tilewidth, int tileheight, int cols, int rows)
|
||||||
{ return &machine.tilemap().create(tilemap_get_info_delegate(tile_get_info, "", &machine), mapper, tilewidth, tileheight, cols, rows); }
|
{ return &machine.tilemap().create(tilemap_get_info_delegate(tile_get_info, "", &machine), mapper, tilewidth, tileheight, cols, rows); }
|
||||||
|
|
||||||
// create a new tilemap that is owned by a device
|
|
||||||
inline tilemap_t *tilemap_create_device(device_t *device, tile_get_info_device_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
|
|
||||||
{ return &device->machine().tilemap().create(tilemap_get_info_delegate(tile_get_info, "", device), tilemap_mapper_delegate(mapper, "", &device->machine()), tilewidth, tileheight, cols, rows); }
|
|
||||||
|
|
||||||
inline tilemap_t *tilemap_create_device(device_t *device, tile_get_info_device_func tile_get_info, tilemap_standard_mapper mapper, int tilewidth, int tileheight, int cols, int rows)
|
|
||||||
{ return &device->machine().tilemap().create(tilemap_get_info_delegate(tile_get_info, "", device), mapper, tilewidth, tileheight, cols, rows); }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// INLINE FUNCTIONS
|
// INLINE FUNCTIONS
|
||||||
|
@ -81,92 +81,81 @@ deco_bac06_device::deco_bac06_device(const machine_config &mconfig, const char *
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape0_scan)
|
||||||
|
|
||||||
|
|
||||||
static TILEMAP_MAPPER( tile_shape0_scan )
|
|
||||||
{
|
{
|
||||||
return (col & 0xf) + ((row & 0xf) << 4) + ((col & 0x1f0) << 4);
|
return (col & 0xf) + ((row & 0xf) << 4) + ((col & 0x1f0) << 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILEMAP_MAPPER( tile_shape1_scan )
|
TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape1_scan)
|
||||||
{
|
{
|
||||||
return (col & 0xf) + ((row & 0x1f) << 4) + ((col & 0xf0) << 5);
|
return (col & 0xf) + ((row & 0x1f) << 4) + ((col & 0xf0) << 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILEMAP_MAPPER( tile_shape2_scan )
|
TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape2_scan)
|
||||||
{
|
{
|
||||||
return (col & 0xf) + ((row & 0x3f) << 4) + ((col & 0x70) << 6);
|
return (col & 0xf) + ((row & 0x3f) << 4) + ((col & 0x70) << 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILEMAP_MAPPER( tile_shape0_8x8_scan )
|
TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape0_8x8_scan)
|
||||||
{
|
{
|
||||||
return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x60) << 5);
|
return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x60) << 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILEMAP_MAPPER( tile_shape1_8x8_scan )
|
TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape1_8x8_scan)
|
||||||
{
|
{
|
||||||
return (col & 0x1f) + ((row & 0x1f) << 5) + ((row & 0x20) << 5) + ((col & 0x20) << 6);
|
return (col & 0x1f) + ((row & 0x1f) << 5) + ((row & 0x20) << 5) + ((col & 0x20) << 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILEMAP_MAPPER( tile_shape2_8x8_scan )
|
TILEMAP_MAPPER_MEMBER(deco_bac06_device::tile_shape2_8x8_scan)
|
||||||
{
|
{
|
||||||
return (col & 0x1f) + ((row & 0x7f) << 5);
|
return (col & 0x1f) + ((row & 0x7f) << 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(deco_bac06_device::get_pf8x8_tile_info)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static TILE_GET_INFO_DEVICE( get_pf8x8_tile_info )
|
|
||||||
{
|
{
|
||||||
|
if (m_rambank&1) tile_index+=0x1000;
|
||||||
deco_bac06_device *dev = (deco_bac06_device*)device;
|
int tile=pf_data[tile_index];
|
||||||
if (dev->m_rambank&1) tile_index+=0x1000;
|
|
||||||
int tile=dev->pf_data[tile_index];
|
|
||||||
int colourpri=(tile>>12);
|
int colourpri=(tile>>12);
|
||||||
SET_TILE_INFO_DEVICE(dev->tile_region,tile&0xfff,0,0);
|
SET_TILE_INFO_MEMBER(tile_region,tile&0xfff,0,0);
|
||||||
tileinfo.category = colourpri;
|
tileinfo.category = colourpri;
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILE_GET_INFO_DEVICE( get_pf16x16_tile_info )
|
TILE_GET_INFO_MEMBER(deco_bac06_device::get_pf16x16_tile_info)
|
||||||
{
|
{
|
||||||
deco_bac06_device *dev = (deco_bac06_device*)device;
|
if (m_rambank&1) tile_index+=0x1000;
|
||||||
if (dev->m_rambank&1) tile_index+=0x1000;
|
int tile=pf_data[tile_index];
|
||||||
int tile=dev->pf_data[tile_index];
|
|
||||||
int colourpri=(tile>>12);
|
int colourpri=(tile>>12);
|
||||||
SET_TILE_INFO_DEVICE(dev->tile_region,tile&0xfff,0,0);
|
SET_TILE_INFO_MEMBER(tile_region,tile&0xfff,0,0);
|
||||||
tileinfo.category = colourpri;
|
tileinfo.category = colourpri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void deco_bac06_device::create_tilemaps(int region8x8, int region16x16)
|
void deco_bac06_device::create_tilemaps(int region8x8, int region16x16)
|
||||||
{
|
{
|
||||||
tile_region = region8x8;
|
tile_region = region8x8;
|
||||||
|
|
||||||
pf8x8_tilemap[0] = tilemap_create_device(this, get_pf8x8_tile_info,tile_shape0_8x8_scan, 8, 8,128, 32);
|
pf8x8_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf8x8_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape0_8x8_scan),this), 8, 8,128, 32);
|
||||||
pf8x8_tilemap[1] = tilemap_create_device(this, get_pf8x8_tile_info,tile_shape1_8x8_scan, 8, 8, 64, 64);
|
pf8x8_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf8x8_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape1_8x8_scan),this), 8, 8, 64, 64);
|
||||||
pf8x8_tilemap[2] = tilemap_create_device(this, get_pf8x8_tile_info,tile_shape2_8x8_scan, 8, 8, 32,128);
|
pf8x8_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf8x8_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape2_8x8_scan),this), 8, 8, 32,128);
|
||||||
|
|
||||||
tile_region = region16x16;
|
tile_region = region16x16;
|
||||||
|
|
||||||
if (m_wide==2)
|
if (m_wide==2)
|
||||||
{
|
{
|
||||||
pf16x16_tilemap[0] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape0_scan, 16, 16, 256, 16);
|
pf16x16_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape0_scan),this), 16, 16, 256, 16);
|
||||||
pf16x16_tilemap[1] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape1_scan, 16, 16, 128, 32);
|
pf16x16_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape1_scan),this), 16, 16, 128, 32);
|
||||||
pf16x16_tilemap[2] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape2_scan, 16, 16, 64, 64);
|
pf16x16_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape2_scan),this), 16, 16, 64, 64);
|
||||||
}
|
}
|
||||||
else if (m_wide==1)
|
else if (m_wide==1)
|
||||||
{
|
{
|
||||||
pf16x16_tilemap[0] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape0_scan, 16, 16, 128, 16);
|
pf16x16_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape0_scan),this), 16, 16, 128, 16);
|
||||||
pf16x16_tilemap[1] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape1_scan, 16, 16, 64, 32);
|
pf16x16_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape1_scan),this), 16, 16, 64, 32);
|
||||||
pf16x16_tilemap[2] = tilemap_create_device(this, get_pf16x16_tile_info, tile_shape2_scan, 16, 16, 32, 64);
|
pf16x16_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this), tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape2_scan),this), 16, 16, 32, 64);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pf16x16_tilemap[0] = tilemap_create_device(this, get_pf16x16_tile_info,tile_shape0_scan, 16,16, 64, 16);
|
pf16x16_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape0_scan),this), 16,16, 64, 16);
|
||||||
pf16x16_tilemap[1] = tilemap_create_device(this, get_pf16x16_tile_info,tile_shape1_scan, 16,16, 32, 32);
|
pf16x16_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape1_scan),this), 16,16, 32, 32);
|
||||||
pf16x16_tilemap[2] = tilemap_create_device(this, get_pf16x16_tile_info,tile_shape2_scan, 16,16, 16, 64);
|
pf16x16_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco_bac06_device::get_pf16x16_tile_info),this),tilemap_mapper_delegate(FUNC(deco_bac06_device::tile_shape2_scan),this), 16,16, 16, 64);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,8 +53,14 @@ protected:
|
|||||||
UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition);
|
UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
TILEMAP_MAPPER_MEMBER(tile_shape0_scan);
|
||||||
|
TILEMAP_MAPPER_MEMBER(tile_shape1_scan);
|
||||||
|
TILEMAP_MAPPER_MEMBER(tile_shape2_scan);
|
||||||
|
TILEMAP_MAPPER_MEMBER(tile_shape0_8x8_scan);
|
||||||
|
TILEMAP_MAPPER_MEMBER(tile_shape1_8x8_scan);
|
||||||
|
TILEMAP_MAPPER_MEMBER(tile_shape2_8x8_scan);
|
||||||
|
TILE_GET_INFO_MEMBER(get_pf8x8_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(get_pf16x16_tile_info);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 16-bit accessors */
|
/* 16-bit accessors */
|
||||||
|
@ -213,15 +213,15 @@ INLINE const deco16ic_interface *get_interface( device_t *device )
|
|||||||
|
|
||||||
/*****************************************************************************************/
|
/*****************************************************************************************/
|
||||||
|
|
||||||
static TILEMAP_MAPPER( deco16_scan_rows )
|
TILEMAP_MAPPER_MEMBER(deco16ic_device::deco16_scan_rows)
|
||||||
{
|
{
|
||||||
/* logical (col,row) -> memory offset */
|
/* logical (col,row) -> memory offset */
|
||||||
return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) << 6);
|
return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5) + ((row & 0x20) << 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILE_GET_INFO_DEVICE( get_pf2_tile_info )
|
TILE_GET_INFO_MEMBER(deco16ic_device::get_pf2_tile_info)
|
||||||
{
|
{
|
||||||
deco16ic_state *deco16ic = get_safe_token(device);
|
deco16ic_state *deco16ic = get_safe_token(this);
|
||||||
UINT16 tile = deco16ic->pf2_data[tile_index];
|
UINT16 tile = deco16ic->pf2_data[tile_index];
|
||||||
UINT8 colour = (tile >> 12) & 0xf;
|
UINT8 colour = (tile >> 12) & 0xf;
|
||||||
UINT8 flags = 0;
|
UINT8 flags = 0;
|
||||||
@ -240,16 +240,16 @@ static TILE_GET_INFO_DEVICE( get_pf2_tile_info )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_TILE_INFO_DEVICE(
|
SET_TILE_INFO_MEMBER(
|
||||||
deco16ic->pf12_16x16_gfx_bank,
|
deco16ic->pf12_16x16_gfx_bank,
|
||||||
(tile & 0xfff) | deco16ic->pf2_bank,
|
(tile & 0xfff) | deco16ic->pf2_bank,
|
||||||
(colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank,
|
(colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank,
|
||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILE_GET_INFO_DEVICE( get_pf1_tile_info )
|
TILE_GET_INFO_MEMBER(deco16ic_device::get_pf1_tile_info)
|
||||||
{
|
{
|
||||||
deco16ic_state *deco16ic = get_safe_token(device);
|
deco16ic_state *deco16ic = get_safe_token(this);
|
||||||
UINT16 tile = deco16ic->pf1_data[tile_index];
|
UINT16 tile = deco16ic->pf1_data[tile_index];
|
||||||
UINT8 colour = (tile >> 12) & 0xf;
|
UINT8 colour = (tile >> 12) & 0xf;
|
||||||
UINT8 flags = 0;
|
UINT8 flags = 0;
|
||||||
@ -273,7 +273,7 @@ static TILE_GET_INFO_DEVICE( get_pf1_tile_info )
|
|||||||
// Captain America operates this chip in 8bpp mode.
|
// Captain America operates this chip in 8bpp mode.
|
||||||
// In 8bpp mode you appear to only get 1 layer, not 2, but you also
|
// In 8bpp mode you appear to only get 1 layer, not 2, but you also
|
||||||
// have an extra 2 tile bits, and 2 less colour bits.
|
// have an extra 2 tile bits, and 2 less colour bits.
|
||||||
SET_TILE_INFO_DEVICE(
|
SET_TILE_INFO_MEMBER(
|
||||||
deco16ic->pf12_16x16_gfx_bank,
|
deco16ic->pf12_16x16_gfx_bank,
|
||||||
(tile & 0x3fff) | deco16ic->pf1_bank,
|
(tile & 0x3fff) | deco16ic->pf1_bank,
|
||||||
((colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank)>>2,
|
((colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank)>>2,
|
||||||
@ -281,7 +281,7 @@ static TILE_GET_INFO_DEVICE( get_pf1_tile_info )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SET_TILE_INFO_DEVICE(
|
SET_TILE_INFO_MEMBER(
|
||||||
deco16ic->pf12_16x16_gfx_bank,
|
deco16ic->pf12_16x16_gfx_bank,
|
||||||
(tile & 0xfff) | deco16ic->pf1_bank,
|
(tile & 0xfff) | deco16ic->pf1_bank,
|
||||||
(colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank,
|
(colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank,
|
||||||
@ -289,9 +289,9 @@ static TILE_GET_INFO_DEVICE( get_pf1_tile_info )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILE_GET_INFO_DEVICE( get_pf2_tile_info_b )
|
TILE_GET_INFO_MEMBER(deco16ic_device::get_pf2_tile_info_b)
|
||||||
{
|
{
|
||||||
deco16ic_state *deco16ic = get_safe_token(device);
|
deco16ic_state *deco16ic = get_safe_token(this);
|
||||||
UINT16 tile = deco16ic->pf2_data[tile_index];
|
UINT16 tile = deco16ic->pf2_data[tile_index];
|
||||||
UINT8 colour = (tile >> 12) & 0xf;
|
UINT8 colour = (tile >> 12) & 0xf;
|
||||||
UINT8 flags = 0;
|
UINT8 flags = 0;
|
||||||
@ -310,16 +310,16 @@ static TILE_GET_INFO_DEVICE( get_pf2_tile_info_b )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_TILE_INFO_DEVICE(
|
SET_TILE_INFO_MEMBER(
|
||||||
deco16ic->pf12_8x8_gfx_bank,
|
deco16ic->pf12_8x8_gfx_bank,
|
||||||
(tile & 0xfff) | deco16ic->pf2_bank,
|
(tile & 0xfff) | deco16ic->pf2_bank,
|
||||||
(colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank,
|
(colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank,
|
||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILE_GET_INFO_DEVICE( get_pf1_tile_info_b )
|
TILE_GET_INFO_MEMBER(deco16ic_device::get_pf1_tile_info_b)
|
||||||
{
|
{
|
||||||
deco16ic_state *deco16ic = get_safe_token(device);
|
deco16ic_state *deco16ic = get_safe_token(this);
|
||||||
UINT16 tile = deco16ic->pf1_data[tile_index];
|
UINT16 tile = deco16ic->pf1_data[tile_index];
|
||||||
UINT8 colour = (tile >> 12) & 0xf;
|
UINT8 colour = (tile >> 12) & 0xf;
|
||||||
UINT8 flags = 0;
|
UINT8 flags = 0;
|
||||||
@ -338,7 +338,7 @@ static TILE_GET_INFO_DEVICE( get_pf1_tile_info_b )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_TILE_INFO_DEVICE(
|
SET_TILE_INFO_MEMBER(
|
||||||
deco16ic->pf12_8x8_gfx_bank,
|
deco16ic->pf12_8x8_gfx_bank,
|
||||||
(tile & 0xfff) | deco16ic->pf1_bank,
|
(tile & 0xfff) | deco16ic->pf1_bank,
|
||||||
(colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank,
|
(colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank,
|
||||||
@ -899,95 +899,6 @@ void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_rgb32 &bitmap, co
|
|||||||
custom_tilemap_draw(device, bitmap, cliprect, 0, deco16ic->pf1_tilemap_16x16, 0, deco16ic->pf2_tilemap_16x16, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo);
|
custom_tilemap_draw(device, bitmap, cliprect, 0, deco16ic->pf1_tilemap_16x16, 0, deco16ic->pf2_tilemap_16x16, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
DEVICE INTERFACE
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
static DEVICE_START( deco16ic )
|
|
||||||
{
|
|
||||||
deco16ic_state *deco16ic = get_safe_token(device);
|
|
||||||
const deco16ic_interface *intf = get_interface(device);
|
|
||||||
|
|
||||||
deco16ic->bank_cb[0] = intf->bank_cb0;
|
|
||||||
deco16ic->bank_cb[1] = intf->bank_cb1;
|
|
||||||
|
|
||||||
deco16ic->pf1_trans_mask = intf->trans_mask1;
|
|
||||||
deco16ic->pf2_trans_mask = intf->trans_mask2;
|
|
||||||
|
|
||||||
deco16ic->pf1_colour_bank = intf->col_base1;
|
|
||||||
deco16ic->pf2_colour_bank = intf->col_base2;
|
|
||||||
|
|
||||||
deco16ic->pf1_colourmask = intf->col_mask1;
|
|
||||||
deco16ic->pf2_colourmask = intf->col_mask2;
|
|
||||||
|
|
||||||
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, fullwidth ? 64 : 32, fullheight ? 64 : 32);
|
|
||||||
else
|
|
||||||
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);
|
|
||||||
|
|
||||||
deco16ic->pf1_tilemap_8x8->set_transparent_pen(0);
|
|
||||||
deco16ic->pf2_tilemap_8x8->set_transparent_pen(0);
|
|
||||||
deco16ic->pf1_tilemap_16x16->set_transparent_pen(0);
|
|
||||||
deco16ic->pf2_tilemap_16x16->set_transparent_pen(0);
|
|
||||||
|
|
||||||
if (intf->split) /* Caveman Ninja only */
|
|
||||||
deco16ic->pf2_tilemap_16x16->set_transmask(0, 0x00ff, 0xff01);
|
|
||||||
|
|
||||||
deco16ic->pf1_8bpp_mode = 0;
|
|
||||||
|
|
||||||
deco16ic->pf1_data = auto_alloc_array_clear(device->machine(), UINT16, 0x2000 / 2);
|
|
||||||
deco16ic->pf2_data = auto_alloc_array_clear(device->machine(), UINT16, 0x2000 / 2);
|
|
||||||
deco16ic->pf12_control = auto_alloc_array_clear(device->machine(), UINT16, 0x10 / 2);
|
|
||||||
|
|
||||||
|
|
||||||
device->save_item(NAME(deco16ic->use_custom_pf1));
|
|
||||||
device->save_item(NAME(deco16ic->use_custom_pf2));
|
|
||||||
device->save_item(NAME(deco16ic->pf1_bank));
|
|
||||||
device->save_item(NAME(deco16ic->pf2_bank));
|
|
||||||
device->save_item(NAME(deco16ic->pf12_8x8_gfx_bank));
|
|
||||||
device->save_item(NAME(deco16ic->pf12_16x16_gfx_bank));
|
|
||||||
device->save_item(NAME(deco16ic->pf12_last_small));
|
|
||||||
device->save_item(NAME(deco16ic->pf12_last_big));
|
|
||||||
|
|
||||||
device->save_item(NAME(deco16ic->pf1_8bpp_mode));
|
|
||||||
|
|
||||||
device->save_pointer(NAME(deco16ic->pf1_data), 0x2000 / 2);
|
|
||||||
device->save_pointer(NAME(deco16ic->pf2_data), 0x2000 / 2);
|
|
||||||
device->save_pointer(NAME(deco16ic->pf12_control), 0x10 / 2);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static DEVICE_RESET( deco16ic )
|
|
||||||
{
|
|
||||||
deco16ic_state *deco16ic = get_safe_token(device);
|
|
||||||
|
|
||||||
deco16ic->pf1_bank = deco16ic->pf2_bank = 0;
|
|
||||||
deco16ic->pf12_last_small = deco16ic->pf12_last_big = -1;
|
|
||||||
deco16ic->use_custom_pf1 = deco16ic->use_custom_pf2 = 0;
|
|
||||||
deco16ic->pf1_rowscroll_ptr = 0;
|
|
||||||
deco16ic->pf2_rowscroll_ptr = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const device_type DECO16IC = &device_creator<deco16ic_device>;
|
const device_type DECO16IC = &device_creator<deco16ic_device>;
|
||||||
|
|
||||||
deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||||
@ -1012,7 +923,73 @@ void deco16ic_device::device_config_complete()
|
|||||||
|
|
||||||
void deco16ic_device::device_start()
|
void deco16ic_device::device_start()
|
||||||
{
|
{
|
||||||
DEVICE_START_NAME( deco16ic )(this);
|
deco16ic_state *deco16ic = get_safe_token(this);
|
||||||
|
const deco16ic_interface *intf = get_interface(this);
|
||||||
|
|
||||||
|
deco16ic->bank_cb[0] = intf->bank_cb0;
|
||||||
|
deco16ic->bank_cb[1] = intf->bank_cb1;
|
||||||
|
|
||||||
|
deco16ic->pf1_trans_mask = intf->trans_mask1;
|
||||||
|
deco16ic->pf2_trans_mask = intf->trans_mask2;
|
||||||
|
|
||||||
|
deco16ic->pf1_colour_bank = intf->col_base1;
|
||||||
|
deco16ic->pf2_colour_bank = intf->col_base2;
|
||||||
|
|
||||||
|
deco16ic->pf1_colourmask = intf->col_mask1;
|
||||||
|
deco16ic->pf2_colourmask = intf->col_mask2;
|
||||||
|
|
||||||
|
int fullheight = 0;
|
||||||
|
int fullwidth = 0;
|
||||||
|
|
||||||
|
if (intf->full_width12&2)
|
||||||
|
fullheight = 1;
|
||||||
|
|
||||||
|
if (intf->full_width12&1)
|
||||||
|
fullwidth = 1;
|
||||||
|
|
||||||
|
deco16ic->pf1_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ?64 : 32);
|
||||||
|
// deco16ic->pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, intf->full_width12 ? 64 : 32, 32);
|
||||||
|
deco16ic->pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), 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 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
|
||||||
|
else
|
||||||
|
deco16ic->pf2_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32);
|
||||||
|
|
||||||
|
deco16ic->pf2_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, fullwidth ? 64 : 32, fullheight ? 64 : 32);
|
||||||
|
|
||||||
|
deco16ic->pf1_tilemap_8x8->set_transparent_pen(0);
|
||||||
|
deco16ic->pf2_tilemap_8x8->set_transparent_pen(0);
|
||||||
|
deco16ic->pf1_tilemap_16x16->set_transparent_pen(0);
|
||||||
|
deco16ic->pf2_tilemap_16x16->set_transparent_pen(0);
|
||||||
|
|
||||||
|
if (intf->split) /* Caveman Ninja only */
|
||||||
|
deco16ic->pf2_tilemap_16x16->set_transmask(0, 0x00ff, 0xff01);
|
||||||
|
|
||||||
|
deco16ic->pf1_8bpp_mode = 0;
|
||||||
|
|
||||||
|
deco16ic->pf1_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2);
|
||||||
|
deco16ic->pf2_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2);
|
||||||
|
deco16ic->pf12_control = auto_alloc_array_clear(machine(), UINT16, 0x10 / 2);
|
||||||
|
|
||||||
|
|
||||||
|
save_item(NAME(deco16ic->use_custom_pf1));
|
||||||
|
save_item(NAME(deco16ic->use_custom_pf2));
|
||||||
|
save_item(NAME(deco16ic->pf1_bank));
|
||||||
|
save_item(NAME(deco16ic->pf2_bank));
|
||||||
|
save_item(NAME(deco16ic->pf12_8x8_gfx_bank));
|
||||||
|
save_item(NAME(deco16ic->pf12_16x16_gfx_bank));
|
||||||
|
save_item(NAME(deco16ic->pf12_last_small));
|
||||||
|
save_item(NAME(deco16ic->pf12_last_big));
|
||||||
|
|
||||||
|
save_item(NAME(deco16ic->pf1_8bpp_mode));
|
||||||
|
|
||||||
|
save_pointer(NAME(deco16ic->pf1_data), 0x2000 / 2);
|
||||||
|
save_pointer(NAME(deco16ic->pf2_data), 0x2000 / 2);
|
||||||
|
save_pointer(NAME(deco16ic->pf12_control), 0x10 / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -1021,7 +998,13 @@ void deco16ic_device::device_start()
|
|||||||
|
|
||||||
void deco16ic_device::device_reset()
|
void deco16ic_device::device_reset()
|
||||||
{
|
{
|
||||||
DEVICE_RESET_NAME( deco16ic )(this);
|
deco16ic_state *deco16ic = get_safe_token(this);
|
||||||
|
|
||||||
|
deco16ic->pf1_bank = deco16ic->pf2_bank = 0;
|
||||||
|
deco16ic->pf12_last_small = deco16ic->pf12_last_big = -1;
|
||||||
|
deco16ic->use_custom_pf1 = deco16ic->use_custom_pf2 = 0;
|
||||||
|
deco16ic->pf1_rowscroll_ptr = 0;
|
||||||
|
deco16ic->pf2_rowscroll_ptr = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
~deco16ic_device() { global_free(m_token); }
|
~deco16ic_device() { global_free(m_token); }
|
||||||
|
|
||||||
// access to legacy token
|
// access to legacy token
|
||||||
void *token() const { assert(m_token != NULL); return m_token; }
|
void *token() const { assert(m_token != NULL); return m_token; }
|
||||||
protected:
|
protected:
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_config_complete();
|
virtual void device_config_complete();
|
||||||
@ -51,6 +51,12 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILEMAP_MAPPER_MEMBER(deco16_scan_rows);
|
||||||
|
TILE_GET_INFO_MEMBER(get_pf2_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(get_pf1_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(get_pf2_tile_info_b);
|
||||||
|
TILE_GET_INFO_MEMBER(get_pf1_tile_info_b);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type DECO16IC;
|
extern const device_type DECO16IC;
|
||||||
|
@ -233,77 +233,66 @@ const address_space_config *gp9001vdp_device::memory_space_config(address_spacen
|
|||||||
return (spacenum == 0) ? &m_space_config : NULL;
|
return (spacenum == 0) ? &m_space_config : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(gp9001vdp_device::get_top0_tile_info)
|
||||||
|
|
||||||
|
|
||||||
static TILE_GET_INFO_DEVICE( get_top0_tile_info )
|
|
||||||
{
|
{
|
||||||
int color, tile_number, attrib;
|
int color, tile_number, attrib;
|
||||||
|
|
||||||
gp9001vdp_device *vdp = (gp9001vdp_device*)device;
|
attrib = top.vram16[2*tile_index];
|
||||||
|
|
||||||
attrib = vdp->top.vram16[2*tile_index];
|
tile_number = top.vram16[2*tile_index+1];
|
||||||
|
|
||||||
tile_number = vdp->top.vram16[2*tile_index+1];
|
if (gp9001_gfxrom_is_banked)
|
||||||
|
|
||||||
if (vdp->gp9001_gfxrom_is_banked)
|
|
||||||
{
|
{
|
||||||
tile_number = ( vdp->gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
|
tile_number = ( gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
|
||||||
}
|
}
|
||||||
|
|
||||||
color = attrib & 0x0fff; // 0x0f00 priority, 0x007f colour
|
color = attrib & 0x0fff; // 0x0f00 priority, 0x007f colour
|
||||||
SET_TILE_INFO_DEVICE(
|
SET_TILE_INFO_MEMBER(
|
||||||
vdp->tile_region,
|
tile_region,
|
||||||
tile_number,
|
tile_number,
|
||||||
color,
|
color,
|
||||||
0);
|
0);
|
||||||
//tileinfo.category = (attrib & 0x0f00) >> 8;
|
//tileinfo.category = (attrib & 0x0f00) >> 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(gp9001vdp_device::get_fg0_tile_info)
|
||||||
|
|
||||||
static TILE_GET_INFO_DEVICE( get_fg0_tile_info )
|
|
||||||
{
|
{
|
||||||
int color, tile_number, attrib;
|
int color, tile_number, attrib;
|
||||||
|
|
||||||
gp9001vdp_device *vdp = (gp9001vdp_device*)device;
|
attrib = fg.vram16[2*tile_index];
|
||||||
|
|
||||||
attrib = vdp->fg.vram16[2*tile_index];
|
tile_number = fg.vram16[2*tile_index+1];
|
||||||
|
|
||||||
tile_number = vdp->fg.vram16[2*tile_index+1];
|
|
||||||
|
|
||||||
|
|
||||||
if (vdp->gp9001_gfxrom_is_banked)
|
if (gp9001_gfxrom_is_banked)
|
||||||
{
|
{
|
||||||
tile_number = ( vdp->gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
|
tile_number = ( gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
|
||||||
}
|
}
|
||||||
|
|
||||||
color = attrib & 0x0fff; // 0x0f00 priority, 0x007f colour
|
color = attrib & 0x0fff; // 0x0f00 priority, 0x007f colour
|
||||||
SET_TILE_INFO_DEVICE(
|
SET_TILE_INFO_MEMBER(
|
||||||
vdp->tile_region,
|
tile_region,
|
||||||
tile_number,
|
tile_number,
|
||||||
color,
|
color,
|
||||||
0);
|
0);
|
||||||
//tileinfo.category = (attrib & 0x0f00) >> 8;
|
//tileinfo.category = (attrib & 0x0f00) >> 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILE_GET_INFO_DEVICE( get_bg0_tile_info )
|
TILE_GET_INFO_MEMBER(gp9001vdp_device::get_bg0_tile_info)
|
||||||
{
|
{
|
||||||
int color, tile_number, attrib;
|
int color, tile_number, attrib;
|
||||||
gp9001vdp_device *vdp = (gp9001vdp_device*)device;
|
attrib = bg.vram16[2*tile_index];
|
||||||
|
|
||||||
attrib = vdp->bg.vram16[2*tile_index];
|
tile_number = bg.vram16[2*tile_index+1];
|
||||||
|
|
||||||
tile_number = vdp->bg.vram16[2*tile_index+1];
|
if (gp9001_gfxrom_is_banked)
|
||||||
|
|
||||||
if (vdp->gp9001_gfxrom_is_banked)
|
|
||||||
{
|
{
|
||||||
tile_number = ( vdp->gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
|
tile_number = ( gp9001_gfxrom_bank[(tile_number >> 13) & 7] << 13 ) | ( tile_number & 0x1fff );
|
||||||
}
|
}
|
||||||
|
|
||||||
color = attrib & 0x0fff; // 0x0f00 priority, 0x007f colour
|
color = attrib & 0x0fff; // 0x0f00 priority, 0x007f colour
|
||||||
SET_TILE_INFO_DEVICE(
|
SET_TILE_INFO_MEMBER(
|
||||||
vdp->tile_region,
|
tile_region,
|
||||||
tile_number,
|
tile_number,
|
||||||
color,
|
color,
|
||||||
0);
|
0);
|
||||||
@ -314,9 +303,9 @@ void gp9001vdp_device::create_tilemaps(int region)
|
|||||||
{
|
{
|
||||||
tile_region = region;
|
tile_region = region;
|
||||||
|
|
||||||
top.tmap = tilemap_create_device(this, get_top0_tile_info,TILEMAP_SCAN_ROWS,16,16,32,32);
|
top.tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gp9001vdp_device::get_top0_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
|
||||||
fg.tmap = tilemap_create_device(this, get_fg0_tile_info,TILEMAP_SCAN_ROWS,16,16,32,32);
|
fg.tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gp9001vdp_device::get_fg0_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
|
||||||
bg.tmap = tilemap_create_device(this, get_bg0_tile_info,TILEMAP_SCAN_ROWS,16,16,32,32);
|
bg.tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(gp9001vdp_device::get_bg0_tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32);
|
||||||
|
|
||||||
top.tmap->set_transparent_pen(0);
|
top.tmap->set_transparent_pen(0);
|
||||||
fg.tmap->set_transparent_pen(0);
|
fg.tmap->set_transparent_pen(0);
|
||||||
|
@ -72,6 +72,10 @@ protected:
|
|||||||
|
|
||||||
address_space_config m_space_config;
|
address_space_config m_space_config;
|
||||||
UINT8 m_gfxregion;
|
UINT8 m_gfxregion;
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(get_top0_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(get_fg0_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(get_bg0_tile_info);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type GP9001_VDP;
|
extern const device_type GP9001_VDP;
|
||||||
|
@ -122,16 +122,16 @@ void kaneko_view2_tilemap_device::set_invert_flip(device_t &device, int invert_f
|
|||||||
dev.m_invert_flip = invert_flip;
|
dev.m_invert_flip = invert_flip;
|
||||||
}
|
}
|
||||||
|
|
||||||
void kaneko_view2_tilemap_device::get_tile_info(kaneko_view2_tilemap_device *device, tile_data &tileinfo, tilemap_memory_index tile_index, int _N_)
|
void kaneko_view2_tilemap_device::get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_)
|
||||||
{
|
{
|
||||||
UINT16 code_hi = m_vram[_N_][ 2 * tile_index + 0];
|
UINT16 code_hi = m_vram[_N_][ 2 * tile_index + 0];
|
||||||
UINT16 code_lo = m_vram[_N_][ 2 * tile_index + 1];
|
UINT16 code_lo = m_vram[_N_][ 2 * tile_index + 1];
|
||||||
SET_TILE_INFO_DEVICE(m_tilebase, code_lo + m_vram_tile_addition[_N_], (code_hi >> 2) & 0x3f, TILE_FLIPXY( code_hi & 3 ));
|
SET_TILE_INFO_MEMBER(m_tilebase, code_lo + m_vram_tile_addition[_N_], (code_hi >> 2) & 0x3f, TILE_FLIPXY( code_hi & 3 ));
|
||||||
tileinfo.category = (code_hi >> 8) & 7;
|
tileinfo.category = (code_hi >> 8) & 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
static TILE_GET_INFO_DEVICE( get_tile_info_0 ) { kaneko_view2_tilemap_device *dev = (kaneko_view2_tilemap_device*)device; dev->get_tile_info(dev, tileinfo, tile_index, 0); }
|
TILE_GET_INFO_MEMBER(kaneko_view2_tilemap_device::get_tile_info_0) { get_tile_info(tileinfo, tile_index, 0); }
|
||||||
static TILE_GET_INFO_DEVICE( get_tile_info_1 ) { kaneko_view2_tilemap_device *dev = (kaneko_view2_tilemap_device*)device; dev->get_tile_info(dev, tileinfo, tile_index, 1); }
|
TILE_GET_INFO_MEMBER(kaneko_view2_tilemap_device::get_tile_info_1) { get_tile_info(tileinfo, tile_index, 1); }
|
||||||
|
|
||||||
|
|
||||||
void kaneko_view2_tilemap_device::device_start()
|
void kaneko_view2_tilemap_device::device_start()
|
||||||
@ -142,9 +142,9 @@ void kaneko_view2_tilemap_device::device_start()
|
|||||||
m_vscroll[1] = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x1000/2);
|
m_vscroll[1] = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x1000/2);
|
||||||
m_regs = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x20/2);
|
m_regs = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x20/2);
|
||||||
|
|
||||||
m_tmap[0] = tilemap_create_device( this, get_tile_info_0, TILEMAP_SCAN_ROWS,
|
m_tmap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kaneko_view2_tilemap_device::get_tile_info_0),this), TILEMAP_SCAN_ROWS,
|
||||||
16,16, 0x20,0x20 );
|
16,16, 0x20,0x20 );
|
||||||
m_tmap[1] = tilemap_create_device( this, get_tile_info_1, TILEMAP_SCAN_ROWS,
|
m_tmap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(kaneko_view2_tilemap_device::get_tile_info_1),this), TILEMAP_SCAN_ROWS,
|
||||||
16,16, 0x20,0x20 );
|
16,16, 0x20,0x20 );
|
||||||
|
|
||||||
m_tmap[0]->set_transparent_pen(0);
|
m_tmap[0]->set_transparent_pen(0);
|
||||||
|
@ -21,7 +21,7 @@ public:
|
|||||||
tilemap_t* m_tmap[2];
|
tilemap_t* m_tmap[2];
|
||||||
UINT16 m_vram_tile_addition[2]; // galsnew
|
UINT16 m_vram_tile_addition[2]; // galsnew
|
||||||
|
|
||||||
void get_tile_info(kaneko_view2_tilemap_device *device, tile_data &tileinfo, tilemap_memory_index tile_index, int _N_);
|
void get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_);
|
||||||
void kaneko16_vram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _N_);
|
void kaneko16_vram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _N_);
|
||||||
|
|
||||||
// call to do the rendering etc.
|
// call to do the rendering etc.
|
||||||
@ -58,8 +58,8 @@ protected:
|
|||||||
virtual void device_reset();
|
virtual void device_reset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
TILE_GET_INFO_MEMBER(get_tile_info_0);
|
||||||
|
TILE_GET_INFO_MEMBER(get_tile_info_1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -194,6 +194,10 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILEMAP_MAPPER_MEMBER(k007342_scan);
|
||||||
|
TILE_GET_INFO_MEMBER(k007342_get_tile_info0);
|
||||||
|
TILE_GET_INFO_MEMBER(k007342_get_tile_info1);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type K007342;
|
extern const device_type K007342;
|
||||||
@ -234,6 +238,10 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(k052109_get_tile_info0);
|
||||||
|
TILE_GET_INFO_MEMBER(k052109_get_tile_info1);
|
||||||
|
TILE_GET_INFO_MEMBER(k052109_get_tile_info2);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type K052109;
|
extern const device_type K052109;
|
||||||
@ -336,6 +344,8 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(k051316_get_tile_info0);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type K051316;
|
extern const device_type K051316;
|
||||||
@ -435,6 +445,23 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_info0);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_info1);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_info2);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_info3);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_info4);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_info5);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_info6);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_info7);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_info8);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_info9);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_infoa);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_infob);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_infoc);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_infod);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_infoe);
|
||||||
|
TILE_GET_INFO_MEMBER(k056832_get_tile_infof);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type K056832;
|
extern const device_type K056832;
|
||||||
@ -536,6 +563,19 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILEMAP_MAPPER_MEMBER(k001604_scan_layer_8x8_0_size0);
|
||||||
|
TILEMAP_MAPPER_MEMBER(k001604_scan_layer_8x8_0_size1);
|
||||||
|
TILEMAP_MAPPER_MEMBER(k001604_scan_layer_8x8_1_size0);
|
||||||
|
TILEMAP_MAPPER_MEMBER(k001604_scan_layer_8x8_1_size1);
|
||||||
|
TILEMAP_MAPPER_MEMBER(slrasslt_scan_layer_8x8_0_size0);
|
||||||
|
TILEMAP_MAPPER_MEMBER(slrasslt_scan_layer_8x8_1_size0);
|
||||||
|
TILEMAP_MAPPER_MEMBER(k001604_scan_layer_roz_0_size0);
|
||||||
|
TILEMAP_MAPPER_MEMBER(k001604_scan_layer_roz_0_size1);
|
||||||
|
TILEMAP_MAPPER_MEMBER(k001604_scan_layer_roz_1_size0);
|
||||||
|
TILEMAP_MAPPER_MEMBER(k001604_scan_layer_roz_1_size1);
|
||||||
|
TILE_GET_INFO_MEMBER(k001604_tile_info_layer_8x8);
|
||||||
|
TILE_GET_INFO_MEMBER(k001604_tile_info_layer_roz);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type K001604;
|
extern const device_type K001604;
|
||||||
@ -556,6 +596,9 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(k037122_tile_info_layer0);
|
||||||
|
TILE_GET_INFO_MEMBER(k037122_tile_info_layer1);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type K037122;
|
extern const device_type K037122;
|
||||||
|
@ -51,24 +51,24 @@ void segas24_tile::tile_info(int offset, tile_data &tileinfo, tilemap_memory_ind
|
|||||||
tileinfo.set(machine(), char_gfx_index, val & tile_mask, (val >> 7) & 0xff, 0);
|
tileinfo.set(machine(), char_gfx_index, val & tile_mask, (val >> 7) & 0xff, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
TILE_GET_INFO_DEVICE( segas24_tile::tile_info_0s )
|
TILE_GET_INFO_MEMBER(segas24_tile::tile_info_0s)
|
||||||
{
|
{
|
||||||
downcast<segas24_tile *>(device)->tile_info(0x0000, tileinfo, tile_index);
|
tile_info(0x0000, tileinfo, tile_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
TILE_GET_INFO_DEVICE( segas24_tile::tile_info_0w )
|
TILE_GET_INFO_MEMBER( segas24_tile::tile_info_0w)
|
||||||
{
|
{
|
||||||
downcast<segas24_tile *>(device)->tile_info(0x1000, tileinfo, tile_index);
|
tile_info(0x1000, tileinfo, tile_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
TILE_GET_INFO_DEVICE( segas24_tile::tile_info_1s )
|
TILE_GET_INFO_MEMBER(segas24_tile::tile_info_1s)
|
||||||
{
|
{
|
||||||
downcast<segas24_tile *>(device)->tile_info(0x2000, tileinfo, tile_index);
|
tile_info(0x2000, tileinfo, tile_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
TILE_GET_INFO_DEVICE( segas24_tile::tile_info_1w )
|
TILE_GET_INFO_MEMBER(segas24_tile::tile_info_1w)
|
||||||
{
|
{
|
||||||
downcast<segas24_tile *>(device)->tile_info(0x3000, tileinfo, tile_index);
|
tile_info(0x3000, tileinfo, tile_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void segas24_tile::device_start()
|
void segas24_tile::device_start()
|
||||||
@ -81,10 +81,10 @@ void segas24_tile::device_start()
|
|||||||
char_ram = auto_alloc_array(machine(), UINT16, 0x80000/2);
|
char_ram = auto_alloc_array(machine(), UINT16, 0x80000/2);
|
||||||
tile_ram = auto_alloc_array(machine(), UINT16, 0x10000/2);
|
tile_ram = auto_alloc_array(machine(), UINT16, 0x10000/2);
|
||||||
|
|
||||||
tile_layer[0] = tilemap_create_device(this, tile_info_0s, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
tile_layer[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_0s),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||||
tile_layer[1] = tilemap_create_device(this, tile_info_0w, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
tile_layer[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_0w),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||||
tile_layer[2] = tilemap_create_device(this, tile_info_1s, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
tile_layer[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_1s),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||||
tile_layer[3] = tilemap_create_device(this, tile_info_1w, TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
tile_layer[3] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas24_tile::tile_info_1w),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
|
||||||
|
|
||||||
tile_layer[0]->set_transparent_pen(0);
|
tile_layer[0]->set_transparent_pen(0);
|
||||||
tile_layer[1]->set_transparent_pen(0);
|
tile_layer[1]->set_transparent_pen(0);
|
||||||
|
@ -49,10 +49,10 @@ private:
|
|||||||
static const gfx_layout char_layout;
|
static const gfx_layout char_layout;
|
||||||
|
|
||||||
void tile_info(int offset, tile_data &tileinfo, tilemap_memory_index tile_index);
|
void tile_info(int offset, tile_data &tileinfo, tilemap_memory_index tile_index);
|
||||||
static TILE_GET_INFO_DEVICE(tile_info_0s);
|
TILE_GET_INFO_MEMBER(tile_info_0s);
|
||||||
static TILE_GET_INFO_DEVICE(tile_info_0w);
|
TILE_GET_INFO_MEMBER(tile_info_0w);
|
||||||
static TILE_GET_INFO_DEVICE(tile_info_1s);
|
TILE_GET_INFO_MEMBER(tile_info_1s);
|
||||||
static TILE_GET_INFO_DEVICE(tile_info_1w);
|
TILE_GET_INFO_MEMBER(tile_info_1w);
|
||||||
|
|
||||||
void draw_rect(bitmap_ind16 &bm, bitmap_ind8 &tm, bitmap_ind16 &dm, const UINT16 *mask,
|
void draw_rect(bitmap_ind16 &bm, bitmap_ind8 &tm, bitmap_ind16 &dm, const UINT16 *mask,
|
||||||
UINT16 tpri, UINT8 lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2);
|
UINT16 tpri, UINT8 lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -121,6 +121,9 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(pc080sn_get_bg_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(pc080sn_get_fg_tile_info);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type PC080SN;
|
extern const device_type PC080SN;
|
||||||
@ -160,6 +163,10 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(tc0080vco_get_bg0_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(tc0080vco_get_bg1_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(tc0080vco_get_tx_tile_info);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type TC0080VCO;
|
extern const device_type TC0080VCO;
|
||||||
@ -180,6 +187,10 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(tc0100scn_get_bg_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(tc0100scn_get_fg_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(tc0100scn_get_tx_tile_info);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type TC0100SCN;
|
extern const device_type TC0100SCN;
|
||||||
@ -200,6 +211,8 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(tc0280grd_get_tile_info);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type TC0280GRD;
|
extern const device_type TC0280GRD;
|
||||||
@ -241,6 +254,12 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(tc0480scp_get_bg0_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(tc0480scp_get_bg1_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(tc0480scp_get_bg2_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(tc0480scp_get_bg3_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(tc0480scp_get_tx_tile_info);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type TC0480SCP;
|
extern const device_type TC0480SCP;
|
||||||
@ -300,6 +319,10 @@ protected:
|
|||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
void *m_token;
|
||||||
|
|
||||||
|
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(get_fg_tile_info);
|
||||||
|
TILE_GET_INFO_MEMBER(get_tx_tile_info);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type TC0180VCU;
|
extern const device_type TC0180VCU;
|
||||||
|
Loading…
Reference in New Issue
Block a user