Previous 199869 Revisions Next

r41724 Saturday 14th November, 2015 at 18:05:18 UTC by Miodrag Milanović
Fixed some suggestions by ReSharper C++ (nw)
[src/devices/video]poly.h
[src/emu]dimemory.cpp input.cpp ioport.cpp luaengine.cpp memory.cpp profiler.cpp render.cpp rendlay.cpp tilemap.cpp uiinput.cpp
[src/emu/debug]debugcmd.cpp debugcpu.cpp dvmemory.cpp dvwpoints.cpp
[src/emu/ui]inputmap.cpp ui.cpp

trunk/src/devices/video/poly.h
r250235r250236
10021002      edgeptr->dxdy = (edgeptr->v2->x - edgeptr->v1->x) * ooy;
10031003      for (int paramnum = 0; paramnum < paramcount; paramnum++)
10041004         edgeptr->dpdy[paramnum] = (edgeptr->v2->p[paramnum] - edgeptr->v1->p[paramnum]) * ooy;
1005      edgeptr++;
1005      ++edgeptr;
10061006   }
10071007
10081008   // walk backward to build up the backward edge list
r250235r250236
10231023      edgeptr->dxdy = (edgeptr->v2->x - edgeptr->v1->x) * ooy;
10241024      for (int paramnum = 0; paramnum < paramcount; paramnum++)
10251025         edgeptr->dpdy[paramnum] = (edgeptr->v2->p[paramnum] - edgeptr->v1->p[paramnum]) * ooy;
1026      edgeptr++;
1026      ++edgeptr;
10271027   }
10281028
10291029   // determine which list is left/right:
r250235r250236
10681068         // compute the ending X based on which part of the triangle we're in
10691069         _BaseType fully = _BaseType(curscan + extnum) + _BaseType(0.5);
10701070         while (fully > ledge->v2->y && fully < v[maxv].y)
1071            ledge++;
1071            ++ledge;
10721072         while (fully > redge->v2->y && fully < v[maxv].y)
1073            redge++;
1073            ++redge;
10741074         _BaseType startx = ledge->v1->x + (fully - ledge->v1->y) * ledge->dxdy;
10751075         _BaseType stopx = redge->v1->x + (fully - redge->v1->y) * redge->dxdy;
10761076
r250235r250236
11591159         nextout->y = v1.y + frac * (v2.y - v1.y);
11601160         for (int paramnum = 0; paramnum < paramcount; paramnum++)
11611161            nextout->p[paramnum] = v1.p[paramnum] + frac * (v2.p[paramnum] - v1.p[paramnum]);
1162         nextout++;
1162         ++nextout;
11631163      }
11641164
11651165      // if this vertex is not clipped, copy it in
trunk/src/emu/debug/debugcmd.cpp
r250235r250236
14841484   /* loop over all CPUs */
14851485   device_iterator iter(machine.root_device());
14861486   for (device_t *device = iter.first(); device != NULL; device = iter.next())
1487      for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
1487      for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum)
14881488         if (device->debug()->watchpoint_first(spacenum) != NULL)
14891489         {
14901490            static const char *const types[] = { "unkn ", "read ", "write", "r/w  " };
trunk/src/emu/debug/debugcpu.cpp
r250235r250236
23772377bool device_debug::watchpoint_clear(int index)
23782378{
23792379   // scan the list to see if we own this breakpoint
2380   for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); spacenum++)
2380   for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); ++spacenum)
23812381      for (watchpoint **wp = &m_wplist[spacenum]; *wp != NULL; wp = &(*wp)->m_next)
23822382         if ((*wp)->m_index == index)
23832383         {
r250235r250236
24012401void device_debug::watchpoint_clear_all()
24022402{
24032403   // clear the head until we run out
2404   for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); spacenum++)
2404   for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); ++spacenum)
24052405      while (m_wplist[spacenum] != NULL)
24062406         watchpoint_clear(m_wplist[spacenum]->index());
24072407}
r250235r250236
24152415bool device_debug::watchpoint_enable(int index, bool enable)
24162416{
24172417   // scan the list to see if we own this watchpoint
2418   for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); spacenum++)
2418   for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); ++spacenum)
24192419      for (watchpoint *wp = m_wplist[spacenum]; wp != NULL; wp = wp->next())
24202420         if (wp->m_index == index)
24212421         {
r250235r250236
24372437void device_debug::watchpoint_enable_all(bool enable)
24382438{
24392439   // apply the enable to all watchpoints we own
2440   for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); spacenum++)
2440   for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_wplist); ++spacenum)
24412441      for (watchpoint *wp = m_wplist[spacenum]; wp != NULL; wp = wp->next())
24422442         watchpoint_enable(wp->index(), enable);
24432443}
trunk/src/emu/debug/dvmemory.cpp
r250235r250236
133133   memory_interface_iterator iter(machine().root_device());
134134   for (device_memory_interface *memintf = iter.first(); memintf != NULL; memintf = iter.next())
135135      if (&memintf->device() != &machine().root_device())
136         for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
136         for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum)
137137            if (memintf->has_space(spacenum))
138138            {
139139               address_space &space = memintf->space(spacenum);
trunk/src/emu/debug/dvwpoints.cpp
r250235r250236
231231   {
232232      // Collect
233233      device_debug &debugInterface = *source->device()->debug();
234      for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
234      for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum)
235235      {
236236         for (device_debug::watchpoint *wp = debugInterface.watchpoint_first(spacenum); wp != NULL; wp = wp->next())
237237            m_buffer.push_back(wp);
trunk/src/emu/dimemory.cpp
r250235r250236
241241   bool detected_overlap = DETECT_OVERLAPPING_MEMORY ? false : true;
242242
243243   // loop over all address spaces
244   for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
244   for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum)
245245   {
246246      const address_space_config *spaceconfig = space_config(spacenum);
247247      if (spaceconfig != NULL)
trunk/src/emu/input.cpp
r250235r250236
834834   // if we have a generic ID, pick a new internal one
835835   input_item_id originalid = itemid;
836836   if (itemid >= ITEM_ID_OTHER_SWITCH && itemid <= ITEM_ID_OTHER_AXIS_RELATIVE)
837      for (itemid = (input_item_id)(ITEM_ID_MAXIMUM + 1); itemid <= ITEM_ID_ABSOLUTE_MAXIMUM; itemid++)
837      for (itemid = (input_item_id)(ITEM_ID_MAXIMUM + 1); itemid <= ITEM_ID_ABSOLUTE_MAXIMUM; ++itemid)
838838         if (m_item[itemid] == NULL)
839839            break;
840840   assert(itemid <= ITEM_ID_ABSOLUTE_MAXIMUM);
r250235r250236
920920
921921   // update the state of all the keys and see if any changed state
922922   bool anything_changed = false;
923   for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= m_maxitem; itemid++)
923   for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= m_maxitem; ++itemid)
924924   {
925925      input_device_item *item = m_item[itemid];
926926      if (item != NULL && item->itemclass() == ITEM_CLASS_SWITCH)
r250235r250236
930930
931931   // if the keyboard state is stable, flush the current state
932932   if (!anything_changed)
933      for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= m_maxitem; itemid++)
933      for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= m_maxitem; ++itemid)
934934      {
935935         input_device_item *item = m_item[itemid];
936936         if (item != NULL && item->itemclass() == ITEM_CLASS_SWITCH)
r250235r250236
11831183   reset_memory();
11841184
11851185   // iterate over device classes and devices
1186   for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; devclass++)
1186   for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; ++devclass)
11871187      for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++)
11881188      {
11891189         // fetch the device; ignore if NULL
r250235r250236
11921192            continue;
11931193
11941194         // iterate over items within each device
1195         for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); itemid++)
1195         for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); ++itemid)
11961196         {
11971197            // for any non-switch items, set memory equal to the current value
11981198            input_device_item *item = device->item(itemid);
r250235r250236
12101210input_code input_manager::poll_switches()
12111211{
12121212   // iterate over device classes and devices
1213   for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; devclass++)
1213   for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; ++devclass)
12141214      for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++)
12151215      {
12161216         // fetch the device; ignore if NULL
r250235r250236
12191219            continue;
12201220
12211221         // iterate over items within each device
1222         for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); itemid++)
1222         for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); ++itemid)
12231223         {
12241224            input_device_item *item = device->item(itemid);
12251225            if (item != NULL)
r250235r250236
12991299         continue;
13001300
13011301      // iterate over items within each device
1302      for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); itemid++)
1302      for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); ++itemid)
13031303      {
13041304         input_device_item *item = device->item(itemid);
13051305         if (item != NULL && item->itemclass() == ITEM_CLASS_SWITCH)
r250235r250236
13641364input_code input_manager::poll_axes()
13651365{
13661366   // iterate over device classes and devices
1367   for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; devclass++)
1367   for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; ++devclass)
13681368      for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++)
13691369      {
13701370         // fetch the device; ignore if NULL
r250235r250236
13731373            continue;
13741374
13751375         // iterate over items within each device
1376         for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); itemid++)
1376         for (input_item_id itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); ++itemid)
13771377         {
13781378            input_device_item *item = device->item(itemid);
13791379            if (item != NULL && item->itemclass() != ITEM_CLASS_SWITCH)
r250235r250236
14451445input_code input_manager::code_from_itemid(input_item_id itemid) const
14461446{
14471447   // iterate over device classes and devices
1448   for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; devclass++)
1448   for (input_device_class devclass = DEVICE_CLASS_FIRST_VALID; devclass <= DEVICE_CLASS_LAST_VALID; ++devclass)
14491449      for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++)
14501450      {
14511451         input_device *device = m_class[devclass]->device(devnum);
r250235r250236
16131613         return INPUT_CODE_INVALID;
16141614
16151615      // if not a standard code, look it up in the device specific codes
1616      for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); itemid++)
1616      for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem(); ++itemid)
16171617      {
16181618         input_device_item *item = device->item(itemid);
16191619         if (item != NULL && token[curtok].compare(item->token()) == 0)
trunk/src/emu/ioport.cpp
r250235r250236
712712
713713void input_type_entry::restore_default_seq()
714714{
715   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
715   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
716716      m_seq[seqtype] = defseq(seqtype);
717717}
718718
r250235r250236
763763
764764   // read all the associated ports
765765   running_machine *machine = NULL;
766   for (direction_t direction = JOYDIR_UP; direction < JOYDIR_COUNT; direction++)
766   for (direction_t direction = JOYDIR_UP; direction < JOYDIR_COUNT; ++direction)
767767      for (const simple_list_wrapper<ioport_field> *i = m_field[direction].first(); i != NULL; i = i->next())
768768      {
769769         machine = &i->object()->machine();
r250235r250236
14771477      m_way(0)
14781478{
14791479   // reset sequences and chars
1480   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
1480   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
14811481      m_seq[seqtype].set_default();
14821482   m_chars[0] = m_chars[1] = m_chars[2] = m_chars[3] = unicode_char(0);
14831483
r250235r250236
16791679   memset(&settings, 0, sizeof(settings));
16801680
16811681   // copy the basics
1682   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
1682   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
16831683      settings.seq[seqtype] = seq(seqtype);
16841684
16851685   // if there's a list of settings or we're an adjuster, copy the current value
r250235r250236
17111711void ioport_field::set_user_settings(const user_settings &settings)
17121712{
17131713   // copy the basics
1714   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
1714   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
17151715   {
17161716      const input_seq &defseq = manager().type_seq(m_type, m_player, input_seq_type(seqtype));
17171717      if (defseq == settings.seq[seqtype])
r250235r250236
21592159      joydir(digital_joystick::JOYDIR_COUNT)
21602160{
21612161   // fill in the basic values
2162   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
2162   for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
21632163      seq[seqtype] = field.defseq_unresolved(seqtype);
21642164
21652165   // if this is a digital joystick field, make a note of it
r250235r250236
29842984
29852985      // initialize sequences to invalid defaults
29862986      input_seq newseq[SEQ_TYPE_TOTAL];
2987      for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
2987      for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
29882988         newseq[seqtype].set(INPUT_CODE_INVALID);
29892989
29902990      // loop over new sequences
r250235r250236
30123012   // what we will diff against
30133013   if (config_type == CONFIG_TYPE_CONTROLLER)
30143014      for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
3015         for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3015         for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
30163016            entry->defseq(seqtype) = entry->seq(seqtype);
30173017}
30183018
r250235r250236
30533053      // loop over the remapping table, then over default ports, replacing old with new
30543054      for (int remapnum = 0; remapnum < count; remapnum++)
30553055         for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
3056            for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3056            for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
30573057               entry->m_seq[seqtype].replace(oldtable[remapnum], newtable[remapnum]);
30583058   }
30593059}
r250235r250236
30703070   for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next())
30713071      if (entry->type() == type && entry->player() == player)
30723072      {
3073         for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3073         for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
30743074            if (newseq[seqtype][0] != INPUT_CODE_INVALID)
30753075               entry->m_seq[seqtype] = newseq[seqtype];
30763076         return true;
r250235r250236
31023102               field->mask() == mask && (field->defvalue() & mask) == (defvalue & mask))
31033103            {
31043104               // if a sequence was specified, copy it in
3105               for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3105               for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
31063106                  if (newseq[seqtype][0] != INPUT_CODE_INVALID)
31073107                     field->live().seq[seqtype] = newseq[seqtype];
31083108
r250235r250236
32213221      {
32223222         // see if any of the sequences have changed
32233223         input_seq_type seqtype;
3224         for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3224         for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
32253225            if (entry->seq(seqtype) != entry->defseq(seqtype))
32263226               break;
32273227
r250235r250236
32373237               xml_set_attribute(portnode, "type", input_type_to_token(tempstr, entry->type(), entry->player()));
32383238
32393239               // add only the sequences that have changed from the defaults
3240               for (input_seq_type type = SEQ_TYPE_STANDARD; type < SEQ_TYPE_TOTAL; type++)
3240               for (input_seq_type type = SEQ_TYPE_STANDARD; type < SEQ_TYPE_TOTAL; ++type)
32413241                  if (entry->seq(type) != entry->defseq(type))
32423242                     save_sequence(portnode, type, entry->type(), entry->seq(type));
32433243            }
r250235r250236
32613261         {
32623262            // determine if we changed
32633263            bool changed = false;
3264            for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3264            for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
32653265               changed |= (field->seq(seqtype) != field->defseq(seqtype));
32663266
32673267            // non-analog changes
r250235r250236
32953295                  xml_set_attribute_int(portnode, "defvalue", field->defvalue() & field->mask());
32963296
32973297                  // add sequences if changed
3298                  for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
3298                  for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
32993299                     if (field->seq(seqtype) != field->defseq(seqtype))
33003300                        save_sequence(portnode, seqtype, field->type(), field->seq(seqtype));
33013301
trunk/src/emu/luaengine.cpp
r250235r250236
428428   lua_State *L = luaThis->m_lua_state;
429429   luabridge::LuaRef sp_table = luabridge::LuaRef::newTable(L);
430430
431   for (address_spacenum sp = AS_0; sp < ADDRESS_SPACES; sp++) {
431   for (address_spacenum sp = AS_0; sp < ADDRESS_SPACES; ++sp) {
432432      if (dev->memory().has_space(sp)) {
433433         sp_table[dev->memory().space(sp).name()] = &(dev->memory().space(sp));
434434      }
trunk/src/emu/memory.cpp
r250235r250236
484484
485485   // forward delegate callbacks configuration
486486   template<typename _delegate> void set_delegate(_delegate delegate) const {
487      for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); i++)
487      for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); ++i)
488488         (*i)->set_delegate(delegate, mask);
489489   }
490490
491491   // forward I/O port access configuration
492492   void set_ioport(ioport_port &ioport) const {
493      for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); i++)
493      for (typename std::list<_HandlerEntry *>::const_iterator i = handlers.begin(); i != handlers.end(); ++i)
494494         (*i)->set_ioport(ioport);
495495   }
496496
r250235r250236
661661      std::list<UINT32> entries;
662662      setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries);
663663      std::list<handler_entry_read *> handlers;
664      for (std::list<UINT32>::const_iterator i = entries.begin(); i != entries.end(); i++)
664      for (std::list<UINT32>::const_iterator i = entries.begin(); i != entries.end(); ++i)
665665         handlers.push_back(&handler_read(*i));
666666      return handler_entry_proxy<handler_entry_read>(handlers, mask);
667667   }
r250235r250236
734734      std::list<UINT32> entries;
735735      setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries);
736736      std::list<handler_entry_write *> handlers;
737      for (std::list<UINT32>::const_iterator i = entries.begin(); i != entries.end(); i++)
737      for (std::list<UINT32>::const_iterator i = entries.begin(); i != entries.end(); ++i)
738738         handlers.push_back(&handler_write(*i));
739739      return handler_entry_proxy<handler_entry_write>(handlers, mask);
740740   }
r250235r250236
812812      std::list<UINT32> entries;
813813      setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries);
814814      std::list<handler_entry_setoffset *> handlers;
815      for (std::list<UINT32>::const_iterator i = entries.begin(); i != entries.end(); i++)
815      for (std::list<UINT32>::const_iterator i = entries.begin(); i != entries.end(); ++i)
816816         handlers.push_back(&handler_setoffset(*i));
817817      return handler_entry_proxy<handler_entry_setoffset>(handlers, mask);
818818   }
r250235r250236
15241524   // loop over devices and spaces within each device
15251525   memory_interface_iterator iter(machine().root_device());
15261526   for (device_memory_interface *memory = iter.first(); memory != NULL; memory = iter.next())
1527      for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
1527      for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum)
15281528      {
15291529         // if there is a configuration for this space, we need an address space
15301530         const address_space_config *spaceconfig = memory->space_config(spacenum);
r250235r250236
19111911   {
19121912      // find the entry before the last one we processed
19131913      const address_map_entry *entry;
1914      for (entry = map->m_entrylist.first(); entry->next() != last_entry; entry = entry->next()) ;
1914      for (entry = map->m_entrylist.first(); entry->next() != last_entry; entry = entry->next()) { };
19151915      last_entry = entry;
19161916
19171917      // map both read and write halves
r250235r250236
28692869      curentry.configure(bytestart, byteend, bytemask);
28702870
28712871      // Populate it wherever needed
2872      for (std::list<subrange>::const_iterator i = range_override.begin(); i != range_override.end(); i++)
2872      for (std::list<subrange>::const_iterator i = range_override.begin(); i != range_override.end(); ++i)
28732873         populate_range(i->start, i->end, entry);
28742874
28752875      // Add it in the "to be setup" list
r250235r250236
28822882   // Ranges in range_partial must duplicated then partially changed
28832883   if (!range_partial.empty())
28842884   {
2885      for (std::map<UINT16, std::list<subrange> >::const_iterator i = range_partial.begin(); i != range_partial.end(); i++)
2885      for (std::map<UINT16, std::list<subrange> >::const_iterator i = range_partial.begin(); i != range_partial.end(); ++i)
28862886      {
28872887         // Theorically, if the handler to change matches the
28882888         // characteristics of ours, we can directly change it.  In
r250235r250236
29122912         curentry.configure(bytestart, byteend, bytemask);
29132913
29142914         // Populate it wherever needed
2915         for (std::list<subrange>::const_iterator j = i->second.begin(); j != i->second.end(); j++)
2915         for (std::list<subrange>::const_iterator j = i->second.begin(); j != i->second.end(); ++j)
29162916            populate_range(j->start, j->end, entry);
29172917
29182918         // Add it in the "to be setup" list
trunk/src/emu/profiler.cpp
r250235r250236
175175   // compute the total time for all bits, not including profiler or idle
176176   UINT64 computed = 0;
177177   profile_type curtype;
178   for (curtype = PROFILER_DEVICE_FIRST; curtype < PROFILER_PROFILER; curtype++)
178   for (curtype = PROFILER_DEVICE_FIRST; curtype < PROFILER_PROFILER; ++curtype)
179179      computed += m_data[curtype];
180180
181181   // save that result in normalize, and continue adding the rest
182182   UINT64 normalize = computed;
183   for ( ; curtype < PROFILER_TOTAL; curtype++)
183   for ( ; curtype < PROFILER_TOTAL; ++curtype)
184184      computed += m_data[curtype];
185185
186186   // this becomes the total; if we end up with 0 for anything, we were just started, so return empty
r250235r250236
193193
194194   // loop over all types and generate the string
195195   device_iterator iter(machine.root_device());
196   for (curtype = PROFILER_DEVICE_FIRST; curtype < PROFILER_TOTAL; curtype++)
196   for (curtype = PROFILER_DEVICE_FIRST; curtype < PROFILER_TOTAL; ++curtype)
197197   {
198198      // determine the accumulated time for this type
199199      computed = m_data[curtype];
trunk/src/emu/render.cpp
r250235r250236
12041204      throw emu_fatalerror("Mandatory artwork is missing");
12051205
12061206   // scan the current view for all screens
1207   for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++)
1207   for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; ++layer)
12081208
12091209      // iterate over items in the layer
12101210      for (layout_view::item *curitem = m_curview->first_item(layer); curitem != NULL; curitem = curitem->next())
r250235r250236
12871287
12881288   // iterate over layers back-to-front, but only if we're running
12891289   if (m_manager.machine().phase() >= MACHINE_PHASE_RESET)
1290      for (item_layer layernum = ITEM_LAYER_FIRST; layernum < ITEM_LAYER_MAX; layernum++)
1290      for (item_layer layernum = ITEM_LAYER_FIRST; layernum < ITEM_LAYER_MAX; ++layernum)
12911291      {
12921292         int blendmode;
12931293         item_layer layer = get_layer_and_blendmode(*m_curview, layernum, blendmode);
r250235r250236
19161916   }
19171917
19181918   // loop through each layer
1919   for (item_layer layernum = ITEM_LAYER_FIRST; layernum < ITEM_LAYER_MAX; layernum++)
1919   for (item_layer layernum = ITEM_LAYER_FIRST; layernum < ITEM_LAYER_MAX; ++layernum)
19201920   {
19211921      int blendmode;
19221922      item_layer layer = get_layer_and_blendmode(*m_curview, layernum, blendmode);
trunk/src/emu/rendlay.cpp
r250235r250236
22162216   // loop over all layers
22172217   bool first = true;
22182218   bool scrfirst = true;
2219   for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++)
2219   for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; ++layer)
22202220   {
22212221      // determine if this layer should be visible
22222222      switch (layer)
r250235r250236
22912291   float yscale = (target_bounds.y1 - target_bounds.y0) / (m_bounds.y1 - m_bounds.y0);
22922292
22932293   // normalize all the item bounds
2294   for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++)
2294   for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; ++layer)
22952295      for (item *curitem = first_item(layer); curitem != NULL; curitem = curitem->next())
22962296      {
22972297         curitem->m_bounds.x0 = target_bounds.x0 + (curitem->m_rawbounds.x0 - xoffs) * xscale;
r250235r250236
23082308
23092309void layout_view::resolve_tags()
23102310{
2311   for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++)
2311   for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; ++layer)
23122312   {
23132313      for (item *curitem = first_item(layer); curitem != NULL; curitem = curitem->next())
23142314      {
trunk/src/emu/tilemap.cpp
r250235r250236
13551355               // advance in X
13561356               cx += incxx;
13571357               x++;
1358               dest++;
1358               ++dest;
13591359               pri++;
13601360            }
13611361         }
r250235r250236
13951395            cx += incxx;
13961396            cy += incxy;
13971397            x++;
1398            dest++;
1398            ++dest;
13991399            pri++;
14001400         }
14011401
r250235r250236
14361436            cx += incxx;
14371437            cy += incxy;
14381438            x++;
1439            dest++;
1439            ++dest;
14401440            pri++;
14411441         }
14421442
trunk/src/emu/ui/inputmap.cpp
r250235r250236
109109
110110         /* loop over all sequence types */
111111         sortorder++;
112         for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
112         for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
113113         {
114114            /* build an entry for the standard sequence */
115115            input_item_data *item = (input_item_data *)m_pool_alloc(sizeof(*item));
r250235r250236
187187               sortorder = field->type() | 0xf000;
188188
189189            /* loop over all sequence types */
190            for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++)
190            for (seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype)
191191            {
192192               /* build an entry for the standard sequence */
193193               input_item_data *item = (input_item_data *)m_pool_alloc(sizeof(*item));
trunk/src/emu/ui/ui.cpp
r250235r250236
17131713   }
17141714
17151715   // check for A-Z or 0-9
1716   for (input_item_id id = ITEM_ID_A; id <= ITEM_ID_Z; id++)
1716   for (input_item_id id = ITEM_ID_A; id <= ITEM_ID_Z; ++id)
17171717      if (machine.input().code_pressed_once(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id)))
17181718         file = id - ITEM_ID_A + 'a';
17191719   if (file == 0)
1720      for (input_item_id id = ITEM_ID_0; id <= ITEM_ID_9; id++)
1720      for (input_item_id id = ITEM_ID_0; id <= ITEM_ID_9; ++id)
17211721         if (machine.input().code_pressed_once(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id)))
17221722            file = id - ITEM_ID_0 + '0';
17231723   if (file == 0)
1724      for (input_item_id id = ITEM_ID_0_PAD; id <= ITEM_ID_9_PAD; id++)
1724      for (input_item_id id = ITEM_ID_0_PAD; id <= ITEM_ID_9_PAD; ++id)
17251725         if (machine.input().code_pressed_once(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id)))
17261726            file = id - ITEM_ID_0_PAD + '0';
17271727   if (file == 0)
trunk/src/emu/uiinput.cpp
r250235r250236
9797   ui_input_private *uidata = machine.ui_input_data;
9898
9999   /* update the state of all the UI keys */
100   for (ioport_type code = ioport_type(IPT_UI_FIRST + 1); code < IPT_UI_LAST; code++)
100   for (ioport_type code = ioport_type(IPT_UI_FIRST + 1); code < IPT_UI_LAST; ++code)
101101   {
102102      bool pressed = machine.ioport().type_pressed(code);
103103      if (!pressed || uidata->seqpressed[code] != SEQ_PRESSED_RESET)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team