Previous 199869 Revisions Next

r20168 Wednesday 9th January, 2013 at 22:39:02 UTC by Angelo Salese
ABC of 3do irq routines
[src/mame/drivers]3do.c
[src/mame/includes]3do.h
[src/mame/machine]3do.c

trunk/src/mame/drivers/3do.c
r20167r20168
131131
132132void _3do_state::machine_reset()
133133{
134
135   m_maincpu = downcast<legacy_cpu_device*>( machine().device<cpu_device>("maincpu") );
136
137134   membank("bank2")->set_base(memregion("user1")->base());
138135
139136   /* configure overlay */
trunk/src/mame/machine/3do.c
r20167r20168
5555
5656#include "emu.h"
5757#include "includes/3do.h"
58#include "cpu/arm7/arm7core.h"
5859
60#define   VERBOSE         1
61#define LOG(x) do { if (VERBOSE) printf x; } while (0)
5962
63/*
640x80000000 Second Priority (?)
650x40000000 SW irq
660x20000000 DMA<->EXP
670x1fff0000 DMA RAM->DSPP *
680x0000f000 DMA DSPP->RAM *
690x00000800 DSPP
700x00000400 Timer  1
710x00000200 Timer  3
720x00000100 Timer  5
730x00000080 Timer  7
740x00000040 Timer  9
750x00000020 Timer 11
760x00000010 Timer 13
770x00000008 Timer 15
780x00000004 Expansion Bus
790x00000002 Vertical 1
800x00000001 Vertical 0
81*/
82void _3do_state::m_3do_request_fiq0(UINT32 irq_req)
83{
84   m_clio.irq0 |= irq_req;
6085
86   if(m_clio.irq0 & m_clio.irq0_enable)
87      m_maincpu->set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE);
6188
89   if((m_clio.irq0 & m_clio.irq0_enable) == 0)
90      m_maincpu->set_input_line(ARM7_FIRQ_LINE, CLEAR_LINE);
91}
6292
93/*
940x00000400 DSPPOVER (Red rev. only)
950x00000200 DSPPUNDER (Red rev. only)
960x00000100 BadBits
970x00000080 DMA<-External
980x00000040 DMA->External
990x00000020 DMA<-Uncle
1000x00000010 DMA->Uncle
1010x00000008 DMA RAM->DSPP N
1020x00000004 SlowBus
1030x00000002 Disk Inserted
1040x00000001 DMA Player bus
105*/
106void _3do_state::m_3do_request_fiq1(UINT32 irq_req)
107{
108   m_clio.irq1 |= irq_req;
63109
110   if(m_clio.irq1 & m_clio.irq1_enable)
111      m_maincpu->set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE);
112
113   if((m_clio.irq1 & m_clio.irq1_enable) == 0)
114      m_maincpu->set_input_line(ARM7_FIRQ_LINE, CLEAR_LINE);
115}
116
117
64118READ32_MEMBER(_3do_state::_3do_nvarea_r){
65119   logerror( "%08X: NVRAM read offset = %08X\n", machine().device("maincpu")->safe_pc(), offset );
66120   return 0;
r20167r20168
585639   case 0x0048/4:
586640   case 0x004c/4:
587641      return m_clio.irq0_enable;
642   case 0x0060/4:
643   case 0x0064/4:
644      return m_clio.irq1;
645   case 0x0068/4:
646   case 0x006c/4:
647      return m_clio.irq1_enable;
588648   case 0x0080/4:
589649      return m_clio.hdelay;
590650   case 0x0084/4:
r20167r20168
744804      m_clio.seed = data;
745805      break;
746806   case 0x0040/4:
807      LOG(("%08x PEND0\n",data));
747808      m_clio.irq0 |= data;
809      m_3do_request_fiq0(0);
748810      break;
749811   case 0x0044/4:
812      LOG(("%08x PEND0 CLEAR\n",data));
750813      m_clio.irq0 &= ~data;
814      m_3do_request_fiq0(0);
751815      break;
752816   case 0x0048/4:
817      LOG(("%08x MASK0\n",data));
753818      m_clio.irq0_enable |= data;
819      m_3do_request_fiq0(0);
754820      break;
755821   case 0x004c/4:
822      LOG(("%08x MASK0 CLEAR\n",data));
756823      m_clio.irq0_enable &= ~data;
824      m_3do_request_fiq0(0);
757825      break;
758826   case 0x0050/4:
759827      m_clio.mode |= data;
r20167r20168
768836      m_clio.spare = data;
769837      break;
770838   case 0x0060/4:
839      LOG(("%08x PEND1\n",data));
771840      m_clio.irq1 |= data;
841      m_3do_request_fiq1(0);
772842      break;
773843   case 0x0064/4:
844      LOG(("%08x PEND1 CLEAR\n",data));
774845      m_clio.irq1 &= ~data;
846      m_3do_request_fiq1(0);
775847      break;
776848   case 0x0068/4:
849      LOG(("%08x MASK1\n",data));
777850      m_clio.irq1_enable |= data;
851      m_3do_request_fiq1(0);
778852      break;
779853   case 0x006c/4:
854      LOG(("%08x MASK1 CLEAR\n",data));
780855      m_clio.irq1_enable &= ~data;
856      m_3do_request_fiq1(0);
781857      break;
782858   case 0x0080/4:
783859      m_clio.hdelay = data;
r20167r20168
9811057}
9821058
9831059
984/* This is incorrect! Just testing stuff */
9851060UINT32 _3do_state::screen_update__3do(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
9861061{
9871062   UINT32 *source_p = m_vram + 0x1c0000 / 4;
r20167r20168
9931068
9941069      for ( int x = 0; x < 320; x++ )
9951070      {
996         /* Odd numbered bits go to lower half, even numbered bits to upper half */
1071         /* Every dword contains two pixels, upper word is top pixel, lower is bottom. */
9971072         UINT32 lower = *source_p & 0xffff;
9981073         UINT32 upper = ( *source_p >> 16 ) & 0xffff;
9991074         int r, g, b;
10001075
1076         /* Format is RGB555 */
10011077         r = (upper & 0x7c00) >> 10;
10021078         g = (upper & 0x03e0) >> 5;
10031079         b = (upper & 0x001f) >> 0;
trunk/src/mame/includes/3do.h
r20167r20168
164164public:
165165   _3do_state(const machine_config &mconfig, device_type type, const char *tag)
166166      : driver_device(mconfig, type, tag) ,
167      m_maincpu(*this, "maincpu"),
167168      m_dram(*this, "dram"),
168169      m_vram(*this, "vram"){ }
169170
170   legacy_cpu_device* m_maincpu;
171   required_device<cpu_device> m_maincpu;
171172   required_shared_ptr<UINT32> m_dram;
172173   required_shared_ptr<UINT32> m_vram;
173174   SLOW2 m_slow2;
r20167r20168
188189   virtual void machine_reset();
189190   DECLARE_VIDEO_START(_3do);
190191   UINT32 screen_update__3do(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
192
193private:
194   void m_3do_request_fiq0(UINT32 irq_req);
195   void m_3do_request_fiq1(UINT32 irq_req);
191196};
192197
193198/*----------- defined in machine/3do.c -----------*/

Previous 199869 Revisions Next


© 1997-2024 The MAME Team