summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author yz70s <yz70s@users.noreply.github.com>2015-05-12 22:37:47 +0200
committer yz70s <yz70s@users.noreply.github.com>2015-05-12 22:47:07 +0200
commitb9e3ff70fa6dd56b4ad8906d5daab37a9f9189d5 (patch)
tree584d445353d8b2aef265dbbceddb6deb32095917 /src/mame
parentc9a40fdda5de178a1afe8fadb5c65080387e8300 (diff)
chihiro.c: add support for swizzled render targets (nw)
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/includes/chihiro.h18
-rw-r--r--src/mame/video/chihiro.c20
2 files changed, 22 insertions, 16 deletions
diff --git a/src/mame/includes/chihiro.h b/src/mame/includes/chihiro.h
index 896b7985f0a..685bb48d6d2 100644
--- a/src/mame/includes/chihiro.h
+++ b/src/mame/includes/chihiro.h
@@ -217,12 +217,13 @@ public:
limits_rendertarget.set(0, 0, 640, 480);
pitch_rendertarget = 0;
pitch_depthbuffer = 0;
- height_rendertarget=0;
- width_rendertarget=0;
- antialiasing_rendertarget=0;
- type_rendertarget=nv2a_renderer::LINEAR;
- depth_rendertarget=nv2a_renderer::NV2A_RT_DEPTH_FORMAT_Z24S8;
- color_rendertarget=nv2a_renderer::NV2A_COLOR_FORMAT_A8R8G8B8;
+ log2height_rendertarget = 0;
+ log2width_rendertarget = 0;
+ dilate_rendertarget = 0;
+ antialiasing_rendertarget = 0;
+ type_rendertarget = nv2a_renderer::LINEAR;
+ depth_rendertarget = nv2a_renderer::NV2A_RT_DEPTH_FORMAT_Z24S8;
+ color_rendertarget = nv2a_renderer::NV2A_COLOR_FORMAT_A8R8G8B8;
rendertarget = NULL;
depthbuffer = NULL;
displayedtarget = NULL;
@@ -309,8 +310,9 @@ public:
rectangle limits_rendertarget;
UINT32 pitch_rendertarget;
UINT32 pitch_depthbuffer;
- int height_rendertarget;
- int width_rendertarget;
+ int log2height_rendertarget;
+ int log2width_rendertarget;
+ int dilate_rendertarget;
int antialiasing_rendertarget;
int type_rendertarget;
int depth_rendertarget;
diff --git a/src/mame/video/chihiro.c b/src/mame/video/chihiro.c
index ac74dc2ac24..d38bfb94596 100644
--- a/src/mame/video/chihiro.c
+++ b/src/mame/video/chihiro.c
@@ -1236,7 +1236,10 @@ void nv2a_renderer::write_pixel(int x, int y, UINT32 color, UINT32 depth)
bool stencil_passed;
bool depth_passed;
- addr=rendertarget + (pitch_rendertarget / 4)*y + x;
+ if (type_rendertarget == SWIZZLED)
+ addr = rendertarget + (dilated0[dilate_rendertarget][x] + dilated1[dilate_rendertarget][y]);
+ else // type_rendertarget == LINEAR*/
+ addr = rendertarget + (pitch_rendertarget / 4)*y + x;
fbcolor = *addr;
daddr=depthbuffer + (pitch_depthbuffer / 4)*y + x;
deptsten = *daddr;
@@ -2593,7 +2596,7 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
int m;
m = channel[chanel][subchannel].object.method[0x1d7c / 4];
- if (channel[chanel][subchannel].object.method[0x0208 / 4] & 0x2000)
+ if (antialiasing_rendertarget != 0)
m = 2;
else
m = 1;
@@ -2631,12 +2634,13 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
limits_rendertarget.sety(y,y+h-1);
}
if (maddress == 0x0208) {
- height_rendertarget=(data >> 24) & 255;
- width_rendertarget=(data >> 16) & 255;
- antialiasing_rendertarget=(data >> 12) & 15;
- type_rendertarget=(data >> 8) & 15;
- depth_rendertarget=(data >> 4) & 15;
- color_rendertarget=(data >> 0) & 15;
+ log2height_rendertarget = (data >> 24) & 255;
+ log2width_rendertarget = (data >> 16) & 255;
+ antialiasing_rendertarget = (data >> 12) & 15;
+ type_rendertarget = (data >> 8) & 15;
+ depth_rendertarget = (data >> 4) & 15;
+ color_rendertarget = (data >> 0) & 15;;
+ dilate_rendertarget = dilatechose[(log2width_rendertarget << 4) + log2height_rendertarget];
}
if (maddress == 0x020c) {
// line size ?