hlsl/yiq_decode.fx
| r11595 | r11596 | |
| 7 | 7 | sampler DiffuseSampler = sampler_state |
| 8 | 8 | { |
| 9 | 9 | Texture = <Diffuse>; |
| 10 | | MipFilter = LINEAR; |
| 11 | | MinFilter = LINEAR; |
| 12 | | MagFilter = LINEAR; |
| 10 | MipFilter = POINT; |
| 11 | MinFilter = POINT; |
| 12 | MagFilter = POINT; |
| 13 | 13 | AddressU = CLAMP; |
| 14 | 14 | AddressV = CLAMP; |
| 15 | 15 | AddressW = CLAMP; |
| r11595 | r11596 | |
| 70 | 70 | Output.Position = float4(Input.Position.xyz, 1.0f); |
| 71 | 71 | Output.Position.x /= TargetWidth; |
| 72 | 72 | Output.Position.y /= TargetHeight; |
| 73 | //Output.Position.x /= WidthRatio; |
| 74 | //Output.Position.y /= HeightRatio; |
| 73 | 75 | Output.Position.y = 1.0f - Output.Position.y; |
| 74 | 76 | Output.Position.x -= 0.5f; |
| 75 | 77 | Output.Position.y -= 0.5f; |
| 76 | 78 | Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f); |
| 77 | 79 | Output.Color = Input.Color; |
| 78 | | float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight); |
| 79 | | float2 Ratios = float2(WidthRatio, HeightRatio); |
| 80 | | float2 TexCoord = (Input.Position.xy * InvTexSize) / Ratios; |
| 81 | | Output.Coord0 = TexCoord + float2(0.0f / RawWidth, 0.0f); |
| 82 | | Output.Coord1 = TexCoord + float2(0.25f / RawWidth, 0.0f); |
| 83 | | Output.Coord2 = TexCoord + float2(0.5f / RawWidth, 0.0f); |
| 84 | | Output.Coord3 = TexCoord + float2(0.75f / RawWidth, 0.0f); |
| 85 | | Output.Coord4 = TexCoord + float2(1.0f / RawWidth, 0.0f); |
| 86 | | Output.Coord5 = TexCoord + float2(1.25f / RawWidth, 0.0f); |
| 80 | Output.Coord0 = Input.TexCoord + float2(0.00f / RawWidth, 0.0f); |
| 81 | Output.Coord1 = Input.TexCoord + float2(0.25f / RawWidth, 0.0f); |
| 82 | Output.Coord2 = Input.TexCoord + float2(0.50f / RawWidth, 0.0f); |
| 83 | Output.Coord3 = Input.TexCoord + float2(0.75f / RawWidth, 0.0f); |
| 84 | Output.Coord4 = Input.TexCoord + float2(1.00f / RawWidth, 0.0f); |
| 85 | Output.Coord5 = Input.TexCoord + float2(1.25f / RawWidth, 0.0f); |
| 87 | 86 | |
| 88 | 87 | return Output; |
| 89 | 88 | } |
| r11595 | r11596 | |
| 102 | 101 | |
| 103 | 102 | float4 ps_main(PS_INPUT Input) : COLOR |
| 104 | 103 | { |
| 104 | float2 RawDims = float2(RawWidth, RawHeight); |
| 105 | 105 | float4 OrigC = tex2D(DiffuseSampler, Input.Coord0.xy); |
| 106 | 106 | float4 OrigC2 = tex2D(DiffuseSampler, Input.Coord4.xy); |
| 107 | 107 | float4 C = OrigC; |
| r11595 | r11596 | |
| 116 | 116 | |
| 117 | 117 | float PI = 3.14159265f; |
| 118 | 118 | |
| 119 | | float2 InvRatios = float2(1.0f / WidthRatio, 1.0f / HeightRatio); |
| 120 | | float2 Scaler = float2(RawWidth, RawHeight) * InvRatios; |
| 119 | float2 Scaler = RawDims; |
| 121 | 120 | float2 Coord0 = Input.Coord0.xy * Scaler; |
| 122 | 121 | float2 Coord1 = Input.Coord1.xy * Scaler; |
| 123 | 122 | float2 Coord2 = Input.Coord2.xy * Scaler; |
| r11595 | r11596 | |
| 125 | 124 | float2 Coord4 = Input.Coord4.xy * Scaler; |
| 126 | 125 | float2 Coord5 = Input.Coord5.xy * Scaler; |
| 127 | 126 | |
| 128 | | float W = WValue * 2.0f; |
| 129 | | float YRatio = 0.5333f; |
| 127 | float W = WValue; |
| 128 | float YRatio = 1.0f; |
| 130 | 129 | float T0 = Coord0.x + AValue * YRatio * Coord0.y + BValue; |
| 131 | 130 | float T1 = Coord1.x + AValue * YRatio * Coord1.y + BValue; |
| 132 | 131 | float T2 = Coord2.x + AValue * YRatio * Coord2.y + BValue; |
| r11595 | r11596 | |
| 152 | 151 | |
| 153 | 152 | float3 OutRGB = float3(dot(YIQ, float3(1.0f, 0.9563f, 0.6210f)), dot(YIQ, float3(1.0f, -0.2721f, -0.6474f)), dot(YIQ, float3(1.0f, -1.1070f, 1.7046f))); |
| 154 | 153 | |
| 155 | | // Debugging: return sin(W * Tc) * 0.5f + 0.5f; |
| 156 | | // Debugging: return float4(0.5f + 0.5f * sin(W * float3(T0, T2, T4)), 1.0f); |
| 157 | 154 | return float4(OutRGB, 1.0f); |
| 158 | 155 | } |
| 159 | 156 | |
hlsl/yiq_encode.fx
| r11595 | r11596 | |
| 66 | 66 | Output.Position = float4(Input.Position.xyz, 1.0f); |
| 67 | 67 | Output.Position.x /= TargetWidth; |
| 68 | 68 | Output.Position.y /= TargetHeight; |
| 69 | | Output.Position.y /= HeightRatio; |
| 70 | 69 | Output.Position.y = 1.0f - Output.Position.y; |
| 71 | | Output.Position.x /= WidthRatio; |
| 72 | 70 | Output.Position.x -= 0.5f; |
| 73 | 71 | Output.Position.y -= 0.5f; |
| 74 | 72 | Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f); |
| 75 | 73 | Output.Color = Input.Color; |
| 76 | | float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight); |
| 77 | 74 | Output.Coord0 = Input.TexCoord + float2(0.00f / RawWidth, 0.0f); |
| 78 | 75 | Output.Coord1 = Input.TexCoord + float2(0.25f / RawWidth, 0.0f); |
| 79 | 76 | Output.Coord2 = Input.TexCoord + float2(0.50f / RawWidth, 0.0f); |
| 80 | 77 | Output.Coord3 = Input.TexCoord + float2(0.75f / RawWidth, 0.0f); |
| 81 | | |
| 78 | |
| 82 | 79 | return Output; |
| 83 | 80 | } |
| 84 | 81 | |
| r11595 | r11596 | |
| 96 | 93 | |
| 97 | 94 | float4 ps_main(PS_INPUT Input) : COLOR |
| 98 | 95 | { |
| 99 | | float3 Texel0 = tex2D(DiffuseSampler, Input.Coord0).rgb; |
| 100 | | float3 Texel1 = tex2D(DiffuseSampler, Input.Coord1).rgb; |
| 101 | | float3 Texel2 = tex2D(DiffuseSampler, Input.Coord2).rgb; |
| 102 | | float3 Texel3 = tex2D(DiffuseSampler, Input.Coord3).rgb; |
| 96 | float2 InvRatios = float2(1.0f / WidthRatio, 1.0f / HeightRatio); |
| 97 | float2 Offset = float2(0.5f / RawWidth, 0.5f / RawHeight); |
| 98 | float3 Texel0 = tex2D(DiffuseSampler, Input.Coord0 - Offset).rgb; |
| 99 | float3 Texel1 = tex2D(DiffuseSampler, Input.Coord1 - Offset).rgb; |
| 100 | float3 Texel2 = tex2D(DiffuseSampler, Input.Coord2 - Offset).rgb; |
| 101 | float3 Texel3 = tex2D(DiffuseSampler, Input.Coord3 - Offset).rgb; |
| 103 | 102 | |
| 104 | | // Cos goes from 1 to 0 to 1 over the course of 2PI |
| 105 | | // Sin goes from 0 to 1 to 0 over the course of 2PI |
| 106 | | // WValue is 4PI / 3 |
| 107 | | // That is, 3 cycles through WValue will reuslt in 4PI being traversed, or cos() to go from 1 to 0 to 1 to 0 to 1 |
| 108 | | // WValue appears to be the chroma carrier rate |
| 109 | | // 1 Pixel -> 1 cycle |
| 110 | | // WValue will cycle from 1 to 0 to 1 to 0 to 1 over 3 pixels |
| 111 | | |
| 112 | | |
| 113 | | float PI = 3.14159265f; |
| 114 | | float W = WValue; |
| 103 | float2 Scaler = float2(RawWidth, RawHeight); |
| 104 | float2 Coord0 = Input.Coord0.xy * Scaler; |
| 105 | float2 Coord1 = Input.Coord1.xy * Scaler; |
| 106 | float2 Coord2 = Input.Coord2.xy * Scaler; |
| 107 | float2 Coord3 = Input.Coord3.xy * Scaler; |
| 115 | 108 | |
| 116 | | float T0 = Input.Coord0.x * (RawWidth / WidthRatio) * 2.0f + AValue * 0.5333f * Input.Coord0.y * (RawHeight / HeightRatio) * 2.0f + BValue * 2.0f + 2.0f; |
| 117 | | float T1 = Input.Coord1.x * (RawWidth / WidthRatio) * 2.0f + AValue * 0.5333f * Input.Coord1.y * (RawHeight / HeightRatio) * 2.0f + BValue * 2.0f + 2.0f; |
| 118 | | float T2 = Input.Coord2.x * (RawWidth / WidthRatio) * 2.0f + AValue * 0.5333f * Input.Coord2.y * (RawHeight / HeightRatio) * 2.0f + BValue * 2.0f + 2.0f; |
| 119 | | float T3 = Input.Coord3.x * (RawWidth / WidthRatio) * 2.0f + AValue * 0.5333f * Input.Coord3.y * (RawHeight / HeightRatio) * 2.0f + BValue * 2.0f + 2.0f; |
| 120 | | |
| 109 | float W = WValue; |
| 110 | float YRatio = 1.0f; |
| 111 | float T0 = Coord0.x + AValue * YRatio * Coord0.y + BValue; |
| 112 | float T1 = Coord1.x + AValue * YRatio * Coord1.y + BValue; |
| 113 | float T2 = Coord2.x + AValue * YRatio * Coord2.y + BValue; |
| 114 | float T3 = Coord3.x + AValue * YRatio * Coord3.y + BValue; |
| 115 | |
| 121 | 116 | float Y0 = dot(Texel0, float3(0.299f, 0.587f, 0.114f)); |
| 122 | 117 | float I0 = dot(Texel0, float3(0.595716f, -0.274453f, -0.321263f)); |
| 123 | 118 | float Q0 = dot(Texel0, float3(0.211456f, -0.522591f, 0.311135f)); |
| r11595 | r11596 | |
| 134 | 129 | float I3 = dot(Texel3, float3(0.595716f, -0.274453f, -0.321263f)); |
| 135 | 130 | float Q3 = dot(Texel3, float3(0.211456f, -0.522591f, 0.311135f)); |
| 136 | 131 | |
| 137 | | //float MaxC = 1.5957f; |
| 138 | | //float MinC = -0.5957f; |
| 139 | 132 | float MaxC = 2.1183f; |
| 140 | 133 | float MinC = -1.1183f; |
| 141 | 134 | float CRange = MaxC - MinC; |
| r11595 | r11596 | |
| 149 | 142 | C2 = (C2 - MinC) / CRange; |
| 150 | 143 | C3 = (C3 - MinC) / CRange; |
| 151 | 144 | |
| 152 | | float4 Tc = float4(T0, T1, T2, T3); |
| 153 | 145 | return float4(C0, C1, C2, C3); |
| 154 | 146 | } |
| 155 | 147 | |
src/osd/windows/drawd3d.c
| r11595 | r11596 | |
| 87 | 87 | #define ENABLE_BORDER_PIX (1) |
| 88 | 88 | |
| 89 | 89 | #define VERTEX_BASE_FORMAT (D3DFVF_DIFFUSE | D3DFVF_TEX1 | D3DFVF_TEX2) |
| 90 | | #define VERTEX_BUFFER_SIZE (2048*4) |
| 90 | #define VERTEX_BUFFER_SIZE (2048*6+6) |
| 91 | 91 | |
| 92 | 92 | enum |
| 93 | 93 | { |
| r11595 | r11596 | |
| 200 | 200 | d3d_effect * color_effect; // pointer to the current color-effect object |
| 201 | 201 | d3d_effect * yiq_encode_effect; // pointer to the current YIQ encoder effect object |
| 202 | 202 | d3d_effect * yiq_decode_effect; // pointer to the current YIQ decoder effect object |
| 203 | d3d_vertex * fsfx_vertices; // pointer to our full-screen-quad object |
| 203 | 204 | |
| 204 | 205 | poly_info poly[VERTEX_BUFFER_SIZE / 3];// array to hold polygons as they are created |
| 205 | 206 | int numpolys; // number of accumulated polygons |
| r11595 | r11596 | |
| 524 | 525 | // drawing |
| 525 | 526 | static void draw_line(d3d_info *d3d, const render_primitive *prim); |
| 526 | 527 | static void draw_quad(d3d_info *d3d, const render_primitive *prim); |
| 528 | static void init_fsfx_quad(d3d_info *d3d); |
| 527 | 529 | |
| 528 | 530 | // primitives |
| 529 | 531 | static d3d_vertex *primitive_alloc(d3d_info *d3d, int numverts); |
| r11595 | r11596 | |
| 744 | 746 | d3d->lockedbuf = NULL; |
| 745 | 747 | |
| 746 | 748 | // loop over primitives |
| 749 | if(d3d->hlsl_enable && d3dintf->post_fx_available) |
| 750 | { |
| 751 | init_fsfx_quad(d3d); |
| 752 | } |
| 753 | |
| 747 | 754 | mtlog_add("drawd3d_window_draw: primitive loop begin"); |
| 748 | 755 | for (prim = window->primlist->first(); prim != NULL; prim = prim->next()) |
| 749 | 756 | switch (prim->type) |
| r11595 | r11596 | |
| 1974 | 1981 | |
| 1975 | 1982 | |
| 1976 | 1983 | //============================================================ |
| 1984 | // init_fsfx_quad |
| 1985 | //============================================================ |
| 1986 | |
| 1987 | static void init_fsfx_quad(d3d_info *d3d) |
| 1988 | { |
| 1989 | // get a pointer to the vertex buffer |
| 1990 | d3d->fsfx_vertices = primitive_alloc(d3d, 6); |
| 1991 | if (d3d->fsfx_vertices == NULL) |
| 1992 | return; |
| 1993 | |
| 1994 | // fill in the vertexes clockwise |
| 1995 | windows_options &options = downcast<windows_options &>(d3d->window->machine().options()); |
| 1996 | float scale_top = options.screen_scale_top(); |
| 1997 | float scale_bottom = options.screen_scale_bottom(); |
| 1998 | |
| 1999 | d3d->fsfx_vertices[0].x = (d3d->width * (scale_top * 0.5f - 0.5f)); |
| 2000 | d3d->fsfx_vertices[0].y = 0.0f; |
| 2001 | d3d->fsfx_vertices[1].x = d3d->width - (d3d->width * (scale_top * 0.5f - 0.5f)); |
| 2002 | d3d->fsfx_vertices[1].y = 0.0f; |
| 2003 | d3d->fsfx_vertices[2].x = (d3d->width * (scale_bottom * 0.5f - 0.5f)); |
| 2004 | d3d->fsfx_vertices[2].y = d3d->height; |
| 2005 | d3d->fsfx_vertices[3].x = d3d->width - (d3d->width * (scale_top * 0.5f - 0.5f)); |
| 2006 | d3d->fsfx_vertices[3].y = 0.0f; |
| 2007 | d3d->fsfx_vertices[4].x = (d3d->width * (scale_bottom * 0.5f - 0.5f)); |
| 2008 | d3d->fsfx_vertices[4].y = d3d->height; |
| 2009 | d3d->fsfx_vertices[5].x = d3d->width - (d3d->width * (scale_bottom * 0.5f - 0.5f)); |
| 2010 | d3d->fsfx_vertices[5].y = d3d->height; |
| 2011 | |
| 2012 | d3d->fsfx_vertices[0].u0 = 0.0f; |
| 2013 | d3d->fsfx_vertices[0].v0 = 0.0f; |
| 2014 | d3d->fsfx_vertices[1].u0 = 1.0f; |
| 2015 | d3d->fsfx_vertices[1].v0 = 0.0f; |
| 2016 | d3d->fsfx_vertices[2].u0 = 0.0f; |
| 2017 | d3d->fsfx_vertices[2].v0 = 1.0f; |
| 2018 | d3d->fsfx_vertices[3].u0 = 1.0f; |
| 2019 | d3d->fsfx_vertices[3].v0 = 0.0f; |
| 2020 | d3d->fsfx_vertices[4].u0 = 0.0f; |
| 2021 | d3d->fsfx_vertices[4].v0 = 1.0f; |
| 2022 | d3d->fsfx_vertices[5].u0 = 1.0f; |
| 2023 | d3d->fsfx_vertices[5].v0 = 1.0f; |
| 2024 | |
| 2025 | // set the color, Z parameters to standard values |
| 2026 | for (int i = 0; i < 6; i++) |
| 2027 | { |
| 2028 | d3d->fsfx_vertices[i].z = 0.0f; |
| 2029 | d3d->fsfx_vertices[i].rhw = 1.0f; |
| 2030 | d3d->fsfx_vertices[i].color = D3DCOLOR_ARGB(255, 255, 255, 255); |
| 2031 | } |
| 2032 | } |
| 2033 | |
| 2034 | |
| 2035 | |
| 2036 | //============================================================ |
| 1977 | 2037 | // primitive_alloc |
| 1978 | 2038 | //============================================================ |
| 1979 | 2039 | |
| r11595 | r11596 | |
| 2050 | 2110 | { |
| 2051 | 2111 | result = (*d3dintf->device.get_render_target)(d3d->device, 0, &backbuffer); |
| 2052 | 2112 | if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device get_render_target call\n", (int)result); |
| 2113 | vertnum = 6; |
| 2053 | 2114 | } |
| 2115 | else |
| 2116 | { |
| 2117 | vertnum = 0; |
| 2118 | } |
| 2054 | 2119 | |
| 2055 | 2120 | windows_options &options = downcast<windows_options &>(d3d->window->machine().options()); |
| 2056 | 2121 | |
| 2057 | 2122 | int cur_render_screen = 0; |
| 2058 | 2123 | // now do the polys |
| 2059 | | for (polynum = vertnum = 0; polynum < d3d->numpolys; polynum++) |
| 2124 | for (polynum = 0; polynum < d3d->numpolys; polynum++) |
| 2060 | 2125 | { |
| 2061 | 2126 | poly_info *poly = &d3d->poly[polynum]; |
| 2062 | 2127 | int newfilter; |
| r11595 | r11596 | |
| 2160 | 2225 | { |
| 2161 | 2226 | (*d3dintf->effect.begin_pass)(curr_effect, pass); |
| 2162 | 2227 | // add the primitives |
| 2163 | | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); |
| 2228 | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count); |
| 2164 | 2229 | if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); |
| 2165 | 2230 | (*d3dintf->effect.end_pass)(curr_effect); |
| 2166 | 2231 | } |
| r11595 | r11596 | |
| 2177 | 2242 | (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", poly->texture != NULL ? (1.0f / (poly->texture->vstop - poly->texture->vstart)) : 0.0f); |
| 2178 | 2243 | (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width); |
| 2179 | 2244 | (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height); |
| 2180 | | (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width); |
| 2181 | | (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height); |
| 2182 | 2245 | (*d3dintf->effect.set_float)(curr_effect, "WValue", options.screen_yiq_w()); |
| 2183 | 2246 | (*d3dintf->effect.set_float)(curr_effect, "AValue", options.screen_yiq_a()); |
| 2184 | 2247 | (*d3dintf->effect.set_float)(curr_effect, "BValue", (float)poly->texture->cur_frame * options.screen_yiq_b()); |
| r11595 | r11596 | |
| 2195 | 2258 | { |
| 2196 | 2259 | (*d3dintf->effect.begin_pass)(curr_effect, pass); |
| 2197 | 2260 | // add the primitives |
| 2198 | | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); |
| 2261 | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count); |
| 2199 | 2262 | if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); |
| 2200 | 2263 | (*d3dintf->effect.end_pass)(curr_effect); |
| 2201 | 2264 | } |
| r11595 | r11596 | |
| 2252 | 2315 | { |
| 2253 | 2316 | (*d3dintf->effect.begin_pass)(curr_effect, pass); |
| 2254 | 2317 | // add the primitives |
| 2255 | | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); |
| 2318 | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count); |
| 2256 | 2319 | if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); |
| 2257 | 2320 | (*d3dintf->effect.end_pass)(curr_effect); |
| 2258 | 2321 | } |
| r11595 | r11596 | |
| 2293 | 2356 | { |
| 2294 | 2357 | (*d3dintf->effect.begin_pass)(curr_effect, pass); |
| 2295 | 2358 | // add the primitives |
| 2296 | | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); |
| 2359 | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count); |
| 2297 | 2360 | if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); |
| 2298 | 2361 | (*d3dintf->effect.end_pass)(curr_effect); |
| 2299 | 2362 | } |
| r11595 | r11596 | |
| 2331 | 2394 | { |
| 2332 | 2395 | (*d3dintf->effect.begin_pass)(curr_effect, pass); |
| 2333 | 2396 | // add the primitives |
| 2334 | | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); |
| 2397 | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count); |
| 2335 | 2398 | if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); |
| 2336 | 2399 | (*d3dintf->effect.end_pass)(curr_effect); |
| 2337 | 2400 | } |
| r11595 | r11596 | |
| 2361 | 2424 | { |
| 2362 | 2425 | (*d3dintf->effect.begin_pass)(curr_effect, pass); |
| 2363 | 2426 | // add the primitives |
| 2364 | | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); |
| 2427 | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count); |
| 2365 | 2428 | if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); |
| 2366 | 2429 | (*d3dintf->effect.end_pass)(curr_effect); |
| 2367 | 2430 | } |
| r11595 | r11596 | |
| 2396 | 2459 | { |
| 2397 | 2460 | (*d3dintf->effect.begin_pass)(curr_effect, pass); |
| 2398 | 2461 | // add the primitives |
| 2399 | | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); |
| 2462 | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count); |
| 2400 | 2463 | if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); |
| 2401 | 2464 | (*d3dintf->effect.end_pass)(curr_effect); |
| 2402 | 2465 | } |
| r11595 | r11596 | |
| 2422 | 2485 | { |
| 2423 | 2486 | (*d3dintf->effect.begin_pass)(curr_effect, pass); |
| 2424 | 2487 | // add the primitives |
| 2425 | | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count); |
| 2488 | result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, 0, poly->count); |
| 2426 | 2489 | if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result); |
| 2427 | 2490 | (*d3dintf->effect.end_pass)(curr_effect); |
| 2428 | 2491 | } |
| r11595 | r11596 | |
| 2432 | 2495 | /* Scanlines and shadow mask */ |
| 2433 | 2496 | curr_effect = d3d->post_effect; |
| 2434 | 2497 | |
| 2435 | | (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", poly->texture->d3dtexture0); |
| 2498 | (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", poly->texture->d3dtexture3); |
| 2436 | 2499 | |
| 2437 | 2500 | result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer); |
| 2438 | 2501 | if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 5\n", (int)result); |
| r11595 | r11596 | |
| 2686 | 2749 | goto error; |
| 2687 | 2750 | (*d3dintf->texture.get_surface_level)(texture->d3dtexture3, 0, &texture->d3dtarget3); |
| 2688 | 2751 | |
| 2689 | | printf("Boo\n"); |
| 2690 | 2752 | result = (*d3dintf->device.create_texture)(d3d->device, (int)(scwidth * d3d->oversample_x), (int)(scheight * d3d->oversample_y), 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texture->d3dtexture4); |
| 2691 | 2753 | if (result != D3D_OK) |
| 2692 | 2754 | goto error; |