Previous 199869 Revisions Next

r41678 Wednesday 11th November, 2015 at 15:31:18 UTC by Miodrag Milanović
Some cleanups and init fixes with help of ReSharper C++ (nw)
[src/devices/imagedev]cassette.cpp chd_cd.cpp flopdrv.cpp flopdrv.h floppy.cpp mfmhd.cpp mfmhd.h midiin.cpp midiout.cpp
[src/devices/machine]keyboard.cpp legscsi.cpp ram.cpp terminal.cpp
[src/devices/sound]samples.cpp
[src/devices/video]poly.h
[src/emu]addrmap.cpp audit.cpp debugger.cpp devcb.cpp devcpu.cpp devfind.cpp devfind.h device.h diexec.h digfx.cpp diimage.cpp diimage.h dinetwork.cpp dinetwork.h dioutput.cpp dioutput.h dipty.cpp dipty.h dirtc.h diserial.cpp dislot.cpp disound.cpp distate.cpp distate.h drawgfxm.h drivenum.cpp drivenum.h emualloc.cpp emupal.cpp hashfile.cpp input.cpp ioport.cpp ioport.h luaengine.cpp machine.cpp machine.h mame.cpp memory.cpp network.cpp render.cpp render.h rendfont.cpp rendlay.cpp romload.cpp save.cpp schedule.cpp screen.cpp softlist.cpp sound.cpp speaker.cpp sprite.h tilemap.cpp timer.cpp uiinput.cpp video.cpp
[src/emu/debug]debugcmd.cpp debugcon.cpp debugcpu.cpp debugvw.cpp debugvw.h dvmemory.h express.cpp
[src/emu/drivers]testcpu.cpp
[src/emu/machine]generic.cpp
[src/emu/ui]cheatopt.cpp filemngr.cpp filesel.cpp imgcntrl.cpp inputmap.cpp mainmenu.cpp menu.cpp menu.h miscmenu.cpp selgame.cpp swlist.cpp ui.cpp videoopt.cpp viewgfx.cpp
[src/emu/video]resnet.cpp rgbgen.h rgbvmx.h vector.cpp

