let's attempt something a bit different here, and be brave, use it for everything (nw)

This commit is contained in:
David Haywood 2013-01-05 03:22:24 +00:00
parent 6ef5bb7da2
commit 87082fc6a8
3 changed files with 30 additions and 26 deletions

View File

@ -405,9 +405,6 @@ static MACHINE_CONFIG_DERIVED( grasspin, blueprnt )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(grasspin_map)
/* video hardware */
MCFG_VIDEO_START_OVERRIDE(blueprnt_state, grasspin)
MACHINE_CONFIG_END
/*************************************

View File

@ -39,11 +39,9 @@ public:
DECLARE_WRITE8_MEMBER(blueprnt_flipscreen_w);
DECLARE_WRITE8_MEMBER(dipsw_w);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_bg_tile_info_grasspin);
virtual void machine_start();
virtual void machine_reset();
DECLARE_VIDEO_START(blueprnt);
DECLARE_VIDEO_START(grasspin);
virtual void palette_init();
UINT32 screen_update_blueprnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};

View File

@ -56,6 +56,16 @@ WRITE8_MEMBER(blueprnt_state::blueprnt_colorram_w)
{
m_colorram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset);
offset-=32;
offset &=0x3ff;
m_bg_tilemap->mark_tile_dirty(offset);
offset+=64;
offset &=0x3ff;
m_bg_tilemap->mark_tile_dirty(offset);
}
WRITE8_MEMBER(blueprnt_state::blueprnt_flipscreen_w)
@ -69,27 +79,35 @@ WRITE8_MEMBER(blueprnt_state::blueprnt_flipscreen_w)
}
}
TILE_GET_INFO_MEMBER(blueprnt_state::get_bg_tile_info)
{
int attr = m_colorram[tile_index];
int code = m_videoram[tile_index] + 256 * m_gfx_bank;
int color = attr & 0x7f;
int bank;
tileinfo.category = (attr & 0x80) ? 1 : 0;
// It looks like the upper bank attribute bit (at least) comes from the previous tile read.
// Obviously if the screen is flipped the previous tile the hardware would read is different
// to the previous tile when it's not flipped hence the if (flip_screen()) logic
//
// note, one line still ends up darkened in the cocktail mode of grasspin, but on the real
// hardware there was no observable brightness difference between any part of the screen so
// I'm not convinced the brightness implementation is correct anyway, it might simply be
// tied to the use of upper / lower tiles or priority instead?
if (flip_screen())
{
bank = m_colorram[(tile_index+32)&0x3ff] & 0x40;
}
else
{
bank = m_colorram[(tile_index-32)&0x3ff] & 0x40;
}
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
// really not sure about this but Grasspin doesn't write the tilebank
// or flipscreen after startup... this certainly doesn't work for 'Saturn'
TILE_GET_INFO_MEMBER(blueprnt_state::get_bg_tile_info_grasspin)
{
int attr = m_colorram[tile_index];
int code = m_videoram[tile_index];
int color = attr & 0x7f;
tileinfo.category = (attr & 0x80) ? 1 : 0;
if ((attr & 0x40)) code += 0x100;
if (bank) code += m_gfx_bank * 0x100;
SET_TILE_INFO_MEMBER(0, code, color, 0);
}
@ -105,15 +123,6 @@ VIDEO_START_MEMBER(blueprnt_state,blueprnt)
save_item(NAME(m_gfx_bank));
}
VIDEO_START_MEMBER(blueprnt_state,grasspin)
{
m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(blueprnt_state::get_bg_tile_info_grasspin),this), TILEMAP_SCAN_COLS_FLIP_X, 8, 8, 32, 32);
m_bg_tilemap->set_transparent_pen(0);
m_bg_tilemap->set_scroll_cols(32);
save_item(NAME(m_gfx_bank));
}
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
{