Previous 199869 Revisions Next

r29617 Sunday 13th April, 2014 at 19:12:45 UTC by Angelo Salese
Documentation notes, nw
[src/mame/drivers]model2.c
[src/mame/includes]model2.h

trunk/src/mame/includes/model2.h
r29616r29617
104104   UINT32 m_videocontrol;
105105   UINT32 m_soundack;
106106   void model2_check_irq_state();
107   void model2_check_irqack_state(UINT32 data);
107108
108109   DECLARE_CUSTOM_INPUT_MEMBER(_1c00000_r);
109110   DECLARE_CUSTOM_INPUT_MEMBER(_1c0001c_r);
trunk/src/mame/drivers/model2.c
r29616r29617
77    Hardware and protection reverse-engineering and general assistance by ElSemi.
88    MAME driver by R. Belmont, Olivier Galibert, and ElSemi.
99
10   TODO (updated as for April 2014):
11   - all Model 2B games: FIFO comms looks way wrong, and 3d is mostly missing/incomplete. Games also stalls at some point;
12   - daytona: runs at half speed in gameplay;
13   - desert: several 3d bugs, presumably down to FIFO;
14   - dynamcop: stalls at stage select screen;
15   - fvipers: enables timers, but then irq register is empty, hence it crashes with an "interrupt halt" at POST (regression);
16   - manxtt: missing 3d;
17   - motoraid: stalls after course select;
18   - pltkidsa: after few secs of gameplay, background 3d disappears and everything reports a collision against the player;
19   - skytargt: MAME hardlocks after disclaimer screen;
20   - srallyc: opponent cars flickers like wild;
21   - vcop: lightgun input is offsetted;
22   - vcop: sound dies at enter initial screen (i.e. after played the game once);
23   - vcop: priority bug at stage select screen;
24   - vcop2: no 3d;
25   - vf2: stalls after disclaimer screen;
26   - zeroguna: stalls after some seconds of gameplay;
27
1028    OK (controls may be wrong/missing/incomplete)
1129    --
1230    daytona/daytonat/daytonam
r29616r29617
337355   int tnum = (int)(FPTR)ptr;
338356   int bit = tnum + 2;
339357
358   if(m_timerrun[tnum] == 0)
359      return;
360
340361   m_timers[tnum]->reset();
341362
342363   m_intreq |= (1<<bit);
364   //printf("%08x %08x (%08x)\n",m_intreq,m_intena,1<<bit);
343365   model2_check_irq_state();
344366
345   m_timervals[tnum] = 0;
367   m_timervals[tnum] = -1;
346368   m_timerrun[tnum] = 0;
347369}
348370
r29616r29617
10051027
10061028void model2_state::model2_check_irq_state()
10071029{
1008   const int irq_type[16]= {I960_IRQ0,I960_IRQ1,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ3,I960_IRQ3};
1030   const int irq_type[12]= {I960_IRQ0,I960_IRQ1,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ3,I960_IRQ3};
10091031
1010   for(int i=0;i<16;i++)
1032   for(int i=0;i<12;i++)
10111033   {
1012      if (m_intena & (1<<i) && m_intreq & 1<<i)
1034      if (m_intena & (1<<i) && m_intreq & (1<<i))
1035      {
10131036         m_maincpu->set_input_line(irq_type[i], ASSERT_LINE);
1037         return;
1038      }
10141039   }
10151040}
10161041
1042void model2_state::model2_check_irqack_state(UINT32 data)
1043{
1044   const int irq_type[12]= {I960_IRQ0,I960_IRQ1,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ3,I960_IRQ3};
1045
1046   for(int i=0;i<12;i++)
1047   {
1048      if(data & 1<<i)
1049         m_maincpu->set_input_line(irq_type[i], CLEAR_LINE);
1050   }
1051}
1052
10171053WRITE32_MEMBER(model2_state::model2_irq_w)
10181054{
10191055   m_maincpu->i960_noburst();
r29616r29617
10261062   }
10271063
10281064   m_intreq &= data;
1029   /* TODO: improve this */
1030   UINT32 irq_ack = data ^ 0xffffffff;
10311065
1032   if(irq_ack & 1<<0)
1033      m_maincpu->set_input_line(I960_IRQ0, CLEAR_LINE);
1034
1035   if(irq_ack & 1<<10)
1036      m_maincpu->set_input_line(I960_IRQ3, CLEAR_LINE);
1037
1066   model2_check_irqack_state(data ^ 0xffffffff);
10381067}
10391068
10401069/* TODO: rewrite this part. */
r29616r29617
19942023{
19952024   int scanline = param;
19962025
1997   if(scanline == 0) // 384
2026   if(scanline == 384)
19982027   {
2028      m_intreq |= (1<<0);
2029      model2_check_irq_state();
2030   }
2031   else if(scanline == 0) // 384
2032   {
19992033      m_intreq |= (1<<10);
20002034      model2_check_irq_state();
20012035   }
2002
2003   if(scanline == 256)
2036   else if(scanline == 256)
20042037   {
2038      /* TODO: irq source? Source allocation in dynamcopc? */
20052039      m_intreq |= (1<<2);
20062040      model2_check_irq_state();
20072041   }
20082042
2009   if(scanline == 128)
2010   {
2011      m_intreq |= (1<<0);
2012      model2_check_irq_state();
2013   }
2043
20142044}
20152045
20162046/* Model 2 sound board emulation */
r29616r29617
21762206   MCFG_MB86233_FIFO_WRITE_CB(WRITE32(model2_state,copro_tgp_fifoout_push))
21772207   MCFG_MB86233_TABLE_REGION("user5")
21782208
2179
21802209   MCFG_MACHINE_START_OVERRIDE(model2_state,model2)
21812210   MCFG_MACHINE_RESET_OVERRIDE(model2_state,model2)
21822211

Previous 199869 Revisions Next


© 1997-2024 The MAME Team