trunk/src/mame/drivers/savquest.c
| r32808 | r32809 | |
| 87 | 87 | UINT8 m_port379; |
| 88 | 88 | int m_hasp_passmode; |
| 89 | 89 | |
| 90 | | UINT8 m_mxtc_config_reg[256]; |
| 90 | UINT8 m_mtxc_config_reg[256]; |
| 91 | 91 | UINT8 m_piix4_config_reg[8][256]; |
| 92 | 92 | |
| 93 | 93 | DECLARE_WRITE32_MEMBER( bios_f0000_ram_w ); |
| r32808 | r32809 | |
| 115 | 115 | void intel82439tx_init(); |
| 116 | 116 | }; |
| 117 | 117 | |
| 118 | | // Intel 82439TX System Controller (MXTC) |
| 118 | // Intel 82439TX System Controller (MTXC) |
| 119 | 119 | |
| 120 | | static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 120 | static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 121 | 121 | { |
| 122 | 122 | savquest_state *state = busdevice->machine().driver_data<savquest_state>(); |
| 123 | | // osd_printf_debug("MXTC: read %d, %02X\n", function, reg); |
| 123 | // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); |
| 124 | 124 | |
| 125 | 125 | if((reg & 0xfe) == 0) |
| 126 | 126 | return (reg & 1) ? 0x80 : 0x86; // Vendor ID, Intel |
| 127 | 127 | |
| 128 | 128 | if((reg & 0xfe) == 2) |
| 129 | | return (reg & 1) ? 0x70 : 0x00; // Device ID, MXTC |
| 129 | return (reg & 1) ? 0x70 : 0x00; // Device ID, MTXC |
| 130 | 130 | |
| 131 | | return state->m_mxtc_config_reg[reg]; |
| 131 | return state->m_mtxc_config_reg[reg]; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | | static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 134 | static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 135 | 135 | { |
| 136 | 136 | savquest_state *state = busdevice->machine().driver_data<savquest_state>(); |
| 137 | 137 | // osd_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); |
| r32808 | r32809 | |
| 198 | 198 | } |
| 199 | 199 | #endif |
| 200 | 200 | |
| 201 | | state->m_mxtc_config_reg[reg] = data; |
| 201 | state->m_mtxc_config_reg[reg] = data; |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | void savquest_state::intel82439tx_init() |
| 205 | 205 | { |
| 206 | | m_mxtc_config_reg[0x60] = 0x02; |
| 207 | | m_mxtc_config_reg[0x61] = 0x02; |
| 208 | | m_mxtc_config_reg[0x62] = 0x02; |
| 209 | | m_mxtc_config_reg[0x63] = 0x02; |
| 210 | | m_mxtc_config_reg[0x64] = 0x02; |
| 211 | | m_mxtc_config_reg[0x65] = 0x02; |
| 206 | m_mtxc_config_reg[0x60] = 0x02; |
| 207 | m_mtxc_config_reg[0x61] = 0x02; |
| 208 | m_mtxc_config_reg[0x62] = 0x02; |
| 209 | m_mtxc_config_reg[0x63] = 0x02; |
| 210 | m_mtxc_config_reg[0x64] = 0x02; |
| 211 | m_mtxc_config_reg[0x65] = 0x02; |
| 212 | 212 | m_smram = auto_alloc_array(machine(), UINT8, 0x20000); |
| 213 | 213 | } |
| 214 | 214 | |
| r32808 | r32809 | |
| 217 | 217 | UINT32 r = 0; |
| 218 | 218 | if (ACCESSING_BITS_24_31) |
| 219 | 219 | { |
| 220 | | r |= mxtc_config_r(busdevice, device, function, reg + 3) << 24; |
| 220 | r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; |
| 221 | 221 | } |
| 222 | 222 | if (ACCESSING_BITS_16_23) |
| 223 | 223 | { |
| 224 | | r |= mxtc_config_r(busdevice, device, function, reg + 2) << 16; |
| 224 | r |= mtxc_config_r(busdevice, device, function, reg + 2) << 16; |
| 225 | 225 | } |
| 226 | 226 | if (ACCESSING_BITS_8_15) |
| 227 | 227 | { |
| 228 | | r |= mxtc_config_r(busdevice, device, function, reg + 1) << 8; |
| 228 | r |= mtxc_config_r(busdevice, device, function, reg + 1) << 8; |
| 229 | 229 | } |
| 230 | 230 | if (ACCESSING_BITS_0_7) |
| 231 | 231 | { |
| 232 | | r |= mxtc_config_r(busdevice, device, function, reg + 0) << 0; |
| 232 | r |= mtxc_config_r(busdevice, device, function, reg + 0) << 0; |
| 233 | 233 | } |
| 234 | 234 | return r; |
| 235 | 235 | } |
| r32808 | r32809 | |
| 238 | 238 | { |
| 239 | 239 | if (ACCESSING_BITS_24_31) |
| 240 | 240 | { |
| 241 | | mxtc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 241 | mtxc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 242 | 242 | } |
| 243 | 243 | if (ACCESSING_BITS_16_23) |
| 244 | 244 | { |
| 245 | | mxtc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 245 | mtxc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 246 | 246 | } |
| 247 | 247 | if (ACCESSING_BITS_8_15) |
| 248 | 248 | { |
| 249 | | mxtc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 249 | mtxc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 250 | 250 | } |
| 251 | 251 | if (ACCESSING_BITS_0_7) |
| 252 | 252 | { |
| 253 | | mxtc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 253 | mtxc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | |
| r32808 | r32809 | |
| 327 | 327 | |
| 328 | 328 | WRITE32_MEMBER(savquest_state::bios_f0000_ram_w) |
| 329 | 329 | { |
| 330 | | //if (m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 330 | //if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 331 | 331 | #if 1 |
| 332 | | if (m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 332 | if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 333 | 333 | { |
| 334 | 334 | COMBINE_DATA(m_bios_f0000_ram + offset); |
| 335 | 335 | } |
| r32808 | r32809 | |
| 338 | 338 | |
| 339 | 339 | WRITE32_MEMBER(savquest_state::bios_e0000_ram_w) |
| 340 | 340 | { |
| 341 | | //if (m_mxtc_config_reg[0x5e] & 2) // write to RAM if this region is write-enabled |
| 341 | //if (m_mtxc_config_reg[0x5e] & 2) // write to RAM if this region is write-enabled |
| 342 | 342 | #if 1 |
| 343 | | if (m_mxtc_config_reg[0x5e] & 2) // write to RAM if this region is write-enabled |
| 343 | if (m_mtxc_config_reg[0x5e] & 2) // write to RAM if this region is write-enabled |
| 344 | 344 | { |
| 345 | 345 | COMBINE_DATA(m_bios_e0000_ram + offset); |
| 346 | 346 | } |
| r32808 | r32809 | |
| 349 | 349 | |
| 350 | 350 | WRITE32_MEMBER(savquest_state::bios_e4000_ram_w) |
| 351 | 351 | { |
| 352 | | //if (m_mxtc_config_reg[0x5e] & 0x20) // write to RAM if this region is write-enabled |
| 352 | //if (m_mtxc_config_reg[0x5e] & 0x20) // write to RAM if this region is write-enabled |
| 353 | 353 | #if 1 |
| 354 | | if (m_mxtc_config_reg[0x5e] & 0x20) // write to RAM if this region is write-enabled |
| 354 | if (m_mtxc_config_reg[0x5e] & 0x20) // write to RAM if this region is write-enabled |
| 355 | 355 | { |
| 356 | 356 | COMBINE_DATA(m_bios_e4000_ram + offset); |
| 357 | 357 | } |
| r32808 | r32809 | |
| 360 | 360 | |
| 361 | 361 | WRITE32_MEMBER(savquest_state::bios_e8000_ram_w) |
| 362 | 362 | { |
| 363 | | //if (m_mxtc_config_reg[0x5f] & 2) // write to RAM if this region is write-enabled |
| 363 | //if (m_mtxc_config_reg[0x5f] & 2) // write to RAM if this region is write-enabled |
| 364 | 364 | #if 1 |
| 365 | | if (m_mxtc_config_reg[0x5f] & 2) // write to RAM if this region is write-enabled |
| 365 | if (m_mtxc_config_reg[0x5f] & 2) // write to RAM if this region is write-enabled |
| 366 | 366 | { |
| 367 | 367 | COMBINE_DATA(m_bios_e8000_ram + offset); |
| 368 | 368 | } |
| r32808 | r32809 | |
| 371 | 371 | |
| 372 | 372 | WRITE32_MEMBER(savquest_state::bios_ec000_ram_w) |
| 373 | 373 | { |
| 374 | | //if (m_mxtc_config_reg[0x5f] & 0x20) // write to RAM if this region is write-enabled |
| 374 | //if (m_mtxc_config_reg[0x5f] & 0x20) // write to RAM if this region is write-enabled |
| 375 | 375 | #if 1 |
| 376 | | if (m_mxtc_config_reg[0x5f] & 0x20) // write to RAM if this region is write-enabled |
| 376 | if (m_mtxc_config_reg[0x5f] & 0x20) // write to RAM if this region is write-enabled |
| 377 | 377 | { |
| 378 | 378 | COMBINE_DATA(m_bios_ec000_ram + offset); |
| 379 | 379 | } |
| r32808 | r32809 | |
| 579 | 579 | READ8_MEMBER(savquest_state::smram_r) |
| 580 | 580 | { |
| 581 | 581 | /* TODO: way more complex than this */ |
| 582 | | if(m_mxtc_config_reg[0x72] & 0x40) |
| 582 | if(m_mtxc_config_reg[0x72] & 0x40) |
| 583 | 583 | return m_smram[offset]; |
| 584 | 584 | else |
| 585 | 585 | return m_vga->mem_r(space,offset,0xff); |
| r32808 | r32809 | |
| 588 | 588 | WRITE8_MEMBER(savquest_state::smram_w) |
| 589 | 589 | { |
| 590 | 590 | /* TODO: way more complex than this */ |
| 591 | | if(m_mxtc_config_reg[0x72] & 0x40) |
| 591 | if(m_mtxc_config_reg[0x72] & 0x40) |
| 592 | 592 | m_smram[offset] = data; |
| 593 | 593 | else |
| 594 | 594 | m_vga->mem_w(space,offset,data,0xff); |
trunk/src/mame/drivers/midqslvr.c
| r32808 | r32809 | |
| 45 | 45 | UINT32 *m_bios_ext4_ram; |
| 46 | 46 | UINT32 *m_isa_ram1; |
| 47 | 47 | UINT32 *m_isa_ram2; |
| 48 | | UINT8 m_mxtc_config_reg[256]; |
| 48 | UINT8 m_mtxc_config_reg[256]; |
| 49 | 49 | UINT8 m_piix4_config_reg[4][256]; |
| 50 | 50 | |
| 51 | 51 | DECLARE_WRITE32_MEMBER( isa_ram1_w ); |
| r32808 | r32809 | |
| 63 | 63 | }; |
| 64 | 64 | |
| 65 | 65 | |
| 66 | | // Intel 82439TX System Controller (MXTC) |
| 66 | // Intel 82439TX System Controller (MTXC) |
| 67 | 67 | |
| 68 | | static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 68 | static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 69 | 69 | { |
| 70 | 70 | midqslvr_state *state = busdevice->machine().driver_data<midqslvr_state>(); |
| 71 | | // osd_printf_debug("MXTC: read %d, %02X\n", function, reg); |
| 71 | // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); |
| 72 | 72 | |
| 73 | 73 | if((reg & 0xfc) == 0 && function == 0) // return vendor ID |
| 74 | 74 | return (0x71008086 >> (reg & 3)*8) & 0xff; |
| 75 | 75 | |
| 76 | | return state->m_mxtc_config_reg[reg]; |
| 76 | return state->m_mtxc_config_reg[reg]; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | | static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 79 | static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 80 | 80 | { |
| 81 | 81 | midqslvr_state *state = busdevice->machine().driver_data<midqslvr_state>(); |
| 82 | | printf("MXTC: write %d, %02X, %02X\n", function, reg, data); |
| 82 | printf("MTXC: write %d, %02X, %02X\n", function, reg, data); |
| 83 | 83 | |
| 84 | 84 | /* |
| 85 | 85 | memory banking with North Bridge: |
| r32808 | r32809 | |
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | | state->m_mxtc_config_reg[reg] = data; |
| 158 | state->m_mtxc_config_reg[reg] = data; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | void midqslvr_state::intel82439tx_init() |
| 162 | 162 | { |
| 163 | | m_mxtc_config_reg[0x60] = 0x02; |
| 164 | | m_mxtc_config_reg[0x61] = 0x02; |
| 165 | | m_mxtc_config_reg[0x62] = 0x02; |
| 166 | | m_mxtc_config_reg[0x63] = 0x02; |
| 167 | | m_mxtc_config_reg[0x64] = 0x02; |
| 168 | | m_mxtc_config_reg[0x65] = 0x02; |
| 163 | m_mtxc_config_reg[0x60] = 0x02; |
| 164 | m_mtxc_config_reg[0x61] = 0x02; |
| 165 | m_mtxc_config_reg[0x62] = 0x02; |
| 166 | m_mtxc_config_reg[0x63] = 0x02; |
| 167 | m_mtxc_config_reg[0x64] = 0x02; |
| 168 | m_mtxc_config_reg[0x65] = 0x02; |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) |
| r32808 | r32809 | |
| 173 | 173 | UINT32 r = 0; |
| 174 | 174 | if (ACCESSING_BITS_24_31) |
| 175 | 175 | { |
| 176 | | r |= mxtc_config_r(busdevice, device, function, reg + 3) << 24; |
| 176 | r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; |
| 177 | 177 | } |
| 178 | 178 | if (ACCESSING_BITS_16_23) |
| 179 | 179 | { |
| 180 | | r |= mxtc_config_r(busdevice, device, function, reg + 2) << 16; |
| 180 | r |= mtxc_config_r(busdevice, device, function, reg + 2) << 16; |
| 181 | 181 | } |
| 182 | 182 | if (ACCESSING_BITS_8_15) |
| 183 | 183 | { |
| 184 | | r |= mxtc_config_r(busdevice, device, function, reg + 1) << 8; |
| 184 | r |= mtxc_config_r(busdevice, device, function, reg + 1) << 8; |
| 185 | 185 | } |
| 186 | 186 | if (ACCESSING_BITS_0_7) |
| 187 | 187 | { |
| 188 | | r |= mxtc_config_r(busdevice, device, function, reg + 0) << 0; |
| 188 | r |= mtxc_config_r(busdevice, device, function, reg + 0) << 0; |
| 189 | 189 | } |
| 190 | 190 | return r; |
| 191 | 191 | } |
| r32808 | r32809 | |
| 194 | 194 | { |
| 195 | 195 | if (ACCESSING_BITS_24_31) |
| 196 | 196 | { |
| 197 | | mxtc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 197 | mtxc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 198 | 198 | } |
| 199 | 199 | if (ACCESSING_BITS_16_23) |
| 200 | 200 | { |
| 201 | | mxtc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 201 | mtxc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 202 | 202 | } |
| 203 | 203 | if (ACCESSING_BITS_8_15) |
| 204 | 204 | { |
| 205 | | mxtc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 205 | mtxc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 206 | 206 | } |
| 207 | 207 | if (ACCESSING_BITS_0_7) |
| 208 | 208 | { |
| 209 | | mxtc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 209 | mtxc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | |
| r32808 | r32809 | |
| 296 | 296 | |
| 297 | 297 | WRITE32_MEMBER(midqslvr_state::isa_ram1_w) |
| 298 | 298 | { |
| 299 | | if (m_mxtc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled |
| 299 | if (m_mtxc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled |
| 300 | 300 | { |
| 301 | 301 | COMBINE_DATA(m_isa_ram1 + offset); |
| 302 | 302 | } |
| r32808 | r32809 | |
| 304 | 304 | |
| 305 | 305 | WRITE32_MEMBER(midqslvr_state::isa_ram2_w) |
| 306 | 306 | { |
| 307 | | if (m_mxtc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled |
| 307 | if (m_mtxc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled |
| 308 | 308 | { |
| 309 | 309 | COMBINE_DATA(m_isa_ram2 + offset); |
| 310 | 310 | } |
| r32808 | r32809 | |
| 312 | 312 | |
| 313 | 313 | WRITE32_MEMBER(midqslvr_state::bios_ext1_ram_w) |
| 314 | 314 | { |
| 315 | | if (m_mxtc_config_reg[0x5e] & 0x2) // write to RAM if this region is write-enabled |
| 315 | if (m_mtxc_config_reg[0x5e] & 0x2) // write to RAM if this region is write-enabled |
| 316 | 316 | { |
| 317 | 317 | COMBINE_DATA(m_bios_ext1_ram + offset); |
| 318 | 318 | } |
| r32808 | r32809 | |
| 321 | 321 | |
| 322 | 322 | WRITE32_MEMBER(midqslvr_state::bios_ext2_ram_w) |
| 323 | 323 | { |
| 324 | | if (m_mxtc_config_reg[0x5e] & 0x20) // write to RAM if this region is write-enabled |
| 324 | if (m_mtxc_config_reg[0x5e] & 0x20) // write to RAM if this region is write-enabled |
| 325 | 325 | { |
| 326 | 326 | COMBINE_DATA(m_bios_ext2_ram + offset); |
| 327 | 327 | } |
| r32808 | r32809 | |
| 330 | 330 | |
| 331 | 331 | WRITE32_MEMBER(midqslvr_state::bios_ext3_ram_w) |
| 332 | 332 | { |
| 333 | | if (m_mxtc_config_reg[0x5f] & 0x2) // write to RAM if this region is write-enabled |
| 333 | if (m_mtxc_config_reg[0x5f] & 0x2) // write to RAM if this region is write-enabled |
| 334 | 334 | { |
| 335 | 335 | COMBINE_DATA(m_bios_ext3_ram + offset); |
| 336 | 336 | } |
| r32808 | r32809 | |
| 339 | 339 | |
| 340 | 340 | WRITE32_MEMBER(midqslvr_state::bios_ext4_ram_w) |
| 341 | 341 | { |
| 342 | | if (m_mxtc_config_reg[0x5f] & 0x20) // write to RAM if this region is write-enabled |
| 342 | if (m_mtxc_config_reg[0x5f] & 0x20) // write to RAM if this region is write-enabled |
| 343 | 343 | { |
| 344 | 344 | COMBINE_DATA(m_bios_ext4_ram + offset); |
| 345 | 345 | } |
| r32808 | r32809 | |
| 348 | 348 | |
| 349 | 349 | WRITE32_MEMBER(midqslvr_state::bios_ram_w) |
| 350 | 350 | { |
| 351 | | if (m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 351 | if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 352 | 352 | { |
| 353 | 353 | COMBINE_DATA(m_bios_ram + offset); |
| 354 | 354 | } |
trunk/src/mame/drivers/queen.c
| r32808 | r32809 | |
| 43 | 43 | |
| 44 | 44 | UINT32 *m_bios_ram; |
| 45 | 45 | UINT32 *m_bios_ext_ram; |
| 46 | | UINT8 m_mxtc_config_reg[256]; |
| 46 | UINT8 m_mtxc_config_reg[256]; |
| 47 | 47 | UINT8 m_piix4_config_reg[4][256]; |
| 48 | 48 | |
| 49 | 49 | DECLARE_WRITE32_MEMBER( bios_ext_ram_w ); |
| r32808 | r32809 | |
| 55 | 55 | }; |
| 56 | 56 | |
| 57 | 57 | |
| 58 | | // Intel 82439TX System Controller (MXTC) |
| 58 | // Intel 82439TX System Controller (MTXC) |
| 59 | 59 | |
| 60 | | static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 60 | static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 61 | 61 | { |
| 62 | 62 | queen_state *state = busdevice->machine().driver_data<queen_state>(); |
| 63 | | // osd_printf_debug("MXTC: read %d, %02X\n", function, reg); |
| 63 | // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); |
| 64 | 64 | |
| 65 | | return state->m_mxtc_config_reg[reg]; |
| 65 | return state->m_mtxc_config_reg[reg]; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | | static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 68 | static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 69 | 69 | { |
| 70 | 70 | queen_state *state = busdevice->machine().driver_data<queen_state>(); |
| 71 | | printf("MXTC: write %d, %02X, %02X\n", function, reg, data); |
| 71 | printf("MTXC: write %d, %02X, %02X\n", function, reg, data); |
| 72 | 72 | |
| 73 | 73 | /* |
| 74 | 74 | memory banking with North Bridge: |
| r32808 | r32809 | |
| 92 | 92 | state->membank("bios_ext")->set_base(state->memregion("bios")->base() + 0x20000); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | | state->m_mxtc_config_reg[reg] = data; |
| 95 | state->m_mtxc_config_reg[reg] = data; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | void queen_state::intel82439tx_init() |
| 99 | 99 | { |
| 100 | | m_mxtc_config_reg[0x60] = 0x02; |
| 101 | | m_mxtc_config_reg[0x61] = 0x02; |
| 102 | | m_mxtc_config_reg[0x62] = 0x02; |
| 103 | | m_mxtc_config_reg[0x63] = 0x02; |
| 104 | | m_mxtc_config_reg[0x64] = 0x02; |
| 105 | | m_mxtc_config_reg[0x65] = 0x02; |
| 100 | m_mtxc_config_reg[0x60] = 0x02; |
| 101 | m_mtxc_config_reg[0x61] = 0x02; |
| 102 | m_mtxc_config_reg[0x62] = 0x02; |
| 103 | m_mtxc_config_reg[0x63] = 0x02; |
| 104 | m_mtxc_config_reg[0x64] = 0x02; |
| 105 | m_mtxc_config_reg[0x65] = 0x02; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) |
| r32808 | r32809 | |
| 110 | 110 | UINT32 r = 0; |
| 111 | 111 | if (ACCESSING_BITS_24_31) |
| 112 | 112 | { |
| 113 | | r |= mxtc_config_r(busdevice, device, function, reg + 3) << 24; |
| 113 | r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; |
| 114 | 114 | } |
| 115 | 115 | if (ACCESSING_BITS_16_23) |
| 116 | 116 | { |
| 117 | | r |= mxtc_config_r(busdevice, device, function, reg + 2) << 16; |
| 117 | r |= mtxc_config_r(busdevice, device, function, reg + 2) << 16; |
| 118 | 118 | } |
| 119 | 119 | if (ACCESSING_BITS_8_15) |
| 120 | 120 | { |
| 121 | | r |= mxtc_config_r(busdevice, device, function, reg + 1) << 8; |
| 121 | r |= mtxc_config_r(busdevice, device, function, reg + 1) << 8; |
| 122 | 122 | } |
| 123 | 123 | if (ACCESSING_BITS_0_7) |
| 124 | 124 | { |
| 125 | | r |= mxtc_config_r(busdevice, device, function, reg + 0) << 0; |
| 125 | r |= mtxc_config_r(busdevice, device, function, reg + 0) << 0; |
| 126 | 126 | } |
| 127 | 127 | return r; |
| 128 | 128 | } |
| r32808 | r32809 | |
| 131 | 131 | { |
| 132 | 132 | if (ACCESSING_BITS_24_31) |
| 133 | 133 | { |
| 134 | | mxtc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 134 | mtxc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 135 | 135 | } |
| 136 | 136 | if (ACCESSING_BITS_16_23) |
| 137 | 137 | { |
| 138 | | mxtc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 138 | mtxc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 139 | 139 | } |
| 140 | 140 | if (ACCESSING_BITS_8_15) |
| 141 | 141 | { |
| 142 | | mxtc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 142 | mtxc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 143 | 143 | } |
| 144 | 144 | if (ACCESSING_BITS_0_7) |
| 145 | 145 | { |
| 146 | | mxtc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 146 | mtxc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| r32808 | r32809 | |
| 209 | 209 | |
| 210 | 210 | WRITE32_MEMBER(queen_state::bios_ext_ram_w) |
| 211 | 211 | { |
| 212 | | if (m_mxtc_config_reg[0x63] & 0x40) // write to RAM if this region is write-enabled |
| 212 | if (m_mtxc_config_reg[0x63] & 0x40) // write to RAM if this region is write-enabled |
| 213 | 213 | { |
| 214 | 214 | COMBINE_DATA(m_bios_ext_ram + offset); |
| 215 | 215 | } |
| r32808 | r32809 | |
| 218 | 218 | |
| 219 | 219 | WRITE32_MEMBER(queen_state::bios_ram_w) |
| 220 | 220 | { |
| 221 | | if (m_mxtc_config_reg[0x63] & 0x10) // write to RAM if this region is write-enabled |
| 221 | if (m_mtxc_config_reg[0x63] & 0x10) // write to RAM if this region is write-enabled |
| 222 | 222 | { |
| 223 | 223 | COMBINE_DATA(m_bios_ram + offset); |
| 224 | 224 | } |
trunk/src/mame/drivers/calchase.c
| r32808 | r32809 | |
| 142 | 142 | |
| 143 | 143 | UINT32 *m_bios_ram; |
| 144 | 144 | UINT32 *m_bios_ext_ram; |
| 145 | | UINT8 m_mxtc_config_reg[256]; |
| 145 | UINT8 m_mtxc_config_reg[256]; |
| 146 | 146 | UINT8 m_piix4_config_reg[4][256]; |
| 147 | 147 | |
| 148 | 148 | UINT32 m_idle_skip_ram; |
| r32808 | r32809 | |
| 166 | 166 | required_device<dac_device> m_dac_r; |
| 167 | 167 | }; |
| 168 | 168 | |
| 169 | | // Intel 82439TX System Controller (MXTC) |
| 169 | // Intel 82439TX System Controller (MTXC) |
| 170 | 170 | // TODO: change with a VIA82C585VPX (North Bridge - APOLLO Chipset) |
| 171 | 171 | |
| 172 | | static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 172 | static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 173 | 173 | { |
| 174 | 174 | calchase_state *state = busdevice->machine().driver_data<calchase_state>(); |
| 175 | | // osd_printf_debug("MXTC: read %d, %02X\n", function, reg); |
| 175 | // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); |
| 176 | 176 | |
| 177 | | return state->m_mxtc_config_reg[reg]; |
| 177 | return state->m_mtxc_config_reg[reg]; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | | static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 180 | static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 181 | 181 | { |
| 182 | 182 | calchase_state *state = busdevice->machine().driver_data<calchase_state>(); |
| 183 | | // osd_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); |
| 183 | // osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); |
| 184 | 184 | |
| 185 | 185 | /* |
| 186 | 186 | memory banking with North Bridge: |
| r32808 | r32809 | |
| 204 | 204 | state->membank("bios_ext")->set_base(state->memregion("bios")->base() + 0); |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | | state->m_mxtc_config_reg[reg] = data; |
| 207 | state->m_mtxc_config_reg[reg] = data; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | void calchase_state::intel82439tx_init() |
| 211 | 211 | { |
| 212 | | m_mxtc_config_reg[0x60] = 0x02; |
| 213 | | m_mxtc_config_reg[0x61] = 0x02; |
| 214 | | m_mxtc_config_reg[0x62] = 0x02; |
| 215 | | m_mxtc_config_reg[0x63] = 0x02; |
| 216 | | m_mxtc_config_reg[0x64] = 0x02; |
| 217 | | m_mxtc_config_reg[0x65] = 0x02; |
| 212 | m_mtxc_config_reg[0x60] = 0x02; |
| 213 | m_mtxc_config_reg[0x61] = 0x02; |
| 214 | m_mtxc_config_reg[0x62] = 0x02; |
| 215 | m_mtxc_config_reg[0x63] = 0x02; |
| 216 | m_mtxc_config_reg[0x64] = 0x02; |
| 217 | m_mtxc_config_reg[0x65] = 0x02; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) |
| r32808 | r32809 | |
| 226 | 226 | |
| 227 | 227 | if (ACCESSING_BITS_24_31) |
| 228 | 228 | { |
| 229 | | r |= mxtc_config_r(busdevice, device, function, reg + 3) << 24; |
| 229 | r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; |
| 230 | 230 | } |
| 231 | 231 | if (ACCESSING_BITS_16_23) |
| 232 | 232 | { |
| 233 | | r |= mxtc_config_r(busdevice, device, function, reg + 2) << 16; |
| 233 | r |= mtxc_config_r(busdevice, device, function, reg + 2) << 16; |
| 234 | 234 | } |
| 235 | 235 | if (ACCESSING_BITS_8_15) |
| 236 | 236 | { |
| 237 | | r |= mxtc_config_r(busdevice, device, function, reg + 1) << 8; |
| 237 | r |= mtxc_config_r(busdevice, device, function, reg + 1) << 8; |
| 238 | 238 | } |
| 239 | 239 | if (ACCESSING_BITS_0_7) |
| 240 | 240 | { |
| 241 | | r |= mxtc_config_r(busdevice, device, function, reg + 0) << 0; |
| 241 | r |= mtxc_config_r(busdevice, device, function, reg + 0) << 0; |
| 242 | 242 | } |
| 243 | 243 | return r; |
| 244 | 244 | } |
| r32808 | r32809 | |
| 247 | 247 | { |
| 248 | 248 | if (ACCESSING_BITS_24_31) |
| 249 | 249 | { |
| 250 | | mxtc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 250 | mtxc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 251 | 251 | } |
| 252 | 252 | if (ACCESSING_BITS_16_23) |
| 253 | 253 | { |
| 254 | | mxtc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 254 | mtxc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 255 | 255 | } |
| 256 | 256 | if (ACCESSING_BITS_8_15) |
| 257 | 257 | { |
| 258 | | mxtc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 258 | mtxc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 259 | 259 | } |
| 260 | 260 | if (ACCESSING_BITS_0_7) |
| 261 | 261 | { |
| 262 | | mxtc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 262 | mtxc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | |
| r32808 | r32809 | |
| 328 | 328 | |
| 329 | 329 | WRITE32_MEMBER(calchase_state::bios_ram_w) |
| 330 | 330 | { |
| 331 | | if (m_mxtc_config_reg[0x63] & 0x10) // write to RAM if this region is write-enabled |
| 331 | if (m_mtxc_config_reg[0x63] & 0x10) // write to RAM if this region is write-enabled |
| 332 | 332 | { |
| 333 | 333 | COMBINE_DATA(m_bios_ram + offset); |
| 334 | 334 | } |
| r32808 | r32809 | |
| 336 | 336 | |
| 337 | 337 | WRITE32_MEMBER(calchase_state::bios_ext_ram_w) |
| 338 | 338 | { |
| 339 | | if (m_mxtc_config_reg[0x63] & 0x40) // write to RAM if this region is write-enabled |
| 339 | if (m_mtxc_config_reg[0x63] & 0x40) // write to RAM if this region is write-enabled |
| 340 | 340 | { |
| 341 | 341 | COMBINE_DATA(m_bios_ext_ram + offset); |
| 342 | 342 | } |
| r32808 | r32809 | |
| 571 | 571 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) |
| 572 | 572 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) |
| 573 | 573 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 574 | | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) |
| 575 | | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) |
| 576 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 574 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") //eggsplc |
| 577 | 575 | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) |
| 578 | 576 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 579 | 577 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| r32808 | r32809 | |
| 774 | 772 | |
| 775 | 773 | GAME( 1998, hostinv, 0, hostinv, calchase, calchase_state, hostinv, ROT0, "The Game Room", "Host Invaders", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 776 | 774 | GAME( 1999, calchase, 0, calchase, calchase, calchase_state, calchase, ROT0, "The Game Room", "California Chase", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 777 | | GAME( 2002, eggsplc, 0, calchase, calchase, calchase_state, hostinv, ROT0, "The Game Room", "Eggs Playing Chicken", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 775 | GAME( 2002, eggsplc, 0, calchase, calchase, calchase_state, hostinv, ROT0, "The Game Room", "Eggs Playing Chicken", 0 ) |
trunk/src/mame/drivers/xtom3d.c
| r32808 | r32809 | |
| 61 | 61 | UINT32 *m_bios_ext4_ram; |
| 62 | 62 | UINT32 *m_isa_ram1; |
| 63 | 63 | UINT32 *m_isa_ram2; |
| 64 | | UINT8 m_mxtc_config_reg[256]; |
| 64 | UINT8 m_mtxc_config_reg[256]; |
| 65 | 65 | UINT8 m_piix4_config_reg[4][256]; |
| 66 | 66 | |
| 67 | 67 | DECLARE_WRITE32_MEMBER( isa_ram1_w ); |
| r32808 | r32809 | |
| 78 | 78 | void intel82439tx_init(); |
| 79 | 79 | }; |
| 80 | 80 | |
| 81 | | // Intel 82439TX System Controller (MXTC) |
| 81 | // Intel 82439TX System Controller (MTXC) |
| 82 | 82 | |
| 83 | | static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 83 | static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 84 | 84 | { |
| 85 | 85 | xtom3d_state *state = busdevice->machine().driver_data<xtom3d_state>(); |
| 86 | | // osd_printf_debug("MXTC: read %d, %02X\n", function, reg); |
| 86 | // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); |
| 87 | 87 | |
| 88 | | return state->m_mxtc_config_reg[reg]; |
| 88 | return state->m_mtxc_config_reg[reg]; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | | static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 91 | static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 92 | 92 | { |
| 93 | 93 | xtom3d_state *state = busdevice->machine().driver_data<xtom3d_state>(); |
| 94 | | printf("MXTC: write %d, %02X, %02X\n", function, reg, data); |
| 94 | printf("MTXC: write %d, %02X, %02X\n", function, reg, data); |
| 95 | 95 | |
| 96 | 96 | /* |
| 97 | 97 | memory banking with North Bridge: |
| r32808 | r32809 | |
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | | state->m_mxtc_config_reg[reg] = data; |
| 170 | state->m_mtxc_config_reg[reg] = data; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | void xtom3d_state::intel82439tx_init() |
| 174 | 174 | { |
| 175 | | m_mxtc_config_reg[0x60] = 0x02; |
| 176 | | m_mxtc_config_reg[0x61] = 0x02; |
| 177 | | m_mxtc_config_reg[0x62] = 0x02; |
| 178 | | m_mxtc_config_reg[0x63] = 0x02; |
| 179 | | m_mxtc_config_reg[0x64] = 0x02; |
| 180 | | m_mxtc_config_reg[0x65] = 0x02; |
| 175 | m_mtxc_config_reg[0x60] = 0x02; |
| 176 | m_mtxc_config_reg[0x61] = 0x02; |
| 177 | m_mtxc_config_reg[0x62] = 0x02; |
| 178 | m_mtxc_config_reg[0x63] = 0x02; |
| 179 | m_mtxc_config_reg[0x64] = 0x02; |
| 180 | m_mtxc_config_reg[0x65] = 0x02; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) |
| r32808 | r32809 | |
| 185 | 185 | UINT32 r = 0; |
| 186 | 186 | if (ACCESSING_BITS_24_31) |
| 187 | 187 | { |
| 188 | | r |= mxtc_config_r(busdevice, device, function, reg + 3) << 24; |
| 188 | r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; |
| 189 | 189 | } |
| 190 | 190 | if (ACCESSING_BITS_16_23) |
| 191 | 191 | { |
| 192 | | r |= mxtc_config_r(busdevice, device, function, reg + 2) << 16; |
| 192 | r |= mtxc_config_r(busdevice, device, function, reg + 2) << 16; |
| 193 | 193 | } |
| 194 | 194 | if (ACCESSING_BITS_8_15) |
| 195 | 195 | { |
| 196 | | r |= mxtc_config_r(busdevice, device, function, reg + 1) << 8; |
| 196 | r |= mtxc_config_r(busdevice, device, function, reg + 1) << 8; |
| 197 | 197 | } |
| 198 | 198 | if (ACCESSING_BITS_0_7) |
| 199 | 199 | { |
| 200 | | r |= mxtc_config_r(busdevice, device, function, reg + 0) << 0; |
| 200 | r |= mtxc_config_r(busdevice, device, function, reg + 0) << 0; |
| 201 | 201 | } |
| 202 | 202 | return r; |
| 203 | 203 | } |
| r32808 | r32809 | |
| 206 | 206 | { |
| 207 | 207 | if (ACCESSING_BITS_24_31) |
| 208 | 208 | { |
| 209 | | mxtc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 209 | mtxc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 210 | 210 | } |
| 211 | 211 | if (ACCESSING_BITS_16_23) |
| 212 | 212 | { |
| 213 | | mxtc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 213 | mtxc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 214 | 214 | } |
| 215 | 215 | if (ACCESSING_BITS_8_15) |
| 216 | 216 | { |
| 217 | | mxtc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 217 | mtxc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 218 | 218 | } |
| 219 | 219 | if (ACCESSING_BITS_0_7) |
| 220 | 220 | { |
| 221 | | mxtc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 221 | mtxc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
| r32808 | r32809 | |
| 283 | 283 | |
| 284 | 284 | WRITE32_MEMBER(xtom3d_state::isa_ram1_w) |
| 285 | 285 | { |
| 286 | | if (m_mxtc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled |
| 286 | if (m_mtxc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled |
| 287 | 287 | { |
| 288 | 288 | COMBINE_DATA(m_isa_ram1 + offset); |
| 289 | 289 | } |
| r32808 | r32809 | |
| 291 | 291 | |
| 292 | 292 | WRITE32_MEMBER(xtom3d_state::isa_ram2_w) |
| 293 | 293 | { |
| 294 | | if (m_mxtc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled |
| 294 | if (m_mtxc_config_reg[0x5a] & 0x2) // write to RAM if this region is write-enabled |
| 295 | 295 | { |
| 296 | 296 | COMBINE_DATA(m_isa_ram2 + offset); |
| 297 | 297 | } |
| r32808 | r32809 | |
| 299 | 299 | |
| 300 | 300 | WRITE32_MEMBER(xtom3d_state::bios_ext1_ram_w) |
| 301 | 301 | { |
| 302 | | if (m_mxtc_config_reg[0x5e] & 0x2) // write to RAM if this region is write-enabled |
| 302 | if (m_mtxc_config_reg[0x5e] & 0x2) // write to RAM if this region is write-enabled |
| 303 | 303 | { |
| 304 | 304 | COMBINE_DATA(m_bios_ext1_ram + offset); |
| 305 | 305 | } |
| r32808 | r32809 | |
| 308 | 308 | |
| 309 | 309 | WRITE32_MEMBER(xtom3d_state::bios_ext2_ram_w) |
| 310 | 310 | { |
| 311 | | if (m_mxtc_config_reg[0x5e] & 0x20) // write to RAM if this region is write-enabled |
| 311 | if (m_mtxc_config_reg[0x5e] & 0x20) // write to RAM if this region is write-enabled |
| 312 | 312 | { |
| 313 | 313 | COMBINE_DATA(m_bios_ext2_ram + offset); |
| 314 | 314 | } |
| r32808 | r32809 | |
| 317 | 317 | |
| 318 | 318 | WRITE32_MEMBER(xtom3d_state::bios_ext3_ram_w) |
| 319 | 319 | { |
| 320 | | if (m_mxtc_config_reg[0x5f] & 0x2) // write to RAM if this region is write-enabled |
| 320 | if (m_mtxc_config_reg[0x5f] & 0x2) // write to RAM if this region is write-enabled |
| 321 | 321 | { |
| 322 | 322 | COMBINE_DATA(m_bios_ext3_ram + offset); |
| 323 | 323 | } |
| r32808 | r32809 | |
| 326 | 326 | |
| 327 | 327 | WRITE32_MEMBER(xtom3d_state::bios_ext4_ram_w) |
| 328 | 328 | { |
| 329 | | if (m_mxtc_config_reg[0x5f] & 0x20) // write to RAM if this region is write-enabled |
| 329 | if (m_mtxc_config_reg[0x5f] & 0x20) // write to RAM if this region is write-enabled |
| 330 | 330 | { |
| 331 | 331 | COMBINE_DATA(m_bios_ext4_ram + offset); |
| 332 | 332 | } |
| r32808 | r32809 | |
| 335 | 335 | |
| 336 | 336 | WRITE32_MEMBER(xtom3d_state::bios_ram_w) |
| 337 | 337 | { |
| 338 | | if (m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 338 | if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 339 | 339 | { |
| 340 | 340 | COMBINE_DATA(m_bios_ram + offset); |
| 341 | 341 | } |
trunk/src/mame/drivers/taitowlf.c
| r32808 | r32809 | |
| 44 | 44 | m_palette(*this, "palette") { } |
| 45 | 45 | |
| 46 | 46 | UINT32 *m_bios_ram; |
| 47 | | UINT8 m_mxtc_config_reg[256]; |
| 47 | UINT8 m_mtxc_config_reg[256]; |
| 48 | 48 | UINT8 m_piix4_config_reg[4][256]; |
| 49 | 49 | |
| 50 | 50 | required_region_ptr<UINT8> m_bootscreen_rom; |
| r32808 | r32809 | |
| 92 | 92 | #endif |
| 93 | 93 | |
| 94 | 94 | |
| 95 | | // Intel 82439TX System Controller (MXTC) |
| 95 | // Intel 82439TX System Controller (MTXC) |
| 96 | 96 | |
| 97 | | static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 97 | static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 98 | 98 | { |
| 99 | 99 | taitowlf_state *state = busdevice->machine().driver_data<taitowlf_state>(); |
| 100 | | // osd_printf_debug("MXTC: read %d, %02X\n", function, reg); |
| 100 | // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); |
| 101 | 101 | |
| 102 | | return state->m_mxtc_config_reg[reg]; |
| 102 | return state->m_mtxc_config_reg[reg]; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | | static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 105 | static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 106 | 106 | { |
| 107 | 107 | taitowlf_state *state = busdevice->machine().driver_data<taitowlf_state>(); |
| 108 | | // osd_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); |
| 108 | // osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); |
| 109 | 109 | |
| 110 | 110 | switch(reg) |
| 111 | 111 | { |
| r32808 | r32809 | |
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | | state->m_mxtc_config_reg[reg] = data; |
| 126 | state->m_mtxc_config_reg[reg] = data; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | void taitowlf_state::intel82439tx_init() |
| 130 | 130 | { |
| 131 | | m_mxtc_config_reg[0x60] = 0x02; |
| 132 | | m_mxtc_config_reg[0x61] = 0x02; |
| 133 | | m_mxtc_config_reg[0x62] = 0x02; |
| 134 | | m_mxtc_config_reg[0x63] = 0x02; |
| 135 | | m_mxtc_config_reg[0x64] = 0x02; |
| 136 | | m_mxtc_config_reg[0x65] = 0x02; |
| 131 | m_mtxc_config_reg[0x60] = 0x02; |
| 132 | m_mtxc_config_reg[0x61] = 0x02; |
| 133 | m_mtxc_config_reg[0x62] = 0x02; |
| 134 | m_mtxc_config_reg[0x63] = 0x02; |
| 135 | m_mtxc_config_reg[0x64] = 0x02; |
| 136 | m_mtxc_config_reg[0x65] = 0x02; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) |
| r32808 | r32809 | |
| 141 | 141 | UINT32 r = 0; |
| 142 | 142 | if (ACCESSING_BITS_24_31) |
| 143 | 143 | { |
| 144 | | r |= mxtc_config_r(busdevice, device, function, reg + 3) << 24; |
| 144 | r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; |
| 145 | 145 | } |
| 146 | 146 | if (ACCESSING_BITS_16_23) |
| 147 | 147 | { |
| 148 | | r |= mxtc_config_r(busdevice, device, function, reg + 2) << 16; |
| 148 | r |= mtxc_config_r(busdevice, device, function, reg + 2) << 16; |
| 149 | 149 | } |
| 150 | 150 | if (ACCESSING_BITS_8_15) |
| 151 | 151 | { |
| 152 | | r |= mxtc_config_r(busdevice, device, function, reg + 1) << 8; |
| 152 | r |= mtxc_config_r(busdevice, device, function, reg + 1) << 8; |
| 153 | 153 | } |
| 154 | 154 | if (ACCESSING_BITS_0_7) |
| 155 | 155 | { |
| 156 | | r |= mxtc_config_r(busdevice, device, function, reg + 0) << 0; |
| 156 | r |= mtxc_config_r(busdevice, device, function, reg + 0) << 0; |
| 157 | 157 | } |
| 158 | 158 | return r; |
| 159 | 159 | } |
| r32808 | r32809 | |
| 162 | 162 | { |
| 163 | 163 | if (ACCESSING_BITS_24_31) |
| 164 | 164 | { |
| 165 | | mxtc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 165 | mtxc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 166 | 166 | } |
| 167 | 167 | if (ACCESSING_BITS_16_23) |
| 168 | 168 | { |
| 169 | | mxtc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 169 | mtxc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 170 | 170 | } |
| 171 | 171 | if (ACCESSING_BITS_8_15) |
| 172 | 172 | { |
| 173 | | mxtc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 173 | mtxc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 174 | 174 | } |
| 175 | 175 | if (ACCESSING_BITS_0_7) |
| 176 | 176 | { |
| 177 | | mxtc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 177 | mtxc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | |
| r32808 | r32809 | |
| 257 | 257 | |
| 258 | 258 | WRITE32_MEMBER(taitowlf_state::bios_ram_w) |
| 259 | 259 | { |
| 260 | | if (m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 260 | if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 261 | 261 | { |
| 262 | 262 | COMBINE_DATA(m_bios_ram + offset); |
| 263 | 263 | } |
trunk/src/mame/drivers/gamecstl.c
| r32808 | r32809 | |
| 83 | 83 | required_device<gfxdecode_device> m_gfxdecode; |
| 84 | 84 | required_device<palette_device> m_palette; |
| 85 | 85 | UINT32 *m_bios_ram; |
| 86 | | UINT8 m_mxtc_config_reg[256]; |
| 86 | UINT8 m_mtxc_config_reg[256]; |
| 87 | 87 | UINT8 m_piix4_config_reg[4][256]; |
| 88 | 88 | |
| 89 | 89 | DECLARE_WRITE32_MEMBER(pnp_config_w); |
| r32808 | r32809 | |
| 162 | 162 | return 0; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | | // Intel 82439TX System Controller (MXTC) |
| 165 | // Intel 82439TX System Controller (MTXC) |
| 166 | 166 | |
| 167 | | static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 167 | static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 168 | 168 | { |
| 169 | 169 | gamecstl_state *state = busdevice->machine().driver_data<gamecstl_state>(); |
| 170 | | printf("MXTC: read %d, %02X\n", function, reg); |
| 171 | | return state->m_mxtc_config_reg[reg]; |
| 170 | printf("MTXC: read %d, %02X\n", function, reg); |
| 171 | return state->m_mtxc_config_reg[reg]; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | | static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 174 | static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 175 | 175 | { |
| 176 | 176 | gamecstl_state *state = busdevice->machine().driver_data<gamecstl_state>(); |
| 177 | | printf("%s:MXTC: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data); |
| 177 | printf("%s:MTXC: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data); |
| 178 | 178 | |
| 179 | 179 | switch(reg) |
| 180 | 180 | { |
| r32808 | r32809 | |
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | | state->m_mxtc_config_reg[reg] = data; |
| 195 | state->m_mtxc_config_reg[reg] = data; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | void gamecstl_state::intel82439tx_init() |
| 199 | 199 | { |
| 200 | | m_mxtc_config_reg[0x60] = 0x02; |
| 201 | | m_mxtc_config_reg[0x61] = 0x02; |
| 202 | | m_mxtc_config_reg[0x62] = 0x02; |
| 203 | | m_mxtc_config_reg[0x63] = 0x02; |
| 204 | | m_mxtc_config_reg[0x64] = 0x02; |
| 205 | | m_mxtc_config_reg[0x65] = 0x02; |
| 200 | m_mtxc_config_reg[0x60] = 0x02; |
| 201 | m_mtxc_config_reg[0x61] = 0x02; |
| 202 | m_mtxc_config_reg[0x62] = 0x02; |
| 203 | m_mtxc_config_reg[0x63] = 0x02; |
| 204 | m_mtxc_config_reg[0x64] = 0x02; |
| 205 | m_mtxc_config_reg[0x65] = 0x02; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) |
| r32808 | r32809 | |
| 210 | 210 | UINT32 r = 0; |
| 211 | 211 | if (ACCESSING_BITS_24_31) |
| 212 | 212 | { |
| 213 | | r |= mxtc_config_r(busdevice, device, function, reg + 3) << 24; |
| 213 | r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; |
| 214 | 214 | } |
| 215 | 215 | if (ACCESSING_BITS_16_23) |
| 216 | 216 | { |
| 217 | | r |= mxtc_config_r(busdevice, device, function, reg + 2) << 16; |
| 217 | r |= mtxc_config_r(busdevice, device, function, reg + 2) << 16; |
| 218 | 218 | } |
| 219 | 219 | if (ACCESSING_BITS_8_15) |
| 220 | 220 | { |
| 221 | | r |= mxtc_config_r(busdevice, device, function, reg + 1) << 8; |
| 221 | r |= mtxc_config_r(busdevice, device, function, reg + 1) << 8; |
| 222 | 222 | } |
| 223 | 223 | if (ACCESSING_BITS_0_7) |
| 224 | 224 | { |
| 225 | | r |= mxtc_config_r(busdevice, device, function, reg + 0) << 0; |
| 225 | r |= mtxc_config_r(busdevice, device, function, reg + 0) << 0; |
| 226 | 226 | } |
| 227 | 227 | return r; |
| 228 | 228 | } |
| r32808 | r32809 | |
| 231 | 231 | { |
| 232 | 232 | if (ACCESSING_BITS_24_31) |
| 233 | 233 | { |
| 234 | | mxtc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 234 | mtxc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 235 | 235 | } |
| 236 | 236 | if (ACCESSING_BITS_16_23) |
| 237 | 237 | { |
| 238 | | mxtc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 238 | mtxc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 239 | 239 | } |
| 240 | 240 | if (ACCESSING_BITS_8_15) |
| 241 | 241 | { |
| 242 | | mxtc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 242 | mtxc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 243 | 243 | } |
| 244 | 244 | if (ACCESSING_BITS_0_7) |
| 245 | 245 | { |
| 246 | | mxtc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 246 | mtxc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | |
| r32808 | r32809 | |
| 326 | 326 | |
| 327 | 327 | WRITE32_MEMBER(gamecstl_state::bios_ram_w) |
| 328 | 328 | { |
| 329 | | if (m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 329 | if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 330 | 330 | { |
| 331 | 331 | COMBINE_DATA(m_bios_ram + offset); |
| 332 | 332 | } |
trunk/src/mame/drivers/voyager.c
| r32808 | r32809 | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | UINT32 *m_bios_ram; |
| 33 | | UINT8 m_mxtc_config_reg[256]; |
| 33 | UINT8 m_mtxc_config_reg[256]; |
| 34 | 34 | UINT8 m_piix4_config_reg[4][256]; |
| 35 | 35 | |
| 36 | 36 | UINT32 m_idle_skip_ram; |
| r32808 | r32809 | |
| 42 | 42 | }; |
| 43 | 43 | |
| 44 | 44 | |
| 45 | | // Intel 82439TX System Controller (MXTC) |
| 45 | // Intel 82439TX System Controller (MTXC) |
| 46 | 46 | |
| 47 | | static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 47 | static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) |
| 48 | 48 | { |
| 49 | 49 | voyager_state *state = busdevice->machine().driver_data<voyager_state>(); |
| 50 | | // osd_printf_debug("MXTC: read %d, %02X\n", function, reg); |
| 50 | // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); |
| 51 | 51 | |
| 52 | | return state->m_mxtc_config_reg[reg]; |
| 52 | return state->m_mtxc_config_reg[reg]; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | | static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 55 | static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) |
| 56 | 56 | { |
| 57 | 57 | voyager_state *state = busdevice->machine().driver_data<voyager_state>(); |
| 58 | | // osd_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); |
| 58 | // osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); |
| 59 | 59 | |
| 60 | 60 | switch(reg) |
| 61 | 61 | { |
| r32808 | r32809 | |
| 72 | 72 | //Execution Hack to avoid crash when switch back from Shadow RAM to Bios ROM, since i386 emu haven't yet pipelined execution structure. |
| 73 | 73 | //It happens when exit from BIOS SETUP. |
| 74 | 74 | #if 0 |
| 75 | | if ((state->m_mxtc_config_reg[0x63] & 0x50) | ( state->m_mxtc_config_reg[0x63] & 0xA0)) // Only DO if comes a change to disable ROM. |
| 75 | if ((state->m_mtxc_config_reg[0x63] & 0x50) | ( state->m_mtxc_config_reg[0x63] & 0xA0)) // Only DO if comes a change to disable ROM. |
| 76 | 76 | { |
| 77 | 77 | if ( busdevice->machine(->safe_pc().device("maincpu"))==0xff74e) state->m_maincpu->set_pc(0xff74d); |
| 78 | 78 | } |
| r32808 | r32809 | |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | | state->m_mxtc_config_reg[reg] = data; |
| 88 | state->m_mtxc_config_reg[reg] = data; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | void voyager_state::intel82439tx_init() |
| 92 | 92 | { |
| 93 | | m_mxtc_config_reg[0x60] = 0x02; |
| 94 | | m_mxtc_config_reg[0x61] = 0x02; |
| 95 | | m_mxtc_config_reg[0x62] = 0x02; |
| 96 | | m_mxtc_config_reg[0x63] = 0x02; |
| 97 | | m_mxtc_config_reg[0x64] = 0x02; |
| 98 | | m_mxtc_config_reg[0x65] = 0x02; |
| 93 | m_mtxc_config_reg[0x60] = 0x02; |
| 94 | m_mtxc_config_reg[0x61] = 0x02; |
| 95 | m_mtxc_config_reg[0x62] = 0x02; |
| 96 | m_mtxc_config_reg[0x63] = 0x02; |
| 97 | m_mtxc_config_reg[0x64] = 0x02; |
| 98 | m_mtxc_config_reg[0x65] = 0x02; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) |
| r32808 | r32809 | |
| 107 | 107 | |
| 108 | 108 | if (ACCESSING_BITS_24_31) |
| 109 | 109 | { |
| 110 | | r |= mxtc_config_r(busdevice, device, function, reg + 3) << 24; |
| 110 | r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; |
| 111 | 111 | } |
| 112 | 112 | if (ACCESSING_BITS_16_23) |
| 113 | 113 | { |
| 114 | | r |= mxtc_config_r(busdevice, device, function, reg + 2) << 16; |
| 114 | r |= mtxc_config_r(busdevice, device, function, reg + 2) << 16; |
| 115 | 115 | } |
| 116 | 116 | if (ACCESSING_BITS_8_15) |
| 117 | 117 | { |
| 118 | | r |= mxtc_config_r(busdevice, device, function, reg + 1) << 8; |
| 118 | r |= mtxc_config_r(busdevice, device, function, reg + 1) << 8; |
| 119 | 119 | } |
| 120 | 120 | if (ACCESSING_BITS_0_7) |
| 121 | 121 | { |
| 122 | | r |= mxtc_config_r(busdevice, device, function, reg + 0) << 0; |
| 122 | r |= mtxc_config_r(busdevice, device, function, reg + 0) << 0; |
| 123 | 123 | } |
| 124 | 124 | return r; |
| 125 | 125 | } |
| r32808 | r32809 | |
| 128 | 128 | { |
| 129 | 129 | if (ACCESSING_BITS_24_31) |
| 130 | 130 | { |
| 131 | | mxtc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 131 | mtxc_config_w(busdevice, device, function, reg + 3, (data >> 24) & 0xff); |
| 132 | 132 | } |
| 133 | 133 | if (ACCESSING_BITS_16_23) |
| 134 | 134 | { |
| 135 | | mxtc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 135 | mtxc_config_w(busdevice, device, function, reg + 2, (data >> 16) & 0xff); |
| 136 | 136 | } |
| 137 | 137 | if (ACCESSING_BITS_8_15) |
| 138 | 138 | { |
| 139 | | mxtc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 139 | mtxc_config_w(busdevice, device, function, reg + 1, (data >> 8) & 0xff); |
| 140 | 140 | } |
| 141 | 141 | if (ACCESSING_BITS_0_7) |
| 142 | 142 | { |
| 143 | | mxtc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 143 | mtxc_config_w(busdevice, device, function, reg + 0, (data >> 0) & 0xff); |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
| r32808 | r32809 | |
| 208 | 208 | |
| 209 | 209 | WRITE32_MEMBER(voyager_state::bios_ram_w) |
| 210 | 210 | { |
| 211 | | //if (m_mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 212 | | if (m_mxtc_config_reg[0x63] & 0x50) |
| 211 | //if (m_mtxc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled |
| 212 | if (m_mtxc_config_reg[0x63] & 0x50) |
| 213 | 213 | { |
| 214 | 214 | COMBINE_DATA(m_bios_ram + offset); |
| 215 | 215 | } |