Small chihiro correction (nw)

Chihiro needs the "xbox waitvblank" debugger command to progress.
This commit is contained in:
yz70s 2015-10-07 00:36:03 +02:00
parent 28919d81a6
commit a0f6b5e59a
2 changed files with 21 additions and 16 deletions

View File

@ -662,9 +662,13 @@ public:
};
enum NV2A_COLOR_FORMAT {
NV2A_COLOR_FORMAT_X1R5G6B5 = 0x0002,
NV2A_COLOR_FORMAT_R5G6B5 = 0x0003,
NV2A_COLOR_FORMAT_UNKNOWN4 = 0x0004,
NV2A_COLOR_FORMAT_X8R8G8B8 = 0x0005,
NV2A_COLOR_FORMAT_X1A7R8G8B8 = 0x0007,
NV2A_COLOR_FORMAT_A8R8G8B8 = 0x0008,
NV2A_COLOR_FORMAT_B8 = 0x0009
NV2A_COLOR_FORMAT_B8 = 0x0009,
NV2A_COLOR_FORMAT_G8B8 = 0x000a,
};
};

View File

@ -1261,6 +1261,7 @@ inline UINT8 *nv2a_renderer::read_pixel(int x, int y, UINT32 c[4])
c[1] = pal6bit((color & 0x07e0) >> 5);
c[0] = pal5bit(color & 0x1f);
return (UINT8 *)addr16;
case NV2A_COLOR_FORMAT_UNKNOWN4:
case NV2A_COLOR_FORMAT_X8R8G8B8:
addr = (UINT32 *)((UINT8 *)rendertarget + offset);
color = *addr;
@ -1861,6 +1862,7 @@ void nv2a_renderer::write_pixel(int x, int y, UINT32 color, UINT32 depth)
w = ((w >> 8) & 0xf800) + ((w >> 5) & 0x7e0) + ((w >> 3) & 0x1f);
*((UINT16 *)addr) = (UINT16)w;
break;
case NV2A_COLOR_FORMAT_UNKNOWN4:
case NV2A_COLOR_FORMAT_X8R8G8B8:
*((UINT32 *)addr) = w;
break;
@ -2451,8 +2453,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
read_vertices_0x1810(space, vert, n + offset, 4);
convert_vertices_poly(vert, xy, 4);
render_polygon<4>(limits_rendertarget, renderspans, 4 + 4 * 2, xy); // 4 rgba, 4 texture units 2 uv
wait();
}
wait();
}
else if (type == nv2a_renderer::TRIANGLE_FAN) {
vertex_nv vert[3];
@ -2466,8 +2468,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
read_vertices_0x1810(space, vert + (((n + 1) & 1) + 1), offset + n, 1);
convert_vertices_poly(vert + (((n + 1) & 1) + 1), xy + (((n + 1) & 1) + 1), 1);
render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[0], xy[(~(n + 1) & 1) + 1], xy[((n + 1) & 1) + 1]);
wait();
}
wait();
}
else if (type == nv2a_renderer::TRIANGLE_STRIP) {
vertex_nv vert[4];
@ -2481,8 +2483,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
read_vertices_0x1810(space, vert + ((n + 2) & 3), offset + n, 1);
convert_vertices_poly(vert + ((n + 2) & 3), xy + ((n + 2) & 3), 1);
render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[((n & 1) + n) & 3], xy[((~n & 1) + n) & 3], xy[(2 + n) & 3]);
wait();
}
wait();
}
else {
logerror("Unsupported primitive %d for method 0x1810\n", type);
@ -2526,8 +2528,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
countlen = countlen - c;
convert_vertices_poly(vert, xy, 4);
render_polygon<4>(limits_rendertarget, renderspans, 4 + 4 * 2, xy); // 4 rgba, 4 texture units 2 uv
wait();
}
wait();
}
else if (type == nv2a_renderer::TRIANGLE_FAN) {
if ((countlen * mult + indexesleft_count) >= 3) {
@ -2553,8 +2555,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
address = address + c * 4;
countlen = countlen - c;
render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[0], xy[(~n & 1) + 1], xy[(n & 1) + 1]);
wait();
}
wait();
}
}
else if (type == nv2a_renderer::TRIANGLES) {
@ -2573,8 +2575,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
countlen = countlen - c;
convert_vertices_poly(vert, xy, 3);
render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[0], xy[1], xy[2]); // 4 rgba, 4 texture units 2 uv
wait();
}
wait();
}
else if (type == nv2a_renderer::TRIANGLE_STRIP) {
if ((countlen * mult + indexesleft_count) >= 3) {
@ -2601,8 +2603,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
if (xy[(n + 2) & 3].y > 293800000.0f)
xy[(n + 2) & 3].y = xy[(n + 2) & 3].y + 1.0f;
render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[((n & 1) + n) & 3], xy[((~n & 1) + n) & 3], xy[(2 + n) & 3]);
wait();
}
wait();
}
}
else {
@ -2670,8 +2672,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
address = address + c * 4;
convert_vertices_poly(vert + ((n & 1) + 1), xy + ((n & 1) + 1), 1);
render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[0], xy[(~n & 1) + 1], xy[(n & 1) + 1]);
wait();
}
wait();
}
else if (type == nv2a_renderer::TRIANGLES) {
while (countlen > 0) {
@ -2689,8 +2691,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
}
address = address + c * 3;
render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[0], xy[1], xy[2]); // 4 rgba, 4 texture units 2 uv
wait();
}
wait();
}
else if (type == nv2a_renderer::TRIANGLE_STRIP) {
vertex_nv vert[4];
@ -2717,8 +2719,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
}
address = address + c * 4;
render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[((n & 1) + n) & 3], xy[((~n & 1) + n) & 3], xy[(2 + n) & 3]);
wait();
}
wait();
}
else if (type == nv2a_renderer::QUADS) {
while (countlen > 0) {
@ -2736,8 +2738,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
}
address = address + c * 4;
render_polygon<4>(limits_rendertarget, renderspans, 4 + 4 * 2, xy); // 4 rgba, 4 texture units 2 uv
wait();
}
wait();
}
else if (type == nv2a_renderer::QUAD_STRIP) {
vertex_nv vert[4];
@ -2765,8 +2767,8 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
address = address + c * 4;
render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[n & 3], xy[(n + 1) & 3], xy[(n + 2) & 3]);
render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[(n + 2) & 3], xy[(n + 1) & 3], xy[(n + 3) & 3]);
wait();
}
wait();
}
else {
logerror("Unsupported primitive %d for method 0x1818\n", type);
@ -2909,6 +2911,7 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
case NV2A_COLOR_FORMAT_R5G6B5:
bytespixel_rendertarget = 2;
break;
case NV2A_COLOR_FORMAT_UNKNOWN4:
case NV2A_COLOR_FORMAT_X8R8G8B8:
case NV2A_COLOR_FORMAT_A8R8G8B8:
bytespixel_rendertarget = 4;
@ -2917,9 +2920,7 @@ int nv2a_renderer::geforce_exec_method(address_space & space, UINT32 chanel, UIN
bytespixel_rendertarget = 1;
break;
default:
#ifdef LOG_NV2A
printf("Unknown render target color format %d\n\r", colorformat_rendertarget);
#endif
logerror("Unknown render target color format %d\n\r", colorformat_rendertarget);
bytespixel_rendertarget = 4;
break;
}