deco_mlc - some improvement to stadhr96

This commit is contained in:
David Haywood 2013-03-17 22:23:05 +00:00
parent 6b3bb0f0f9
commit 1046e109e0
3 changed files with 59 additions and 22 deletions

View File

@ -206,6 +206,7 @@ READ32_MEMBER(deco_mlc_state::mlc_vram_r)
return m_mlc_vram[offset]&0xffff;
}
// there is more to this, it controls the runner on the attract screen before the title should appear at least
READ32_MEMBER(deco_mlc_state::stadhr96_prot_146_r)
{
/*
@ -217,7 +218,6 @@ READ32_MEMBER(deco_mlc_state::stadhr96_prot_146_r)
*/
offset<<=1;
logerror("%08x: Read prot %04x\n", space.device().safe_pc(), offset);
if (offset==0x5c4)
return 0xaa55 << 16;
@ -228,9 +228,16 @@ READ32_MEMBER(deco_mlc_state::stadhr96_prot_146_r)
if (offset==0x304)
return 0x0001 << 16; // Unknown, is either 0,1,2,3
printf("%08x: Read prot %08x\n", space.device().safe_pc(), offset);
return 0;
}
WRITE32_MEMBER(deco_mlc_state::stadhr96_prot_146_w)
{
printf("%08x: Write prot %04x %08x\n", space.device().safe_pc(), offset, data);
}
/******************************************************************************/
static ADDRESS_MAP_START( decomlc_map, AS_PROGRAM, 32, deco_mlc_state )
@ -250,8 +257,7 @@ static ADDRESS_MAP_START( decomlc_map, AS_PROGRAM, 32, deco_mlc_state )
AM_RANGE(0x044001c, 0x044001f) AM_WRITENOP AM_MIRROR(0xff000000)
AM_RANGE(0x0500000, 0x0500003) AM_WRITE(avengrs_eprom_w) AM_MIRROR(0xff000000)
AM_RANGE(0x0600000, 0x0600007) AM_DEVREADWRITE8_LEGACY("ymz", ymz280b_r, ymz280b_w, 0xff000000) AM_MIRROR(0xff000000)
AM_RANGE(0x070f000, 0x070ffff) AM_READ(stadhr96_prot_146_r) AM_MIRROR(0xff000000)
// AM_RANGE(0x070f000, 0x070ffff) AM_READ_LEGACY(stadhr96_prot_146_w) AM_SHARE("prot32ram")
AM_RANGE(0x070f000, 0x070ffff) AM_READWRITE(stadhr96_prot_146_r, stadhr96_prot_146_w) AM_MIRROR(0xff000000)
ADDRESS_MAP_END
/******************************************************************************/

View File

@ -16,7 +16,9 @@ public:
required_shared_ptr<UINT32> m_mlc_vram;
timer_device *m_raster_irq_timer;
int m_mainCpuIsArm;
int m_mlc_raster_table[9][256];
UINT32 m_mlc_raster_table_1[4*256];
UINT32 m_mlc_raster_table_2[4*256];
UINT32 m_mlc_raster_table_3[4*256];
UINT32 m_vbl_i;
int m_lastScanline[9];
UINT32 m_colour_mask;
@ -30,6 +32,7 @@ public:
DECLARE_READ32_MEMBER(mlc_spriteram_r);
DECLARE_READ32_MEMBER(mlc_vram_r);
DECLARE_READ32_MEMBER(stadhr96_prot_146_r);
DECLARE_WRITE32_MEMBER(stadhr96_prot_146_w);
DECLARE_READ32_MEMBER(avengrgs_speedup_r);
DECLARE_WRITE32_MEMBER(avengrs_eprom_w);
DECLARE_DRIVER_INIT(mlc);

View File

@ -336,29 +336,57 @@ void deco_mlc_state::draw_sprites( const rectangle &cliprect, int scanline, UINT
if(fx1&1) fx^=0x8000;
if(fy1&1) fy^=0x4000;
int extra_x_scale = 0x100;
// I think we need some hardware tests..
// see notes about how this can't be our enable register (avengrgs doesn't touch it
// and relies on something else, probably just the bits we use to select the window)
// (although as previously noted, it isn't writing valid per-scanline values either)
if (rasterMode)
{
int irq_base_reg = 12 /* 6, 9, 12 */;
// use of these is a bit weird.
// -ZZZ -xxx ---- -yyy -XXX -zzz
int extra_y_off = m_irq_ram[irq_base_reg+0] & 0x7ff;
int extra_x_off = m_irq_ram[irq_base_reg+1] & 0x7ff;
int extra_y_scale = (m_irq_ram[irq_base_reg+2]>>16) & 0x7ff;
int extra_x_scale = (m_irq_ram[irq_base_reg+2]>>0) & 0x7ff;
// xxx = x offset?
// yyy = y offset?
// zzz = xzoom (confirmed? stadium hero)
// 0x100 = no zoom
//
// XXX = duplicate bits of xxx?
// ZZZ = (sometimes) duplicate bits of zzz
if (extra_x_off & 0x400) extra_x_off -= 0x800;
if (extra_y_off & 0x400) extra_y_off -= 0x800;
if ((clipper==0x0) || (clipper==0x2))
{
int irq_base_reg; /* 6, 9, 12 are possible */
if (clipper== 0) irq_base_reg = 6; // OK upper screen.. left?
else if (clipper== 2) irq_base_reg = 9; // OK upper screen.. main / center
else irq_base_reg = 12;
int extra_y_off = m_irq_ram[irq_base_reg+0] & 0x7ff;
int extra_x_off = m_irq_ram[irq_base_reg+1] & 0x7ff;
extra_x_scale = (m_irq_ram[irq_base_reg+2]>>0) & 0x3ff;
if (extra_x_off & 0x400) { extra_x_off = (-extra_x_off & 0x3ff); } else { extra_x_off = (extra_x_off & 0x3ff); }
if (extra_y_off & 0x400) { extra_x_off = (-extra_y_off & 0x3ff); } else { extra_y_off = (extra_y_off & 0x3ff); }
if (extra_y_scale & 0x400) extra_y_scale -= 0x800;
if (extra_x_scale & 0x400) extra_x_scale -= 0x800;
x += extra_x_off;
y += extra_y_off;
xscale += extra_x_scale;
yscale += extra_y_scale;
x += extra_x_off;
y += extra_y_off;
}
else if (clipper==0x1)
{
// right?
}
else if (clipper==0x3)
{
// bottom?
}
}
xscale *= extra_x_scale;
int ybase=y<<16;
int yinc=(yscale<<8)*16;
@ -368,12 +396,12 @@ void deco_mlc_state::draw_sprites( const rectangle &cliprect, int scanline, UINT
ybase-=yoffs * (yscale<<8);
int xbase=x<<16;
int xinc=(xscale<<8)*16;
int xinc=(xscale)*16;
if (fx)
xbase+=(xoffs-15) * (xscale<<8) - ((w-1)*xinc);
xbase+=(xoffs-15) * (xscale) - ((w-1)*xinc);
else
xbase-=xoffs * (xscale<<8);
xbase-=xoffs * (xscale);
int full_realybase = ybase;
@ -490,7 +518,7 @@ void deco_mlc_state::draw_sprites( const rectangle &cliprect, int scanline, UINT
tile,tile2,
color + colorOffset,fx,realxbase,
0,
use8bppMode,(xscale<<8),alpha, srcline);
use8bppMode,(xscale),alpha, srcline);
}