trunk/src/devices/video/poly.h
| r250235 | r250236 | |
| 1002 | 1002 | edgeptr->dxdy = (edgeptr->v2->x - edgeptr->v1->x) * ooy; |
| 1003 | 1003 | for (int paramnum = 0; paramnum < paramcount; paramnum++) |
| 1004 | 1004 | edgeptr->dpdy[paramnum] = (edgeptr->v2->p[paramnum] - edgeptr->v1->p[paramnum]) * ooy; |
| 1005 | | edgeptr++; |
| 1005 | ++edgeptr; |
| 1006 | 1006 | } |
| 1007 | 1007 | |
| 1008 | 1008 | // walk backward to build up the backward edge list |
| r250235 | r250236 | |
| 1023 | 1023 | edgeptr->dxdy = (edgeptr->v2->x - edgeptr->v1->x) * ooy; |
| 1024 | 1024 | for (int paramnum = 0; paramnum < paramcount; paramnum++) |
| 1025 | 1025 | edgeptr->dpdy[paramnum] = (edgeptr->v2->p[paramnum] - edgeptr->v1->p[paramnum]) * ooy; |
| 1026 | | edgeptr++; |
| 1026 | ++edgeptr; |
| 1027 | 1027 | } |
| 1028 | 1028 | |
| 1029 | 1029 | // determine which list is left/right: |
| r250235 | r250236 | |
| 1068 | 1068 | // compute the ending X based on which part of the triangle we're in |
| 1069 | 1069 | _BaseType fully = _BaseType(curscan + extnum) + _BaseType(0.5); |
| 1070 | 1070 | while (fully > ledge->v2->y && fully < v[maxv].y) |
| 1071 | | ledge++; |
| 1071 | ++ledge; |
| 1072 | 1072 | while (fully > redge->v2->y && fully < v[maxv].y) |
| 1073 | | redge++; |
| 1073 | ++redge; |
| 1074 | 1074 | _BaseType startx = ledge->v1->x + (fully - ledge->v1->y) * ledge->dxdy; |
| 1075 | 1075 | _BaseType stopx = redge->v1->x + (fully - redge->v1->y) * redge->dxdy; |
| 1076 | 1076 | |
| r250235 | r250236 | |
| 1159 | 1159 | nextout->y = v1.y + frac * (v2.y - v1.y); |
| 1160 | 1160 | for (int paramnum = 0; paramnum < paramcount; paramnum++) |
| 1161 | 1161 | nextout->p[paramnum] = v1.p[paramnum] + frac * (v2.p[paramnum] - v1.p[paramnum]); |
| 1162 | | nextout++; |
| 1162 | ++nextout; |
| 1163 | 1163 | } |
| 1164 | 1164 | |
| 1165 | 1165 | // if this vertex is not clipped, copy it in |
trunk/src/emu/debug/debugcpu.cpp
| r250235 | r250236 | |
| 2377 | 2377 | bool device_debug::watchpoint_clear(int index) |
| 2378 | 2378 | { |
| 2379 | 2379 | // 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) |
| 2381 | 2381 | for (watchpoint **wp = &m_wplist[spacenum]; *wp != NULL; wp = &(*wp)->m_next) |
| 2382 | 2382 | if ((*wp)->m_index == index) |
| 2383 | 2383 | { |
| r250235 | r250236 | |
| 2401 | 2401 | void device_debug::watchpoint_clear_all() |
| 2402 | 2402 | { |
| 2403 | 2403 | // 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) |
| 2405 | 2405 | while (m_wplist[spacenum] != NULL) |
| 2406 | 2406 | watchpoint_clear(m_wplist[spacenum]->index()); |
| 2407 | 2407 | } |
| r250235 | r250236 | |
| 2415 | 2415 | bool device_debug::watchpoint_enable(int index, bool enable) |
| 2416 | 2416 | { |
| 2417 | 2417 | // 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) |
| 2419 | 2419 | for (watchpoint *wp = m_wplist[spacenum]; wp != NULL; wp = wp->next()) |
| 2420 | 2420 | if (wp->m_index == index) |
| 2421 | 2421 | { |
| r250235 | r250236 | |
| 2437 | 2437 | void device_debug::watchpoint_enable_all(bool enable) |
| 2438 | 2438 | { |
| 2439 | 2439 | // 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) |
| 2441 | 2441 | for (watchpoint *wp = m_wplist[spacenum]; wp != NULL; wp = wp->next()) |
| 2442 | 2442 | watchpoint_enable(wp->index(), enable); |
| 2443 | 2443 | } |
trunk/src/emu/input.cpp
| r250235 | r250236 | |
| 834 | 834 | // if we have a generic ID, pick a new internal one |
| 835 | 835 | input_item_id originalid = itemid; |
| 836 | 836 | 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) |
| 838 | 838 | if (m_item[itemid] == NULL) |
| 839 | 839 | break; |
| 840 | 840 | assert(itemid <= ITEM_ID_ABSOLUTE_MAXIMUM); |
| r250235 | r250236 | |
| 920 | 920 | |
| 921 | 921 | // update the state of all the keys and see if any changed state |
| 922 | 922 | 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) |
| 924 | 924 | { |
| 925 | 925 | input_device_item *item = m_item[itemid]; |
| 926 | 926 | if (item != NULL && item->itemclass() == ITEM_CLASS_SWITCH) |
| r250235 | r250236 | |
| 930 | 930 | |
| 931 | 931 | // if the keyboard state is stable, flush the current state |
| 932 | 932 | 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) |
| 934 | 934 | { |
| 935 | 935 | input_device_item *item = m_item[itemid]; |
| 936 | 936 | if (item != NULL && item->itemclass() == ITEM_CLASS_SWITCH) |
| r250235 | r250236 | |
| 1183 | 1183 | reset_memory(); |
| 1184 | 1184 | |
| 1185 | 1185 | // 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) |
| 1187 | 1187 | for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++) |
| 1188 | 1188 | { |
| 1189 | 1189 | // fetch the device; ignore if NULL |
| r250235 | r250236 | |
| 1192 | 1192 | continue; |
| 1193 | 1193 | |
| 1194 | 1194 | // 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) |
| 1196 | 1196 | { |
| 1197 | 1197 | // for any non-switch items, set memory equal to the current value |
| 1198 | 1198 | input_device_item *item = device->item(itemid); |
| r250235 | r250236 | |
| 1210 | 1210 | input_code input_manager::poll_switches() |
| 1211 | 1211 | { |
| 1212 | 1212 | // 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) |
| 1214 | 1214 | for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++) |
| 1215 | 1215 | { |
| 1216 | 1216 | // fetch the device; ignore if NULL |
| r250235 | r250236 | |
| 1219 | 1219 | continue; |
| 1220 | 1220 | |
| 1221 | 1221 | // 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) |
| 1223 | 1223 | { |
| 1224 | 1224 | input_device_item *item = device->item(itemid); |
| 1225 | 1225 | if (item != NULL) |
| r250235 | r250236 | |
| 1299 | 1299 | continue; |
| 1300 | 1300 | |
| 1301 | 1301 | // 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) |
| 1303 | 1303 | { |
| 1304 | 1304 | input_device_item *item = device->item(itemid); |
| 1305 | 1305 | if (item != NULL && item->itemclass() == ITEM_CLASS_SWITCH) |
| r250235 | r250236 | |
| 1364 | 1364 | input_code input_manager::poll_axes() |
| 1365 | 1365 | { |
| 1366 | 1366 | // 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) |
| 1368 | 1368 | for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++) |
| 1369 | 1369 | { |
| 1370 | 1370 | // fetch the device; ignore if NULL |
| r250235 | r250236 | |
| 1373 | 1373 | continue; |
| 1374 | 1374 | |
| 1375 | 1375 | // 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) |
| 1377 | 1377 | { |
| 1378 | 1378 | input_device_item *item = device->item(itemid); |
| 1379 | 1379 | if (item != NULL && item->itemclass() != ITEM_CLASS_SWITCH) |
| r250235 | r250236 | |
| 1445 | 1445 | input_code input_manager::code_from_itemid(input_item_id itemid) const |
| 1446 | 1446 | { |
| 1447 | 1447 | // 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) |
| 1449 | 1449 | for (int devnum = 0; devnum <= m_class[devclass]->maxindex(); devnum++) |
| 1450 | 1450 | { |
| 1451 | 1451 | input_device *device = m_class[devclass]->device(devnum); |
| r250235 | r250236 | |
| 1613 | 1613 | return INPUT_CODE_INVALID; |
| 1614 | 1614 | |
| 1615 | 1615 | // 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) |
| 1617 | 1617 | { |
| 1618 | 1618 | input_device_item *item = device->item(itemid); |
| 1619 | 1619 | if (item != NULL && token[curtok].compare(item->token()) == 0) |
trunk/src/emu/ioport.cpp
| r250235 | r250236 | |
| 712 | 712 | |
| 713 | 713 | void input_type_entry::restore_default_seq() |
| 714 | 714 | { |
| 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) |
| 716 | 716 | m_seq[seqtype] = defseq(seqtype); |
| 717 | 717 | } |
| 718 | 718 | |
| r250235 | r250236 | |
| 763 | 763 | |
| 764 | 764 | // read all the associated ports |
| 765 | 765 | 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) |
| 767 | 767 | for (const simple_list_wrapper<ioport_field> *i = m_field[direction].first(); i != NULL; i = i->next()) |
| 768 | 768 | { |
| 769 | 769 | machine = &i->object()->machine(); |
| r250235 | r250236 | |
| 1477 | 1477 | m_way(0) |
| 1478 | 1478 | { |
| 1479 | 1479 | // 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) |
| 1481 | 1481 | m_seq[seqtype].set_default(); |
| 1482 | 1482 | m_chars[0] = m_chars[1] = m_chars[2] = m_chars[3] = unicode_char(0); |
| 1483 | 1483 | |
| r250235 | r250236 | |
| 1679 | 1679 | memset(&settings, 0, sizeof(settings)); |
| 1680 | 1680 | |
| 1681 | 1681 | // 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) |
| 1683 | 1683 | settings.seq[seqtype] = seq(seqtype); |
| 1684 | 1684 | |
| 1685 | 1685 | // if there's a list of settings or we're an adjuster, copy the current value |
| r250235 | r250236 | |
| 1711 | 1711 | void ioport_field::set_user_settings(const user_settings &settings) |
| 1712 | 1712 | { |
| 1713 | 1713 | // 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) |
| 1715 | 1715 | { |
| 1716 | 1716 | const input_seq &defseq = manager().type_seq(m_type, m_player, input_seq_type(seqtype)); |
| 1717 | 1717 | if (defseq == settings.seq[seqtype]) |
| r250235 | r250236 | |
| 2159 | 2159 | joydir(digital_joystick::JOYDIR_COUNT) |
| 2160 | 2160 | { |
| 2161 | 2161 | // 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) |
| 2163 | 2163 | seq[seqtype] = field.defseq_unresolved(seqtype); |
| 2164 | 2164 | |
| 2165 | 2165 | // if this is a digital joystick field, make a note of it |
| r250235 | r250236 | |
| 2984 | 2984 | |
| 2985 | 2985 | // initialize sequences to invalid defaults |
| 2986 | 2986 | 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) |
| 2988 | 2988 | newseq[seqtype].set(INPUT_CODE_INVALID); |
| 2989 | 2989 | |
| 2990 | 2990 | // loop over new sequences |
| r250235 | r250236 | |
| 3012 | 3012 | // what we will diff against |
| 3013 | 3013 | if (config_type == CONFIG_TYPE_CONTROLLER) |
| 3014 | 3014 | 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) |
| 3016 | 3016 | entry->defseq(seqtype) = entry->seq(seqtype); |
| 3017 | 3017 | } |
| 3018 | 3018 | |
| r250235 | r250236 | |
| 3053 | 3053 | // loop over the remapping table, then over default ports, replacing old with new |
| 3054 | 3054 | for (int remapnum = 0; remapnum < count; remapnum++) |
| 3055 | 3055 | 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) |
| 3057 | 3057 | entry->m_seq[seqtype].replace(oldtable[remapnum], newtable[remapnum]); |
| 3058 | 3058 | } |
| 3059 | 3059 | } |
| r250235 | r250236 | |
| 3070 | 3070 | for (input_type_entry *entry = m_typelist.first(); entry != NULL; entry = entry->next()) |
| 3071 | 3071 | if (entry->type() == type && entry->player() == player) |
| 3072 | 3072 | { |
| 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) |
| 3074 | 3074 | if (newseq[seqtype][0] != INPUT_CODE_INVALID) |
| 3075 | 3075 | entry->m_seq[seqtype] = newseq[seqtype]; |
| 3076 | 3076 | return true; |
| r250235 | r250236 | |
| 3102 | 3102 | field->mask() == mask && (field->defvalue() & mask) == (defvalue & mask)) |
| 3103 | 3103 | { |
| 3104 | 3104 | // 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) |
| 3106 | 3106 | if (newseq[seqtype][0] != INPUT_CODE_INVALID) |
| 3107 | 3107 | field->live().seq[seqtype] = newseq[seqtype]; |
| 3108 | 3108 | |
| r250235 | r250236 | |
| 3221 | 3221 | { |
| 3222 | 3222 | // see if any of the sequences have changed |
| 3223 | 3223 | 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) |
| 3225 | 3225 | if (entry->seq(seqtype) != entry->defseq(seqtype)) |
| 3226 | 3226 | break; |
| 3227 | 3227 | |
| r250235 | r250236 | |
| 3237 | 3237 | xml_set_attribute(portnode, "type", input_type_to_token(tempstr, entry->type(), entry->player())); |
| 3238 | 3238 | |
| 3239 | 3239 | // 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) |
| 3241 | 3241 | if (entry->seq(type) != entry->defseq(type)) |
| 3242 | 3242 | save_sequence(portnode, type, entry->type(), entry->seq(type)); |
| 3243 | 3243 | } |
| r250235 | r250236 | |
| 3261 | 3261 | { |
| 3262 | 3262 | // determine if we changed |
| 3263 | 3263 | 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) |
| 3265 | 3265 | changed |= (field->seq(seqtype) != field->defseq(seqtype)); |
| 3266 | 3266 | |
| 3267 | 3267 | // non-analog changes |
| r250235 | r250236 | |
| 3295 | 3295 | xml_set_attribute_int(portnode, "defvalue", field->defvalue() & field->mask()); |
| 3296 | 3296 | |
| 3297 | 3297 | // 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) |
| 3299 | 3299 | if (field->seq(seqtype) != field->defseq(seqtype)) |
| 3300 | 3300 | save_sequence(portnode, seqtype, field->type(), field->seq(seqtype)); |
| 3301 | 3301 | |
trunk/src/emu/memory.cpp
| r250235 | r250236 | |
| 484 | 484 | |
| 485 | 485 | // forward delegate callbacks configuration |
| 486 | 486 | 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) |
| 488 | 488 | (*i)->set_delegate(delegate, mask); |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | // forward I/O port access configuration |
| 492 | 492 | 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) |
| 494 | 494 | (*i)->set_ioport(ioport); |
| 495 | 495 | } |
| 496 | 496 | |
| r250235 | r250236 | |
| 661 | 661 | std::list<UINT32> entries; |
| 662 | 662 | setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries); |
| 663 | 663 | 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) |
| 665 | 665 | handlers.push_back(&handler_read(*i)); |
| 666 | 666 | return handler_entry_proxy<handler_entry_read>(handlers, mask); |
| 667 | 667 | } |
| r250235 | r250236 | |
| 734 | 734 | std::list<UINT32> entries; |
| 735 | 735 | setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries); |
| 736 | 736 | 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) |
| 738 | 738 | handlers.push_back(&handler_write(*i)); |
| 739 | 739 | return handler_entry_proxy<handler_entry_write>(handlers, mask); |
| 740 | 740 | } |
| r250235 | r250236 | |
| 812 | 812 | std::list<UINT32> entries; |
| 813 | 813 | setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries); |
| 814 | 814 | 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) |
| 816 | 816 | handlers.push_back(&handler_setoffset(*i)); |
| 817 | 817 | return handler_entry_proxy<handler_entry_setoffset>(handlers, mask); |
| 818 | 818 | } |
| r250235 | r250236 | |
| 1524 | 1524 | // loop over devices and spaces within each device |
| 1525 | 1525 | memory_interface_iterator iter(machine().root_device()); |
| 1526 | 1526 | 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) |
| 1528 | 1528 | { |
| 1529 | 1529 | // if there is a configuration for this space, we need an address space |
| 1530 | 1530 | const address_space_config *spaceconfig = memory->space_config(spacenum); |
| r250235 | r250236 | |
| 1911 | 1911 | { |
| 1912 | 1912 | // find the entry before the last one we processed |
| 1913 | 1913 | 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()) { }; |
| 1915 | 1915 | last_entry = entry; |
| 1916 | 1916 | |
| 1917 | 1917 | // map both read and write halves |
| r250235 | r250236 | |
| 2869 | 2869 | curentry.configure(bytestart, byteend, bytemask); |
| 2870 | 2870 | |
| 2871 | 2871 | // 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) |
| 2873 | 2873 | populate_range(i->start, i->end, entry); |
| 2874 | 2874 | |
| 2875 | 2875 | // Add it in the "to be setup" list |
| r250235 | r250236 | |
| 2882 | 2882 | // Ranges in range_partial must duplicated then partially changed |
| 2883 | 2883 | if (!range_partial.empty()) |
| 2884 | 2884 | { |
| 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) |
| 2886 | 2886 | { |
| 2887 | 2887 | // Theorically, if the handler to change matches the |
| 2888 | 2888 | // characteristics of ours, we can directly change it. In |
| r250235 | r250236 | |
| 2912 | 2912 | curentry.configure(bytestart, byteend, bytemask); |
| 2913 | 2913 | |
| 2914 | 2914 | // 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) |
| 2916 | 2916 | populate_range(j->start, j->end, entry); |
| 2917 | 2917 | |
| 2918 | 2918 | // Add it in the "to be setup" list |