trunk/src/mame/machine/nmk004.c
| r24657 | r24658 | |
| 1 | 1 | #include "emu.h" |
| 2 | 2 | #include "nmk004.h" |
| 3 | | #include "sound/2203intf.h" |
| 4 | | #include "sound/okim6295.h" |
| 5 | 3 | |
| 6 | | |
| 7 | | |
| 8 | | #define FM_CHANNELS 6 |
| 9 | | #define PSG_CHANNELS 3 |
| 10 | | #define EFFECTS_CHANNELS 8 |
| 11 | | |
| 12 | 4 | #define FM_FLAG_NEED_INITIALIZATION (1<<0) |
| 13 | 5 | #define FM_FLAG_UNKNOWN2 (1<<1) |
| 14 | 6 | #define FM_FLAG_NOTE_IS_PAUSE (1<<2) |
| r24657 | r24658 | |
| 30 | 22 | |
| 31 | 23 | #define NOTE_PAUSE 0x0c |
| 32 | 24 | |
| 33 | | struct psg_control |
| 34 | | { |
| 35 | | /* C220 */ UINT8 flags; |
| 36 | | /* C221-C222 */ UINT16 note_timer; |
| 37 | | /* C223-C224 */ UINT16 note_length; |
| 38 | | /* C225 */ UINT8 volume_timer; |
| 39 | | /* C227-C228 */ UINT16 current; // current position in control table |
| 40 | | /* C229-C22A */ UINT16 return_address[16]; // return address when control table calls a subtable |
| 41 | | int return_address_depth; |
| 42 | | /* C22B-C22C */ UINT16 loop_start; // first instruction of loop |
| 43 | | /* C22D */ UINT8 loop_times; // number of times to loop |
| 44 | | /* C22E */ UINT8 volume_shape; |
| 45 | | /* C22F */ UINT8 volume_position; |
| 46 | | /* C230 */ UINT8 octave; // base octave |
| 47 | | /* C231 */ UINT8 note; // note to play |
| 48 | | /* C233 */ UINT8 note_period_hi_bits; |
| 49 | | }; |
| 50 | | |
| 51 | | struct fm_control |
| 52 | | { |
| 53 | | UINT8 note; |
| 54 | | /* C020 */ UINT8 flags; |
| 55 | | /* C021 */ UINT8 slot; // for ym2203 keyon command |
| 56 | | /* C022-C039 */ UINT8 voice_params[0x18]; // parameters for the YM2203 to configure sound shape |
| 57 | | /* C03A-C03B */ UINT16 f_number; |
| 58 | | /* C03C */ UINT8 self_feedback; |
| 59 | | /* C03D */ UINT8 note_duration_table_select; |
| 60 | | /* C03E-C03F */ UINT16 current; // current position in control table |
| 61 | | /* C040-C041 */ UINT16 loop_start; // first instruction of loop |
| 62 | | /* C042 */ UINT8 loop_times; // number of times to loop |
| 63 | | /* C043-C044 */ UINT16 return_address[16]; // return address when control table calls a subtable |
| 64 | | int return_address_depth; |
| 65 | | /* C045 */ UINT8 octave; |
| 66 | | /* C046-C047 */ UINT16 timer1; |
| 67 | | /* C048-C049 */ UINT16 timer2; |
| 68 | | /* C04A-C04B */ UINT16 timer1_duration; |
| 69 | | /* C04C-C04D */ UINT16 timer2_duration; |
| 70 | | /* C04E */ UINT8 modulation_table_number; |
| 71 | | /* C04F-C050 */ UINT16 modulation_timer; |
| 72 | | /* C051-C052 */ UINT16 modulation_table; |
| 73 | | /* C053-C054 */ UINT16 modulation_table_position; |
| 74 | | /* C055-C056 */ UINT16 note_period; |
| 75 | | /* C057-C05A */ UINT8 voice_volume[4]; // parameters for the YM2203 to configure sound shape |
| 76 | | /* C05C */ UINT8 must_update_voice_params; |
| 77 | | }; |
| 78 | | |
| 79 | | struct effects_control |
| 80 | | { |
| 81 | | /* C1A0 */ UINT8 flags; |
| 82 | | /* C1BE-C1BF */ UINT16 current; // current position in control table |
| 83 | | /* C1C0-C1C1 */ UINT16 loop_start; // first instruction of loop |
| 84 | | /* C1C2 */ UINT8 loop_times; // number of times to loop |
| 85 | | /* C1C3-C1C4 */ UINT16 return_address[16]; // return address when control table calls a subtable |
| 86 | | int return_address_depth; |
| 87 | | /* C1C6-C1C7 */ UINT16 timer; |
| 88 | | /* C1CA-C1CB */ UINT16 timer_duration; |
| 89 | | }; |
| 90 | | |
| 91 | | struct nmk004_state |
| 92 | | { |
| 93 | | public: |
| 94 | | running_machine &machine() const { assert(m_machine != NULL); return *m_machine; } |
| 95 | | void set_machine(running_machine &machine) { m_machine = &machine; } |
| 96 | | |
| 97 | | const UINT8 *rom; // NMK004 data ROM |
| 98 | | UINT8 from_main; // command from main CPU |
| 99 | | UINT8 to_main; // answer to main CPU |
| 100 | | int protection_check; |
| 101 | | |
| 102 | | ym2203_device *ymdevice; |
| 103 | | okim6295_device *oki1device; |
| 104 | | okim6295_device *oki2device; |
| 105 | | |
| 106 | | /* C001 */ UINT8 last_command; // last command received |
| 107 | | /* C016 */ UINT8 oki_playing; // bitmap of active Oki channels |
| 108 | | /* C020-C19F */ struct fm_control fm_control[FM_CHANNELS]; |
| 109 | | /* C220-C2DF */ struct psg_control psg_control[PSG_CHANNELS]; |
| 110 | | /* C1A0-C21F */ struct effects_control effects_control[EFFECTS_CHANNELS]; |
| 111 | | |
| 112 | | private: |
| 113 | | running_machine *m_machine; |
| 114 | | }; |
| 115 | | |
| 116 | | static nmk004_state NMK004_state; |
| 117 | | |
| 118 | | |
| 119 | 25 | #define SAMPLE_TABLE_0 0xefe0 |
| 120 | 26 | #define SAMPLE_TABLE_1 0xefe2 |
| 121 | 27 | #define FM_MODULATION_TABLE 0xefe4 |
| r24657 | r24658 | |
| 128 | 34 | #define PSG_NOTE_TABLE 0xeff2 |
| 129 | 35 | |
| 130 | 36 | |
| 131 | | static UINT8 read8(int address) |
| 37 | const device_type NMK004 = &device_creator<nmk004_device>; |
| 38 | |
| 39 | nmk004_device::nmk004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 40 | : device_t(mconfig, NMK004, "NMK004", tag, owner, clock, "nmk004", __FILE__), |
| 41 | m_rom(NULL), |
| 42 | m_from_main(0), |
| 43 | m_to_main(0), |
| 44 | m_protection_check(0), |
| 45 | m_last_command(0), |
| 46 | m_oki_playing(0) |
| 132 | 47 | { |
| 133 | | return NMK004_state.rom[address]; |
| 48 | memset(m_fm_control, 0, sizeof(m_fm_control)); |
| 49 | memset(m_psg_control, 0, sizeof(m_psg_control)); |
| 50 | memset(m_effects_control, 0, sizeof(m_effects_control)); |
| 134 | 51 | } |
| 135 | 52 | |
| 136 | | static UINT16 read16(int address) |
| 53 | //------------------------------------------------- |
| 54 | // device_config_complete - perform any |
| 55 | // operations now that the configuration is |
| 56 | // complete |
| 57 | //------------------------------------------------- |
| 58 | |
| 59 | void nmk004_device::device_config_complete() |
| 137 | 60 | { |
| 138 | | return NMK004_state.rom[address] + 256 * NMK004_state.rom[address+1]; |
| 139 | 61 | } |
| 140 | 62 | |
| 63 | //------------------------------------------------- |
| 64 | // device_start - device-specific startup |
| 65 | //------------------------------------------------- |
| 141 | 66 | |
| 67 | void nmk004_device::device_start() |
| 68 | { |
| 69 | /* we have to do this via a timer because we get called before the sound reset */ |
| 70 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(nmk004_device::real_init), this)); |
| 71 | } |
| 142 | 72 | |
| 73 | //------------------------------------------------- |
| 74 | // device_reset - device-specific reset |
| 75 | //------------------------------------------------- |
| 76 | |
| 77 | void nmk004_device::device_reset() |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | UINT8 nmk004_device::read8(int address) |
| 82 | { |
| 83 | return m_rom[address]; |
| 84 | } |
| 85 | |
| 86 | UINT16 nmk004_device::read16(int address) |
| 87 | { |
| 88 | return m_rom[address] + 256 * m_rom[address+1]; |
| 89 | } |
| 90 | |
| 91 | |
| 92 | |
| 143 | 93 | /***************************** |
| 144 | 94 | |
| 145 | 95 | OKI6295 |
| 146 | 96 | |
| 147 | 97 | *****************************/ |
| 148 | 98 | |
| 149 | | static void oki_play_sample(int sample_no) |
| 99 | void nmk004_device::oki_play_sample(int sample_no) |
| 150 | 100 | { |
| 151 | 101 | UINT16 table_start = (sample_no & 0x80) ? read16(SAMPLE_TABLE_1) : read16(SAMPLE_TABLE_0); |
| 152 | 102 | UINT8 byte1 = read8(table_start + 2 * (sample_no & 0x7f) + 0); |
| 153 | 103 | UINT8 byte2 = read8(table_start + 2 * (sample_no & 0x7f) + 1); |
| 154 | 104 | int chip = (byte1 & 0x80) >> 7; |
| 155 | | okim6295_device *okidevice = (chip) ? NMK004_state.oki2device : NMK004_state.oki1device; |
| 105 | okim6295_device *okidevice = (chip) ? m_oki2device : m_oki1device; |
| 156 | 106 | |
| 157 | 107 | if ((byte1 & 0x7f) == 0) |
| 158 | 108 | { |
| r24657 | r24658 | |
| 165 | 115 | int ch = byte2 & 0x03; |
| 166 | 116 | int force = (byte2 & 0x80) >> 7; |
| 167 | 117 | |
| 168 | | if (!force && (NMK004_state.oki_playing & (1 << (ch + 4*chip)))) |
| 118 | if (!force && (m_oki_playing & (1 << (ch + 4*chip)))) |
| 169 | 119 | return; |
| 170 | 120 | |
| 171 | | NMK004_state.oki_playing |= 1 << (ch + 4*chip); |
| 121 | m_oki_playing |= 1 << (ch + 4*chip); |
| 172 | 122 | |
| 173 | 123 | // stop channel |
| 174 | 124 | okidevice->write_command( 0x08 << ch ); |
| 175 | 125 | |
| 176 | 126 | if (sample != 0) |
| 177 | 127 | { |
| 178 | | UINT8 *rom = NMK004_state.machine().root_device().memregion((chip == 0) ? "oki1" : "oki2")->base(); |
| 128 | UINT8 *rom = machine().root_device().memregion((chip == 0) ? "oki1" : "oki2")->base(); |
| 179 | 129 | int bank = (byte2 & 0x0c) >> 2; |
| 180 | 130 | int vol = (byte2 & 0x70) >> 4; |
| 181 | 131 | |
| r24657 | r24658 | |
| 188 | 138 | } |
| 189 | 139 | } |
| 190 | 140 | |
| 191 | | static void oki_update_state(void) |
| 141 | void nmk004_device::oki_update_state(void) |
| 192 | 142 | { |
| 193 | | NMK004_state.oki_playing = ((NMK004_state.oki2device->read_status() & 0x0f) << 4) | (NMK004_state.oki1device->read_status() & 0x0f); |
| 143 | m_oki_playing = ((m_oki2device->read_status() & 0x0f) << 4) | (m_oki1device->read_status() & 0x0f); |
| 194 | 144 | } |
| 195 | 145 | |
| 196 | 146 | |
| r24657 | r24658 | |
| 201 | 151 | |
| 202 | 152 | *****************************/ |
| 203 | 153 | |
| 204 | | static void effects_update(int channel) |
| 154 | void nmk004_device::effects_update(int channel) |
| 205 | 155 | { |
| 206 | | struct effects_control *effects = &NMK004_state.effects_control[channel]; |
| 156 | struct effects_control *effects = &m_effects_control[channel]; |
| 207 | 157 | |
| 208 | 158 | // advance the timers |
| 209 | 159 | if (effects->timer) |
| r24657 | r24658 | |
| 308 | 258 | |
| 309 | 259 | *****************************/ |
| 310 | 260 | |
| 311 | | static void fm_update(int channel) |
| 261 | void nmk004_device::fm_update(int channel) |
| 312 | 262 | { |
| 313 | | struct fm_control *fm = &NMK004_state.fm_control[channel]; |
| 314 | | address_space &space = NMK004_state.machine().firstcpu->space(AS_PROGRAM); |
| 263 | struct fm_control *fm = &m_fm_control[channel]; |
| 264 | address_space &space = machine().firstcpu->space(AS_PROGRAM); |
| 315 | 265 | |
| 316 | 266 | // advance the timers |
| 317 | 267 | if (fm->timer1) |
| r24657 | r24658 | |
| 355 | 305 | case 0xf0: // slot (for keyon ym2203 command) |
| 356 | 306 | fm->flags |= FM_FLAG_MUST_SEND_CONFIGURATION; |
| 357 | 307 | fm->slot = read8(fm->current++); |
| 358 | | if (channel < 3 || !(NMK004_state.fm_control[channel-3].flags & FM_FLAG_ACTIVE)) |
| 308 | if (channel < 3 || !(m_fm_control[channel-3].flags & FM_FLAG_ACTIVE)) |
| 359 | 309 | { |
| 360 | | NMK004_state.ymdevice->control_port_w(space, 0, 0x28); // keyon/off |
| 361 | | NMK004_state.ymdevice->write_port_w(space, 0, channel % 3); |
| 310 | m_ymdevice->control_port_w(space, 0, 0x28); // keyon/off |
| 311 | m_ymdevice->write_port_w(space, 0, channel % 3); |
| 362 | 312 | } |
| 363 | 313 | break; |
| 364 | 314 | |
| r24657 | r24658 | |
| 558 | 508 | |
| 559 | 509 | #if 0 |
| 560 | 510 | popmessage("%02x %02x %02x %02x %02x %02x", |
| 561 | | NMK004_state.fm_control[0].note, |
| 562 | | NMK004_state.fm_control[1].note, |
| 563 | | NMK004_state.fm_control[2].note, |
| 564 | | NMK004_state.fm_control[3].note, |
| 565 | | NMK004_state.fm_control[4].note, |
| 566 | | NMK004_state.fm_control[5].note); |
| 511 | m_fm_control[0].note, |
| 512 | m_fm_control[1].note, |
| 513 | m_fm_control[2].note, |
| 514 | m_fm_control[3].note, |
| 515 | m_fm_control[4].note, |
| 516 | m_fm_control[5].note); |
| 567 | 517 | #endif |
| 568 | 518 | #if 0 |
| 569 | 519 | popmessage("%02x %02x%02x%02x%02x %02x %02x%02x%02x%02x %02x %02x%02x%02x%02x", |
| 570 | | NMK004_state.fm_control[3].note, |
| 571 | | NMK004_state.fm_control[3].voice_volume[0], |
| 572 | | NMK004_state.fm_control[3].voice_volume[1], |
| 573 | | NMK004_state.fm_control[3].voice_volume[2], |
| 574 | | NMK004_state.fm_control[3].voice_volume[3], |
| 575 | | NMK004_state.fm_control[4].note, |
| 576 | | NMK004_state.fm_control[4].voice_volume[0], |
| 577 | | NMK004_state.fm_control[4].voice_volume[1], |
| 578 | | NMK004_state.fm_control[4].voice_volume[2], |
| 579 | | NMK004_state.fm_control[4].voice_volume[3], |
| 580 | | NMK004_state.fm_control[5].note, |
| 581 | | NMK004_state.fm_control[5].voice_volume[0], |
| 582 | | NMK004_state.fm_control[5].voice_volume[1], |
| 583 | | NMK004_state.fm_control[5].voice_volume[2], |
| 584 | | NMK004_state.fm_control[5].voice_volume[3]); |
| 520 | m_fm_control[3].note, |
| 521 | m_fm_control[3].voice_volume[0], |
| 522 | m_fm_control[3].voice_volume[1], |
| 523 | m_fm_control[3].voice_volume[2], |
| 524 | m_fm_control[3].voice_volume[3], |
| 525 | m_fm_control[4].note, |
| 526 | m_fm_control[4].voice_volume[0], |
| 527 | m_fm_control[4].voice_volume[1], |
| 528 | m_fm_control[4].voice_volume[2], |
| 529 | m_fm_control[4].voice_volume[3], |
| 530 | m_fm_control[5].note, |
| 531 | m_fm_control[5].voice_volume[0], |
| 532 | m_fm_control[5].voice_volume[1], |
| 533 | m_fm_control[5].voice_volume[2], |
| 534 | m_fm_control[5].voice_volume[3]); |
| 585 | 535 | #endif |
| 586 | 536 | } |
| 587 | 537 | |
| 588 | 538 | |
| 589 | | static void fm_voices_update(void) |
| 539 | void nmk004_device::fm_voices_update(void) |
| 590 | 540 | { |
| 591 | 541 | static const int ym2203_registers[0x18] = |
| 592 | 542 | { |
| r24657 | r24658 | |
| 595 | 545 | }; |
| 596 | 546 | int channel,i; |
| 597 | 547 | |
| 598 | | address_space &space = NMK004_state.machine().firstcpu->space(AS_PROGRAM); |
| 548 | address_space &space = machine().firstcpu->space(AS_PROGRAM); |
| 599 | 549 | for (channel = 0; channel < 3;channel++) |
| 600 | 550 | { |
| 601 | | struct fm_control *fm1 = &NMK004_state.fm_control[channel]; |
| 602 | | struct fm_control *fm2 = &NMK004_state.fm_control[channel + 3]; |
| 551 | struct fm_control *fm1 = &m_fm_control[channel]; |
| 552 | struct fm_control *fm2 = &m_fm_control[channel + 3]; |
| 603 | 553 | |
| 604 | 554 | if (fm1->flags & FM_FLAG_MUST_SEND_CONFIGURATION) |
| 605 | 555 | { |
| r24657 | r24658 | |
| 607 | 557 | |
| 608 | 558 | for (i = 0; i < 0x18; i++) |
| 609 | 559 | { |
| 610 | | NMK004_state.ymdevice->control_port_w(space, 0, ym2203_registers[i] + channel); |
| 611 | | NMK004_state.ymdevice->write_port_w(space, 0, fm1->voice_params[i]); |
| 560 | m_ymdevice->control_port_w(space, 0, ym2203_registers[i] + channel); |
| 561 | m_ymdevice->write_port_w(space, 0, fm1->voice_params[i]); |
| 612 | 562 | } |
| 613 | 563 | } |
| 614 | 564 | |
| r24657 | r24658 | |
| 620 | 570 | { |
| 621 | 571 | for (i = 0; i < 0x18; i++) |
| 622 | 572 | { |
| 623 | | NMK004_state.ymdevice->control_port_w(space, 0, ym2203_registers[i] + channel); |
| 624 | | NMK004_state.ymdevice->write_port_w(space, 0, fm2->voice_params[i]); |
| 573 | m_ymdevice->control_port_w(space, 0, ym2203_registers[i] + channel); |
| 574 | m_ymdevice->write_port_w(space, 0, fm2->voice_params[i]); |
| 625 | 575 | } |
| 626 | 576 | } |
| 627 | 577 | } |
| r24657 | r24658 | |
| 629 | 579 | |
| 630 | 580 | if (fm1->flags & FM_FLAG_ACTIVE) |
| 631 | 581 | { |
| 632 | | NMK004_state.ymdevice->control_port_w(space, 0, 0xb0 + channel); // self-feedback |
| 633 | | NMK004_state.ymdevice->write_port_w(space, 0, fm1->self_feedback); |
| 582 | m_ymdevice->control_port_w(space, 0, 0xb0 + channel); // self-feedback |
| 583 | m_ymdevice->write_port_w(space, 0, fm1->self_feedback); |
| 634 | 584 | |
| 635 | | NMK004_state.ymdevice->control_port_w(space, 0, 0xa4 + channel); // F-number |
| 636 | | NMK004_state.ymdevice->write_port_w(space, 0, fm1->f_number >> 8); |
| 585 | m_ymdevice->control_port_w(space, 0, 0xa4 + channel); // F-number |
| 586 | m_ymdevice->write_port_w(space, 0, fm1->f_number >> 8); |
| 637 | 587 | |
| 638 | | NMK004_state.ymdevice->control_port_w(space, 0, 0xa0 + channel); // F-number |
| 639 | | NMK004_state.ymdevice->write_port_w(space, 0, fm1->f_number & 0xff); |
| 588 | m_ymdevice->control_port_w(space, 0, 0xa0 + channel); // F-number |
| 589 | m_ymdevice->write_port_w(space, 0, fm1->f_number & 0xff); |
| 640 | 590 | } |
| 641 | 591 | else |
| 642 | 592 | { |
| 643 | | NMK004_state.ymdevice->control_port_w(space, 0, 0xb0 + channel); // self-feedback |
| 644 | | NMK004_state.ymdevice->write_port_w(space, 0, fm2->self_feedback); |
| 593 | m_ymdevice->control_port_w(space, 0, 0xb0 + channel); // self-feedback |
| 594 | m_ymdevice->write_port_w(space, 0, fm2->self_feedback); |
| 645 | 595 | |
| 646 | | NMK004_state.ymdevice->control_port_w(space, 0, 0xa4 + channel); // F-number |
| 647 | | NMK004_state.ymdevice->write_port_w(space, 0, fm2->f_number >> 8); |
| 596 | m_ymdevice->control_port_w(space, 0, 0xa4 + channel); // F-number |
| 597 | m_ymdevice->write_port_w(space, 0, fm2->f_number >> 8); |
| 648 | 598 | |
| 649 | | NMK004_state.ymdevice->control_port_w(space, 0, 0xa0 + channel); // F-number |
| 650 | | NMK004_state.ymdevice->write_port_w(space, 0, fm2->f_number & 0xff); |
| 599 | m_ymdevice->control_port_w(space, 0, 0xa0 + channel); // F-number |
| 600 | m_ymdevice->write_port_w(space, 0, fm2->f_number & 0xff); |
| 651 | 601 | } |
| 652 | 602 | |
| 653 | 603 | |
| r24657 | r24658 | |
| 656 | 606 | { |
| 657 | 607 | fm1->flags &= ~FM_FLAG_MUST_SEND_KEYON; |
| 658 | 608 | |
| 659 | | NMK004_state.ymdevice->control_port_w(space, 0, 0x28); // keyon/off |
| 660 | | NMK004_state.ymdevice->write_port_w(space, 0, fm1->slot | channel); |
| 609 | m_ymdevice->control_port_w(space, 0, 0x28); // keyon/off |
| 610 | m_ymdevice->write_port_w(space, 0, fm1->slot | channel); |
| 661 | 611 | } |
| 662 | 612 | |
| 663 | 613 | if (fm2->flags & FM_FLAG_MUST_SEND_KEYON) |
| r24657 | r24658 | |
| 666 | 616 | |
| 667 | 617 | if (!(fm1->flags & FM_FLAG_ACTIVE)) |
| 668 | 618 | { |
| 669 | | NMK004_state.ymdevice->control_port_w(space, 0, 0x28); // keyon/off |
| 670 | | NMK004_state.ymdevice->write_port_w(space, 0, fm2->slot | channel); |
| 619 | m_ymdevice->control_port_w(space, 0, 0x28); // keyon/off |
| 620 | m_ymdevice->write_port_w(space, 0, fm2->slot | channel); |
| 671 | 621 | } |
| 672 | 622 | } |
| 673 | 623 | } |
| r24657 | r24658 | |
| 681 | 631 | |
| 682 | 632 | *****************************/ |
| 683 | 633 | |
| 684 | | static void psg_update(int channel) |
| 634 | void nmk004_device::psg_update(int channel) |
| 685 | 635 | { |
| 686 | | struct psg_control *psg = &NMK004_state.psg_control[channel]; |
| 687 | | address_space &space = NMK004_state.machine().firstcpu->space(AS_PROGRAM); |
| 636 | struct psg_control *psg = &m_psg_control[channel]; |
| 637 | address_space &space = machine().firstcpu->space(AS_PROGRAM); |
| 688 | 638 | |
| 689 | 639 | // advance the timers |
| 690 | 640 | if (psg->note_timer) |
| r24657 | r24658 | |
| 706 | 656 | psg->flags &= ~PSG_FLAG_NOISE_NOT_ENABLED; |
| 707 | 657 | |
| 708 | 658 | // enable noise, disable tone on this channel |
| 709 | | NMK004_state.ymdevice->control_port_w(space, 0, 0x07); |
| 710 | | enable = NMK004_state.ymdevice->read_port_r(space, 0); |
| 659 | m_ymdevice->control_port_w(space, 0, 0x07); |
| 660 | enable = m_ymdevice->read_port_r(space, 0); |
| 711 | 661 | enable |= (0x01 << channel); // disable tone |
| 712 | 662 | enable &= ~(0x08 << channel); // enable noise |
| 713 | | NMK004_state.ymdevice->write_port_w(space, 0, enable); |
| 663 | m_ymdevice->write_port_w(space, 0, enable); |
| 714 | 664 | } |
| 715 | 665 | |
| 716 | 666 | |
| r24657 | r24658 | |
| 744 | 694 | psg->flags &= ~PSG_FLAG_NOISE_NOT_ENABLED; |
| 745 | 695 | |
| 746 | 696 | // enable noise, disable tone on this channel |
| 747 | | NMK004_state.ymdevice->control_port_w(space, 0, 0x07); |
| 748 | | enable = NMK004_state.ymdevice->read_port_r(space, 0); |
| 697 | m_ymdevice->control_port_w(space, 0, 0x07); |
| 698 | enable = m_ymdevice->read_port_r(space, 0); |
| 749 | 699 | enable |= (0x01 << channel); // disable tone |
| 750 | 700 | enable &= ~(0x08 << channel); // enable noise |
| 751 | | NMK004_state.ymdevice->write_port_w(space, 0, enable); |
| 701 | m_ymdevice->write_port_w(space, 0, enable); |
| 752 | 702 | break; |
| 753 | 703 | |
| 754 | 704 | case 0xf2: // set volume shape |
| r24657 | r24658 | |
| 793 | 743 | psg->volume_shape = 0; |
| 794 | 744 | |
| 795 | 745 | // mute channel |
| 796 | | NMK004_state.ymdevice->control_port_w(space, 0, 8 + channel); |
| 797 | | NMK004_state.ymdevice->write_port_w(space, 0, 0); |
| 746 | m_ymdevice->control_port_w(space, 0, 8 + channel); |
| 747 | m_ymdevice->write_port_w(space, 0, 0); |
| 798 | 748 | return; |
| 799 | 749 | } |
| 800 | 750 | } |
| r24657 | r24658 | |
| 834 | 784 | |
| 835 | 785 | period >>= octave; |
| 836 | 786 | |
| 837 | | NMK004_state.ymdevice->control_port_w(space, 0, 2 * channel + 1); |
| 838 | | NMK004_state.ymdevice->write_port_w(space, 0, (period & 0x0f00) >> 8); |
| 839 | | NMK004_state.ymdevice->control_port_w(space, 0, 2 * channel + 0); |
| 840 | | NMK004_state.ymdevice->write_port_w(space, 0, (period & 0x00ff)); |
| 787 | m_ymdevice->control_port_w(space, 0, 2 * channel + 1); |
| 788 | m_ymdevice->write_port_w(space, 0, (period & 0x0f00) >> 8); |
| 789 | m_ymdevice->control_port_w(space, 0, 2 * channel + 0); |
| 790 | m_ymdevice->write_port_w(space, 0, (period & 0x00ff)); |
| 841 | 791 | |
| 842 | 792 | psg->note_period_hi_bits = (period & 0x0f00) >> 8; |
| 843 | 793 | } |
| r24657 | r24658 | |
| 850 | 800 | psg->flags |= PSG_FLAG_NOISE_NOT_ENABLED; |
| 851 | 801 | |
| 852 | 802 | // disable noise, enable tone on this channel |
| 853 | | NMK004_state.ymdevice->control_port_w(space, 0, 0x07); |
| 854 | | enable = NMK004_state.ymdevice->read_port_r(space, 0); |
| 803 | m_ymdevice->control_port_w(space, 0, 0x07); |
| 804 | enable = m_ymdevice->read_port_r(space, 0); |
| 855 | 805 | enable &= ~(0x01 << channel); // enable tone |
| 856 | 806 | enable |= (0x08 << channel); // disable noise |
| 857 | | NMK004_state.ymdevice->write_port_w(space, 0, enable); |
| 807 | m_ymdevice->write_port_w(space, 0, enable); |
| 858 | 808 | } |
| 859 | 809 | |
| 860 | | NMK004_state.ymdevice->control_port_w(space, 0, 0x06); // noise period |
| 861 | | NMK004_state.ymdevice->write_port_w(space, 0, psg->note); |
| 810 | m_ymdevice->control_port_w(space, 0, 0x06); // noise period |
| 811 | m_ymdevice->write_port_w(space, 0, psg->note); |
| 862 | 812 | psg->note_period_hi_bits = psg->note; |
| 863 | 813 | } |
| 864 | 814 | } |
| r24657 | r24658 | |
| 883 | 833 | volume = 0; |
| 884 | 834 | |
| 885 | 835 | // set volume |
| 886 | | NMK004_state.ymdevice->control_port_w(space, 0, 8 + channel); |
| 887 | | NMK004_state.ymdevice->write_port_w(space, 0, volume & 0x0f); |
| 836 | m_ymdevice->control_port_w(space, 0, 8 + channel); |
| 837 | m_ymdevice->write_port_w(space, 0, volume & 0x0f); |
| 888 | 838 | } |
| 889 | 839 | } |
| 890 | 840 | } |
| r24657 | r24658 | |
| 897 | 847 | |
| 898 | 848 | *****************************/ |
| 899 | 849 | |
| 900 | | static void get_command(void) |
| 850 | void nmk004_device::get_command(void) |
| 901 | 851 | { |
| 902 | 852 | static const UINT8 from_main[] = |
| 903 | 853 | { |
| r24657 | r24658 | |
| 908 | 858 | 0x82,0xc7,0x00,0x2c,0x6c,0x00,0x9f,0xc7,0x00,0x29,0x69,0x00,0x8b,0xc7,0x00 |
| 909 | 859 | }; |
| 910 | 860 | |
| 911 | | UINT8 cmd = NMK004_state.from_main; |
| 861 | UINT8 cmd = m_from_main; |
| 912 | 862 | |
| 913 | | if (NMK004_state.protection_check < sizeof(to_main)) |
| 863 | if (m_protection_check < sizeof(to_main)) |
| 914 | 864 | { |
| 915 | 865 | // startup handshake |
| 916 | | if (cmd == from_main[NMK004_state.protection_check]) |
| 866 | if (cmd == from_main[m_protection_check]) |
| 917 | 867 | { |
| 918 | | logerror("advance handshake to %02x\n",to_main[NMK004_state.protection_check]); |
| 919 | | NMK004_state.to_main = to_main[NMK004_state.protection_check++]; |
| 868 | logerror("advance handshake to %02x\n",to_main[m_protection_check]); |
| 869 | m_to_main = to_main[m_protection_check++]; |
| 920 | 870 | } |
| 921 | 871 | } |
| 922 | 872 | else |
| 923 | 873 | { |
| 924 | 874 | // send command back to main CPU to acknowledge reception |
| 925 | | NMK004_state.to_main = cmd; |
| 875 | m_to_main = cmd; |
| 926 | 876 | } |
| 927 | 877 | |
| 928 | | if (NMK004_state.last_command != cmd) |
| 878 | if (m_last_command != cmd) |
| 929 | 879 | { |
| 930 | 880 | UINT16 table_start = read16(COMMAND_TABLE); |
| 931 | 881 | UINT16 cmd_table = read16(table_start + 2 * cmd); |
| 932 | 882 | |
| 933 | | NMK004_state.last_command = cmd; |
| 883 | m_last_command = cmd; |
| 934 | 884 | |
| 935 | 885 | if ((cmd_table & 0xff00) == 0) |
| 936 | 886 | { |
| r24657 | r24658 | |
| 950 | 900 | //logerror("%04x: channel %d table %04x\n",cmd_table-3,channel,table_start); |
| 951 | 901 | if (channel < FM_CHANNELS) |
| 952 | 902 | { |
| 953 | | NMK004_state.fm_control[channel].current = table_start; |
| 954 | | NMK004_state.fm_control[channel].return_address_depth = 0; |
| 955 | | NMK004_state.fm_control[channel].flags |= FM_FLAG_NEED_INITIALIZATION; |
| 903 | m_fm_control[channel].current = table_start; |
| 904 | m_fm_control[channel].return_address_depth = 0; |
| 905 | m_fm_control[channel].flags |= FM_FLAG_NEED_INITIALIZATION; |
| 956 | 906 | } |
| 957 | 907 | else |
| 958 | 908 | { |
| 959 | 909 | channel -= FM_CHANNELS; |
| 960 | 910 | if (channel < PSG_CHANNELS) |
| 961 | 911 | { |
| 962 | | NMK004_state.psg_control[channel].current = table_start; |
| 963 | | NMK004_state.psg_control[channel].return_address_depth = 0; |
| 964 | | NMK004_state.psg_control[channel].flags |= PSG_FLAG_NEED_INITIALIZATION; |
| 912 | m_psg_control[channel].current = table_start; |
| 913 | m_psg_control[channel].return_address_depth = 0; |
| 914 | m_psg_control[channel].flags |= PSG_FLAG_NEED_INITIALIZATION; |
| 965 | 915 | } |
| 966 | 916 | else |
| 967 | 917 | { |
| r24657 | r24658 | |
| 970 | 920 | { |
| 971 | 921 | fatalerror("too many effects channels\n"); |
| 972 | 922 | } |
| 973 | | NMK004_state.effects_control[channel].current = table_start; |
| 974 | | NMK004_state.effects_control[channel].return_address_depth = 0; |
| 975 | | NMK004_state.effects_control[channel].flags |= EFFECTS_FLAG_NEED_INITIALIZATION; |
| 923 | m_effects_control[channel].current = table_start; |
| 924 | m_effects_control[channel].return_address_depth = 0; |
| 925 | m_effects_control[channel].flags |= EFFECTS_FLAG_NEED_INITIALIZATION; |
| 976 | 926 | } |
| 977 | 927 | } |
| 978 | 928 | } |
| r24657 | r24658 | |
| 982 | 932 | |
| 983 | 933 | |
| 984 | 934 | |
| 985 | | static void update_music(void) |
| 935 | void nmk004_device::update_music(void) |
| 986 | 936 | { |
| 987 | 937 | int channel; |
| 988 | 938 | |
| r24657 | r24658 | |
| 999 | 949 | |
| 1000 | 950 | |
| 1001 | 951 | |
| 1002 | | void NMK004_irq(device_t *device, int irq) |
| 952 | void nmk004_device::ym2203_irq_handler(int irq) |
| 1003 | 953 | { |
| 1004 | 954 | if (irq) |
| 1005 | 955 | { |
| 1006 | | address_space &space = NMK004_state.machine().firstcpu->space(AS_PROGRAM); |
| 1007 | | int status = NMK004_state.ymdevice->status_port_r(space,0); |
| 956 | address_space &space = machine().firstcpu->space(AS_PROGRAM); |
| 957 | int status = m_ymdevice->status_port_r(space,0); |
| 1008 | 958 | |
| 1009 | 959 | if (status & 1) // timer A expired |
| 1010 | 960 | { |
| r24657 | r24658 | |
| 1013 | 963 | update_music(); |
| 1014 | 964 | |
| 1015 | 965 | // restart timer |
| 1016 | | NMK004_state.ymdevice->control_port_w(space, 0, 0x27); |
| 1017 | | NMK004_state.ymdevice->write_port_w(space, 0, 0x15); |
| 966 | m_ymdevice->control_port_w(space, 0, 0x27); |
| 967 | m_ymdevice->write_port_w(space, 0, 0x15); |
| 1018 | 968 | } |
| 1019 | 969 | } |
| 1020 | 970 | } |
| 1021 | 971 | |
| 1022 | 972 | |
| 1023 | | static TIMER_CALLBACK( real_nmk004_init ) |
| 973 | TIMER_CALLBACK_MEMBER( nmk004_device::real_init ) |
| 1024 | 974 | { |
| 1025 | 975 | static const UINT8 ym2203_init[] = |
| 1026 | 976 | { |
| r24657 | r24658 | |
| 1030 | 980 | }; |
| 1031 | 981 | int i; |
| 1032 | 982 | |
| 1033 | | memset(&NMK004_state, 0, sizeof(NMK004_state)); |
| 983 | m_ymdevice = machine().device<ym2203_device>("ymsnd"); |
| 984 | m_oki1device = machine().device<okim6295_device>("oki1"); |
| 985 | m_oki2device = machine().device<okim6295_device>("oki2"); |
| 1034 | 986 | |
| 1035 | | NMK004_state.set_machine(machine); |
| 1036 | | NMK004_state.ymdevice = machine.device<ym2203_device>("ymsnd"); |
| 1037 | | NMK004_state.oki1device = machine.device<okim6295_device>("oki1"); |
| 1038 | | NMK004_state.oki2device = machine.device<okim6295_device>("oki2"); |
| 987 | m_rom = machine().root_device().memregion("audiocpu")->base(); |
| 1039 | 988 | |
| 1040 | | NMK004_state.rom = machine.root_device().memregion("audiocpu")->base(); |
| 1041 | | |
| 1042 | | address_space &space = NMK004_state.machine().firstcpu->space(AS_PROGRAM); |
| 1043 | | NMK004_state.ymdevice->control_port_w(space, 0, 0x2f); |
| 1044 | | |
| 1045 | | i = 0; |
| 1046 | | while (ym2203_init[i] != 0xff) |
| 989 | address_space &space = machine().firstcpu->space(AS_PROGRAM); |
| 990 | |
| 991 | if (m_ymdevice != NULL) |
| 1047 | 992 | { |
| 1048 | | NMK004_state.ymdevice->control_port_w(space, 0, ym2203_init[i++]); |
| 1049 | | NMK004_state.ymdevice->write_port_w(space, 0, ym2203_init[i++]); |
| 1050 | | } |
| 993 | m_ymdevice->control_port_w(space, 0, 0x2f); |
| 1051 | 994 | |
| 1052 | | NMK004_state.oki_playing = 0; |
| 995 | i = 0; |
| 996 | while (ym2203_init[i] != 0xff) |
| 997 | { |
| 998 | m_ymdevice->control_port_w(space, 0, ym2203_init[i++]); |
| 999 | m_ymdevice->write_port_w(space, 0, ym2203_init[i++]); |
| 1000 | } |
| 1001 | } |
| 1002 | else |
| 1003 | return; |
| 1004 | |
| 1005 | m_oki_playing = 0; |
| 1053 | 1006 | |
| 1054 | 1007 | oki_play_sample(0); |
| 1055 | 1008 | |
| 1056 | | NMK004_state.protection_check = 0; |
| 1009 | m_protection_check = 0; |
| 1057 | 1010 | } |
| 1058 | 1011 | |
| 1059 | | void NMK004_init(running_machine &machine) |
| 1060 | | { |
| 1061 | | /* we have to do this via a timer because we get called before the sound reset */ |
| 1062 | | machine.scheduler().synchronize(FUNC(real_nmk004_init)); |
| 1063 | | } |
| 1064 | 1012 | |
| 1065 | | |
| 1066 | | WRITE16_HANDLER( NMK004_w ) |
| 1013 | WRITE16_MEMBER( nmk004_device::write ) |
| 1067 | 1014 | { |
| 1068 | 1015 | if (ACCESSING_BITS_0_7) |
| 1069 | 1016 | { |
| 1070 | 1017 | //logerror("%06x: NMK004_w %02x\n",space.device().safe_pc(),data); |
| 1071 | | NMK004_state.from_main = data & 0xff; |
| 1018 | m_from_main = data & 0xff; |
| 1072 | 1019 | } |
| 1073 | 1020 | } |
| 1074 | 1021 | |
| 1075 | | READ16_HANDLER( NMK004_r ) |
| 1022 | READ16_MEMBER( nmk004_device::read ) |
| 1076 | 1023 | { |
| 1077 | 1024 | //static int last; |
| 1078 | | int res = NMK004_state.to_main; |
| 1025 | int res = m_to_main; |
| 1079 | 1026 | |
| 1080 | 1027 | //if (res != last) logerror("%06x: NMK004_r %02x\n",space.device().safe_pc(),res); |
| 1081 | 1028 | //last = res; |
trunk/src/mame/drivers/nmk16.c
| r24657 | r24658 | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
| 193 | | MACHINE_RESET_MEMBER(nmk16_state,NMK004) |
| 194 | | { |
| 195 | | NMK004_init(machine()); |
| 196 | | } |
| 197 | | |
| 198 | 193 | WRITE16_MEMBER(nmk16_state::ssmissin_sound_w) |
| 199 | 194 | { |
| 200 | 195 | if (ACCESSING_BITS_0_7) |
| r24657 | r24658 | |
| 309 | 304 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
| 310 | 305 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
| 311 | 306 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") |
| 312 | | AM_RANGE(0x08000e, 0x08000f) AM_READ_LEGACY(NMK004_r) |
| 307 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) |
| 313 | 308 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP /* IRQ enable? */ |
| 314 | 309 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 315 | | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 310 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) |
| 316 | 311 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") |
| 317 | 312 | AM_RANGE(0x08c000, 0x08c007) AM_WRITE(vandyke_scroll_w) |
| 318 | 313 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") |
| r24657 | r24658 | |
| 327 | 322 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
| 328 | 323 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
| 329 | 324 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") |
| 330 | | AM_RANGE(0x08000e, 0x08000f) AM_READ_LEGACY(NMK004_r) |
| 325 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) |
| 331 | 326 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP /* IRQ enable? */ |
| 332 | 327 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 333 | 328 | AM_RANGE(0x080010, 0x08001d) AM_WRITE(vandykeb_scroll_w) /* 10, 12, 1a, 1c */ |
| 334 | | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 329 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) |
| 335 | 330 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") |
| 336 | 331 | AM_RANGE(0x08c000, 0x08c007) AM_WRITENOP /* just in case... */ |
| 337 | 332 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") |
| r24657 | r24658 | |
| 400 | 395 | AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN0") |
| 401 | 396 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
| 402 | 397 | AM_RANGE(0x080004, 0x080005) AM_READ_PORT("DSW1") |
| 403 | | AM_RANGE(0x08000e, 0x08000f) AM_READ_LEGACY(NMK004_r) AM_WRITENOP |
| 398 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) AM_WRITENOP |
| 404 | 399 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 405 | 400 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP // frame number? |
| 406 | | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 401 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) |
| 407 | 402 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") |
| 408 | 403 | AM_RANGE(0x08c000, 0x08c001) AM_WRITE(mustang_scroll_w) |
| 409 | 404 | AM_RANGE(0x08c002, 0x08c087) AM_WRITENOP // ?? |
| r24657 | r24658 | |
| 455 | 450 | AM_RANGE(0xc0002, 0xc0003) AM_READ_PORT("IN1") |
| 456 | 451 | AM_RANGE(0xc0008, 0xc0009) AM_READ_PORT("DSW1") |
| 457 | 452 | AM_RANGE(0xc000a, 0xc000b) AM_READ_PORT("DSW2") |
| 458 | | AM_RANGE(0xc000e, 0xc000f) AM_READ_LEGACY(NMK004_r) |
| 453 | AM_RANGE(0xc000e, 0xc000f) AM_DEVREAD("nmk004", nmk004_device, read) |
| 459 | 454 | AM_RANGE(0xc0014, 0xc0015) AM_WRITE(nmk_flipscreen_w) |
| 460 | 455 | AM_RANGE(0xc0016, 0xc0017) AM_WRITENOP |
| 461 | 456 | AM_RANGE(0xc0018, 0xc0019) AM_WRITE(nmk_tilebank_w) |
| 462 | | AM_RANGE(0xc001e, 0xc001f) AM_WRITE_LEGACY(NMK004_w) |
| 457 | AM_RANGE(0xc001e, 0xc001f) AM_DEVWRITE("nmk004", nmk004_device, write) |
| 463 | 458 | AM_RANGE(0xc4000, 0xc45ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram") |
| 464 | 459 | AM_RANGE(0xc8000, 0xc8007) AM_RAM_WRITE(nmk_scroll_w) |
| 465 | 460 | AM_RANGE(0xcc000, 0xcffff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") |
| r24657 | r24658 | |
| 472 | 467 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
| 473 | 468 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
| 474 | 469 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") |
| 475 | | AM_RANGE(0x08000e, 0x08000f) AM_READ_LEGACY(NMK004_r) |
| 470 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) |
| 476 | 471 | // AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 477 | | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 472 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) |
| 478 | 473 | AM_RANGE(0x084000, 0x084001) AM_WRITE(bioship_bank_w) |
| 479 | 474 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") |
| 480 | 475 | AM_RANGE(0x08c000, 0x08c007) AM_RAM_WRITE(bioshipbg_scroll_w) |
| r24657 | r24658 | |
| 650 | 645 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
| 651 | 646 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
| 652 | 647 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("UNK") |
| 653 | | AM_RANGE(0x08000e, 0x08000f) AM_READ_LEGACY(NMK004_r) |
| 648 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) |
| 654 | 649 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 655 | 650 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 656 | | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 651 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) |
| 657 | 652 | /* Video Region */ |
| 658 | 653 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") |
| 659 | 654 | AM_RANGE(0x08c000, 0x08c007) AM_WRITE(nmk_scroll_w) |
| r24657 | r24658 | |
| 882 | 877 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("IN1") |
| 883 | 878 | AM_RANGE(0x0c0008, 0x0c0009) AM_READ_PORT("DSW1") |
| 884 | 879 | AM_RANGE(0x0c000a, 0x0c000b) AM_READ_PORT("DSW2") |
| 885 | | AM_RANGE(0x0c000e, 0x0c000f) AM_READ_LEGACY(NMK004_r) |
| 880 | AM_RANGE(0x0c000e, 0x0c000f) AM_DEVREAD("nmk004", nmk004_device, read) |
| 886 | 881 | AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(nmk_flipscreen_w) /* Maybe */ |
| 887 | 882 | AM_RANGE(0x0c0018, 0x0c0019) AM_WRITE(nmk_tilebank_w) /* Tile Bank ? */ |
| 888 | | AM_RANGE(0x0c001e, 0x0c001f) AM_WRITE_LEGACY(NMK004_w) |
| 883 | AM_RANGE(0x0c001e, 0x0c001f) AM_DEVWRITE("nmk004", nmk004_device, write) |
| 889 | 884 | AM_RANGE(0x0c4000, 0x0c4007) AM_RAM_WRITE(nmk_scroll_w) |
| 890 | 885 | AM_RANGE(0x0c8000, 0x0c87ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") |
| 891 | 886 | AM_RANGE(0x0cc000, 0x0cffff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") |
| r24657 | r24658 | |
| 945 | 940 | AM_RANGE(0x80002, 0x80003) AM_READ_PORT("IN1") |
| 946 | 941 | AM_RANGE(0x80008, 0x80009) AM_READ_PORT("DSW1") |
| 947 | 942 | AM_RANGE(0x8000a, 0x8000b) AM_READ_PORT("DSW2") |
| 948 | | AM_RANGE(0x8000e, 0x8000f) AM_READ_LEGACY(NMK004_r) |
| 943 | AM_RANGE(0x8000e, 0x8000f) AM_DEVREAD("nmk004", nmk004_device, read) |
| 949 | 944 | AM_RANGE(0x80014, 0x80015) AM_WRITE(nmk_flipscreen_w) |
| 950 | 945 | AM_RANGE(0x80016, 0x80017) AM_WRITENOP /* IRQ enable? */ |
| 951 | | AM_RANGE(0x8001e, 0x8001f) AM_WRITE_LEGACY(NMK004_w) |
| 946 | AM_RANGE(0x8001e, 0x8001f) AM_DEVWRITE("nmk004", nmk004_device, write) |
| 952 | 947 | AM_RANGE(0x84000, 0x84007) AM_RAM_WRITE(nmk_scroll_w) |
| 953 | 948 | AM_RANGE(0x88000, 0x88007) AM_RAM_WRITE(nmk_scroll_2_w) |
| 954 | 949 | AM_RANGE(0x8c000, 0x8c7ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram") |
| r24657 | r24658 | |
| 964 | 959 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
| 965 | 960 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
| 966 | 961 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") |
| 967 | | AM_RANGE(0x08000e, 0x08000f) AM_READ_LEGACY(NMK004_r) |
| 962 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) |
| 968 | 963 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 969 | 964 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP /* IRQ enable? */ |
| 970 | 965 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 971 | | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 966 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) |
| 972 | 967 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") |
| 973 | 968 | AM_RANGE(0x08c000, 0x08c007) AM_RAM_WRITE(nmk_scroll_w) |
| 974 | 969 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") |
| r24657 | r24658 | |
| 982 | 977 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
| 983 | 978 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
| 984 | 979 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") |
| 985 | | AM_RANGE(0x08000e, 0x08000f) AM_READ_LEGACY(NMK004_r) |
| 980 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) |
| 986 | 981 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
| 987 | 982 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP /* IRQ enable? */ |
| 988 | 983 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
| 989 | | AM_RANGE(0x08001e, 0x08001f) AM_WRITE_LEGACY(NMK004_w) |
| 984 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) |
| 990 | 985 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBRGBx_word_w) AM_SHARE("paletteram") |
| 991 | 986 | AM_RANGE(0x08c000, 0x08c1ff) AM_WRITEONLY AM_SHARE("scrollram") |
| 992 | 987 | AM_RANGE(0x08c200, 0x08c3ff) AM_WRITEONLY AM_SHARE("scrollramy") |
| r24657 | r24658 | |
| 3672 | 3667 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ |
| 3673 | 3668 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) |
| 3674 | 3669 | |
| 3675 | | MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004) |
| 3676 | | |
| 3677 | 3670 | /* video hardware */ |
| 3678 | 3671 | MCFG_SCREEN_ADD("screen", RASTER) |
| 3679 | 3672 | MCFG_SCREEN_REFRESH_RATE(56) |
| r24657 | r24658 | |
| 3690 | 3683 | |
| 3691 | 3684 | /* sound hardware */ |
| 3692 | 3685 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 3686 | |
| 3687 | MCFG_NMK004_ADD("nmk004") |
| 3693 | 3688 | |
| 3694 | 3689 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
| 3695 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<NMK004_irq>)) |
| 3690 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
| 3696 | 3691 | MCFG_YM2203_AY8910_INTF(&ay8910_config) |
| 3697 | 3692 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
| 3698 | 3693 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
| r24657 | r24658 | |
| 3746 | 3741 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 100)/* 112 breaks the title screen */ |
| 3747 | 3742 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) |
| 3748 | 3743 | |
| 3749 | | MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004) |
| 3750 | | |
| 3751 | 3744 | /* video hardware */ |
| 3752 | 3745 | MCFG_SCREEN_ADD("screen", RASTER) |
| 3753 | 3746 | MCFG_SCREEN_REFRESH_RATE(56) |
| r24657 | r24658 | |
| 3764 | 3757 | |
| 3765 | 3758 | /* sound hardware */ |
| 3766 | 3759 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 3760 | |
| 3761 | MCFG_NMK004_ADD("nmk004") |
| 3767 | 3762 | |
| 3768 | 3763 | MCFG_SOUND_ADD("ymsnd", YM2203, BIOSHIP_CRYSTAL2 / 8) /* 1.5 Mhz (verified) */ |
| 3769 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<NMK004_irq>)) |
| 3764 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
| 3770 | 3765 | MCFG_YM2203_AY8910_INTF(&ay8910_config) |
| 3771 | 3766 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
| 3772 | 3767 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
| r24657 | r24658 | |
| 3788 | 3783 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ |
| 3789 | 3784 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) |
| 3790 | 3785 | |
| 3791 | | MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004) |
| 3792 | | |
| 3793 | 3786 | /* video hardware */ |
| 3794 | 3787 | MCFG_SCREEN_ADD("screen", RASTER) |
| 3795 | 3788 | MCFG_SCREEN_REFRESH_RATE(56) |
| r24657 | r24658 | |
| 3806 | 3799 | |
| 3807 | 3800 | /* sound hardware */ |
| 3808 | 3801 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 3802 | |
| 3803 | MCFG_NMK004_ADD("nmk004") |
| 3809 | 3804 | |
| 3810 | 3805 | MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/8) /* verified on pcb */ |
| 3811 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<NMK004_irq>)) |
| 3806 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
| 3812 | 3807 | MCFG_YM2203_AY8910_INTF(&ay8910_config) |
| 3813 | 3808 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
| 3814 | 3809 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
| r24657 | r24658 | |
| 3833 | 3828 | MCFG_CPU_ADD("mcu", PIC16C57, 12000000) /* 3MHz */ |
| 3834 | 3829 | MCFG_DEVICE_DISABLE() |
| 3835 | 3830 | |
| 3836 | | //MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004) // no NMK004 |
| 3837 | | |
| 3838 | 3831 | /* video hardware */ |
| 3839 | 3832 | MCFG_SCREEN_ADD("screen", RASTER) |
| 3840 | 3833 | MCFG_SCREEN_REFRESH_RATE(56) |
| r24657 | r24658 | |
| 3851 | 3844 | |
| 3852 | 3845 | /* sound hardware */ |
| 3853 | 3846 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 3847 | |
| 3848 | MCFG_NMK004_ADD("nmk004") |
| 3854 | 3849 | |
| 3855 | 3850 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) |
| 3856 | 3851 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| r24657 | r24658 | |
| 3864 | 3859 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ |
| 3865 | 3860 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) |
| 3866 | 3861 | |
| 3867 | | MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004) |
| 3868 | | |
| 3869 | 3862 | /* video hardware */ |
| 3870 | 3863 | MCFG_SCREEN_ADD("screen", RASTER) |
| 3871 | 3864 | MCFG_SCREEN_REFRESH_RATE(56) |
| r24657 | r24658 | |
| 3882 | 3875 | |
| 3883 | 3876 | /* sound hardware */ |
| 3884 | 3877 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 3878 | |
| 3879 | MCFG_NMK004_ADD("nmk004") |
| 3885 | 3880 | |
| 3886 | 3881 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) /* (verified on pcb) */ |
| 3887 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<NMK004_irq>)) |
| 3882 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
| 3888 | 3883 | MCFG_YM2203_AY8910_INTF(&ay8910_config) |
| 3889 | 3884 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
| 3890 | 3885 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
| r24657 | r24658 | |
| 3937 | 3932 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ?? drives music */ |
| 3938 | 3933 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) |
| 3939 | 3934 | |
| 3940 | | MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004) |
| 3941 | | |
| 3942 | 3935 | /* video hardware */ |
| 3943 | 3936 | MCFG_SCREEN_ADD("screen", RASTER) |
| 3944 | 3937 | MCFG_SCREEN_REFRESH_RATE(56) |
| r24657 | r24658 | |
| 3956 | 3949 | |
| 3957 | 3950 | /* sound hardware */ |
| 3958 | 3951 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 3952 | |
| 3953 | MCFG_NMK004_ADD("nmk004") |
| 3959 | 3954 | |
| 3960 | 3955 | MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/8) /* verified on pcb */ |
| 3961 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<NMK004_irq>)) |
| 3956 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
| 3962 | 3957 | MCFG_YM2203_AY8910_INTF(&ay8910_config) |
| 3963 | 3958 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
| 3964 | 3959 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
| r24657 | r24658 | |
| 4013 | 4008 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ |
| 4014 | 4009 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) |
| 4015 | 4010 | |
| 4016 | | MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004) |
| 4017 | | |
| 4018 | | /* video hardware */ |
| 4011 | /* video hardware */ |
| 4019 | 4012 | MCFG_SCREEN_ADD("screen", RASTER) |
| 4020 | 4013 | MCFG_SCREEN_REFRESH_RATE(56) |
| 4021 | 4014 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| r24657 | r24658 | |
| 4031 | 4024 | |
| 4032 | 4025 | /* sound hardware */ |
| 4033 | 4026 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 4027 | |
| 4028 | MCFG_NMK004_ADD("nmk004") |
| 4034 | 4029 | |
| 4035 | 4030 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
| 4036 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<NMK004_irq>)) |
| 4031 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
| 4037 | 4032 | MCFG_YM2203_AY8910_INTF(&ay8910_config) |
| 4038 | 4033 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
| 4039 | 4034 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
| r24657 | r24658 | |
| 4055 | 4050 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) |
| 4056 | 4051 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ |
| 4057 | 4052 | |
| 4058 | | MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004) |
| 4059 | | |
| 4060 | 4053 | /* video hardware */ |
| 4061 | 4054 | MCFG_SCREEN_ADD("screen", RASTER) |
| 4062 | 4055 | MCFG_SCREEN_REFRESH_RATE(56) |
| r24657 | r24658 | |
| 4074 | 4067 | |
| 4075 | 4068 | /* sound hardware */ |
| 4076 | 4069 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 4070 | |
| 4071 | MCFG_NMK004_ADD("nmk004") |
| 4077 | 4072 | |
| 4078 | 4073 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
| 4079 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<NMK004_irq>)) |
| 4074 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
| 4080 | 4075 | MCFG_YM2203_AY8910_INTF(&ay8910_config) |
| 4081 | 4076 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
| 4082 | 4077 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
| r24657 | r24658 | |
| 4098 | 4093 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) |
| 4099 | 4094 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ |
| 4100 | 4095 | |
| 4101 | | MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004) |
| 4102 | | |
| 4103 | 4096 | /* video hardware */ |
| 4104 | 4097 | MCFG_SCREEN_ADD("screen", RASTER) |
| 4105 | 4098 | MCFG_SCREEN_REFRESH_RATE(56) |
| r24657 | r24658 | |
| 4116 | 4109 | |
| 4117 | 4110 | /* sound hardware */ |
| 4118 | 4111 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 4112 | |
| 4113 | MCFG_NMK004_ADD("nmk004") |
| 4119 | 4114 | |
| 4120 | 4115 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
| 4121 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<NMK004_irq>)) |
| 4116 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
| 4122 | 4117 | MCFG_YM2203_AY8910_INTF(&ay8910_config) |
| 4123 | 4118 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
| 4124 | 4119 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
| r24657 | r24658 | |
| 4140 | 4135 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) |
| 4141 | 4136 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ |
| 4142 | 4137 | |
| 4143 | | MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004) |
| 4144 | | |
| 4145 | 4138 | /* video hardware */ |
| 4146 | 4139 | MCFG_SCREEN_ADD("screen", RASTER) |
| 4147 | 4140 | MCFG_SCREEN_REFRESH_RATE(56.18) /* verified on pcb */ |
| r24657 | r24658 | |
| 4158 | 4151 | |
| 4159 | 4152 | /* sound hardware */ |
| 4160 | 4153 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 4154 | |
| 4155 | MCFG_NMK004_ADD("nmk004") |
| 4161 | 4156 | |
| 4162 | 4157 | MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/8 ) /* verified on pcb */ |
| 4163 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<NMK004_irq>)) |
| 4158 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
| 4164 | 4159 | MCFG_YM2203_AY8910_INTF(&ay8910_config) |
| 4165 | 4160 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
| 4166 | 4161 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
| r24657 | r24658 | |
| 4182 | 4177 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) |
| 4183 | 4178 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112) |
| 4184 | 4179 | |
| 4185 | | MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004) |
| 4186 | | |
| 4187 | 4180 | /* video hardware */ |
| 4188 | 4181 | MCFG_SCREEN_ADD("screen", RASTER) |
| 4189 | 4182 | MCFG_SCREEN_REFRESH_RATE(56) |
| r24657 | r24658 | |
| 4200 | 4193 | |
| 4201 | 4194 | /* sound hardware */ |
| 4202 | 4195 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 4196 | |
| 4197 | MCFG_NMK004_ADD("nmk004") |
| 4203 | 4198 | |
| 4204 | 4199 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
| 4205 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(driver_device, member_wrapper_line<NMK004_irq>)) |
| 4200 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
| 4206 | 4201 | MCFG_YM2203_AY8910_INTF(&ay8910_config) |
| 4207 | 4202 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
| 4208 | 4203 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |