trunk/src/emu/machine/i6300esb.c
| r241832 | r241833 | |
| 71 | 71 | lpc_if_sound_range = 0x00; |
| 72 | 72 | fwh_dec_en1 = 0xff; |
| 73 | 73 | gen1_dec = 0x0000; |
| 74 | | lpc_en = 0x2000; |
| 74 | lpc_en = 0x0000; |
| 75 | 75 | fwh_sel1 = 0x00112233; |
| 76 | 76 | } |
| 77 | 77 | |
| r241832 | r241833 | |
| 85 | 85 | COMBINE_DATA(&gpio_base); |
| 86 | 86 | gpio_base &= 0x0000ffc0; |
| 87 | 87 | logerror("%s: gpio_base = %08x\n", tag(), gpio_base); |
| 88 | remap_cb(); |
| 88 | 89 | } |
| 89 | 90 | |
| 90 | 91 | READ8_MEMBER (i6300esb_lpc_device::gpio_cntl_r) |
| r241832 | r241833 | |
| 96 | 97 | { |
| 97 | 98 | COMBINE_DATA(&gpio_cntl); |
| 98 | 99 | logerror("%s: gpio_cntl = %02x\n", tag(), gpio_cntl); |
| 100 | remap_cb(); |
| 99 | 101 | } |
| 100 | 102 | |
| 101 | 103 | READ8_MEMBER (i6300esb_lpc_device::lpc_if_com_range_r) |
| r241832 | r241833 | |
| 107 | 109 | { |
| 108 | 110 | COMBINE_DATA(&lpc_if_com_range); |
| 109 | 111 | logerror("%s: lpc_if_com_range = %02x\n", tag(), lpc_if_com_range); |
| 112 | remap_cb(); |
| 110 | 113 | } |
| 111 | 114 | |
| 112 | 115 | READ8_MEMBER (i6300esb_lpc_device::lpc_if_fdd_lpt_range_r) |
| r241832 | r241833 | |
| 118 | 121 | { |
| 119 | 122 | COMBINE_DATA(&lpc_if_fdd_lpt_range); |
| 120 | 123 | logerror("%s: lpc_if_fdd_lpt_range = %02x\n", tag(), lpc_if_fdd_lpt_range); |
| 124 | remap_cb(); |
| 121 | 125 | } |
| 122 | 126 | |
| 123 | 127 | READ8_MEMBER (i6300esb_lpc_device::lpc_if_sound_range_r) |
| r241832 | r241833 | |
| 129 | 133 | { |
| 130 | 134 | COMBINE_DATA(&lpc_if_sound_range); |
| 131 | 135 | logerror("%s: lpc_if_sound_range = %02x\n", tag(), lpc_if_sound_range); |
| 136 | remap_cb(); |
| 132 | 137 | } |
| 133 | 138 | |
| 134 | 139 | READ8_MEMBER (i6300esb_lpc_device::fwh_dec_en1_r) |
| r241832 | r241833 | |
| 140 | 145 | { |
| 141 | 146 | fwh_dec_en1 = data | 0x80; |
| 142 | 147 | logerror("%s: fwh_dec_en1 = %02x\n", tag(), fwh_dec_en1); |
| 148 | remap_cb(); |
| 143 | 149 | } |
| 144 | 150 | |
| 145 | 151 | READ16_MEMBER (i6300esb_lpc_device::gen1_dec_r) |
| r241832 | r241833 | |
| 151 | 157 | { |
| 152 | 158 | COMBINE_DATA(&gen1_dec); |
| 153 | 159 | logerror("%s: gen1_dec = %04x\n", tag(), gen1_dec); |
| 160 | remap_cb(); |
| 154 | 161 | } |
| 155 | 162 | |
| 156 | 163 | READ16_MEMBER (i6300esb_lpc_device::lpc_en_r) |
| r241832 | r241833 | |
| 162 | 169 | { |
| 163 | 170 | COMBINE_DATA(&lpc_en); |
| 164 | 171 | logerror("%s: lpc_en = %04x\n", tag(), lpc_en); |
| 172 | remap_cb(); |
| 165 | 173 | } |
| 166 | 174 | |
| 167 | 175 | READ32_MEMBER (i6300esb_lpc_device::fwh_sel1_r) |
| r241832 | r241833 | |
| 173 | 181 | { |
| 174 | 182 | COMBINE_DATA(&fwh_sel1); |
| 175 | 183 | logerror("%s: fwh_sel1 = %08x\n", tag(), fwh_sel1); |
| 184 | remap_cb(); |
| 176 | 185 | } |
| 177 | 186 | |
| 178 | 187 | READ32_MEMBER (i6300esb_lpc_device::unk_fc_r) |
trunk/src/emu/machine/pci.c
| r241832 | r241833 | |
| 91 | 91 | { |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | void pci_device::set_remap_cb(mapper_cb _remap_cb) |
| 95 | { |
| 96 | remap_cb = _remap_cb; |
| 97 | } |
| 98 | |
| 94 | 99 | void pci_device::reset_all_mappings() |
| 95 | 100 | { |
| 96 | 101 | } |
| r241832 | r241833 | |
| 163 | 168 | return this; |
| 164 | 169 | } |
| 165 | 170 | |
| 171 | void pci_bridge_device::set_remap_cb(mapper_cb _remap_cb) |
| 172 | { |
| 173 | remap_cb = _remap_cb; |
| 174 | for(int i=0; i != all_devices.count(); i++) |
| 175 | if(all_devices[i] != this) |
| 176 | all_devices[i]->set_remap_cb(_remap_cb); |
| 177 | } |
| 178 | |
| 166 | 179 | void pci_bridge_device::device_start() |
| 167 | 180 | { |
| 168 | 181 | pci_device::device_start(); |
| r241832 | r241833 | |
| 179 | 192 | int fct = t[l-1] - '0'; |
| 180 | 193 | sub_devices[(id << 3) | fct] = downcast<pci_device *>(d); |
| 181 | 194 | } |
| 195 | |
| 196 | mapper_cb cf_cb(FUNC(pci_bridge_device::regenerate_config_mapping), this); |
| 197 | |
| 182 | 198 | for(int i=0; i<32*8; i++) |
| 183 | 199 | if(sub_devices[i]) { |
| 184 | 200 | all_devices.append(sub_devices[i]); |
| 185 | 201 | if(sub_devices[i] != this) { |
| 202 | sub_devices[i]->remap_config_cb = cf_cb; |
| 203 | sub_devices[i]->set_remap_cb(remap_cb); |
| 186 | 204 | pci_bridge_device *bridge = dynamic_cast<pci_bridge_device *>(sub_devices[i]); |
| 187 | 205 | if(bridge) |
| 188 | 206 | all_bridges.append(bridge); |
| r241832 | r241833 | |
| 262 | 280 | |
| 263 | 281 | void pci_host_device::device_start() |
| 264 | 282 | { |
| 283 | remap_cb = mapper_cb(FUNC(pci_host_device::regenerate_mapping), this); |
| 284 | |
| 265 | 285 | pci_bridge_device::device_start(); |
| 266 | 286 | |
| 267 | 287 | memory_window_start = memory_window_end = memory_offset = 0; |
| 268 | 288 | io_window_start = io_window_end = io_offset = 0; |
| 289 | |
| 290 | for(int i=0; i != all_devices.count(); i++) |
| 291 | if(all_devices[i] != this) |
| 292 | all_devices[i]->reset_all_mappings(); |
| 269 | 293 | } |
| 270 | 294 | |
| 271 | 295 | void pci_host_device::device_reset() |
trunk/src/emu/machine/pci.h
| r241832 | r241833 | |
| 24 | 24 | |
| 25 | 25 | class pci_device : public device_t { |
| 26 | 26 | public: |
| 27 | typedef delegate<void ()> mapper_cb; |
| 28 | |
| 29 | mapper_cb remap_cb, remap_config_cb; |
| 30 | |
| 27 | 31 | pci_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); |
| 28 | 32 | |
| 29 | 33 | void set_ids(UINT32 main_id, UINT8 revision, UINT32 pclass, UINT32 subsystem_id); |
| 30 | 34 | |
| 35 | virtual void set_remap_cb(mapper_cb _remap_cb); |
| 31 | 36 | virtual void reset_all_mappings(); |
| 32 | 37 | virtual void map_device(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, |
| 33 | 38 | UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space); |
| r241832 | r241833 | |
| 87 | 92 | pci_bridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 88 | 93 | pci_bridge_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); |
| 89 | 94 | |
| 95 | virtual void set_remap_cb(mapper_cb _remap_cb); |
| 90 | 96 | virtual void map_device(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, |
| 91 | 97 | UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space); |
| 92 | 98 | virtual void reset_all_mappings(); |