summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Pierpaolo Prazzoli <pierpaol@mamedev.org>2008-05-02 17:25:39 +0000
committer Pierpaolo Prazzoli <pierpaol@mamedev.org>2008-05-02 17:25:39 +0000
commite6b2a18ba70a85efbd49a268d23cfa71bc8308af (patch)
treeb128443c408b1b1035049f60d9140c047f6ac401 /src
parent6afeb5015ab93983c054a0b22f4e09cccef1cf6c (diff)
Fixed ROZ centering in namcona1 driver [Phil Stroffolino]
Diffstat (limited to 'src')
-rw-r--r--src/mame/video/namcona1.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/mame/video/namcona1.c b/src/mame/video/namcona1.c
index 8e26702ab5e..d5d647ddb48 100644
--- a/src/mame/video/namcona1.c
+++ b/src/mame/video/namcona1.c
@@ -4,7 +4,6 @@
TODO:
- dynamic screen resolution
- bg pen (or the pen of the lower tilemap?)
-- roz centering
- sprites, that have the shadow bit set but aren't shadows, have bad colors
- check if the data&0x8000 condition in tilemaps is valid even when 4bpp mode it's used
- namco logo in emeralda demo is missing (it's used with a roz effect)
@@ -596,23 +595,20 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
// used in emeraldia
if(which == 1 && namcona1_vreg[0x8a/2] == 0xfd /* maybe reg & 0x4 */)
{
- INT32 incxx = ((INT16)namcona1_vreg[0xc0/2])<<8; //or incyy ?
- INT32 incxy = ((INT16)namcona1_vreg[0xc2/2])<<8;
- INT32 incyx = ((INT16)namcona1_vreg[0xc4/2])<<8;
- INT32 incyy = ((INT16)namcona1_vreg[0xc6/2])<<8; //or incxx ?
- UINT32 startx = (INT32)(INT16)namcona1_vreg[0xc8/2]<<12;
- UINT32 starty = (INT32)(INT16)namcona1_vreg[0xca/2]<<12;
- //namcona1_vreg[0xcc/2]; // changes dx/dy ?
-
- // all ROZ parameters now in 16.16 format
+ int incxx = ((INT16)namcona1_vreg[0xc0/2])<<8; // or incyy ?
+ int incxy = ((INT16)namcona1_vreg[0xc2/2])<<8;
+ int incyx = ((INT16)namcona1_vreg[0xc4/2])<<8;
+ int incyy = ((INT16)namcona1_vreg[0xc6/2])<<8; // or incxx ?
+ INT16 xoffset = namcona1_vreg[0xc8/2];
+ INT16 yoffset = namcona1_vreg[0xca/2];
+ int dx = 46;
+ int dy = -8;
// now, apply adjustments to startx, starty to translate the
// ROZ plane. Note that these are corrected by the inc parameters
// to account for scale/rotate state.
- int dx = 46; // horizontal adjust in pixels
- int dy = -8; // vertical adjust in pixels
- startx += dx*incxx + dy*incyx;
- starty += dx*incyx + dy*incyy;
+ UINT32 startx = (xoffset<<12)+incxx*dx+incyx*dy;
+ UINT32 starty = (yoffset<<12)+incxy*dx+incyy*dy;
tilemap_draw_roz_primask(bitmap, &clip, bg_tilemap[which],
startx, starty, incxx, incxy, incyx, incyy,