Previous 15994 Revisions Next

r13412 Tuesday 29th November, 2011 at 08:52:50 UTC by Curt Coder
[BBC] Fixed interrupt handling. [Curt Coder]
[src/mess/drivers]bbc.c
[src/mess/includes]bbc.h
[src/mess/machine]bbc.c

src/mess/machine/bbc.c
r13411r13412
2424#include "imagedev/cassette.h"
2525
2626
27void bbc_state::check_interrupts()
28{
29   m_maincpu->set_input_line(M6502_IRQ_LINE, m_via_system_irq | m_via_user_irq | !m_acia_irq | m_ACCCON_IRR);
30}
31
2732/*************************
2833Model A memory handling functions
2934*************************/
r13411r13412
360365
361366   if (tempIRR!=state->m_ACCCON_IRR)
362367   {
363      cputag_set_input_line(space->machine(), "maincpu", M6502_IRQ_LINE, state->m_ACCCON_IRR);
368      state->check_interrupts();
364369   }
365370
366371   if (state->m_ACCCON_Y)
r13411r13412
12051210}
12061211
12071212
1213static WRITE_LINE_DEVICE_HANDLER( bbcb_via_system_irq_w )
1214{
1215   bbc_state *driver_state = device->machine().driver_data<bbc_state>();
1216   driver_state->m_via_system_irq = state;
1217
1218   driver_state->check_interrupts();
1219}
1220
12081221const via6522_interface bbcb_system_via =
12091222{
12101223   DEVCB_HANDLER(bbcb_via_system_read_porta),
r13411r13412
12191232   DEVCB_NULL,
12201233   DEVCB_NULL,
12211234   DEVCB_NULL,
1222   DEVCB_CPU_INPUT_LINE("maincpu", M6502_IRQ_LINE)
1235   DEVCB_LINE(bbcb_via_system_irq_w)
12231236};
12241237
12251238
r13411r13412
12441257   state->m_userport = data;
12451258}
12461259
1260static WRITE_LINE_DEVICE_HANDLER( bbcb_via_user_irq_w )
1261{
1262   bbc_state *driver_state = device->machine().driver_data<bbc_state>();
1263   driver_state->m_via_user_irq = state;
1264
1265   driver_state->check_interrupts();
1266}
1267
12471268const via6522_interface bbcb_user_via =
12481269{
12491270   DEVCB_NULL,   //via_user_read_porta,
r13411r13412
12581279   DEVCB_NULL, //via_user_write_cb1
12591280   DEVCB_DEVICE_LINE("centronics", centronics_strobe_w),
12601281   DEVCB_NULL,   //via_user_write_cb2,
1261   DEVCB_CPU_INPUT_LINE("maincpu", M6502_IRQ_LINE)
1282   DEVCB_LINE(bbcb_via_user_irq_w)
12621283};
12631284
12641285
src/mess/includes/bbc.h
r13411r13412
2222{
2323public:
2424   bbc_state(const machine_config &mconfig, device_type type, const char *tag)
25      : driver_device(mconfig, type, tag) { }
25      : driver_device(mconfig, type, tag),
26        m_maincpu(*this, "maincpu"),
27        m_ACCCON_IRR(CLEAR_LINE),
28        m_via_system_irq(CLEAR_LINE),
29        m_via_user_irq(CLEAR_LINE),
30        m_acia_irq(CLEAR_LINE)
31   { }
32   
33   required_device<cpu_device> m_maincpu;
34
35   void check_interrupts();
36   
2637   int m_RAMSize;         // BBC Memory Size
2738   int m_DFSType;         // this stores the DIP switch setting for the DFS type being used
2839   int m_SWRAMtype;      // this stores the DIP switch setting for the SWRAM type being used
r13411r13412
108119   int m_MC146818_CE;      // 6522 port b bit 6
109120
110121   int m_via_system_porta;
122   int m_via_system_irq;
123   int m_via_user_irq;
124   int m_acia_irq;
111125
112126   int m_column;         // this is a counter in the keyboard circuit
113127
src/mess/drivers/bbc.c
r13411r13412
726726   DEVCB_NULL
727727};
728728
729static WRITE_LINE_DEVICE_HANDLER( bbcb_acia6850_irq_w )
730{
731   bbc_state *driver_state = device->machine().driver_data<bbc_state>();
732   driver_state->m_acia_irq = state;
733
734   driver_state->check_interrupts();
735}
736
729737static ACIA6850_INTERFACE( bbc_acia6850_interface )
730738{
731739   0,
r13411r13412
735743   DEVCB_NULL,
736744   DEVCB_NULL,
737745   DEVCB_NULL,
738   DEVCB_CPU_INPUT_LINE("maincpu", M6502_IRQ_LINE)
746   DEVCB_LINE(bbcb_acia6850_irq_w)
739747};
740748
741749static LEGACY_FLOPPY_OPTIONS_START(bbc)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team