mirror of
https://github.com/holub/mame
synced 2025-04-19 15:11:37 +03:00
Removed ancient "dirty" optimizations from CVS/S2656 and related drivers. This fixes at least spacefrt096u1gre
This commit is contained in:
parent
162c8fe076
commit
5a081cf2a1
@ -88,38 +88,9 @@ mame_bitmap *s2636_1_bitmap;
|
||||
mame_bitmap *s2636_2_bitmap;
|
||||
mame_bitmap *s2636_3_bitmap;
|
||||
|
||||
UINT8 s2636_1_dirty[4];
|
||||
UINT8 s2636_2_dirty[4];
|
||||
UINT8 s2636_3_dirty[4];
|
||||
|
||||
int s2636_x_offset=0;
|
||||
int s2636_y_offset=0;
|
||||
|
||||
void s2636_w(UINT8 *workram,int offset,int data,UINT8 *dirty)
|
||||
{
|
||||
if (workram[offset] != data)
|
||||
{
|
||||
workram[offset] = data;
|
||||
|
||||
if(offset < 10)
|
||||
dirty[0]=1;
|
||||
else
|
||||
{
|
||||
if((offset > 15) && (offset < 26))
|
||||
dirty[1]=1;
|
||||
else
|
||||
{
|
||||
if((offset > 31) && (offset < 42))
|
||||
dirty[2]=1;
|
||||
else
|
||||
{
|
||||
if((offset > 63) && (offset < 74))
|
||||
dirty[3]=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************/
|
||||
/* Check for Collision between 2 sprites */
|
||||
@ -218,7 +189,7 @@ static int SpriteCheck(running_machine *machine, int first,int second,UINT8 *wor
|
||||
return Checksum;
|
||||
}
|
||||
|
||||
void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *workram,UINT8 *dirty,int Graphics_Bank,mame_bitmap *collision_bitmap)
|
||||
void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *workram,int Graphics_Bank,mame_bitmap *collision_bitmap)
|
||||
{
|
||||
int CollisionSprite = 0;
|
||||
int spriteno;
|
||||
@ -245,11 +216,7 @@ void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *wor
|
||||
|
||||
colour = (colour & 7) + 7;
|
||||
|
||||
if(dirty[spriteno])
|
||||
{
|
||||
decodechar(machine->gfx[Graphics_Bank],charno,workram,machine->drv->gfxdecodeinfo[Graphics_Bank].gfxlayout);
|
||||
dirty[spriteno] = 0;
|
||||
}
|
||||
decodechar(machine->gfx[Graphics_Bank],charno,workram,machine->drv->gfxdecodeinfo[Graphics_Bank].gfxlayout);
|
||||
|
||||
drawgfxzoom(bitmap,machine->gfx[Graphics_Bank],
|
||||
charno,
|
||||
|
@ -6,13 +6,8 @@ extern mame_bitmap *s2636_1_bitmap;
|
||||
extern mame_bitmap *s2636_2_bitmap;
|
||||
extern mame_bitmap *s2636_3_bitmap;
|
||||
|
||||
extern UINT8 s2636_1_dirty[4];
|
||||
extern UINT8 s2636_2_dirty[4];
|
||||
extern UINT8 s2636_3_dirty[4];
|
||||
|
||||
extern int s2636_x_offset;
|
||||
extern int s2636_y_offset;
|
||||
|
||||
void s2636_w(UINT8 *workram,int offset,int data,UINT8 *dirty);
|
||||
void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *workram,UINT8 *dirty,int Graphics_Bank,mame_bitmap *collision_bitmap);
|
||||
void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *workram,int Graphics_Bank,mame_bitmap *collision_bitmap);
|
||||
|
||||
|
@ -57,21 +57,6 @@ static WRITE8_HANDLER( laserbat_videoram_w )
|
||||
}
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( laserbat_s2636_1_w )
|
||||
{
|
||||
s2636_w(s2636_1_ram,offset,data,s2636_1_dirty);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( laserbat_s2636_2_w )
|
||||
{
|
||||
s2636_w(s2636_2_ram,offset,data,s2636_2_dirty);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( laserbat_s2636_3_w )
|
||||
{
|
||||
s2636_w(s2636_3_ram,offset,data,s2636_3_dirty);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( video_extra_w )
|
||||
{
|
||||
laserbat_video_page = (data & 0x10) >> 4;
|
||||
@ -196,9 +181,9 @@ static ADDRESS_MAP_START( laserbat_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x7800, 0x7bff) AM_ROM
|
||||
|
||||
AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_WRITENOP // always 0 (bullet ram in Quasar)
|
||||
AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_RAM AM_WRITE(laserbat_s2636_1_w) AM_BASE(&s2636_1_ram)
|
||||
AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_RAM AM_WRITE(laserbat_s2636_2_w) AM_BASE(&s2636_2_ram)
|
||||
AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM AM_WRITE(laserbat_s2636_3_w) AM_BASE(&s2636_3_ram)
|
||||
AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_1_ram)
|
||||
AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_2_ram)
|
||||
AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_3_ram)
|
||||
AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(laserbat_videoram_w)
|
||||
AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
@ -542,9 +527,9 @@ static VIDEO_UPDATE( laserbat )
|
||||
{
|
||||
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
|
||||
|
||||
s2636_update_bitmap(machine,bitmap,s2636_1_ram,s2636_1_dirty,1,collision_bitmap);
|
||||
s2636_update_bitmap(machine,bitmap,s2636_2_ram,s2636_2_dirty,2,collision_bitmap);
|
||||
s2636_update_bitmap(machine,bitmap,s2636_3_ram,s2636_3_dirty,3,collision_bitmap);
|
||||
s2636_update_bitmap(machine,bitmap,s2636_1_ram,1,collision_bitmap);
|
||||
s2636_update_bitmap(machine,bitmap,s2636_2_ram,2,collision_bitmap);
|
||||
s2636_update_bitmap(machine,bitmap,s2636_3_ram,3,collision_bitmap);
|
||||
|
||||
if(sprite_info.enable)
|
||||
drawgfx(bitmap,machine->gfx[4],
|
||||
|
@ -55,26 +55,6 @@ VIDEO_START( malzak );
|
||||
VIDEO_UPDATE( malzak );
|
||||
WRITE8_HANDLER( playfield_w );
|
||||
|
||||
static READ8_HANDLER( malzak_s2636_1_r )
|
||||
{
|
||||
return s2636_1_ram[offset];
|
||||
}
|
||||
|
||||
static READ8_HANDLER( malzak_s2636_2_r )
|
||||
{
|
||||
return s2636_2_ram[offset];
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( malzak_s2636_1_w )
|
||||
{
|
||||
s2636_w(s2636_1_ram,offset,data,s2636_1_dirty);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( malzak_s2636_2_w )
|
||||
{
|
||||
s2636_w(s2636_2_ram,offset,data,s2636_2_dirty);
|
||||
}
|
||||
|
||||
|
||||
static READ8_HANDLER( saa5050_r )
|
||||
{
|
||||
@ -144,8 +124,8 @@ static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x1200, 0x12ff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0x1300, 0x13ff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0x14cb, 0x14cb) AM_READ(fake_VRLE_r)
|
||||
AM_RANGE(0x1400, 0x14ff) AM_READ(malzak_s2636_1_r)
|
||||
AM_RANGE(0x1500, 0x15ff) AM_READ(malzak_s2636_2_r)
|
||||
AM_RANGE(0x1400, 0x14ff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0x1500, 0x15ff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0x1600, 0x16ff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0x1700, 0x17ff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0x1800, 0x1fff) AM_READ(saa5050_r) // SAA 5050 video RAM
|
||||
@ -164,8 +144,8 @@ static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x1100, 0x11ff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0x1200, 0x12ff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0x1300, 0x13ff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0x1400, 0x14ff) AM_WRITE(malzak_s2636_1_w)
|
||||
AM_RANGE(0x1500, 0x15ff) AM_WRITE(malzak_s2636_2_w)
|
||||
AM_RANGE(0x1400, 0x14ff) AM_WRITE(MWA8_RAM) AM_BASE(&s2636_1_ram)
|
||||
AM_RANGE(0x1500, 0x15ff) AM_WRITE(MWA8_RAM) AM_BASE(&s2636_2_ram)
|
||||
AM_RANGE(0x1600, 0x16ff) AM_WRITE(playfield_w)
|
||||
AM_RANGE(0x1600, 0x16ff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0x1700, 0x17ff) AM_WRITE(MWA8_RAM)
|
||||
@ -187,8 +167,8 @@ static ADDRESS_MAP_START( malzak2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x1300, 0x13ff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0x14cb, 0x14cb) AM_READ(fake_VRLE_r)
|
||||
AM_RANGE(0x14cc, 0x14cc) AM_READ(s2636_portA_r)
|
||||
AM_RANGE(0x1400, 0x14ff) AM_READ(malzak_s2636_1_r)
|
||||
AM_RANGE(0x1500, 0x15ff) AM_READ(malzak_s2636_2_r)
|
||||
AM_RANGE(0x1400, 0x14ff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0x1500, 0x15ff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0x1600, 0x16ff) AM_READ(MRA8_RAM)
|
||||
AM_RANGE(0x1700, 0x17ff) AM_READ(MRA8_RAM) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
|
||||
AM_RANGE(0x1800, 0x1fff) AM_READ(saa5050_r) // SAA 5050 video RAM
|
||||
@ -207,8 +187,8 @@ static ADDRESS_MAP_START( malzak2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x1100, 0x11ff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0x1200, 0x12ff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0x1300, 0x13ff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0x1400, 0x14ff) AM_WRITE(malzak_s2636_1_w)
|
||||
AM_RANGE(0x1500, 0x15ff) AM_WRITE(malzak_s2636_2_w)
|
||||
AM_RANGE(0x1400, 0x14ff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0x1500, 0x15ff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0x1600, 0x16ff) AM_WRITE(playfield_w)
|
||||
AM_RANGE(0x1600, 0x16ff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0x1700, 0x17ff) AM_WRITE(MWA8_RAM) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
|
||||
|
@ -10,19 +10,17 @@
|
||||
|
||||
#include "driver.h"
|
||||
#include "cpu/s2650/s2650.h"
|
||||
#include "video/s2636.h"
|
||||
|
||||
#include "tinv2650.lh"
|
||||
|
||||
extern UINT8 *zac_s2636ram;
|
||||
WRITE8_HANDLER( tinvader_videoram_w );
|
||||
WRITE8_HANDLER( tinvader_sound_w );
|
||||
READ8_HANDLER( zac_s2636_r );
|
||||
READ8_HANDLER( tinvader_port_0_r );
|
||||
|
||||
extern WRITE8_HANDLER( tinvader_videoram_w );
|
||||
extern WRITE8_HANDLER( zac_s2636_w );
|
||||
extern WRITE8_HANDLER( tinvader_sound_w );
|
||||
extern READ8_HANDLER( zac_s2636_r );
|
||||
extern READ8_HANDLER( tinvader_port_0_r );
|
||||
|
||||
extern VIDEO_START( tinvader );
|
||||
extern VIDEO_UPDATE( tinvader );
|
||||
VIDEO_START( tinvader );
|
||||
VIDEO_UPDATE( tinvader );
|
||||
|
||||
static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x17ff) AM_READ(MRA8_ROM)
|
||||
@ -45,7 +43,7 @@ static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x1d00, 0x1dff) AM_WRITE(MWA8_RAM)
|
||||
AM_RANGE(0x1e80, 0x1e80) AM_WRITE(tinvader_sound_w)
|
||||
AM_RANGE(0x1e86, 0x1e86) AM_WRITE(MWA8_NOP) /* Dodgem Only */
|
||||
AM_RANGE(0x1f00, 0x1fff) AM_WRITE(zac_s2636_w) AM_BASE(&zac_s2636ram)
|
||||
AM_RANGE(0x1f00, 0x1fff) AM_WRITE(MWA8_RAM) AM_BASE(&s2636_1_ram)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
|
||||
|
@ -43,7 +43,6 @@ static int character_page=0;
|
||||
static int scroll_reg = 0;
|
||||
static int stars_scroll=0;
|
||||
|
||||
static UINT8 *dirty_character;
|
||||
static UINT8 *character_1_ram;
|
||||
static UINT8 *character_2_ram;
|
||||
static UINT8 *character_3_ram;
|
||||
@ -104,12 +103,10 @@ PALETTE_INIT( cvs )
|
||||
}
|
||||
|
||||
/* Initialise Dirty Character Array */
|
||||
dirty_character = auto_malloc(0x100);
|
||||
character_1_ram = auto_malloc(0x2000);
|
||||
character_2_ram = character_1_ram + 0x800;
|
||||
character_3_ram = character_2_ram + 0x800;
|
||||
|
||||
memset(dirty_character, 0, 256);
|
||||
memset(character_1_ram, 0, 1024);
|
||||
memset(character_2_ram, 0, 1024);
|
||||
memset(character_3_ram, 0, 1024);
|
||||
@ -253,17 +250,12 @@ WRITE8_HANDLER( cvs_2636_1_w )
|
||||
{
|
||||
// First 2636
|
||||
|
||||
s2636_w(s2636_1_ram,offset,data,s2636_1_dirty);
|
||||
s2636_1_ram[offset] = data;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Character Ram 1
|
||||
|
||||
if(character_1_ram[character_page + offset] != data)
|
||||
{
|
||||
character_1_ram[character_page + offset] = data;
|
||||
dirty_character[128+((character_page + offset)>>3)] = 1;
|
||||
}
|
||||
character_1_ram[character_page + offset] = data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -289,17 +281,12 @@ WRITE8_HANDLER( cvs_2636_2_w )
|
||||
{
|
||||
// Second 2636
|
||||
|
||||
s2636_w(s2636_2_ram,offset,data,s2636_2_dirty);
|
||||
s2636_2_ram[offset] = data;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Character Ram 2
|
||||
|
||||
if(character_2_ram[character_page + offset] != data)
|
||||
{
|
||||
character_2_ram[character_page + offset] = data;
|
||||
dirty_character[128+((character_page + offset)>>3)] = 1;
|
||||
}
|
||||
character_2_ram[character_page + offset] = data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -325,17 +312,12 @@ WRITE8_HANDLER( cvs_2636_3_w )
|
||||
{
|
||||
// Third 2636
|
||||
|
||||
s2636_w(s2636_3_ram,offset,data,s2636_3_dirty);
|
||||
s2636_3_ram[offset] = data;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Character Ram 3
|
||||
|
||||
if(character_3_ram[character_page + offset] != data)
|
||||
{
|
||||
character_3_ram[character_page + offset] = data;
|
||||
dirty_character[128+((character_page + offset)>>3)] = 1;
|
||||
}
|
||||
character_3_ram[character_page + offset] = data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -457,14 +439,7 @@ VIDEO_UPDATE( cvs )
|
||||
|
||||
if(character > ModeOffset[character_mode])
|
||||
{
|
||||
/* re-generate character if dirty */
|
||||
|
||||
if (dirty_character[character])
|
||||
{
|
||||
decodechar(machine->gfx[1],character,character_1_ram-1024,machine->drv->gfxdecodeinfo[1].gfxlayout);
|
||||
|
||||
dirty_character[character] = 0;
|
||||
}
|
||||
decodechar(machine->gfx[1],character,character_1_ram-1024,machine->drv->gfxdecodeinfo[1].gfxlayout);
|
||||
|
||||
character_bank=1;
|
||||
}
|
||||
@ -514,13 +489,13 @@ VIDEO_UPDATE( cvs )
|
||||
/* 2636's */
|
||||
|
||||
fillbitmap(s2636_1_bitmap,0,0);
|
||||
s2636_update_bitmap(machine,s2636_1_bitmap,s2636_1_ram,s2636_1_dirty,2,cvs_collision_bitmap);
|
||||
s2636_update_bitmap(machine,s2636_1_bitmap,s2636_1_ram,2,cvs_collision_bitmap);
|
||||
|
||||
fillbitmap(s2636_2_bitmap,0,0);
|
||||
s2636_update_bitmap(machine,s2636_2_bitmap,s2636_2_ram,s2636_2_dirty,3,cvs_collision_bitmap);
|
||||
s2636_update_bitmap(machine,s2636_2_bitmap,s2636_2_ram,3,cvs_collision_bitmap);
|
||||
|
||||
fillbitmap(s2636_3_bitmap,0,0);
|
||||
s2636_update_bitmap(machine,s2636_3_bitmap,s2636_3_ram,s2636_3_dirty,4,cvs_collision_bitmap);
|
||||
s2636_update_bitmap(machine,s2636_3_bitmap,s2636_3_ram,4,cvs_collision_bitmap);
|
||||
|
||||
/* Bullet Hardware */
|
||||
|
||||
|
@ -57,8 +57,6 @@ VIDEO_START( malzak )
|
||||
collision_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,BITMAP_FORMAT_INDEXED8);
|
||||
|
||||
saa5050_vidram = auto_malloc(0x800);
|
||||
s2636_1_ram = auto_malloc(0x100);
|
||||
s2636_2_ram = auto_malloc(0x100);
|
||||
}
|
||||
|
||||
VIDEO_UPDATE( malzak )
|
||||
@ -215,8 +213,8 @@ VIDEO_UPDATE( malzak )
|
||||
s2636_x_offset = -16;
|
||||
// s2636_y_offset = -8;
|
||||
|
||||
s2636_update_bitmap(machine,bitmap,s2636_1_ram,s2636_1_dirty,1,collision_bitmap);
|
||||
s2636_update_bitmap(machine,bitmap,s2636_2_ram,s2636_2_dirty,2,collision_bitmap);
|
||||
s2636_update_bitmap(machine,bitmap,s2636_1_ram,1,collision_bitmap);
|
||||
s2636_update_bitmap(machine,bitmap,s2636_2_ram,2,collision_bitmap);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -127,10 +127,6 @@ PALETTE_INIT( quasar )
|
||||
|
||||
s2636_x_offset = -26;
|
||||
s2636_y_offset = 3;
|
||||
|
||||
memset(s2636_1_dirty,0,sizeof(s2636_1_dirty));
|
||||
memset(s2636_2_dirty,0,sizeof(s2636_2_dirty));
|
||||
memset(s2636_3_dirty,0,sizeof(s2636_3_dirty));
|
||||
}
|
||||
|
||||
VIDEO_START( quasar )
|
||||
@ -201,13 +197,13 @@ VIDEO_UPDATE( quasar )
|
||||
/* 2636's */
|
||||
|
||||
fillbitmap(s2636_1_bitmap,0,0);
|
||||
s2636_update_bitmap(machine,s2636_1_bitmap,s2636_1_ram,s2636_1_dirty,2,cvs_collision_bitmap);
|
||||
s2636_update_bitmap(machine,s2636_1_bitmap,s2636_1_ram,2,cvs_collision_bitmap);
|
||||
|
||||
fillbitmap(s2636_2_bitmap,0,0);
|
||||
s2636_update_bitmap(machine,s2636_2_bitmap,s2636_2_ram,s2636_2_dirty,3,cvs_collision_bitmap);
|
||||
s2636_update_bitmap(machine,s2636_2_bitmap,s2636_2_ram,3,cvs_collision_bitmap);
|
||||
|
||||
fillbitmap(s2636_3_bitmap,0,0);
|
||||
s2636_update_bitmap(machine,s2636_3_bitmap,s2636_3_ram,s2636_3_dirty,4,cvs_collision_bitmap);
|
||||
s2636_update_bitmap(machine,s2636_3_bitmap,s2636_3_ram,4,cvs_collision_bitmap);
|
||||
|
||||
/* Bullet Hardware */
|
||||
|
||||
|
@ -5,11 +5,10 @@
|
||||
/*************************************************************/
|
||||
|
||||
#include "driver.h"
|
||||
#include "video/s2636.h"
|
||||
|
||||
UINT8 *zac_s2636ram;
|
||||
static mame_bitmap *spritebitmap;
|
||||
|
||||
static UINT8 dirtychar[256>>3];
|
||||
static int CollisionBackground;
|
||||
static int CollisionSprite;
|
||||
|
||||
@ -28,18 +27,9 @@ WRITE8_HANDLER( tinvader_videoram_w )
|
||||
tilemap_mark_tile_dirty(bg_tilemap, offset);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( zac_s2636_w )
|
||||
{
|
||||
if (zac_s2636ram[offset] != data)
|
||||
{
|
||||
zac_s2636ram[offset] = data;
|
||||
dirtychar[offset>>3] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
READ8_HANDLER( zac_s2636_r )
|
||||
{
|
||||
if(offset!=0xCB) return zac_s2636ram[offset];
|
||||
if(offset!=0xCB) return s2636_1_ram[offset];
|
||||
else return CollisionSprite;
|
||||
}
|
||||
|
||||
@ -57,10 +47,10 @@ static int SpriteCollision(running_machine *machine, int first,int second)
|
||||
int Checksum=0;
|
||||
int x,y;
|
||||
|
||||
if((zac_s2636ram[first * 0x10 + 10] < 0xf0) && (zac_s2636ram[second * 0x10 + 10] < 0xf0))
|
||||
if((s2636_1_ram[first * 0x10 + 10] < 0xf0) && (s2636_1_ram[second * 0x10 + 10] < 0xf0))
|
||||
{
|
||||
int fx = (zac_s2636ram[first * 0x10 + 10] * 4)-22;
|
||||
int fy = (zac_s2636ram[first * 0x10 + 12] * 3)+3;
|
||||
int fx = (s2636_1_ram[first * 0x10 + 10] * 4)-22;
|
||||
int fy = (s2636_1_ram[first * 0x10 + 12] * 3)+3;
|
||||
int expand = (first==1) ? 2 : 1;
|
||||
|
||||
/* Draw first sprite */
|
||||
@ -96,7 +86,7 @@ static int SpriteCollision(running_machine *machine, int first,int second)
|
||||
second * 2,
|
||||
1,
|
||||
0,0,
|
||||
(zac_s2636ram[second * 0x10 + 10] * 4)-22,(zac_s2636ram[second * 0x10 + 12] * 3) + 3,
|
||||
(s2636_1_ram[second * 0x10 + 10] * 4)-22,(s2636_1_ram[second * 0x10 + 12] * 3) + 3,
|
||||
0, TRANSPARENCY_PEN, 0);
|
||||
|
||||
/* Remove fingerprint */
|
||||
@ -168,24 +158,19 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap)
|
||||
|
||||
for(offs=0;offs<0x50;offs+=0x10)
|
||||
{
|
||||
if((zac_s2636ram[offs+10]<0xF0) && (offs!=0x30))
|
||||
if((s2636_1_ram[offs+10]<0xF0) && (offs!=0x30))
|
||||
{
|
||||
int spriteno = (offs / 8);
|
||||
int expand = ((zac_s2636ram[0xc0] & (spriteno*2))!=0) ? 2 : 1;
|
||||
int bx = (zac_s2636ram[offs+10] * 4) - 22;
|
||||
int by = (zac_s2636ram[offs+12] * 3) + 3;
|
||||
int expand = ((s2636_1_ram[0xc0] & (spriteno*2))!=0) ? 2 : 1;
|
||||
int bx = (s2636_1_ram[offs+10] * 4) - 22;
|
||||
int by = (s2636_1_ram[offs+12] * 3) + 3;
|
||||
int x,y;
|
||||
|
||||
if(dirtychar[spriteno])
|
||||
{
|
||||
/* 16x8 version */
|
||||
decodechar(machine->gfx[1],spriteno,zac_s2636ram,machine->drv->gfxdecodeinfo[1].gfxlayout);
|
||||
/* 16x8 version */
|
||||
decodechar(machine->gfx[1],spriteno,s2636_1_ram,machine->drv->gfxdecodeinfo[1].gfxlayout);
|
||||
|
||||
/* 16x16 version */
|
||||
decodechar(machine->gfx[2],spriteno,zac_s2636ram,machine->drv->gfxdecodeinfo[2].gfxlayout);
|
||||
|
||||
dirtychar[spriteno] = 0;
|
||||
}
|
||||
/* 16x16 version */
|
||||
decodechar(machine->gfx[2],spriteno,s2636_1_ram,machine->drv->gfxdecodeinfo[2].gfxlayout);
|
||||
|
||||
/* Sprite->Background collision detection */
|
||||
drawgfx(bitmap,machine->gfx[expand],
|
||||
|
Loading…
Reference in New Issue
Block a user