trunk/src/emu/bus/cpc/playcity.c
r241650 | r241651 | |
3 | 3 | |
4 | 4 | Z80 CTC |
5 | 5 | 2x YMZ294 (clocks provided by CTC) |
| 6 | |
| 7 | TODO: |
| 8 | IRQs aren't working currently, the Z80CTC core requires the daisy chain setup to acknowledge IRQs properly, and that can't be used in a slot device currently. |
| 9 | Add CRTC Cursor signal support to the expansion bus, this should get NMIs working consistently. |
6 | 10 | */ |
7 | 11 | |
8 | 12 | #include "playcity.h" |
r241650 | r241651 | |
18 | 22 | static MACHINE_CONFIG_FRAGMENT( cpc_playcity ) |
19 | 23 | MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL_4MHz) |
20 | 24 | MCFG_Z80CTC_ZC1_CB(WRITELINE(cpc_playcity_device,ctc_zc1_cb)) |
21 | | MCFG_Z80CTC_ZC2_CB(WRITELINE(cpc_playcity_device,ctc_zc2_cb)) |
| 25 | MCFG_Z80CTC_ZC2_CB(DEVWRITELINE("ctc",z80ctc_device,trg3)) |
| 26 | MCFG_Z80CTC_INTR_CB(WRITELINE(cpc_playcity_device,ctc_intr_cb)) |
22 | 27 | |
23 | | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 28 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker") |
24 | 29 | MCFG_SOUND_ADD("ymz_1",YMZ294,XTAL_4MHz) // when timer is not set, operates at 4MHz (interally divided by 2, so equivalent to the ST) |
25 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 30 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) |
26 | 31 | MCFG_SOUND_ADD("ymz_2",YMZ294,XTAL_4MHz) |
27 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 32 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) |
28 | 33 | |
29 | 34 | // pass-through |
30 | 35 | MCFG_DEVICE_ADD("exp", CPC_EXPANSION_SLOT, 0) |
r241650 | r241651 | |
89 | 94 | WRITE8_MEMBER(cpc_playcity_device::ctc_w) |
90 | 95 | { |
91 | 96 | m_ctc->write(space,offset,data); |
92 | | update_ymz_clock(); |
| 97 | if(offset == 0) |
| 98 | update_ymz_clock(); |
93 | 99 | } |
94 | 100 | |
95 | 101 | WRITE8_MEMBER(cpc_playcity_device::ymz1_address_w) |
trunk/src/emu/bus/cpc/playcity.h
r241650 | r241651 | |
3 | 3 | |
4 | 4 | I/O ports: |
5 | 5 | * F880 - Z80CTC channel 0 (input is system clock (4MHz), output to YMZ294 clock) |
6 | | * F881 - Z80CTC channel 1 (input from CRTC CURSOR, output to NMI) |
| 6 | * F881 - Z80CTC channel 1 (input from CRTC CURSOR, output to /NMI) |
7 | 7 | * F882 - Z80CTC channel 2 (input is system clock (4MHz), output to channel 3 input) |
8 | | * F883 - Z80CTC channel 3 (input is channel 2 output, output to IRQ) |
| 8 | * F883 - Z80CTC channel 3 (input is channel 2 output) |
9 | 9 | * F884 - YMZ294 #1 (right) data |
10 | 10 | * F888 - YMZ294 #2 (left) data |
11 | 11 | * F984 - YMZ294 #1 (right) register select |
r241650 | r241651 | |
39 | 39 | DECLARE_WRITE8_MEMBER(ymz2_data_w); |
40 | 40 | DECLARE_READ8_MEMBER(ymz1_data_r); |
41 | 41 | DECLARE_READ8_MEMBER(ymz2_data_r); |
42 | | DECLARE_WRITE_LINE_MEMBER(ctc_zc1_cb) { if(state) {m_slot->nmi_w(1); m_slot->nmi_w(0); } } |
43 | | DECLARE_WRITE_LINE_MEMBER(ctc_zc2_cb) { m_slot->irq_w(state); } |
| 42 | DECLARE_WRITE_LINE_MEMBER(ctc_zc1_cb) { if(state) { m_slot->nmi_w(1); m_slot->nmi_w(0); } printf("NMI %i",state); } |
| 43 | DECLARE_WRITE_LINE_MEMBER(ctc_intr_cb) { m_slot->irq_w(state); } |
44 | 44 | |
45 | 45 | protected: |
46 | 46 | // device-level overrides |