Merge pull request #5158 from cam900/generic_packedgfx

emu/video/generic.cpp : Add packed, raw case of generic gfx layouts, …
This commit is contained in:
R. Belmont 2019-06-05 09:31:39 -04:00 committed by GitHub
commit fa23544748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 69 additions and 93 deletions

View File

@ -92,3 +92,51 @@ const gfx_layout gfx_16x16x4_planar =
{ STEP16(0,16) },
16*16
};
const gfx_layout gfx_8x8x4_packed_msb =
{
8,8,
RGN_FRAC(1,1),
4,
{ STEP4(0,1) },
{ STEP8(0,4) }, // x order : hi nibble first, low nibble second
{ STEP8(0,4*8) },
8*8*4
};
const gfx_layout gfx_8x8x4_packed_lsb =
{
8,8,
RGN_FRAC(1,1),
4,
{ STEP4(0,1) },
{ 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4 }, // x order : low nibble first, hi nibble second
{ STEP8(0,4*8) },
8*8*4
};
GFXLAYOUT_RAW(gfx_8x8x8_raw, 8, 8, 8*8, 8*8*8);
const gfx_layout gfx_16x16x4_packed_msb =
{
16,16,
RGN_FRAC(1,1),
4,
{ STEP4(0,1) },
{ STEP16(0,4) }, // x order : hi nibble first, low nibble second
{ STEP16(0,4*16) },
16*16*4
};
const gfx_layout gfx_16x16x4_packed_lsb =
{
16,16,
RGN_FRAC(1,1),
4,
{ STEP4(0,1) },
{ 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4, 9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 }, // x order : low nibble first, hi nibble second
{ STEP16(0,4*16) },
16*16*4
};
GFXLAYOUT_RAW(gfx_16x16x8_raw, 16, 16, 16*8, 16*16*8);

View File

@ -28,4 +28,12 @@ extern const gfx_layout gfx_8x8x6_planar;
extern const gfx_layout gfx_16x16x4_planar;
extern const gfx_layout gfx_8x8x4_packed_msb;
extern const gfx_layout gfx_8x8x4_packed_lsb;
extern const gfx_layout gfx_8x8x8_raw;
extern const gfx_layout gfx_16x16x4_packed_msb;
extern const gfx_layout gfx_16x16x4_packed_lsb;
extern const gfx_layout gfx_16x16x8_raw;
#endif /* MAME_EMU_VIDEO_GENERIC_H */

View File

@ -316,51 +316,17 @@ INPUT_PORTS_END
static const gfx_layout charlayout =
{
8,8,
RGN_FRAC(1,1),
8,
{ STEP8(0,1) },
{ STEP8(0,8) },
{ STEP8(0,8*8) },
8*8*8
};
static const gfx_layout tilelayout =
{
16,16,
RGN_FRAC(1,1),
4,
{ STEP4(0,1) },
{ STEP16(0,4) },
{ STEP16(0,4*16) },
16*16*4
};
static const gfx_layout spritelayout =
{
16,16,
RGN_FRAC(1,1),
4,
{ STEP4(0,1) },
{ 1*4, 0*4, 3*4, 2*4, 5*4, 4*4, 7*4, 6*4,
9*4, 8*4, 11*4, 10*4, 13*4, 12*4, 15*4, 14*4 },
{ STEP16(0,4*16) },
16*16*4
};
static GFXDECODE_START( gfx_f1gp )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x000, 1 )
GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x100, 16 )
GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x200, 16 )
GFXDECODE_RAM( "rozgfxram", 0, tilelayout, 0x300, 16 )
GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x8_raw, 0x000, 1 )
GFXDECODE_ENTRY( "gfx2", 0, gfx_16x16x4_packed_lsb, 0x100, 16 )
GFXDECODE_ENTRY( "gfx3", 0, gfx_16x16x4_packed_lsb, 0x200, 16 )
GFXDECODE_RAM( "rozgfxram", 0, gfx_16x16x4_packed_msb, 0x300, 16 )
GFXDECODE_END
static GFXDECODE_START( gfx_f1gp2 )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x000, 1 )
GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x200, 32 )
GFXDECODE_ENTRY( "gfx3", 0, tilelayout, 0x100, 16 )
GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x8_raw, 0x000, 1 )
GFXDECODE_ENTRY( "gfx2", 0, gfx_16x16x4_packed_lsb, 0x200, 32 )
GFXDECODE_ENTRY( "gfx3", 0, gfx_16x16x4_packed_msb, 0x100, 16 )
GFXDECODE_END

