mirror of
https://github.com/holub/mame
synced 2025-05-25 23:35:26 +03:00
03509: galpans2, galpans3, panicstr: Input test screen shows zoomed in text [David Haywood]
Improved Super Nova sprite shrinking, used by Gals Panic S2 and Sengeki Striker [David Haywood] Date: Thu, 05 Nov 2009 13:13:25 +0000 From: David Haywood <neohaze@nildram.co.uk> CC: Philip Bennett <p.j.bennett@gmail.com> Subject: Re: fix for mantis 3509 (skns) Just noticed that I left a debug line in which turned off column scroll, gals panic 4 wasn't very happy about that ;-) use this instead ----- David Haywood wrote: This patch replaces the previous one and also fixes mantis 3498 With both these fixes Sengeki Striker looks much, much better than it did in 135 ;-) ----- David Haywood wrote: http://mametesters.org/view.php?id=3509 I'm not 100% convinced by this, but it at least fixes the text problem, and the enemies look much better in sengekis when you shoot them down. This only affects the games where the special 'srhink' flag is set. There are still general precision issues with the normal sprite placement / zooming in the emulation tho, the Jackie Chan games make it very obvious
This commit is contained in:
parent
53e3bcec1f
commit
2c77136719
@ -348,10 +348,10 @@ void skns_sprite_kludge(int x, int y)
|
||||
/* We are working in .6 fixed point if you hadn't guessed */
|
||||
|
||||
#define z_decls(step) \
|
||||
UINT16 zxs = 0x40-(zx>>10); \
|
||||
UINT16 zxd = 0x40-((zx>>2) & 0x3f); \
|
||||
UINT16 zys = 0x40-(zy>>10); \
|
||||
UINT16 zyd = 0x40-((zy>>2) & 0x3f); \
|
||||
UINT16 zxs = 0x40-(zx_m>>2); \
|
||||
UINT16 zxd = 0x40-(zx_s>>2); \
|
||||
UINT16 zys = 0x40-(zy_m>>2); \
|
||||
UINT16 zyd = 0x40-(zy_s>>2); \
|
||||
int xs, ys, xd, yd, old, old2; \
|
||||
int step_spr = step; \
|
||||
int bxs = 0, bys = 0; \
|
||||
@ -443,7 +443,7 @@ void skns_sprite_kludge(int x, int y)
|
||||
old2 += 0x40; \
|
||||
}
|
||||
|
||||
static void blit_nf_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx, UINT16 zy, int colour)
|
||||
static void blit_nf_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
|
||||
{
|
||||
z_decls(sx);
|
||||
z_clamp_x_min();
|
||||
@ -457,7 +457,7 @@ static void blit_nf_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *
|
||||
}
|
||||
}
|
||||
|
||||
static void blit_fy_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx, UINT16 zy, int colour)
|
||||
static void blit_fy_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
|
||||
{
|
||||
z_decls(sx);
|
||||
z_clamp_x_min();
|
||||
@ -471,7 +471,7 @@ static void blit_fy_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *
|
||||
}
|
||||
}
|
||||
|
||||
static void blit_fx_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx, UINT16 zy, int colour)
|
||||
static void blit_fx_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
|
||||
{
|
||||
z_decls(sx);
|
||||
z_clamp_x_max();
|
||||
@ -485,7 +485,7 @@ static void blit_fx_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *
|
||||
}
|
||||
}
|
||||
|
||||
static void blit_fxy_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx, UINT16 zy, int colour)
|
||||
static void blit_fxy_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
|
||||
{
|
||||
z_decls(sx);
|
||||
z_clamp_x_max();
|
||||
@ -499,7 +499,7 @@ static void blit_fxy_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8
|
||||
}
|
||||
}
|
||||
|
||||
static void (*const blit_z[4])(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx, UINT16 zy, int colour) = {
|
||||
static void (*const blit_z[4])(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour) = {
|
||||
blit_nf_z,
|
||||
blit_fy_z,
|
||||
blit_fx_z,
|
||||
@ -560,7 +560,7 @@ void skns_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectang
|
||||
int sx,sy;
|
||||
int endromoffs=0, gfxlen;
|
||||
int grow;
|
||||
UINT16 zoomx, zoomy;
|
||||
UINT16 zoomx_m, zoomx_s, zoomy_m, zoomy_s;
|
||||
|
||||
|
||||
if ((!disabled) && suprnova_alt_enable_sprites){
|
||||
@ -700,15 +700,25 @@ void skns_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectang
|
||||
|
||||
if (!grow)
|
||||
{
|
||||
zoomx = (source[2] >> 16)&0xfcfc;
|
||||
zoomy = (source[3] >> 16)&0xfcfc;
|
||||
zoomx_m = (source[2] >> 24)&0x00fc;
|
||||
zoomx_s = (source[2] >> 16)&0x00fc;
|
||||
zoomy_m = (source[3] >> 24)&0x00fc;
|
||||
zoomy_s = (source[3] >> 16)&0x00fc;
|
||||
}
|
||||
else
|
||||
{
|
||||
// the bad sprites in sengekis all have this not set..
|
||||
// we need to handle sprite shrink properly
|
||||
zoomx = 0;
|
||||
zoomy = 0;
|
||||
// sengekis uses this on sprites which are shrinking as they head towards the ground
|
||||
// it's also used on the input test of Gals Panic S2
|
||||
//
|
||||
// it appears to offer a higher precision 'shrink' mode (although I'm not entirely
|
||||
// convinced this implementation is correct because we simply end up ignoring
|
||||
// part of the data)
|
||||
zoomx_m = 0;
|
||||
zoomx_s = (source[2] >> 24)&0x00fc;
|
||||
zoomy_m = 0;
|
||||
zoomy_s = (source[3] >> 24)&0x00fc;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -732,9 +742,9 @@ void skns_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectang
|
||||
{
|
||||
int NewColour = (colour<<8) | (pri << 14);
|
||||
|
||||
if(zoomx || zoomy)
|
||||
if(zoomx_m || zoomx_s || zoomy_m || zoomy_s)
|
||||
{
|
||||
blit_z[ (xflip<<1) | yflip ](bitmap, cliprect, decodebuffer, sx, sy, xsize, ysize, zoomx, zoomy, NewColour);
|
||||
blit_z[ (xflip<<1) | yflip ](bitmap, cliprect, decodebuffer, sx, sy, xsize, ysize, zoomx_m, zoomx_s, zoomy_m, zoomy_s, NewColour);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -952,11 +962,13 @@ static void supernova_draw_a( bitmap_t *bitmap, bitmap_t* bitmap_flags, const re
|
||||
if (enable_a && suprnova_alt_enable_background)
|
||||
{
|
||||
startx = skns_v3_regs[0x1c/4];
|
||||
incyy = skns_v3_regs[0x30/4]; // was xx, changed for sarukani
|
||||
incyy = skns_v3_regs[0x30/4]&0x7ffff;
|
||||
if (incyy&0x40000) incyy = incyy-0x80000; // level 3 boss in sengekis
|
||||
incyx = skns_v3_regs[0x2c/4];
|
||||
starty = skns_v3_regs[0x20/4];
|
||||
incxy = skns_v3_regs[0x28/4];
|
||||
incxx = skns_v3_regs[0x24/4]; // was yy, changed for sarukani
|
||||
incxx = skns_v3_regs[0x24/4]&0x7ffff;
|
||||
if (incxx&0x40000) incxx = incxx-0x80000;
|
||||
|
||||
columnscroll = (skns_v3_regs[0x0c/4] >> 1) & 0x0001;
|
||||
|
||||
@ -980,13 +992,18 @@ static void supernova_draw_b( bitmap_t *bitmap, bitmap_t* bitmap_flags, const re
|
||||
if (enable_b && suprnova_alt_enable_background)
|
||||
{
|
||||
startx = skns_v3_regs[0x40/4];
|
||||
incyy = skns_v3_regs[0x54/4];
|
||||
incyy = skns_v3_regs[0x54/4]&0x7ffff;
|
||||
if (incyy&0x40000) incyy = incyy-0x80000;
|
||||
incyx = skns_v3_regs[0x50/4];
|
||||
starty = skns_v3_regs[0x44/4];
|
||||
incxy = skns_v3_regs[0x4c/4];
|
||||
incxx = skns_v3_regs[0x48/4];
|
||||
incxx = skns_v3_regs[0x48/4]&0x7ffff;
|
||||
if (incxx&0x40000) incxx = incxx-0x80000;
|
||||
columnscroll = (skns_v3_regs[0x0c/4] >> 9) & 0x0001; // selects column scroll or rowscroll
|
||||
suprnova_draw_roz(bitmap,bitmap_flags, cliprect, skns_tilemap_B, startx << 8,starty << 8, incxx << 8,incxy << 8,incyx << 8,incyy << 8, !nowrap_b, columnscroll, &skns_v3slc_ram[0x1000/4]);
|
||||
|
||||
//popmessage("%08x %08x %08x %08x %08x %08x", startx, starty, incxx, incyy, incxy, incyx);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user