mirror of
https://github.com/holub/mame
synced 2025-06-06 21:03:47 +03:00
deco_mlc - checkpoint
This commit is contained in:
parent
86b48108c2
commit
a2db6d1509
@ -395,6 +395,7 @@ static MACHINE_CONFIG_START( avengrgs, deco_mlc_state )
|
|||||||
|
|
||||||
MCFG_GFXDECODE(deco_mlc)
|
MCFG_GFXDECODE(deco_mlc)
|
||||||
MCFG_PALETTE_LENGTH(2048)
|
MCFG_PALETTE_LENGTH(2048)
|
||||||
|
// MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
|
||||||
|
|
||||||
MCFG_VIDEO_START_OVERRIDE(deco_mlc_state,mlc)
|
MCFG_VIDEO_START_OVERRIDE(deco_mlc_state,mlc)
|
||||||
|
|
||||||
@ -427,6 +428,7 @@ static MACHINE_CONFIG_START( mlc, deco_mlc_state )
|
|||||||
|
|
||||||
MCFG_GFXDECODE(deco_mlc)
|
MCFG_GFXDECODE(deco_mlc)
|
||||||
MCFG_PALETTE_LENGTH(2048)
|
MCFG_PALETTE_LENGTH(2048)
|
||||||
|
// MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
|
||||||
|
|
||||||
MCFG_VIDEO_START_OVERRIDE(deco_mlc_state,mlc)
|
MCFG_VIDEO_START_OVERRIDE(deco_mlc_state,mlc)
|
||||||
|
|
||||||
|
@ -40,6 +40,6 @@ public:
|
|||||||
void screen_eof_mlc(screen_device &screen, bool state);
|
void screen_eof_mlc(screen_device &screen, bool state);
|
||||||
TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
|
TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
|
||||||
void blitRaster(bitmap_rgb32 &bitmap, int rasterMode);
|
void blitRaster(bitmap_rgb32 &bitmap, int rasterMode);
|
||||||
void draw_sprites( bitmap_rgb32 &bitmap,const rectangle &cliprect);
|
void draw_sprites( bitmap_rgb32 &bitmap,const rectangle &cliprect, int scanline);
|
||||||
void descramble_sound( );
|
void descramble_sound( );
|
||||||
};
|
};
|
||||||
|
@ -158,7 +158,7 @@ static void mlc_drawgfxzoomline(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void deco_mlc_state::draw_sprites( bitmap_rgb32 &bitmap,const rectangle &cliprect)
|
void deco_mlc_state::draw_sprites( bitmap_rgb32 &bitmap,const rectangle &cliprect, int scanline)
|
||||||
{
|
{
|
||||||
UINT32 *index_ptr=0;
|
UINT32 *index_ptr=0;
|
||||||
int offs,fx=0,fy=0,x,y,color,colorOffset,sprite,indx,h,w,bx,by,fx1,fy1;
|
int offs,fx=0,fy=0,x,y,color,colorOffset,sprite,indx,h,w,bx,by,fx1,fy1;
|
||||||
@ -368,127 +368,121 @@ void deco_mlc_state::draw_sprites( bitmap_rgb32 &bitmap,const rectangle &cliprec
|
|||||||
if (!ratio)
|
if (!ratio)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (int bby=0; bby<full_sprite_screen_height>>16; bby++)
|
int bby = scanline - (full_realybase>>16);
|
||||||
|
|
||||||
|
if (bby < 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (bby >= full_sprite_screen_height>>16)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int srcline = ((bby<<16) / ratio);
|
||||||
|
|
||||||
|
by = srcline >> 4;
|
||||||
|
|
||||||
|
int y = (full_realybase>>16)+bby;
|
||||||
|
|
||||||
|
rectangle myclip;
|
||||||
|
myclip = user_clip;
|
||||||
|
myclip &= bitmap.cliprect();
|
||||||
|
|
||||||
|
if( y < myclip.min_y )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if( y > myclip.max_y+1 )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
UINT32 *dest = &bitmap.pix32(y);
|
||||||
|
|
||||||
|
srcline &=0xf;
|
||||||
|
if( fy )
|
||||||
{
|
{
|
||||||
int srcline = ((bby<<16) / ratio);
|
srcline = 15 - srcline;
|
||||||
|
}
|
||||||
|
|
||||||
by = srcline >> 4;
|
|
||||||
|
|
||||||
int y = (full_realybase>>16)+bby;
|
for (bx=0; bx<w; bx++) {
|
||||||
|
|
||||||
rectangle myclip;
|
int realxbase = xbase + bx * xinc;
|
||||||
myclip = user_clip;
|
int count = 0;
|
||||||
myclip &= bitmap.cliprect();
|
if (fx)
|
||||||
|
|
||||||
if( y < myclip.min_y )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if( y > myclip.max_y+1 )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
UINT32 *dest = &bitmap.pix32(y);
|
|
||||||
|
|
||||||
srcline &=0xf;
|
|
||||||
if( fy )
|
|
||||||
{
|
{
|
||||||
srcline = 15 - srcline;
|
if (fy)
|
||||||
|
count = (h-1-by) * w + (w-1-bx);
|
||||||
|
else
|
||||||
|
count = by * w + (w-1-bx);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (fy)
|
||||||
|
count = (h-1-by) * w + bx;
|
||||||
|
else
|
||||||
|
count = by * w + bx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int tile=sprite + count;
|
||||||
|
int tile2=sprite2 + count;
|
||||||
|
|
||||||
for (bx=0; bx<w; bx++) {
|
if (blockIsTilemapIndex) {
|
||||||
|
if (useIndicesInRom)
|
||||||
int realxbase = xbase + bx * xinc;
|
|
||||||
int count = 0;
|
|
||||||
if (fx)
|
|
||||||
{
|
{
|
||||||
if (fy)
|
const UINT8* ptr=rawrom+(tile*2);
|
||||||
count = (h-1-by) * w + (w-1-bx);
|
tile=(*ptr) + ((*(ptr+1))<<8);
|
||||||
|
|
||||||
|
if (use8bppMode) {
|
||||||
|
const UINT8* ptr2=rawrom+(tile2*2);
|
||||||
|
tile2=(*ptr2) + ((*(ptr2+1))<<8);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
count = by * w + (w-1-bx);
|
{
|
||||||
|
tile2=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tileFormat)
|
||||||
|
{
|
||||||
|
colorOffset=(tile&0xf000)>>12;
|
||||||
|
tile=(tile&0x0fff)|hibits;
|
||||||
|
tile2=(tile2&0x0fff)|hibits;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colorOffset=0;
|
||||||
|
tile=(tile&0xffff)|(hibits<<2);
|
||||||
|
tile2=(tile2&0xffff)|(hibits<<2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (fy)
|
const UINT32* ptr=m_mlc_vram + ((tile)&0x7fff);
|
||||||
count = (h-1-by) * w + bx;
|
tile=(*ptr)&0xffff;
|
||||||
else
|
|
||||||
count = by * w + bx;
|
|
||||||
}
|
|
||||||
|
|
||||||
int tile=sprite + count;
|
if (tileFormat)
|
||||||
int tile2=sprite2 + count;
|
|
||||||
|
|
||||||
if (blockIsTilemapIndex) {
|
|
||||||
if (useIndicesInRom)
|
|
||||||
{
|
{
|
||||||
const UINT8* ptr=rawrom+(tile*2);
|
colorOffset=(tile&0xf000)>>12;
|
||||||
tile=(*ptr) + ((*(ptr+1))<<8);
|
tile=(tile&0x0fff)|hibits;
|
||||||
|
|
||||||
if (use8bppMode) {
|
|
||||||
const UINT8* ptr2=rawrom+(tile2*2);
|
|
||||||
tile2=(*ptr2) + ((*(ptr2+1))<<8);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tile2=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tileFormat)
|
|
||||||
{
|
|
||||||
colorOffset=(tile&0xf000)>>12;
|
|
||||||
tile=(tile&0x0fff)|hibits;
|
|
||||||
tile2=(tile2&0x0fff)|hibits;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
colorOffset=0;
|
|
||||||
tile=(tile&0xffff)|(hibits<<2);
|
|
||||||
tile2=(tile2&0xffff)|(hibits<<2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const UINT32* ptr=m_mlc_vram + ((tile)&0x7fff);
|
colorOffset=0;
|
||||||
tile=(*ptr)&0xffff;
|
tile=(tile&0xffff)|(hibits<<2);
|
||||||
|
|
||||||
if (tileFormat)
|
|
||||||
{
|
|
||||||
colorOffset=(tile&0xf000)>>12;
|
|
||||||
tile=(tile&0x0fff)|hibits;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
colorOffset=0;
|
|
||||||
tile=(tile&0xffff)|(hibits<<2);
|
|
||||||
}
|
|
||||||
|
|
||||||
tile2=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tile2=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mlc_drawgfxzoomline(
|
|
||||||
dest,user_clip,machine().gfx[0],
|
|
||||||
tile,tile2,
|
|
||||||
color + colorOffset,fx,realxbase,
|
|
||||||
0,
|
|
||||||
use8bppMode,(xscale<<8),alpha, srcline);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mlc_drawgfxzoomline(
|
||||||
|
dest,user_clip,machine().gfx[0],
|
||||||
|
tile,tile2,
|
||||||
|
color + colorOffset,fx,realxbase,
|
||||||
|
0,
|
||||||
|
use8bppMode,(xscale<<8),alpha, srcline);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (lastRasterMode!=0 && rasterDirty)
|
|
||||||
// {
|
|
||||||
// blitRaster(machine, bitmap, rasterMode);
|
|
||||||
// temp_bitmap->fill(0, cliprect);
|
|
||||||
// rasterDirty=0;
|
|
||||||
// }
|
|
||||||
// lastRasterMode=rasterMode;
|
|
||||||
|
|
||||||
if (use8bppMode)
|
if (use8bppMode)
|
||||||
offs-=8;
|
offs-=8;
|
||||||
}
|
}
|
||||||
@ -512,6 +506,10 @@ UINT32 deco_mlc_state::screen_update_mlc(screen_device &screen, bitmap_rgb32 &bi
|
|||||||
{
|
{
|
||||||
// temp_bitmap->fill(0, cliprect);
|
// temp_bitmap->fill(0, cliprect);
|
||||||
bitmap.fill(machine().pens[0], cliprect); /* Pen 0 fill colour confirmed from Skull Fang level 2 */
|
bitmap.fill(machine().pens[0], cliprect); /* Pen 0 fill colour confirmed from Skull Fang level 2 */
|
||||||
draw_sprites(bitmap,cliprect);
|
|
||||||
|
for (int i=0;i<256;i++)
|
||||||
|
{
|
||||||
|
draw_sprites(bitmap,cliprect, i);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user