Previous 199869 Revisions Next

r20863 Saturday 9th February, 2013 at 12:50:29 UTC by Wilbert Pol
(MESS) apollo.c: Some tagmap lookup reduction (nw)
[src/mess/drivers]apollo.c
[src/mess/includes]apollo.h

trunk/src/mess/includes/apollo.h
r20862r20863
112112public:
113113   apollo_state(const machine_config &mconfig, device_type type, const char *tag)
114114         : driver_device(mconfig, type, tag),
115         m_maincpu(*this, MAINCPU),
115116         m_ctape(*this, APOLLO_CTAPE_TAG),
116117         m_messram_ptr(*this, "messram")
117118         { }
118119
120   required_device<cpu_device> m_maincpu;
119121   required_device<sc499_device> m_ctape;
120122
121123   device_t *dma8237_1;
r20862r20863
189191   DECLARE_FLOPPY_FORMATS( floppy_formats );
190192   IRQ_CALLBACK_MEMBER(apollo_irq_acknowledge);
191193   IRQ_CALLBACK_MEMBER(apollo_pic_acknowledge);
194   void apollo_bus_error();
192195};
193196
194197MACHINE_CONFIG_EXTERN( apollo );
trunk/src/mess/drivers/apollo.c
r20862r20863
270270 apollo bus error
271271 ***************************************************************************/
272272
273static void apollo_bus_error(running_machine &machine)
273void apollo_state::apollo_bus_error()
274274{
275   machine.device(MAINCPU)->execute().set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE);
276   machine.device(MAINCPU)->execute().set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE);
275   m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE);
276   m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE);
277277
278278   apollo_csr_set_status_register(APOLLO_CSR_SR_CPU_TIMEOUT, APOLLO_CSR_SR_CPU_TIMEOUT);
279279}
r20862r20863
282282{
283283   int result = M68K_INT_ACK_AUTOVECTOR;
284284
285   machine().device(MAINCPU)->execute().set_input_line(irqline, CLEAR_LINE);
285   m_maincpu->set_input_line(irqline, CLEAR_LINE);
286286
287287   MLOG2(("apollo_irq_acknowledge: interrupt level=%d", irqline));
288288
r20862r20863
457457      if (apollo_csr_get_control_register() & APOLLO_CSR_CR_INTERRUPT_ENABLE) {
458458         // force parity error (if NMI is enabled)
459459//          cpu_set_input_line_and_vector(&space.device(), 7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
460         machine().device(MAINCPU)->execute().set_input_line_and_vector(7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
460         m_maincpu->set_input_line_and_vector(7, ASSERT_LINE, M68K_INT_ACK_AUTOVECTOR);
461461
462462      }
463463   }
r20862r20863
533533   }
534534
535535   /* unmapped; access causes a bus error */
536   apollo_bus_error(machine());
536   apollo_bus_error();
537537   return 0xffffffff;
538538}
539539
r20862r20863
542542   SLOG(("unmapped memory dword write to %08x = %08x & %08x", offset * 4, data, mem_mask));
543543
544544   /* unmapped; access causes a bus error */
545   apollo_bus_error(machine());
545   apollo_bus_error();
546546}
547547
548548/***************************************************************************
r20862r20863
10001000
10011001void apollo_state::machine_reset()
10021002{
1003   device_t *cpu = machine().device(MAINCPU);
1004
10051003   //MLOG1(("machine_reset_dn3500"));
10061004
10071005   MACHINE_RESET_CALL_MEMBER(apollo);
r20862r20863
10301028      }
10311029   }
10321030
1033   m68k_set_instruction_hook(cpu, apollo_instruction_hook);
1031   m68k_set_instruction_hook(m_maincpu, apollo_instruction_hook);
10341032}
10351033
10361034static void apollo_reset_instr_callback(device_t *device)
r20862r20863
10811079{
10821080//  MLOG1(("driver_init_dn3500"));
10831081
1084   machine().device(MAINCPU)->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(apollo_state::apollo_irq_acknowledge),this));
1082   m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(apollo_state::apollo_irq_acknowledge),this));
10851083
10861084   /* hook the RESET line, which resets a slew of other components */
1087   m68k_set_reset_callback(machine().device(MAINCPU), apollo_reset_instr_callback);
1085   m68k_set_reset_callback(m_maincpu, apollo_reset_instr_callback);
10881086
10891087   ram_base_address = DN3500_RAM_BASE;
10901088   ram_end_address = DN3500_RAM_END;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team