trunk/src/mess/drivers/smc777.c
| r20267 | r20268 | |
| 32 | 32 | public: |
| 33 | 33 | smc777_state(const machine_config &mconfig, device_type type, const char *tag) |
| 34 | 34 | : driver_device(mconfig, type, tag), |
| 35 | m_maincpu(*this, "maincpu"), |
| 36 | m_crtc(*this, "crtc"), |
| 37 | m_fdc(*this, "fdc"), |
| 35 | 38 | m_sn(*this, "sn1") |
| 36 | 39 | { } |
| 37 | 40 | |
| 41 | required_device<cpu_device> m_maincpu; |
| 42 | required_device<mc6845_device> m_crtc; |
| 43 | required_device<mb8876_device> m_fdc; |
| 38 | 44 | optional_device<sn76489a_device> m_sn; |
| 39 | 45 | |
| 40 | 46 | UINT8 *m_ipl_rom; |
| r20267 | r20268 | |
| 243 | 249 | if(offset == 0) |
| 244 | 250 | { |
| 245 | 251 | m_addr_latch = data; |
| 246 | | //mc6845_address_w(machine().device("crtc"), 0,data); |
| 252 | //mc6845_address_w(m_crtc, 0,data); |
| 247 | 253 | } |
| 248 | 254 | else |
| 249 | 255 | { |
| r20267 | r20268 | |
| 254 | 260 | else if(m_addr_latch == 0x0f) |
| 255 | 261 | m_cursor_addr = (m_cursor_addr & 0x3f00) | (data & 0xff); |
| 256 | 262 | |
| 257 | | //mc6845_register_w(machine().device("crtc"), 0,data); |
| 263 | //mc6845_register_w(m_crtc, 0,data); |
| 258 | 264 | } |
| 259 | 265 | } |
| 260 | 266 | |
| r20267 | r20268 | |
| 358 | 364 | |
| 359 | 365 | READ8_MEMBER(smc777_state::smc777_fdc1_r) |
| 360 | 366 | { |
| 361 | | device_t* dev = machine().device("fdc"); |
| 362 | | |
| 363 | 367 | check_floppy_inserted(machine()); |
| 364 | 368 | |
| 365 | 369 | switch(offset) |
| 366 | 370 | { |
| 367 | 371 | case 0x00: |
| 368 | | return wd17xx_status_r(dev,space, offset) ^ 0xff; |
| 372 | return wd17xx_status_r(m_fdc,space, offset) ^ 0xff; |
| 369 | 373 | case 0x01: |
| 370 | | return wd17xx_track_r(dev,space, offset) ^ 0xff; |
| 374 | return wd17xx_track_r(m_fdc,space, offset) ^ 0xff; |
| 371 | 375 | case 0x02: |
| 372 | | return wd17xx_sector_r(dev,space, offset) ^ 0xff; |
| 376 | return wd17xx_sector_r(m_fdc,space, offset) ^ 0xff; |
| 373 | 377 | case 0x03: |
| 374 | | return wd17xx_data_r(dev,space, offset) ^ 0xff; |
| 378 | return wd17xx_data_r(m_fdc,space, offset) ^ 0xff; |
| 375 | 379 | case 0x04: //irq / drq status |
| 376 | 380 | //popmessage("%02x %02x\n",m_fdc_irq_flag,m_fdc_drq_flag); |
| 377 | 381 | |
| r20267 | r20268 | |
| 383 | 387 | |
| 384 | 388 | WRITE8_MEMBER(smc777_state::smc777_fdc1_w) |
| 385 | 389 | { |
| 386 | | device_t* dev = machine().device("fdc"); |
| 387 | | |
| 388 | 390 | check_floppy_inserted(machine()); |
| 389 | 391 | |
| 390 | 392 | switch(offset) |
| 391 | 393 | { |
| 392 | 394 | case 0x00: |
| 393 | | wd17xx_command_w(dev,space, offset,data ^ 0xff); |
| 395 | wd17xx_command_w(m_fdc,space, offset,data ^ 0xff); |
| 394 | 396 | break; |
| 395 | 397 | case 0x01: |
| 396 | | wd17xx_track_w(dev,space, offset,data ^ 0xff); |
| 398 | wd17xx_track_w(m_fdc,space, offset,data ^ 0xff); |
| 397 | 399 | break; |
| 398 | 400 | case 0x02: |
| 399 | | wd17xx_sector_w(dev,space, offset,data ^ 0xff); |
| 401 | wd17xx_sector_w(m_fdc,space, offset,data ^ 0xff); |
| 400 | 402 | break; |
| 401 | 403 | case 0x03: |
| 402 | | wd17xx_data_w(dev,space, offset,data ^ 0xff); |
| 404 | wd17xx_data_w(m_fdc,space, offset,data ^ 0xff); |
| 403 | 405 | break; |
| 404 | 406 | case 0x04: |
| 405 | 407 | // ---- xxxx select floppy drive (yes, 15 of them, A to P) |
| 406 | | wd17xx_set_drive(dev,data & 0x01); |
| 407 | | // wd17xx_set_side(dev,(data & 0x10)>>4); |
| 408 | wd17xx_set_drive(m_fdc,data & 0x01); |
| 409 | // wd17xx_set_side(m_fdc,(data & 0x10)>>4); |
| 408 | 410 | if(data & 0xf0) |
| 409 | 411 | printf("floppy access %02x\n",data); |
| 410 | 412 | break; |
| r20267 | r20268 | |
| 955 | 957 | void smc777_state::machine_start() |
| 956 | 958 | { |
| 957 | 959 | m_ipl_rom = memregion("ipl")->base(); |
| 958 | | m_work_ram = auto_alloc_array(machine(), UINT8, 0x10000); |
| 959 | | m_vram = auto_alloc_array(machine(), UINT8, 0x800); |
| 960 | | m_attr = auto_alloc_array(machine(), UINT8, 0x800); |
| 961 | | m_gvram = auto_alloc_array(machine(), UINT8, 0x8000); |
| 962 | | m_pcg = auto_alloc_array(machine(), UINT8, 0x800); |
| 960 | m_work_ram = auto_alloc_array_clear(machine(), UINT8, 0x10000); |
| 961 | m_vram = auto_alloc_array_clear(machine(), UINT8, 0x800); |
| 962 | m_attr = auto_alloc_array_clear(machine(), UINT8, 0x800); |
| 963 | m_gvram = auto_alloc_array_clear(machine(), UINT8, 0x8000); |
| 964 | m_pcg = auto_alloc_array_clear(machine(), UINT8, 0x800); |
| 963 | 965 | |
| 964 | 966 | state_save_register_global_pointer(machine(), m_work_ram, 0x10000); |
| 965 | 967 | state_save_register_global_pointer(machine(), m_vram, 0x800); |