Previous 199869 Revisions Next

r41681 Wednesday 11th November, 2015 at 16:19:26 UTC by Miodrag Milanović
more cleanups and fix (nw)
[src/emu]input.cpp
[src/osd]strconv.cpp
[src/osd/modules/debugger]debugint.cpp debugwin.cpp
[src/osd/modules/debugger/win]consolewininfo.cpp debugviewinfo.cpp debugwininfo.cpp disasmwininfo.cpp logwininfo.cpp memorywininfo.cpp pointswininfo.cpp uimetrics.cpp
[src/osd/modules/font]font_none.cpp font_windows.cpp
[src/osd/modules/midi]none.cpp portmidi.cpp
[src/osd/modules/netdev]pcap.cpp
[src/osd/modules/render]drawd3d.cpp drawdd.cpp drawnone.cpp drawogl.cpp
[src/osd/modules/render/d3d]d3d9intf.cpp d3dhlsl.cpp d3dhlsl.h
[src/osd/modules/sound]direct_sound.cpp
[src/osd/modules/sync]work_osd.cpp
[src/osd/windows]input.cpp output.cpp video.cpp winclip.cpp window.cpp winfile.cpp winmain.cpp winsocket.cpp winutf8.cpp winutil.cpp

trunk/src/emu/input.cpp
r250192r250193
859859         break;
860860
861861      default:
862         item = NULL;
862863         assert(false);
863864   }
864865
trunk/src/osd/modules/debugger/debugint.cpp
r250192r250193
1717#include "debug/debugvw.h"
1818#include "debug/dvdisasm.h"
1919#include "debug/dvmemory.h"
20#include "debug/dvstate.h"
2120#include "debug/debugcon.h"
2221#include "debug/debugcpu.h"
2322
r250192r250193
151150   DISABLE_COPYING(DView_edit);
152151
153152public:
154   DView_edit()
155   { }
156   ~DView_edit()
157   { }
153   DView_edit(): active(0), container(NULL) { }
154   ~DView_edit() { }
158155   int                 active;
159156   render_container *  container;
160157   std::string         str;
r250192r250193
11311128   x1 += UI_BOX_LR_BORDER;
11321129   x2 -= UI_BOX_LR_BORDER;
11331130   y1 += UI_BOX_TB_BORDER;
1134   y2 -= UI_BOX_TB_BORDER;
11351131
11361132   /* draw the text within it */
11371133   editor->container->manager().machine().ui().draw_text_full(editor->container, editor->str.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
trunk/src/osd/modules/debugger/debugwin.cpp
r250192r250193
2222#include "win/uimetrics.h"
2323
2424#include "emu.h"
25#include "uiinput.h"
2625#include "debugger.h"
2726
2827#include "window.h"
29#include "winmain.h"
3028#include "../../windows/input.h"
3129
3230
trunk/src/osd/modules/debugger/win/consolewininfo.cpp
r250192r250193
99#include "consolewininfo.h"
1010
1111#include "debugviewinfo.h"
12#include "disasmviewinfo.h"
1312#include "uimetrics.h"
1413
1514#include "debug/debugcon.h"
r250192r250193
8483   set_cpu(*debug_cpu_get_visible_cpu(machine()));
8584
8685   // mark the edit box as the default focus and set it
87   set_default_focus();
86   editwin_info::set_default_focus();
8887   return;
8988
9089cleanup:
trunk/src/osd/modules/debugger/win/debugviewinfo.cpp
r250192r250193
315315      // loop twice; once to fill the background and once to draw the text
316316      for (int iter = 0; iter < 2; iter++)
317317      {
318         COLORREF fgcolor = RGB(0x00,0x00,0x00);
318         COLORREF fgcolor;
319319         COLORREF bgcolor = RGB(0xff,0xff,0xff);
320320         HBRUSH bgbrush = NULL;
321321         int last_attrib = -1;
trunk/src/osd/modules/debugger/win/debugwininfo.cpp
r250192r250193
1111#include "debugviewinfo.h"
1212
1313#include "debug/debugcpu.h"
14#include "imagedev/cassette.h"
15
16#include "strconv.h"
1714#include "window.h"
1815#include "winutf8.h"
1916
trunk/src/osd/modules/debugger/win/disasmwininfo.cpp
r250192r250193
1111#include "debugviewinfo.h"
1212#include "disasmviewinfo.h"
1313#include "uimetrics.h"
14
15#include "debugger.h"
16#include "debug/debugcon.h"
17#include "debug/debugcpu.h"
18
1914#include "winutf8.h"
2015
2116
r250192r250193
3833   update_caption();
3934
4035   // recompute the children once to get the maxwidth
41   recompute_children();
36   disasmwin_info::recompute_children();
4237
4338   // position the window and recompute children again
4439   SetWindowPos(window(), HWND_TOP, 100, 100, maxwidth(), 200, SWP_SHOWWINDOW);
45   recompute_children();
40   disasmwin_info::recompute_children();
4641
4742   // mark the edit box as the default focus and set it
48   set_default_focus();
43   editwin_info::set_default_focus();
4944}
5045
5146
trunk/src/osd/modules/debugger/win/logwininfo.cpp
r250192r250193
3838   SetWindowPos(window(), HWND_TOP, 100, 100, bounds.right - bounds.left, bounds.bottom - bounds.top, SWP_SHOWWINDOW);
3939
4040   // recompute the children
41   recompute_children();
41   debugwin_info::recompute_children();
4242}
4343
4444
trunk/src/osd/modules/debugger/win/memorywininfo.cpp
r250192r250193
5959   update_caption();
6060
6161   // recompute the children once to get the maxwidth
62   recompute_children();
62   memorywin_info::recompute_children();
6363
6464   // position the window and recompute children again
6565   SetWindowPos(window(), HWND_TOP, 100, 100, maxwidth(), 200, SWP_SHOWWINDOW);
66   recompute_children();
66   memorywin_info::recompute_children();
6767
6868   // mark the edit box as the default focus and set it
69   set_default_focus();
69   editwin_info::set_default_focus();
7070}
7171
7272
trunk/src/osd/modules/debugger/win/pointswininfo.cpp
r250192r250193
4646   SetWindowPos(window(), HWND_TOP, 100, 100, bounds.right - bounds.left, bounds.bottom - bounds.top, SWP_SHOWWINDOW);
4747
4848   // recompute the children
49   recompute_children();
49   debugwin_info::recompute_children();
5050}
5151
5252
trunk/src/osd/modules/debugger/win/uimetrics.cpp
r250192r250193
3131      m_debug_font = CreateFont(-MulDiv((size <= 0) ? 9 : size, GetDeviceCaps(temp_dc, LOGPIXELSY), 72), 0, 0, 0, FW_MEDIUM, FALSE, FALSE, FALSE,
3232               ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH, t_face);
3333      osd_free(t_face);
34      t_face = NULL;
3534
3635      if (m_debug_font == NULL)
3736         fatalerror("Unable to create debugger font\n");
trunk/src/osd/modules/font/font_none.cpp
r250192r250193
2121   virtual bool open(const char *font_path, const char *name, int &height);
2222   virtual void close();
2323   virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs);
24private:
2524};
2625
2726bool osd_font_none::open(const char *font_path, const char *_name, int &height)
trunk/src/osd/modules/font/font_windows.cpp
r250192r250193
3434//-------------------------------------------------
3535
3636class osd_font_windows : public osd_font
37{
37{   
3838public:
39   osd_font_windows(): m_font(NULL) { }
3940   virtual ~osd_font_windows() { }
4041
4142   virtual bool open(const char *font_path, const char *name, int &height);
trunk/src/osd/modules/midi/none.cpp
r250192r250193
4141   virtual bool poll();
4242   virtual int read(UINT8 *pOut);
4343   virtual void write(UINT8 data);
44
45private:
46   //int dummy;
4744};
4845
4946osd_midi_device *none_module::create_midi_device()
trunk/src/osd/modules/midi/portmidi.cpp
r250192r250193
4444#define MIDI_EOX    0xf7
4545
4646class osd_midi_device_pm : public osd_midi_device
47{
47{   
4848public:
49   osd_midi_device_pm(): pmStream(NULL), xmit_cnt(0), last_status(0), rx_sysex(false) { }
4950   virtual ~osd_midi_device_pm() { }
5051   virtual bool open_input(const char *devname);
5152   virtual bool open_output(const char *devname);
r250192r250193
208209   {
209210      return false;
210211   }
211   return false;
212212}
213213
214214void osd_midi_device_pm::close()
trunk/src/osd/modules/netdev/pcap.cpp
r250192r250193
168168      m_p = NULL;
169169      return;
170170   }
171   set_mac(get_mac());
171   netdev_pcap::set_mac(get_mac());
172172
173173#ifdef SDLMAME_MACOSX
174174   m_ctx.head = 0;
r250192r250193
206206   ret = pcap_sendpacket_dl(m_p, buf, len);
207207   printf("sent packet length %d, returned %d\n", len, ret);
208208   return ret ? len : 0;
209   return (!pcap_sendpacket_dl(m_p, buf, len))?len:0;
209   //return (!pcap_sendpacket_dl(m_p, buf, len))?len:0;
210210}
211211
212212int netdev_pcap::recv_dev(UINT8 **buf)
trunk/src/osd/modules/render/d3d/d3d9intf.cpp
r250192r250193
1818
1919// MAMEOS headers
2020#include "d3dintf.h"
21#include "winmain.h"
2221
2322
2423
r250192r250193
8382   {
8483      osd_printf_verbose("Direct3D: Unable to find Direct3DCreate9\n");
8584      FreeLibrary(dllhandle);
86      dllhandle = NULL;
8785      return NULL;
8886   }
8987
r250192r250193
9391   {
9492      osd_printf_verbose("Direct3D: Error attempting to initialize Direct3D9\n");
9593      FreeLibrary(dllhandle);
96      dllhandle = NULL;
9794      return NULL;
9895   }
9996
trunk/src/osd/modules/render/d3d/d3dhlsl.cpp
r250192r250193
2929#include "render.h"
3030#include "ui/ui.h"
3131#include "rendutil.h"
32#include "options.h"
3332#include "emuopts.h"
3433#include "aviio.h"
3534#include "png.h"
r250192r250193
3938#include "d3dintf.h"
4039#include "winmain.h"
4140#include "window.h"
42#include "config.h"
4341#include "d3dcomm.h"
4442#include "modules/render/drawd3d.h"
4543#include "strconv.h"
r250192r250193
178176//  shader manager constructor
179177//============================================================
180178
181shaders::shaders()
179shaders::shaders():
180   d3dintf(NULL), machine(NULL), d3d(NULL), num_screens(0), curr_screen(0), curr_frame(0), write_ini(false), read_ini(false), hlsl_prescale_x(0), hlsl_prescale_y(0), bloom_count(0),
181   vecbuf_type(), vecbuf_index(0), vecbuf_count(0), avi_output_file(NULL), avi_frame(0), avi_copy_surface(NULL), avi_copy_texture(NULL), avi_final_target(NULL), avi_final_texture(NULL),
182   black_surface(NULL), black_texture(NULL), render_snap(false), snap_rendered(false), snap_copy_target(NULL), snap_copy_texture(NULL), snap_target(NULL), snap_texture(NULL),
183   snap_width(0), snap_height(0), lines_pending(false), backbuffer(NULL), curr_effect(NULL), default_effect(NULL), prescale_effect(NULL), post_effect(NULL), distortion_effect(NULL),
184   focus_effect(NULL), phosphor_effect(NULL), deconverge_effect(NULL), color_effect(NULL), yiq_encode_effect(NULL), yiq_decode_effect(NULL), bloom_effect(NULL),
185   downsample_effect(NULL), vector_effect(NULL), fsfx_vertices(NULL), curr_texture(NULL), curr_render_target(NULL), curr_poly(NULL)
186
182187{
183188   master_enable = false;
184189   vector_enable = true;
r250192r250193
34353440         // find length of the device name
34363441         int end1 = snapstr.find("/", pos + 3);
34373442         int end2 = snapstr.find("%", pos + 3);
3438         int end = -1;
3443         int end;
34393444
34403445         if ((end1 != -1) && (end2 != -1))
34413446         {
trunk/src/osd/modules/render/d3d/d3dhlsl.h
r250192r250193
2020//  TYPE DEFINITIONS
2121//============================================================
2222
23struct slider_state;
24
2325namespace d3d
2426{
2527class effect;
trunk/src/osd/modules/render/drawd3d.cpp
r250192r250193
2727// MAME headers
2828#include "emu.h"
2929#include "render.h"
30#include "ui/ui.h"
30
3131#include "rendutil.h"
32#include "options.h"
3332#include "emuopts.h"
3433#include "aviio.h"
35#include "png.h"
3634
3735// MAMEOS headers
3836#include "modules/render/d3d/d3dintf.h"
3937#include "winmain.h"
4038#include "window.h"
41#include "config.h"
42#include "strconv.h"
4339#include "modules/render/d3d/d3dcomm.h"
4440#include "drawd3d.h"
4541
r250192r250193
616612}
617613
618614renderer::renderer(osd_window *window)
619   : osd_renderer(window, FLAG_NONE)
615   : osd_renderer(window, FLAG_NONE), m_adapter(0), m_width(0), m_height(0), m_refresh(0), m_create_error_count(0), m_device(NULL), m_gamma_supported(0), m_pixformat(),
616   m_vertexbuf(NULL), m_lockedbuf(NULL), m_numverts(0), m_vectorbatch(NULL), m_batchindex(0), m_numpolys(0), m_restarting(false), m_mod2x_supported(0), m_mod4x_supported(0),
617   m_screen_format(), m_last_texture(NULL), m_last_texture_flags(0), m_last_blendenable(0), m_last_blendop(0), m_last_blendsrc(0), m_last_blenddst(0), m_last_filter(0),
618   m_last_wrap(), m_last_modmode(0), m_hlsl_buf(NULL), m_shaders(NULL), m_texture_manager(NULL), m_line_count(0)
620619{
621   m_device = NULL;
622   m_restarting = false;
623   m_shaders = NULL;
624   m_numverts = 0;
625   m_numpolys = 0;
626   m_vertexbuf = NULL;
627   m_lockedbuf = NULL;
628   m_vectorbatch = NULL;
629   m_last_texture = NULL;
630   m_hlsl_buf = NULL;
631   m_texture_manager = NULL;
632620}
633621
634622int renderer::initialize()
trunk/src/osd/modules/render/drawdd.cpp
r250192r250193
1717#include "emu.h"
1818#include "render.h"
1919#include "rendutil.h"
20#include "options.h"
2120#include "rendersw.inc"
2221
2322// MAMEOS headers
2423#include "winmain.h"
2524#include "window.h"
26#include "config.h"
2725
2826
2927
r250192r250193
4038{
4139public:
4240   renderer_dd(osd_window *window)
43   : osd_renderer(window, FLAG_NONE),
41   : osd_renderer(window, FLAG_NONE),
42      width(0),
43      height(0),
44      refresh(0),
4445      //adapter(0),
4546      adapter_ptr(NULL),
4647      clearouter(0),
trunk/src/osd/modules/render/drawnone.cpp
r250192r250193
3232   virtual void record() { };
3333   virtual void toggle_fsfx() { };
3434   virtual void destroy();
35
36private:
3735};
3836
3937//============================================================
trunk/src/osd/modules/render/drawogl.cpp
r250192r250193
1919// MAME headers
2020#include "osdcomm.h"
2121#include "emu.h"
22#include "options.h"
2322#include "emuopts.h"
2423
2524#ifndef OSD_WINDOWS
trunk/src/osd/modules/sound/direct_sound.cpp
r250192r250193
174174            memcpy(m_bytes2, (UINT8 const *)data + m_locked1, bytes - m_locked1);
175175         }
176176
177         result = unlock();
177         unlock();
178178         return DS_OK;
179179      }
180180      HRESULT clear()
r250192r250193
189189         assert(0U == m_locked2);
190190         memset(m_bytes1, 0, m_locked1);
191191
192         result = unlock();
192         unlock();
193193         return DS_OK;
194194      }
195195
trunk/src/osd/modules/sync/work_osd.cpp
r250192r250193
444444      osd_work_item *item;
445445
446446      // first allocate a new work item; try the free list first
447      INT32 lockslot = osd_scalable_lock_acquire(queue->lock);
447      INT32 myslot = osd_scalable_lock_acquire(queue->lock);
448448      do
449449      {
450450         item = (osd_work_item *)queue->free;
451451      } while (item != NULL && compare_exchange_ptr((PVOID volatile *)&queue->free, item, item->next) != item);
452      osd_scalable_lock_release(queue->lock, lockslot);
452      osd_scalable_lock_release(queue->lock, myslot);
453453
454454      // if nothing, allocate something new
455455      if (item == NULL)
trunk/src/osd/strconv.cpp
r250192r250193
1313
1414// MAMEOS headers
1515#include "strconv.h"
16#include "unicode.h"
1716
1817#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS)
1918//============================================================
trunk/src/osd/windows/input.cpp
r250192r250193
122122{
123123public:
124124   device_info(running_machine &machine)
125      : m_machine(machine) { }
125      : head(NULL), next(NULL), name(NULL), poll(NULL), device(NULL), m_machine(machine) { }
126126
127127   running_machine &machine() const { return m_machine; }
128128
trunk/src/osd/windows/output.cpp
r250192r250193
1212
1313// MAME headers
1414#include "emu.h"
15#include "osdepend.h"
1615#include "winmain.h"
1716// MAMEOS headers
1817#include "output.h"
trunk/src/osd/windows/video.cpp
r250192r250193
1313// MAME headers
1414#include "emu.h"
1515#include "emuopts.h"
16#include "osdepend.h"
17#include "video/vector.h"
1816#include "render.h"
19#include "rendutil.h"
20#include "ui/ui.h"
2117#include "uiinput.h"
2218
2319// MAMEOS headers
r250192r250193
2622#include "window.h"
2723#include "input.h"
2824#include "strconv.h"
29#include "config.h"
3025
3126//============================================================
3227//  CONSTANTS
r250192r250193
113108win_monitor_info::win_monitor_info(const HMONITOR handle, const char *monitor_device, float aspect)
114109   : osd_monitor_info(&m_handle, monitor_device, aspect), m_handle(handle)
115110{
116   refresh();
111   win_monitor_info::refresh();
117112}
118113
119114win_monitor_info::~win_monitor_info()
trunk/src/osd/windows/winclip.cpp
r250192r250193
7676
7777char *osd_get_clipboard_text(void)
7878{
79   char *result = NULL;
79   char *result;
8080
8181   // try to access unicode text
8282   result = get_clipboard_text_by_format(CF_UNICODETEXT, convert_wide);
trunk/src/osd/windows/window.cpp
r250192r250193
2323
2424// MAME headers
2525#include "emu.h"
26#include "emuopts.h"
2726#include "uiinput.h"
2827
2928// MAMEOS headers
r250192r250193
3130#include "window.h"
3231#include "video.h"
3332#include "input.h"
34#include "strconv.h"
35#include "config.h"
3633#include "winutf8.h"
3734
3835#include "winutil.h"
r250192r250193
617614      RECT bounds;
618615
619616      // hide cursor
620      while (ShowCursor(FALSE) >= -1) ;
617      while (ShowCursor(FALSE) >= -1) { };
621618      ShowCursor(TRUE);
622619
623620      // store the cursor position
r250192r250193
632629   else
633630   {
634631      // show cursor
635      while (ShowCursor(TRUE) < 1) ;
632      while (ShowCursor(TRUE) < 1) { };
636633      ShowCursor(FALSE);
637634
638635      // allow cursor to move freely
trunk/src/osd/windows/winfile.cpp
r250192r250193
2020// MAMEOS headers
2121#include "strconv.h"
2222#include "winutil.h"
23#include "winutf8.h"
2423
2524#include "winfile.h"
2625
r250192r250193
187186         break;
188187      case WINFILE_SOCKET:
189188         return win_read_socket(file, buffer, offset, length, actual);
190         break;
191189      case WINFILE_PTTY:
192190         return win_read_ptty(file, buffer, offset, length, actual);
193         break;
194191
195192   }
196193   return FILERR_NONE;
r250192r250193
226223         break;
227224      case WINFILE_SOCKET:
228225         return win_write_socket(file, buffer, offset, length, actual);
229         break;
230226      case WINFILE_PTTY:
231227         return win_write_ptty(file, buffer, offset, length, actual);
232         break;
233228
234229   }
235230   return FILERR_NONE;
r250192r250193
274269         break;
275270      case WINFILE_SOCKET:
276271         return FILERR_FAILURE;
277         break;
278272      case WINFILE_PTTY:
279273         return FILERR_FAILURE;
280         break;
281274
282275   }
283276   return FILERR_NONE;
trunk/src/osd/windows/winmain.cpp
r250192r250193
2929#include "winmain.h"
3030#include "window.h"
3131#include "video.h"
32#include "input.h"
33#include "output.h"
34#include "config.h"
35#include "osdepend.h"
36#include "strconv.h"
3732#include "winutf8.h"
3833#include "winutil.h"
3934#include "debugger.h"
r250192r250193
417412
418413
419414   // parse config and cmdline options
420   DWORD result = 0;
415   DWORD result;
421416   {
422417      windows_options options;
423418      windows_osd_interface osd(options);
r250192r250193
13541349//-------------------------------------------------
13551350
13561351sampling_profiler::sampling_profiler(UINT32 max_seconds, UINT8 stack_depth = 0)
1357   : m_thread(NULL),
1352   :   m_target_thread(NULL),
1353      m_thread(NULL),
13581354      m_thread_id(0),
13591355      m_thread_exit(false),
13601356      m_stack_depth(stack_depth),
trunk/src/osd/windows/winsocket.cpp
r250192r250193
1616// MAME headers
1717#include "osdcore.h"
1818
19// MAMEOS headers
20#include "strconv.h"
21#include "winutil.h"
22#include "winutf8.h"
23
2419#include "winfile.h"
2520
2621const char *winfile_socket_identifier  = "socket.";
trunk/src/osd/windows/winutf8.cpp
r250192r250193
235235                        int x, int y, int width, int height, HWND parent, HMENU menu,
236236                        HINSTANCE instance, void* param)
237237{
238   TCHAR* t_classname = NULL;
238   TCHAR* t_classname;
239239   TCHAR* t_windowname = NULL;
240240   HWND result = 0;
241241
trunk/src/osd/windows/winutil.cpp
r250192r250193
1212
1313// MAMEOS headers
1414#include "winutil.h"
15#include "strconv.h"
1615
1716//============================================================
1817//  win_error_to_file_error


Previous 199869 Revisions Next


© 1997-2024 The MAME Team