wc90b1 and wc90b2: some improvements:

- fixed bg and fg scroll
- fixed bg and fg offsets
This commit is contained in:
Roberto Zandona 2009-03-08 19:40:20 +00:00
parent 3cb1b0b087
commit f82922db1e
2 changed files with 10 additions and 6 deletions

View File

@ -98,6 +98,8 @@ extern UINT8 *wc90b_scroll2x;
extern UINT8 *wc90b_scroll1y;
extern UINT8 *wc90b_scroll2y;
extern UINT8 *wc90b_scroll_x_lo;
VIDEO_START( wc90b );
WRITE8_HANDLER( wc90b_bgvideoram_w );
WRITE8_HANDLER( wc90b_fgvideoram_w );
@ -176,6 +178,7 @@ static ADDRESS_MAP_START( wc90b_map1, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0xfd06, 0xfd06) AM_WRITEONLY AM_BASE(&wc90b_scroll1x)
AM_RANGE(0xfd08, 0xfd08) AM_WRITEONLY AM_BASE(&wc90b_scroll2y)
AM_RANGE(0xfd0a, 0xfd0a) AM_WRITEONLY AM_BASE(&wc90b_scroll2x)
AM_RANGE(0xfd0e, 0xfd0e) AM_WRITEONLY AM_BASE(&wc90b_scroll_x_lo)
AM_RANGE(0xfd00, 0xfd00) AM_READ_PORT("P1")
AM_RANGE(0xfd02, 0xfd02) AM_READ_PORT("P2")
AM_RANGE(0xfd06, 0xfd06) AM_READ_PORT("DSW1")

View File

@ -9,6 +9,7 @@ UINT8 *wc90b_scroll2x;
UINT8 *wc90b_scroll1y;
UINT8 *wc90b_scroll2y;
UINT8 *wc90b_scroll_x_lo;
static tilemap *tx_tilemap,*fg_tilemap,*bg_tilemap;
@ -128,8 +129,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
drawgfx( bitmap, machine->gfx[17], code,
flags >> 4, /* color */
bank & 1, /* flipx */
bank & 2, /* flipy */
bank & 1, /* flipx */
bank & 2, /* flipy */
sx,
sy,
cliprect,TRANSPARENCY_PEN,15 );
@ -139,10 +140,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
VIDEO_UPDATE( wc90b )
{
tilemap_set_scrollx(bg_tilemap,0,8 * wc90b_scroll2x[0] + 256);
tilemap_set_scrolly(bg_tilemap,0,wc90b_scroll2y[0] + ((wc90b_scroll2y[0] < 0x10 || wc90b_scroll2y[0] == 0xff) ? 256 : 0));
tilemap_set_scrollx(fg_tilemap,0,8 * wc90b_scroll1x[0] + 256);
tilemap_set_scrolly(fg_tilemap,0,wc90b_scroll1y[0] + ((wc90b_scroll1y[0] < 0x10 || wc90b_scroll1y[0] == 0xff) ? 256 : 0));
tilemap_set_scrollx(bg_tilemap,0,8 * wc90b_scroll2x[0] + 256 - 4 + (wc90b_scroll_x_lo[0] & 0x07));
tilemap_set_scrolly(bg_tilemap,0,wc90b_scroll2y[0] + 1 + ((wc90b_scroll2y[0] < 0x10 || wc90b_scroll2y[0] == 0xff) ? 256 : 0));
tilemap_set_scrollx(fg_tilemap,0,8 * wc90b_scroll1x[0] + 256 - 6 + ((wc90b_scroll_x_lo[0] & 0x38) >> 3));
tilemap_set_scrolly(fg_tilemap,0,wc90b_scroll1y[0] + 1 + ((wc90b_scroll1y[0] < 0x10 || wc90b_scroll1y[0] == 0xff) ? 256 : 0));
tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);