Previous 199869 Revisions Next

r19545 Friday 14th December, 2012 at 10:25:31 UTC by Miodrag Milanović
b2m : simplified floppy control (no whatsnew)
[src/mess/includes]b2m.h
[src/mess/machine]b2m.c

trunk/src/mess/machine/b2m.c
r19544r19545
203203void b2m_state::b2m_fdc_drq(bool state)
204204{
205205   /* Clears HALT state of CPU when data is ready to read */
206   if(state==1) {
206   if (state)
207207      m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
208   }
209208}
210209
211210
r19544r19545
222221
223222   floppy->mon_w(0);
224223   m_fdc->set_floppy(floppy);
225   m_fdc->setup_drq_cb(fd1793_t::line_cb(FUNC(b2m_state::b2m_fdc_drq), this));
226224   if (m_b2m_drive!=drive) {
227225      m_b2m_drive = drive;
228226   }
r19544r19545
235233      When bit 5 is set CPU is in HALT state and stay there until
236234      DRQ is triggered from floppy side
237235   */
238   if (BIT(data,5) && m_first_start==0 && m_cnt <=0) {
236   
237   if ((data & 0xf0)==0x20) {
239238      m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
240239   }
241   m_first_start = 0;
242   if (BIT(data,5)) m_cnt--;
243
244240}
245241
246242I8255A_INTERFACE( b2m_ppi8255_interface_2 )
r19544r19545
334330   m_fdc = machine().device<fd1793_t>("fd1793");
335331   m_speaker = machine().device(SPEAKER_TAG);
336332
333   m_fdc->setup_drq_cb(fd1793_t::line_cb(FUNC(b2m_state::b2m_fdc_drq), this));
334
337335   /* register for state saving */
338336   save_item(NAME(m_b2m_8255_porta));
339337   save_item(NAME(m_b2m_video_scroll));
r19544r19545
377375
378376   machine().device("maincpu")->execute().set_irq_acknowledge_callback(b2m_irq_callback);
379377   b2m_set_bank(machine(), 7);
380   m_first_start = 1;
381   m_cnt = 2;
382378}
trunk/src/mess/includes/b2m.h
r19544r19545
1919public:
2020   b2m_state(const machine_config &mconfig, device_type type, const char *tag)
2121      : driver_device(mconfig, type, tag),
22        m_first_start(1),
23        m_cnt(3),
2422        m_maincpu(*this, "maincpu") { }
2523
2624   UINT8 m_b2m_8255_porta;
r19544r19545
3735   UINT8 m_b2m_color[4];
3836   UINT8 m_b2m_localmachine;
3937   UINT8 m_vblank_state;
40   int  m_first_start;
41   int m_cnt;
4238   required_device<cpu_device> m_maincpu;
4339
4440   /* devices */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team