added cocktail mode support to world rally

This commit is contained in:
Manuel Abadia 2008-05-12 16:15:04 +00:00
parent 2528b956f5
commit 2ed6f56c36
3 changed files with 25 additions and 9 deletions

View File

@ -92,7 +92,6 @@ extern UINT16 *wrally_vregs;
extern UINT16 *wrally_videoram;
extern UINT16 *wrally_spriteram;
WRITE16_HANDLER( wrally_vram_w );
VIDEO_START( wrally );
VIDEO_UPDATE( wrally );
@ -100,6 +99,8 @@ VIDEO_UPDATE( wrally );
DRIVER_INIT( wrally );
MACHINE_RESET( wrally );
READ32_HANDLER( wrally_external_ram_iaddr );
WRITE16_HANDLER( wrally_vram_w );
WRITE16_HANDLER( wrally_flipscreen_w );
WRITE16_HANDLER( OKIM6295_bankswitch_w );
WRITE16_HANDLER( wrally_coin_counter_w );
WRITE16_HANDLER( wrally_coin_lockout_w );
@ -119,8 +120,8 @@ static ADDRESS_MAP_START( wrally_readmem, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x70000e, 0x70000f) AM_READWRITE(OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w) /* OKI6295 status/data register */
AM_RANGE(0x70000a, 0x70001b) AM_WRITE(wrally_coin_lockout_w) /* Coin lockouts */
AM_RANGE(0x70002a, 0x70003b) AM_WRITE(wrally_coin_counter_w) /* Coin counters */
AM_RANGE(0x70004a, 0x70004b) AM_WRITE(SMH_NOP) /* sound muting */
AM_RANGE(0x70005a, 0x70005b) AM_WRITE(SMH_NOP) /* flip screen */
AM_RANGE(0x70004a, 0x70004b) AM_WRITE(SMH_NOP) /* Sound muting */
AM_RANGE(0x70005a, 0x70005b) AM_WRITE(wrally_flipscreen_w) /* Flip screen */
AM_RANGE(0x70006a, 0x70007b) AM_WRITE(SMH_NOP) /* ??? */
AM_RANGE(0xfec000, 0xfeffff) AM_RAM AM_SHARE(1) /* Work RAM (shared with DS5002FP) */
ADDRESS_MAP_END

View File

@ -29,6 +29,10 @@ WRITE16_HANDLER( wrally_vram_w )
tilemap_mark_tile_dirty(wrally_pant[(offset & 0x1fff) >> 12], ((offset << 1) & 0x1fff) >> 2);
}
WRITE16_HANDLER( wrally_flipscreen_w )
{
flip_screen_set(data & 0x01);
}
WRITE16_HANDLER( OKIM6295_bankswitch_w )
{

View File

@ -125,6 +125,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (high_priority != priority) continue;
if (flip_screen_get()) {
sy = sy + 248;
}
if (!color_effect) {
drawgfx(bitmap,gfx,number,
0x20 + color,xflip,yflip,
@ -136,7 +140,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (py = 0; py < gfx->height; py++){
/* get a pointer to the current line in the screen bitmap */
int ypos = ((sy + py) & 0xff);
int ypos = ((sy + py) & 0x1ff);
UINT16 *srcy = BITMAP_ADDR16(bitmap, ypos, 0);
int gfx_py = yflip ? (gfx->height - 1 - py) : py;
@ -174,12 +178,19 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
***************************************************************************/
VIDEO_UPDATE( wrally )
{
{
/* set scroll registers */
tilemap_set_scrolly(wrally_pant[0], 0, wrally_vregs[0]);
tilemap_set_scrollx(wrally_pant[0], 0, wrally_vregs[1]+4);
tilemap_set_scrolly(wrally_pant[1], 0, wrally_vregs[2]);
tilemap_set_scrollx(wrally_pant[1], 0, wrally_vregs[3]);
if (!flip_screen_get()) {
tilemap_set_scrolly(wrally_pant[0], 0, wrally_vregs[0]);
tilemap_set_scrollx(wrally_pant[0], 0, wrally_vregs[1]+4);
tilemap_set_scrolly(wrally_pant[1], 0, wrally_vregs[2]);
tilemap_set_scrollx(wrally_pant[1], 0, wrally_vregs[3]);
} else {
tilemap_set_scrolly(wrally_pant[0], 0, 248 - wrally_vregs[0]);
tilemap_set_scrollx(wrally_pant[0], 0, 1024 - wrally_vregs[1] - 4);
tilemap_set_scrolly(wrally_pant[1], 0, 248 - wrally_vregs[2]);
tilemap_set_scrollx(wrally_pant[1], 0, 1024 - wrally_vregs[3]);
}
/* draw tilemaps + sprites */
tilemap_draw(bitmap,cliprect,wrally_pant[1],TILEMAP_DRAW_OPAQUE,0);