trunk/src/mess/machine/at.c
| r26061 | r26062 | |
| 266 | 266 | READ8_MEMBER( at_state::at_portb_r ) |
| 267 | 267 | { |
| 268 | 268 | UINT8 data = m_at_speaker; |
| 269 | | data &= ~0xc0; /* AT BIOS don't likes this being set */ |
| 269 | data &= ~0xd0; /* AT BIOS don't likes this being set */ |
| 270 | 270 | |
| 271 | | /* 0x10 is the dram refresh line bit. The 5170 (bios 1) and 5162 test the cpu clock against it in post. */ |
| 272 | | if ( --m_poll_delay < 0 ) |
| 273 | | { |
| 274 | | if(m_type == TYPE_286) |
| 275 | | m_poll_delay = m_at_offset1 ? 3 : 2; |
| 276 | | else |
| 277 | | m_poll_delay = 3; |
| 278 | | m_at_offset1 ^= 0x10; |
| 279 | | } |
| 280 | | data = (data & ~0x10) | ( m_at_offset1 & 0x10 ); |
| 271 | /* 0x10 is the dram refresh line bit, 15.085us. */ |
| 272 | data |= (machine().time().as_ticks(110000) & 1) ? 0x10 : 0; |
| 281 | 273 | |
| 282 | 274 | if (m_pit8254->get_output(2)) |
| 283 | 275 | data |= 0x20; |
| r26061 | r26062 | |
| 307 | 299 | { |
| 308 | 300 | address_space& space = m_maincpu->space(AS_PROGRAM); |
| 309 | 301 | |
| 310 | | if(!strncmp(m_maincpu->shortname(), "i386", 4)) |
| 311 | | m_type = TYPE_386; |
| 312 | | else if(!strncmp(m_maincpu->shortname(), "i486", 4)) |
| 313 | | m_type = TYPE_486; |
| 314 | | else |
| 315 | | m_type = TYPE_286; |
| 316 | | |
| 317 | 302 | /* MESS managed RAM */ |
| 318 | 303 | membank("bank10")->set_base(m_ram->pointer()); |
| 319 | 304 | |
| r26061 | r26062 | |
| 324 | 309 | space.install_write_bank(0x100000, ram_limit - 1, "bank1"); |
| 325 | 310 | membank("bank1")->set_base(m_ram->pointer() + 0xa0000); |
| 326 | 311 | } |
| 327 | | |
| 328 | | if(m_type == TYPE_286) |
| 329 | | m_at_offset1 = 0; |
| 330 | | else |
| 331 | | m_at_offset1 = 0xff; |
| 332 | 312 | } |
| 333 | 313 | |
| 334 | 314 | DRIVER_INIT_MEMBER(at_state,atcga) |
| r26061 | r26062 | |
| 343 | 323 | |
| 344 | 324 | DRIVER_INIT_MEMBER(at586_state,at586) |
| 345 | 325 | { |
| 346 | | m_type = TYPE_586; |
| 347 | | m_at_offset1 = 0xff; |
| 348 | 326 | } |
| 349 | 327 | |
| 350 | 328 | IRQ_CALLBACK_MEMBER(at_state::at_irq_callback) |
| r26061 | r26062 | |
| 359 | 337 | |
| 360 | 338 | MACHINE_RESET_MEMBER(at_state,at) |
| 361 | 339 | { |
| 362 | | if(m_type == TYPE_286) |
| 363 | | m_poll_delay = 3; |
| 364 | | else |
| 365 | | m_poll_delay = 4; |
| 366 | 340 | m_at_spkrdata = 0; |
| 367 | 341 | m_at_speaker_input = 0; |
| 368 | 342 | m_dma_channel = -1; |
trunk/src/mess/machine/southbridge.c
| r26061 | r26062 | |
| 224 | 224 | spaceio.nop_readwrite(0x00e0, 0x00ef); |
| 225 | 225 | |
| 226 | 226 | |
| 227 | | m_at_offset1 = 0xff; |
| 228 | 227 | machine().device(":maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(southbridge_device::at_irq_callback),this)); |
| 229 | 228 | } |
| 230 | 229 | |
| r26061 | r26062 | |
| 234 | 233 | |
| 235 | 234 | void southbridge_device::device_reset() |
| 236 | 235 | { |
| 237 | | m_poll_delay = 4; |
| 238 | 236 | m_at_spkrdata = 0; |
| 239 | 237 | m_at_speaker_input = 0; |
| 240 | 238 | m_dma_channel = -1; |
| r26061 | r26062 | |
| 454 | 452 | READ8_MEMBER( southbridge_device::at_portb_r ) |
| 455 | 453 | { |
| 456 | 454 | UINT8 data = m_at_speaker; |
| 457 | | data &= ~0xc0; /* AT BIOS don't likes this being set */ |
| 455 | data &= ~0xd0; /* AT BIOS don't likes this being set */ |
| 458 | 456 | |
| 459 | | /* This needs fixing/updating not sure what this is meant to fix */ |
| 460 | | if ( --m_poll_delay < 0 ) |
| 461 | | { |
| 462 | | m_poll_delay = 25; |
| 463 | | m_at_offset1 ^= 0x10; |
| 464 | | } |
| 465 | | data = (data & ~0x10) | ( m_at_offset1 & 0x10 ); |
| 457 | /* 0x10 is the dram refresh line bit on the 5170, just a timer here, 15.085us. */ |
| 458 | data |= (machine().time().as_ticks(110000) & 1) ? 0x10 : 0; |
| 466 | 459 | |
| 467 | 460 | if (m_pit8254->get_output(2)) |
| 468 | 461 | data |= 0x20; |
trunk/src/mess/includes/at.h
| r26061 | r26062 | |
| 51 | 51 | required_device<cpu_device> m_maincpu; |
| 52 | 52 | |
| 53 | 53 | DECLARE_DRIVER_INIT(at586); |
| 54 | | |
| 55 | | UINT8 m_at_offset1; |
| 56 | | |
| 57 | | enum { |
| 58 | | TYPE_586 |
| 59 | | }; |
| 60 | | |
| 61 | | int m_type; |
| 62 | 54 | }; |
| 63 | 55 | |
| 64 | 56 | class at_state : public driver_device |
| r26061 | r26062 | |
| 137 | 129 | DECLARE_WRITE16_MEMBER(neat_chipset_w); |
| 138 | 130 | DECLARE_WRITE_LINE_MEMBER(at_mc146818_irq); |
| 139 | 131 | DECLARE_WRITE8_MEMBER(write_rtc); |
| 140 | | int m_poll_delay; |
| 141 | 132 | UINT8 m_at_spkrdata; |
| 142 | 133 | UINT8 m_at_speaker_input; |
| 143 | 134 | int m_dma_channel; |
| r26061 | r26062 | |
| 146 | 137 | UINT8 m_at_pages[0x10]; |
| 147 | 138 | UINT16 m_dma_high_byte; |
| 148 | 139 | UINT8 m_at_speaker; |
| 149 | | UINT8 m_at_offset1; |
| 150 | 140 | UINT16 m_ps1_reg[2]; |
| 151 | 141 | DECLARE_READ16_MEMBER(ps1_unk_r); |
| 152 | 142 | DECLARE_WRITE16_MEMBER(ps1_unk_w); |
| r26061 | r26062 | |
| 171 | 161 | IRQ_CALLBACK_MEMBER(at_irq_callback); |
| 172 | 162 | void init_at_common(); |
| 173 | 163 | UINT32 at_286_a20(bool state); |
| 174 | | |
| 175 | | enum { |
| 176 | | TYPE_286, |
| 177 | | TYPE_386, |
| 178 | | TYPE_486, |
| 179 | | }; |
| 180 | | |
| 181 | | int m_type; |
| 182 | 164 | }; |
| 183 | 165 | |
| 184 | 166 | |