src/mess/drivers/fmtowns.c
| r5992 | r5993 | |
| 91 | 91 | static UINT32 towns_mainmem_enable; |
| 92 | 92 | static UINT32 towns_ram_enable; |
| 93 | 93 | static UINT32* towns_vram; |
| 94 | | static UINT32* towns_cmos; |
| 94 | static UINT8* towns_cmos; |
| 95 | 95 | static UINT8* towns_gfxvram; |
| 96 | 96 | static UINT8* towns_txtvram; |
| 97 | 97 | static UINT8 towns_vram_wplane; |
| r5992 | r5993 | |
| 327 | 327 | floppy_drive_set_ready_state(floppy_get_device(space->machine, towns_selected_drive-1), data & 0x10,0); |
| 328 | 328 | } |
| 329 | 329 | } |
| 330 | | // bit 2 - HDISEL |
| 330 | wd17xx_set_side(fdc,(data & 0x04)>>2); |
| 331 | 331 | // bit 1 - DDEN |
| 332 | 332 | // bit 0 - IRQMSK |
| 333 | 333 | logerror("FDC: write %02x to offset 0x08\n",data); |
| r5992 | r5993 | |
| 340 | 340 | break; |
| 341 | 341 | case 0x01: |
| 342 | 342 | towns_selected_drive = 1; |
| 343 | wd17xx_set_drive(fdc,0); |
| 343 | 344 | break; |
| 344 | 345 | case 0x02: |
| 345 | 346 | towns_selected_drive = 2; |
| 347 | wd17xx_set_drive(fdc,1); |
| 346 | 348 | break; |
| 347 | 349 | case 0x04: |
| 348 | 350 | towns_selected_drive = 3; |
| 351 | wd17xx_set_drive(fdc,2); |
| 349 | 352 | break; |
| 350 | 353 | case 0x08: |
| 351 | 354 | towns_selected_drive = 4; |
| 355 | wd17xx_set_drive(fdc,3); |
| 352 | 356 | break; |
| 353 | 357 | } |
| 354 | 358 | logerror("FDC: drive select %02x\n",data); |
| r5992 | r5993 | |
| 535 | 539 | |
| 536 | 540 | static READ8_HANDLER( towns_cmos8_r ) |
| 537 | 541 | { |
| 538 | | UINT8* cmos = (UINT8*)towns_cmos; |
| 539 | | |
| 540 | | return cmos[offset]; |
| 542 | return towns_cmos[offset]; |
| 541 | 543 | } |
| 542 | 544 | |
| 543 | 545 | static WRITE8_HANDLER( towns_cmos8_w ) |
| 544 | 546 | { |
| 545 | | UINT8* cmos = (UINT8*)towns_cmos; |
| 546 | | |
| 547 | | cmos[offset] = data; |
| 547 | towns_cmos[offset] = data; |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | static READ8_HANDLER( towns_cmos_low_r ) |
| 551 | 551 | { |
| 552 | | UINT8* cmos = (UINT8*)towns_cmos; |
| 553 | | |
| 554 | 552 | if(towns_mainmem_enable != 0) |
| 555 | 553 | return mess_ram[offset + 0xd8000]; |
| 556 | 554 | |
| 557 | | return cmos[offset]; |
| 555 | return towns_cmos[offset]; |
| 558 | 556 | } |
| 559 | 557 | |
| 560 | 558 | static WRITE8_HANDLER( towns_cmos_low_w ) |
| 561 | 559 | { |
| 562 | | UINT8* cmos = (UINT8*)towns_cmos; |
| 563 | | |
| 564 | 560 | if(towns_mainmem_enable != 0) |
| 565 | 561 | mess_ram[offset+0xd8000] = data; |
| 566 | 562 | else |
| 567 | | cmos[offset] = data; |
| 563 | towns_cmos[offset] = data; |
| 568 | 564 | } |
| 569 | 565 | |
| 570 | | static READ32_HANDLER( towns_cmos_r ) |
| 566 | static READ8_HANDLER( towns_cmos_r ) |
| 571 | 567 | { |
| 572 | 568 | return towns_cmos[offset]; |
| 573 | 569 | } |
| 574 | 570 | |
| 575 | | static WRITE32_HANDLER( towns_cmos_w ) |
| 571 | static WRITE8_HANDLER( towns_cmos_w ) |
| 576 | 572 | { |
| 577 | | COMBINE_DATA(towns_cmos+offset); |
| 573 | towns_cmos[offset] = data; |
| 578 | 574 | } |
| 579 | 575 | |
| 580 | 576 | static WRITE8_HANDLER( towns_gfx_w ) |
| r5992 | r5993 | |
| 818 | 814 | AM_RANGE(0xc2000000, 0xc207ffff) AM_ROM AM_REGION("user",0x000000) // OS ROM |
| 819 | 815 | AM_RANGE(0xc2080000, 0xc20fffff) AM_ROM AM_REGION("user",0x100000) // DIC ROM |
| 820 | 816 | AM_RANGE(0xc2100000, 0xc213ffff) AM_ROM AM_REGION("user",0x180000) // FONT ROM |
| 821 | | AM_RANGE(0xc2140000, 0xc2141fff) AM_READWRITE(towns_cmos_r,towns_cmos_w) // CMOS (mirror?) |
| 817 | AM_RANGE(0xc2140000, 0xc2141fff) AM_READWRITE8(towns_cmos_r,towns_cmos_w,0xffffffff) // CMOS (mirror?) |
| 822 | 818 | AM_RANGE(0xc2200000, 0xc2200fff) AM_NOP // WAVE RAM |
| 823 | 819 | AM_RANGE(0xfffc0000, 0xffffffff) AM_ROM AM_REGION("user",0x200000) // SYSTEM ROM |
| 824 | 820 | ADDRESS_MAP_END |
| r5992 | r5993 | |
| 880 | 876 | static DRIVER_INIT( towns ) |
| 881 | 877 | { |
| 882 | 878 | towns_vram = auto_alloc_array(machine,UINT32,0x20000); |
| 883 | | towns_cmos = auto_alloc_array(machine,UINT32,0x2000/(sizeof(UINT32))); |
| 879 | towns_cmos = auto_alloc_array(machine,UINT8,0x2000); |
| 884 | 880 | towns_gfxvram = auto_alloc_array(machine,UINT8,0x200000); |
| 885 | 881 | towns_txtvram = auto_alloc_array(machine,UINT8,0x8000); |
| 886 | 882 | towns_serial_rom = auto_alloc_array(machine,UINT8,256/8); |
| r5992 | r5993 | |
| 1047 | 1043 | MDRV_PIC8259_ADD( "pic8259_slave", towns_pic8259_slave_config ) |
| 1048 | 1044 | |
| 1049 | 1045 | MDRV_MB8877_ADD("fdc",towns_mb8877a_interface) |
| 1050 | | MDRV_FLOPPY_2_DRIVES_ADD(towns_floppy_config) |
| 1046 | MDRV_FLOPPY_4_DRIVES_ADD(towns_floppy_config) |
| 1051 | 1047 | |
| 1052 | 1048 | MDRV_UPD71071_ADD("dma_1",towns_dma_config) |
| 1053 | 1049 | MDRV_UPD71071_ADD("dma_2",towns_dma_config) |