diff options
Diffstat (limited to 'src/osd/windows')
36 files changed, 1264 insertions, 1266 deletions
diff --git a/src/osd/windows/d3d8intf.c b/src/osd/windows/d3d8intf.c index 3352141d838..fa408d8cf65 100644 --- a/src/osd/windows/d3d8intf.c +++ b/src/osd/windows/d3d8intf.c @@ -238,20 +238,20 @@ static HRESULT d3d_get_caps_dword(d3d_base *d3dptr, UINT adapter, D3DDEVTYPE dev HRESULT result = IDirect3D8_GetDeviceCaps(d3d8, adapter, devtype, &caps); switch (which) { - case CAPS_PRESENTATION_INTERVALS: *value = caps.PresentationIntervals; break; - case CAPS_CAPS2: *value = caps.DevCaps; break; - case CAPS_DEV_CAPS: *value = caps.DevCaps; break; - case CAPS_SRCBLEND_CAPS: *value = caps.SrcBlendCaps; break; - case CAPS_DSTBLEND_CAPS: *value = caps.DestBlendCaps; break; - case CAPS_TEXTURE_CAPS: *value = caps.TextureCaps; break; - case CAPS_TEXTURE_FILTER_CAPS: *value = caps.TextureFilterCaps; break; - case CAPS_TEXTURE_ADDRESS_CAPS: *value = caps.TextureAddressCaps; break; - case CAPS_TEXTURE_OP_CAPS: *value = caps.TextureOpCaps; break; - case CAPS_MAX_TEXTURE_ASPECT: *value = caps.MaxTextureAspectRatio; break; - case CAPS_MAX_TEXTURE_WIDTH: *value = caps.MaxTextureWidth; break; - case CAPS_MAX_TEXTURE_HEIGHT: *value = caps.MaxTextureHeight; break; - case CAPS_STRETCH_RECT_FILTER: *value = 0; break; - case CAPS_MAX_PS30_INSN_SLOTS: *value = 0; break; + case CAPS_PRESENTATION_INTERVALS: *value = caps.PresentationIntervals; break; + case CAPS_CAPS2: *value = caps.DevCaps; break; + case CAPS_DEV_CAPS: *value = caps.DevCaps; break; + case CAPS_SRCBLEND_CAPS: *value = caps.SrcBlendCaps; break; + case CAPS_DSTBLEND_CAPS: *value = caps.DestBlendCaps; break; + case CAPS_TEXTURE_CAPS: *value = caps.TextureCaps; break; + case CAPS_TEXTURE_FILTER_CAPS: *value = caps.TextureFilterCaps; break; + case CAPS_TEXTURE_ADDRESS_CAPS: *value = caps.TextureAddressCaps; break; + case CAPS_TEXTURE_OP_CAPS: *value = caps.TextureOpCaps; break; + case CAPS_MAX_TEXTURE_ASPECT: *value = caps.MaxTextureAspectRatio; break; + case CAPS_MAX_TEXTURE_WIDTH: *value = caps.MaxTextureWidth; break; + case CAPS_MAX_TEXTURE_HEIGHT: *value = caps.MaxTextureHeight; break; + case CAPS_STRETCH_RECT_FILTER: *value = 0; break; + case CAPS_MAX_PS30_INSN_SLOTS: *value = 0; break; } return result; } diff --git a/src/osd/windows/d3d9intf.c b/src/osd/windows/d3d9intf.c index a4975f7e5c0..dc15f8f4d29 100644 --- a/src/osd/windows/d3d9intf.c +++ b/src/osd/windows/d3d9intf.c @@ -263,20 +263,20 @@ static HRESULT d3d_get_caps_dword(d3d_base *d3dptr, UINT adapter, D3DDEVTYPE dev HRESULT result = IDirect3D9_GetDeviceCaps(d3d9, adapter, devtype, &caps); switch (which) { - case CAPS_PRESENTATION_INTERVALS: *value = caps.PresentationIntervals; break; - case CAPS_CAPS2: *value = caps.Caps2; break; - case CAPS_DEV_CAPS: *value = caps.DevCaps; break; - case CAPS_SRCBLEND_CAPS: *value = caps.SrcBlendCaps; break; - case CAPS_DSTBLEND_CAPS: *value = caps.DestBlendCaps; break; - case CAPS_TEXTURE_CAPS: *value = caps.TextureCaps; break; - case CAPS_TEXTURE_FILTER_CAPS: *value = caps.TextureFilterCaps; break; - case CAPS_TEXTURE_ADDRESS_CAPS: *value = caps.TextureAddressCaps; break; - case CAPS_TEXTURE_OP_CAPS: *value = caps.TextureOpCaps; break; - case CAPS_MAX_TEXTURE_ASPECT: *value = caps.MaxTextureAspectRatio; break; - case CAPS_MAX_TEXTURE_WIDTH: *value = caps.MaxTextureWidth; break; - case CAPS_MAX_TEXTURE_HEIGHT: *value = caps.MaxTextureHeight; break; - case CAPS_STRETCH_RECT_FILTER: *value = caps.StretchRectFilterCaps; break; - case CAPS_MAX_PS30_INSN_SLOTS: *value = caps.MaxPixelShader30InstructionSlots; break; + case CAPS_PRESENTATION_INTERVALS: *value = caps.PresentationIntervals; break; + case CAPS_CAPS2: *value = caps.Caps2; break; + case CAPS_DEV_CAPS: *value = caps.DevCaps; break; + case CAPS_SRCBLEND_CAPS: *value = caps.SrcBlendCaps; break; + case CAPS_DSTBLEND_CAPS: *value = caps.DestBlendCaps; break; + case CAPS_TEXTURE_CAPS: *value = caps.TextureCaps; break; + case CAPS_TEXTURE_FILTER_CAPS: *value = caps.TextureFilterCaps; break; + case CAPS_TEXTURE_ADDRESS_CAPS: *value = caps.TextureAddressCaps; break; + case CAPS_TEXTURE_OP_CAPS: *value = caps.TextureOpCaps; break; + case CAPS_MAX_TEXTURE_ASPECT: *value = caps.MaxTextureAspectRatio; break; + case CAPS_MAX_TEXTURE_WIDTH: *value = caps.MaxTextureWidth; break; + case CAPS_MAX_TEXTURE_HEIGHT: *value = caps.MaxTextureHeight; break; + case CAPS_STRETCH_RECT_FILTER: *value = caps.StretchRectFilterCaps; break; + case CAPS_MAX_PS30_INSN_SLOTS: *value = caps.MaxPixelShader30InstructionSlots; break; } return result; } diff --git a/src/osd/windows/d3dcomm.h b/src/osd/windows/d3dcomm.h index fedcd6ebbac..806e4aa7a17 100644 --- a/src/osd/windows/d3dcomm.h +++ b/src/osd/windows/d3dcomm.h @@ -55,55 +55,55 @@ /* d3d_texture_info holds information about a texture */ struct d3d_texture_info { - d3d_texture_info * next; // next texture in the list - d3d_texture_info * prev; // prev texture in the list - UINT32 hash; // hash value for the texture - UINT32 flags; // rendering flags - render_texinfo texinfo; // copy of the texture info - float ustart, ustop; // beginning/ending U coordinates - float vstart, vstop; // beginning/ending V coordinates - int rawwidth, rawheight; // raw width/height of the texture - int type; // what type of texture are we? - int xborderpix; // number of border pixels in X - int yborderpix; // number of border pixels in Y - int xprescale; // what is our X prescale factor? - int yprescale; // what is our Y prescale factor? - int cur_frame; // what is our current frame? - int prev_frame; // what was our last frame? (used to determine pause state) - d3d_texture * d3dtex; // Direct3D texture pointer - d3d_surface * d3dsurface; // Direct3D offscreen plain surface pointer - d3d_texture * d3dfinaltex; // Direct3D final (post-scaled) texture - int target_index; // Direct3D target index + d3d_texture_info * next; // next texture in the list + d3d_texture_info * prev; // prev texture in the list + UINT32 hash; // hash value for the texture + UINT32 flags; // rendering flags + render_texinfo texinfo; // copy of the texture info + float ustart, ustop; // beginning/ending U coordinates + float vstart, vstop; // beginning/ending V coordinates + int rawwidth, rawheight; // raw width/height of the texture + int type; // what type of texture are we? + int xborderpix; // number of border pixels in X + int yborderpix; // number of border pixels in Y + int xprescale; // what is our X prescale factor? + int yprescale; // what is our Y prescale factor? + int cur_frame; // what is our current frame? + int prev_frame; // what was our last frame? (used to determine pause state) + d3d_texture * d3dtex; // Direct3D texture pointer + d3d_surface * d3dsurface; // Direct3D offscreen plain surface pointer + d3d_texture * d3dfinaltex; // Direct3D final (post-scaled) texture + int target_index; // Direct3D target index }; /* d3d_poly_info holds information about a single polygon/d3d primitive */ struct d3d_poly_info { - D3DPRIMITIVETYPE type; // type of primitive - UINT32 count; // total number of primitives - UINT32 numverts; // total number of vertices - UINT32 flags; // rendering flags - DWORD modmode; // texture modulation mode - d3d_texture_info * texture; // pointer to texture info + D3DPRIMITIVETYPE type; // type of primitive + UINT32 count; // total number of primitives + UINT32 numverts; // total number of vertices + UINT32 flags; // rendering flags + DWORD modmode; // texture modulation mode + d3d_texture_info * texture; // pointer to texture info }; /* d3d_vertex describes a single vertex */ struct d3d_vertex { - float x, y, z; // X,Y,Z coordinates - float rhw; // RHW when no HLSL, padding when HLSL - D3DCOLOR color; // diffuse color - float u0, v0; // texture stage 0 coordinates + float x, y, z; // X,Y,Z coordinates + float rhw; // RHW when no HLSL, padding when HLSL + D3DCOLOR color; // diffuse color + float u0, v0; // texture stage 0 coordinates }; /* line_aa_step is used for drawing antialiased lines */ struct line_aa_step { - float xoffs, yoffs; // X/Y deltas - float weight; // weight contribution + float xoffs, yoffs; // X/Y deltas + float weight; // weight contribution }; diff --git a/src/osd/windows/d3dhlsl.c b/src/osd/windows/d3dhlsl.c index b316642db90..f21312217f4 100644 --- a/src/osd/windows/d3dhlsl.c +++ b/src/osd/windows/d3dhlsl.c @@ -85,7 +85,7 @@ static hlsl_options g_hlsl_presets[4] = { - { // 25% Shadow mask, 50% Scanlines, 3% Pincushion, 0 defocus, No Tint, 0.9 Exponent, 5% Floor, 25% Phosphor Return, 120% Saturation + { // 25% Shadow mask, 50% Scanlines, 3% Pincushion, 0 defocus, No Tint, 0.9 Exponent, 5% Floor, 25% Phosphor Return, 120% Saturation true, 0.25f, { "aperture.png" }, 320, 240, 0.09375f, 0.109375f, 0.03f, 0.03f, @@ -106,7 +106,7 @@ static hlsl_options g_hlsl_presets[4] = 1.2f, false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0 }, - { // 25% Shadow mask, 0% Scanlines, 3% Pincushion, 0 defocus, No Tint, 0.9 Exponent, 5% Floor, 25% Phosphor Return, 120% Saturation + { // 25% Shadow mask, 0% Scanlines, 3% Pincushion, 0 defocus, No Tint, 0.9 Exponent, 5% Floor, 25% Phosphor Return, 120% Saturation true, 0.25f, { "aperture.png" }, 320, 240, 0.09375f, 0.109375f, 0.03f, 0.03f, @@ -127,7 +127,7 @@ static hlsl_options g_hlsl_presets[4] = 1.2f, false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0 }, - { // 25% Shadow mask, 0% Scanlines, 0% Pincushion, 0 defocus, No Tint, 0.9 Exponent, 5% Floor, 25% Phosphor Return, 120% Saturation + { // 25% Shadow mask, 0% Scanlines, 0% Pincushion, 0 defocus, No Tint, 0.9 Exponent, 5% Floor, 25% Phosphor Return, 120% Saturation true, 0.25f, { "aperture.png" }, 320, 240, 0.09375f, 0.109375f, 0.0f, 0.0f, @@ -148,7 +148,7 @@ static hlsl_options g_hlsl_presets[4] = 1.2f, false, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0 }, - { // 25% Shadow mask, 100% Scanlines, 15% Pincushion, 3 defocus, 24-degree Tint Out, 1.5 Exponent, 5% Floor, 70% Phosphor Return, 80% Saturation, Bad Convergence + { // 25% Shadow mask, 100% Scanlines, 15% Pincushion, 3 defocus, 24-degree Tint Out, 1.5 Exponent, 5% Floor, 70% Phosphor Return, 80% Saturation, Bad Convergence true, 0.25f, { "aperture.png" }, 320, 240, 0.09375f, 0.109375f, 0.15f, 0.15f, @@ -2805,5 +2805,5 @@ static file_error open_next(d3d_info *d3d, emu_file &file, const char *templ, co // create the final file file.set_openflags(origflags); - return file.open(fname); + return file.open(fname); } diff --git a/src/osd/windows/d3dhlsl.h b/src/osd/windows/d3dhlsl.h index 2a7f0c6d15f..32786776ad7 100644 --- a/src/osd/windows/d3dhlsl.h +++ b/src/osd/windows/d3dhlsl.h @@ -48,7 +48,7 @@ // CONSTANTS //============================================================ -#define HLSL_VECTOR (0) +#define HLSL_VECTOR (0) //============================================================ // TYPE DEFINITIONS @@ -62,47 +62,47 @@ struct d3d_info; /* in the future this will be moved into an OSD/emu shared buffer */ struct hlsl_options { - bool params_dirty; - float shadow_mask_alpha; - char shadow_mask_texture[1024]; - int shadow_mask_count_x; - int shadow_mask_count_y; - float shadow_mask_u_size; - float shadow_mask_v_size; - float curvature; - float pincushion; - float scanline_alpha; - float scanline_scale; - float scanline_height; - float scanline_bright_scale; - float scanline_bright_offset; - float scanline_offset; - float defocus[4]; - float converge_x[3]; - float converge_y[3]; - float radial_converge_x[3]; - float radial_converge_y[3]; - float red_ratio[3]; - float grn_ratio[3]; - float blu_ratio[3]; - float offset[3]; - float scale[3]; - float power[3]; - float floor[3]; - float phosphor[3]; - float saturation; - bool yiq_enable; - float yiq_cc; - float yiq_a; - float yiq_b; - float yiq_o; - float yiq_p; - float yiq_n; - float yiq_y; - float yiq_i; - float yiq_q; - float yiq_scan_time; - int yiq_phase_count; + bool params_dirty; + float shadow_mask_alpha; + char shadow_mask_texture[1024]; + int shadow_mask_count_x; + int shadow_mask_count_y; + float shadow_mask_u_size; + float shadow_mask_v_size; + float curvature; + float pincushion; + float scanline_alpha; + float scanline_scale; + float scanline_height; + float scanline_bright_scale; + float scanline_bright_offset; + float scanline_offset; + float defocus[4]; + float converge_x[3]; + float converge_y[3]; + float radial_converge_x[3]; + float radial_converge_y[3]; + float red_ratio[3]; + float grn_ratio[3]; + float blu_ratio[3]; + float offset[3]; + float scale[3]; + float power[3]; + float floor[3]; + float phosphor[3]; + float saturation; + bool yiq_enable; + float yiq_cc; + float yiq_a; + float yiq_b; + float yiq_o; + float yiq_p; + float yiq_n; + float yiq_y; + float yiq_i; + float yiq_q; + float yiq_scan_time; + int yiq_phase_count; }; class hlsl_info @@ -141,11 +141,11 @@ public: void frame_complete(); - void set_texture(d3d_texture_info *texture); - d3d_render_target * find_render_target(d3d_texture_info *info); - void remove_render_target(d3d_texture_info *texture); - void remove_render_target(int width, int height, UINT32 screen_index, UINT32 page_index); - void remove_render_target(d3d_render_target *rt); + void set_texture(d3d_texture_info *texture); + d3d_render_target * find_render_target(d3d_texture_info *info); + void remove_render_target(d3d_texture_info *texture); + void remove_render_target(int width, int height, UINT32 screen_index, UINT32 page_index); + void remove_render_target(d3d_render_target *rt); int create_resources(bool reset); void delete_resources(bool reset); @@ -154,79 +154,79 @@ public: slider_state *init_slider_list(); private: - void enumerate_screens(); - - void end_avi_recording(); - void begin_avi_recording(const char *name); - - bool register_texture(d3d_texture_info *texture, int width, int height, int xscale, int yscale); - - d3d_render_target* find_render_target(int width, int height, UINT32 screen_index, UINT32 page_index); - d3d_cache_target * find_cache_target(UINT32 screen_index, int width, int height); - void remove_cache_target(d3d_cache_target *cache); - - d3d_base * d3dintf; // D3D interface - win_window_info * window; // D3D window info - - bool master_enable; // overall enable flag - bool vector_enable; // vector post-processing enable flag - bool paused; // whether or not rendering is currently paused - int num_screens; // number of emulated physical screens - int curr_screen; // current screen for render target operations - int curr_frame; // current frame (0/1) of a screen for render target operations - int lastidx; // index of the last-encountered target - bool write_ini; // enable external ini saving - bool read_ini; // enable external ini loading - int prescale_force_x; // prescale force x - int prescale_force_y; // prescale force y - int prescale_size_x; // prescale size x - int prescale_size_y; // prescale size y - int preset; // preset, if relevant - bitmap_argb32 shadow_bitmap; // shadow mask bitmap for post-processing shader - d3d_texture_info * shadow_texture; // shadow mask texture for post-processing shader - hlsl_options * options; // current uniform state - - avi_file * avi_output_file; // AVI file - bitmap_rgb32 avi_snap; // AVI snapshot - int avi_frame; // AVI frame - attotime avi_frame_period; // AVI frame period - attotime avi_next_frame_time; // AVI next frame time - d3d_surface * avi_copy_surface; // AVI destination surface in system memory - d3d_texture * avi_copy_texture; // AVI destination texture in system memory - d3d_surface * avi_final_target; // AVI upscaled surface - d3d_texture * avi_final_texture; // AVI upscaled texture - - bool render_snap; // whether or not to take HLSL post-render snapshot - bool snap_rendered; // whether we just rendered our HLSL post-render shot or not - d3d_surface * snap_copy_target; // snapshot destination surface in system memory - d3d_texture * snap_copy_texture; // snapshot destination surface in system memory - d3d_surface * snap_target; // snapshot upscaled surface - d3d_texture * snap_texture; // snapshot upscaled texture - int snap_width; // snapshot width - int snap_height; // snapshot height - bool lines_pending; // whether or not we have lines to flush on the next quad + void enumerate_screens(); + + void end_avi_recording(); + void begin_avi_recording(const char *name); + + bool register_texture(d3d_texture_info *texture, int width, int height, int xscale, int yscale); + + d3d_render_target* find_render_target(int width, int height, UINT32 screen_index, UINT32 page_index); + d3d_cache_target * find_cache_target(UINT32 screen_index, int width, int height); + void remove_cache_target(d3d_cache_target *cache); + + d3d_base * d3dintf; // D3D interface + win_window_info * window; // D3D window info + + bool master_enable; // overall enable flag + bool vector_enable; // vector post-processing enable flag + bool paused; // whether or not rendering is currently paused + int num_screens; // number of emulated physical screens + int curr_screen; // current screen for render target operations + int curr_frame; // current frame (0/1) of a screen for render target operations + int lastidx; // index of the last-encountered target + bool write_ini; // enable external ini saving + bool read_ini; // enable external ini loading + int prescale_force_x; // prescale force x + int prescale_force_y; // prescale force y + int prescale_size_x; // prescale size x + int prescale_size_y; // prescale size y + int preset; // preset, if relevant + bitmap_argb32 shadow_bitmap; // shadow mask bitmap for post-processing shader + d3d_texture_info * shadow_texture; // shadow mask texture for post-processing shader + hlsl_options * options; // current uniform state + + avi_file * avi_output_file; // AVI file + bitmap_rgb32 avi_snap; // AVI snapshot + int avi_frame; // AVI frame + attotime avi_frame_period; // AVI frame period + attotime avi_next_frame_time; // AVI next frame time + d3d_surface * avi_copy_surface; // AVI destination surface in system memory + d3d_texture * avi_copy_texture; // AVI destination texture in system memory + d3d_surface * avi_final_target; // AVI upscaled surface + d3d_texture * avi_final_texture; // AVI upscaled texture + + bool render_snap; // whether or not to take HLSL post-render snapshot + bool snap_rendered; // whether we just rendered our HLSL post-render shot or not + d3d_surface * snap_copy_target; // snapshot destination surface in system memory + d3d_texture * snap_copy_texture; // snapshot destination surface in system memory + d3d_surface * snap_target; // snapshot upscaled surface + d3d_texture * snap_texture; // snapshot upscaled texture + int snap_width; // snapshot width + int snap_height; // snapshot height + bool lines_pending; // whether or not we have lines to flush on the next quad // HLSL effects - d3d_surface * backbuffer; // pointer to our device's backbuffer - d3d_effect * curr_effect; // pointer to the currently active effect object - d3d_effect * effect; // pointer to the primary-effect object - d3d_effect * prescale_effect; // pointer to the prescale-effect object - d3d_effect * post_effect; // pointer to the post-effect object - d3d_effect * pincushion_effect; // pointer to the pincushion-effect object - d3d_effect * focus_effect; // pointer to the focus-effect object - d3d_effect * phosphor_effect; // pointer to the phosphor-effect object - d3d_effect * deconverge_effect; // pointer to the deconvergence-effect object - d3d_effect * color_effect; // pointer to the color-effect object - d3d_effect * yiq_encode_effect; // pointer to the YIQ encoder effect object - d3d_effect * yiq_decode_effect; // pointer to the YIQ decoder effect object + d3d_surface * backbuffer; // pointer to our device's backbuffer + d3d_effect * curr_effect; // pointer to the currently active effect object + d3d_effect * effect; // pointer to the primary-effect object + d3d_effect * prescale_effect; // pointer to the prescale-effect object + d3d_effect * post_effect; // pointer to the post-effect object + d3d_effect * pincushion_effect; // pointer to the pincushion-effect object + d3d_effect * focus_effect; // pointer to the focus-effect object + d3d_effect * phosphor_effect; // pointer to the phosphor-effect object + d3d_effect * deconverge_effect; // pointer to the deconvergence-effect object + d3d_effect * color_effect; // pointer to the color-effect object + d3d_effect * yiq_encode_effect; // pointer to the YIQ encoder effect object + d3d_effect * yiq_decode_effect; // pointer to the YIQ decoder effect object #if HLSL_VECTOR - d3d_effect * vector_effect; // pointer to the vector-effect object + d3d_effect * vector_effect; // pointer to the vector-effect object #endif - d3d_vertex * fsfx_vertices; // pointer to our full-screen-quad object + d3d_vertex * fsfx_vertices; // pointer to our full-screen-quad object public: - d3d_render_target * targethead; - d3d_cache_target * cachehead; + d3d_render_target * targethead; + d3d_cache_target * cachehead; }; #endif diff --git a/src/osd/windows/d3dintf.h b/src/osd/windows/d3dintf.h index 6503b5bd769..27643afcdb8 100644 --- a/src/osd/windows/d3dintf.h +++ b/src/osd/windows/d3dintf.h @@ -113,15 +113,15 @@ struct d3d_present_parameters struct d3d_adapter_identifier { - char Driver[512]; - char Description[512]; - LARGE_INTEGER DriverVersion; - DWORD VendorId; - DWORD DeviceId; - DWORD SubSysId; - DWORD Revision; - GUID DeviceIdentifier; - DWORD WHQLLevel; + char Driver[512]; + char Description[512]; + LARGE_INTEGER DriverVersion; + DWORD VendorId; + DWORD DeviceId; + DWORD SubSysId; + DWORD Revision; + GUID DeviceIdentifier; + DWORD WHQLLevel; }; @@ -265,16 +265,16 @@ struct d3d_effect_interface struct d3d_base { // internal objects - int version; - void * d3dobj; - HINSTANCE dllhandle; - bool post_fx_available; + int version; + void * d3dobj; + HINSTANCE dllhandle; + bool post_fx_available; // interface pointers - d3d_interface d3d; - d3d_device_interface device; - d3d_surface_interface surface; - d3d_texture_interface texture; + d3d_interface d3d; + d3d_device_interface device; + d3d_surface_interface surface; + d3d_texture_interface texture; d3d_vertex_buffer_interface vertexbuf; d3d_effect_interface effect; }; diff --git a/src/osd/windows/debugwin.c b/src/osd/windows/debugwin.c index debb293363b..0b74fc60918 100644 --- a/src/osd/windows/debugwin.c +++ b/src/osd/windows/debugwin.c @@ -78,35 +78,35 @@ // PARAMETERS //============================================================ -#define MAX_VIEWS 4 -#define EDGE_WIDTH 3 -#define MAX_EDIT_STRING 256 -#define HISTORY_LENGTH 20 -#define MAX_OTHER_WND 4 +#define MAX_VIEWS 4 +#define EDGE_WIDTH 3 +#define MAX_EDIT_STRING 256 +#define HISTORY_LENGTH 20 +#define MAX_OTHER_WND 4 // debugger window styles -#define DEBUG_WINDOW_STYLE (WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN) & (~WS_MINIMIZEBOX & ~WS_MAXIMIZEBOX) -#define DEBUG_WINDOW_STYLE_EX 0 +#define DEBUG_WINDOW_STYLE (WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN) & (~WS_MINIMIZEBOX & ~WS_MAXIMIZEBOX) +#define DEBUG_WINDOW_STYLE_EX 0 // debugger view styles -#define DEBUG_VIEW_STYLE WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN -#define DEBUG_VIEW_STYLE_EX 0 +#define DEBUG_VIEW_STYLE WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN +#define DEBUG_VIEW_STYLE_EX 0 // edit box styles -#define EDIT_BOX_STYLE WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL -#define EDIT_BOX_STYLE_EX 0 +#define EDIT_BOX_STYLE WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL +#define EDIT_BOX_STYLE_EX 0 // combo box styles -#define COMBO_BOX_STYLE WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_VSCROLL -#define COMBO_BOX_STYLE_EX 0 +#define COMBO_BOX_STYLE WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_VSCROLL +#define COMBO_BOX_STYLE_EX 0 // horizontal scroll bar styles -#define HSCROLL_STYLE WS_CHILD | WS_VISIBLE | SBS_HORZ -#define HSCROLL_STYLE_EX 0 +#define HSCROLL_STYLE WS_CHILD | WS_VISIBLE | SBS_HORZ +#define HSCROLL_STYLE_EX 0 // vertical scroll bar styles -#define VSCROLL_STYLE WS_CHILD | WS_VISIBLE | SBS_VERT -#define VSCROLL_STYLE_EX 0 +#define VSCROLL_STYLE WS_CHILD | WS_VISIBLE | SBS_VERT +#define VSCROLL_STYLE_EX 0 enum @@ -157,11 +157,11 @@ class debugwin_info; struct debugview_info { - debugwin_info * owner; - debug_view * view; - HWND wnd; - HWND hscroll; - HWND vscroll; + debugwin_info * owner; + debug_view * view; + HWND wnd; + HWND hscroll; + HWND vscroll; }; @@ -173,34 +173,34 @@ public: running_machine &machine() const { return m_machine; } - debugwin_info * next; - HWND wnd; - HWND focuswnd; - WNDPROC handler; + debugwin_info * next; + HWND wnd; + HWND focuswnd; + WNDPROC handler; - UINT32 minwidth, maxwidth; - UINT32 minheight, maxheight; - void (*recompute_children)(debugwin_info *); - void (*update_menu)(debugwin_info *); + UINT32 minwidth, maxwidth; + UINT32 minheight, maxheight; + void (*recompute_children)(debugwin_info *); + void (*update_menu)(debugwin_info *); - int (*handle_command)(debugwin_info *, WPARAM, LPARAM); - int (*handle_key)(debugwin_info *, WPARAM, LPARAM); - UINT16 ignore_char_lparam; + int (*handle_command)(debugwin_info *, WPARAM, LPARAM); + int (*handle_key)(debugwin_info *, WPARAM, LPARAM); + UINT16 ignore_char_lparam; - debugview_info view[MAX_VIEWS]; + debugview_info view[MAX_VIEWS]; - HWND editwnd; - char edit_defstr[256]; - void (*process_string)(debugwin_info *, const char *); - WNDPROC original_editproc; - TCHAR history[HISTORY_LENGTH][MAX_EDIT_STRING]; - int history_count; - int last_history; + HWND editwnd; + char edit_defstr[256]; + void (*process_string)(debugwin_info *, const char *); + WNDPROC original_editproc; + TCHAR history[HISTORY_LENGTH][MAX_EDIT_STRING]; + int history_count; + int last_history; - HWND otherwnd[MAX_OTHER_WND]; + HWND otherwnd[MAX_OTHER_WND]; private: - running_machine & m_machine; + running_machine & m_machine; }; @@ -403,24 +403,24 @@ void debugwin_init_windows(running_machine &machine) WNDCLASS wc = { 0 }; // initialize the description of the window class - wc.lpszClassName = TEXT("MAMEDebugWindow"); - wc.hInstance = GetModuleHandle(NULL); - wc.lpfnWndProc = debugwin_window_proc; - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hIcon = LoadIcon(wc.hInstance, MAKEINTRESOURCE(2)); - wc.lpszMenuName = NULL; - wc.hbrBackground = NULL; - wc.style = 0; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; + wc.lpszClassName = TEXT("MAMEDebugWindow"); + wc.hInstance = GetModuleHandle(NULL); + wc.lpfnWndProc = debugwin_window_proc; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hIcon = LoadIcon(wc.hInstance, MAKEINTRESOURCE(2)); + wc.lpszMenuName = NULL; + wc.hbrBackground = NULL; + wc.style = 0; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; // register the class; fail if we can't if (!RegisterClass(&wc)) fatalerror("Unable to register debug window class\n"); // initialize the description of the view class - wc.lpszClassName = TEXT("MAMEDebugView"); - wc.lpfnWndProc = debugwin_view_proc; + wc.lpszClassName = TEXT("MAMEDebugView"); + wc.lpfnWndProc = debugwin_view_proc; // register the class; fail if we can't if (!RegisterClass(&wc)) @@ -2423,8 +2423,8 @@ static void image_update_menu(debugwin_info *info) AppendMenu(devicesubmenu, MF_STRING, new_item + DEVOPTION_OPEN, TEXT("Mount...")); /*if (img->is_creatable()) - AppendMenu(devicesubmenu, MF_STRING, new_item + DEVOPTION_CREATE, TEXT("Create...")); - */ + AppendMenu(devicesubmenu, MF_STRING, new_item + DEVOPTION_CREATE, TEXT("Create...")); + */ AppendMenu(devicesubmenu, flags_for_exists, new_item + DEVOPTION_CLOSE, TEXT("Unmount")); if (img->device().type() == CASSETTE) @@ -2432,9 +2432,9 @@ static void image_update_menu(debugwin_info *info) cassette_state state; state = (cassette_state)(img->exists() ? (dynamic_cast<cassette_image_device*>(&img->device())->get_state() & CASSETTE_MASK_UISTATE) : CASSETTE_STOPPED); AppendMenu(devicesubmenu, MF_SEPARATOR, 0, NULL); - AppendMenu(devicesubmenu, flags_for_exists | ((state == CASSETTE_STOPPED) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_STOPPAUSE, TEXT("Pause/Stop")); - AppendMenu(devicesubmenu, flags_for_exists | ((state == CASSETTE_PLAY) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_PLAY, TEXT("Play")); - AppendMenu(devicesubmenu, flags_for_writing | ((state == CASSETTE_RECORD) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_RECORD, TEXT("Record")); + AppendMenu(devicesubmenu, flags_for_exists | ((state == CASSETTE_STOPPED) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_STOPPAUSE, TEXT("Pause/Stop")); + AppendMenu(devicesubmenu, flags_for_exists | ((state == CASSETTE_PLAY) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_PLAY, TEXT("Play")); + AppendMenu(devicesubmenu, flags_for_writing | ((state == CASSETTE_RECORD) ? MF_CHECKED : 0), new_item + DEVOPTION_CASSETTE_RECORD, TEXT("Record")); AppendMenu(devicesubmenu, flags_for_exists, new_item + DEVOPTION_CASSETTE_REWIND, TEXT("Rewind")); AppendMenu(devicesubmenu, flags_for_exists, new_item + DEVOPTION_CASSETTE_FASTFORWARD, TEXT("Fast Forward")); } diff --git a/src/osd/windows/drawd3d.c b/src/osd/windows/drawd3d.c index 1b3a28c6238..481ca37f3fa 100644 --- a/src/osd/windows/drawd3d.c +++ b/src/osd/windows/drawd3d.c @@ -90,7 +90,7 @@ extern void mtlog_add(const char *event); // CONSTANTS //============================================================ -#define ENABLE_BORDER_PIX (1) +#define ENABLE_BORDER_PIX (1) enum { @@ -113,7 +113,7 @@ enum // GLOBALS //============================================================ -static d3d_base * d3dintf; // FIX ME +static d3d_base * d3dintf; // FIX ME static const line_aa_step line_aa_1step[] = { @@ -165,26 +165,26 @@ INLINE UINT32 ycc_to_rgb(UINT8 y, UINT8 cb, UINT8 cr) { /* original equations: - C = Y - 16 - D = Cb - 128 - E = Cr - 128 + C = Y - 16 + D = Cb - 128 + E = Cr - 128 - R = clip(( 298 * C + 409 * E + 128) >> 8) - G = clip(( 298 * C - 100 * D - 208 * E + 128) >> 8) - B = clip(( 298 * C + 516 * D + 128) >> 8) + R = clip(( 298 * C + 409 * E + 128) >> 8) + G = clip(( 298 * C - 100 * D - 208 * E + 128) >> 8) + B = clip(( 298 * C + 516 * D + 128) >> 8) - R = clip(( 298 * (Y - 16) + 409 * (Cr - 128) + 128) >> 8) - G = clip(( 298 * (Y - 16) - 100 * (Cb - 128) - 208 * (Cr - 128) + 128) >> 8) - B = clip(( 298 * (Y - 16) + 516 * (Cb - 128) + 128) >> 8) + R = clip(( 298 * (Y - 16) + 409 * (Cr - 128) + 128) >> 8) + G = clip(( 298 * (Y - 16) - 100 * (Cb - 128) - 208 * (Cr - 128) + 128) >> 8) + B = clip(( 298 * (Y - 16) + 516 * (Cb - 128) + 128) >> 8) - R = clip(( 298 * Y - 298 * 16 + 409 * Cr - 409 * 128 + 128) >> 8) - G = clip(( 298 * Y - 298 * 16 - 100 * Cb + 100 * 128 - 208 * Cr + 208 * 128 + 128) >> 8) - B = clip(( 298 * Y - 298 * 16 + 516 * Cb - 516 * 128 + 128) >> 8) + R = clip(( 298 * Y - 298 * 16 + 409 * Cr - 409 * 128 + 128) >> 8) + G = clip(( 298 * Y - 298 * 16 - 100 * Cb + 100 * 128 - 208 * Cr + 208 * 128 + 128) >> 8) + B = clip(( 298 * Y - 298 * 16 + 516 * Cb - 516 * 128 + 128) >> 8) - R = clip(( 298 * Y - 298 * 16 + 409 * Cr - 409 * 128 + 128) >> 8) - G = clip(( 298 * Y - 298 * 16 - 100 * Cb + 100 * 128 - 208 * Cr + 208 * 128 + 128) >> 8) - B = clip(( 298 * Y - 298 * 16 + 516 * Cb - 516 * 128 + 128) >> 8) - */ + R = clip(( 298 * Y - 298 * 16 + 409 * Cr - 409 * 128 + 128) >> 8) + G = clip(( 298 * Y - 298 * 16 - 100 * Cb + 100 * 128 - 208 * Cr + 208 * 128 + 128) >> 8) + B = clip(( 298 * Y - 298 * 16 + 516 * Cb - 516 * 128 + 128) >> 8) + */ int r, g, b, common; common = 298 * y - 298 * 16; @@ -286,10 +286,10 @@ INLINE void set_blendmode(d3d_info *d3d, int blendmode) switch (blendmode) { default: - case BLENDMODE_NONE: blendenable = FALSE; blendop = D3DBLENDOP_ADD; blendsrc = D3DBLEND_SRCALPHA; blenddst = D3DBLEND_INVSRCALPHA; break; - case BLENDMODE_ALPHA: blendenable = TRUE; blendop = D3DBLENDOP_ADD; blendsrc = D3DBLEND_SRCALPHA; blenddst = D3DBLEND_INVSRCALPHA; break; - case BLENDMODE_RGB_MULTIPLY: blendenable = TRUE; blendop = D3DBLENDOP_ADD; blendsrc = D3DBLEND_DESTCOLOR; blenddst = D3DBLEND_ZERO; break; - case BLENDMODE_ADD: blendenable = TRUE; blendop = D3DBLENDOP_ADD; blendsrc = D3DBLEND_SRCALPHA; blenddst = D3DBLEND_ONE; break; + case BLENDMODE_NONE: blendenable = FALSE; blendop = D3DBLENDOP_ADD; blendsrc = D3DBLEND_SRCALPHA; blenddst = D3DBLEND_INVSRCALPHA; break; + case BLENDMODE_ALPHA: blendenable = TRUE; blendop = D3DBLENDOP_ADD; blendsrc = D3DBLEND_SRCALPHA; blenddst = D3DBLEND_INVSRCALPHA; break; + case BLENDMODE_RGB_MULTIPLY: blendenable = TRUE; blendop = D3DBLENDOP_ADD; blendsrc = D3DBLEND_DESTCOLOR; blenddst = D3DBLEND_ZERO; break; + case BLENDMODE_ADD: blendenable = TRUE; blendop = D3DBLENDOP_ADD; blendsrc = D3DBLEND_SRCALPHA; blenddst = D3DBLEND_ONE; break; } // adjust the bits that changed @@ -721,19 +721,19 @@ try_again: // initialize the D3D presentation parameters memset(&d3d->presentation, 0, sizeof(d3d->presentation)); - d3d->presentation.BackBufferWidth = d3d->width; - d3d->presentation.BackBufferHeight = d3d->height; - d3d->presentation.BackBufferFormat = d3d->pixformat; - d3d->presentation.BackBufferCount = video_config.triplebuf ? 2 : 1; - d3d->presentation.MultiSampleType = D3DMULTISAMPLE_NONE; - d3d->presentation.SwapEffect = D3DSWAPEFFECT_DISCARD; - d3d->presentation.hDeviceWindow = window->hwnd; - d3d->presentation.Windowed = !window->fullscreen || win_has_menu(window); - d3d->presentation.EnableAutoDepthStencil = FALSE; - d3d->presentation.AutoDepthStencilFormat = D3DFMT_D16; - d3d->presentation.Flags = 0; - d3d->presentation.FullScreen_RefreshRateInHz = d3d->refresh; - d3d->presentation.PresentationInterval = ((video_config.triplebuf && window->fullscreen) || video_config.waitvsync || video_config.syncrefresh) ? + d3d->presentation.BackBufferWidth = d3d->width; + d3d->presentation.BackBufferHeight = d3d->height; + d3d->presentation.BackBufferFormat = d3d->pixformat; + d3d->presentation.BackBufferCount = video_config.triplebuf ? 2 : 1; + d3d->presentation.MultiSampleType = D3DMULTISAMPLE_NONE; + d3d->presentation.SwapEffect = D3DSWAPEFFECT_DISCARD; + d3d->presentation.hDeviceWindow = window->hwnd; + d3d->presentation.Windowed = !window->fullscreen || win_has_menu(window); + d3d->presentation.EnableAutoDepthStencil = FALSE; + d3d->presentation.AutoDepthStencilFormat = D3DFMT_D16; + d3d->presentation.Flags = 0; + d3d->presentation.FullScreen_RefreshRateInHz = d3d->refresh; + d3d->presentation.PresentationInterval = ((video_config.triplebuf && window->fullscreen) || video_config.waitvsync || video_config.syncrefresh) ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE; // create the D3D device @@ -789,7 +789,7 @@ try_again: int ret = d3d->hlsl->create_resources(false); if (ret != 0) - return ret; + return ret; return device_create_resources(d3d); } @@ -2345,9 +2345,9 @@ static void texture_set_data(d3d_info *d3d, d3d_texture_info *texture, const ren switch (texture->type) { default: - case TEXTURE_TYPE_PLAIN: result = (*d3dintf->texture.lock_rect)(texture->d3dtex, 0, &rect, NULL, 0); break; - case TEXTURE_TYPE_DYNAMIC: result = (*d3dintf->texture.lock_rect)(texture->d3dtex, 0, &rect, NULL, D3DLOCK_DISCARD); break; - case TEXTURE_TYPE_SURFACE: result = (*d3dintf->surface.lock_rect)(texture->d3dsurface, &rect, NULL, D3DLOCK_DISCARD); break; + case TEXTURE_TYPE_PLAIN: result = (*d3dintf->texture.lock_rect)(texture->d3dtex, 0, &rect, NULL, 0); break; + case TEXTURE_TYPE_DYNAMIC: result = (*d3dintf->texture.lock_rect)(texture->d3dtex, 0, &rect, NULL, D3DLOCK_DISCARD); break; + case TEXTURE_TYPE_SURFACE: result = (*d3dintf->surface.lock_rect)(texture->d3dsurface, &rect, NULL, D3DLOCK_DISCARD); break; } if (result != D3D_OK) return; @@ -2398,9 +2398,9 @@ static void texture_set_data(d3d_info *d3d, d3d_texture_info *texture, const ren switch (texture->type) { default: - case TEXTURE_TYPE_PLAIN: result = (*d3dintf->texture.unlock_rect)(texture->d3dtex, 0); break; - case TEXTURE_TYPE_DYNAMIC: result = (*d3dintf->texture.unlock_rect)(texture->d3dtex, 0); break; - case TEXTURE_TYPE_SURFACE: result = (*d3dintf->surface.unlock_rect)(texture->d3dsurface); break; + case TEXTURE_TYPE_PLAIN: result = (*d3dintf->texture.unlock_rect)(texture->d3dtex, 0); break; + case TEXTURE_TYPE_DYNAMIC: result = (*d3dintf->texture.unlock_rect)(texture->d3dtex, 0); break; + case TEXTURE_TYPE_SURFACE: result = (*d3dintf->surface.unlock_rect)(texture->d3dsurface); break; } if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during texture unlock_rect call\n", (int)result); @@ -2598,10 +2598,10 @@ static d3d_texture_info *texture_find(d3d_info *d3d, const render_primitive *pri // Clear our old texture reference if (texture->hash == texhash && - texture->texinfo.base == prim->texture.base && - ((texture->flags ^ prim->flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) == 0 && - (texture->texinfo.width != prim->texture.width || - texture->texinfo.height != prim->texture.height)) + texture->texinfo.base == prim->texture.base && + ((texture->flags ^ prim->flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) == 0 && + (texture->texinfo.width != prim->texture.width || + texture->texinfo.height != prim->texture.height)) { d3d->hlsl->remove_render_target(texture); break; @@ -2694,7 +2694,7 @@ d3d_render_target::~d3d_render_target() prescaletexture = NULL; } if (prescaletarget != NULL) - { + { (*d3dintf->surface.release)(prescaletarget); prescaletarget = NULL; } diff --git a/src/osd/windows/drawd3d.h b/src/osd/windows/drawd3d.h index fb590a9bd82..a0feed411d5 100644 --- a/src/osd/windows/drawd3d.h +++ b/src/osd/windows/drawd3d.h @@ -50,8 +50,8 @@ // CONSTANTS //============================================================ -#define VERTEX_BASE_FORMAT (D3DFVF_DIFFUSE | D3DFVF_TEX1) -#define VERTEX_BUFFER_SIZE (2048*4+4) +#define VERTEX_BASE_FORMAT (D3DFVF_DIFFUSE | D3DFVF_TEX1) +#define VERTEX_BUFFER_SIZE (2048*4+4) //============================================================ // TYPE DEFINITIONS @@ -114,57 +114,57 @@ public: /* d3d_info is the information about Direct3D for the current screen */ struct d3d_info { - int adapter; // ordinal adapter number - int width, height; // current width, height - int refresh; // current refresh rate - int create_error_count; // number of consecutive create errors - - win_window_info * window; // current window info - - d3d_device * device; // pointer to the Direct3DDevice object - int gamma_supported; // is full screen gamma supported? - d3d_present_parameters presentation; // set of presentation parameters - D3DDISPLAYMODE origmode; // original display mode for the adapter - D3DFORMAT pixformat; // pixel format we are using - - d3d_vertex_buffer * vertexbuf; // pointer to the vertex buffer object - d3d_vertex * lockedbuf; // pointer to the locked vertex buffer - int numverts; // number of accumulated vertices - - d3d_poly_info poly[VERTEX_BUFFER_SIZE/3]; // array to hold polygons as they are created - int numpolys; // number of accumulated polygons - - d3d_texture_info * texlist; // list of active textures - int dynamic_supported; // are dynamic textures supported? - int stretch_supported; // is StretchRect with point filtering supported? - int mod2x_supported; // is D3DTOP_MODULATE2X supported? - int mod4x_supported; // is D3DTOP_MODULATE4X supported? - D3DFORMAT screen_format; // format to use for screen textures - D3DFORMAT yuv_format; // format to use for YUV textures - - DWORD texture_caps; // textureCaps field - DWORD texture_max_aspect; // texture maximum aspect ratio - DWORD texture_max_width; // texture maximum width - DWORD texture_max_height; // texture maximum height - - d3d_texture_info * last_texture; // previous texture - UINT32 last_texture_flags; // previous texture flags - int last_blendenable; // previous blendmode - int last_blendop; // previous blendmode - int last_blendsrc; // previous blendmode - int last_blenddst; // previous blendmode - int last_filter; // previous texture filter - int last_wrap; // previous wrap state - DWORD last_modmode; // previous texture modulation - - bitmap_argb32 vector_bitmap; // experimental: bitmap for vectors - d3d_texture_info * vector_texture; // experimental: texture for vectors - - bitmap_rgb32 default_bitmap; // experimental: default bitmap - d3d_texture_info * default_texture; // experimental: default texture - - void * hlsl_buf; // HLSL vertex data - hlsl_info * hlsl; // HLSL interface + int adapter; // ordinal adapter number + int width, height; // current width, height + int refresh; // current refresh rate + int create_error_count; // number of consecutive create errors + + win_window_info * window; // current window info + + d3d_device * device; // pointer to the Direct3DDevice object + int gamma_supported; // is full screen gamma supported? + d3d_present_parameters presentation; // set of presentation parameters + D3DDISPLAYMODE origmode; // original display mode for the adapter + D3DFORMAT pixformat; // pixel format we are using + + d3d_vertex_buffer * vertexbuf; // pointer to the vertex buffer object + d3d_vertex * lockedbuf; // pointer to the locked vertex buffer + int numverts; // number of accumulated vertices + + d3d_poly_info poly[VERTEX_BUFFER_SIZE/3]; // array to hold polygons as they are created + int numpolys; // number of accumulated polygons + + d3d_texture_info * texlist; // list of active textures + int dynamic_supported; // are dynamic textures supported? + int stretch_supported; // is StretchRect with point filtering supported? + int mod2x_supported; // is D3DTOP_MODULATE2X supported? + int mod4x_supported; // is D3DTOP_MODULATE4X supported? + D3DFORMAT screen_format; // format to use for screen textures + D3DFORMAT yuv_format; // format to use for YUV textures + + DWORD texture_caps; // textureCaps field + DWORD texture_max_aspect; // texture maximum aspect ratio + DWORD texture_max_width; // texture maximum width + DWORD texture_max_height; // texture maximum height + + d3d_texture_info * last_texture; // previous texture + UINT32 last_texture_flags; // previous texture flags + int last_blendenable; // previous blendmode + int last_blendop; // previous blendmode + int last_blendsrc; // previous blendmode + int last_blenddst; // previous blendmode + int last_filter; // previous texture filter + int last_wrap; // previous wrap state + DWORD last_modmode; // previous texture modulation + + bitmap_argb32 vector_bitmap; // experimental: bitmap for vectors + d3d_texture_info * vector_texture; // experimental: texture for vectors + + bitmap_rgb32 default_bitmap; // experimental: default bitmap + d3d_texture_info * default_texture; // experimental: default texture + + void * hlsl_buf; // HLSL vertex data + hlsl_info * hlsl; // HLSL interface }; diff --git a/src/osd/windows/drawdd.c b/src/osd/windows/drawdd.c index 25004360e09..896255004cf 100644 --- a/src/osd/windows/drawdd.c +++ b/src/osd/windows/drawdd.c @@ -71,52 +71,52 @@ typedef HRESULT (WINAPI *directdrawenumerateex_ptr)(LPDDENUMCALLBACKEXA lpCallba /* dd_info is the information about DirectDraw for the current screen */ struct dd_info { - GUID adapter; // current display adapter - GUID * adapter_ptr; // pointer to current display adapter - int width, height; // current width, height - int refresh; // current refresh rate - int clearouter; // clear the outer areas? - - INT32 blitwidth, blitheight; // current blit width/height values - RECT lastdest; // last destination rectangle - - IDirectDraw7 * ddraw; // pointer to the DirectDraw object - IDirectDrawSurface7 * primary; // pointer to the primary surface object - IDirectDrawSurface7 * back; // pointer to the back buffer surface object - IDirectDrawSurface7 * blit; // pointer to the blit surface object - IDirectDrawClipper * clipper; // pointer to the clipper object - IDirectDrawGammaControl *gamma; // pointer to the gamma control object - - DDSURFACEDESC2 primarydesc; // description of the primary surface - DDSURFACEDESC2 blitdesc; // description of the blitting surface - DDSURFACEDESC2 origmode; // original video mode - - DDCAPS ddcaps; // capabilities of the device - DDCAPS helcaps; // capabilities of the hardware - - void * membuffer; // memory buffer for complex rendering - UINT32 membuffersize; // current size of the memory buffer + GUID adapter; // current display adapter + GUID * adapter_ptr; // pointer to current display adapter + int width, height; // current width, height + int refresh; // current refresh rate + int clearouter; // clear the outer areas? + + INT32 blitwidth, blitheight; // current blit width/height values + RECT lastdest; // last destination rectangle + + IDirectDraw7 * ddraw; // pointer to the DirectDraw object + IDirectDrawSurface7 * primary; // pointer to the primary surface object + IDirectDrawSurface7 * back; // pointer to the back buffer surface object + IDirectDrawSurface7 * blit; // pointer to the blit surface object + IDirectDrawClipper * clipper; // pointer to the clipper object + IDirectDrawGammaControl *gamma; // pointer to the gamma control object + + DDSURFACEDESC2 primarydesc; // description of the primary surface + DDSURFACEDESC2 blitdesc; // description of the blitting surface + DDSURFACEDESC2 origmode; // original video mode + + DDCAPS ddcaps; // capabilities of the device + DDCAPS helcaps; // capabilities of the hardware + + void * membuffer; // memory buffer for complex rendering + UINT32 membuffersize; // current size of the memory buffer }; /* monitor_enum_info holds information during a monitor enumeration */ struct monitor_enum_info { - win_monitor_info * monitor; // pointer to monitor we want - GUID guid; // GUID of the one we found - GUID * guid_ptr; // pointer to our GUID - int foundit; // TRUE if we found what we wanted + win_monitor_info * monitor; // pointer to monitor we want + GUID guid; // GUID of the one we found + GUID * guid_ptr; // pointer to our GUID + int foundit; // TRUE if we found what we wanted }; /* mode_enum_info holds information during a display mode enumeration */ struct mode_enum_info { - win_window_info * window; - INT32 minimum_width, minimum_height; - INT32 target_width, target_height; - double target_refresh; - float best_score; + win_window_info * window; + INT32 minimum_width, minimum_height; + INT32 target_width, target_height; + double target_refresh; + float best_score; }; @@ -377,10 +377,10 @@ static int drawdd_window_draw(win_window_info *window, HDC dc, int update) // based on the target format, use one of our standard renderers switch (dd->blitdesc.ddpfPixelFormat.dwRBitMask) { - case 0x00ff0000: software_renderer<UINT32, 0,0,0, 16,8,0>::draw_primitives(*window->primlist, dd->membuffer, dd->blitwidth, dd->blitheight, dd->blitwidth); break; - case 0x000000ff: software_renderer<UINT32, 0,0,0, 0,8,16>::draw_primitives(*window->primlist, dd->membuffer, dd->blitwidth, dd->blitheight, dd->blitwidth); break; - case 0xf800: software_renderer<UINT16, 3,2,3, 11,5,0>::draw_primitives(*window->primlist, dd->membuffer, dd->blitwidth, dd->blitheight, dd->blitwidth); break; - case 0x7c00: software_renderer<UINT16, 3,3,3, 10,5,0>::draw_primitives(*window->primlist, dd->membuffer, dd->blitwidth, dd->blitheight, dd->blitwidth); break; + case 0x00ff0000: software_renderer<UINT32, 0,0,0, 16,8,0>::draw_primitives(*window->primlist, dd->membuffer, dd->blitwidth, dd->blitheight, dd->blitwidth); break; + case 0x000000ff: software_renderer<UINT32, 0,0,0, 0,8,16>::draw_primitives(*window->primlist, dd->membuffer, dd->blitwidth, dd->blitheight, dd->blitwidth); break; + case 0xf800: software_renderer<UINT16, 3,2,3, 11,5,0>::draw_primitives(*window->primlist, dd->membuffer, dd->blitwidth, dd->blitheight, dd->blitwidth); break; + case 0x7c00: software_renderer<UINT16, 3,3,3, 10,5,0>::draw_primitives(*window->primlist, dd->membuffer, dd->blitwidth, dd->blitheight, dd->blitwidth); break; default: mame_printf_verbose("DirectDraw: Unknown target mode: R=%08X G=%08X B=%08X\n", (int)dd->blitdesc.ddpfPixelFormat.dwRBitMask, (int)dd->blitdesc.ddpfPixelFormat.dwGBitMask, (int)dd->blitdesc.ddpfPixelFormat.dwBBitMask); break; @@ -413,10 +413,10 @@ static int drawdd_window_draw(win_window_info *window, HDC dc, int update) // based on the target format, use one of our standard renderers switch (dd->blitdesc.ddpfPixelFormat.dwRBitMask) { - case 0x00ff0000: software_renderer<UINT32, 0,0,0, 16,8,0, true>::draw_primitives(*window->primlist, dd->blitdesc.lpSurface, dd->blitwidth, dd->blitheight, dd->blitdesc.lPitch / 4); break; - case 0x000000ff: software_renderer<UINT32, 0,0,0, 0,8,16, true>::draw_primitives(*window->primlist, dd->blitdesc.lpSurface, dd->blitwidth, dd->blitheight, dd->blitdesc.lPitch / 4); break; - case 0xf800: software_renderer<UINT16, 3,2,3, 11,5,0, true>::draw_primitives(*window->primlist, dd->blitdesc.lpSurface, dd->blitwidth, dd->blitheight, dd->blitdesc.lPitch / 2); break; - case 0x7c00: software_renderer<UINT16, 3,3,3, 10,5,0, true>::draw_primitives(*window->primlist, dd->blitdesc.lpSurface, dd->blitwidth, dd->blitheight, dd->blitdesc.lPitch / 2); break; + case 0x00ff0000: software_renderer<UINT32, 0,0,0, 16,8,0, true>::draw_primitives(*window->primlist, dd->blitdesc.lpSurface, dd->blitwidth, dd->blitheight, dd->blitdesc.lPitch / 4); break; + case 0x000000ff: software_renderer<UINT32, 0,0,0, 0,8,16, true>::draw_primitives(*window->primlist, dd->blitdesc.lpSurface, dd->blitwidth, dd->blitheight, dd->blitdesc.lPitch / 4); break; + case 0xf800: software_renderer<UINT16, 3,2,3, 11,5,0, true>::draw_primitives(*window->primlist, dd->blitdesc.lpSurface, dd->blitwidth, dd->blitheight, dd->blitdesc.lPitch / 2); break; + case 0x7c00: software_renderer<UINT16, 3,3,3, 10,5,0, true>::draw_primitives(*window->primlist, dd->blitdesc.lpSurface, dd->blitwidth, dd->blitheight, dd->blitdesc.lPitch / 2); break; default: mame_printf_verbose("DirectDraw: Unknown target mode: R=%08X G=%08X B=%08X\n", (int)dd->blitdesc.ddpfPixelFormat.dwRBitMask, (int)dd->blitdesc.ddpfPixelFormat.dwGBitMask, (int)dd->blitdesc.ddpfPixelFormat.dwBBitMask); break; diff --git a/src/osd/windows/drawgdi.c b/src/osd/windows/drawgdi.c index 1ff77066f0a..52d3b629f81 100644 --- a/src/osd/windows/drawgdi.c +++ b/src/osd/windows/drawgdi.c @@ -59,10 +59,10 @@ /* gdi_info is the information for the current screen */ struct gdi_info { - BITMAPINFO bminfo; - RGBQUAD colors[256]; - UINT8 * bmdata; - size_t bmsize; + BITMAPINFO bminfo; + RGBQUAD colors[256]; + UINT8 * bmdata; + size_t bmsize; }; @@ -123,22 +123,22 @@ static int drawgdi_window_init(win_window_info *window) window->drawdata = gdi; // fill in the bitmap info header - gdi->bminfo.bmiHeader.biSize = sizeof(gdi->bminfo.bmiHeader); - gdi->bminfo.bmiHeader.biPlanes = 1; - gdi->bminfo.bmiHeader.biCompression = BI_RGB; - gdi->bminfo.bmiHeader.biSizeImage = 0; - gdi->bminfo.bmiHeader.biXPelsPerMeter = 0; - gdi->bminfo.bmiHeader.biYPelsPerMeter = 0; - gdi->bminfo.bmiHeader.biClrUsed = 0; - gdi->bminfo.bmiHeader.biClrImportant = 0; + gdi->bminfo.bmiHeader.biSize = sizeof(gdi->bminfo.bmiHeader); + gdi->bminfo.bmiHeader.biPlanes = 1; + gdi->bminfo.bmiHeader.biCompression = BI_RGB; + gdi->bminfo.bmiHeader.biSizeImage = 0; + gdi->bminfo.bmiHeader.biXPelsPerMeter = 0; + gdi->bminfo.bmiHeader.biYPelsPerMeter = 0; + gdi->bminfo.bmiHeader.biClrUsed = 0; + gdi->bminfo.bmiHeader.biClrImportant = 0; // initialize the palette to a gray ramp for (i = 0; i < 256; i++) { - gdi->bminfo.bmiColors[i].rgbRed = i; - gdi->bminfo.bmiColors[i].rgbGreen = i; - gdi->bminfo.bmiColors[i].rgbBlue = i; - gdi->bminfo.bmiColors[i].rgbReserved = i; + gdi->bminfo.bmiColors[i].rgbRed = i; + gdi->bminfo.bmiColors[i].rgbGreen = i; + gdi->bminfo.bmiColors[i].rgbBlue = i; + gdi->bminfo.bmiColors[i].rgbReserved = i; } return 0; diff --git a/src/osd/windows/eivcx86.h b/src/osd/windows/eivcx86.h index b9cd1e30dcb..04f337a12bf 100644 --- a/src/osd/windows/eivcx86.h +++ b/src/osd/windows/eivcx86.h @@ -64,12 +64,12 @@ INLINE INT64 _mul_32x32(INT32 a, INT32 b) { // in theory this should work, but it is untested - __asm - { - mov eax,a - imul b - // leave results in edx:eax - } + __asm + { + mov eax,a + imul b + // leave results in edx:eax + } } #endif @@ -85,12 +85,12 @@ INLINE INT64 _mul_32x32(INT32 a, INT32 b) INLINE UINT64 _mulu_32x32(UINT32 a, UINT32 b) { // in theory this should work, but it is untested - __asm - { - mov eax,a - mul b - // leave results in edx:eax - } + __asm + { + mov eax,a + mul b + // leave results in edx:eax + } } #endif @@ -107,12 +107,12 @@ INLINE INT32 _mul_32x32_hi(INT32 a, INT32 b) { INT32 result; - __asm - { - mov eax,a - imul b - mov result,edx - } + __asm + { + mov eax,a + imul b + mov result,edx + } return result; } @@ -131,12 +131,12 @@ INLINE UINT32 _mulu_32x32_hi(UINT32 a, UINT32 b) { INT32 result; - __asm - { - mov eax,a - mul b - mov result,edx - } + __asm + { + mov eax,a + mul b + mov result,edx + } return result; } @@ -156,14 +156,14 @@ INLINE INT32 _mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) { INT32 result; - __asm - { - mov eax,a - imul b - mov cl,shift - shrd eax,edx,cl - mov result,eax - } + __asm + { + mov eax,a + imul b + mov cl,shift + shrd eax,edx,cl + mov result,eax + } return result; } @@ -183,14 +183,14 @@ INLINE UINT32 _mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) { INT32 result; - __asm - { - mov eax,a - mul b - mov cl,shift - shrd eax,edx,cl - mov result,eax - } + __asm + { + mov eax,a + mul b + mov cl,shift + shrd eax,edx,cl + mov result,eax + } return result; } @@ -210,13 +210,13 @@ INLINE INT32 _div_64x32(INT64 a, INT32 b) INT32 alow = a; INT32 ahigh = a >> 32; - __asm - { - mov eax,alow - mov edx,ahigh - idiv b - mov result,eax - } + __asm + { + mov eax,alow + mov edx,ahigh + idiv b + mov result,eax + } return result; } @@ -236,13 +236,13 @@ INLINE UINT32 _divu_64x32(UINT64 a, UINT32 b) UINT32 alow = a; UINT32 ahigh = a >> 32; - __asm - { - mov eax,alow - mov edx,ahigh - div b - mov result,eax - } + __asm + { + mov eax,alow + mov edx,ahigh + div b + mov result,eax + } return result; } @@ -264,14 +264,14 @@ INLINE INT32 _div_64x32_rem(INT64 a, INT32 b, INT32 *remainder) INT32 ahigh = a >> 32; INT32 rem; - __asm - { - mov eax,alow - mov edx,ahigh - idiv b - mov result,eax - mov rem,edx - } + __asm + { + mov eax,alow + mov edx,ahigh + idiv b + mov result,eax + mov rem,edx + } *remainder = rem; return result; @@ -294,14 +294,14 @@ INLINE UINT32 _divu_64x32_rem(UINT64 a, UINT32 b, UINT32 *remainder) UINT32 ahigh = a >> 32; UINT32 rem; - __asm - { - mov eax,alow - mov edx,ahigh - div b - mov result,eax - mov rem,edx - } + __asm + { + mov eax,alow + mov edx,ahigh + div b + mov result,eax + mov rem,edx + } *remainder = rem; return result; @@ -321,16 +321,16 @@ INLINE INT32 _div_32x32_shift(INT32 a, INT32 b, UINT8 shift) { INT32 result; - __asm - { - mov eax,a - cdq - mov cl,shift - shld edx,eax,cl - shl eax,cl - idiv b - mov result,eax - } + __asm + { + mov eax,a + cdq + mov cl,shift + shld edx,eax,cl + shl eax,cl + idiv b + mov result,eax + } return result; } @@ -349,16 +349,16 @@ INLINE UINT32 _divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) { UINT32 result; - __asm - { - mov eax,a - xor edx,edx - mov cl,shift - shld edx,eax,cl - shl eax,cl - div b - mov result,eax - } + __asm + { + mov eax,a + xor edx,edx + mov cl,shift + shld edx,eax,cl + shl eax,cl + div b + mov result,eax + } return result; } @@ -378,13 +378,13 @@ INLINE INT32 _mod_64x32(INT64 a, INT32 b) INT32 alow = a; INT32 ahigh = a >> 32; - __asm - { - mov eax,alow - mov edx,ahigh - idiv b - mov result,edx - } + __asm + { + mov eax,alow + mov edx,ahigh + idiv b + mov result,edx + } return result; } @@ -404,13 +404,13 @@ INLINE UINT32 _modu_64x32(UINT64 a, UINT32 b) UINT32 alow = a; UINT32 ahigh = a >> 32; - __asm - { - mov eax,alow - mov edx,ahigh - div b - mov result,edx - } + __asm + { + mov eax,alow + mov edx,ahigh + div b + mov result,edx + } return result; } @@ -451,15 +451,15 @@ INLINE UINT8 _count_leading_zeros(UINT32 value) { INT32 result; - __asm - { - bsr eax,value - jnz skip - mov eax,63 - skip: - xor eax,31 - mov result,eax - } + __asm + { + bsr eax,value + jnz skip + mov eax,63 + skip: + xor eax,31 + mov result,eax + } return result; } @@ -477,17 +477,17 @@ INLINE UINT8 _count_leading_ones(UINT32 value) { INT32 result; - __asm - { - mov eax,value - not eax - bsr eax,eax - jnz skip - mov eax,63 - skip: - xor eax,31 - mov result,eax - } + __asm + { + mov eax,value + not eax + bsr eax,eax + jnz skip + mov eax,63 + skip: + xor eax,31 + mov result,eax + } return result; } @@ -523,7 +523,7 @@ INLINE osd_ticks_t _get_profile_ticks(void) UINT64 *presult = &result; __asm { - __asm _emit 0Fh __asm _emit 031h // rdtsc + __asm _emit 0Fh __asm _emit 031h // rdtsc mov ebx, presult mov [ebx],eax mov [ebx+4],edx diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c index e22b669efc4..8e28447efaa 100644 --- a/src/osd/windows/input.c +++ b/src/osd/windows/input.c @@ -40,7 +40,7 @@ //============================================================ // For testing purposes: force DirectInput -#define FORCE_DIRECTINPUT 0 +#define FORCE_DIRECTINPUT 0 // standard windows headers #define WIN32_LEAN_AND_MEAN @@ -84,12 +84,12 @@ enum POVDIR_DOWN }; -#define MAX_KEYS 256 +#define MAX_KEYS 256 -#define MAME_KEY 0 -#define DI_KEY 1 -#define VIRTUAL_KEY 2 -#define ASCII_KEY 3 +#define MAME_KEY 0 +#define DI_KEY 1 +#define VIRTUAL_KEY 2 +#define ASCII_KEY 3 @@ -97,12 +97,12 @@ enum // MACROS //============================================================ -#define STRUCTSIZE(x) ((dinput_version == 0x0300) ? sizeof(x##_DX3) : sizeof(x)) +#define STRUCTSIZE(x) ((dinput_version == 0x0300) ? sizeof(x##_DX3) : sizeof(x)) #ifdef UNICODE -#define UNICODE_SUFFIX "W" +#define UNICODE_SUFFIX "W" #else -#define UNICODE_SUFFIX "A" +#define UNICODE_SUFFIX "A" #endif @@ -114,43 +114,43 @@ enum // state information for a keyboard; DirectInput state must be first element struct keyboard_state { - UINT8 state[MAX_KEYS]; - INT8 oldkey[MAX_KEYS]; - INT8 currkey[MAX_KEYS]; + UINT8 state[MAX_KEYS]; + INT8 oldkey[MAX_KEYS]; + INT8 currkey[MAX_KEYS]; }; // state information for a mouse; DirectInput state must be first element struct mouse_state { - DIMOUSESTATE2 state; - LONG raw_x, raw_y, raw_z; + DIMOUSESTATE2 state; + LONG raw_x, raw_y, raw_z; }; // state information for a joystick; DirectInput state must be first element struct joystick_state { - DIJOYSTATE state; - LONG rangemin[8]; - LONG rangemax[8]; + DIJOYSTATE state; + LONG rangemin[8]; + LONG rangemax[8]; }; // DirectInput-specific information about a device struct dinput_device_info { - LPDIRECTINPUTDEVICE device; - LPDIRECTINPUTDEVICE2 device2; - DIDEVCAPS caps; - LPCDIDATAFORMAT format; + LPDIRECTINPUTDEVICE device; + LPDIRECTINPUTDEVICE2 device2; + DIDEVCAPS caps; + LPCDIDATAFORMAT format; }; // RawInput-specific information about a device struct rawinput_device_info { - HANDLE device; + HANDLE device; }; @@ -164,28 +164,28 @@ public: running_machine &machine() const { return m_machine; } // device information - device_info ** head; - device_info * next; - const char * name; - void (*poll)(device_info *info); + device_info ** head; + device_info * next; + const char * name; + void (*poll)(device_info *info); // MAME information - input_device * device; + input_device * device; // device state union { - keyboard_state keyboard; - mouse_state mouse; - joystick_state joystick; + keyboard_state keyboard; + mouse_state mouse; + joystick_state joystick; }; // DirectInput/RawInput-specific state - dinput_device_info dinput; - rawinput_device_info rawinput; + dinput_device_info dinput; + rawinput_device_info rawinput; private: - running_machine & m_machine; + running_machine & m_machine; }; @@ -202,36 +202,36 @@ typedef /*WINUSERAPI*/ BOOL (WINAPI *register_rawinput_devices_ptr)(IN PCRAWINPU //============================================================ // global states -static UINT8 input_enabled; -static osd_lock * input_lock; -static UINT8 input_paused; -static DWORD last_poll; +static UINT8 input_enabled; +static osd_lock * input_lock; +static UINT8 input_paused; +static DWORD last_poll; // DirectInput variables -static LPDIRECTINPUT dinput; -static int dinput_version; +static LPDIRECTINPUT dinput; +static int dinput_version; // RawInput variables -static get_rawinput_device_list_ptr get_rawinput_device_list; -static get_rawinput_data_ptr get_rawinput_data; -static get_rawinput_device_info_ptr get_rawinput_device_info; -static register_rawinput_devices_ptr register_rawinput_devices; +static get_rawinput_device_list_ptr get_rawinput_device_list; +static get_rawinput_data_ptr get_rawinput_data; +static get_rawinput_device_info_ptr get_rawinput_device_info; +static register_rawinput_devices_ptr register_rawinput_devices; // keyboard states -static UINT8 keyboard_win32_reported_key_down; -static device_info * keyboard_list; +static UINT8 keyboard_win32_reported_key_down; +static device_info * keyboard_list; // mouse states -static UINT8 mouse_enabled; -static device_info * mouse_list; +static UINT8 mouse_enabled; +static device_info * mouse_list; // lightgun states -static UINT8 lightgun_shared_axis_mode; -static UINT8 lightgun_enabled; -static device_info * lightgun_list; +static UINT8 lightgun_shared_axis_mode; +static UINT8 lightgun_enabled; +static device_info * lightgun_list; // joystick states -static device_info * joystick_list; +static device_info * joystick_list; // default axis names static const TCHAR *const default_axis_name[] = @@ -311,115 +311,115 @@ static const TCHAR *default_pov_name(int which); static const int win_key_trans_table[][4] = { // MAME key dinput key virtual key ascii - { ITEM_ID_ESC, DIK_ESCAPE, VK_ESCAPE, 27 }, - { ITEM_ID_1, DIK_1, '1', '1' }, - { ITEM_ID_2, DIK_2, '2', '2' }, - { ITEM_ID_3, DIK_3, '3', '3' }, - { ITEM_ID_4, DIK_4, '4', '4' }, - { ITEM_ID_5, DIK_5, '5', '5' }, - { ITEM_ID_6, DIK_6, '6', '6' }, - { ITEM_ID_7, DIK_7, '7', '7' }, - { ITEM_ID_8, DIK_8, '8', '8' }, - { ITEM_ID_9, DIK_9, '9', '9' }, - { ITEM_ID_0, DIK_0, '0', '0' }, - { ITEM_ID_MINUS, DIK_MINUS, VK_OEM_MINUS, '-' }, - { ITEM_ID_EQUALS, DIK_EQUALS, VK_OEM_PLUS, '=' }, - { ITEM_ID_BACKSPACE, DIK_BACK, VK_BACK, 8 }, - { ITEM_ID_TAB, DIK_TAB, VK_TAB, 9 }, - { ITEM_ID_Q, DIK_Q, 'Q', 'Q' }, - { ITEM_ID_W, DIK_W, 'W', 'W' }, - { ITEM_ID_E, DIK_E, 'E', 'E' }, - { ITEM_ID_R, DIK_R, 'R', 'R' }, - { ITEM_ID_T, DIK_T, 'T', 'T' }, - { ITEM_ID_Y, DIK_Y, 'Y', 'Y' }, - { ITEM_ID_U, DIK_U, 'U', 'U' }, - { ITEM_ID_I, DIK_I, 'I', 'I' }, - { ITEM_ID_O, DIK_O, 'O', 'O' }, - { ITEM_ID_P, DIK_P, 'P', 'P' }, - { ITEM_ID_OPENBRACE, DIK_LBRACKET, VK_OEM_4, '[' }, - { ITEM_ID_CLOSEBRACE, DIK_RBRACKET, VK_OEM_6, ']' }, - { ITEM_ID_ENTER, DIK_RETURN, VK_RETURN, 13 }, - { ITEM_ID_LCONTROL, DIK_LCONTROL, VK_LCONTROL, 0 }, - { ITEM_ID_A, DIK_A, 'A', 'A' }, - { ITEM_ID_S, DIK_S, 'S', 'S' }, - { ITEM_ID_D, DIK_D, 'D', 'D' }, - { ITEM_ID_F, DIK_F, 'F', 'F' }, - { ITEM_ID_G, DIK_G, 'G', 'G' }, - { ITEM_ID_H, DIK_H, 'H', 'H' }, - { ITEM_ID_J, DIK_J, 'J', 'J' }, - { ITEM_ID_K, DIK_K, 'K', 'K' }, - { ITEM_ID_L, DIK_L, 'L', 'L' }, - { ITEM_ID_COLON, DIK_SEMICOLON, VK_OEM_1, ';' }, - { ITEM_ID_QUOTE, DIK_APOSTROPHE, VK_OEM_7, '\'' }, - { ITEM_ID_TILDE, DIK_GRAVE, VK_OEM_3, '`' }, - { ITEM_ID_LSHIFT, DIK_LSHIFT, VK_LSHIFT, 0 }, - { ITEM_ID_BACKSLASH, DIK_BACKSLASH, VK_OEM_5, '\\' }, - { ITEM_ID_BACKSLASH2, DIK_OEM_102, VK_OEM_102, '<' }, - { ITEM_ID_Z, DIK_Z, 'Z', 'Z' }, - { ITEM_ID_X, DIK_X, 'X', 'X' }, - { ITEM_ID_C, DIK_C, 'C', 'C' }, - { ITEM_ID_V, DIK_V, 'V', 'V' }, - { ITEM_ID_B, DIK_B, 'B', 'B' }, - { ITEM_ID_N, DIK_N, 'N', 'N' }, - { ITEM_ID_M, DIK_M, 'M', 'M' }, - { ITEM_ID_COMMA, DIK_COMMA, VK_OEM_COMMA, ',' }, - { ITEM_ID_STOP, DIK_PERIOD, VK_OEM_PERIOD, '.' }, - { ITEM_ID_SLASH, DIK_SLASH, VK_OEM_2, '/' }, - { ITEM_ID_RSHIFT, DIK_RSHIFT, VK_RSHIFT, 0 }, - { ITEM_ID_ASTERISK, DIK_MULTIPLY, VK_MULTIPLY, '*' }, - { ITEM_ID_LALT, DIK_LMENU, VK_LMENU, 0 }, - { ITEM_ID_SPACE, DIK_SPACE, VK_SPACE, ' ' }, - { ITEM_ID_CAPSLOCK, DIK_CAPITAL, VK_CAPITAL, 0 }, - { ITEM_ID_F1, DIK_F1, VK_F1, 0 }, - { ITEM_ID_F2, DIK_F2, VK_F2, 0 }, - { ITEM_ID_F3, DIK_F3, VK_F3, 0 }, - { ITEM_ID_F4, DIK_F4, VK_F4, 0 }, - { ITEM_ID_F5, DIK_F5, VK_F5, 0 }, - { ITEM_ID_F6, DIK_F6, VK_F6, 0 }, - { ITEM_ID_F7, DIK_F7, VK_F7, 0 }, - { ITEM_ID_F8, DIK_F8, VK_F8, 0 }, - { ITEM_ID_F9, DIK_F9, VK_F9, 0 }, - { ITEM_ID_F10, DIK_F10, VK_F10, 0 }, - { ITEM_ID_NUMLOCK, DIK_NUMLOCK, VK_NUMLOCK, 0 }, - { ITEM_ID_SCRLOCK, DIK_SCROLL, VK_SCROLL, 0 }, - { ITEM_ID_7_PAD, DIK_NUMPAD7, VK_NUMPAD7, 0 }, - { ITEM_ID_8_PAD, DIK_NUMPAD8, VK_NUMPAD8, 0 }, - { ITEM_ID_9_PAD, DIK_NUMPAD9, VK_NUMPAD9, 0 }, - { ITEM_ID_MINUS_PAD, DIK_SUBTRACT, VK_SUBTRACT, 0 }, - { ITEM_ID_4_PAD, DIK_NUMPAD4, VK_NUMPAD4, 0 }, - { ITEM_ID_5_PAD, DIK_NUMPAD5, VK_NUMPAD5, 0 }, - { ITEM_ID_6_PAD, DIK_NUMPAD6, VK_NUMPAD6, 0 }, - { ITEM_ID_PLUS_PAD, DIK_ADD, VK_ADD, 0 }, - { ITEM_ID_1_PAD, DIK_NUMPAD1, VK_NUMPAD1, 0 }, - { ITEM_ID_2_PAD, DIK_NUMPAD2, VK_NUMPAD2, 0 }, - { ITEM_ID_3_PAD, DIK_NUMPAD3, VK_NUMPAD3, 0 }, - { ITEM_ID_0_PAD, DIK_NUMPAD0, VK_NUMPAD0, 0 }, - { ITEM_ID_DEL_PAD, DIK_DECIMAL, VK_DECIMAL, 0 }, - { ITEM_ID_F11, DIK_F11, VK_F11, 0 }, - { ITEM_ID_F12, DIK_F12, VK_F12, 0 }, - { ITEM_ID_F13, DIK_F13, VK_F13, 0 }, - { ITEM_ID_F14, DIK_F14, VK_F14, 0 }, - { ITEM_ID_F15, DIK_F15, VK_F15, 0 }, - { ITEM_ID_ENTER_PAD, DIK_NUMPADENTER, VK_RETURN, 0 }, - { ITEM_ID_RCONTROL, DIK_RCONTROL, VK_RCONTROL, 0 }, - { ITEM_ID_SLASH_PAD, DIK_DIVIDE, VK_DIVIDE, 0 }, - { ITEM_ID_PRTSCR, DIK_SYSRQ, 0, 0 }, - { ITEM_ID_RALT, DIK_RMENU, VK_RMENU, 0 }, - { ITEM_ID_HOME, DIK_HOME, VK_HOME, 0 }, - { ITEM_ID_UP, DIK_UP, VK_UP, 0 }, - { ITEM_ID_PGUP, DIK_PRIOR, VK_PRIOR, 0 }, - { ITEM_ID_LEFT, DIK_LEFT, VK_LEFT, 0 }, - { ITEM_ID_RIGHT, DIK_RIGHT, VK_RIGHT, 0 }, - { ITEM_ID_END, DIK_END, VK_END, 0 }, - { ITEM_ID_DOWN, DIK_DOWN, VK_DOWN, 0 }, - { ITEM_ID_PGDN, DIK_NEXT, VK_NEXT, 0 }, - { ITEM_ID_INSERT, DIK_INSERT, VK_INSERT, 0 }, - { ITEM_ID_DEL, DIK_DELETE, VK_DELETE, 0 }, - { ITEM_ID_LWIN, DIK_LWIN, VK_LWIN, 0 }, - { ITEM_ID_RWIN, DIK_RWIN, VK_RWIN, 0 }, - { ITEM_ID_MENU, DIK_APPS, VK_APPS, 0 }, - { ITEM_ID_PAUSE, DIK_PAUSE, VK_PAUSE, 0 }, - { ITEM_ID_CANCEL, 0, VK_CANCEL, 0 }, + { ITEM_ID_ESC, DIK_ESCAPE, VK_ESCAPE, 27 }, + { ITEM_ID_1, DIK_1, '1', '1' }, + { ITEM_ID_2, DIK_2, '2', '2' }, + { ITEM_ID_3, DIK_3, '3', '3' }, + { ITEM_ID_4, DIK_4, '4', '4' }, + { ITEM_ID_5, DIK_5, '5', '5' }, + { ITEM_ID_6, DIK_6, '6', '6' }, + { ITEM_ID_7, DIK_7, '7', '7' }, + { ITEM_ID_8, DIK_8, '8', '8' }, + { ITEM_ID_9, DIK_9, '9', '9' }, + { ITEM_ID_0, DIK_0, '0', '0' }, + { ITEM_ID_MINUS, DIK_MINUS, VK_OEM_MINUS, '-' }, + { ITEM_ID_EQUALS, DIK_EQUALS, VK_OEM_PLUS, '=' }, + { ITEM_ID_BACKSPACE, DIK_BACK, VK_BACK, 8 }, + { ITEM_ID_TAB, DIK_TAB, VK_TAB, 9 }, + { ITEM_ID_Q, DIK_Q, 'Q', 'Q' }, + { ITEM_ID_W, DIK_W, 'W', 'W' }, + { ITEM_ID_E, DIK_E, 'E', 'E' }, + { ITEM_ID_R, DIK_R, 'R', 'R' }, + { ITEM_ID_T, DIK_T, 'T', 'T' }, + { ITEM_ID_Y, DIK_Y, 'Y', 'Y' }, + { ITEM_ID_U, DIK_U, 'U', 'U' }, + { ITEM_ID_I, DIK_I, 'I', 'I' }, + { ITEM_ID_O, DIK_O, 'O', 'O' }, + { ITEM_ID_P, DIK_P, 'P', 'P' }, + { ITEM_ID_OPENBRACE, DIK_LBRACKET, VK_OEM_4, '[' }, + { ITEM_ID_CLOSEBRACE, DIK_RBRACKET, VK_OEM_6, ']' }, + { ITEM_ID_ENTER, DIK_RETURN, VK_RETURN, 13 }, + { ITEM_ID_LCONTROL, DIK_LCONTROL, VK_LCONTROL, 0 }, + { ITEM_ID_A, DIK_A, 'A', 'A' }, + { ITEM_ID_S, DIK_S, 'S', 'S' }, + { ITEM_ID_D, DIK_D, 'D', 'D' }, + { ITEM_ID_F, DIK_F, 'F', 'F' }, + { ITEM_ID_G, DIK_G, 'G', 'G' }, + { ITEM_ID_H, DIK_H, 'H', 'H' }, + { ITEM_ID_J, DIK_J, 'J', 'J' }, + { ITEM_ID_K, DIK_K, 'K', 'K' }, + { ITEM_ID_L, DIK_L, 'L', 'L' }, + { ITEM_ID_COLON, DIK_SEMICOLON, VK_OEM_1, ';' }, + { ITEM_ID_QUOTE, DIK_APOSTROPHE, VK_OEM_7, '\'' }, + { ITEM_ID_TILDE, DIK_GRAVE, VK_OEM_3, '`' }, + { ITEM_ID_LSHIFT, DIK_LSHIFT, VK_LSHIFT, 0 }, + { ITEM_ID_BACKSLASH, DIK_BACKSLASH, VK_OEM_5, '\\' }, + { ITEM_ID_BACKSLASH2, DIK_OEM_102, VK_OEM_102, '<' }, + { ITEM_ID_Z, DIK_Z, 'Z', 'Z' }, + { ITEM_ID_X, DIK_X, 'X', 'X' }, + { ITEM_ID_C, DIK_C, 'C', 'C' }, + { ITEM_ID_V, DIK_V, 'V', 'V' }, + { ITEM_ID_B, DIK_B, 'B', 'B' }, + { ITEM_ID_N, DIK_N, 'N', 'N' }, + { ITEM_ID_M, DIK_M, 'M', 'M' }, + { ITEM_ID_COMMA, DIK_COMMA, VK_OEM_COMMA, ',' }, + { ITEM_ID_STOP, DIK_PERIOD, VK_OEM_PERIOD, '.' }, + { ITEM_ID_SLASH, DIK_SLASH, VK_OEM_2, '/' }, + { ITEM_ID_RSHIFT, DIK_RSHIFT, VK_RSHIFT, 0 }, + { ITEM_ID_ASTERISK, DIK_MULTIPLY, VK_MULTIPLY, '*' }, + { ITEM_ID_LALT, DIK_LMENU, VK_LMENU, 0 }, + { ITEM_ID_SPACE, DIK_SPACE, VK_SPACE, ' ' }, + { ITEM_ID_CAPSLOCK, DIK_CAPITAL, VK_CAPITAL, 0 }, + { ITEM_ID_F1, DIK_F1, VK_F1, 0 }, + { ITEM_ID_F2, DIK_F2, VK_F2, 0 }, + { ITEM_ID_F3, DIK_F3, VK_F3, 0 }, + { ITEM_ID_F4, DIK_F4, VK_F4, 0 }, + { ITEM_ID_F5, DIK_F5, VK_F5, 0 }, + { ITEM_ID_F6, DIK_F6, VK_F6, 0 }, + { ITEM_ID_F7, DIK_F7, VK_F7, 0 }, + { ITEM_ID_F8, DIK_F8, VK_F8, 0 }, + { ITEM_ID_F9, DIK_F9, VK_F9, 0 }, + { ITEM_ID_F10, DIK_F10, VK_F10, 0 }, + { ITEM_ID_NUMLOCK, DIK_NUMLOCK, VK_NUMLOCK, 0 }, + { ITEM_ID_SCRLOCK, DIK_SCROLL, VK_SCROLL, 0 }, + { ITEM_ID_7_PAD, DIK_NUMPAD7, VK_NUMPAD7, 0 }, + { ITEM_ID_8_PAD, DIK_NUMPAD8, VK_NUMPAD8, 0 }, + { ITEM_ID_9_PAD, DIK_NUMPAD9, VK_NUMPAD9, 0 }, + { ITEM_ID_MINUS_PAD, DIK_SUBTRACT, VK_SUBTRACT, 0 }, + { ITEM_ID_4_PAD, DIK_NUMPAD4, VK_NUMPAD4, 0 }, + { ITEM_ID_5_PAD, DIK_NUMPAD5, VK_NUMPAD5, 0 }, + { ITEM_ID_6_PAD, DIK_NUMPAD6, VK_NUMPAD6, 0 }, + { ITEM_ID_PLUS_PAD, DIK_ADD, VK_ADD, 0 }, + { ITEM_ID_1_PAD, DIK_NUMPAD1, VK_NUMPAD1, 0 }, + { ITEM_ID_2_PAD, DIK_NUMPAD2, VK_NUMPAD2, 0 }, + { ITEM_ID_3_PAD, DIK_NUMPAD3, VK_NUMPAD3, 0 }, + { ITEM_ID_0_PAD, DIK_NUMPAD0, VK_NUMPAD0, 0 }, + { ITEM_ID_DEL_PAD, DIK_DECIMAL, VK_DECIMAL, 0 }, + { ITEM_ID_F11, DIK_F11, VK_F11, 0 }, + { ITEM_ID_F12, DIK_F12, VK_F12, 0 }, + { ITEM_ID_F13, DIK_F13, VK_F13, 0 }, + { ITEM_ID_F14, DIK_F14, VK_F14, 0 }, + { ITEM_ID_F15, DIK_F15, VK_F15, 0 }, + { ITEM_ID_ENTER_PAD, DIK_NUMPADENTER, VK_RETURN, 0 }, + { ITEM_ID_RCONTROL, DIK_RCONTROL, VK_RCONTROL, 0 }, + { ITEM_ID_SLASH_PAD, DIK_DIVIDE, VK_DIVIDE, 0 }, + { ITEM_ID_PRTSCR, DIK_SYSRQ, 0, 0 }, + { ITEM_ID_RALT, DIK_RMENU, VK_RMENU, 0 }, + { ITEM_ID_HOME, DIK_HOME, VK_HOME, 0 }, + { ITEM_ID_UP, DIK_UP, VK_UP, 0 }, + { ITEM_ID_PGUP, DIK_PRIOR, VK_PRIOR, 0 }, + { ITEM_ID_LEFT, DIK_LEFT, VK_LEFT, 0 }, + { ITEM_ID_RIGHT, DIK_RIGHT, VK_RIGHT, 0 }, + { ITEM_ID_END, DIK_END, VK_END, 0 }, + { ITEM_ID_DOWN, DIK_DOWN, VK_DOWN, 0 }, + { ITEM_ID_PGDN, DIK_NEXT, VK_NEXT, 0 }, + { ITEM_ID_INSERT, DIK_INSERT, VK_INSERT, 0 }, + { ITEM_ID_DEL, DIK_DELETE, VK_DELETE, 0 }, + { ITEM_ID_LWIN, DIK_LWIN, VK_LWIN, 0 }, + { ITEM_ID_RWIN, DIK_RWIN, VK_RWIN, 0 }, + { ITEM_ID_MENU, DIK_APPS, VK_APPS, 0 }, + { ITEM_ID_PAUSE, DIK_PAUSE, VK_PAUSE, 0 }, + { ITEM_ID_CANCEL, 0, VK_CANCEL, 0 }, // New keys introduced in Windows 2000. These have no MAME codes to // preserve compatibility with old config files that may refer to them @@ -429,18 +429,18 @@ static const int win_key_trans_table[][4] = // paused). Some codes are missing because the mapping to vkey codes // isn't clear, and MapVirtualKey is no help. - { ITEM_ID_OTHER_SWITCH, DIK_MUTE, VK_VOLUME_MUTE, 0 }, - { ITEM_ID_OTHER_SWITCH, DIK_VOLUMEDOWN, VK_VOLUME_DOWN, 0 }, - { ITEM_ID_OTHER_SWITCH, DIK_VOLUMEUP, VK_VOLUME_UP, 0 }, - { ITEM_ID_OTHER_SWITCH, DIK_WEBHOME, VK_BROWSER_HOME, 0 }, - { ITEM_ID_OTHER_SWITCH, DIK_WEBSEARCH, VK_BROWSER_SEARCH, 0 }, - { ITEM_ID_OTHER_SWITCH, DIK_WEBFAVORITES, VK_BROWSER_FAVORITES, 0 }, - { ITEM_ID_OTHER_SWITCH, DIK_WEBREFRESH, VK_BROWSER_REFRESH, 0 }, - { ITEM_ID_OTHER_SWITCH, DIK_WEBSTOP, VK_BROWSER_STOP, 0 }, - { ITEM_ID_OTHER_SWITCH, DIK_WEBFORWARD, VK_BROWSER_FORWARD, 0 }, - { ITEM_ID_OTHER_SWITCH, DIK_WEBBACK, VK_BROWSER_BACK, 0 }, - { ITEM_ID_OTHER_SWITCH, DIK_MAIL, VK_LAUNCH_MAIL, 0 }, - { ITEM_ID_OTHER_SWITCH, DIK_MEDIASELECT, VK_LAUNCH_MEDIA_SELECT, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_MUTE, VK_VOLUME_MUTE, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_VOLUMEDOWN, VK_VOLUME_DOWN, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_VOLUMEUP, VK_VOLUME_UP, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_WEBHOME, VK_BROWSER_HOME, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_WEBSEARCH, VK_BROWSER_SEARCH, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_WEBFAVORITES, VK_BROWSER_FAVORITES, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_WEBREFRESH, VK_BROWSER_REFRESH, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_WEBSTOP, VK_BROWSER_STOP, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_WEBFORWARD, VK_BROWSER_FORWARD, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_WEBBACK, VK_BROWSER_BACK, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_MAIL, VK_LAUNCH_MAIL, 0 }, + { ITEM_ID_OTHER_SWITCH, DIK_MEDIASELECT, VK_LAUNCH_MEDIA_SELECT, 0 }, }; @@ -1649,10 +1649,10 @@ static INT32 dinput_joystick_pov_get_state(void *device_internal, void *item_int // return the current state switch (povdir) { - case POVDIR_LEFT: result = (pov >= 22500 && pov <= 31500); break; - case POVDIR_RIGHT: result = (pov >= 4500 && pov <= 13500); break; - case POVDIR_UP: result = (pov >= 31500 || pov <= 4500); break; - case POVDIR_DOWN: result = (pov >= 13500 && pov <= 22500); break; + case POVDIR_LEFT: result = (pov >= 22500 && pov <= 31500); break; + case POVDIR_RIGHT: result = (pov >= 4500 && pov <= 13500); break; + case POVDIR_UP: result = (pov >= 31500 || pov <= 4500); break; + case POVDIR_DOWN: result = (pov >= 13500 && pov <= 22500); break; } return result; } diff --git a/src/osd/windows/ledutil.c b/src/osd/windows/ledutil.c index 7630bfc15fe..9931e2f053d 100644 --- a/src/osd/windows/ledutil.c +++ b/src/osd/windows/ledutil.c @@ -85,10 +85,10 @@ typedef int running_machine; // note you need to compile as a console app to have any of // these printfs show up -#define DEBUG_VERSION 0 +#define DEBUG_VERSION 0 #if DEBUG_VERSION -#define DEBUG_PRINTF(x) printf x +#define DEBUG_PRINTF(x) printf x #else #define DEBUG_PRINTF(x) #endif @@ -99,31 +99,31 @@ typedef int running_machine; //============================================================ // unique client ID -#define CLIENT_ID (('M' << 24) | ('L' << 16) | ('E' << 8) | ('D' << 0)) +#define CLIENT_ID (('M' << 24) | ('L' << 16) | ('E' << 8) | ('D' << 0)) // LED methods -#define LED_METHOD_PS2 0 -#define LED_METHOD_USB 1 -#define LED_METHOD_WIN9X 2 +#define LED_METHOD_PS2 0 +#define LED_METHOD_USB 1 +#define LED_METHOD_WIN9X 2 // window parameters -#define WINDOW_CLASS TEXT("LEDSample") -#define WINDOW_NAME TEXT("LEDSample") +#define WINDOW_CLASS TEXT("LEDSample") +#define WINDOW_NAME TEXT("LEDSample") // window styles -#define WINDOW_STYLE WS_OVERLAPPEDWINDOW -#define WINDOW_STYLE_EX 0 +#define WINDOW_STYLE WS_OVERLAPPEDWINDOW +#define WINDOW_STYLE_EX 0 // Define the keyboard indicators. // (Definitions borrowed from ntddkbd.h) -#define IOCTL_KEYBOARD_SET_INDICATORS CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0002, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_KEYBOARD_QUERY_TYPEMATIC CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_KEYBOARD_QUERY_INDICATORS CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_KEYBOARD_SET_INDICATORS CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0002, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_KEYBOARD_QUERY_TYPEMATIC CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_KEYBOARD_QUERY_INDICATORS CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define KEYBOARD_SCROLL_LOCK_ON 1 -#define KEYBOARD_NUM_LOCK_ON 2 -#define KEYBOARD_CAPS_LOCK_ON 4 +#define KEYBOARD_SCROLL_LOCK_ON 1 +#define KEYBOARD_NUM_LOCK_ON 2 +#define KEYBOARD_CAPS_LOCK_ON 4 @@ -133,16 +133,16 @@ typedef int running_machine; struct KEYBOARD_INDICATOR_PARAMETERS { - USHORT UnitId; // Unit identifier. - USHORT LedFlags; // LED indicator state. + USHORT UnitId; // Unit identifier. + USHORT LedFlags; // LED indicator state. }; struct id_map_entry { - id_map_entry * next; - const char * name; - WPARAM id; + id_map_entry * next; + const char * name; + WPARAM id; }; @@ -151,24 +151,24 @@ struct id_map_entry // GLOBAL VARIABLES //============================================================ -static int ledmethod; -static int original_state; -static int current_state; -static int pause_state; -static HANDLE hKbdDev; +static int ledmethod; +static int original_state; +static int current_state; +static int pause_state; +static HANDLE hKbdDev; -static HWND mame_target; -static HWND listener_hwnd; +static HWND mame_target; +static HWND listener_hwnd; -static id_map_entry * idmaplist; +static id_map_entry * idmaplist; // message IDs -static UINT om_mame_start; -static UINT om_mame_stop; -static UINT om_mame_update_state; -static UINT om_mame_register_client; -static UINT om_mame_unregister_client; -static UINT om_mame_get_id_string; +static UINT om_mame_start; +static UINT om_mame_stop; +static UINT om_mame_update_state; +static UINT om_mame_register_client; +static UINT om_mame_unregister_client; +static UINT om_mame_get_id_string; @@ -306,9 +306,9 @@ static int create_window_class(void) WNDCLASS wc = { 0 }; // initialize the description of the window class - wc.lpszClassName = WINDOW_CLASS; - wc.hInstance = GetModuleHandle(NULL); - wc.lpfnWndProc = listener_window_proc; + wc.lpszClassName = WINDOW_CLASS; + wc.hInstance = GetModuleHandle(NULL); + wc.lpfnWndProc = listener_window_proc; // register the class; fail if we can't if (!RegisterClass(&wc)) @@ -670,9 +670,9 @@ static int led_get_state(void) case LED_METHOD_PS2: { - KEYBOARD_INDICATOR_PARAMETERS OutputBuffer; // Output buffer for DeviceIoControl - ULONG DataLength = sizeof(KEYBOARD_INDICATOR_PARAMETERS); - ULONG ReturnedLength; // Number of bytes returned in output buffer + KEYBOARD_INDICATOR_PARAMETERS OutputBuffer; // Output buffer for DeviceIoControl + ULONG DataLength = sizeof(KEYBOARD_INDICATOR_PARAMETERS); + ULONG ReturnedLength; // Number of bytes returned in output buffer // Address first keyboard OutputBuffer.UnitId = 0; @@ -750,10 +750,10 @@ static void led_set_state(int state) case LED_METHOD_PS2: { - KEYBOARD_INDICATOR_PARAMETERS InputBuffer; // Input buffer for DeviceIoControl - ULONG DataLength = sizeof(KEYBOARD_INDICATOR_PARAMETERS); - ULONG ReturnedLength; // Number of bytes returned in output buffer - UINT LedFlags=0; + KEYBOARD_INDICATOR_PARAMETERS InputBuffer; // Input buffer for DeviceIoControl + ULONG DataLength = sizeof(KEYBOARD_INDICATOR_PARAMETERS); + ULONG ReturnedLength; // Number of bytes returned in output buffer + UINT LedFlags=0; // Demangle lights to match 95/98 if (state & 0x1) LedFlags |= KEYBOARD_NUM_LOCK_ON; diff --git a/src/osd/windows/netdev_pcap.c b/src/osd/windows/netdev_pcap.c index b1f5b0e97c8..92dc87b0b42 100644 --- a/src/osd/windows/netdev_pcap.c +++ b/src/osd/windows/netdev_pcap.c @@ -135,4 +135,3 @@ void deinit_pcap() clear_netdev(); FreeLibrary(handle); } - diff --git a/src/osd/windows/output.c b/src/osd/windows/output.c index 637ba1f94f8..483042eecf1 100644 --- a/src/osd/windows/output.c +++ b/src/osd/windows/output.c @@ -57,8 +57,8 @@ //============================================================ // window styles -#define WINDOW_STYLE WS_OVERLAPPEDWINDOW -#define WINDOW_STYLE_EX 0 +#define WINDOW_STYLE WS_OVERLAPPEDWINDOW +#define WINDOW_STYLE_EX 0 @@ -68,9 +68,9 @@ struct registered_client { - registered_client * next; // next client in the list - LPARAM id; // client-specified ID - HWND hwnd; // client HWND + registered_client * next; // next client in the list + LPARAM id; // client-specified ID + HWND hwnd; // client HWND }; @@ -80,18 +80,18 @@ struct registered_client //============================================================ // our HWND -static HWND output_hwnd; +static HWND output_hwnd; // client list -static registered_client * clientlist; +static registered_client * clientlist; // message IDs -static UINT om_mame_start; -static UINT om_mame_stop; -static UINT om_mame_update_state; -static UINT om_mame_register_client; -static UINT om_mame_unregister_client; -static UINT om_mame_get_id_string; +static UINT om_mame_start; +static UINT om_mame_stop; +static UINT om_mame_update_state; +static UINT om_mame_register_client; +static UINT om_mame_unregister_client; +static UINT om_mame_get_id_string; @@ -201,9 +201,9 @@ static int create_window_class(void) WNDCLASS wc = { 0 }; // initialize the description of the window class - wc.lpszClassName = OUTPUT_WINDOW_CLASS; - wc.hInstance = GetModuleHandle(NULL); - wc.lpfnWndProc = output_window_proc; + wc.lpszClassName = OUTPUT_WINDOW_CLASS; + wc.hInstance = GetModuleHandle(NULL); + wc.lpfnWndProc = output_window_proc; // register the class; fail if we can't if (!RegisterClass(&wc)) diff --git a/src/osd/windows/output.h b/src/osd/windows/output.h index 8e8919116e3..b563c2e0711 100644 --- a/src/osd/windows/output.h +++ b/src/osd/windows/output.h @@ -48,8 +48,8 @@ //============================================================ // window parameters -#define OUTPUT_WINDOW_CLASS TEXT("MAMEOutput") -#define OUTPUT_WINDOW_NAME TEXT("MAMEOutput") +#define OUTPUT_WINDOW_CLASS TEXT("MAMEOutput") +#define OUTPUT_WINDOW_NAME TEXT("MAMEOutput") // // These messages are sent by MAME: @@ -58,18 +58,18 @@ // OM_MAME_START: broadcast when MAME initializes // WPARAM = HWND of MAME's output window // LPARAM = unused -#define OM_MAME_START TEXT("MAMEOutputStart") +#define OM_MAME_START TEXT("MAMEOutputStart") // OM_MAME_STOP: broadcast when MAME shuts down // WPARAM = HWND of MAME's output window // LPARAM = unused -#define OM_MAME_STOP TEXT("MAMEOutputStop") +#define OM_MAME_STOP TEXT("MAMEOutputStop") // OM_MAME_UPDATE_STATE: sent to registered clients when the state // of an output changes // WPARAM = ID of the output // LPARAM = new value for the output -#define OM_MAME_UPDATE_STATE TEXT("MAMEOutputUpdateState") +#define OM_MAME_UPDATE_STATE TEXT("MAMEOutputUpdateState") // @@ -79,12 +79,12 @@ // OM_MAME_REGISTER_CLIENT: sent to MAME to register a client // WPARAM = HWND of client's listener window // LPARAM = client-specified ID (must be unique) -#define OM_MAME_REGISTER_CLIENT TEXT("MAMEOutputRegister") +#define OM_MAME_REGISTER_CLIENT TEXT("MAMEOutputRegister") // OM_MAME_UNREGISTER_CLIENT: sent to MAME to unregister a client // WPARAM = HWND of client's listener window // LPARAM = client-specified ID (must match registration) -#define OM_MAME_UNREGISTER_CLIENT TEXT("MAMEOutputUnregister") +#define OM_MAME_UNREGISTER_CLIENT TEXT("MAMEOutputUnregister") // OM_MAME_GET_ID_STRING: requests the string associated with a // given ID. ID=0 is always the name of the game. Other IDs are @@ -94,7 +94,7 @@ // and lpData pointing to a NULL-terminated string. // WPARAM = HWND of client's listener window // LPARAM = ID you wish to know about -#define OM_MAME_GET_ID_STRING TEXT("MAMEOutputGetIDString") +#define OM_MAME_GET_ID_STRING TEXT("MAMEOutputGetIDString") // @@ -102,7 +102,7 @@ // coming from MAME: // -#define COPYDATA_MESSAGE_ID_STRING 1 +#define COPYDATA_MESSAGE_ID_STRING 1 @@ -112,8 +112,8 @@ struct copydata_id_string { - UINT32 id; // ID that was requested - char string[1]; // string array containing the data + UINT32 id; // ID that was requested + char string[1]; // string array containing the data }; diff --git a/src/osd/windows/sound.c b/src/osd/windows/sound.c index 413c8fb9e0b..9ccfc39e6c3 100644 --- a/src/osd/windows/sound.c +++ b/src/osd/windows/sound.c @@ -66,7 +66,7 @@ // DEBUGGING //============================================================ -#define LOG_SOUND 0 +#define LOG_SOUND 0 #define LOG(x) do { if (LOG_SOUND) logerror x; } while(0) @@ -76,35 +76,35 @@ //============================================================ // DirectSound objects -static LPDIRECTSOUND dsound; -static DSCAPS dsound_caps; +static LPDIRECTSOUND dsound; +static DSCAPS dsound_caps; // sound buffers -static LPDIRECTSOUNDBUFFER primary_buffer; -static LPDIRECTSOUNDBUFFER stream_buffer; -static UINT32 stream_buffer_size; -static UINT32 stream_buffer_in; +static LPDIRECTSOUNDBUFFER primary_buffer; +static LPDIRECTSOUNDBUFFER stream_buffer; +static UINT32 stream_buffer_size; +static UINT32 stream_buffer_in; // descriptors and formats -static DSBUFFERDESC primary_desc; -static DSBUFFERDESC stream_desc; -static WAVEFORMATEX primary_format; -static WAVEFORMATEX stream_format; +static DSBUFFERDESC primary_desc; +static DSBUFFERDESC stream_desc; +static WAVEFORMATEX primary_format; +static WAVEFORMATEX stream_format; // buffer over/underflow counts -static int buffer_underflows; -static int buffer_overflows; +static int buffer_underflows; +static int buffer_overflows; //============================================================ // PROTOTYPES //============================================================ -static void sound_exit(running_machine &machine); -static HRESULT dsound_init(running_machine &machine); -static void dsound_kill(void); -static HRESULT dsound_create_buffers(void); -static void dsound_destroy_buffers(void); +static void sound_exit(running_machine &machine); +static HRESULT dsound_init(running_machine &machine); +static void dsound_kill(void); +static HRESULT dsound_create_buffers(void); +static void dsound_destroy_buffers(void); @@ -297,12 +297,12 @@ static HRESULT dsound_init(running_machine &machine) } // make a format description for what we want - stream_format.wBitsPerSample = 16; - stream_format.wFormatTag = WAVE_FORMAT_PCM; - stream_format.nChannels = 2; - stream_format.nSamplesPerSec = machine.sample_rate(); - stream_format.nBlockAlign = stream_format.wBitsPerSample * stream_format.nChannels / 8; - stream_format.nAvgBytesPerSec = stream_format.nSamplesPerSec * stream_format.nBlockAlign; + stream_format.wBitsPerSample = 16; + stream_format.wFormatTag = WAVE_FORMAT_PCM; + stream_format.nChannels = 2; + stream_format.nSamplesPerSec = machine.sample_rate(); + stream_format.nBlockAlign = stream_format.wBitsPerSample * stream_format.nChannels / 8; + stream_format.nAvgBytesPerSec = stream_format.nSamplesPerSec * stream_format.nBlockAlign; // compute the buffer size based on the output sample rate stream_buffer_size = stream_format.nSamplesPerSec * stream_format.nBlockAlign * downcast<windows_options &>(machine.options()).audio_latency() / 10; @@ -359,7 +359,7 @@ static HRESULT dsound_create_buffers(void) // create a buffer desc for the primary buffer memset(&primary_desc, 0, sizeof(primary_desc)); - primary_desc.dwSize = sizeof(primary_desc); + primary_desc.dwSize = sizeof(primary_desc); primary_desc.dwFlags = DSBCAPS_PRIMARYBUFFER | DSBCAPS_GETCURRENTPOSITION2; primary_desc.lpwfxFormat = NULL; @@ -394,7 +394,7 @@ static HRESULT dsound_create_buffers(void) stream_desc.dwSize = sizeof(stream_desc); stream_desc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2; stream_desc.dwBufferBytes = stream_buffer_size; - stream_desc.lpwfxFormat = &stream_format; + stream_desc.lpwfxFormat = &stream_format; // create the stream buffer result = IDirectSound_CreateSoundBuffer(dsound, &stream_desc, &stream_buffer, NULL); diff --git a/src/osd/windows/strconv.h b/src/osd/windows/strconv.h index b98a7388093..bb64db4bb27 100644 --- a/src/osd/windows/strconv.h +++ b/src/osd/windows/strconv.h @@ -59,11 +59,11 @@ WCHAR *wstring_from_utf8(const char *s); char *utf8_from_wstring(const WCHAR *s); #ifdef UNICODE -#define tstring_from_utf8 wstring_from_utf8 -#define utf8_from_tstring utf8_from_wstring +#define tstring_from_utf8 wstring_from_utf8 +#define utf8_from_tstring utf8_from_wstring #else // !UNICODE -#define tstring_from_utf8 astring_from_utf8 -#define utf8_from_tstring utf8_from_astring +#define tstring_from_utf8 astring_from_utf8 +#define utf8_from_tstring utf8_from_astring #endif // UNICODE diff --git a/src/osd/windows/vconv.c b/src/osd/windows/vconv.c index 0e8319a48e9..108ab7cb4e5 100644 --- a/src/osd/windows/vconv.c +++ b/src/osd/windows/vconv.c @@ -51,13 +51,13 @@ // CONSTANTS //============================================================ -#define PRINT_COMMAND_LINE 0 +#define PRINT_COMMAND_LINE 0 -#define VS6 0x00060000 -#define VS7 0x00070000 -#define VS71 0x0007000a -#define VS2005 0x00080000 -#define VS2008 0x00090000 +#define VS6 0x00060000 +#define VS7 0x00070000 +#define VS71 0x0007000a +#define VS2005 0x00080000 +#define VS2008 0x00090000 @@ -80,90 +80,90 @@ typedef struct static const translation_info gcc_translate[] = { - { 0, "-D*", "/D*" }, - { 0, "-U*", "/U*" }, - { 0, "-I*", "/I*" }, - { 0, "-o*", "~*" }, - { 0, "-include*", "/FI*" }, - { 0, "-c", "/c~/Fo" }, - { 0, "-E", "/c~/E >" }, - { 0, "-S", "/c~/Fa" }, - { VS7, "-O0", "/Od /GS /Oi" }, - { 0, "-O0", "/Od" }, - { 0, "-O1", "/O2" }, - { 0, "-O2", "/O2" }, - { 0, "-O3", "/O2" }, - { 0, "-Os", "/O1" }, - { 0, "-g*", "/Zi" }, - { VS2005, "-fno-strict-aliasing", "" }, // deprecated in VS2005 - { 0, "-fno-strict-aliasing", "/Oa" }, - { 0, "-fno-omit-frame-pointer", "" }, - { 0, "-fomit-frame-pointer", "" }, - { 0, "-Werror", "/WX" }, - //{ VS7, "-Wall", "/Wall /W3 /wd4003 /wd4018 /wd4146 /wd4242 /wd4244 /wd4619 /wd4702 /wd4706 /wd4710 /wd4711 /wd4738 /wd4826" }, - { VS7, "-Wall", "/Wall /W4 /wd4003 /wd4018 /wd4146 /wd4242 /wd4244 /wd4619 /wd4702 /wd4706 /wd4710 /wd4711 /wd4738 /wd4826 /wd4820 /wd4514 /wd4668 /wd4127 /wd4625 /wd4626 /wd4512 /wd4100 /wd4310 /wd4571 /wd4061 /wd4131 /wd4255 /wd4510 /wd4610 /wd4505 /wd4324 /wd4611 /wd4201 /wd4189 /wd4296 /wd4986 /wd4347" }, - { 0, "-Wall", "/W0" }, - { VS7, "-Wno-unused", "/wd4100 /wd4101 /wd4102 /wd4505" }, - { 0, "-Wno-sign-compare", "/wd4365 /wd4389 /wd4245" }, - { 0, "-W*", "" }, - { VS2005, "-march=*", "" }, // deprecated in VS2005 - { 0, "-march=pentium", "/G5" }, - { 0, "-march=pentiumpro", "/G6" }, - { 0, "-march=pentium3", "/G6" }, - { 0, "-march=pentium-m", "/G6" }, - { 0, "-march=athlon", "/G7" }, - { 0, "-march=pentium4", "/G7" }, - { 0, "-march=athlon64", "/G7" }, - { VS71, "-msse2", "/arch:SSE2" }, - { 0, "-msse2", "" }, - { 0, "-msse3", "" }, - { 0, "-mwindows", "" }, - { 0, "-mno-cygwin", "" }, - { 0, "-std=gnu89", "" }, - { 0, "-std=gnu++98", "/TP" }, - { 0, "-pipe", "" }, - { 0, "-x", "" }, - { 0, "c++", "" }, + { 0, "-D*", "/D*" }, + { 0, "-U*", "/U*" }, + { 0, "-I*", "/I*" }, + { 0, "-o*", "~*" }, + { 0, "-include*", "/FI*" }, + { 0, "-c", "/c~/Fo" }, + { 0, "-E", "/c~/E >" }, + { 0, "-S", "/c~/Fa" }, + { VS7, "-O0", "/Od /GS /Oi" }, + { 0, "-O0", "/Od" }, + { 0, "-O1", "/O2" }, + { 0, "-O2", "/O2" }, + { 0, "-O3", "/O2" }, + { 0, "-Os", "/O1" }, + { 0, "-g*", "/Zi" }, + { VS2005, "-fno-strict-aliasing", "" }, // deprecated in VS2005 + { 0, "-fno-strict-aliasing", "/Oa" }, + { 0, "-fno-omit-frame-pointer", "" }, + { 0, "-fomit-frame-pointer", "" }, + { 0, "-Werror", "/WX" }, + //{ VS7, "-Wall", "/Wall /W3 /wd4003 /wd4018 /wd4146 /wd4242 /wd4244 /wd4619 /wd4702 /wd4706 /wd4710 /wd4711 /wd4738 /wd4826" }, + { VS7, "-Wall", "/Wall /W4 /wd4003 /wd4018 /wd4146 /wd4242 /wd4244 /wd4619 /wd4702 /wd4706 /wd4710 /wd4711 /wd4738 /wd4826 /wd4820 /wd4514 /wd4668 /wd4127 /wd4625 /wd4626 /wd4512 /wd4100 /wd4310 /wd4571 /wd4061 /wd4131 /wd4255 /wd4510 /wd4610 /wd4505 /wd4324 /wd4611 /wd4201 /wd4189 /wd4296 /wd4986 /wd4347" }, + { 0, "-Wall", "/W0" }, + { VS7, "-Wno-unused", "/wd4100 /wd4101 /wd4102 /wd4505" }, + { 0, "-Wno-sign-compare", "/wd4365 /wd4389 /wd4245" }, + { 0, "-W*", "" }, + { VS2005, "-march=*", "" }, // deprecated in VS2005 + { 0, "-march=pentium", "/G5" }, + { 0, "-march=pentiumpro", "/G6" }, + { 0, "-march=pentium3", "/G6" }, + { 0, "-march=pentium-m", "/G6" }, + { 0, "-march=athlon", "/G7" }, + { 0, "-march=pentium4", "/G7" }, + { 0, "-march=athlon64", "/G7" }, + { VS71, "-msse2", "/arch:SSE2" }, + { 0, "-msse2", "" }, + { 0, "-msse3", "" }, + { 0, "-mwindows", "" }, + { 0, "-mno-cygwin", "" }, + { 0, "-std=gnu89", "" }, + { 0, "-std=gnu++98", "/TP" }, + { 0, "-pipe", "" }, + { 0, "-x", "" }, + { 0, "c++", "" }, { 0 } }; static const translation_info ld_translate[] = { - { VS2008, "-lbufferoverflowu", "" }, - { 0, "-l*", "*.lib" }, - { 0, "-o*", "/out:*" }, - { 0, "-Wl,-Map,*", "/map:*" }, - { 0, "-Wl,--allow-multiple-definition", "/force:multiple" }, - { 0, "-Wl,--warn-common", "" }, - { 0, "-mno-cygwin", "" }, - { 0, "-s", "" }, - { 0, "-WO", "" }, - { 0, "-mconsole", "/subsystem:console" }, - { 0, "-mwindows", "/subsystem:windows" }, - { 0, "-municode", "" }, - { 0, "-static-libgcc", "" }, - { 0, "-static-libstdc++", "" }, - { 0, "-shared", "/dll" }, + { VS2008, "-lbufferoverflowu", "" }, + { 0, "-l*", "*.lib" }, + { 0, "-o*", "/out:*" }, + { 0, "-Wl,-Map,*", "/map:*" }, + { 0, "-Wl,--allow-multiple-definition", "/force:multiple" }, + { 0, "-Wl,--warn-common", "" }, + { 0, "-mno-cygwin", "" }, + { 0, "-s", "" }, + { 0, "-WO", "" }, + { 0, "-mconsole", "/subsystem:console" }, + { 0, "-mwindows", "/subsystem:windows" }, + { 0, "-municode", "" }, + { 0, "-static-libgcc", "" }, + { 0, "-static-libstdc++", "" }, + { 0, "-shared", "/dll" }, { 0 } }; static const translation_info ar_translate[] = { - { 0, "-cr", "" }, - { 0, "/LTCG", "/LTCG" }, + { 0, "-cr", "" }, + { 0, "/LTCG", "/LTCG" }, { 0 } }; static const translation_info windres_translate[] = { - { 0, "-D*", "/D*" }, - { 0, "-U*", "/U*" }, - { 0, "-I*", "/I*" }, - { 0, "--include-dir*", "/I*" }, - { 0, "-o*", "/fo*" }, - { 0, "-O*", "" }, - { 0, "-i*", "*" }, + { 0, "-D*", "/D*" }, + { 0, "-U*", "/U*" }, + { 0, "-I*", "/I*" }, + { 0, "--include-dir*", "/I*" }, + { 0, "-o*", "/fo*" }, + { 0, "-O*", "" }, + { 0, "-i*", "*" }, { 0 } }; diff --git a/src/osd/windows/video.h b/src/osd/windows/video.h index 86e5107b1e1..90320ee4562 100644 --- a/src/osd/windows/video.h +++ b/src/osd/windows/video.h @@ -49,12 +49,12 @@ // CONSTANTS //============================================================ -#define MAX_WINDOWS 4 +#define MAX_WINDOWS 4 -#define VIDEO_MODE_NONE 0 -#define VIDEO_MODE_GDI 1 -#define VIDEO_MODE_DDRAW 2 -#define VIDEO_MODE_D3D 3 +#define VIDEO_MODE_NONE 0 +#define VIDEO_MODE_GDI 1 +#define VIDEO_MODE_DDRAW 2 +#define VIDEO_MODE_D3D 3 @@ -64,48 +64,48 @@ struct win_monitor_info { - win_monitor_info * next; // pointer to next monitor in list - HMONITOR handle; // handle to the monitor - MONITORINFOEX info; // most recently retrieved info - float aspect; // computed/configured aspect ratio of the physical device - int reqwidth; // requested width for this monitor - int reqheight; // requested height for this monitor + win_monitor_info * next; // pointer to next monitor in list + HMONITOR handle; // handle to the monitor + MONITORINFOEX info; // most recently retrieved info + float aspect; // computed/configured aspect ratio of the physical device + int reqwidth; // requested width for this monitor + int reqheight; // requested height for this monitor }; struct win_window_config { - float aspect; // decoded aspect ratio - int width; // decoded width - int height; // decoded height - int refresh; // decoded refresh + float aspect; // decoded aspect ratio + int width; // decoded width + int height; // decoded height + int refresh; // decoded refresh }; struct win_video_config { // global configuration - int windowed; // start windowed? - int prescale; // prescale factor - int keepaspect; // keep aspect ratio - int numscreens; // number of screens - render_layer_config layerconfig; // default configuration of layers + int windowed; // start windowed? + int prescale; // prescale factor + int keepaspect; // keep aspect ratio + int numscreens; // number of screens + render_layer_config layerconfig; // default configuration of layers // per-window configuration - win_window_config window[MAX_WINDOWS]; // configuration data per-window + win_window_config window[MAX_WINDOWS]; // configuration data per-window // hardware options - int mode; // output mode - int waitvsync; // spin until vsync - int syncrefresh; // sync only to refresh rate - int triplebuf; // triple buffer - int switchres; // switch resolutions + int mode; // output mode + int waitvsync; // spin until vsync + int syncrefresh; // sync only to refresh rate + int triplebuf; // triple buffer + int switchres; // switch resolutions // ddraw options - int hwstretch; // stretch using the hardware + int hwstretch; // stretch using the hardware // d3d options - int filter; // enable filtering + int filter; // enable filtering }; diff --git a/src/osd/windows/windir.c b/src/osd/windows/windir.c index 6b41a63f04a..7ca49029c1e 100644 --- a/src/osd/windows/windir.c +++ b/src/osd/windows/windir.c @@ -63,10 +63,10 @@ struct osd_directory { - HANDLE find; // handle to the finder - int is_first; // TRUE if this is the first entry - osd_directory_entry entry; // current entry's data - WIN32_FIND_DATA data; // current raw data + HANDLE find; // handle to the finder + int is_first; // TRUE if this is the first entry + osd_directory_entry entry; // current entry's data + WIN32_FIND_DATA data; // current raw data }; @@ -184,4 +184,3 @@ int osd_is_absolute_path(const char *path) } return result; } - diff --git a/src/osd/windows/window.c b/src/osd/windows/window.c index b4d8114815a..52366a704f8 100644 --- a/src/osd/windows/window.c +++ b/src/osd/windows/window.c @@ -39,8 +39,8 @@ // //============================================================ -#define LOG_THREADS 0 -#define LOG_TEMP_PAUSE 0 +#define LOG_THREADS 0 +#define LOG_TEMP_PAUSE 0 // Needed for RAW Input #define WM_INPUT 0x00FF @@ -80,29 +80,29 @@ extern int drawd3d_init(running_machine &machine, win_draw_callbacks *callbacks) //============================================================ // window styles -#define WINDOW_STYLE WS_OVERLAPPEDWINDOW -#define WINDOW_STYLE_EX 0 +#define WINDOW_STYLE WS_OVERLAPPEDWINDOW +#define WINDOW_STYLE_EX 0 // debugger window styles -#define DEBUG_WINDOW_STYLE WS_OVERLAPPED -#define DEBUG_WINDOW_STYLE_EX 0 +#define DEBUG_WINDOW_STYLE WS_OVERLAPPED +#define DEBUG_WINDOW_STYLE_EX 0 // full screen window styles -#define FULLSCREEN_STYLE WS_POPUP -#define FULLSCREEN_STYLE_EX WS_EX_TOPMOST +#define FULLSCREEN_STYLE WS_POPUP +#define FULLSCREEN_STYLE_EX WS_EX_TOPMOST // minimum window dimension -#define MIN_WINDOW_DIM 200 +#define MIN_WINDOW_DIM 200 // custom window messages -#define WM_USER_FINISH_CREATE_WINDOW (WM_USER + 0) -#define WM_USER_SELF_TERMINATE (WM_USER + 1) -#define WM_USER_REDRAW (WM_USER + 2) -#define WM_USER_SET_FULLSCREEN (WM_USER + 3) -#define WM_USER_SET_MAXSIZE (WM_USER + 4) -#define WM_USER_SET_MINSIZE (WM_USER + 5) -#define WM_USER_UI_TEMP_PAUSE (WM_USER + 6) -#define WM_USER_EXEC_FUNC (WM_USER + 7) +#define WM_USER_FINISH_CREATE_WINDOW (WM_USER + 0) +#define WM_USER_SELF_TERMINATE (WM_USER + 1) +#define WM_USER_REDRAW (WM_USER + 2) +#define WM_USER_SET_FULLSCREEN (WM_USER + 3) +#define WM_USER_SET_MAXSIZE (WM_USER + 4) +#define WM_USER_SET_MINSIZE (WM_USER + 5) +#define WM_USER_UI_TEMP_PAUSE (WM_USER + 6) +#define WM_USER_EXEC_FUNC (WM_USER + 7) @@ -175,7 +175,7 @@ static void set_fullscreen(win_window_info *window, int fullscreen); #if LOG_THREADS struct mtlog { - osd_ticks_t timestamp; + osd_ticks_t timestamp; const char *event; }; @@ -872,11 +872,11 @@ static void create_window_class(void) WNDCLASS wc = { 0 }; // initialize the description of the window class - wc.lpszClassName = TEXT("MAME"); - wc.hInstance = GetModuleHandle(NULL); - wc.lpfnWndProc = winwindow_video_window_proc_ui; - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hIcon = LoadIcon(wc.hInstance, MAKEINTRESOURCE(2)); + wc.lpszClassName = TEXT("MAME"); + wc.hInstance = GetModuleHandle(NULL); + wc.lpfnWndProc = winwindow_video_window_proc_ui; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hIcon = LoadIcon(wc.hInstance, MAKEINTRESOURCE(2)); // register the class; fail if we can't if (!RegisterClass(&wc)) diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h index 5e167c934a0..cd1ebc80842 100644 --- a/src/osd/windows/window.h +++ b/src/osd/windows/window.h @@ -55,9 +55,9 @@ // CONSTANTS //============================================================ -#define RESIZE_STATE_NORMAL 0 -#define RESIZE_STATE_RESIZING 1 -#define RESIZE_STATE_PENDING 2 +#define RESIZE_STATE_NORMAL 0 +#define RESIZE_STATE_RESIZING 1 +#define RESIZE_STATE_PENDING 2 @@ -73,44 +73,44 @@ public: running_machine &machine() const { return m_machine; } - win_window_info * next; - volatile int init_state; + win_window_info * next; + volatile int init_state; // window handle and info - HWND hwnd; - char title[256]; - RECT non_fullscreen_bounds; - int startmaximized; - int isminimized; - int ismaximized; - int resize_state; + HWND hwnd; + char title[256]; + RECT non_fullscreen_bounds; + int startmaximized; + int isminimized; + int ismaximized; + int resize_state; // monitor info - win_monitor_info * monitor; - int fullscreen; - int fullscreen_safe; - int maxwidth, maxheight; - int refresh; - float aspect; + win_monitor_info * monitor; + int fullscreen; + int fullscreen_safe; + int maxwidth, maxheight; + int refresh; + float aspect; // rendering info - osd_lock * render_lock; - render_target * target; - int targetview; - int targetorient; - render_layer_config targetlayerconfig; + osd_lock * render_lock; + render_target * target; + int targetview; + int targetorient; + render_layer_config targetlayerconfig; render_primitive_list *primlist; // input info - DWORD lastclicktime; - int lastclickx; - int lastclicky; + DWORD lastclicktime; + int lastclickx; + int lastclicky; // drawing data - void * drawdata; + void * drawdata; private: - running_machine & m_machine; + running_machine & m_machine; }; diff --git a/src/osd/windows/windows.mak b/src/osd/windows/windows.mak index 0b8cd744c28..809fa259426 100644 --- a/src/osd/windows/windows.mak +++ b/src/osd/windows/windows.mak @@ -98,7 +98,7 @@ RCFLAGS = -O coff -I $(WINSRC) -I $(WINOBJ) ifdef CYGWIN_BUILD CCOMFLAGS += -mno-cygwin -LDFLAGS += -mno-cygwin +LDFLAGS += -mno-cygwin endif @@ -279,8 +279,8 @@ LIBS += -lcomdlg32 #------------------------------------------------- OSDCOREOBJS = \ - $(WINOBJ)/main.o \ - $(WINOBJ)/strconv.o \ + $(WINOBJ)/main.o \ + $(WINOBJ)/strconv.o \ $(WINOBJ)/windir.o \ $(WINOBJ)/winfile.o \ $(WINOBJ)/winmisc.o \ @@ -292,7 +292,7 @@ OSDCOREOBJS = \ $(WINOBJ)/winsocket.o \ $(WINOBJ)/winwork.o \ $(WINOBJ)/winptty.o \ - $(WINOBJ)/winmidi.o + $(WINOBJ)/winmidi.o #------------------------------------------------- @@ -328,8 +328,8 @@ OSDOBJS += $(WINOBJ)/d3d8intf.o endif # extra dependencies -$(WINOBJ)/drawdd.o : $(SRC)/emu/rendersw.c -$(WINOBJ)/drawgdi.o : $(SRC)/emu/rendersw.c +$(WINOBJ)/drawdd.o : $(SRC)/emu/rendersw.c +$(WINOBJ)/drawgdi.o : $(SRC)/emu/rendersw.c $(WINOBJ)/winmidi.o: $(SRC)/osd/portmedia/pmmidi.c # add debug-specific files diff --git a/src/osd/windows/winfile.c b/src/osd/windows/winfile.c index 1d3ea1748a6..2afa8da23ed 100644 --- a/src/osd/windows/winfile.c +++ b/src/osd/windows/winfile.c @@ -202,8 +202,8 @@ file_error osd_read(osd_file *file, void *buffer, UINT64 offset, UINT32 length, LONG upper = offset >> 32; DWORD result; - switch (file->type) - { + switch (file->type) + { case WINFILE_FILE: // attempt to set the file pointer result = SetFilePointer(file->handle, (UINT32)offset, &upper, FILE_BEGIN); @@ -241,8 +241,8 @@ file_error osd_write(osd_file *file, const void *buffer, UINT64 offset, UINT32 l LONG upper = offset >> 32; DWORD result; - switch (file->type) - { + switch (file->type) + { case WINFILE_FILE: // attempt to set the file pointer result = SetFilePointer(file->handle, (UINT32)offset, &upper, FILE_BEGIN); @@ -277,8 +277,8 @@ file_error osd_write(osd_file *file, const void *buffer, UINT64 offset, UINT32 l file_error osd_close(osd_file *file) { - switch (file->type) - { + switch (file->type) + { case WINFILE_FILE: // close the file handle and free the file structure CloseHandle(file->handle); diff --git a/src/osd/windows/winfile.h b/src/osd/windows/winfile.h index cae70873982..a5afab43a58 100644 --- a/src/osd/windows/winfile.h +++ b/src/osd/windows/winfile.h @@ -25,10 +25,10 @@ enum struct osd_file { - HANDLE handle; - SOCKET socket; - int type; - TCHAR filename[1]; + HANDLE handle; + SOCKET socket; + int type; + TCHAR filename[1]; }; //============================================================ diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c index 9fb164d22e0..1d84d659c77 100644 --- a/src/osd/windows/winmain.c +++ b/src/osd/windows/winmain.c @@ -75,7 +75,7 @@ #include "netdev.h" #endif -#define DEBUG_SLOW_LOCKS 0 +#define DEBUG_SLOW_LOCKS 0 //************************************************************************** @@ -114,7 +114,7 @@ public: _FunctionPtr operator *() const { return m_function; } private: - _FunctionPtr m_function; + _FunctionPtr m_function; }; @@ -132,11 +132,11 @@ public: bool unwind(); private: - HANDLE m_process; - HANDLE m_thread; - STACKFRAME64 m_stackframe; - CONTEXT m_context; - bool m_first; + HANDLE m_process; + HANDLE m_thread; + STACKFRAME64 m_stackframe; + CONTEXT m_context; + bool m_first; dynamic_bind<BOOL (WINAPI *)(DWORD, HANDLE, HANDLE, LPSTACKFRAME64, PVOID, PREAD_PROCESS_MEMORY_ROUTINE64, PFUNCTION_TABLE_ACCESS_ROUTINE64, PGET_MODULE_BASE_ROUTINE64, PTRANSLATE_ADDRESS_ROUTINE64)> m_stack_walk_64; @@ -145,7 +145,7 @@ private: dynamic_bind<DWORD64 (WINAPI *)(HANDLE, DWORD64)> m_sym_get_module_base_64; dynamic_bind<VOID (WINAPI *)(PCONTEXT)> m_rtl_capture_context; - static bool s_initialized; + static bool s_initialized; }; @@ -184,18 +184,18 @@ private: m_next(NULL), m_address(address), m_name(symbol) { } cache_entry *next() const { return m_next; } - cache_entry * m_next; - FPTR m_address; - astring m_name; + cache_entry * m_next; + FPTR m_address; + astring m_name; }; simple_list<cache_entry> m_cache; - astring m_mapfile; - astring m_symfile; - astring m_buffer; - HANDLE m_process; - FPTR m_last_base; - FPTR m_text_base; + astring m_mapfile; + astring m_symfile; + astring m_buffer; + HANDLE m_process; + FPTR m_last_base; + FPTR m_text_base; dynamic_bind<BOOL (WINAPI *)(HANDLE, DWORD64, PDWORD64, PSYMBOL_INFO)> m_sym_from_addr; dynamic_bind<BOOL (WINAPI *)(HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINE64)> m_sym_get_line_from_addr_64; @@ -221,18 +221,18 @@ private: static int CLIB_DECL compare_address(const void *item1, const void *item2); static int CLIB_DECL compare_frequency(const void *item1, const void *item2); - HANDLE m_target_thread; + HANDLE m_target_thread; - HANDLE m_thread; - DWORD m_thread_id; - volatile bool m_thread_exit; + HANDLE m_thread; + DWORD m_thread_id; + volatile bool m_thread_exit; - UINT8 m_stack_depth; - UINT8 m_entry_stride; - UINT32 m_max_seconds; - FPTR * m_buffer; - FPTR * m_buffer_ptr; - FPTR * m_buffer_end; + UINT8 m_stack_depth; + UINT8 m_entry_stride; + UINT32 m_max_seconds; + FPTR * m_buffer; + FPTR * m_buffer_ptr; + FPTR * m_buffer_end; }; @@ -306,7 +306,7 @@ const options_entry windows_options::s_option_entries[] = { NULL, NULL, OPTION_HEADER, "WINDOWS PERFORMANCE OPTIONS" }, { WINOPTION_PRIORITY "(-15-1)", "0", OPTION_INTEGER, "thread priority for the main game thread; range from -15 to 1" }, { WINOPTION_MULTITHREADING ";mt", "1", OPTION_BOOLEAN, "enable multithreading; this enables rendering and blitting on a separate thread" }, - { WINOPTION_NUMPROCESSORS ";np", "auto", OPTION_STRING, "number of processors; this overrides the number the system reports" }, + { WINOPTION_NUMPROCESSORS ";np", "auto", OPTION_STRING, "number of processors; this overrides the number the system reports" }, { WINOPTION_PROFILE, "0", OPTION_INTEGER, "enable profiling, specifying the stack depth to track" }, { WINOPTION_BENCH, "0", OPTION_INTEGER, "benchmark for the given number of emulated seconds; implies -video none -nosound -nothrottle" }, @@ -320,7 +320,7 @@ const options_entry windows_options::s_option_entries[] = { WINOPTION_PRESCALE, "1", OPTION_INTEGER, "scale screen rendering by this amount in software" }, { WINOPTION_WAITVSYNC ";vs", "0", OPTION_BOOLEAN, "enable waiting for the start of VBLANK before flipping screens; reduces tearing effects" }, { WINOPTION_SYNCREFRESH ";srf", "0", OPTION_BOOLEAN, "enable using the start of VBLANK for throttling instead of the game time" }, - { WINOPTION_MENU, "0", OPTION_BOOLEAN, "enable menu bar if available by UI implementation" }, + { WINOPTION_MENU, "0", OPTION_BOOLEAN, "enable menu bar if available by UI implementation" }, // DirectDraw-specific options { NULL, NULL, OPTION_HEADER, "DIRECTDRAW-SPECIFIC OPTIONS" }, @@ -332,61 +332,61 @@ const options_entry windows_options::s_option_entries[] = { WINOPTION_FILTER ";d3dfilter;flt", "1", OPTION_BOOLEAN, "enable bilinear filtering on screen output" }, // post-processing options - { NULL, NULL, OPTION_HEADER, "DIRECT3D POST-PROCESSING OPTIONS" }, - { WINOPTION_HLSL_ENABLE";hlsl", "0", OPTION_BOOLEAN, "enable HLSL post-processing (PS3.0 required)" }, - { WINOPTION_HLSLPATH, "hlsl", OPTION_STRING, "path to hlsl files" }, - { WINOPTION_HLSL_INI_READ, "0", OPTION_BOOLEAN, "enable HLSL INI reading" }, - { WINOPTION_HLSL_INI_WRITE, "0", OPTION_BOOLEAN, "enable HLSL INI writing" }, - { WINOPTION_HLSL_INI_NAME, "%g", OPTION_STRING, "HLSL INI file name for this game" }, - { WINOPTION_HLSL_PRESCALE_X, "0", OPTION_INTEGER, "HLSL pre-scale override factor for X (0 for auto)" }, - { WINOPTION_HLSL_PRESCALE_Y, "0", OPTION_INTEGER, "HLSL pre-scale override factor for Y (0 for auto)" }, + { NULL, NULL, OPTION_HEADER, "DIRECT3D POST-PROCESSING OPTIONS" }, + { WINOPTION_HLSL_ENABLE";hlsl", "0", OPTION_BOOLEAN, "enable HLSL post-processing (PS3.0 required)" }, + { WINOPTION_HLSLPATH, "hlsl", OPTION_STRING, "path to hlsl files" }, + { WINOPTION_HLSL_INI_READ, "0", OPTION_BOOLEAN, "enable HLSL INI reading" }, + { WINOPTION_HLSL_INI_WRITE, "0", OPTION_BOOLEAN, "enable HLSL INI writing" }, + { WINOPTION_HLSL_INI_NAME, "%g", OPTION_STRING, "HLSL INI file name for this game" }, + { WINOPTION_HLSL_PRESCALE_X, "0", OPTION_INTEGER, "HLSL pre-scale override factor for X (0 for auto)" }, + { WINOPTION_HLSL_PRESCALE_Y, "0", OPTION_INTEGER, "HLSL pre-scale override factor for Y (0 for auto)" }, { WINOPTION_HLSL_PRESET";(-1-3)", "-1", OPTION_INTEGER, "HLSL preset to use (0-3)" }, - { WINOPTION_HLSL_WRITE, NULL, OPTION_STRING, "enable HLSL AVI writing (huge disk bandwidth suggested)" }, - { WINOPTION_HLSL_SNAP_WIDTH, "2048", OPTION_STRING, "HLSL upscaled-snapshot width" }, - { WINOPTION_HLSL_SNAP_HEIGHT, "1536", OPTION_STRING, "HLSL upscaled-snapshot height" }, + { WINOPTION_HLSL_WRITE, NULL, OPTION_STRING, "enable HLSL AVI writing (huge disk bandwidth suggested)" }, + { WINOPTION_HLSL_SNAP_WIDTH, "2048", OPTION_STRING, "HLSL upscaled-snapshot width" }, + { WINOPTION_HLSL_SNAP_HEIGHT, "1536", OPTION_STRING, "HLSL upscaled-snapshot height" }, { WINOPTION_SHADOW_MASK_ALPHA";fs_shadwa(0.0-1.0)", "0.0", OPTION_FLOAT, "shadow mask alpha-blend value (1.0 is fully blended, 0.0 is no mask)" }, { WINOPTION_SHADOW_MASK_TEXTURE";fs_shadwt(0.0-1.0)", "aperture.png", OPTION_STRING, "shadow mask texture name" }, - { WINOPTION_SHADOW_MASK_COUNT_X";fs_shadww", "320", OPTION_INTEGER, "shadow mask width, in phosphor dots" }, - { WINOPTION_SHADOW_MASK_COUNT_Y";fs_shadwh", "240", OPTION_INTEGER, "shadow mask height, in phosphor dots" }, - { WINOPTION_SHADOW_MASK_USIZE";fs_shadwu(0.0-1.0)", "0.09375", OPTION_FLOAT, "shadow mask texture size in U direction" }, - { WINOPTION_SHADOW_MASK_VSIZE";fs_shadwv(0.0-1.0)", "0.109375", OPTION_FLOAT, "shadow mask texture size in V direction" }, - { WINOPTION_CURVATURE";fs_curv(0.0-4.0)", "0.0", OPTION_FLOAT, "screen curvature amount" }, + { WINOPTION_SHADOW_MASK_COUNT_X";fs_shadww", "320", OPTION_INTEGER, "shadow mask width, in phosphor dots" }, + { WINOPTION_SHADOW_MASK_COUNT_Y";fs_shadwh", "240", OPTION_INTEGER, "shadow mask height, in phosphor dots" }, + { WINOPTION_SHADOW_MASK_USIZE";fs_shadwu(0.0-1.0)", "0.09375", OPTION_FLOAT, "shadow mask texture size in U direction" }, + { WINOPTION_SHADOW_MASK_VSIZE";fs_shadwv(0.0-1.0)", "0.109375", OPTION_FLOAT, "shadow mask texture size in V direction" }, + { WINOPTION_CURVATURE";fs_curv(0.0-4.0)", "0.0", OPTION_FLOAT, "screen curvature amount" }, /* Beam-related values below this line*/ - { WINOPTION_PINCUSHION";fs_pin(0.0-4.0)", "0.0", OPTION_FLOAT, "pincushion amount" }, - { WINOPTION_SCANLINE_AMOUNT";fs_scanam(0.0-4.0)", "0.0", OPTION_FLOAT, "overall alpha scaling value for scanlines" }, - { WINOPTION_SCANLINE_SCALE";fs_scansc(0.0-4.0)", "1.0", OPTION_FLOAT, "overall height scaling value for scanlines" }, - { WINOPTION_SCANLINE_HEIGHT";fs_scanh(0.0-4.0)", "0.7", OPTION_FLOAT, "individual height scaling value for scanlines" }, - { WINOPTION_SCANLINE_BRIGHT_SCALE";fs_scanbs(0.0-2.0)", "1.0", OPTION_FLOAT, "overall brightness scaling value for scanlines (multiplicative)" }, - { WINOPTION_SCANLINE_BRIGHT_OFFSET";fs_scanbo(0.0-1.0)", "0.0", OPTION_FLOAT, "overall brightness offset value for scanlines (additive)" }, - { WINOPTION_SCANLINE_OFFSET";fs_scanjt(0.0-4.0)", "0.0", OPTION_FLOAT, "overall interlace jitter scaling value for scanlines" }, - { WINOPTION_DEFOCUS";fs_focus", "0.0,0.0", OPTION_STRING, "overall defocus value in screen-relative coords" }, - { WINOPTION_CONVERGE_X";fs_convx", "0.0,0.0,0.0",OPTION_STRING, "convergence in screen-relative X direction" }, - { WINOPTION_CONVERGE_Y";fs_convy", "0.0,0.0,0.0",OPTION_STRING, "convergence in screen-relative Y direction" }, - { WINOPTION_RADIAL_CONVERGE_X";fs_rconvx", "0.0,0.0,0.0",OPTION_STRING, "radial convergence in screen-relative X direction" }, - { WINOPTION_RADIAL_CONVERGE_Y";fs_rconvy", "0.0,0.0,0.0",OPTION_STRING, "radial convergence in screen-relative Y direction" }, + { WINOPTION_PINCUSHION";fs_pin(0.0-4.0)", "0.0", OPTION_FLOAT, "pincushion amount" }, + { WINOPTION_SCANLINE_AMOUNT";fs_scanam(0.0-4.0)", "0.0", OPTION_FLOAT, "overall alpha scaling value for scanlines" }, + { WINOPTION_SCANLINE_SCALE";fs_scansc(0.0-4.0)", "1.0", OPTION_FLOAT, "overall height scaling value for scanlines" }, + { WINOPTION_SCANLINE_HEIGHT";fs_scanh(0.0-4.0)", "0.7", OPTION_FLOAT, "individual height scaling value for scanlines" }, + { WINOPTION_SCANLINE_BRIGHT_SCALE";fs_scanbs(0.0-2.0)", "1.0", OPTION_FLOAT, "overall brightness scaling value for scanlines (multiplicative)" }, + { WINOPTION_SCANLINE_BRIGHT_OFFSET";fs_scanbo(0.0-1.0)", "0.0", OPTION_FLOAT, "overall brightness offset value for scanlines (additive)" }, + { WINOPTION_SCANLINE_OFFSET";fs_scanjt(0.0-4.0)", "0.0", OPTION_FLOAT, "overall interlace jitter scaling value for scanlines" }, + { WINOPTION_DEFOCUS";fs_focus", "0.0,0.0", OPTION_STRING, "overall defocus value in screen-relative coords" }, + { WINOPTION_CONVERGE_X";fs_convx", "0.0,0.0,0.0",OPTION_STRING, "convergence in screen-relative X direction" }, + { WINOPTION_CONVERGE_Y";fs_convy", "0.0,0.0,0.0",OPTION_STRING, "convergence in screen-relative Y direction" }, + { WINOPTION_RADIAL_CONVERGE_X";fs_rconvx", "0.0,0.0,0.0",OPTION_STRING, "radial convergence in screen-relative X direction" }, + { WINOPTION_RADIAL_CONVERGE_Y";fs_rconvy", "0.0,0.0,0.0",OPTION_STRING, "radial convergence in screen-relative Y direction" }, /* RGB colorspace convolution below this line */ - { WINOPTION_RED_RATIO";fs_redratio", "1.0,0.0,0.0",OPTION_STRING, "red output signal generated by input signal" }, - { WINOPTION_GRN_RATIO";fs_grnratio", "0.0,1.0,0.0",OPTION_STRING, "green output signal generated by input signal" }, - { WINOPTION_BLU_RATIO";fs_bluratio", "0.0,0.0,1.0",OPTION_STRING, "blue output signal generated by input signal" }, - { WINOPTION_SATURATION";fs_sat(0.0-4.0)", "1.0", OPTION_FLOAT, "saturation scaling value" }, - { WINOPTION_OFFSET";fs_offset", "0.0,0.0,0.0",OPTION_STRING, "signal offset value (additive)" }, - { WINOPTION_SCALE";fs_scale", "1.0,1.0,1.0",OPTION_STRING, "signal scaling value (multiplicative)" }, - { WINOPTION_POWER";fs_power", "1.0,1.0,1.0",OPTION_STRING, "signal power value (exponential)" }, - { WINOPTION_FLOOR";fs_floor", "0.0,0.0,0.0",OPTION_STRING, "signal floor level" }, - { WINOPTION_PHOSPHOR";fs_phosphor", "0.0,0.0,0.0",OPTION_STRING, "phosphorescence decay rate (0.0 is instant, 1.0 is forever)" }, + { WINOPTION_RED_RATIO";fs_redratio", "1.0,0.0,0.0",OPTION_STRING, "red output signal generated by input signal" }, + { WINOPTION_GRN_RATIO";fs_grnratio", "0.0,1.0,0.0",OPTION_STRING, "green output signal generated by input signal" }, + { WINOPTION_BLU_RATIO";fs_bluratio", "0.0,0.0,1.0",OPTION_STRING, "blue output signal generated by input signal" }, + { WINOPTION_SATURATION";fs_sat(0.0-4.0)", "1.0", OPTION_FLOAT, "saturation scaling value" }, + { WINOPTION_OFFSET";fs_offset", "0.0,0.0,0.0",OPTION_STRING, "signal offset value (additive)" }, + { WINOPTION_SCALE";fs_scale", "1.0,1.0,1.0",OPTION_STRING, "signal scaling value (multiplicative)" }, + { WINOPTION_POWER";fs_power", "1.0,1.0,1.0",OPTION_STRING, "signal power value (exponential)" }, + { WINOPTION_FLOOR";fs_floor", "0.0,0.0,0.0",OPTION_STRING, "signal floor level" }, + { WINOPTION_PHOSPHOR";fs_phosphor", "0.0,0.0,0.0",OPTION_STRING, "phosphorescence decay rate (0.0 is instant, 1.0 is forever)" }, /* NTSC simulation below this line */ - { WINOPTION_YIQ_ENABLE";yiq", "0", OPTION_BOOLEAN, "enable YIQ-space HLSL post-processing" }, - { WINOPTION_YIQ_CCVALUE";yiqcc", "3.59754545",OPTION_FLOAT, "Color Carrier frequency for NTSC signal processing" }, - { WINOPTION_YIQ_AVALUE";yiqa", "0.5", OPTION_FLOAT, "A value for NTSC signal processing" }, - { WINOPTION_YIQ_BVALUE";yiqb", "0.5", OPTION_FLOAT, "B value for NTSC signal processing" }, - { WINOPTION_YIQ_OVALUE";yiqo", "0.0", OPTION_FLOAT, "Outgoing Color Carrier phase offset for NTSC signal processing" }, - { WINOPTION_YIQ_PVALUE";yiqp", "1.0", OPTION_FLOAT, "Incoming Pixel Clock scaling value for NTSC signal processing" }, - { WINOPTION_YIQ_NVALUE";yiqn", "1.0", OPTION_FLOAT, "Y filter notch width for NTSC signal processing" }, - { WINOPTION_YIQ_YVALUE";yiqy", "6.0", OPTION_FLOAT, "Y filter cutoff frequency for NTSC signal processing" }, - { WINOPTION_YIQ_IVALUE";yiqi", "1.2", OPTION_FLOAT, "I filter cutoff frequency for NTSC signal processing" }, - { WINOPTION_YIQ_QVALUE";yiqq", "0.6", OPTION_FLOAT, "Q filter cutoff frequency for NTSC signal processing" }, - { WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" }, - { WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" }, + { WINOPTION_YIQ_ENABLE";yiq", "0", OPTION_BOOLEAN, "enable YIQ-space HLSL post-processing" }, + { WINOPTION_YIQ_CCVALUE";yiqcc", "3.59754545",OPTION_FLOAT, "Color Carrier frequency for NTSC signal processing" }, + { WINOPTION_YIQ_AVALUE";yiqa", "0.5", OPTION_FLOAT, "A value for NTSC signal processing" }, + { WINOPTION_YIQ_BVALUE";yiqb", "0.5", OPTION_FLOAT, "B value for NTSC signal processing" }, + { WINOPTION_YIQ_OVALUE";yiqo", "0.0", OPTION_FLOAT, "Outgoing Color Carrier phase offset for NTSC signal processing" }, + { WINOPTION_YIQ_PVALUE";yiqp", "1.0", OPTION_FLOAT, "Incoming Pixel Clock scaling value for NTSC signal processing" }, + { WINOPTION_YIQ_NVALUE";yiqn", "1.0", OPTION_FLOAT, "Y filter notch width for NTSC signal processing" }, + { WINOPTION_YIQ_YVALUE";yiqy", "6.0", OPTION_FLOAT, "Y filter cutoff frequency for NTSC signal processing" }, + { WINOPTION_YIQ_IVALUE";yiqi", "1.2", OPTION_FLOAT, "I filter cutoff frequency for NTSC signal processing" }, + { WINOPTION_YIQ_QVALUE";yiqq", "0.6", OPTION_FLOAT, "Q filter cutoff frequency for NTSC signal processing" }, + { WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" }, + { WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" }, // per-window options { NULL, NULL, OPTION_HEADER, "PER-WINDOW VIDEO OPTIONS" }, @@ -511,12 +511,12 @@ static BOOL WINAPI control_handler(DWORD type) // indicate to the user that we detected something switch (type) { - case CTRL_C_EVENT: fprintf(stderr, "Caught Ctrl+C"); break; - case CTRL_BREAK_EVENT: fprintf(stderr, "Caught Ctrl+break"); break; - case CTRL_CLOSE_EVENT: fprintf(stderr, "Caught console close"); break; - case CTRL_LOGOFF_EVENT: fprintf(stderr, "Caught logoff"); break; - case CTRL_SHUTDOWN_EVENT: fprintf(stderr, "Caught shutdown"); break; - default: fprintf(stderr, "Caught unexpected console event"); break; + case CTRL_C_EVENT: fprintf(stderr, "Caught Ctrl+C"); break; + case CTRL_BREAK_EVENT: fprintf(stderr, "Caught Ctrl+break"); break; + case CTRL_CLOSE_EVENT: fprintf(stderr, "Caught console close"); break; + case CTRL_LOGOFF_EVENT: fprintf(stderr, "Caught logoff"); break; + case CTRL_SHUTDOWN_EVENT: fprintf(stderr, "Caught shutdown"); break; + default: fprintf(stderr, "Caught unexpected console event"); break; } // if we don't have a machine yet, or if we are handling ctrl+c/ctrl+break, @@ -1067,29 +1067,29 @@ static LONG WINAPI exception_filter(struct _EXCEPTION_POINTERS *info) const char *string; } exception_table[] = { - { EXCEPTION_ACCESS_VIOLATION, "ACCESS VIOLATION" }, - { EXCEPTION_DATATYPE_MISALIGNMENT, "DATATYPE MISALIGNMENT" }, - { EXCEPTION_BREAKPOINT, "BREAKPOINT" }, - { EXCEPTION_SINGLE_STEP, "SINGLE STEP" }, - { EXCEPTION_ARRAY_BOUNDS_EXCEEDED, "ARRAY BOUNDS EXCEEDED" }, - { EXCEPTION_FLT_DENORMAL_OPERAND, "FLOAT DENORMAL OPERAND" }, - { EXCEPTION_FLT_DIVIDE_BY_ZERO, "FLOAT DIVIDE BY ZERO" }, - { EXCEPTION_FLT_INEXACT_RESULT, "FLOAT INEXACT RESULT" }, - { EXCEPTION_FLT_INVALID_OPERATION, "FLOAT INVALID OPERATION" }, - { EXCEPTION_FLT_OVERFLOW, "FLOAT OVERFLOW" }, - { EXCEPTION_FLT_STACK_CHECK, "FLOAT STACK CHECK" }, - { EXCEPTION_FLT_UNDERFLOW, "FLOAT UNDERFLOW" }, - { EXCEPTION_INT_DIVIDE_BY_ZERO, "INTEGER DIVIDE BY ZERO" }, - { EXCEPTION_INT_OVERFLOW, "INTEGER OVERFLOW" }, - { EXCEPTION_PRIV_INSTRUCTION, "PRIVILEGED INSTRUCTION" }, - { EXCEPTION_IN_PAGE_ERROR, "IN PAGE ERROR" }, - { EXCEPTION_ILLEGAL_INSTRUCTION, "ILLEGAL INSTRUCTION" }, + { EXCEPTION_ACCESS_VIOLATION, "ACCESS VIOLATION" }, + { EXCEPTION_DATATYPE_MISALIGNMENT, "DATATYPE MISALIGNMENT" }, + { EXCEPTION_BREAKPOINT, "BREAKPOINT" }, + { EXCEPTION_SINGLE_STEP, "SINGLE STEP" }, + { EXCEPTION_ARRAY_BOUNDS_EXCEEDED, "ARRAY BOUNDS EXCEEDED" }, + { EXCEPTION_FLT_DENORMAL_OPERAND, "FLOAT DENORMAL OPERAND" }, + { EXCEPTION_FLT_DIVIDE_BY_ZERO, "FLOAT DIVIDE BY ZERO" }, + { EXCEPTION_FLT_INEXACT_RESULT, "FLOAT INEXACT RESULT" }, + { EXCEPTION_FLT_INVALID_OPERATION, "FLOAT INVALID OPERATION" }, + { EXCEPTION_FLT_OVERFLOW, "FLOAT OVERFLOW" }, + { EXCEPTION_FLT_STACK_CHECK, "FLOAT STACK CHECK" }, + { EXCEPTION_FLT_UNDERFLOW, "FLOAT UNDERFLOW" }, + { EXCEPTION_INT_DIVIDE_BY_ZERO, "INTEGER DIVIDE BY ZERO" }, + { EXCEPTION_INT_OVERFLOW, "INTEGER OVERFLOW" }, + { EXCEPTION_PRIV_INSTRUCTION, "PRIVILEGED INSTRUCTION" }, + { EXCEPTION_IN_PAGE_ERROR, "IN PAGE ERROR" }, + { EXCEPTION_ILLEGAL_INSTRUCTION, "ILLEGAL INSTRUCTION" }, { EXCEPTION_NONCONTINUABLE_EXCEPTION,"NONCONTINUABLE EXCEPTION" }, - { EXCEPTION_STACK_OVERFLOW, "STACK OVERFLOW" }, - { EXCEPTION_INVALID_DISPOSITION, "INVALID DISPOSITION" }, - { EXCEPTION_GUARD_PAGE, "GUARD PAGE VIOLATION" }, - { EXCEPTION_INVALID_HANDLE, "INVALID HANDLE" }, - { 0, "UNKNOWN EXCEPTION" } + { EXCEPTION_STACK_OVERFLOW, "STACK OVERFLOW" }, + { EXCEPTION_INVALID_DISPOSITION, "INVALID DISPOSITION" }, + { EXCEPTION_GUARD_PAGE, "GUARD PAGE VIOLATION" }, + { EXCEPTION_INVALID_HANDLE, "INVALID HANDLE" }, + { 0, "UNKNOWN EXCEPTION" } }; static int already_hit = 0; int i; @@ -1186,13 +1186,13 @@ static LONG WINAPI exception_filter(struct _EXCEPTION_POINTERS *info) stack_walker::stack_walker() : m_process(GetCurrentProcess()), - m_thread(GetCurrentThread()), - m_first(true), - m_stack_walk_64(TEXT("dbghelp.dll"), "StackWalk64"), - m_sym_initialize(TEXT("dbghelp.dll"), "SymInitialize"), - m_sym_function_table_access_64(TEXT("dbghelp.dll"), "SymFunctionTableAccess64"), - m_sym_get_module_base_64(TEXT("dbghelp.dll"), "SymGetModuleBase64"), - m_rtl_capture_context(TEXT("kernel32.dll"), "RtlCaptureContext") + m_thread(GetCurrentThread()), + m_first(true), + m_stack_walk_64(TEXT("dbghelp.dll"), "StackWalk64"), + m_sym_initialize(TEXT("dbghelp.dll"), "SymInitialize"), + m_sym_function_table_access_64(TEXT("dbghelp.dll"), "SymFunctionTableAccess64"), + m_sym_get_module_base_64(TEXT("dbghelp.dll"), "SymGetModuleBase64"), + m_rtl_capture_context(TEXT("kernel32.dll"), "RtlCaptureContext") { // zap the structs memset(&m_stackframe, 0, sizeof(m_stackframe)); @@ -1302,12 +1302,12 @@ bool stack_walker::unwind() symbol_manager::symbol_manager(const char *argv0) : m_mapfile(argv0), - m_symfile(argv0), - m_process(GetCurrentProcess()), - m_last_base(0), - m_text_base(0), - m_sym_from_addr(TEXT("dbghelp.dll"), "SymFromAddr"), - m_sym_get_line_from_addr_64(TEXT("dbghelp.dll"), "SymGetLineFromAddr64") + m_symfile(argv0), + m_process(GetCurrentProcess()), + m_last_base(0), + m_text_base(0), + m_sym_from_addr(TEXT("dbghelp.dll"), "SymFromAddr"), + m_sym_get_line_from_addr_64(TEXT("dbghelp.dll"), "SymGetLineFromAddr64") { #ifdef __GNUC__ // compute the name of the mapfile @@ -1650,14 +1650,14 @@ FPTR symbol_manager::get_text_section_base() sampling_profiler::sampling_profiler(UINT32 max_seconds, UINT8 stack_depth = 0) : m_thread(NULL), - m_thread_id(0), - m_thread_exit(false), - m_stack_depth(stack_depth), - m_entry_stride(stack_depth + 2), - m_max_seconds(max_seconds), - m_buffer(global_alloc(FPTR[max_seconds * 1000 * m_entry_stride])), - m_buffer_ptr(m_buffer), - m_buffer_end(m_buffer + max_seconds * 1000 * m_entry_stride) + m_thread_id(0), + m_thread_exit(false), + m_stack_depth(stack_depth), + m_entry_stride(stack_depth + 2), + m_max_seconds(max_seconds), + m_buffer(global_alloc(FPTR[max_seconds * 1000 * m_entry_stride])), + m_buffer_ptr(m_buffer), + m_buffer_end(m_buffer + max_seconds * 1000 * m_entry_stride) { } diff --git a/src/osd/windows/winmain.h b/src/osd/windows/winmain.h index 98d6d038415..a935d8c9c6a 100644 --- a/src/osd/windows/winmain.h +++ b/src/osd/windows/winmain.h @@ -48,107 +48,107 @@ //============================================================ // debugging options -#define WINOPTION_OSLOG "oslog" -#define WINOPTION_WATCHDOG "watchdog" -#define WINOPTION_DEBUGGER_FONT "debugger_font" -#define WINOPTION_DEBUGGER_FONT_SIZE "debugger_font_size" +#define WINOPTION_OSLOG "oslog" +#define WINOPTION_WATCHDOG "watchdog" +#define WINOPTION_DEBUGGER_FONT "debugger_font" +#define WINOPTION_DEBUGGER_FONT_SIZE "debugger_font_size" // performance options -#define WINOPTION_PRIORITY "priority" -#define WINOPTION_MULTITHREADING "multithreading" -#define WINOPTION_NUMPROCESSORS "numprocessors" -#define WINOPTION_PROFILE "profile" -#define WINOPTION_BENCH "bench" +#define WINOPTION_PRIORITY "priority" +#define WINOPTION_MULTITHREADING "multithreading" +#define WINOPTION_NUMPROCESSORS "numprocessors" +#define WINOPTION_PROFILE "profile" +#define WINOPTION_BENCH "bench" // video options -#define WINOPTION_VIDEO "video" -#define WINOPTION_NUMSCREENS "numscreens" -#define WINOPTION_WINDOW "window" -#define WINOPTION_MAXIMIZE "maximize" -#define WINOPTION_KEEPASPECT "keepaspect" -#define WINOPTION_PRESCALE "prescale" -#define WINOPTION_WAITVSYNC "waitvsync" -#define WINOPTION_SYNCREFRESH "syncrefresh" -#define WINOPTION_MENU "menu" +#define WINOPTION_VIDEO "video" +#define WINOPTION_NUMSCREENS "numscreens" +#define WINOPTION_WINDOW "window" +#define WINOPTION_MAXIMIZE "maximize" +#define WINOPTION_KEEPASPECT "keepaspect" +#define WINOPTION_PRESCALE "prescale" +#define WINOPTION_WAITVSYNC "waitvsync" +#define WINOPTION_SYNCREFRESH "syncrefresh" +#define WINOPTION_MENU "menu" // DirectDraw-specific options -#define WINOPTION_HWSTRETCH "hwstretch" +#define WINOPTION_HWSTRETCH "hwstretch" // Direct3D-specific options -#define WINOPTION_D3DVERSION "d3dversion" -#define WINOPTION_FILTER "filter" +#define WINOPTION_D3DVERSION "d3dversion" +#define WINOPTION_FILTER "filter" // core post-processing options -#define WINOPTION_HLSL_ENABLE "hlsl_enable" -#define WINOPTION_HLSLPATH "hlslpath" -#define WINOPTION_HLSL_INI_NAME "hlslini" -#define WINOPTION_HLSL_INI_WRITE "hlsl_ini_write" -#define WINOPTION_HLSL_INI_READ "hlsl_ini_read" -#define WINOPTION_HLSL_PRESCALE_X "hlsl_prescale_x" -#define WINOPTION_HLSL_PRESCALE_Y "hlsl_prescale_y" -#define WINOPTION_HLSL_PRESET "hlsl_preset" -#define WINOPTION_HLSL_WRITE "hlsl_write" -#define WINOPTION_HLSL_SNAP_WIDTH "hlsl_snap_width" -#define WINOPTION_HLSL_SNAP_HEIGHT "hlsl_snap_height" -#define WINOPTION_SHADOW_MASK_ALPHA "shadow_mask_alpha" -#define WINOPTION_SHADOW_MASK_TEXTURE "shadow_mask_texture" -#define WINOPTION_SHADOW_MASK_COUNT_X "shadow_mask_x_count" -#define WINOPTION_SHADOW_MASK_COUNT_Y "shadow_mask_y_count" -#define WINOPTION_SHADOW_MASK_USIZE "shadow_mask_usize" -#define WINOPTION_SHADOW_MASK_VSIZE "shadow_mask_vsize" -#define WINOPTION_PINCUSHION "pincushion" -#define WINOPTION_CURVATURE "curvature" -#define WINOPTION_SCANLINE_AMOUNT "scanline_alpha" -#define WINOPTION_SCANLINE_SCALE "scanline_size" -#define WINOPTION_SCANLINE_HEIGHT "scanline_height" -#define WINOPTION_SCANLINE_BRIGHT_SCALE "scanline_bright_scale" -#define WINOPTION_SCANLINE_BRIGHT_OFFSET "scanline_bright_offset" -#define WINOPTION_SCANLINE_OFFSET "scanline_jitter" -#define WINOPTION_DEFOCUS "defocus" -#define WINOPTION_CONVERGE_X "converge_x" -#define WINOPTION_CONVERGE_Y "converge_y" -#define WINOPTION_RADIAL_CONVERGE_X "radial_converge_x" -#define WINOPTION_RADIAL_CONVERGE_Y "radial_converge_y" -#define WINOPTION_RED_RATIO "red_ratio" -#define WINOPTION_GRN_RATIO "grn_ratio" -#define WINOPTION_BLU_RATIO "blu_ratio" -#define WINOPTION_OFFSET "offset" -#define WINOPTION_SCALE "scale" -#define WINOPTION_POWER "power" -#define WINOPTION_FLOOR "floor" -#define WINOPTION_PHOSPHOR "phosphor_life" -#define WINOPTION_SATURATION "saturation" -#define WINOPTION_YIQ_ENABLE "yiq_enable" -#define WINOPTION_YIQ_CCVALUE "yiq_cc" -#define WINOPTION_YIQ_AVALUE "yiq_a" -#define WINOPTION_YIQ_BVALUE "yiq_b" -#define WINOPTION_YIQ_OVALUE "yiq_o" -#define WINOPTION_YIQ_PVALUE "yiq_p" -#define WINOPTION_YIQ_NVALUE "yiq_n" -#define WINOPTION_YIQ_YVALUE "yiq_y" -#define WINOPTION_YIQ_IVALUE "yiq_i" -#define WINOPTION_YIQ_QVALUE "yiq_q" -#define WINOPTION_YIQ_SCAN_TIME "yiq_scan_time" -#define WINOPTION_YIQ_PHASE_COUNT "yiq_phase_count" +#define WINOPTION_HLSL_ENABLE "hlsl_enable" +#define WINOPTION_HLSLPATH "hlslpath" +#define WINOPTION_HLSL_INI_NAME "hlslini" +#define WINOPTION_HLSL_INI_WRITE "hlsl_ini_write" +#define WINOPTION_HLSL_INI_READ "hlsl_ini_read" +#define WINOPTION_HLSL_PRESCALE_X "hlsl_prescale_x" +#define WINOPTION_HLSL_PRESCALE_Y "hlsl_prescale_y" +#define WINOPTION_HLSL_PRESET "hlsl_preset" +#define WINOPTION_HLSL_WRITE "hlsl_write" +#define WINOPTION_HLSL_SNAP_WIDTH "hlsl_snap_width" +#define WINOPTION_HLSL_SNAP_HEIGHT "hlsl_snap_height" +#define WINOPTION_SHADOW_MASK_ALPHA "shadow_mask_alpha" +#define WINOPTION_SHADOW_MASK_TEXTURE "shadow_mask_texture" +#define WINOPTION_SHADOW_MASK_COUNT_X "shadow_mask_x_count" +#define WINOPTION_SHADOW_MASK_COUNT_Y "shadow_mask_y_count" +#define WINOPTION_SHADOW_MASK_USIZE "shadow_mask_usize" +#define WINOPTION_SHADOW_MASK_VSIZE "shadow_mask_vsize" +#define WINOPTION_PINCUSHION "pincushion" +#define WINOPTION_CURVATURE "curvature" +#define WINOPTION_SCANLINE_AMOUNT "scanline_alpha" +#define WINOPTION_SCANLINE_SCALE "scanline_size" +#define WINOPTION_SCANLINE_HEIGHT "scanline_height" +#define WINOPTION_SCANLINE_BRIGHT_SCALE "scanline_bright_scale" +#define WINOPTION_SCANLINE_BRIGHT_OFFSET "scanline_bright_offset" +#define WINOPTION_SCANLINE_OFFSET "scanline_jitter" +#define WINOPTION_DEFOCUS "defocus" +#define WINOPTION_CONVERGE_X "converge_x" +#define WINOPTION_CONVERGE_Y "converge_y" +#define WINOPTION_RADIAL_CONVERGE_X "radial_converge_x" +#define WINOPTION_RADIAL_CONVERGE_Y "radial_converge_y" +#define WINOPTION_RED_RATIO "red_ratio" +#define WINOPTION_GRN_RATIO "grn_ratio" +#define WINOPTION_BLU_RATIO "blu_ratio" +#define WINOPTION_OFFSET "offset" +#define WINOPTION_SCALE "scale" +#define WINOPTION_POWER "power" +#define WINOPTION_FLOOR "floor" +#define WINOPTION_PHOSPHOR "phosphor_life" +#define WINOPTION_SATURATION "saturation" +#define WINOPTION_YIQ_ENABLE "yiq_enable" +#define WINOPTION_YIQ_CCVALUE "yiq_cc" +#define WINOPTION_YIQ_AVALUE "yiq_a" +#define WINOPTION_YIQ_BVALUE "yiq_b" +#define WINOPTION_YIQ_OVALUE "yiq_o" +#define WINOPTION_YIQ_PVALUE "yiq_p" +#define WINOPTION_YIQ_NVALUE "yiq_n" +#define WINOPTION_YIQ_YVALUE "yiq_y" +#define WINOPTION_YIQ_IVALUE "yiq_i" +#define WINOPTION_YIQ_QVALUE "yiq_q" +#define WINOPTION_YIQ_SCAN_TIME "yiq_scan_time" +#define WINOPTION_YIQ_PHASE_COUNT "yiq_phase_count" // per-window options -#define WINOPTION_SCREEN "screen" -#define WINOPTION_ASPECT "aspect" -#define WINOPTION_RESOLUTION "resolution" -#define WINOPTION_VIEW "view" +#define WINOPTION_SCREEN "screen" +#define WINOPTION_ASPECT "aspect" +#define WINOPTION_RESOLUTION "resolution" +#define WINOPTION_VIEW "view" // full screen options -#define WINOPTION_TRIPLEBUFFER "triplebuffer" -#define WINOPTION_SWITCHRES "switchres" -#define WINOPTION_FULLSCREENBRIGHTNESS "full_screen_brightness" -#define WINOPTION_FULLSCREENCONTRAST "full_screen_contrast" -#define WINOPTION_FULLSCREENGAMMA "full_screen_gamma" +#define WINOPTION_TRIPLEBUFFER "triplebuffer" +#define WINOPTION_SWITCHRES "switchres" +#define WINOPTION_FULLSCREENBRIGHTNESS "full_screen_brightness" +#define WINOPTION_FULLSCREENCONTRAST "full_screen_contrast" +#define WINOPTION_FULLSCREENGAMMA "full_screen_gamma" // sound options -#define WINOPTION_AUDIO_LATENCY "audio_latency" +#define WINOPTION_AUDIO_LATENCY "audio_latency" // input options -#define WINOPTION_DUAL_LIGHTGUN "dual_lightgun" +#define WINOPTION_DUAL_LIGHTGUN "dual_lightgun" @@ -280,9 +280,9 @@ private: //============================================================ #ifdef __cplusplus -#define WRAP_REFIID(x) x +#define WRAP_REFIID(x) x #else -#define WRAP_REFIID(x) &x +#define WRAP_REFIID(x) &x #endif diff --git a/src/osd/windows/winmisc.c b/src/osd/windows/winmisc.c index c83613a5e37..3c74ed879a6 100644 --- a/src/osd/windows/winmisc.c +++ b/src/osd/windows/winmisc.c @@ -58,10 +58,10 @@ //============================================================ // presumed size of a page of memory -#define PAGE_SIZE 4096 +#define PAGE_SIZE 4096 // align allocations to start or end of the page? -#define GUARD_ALIGN_START 0 +#define GUARD_ALIGN_START 0 diff --git a/src/osd/windows/winprefix.h b/src/osd/windows/winprefix.h index eb540920d8d..1e82d355ef1 100644 --- a/src/osd/windows/winprefix.h +++ b/src/osd/windows/winprefix.h @@ -53,10 +53,10 @@ #ifdef __GNUC__ #ifndef alloca -#define alloca __builtin_alloca +#define alloca __builtin_alloca #endif #define min(x,y) fmin(x,y) #define max(x,y) fmax(x,y) #endif -#define PATH_SEPARATOR "\\" +#define PATH_SEPARATOR "\\" diff --git a/src/osd/windows/winsocket.c b/src/osd/windows/winsocket.c index 058488759a3..0704772e1f1 100644 --- a/src/osd/windows/winsocket.c +++ b/src/osd/windows/winsocket.c @@ -43,7 +43,7 @@ bool win_init_sockets() /* check for correct version */ if ( LOBYTE( wsaData.wVersion ) != 2 || - HIBYTE( wsaData.wVersion ) != 0 ) + HIBYTE( wsaData.wVersion ) != 0 ) { /* incorrect WinSock version */ WSACleanup(); diff --git a/src/osd/windows/winsync.c b/src/osd/windows/winsync.c index 6876dd11de3..fbb32cfa441 100644 --- a/src/osd/windows/winsync.c +++ b/src/osd/windows/winsync.c @@ -53,7 +53,7 @@ // DEBUGGING //============================================================ -#define DEBUG_SLOW_LOCKS 0 +#define DEBUG_SLOW_LOCKS 0 @@ -65,7 +65,7 @@ typedef BOOL (WINAPI *try_enter_critical_section_ptr)(LPCRITICAL_SECTION lpCriti struct osd_lock { - CRITICAL_SECTION critsect; + CRITICAL_SECTION critsect; }; diff --git a/src/osd/windows/winutf8.c b/src/osd/windows/winutf8.c index 4e7ca623d74..37d3841bf5f 100644 --- a/src/osd/windows/winutf8.c +++ b/src/osd/windows/winutf8.c @@ -265,8 +265,8 @@ done: //============================================================ HWND win_create_window_ex_utf8(DWORD exstyle, const char* classname, const char* windowname, DWORD style, - int x, int y, int width, int height, HWND parent, HMENU menu, - HINSTANCE instance, void* param) + int x, int y, int width, int height, HWND parent, HMENU menu, + HINSTANCE instance, void* param) { TCHAR* t_classname = NULL; TCHAR* t_windowname = NULL; diff --git a/src/osd/windows/winutf8.h b/src/osd/windows/winutf8.h index dbade1dcd46..b3a87aebce4 100644 --- a/src/osd/windows/winutf8.h +++ b/src/osd/windows/winutf8.h @@ -56,7 +56,7 @@ int win_message_box_utf8(HWND window, const char *text, const char *caption, UIN BOOL win_set_window_text_utf8(HWND window, const char *text); int win_get_window_text_utf8(HWND window, char *buffer, size_t buffer_size); HWND win_create_window_ex_utf8(DWORD exstyle, const char* classname, const char* windowname, DWORD style, - int x, int y, int width, int height, HWND wndparent, HMENU menu, - HINSTANCE instance, void* param); + int x, int y, int width, int height, HWND wndparent, HMENU menu, + HINSTANCE instance, void* param); #endif // __WINUTF8__ diff --git a/src/osd/windows/winwork.c b/src/osd/windows/winwork.c index 5bfa1ebd2ae..250f9700840 100644 --- a/src/osd/windows/winwork.c +++ b/src/osd/windows/winwork.c @@ -59,8 +59,8 @@ // DEBUGGING //============================================================ -#define KEEP_STATISTICS (0) -#define USE_SCALABLE_LOCKS (0) +#define KEEP_STATISTICS (0) +#define USE_SCALABLE_LOCKS (0) @@ -68,7 +68,7 @@ // PARAMETERS //============================================================ -#define SPIN_LOOP_TIME (osd_ticks_per_second() / 1000) +#define SPIN_LOOP_TIME (osd_ticks_per_second() / 1000) @@ -77,13 +77,13 @@ //============================================================ #if KEEP_STATISTICS -#define add_to_stat(v,x) do { atomic_add32((v), (x)); } while (0) -#define begin_timing(v) do { (v) -= get_profile_ticks(); } while (0) -#define end_timing(v) do { (v) += get_profile_ticks(); } while (0) +#define add_to_stat(v,x) do { atomic_add32((v), (x)); } while (0) +#define begin_timing(v) do { (v) -= get_profile_ticks(); } while (0) +#define end_timing(v) do { (v) += get_profile_ticks(); } while (0) #else -#define add_to_stat(v,x) do { } while (0) -#define begin_timing(v) do { } while (0) -#define end_timing(v) do { } while (0) +#define add_to_stat(v,x) do { } while (0) +#define begin_timing(v) do { } while (0) +#define end_timing(v) do { } while (0) #endif #ifndef YieldProcessor @@ -109,69 +109,69 @@ INLINE void YieldProcessor(void) struct scalable_lock { #if USE_SCALABLE_LOCKS - struct - { - volatile INT32 haslock; // do we have the lock? - INT32 filler[64/4-1]; // assumes a 64-byte cache line - } slot[WORK_MAX_THREADS]; // one slot per thread - volatile INT32 nextindex; // index of next slot to use + struct + { + volatile INT32 haslock; // do we have the lock? + INT32 filler[64/4-1]; // assumes a 64-byte cache line + } slot[WORK_MAX_THREADS]; // one slot per thread + volatile INT32 nextindex; // index of next slot to use #else - CRITICAL_SECTION section; + CRITICAL_SECTION section; #endif }; struct work_thread_info { - osd_work_queue * queue; // pointer back to the queue - HANDLE handle; // handle to the thread - HANDLE wakeevent; // wake event for the thread - volatile INT32 active; // are we actively processing work? + osd_work_queue * queue; // pointer back to the queue + HANDLE handle; // handle to the thread + HANDLE wakeevent; // wake event for the thread + volatile INT32 active; // are we actively processing work? #if KEEP_STATISTICS - INT32 itemsdone; - osd_ticks_t actruntime; - osd_ticks_t runtime; - osd_ticks_t spintime; - osd_ticks_t waittime; + INT32 itemsdone; + osd_ticks_t actruntime; + osd_ticks_t runtime; + osd_ticks_t spintime; + osd_ticks_t waittime; #endif }; struct osd_work_queue { - scalable_lock lock; // lock for protecting the queue - osd_work_item * volatile list; // list of items in the queue - osd_work_item ** volatile tailptr; // pointer to the tail pointer of work items in the queue - osd_work_item * volatile free; // free list of work items - volatile INT32 items; // items in the queue - volatile INT32 livethreads; // number of live threads - volatile INT32 waiting; // is someone waiting on the queue to complete? - volatile UINT8 exiting; // should the threads exit on their next opportunity? - UINT32 threads; // number of threads in this queue - UINT32 flags; // creation flags - work_thread_info * thread; // array of thread information - HANDLE doneevent; // event signalled when work is complete + scalable_lock lock; // lock for protecting the queue + osd_work_item * volatile list; // list of items in the queue + osd_work_item ** volatile tailptr; // pointer to the tail pointer of work items in the queue + osd_work_item * volatile free; // free list of work items + volatile INT32 items; // items in the queue + volatile INT32 livethreads; // number of live threads + volatile INT32 waiting; // is someone waiting on the queue to complete? + volatile UINT8 exiting; // should the threads exit on their next opportunity? + UINT32 threads; // number of threads in this queue + UINT32 flags; // creation flags + work_thread_info * thread; // array of thread information + HANDLE doneevent; // event signalled when work is complete #if KEEP_STATISTICS - volatile INT32 itemsqueued; // total items queued - volatile INT32 setevents; // number of times we called SetEvent - volatile INT32 extraitems; // how many extra items we got after the first in the queue loop - volatile INT32 spinloops; // how many times spinning bought us more items + volatile INT32 itemsqueued; // total items queued + volatile INT32 setevents; // number of times we called SetEvent + volatile INT32 extraitems; // how many extra items we got after the first in the queue loop + volatile INT32 spinloops; // how many times spinning bought us more items #endif }; struct osd_work_item { - osd_work_item * next; // pointer to next item - osd_work_queue * queue; // pointer back to the owning queue - osd_work_callback callback; // callback function - void * param; // callback parameter - void * result; // callback result - HANDLE event; // event signalled when complete - UINT32 flags; // creation flags - volatile INT32 done; // is the item done? + osd_work_item * next; // pointer to next item + osd_work_queue * queue; // pointer back to the owning queue + osd_work_callback callback; // callback function + void * param; // callback parameter + void * result; // callback result + HANDLE event; // event signalled when complete + UINT32 flags; // creation flags + volatile INT32 done; // is the item done? }; //============================================================ @@ -267,7 +267,7 @@ osd_work_queue *osd_work_queue_alloc(int flags) queue->flags = flags; // allocate events for the queue - queue->doneevent = CreateEvent(NULL, TRUE, TRUE, NULL); // manual reset, signalled + queue->doneevent = CreateEvent(NULL, TRUE, TRUE, NULL); // manual reset, signalled if (queue->doneevent == NULL) goto error; @@ -307,7 +307,7 @@ osd_work_queue *osd_work_queue_alloc(int flags) thread->queue = queue; // create the per-thread wake event - thread->wakeevent = CreateEvent(NULL, FALSE, FALSE, NULL); // auto-reset, not signalled + thread->wakeevent = CreateEvent(NULL, FALSE, FALSE, NULL); // auto-reset, not signalled if (thread->wakeevent == NULL) goto error; @@ -598,7 +598,7 @@ int osd_work_item_wait(osd_work_item *item, osd_ticks_t timeout) // if we don't have an event, create one if (item->event == NULL) - item->event = CreateEvent(NULL, TRUE, FALSE, NULL); // manual reset, not signalled + item->event = CreateEvent(NULL, TRUE, FALSE, NULL); // manual reset, not signalled else ResetEvent(item->event); |