mirror of
https://github.com/holub/mame
synced 2025-10-06 09:00:04 +03:00
Added base sprites. Also added STEP2_INV / STEP4_INV, nw
This commit is contained in:
parent
0199433d44
commit
732eef6e0e
@ -71,7 +71,8 @@ const gfx_layout name = { width, height, RGN_FRAC(1,1), 8, { GFX_RAW }, { 0 }, {
|
||||
#define STEP1024(START,STEP) STEP512(START,STEP),STEP512((START)+512*(STEP),STEP)
|
||||
#define STEP2048(START,STEP) STEP1024(START,STEP),STEP1024((START)+1024*(STEP),STEP)
|
||||
|
||||
|
||||
#define STEP2_INV(START,STEP) (START)+(STEP),(START)
|
||||
#define STEP4_INV(START,STEP) STEP2_INV(START+2*STEP,STEP),STEP2_INV(START,STEP)
|
||||
|
||||
//**************************************************************************
|
||||
// GRAPHICS INFO MACROS
|
||||
|
@ -28,6 +28,7 @@ public:
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_decrypted_opcodes(*this, "decrypted_opcodes"),
|
||||
m_work_ram(*this, "wram"),
|
||||
m_vram(*this, "vram"),
|
||||
m_palette(*this, "palette"),
|
||||
m_gfxdecode(*this, "gfxdecode")
|
||||
@ -36,10 +37,13 @@ public:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
void legacy_fg_draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void legacy_bg_draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void legacy_obj_draw(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
UINT32 screen_update_metlfrzr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_shared_ptr<UINT8> m_decrypted_opcodes;
|
||||
required_shared_ptr<UINT8> m_work_ram;
|
||||
required_shared_ptr<UINT8> m_vram;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
@ -55,9 +59,9 @@ void metlfrzr_state::video_start()
|
||||
{
|
||||
}
|
||||
|
||||
void metlfrzr_state::legacy_fg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect)
|
||||
void metlfrzr_state::legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect)
|
||||
{
|
||||
gfx_element *gfx_0 = m_gfxdecode->gfx(m_fg_tilebank);
|
||||
gfx_element *gfx = m_gfxdecode->gfx(m_fg_tilebank);
|
||||
int count;
|
||||
|
||||
for (count=0;count<32*32;count++)
|
||||
@ -68,28 +72,48 @@ void metlfrzr_state::legacy_fg_draw(bitmap_ind16 &bitmap,const rectangle &clipre
|
||||
UINT16 tile = m_vram[count*2+0] + ((m_vram[count*2+1] & 0xf0) << 4);
|
||||
UINT8 color = m_vram[count*2+1] & 0xf;
|
||||
|
||||
gfx_0->transpen(bitmap,cliprect,tile,color,0,0,x*8,y*8,0xf);
|
||||
gfx->transpen(bitmap,cliprect,tile,color,0,0,x*8,y*8,0xf);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void metlfrzr_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &cliprect)
|
||||
{
|
||||
gfx_element *gfx = m_gfxdecode->gfx(3);
|
||||
int count;
|
||||
UINT8 *base_spriteram = m_work_ram + 0xe00;
|
||||
|
||||
for(count=0;count<0x200;count+=4)
|
||||
{
|
||||
UINT8 tile_bank = 0;//base_spriteram[count+1] & 3;
|
||||
UINT16 tile = base_spriteram[count] | (tile_bank << 8);
|
||||
UINT8 color = base_spriteram[count+1] & 0xf;
|
||||
int y = base_spriteram[count+2];
|
||||
int x = base_spriteram[count+3];
|
||||
|
||||
gfx->transpen(bitmap,cliprect,tile,color,0,0,x,y,0xf);
|
||||
}
|
||||
}
|
||||
|
||||
UINT32 metlfrzr_state::screen_update_metlfrzr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
bitmap.fill(m_palette->black_pen(), cliprect);
|
||||
|
||||
legacy_fg_draw(bitmap,cliprect);
|
||||
legacy_bg_draw(bitmap,cliprect);
|
||||
legacy_obj_draw(bitmap,cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(metlfrzr_state::output_w)
|
||||
{
|
||||
// bit 7: flip screen
|
||||
// bit 5: on title screen after coin is inserted
|
||||
// bit 1-0: unknown purpose, both 1s too generally
|
||||
m_fg_tilebank = (data & 0x10) >> 4;
|
||||
membank("bank1")->set_entry((data & 0xc) >> 2);
|
||||
|
||||
popmessage("%02x",data & 3);
|
||||
if(data & 0x63)
|
||||
if(data & 0x60)
|
||||
printf("%02x\n",data);
|
||||
}
|
||||
|
||||
@ -234,44 +258,41 @@ void metlfrzr_state::machine_reset()
|
||||
}
|
||||
|
||||
|
||||
static const gfx_layout tiles8x8_layout =
|
||||
static const gfx_layout tile_layout =
|
||||
{
|
||||
8,8,
|
||||
RGN_FRAC(1,1),
|
||||
4,
|
||||
{ 0, 4, 8, 12 },
|
||||
{ 19, 18,17,16,3,2,1,0 },
|
||||
// { 19, 18, 17, 16, 3, 2, 1, 0 }, // maybe display is flipped?
|
||||
// { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
|
||||
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
|
||||
{ STEP4(0,4) },
|
||||
{ STEP4_INV(16,1), STEP4_INV(0,1) },
|
||||
{ STEP8(0,32) },
|
||||
32*8
|
||||
};
|
||||
|
||||
static const gfx_layout tiles16x16_layout =
|
||||
static const gfx_layout sprite_layout =
|
||||
{
|
||||
16, 16,
|
||||
RGN_FRAC(1, 1),
|
||||
4,
|
||||
{ 0, 4, 8, 12 },
|
||||
// { 0, 1, 2, 3, 16, 17, 18, 19, 64*8+0, 64*8+1, 64*8+2, 64*8+3, 64*8+16, 64*8+17, 64*8+18, 64*8+19 },
|
||||
{ 64 * 8 + 19, 64 * 8 + 18, 64 * 8 + 17, 64 * 8 + 16, 64 * 8 + 3, 64 * 8 + 2, 64 * 8 + 1, 64 * 8 + 0, 19, 18, 17, 16, 3, 2, 1, 0 },
|
||||
// { 0*32,1*32,2*32,3*32,4*32,5*32,6*32,7*32, 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
|
||||
{ 15 * 32,14 * 32,13 * 32,12 * 32,11 * 32,10 * 32,9 * 32,8 * 32, 7 * 32, 6 * 32, 5 * 32, 4 * 32, 3 * 32, 2 * 32, 1 * 32, 0 * 32 },
|
||||
128 * 8
|
||||
RGN_FRAC(1, 1),
|
||||
4,
|
||||
{ STEP4(0,4) },
|
||||
{ STEP4(0,1), STEP4(16,1), STEP4(64*8,1), STEP4(64*8+16,1) },
|
||||
{ STEP16(0,32) },
|
||||
128 * 8
|
||||
};
|
||||
|
||||
|
||||
static GFXDECODE_START(metlfrzr)
|
||||
GFXDECODE_ENTRY("gfx1", 0, tiles8x8_layout, 0x100, 16)
|
||||
GFXDECODE_ENTRY("gfx2", 0, tiles8x8_layout, 0x100, 16)
|
||||
GFXDECODE_ENTRY("gfx3", 0, tiles16x16_layout, 0, 16)
|
||||
GFXDECODE_ENTRY("gfx4", 0, tiles16x16_layout, 0, 16)
|
||||
GFXDECODE_ENTRY("gfx1", 0, tile_layout, 0x100, 16)
|
||||
GFXDECODE_ENTRY("gfx2", 0, tile_layout, 0x100, 16)
|
||||
GFXDECODE_ENTRY("gfx3", 0, sprite_layout, 0, 16)
|
||||
GFXDECODE_ENTRY("gfx4", 0, sprite_layout, 0, 16)
|
||||
GFXDECODE_END
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(metlfrzr_state::scanline)
|
||||
{
|
||||
int scanline = param;
|
||||
|
||||
|
||||
if(scanline == 240) // vblank-out irq
|
||||
m_maincpu->set_input_line_and_vector(0, HOLD_LINE,0x10); /* RST 10h */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user