trunk/src/emu/ui/ui.c
r245648 | r245649 | |
107 | 107 | // slider controls |
108 | 108 | static slider_state *slider_alloc(running_machine &machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg); |
109 | 109 | static slider_state *slider_init(running_machine &machine); |
110 | | static INT32 slider_volume(running_machine &machine, void *arg, astring *string, INT32 newval); |
111 | | static INT32 slider_mixervol(running_machine &machine, void *arg, astring *string, INT32 newval); |
112 | | static INT32 slider_adjuster(running_machine &machine, void *arg, astring *string, INT32 newval); |
113 | | static INT32 slider_overclock(running_machine &machine, void *arg, astring *string, INT32 newval); |
114 | | static INT32 slider_refresh(running_machine &machine, void *arg, astring *string, INT32 newval); |
115 | | static INT32 slider_brightness(running_machine &machine, void *arg, astring *string, INT32 newval); |
116 | | static INT32 slider_contrast(running_machine &machine, void *arg, astring *string, INT32 newval); |
117 | | static INT32 slider_gamma(running_machine &machine, void *arg, astring *string, INT32 newval); |
118 | | static INT32 slider_xscale(running_machine &machine, void *arg, astring *string, INT32 newval); |
119 | | static INT32 slider_yscale(running_machine &machine, void *arg, astring *string, INT32 newval); |
120 | | static INT32 slider_xoffset(running_machine &machine, void *arg, astring *string, INT32 newval); |
121 | | static INT32 slider_yoffset(running_machine &machine, void *arg, astring *string, INT32 newval); |
122 | | static INT32 slider_overxscale(running_machine &machine, void *arg, astring *string, INT32 newval); |
123 | | static INT32 slider_overyscale(running_machine &machine, void *arg, astring *string, INT32 newval); |
124 | | static INT32 slider_overxoffset(running_machine &machine, void *arg, astring *string, INT32 newval); |
125 | | static INT32 slider_overyoffset(running_machine &machine, void *arg, astring *string, INT32 newval); |
126 | | static INT32 slider_flicker(running_machine &machine, void *arg, astring *string, INT32 newval); |
127 | | static INT32 slider_beam(running_machine &machine, void *arg, astring *string, INT32 newval); |
| 110 | static INT32 slider_volume(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 111 | static INT32 slider_mixervol(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 112 | static INT32 slider_adjuster(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 113 | static INT32 slider_overclock(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 114 | static INT32 slider_refresh(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 115 | static INT32 slider_brightness(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 116 | static INT32 slider_contrast(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 117 | static INT32 slider_gamma(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 118 | static INT32 slider_xscale(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 119 | static INT32 slider_yscale(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 120 | static INT32 slider_xoffset(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 121 | static INT32 slider_yoffset(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 122 | static INT32 slider_overxscale(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 123 | static INT32 slider_overyscale(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 124 | static INT32 slider_overxoffset(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 125 | static INT32 slider_overyoffset(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 126 | static INT32 slider_flicker(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 127 | static INT32 slider_beam(running_machine &machine, void *arg, astring *str, INT32 newval); |
128 | 128 | static char *slider_get_screen_desc(screen_device &screen); |
129 | 129 | #ifdef MAME_DEBUG |
130 | | static INT32 slider_crossscale(running_machine &machine, void *arg, astring *string, INT32 newval); |
131 | | static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *string, INT32 newval); |
| 130 | static INT32 slider_crossscale(running_machine &machine, void *arg, astring *str, INT32 newval); |
| 131 | static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *str, INT32 newval); |
132 | 132 | #endif |
133 | 133 | |
134 | 134 | |
r245648 | r245649 | |
1977 | 1977 | // slider_volume - global volume slider callback |
1978 | 1978 | //------------------------------------------------- |
1979 | 1979 | |
1980 | | static INT32 slider_volume(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 1980 | static INT32 slider_volume(running_machine &machine, void *arg, astring *str, INT32 newval) |
1981 | 1981 | { |
1982 | 1982 | if (newval != SLIDER_NOCHANGE) |
1983 | 1983 | machine.sound().set_attenuation(newval); |
1984 | | if (string != NULL) |
1985 | | string->printf("%3ddB", machine.sound().attenuation()); |
| 1984 | if (str != NULL) |
| 1985 | str->printf("%3ddB", machine.sound().attenuation()); |
1986 | 1986 | return machine.sound().attenuation(); |
1987 | 1987 | } |
1988 | 1988 | |
r245648 | r245649 | |
1992 | 1992 | // slider callback |
1993 | 1993 | //------------------------------------------------- |
1994 | 1994 | |
1995 | | static INT32 slider_mixervol(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 1995 | static INT32 slider_mixervol(running_machine &machine, void *arg, astring *str, INT32 newval) |
1996 | 1996 | { |
1997 | 1997 | mixer_input info; |
1998 | 1998 | if (!machine.sound().indexed_mixer_input((FPTR)arg, info)) |
r245648 | r245649 | |
2003 | 2003 | if (newval > curval && (newval - curval) <= 4) newval += 4; // round up on increment |
2004 | 2004 | info.stream->set_user_gain(info.inputnum, (float)newval * 0.001f); |
2005 | 2005 | } |
2006 | | if (string != NULL) |
2007 | | string->printf("%4.2f", info.stream->user_gain(info.inputnum)); |
| 2006 | if (str != NULL) |
| 2007 | str->printf("%4.2f", info.stream->user_gain(info.inputnum)); |
2008 | 2008 | return floor(info.stream->user_gain(info.inputnum) * 1000.0f + 0.5f); |
2009 | 2009 | } |
2010 | 2010 | |
r245648 | r245649 | |
2014 | 2014 | // callback |
2015 | 2015 | //------------------------------------------------- |
2016 | 2016 | |
2017 | | static INT32 slider_adjuster(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2017 | static INT32 slider_adjuster(running_machine &machine, void *arg, astring *str, INT32 newval) |
2018 | 2018 | { |
2019 | 2019 | ioport_field *field = (ioport_field *)arg; |
2020 | 2020 | ioport_field::user_settings settings; |
r245648 | r245649 | |
2025 | 2025 | settings.value = newval; |
2026 | 2026 | field->set_user_settings(settings); |
2027 | 2027 | } |
2028 | | if (string != NULL) |
2029 | | string->printf("%d%%", settings.value); |
| 2028 | if (str != NULL) |
| 2029 | str->printf("%d%%", settings.value); |
2030 | 2030 | return settings.value; |
2031 | 2031 | } |
2032 | 2032 | |
r245648 | r245649 | |
2036 | 2036 | // callback |
2037 | 2037 | //------------------------------------------------- |
2038 | 2038 | |
2039 | | static INT32 slider_overclock(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2039 | static INT32 slider_overclock(running_machine &machine, void *arg, astring *str, INT32 newval) |
2040 | 2040 | { |
2041 | 2041 | device_t *cpu = (device_t *)arg; |
2042 | 2042 | if (newval != SLIDER_NOCHANGE) |
2043 | 2043 | cpu->set_clock_scale((float)newval * 0.001f); |
2044 | | if (string != NULL) |
2045 | | string->printf("%3.0f%%", floor(cpu->clock_scale() * 100.0f + 0.5f)); |
| 2044 | if (str != NULL) |
| 2045 | str->printf("%3.0f%%", floor(cpu->clock_scale() * 100.0f + 0.5f)); |
2046 | 2046 | return floor(cpu->clock_scale() * 1000.0f + 0.5f); |
2047 | 2047 | } |
2048 | 2048 | |
r245648 | r245649 | |
2051 | 2051 | // slider_refresh - refresh rate slider callback |
2052 | 2052 | //------------------------------------------------- |
2053 | 2053 | |
2054 | | static INT32 slider_refresh(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2054 | static INT32 slider_refresh(running_machine &machine, void *arg, astring *str, INT32 newval) |
2055 | 2055 | { |
2056 | 2056 | screen_device *screen = reinterpret_cast<screen_device *>(arg); |
2057 | 2057 | double defrefresh = ATTOSECONDS_TO_HZ(screen->refresh_attoseconds()); |
r245648 | r245649 | |
2064 | 2064 | const rectangle &visarea = screen->visible_area(); |
2065 | 2065 | screen->configure(width, height, visarea, HZ_TO_ATTOSECONDS(defrefresh + (double)newval * 0.001)); |
2066 | 2066 | } |
2067 | | if (string != NULL) |
2068 | | string->printf("%.3ffps", ATTOSECONDS_TO_HZ(machine.first_screen()->frame_period().attoseconds)); |
| 2067 | if (str != NULL) |
| 2068 | str->printf("%.3ffps", ATTOSECONDS_TO_HZ(machine.first_screen()->frame_period().attoseconds)); |
2069 | 2069 | refresh = ATTOSECONDS_TO_HZ(machine.first_screen()->frame_period().attoseconds); |
2070 | 2070 | return floor((refresh - defrefresh) * 1000.0f + 0.5f); |
2071 | 2071 | } |
r245648 | r245649 | |
2076 | 2076 | // callback |
2077 | 2077 | //------------------------------------------------- |
2078 | 2078 | |
2079 | | static INT32 slider_brightness(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2079 | static INT32 slider_brightness(running_machine &machine, void *arg, astring *str, INT32 newval) |
2080 | 2080 | { |
2081 | 2081 | screen_device *screen = reinterpret_cast<screen_device *>(arg); |
2082 | 2082 | render_container::user_settings settings; |
r245648 | r245649 | |
2087 | 2087 | settings.m_brightness = (float)newval * 0.001f; |
2088 | 2088 | screen->container().set_user_settings(settings); |
2089 | 2089 | } |
2090 | | if (string != NULL) |
2091 | | string->printf("%.3f", settings.m_brightness); |
| 2090 | if (str != NULL) |
| 2091 | str->printf("%.3f", settings.m_brightness); |
2092 | 2092 | return floor(settings.m_brightness * 1000.0f + 0.5f); |
2093 | 2093 | } |
2094 | 2094 | |
r245648 | r245649 | |
2098 | 2098 | // callback |
2099 | 2099 | //------------------------------------------------- |
2100 | 2100 | |
2101 | | static INT32 slider_contrast(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2101 | static INT32 slider_contrast(running_machine &machine, void *arg, astring *str, INT32 newval) |
2102 | 2102 | { |
2103 | 2103 | screen_device *screen = reinterpret_cast<screen_device *>(arg); |
2104 | 2104 | render_container::user_settings settings; |
r245648 | r245649 | |
2109 | 2109 | settings.m_contrast = (float)newval * 0.001f; |
2110 | 2110 | screen->container().set_user_settings(settings); |
2111 | 2111 | } |
2112 | | if (string != NULL) |
2113 | | string->printf("%.3f", settings.m_contrast); |
| 2112 | if (str != NULL) |
| 2113 | str->printf("%.3f", settings.m_contrast); |
2114 | 2114 | return floor(settings.m_contrast * 1000.0f + 0.5f); |
2115 | 2115 | } |
2116 | 2116 | |
r245648 | r245649 | |
2119 | 2119 | // slider_gamma - screen gamma slider callback |
2120 | 2120 | //------------------------------------------------- |
2121 | 2121 | |
2122 | | static INT32 slider_gamma(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2122 | static INT32 slider_gamma(running_machine &machine, void *arg, astring *str, INT32 newval) |
2123 | 2123 | { |
2124 | 2124 | screen_device *screen = reinterpret_cast<screen_device *>(arg); |
2125 | 2125 | render_container::user_settings settings; |
r245648 | r245649 | |
2130 | 2130 | settings.m_gamma = (float)newval * 0.001f; |
2131 | 2131 | screen->container().set_user_settings(settings); |
2132 | 2132 | } |
2133 | | if (string != NULL) |
2134 | | string->printf("%.3f", settings.m_gamma); |
| 2133 | if (str != NULL) |
| 2134 | str->printf("%.3f", settings.m_gamma); |
2135 | 2135 | return floor(settings.m_gamma * 1000.0f + 0.5f); |
2136 | 2136 | } |
2137 | 2137 | |
r245648 | r245649 | |
2141 | 2141 | // callback |
2142 | 2142 | //------------------------------------------------- |
2143 | 2143 | |
2144 | | static INT32 slider_xscale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2144 | static INT32 slider_xscale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2145 | 2145 | { |
2146 | 2146 | screen_device *screen = reinterpret_cast<screen_device *>(arg); |
2147 | 2147 | render_container::user_settings settings; |
r245648 | r245649 | |
2152 | 2152 | settings.m_xscale = (float)newval * 0.001f; |
2153 | 2153 | screen->container().set_user_settings(settings); |
2154 | 2154 | } |
2155 | | if (string != NULL) |
2156 | | string->printf("%.3f", settings.m_xscale); |
| 2155 | if (str != NULL) |
| 2156 | str->printf("%.3f", settings.m_xscale); |
2157 | 2157 | return floor(settings.m_xscale * 1000.0f + 0.5f); |
2158 | 2158 | } |
2159 | 2159 | |
r245648 | r245649 | |
2163 | 2163 | // callback |
2164 | 2164 | //------------------------------------------------- |
2165 | 2165 | |
2166 | | static INT32 slider_yscale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2166 | static INT32 slider_yscale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2167 | 2167 | { |
2168 | 2168 | screen_device *screen = reinterpret_cast<screen_device *>(arg); |
2169 | 2169 | render_container::user_settings settings; |
r245648 | r245649 | |
2174 | 2174 | settings.m_yscale = (float)newval * 0.001f; |
2175 | 2175 | screen->container().set_user_settings(settings); |
2176 | 2176 | } |
2177 | | if (string != NULL) |
2178 | | string->printf("%.3f", settings.m_yscale); |
| 2177 | if (str != NULL) |
| 2178 | str->printf("%.3f", settings.m_yscale); |
2179 | 2179 | return floor(settings.m_yscale * 1000.0f + 0.5f); |
2180 | 2180 | } |
2181 | 2181 | |
r245648 | r245649 | |
2185 | 2185 | // slider callback |
2186 | 2186 | //------------------------------------------------- |
2187 | 2187 | |
2188 | | static INT32 slider_xoffset(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2188 | static INT32 slider_xoffset(running_machine &machine, void *arg, astring *str, INT32 newval) |
2189 | 2189 | { |
2190 | 2190 | screen_device *screen = reinterpret_cast<screen_device *>(arg); |
2191 | 2191 | render_container::user_settings settings; |
r245648 | r245649 | |
2196 | 2196 | settings.m_xoffset = (float)newval * 0.001f; |
2197 | 2197 | screen->container().set_user_settings(settings); |
2198 | 2198 | } |
2199 | | if (string != NULL) |
2200 | | string->printf("%.3f", settings.m_xoffset); |
| 2199 | if (str != NULL) |
| 2200 | str->printf("%.3f", settings.m_xoffset); |
2201 | 2201 | return floor(settings.m_xoffset * 1000.0f + 0.5f); |
2202 | 2202 | } |
2203 | 2203 | |
r245648 | r245649 | |
2207 | 2207 | // slider callback |
2208 | 2208 | //------------------------------------------------- |
2209 | 2209 | |
2210 | | static INT32 slider_yoffset(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2210 | static INT32 slider_yoffset(running_machine &machine, void *arg, astring *str, INT32 newval) |
2211 | 2211 | { |
2212 | 2212 | screen_device *screen = reinterpret_cast<screen_device *>(arg); |
2213 | 2213 | render_container::user_settings settings; |
r245648 | r245649 | |
2218 | 2218 | settings.m_yoffset = (float)newval * 0.001f; |
2219 | 2219 | screen->container().set_user_settings(settings); |
2220 | 2220 | } |
2221 | | if (string != NULL) |
2222 | | string->printf("%.3f", settings.m_yoffset); |
| 2221 | if (str != NULL) |
| 2222 | str->printf("%.3f", settings.m_yoffset); |
2223 | 2223 | return floor(settings.m_yoffset * 1000.0f + 0.5f); |
2224 | 2224 | } |
2225 | 2225 | |
r245648 | r245649 | |
2229 | 2229 | // callback |
2230 | 2230 | //------------------------------------------------- |
2231 | 2231 | |
2232 | | static INT32 slider_overxscale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2232 | static INT32 slider_overxscale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2233 | 2233 | { |
2234 | 2234 | laserdisc_device *laserdisc = (laserdisc_device *)arg; |
2235 | 2235 | laserdisc_overlay_config settings; |
r245648 | r245649 | |
2240 | 2240 | settings.m_overscalex = (float)newval * 0.001f; |
2241 | 2241 | laserdisc->set_overlay_config(settings); |
2242 | 2242 | } |
2243 | | if (string != NULL) |
2244 | | string->printf("%.3f", settings.m_overscalex); |
| 2243 | if (str != NULL) |
| 2244 | str->printf("%.3f", settings.m_overscalex); |
2245 | 2245 | return floor(settings.m_overscalex * 1000.0f + 0.5f); |
2246 | 2246 | } |
2247 | 2247 | |
r245648 | r245649 | |
2251 | 2251 | // callback |
2252 | 2252 | //------------------------------------------------- |
2253 | 2253 | |
2254 | | static INT32 slider_overyscale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2254 | static INT32 slider_overyscale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2255 | 2255 | { |
2256 | 2256 | laserdisc_device *laserdisc = (laserdisc_device *)arg; |
2257 | 2257 | laserdisc_overlay_config settings; |
r245648 | r245649 | |
2262 | 2262 | settings.m_overscaley = (float)newval * 0.001f; |
2263 | 2263 | laserdisc->set_overlay_config(settings); |
2264 | 2264 | } |
2265 | | if (string != NULL) |
2266 | | string->printf("%.3f", settings.m_overscaley); |
| 2265 | if (str != NULL) |
| 2266 | str->printf("%.3f", settings.m_overscaley); |
2267 | 2267 | return floor(settings.m_overscaley * 1000.0f + 0.5f); |
2268 | 2268 | } |
2269 | 2269 | |
r245648 | r245649 | |
2273 | 2273 | // slider callback |
2274 | 2274 | //------------------------------------------------- |
2275 | 2275 | |
2276 | | static INT32 slider_overxoffset(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2276 | static INT32 slider_overxoffset(running_machine &machine, void *arg, astring *str, INT32 newval) |
2277 | 2277 | { |
2278 | 2278 | laserdisc_device *laserdisc = (laserdisc_device *)arg; |
2279 | 2279 | laserdisc_overlay_config settings; |
r245648 | r245649 | |
2284 | 2284 | settings.m_overposx = (float)newval * 0.001f; |
2285 | 2285 | laserdisc->set_overlay_config(settings); |
2286 | 2286 | } |
2287 | | if (string != NULL) |
2288 | | string->printf("%.3f", settings.m_overposx); |
| 2287 | if (str != NULL) |
| 2288 | str->printf("%.3f", settings.m_overposx); |
2289 | 2289 | return floor(settings.m_overposx * 1000.0f + 0.5f); |
2290 | 2290 | } |
2291 | 2291 | |
r245648 | r245649 | |
2295 | 2295 | // slider callback |
2296 | 2296 | //------------------------------------------------- |
2297 | 2297 | |
2298 | | static INT32 slider_overyoffset(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2298 | static INT32 slider_overyoffset(running_machine &machine, void *arg, astring *str, INT32 newval) |
2299 | 2299 | { |
2300 | 2300 | laserdisc_device *laserdisc = (laserdisc_device *)arg; |
2301 | 2301 | laserdisc_overlay_config settings; |
r245648 | r245649 | |
2306 | 2306 | settings.m_overposy = (float)newval * 0.001f; |
2307 | 2307 | laserdisc->set_overlay_config(settings); |
2308 | 2308 | } |
2309 | | if (string != NULL) |
2310 | | string->printf("%.3f", settings.m_overposy); |
| 2309 | if (str != NULL) |
| 2310 | str->printf("%.3f", settings.m_overposy); |
2311 | 2311 | return floor(settings.m_overposy * 1000.0f + 0.5f); |
2312 | 2312 | } |
2313 | 2313 | |
r245648 | r245649 | |
2317 | 2317 | // callback |
2318 | 2318 | //------------------------------------------------- |
2319 | 2319 | |
2320 | | static INT32 slider_flicker(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2320 | static INT32 slider_flicker(running_machine &machine, void *arg, astring *str, INT32 newval) |
2321 | 2321 | { |
2322 | 2322 | vector_device *vector = NULL; |
2323 | 2323 | if (newval != SLIDER_NOCHANGE) |
2324 | 2324 | vector->set_flicker((float)newval * 0.1f); |
2325 | | if (string != NULL) |
2326 | | string->printf("%1.2f", vector->get_flicker()); |
| 2325 | if (str != NULL) |
| 2326 | str->printf("%1.2f", vector->get_flicker()); |
2327 | 2327 | return floor(vector->get_flicker() * 10.0f + 0.5f); |
2328 | 2328 | } |
2329 | 2329 | |
r245648 | r245649 | |
2333 | 2333 | // callback |
2334 | 2334 | //------------------------------------------------- |
2335 | 2335 | |
2336 | | static INT32 slider_beam(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2336 | static INT32 slider_beam(running_machine &machine, void *arg, astring *str, INT32 newval) |
2337 | 2337 | { |
2338 | 2338 | vector_device *vector = NULL; |
2339 | 2339 | if (newval != SLIDER_NOCHANGE) |
2340 | 2340 | vector->set_beam((float)newval * 0.01f); |
2341 | | if (string != NULL) |
2342 | | string->printf("%1.2f", vector->get_beam()); |
| 2341 | if (str != NULL) |
| 2342 | str->printf("%1.2f", vector->get_beam()); |
2343 | 2343 | return floor(vector->get_beam() * 100.0f + 0.5f); |
2344 | 2344 | } |
2345 | 2345 | |
r245648 | r245649 | |
2369 | 2369 | //------------------------------------------------- |
2370 | 2370 | |
2371 | 2371 | #ifdef MAME_DEBUG |
2372 | | static INT32 slider_crossscale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2372 | static INT32 slider_crossscale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2373 | 2373 | { |
2374 | 2374 | ioport_field *field = (ioport_field *)arg; |
2375 | 2375 | |
2376 | 2376 | if (newval != SLIDER_NOCHANGE) |
2377 | 2377 | field->set_crosshair_scale(float(newval) * 0.001); |
2378 | | if (string != NULL) |
2379 | | string->printf("%s %s %1.3f", "Crosshair Scale", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f); |
| 2378 | if (str != NULL) |
| 2379 | str->printf("%s %s %1.3f", "Crosshair Scale", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f); |
2380 | 2380 | return floor(field->crosshair_scale() * 1000.0f + 0.5f); |
2381 | 2381 | } |
2382 | 2382 | #endif |
r245648 | r245649 | |
2388 | 2388 | //------------------------------------------------- |
2389 | 2389 | |
2390 | 2390 | #ifdef MAME_DEBUG |
2391 | | static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2391 | static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *str, INT32 newval) |
2392 | 2392 | { |
2393 | 2393 | ioport_field *field = (ioport_field *)arg; |
2394 | 2394 | |
2395 | 2395 | if (newval != SLIDER_NOCHANGE) |
2396 | 2396 | field->set_crosshair_offset(float(newval) * 0.001f); |
2397 | | if (string != NULL) |
2398 | | string->printf("%s %s %1.3f", "Crosshair Offset", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f); |
| 2397 | if (str != NULL) |
| 2398 | str->printf("%s %s %1.3f", "Crosshair Offset", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f); |
2399 | 2399 | return field->crosshair_offset(); |
2400 | 2400 | } |
2401 | 2401 | #endif |
trunk/src/osd/modules/render/d3d/d3dhlsl.c
r245648 | r245649 | |
2394 | 2394 | // assorted global slider accessors |
2395 | 2395 | //============================================================ |
2396 | 2396 | |
2397 | | static INT32 slider_set(float *option, float scale, const char *fmt, astring *string, INT32 newval) |
| 2397 | static INT32 slider_set(float *option, float scale, const char *fmt, astring *str, INT32 newval) |
2398 | 2398 | { |
2399 | 2399 | if (option != NULL && newval != SLIDER_NOCHANGE) *option = (float)newval * scale; |
2400 | | if (string != NULL) string->printf(fmt, *option); |
| 2400 | if (str != NULL) str->printf(fmt, *option); |
2401 | 2401 | return floor(*option / scale + 0.5f); |
2402 | 2402 | } |
2403 | 2403 | |
2404 | | static INT32 slider_shadow_mask_alpha(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2404 | static INT32 slider_shadow_mask_alpha(running_machine &machine, void *arg, astring *str, INT32 newval) |
2405 | 2405 | { |
2406 | | return slider_set(&(((hlsl_options*)arg)->shadow_mask_alpha), 0.01f, "%2.2f", string, newval); |
| 2406 | return slider_set(&(((hlsl_options*)arg)->shadow_mask_alpha), 0.01f, "%2.2f", str, newval); |
2407 | 2407 | } |
2408 | 2408 | |
2409 | | static INT32 slider_shadow_mask_x_count(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2409 | static INT32 slider_shadow_mask_x_count(running_machine &machine, void *arg, astring *str, INT32 newval) |
2410 | 2410 | { |
2411 | 2411 | hlsl_options *options = (hlsl_options*)arg; |
2412 | 2412 | if (newval != SLIDER_NOCHANGE) options->shadow_mask_count_x = newval; |
2413 | | if (string != NULL) string->printf("%d", options->shadow_mask_count_x); |
| 2413 | if (str != NULL) str->printf("%d", options->shadow_mask_count_x); |
2414 | 2414 | options->params_dirty = true; |
2415 | 2415 | return options->shadow_mask_count_x; |
2416 | 2416 | } |
2417 | 2417 | |
2418 | | static INT32 slider_shadow_mask_y_count(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2418 | static INT32 slider_shadow_mask_y_count(running_machine &machine, void *arg, astring *str, INT32 newval) |
2419 | 2419 | { |
2420 | 2420 | hlsl_options *options = (hlsl_options*)arg; |
2421 | 2421 | if (newval != SLIDER_NOCHANGE) options->shadow_mask_count_y = newval; |
2422 | | if (string != NULL) string->printf("%d", options->shadow_mask_count_y); |
| 2422 | if (str != NULL) str->printf("%d", options->shadow_mask_count_y); |
2423 | 2423 | options->params_dirty = true; |
2424 | 2424 | return options->shadow_mask_count_y; |
2425 | 2425 | } |
2426 | 2426 | |
2427 | | static INT32 slider_shadow_mask_usize(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2427 | static INT32 slider_shadow_mask_usize(running_machine &machine, void *arg, astring *str, INT32 newval) |
2428 | 2428 | { |
2429 | 2429 | ((hlsl_options*)arg)->params_dirty = true; |
2430 | | return slider_set(&(((hlsl_options*)arg)->shadow_mask_u_size), 1.0f / 32.0f, "%2.5f", string, newval); |
| 2430 | return slider_set(&(((hlsl_options*)arg)->shadow_mask_u_size), 1.0f / 32.0f, "%2.5f", str, newval); |
2431 | 2431 | } |
2432 | 2432 | |
2433 | | static INT32 slider_shadow_mask_vsize(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2433 | static INT32 slider_shadow_mask_vsize(running_machine &machine, void *arg, astring *str, INT32 newval) |
2434 | 2434 | { |
2435 | 2435 | ((hlsl_options*)arg)->params_dirty = true; |
2436 | | return slider_set(&(((hlsl_options*)arg)->shadow_mask_v_size), 1.0f / 32.0f, "%2.5f", string, newval); |
| 2436 | return slider_set(&(((hlsl_options*)arg)->shadow_mask_v_size), 1.0f / 32.0f, "%2.5f", str, newval); |
2437 | 2437 | } |
2438 | 2438 | |
2439 | | static INT32 slider_curvature(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2439 | static INT32 slider_curvature(running_machine &machine, void *arg, astring *str, INT32 newval) |
2440 | 2440 | { |
2441 | 2441 | ((hlsl_options*)arg)->params_dirty = true; |
2442 | | return slider_set(&(((hlsl_options*)arg)->curvature), 0.01f, "%2.2f", string, newval); |
| 2442 | return slider_set(&(((hlsl_options*)arg)->curvature), 0.01f, "%2.2f", str, newval); |
2443 | 2443 | } |
2444 | 2444 | |
2445 | | static INT32 slider_pincushion(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2445 | static INT32 slider_pincushion(running_machine &machine, void *arg, astring *str, INT32 newval) |
2446 | 2446 | { |
2447 | 2447 | ((hlsl_options*)arg)->params_dirty = true; |
2448 | | return slider_set(&(((hlsl_options*)arg)->pincushion), 0.01f, "%2.2f", string, newval); |
| 2448 | return slider_set(&(((hlsl_options*)arg)->pincushion), 0.01f, "%2.2f", str, newval); |
2449 | 2449 | } |
2450 | 2450 | |
2451 | | static INT32 slider_scanline_alpha(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2451 | static INT32 slider_scanline_alpha(running_machine &machine, void *arg, astring *str, INT32 newval) |
2452 | 2452 | { |
2453 | 2453 | ((hlsl_options*)arg)->params_dirty = true; |
2454 | | return slider_set(&(((hlsl_options*)arg)->scanline_alpha), 0.01f, "%2.2f", string, newval); |
| 2454 | return slider_set(&(((hlsl_options*)arg)->scanline_alpha), 0.01f, "%2.2f", str, newval); |
2455 | 2455 | } |
2456 | 2456 | |
2457 | | static INT32 slider_scanline_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2457 | static INT32 slider_scanline_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2458 | 2458 | { |
2459 | 2459 | ((hlsl_options*)arg)->params_dirty = true; |
2460 | | return slider_set(&(((hlsl_options*)arg)->scanline_scale), 0.05f, "%2.2f", string, newval); |
| 2460 | return slider_set(&(((hlsl_options*)arg)->scanline_scale), 0.05f, "%2.2f", str, newval); |
2461 | 2461 | } |
2462 | 2462 | |
2463 | | static INT32 slider_scanline_height(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2463 | static INT32 slider_scanline_height(running_machine &machine, void *arg, astring *str, INT32 newval) |
2464 | 2464 | { |
2465 | 2465 | ((hlsl_options*)arg)->params_dirty = true; |
2466 | | return slider_set(&(((hlsl_options*)arg)->scanline_height), 0.05f, "%2.2f", string, newval); |
| 2466 | return slider_set(&(((hlsl_options*)arg)->scanline_height), 0.05f, "%2.2f", str, newval); |
2467 | 2467 | } |
2468 | 2468 | |
2469 | | static INT32 slider_scanline_bright_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2469 | static INT32 slider_scanline_bright_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2470 | 2470 | { |
2471 | 2471 | ((hlsl_options*)arg)->params_dirty = true; |
2472 | | return slider_set(&(((hlsl_options*)arg)->scanline_bright_scale), 0.05f, "%2.2f", string, newval); |
| 2472 | return slider_set(&(((hlsl_options*)arg)->scanline_bright_scale), 0.05f, "%2.2f", str, newval); |
2473 | 2473 | } |
2474 | 2474 | |
2475 | | static INT32 slider_scanline_bright_offset(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2475 | static INT32 slider_scanline_bright_offset(running_machine &machine, void *arg, astring *str, INT32 newval) |
2476 | 2476 | { |
2477 | 2477 | ((hlsl_options*)arg)->params_dirty = true; |
2478 | | return slider_set(&(((hlsl_options*)arg)->scanline_bright_offset), 0.05f, "%2.2f", string, newval); |
| 2478 | return slider_set(&(((hlsl_options*)arg)->scanline_bright_offset), 0.05f, "%2.2f", str, newval); |
2479 | 2479 | } |
2480 | 2480 | |
2481 | | static INT32 slider_scanline_offset(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2481 | static INT32 slider_scanline_offset(running_machine &machine, void *arg, astring *str, INT32 newval) |
2482 | 2482 | { |
2483 | 2483 | ((hlsl_options*)arg)->params_dirty = true; |
2484 | | return slider_set(&(((hlsl_options*)arg)->scanline_offset), 0.05f, "%2.2f", string, newval); |
| 2484 | return slider_set(&(((hlsl_options*)arg)->scanline_offset), 0.05f, "%2.2f", str, newval); |
2485 | 2485 | } |
2486 | 2486 | |
2487 | | static INT32 slider_defocus_x(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2487 | static INT32 slider_defocus_x(running_machine &machine, void *arg, astring *str, INT32 newval) |
2488 | 2488 | { |
2489 | 2489 | ((hlsl_options*)arg)->params_dirty = true; |
2490 | | return slider_set(&(((hlsl_options*)arg)->defocus[0]), 0.5f, "%2.1f", string, newval); |
| 2490 | return slider_set(&(((hlsl_options*)arg)->defocus[0]), 0.5f, "%2.1f", str, newval); |
2491 | 2491 | } |
2492 | 2492 | |
2493 | | static INT32 slider_defocus_y(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2493 | static INT32 slider_defocus_y(running_machine &machine, void *arg, astring *str, INT32 newval) |
2494 | 2494 | { |
2495 | 2495 | ((hlsl_options*)arg)->params_dirty = true; |
2496 | | return slider_set(&(((hlsl_options*)arg)->defocus[1]), 0.5f, "%2.1f", string, newval); |
| 2496 | return slider_set(&(((hlsl_options*)arg)->defocus[1]), 0.5f, "%2.1f", str, newval); |
2497 | 2497 | } |
2498 | 2498 | |
2499 | | static INT32 slider_red_converge_x(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2499 | static INT32 slider_red_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval) |
2500 | 2500 | { |
2501 | 2501 | ((hlsl_options*)arg)->params_dirty = true; |
2502 | | return slider_set(&(((hlsl_options*)arg)->converge_x[0]), 0.1f, "%3.1f", string, newval); |
| 2502 | return slider_set(&(((hlsl_options*)arg)->converge_x[0]), 0.1f, "%3.1f", str, newval); |
2503 | 2503 | } |
2504 | 2504 | |
2505 | | static INT32 slider_red_converge_y(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2505 | static INT32 slider_red_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval) |
2506 | 2506 | { |
2507 | 2507 | ((hlsl_options*)arg)->params_dirty = true; |
2508 | | return slider_set(&(((hlsl_options*)arg)->converge_y[0]), 0.1f, "%3.1f", string, newval); |
| 2508 | return slider_set(&(((hlsl_options*)arg)->converge_y[0]), 0.1f, "%3.1f", str, newval); |
2509 | 2509 | } |
2510 | 2510 | |
2511 | | static INT32 slider_green_converge_x(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2511 | static INT32 slider_green_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval) |
2512 | 2512 | { |
2513 | 2513 | ((hlsl_options*)arg)->params_dirty = true; |
2514 | | return slider_set(&(((hlsl_options*)arg)->converge_x[1]), 0.1f, "%3.1f", string, newval); |
| 2514 | return slider_set(&(((hlsl_options*)arg)->converge_x[1]), 0.1f, "%3.1f", str, newval); |
2515 | 2515 | } |
2516 | 2516 | |
2517 | | static INT32 slider_green_converge_y(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2517 | static INT32 slider_green_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval) |
2518 | 2518 | { |
2519 | 2519 | ((hlsl_options*)arg)->params_dirty = true; |
2520 | | return slider_set(&(((hlsl_options*)arg)->converge_y[1]), 0.1f, "%3.1f", string, newval); |
| 2520 | return slider_set(&(((hlsl_options*)arg)->converge_y[1]), 0.1f, "%3.1f", str, newval); |
2521 | 2521 | } |
2522 | 2522 | |
2523 | | static INT32 slider_blue_converge_x(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2523 | static INT32 slider_blue_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval) |
2524 | 2524 | { |
2525 | 2525 | ((hlsl_options*)arg)->params_dirty = true; |
2526 | | return slider_set(&(((hlsl_options*)arg)->converge_x[2]), 0.1f, "%3.1f", string, newval); |
| 2526 | return slider_set(&(((hlsl_options*)arg)->converge_x[2]), 0.1f, "%3.1f", str, newval); |
2527 | 2527 | } |
2528 | 2528 | |
2529 | | static INT32 slider_blue_converge_y(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2529 | static INT32 slider_blue_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval) |
2530 | 2530 | { |
2531 | 2531 | ((hlsl_options*)arg)->params_dirty = true; |
2532 | | return slider_set(&(((hlsl_options*)arg)->converge_y[2]), 0.1f, "%3.1f", string, newval); |
| 2532 | return slider_set(&(((hlsl_options*)arg)->converge_y[2]), 0.1f, "%3.1f", str, newval); |
2533 | 2533 | } |
2534 | 2534 | |
2535 | | static INT32 slider_red_radial_converge_x(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2535 | static INT32 slider_red_radial_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval) |
2536 | 2536 | { |
2537 | 2537 | ((hlsl_options*)arg)->params_dirty = true; |
2538 | | return slider_set(&(((hlsl_options*)arg)->radial_converge_x[0]), 0.1f, "%3.1f", string, newval); |
| 2538 | return slider_set(&(((hlsl_options*)arg)->radial_converge_x[0]), 0.1f, "%3.1f", str, newval); |
2539 | 2539 | } |
2540 | 2540 | |
2541 | | static INT32 slider_red_radial_converge_y(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2541 | static INT32 slider_red_radial_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval) |
2542 | 2542 | { |
2543 | 2543 | ((hlsl_options*)arg)->params_dirty = true; |
2544 | | return slider_set(&(((hlsl_options*)arg)->radial_converge_y[0]), 0.1f, "%3.1f", string, newval); |
| 2544 | return slider_set(&(((hlsl_options*)arg)->radial_converge_y[0]), 0.1f, "%3.1f", str, newval); |
2545 | 2545 | } |
2546 | 2546 | |
2547 | | static INT32 slider_green_radial_converge_x(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2547 | static INT32 slider_green_radial_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval) |
2548 | 2548 | { |
2549 | 2549 | ((hlsl_options*)arg)->params_dirty = true; |
2550 | | return slider_set(&(((hlsl_options*)arg)->radial_converge_x[1]), 0.1f, "%3.1f", string, newval); |
| 2550 | return slider_set(&(((hlsl_options*)arg)->radial_converge_x[1]), 0.1f, "%3.1f", str, newval); |
2551 | 2551 | } |
2552 | 2552 | |
2553 | | static INT32 slider_green_radial_converge_y(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2553 | static INT32 slider_green_radial_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval) |
2554 | 2554 | { |
2555 | 2555 | ((hlsl_options*)arg)->params_dirty = true; |
2556 | | return slider_set(&(((hlsl_options*)arg)->radial_converge_y[1]), 0.1f, "%3.1f", string, newval); |
| 2556 | return slider_set(&(((hlsl_options*)arg)->radial_converge_y[1]), 0.1f, "%3.1f", str, newval); |
2557 | 2557 | } |
2558 | 2558 | |
2559 | | static INT32 slider_blue_radial_converge_x(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2559 | static INT32 slider_blue_radial_converge_x(running_machine &machine, void *arg, astring *str, INT32 newval) |
2560 | 2560 | { |
2561 | 2561 | ((hlsl_options*)arg)->params_dirty = true; |
2562 | | return slider_set(&(((hlsl_options*)arg)->radial_converge_x[2]), 0.1f, "%3.1f", string, newval); |
| 2562 | return slider_set(&(((hlsl_options*)arg)->radial_converge_x[2]), 0.1f, "%3.1f", str, newval); |
2563 | 2563 | } |
2564 | 2564 | |
2565 | | static INT32 slider_blue_radial_converge_y(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2565 | static INT32 slider_blue_radial_converge_y(running_machine &machine, void *arg, astring *str, INT32 newval) |
2566 | 2566 | { |
2567 | 2567 | ((hlsl_options*)arg)->params_dirty = true; |
2568 | | return slider_set(&(((hlsl_options*)arg)->radial_converge_y[2]), 0.1f, "%3.1f", string, newval); |
| 2568 | return slider_set(&(((hlsl_options*)arg)->radial_converge_y[2]), 0.1f, "%3.1f", str, newval); |
2569 | 2569 | } |
2570 | 2570 | |
2571 | | static INT32 slider_red_from_r(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2571 | static INT32 slider_red_from_r(running_machine &machine, void *arg, astring *str, INT32 newval) |
2572 | 2572 | { |
2573 | 2573 | ((hlsl_options*)arg)->params_dirty = true; |
2574 | | return slider_set(&(((hlsl_options*)arg)->red_ratio[0]), 0.005f, "%2.3f", string, newval); |
| 2574 | return slider_set(&(((hlsl_options*)arg)->red_ratio[0]), 0.005f, "%2.3f", str, newval); |
2575 | 2575 | } |
2576 | 2576 | |
2577 | | static INT32 slider_red_from_g(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2577 | static INT32 slider_red_from_g(running_machine &machine, void *arg, astring *str, INT32 newval) |
2578 | 2578 | { |
2579 | 2579 | ((hlsl_options*)arg)->params_dirty = true; |
2580 | | return slider_set(&(((hlsl_options*)arg)->red_ratio[1]), 0.005f, "%2.3f", string, newval); |
| 2580 | return slider_set(&(((hlsl_options*)arg)->red_ratio[1]), 0.005f, "%2.3f", str, newval); |
2581 | 2581 | } |
2582 | 2582 | |
2583 | | static INT32 slider_red_from_b(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2583 | static INT32 slider_red_from_b(running_machine &machine, void *arg, astring *str, INT32 newval) |
2584 | 2584 | { |
2585 | 2585 | ((hlsl_options*)arg)->params_dirty = true; |
2586 | | return slider_set(&(((hlsl_options*)arg)->red_ratio[2]), 0.005f, "%2.3f", string, newval); |
| 2586 | return slider_set(&(((hlsl_options*)arg)->red_ratio[2]), 0.005f, "%2.3f", str, newval); |
2587 | 2587 | } |
2588 | 2588 | |
2589 | | static INT32 slider_green_from_r(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2589 | static INT32 slider_green_from_r(running_machine &machine, void *arg, astring *str, INT32 newval) |
2590 | 2590 | { |
2591 | 2591 | ((hlsl_options*)arg)->params_dirty = true; |
2592 | | return slider_set(&(((hlsl_options*)arg)->grn_ratio[0]), 0.005f, "%2.3f", string, newval); |
| 2592 | return slider_set(&(((hlsl_options*)arg)->grn_ratio[0]), 0.005f, "%2.3f", str, newval); |
2593 | 2593 | } |
2594 | 2594 | |
2595 | | static INT32 slider_green_from_g(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2595 | static INT32 slider_green_from_g(running_machine &machine, void *arg, astring *str, INT32 newval) |
2596 | 2596 | { |
2597 | 2597 | ((hlsl_options*)arg)->params_dirty = true; |
2598 | | return slider_set(&(((hlsl_options*)arg)->grn_ratio[1]), 0.005f, "%2.3f", string, newval); |
| 2598 | return slider_set(&(((hlsl_options*)arg)->grn_ratio[1]), 0.005f, "%2.3f", str, newval); |
2599 | 2599 | } |
2600 | 2600 | |
2601 | | static INT32 slider_green_from_b(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2601 | static INT32 slider_green_from_b(running_machine &machine, void *arg, astring *str, INT32 newval) |
2602 | 2602 | { |
2603 | 2603 | ((hlsl_options*)arg)->params_dirty = true; |
2604 | | return slider_set(&(((hlsl_options*)arg)->grn_ratio[2]), 0.005f, "%2.3f", string, newval); |
| 2604 | return slider_set(&(((hlsl_options*)arg)->grn_ratio[2]), 0.005f, "%2.3f", str, newval); |
2605 | 2605 | } |
2606 | 2606 | |
2607 | | static INT32 slider_blue_from_r(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2607 | static INT32 slider_blue_from_r(running_machine &machine, void *arg, astring *str, INT32 newval) |
2608 | 2608 | { |
2609 | 2609 | ((hlsl_options*)arg)->params_dirty = true; |
2610 | | return slider_set(&(((hlsl_options*)arg)->blu_ratio[0]), 0.005f, "%2.3f", string, newval); |
| 2610 | return slider_set(&(((hlsl_options*)arg)->blu_ratio[0]), 0.005f, "%2.3f", str, newval); |
2611 | 2611 | } |
2612 | 2612 | |
2613 | | static INT32 slider_blue_from_g(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2613 | static INT32 slider_blue_from_g(running_machine &machine, void *arg, astring *str, INT32 newval) |
2614 | 2614 | { |
2615 | 2615 | ((hlsl_options*)arg)->params_dirty = true; |
2616 | | return slider_set(&(((hlsl_options*)arg)->blu_ratio[1]), 0.005f, "%2.3f", string, newval); |
| 2616 | return slider_set(&(((hlsl_options*)arg)->blu_ratio[1]), 0.005f, "%2.3f", str, newval); |
2617 | 2617 | } |
2618 | 2618 | |
2619 | | static INT32 slider_blue_from_b(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2619 | static INT32 slider_blue_from_b(running_machine &machine, void *arg, astring *str, INT32 newval) |
2620 | 2620 | { |
2621 | 2621 | ((hlsl_options*)arg)->params_dirty = true; |
2622 | | return slider_set(&(((hlsl_options*)arg)->blu_ratio[2]), 0.005f, "%2.3f", string, newval); |
| 2622 | return slider_set(&(((hlsl_options*)arg)->blu_ratio[2]), 0.005f, "%2.3f", str, newval); |
2623 | 2623 | } |
2624 | 2624 | |
2625 | | static INT32 slider_red_offset(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2625 | static INT32 slider_red_offset(running_machine &machine, void *arg, astring *str, INT32 newval) |
2626 | 2626 | { |
2627 | 2627 | ((hlsl_options*)arg)->params_dirty = true; |
2628 | | return slider_set(&(((hlsl_options*)arg)->offset[0]), 0.01f, "%2.2f", string, newval); |
| 2628 | return slider_set(&(((hlsl_options*)arg)->offset[0]), 0.01f, "%2.2f", str, newval); |
2629 | 2629 | } |
2630 | 2630 | |
2631 | | static INT32 slider_green_offset(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2631 | static INT32 slider_green_offset(running_machine &machine, void *arg, astring *str, INT32 newval) |
2632 | 2632 | { |
2633 | 2633 | ((hlsl_options*)arg)->params_dirty = true; |
2634 | | return slider_set(&(((hlsl_options*)arg)->offset[1]), 0.01f, "%2.2f", string, newval); |
| 2634 | return slider_set(&(((hlsl_options*)arg)->offset[1]), 0.01f, "%2.2f", str, newval); |
2635 | 2635 | } |
2636 | 2636 | |
2637 | | static INT32 slider_blue_offset(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2637 | static INT32 slider_blue_offset(running_machine &machine, void *arg, astring *str, INT32 newval) |
2638 | 2638 | { |
2639 | 2639 | ((hlsl_options*)arg)->params_dirty = true; |
2640 | | return slider_set(&(((hlsl_options*)arg)->offset[2]), 0.01f, "%2.2f", string, newval); |
| 2640 | return slider_set(&(((hlsl_options*)arg)->offset[2]), 0.01f, "%2.2f", str, newval); |
2641 | 2641 | } |
2642 | 2642 | |
2643 | | static INT32 slider_red_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2643 | static INT32 slider_red_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2644 | 2644 | { |
2645 | 2645 | ((hlsl_options*)arg)->params_dirty = true; |
2646 | | return slider_set(&(((hlsl_options*)arg)->scale[0]), 0.01f, "%2.2f", string, newval); |
| 2646 | return slider_set(&(((hlsl_options*)arg)->scale[0]), 0.01f, "%2.2f", str, newval); |
2647 | 2647 | } |
2648 | 2648 | |
2649 | | static INT32 slider_green_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2649 | static INT32 slider_green_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2650 | 2650 | { |
2651 | 2651 | ((hlsl_options*)arg)->params_dirty = true; |
2652 | | return slider_set(&(((hlsl_options*)arg)->scale[1]), 0.01f, "%2.2f", string, newval); |
| 2652 | return slider_set(&(((hlsl_options*)arg)->scale[1]), 0.01f, "%2.2f", str, newval); |
2653 | 2653 | } |
2654 | 2654 | |
2655 | | static INT32 slider_blue_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2655 | static INT32 slider_blue_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2656 | 2656 | { |
2657 | 2657 | ((hlsl_options*)arg)->params_dirty = true; |
2658 | | return slider_set(&(((hlsl_options*)arg)->scale[2]), 0.01f, "%2.2f", string, newval); |
| 2658 | return slider_set(&(((hlsl_options*)arg)->scale[2]), 0.01f, "%2.2f", str, newval); |
2659 | 2659 | } |
2660 | 2660 | |
2661 | | static INT32 slider_red_power(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2661 | static INT32 slider_red_power(running_machine &machine, void *arg, astring *str, INT32 newval) |
2662 | 2662 | { |
2663 | 2663 | ((hlsl_options*)arg)->params_dirty = true; |
2664 | | return slider_set(&(((hlsl_options*)arg)->power[0]), 0.05f, "%2.2f", string, newval); |
| 2664 | return slider_set(&(((hlsl_options*)arg)->power[0]), 0.05f, "%2.2f", str, newval); |
2665 | 2665 | } |
2666 | 2666 | |
2667 | | static INT32 slider_green_power(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2667 | static INT32 slider_green_power(running_machine &machine, void *arg, astring *str, INT32 newval) |
2668 | 2668 | { |
2669 | 2669 | ((hlsl_options*)arg)->params_dirty = true; |
2670 | | return slider_set(&(((hlsl_options*)arg)->power[1]), 0.05f, "%2.2f", string, newval); |
| 2670 | return slider_set(&(((hlsl_options*)arg)->power[1]), 0.05f, "%2.2f", str, newval); |
2671 | 2671 | } |
2672 | 2672 | |
2673 | | static INT32 slider_blue_power(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2673 | static INT32 slider_blue_power(running_machine &machine, void *arg, astring *str, INT32 newval) |
2674 | 2674 | { |
2675 | 2675 | ((hlsl_options*)arg)->params_dirty = true; |
2676 | | return slider_set(&(((hlsl_options*)arg)->power[2]), 0.05f, "%2.2f", string, newval); |
| 2676 | return slider_set(&(((hlsl_options*)arg)->power[2]), 0.05f, "%2.2f", str, newval); |
2677 | 2677 | } |
2678 | 2678 | |
2679 | | static INT32 slider_red_floor(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2679 | static INT32 slider_red_floor(running_machine &machine, void *arg, astring *str, INT32 newval) |
2680 | 2680 | { |
2681 | 2681 | ((hlsl_options*)arg)->params_dirty = true; |
2682 | | return slider_set(&(((hlsl_options*)arg)->floor[0]), 0.01f, "%2.2f", string, newval); |
| 2682 | return slider_set(&(((hlsl_options*)arg)->floor[0]), 0.01f, "%2.2f", str, newval); |
2683 | 2683 | } |
2684 | 2684 | |
2685 | | static INT32 slider_green_floor(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2685 | static INT32 slider_green_floor(running_machine &machine, void *arg, astring *str, INT32 newval) |
2686 | 2686 | { |
2687 | 2687 | ((hlsl_options*)arg)->params_dirty = true; |
2688 | | return slider_set(&(((hlsl_options*)arg)->floor[1]), 0.01f, "%2.2f", string, newval); |
| 2688 | return slider_set(&(((hlsl_options*)arg)->floor[1]), 0.01f, "%2.2f", str, newval); |
2689 | 2689 | } |
2690 | 2690 | |
2691 | | static INT32 slider_blue_floor(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2691 | static INT32 slider_blue_floor(running_machine &machine, void *arg, astring *str, INT32 newval) |
2692 | 2692 | { |
2693 | 2693 | ((hlsl_options*)arg)->params_dirty = true; |
2694 | | return slider_set(&(((hlsl_options*)arg)->floor[2]), 0.01f, "%2.2f", string, newval); |
| 2694 | return slider_set(&(((hlsl_options*)arg)->floor[2]), 0.01f, "%2.2f", str, newval); |
2695 | 2695 | } |
2696 | 2696 | |
2697 | | static INT32 slider_red_phosphor_life(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2697 | static INT32 slider_red_phosphor_life(running_machine &machine, void *arg, astring *str, INT32 newval) |
2698 | 2698 | { |
2699 | 2699 | ((hlsl_options*)arg)->params_dirty = true; |
2700 | | return slider_set(&(((hlsl_options*)arg)->phosphor[0]), 0.01f, "%2.2f", string, newval); |
| 2700 | return slider_set(&(((hlsl_options*)arg)->phosphor[0]), 0.01f, "%2.2f", str, newval); |
2701 | 2701 | } |
2702 | 2702 | |
2703 | | static INT32 slider_green_phosphor_life(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2703 | static INT32 slider_green_phosphor_life(running_machine &machine, void *arg, astring *str, INT32 newval) |
2704 | 2704 | { |
2705 | 2705 | ((hlsl_options*)arg)->params_dirty = true; |
2706 | | return slider_set(&(((hlsl_options*)arg)->phosphor[1]), 0.01f, "%2.2f", string, newval); |
| 2706 | return slider_set(&(((hlsl_options*)arg)->phosphor[1]), 0.01f, "%2.2f", str, newval); |
2707 | 2707 | } |
2708 | 2708 | |
2709 | | static INT32 slider_blue_phosphor_life(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2709 | static INT32 slider_blue_phosphor_life(running_machine &machine, void *arg, astring *str, INT32 newval) |
2710 | 2710 | { |
2711 | 2711 | ((hlsl_options*)arg)->params_dirty = true; |
2712 | | return slider_set(&(((hlsl_options*)arg)->phosphor[2]), 0.01f, "%2.2f", string, newval); |
| 2712 | return slider_set(&(((hlsl_options*)arg)->phosphor[2]), 0.01f, "%2.2f", str, newval); |
2713 | 2713 | } |
2714 | 2714 | |
2715 | | static INT32 slider_saturation(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2715 | static INT32 slider_saturation(running_machine &machine, void *arg, astring *str, INT32 newval) |
2716 | 2716 | { |
2717 | 2717 | ((hlsl_options*)arg)->params_dirty = true; |
2718 | | return slider_set(&(((hlsl_options*)arg)->saturation), 0.01f, "%2.2f", string, newval); |
| 2718 | return slider_set(&(((hlsl_options*)arg)->saturation), 0.01f, "%2.2f", str, newval); |
2719 | 2719 | } |
2720 | 2720 | |
2721 | | static INT32 slider_vector_attenuation(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2721 | static INT32 slider_vector_attenuation(running_machine &machine, void *arg, astring *str, INT32 newval) |
2722 | 2722 | { |
2723 | 2723 | ((hlsl_options*)arg)->params_dirty = true; |
2724 | | return slider_set(&(((hlsl_options*)arg)->vector_length_scale), 0.01f, "%1.2f", string, newval); |
| 2724 | return slider_set(&(((hlsl_options*)arg)->vector_length_scale), 0.01f, "%1.2f", str, newval); |
2725 | 2725 | } |
2726 | 2726 | |
2727 | | static INT32 slider_vector_length_max(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2727 | static INT32 slider_vector_length_max(running_machine &machine, void *arg, astring *str, INT32 newval) |
2728 | 2728 | { |
2729 | 2729 | ((hlsl_options*)arg)->params_dirty = true; |
2730 | | return slider_set(&(((hlsl_options*)arg)->vector_length_ratio), 1.0f, "%4f", string, newval); |
| 2730 | return slider_set(&(((hlsl_options*)arg)->vector_length_ratio), 1.0f, "%4f", str, newval); |
2731 | 2731 | } |
2732 | 2732 | |
2733 | | static INT32 slider_vector_bloom_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2733 | static INT32 slider_vector_bloom_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2734 | 2734 | { |
2735 | 2735 | ((hlsl_options*)arg)->params_dirty = true; |
2736 | | return slider_set(&(((hlsl_options*)arg)->vector_bloom_scale), 0.001f, "%1.3f", string, newval); |
| 2736 | return slider_set(&(((hlsl_options*)arg)->vector_bloom_scale), 0.001f, "%1.3f", str, newval); |
2737 | 2737 | } |
2738 | 2738 | |
2739 | | static INT32 slider_raster_bloom_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2739 | static INT32 slider_raster_bloom_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2740 | 2740 | { |
2741 | 2741 | ((hlsl_options*)arg)->params_dirty = true; |
2742 | | return slider_set(&(((hlsl_options*)arg)->raster_bloom_scale), 0.001f, "%1.3f", string, newval); |
| 2742 | return slider_set(&(((hlsl_options*)arg)->raster_bloom_scale), 0.001f, "%1.3f", str, newval); |
2743 | 2743 | } |
2744 | 2744 | |
2745 | | static INT32 slider_bloom_lvl0_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2745 | static INT32 slider_bloom_lvl0_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2746 | 2746 | { |
2747 | 2747 | ((hlsl_options*)arg)->params_dirty = true; |
2748 | | return slider_set(&(((hlsl_options*)arg)->bloom_level0_weight), 0.01f, "%1.2f", string, newval); |
| 2748 | return slider_set(&(((hlsl_options*)arg)->bloom_level0_weight), 0.01f, "%1.2f", str, newval); |
2749 | 2749 | } |
2750 | 2750 | |
2751 | | static INT32 slider_bloom_lvl1_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2751 | static INT32 slider_bloom_lvl1_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2752 | 2752 | { |
2753 | 2753 | ((hlsl_options*)arg)->params_dirty = true; |
2754 | | return slider_set(&(((hlsl_options*)arg)->bloom_level1_weight), 0.01f, "%1.2f", string, newval); |
| 2754 | return slider_set(&(((hlsl_options*)arg)->bloom_level1_weight), 0.01f, "%1.2f", str, newval); |
2755 | 2755 | } |
2756 | 2756 | |
2757 | | static INT32 slider_bloom_lvl2_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2757 | static INT32 slider_bloom_lvl2_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2758 | 2758 | { |
2759 | 2759 | ((hlsl_options*)arg)->params_dirty = true; |
2760 | | return slider_set(&(((hlsl_options*)arg)->bloom_level2_weight), 0.01f, "%1.2f", string, newval); |
| 2760 | return slider_set(&(((hlsl_options*)arg)->bloom_level2_weight), 0.01f, "%1.2f", str, newval); |
2761 | 2761 | } |
2762 | 2762 | |
2763 | | static INT32 slider_bloom_lvl3_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2763 | static INT32 slider_bloom_lvl3_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2764 | 2764 | { |
2765 | 2765 | ((hlsl_options*)arg)->params_dirty = true; |
2766 | | return slider_set(&(((hlsl_options*)arg)->bloom_level3_weight), 0.01f, "%1.2f", string, newval); |
| 2766 | return slider_set(&(((hlsl_options*)arg)->bloom_level3_weight), 0.01f, "%1.2f", str, newval); |
2767 | 2767 | } |
2768 | 2768 | |
2769 | | static INT32 slider_bloom_lvl4_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2769 | static INT32 slider_bloom_lvl4_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2770 | 2770 | { |
2771 | 2771 | ((hlsl_options*)arg)->params_dirty = true; |
2772 | | return slider_set(&(((hlsl_options*)arg)->bloom_level4_weight), 0.01f, "%1.2f", string, newval); |
| 2772 | return slider_set(&(((hlsl_options*)arg)->bloom_level4_weight), 0.01f, "%1.2f", str, newval); |
2773 | 2773 | } |
2774 | 2774 | |
2775 | | static INT32 slider_bloom_lvl5_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2775 | static INT32 slider_bloom_lvl5_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2776 | 2776 | { |
2777 | 2777 | ((hlsl_options*)arg)->params_dirty = true; |
2778 | | return slider_set(&(((hlsl_options*)arg)->bloom_level5_weight), 0.01f, "%1.2f", string, newval); |
| 2778 | return slider_set(&(((hlsl_options*)arg)->bloom_level5_weight), 0.01f, "%1.2f", str, newval); |
2779 | 2779 | } |
2780 | 2780 | |
2781 | | static INT32 slider_bloom_lvl6_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2781 | static INT32 slider_bloom_lvl6_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2782 | 2782 | { |
2783 | 2783 | ((hlsl_options*)arg)->params_dirty = true; |
2784 | | return slider_set(&(((hlsl_options*)arg)->bloom_level6_weight), 0.01f, "%1.2f", string, newval); |
| 2784 | return slider_set(&(((hlsl_options*)arg)->bloom_level6_weight), 0.01f, "%1.2f", str, newval); |
2785 | 2785 | } |
2786 | 2786 | |
2787 | | static INT32 slider_bloom_lvl7_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2787 | static INT32 slider_bloom_lvl7_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2788 | 2788 | { |
2789 | 2789 | ((hlsl_options*)arg)->params_dirty = true; |
2790 | | return slider_set(&(((hlsl_options*)arg)->bloom_level7_weight), 0.01f, "%1.2f", string, newval); |
| 2790 | return slider_set(&(((hlsl_options*)arg)->bloom_level7_weight), 0.01f, "%1.2f", str, newval); |
2791 | 2791 | } |
2792 | 2792 | |
2793 | | static INT32 slider_bloom_lvl8_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2793 | static INT32 slider_bloom_lvl8_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2794 | 2794 | { |
2795 | 2795 | ((hlsl_options*)arg)->params_dirty = true; |
2796 | | return slider_set(&(((hlsl_options*)arg)->bloom_level8_weight), 0.01f, "%1.2f", string, newval); |
| 2796 | return slider_set(&(((hlsl_options*)arg)->bloom_level8_weight), 0.01f, "%1.2f", str, newval); |
2797 | 2797 | } |
2798 | 2798 | |
2799 | | static INT32 slider_bloom_lvl9_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2799 | static INT32 slider_bloom_lvl9_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2800 | 2800 | { |
2801 | 2801 | ((hlsl_options*)arg)->params_dirty = true; |
2802 | | return slider_set(&(((hlsl_options*)arg)->bloom_level9_weight), 0.01f, "%1.2f", string, newval); |
| 2802 | return slider_set(&(((hlsl_options*)arg)->bloom_level9_weight), 0.01f, "%1.2f", str, newval); |
2803 | 2803 | } |
2804 | 2804 | |
2805 | | static INT32 slider_bloom_lvl10_scale(running_machine &machine, void *arg, astring *string, INT32 newval) |
| 2805 | static INT32 slider_bloom_lvl10_scale(running_machine &machine, void *arg, astring *str, INT32 newval) |
2806 | 2806 | { |
2807 | 2807 | ((hlsl_options*)arg)->params_dirty = true; |
2808 | | return slider_set(&(((hlsl_options*)arg)->bloom_level10_weight), 0.01f, "%1.2f", string, newval); |
| 2808 | return slider_set(&(((hlsl_options*)arg)->bloom_level10_weight), 0.01f, "%1.2f", str, newval); |
2809 | 2809 | } |
2810 | 2810 | |
2811 | 2811 | //============================================================ |