trunk/src/devices/imagedev/cassette.cpp
r250189r250190
3030
3131cassette_image_device::cassette_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3232   : device_t(mconfig, CASSETTE, "Cassette", tag, owner, clock, "cassette_image", __FILE__),
33   device_image_interface(mconfig, *this),
34   m_state(CASSETTE_STOPPED),
33   device_image_interface(mconfig, *this),
34   m_cassette(NULL),
35   m_state(CASSETTE_STOPPED),
36   m_position(0),
37   m_position_time(0),
38   m_value(0),
39   m_channel(0),
40   m_speed(0),
41   m_direction(0),
3542   m_formats(cassette_default_formats),
3643   m_create_opts(NULL),
3744   m_default_state(CASSETTE_PLAY),
r250189r250190
423430         if (position > length)
424431         {
425432            m_state = (cassette_state)(( m_state & ~CASSETTE_MASK_UISTATE ) | CASSETTE_STOPPED);
426            position = length;
427433         }
428434      }
429435   }
trunk/src/devices/imagedev/chd_cd.cpp
r250189r250190
2828
2929cdrom_image_device::cdrom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3030   : device_t(mconfig, CDROM, "CD-ROM Image", tag, owner, clock, "cdrom_image", __FILE__),
31      device_image_interface(mconfig, *this),
31      device_image_interface(mconfig, *this),
32       m_cdrom_handle(NULL),
33       m_extension_list(NULL),
3234      m_interface(NULL)
3335{
3436}
3537
3638cdrom_image_device::cdrom_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
3739   : device_t(mconfig, type, name,  tag, owner, clock, shortname, source),
38      device_image_interface(mconfig, *this),
40      device_image_interface(mconfig, *this),
41      m_cdrom_handle(NULL),
42      m_extension_list(NULL),
3943      m_interface(NULL)
4044{
4145}
trunk/src/devices/imagedev/flopdrv.cpp
r250189r250190
709709      m_rdy(0),
710710      m_dskchg(0),
711711      m_drive_id(0),
712      m_active(0),
712      m_active(0),
713      m_config(NULL),
713714      m_flags(0),
714715      m_max_track(0),
715716      m_num_sides(0),
716      m_current_track(0),
717      m_current_track(0),
718      m_index_timer(NULL),
717719      m_index_pulse_callback(NULL),
718720      m_rpm(0.0f),
719721      m_id_index(0),
r250189r250190
741743      m_rdy(0),
742744      m_dskchg(0),
743745      m_drive_id(0),
744      m_active(0),
746      m_active(0),
747       m_config(NULL),
745748      m_flags(0),
746749      m_max_track(0),
747750      m_num_sides(0),
748      m_current_track(0),
751      m_current_track(0),
752      m_index_timer(NULL),
749753      m_index_pulse_callback(NULL),
750754      m_rpm(0.0f),
751755      m_id_index(0),
trunk/src/devices/imagedev/flopdrv.h
r250189r250190
161161   TIMER_CALLBACK_MEMBER(floppy_drive_index_callback);
162162   void floppy_drive_init();
163163   void floppy_drive_index_func();
164   TIMER_CALLBACK(floppy_drive_index_callback);
165164   int internal_floppy_device_load(int create_format, option_resolution *create_args);
166165   TIMER_CALLBACK_MEMBER( set_wpt );
167166
trunk/src/devices/imagedev/floppy.cpp
r250189r250190
77*********************************************************************/
88
99#include "emu.h"
10#include "emuopts.h"
1110#include "ui/menu.h"
1211#include "ui/filesel.h"
1312#include "zippath.h"
r250189r250190
127126
128127floppy_connector::floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
129128   device_t(mconfig, FLOPPY_CONNECTOR, "Floppy drive connector abstraction", tag, owner, clock, "floppy_connector", __FILE__),
130   device_slot_interface(mconfig, *this),
129   device_slot_interface(mconfig, *this),
130   formats(NULL),
131131   m_enable_sound(false)
132132{
133133}
r250189r250190
167167floppy_image_device::floppy_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
168168   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
169169      device_image_interface(mconfig, *this),
170      device_slot_card_interface(mconfig, *this),
170      device_slot_card_interface(mconfig, *this),
171      input_format(NULL),
172      output_format(NULL),
171173      image(NULL),
172      fif_list(NULL),
173      m_make_sound(false)
174      fif_list(NULL),
175      index_timer(NULL),
176      tracks(0),
177      sides(0),
178      form_factor(0),
179      motor_always_on(false),
180      dir(0), stp(0), wtg(0), mon(0), ss(0), idx(0), wpt(0), rdy(0), dskchg(0),
181      ready(false),
182      rpm(0),
183      floppy_ratio_1(0),
184      revolution_count(0),
185      cyl(0),
186      subcyl(0),
187      image_dirty(false),
188      ready_counter(0),
189      m_make_sound(false),
190      m_sound_out(NULL)
174191{
175192   extension_list[0] = '\0';
176193   m_err = IMAGE_ERROR_INVALIDIMAGE;
r250189r250190
9831000
9841001   bool can_in_place = input_format->supports_save();
9851002   if(can_in_place) {
986      file_error filerr = FILERR_NOT_FOUND;
1003      file_error filerr;
9871004      std::string tmp_path;
9881005      core_file *tmp_file;
9891006      /* attempt to open the file for writing but *without* create */
r250189r250190
10041021   switch (state) {
10051022   case DO_CREATE: {
10061023      floppy_image_format_t *fif_list = fd->get_formats();
1007      int ext_match = 0, total_usable = 0;
1008      for(floppy_image_format_t *i = fif_list; i; i = i->next) {
1024         int ext_match;
1025         int total_usable = 0;
1026         for(floppy_image_format_t *i = fif_list; i; i = i->next) {
10091027         if(!i->supports_save())
10101028            continue;
10111029         if (i->extension_matches(current_file.c_str()))
r250189r250190
10851103//===================================================================
10861104
10871105floppy_sound_device::floppy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1088   : samples_device(mconfig, FLOPPYSOUND, "Floppy sound", tag, owner, clock, "flopsnd", __FILE__)
1106   : samples_device(mconfig, FLOPPYSOUND, "Floppy sound", tag, owner, clock, "flopsnd", __FILE__),
1107     m_sound(NULL),
1108     m_is525(false),
1109     m_sampleindex_motor_start(0),
1110     m_sampleindex_motor_loop(0),
1111     m_sampleindex_motor_end(0),
1112     m_samplesize_motor_start(0),
1113     m_samplesize_motor_loop(0),
1114     m_samplesize_motor_end(0),
1115     m_samplepos_motor(0),
1116     m_motor_playback_state(0),
1117     m_motor_on(false),
1118     m_step_samples(0),
1119     m_sampleindex_step1(0),
1120     m_samplepos_step(0),
1121     m_step_playback_state(0)
10891122{
10901123   m_loaded = false;
10911124}
r250189r250190
11931226   // Also, there is no need for interpolation, as we only expect
11941227   // one sample rate of 44100 for all samples
11951228
1196   INT16 out = 0;
1229   INT16 out;
11971230   stream_sample_t *samplebuffer = outputs[0];
11981231
11991232   while (samples-- > 0)
trunk/src/devices/imagedev/mfmhd.cpp
r250189r250190
270270**************************************************************************/
271271
272272#include "emu.h"
273#include "formats/imageutl.h"
274273#include "harddisk.h"
275274#include "mfmhd.h"
276275
r250189r250190
310309
311310mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
312311   : harddisk_image_device(mconfig, type, name, tag, owner, clock, shortname, source),
313      device_slot_card_interface(mconfig, *this)
312      device_slot_card_interface(mconfig, *this),
313      m_index_timer(NULL),
314      m_spinup_timer(NULL),
315      m_seek_timer(NULL),
316      m_cache_timer(NULL),
317      m_precomp_cyl(0),
318      m_redwc_cyl(0),
319      m_encoding(),
320      m_ready(false),
321      m_current_cylinder(0),
322      m_current_head(0),
323      m_track_delta(0),
324      m_step_phase(0),
325      m_seek_complete(false),
326      m_seek_inward(false),
327      m_autotruncation(false),
328      m_recalibrated(false),
329      m_step_line(),
330      m_format(NULL)
314331{
315332   m_spinupms = 10000;
316333   m_cachelines = 5;
r250189r250190
952969//   This is a write-back LRU cache.
953970// ===========================================================
954971
955mfmhd_trackimage_cache::mfmhd_trackimage_cache(running_machine &machine):
972mfmhd_trackimage_cache::mfmhd_trackimage_cache(running_machine &machine):
973   m_mfmhd(NULL),
956974   m_tracks(NULL),
957975   m_machine(machine)
958976{
r250189r250190
10261044{
10271045   if (TRACE_CACHE) m_machine.logerror("%s: MFM HD cache init; cache size is %d tracks\n", mfmhd->tag(), trackslots);
10281046
1029   chd_error state = CHDERR_NONE;
1047   chd_error state;
10301048
1031   mfmhd_trackimage* previous = NULL;
1049   mfmhd_trackimage* previous;
10321050   mfmhd_trackimage* current = NULL;
10331051
10341052   m_mfmhd = mfmhd;
r250189r250190
11411159
11421160mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock):
11431161   device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__),
1144   device_slot_interface(mconfig, *this)
1162   device_slot_interface(mconfig, *this),
1163   m_encoding(),
1164   m_spinupms(0),
1165   m_cachesize(0),
1166   m_format(NULL)
11451167{
11461168}
11471169
trunk/src/devices/imagedev/mfmhd.h
r250189r250190
154154   mfmhd_trackimage_cache* m_cache;
155155   mfmhd_image_format_t*   m_format;
156156
157   void        prepare_track(int cylinder, int head);
158157   void        head_move();
159158   void        recalibrate();
160159
trunk/src/devices/imagedev/midiin.cpp
r250189r250190
2424
2525midiin_device::midiin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2626   : device_t(mconfig, MIDIIN, "MIDI In image device", tag, owner, clock, "midiin", __FILE__),
27      device_image_interface(mconfig, *this),
28         device_serial_interface(mconfig, *this),
29         m_input_cb(*this)
27     device_image_interface(mconfig, *this),
28     device_serial_interface(mconfig, *this),
29     m_midi(NULL),
30     m_timer(NULL),
31     m_input_cb(*this),
32     m_xmit_read(0),
33     m_xmit_write(0),
34     m_tx_busy(false)
3035{
3136}
3237
trunk/src/devices/imagedev/midiout.cpp
r250189r250190
2424
2525midiout_device::midiout_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2626   : device_t(mconfig, MIDIOUT, "MIDI Out image device", tag, owner, clock, "midiout", __FILE__),
27   device_image_interface(mconfig, *this),
28      device_serial_interface(mconfig, *this)
27     device_image_interface(mconfig, *this),
28     device_serial_interface(mconfig, *this),
29     m_midi(NULL)
2930{
3031}
3132
trunk/src/devices/machine/keyboard.cpp
r250189r250190
4343   m_io_kbd7(*this, "TERM_LINE7"),
4444   m_io_kbd8(*this, "TERM_LINE8"),
4545   m_io_kbd9(*this, "TERM_LINE9"),
46   m_io_kbdc(*this, "TERM_LINEC"),
46   m_io_kbdc(*this, "TERM_LINEC"),
47   m_timer(NULL),
48   m_last_code(0),
49   m_scan_line(0),
4750   m_keyboard_cb(*this)
4851{
4952}
r250189r250190
6164   m_io_kbd8(*this, "TERM_LINE8"),
6265   m_io_kbd9(*this, "TERM_LINE9"),
6366   m_io_kbdc(*this, "TERM_LINEC"),
67   m_timer(NULL),
68   m_last_code(0),
69   m_scan_line(0),
6470   m_keyboard_cb(*this)
6571{
6672}
trunk/src/devices/machine/legscsi.cpp
r250189r250190
33#include "legscsi.h"
44
55legacy_scsi_host_adapter::legacy_scsi_host_adapter(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
6   device_t(mconfig, type, name, tag, owner, clock, shortname, source),
6   device_t(mconfig, type, name, tag, owner, clock, shortname, source),
7   m_selected(0),
78   m_scsi_port(*this)
89{
910}
trunk/src/devices/machine/ram.cpp
r250189r250190
7878{
7979   const char *ramsize_string = NULL;
8080   int is_valid = FALSE;
81   UINT32 specified_ram = 0;
82   const char *gamename_option = NULL;
81   UINT32 specified_ram;
82   const char *gamename_option;
8383
8484   /* verify default ram value */
8585   if (default_size() == 0)
r250189r250190
183183   UINT32 ram;
184184   char suffix = '\0';
185185
186   s += sscanf(s, "%u%c", &ram, &suffix);
186   sscanf(s, "%u%c", &ram, &suffix);
187187
188188   switch(tolower(suffix))
189189   {
trunk/src/devices/machine/terminal.cpp
r250189r250190
143143generic_terminal_device::generic_terminal_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
144144   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
145145      m_palette(*this, "palette"),
146      m_io_term_conf(*this, "TERM_CONF"),
146      m_io_term_conf(*this, "TERM_CONF"),
147      m_x_pos(0),
148      m_framecnt(0),
149      m_y_pos(0),
147150      m_keyboard_cb(*this)
148151{
149152}
150153
151154generic_terminal_device::generic_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
152155   : device_t(mconfig, GENERIC_TERMINAL, "Generic Terminal", tag, owner, clock, "generic_terminal", __FILE__),
153      m_palette(*this, "palette"),
154      m_io_term_conf(*this, "TERM_CONF"),
155      m_keyboard_cb(*this)
156     m_palette(*this, "palette"),
157     m_io_term_conf(*this, "TERM_CONF"),
158     m_x_pos(0),
159     m_framecnt(0),
160     m_y_pos(0),
161     m_keyboard_cb(*this)
156162{
157163}
158164
trunk/src/devices/sound/samples.cpp
r250189r250190
363363                     chan.source_num = -1;
364364                     if (samples > 0)
365365                        memset(buffer, 0, samples * sizeof(*buffer));
366                     samples = 0;
367366                     break;
368367                  }
369368               }
trunk/src/devices/video/poly.h
r250189r250190
656656      v3 = tv;
657657      if (v2->y < v1->y)
658658      {
659         const vertex_t *tv = v1;
659         const vertex_t *tv2 = v1;
660660         v1 = v2;
661         v2 = tv;
661         v2 = tv2;
662662      }
663663   }
664664
trunk/src/emu/addrmap.cpp
r250189r250190
2929      m_addrmask(0),
3030      m_share(NULL),
3131      m_region(NULL),
32      m_rgnoffs(0),
32      m_rgnoffs(0),
33       m_submap_bits(0),
3334      m_memory(NULL),
3435      m_bytestart(0),
3536      m_byteend(0),
trunk/src/emu/audit.cpp
r250189r250190
270270   int found = 0;
271271
272272   // iterate over sample entries
273   samples_device_iterator iter(m_enumerator.config().root_device());
274   for (samples_device *device = iter.first(); device != NULL; device = iter.next())
273   samples_device_iterator iterator(m_enumerator.config().root_device());
274   for (samples_device *device = iterator.first(); device != NULL; device = iterator.next())
275275   {
276276      // by default we just search using the driver name
277277      std::string searchpath(m_enumerator.driver().name);
trunk/src/emu/debug/debugcmd.cpp
r250189r250190
13531353   address_space *space;
13541354   const char *action = NULL;
13551355   UINT64 address, length;
1356   int type = 0;
1356   int type;
13571357   int wpnum;
13581358
13591359   /* CPU is implicit */
r250189r250190
18301830{
18311831   UINT64 offset, endoffset, length, width = 0, ascii = 1;
18321832   address_space *space;
1833   FILE *f = NULL;
1833   FILE *f;
18341834   UINT64 i, j;
18351835
18361836   /* validate parameters */
r250189r250190
19841984   /* initialize entire memory by default */
19851985   if (params <= 1)
19861986   {
1987      offset = 0;
1988      length = space->bytemask() + 1;
19891987      for (entry = space->map()->m_entrylist.first(); entry != NULL; entry = entry->next())
19901988      {
19911989         cheat_region[region_count].offset = space->address_to_byte(entry->m_addrstart) & space->bytemask();
r250189r250190
24562454   UINT64 offset, length, bytes = 1;
24572455   int minbytes, maxbytes, byteswidth;
24582456   address_space *space, *decrypted_space;
2459   FILE *f = NULL;
2457   FILE *f;
24602458   int j;
24612459
24622460   /* validate parameters */
trunk/src/emu/debug/debugcon.cpp
r250189r250190
1111#include "emu.h"
1212#include "debugcon.h"
1313#include "debugcpu.h"
14#include "debughlp.h"
1514#include "debugvw.h"
1615#include "textbuf.h"
1716#include "debugger.h"
r250189r250190
270269{
271270   char command[MAX_COMMAND_LENGTH], parens[MAX_COMMAND_LENGTH];
272271   char *params[MAX_COMMAND_PARAMS] = { 0 };
273   CMDERR result = CMDERR_NONE;
272   CMDERR result;
274273   char *command_start;
275274   char *p, c = 0;
276275
trunk/src/emu/debug/debugcpu.cpp
r250189r250190
1212#include "emuopts.h"
1313#include "osdepend.h"
1414#include "debugcpu.h"
15#include "debugcmd.h"
1615#include "debugcon.h"
1716#include "express.h"
1817#include "debugvw.h"
trunk/src/emu/debug/debugvw.cpp
r250189r250190
1717#include "dvmemory.h"
1818#include "dvbpoints.h"
1919#include "dvwpoints.h"
20#include "debugcmd.h"
2120#include "debugcpu.h"
22#include "debugcon.h"
2321#include <ctype.h>
2422
2523
trunk/src/emu/debug/debugvw.h
r250189r250190
162162   const simple_list<debug_view_source> &source_list() const { return m_source_list; }
163163
164164   // setters
165   void set_size(int width, int height);
166165   void set_visible_size(debug_view_xy size);
167166   void set_visible_position(debug_view_xy pos);
168167   void set_cursor_position(debug_view_xy pos);
trunk/src/emu/debug/dvmemory.h
r250189r250190
1111#ifndef __DVMEMORY_H__
1212#define __DVMEMORY_H__
1313
14#include "dvstate.h"
15
16
1714//**************************************************************************
1815//  TYPE DEFINITIONS
1916//**************************************************************************
trunk/src/emu/debug/express.cpp
r250189r250190
11051105      throw expression_error(expression_error::INVALID_TOKEN, token.offset());
11061106
11071107   // convert the space to flags
1108   expression_space memspace = EXPSPACE_INVALID;
1108   expression_space memspace;
11091109   switch (space)
11101110   {
11111111      case 'p':   memspace = physical ? EXPSPACE_PROGRAM_PHYSICAL : EXPSPACE_PROGRAM_LOGICAL; break;
r250189r250190
12191219
12201220   // loop over all the original tokens
12211221   parse_token *prev = NULL;
1222   parse_token *next = NULL;
1222   parse_token *next;
12231223   for (parse_token *token = m_tokenlist.detach_all(); token != NULL; prev = token, token = next)
12241224   {
12251225      // pre-determine our next token
trunk/src/emu/debugger.cpp
r250189r250190
1313#include "debug/debugcpu.h"
1414#include "debug/debugcmd.h"
1515#include "debug/debugcon.h"
16#include "debug/express.h"
1716#include "debug/debugvw.h"
1817#include <ctype.h>
1918
trunk/src/emu/devcb.cpp
r250189r250190
108108//-------------------------------------------------
109109
110110devcb_read_base::devcb_read_base(device_t &device, UINT64 defmask)
111   : devcb_base(device, defmask)
111   : devcb_base(device, defmask),
112     m_adapter(NULL)
112113{
113114}
114115
r250189r250190
335336//-------------------------------------------------
336337
337338devcb_write_base::devcb_write_base(device_t &device, UINT64 defmask)
338   : devcb_base(device, defmask)
339   : devcb_base(device, defmask),
340     m_adapter(NULL)
339341{
340342}
341343
trunk/src/emu/devcpu.cpp
r250189r250190
99***************************************************************************/
1010
1111#include "emu.h"
12#include "debugger.h"
1312#include <ctype.h>
1413
1514
trunk/src/emu/devfind.cpp
r250189r250190
4040//  find_memregion - find memory region
4141//-------------------------------------------------
4242
43void *finder_base::find_memregion(UINT8 width, size_t &length, bool required)
43void *finder_base::find_memregion(UINT8 width, size_t &length, bool required) const
4444{
4545   // look up the region and return NULL if not found
4646   memory_region *region = m_base.memregion(m_tag);
trunk/src/emu/devfind.h
r250189r250190
5353
5454protected:
5555   // helpers
56   void *find_memregion(UINT8 width, size_t &length, bool required);
56   void *find_memregion(UINT8 width, size_t &length, bool required) const;
5757   void *find_memshare(UINT8 width, size_t &bytes, bool required);
5858   bool report_missing(bool found, const char *objname, bool required);
5959
r250189r250190
8080
8181   // operators to make use transparent
8282   operator _ObjectClass *() const { return m_target; }
83   _ObjectClass *operator->() const { assert(m_target != NULL); return m_target; }
8483
84   virtual _ObjectClass *operator->() const { assert(m_target != NULL); return m_target; }
85
8586   // getter for explicit fetching
8687   _ObjectClass *target() const { return m_target; }
8788
trunk/src/emu/device.h
r250189r250190
198198
199199   // debugging
200200   device_debug *debug() const { return m_debug; }
201   offs_t safe_pc();
202   offs_t safe_pcbase();
201   offs_t safe_pc() const;
202   offs_t safe_pcbase() const;
203203
204204   void set_default_bios(UINT8 bios) { m_default_bios = bios; }
205205   void set_system_bios(UINT8 bios) { m_system_bios = bios; }
trunk/src/emu/diexec.h
r250189r250190
166166   void set_input_line(int linenum, int state) { m_input[linenum].set_state_synced(state); }
167167   void set_input_line_vector(int linenum, int vector) { m_input[linenum].set_vector(vector); }
168168   void set_input_line_and_vector(int linenum, int state, int vector) { m_input[linenum].set_state_synced(state, vector); }
169   int input_state(int linenum) { return m_input[linenum].m_curstate; }
169   int input_state(int linenum) const { return m_input[linenum].m_curstate; }
170170
171171   // suspend/resume
172172   void suspend(UINT32 reason, bool eatcycles);
173173   void resume(UINT32 reason);
174   bool suspended(UINT32 reason = SUSPEND_ANY_REASON) { return (m_nextsuspend & reason) != 0; }
174   bool suspended(UINT32 reason = SUSPEND_ANY_REASON) const { return (m_nextsuspend & reason) != 0; }
175175   void yield() { suspend(SUSPEND_REASON_TIMESLICE, false); }
176176   void spin() { suspend(SUSPEND_REASON_TIMESLICE, true); }
177177   void spin_until_trigger(int trigid) { suspend_until_trigger(trigid, true); }
r250189r250190
195195   device_execute_interface &execute() { return *this; }
196196
197197protected:
198   // internal helpers
199   void run_thread_wrapper();
200
201198   // clock and cycle information getters
202199   virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const;
203200   virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const;
trunk/src/emu/digfx.cpp
r250189r250190
2222
2323device_gfx_interface::device_gfx_interface(const machine_config &mconfig, device_t &device,
2424                              const gfx_decode_entry *gfxinfo, const char *palette_tag)
25   : device_interface(device, "gfx"),
25   : device_interface(device, "gfx"),
26   m_palette(NULL),
2627   m_gfxdecodeinfo(gfxinfo),
2728   m_palette_tag(palette_tag),
2829   m_palette_is_sibling(palette_tag == NULL),
trunk/src/emu/diimage.cpp
r250189r250190
1414#include "ui/ui.h"
1515#include "ui/menu.h"
1616#include "zippath.h"
17#include "ui/filesel.h"
18#include "ui/swlist.h"
1917#include "ui/imgcntrl.h"
2018#include "softlist.h"
2119#include "image.h"
r250189r250190
5755
5856device_image_interface::device_image_interface(const machine_config &mconfig, device_t &device)
5957   : device_interface(device, "image"),
58      m_err(),
6059      m_file(NULL),
6160      m_mame_file(NULL),
6261      m_software_info_ptr(NULL),
63      m_software_part_ptr(NULL),
62      m_software_part_ptr(NULL),
63       m_supported(0),
6464      m_readonly(false),
65      m_created(false),
65      m_created(false),
66       m_init_phase(false),
67       m_from_swlist(false),
68       m_create_format(0),
69       m_create_args(NULL),
6670      m_is_loading(FALSE)
6771{
6872}
r250189r250190
575579
576580image_error_t device_image_interface::load_image_by_path(UINT32 open_flags, const char *path)
577581{
578   file_error filerr = FILERR_NOT_FOUND;
579   image_error_t err = IMAGE_ERROR_FILENOTFOUND;
582   file_error filerr;
583   image_error_t err;
580584   std::string revised_path;
581585
582586   /* attempt to read the file */
r250189r250190
629633   if(m_file)
630634      core_fclose(m_file);
631635
632   file_error filerr = FILERR_NOT_FOUND;
633   image_error_t err = IMAGE_ERROR_FILENOTFOUND;
636   file_error filerr;
637   image_error_t err;
634638   std::string revised_path;
635639
636640   /* attempt to open the file for writing*/
trunk/src/emu/diimage.h
r250189r250190
253253   void setup_working_directory();
254254   bool try_change_working_directory(const char *subdir);
255255
256   int read_hash_config(const char *sysname);
257256   void run_hash(void (*partialhash)(hash_collection &, const unsigned char *, unsigned long, const char *), hash_collection &hashes, const char *types);
258257   void image_checkhash();
259258   void update_names(const device_type device_type = NULL, const char *inst = NULL, const char *brief = NULL);
trunk/src/emu/dinetwork.cpp
r250189r250190
1616{
1717}
1818
19int device_network_interface::send(UINT8 *buf, int len)
19int device_network_interface::send(UINT8 *buf, int len) const
2020{
2121   if(!m_dev) return 0;
2222   return m_dev->send(buf, len);
trunk/src/emu/dinetwork.h
r250189r250190
1919   bool get_promisc() { return m_promisc; }
2020   int get_interface() { return m_intf; }
2121
22   int send(UINT8 *buf, int len);
22   int send(UINT8 *buf, int len) const;
2323   virtual void recv_cb(UINT8 *buf, int len);
2424
2525protected:
trunk/src/emu/dioutput.cpp
r250189r250190
3535{
3636}
3737
38void device_output_interface::set_output_value(int value)
38void device_output_interface::set_output_value(int value) const
3939{
4040   if (m_output_name)
4141      output_set_value(m_output_name, value);
r250189r250190
4343      fatalerror("Output name not set!");
4444}
4545
46void device_output_interface::set_led_value(int value)
46void device_output_interface::set_led_value(int value) const
4747{
4848   if (m_output_name)
4949      output_set_value(m_output_name, value);
r250189r250190
5151      output_set_led_value(m_output_index, value);
5252}
5353
54void device_output_interface::set_lamp_value(int value)
54void device_output_interface::set_lamp_value(int value) const
5555{
5656   if (m_output_name)
5757      output_set_value(m_output_name, value);
r250189r250190
5959      output_set_lamp_value(m_output_index, value);
6060}
6161
62void device_output_interface::set_digit_value(int value)
62void device_output_interface::set_digit_value(int value) const
6363{
6464   if (m_output_name)
6565      output_set_value(m_output_name, value);
trunk/src/emu/dioutput.h
r250189r250190
4747   static void set_output_index(device_t &device, int index) { dynamic_cast<device_output_interface &>(device).m_output_index = index; }
4848   static void set_output_name(device_t &device, const char *name) { dynamic_cast<device_output_interface &>(device).m_output_name = name; }
4949
50   void set_output_value(int value);
51   void set_led_value(int value);
52   void set_lamp_value(int value);
53   void set_digit_value(int value);
50   void set_output_value(int value) const;
51   void set_led_value(int value) const;
52   void set_lamp_value(int value) const;
53   void set_digit_value(int value) const;
5454
5555protected:
5656   int m_output_index;
trunk/src/emu/dipty.cpp
r250189r250190
5353   return m_opened;
5454}
5555
56ssize_t device_pty_interface::read(UINT8 *rx_chars , size_t count)
56ssize_t device_pty_interface::read(UINT8 *rx_chars , size_t count) const
5757{
5858   UINT32 actual_bytes;
5959
r250189r250190
6464   }
6565}
6666
67void device_pty_interface::write(UINT8 tx_char)
67void device_pty_interface::write(UINT8 tx_char) const
6868{
6969   UINT32 actual_bytes;
7070
trunk/src/emu/dipty.h
r250189r250190
2929
3030      bool is_open(void) const;
3131
32      ssize_t read(UINT8 *rx_chars , size_t count);
33      void write(UINT8 tx_char);
32      ssize_t read(UINT8 *rx_chars , size_t count) const;
33      void write(UINT8 tx_char) const;
3434
3535      bool is_slave_connected(void) const;
3636
trunk/src/emu/dirtc.h
r250189r250190
5555   void set_current_time(running_machine &machine);
5656
5757protected:
58   UINT8 convert_to_bcd(int val);
59   int bcd_to_integer(UINT8 val);
58   static UINT8 convert_to_bcd(int val);
59   static int bcd_to_integer(UINT8 val);
6060
6161   void set_clock_register(int register, int value);
6262   int get_clock_register(int register);
trunk/src/emu/diserial.cpp
r250189r250190
1919   m_rcv_register_data(0x8000),
2020   m_rcv_flags(0),
2121   m_rcv_bit_count_received(0),
22   m_rcv_bit_count(0),
22   m_rcv_bit_count(0),
23   m_rcv_byte_received(0),
2324   m_rcv_framing_error(false),
2425   m_rcv_parity_error(false),
25   m_tra_flags(TRANSMIT_REGISTER_EMPTY),
26   m_tra_register_data(0),
27   m_tra_flags(TRANSMIT_REGISTER_EMPTY),
28   m_tra_bit_count_transmitted(0),
29   m_tra_bit_count(0),
2630   m_rcv_clock(NULL),
2731   m_tra_clock(NULL),
2832   m_rcv_rate(attotime::never),
trunk/src/emu/dislot.cpp
r250189r250190
2020{
2121}
2222
23device_slot_option::device_slot_option(const char *name, const device_type &devtype):
24   m_name(name),
23device_slot_option::device_slot_option(const char *name, const device_type &devtype):
24   m_next(NULL),
25    m_name(name),
2526   m_devtype(devtype),
2627   m_selectable(true),
2728   m_default_bios(NULL),
trunk/src/emu/disound.cpp
r250189r250190
194194   {
195195      for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
196196         if (&stream->device() == &device())
197            for (int outputnum = 0; outputnum < stream->output_count(); outputnum++)
198               stream->set_output_gain(outputnum, gain);
197            for (int num = 0; num < stream->output_count(); num++)
198               stream->set_output_gain(num, gain);
199199   }
200200
201201   // look up the stream and stream output index
trunk/src/emu/distate.cpp
r250189r250190
146146UINT64 device_state_entry::value() const
147147{
148148   // pick up the value
149   UINT64 result = ~(UINT64)0;
149   UINT64 result;
150150   switch (m_datasize)
151151   {
152152      default:
r250189r250190
172172   bool leadzero = false;
173173   bool percent = false;
174174   bool explicitsign = false;
175   bool hitnonzero = false;
175   bool hitnonzero;
176176   bool reset = true;
177177   int width = 0;
178178   for (const char *fptr = m_format.c_str(); *fptr != 0; fptr++)
trunk/src/emu/distate.h
r250189r250190
195195//  or 0 if no state object exists
196196//-------------------------------------------------
197197
198inline offs_t device_t::safe_pc()
198inline offs_t device_t::safe_pc() const
199199{
200200   return (m_state != NULL) ? m_state->pc() : 0;
201201}
r250189r250190
206206//  base or 0 if no state object exists
207207//-------------------------------------------------
208208
209inline offs_t device_t::safe_pcbase()
209inline offs_t device_t::safe_pcbase() const
210210{
211211   return (m_state != NULL) ? m_state->pcbase() : 0;
212212}
trunk/src/emu/drawgfxm.h
r250189r250190
5050#ifndef __DRAWGFXM_H__
5151#define __DRAWGFXM_H__
5252
53#include "profiler.h"
54
55
5653/* special priority type meaning "none" */
5754struct NO_PRIORITY { char dummy[3]; };
5855
trunk/src/emu/drivenum.cpp
r250189r250190
395395//  we're done with it
396396//-------------------------------------------------
397397
398void driver_enumerator::release_current()
398void driver_enumerator::release_current() const
399399{
400400   // skip if no current entry
401401   if (m_current < 0 || m_current >= s_driver_count)
trunk/src/emu/drivenum.h
r250189r250190
117117
118118private:
119119   // internal helpers
120   void release_current();
120   void release_current() const;
121121
122122   // entry in the config cache
123123   struct config_entry
trunk/src/emu/drivers/testcpu.cpp
r250189r250190
3232   testcpu_state(const machine_config &mconfig, device_type type, const char *tag)
3333      : driver_device(mconfig, type, tag),
3434         m_cpu(*this, "maincpu"),
35         m_ram(*this, "ram")
35         m_ram(*this, "ram"),
36         m_space(NULL)
3637   {
3738   }
3839
trunk/src/emu/emualloc.cpp
r250189r250190
99***************************************************************************/
1010
1111#include "emucore.h"
12#include "coreutil.h"
1312
1413
1514//**************************************************************************
trunk/src/emu/emupal.cpp
r250189r250190
2424      m_entries(0),
2525      m_indirect_entries(0),
2626      m_enable_shadows(0),
27      m_enable_hilights(0),
28      m_membits_supplied(false),
27      m_enable_hilights(0),
28      m_membits(0),
29      m_membits_supplied(false),
30      m_endianness(),
2931      m_endianness_supplied(false),
3032      m_raw_to_rgb(raw_to_rgb_converter()),
3133      m_palette(NULL),
32      m_pens(NULL),
34      m_pens(NULL),
35      m_format(),
3336      m_shadow_table(NULL),
3437      m_shadow_group(0),
35      m_hilight_group(0),
38      m_hilight_group(0),
39      m_white_pen(0),
40      m_black_pen(0),
3641      m_init(palette_init_delegate())
3742{
3843}
trunk/src/emu/hashfile.cpp
r250189r250190
540540bool read_hash_config(device_image_interface &image, const char *sysname, std::string &result)
541541{
542542   hash_file *hashfile = NULL;
543   const hash_info *info = NULL;
543   const hash_info *info;
544544
545545   /* open the hash file */
546546   hashfile = hashfile_open(image.device().mconfig().options(), sysname, FALSE, NULL);
trunk/src/emu/input.cpp
r250189r250190
843843   assert(m_item[itemid] == NULL);
844844
845845   // determine the class and create the appropriate item class
846   input_device_item *item = NULL;
846   input_device_item *item;
847847   switch (m_class.standard_item_class(originalid))
848848   {
849849      case ITEM_CLASS_SWITCH:
trunk/src/emu/ioport.cpp
r250189r250190
9797#include "profiler.h"
9898#include "ui/ui.h"
9999#include "uiinput.h"
100#include "debug/debugcon.h"
101100
102101#include "osdepend.h"
103102
r250189r250190
727726//-------------------------------------------------
728727
729728digital_joystick::digital_joystick(int player, int number)
730   : m_player(player),
729   :   m_next(NULL),
730      m_player(player),
731731      m_number(number),
732732      m_current(0),
733733      m_current4way(0),
r250189r250190
24542454      m_record_file(machine.options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS),
24552455      m_playback_file(machine.options().input_directory(), OPEN_FLAG_READ),
24562456      m_playback_accumulated_speed(0),
2457      m_playback_accumulated_frames(0)
2457      m_playback_accumulated_frames(0),
2458      m_has_configs(false),
2459      m_has_analog(false),
2460      m_has_dips(false),
2461      m_has_bioses(false)
24582462{
24592463   memset(m_type_to_entry, 0, sizeof(m_type_to_entry));
24602464}
r250189r250190
32333237               xml_set_attribute(portnode, "type", input_type_to_token(tempstr, entry->type(), entry->player()));
32343238
32353239               // add only the sequences that have changed from the defaults
3236               for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3237                  if (entry->seq(seqtype) != entry->defseq(seqtype))
3238                     save_sequence(portnode, seqtype, entry->type(), entry->seq(seqtype));
3240               for (input_seq_type type = SEQ_TYPE_STANDARD; type < SEQ_TYPE_TOTAL; type++)
3241                  if (entry->seq(type) != entry->defseq(type))
3242                     save_sequence(portnode, type, entry->type(), entry->seq(type));
32393243            }
32403244         }
32413245      }
trunk/src/emu/ioport.h
r250189r250190
13941394   int count_players() const;
13951395   bool crosshair_position(int player, float &x, float &y);
13961396   bool has_keyboard() const;
1397   void setup_natural_keyboard(ioport_queue_chars_delegate queue_chars, ioport_accept_char_delegate accept_char, ioport_charqueue_empty_delegate charqueue_empty);
13981397   INT32 frame_interpolate(INT32 oldval, INT32 newval);
13991398   ioport_type token_to_input_type(const char *string, int &player) const;
14001399   const char *input_type_to_token(std::string &str, ioport_type type, int player);
trunk/src/emu/luaengine.cpp
r250189r250190
1313#include "luabridge/Source/LuaBridge/LuaBridge.h"
1414#include <signal.h>
1515#include "emu.h"
16#include "emuopts.h"
17#include "osdepend.h"
1816#include "drivenum.h"
1917#include "ui/ui.h"
2018#include "luaengine.h"
r250189r250190
838836      osd_lock_release(lock);
839837
840838      // Wait for response
841      int done = 0;
839      int done;
842840      do {
843841         osd_sleep(osd_ticks_per_second() / 1000);
844842         osd_lock_acquire(lock);
trunk/src/emu/machine.cpp
r250189r250190
7575#include "debugger.h"
7676#include "render.h"
7777#include "cheat.h"
78#include "ui/selgame.h"
7978#include "uiinput.h"
8079#include "crsshair.h"
81#include "validity.h"
8280#include "unzip.h"
83#include "debug/debugcon.h"
8481#include "debug/debugvw.h"
8582#include "image.h"
8683#include "luaengine.h"
r250189r250190
322319
323320   // notify this device and all its subdevices that they are now configured
324321   device_iterator iter(root_device());
325   for (device_t *device = iter.first(); device != NULL; device = iter.next())
326      if (!device->configured())
327         device->config_complete();
322   for (device_t *dev = iter.first(); dev != NULL; dev = iter.next())
323      if (!dev->configured())
324         dev->config_complete();
328325   return *device;
329326}
330327
r250189r250190
578575         // find length of the device name
579576         int end1 = statename_str.find("/", pos + 3);
580577         int end2 = statename_str.find("%", pos + 3);
581         int end = -1;
578         int end;
582579
583580         if ((end1 != -1) && (end2 != -1))
584581            end = MIN(end1, end2);
trunk/src/emu/machine.h
r250189r250190
7373#define auto_alloc_array_clear(m, t, c) pool_alloc_array_clear(static_cast<running_machine &>(m).respool(), t, c)
7474#define auto_free(m, v)                 pool_free(static_cast<running_machine &>(m).respool(), v)
7575
76#define auto_bitmap_alloc(m, w, h, f)   auto_alloc(m, bitmap_t(w, h, f))
7776#define auto_bitmap_ind8_alloc(m, w, h) auto_alloc(m, bitmap_ind8(w, h))
7877#define auto_bitmap_ind16_alloc(m, w, h)    auto_alloc(m, bitmap_ind16(w, h))
7978#define auto_bitmap_ind32_alloc(m, w, h)    auto_alloc(m, bitmap_ind32(w, h))
r250189r250190
191190   bool scheduled_event_pending() const { return m_exit_pending || m_hard_reset_pending; }
192191
193192   // fetch items by name
194   inline device_t *device(const char *tag) { return root_device().subdevice(tag); }
193   inline device_t *device(const char *tag) const { return root_device().subdevice(tag); }
195194   template<class _DeviceClass> inline _DeviceClass *device(const char *tag) { return downcast<_DeviceClass *>(device(tag)); }
196195
197196   // configuration helpers
trunk/src/emu/machine/generic.cpp
r250189r250190
99*********************************************************************/
1010
1111#include "emu.h"
12#include "emuopts.h"
1312#include "config.h"
1413
1514
trunk/src/emu/mame.cpp
r250189r250190
7373#include "emu.h"
7474#include "emuopts.h"
7575#include "osdepend.h"
76#include "config.h"
77#include "debugger.h"
78#include "render.h"
79#include "cheat.h"
80#include "ui/ui.h"
81#include "uiinput.h"
82#include "crsshair.h"
8376#include "validity.h"
84#include "debug/debugcon.h"
8577#include "luaengine.h"
8678#include <time.h>
8779
trunk/src/emu/memory.cpp
r250189r250190
335335
336336   // construction/destruction
337337   handler_entry_read(UINT8 width, endianness_t endianness, UINT8 **rambaseptr)
338      : handler_entry(width, endianness, rambaseptr)
338      : handler_entry(width, endianness, rambaseptr),
339        m_ioport(NULL)
339340   {
340341   }
341342
r250189r250190
397398
398399   // construction/destruction
399400   handler_entry_write(UINT8 width, endianness_t endianness, UINT8 **rambaseptr)
400      : handler_entry(width, endianness, rambaseptr)
401      : handler_entry(width, endianness, rambaseptr),
402        m_ioport(NULL)
401403   {
402404   }
403405
r250189r250190
40794081      m_byteend(0),
40804082      m_bytemask(~0),
40814083      m_rambaseptr(rambaseptr),
4082      m_subunits(0)
4084      m_subunits(0),
4085       m_invsubmask(0)
40834086{
40844087}
40854088
trunk/src/emu/network.cpp
r250189r250190
99#include <ctype.h>
1010
1111#include "emu.h"
12#include "emuopts.h"
1312#include "network.h"
1413#include "config.h"
1514#include "xmlfile.h"
trunk/src/emu/render.cpp
r250189r250190
25002500
25012501float render_manager::ui_aspect(render_container *rc)
25022502{
2503   int orient = 0;
2504   float aspect = 1.0f;
2503   int orient;
2504   float aspect;
25052505
25062506   if (rc == m_ui_container || rc == NULL) {
25072507      // ui container, aggregated multi-screen target
trunk/src/emu/render.h
r250189r250190
304304   friend class simple_list<render_primitive>;
305305
306306public:
307   render_primitive():
308      type(),
309      flags(0),
310      width(0),
311      container(NULL),
312      m_next(NULL)
313   {}
314
307315   // render primitive types
308316   enum primitive_type
309317   {
r250189r250190
522530      friend class simple_list<item>;
523531
524532   public:
533      item() : m_next(NULL), m_type(0), m_flags(0), m_internal(0), m_width(0), m_texture(NULL) { }
534
525535      // getters
526536      item *next() const { return m_next; }
527537      UINT8 type() const { return m_type; }
trunk/src/emu/rendfont.cpp
r250189r250190
1010
1111#include "emu.h"
1212#include "rendfont.h"
13#include "rendutil.h"
1413#include "emuopts.h"
1514#include "coreutil.h"
1615
trunk/src/emu/rendlay.cpp
r250189r250190
5353#include "rendlay.h"
5454#include "rendutil.h"
5555#include "xmlfile.h"
56#include "png.h"
57#include "ui/ui.h"
5856
5957
6058
r250189r250190
632630      std::string symbollist = xml_get_attribute_string_with_subst(machine, compnode, "symbollist", "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15");
633631
634632      // split out position names from string and figure out our number of symbols
635      int location = -1;
633      int location;
636634      m_numstops = 0;
637635      location=symbollist.find(",");
638636      while (location!=-1)
trunk/src/emu/romload.cpp
r250189r250190
1010#include "emu.h"
1111#include "emuopts.h"
1212#include "drivenum.h"
13#include "png.h"
1413#include "chd.h"
15#include "config.h"
1614#include "softlist.h"
1715#include "ui/ui.h"
1816
trunk/src/emu/save.cpp
r250189r250190
194194save_error save_manager::check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...))
195195{
196196   // if we want to validate the signature, compute it
197   UINT32 sig = 0;
197   UINT32 sig;
198198   sig = machine.save().signature();
199199
200200   // seek to the beginning and read the header
trunk/src/emu/schedule.cpp
r250189r250190
490490               exec->m_totalcycles += ran;
491491
492492               // update the local time for this CPU
493               attotime delta(0, exec->m_attoseconds_per_cycle * ran);
494               assert(delta >= attotime::zero);
495               exec->m_localtime += delta;
493               attotime deltatime(0, exec->m_attoseconds_per_cycle * ran);
494               assert(deltatime >= attotime::zero);
495               exec->m_localtime += deltatime;
496496               LOG(("         %d ran, %d total, time = %s\n", ran, (INT32)exec->m_totalcycles, exec->m_localtime.as_string(PRECISION)));
497497
498498               // if the new local CPU time is less than our target, move the target up, but not before the base
trunk/src/emu/screen.cpp
r250189r250190
5858      m_container(NULL),
5959      m_width(100),
6060      m_height(100),
61      m_visarea(0, 99, 0, 99),
61      m_visarea(0, 99, 0, 99),
62       m_texformat(),
6263      m_curbitmap(0),
6364      m_curtexture(0),
6465      m_changed(true),
r250189r250190
634635   LOG_PARTIAL_UPDATES(("updating %d-%d\n", clip.min_y, clip.max_y));
635636   g_profiler.start(PROFILER_VIDEO);
636637
637   UINT32 flags = UPDATE_HAS_NOT_CHANGED;
638   UINT32 flags;
638639   screen_bitmap &curbitmap = m_bitmap[m_curbitmap];
639640   switch (curbitmap.format())
640641   {
r250189r250190
751752
752753      LOG_PARTIAL_UPDATES(("doing scanline partial draw: Y %d X %d-%d\n", clip.max_y, clip.min_x, clip.max_x));
753754
754      UINT32 flags = UPDATE_HAS_NOT_CHANGED;
755      UINT32 flags;
755756      screen_bitmap &curbitmap = m_bitmap[m_curbitmap];
756757      switch (curbitmap.format())
757758      {
trunk/src/emu/softlist.cpp
r250189r250190
99***************************************************************************/
1010
1111#include "emu.h"
12#include "pool.h"
1312#include "emuopts.h"
1413#include "softlist.h"
1514#include "clifront.h"
r250189r250190
279278      m_list_type(SOFTWARE_LIST_ORIGINAL_SYSTEM),
280279      m_filter(NULL),
281280      m_parsed(false),
282      m_file(mconfig.options().hash_path(), OPEN_FLAG_READ)
281      m_file(mconfig.options().hash_path(), OPEN_FLAG_READ),
282      m_description(NULL)
283283{
284284}
285285
trunk/src/emu/sound.cpp
r250189r250190
791791//-------------------------------------------------
792792
793793sound_stream::stream_output::stream_output()
794   : m_dependents(0),
795      m_gain(0x100)
794   : m_stream(NULL),
795     m_dependents(0),
796     m_gain(0x100)
796797{
797798}
798799
trunk/src/emu/speaker.cpp
r250189r250190
99***************************************************************************/
1010
1111#include "emu.h"
12#include "emuopts.h"
13#include "osdepend.h"
14#include "config.h"
15#include "sound/wavwrite.h"
1612
1713
1814
trunk/src/emu/sprite.h
r250189r250190
2020
2121// class representing a single dirty region
2222class sparse_dirty_rect : public rectangle
23{
23{   
2424   friend class simple_list<sparse_dirty_rect>;
2525
2626public:
27   sparse_dirty_rect(): m_next(NULL) { }
2728   // getters
2829   const sparse_dirty_rect *next() const { return m_next; }
2930
trunk/src/emu/tilemap.cpp
r250189r250190
15891589tilemap_device::tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
15901590   : device_t(mconfig, TILEMAP, "Tilemap", tag, owner, clock, "tilemap", __FILE__),
15911591      m_gfxdecode(*this),
1592      m_standard_mapper(TILEMAP_STANDARD_COUNT),
1592      m_standard_mapper(TILEMAP_STANDARD_COUNT),
1593       m_bytes_per_entry(0),
15931594      m_tile_width(8),
15941595      m_tile_height(8),
15951596      m_num_columns(64),
trunk/src/emu/timer.cpp
r250189r250190
217217      case TIMER_TYPE_PERIODIC:
218218      {
219219         // convert the period into attotime
220         attotime period = attotime::never;
220         attotime period;
221221         if (m_period > attotime::zero)
222222         {
223223            period = m_period;
trunk/src/emu/ui/cheatopt.cpp
r250189r250190
1111#include "emu.h"
1212#include "cheat.h"
1313
14#include "uiinput.h"
1514#include "ui/ui.h"
1615#include "ui/menu.h"
1716#include "ui/cheatopt.h"
trunk/src/emu/ui/filemngr.cpp
r250189r250190
1414#include "emu.h"
1515#include "ui/ui.h"
1616#include "ui/menu.h"
17#include "ui/swlist.h"
1817#include "ui/filemngr.h"
1918#include "ui/filesel.h"
2019#include "ui/miscmenu.h"
r250189r250190
2928//  ctor
3029//-------------------------------------------------
3130
32ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_container *container, const char *warnings) : ui_menu(machine, container)
31ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_container *container, const char *warnings) : ui_menu(machine, container), selected_device(NULL)
3332{
3433   // This warning string is used when accessing from the force_file_manager call, i.e.
3534   // when the file manager is loaded top front in the case of mandatory image devices
r250189r250190
127126      if (subiter.count() > 0)
128127      {
129128         // if so, cycle through all its image interfaces
130         image_interface_iterator subiter(*dev);
131         for (device_image_interface *scan = subiter.first(); scan != NULL; scan = subiter.next())
129         image_interface_iterator subiterator(*dev);
130         for (device_image_interface *scan = subiterator.first(); scan != NULL; scan = subiterator.next())
132131         {
133132            // if it is a children device, and not something further down the device tree, we want it in the menu!
134133            if (strcmp(scan->device().owner()->tag(), dev->tag()) == 0)
trunk/src/emu/ui/filesel.cpp
r250189r250190
1616#include "ui/ui.h"
1717#include "ui/menu.h"
1818#include "zippath.h"
19#include "ui/menu.h"
2019#include "ui/filesel.h"
21#include "ui/swlist.h"
2220#include "imagedev/floppy.h"
2321
2422
r250189r250190
10098
10199   // take off the borders
102100   x1 += UI_BOX_LR_BORDER;
103   x2 -= UI_BOX_LR_BORDER;
104101   y1 += UI_BOX_TB_BORDER;
105   y2 -= UI_BOX_TB_BORDER;
106102
107103   // draw the text within it
108104   container->manager().machine().ui().draw_text_full(container,text, x1, y1, text_width, JUSTIFY_LEFT, WRAP_WORD,
r250189r250190
222218ui_menu_file_create::ui_menu_file_create(running_machine &machine, render_container *container, device_image_interface *image, std::string &current_directory, std::string &current_file, bool *ok)
223219   : ui_menu(machine, container),
224220      m_current_directory(current_directory),
225      m_current_file(current_file)
221      m_current_file(current_file),
222      m_current_format(NULL)
226223{
227224   m_image = image;
228225   m_ok = ok;
r250189r250190
347344ui_menu_file_selector::ui_menu_file_selector(running_machine &machine, render_container *container, device_image_interface *image, std::string &current_directory, std::string &current_file, bool has_empty, bool has_softlist, bool has_create, int *result)
348345   : ui_menu(machine, container),
349346      m_current_directory(current_directory),
350      m_current_file(current_file)
347      m_current_file(current_file),
348      m_entrylist(NULL)
351349{
352350   m_image = image;
353351   m_has_empty = has_empty;
r250189r250190
538536void ui_menu_file_selector::populate()
539537{
540538   zippath_directory *directory = NULL;
541   file_error err = FILERR_NONE;
539   file_error err;
542540   const osd_directory_entry *dirent;
543541   const file_selector_entry *entry;
544542   const file_selector_entry *selected_entry = NULL;
trunk/src/emu/ui/imgcntrl.cpp
r250189r250190
2828//-------------------------------------------------
2929
3030ui_menu_control_device_image::ui_menu_control_device_image(running_machine &machine, render_container *container, device_image_interface *_image)
31   : ui_menu(machine, container)
31   : ui_menu(machine, container),
32     submenu_result(0),
33     create_ok(false),
34     create_confirmed(false)
3235{
3336   image = _image;
3437
trunk/src/emu/ui/inputmap.cpp
r250189r250190
224224/*-------------------------------------------------
225225    menu_input - display a menu for inputs
226226-------------------------------------------------*/
227ui_menu_input::ui_menu_input(running_machine &machine, render_container *container) : ui_menu(machine, container)
227ui_menu_input::ui_menu_input(running_machine &machine, render_container *container) : ui_menu(machine, container), last_sortorder(0), record_next(false)
228228{
229229   pollingitem = 0;
230230   pollingref = 0;
r250189r250190
264264   if (pollingitem != NULL)
265265   {
266266      input_item_data *item = pollingitem;
267      input_seq newseq;
268267
269268      /* if UI_CANCEL is pressed, abort */
270269      if (ui_input_pressed(machine(), IPT_UI_CANCEL))
r250189r250190
533532    switches menus
534533-------------------------------------------------*/
535534
536ui_menu_settings::ui_menu_settings(running_machine &machine, render_container *container, UINT32 _type) : ui_menu(machine, container)
535ui_menu_settings::ui_menu_settings(running_machine &machine, render_container *container, UINT32 _type) : ui_menu(machine, container), diplist(NULL), dipcount(0)
537536{
538537   type = _type;
539538}
trunk/src/emu/ui/mainmenu.cpp
r250189r250190
99*********************************************************************/
1010
1111#include "emu.h"
12#include "audit.h"
1312#include "crsshair.h"
14#include "osdnet.h"
1513#include "emuopts.h"
1614#include "rendutil.h"
1715#include "cheat.h"
18#include "uiinput.h"
19#include "ui/ui.h"
2016#include "ui/menu.h"
2117#include "ui/filemngr.h"
22#include "ui/filesel.h"
2318#include "ui/barcode.h"
2419#include "ui/cheatopt.h"
2520#include "ui/info.h"
r250189r250190
3328#include "ui/tapectrl.h"
3429#include "ui/videoopt.h"
3530#include "imagedev/cassette.h"
36#include "imagedev/bitbngr.h"
3731#include "machine/bcreader.h"
3832
3933
trunk/src/emu/ui/menu.cpp
r250189r250190
99*********************************************************************/
1010
1111#include "emu.h"
12#include "emuopts.h"
1312#include "rendutil.h"
1413#include "cheat.h"
1514#include "uiinput.h"
1615#include "ui/ui.h"
1716#include "ui/menu.h"
1817#include "ui/mainmenu.h"
19#include "ui/cheatopt.h"
2018
2119
2220
r250189r250190
411409
412410   float effective_width, effective_left;
413411   float visible_width, visible_main_menu_height;
414   float visible_extra_menu_height = 0;
412   float visible_extra_menu_height;
415413   float visible_top, visible_left;
416414   int selected_subitem_too_big = FALSE;
417415   int visible_lines;
r250189r250190
812810void ui_menu::handle_keys(UINT32 flags)
813811{
814812   int ignorepause = ui_menu::stack_has_special_main_menu();
815   int ignoreright = FALSE;
816   int ignoreleft = FALSE;
813   int ignoreright;
814   int ignoreleft;
817815   int code;
818816
819817   // bail if no items
trunk/src/emu/ui/menu.h
r250189r250190
180180   void draw_text_box();
181181   void handle_events();
182182   void handle_keys(UINT32 flags);
183   void clear_free_list();
184183
185184   inline bool exclusive_input_pressed(int key, int repeat);
186185   static void clear_free_list(running_machine &machine);
trunk/src/emu/ui/miscmenu.cpp
r250189r250190
1515#include "ui/ui.h"
1616#include "ui/menu.h"
1717#include "ui/miscmenu.h"
18#include "ui/filemngr.h"
1918
2019
2120/***************************************************************************
trunk/src/emu/ui/selgame.cpp
r250189r250190
99***************************************************************************/
1010
1111#include "emu.h"
12#include "osdnet.h"
1312#include "emuopts.h"
1413#include "ui/ui.h"
1514#include "ui/menu.h"
16#include "rendutil.h"
17#include "cheat.h"
1815#include "uiinput.h"
1916#include "ui/selgame.h"
2017#include "ui/inputmap.h"
2118#include "ui/miscmenu.h"
2219#include "audit.h"
23#include "crsshair.h"
2420#include <ctype.h>
2521
2622
r250189r250190
409405   x1 += UI_BOX_LR_BORDER;
410406   x2 -= UI_BOX_LR_BORDER;
411407   y1 += UI_BOX_TB_BORDER;
412   y2 -= UI_BOX_TB_BORDER;
413408
414409   // draw all lines
415410   for (line = 0; line < 4; line++)
trunk/src/emu/ui/swlist.cpp
r250189r250190
270270      // handle selections
271271      else if (event->iptkey == IPT_UI_SELECT)
272272      {
273         entry_info *entry = (entry_info *) event->itemref;
274         m_result = entry->short_name;
273         entry_info *info = (entry_info *) event->itemref;
274         m_result = info->short_name;
275275         ui_menu::stack_pop(machine());
276276      }
277277      else if (event->iptkey == IPT_SPECIAL)
trunk/src/emu/ui/ui.cpp
r250189r250190
1818#include "uiinput.h"
1919#include "ui/ui.h"
2020#include "ui/menu.h"
21#include "ui/cheatopt.h"
2221#include "ui/mainmenu.h"
23#include "ui/miscmenu.h"
2422#include "ui/filemngr.h"
2523#include "ui/sliders.h"
2624#include "ui/viewgfx.h"
r250189r250190
16881686UINT32 ui_manager::handler_load_save(running_machine &machine, render_container *container, UINT32 state)
16891687{
16901688   char filename[20];
1691   input_code code;
16921689   char file = 0;
16931690
16941691   // if we're not in the middle of anything, skip
trunk/src/emu/ui/videoopt.cpp
r250189r250190
1111#include "emu.h"
1212#include "rendutil.h"
1313
14#include "uiinput.h"
15#include "ui/ui.h"
1614#include "ui/menu.h"
1715#include "ui/videoopt.h"
1816
trunk/src/emu/ui/viewgfx.cpp
r250189r250190
1010
1111#include "emu.h"
1212#include "ui/ui.h"
13#include "ui/menu.h"
1413#include "uiinput.h"
1514#include "render.h"
1615#include "rendfont.h"
trunk/src/emu/uiinput.cpp
r250189r250190
249249bool ui_input_pressed_repeat(running_machine &machine, int code, int speed)
250250{
251251   ui_input_private *uidata = machine.ui_input_data;
252   int pressed = FALSE;
252   int pressed;
253253
254254g_profiler.start(PROFILER_INPUT);
255255
trunk/src/emu/video.cpp
r250189r250190
11421142         // find length of the device name
11431143         int end1 = snapstr.find("/", pos + 3);
11441144         int end2 = snapstr.find("%", pos + 3);
1145         int end = -1;
1145         int end;
11461146
11471147         if ((end1 != -1) && (end2 != -1))
11481148            end = MIN(end1, end2);
trunk/src/emu/video/resnet.cpp
r250189r250190
346346   max = minval;
347347   for( i = 0; i < networks_no; i++ )
348348   {
349      double val = 0.0;
349      double val;
350350      double max_tmp = minval;
351351      double min_tmp = maxval;
352352
trunk/src/emu/video/rgbgen.h
r250189r250190
1919class rgbaint_t
2020{
2121public:
22   inline rgbaint_t() { }
22   inline rgbaint_t(): m_a(0), m_r(0), m_g(0), m_b(0) { }
2323   inline rgbaint_t(UINT32 rgba) { set(rgba); }
2424   inline rgbaint_t(INT32 a, INT32 r, INT32 g, INT32 b) { set(a, r, g, b); }
2525   inline rgbaint_t(rgb_t& rgba) { set(rgba); }
trunk/src/emu/video/rgbvmx.h
r250189r250190
2828   typedef __vector unsigned int   VECU32;
2929
3030public:
31   inline rgbaint_t() { }
31   inline rgbaint_t(): VECS8(0), VECU8(0), VECS16(0), VECU16(0), VECS32(0), VECU32(0) { }
3232   inline rgbaint_t(UINT32 rgba) { set(rgba); }
3333   inline rgbaint_t(INT32 a, INT32 r, INT32 g, INT32 b) { set(a, r, g, b); }
3434   inline rgbaint_t(rgb_t& rgb) { set(rgb); }
35   inline rgbaint_t(VECS32 rgba) { m_value = rgba; }
35   inline rgbaint_t(VECS32 rgba): VECS8(0), VECU8(0), VECS16(0), VECU16(0), VECS32(0), VECU32(0) { m_value = rgba; }
3636
3737   inline void set(rgbaint_t& other) { m_value = other.m_value; }
3838
trunk/src/emu/video/vector.cpp
r250189r250190
130130
131131vector_device::vector_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
132132   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
133      device_video_interface(mconfig, *this)
133      device_video_interface(mconfig, *this),
134      m_vector_list(NULL)
134135{
135136}
136137
137138vector_device::vector_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
138139   : device_t(mconfig, VECTOR, "VECTOR", tag, owner, clock, "vector_device", __FILE__),
139      device_video_interface(mconfig, *this)
140     device_video_interface(mconfig, *this),
141     m_vector_list(NULL)
140142{
141143}
142144


Previous 199869 Revisions Next


© 1997-2024 The MAME Team