Previous 199869 Revisions Next

r33970 Friday 19th December, 2014 at 23:12:56 UTC by Angelo Salese
Using IRQ_CALLBACK_MEMBER for irqs in MZ-2500, nw.
[src/mess/drivers]mz2500.c

trunk/src/mess/drivers/mz2500.c
r242481r242482
1818    - Dust Box vol. 1-3: they die with text garbage, might be bad dumps;
1919    - Dust Box vol. 4: window effect transition is bugged;
2020    - Dust Box vol. n: three items returns "purple" text, presumably HW failures (DFJustin: joystick "digital", mouse "not installed", HDD "not installed");
21    - LayDock: hangs by reading the FDC status and expecting it to become 0x81;
21    - LayDock: hangs at title screen due of a PIT bug (timer irq dies for whatever reason);
2222    - Moon Child: needs mixed 3+3bpp tvram supported, kludged for now (not a real test case);
2323    - Moon Child: window masking doesn't mask bottom part of the screen?
2424    - Moon Child: appears to be a network / system link game, obviously doesn't work with current MAME / MESS framework;
r242481r242482
9595   UINT8 m_irq_sel;
9696   UINT8 m_irq_vector[4];
9797   UINT8 m_irq_mask[4];
98   UINT8 m_irq_pending[4];
9899   UINT8 m_kanji_bank;
99100   UINT8 m_dic_bank;
100101   UINT8 m_fdc_reverse;
r242481r242482
204205   DECLARE_WRITE8_MEMBER(opn_porta_w);
205206   DECLARE_WRITE_LINE_MEMBER(pit8253_clk0_irq);
206207   DECLARE_WRITE_LINE_MEMBER(mz2500_rtc_alarm_irq);
208   IRQ_CALLBACK_MEMBER( mz2500_irq_ack );
207209
208210   void draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,UINT16 map_addr);
209211   void draw_40x25(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,UINT16 map_addr);
r242481r242482
17951797
17961798   /* disable IRQ */
17971799   for(i=0;i<4;i++)
1800   {
17981801      m_irq_mask[i] = 0;
1799
1802      m_irq_pending[i] = 0;
1803   }
18001804   m_kanji_bank = 0;
18011805
18021806   m_cg_clear_flag = 0;
r242481r242482
18531857INTERRUPT_GEN_MEMBER(mz2500_state::mz2500_vbl)
18541858{
18551859   if(m_irq_mask[0])
1856      device.execute().set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[0]);
1857
1860   {
1861      m_irq_pending[0] = 1;
1862      m_maincpu->set_input_line(0, ASSERT_LINE);
1863   }
18581864   m_cg_clear_flag = 0;
18591865}
18601866
1867IRQ_CALLBACK_MEMBER(mz2500_state::mz2500_irq_ack)
1868{
1869   int i;
1870   for(i=0;i<4;i++)
1871   {
1872      if(m_irq_mask[i] && m_irq_pending[i])
1873      {
1874         m_irq_pending[i] = 0;
1875         m_maincpu->set_input_line(0, CLEAR_LINE);
1876         return m_irq_vector[i];
1877      }
1878   }
1879   return 0;
1880}
1881
18611882READ8_MEMBER(mz2500_state::mz2500_porta_r)
18621883{
18631884   logerror("PPI PORTA R\n");
r242481r242482
20322053
20332054WRITE_LINE_MEMBER(mz2500_state::pit8253_clk0_irq)
20342055{
2035   if(m_irq_mask[1]/* && state & 1*/)
2036      m_maincpu->set_input_line_and_vector(0, HOLD_LINE,m_irq_vector[1]);
2056   if(m_irq_mask[1] && state & 1)
2057   {
2058      m_irq_pending[1] = 1;
2059      m_maincpu->set_input_line(0, ASSERT_LINE);
2060   }
20372061}
20382062
20392063WRITE_LINE_MEMBER(mz2500_state::mz2500_rtc_alarm_irq)
r242481r242482
20492073   MCFG_CPU_PROGRAM_MAP(mz2500_map)
20502074   MCFG_CPU_IO_MAP(mz2500_io)
20512075   MCFG_CPU_VBLANK_INT_DRIVER("screen", mz2500_state,  mz2500_vbl)
2076   MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(mz2500_state,mz2500_irq_ack)
20522077
20532078   MCFG_DEVICE_ADD("i8255_0", I8255, 0)
20542079   MCFG_I8255_IN_PORTA_CB(READ8(mz2500_state, mz2500_porta_r))
r242481r242482
20712096   MCFG_DEVICE_ADD("pit", PIT8253, 0)
20722097   MCFG_PIT8253_CLK0(31250)
20732098   MCFG_PIT8253_OUT0_HANDLER(WRITELINE(mz2500_state, pit8253_clk0_irq))
2099   // TODO: is this really right?
20742100   MCFG_PIT8253_CLK1(0)
2075   MCFG_PIT8253_CLK2(16) //CH2, trusted, used by Super MZ demo / The Black Onyx and a bunch of others (TODO: timing of this)
2101   MCFG_PIT8253_CLK2(16) //CH2, used by Super MZ demo / The Black Onyx and a few others (TODO: timing of this)
20762102   MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("pit", pit8253_device, write_clk1))
20772103
20782104   MCFG_DEVICE_ADD("mb8877a", MB8877, 0)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team