src/mess/machine/at45dbxx.c
| r3675 | r3676 | |
| 119 | 119 | { |
| 120 | 120 | const char *name = "at45dbxx"; |
| 121 | 121 | // data |
| 122 | | state_save_register_item_pointer( name, 0, flash.data, flash.size); |
| 122 | state_save_register_item_pointer( name, NULL, 0, flash.data, flash.size); |
| 123 | 123 | // pins |
| 124 | | state_save_register_item( name, 0, flash.pin.cs); |
| 125 | | state_save_register_item( name, 0, flash.pin.sck); |
| 126 | | state_save_register_item( name, 0, flash.pin.si); |
| 127 | | state_save_register_item( name, 0, flash.pin.so); |
| 128 | | state_save_register_item( name, 0, flash.pin.wp); |
| 129 | | state_save_register_item( name, 0, flash.pin.reset); |
| 130 | | state_save_register_item( name, 0, flash.pin.busy); |
| 124 | state_save_register_item( name, NULL, 0, flash.pin.cs); |
| 125 | state_save_register_item( name, NULL, 0, flash.pin.sck); |
| 126 | state_save_register_item( name, NULL, 0, flash.pin.si); |
| 127 | state_save_register_item( name, NULL, 0, flash.pin.so); |
| 128 | state_save_register_item( name, NULL, 0, flash.pin.wp); |
| 129 | state_save_register_item( name, NULL, 0, flash.pin.reset); |
| 130 | state_save_register_item( name, NULL, 0, flash.pin.busy); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | static UINT8 at45dbxx_read_byte( void) |
src/mess/machine/concept.c
| r3675 | r3676 | |
| 75 | 75 | |
| 76 | 76 | static struct |
| 77 | 77 | { |
| 78 | | read8_machine_func reg_read; |
| 79 | | write8_machine_func reg_write; |
| 80 | | read8_machine_func rom_read; |
| 81 | | write8_machine_func rom_write; |
| 78 | read8_space_func reg_read; |
| 79 | write8_space_func reg_write; |
| 80 | read8_space_func rom_read; |
| 81 | write8_space_func rom_write; |
| 82 | 82 | } expansion_slots[4]; |
| 83 | 83 | |
| 84 | 84 | static void concept_fdc_init(running_machine *machine, int slot); |
| r3675 | r3676 | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | static void install_expansion_slot(int slot, |
| 113 | | read8_machine_func reg_read, write8_machine_func reg_write, |
| 114 | | read8_machine_func rom_read, write8_machine_func rom_write) |
| 113 | read8_space_func reg_read, write8_space_func reg_write, |
| 114 | read8_space_func rom_read, write8_space_func rom_write) |
| 115 | 115 | { |
| 116 | 116 | expansion_slots[slot].reg_read = reg_read; |
| 117 | 117 | expansion_slots[slot].reg_write = reg_write; |
| r3675 | r3676 | |
| 208 | 208 | |
| 209 | 209 | INTERRUPT_GEN( concept_interrupt ) |
| 210 | 210 | { |
| 211 | | poll_keyboard(machine); |
| 211 | poll_keyboard(device->machine); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /* |
| r3675 | r3676 | |
| 247 | 247 | 6: boot switch 0 (I) |
| 248 | 248 | 7: boot switch 1 (I) |
| 249 | 249 | */ |
| 250 | | static READ8_HANDLER(via_in_b) |
| 250 | static READ8_HANDLER(via_in_b) |
| 251 | 251 | { |
| 252 | 252 | UINT8 status; |
| 253 | 253 | |
| 254 | | status = ((input_port_read(machine, "DSW0") & 0x80) >> 1) | ((input_port_read(machine, "DSW0") & 0x40) << 1); |
| 254 | status = ((input_port_read(space->machine, "DSW0") & 0x80) >> 1) | ((input_port_read(space->machine, "DSW0") & 0x40) << 1); |
| 255 | 255 | LOG(("via_in_b: VIA port B (DIP switches, Video, Comm Rate) - status: 0x%2.2x\n", status)); |
| 256 | 256 | return status; |
| 257 | 257 | } |
| r3675 | r3676 | |
| 299 | 299 | { |
| 300 | 300 | int slot = ((offset >> 4) & 7) - 1; |
| 301 | 301 | if (expansion_slots[slot].reg_read) |
| 302 | | return expansion_slots[slot].reg_read(machine, offset & 0xf); |
| 302 | return expansion_slots[slot].reg_read(space, offset & 0xf); |
| 303 | 303 | } |
| 304 | 304 | break; |
| 305 | 305 | |
| r3675 | r3676 | |
| 322 | 322 | int slot = ((offset >> 8) & 7) - 1; |
| 323 | 323 | LOG(("concept_io_r: Slot ROM memory accessed for slot %d at address 0x03%4.4x\n", slot, offset << 1)); |
| 324 | 324 | if (expansion_slots[slot].rom_read) |
| 325 | | return expansion_slots[slot].rom_read(machine, offset & 0xff); |
| 325 | return expansion_slots[slot].rom_read(space, offset & 0xff); |
| 326 | 326 | } |
| 327 | 327 | break; |
| 328 | 328 | |
| r3675 | r3676 | |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | if (!KeyQueueLen) |
| 363 | | concept_set_interrupt(machine, KEYINT_level, 0); |
| 363 | concept_set_interrupt(space->machine, KEYINT_level, 0); |
| 364 | 364 | |
| 365 | 365 | return reply; |
| 366 | 366 | |
| r3675 | r3676 | |
| 382 | 382 | case 3: |
| 383 | 383 | /* NVIA versatile system interface */ |
| 384 | 384 | LOG(("concept_io_r: VIA read at address 0x03%4.4x\n", offset << 1)); |
| 385 | | return via_read(machine, 0, offset & 0xf); |
| 385 | return via_read(space->machine, 0, offset & 0xf); |
| 386 | 386 | break; |
| 387 | 387 | |
| 388 | 388 | case 4: |
| r3675 | r3676 | |
| 438 | 438 | LOG(("concept_io_w: Slot I/O register written for slot %d at address 0x03%4.4x, data: 0x%4.4x\n", |
| 439 | 439 | slot, offset << 1, data)); |
| 440 | 440 | if (expansion_slots[slot].reg_write) |
| 441 | | expansion_slots[slot].reg_write(machine, offset & 0xf, data); |
| 441 | expansion_slots[slot].reg_write(space, offset & 0xf, data); |
| 442 | 442 | } |
| 443 | 443 | break; |
| 444 | 444 | |
| r3675 | r3676 | |
| 461 | 461 | int slot = ((offset >> 8) & 7) - 1; |
| 462 | 462 | LOG(("concept_io_w: Slot ROM memory written to for slot %d at address 0x03%4.4x, data: 0x%4.4x\n", slot, offset << 1, data)); |
| 463 | 463 | if (expansion_slots[slot].rom_write) |
| 464 | | expansion_slots[slot].rom_write(machine, offset & 0xff, data); |
| 464 | expansion_slots[slot].rom_write(space, offset & 0xff, data); |
| 465 | 465 | } |
| 466 | 466 | break; |
| 467 | 467 | |
| r3675 | r3676 | |
| 492 | 492 | |
| 493 | 493 | case 3: |
| 494 | 494 | /* NVIA versatile system interface */ |
| 495 | | via_write(machine, 0, offset & 0xf, data); |
| 495 | via_write(space->machine, 0, offset & 0xf, data); |
| 496 | 496 | break; |
| 497 | 497 | |
| 498 | 498 | case 4: |
| r3675 | r3676 | |
| 612 | 612 | |
| 613 | 613 | case 8: |
| 614 | 614 | /* FDC STATUS REG */ |
| 615 | | return wd17xx_status_r(machine, offset); |
| 615 | return wd17xx_status_r(space, offset); |
| 616 | 616 | break; |
| 617 | 617 | |
| 618 | 618 | case 9: |
| 619 | 619 | /* FDC TRACK REG */ |
| 620 | | return wd17xx_track_r(machine, offset); |
| 620 | return wd17xx_track_r(space, offset); |
| 621 | 621 | break; |
| 622 | 622 | |
| 623 | 623 | case 10: |
| 624 | 624 | /* FDC SECTOR REG */ |
| 625 | | return wd17xx_sector_r(machine, offset); |
| 625 | return wd17xx_sector_r(space, offset); |
| 626 | 626 | break; |
| 627 | 627 | |
| 628 | 628 | case 11: |
| 629 | 629 | /* FDC DATA REG */ |
| 630 | | return wd17xx_data_r(machine, offset); |
| 630 | return wd17xx_data_r(space, offset); |
| 631 | 631 | break; |
| 632 | 632 | } |
| 633 | 633 | |
| r3675 | r3676 | |
| 656 | 656 | |
| 657 | 657 | case 8: |
| 658 | 658 | /* FDC COMMAMD REG */ |
| 659 | | wd17xx_command_w(machine, offset, data); |
| 659 | wd17xx_command_w(space, offset, data); |
| 660 | 660 | break; |
| 661 | 661 | |
| 662 | 662 | case 9: |
| 663 | 663 | /* FDC TRACK REG */ |
| 664 | | wd17xx_track_w(machine, offset, data); |
| 664 | wd17xx_track_w(space, offset, data); |
| 665 | 665 | break; |
| 666 | 666 | |
| 667 | 667 | case 10: |
| 668 | 668 | /* FDC SECTOR REG */ |
| 669 | | wd17xx_sector_w(machine, offset, data); |
| 669 | wd17xx_sector_w(space, offset, data); |
| 670 | 670 | break; |
| 671 | 671 | |
| 672 | 672 | case 11: |
| 673 | 673 | /* FDC DATA REG */ |
| 674 | | wd17xx_data_w(machine, offset, data); |
| 674 | wd17xx_data_w(space, offset, data); |
| 675 | 675 | break; |
| 676 | 676 | } |
| 677 | 677 | } |
| r3675 | r3676 | |
| 703 | 703 | /* |
| 704 | 704 | * Handle reads against the Hard Disk Controller's onboard registers |
| 705 | 705 | */ |
| 706 | | static READ8_HANDLER(concept_hdc_reg_r) |
| 706 | static READ8_HANDLER(concept_hdc_reg_r) |
| 707 | 707 | { |
| 708 | 708 | switch (offset) |
| 709 | 709 | { |
| 710 | 710 | case 0: |
| 711 | 711 | /* HDC Data Register */ |
| 712 | | return corvus_hdc_data_r(machine, offset); |
| 712 | return corvus_hdc_data_r(space, offset); |
| 713 | 713 | break; |
| 714 | 714 | |
| 715 | 715 | case 1: |
| 716 | 716 | /* HDC Status Register */ |
| 717 | | return corvus_hdc_status_r(machine, offset); |
| 717 | return corvus_hdc_status_r(space, offset); |
| 718 | 718 | break; |
| 719 | 719 | } |
| 720 | 720 | |
| r3675 | r3676 | |
| 730 | 730 | { |
| 731 | 731 | case 0: |
| 732 | 732 | /* HDC Data Register */ |
| 733 | | corvus_hdc_data_w(machine, offset, data); |
| 733 | corvus_hdc_data_w(space, offset, data); |
| 734 | 734 | break; |
| 735 | 735 | } |
| 736 | 736 | } |
src/mess/machine/cybiko.c
| r3675 | r3676 | |
| 81 | 81 | |
| 82 | 82 | static void init_ram_handler(running_machine *machine, offs_t start, offs_t size, offs_t mirror) |
| 83 | 83 | { |
| 84 | | memory_install_read_handler(machine, 0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, mirror - size, STATIC_BANK1); |
| 85 | | memory_install_write_handler(machine, 0, ADDRESS_SPACE_PROGRAM, start, start + size - 1, 0, mirror - size, STATIC_BANK1); |
| 86 | | memory_set_bankptr( 1, mess_ram); |
| 84 | memory_install_read_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), start, start + size - 1, 0, mirror - size, STATIC_BANK1); |
| 85 | memory_install_write_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), start, start + size - 1, 0, mirror - size, STATIC_BANK1); |
| 86 | memory_set_bankptr( machine, 1, mess_ram); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | DRIVER_INIT( cybikov1 ) |
| r3675 | r3676 | |
| 210 | 210 | // multi-purpose flash |
| 211 | 211 | sst39vfx_init( SST39VF020, 16, CPU_IS_BE); |
| 212 | 212 | nvram_system_load( machine, "flash2", &sst39vfx_load, 1); |
| 213 | | memory_set_bankptr( 2, sst39vfx_get_base()); |
| 213 | memory_set_bankptr( machine, 2, sst39vfx_get_base()); |
| 214 | 214 | // serial port |
| 215 | 215 | cybiko_rs232_init(); |
| 216 | 216 | // other |
| r3675 | r3676 | |
| 226 | 226 | // multi-purpose flash |
| 227 | 227 | sst39vfx_init( SST39VF400A, 16, CPU_IS_BE); |
| 228 | 228 | nvram_system_load( machine, "flash1", &sst39vfx_load, 1); |
| 229 | | memory_set_bankptr( 2, sst39vfx_get_base()); |
| 229 | memory_set_bankptr( machine, 2, sst39vfx_get_base()); |
| 230 | 230 | // serial port |
| 231 | 231 | cybiko_rs232_init(); |
| 232 | 232 | // other |
| r3675 | r3676 | |
| 428 | 428 | for (i=1; i<10; i++) |
| 429 | 429 | { |
| 430 | 430 | if (!(offset & (1 << i))) |
| 431 | | data &= input_port_read(machine, keynames[i-1]); |
| 431 | data &= input_port_read(space->machine, keynames[i-1]); |
| 432 | 432 | } |
| 433 | 433 | // A0 |
| 434 | 434 | if (!(offset & (1 << 0))) |
| r3675 | r3676 | |
| 441 | 441 | { |
| 442 | 442 | UINT16 data = 0; |
| 443 | 443 | _logerror( 2, ("cybiko_key_r (%08X/%04X)\n", offset, mem_mask)); |
| 444 | | if ACCESSING_BITS_8_15 data = data | (cybiko_key_r_byte(machine, offset * 2 + 0) << 8); |
| 445 | | if ACCESSING_BITS_0_7 data = data | (cybiko_key_r_byte(machine, offset * 2 + 1) << 0); |
| 444 | if ACCESSING_BITS_8_15 data = data | (cybiko_key_r_byte(space, offset * 2 + 0) << 8); |
| 445 | if ACCESSING_BITS_0_7 data = data | (cybiko_key_r_byte(space, offset * 2 + 1) << 0); |
| 446 | 446 | _logerror( 2, ("%04X\n", data)); |
| 447 | 447 | return data; |
| 448 | 448 | } |
| r3675 | r3676 | |
| 456 | 456 | // keyboard |
| 457 | 457 | case H8S_IO_PORT1 : |
| 458 | 458 | { |
| 459 | | //if (input_port_read(machine, "A1") & 0x02) data = data | 0x08; else data = data & (~0x08); // "esc" key |
| 459 | //if (input_port_read(space->machine, "A1") & 0x02) data = data | 0x08; else data = data & (~0x08); // "esc" key |
| 460 | 460 | data = data | 0x08; |
| 461 | 461 | } |
| 462 | 462 | break; |
| r3675 | r3676 | |
| 512 | 512 | READ8_HANDLER( cybikov1_io_reg_r ) |
| 513 | 513 | { |
| 514 | 514 | _logerror( 2, ("cybikov1_io_reg_r (%08X)\n", offset)); |
| 515 | | return cybiko_io_reg_r(machine, offset); |
| 515 | return cybiko_io_reg_r(space, offset); |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | READ8_HANDLER( cybikov2_io_reg_r ) |
| 519 | 519 | { |
| 520 | 520 | _logerror( 2, ("cybikov2_io_reg_r (%08X)\n", offset)); |
| 521 | | return cybiko_io_reg_r(machine, offset); |
| 521 | return cybiko_io_reg_r(space, offset); |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | READ8_HANDLER( cybikoxt_io_reg_r ) |
| r3675 | r3676 | |
| 530 | 530 | // rs232 |
| 531 | 531 | case H8S_IO_PORT3 : if (cybiko_rs232_pin_rxd()) data = data | H8S_P3_RXD1; break; |
| 532 | 532 | // default |
| 533 | | default : data = cybiko_io_reg_r(machine, offset); |
| 533 | default : data = cybiko_io_reg_r(space, offset); |
| 534 | 534 | } |
| 535 | 535 | return data; |
| 536 | 536 | } |
| r3675 | r3676 | |
| 538 | 538 | WRITE8_HANDLER( cybikov1_io_reg_w ) |
| 539 | 539 | { |
| 540 | 540 | _logerror( 2, ("cybikov1_io_reg_w (%08X/%02X)\n", offset, data)); |
| 541 | | cybiko_io_reg_w(machine, offset, data); |
| 541 | cybiko_io_reg_w(space, offset, data); |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | WRITE8_HANDLER( cybikov2_io_reg_w ) |
| 545 | 545 | { |
| 546 | 546 | _logerror( 2, ("cybikov2_io_reg_w (%08X/%02X)\n", offset, data)); |
| 547 | | cybiko_io_reg_w(machine, offset, data); |
| 547 | cybiko_io_reg_w(space, offset, data); |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | WRITE8_HANDLER( cybikoxt_io_reg_w ) |
| r3675 | r3676 | |
| 560 | 560 | } |
| 561 | 561 | break; |
| 562 | 562 | // default |
| 563 | | default : cybiko_io_reg_w(machine, offset, data); |
| 563 | default : cybiko_io_reg_w(space, offset, data); |
| 564 | 564 | } |
| 565 | 565 | } |
| 566 | 566 | |
src/mess/drivers/cpschngr.c
| r3675 | r3676 | |
| 32 | 32 | void forogttn_dummy_function(running_machine *machine) |
| 33 | 33 | { |
| 34 | 34 | /* Forgotten Worlds has extra inputs on the B-board CN-MOWS connector for the dial controls. */ |
| 35 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800040, 0x800041, 0, 0, forgottn_dial_0_reset_w); |
| 36 | | memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800048, 0x800049, 0, 0, forgottn_dial_1_reset_w); |
| 37 | | memory_install_read16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x800052, 0x800055, 0, 0, forgottn_dial_0_r); |
| 38 | | memory_install_read16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x80005a, 0x80005d, 0, 0, forgottn_dial_1_r); |
| 39 | | cps1_hack_dsw_r(machine, 0, 0); |
| 35 | memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x800040, 0x800041, 0, 0, forgottn_dial_0_reset_w); |
| 36 | memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x800048, 0x800049, 0, 0, forgottn_dial_1_reset_w); |
| 37 | memory_install_read16_handler (cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x800052, 0x800055, 0, 0, forgottn_dial_0_r); |
| 38 | memory_install_read16_handler (cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x80005a, 0x80005d, 0, 0, forgottn_dial_1_r); |
| 39 | cps1_hack_dsw_r(cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0); |
| 40 | 40 | driver_init_sf2mdt(machine); |
| 41 | 41 | } |
| 42 | 42 | |
| r3675 | r3676 | |
| 140 | 140 | |
| 141 | 141 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 142 | 142 | CONS( 1995, sfzch, 0, 0, cps1_10MHz, sfzch, cps1, NULL, "Capcom", "CPS Changer (Street Fighter ZERO)" , 0) |
| 143 | | |