Previous 199869 Revisions Next

r21503 Friday 1st March, 2013 at 02:28:19 UTC by David Haywood
a mystery starts to unravel...
[src/mame/drivers]gunpey.c

trunk/src/mame/drivers/gunpey.c
r21502r21503
216216   DECLARE_DRIVER_INIT(gunpey);
217217   virtual void video_start();
218218   virtual void palette_init();
219   UINT32 screen_update_gunpey(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
219   UINT32 screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
220220   TIMER_DEVICE_CALLBACK_MEMBER(gunpey_scanline);
221221   void gunpey_irq_check(UINT8 irq_type);
222222   UINT16 m_vram_bank;
223223
224   UINT16 main_vram[0x800][0x800];
224   //UINT16 main_vram[0x800][0x800];
225225};
226226
227227
r21502r21503
230230   m_blit_buffer = auto_alloc_array(machine(), UINT16, 512*512);
231231}
232232
233UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
233UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
234234{
235235   //UINT16 *blit_buffer = m_blit_buffer;
236236   int x,y;
237237   int count;
238238   UINT16 vram_bank = m_vram_bank & 0x7fff;
239   UINT8 *vram = memregion("vram")->base();
239240
240241   bitmap.fill(machine().pens[0], cliprect); //black pen
241242
r21502r21503
251252         x-=0x100;
252253         y-=0x100;
253254
254         UINT32 col = 0xffffff;
255         //UINT32 col = 0xffffff;
255256
256257         UINT32 val = (m_wram[count+1] << 16) | ((m_wram[count+2]));
258
259#ifdef USE_FAKE_ROM
257260         int letter = -1;
261
258262/*
259263-- TEST MODE --
260264I/O TEST
r21502r21503
305309         if (val == 0x8080e03a) { letter = 'Y'; }
306310         if (val == 0xa080e03a) { letter = 'Z'; }
307311
308#ifndef USE_FAKE_ROM
309         letter = -1;
310312#endif
313         int xsource = ((val & 0x000000ff) << 4) | ((val & 0xf0000000) >> 28);
314         int ysource = ((val & 0x0000f000) >> 10);
311315
316
317
318#ifdef USE_FAKE_ROM
312319         if (letter != -1)
313320            drawgfx_opaque(bitmap,cliprect,machine().gfx[1],letter,1,0,0,x,y);
314321         else
322#endif
315323         {
316324            for(int yi=0;yi<8;yi++)
317325            {
318               for(int xi=0;xi<8;xi++)
326               for(int xi=0;xi<4;xi++)
319327               {
320                  if(cliprect.contains(x+xi, y+yi))
321                     bitmap.pix32(y+yi, x+xi) = col;
328                  UINT8 data = vram[((((ysource+yi)&0x7ff)*0x400) + ((xsource+xi)&0x3ff))];
329
330                  UINT8 pix;
331                 
332                  pix = (data & 0x0f);
333
334                  if(cliprect.contains(x+(xi*2), y+yi))
335                     bitmap.pix16(y+yi, x+(xi*2)) = pix;
336           
337                  pix = (data & 0xf0)>>4;
338
339                  if(cliprect.contains(x+1+(xi*2), y+yi))
340                     bitmap.pix16(y+yi, x+1+(xi*2)) = pix;
341
342
322343               }
323344            }
324345         }
r21502r21503
443464      {
444465         for (int x=0;x<xsize;x++)
445466         {
446            vram[(((dsty+y)&0x7ff)*0x800)+((dstx+x)&0x7ff)] = blit_rom[(((srcy+y)&0x7ff)*0x800)+((srcx+x)&0x7ff)];
467            vram[(((dsty+y)&0x7ff)*0x400)+((dstx+x)&0x3ff)] = blit_rom[(((srcy+y)&0x7ff)*0x800)+((srcx+x)&0x7ff)];
447468         }
448469      }
449470
r21502r21503
654675// this isn't a real decode as such, but the graphic data is all stored in pages 2048 bytes wide at varying BPP levelsl, some (BG data) compressed with what is likely a lossy scheme
655676// palette data is in here too, the blocks at the bottom right of all this?
656677static GFXLAYOUT_RAW( gunpey, 2048, 1, 2048*8, 2048*8 )
678static GFXLAYOUT_RAW( gunpey1024, 1024, 1, 1024*8, 1024*8 )
679
657680static GFXDECODE_START( gunpey )
658681   GFXDECODE_ENTRY( "blit_data", 0, gunpey,     0x0000, 0x1 )
659682   GFXDECODE_ENTRY( "fakerom", 0x18000, fake_layout,   0x0, 2  )
660   GFXDECODE_ENTRY( "vram", 0, gunpey,     0x0000, 0x1 )
683   GFXDECODE_ENTRY( "vram", 0, gunpey1024,     0x0000, 0x1 )
661684
662685GFXDECODE_END
663686
r21502r21503
706729
707730   ROM_REGION( 0x400000, "blit_data", 0 )
708731   ROM_LOAD( "gp_rom3.025",  0x00000, 0x400000,  CRC(f2d1f9f0) SHA1(0d20301fd33892074508b9d127456eae80cc3a1c) )
709   ROM_REGION( 0x400000, "vram", ROMREGION_ERASEFF )
732   ROM_REGION( 0x200000, "vram", ROMREGION_ERASEFF )
710733
711734   ROM_REGION( 0x400000, "ymz", 0 )
712735   ROM_LOAD( "gp_rom4.525",  0x000000, 0x400000, CRC(78dd1521) SHA1(91d2046c60e3db348f29f776def02e3ef889f2c1) ) // 11xxxxxxxxxxxxxxxxxxxx = 0xFF

Previous 199869 Revisions Next


© 1997-2024 The MAME Team