fixed vulgus wrong sprite wraparound

This commit is contained in:
Michaël Banaan Ananas 2014-06-21 14:11:04 +00:00
parent 158ca615a5
commit 6bc9db60ea
2 changed files with 25 additions and 38 deletions

View File

@ -73,7 +73,6 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, vulgus_state ) static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, vulgus_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x4000, 0x47ff) AM_RAM AM_RANGE(0x4000, 0x47ff) AM_RAM
AM_RANGE(0x4000, 0x47ff) AM_WRITEONLY
AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r)
AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w) AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
AM_RANGE(0xc000, 0xc001) AM_DEVWRITE("ay2", ay8910_device, address_data_w) AM_RANGE(0xc000, 0xc001) AM_DEVWRITE("ay2", ay8910_device, address_data_w)

View File

@ -1,6 +1,6 @@
/*************************************************************************** /***************************************************************************
video.c Capcom Vulgus hardware
Functions to emulate the video hardware of the machine. Functions to emulate the video hardware of the machine.
@ -164,46 +164,33 @@ WRITE8_MEMBER(vulgus_state::vulgus_palette_bank_w)
void vulgus_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) void vulgus_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{ {
UINT8 *spriteram = m_spriteram; gfx_element *gfx = m_gfxdecode->gfx(2);
int offs;
for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
for (offs = m_spriteram.bytes() - 4;offs >= 0;offs -= 4)
{ {
int code,i,col,sx,sy,dir; int code = m_spriteram[offs];
int color = m_spriteram[offs + 1] & 0x0f;
int sy = m_spriteram[offs + 2];
int sx = m_spriteram[offs + 3];
bool flip = flip_screen() ? true : false;
int dir = 1;
if (sy == 0)
continue;
code = spriteram[offs]; if (flip)
col = spriteram[offs + 1] & 0x0f;
sx = spriteram[offs + 3];
sy = spriteram[offs + 2];
dir = 1;
if (flip_screen())
{ {
sx = 240 - sx; sx = 240 - sx;
sy = 240 - sy; sy = 240 - sy;
dir = -1; dir = -1;
} }
i = (spriteram[offs + 1] & 0xc0) >> 6; // draw sprite rows (16*16, 16*32, or 16*64)
if (i == 2) i = 3; int row = (m_spriteram[offs + 1] & 0xc0) >> 6;
if (row == 2) row = 3;
do for (; row >= 0; row--)
{ gfx->transpen(bitmap, cliprect, code + row, color, flip, flip, sx, sy + 16 * row * dir, 15);
m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
code + i,
col,
flip_screen(),flip_screen(),
sx, sy + 16 * i * dir,15);
/* draw again with wraparound */
m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
code + i,
col,
flip_screen(),flip_screen(),
sx, sy + 16 * i * dir - dir * 256,15);
i--;
} while (i >= 0);
} }
} }
@ -215,5 +202,6 @@ UINT32 vulgus_state::screen_update_vulgus(screen_device &screen, bitmap_ind16 &b
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
draw_sprites(bitmap, cliprect); draw_sprites(bitmap, cliprect);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0; return 0;
} }