diff options
Diffstat (limited to 'src/mame/machine/dgn_beta.cpp')
-rw-r--r-- | src/mame/machine/dgn_beta.cpp | 89 |
1 files changed, 42 insertions, 47 deletions
diff --git a/src/mame/machine/dgn_beta.cpp b/src/mame/machine/dgn_beta.cpp index 3c75c4c11f9..dab45919b06 100644 --- a/src/mame/machine/dgn_beta.cpp +++ b/src/mame/machine/dgn_beta.cpp @@ -35,7 +35,7 @@ 2005-11-29 - Major track tracing excersise on scans of bare beta board, reveal where a + Major track tracing exercise on scans of bare beta board, reveal where a whole bunch of the PIA lines go, especially the IRQs, most of them go back to the IRQ line on the main CPU. @@ -46,8 +46,8 @@ 2005-12-08 Fixed density setting on WD2797, so density of read data is now - correctlty set as required by OS-9. This was the reason startup - script was not being executed as Beta disks have a single denisty + correctly set as required by OS-9. This was the reason startup + script was not being executed as Beta disks have a single density boot track, however the rest of the disk is double density. Booted completely to OS-9, including running startup script. @@ -89,8 +89,8 @@ //static int DMA_NMI; /* DMA cpu has received an NMI */ -#define INVALID_KEYROW -1 /* no ketrow selected */ -#define NO_KEY_PRESSED 0x7F /* retrurned by hardware if no key pressed */ +#define INVALID_KEYROW -1 /* no keyrow selected */ +#define NO_KEY_PRESSED 0x7F /* returned by hardware if no key pressed */ // Info for bank switcher struct bank_info_entry @@ -135,15 +135,15 @@ static const struct bank_info_entry bank_info[] = // For the purpose of this driver any block that is not ram, and is not a known ROM block, // is mapped to the first page of the boot rom, I do not know what happens in the real // hardware, however this does allow the boot rom to correctly size the RAM. -// this should probably be considdered a hack ! +// this should probably be considered a hack ! // void dgn_beta_state::UpdateBanks(int first, int last) { address_space &space_0 = m_maincpu->space(AS_PROGRAM); - address_space &space_1 = machine().device(DMACPU_TAG)->memory().space(AS_PROGRAM); + address_space &space_1 = m_dmacpu->space(AS_PROGRAM); int Page; - uint8_t *readbank; + uint8_t *readbank; int bank_start; int bank_end; int MapPage; @@ -575,7 +575,7 @@ WRITE8_MEMBER(dgn_beta_state::d_pia1_pa_w) HALT_DMA = CLEAR_LINE; LOG_HALT(("DMA_CPU HALT=%d\n", HALT_DMA)); - machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_HALT, HALT_DMA); + m_dmacpu->set_input_line(INPUT_LINE_HALT, HALT_DMA); /* CPU un-halted let it run ! */ if (HALT_DMA == CLEAR_LINE) @@ -597,6 +597,11 @@ WRITE8_MEMBER(dgn_beta_state::d_pia1_pa_w) m_fdc->set_floppy(floppy); + if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(0); + if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(0); + if (m_floppy2->get_device()) m_floppy2->get_device()->mon_w(0); + if (m_floppy3->get_device()) m_floppy3->get_device()->mon_w(0); + // not connected: bit 5 = ENP m_fdc->dden_w(BIT(data, 6)); LOG_DISK(("Set density %s\n", BIT(data, 6) ? "low" : "high")); @@ -627,7 +632,7 @@ WRITE8_MEMBER(dgn_beta_state::d_pia1_pb_w) /* CPU un-halted let it run ! */ if (HALT_CPU == CLEAR_LINE) - machine().device(DMACPU_TAG)->execute().yield(); + m_dmacpu->yield(); } } @@ -648,7 +653,7 @@ WRITE_LINE_MEMBER(dgn_beta_state::d_pia1_irq_b) DMA CPU NMI PA7 Graphics control PB0..PB7 ??? - VSYNC intutrupt CB2 + VSYNC interrupt CB2 */ READ8_MEMBER(dgn_beta_state::d_pia2_pa_r) { @@ -672,13 +677,13 @@ WRITE8_MEMBER(dgn_beta_state::d_pia2_pa_w) LOG_INTS(("cpu1 NMI : %d\n", NMI)); if(!NMI) { - machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); + m_dmacpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); logerror("device_yield()\n"); - machine().device(DMACPU_TAG)->execute().yield(); /* Let DMA CPU run */ + m_dmacpu->yield(); /* Let DMA CPU run */ } else { - machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + m_dmacpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } m_DMA_NMI_LAST = NMI; /* Save it for next time */ @@ -697,7 +702,7 @@ WRITE8_MEMBER(dgn_beta_state::d_pia2_pa_w) LOG_TASK(("OldTask=$%02X EnableMapRegs=%d OldEnableMap=%d\n", OldTask, m_EnableMapRegs, OldEnableMap)); - // Maping was enabled or disabled, select apropreate task reg + // Mapping was enabled or disabled, select appropriate task reg // and map it in if (m_EnableMapRegs != OldEnableMap) { @@ -741,18 +746,15 @@ WRITE_LINE_MEMBER(dgn_beta_state::d_pia2_irq_b) cpu0_recalc_irq(state); } -/************************************ Recalculate CPU inturrupts ****************************/ +/************************************ Recalculate CPU interrupts ****************************/ /* CPU 0 */ void dgn_beta_state::cpu0_recalc_irq(int state) { - pia6821_device *pia_0 = machine().device<pia6821_device>( PIA_0_TAG ); - pia6821_device *pia_1 = machine().device<pia6821_device>( PIA_1_TAG ); - pia6821_device *pia_2 = machine().device<pia6821_device>( PIA_2_TAG ); - uint8_t pia0_irq_a = pia_0->irq_a_state(); - uint8_t pia1_irq_a = pia_1->irq_a_state(); - uint8_t pia1_irq_b = pia_1->irq_b_state(); - uint8_t pia2_irq_a = pia_2->irq_a_state(); - uint8_t pia2_irq_b = pia_2->irq_b_state(); + uint8_t pia0_irq_a = m_pia_0->irq_a_state(); + uint8_t pia1_irq_a = m_pia_1->irq_a_state(); + uint8_t pia1_irq_b = m_pia_1->irq_b_state(); + uint8_t pia2_irq_a = m_pia_2->irq_a_state(); + uint8_t pia2_irq_b = m_pia_2->irq_b_state(); uint8_t IRQ; if (pia0_irq_a || pia1_irq_a || pia1_irq_b || pia2_irq_a || pia2_irq_b) @@ -766,8 +768,7 @@ void dgn_beta_state::cpu0_recalc_irq(int state) void dgn_beta_state::cpu0_recalc_firq(int state) { - pia6821_device *pia_0 = machine().device<pia6821_device>( PIA_0_TAG ); - uint8_t pia0_irq_b = pia_0->irq_b_state(); + uint8_t pia0_irq_b = m_pia_0->irq_b_state(); uint8_t FIRQ; if (pia0_irq_b) @@ -784,7 +785,7 @@ void dgn_beta_state::cpu0_recalc_firq(int state) void dgn_beta_state::cpu1_recalc_firq(int state) { - machine().device(DMACPU_TAG)->execute().set_input_line(M6809_FIRQ_LINE, state); + m_dmacpu->set_input_line(M6809_FIRQ_LINE, state); LOG_INTS(("cpu1 FIRQ : %d\n",state)); } @@ -795,13 +796,13 @@ void dgn_beta_state::cpu1_recalc_firq(int state) /* The INTRQ line goes through pia2 ca1, in exactly the same way as DRQ from DragonDos does */ WRITE_LINE_MEMBER( dgn_beta_state::dgnbeta_fdc_intrq_w ) { - device_t *device = machine().device(PIA_2_TAG); LOG_DISK(("dgnbeta_fdc_intrq_w(%d)\n", state)); + if(m_wd2797_written) - downcast<pia6821_device *>(device)->ca1_w(state); + m_pia_2->ca1_w(state); } -/* DRQ is routed through various logic to the FIRQ inturrupt line on *BOTH* CPUs */ +/* DRQ is routed through various logic to the FIRQ interrupt line on *BOTH* CPUs */ WRITE_LINE_MEMBER( dgn_beta_state::dgnbeta_fdc_drq_w ) { LOG_DISK(("dgnbeta_fdc_drq_w(%d)\n", state)); @@ -853,16 +854,14 @@ void dgn_beta_state::ScanInKeyboard(void) #endif } -/* VBlank inturrupt */ +/* VBlank interrupt */ void dgn_beta_state::dgn_beta_frame_interrupt (int data) { - pia6821_device *pia_2 = machine().device<pia6821_device>( PIA_2_TAG ); - - /* Set PIA line, so it recognises inturrupt */ + /* Set PIA line, so it recognises interrupt */ if (!data) - pia_2->cb2_w(ASSERT_LINE); + m_pia_2->cb2_w(ASSERT_LINE); else - pia_2->cb2_w(CLEAR_LINE); + m_pia_2->cb2_w(CLEAR_LINE); // LOG_VIDEO(("Vblank\n")); ScanInKeyboard(); @@ -871,14 +870,14 @@ void dgn_beta_state::dgn_beta_frame_interrupt (int data) #ifdef UNUSED_FUNCTION void dgn_beta_state::dgn_beta_line_interrupt (int data) { -// /* Set PIA line, so it recognises inturrupt */ +// /* Set PIA line, so it recognises interrupt */ // if (data) // { -// pia_0_cb1_w(machine, 0,ASSERT_LINE); +// m_pia_0->cb1_w(ASSERT_LINE); // } // else // { -// pia_0_cb1_w(machine, 0,CLEAR_LINE); +// m_pia_0->cb1_w(CLEAR_LINE); // } } #endif @@ -887,16 +886,12 @@ void dgn_beta_state::dgn_beta_line_interrupt (int data) /********************************* Machine/Driver Initialization ****************************************/ void dgn_beta_state::machine_reset() { - pia6821_device *pia_0 = machine().device<pia6821_device>( PIA_0_TAG ); - pia6821_device *pia_1 = machine().device<pia6821_device>( PIA_1_TAG ); - pia6821_device *pia_2 = machine().device<pia6821_device>( PIA_2_TAG ); - logerror("dgn_beta_state::machine_reset()\n"); m_system_rom = memregion(MAINCPU_TAG)->base(); /* Make sure CPU 1 is started out halted ! */ - machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); + m_dmacpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); /* Reset to task 0, and map banks disabled, so standard memory map */ /* with ram at $0000-$BFFF, ROM at $C000-FBFF, IO at $FC00-$FEFF */ @@ -908,9 +903,9 @@ void dgn_beta_state::machine_reset() SetDefaultTask(); /* Set pullups on all PIA port A, to match what hardware does */ - pia_0->set_port_a_z_mask(0xFF); - pia_1->set_port_a_z_mask(0xFF); - pia_2->set_port_a_z_mask(0xFF); + m_pia_0->set_port_a_z_mask(0xFF); + m_pia_1->set_port_a_z_mask(0xFF); + m_pia_2->set_port_a_z_mask(0xFF); m_d_pia1_pa_last = 0x00; m_d_pia1_pb_last = 0x00; |