Previous 199869 Revisions Next

r17436 Friday 24th August, 2012 at 01:15:13 UTC by Angelo Salese
Commented out code for hooking up the fb
[src/mess/drivers]vboy.c

trunk/src/mess/drivers/vboy.c
r17435r17436
8181public:
8282   vboy_state(const machine_config &mconfig, device_type type, const char *tag)
8383      : driver_device(mconfig, type, tag),
84        m_maincpu(*this, "maincpu"),
85        m_l_frame_0(*this,"l_frame_0"),
86        m_l_frame_1(*this,"l_frame_1"),
87        m_r_frame_0(*this,"r_frame_0"),
88        m_r_frame_1(*this,"r_frame_1") { }
84        m_maincpu(*this, "maincpu")
85        { }
8986
9087   required_device<cpu_device> m_maincpu;
9188
r17435r17436
103100   DECLARE_READ16_MEMBER(vboy_font3_r);
104101   DECLARE_WRITE16_MEMBER(vboy_bgmap_w);
105102   DECLARE_READ16_MEMBER(vboy_bgmap_r);
103   DECLARE_READ8_MEMBER(vboy_lfb0_r);
104   DECLARE_READ8_MEMBER(vboy_lfb1_r);
105   DECLARE_READ8_MEMBER(vboy_rfb0_r);
106   DECLARE_READ8_MEMBER(vboy_rfb1_r);
107   DECLARE_WRITE8_MEMBER(vboy_lfb0_w);
108   DECLARE_WRITE8_MEMBER(vboy_lfb1_w);
109   DECLARE_WRITE8_MEMBER(vboy_rfb0_w);
110   DECLARE_WRITE8_MEMBER(vboy_rfb1_w);
106111   UINT16 *m_font;
107112   UINT16 *m_bgmap;
108   required_shared_ptr<UINT32> m_l_frame_0;
109   required_shared_ptr<UINT32> m_l_frame_1;
110   required_shared_ptr<UINT32> m_r_frame_0;
111   required_shared_ptr<UINT32> m_r_frame_1;
113   UINT8 *m_l_frame_0;
114   UINT8 *m_l_frame_1;
115   UINT8 *m_r_frame_0;
116   UINT8 *m_r_frame_1;
112117   UINT16 *m_world;
113118   UINT16 *m_columntab1;
114119   UINT16 *m_columntab2;
r17435r17436
123128   UINT8 m_drawfb;
124129   UINT8 m_row_num;
125130   attotime m_input_latch_time;
126
127131   void m_timer_tick(UINT8 setting);
128132   void m_scanline_tick(int scanline, UINT8 screen_type);
129133   void m_set_irq(UINT16 irq_vector);
r17435r17436
152156   state->m_bg_map = auto_alloc_array_clear(machine, int, 0x1000*0x1000);
153157   state->m_ovr_map = auto_alloc_array_clear(machine, int, 8*8);
154158
159   // Allocate memory for framebuffers
160   state->m_l_frame_0 = auto_alloc_array_clear(machine, UINT8, 0x6000);
161   state->m_l_frame_1 = auto_alloc_array_clear(machine, UINT8, 0x6000);
162   state->m_r_frame_0 = auto_alloc_array_clear(machine, UINT8, 0x6000);
163   state->m_r_frame_1 = auto_alloc_array_clear(machine, UINT8, 0x6000);
164
155165   state->m_font  = auto_alloc_array_clear(machine, UINT16, 2048 * 8);
156166   state->m_bgmap = auto_alloc_array(machine, UINT16, 0x20000 >> 1);
157167   state->m_objects = state->m_bgmap + (0x1e000 >> 1);
r17435r17436
484494   for(int i=31; i>=0; i--)
485495      if (state->display_world(i, bitmap, false, cur_spt)) break;
486496
497   if(0)
498   {
499      int x,y;
500
501      for(y=0;y<224;y++)
502      {
503         for(x=0;x<384;x++)
504         {
505            UINT8 pen;
506            UINT8 pix;
507            int yi;
508
509            pen = state->m_l_frame_1[(x*0x40)+(y >> 2)];
510            yi = ((y & 0x3)*2);
511            pix = (pen >> yi) & 3;
512
513            bitmap.pix16(y, x) = screen.machine().pens[pix & 3];
514         }
515      }
516   }
517
487518   return 0;
488519}
489520
r17435r17436
798829               logerror("Error writing INTPND\n");
799830               break;
800831      case 0x02:   //INTENB
801               if(data & 0x2000)
802                  printf("SBHIT active\n");
803832               m_vip_regs.INTENB = data;
804833               m_set_irq(0);
805834               //printf("%04x ENB\n",data);
r17435r17436
10021031   return m_bgmap[offset];
10031032}
10041033
1034READ8_MEMBER( vboy_state::vboy_lfb0_r ) { return m_l_frame_0[offset]; }
1035READ8_MEMBER( vboy_state::vboy_lfb1_r ) { return m_l_frame_1[offset]; }
1036READ8_MEMBER( vboy_state::vboy_rfb0_r ) { return m_r_frame_0[offset]; }
1037READ8_MEMBER( vboy_state::vboy_rfb1_r ) { return m_r_frame_1[offset]; }
1038WRITE8_MEMBER( vboy_state::vboy_lfb0_w ) { m_l_frame_0[offset] = data; }
1039WRITE8_MEMBER( vboy_state::vboy_lfb1_w ) { m_l_frame_1[offset] = data; }
1040WRITE8_MEMBER( vboy_state::vboy_rfb0_w ) { m_r_frame_0[offset] = data; }
1041WRITE8_MEMBER( vboy_state::vboy_rfb1_w ) { m_r_frame_1[offset] = data; }
1042
1043
10051044static ADDRESS_MAP_START( vboy_mem, AS_PROGRAM, 32, vboy_state )
10061045   ADDRESS_MAP_GLOBAL_MASK(0x07ffffff)
1007   AM_RANGE( 0x00000000, 0x00005fff ) AM_RAM AM_SHARE("l_frame_0") // L frame buffer 0
1046   AM_RANGE( 0x00000000, 0x00005fff ) AM_READWRITE8(vboy_lfb0_r,vboy_lfb0_w,0xffffffff) // L frame buffer 0
10081047   AM_RANGE( 0x00006000, 0x00007fff ) AM_READWRITE16(vboy_font0_r, vboy_font0_w, 0xffffffff) // Font 0-511
1009   AM_RANGE( 0x00008000, 0x0000dfff ) AM_RAM AM_SHARE("l_frame_1") // L frame buffer 1
1048   AM_RANGE( 0x00008000, 0x0000dfff ) AM_READWRITE8(vboy_lfb1_r,vboy_lfb1_w,0xffffffff) // L frame buffer 1
10101049   AM_RANGE( 0x0000e000, 0x0000ffff ) AM_READWRITE16(vboy_font1_r, vboy_font1_w, 0xffffffff) // Font 512-1023
1011   AM_RANGE( 0x00010000, 0x00015fff ) AM_RAM AM_SHARE("r_frame_0") // R frame buffer 0
1050   AM_RANGE( 0x00010000, 0x00015fff ) AM_READWRITE8(vboy_rfb0_r,vboy_rfb0_w,0xffffffff) // R frame buffer 0
10121051   AM_RANGE( 0x00016000, 0x00017fff ) AM_READWRITE16(vboy_font2_r, vboy_font2_w, 0xffffffff) // Font 1024-1535
1013   AM_RANGE( 0x00018000, 0x0001dfff ) AM_RAM AM_SHARE("r_frame_1") // R frame buffer 1
1052   AM_RANGE( 0x00018000, 0x0001dfff ) AM_READWRITE8(vboy_rfb1_r,vboy_rfb1_w,0xffffffff) // R frame buffer 1
10141053   AM_RANGE( 0x0001e000, 0x0001ffff ) AM_READWRITE16(vboy_font3_r, vboy_font3_w, 0xffffffff) // Font 1536-2047
10151054
10161055   AM_RANGE( 0x00020000, 0x0003ffff ) AM_READWRITE16(vboy_bgmap_r,vboy_bgmap_w, 0xffffffff) // VIPC memory
r17435r17436
12011240      m_set_irq(0x0004); // RFBEND
12021241   }
12031242
1204   if(scanline == 248)
1243   if(m_row_num == ((m_vip_regs.XPCTRL & 0x1f00) >> 8))
12051244   {
1206      //m_set_irq(0x2000); // SBHIT
1245      m_set_irq(0x2000); // SBHIT
12071246   }
12081247
12091248}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team