trunk/src/mame/machine/midtunit.c
| r22703 | r22704 | |
| 20 | 20 | #define SOUND_DCS 3 |
| 21 | 21 | |
| 22 | 22 | |
| 23 | | /* CMOS-related variables */ |
| 24 | | static UINT8 cmos_write_enable; |
| 25 | | |
| 26 | | /* sound-related variables */ |
| 27 | | static UINT8 chip_type; |
| 28 | | static UINT8 fake_sound_state; |
| 29 | | |
| 30 | | /* protection */ |
| 31 | | static UINT8 mk_prot_index; |
| 32 | | static UINT16 mk2_prot_data; |
| 33 | | |
| 34 | | static const UINT32 *nbajam_prot_table; |
| 35 | | static UINT16 nbajam_prot_queue[5]; |
| 36 | | static UINT8 nbajam_prot_index; |
| 37 | | |
| 38 | | static const UINT8 *jdredd_prot_table; |
| 39 | | static UINT8 jdredd_prot_index; |
| 40 | | static UINT8 jdredd_prot_max; |
| 41 | | |
| 42 | | |
| 43 | | |
| 44 | 23 | /************************************* |
| 45 | 24 | * |
| 46 | 25 | * State saving |
| 47 | 26 | * |
| 48 | 27 | *************************************/ |
| 49 | 28 | |
| 50 | | static void register_state_saving(running_machine &machine) |
| 29 | void midtunit_state::register_state_saving() |
| 51 | 30 | { |
| 52 | | state_save_register_global(machine, cmos_write_enable); |
| 53 | | state_save_register_global(machine, fake_sound_state); |
| 54 | | state_save_register_global(machine, mk_prot_index); |
| 55 | | state_save_register_global(machine, mk2_prot_data); |
| 56 | | state_save_register_global_array(machine, nbajam_prot_queue); |
| 57 | | state_save_register_global(machine, nbajam_prot_index); |
| 58 | | state_save_register_global(machine, jdredd_prot_index); |
| 59 | | state_save_register_global(machine, jdredd_prot_max); |
| 31 | state_save_register_global(machine(), cmos_write_enable); |
| 32 | state_save_register_global(machine(), fake_sound_state); |
| 33 | state_save_register_global(machine(), mk_prot_index); |
| 34 | state_save_register_global(machine(), mk2_prot_data); |
| 35 | state_save_register_global_array(machine(), nbajam_prot_queue); |
| 36 | state_save_register_global(machine(), nbajam_prot_index); |
| 37 | state_save_register_global(machine(), jdredd_prot_index); |
| 38 | state_save_register_global(machine(), jdredd_prot_max); |
| 60 | 39 | } |
| 61 | 40 | |
| 62 | 41 | |
| r22703 | r22704 | |
| 407 | 386 | * |
| 408 | 387 | *************************************/ |
| 409 | 388 | |
| 410 | | static void init_tunit_generic(running_machine &machine, int sound) |
| 389 | void midtunit_state::init_tunit_generic(int sound) |
| 411 | 390 | { |
| 412 | 391 | /* register for state saving */ |
| 413 | | register_state_saving(machine); |
| 392 | register_state_saving(); |
| 414 | 393 | |
| 415 | 394 | /* load sound ROMs and set up sound handlers */ |
| 416 | 395 | chip_type = sound; |
| r22703 | r22704 | |
| 421 | 400 | break; |
| 422 | 401 | |
| 423 | 402 | case SOUND_DCS: |
| 424 | | dcs_init(machine); |
| 403 | dcs_init(machine()); |
| 425 | 404 | break; |
| 426 | 405 | } |
| 427 | 406 | |
| r22703 | r22704 | |
| 442 | 421 | DRIVER_INIT_MEMBER(midtunit_state,mktunit) |
| 443 | 422 | { |
| 444 | 423 | /* common init */ |
| 445 | | init_tunit_generic(machine(), SOUND_ADPCM); |
| 424 | init_tunit_generic(SOUND_ADPCM); |
| 446 | 425 | |
| 447 | 426 | /* protection */ |
| 448 | 427 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1b00000, 0x1b6ffff, read16_delegate(FUNC(midtunit_state::mk_prot_r),this), write16_delegate(FUNC(midtunit_state::mk_prot_w),this)); |
| r22703 | r22704 | |
| 460 | 439 | } |
| 461 | 440 | |
| 462 | 441 | |
| 463 | | static void init_nbajam_common(running_machine &machine, int te_protection) |
| 442 | void midtunit_state::init_nbajam_common(int te_protection) |
| 464 | 443 | { |
| 465 | 444 | /* common init */ |
| 466 | | init_tunit_generic(machine, SOUND_ADPCM_LARGE); |
| 467 | | midtunit_state *state = machine.driver_data<midtunit_state>(); |
| 445 | init_tunit_generic(SOUND_ADPCM_LARGE); |
| 468 | 446 | /* protection */ |
| 469 | 447 | if (!te_protection) |
| 470 | 448 | { |
| 471 | 449 | nbajam_prot_table = nbajam_prot_values; |
| 472 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1b14020, 0x1b2503f, read16_delegate(FUNC(midtunit_state::nbajam_prot_r),state), write16_delegate(FUNC(midtunit_state::nbajam_prot_w),state)); |
| 450 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1b14020, 0x1b2503f, read16_delegate(FUNC(midtunit_state::nbajam_prot_r),this), write16_delegate(FUNC(midtunit_state::nbajam_prot_w),this)); |
| 473 | 451 | } |
| 474 | 452 | else |
| 475 | 453 | { |
| 476 | 454 | nbajam_prot_table = nbajamte_prot_values; |
| 477 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1b15f40, 0x1b37f5f, read16_delegate(FUNC(midtunit_state::nbajam_prot_r),state), write16_delegate(FUNC(midtunit_state::nbajam_prot_w),state)); |
| 478 | | state->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1b95f40, 0x1bb7f5f, read16_delegate(FUNC(midtunit_state::nbajam_prot_r),state), write16_delegate(FUNC(midtunit_state::nbajam_prot_w),state)); |
| 455 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1b15f40, 0x1b37f5f, read16_delegate(FUNC(midtunit_state::nbajam_prot_r),this), write16_delegate(FUNC(midtunit_state::nbajam_prot_w),this)); |
| 456 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x1b95f40, 0x1bb7f5f, read16_delegate(FUNC(midtunit_state::nbajam_prot_r),this), write16_delegate(FUNC(midtunit_state::nbajam_prot_w),this)); |
| 479 | 457 | } |
| 480 | 458 | |
| 481 | 459 | /* sound chip protection (hidden RAM) */ |
| 482 | 460 | if (!te_protection) |
| 483 | | machine.device("adpcm:cpu")->memory().space(AS_PROGRAM).install_ram(0xfbaa, 0xfbd4); |
| 461 | machine().device("adpcm:cpu")->memory().space(AS_PROGRAM).install_ram(0xfbaa, 0xfbd4); |
| 484 | 462 | else |
| 485 | | machine.device("adpcm:cpu")->memory().space(AS_PROGRAM).install_ram(0xfbec, 0xfc16); |
| 463 | machine().device("adpcm:cpu")->memory().space(AS_PROGRAM).install_ram(0xfbec, 0xfc16); |
| 486 | 464 | } |
| 487 | 465 | |
| 488 | 466 | DRIVER_INIT_MEMBER(midtunit_state,nbajam) |
| 489 | 467 | { |
| 490 | | init_nbajam_common(machine(), 0); |
| 468 | init_nbajam_common(0); |
| 491 | 469 | } |
| 492 | 470 | |
| 493 | 471 | DRIVER_INIT_MEMBER(midtunit_state,nbajamte) |
| 494 | 472 | { |
| 495 | | init_nbajam_common(machine(), 1); |
| 473 | init_nbajam_common(1); |
| 496 | 474 | } |
| 497 | 475 | |
| 498 | 476 | DRIVER_INIT_MEMBER(midtunit_state,jdreddp) |
| 499 | 477 | { |
| 500 | 478 | /* common init */ |
| 501 | | init_tunit_generic(machine(), SOUND_ADPCM_LARGE); |
| 479 | init_tunit_generic(SOUND_ADPCM_LARGE); |
| 502 | 480 | |
| 503 | 481 | /* looks like the watchdog needs to be disabled */ |
| 504 | 482 | m_maincpu->space(AS_PROGRAM).nop_write(0x01d81060, 0x01d8107f); |
| r22703 | r22704 | |
| 530 | 508 | DRIVER_INIT_MEMBER(midtunit_state,mk2) |
| 531 | 509 | { |
| 532 | 510 | /* common init */ |
| 533 | | init_tunit_generic(machine(), SOUND_DCS); |
| 511 | init_tunit_generic(SOUND_DCS); |
| 534 | 512 | midtunit_gfx_rom_large = 1; |
| 535 | 513 | |
| 536 | 514 | /* protection */ |
trunk/src/emu/video/psx.c
| r22703 | r22704 | |
| 568 | 568 | machine().save().save_memory( "globals", NULL, 0, "m_packet", (UINT8 *)&m_packet, 1, sizeof( m_packet ) ); |
| 569 | 569 | |
| 570 | 570 | state_save_register_global_pointer( machine(), p_vram, width * height ); |
| 571 | | state_save_register_global( machine(), n_gpu_buffer_offset ); |
| 572 | | state_save_register_global( machine(), n_vramx ); |
| 573 | | state_save_register_global( machine(), n_vramy ); |
| 574 | | state_save_register_global( machine(), n_twy ); |
| 575 | | state_save_register_global( machine(), n_twx ); |
| 576 | | state_save_register_global( machine(), n_tww ); |
| 577 | | state_save_register_global( machine(), n_drawarea_x1 ); |
| 578 | | state_save_register_global( machine(), n_drawarea_y1 ); |
| 579 | | state_save_register_global( machine(), n_drawarea_x2 ); |
| 580 | | state_save_register_global( machine(), n_drawarea_y2 ); |
| 581 | | state_save_register_global( machine(), n_horiz_disstart ); |
| 582 | | state_save_register_global( machine(), n_horiz_disend ); |
| 583 | | state_save_register_global( machine(), n_vert_disstart ); |
| 584 | | state_save_register_global( machine(), n_vert_disend ); |
| 585 | | state_save_register_global( machine(), b_reverseflag ); |
| 586 | | state_save_register_global( machine(), n_drawoffset_x ); |
| 587 | | state_save_register_global( machine(), n_drawoffset_y ); |
| 588 | | state_save_register_global( machine(), m_n_displaystartx ); |
| 589 | | state_save_register_global( machine(), n_displaystarty ); |
| 590 | | state_save_register_global( machine(), n_gpustatus ); |
| 591 | | state_save_register_global( machine(), n_gpuinfo ); |
| 592 | | state_save_register_global( machine(), n_lightgun_x ); |
| 593 | | state_save_register_global( machine(), n_lightgun_y ); |
| 594 | | state_save_register_global( machine(), m_n_tx ); |
| 595 | | state_save_register_global( machine(), m_n_ty ); |
| 596 | | state_save_register_global( machine(), n_abr ); |
| 597 | | state_save_register_global( machine(), n_tp ); |
| 598 | | state_save_register_global( machine(), n_ix ); |
| 599 | | state_save_register_global( machine(), n_iy ); |
| 600 | | state_save_register_global( machine(), n_ti ); |
| 571 | state_save_register_global(machine(), n_gpu_buffer_offset ); |
| 572 | state_save_register_global(machine(), n_vramx ); |
| 573 | state_save_register_global(machine(), n_vramy ); |
| 574 | state_save_register_global(machine(), n_twy ); |
| 575 | state_save_register_global(machine(), n_twx ); |
| 576 | state_save_register_global(machine(), n_tww ); |
| 577 | state_save_register_global(machine(), n_drawarea_x1 ); |
| 578 | state_save_register_global(machine(), n_drawarea_y1 ); |
| 579 | state_save_register_global(machine(), n_drawarea_x2 ); |
| 580 | state_save_register_global(machine(), n_drawarea_y2 ); |
| 581 | state_save_register_global(machine(), n_horiz_disstart ); |
| 582 | state_save_register_global(machine(), n_horiz_disend ); |
| 583 | state_save_register_global(machine(), n_vert_disstart ); |
| 584 | state_save_register_global(machine(), n_vert_disend ); |
| 585 | state_save_register_global(machine(), b_reverseflag ); |
| 586 | state_save_register_global(machine(), n_drawoffset_x ); |
| 587 | state_save_register_global(machine(), n_drawoffset_y ); |
| 588 | state_save_register_global(machine(), m_n_displaystartx ); |
| 589 | state_save_register_global(machine(), n_displaystarty ); |
| 590 | state_save_register_global(machine(), n_gpustatus ); |
| 591 | state_save_register_global(machine(), n_gpuinfo ); |
| 592 | state_save_register_global(machine(), n_lightgun_x ); |
| 593 | state_save_register_global(machine(), n_lightgun_y ); |
| 594 | state_save_register_global(machine(), m_n_tx ); |
| 595 | state_save_register_global(machine(), m_n_ty ); |
| 596 | state_save_register_global(machine(), n_abr ); |
| 597 | state_save_register_global(machine(), n_tp ); |
| 598 | state_save_register_global(machine(), n_ix ); |
| 599 | state_save_register_global(machine(), n_iy ); |
| 600 | state_save_register_global(machine(), n_ti ); |
| 601 | 601 | |
| 602 | 602 | machine().save().register_postload( save_prepost_delegate( FUNC( psxgpu_device::updatevisiblearea ), this ) ); |
| 603 | 603 | } |
trunk/src/mess/machine/thomflop.c
| r22703 | r22704 | |
| 340 | 340 | void thomson_state::to7_5p14_init() |
| 341 | 341 | { |
| 342 | 342 | LOG(( "to7_5p14_init: CD 90-640 controller\n" )); |
| 343 | | state_save_register_global( machine(), to7_5p14_select ); |
| 343 | state_save_register_global(machine(), to7_5p14_select ); |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | |
| r22703 | r22704 | |
| 447 | 447 | void thomson_state::to7_5p14sd_init() |
| 448 | 448 | { |
| 449 | 449 | LOG(( "to7_5p14sd_init: CD 90-015 controller\n" )); |
| 450 | | state_save_register_global( machine(), to7_5p14sd_select ); |
| 450 | state_save_register_global(machine(), to7_5p14sd_select ); |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | |
| r22703 | r22704 | |
| 858 | 858 | |
| 859 | 859 | to7qdd = auto_alloc(machine(), to7qdd_t); |
| 860 | 860 | |
| 861 | | state_save_register_global( machine(), to7qdd->status ); |
| 862 | | state_save_register_global( machine(), to7qdd->ctrl1 ); |
| 863 | | state_save_register_global( machine(), to7qdd->ctrl2 ); |
| 864 | | state_save_register_global( machine(), to7qdd->ctrl3 ); |
| 865 | | state_save_register_global( machine(), to7qdd->drive ); |
| 866 | | state_save_register_global( machine(), to7qdd->data_idx ); |
| 867 | | state_save_register_global( machine(), to7qdd->start_idx ); |
| 868 | | state_save_register_global( machine(), to7qdd->data_size ); |
| 869 | | state_save_register_global( machine(), to7qdd->data_crc ); |
| 870 | | state_save_register_global( machine(), to7qdd->index_pulse ); |
| 871 | | state_save_register_global_array( machine(), to7qdd->data ); |
| 861 | state_save_register_global(machine(), to7qdd->status ); |
| 862 | state_save_register_global(machine(), to7qdd->ctrl1 ); |
| 863 | state_save_register_global(machine(), to7qdd->ctrl2 ); |
| 864 | state_save_register_global(machine(), to7qdd->ctrl3 ); |
| 865 | state_save_register_global(machine(), to7qdd->drive ); |
| 866 | state_save_register_global(machine(), to7qdd->data_idx ); |
| 867 | state_save_register_global(machine(), to7qdd->start_idx ); |
| 868 | state_save_register_global(machine(), to7qdd->data_size ); |
| 869 | state_save_register_global(machine(), to7qdd->data_crc ); |
| 870 | state_save_register_global(machine(), to7qdd->index_pulse ); |
| 871 | state_save_register_global_array(machine(), to7qdd->data ); |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | 874 | |
| r22703 | r22704 | |
| 1554 | 1554 | |
| 1555 | 1555 | thmfc_floppy_cmd = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thomson_state::thmfc_floppy_cmd_complete_cb),this)); |
| 1556 | 1556 | |
| 1557 | | state_save_register_global( machine(), thmfc1->op ); |
| 1558 | | state_save_register_global( machine(), thmfc1->sector ); |
| 1559 | | state_save_register_global( machine(), thmfc1->sector_id ); |
| 1560 | | state_save_register_global( machine(), thmfc1->track ); |
| 1561 | | state_save_register_global( machine(), thmfc1->side ); |
| 1562 | | state_save_register_global( machine(), thmfc1->drive ); |
| 1563 | | state_save_register_global( machine(), thmfc1->sector_size ); |
| 1564 | | state_save_register_global( machine(), thmfc1->formatting ); |
| 1565 | | state_save_register_global( machine(), thmfc1->ipl ); |
| 1566 | | state_save_register_global( machine(), thmfc1->data_idx ); |
| 1567 | | state_save_register_global( machine(), thmfc1->data_size ); |
| 1568 | | state_save_register_global( machine(), thmfc1->data_finish ); |
| 1569 | | state_save_register_global( machine(), thmfc1->stat0 ); |
| 1570 | | state_save_register_global( machine(), thmfc1->data_raw_idx ); |
| 1571 | | state_save_register_global( machine(), thmfc1->data_raw_size ); |
| 1572 | | state_save_register_global( machine(), thmfc1->data_crc ); |
| 1573 | | state_save_register_global( machine(), thmfc1->wsync ); |
| 1574 | | state_save_register_global_array( machine(), thmfc1->data ); |
| 1557 | state_save_register_global(machine(), thmfc1->op ); |
| 1558 | state_save_register_global(machine(), thmfc1->sector ); |
| 1559 | state_save_register_global(machine(), thmfc1->sector_id ); |
| 1560 | state_save_register_global(machine(), thmfc1->track ); |
| 1561 | state_save_register_global(machine(), thmfc1->side ); |
| 1562 | state_save_register_global(machine(), thmfc1->drive ); |
| 1563 | state_save_register_global(machine(), thmfc1->sector_size ); |
| 1564 | state_save_register_global(machine(), thmfc1->formatting ); |
| 1565 | state_save_register_global(machine(), thmfc1->ipl ); |
| 1566 | state_save_register_global(machine(), thmfc1->data_idx ); |
| 1567 | state_save_register_global(machine(), thmfc1->data_size ); |
| 1568 | state_save_register_global(machine(), thmfc1->data_finish ); |
| 1569 | state_save_register_global(machine(), thmfc1->stat0 ); |
| 1570 | state_save_register_global(machine(), thmfc1->data_raw_idx ); |
| 1571 | state_save_register_global(machine(), thmfc1->data_raw_size ); |
| 1572 | state_save_register_global(machine(), thmfc1->data_crc ); |
| 1573 | state_save_register_global(machine(), thmfc1->wsync ); |
| 1574 | state_save_register_global_array(machine(), thmfc1->data ); |
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | 1577 | |
| r22703 | r22704 | |
| 1752 | 1752 | void thomson_state::to7_floppy_init( void* base ) |
| 1753 | 1753 | { |
| 1754 | 1754 | membank( THOM_FLOP_BANK )->configure_entries( 0, TO7_NB_FLOP_BANK, base, 0x800 ); |
| 1755 | | state_save_register_global( machine(), to7_controller_type ); |
| 1756 | | state_save_register_global( machine(), to7_floppy_bank ); |
| 1755 | state_save_register_global(machine(), to7_controller_type ); |
| 1756 | state_save_register_global(machine(), to7_floppy_bank ); |
| 1757 | 1757 | to7_5p14sd_init(); |
| 1758 | 1758 | to7_5p14_init(); |
| 1759 | 1759 | to7_qdd_init(); |