View File

@ -729,17 +729,6 @@ void pgm2_state::machine_reset()
module_clk_cnt = 151; // this needed because of "false" clock pulse happen during gpio init
}
static const gfx_layout tiles8x8_layout =
{
8,8,
RGN_FRAC(1,1),
4,
{ STEP4(0,1) },
{ 4, 0, 12, 8, 20, 16, 28, 24 },
{ STEP8(0,4*8) },
32*8
};
static const gfx_layout tiles32x32x8_layout =
{
32,32,
@ -752,7 +741,7 @@ static const gfx_layout tiles32x32x8_layout =
};
static GFXDECODE_START( pgm2_tx )
GFXDECODE_ENTRY( "tiles", 0, tiles8x8_layout, 0, 0x800/4/0x10 )
GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x4_packed_lsb, 0, 0x800/4/0x10 )
GFXDECODE_END
static GFXDECODE_START( pgm2_bg )

View File

@ -243,19 +243,6 @@ INPUT_PORTS_END
***************************************************************************/
/* 8x8x4 tiles */
static const gfx_layout layout_8x8x4 =
{
8,8,
RGN_FRAC(1,1),
4,
{STEP4(0,1)},
{STEP8(0,4)},
{STEP8(0,4*8)},
8*8*4
};
/* 16x16x4 tiles (made of two 8x16 tiles) */
static const gfx_layout layout_16x16x4 =
{
@ -270,9 +257,9 @@ static const gfx_layout layout_16x16x4 =
static GFXDECODE_START( gfx_powerins )
GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x4, 0x000, 0x20 ) // [0] Tiles
GFXDECODE_ENTRY( "gfx2", 0, layout_8x8x4, 0x200, 0x10 ) // [1] Tiles
GFXDECODE_ENTRY( "gfx3", 0, layout_16x16x4, 0x400, 0x40 ) // [2] Sprites
GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x4, 0x000, 0x20 ) // [0] Tiles
GFXDECODE_ENTRY( "gfx2", 0, gfx_8x8x4_packed_msb, 0x200, 0x10 ) // [1] Tiles
GFXDECODE_ENTRY( "gfx3", 0, layout_16x16x4, 0x400, 0x40 ) // [2] Sprites
GFXDECODE_END

View File

@ -283,31 +283,9 @@ Notes:
#include "speaker.h"
static const gfx_layout layout_16x16x4 =
{
16,16,
RGN_FRAC(1,1),
4,
{STEP4(0,1)},
{STEP16(0,4)},
{STEP16(0,16*4)},
16*16*4
};
static const gfx_layout layout_16x16x8 =
{
16,16,
RGN_FRAC(1,1),
8,
{STEP8(0,1)},
{STEP16(0,8)},
{STEP16(0,16*8)},
16*16*8
};
static GFXDECODE_START( gfx_psikyosh )
GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x4, 0x000, 0x100 ) // 4bpp tiles
GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0x000, 0x100 ) // 8bpp tiles
GFXDECODE_ENTRY( "gfx1", 0, gfx_16x16x4_packed_msb, 0x000, 0x100 ) // 4bpp tiles
GFXDECODE_ENTRY( "gfx1", 0, gfx_16x16x8_raw, 0x000, 0x100 ) // 8bpp tiles
GFXDECODE_END
void psikyosh_state::eeprom_w(u8 data)