Previous 199869 Revisions Next

r21488 Thursday 28th February, 2013 at 22:03:19 UTC by Angelo Salese
Try to make a sense over the RAM format ...
[src/mame/drivers]gunpey.c

trunk/src/mame/drivers/gunpey.c
r21487r21488
101101   checks if 0x5e62 is 0 (bit 6 of 0x5c80, i/o 0x7f41)
102102   ...
1031030x8474a: call 0xa7f53 sound init
104...
104105
106
107
105108=============================================================================================
106109
107110Gunpey
r21487r21488
190193   gunpey_state(const machine_config &mconfig, device_type type, const char *tag)
191194      : driver_device(mconfig, type, tag),
192195      m_maincpu(*this, "maincpu"),
193      m_oki(*this, "oki")
196      m_oki(*this, "oki"),
197      m_wram(*this, "wram")
194198      { }
195199
196200   required_device<cpu_device> m_maincpu;
197201   required_device<okim6295_device> m_oki;
202   required_shared_ptr<UINT16> m_wram;
198203
199204   UINT16 *m_blit_buffer;
200205   UINT16 m_blit_ram[0x10];
r21487r21488
220225
221226UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
222227{
223   UINT16 *blit_buffer = m_blit_buffer;
228   //UINT16 *blit_buffer = m_blit_buffer;
224229   int x,y;
225230   int count;
226231
227   count = 0;
232   bitmap.fill(machine().pens[0], cliprect); //black pen
228233
234   for(count = 0x1800/2;count<0x1d40/2;count+=0x10/2)
235   {
236      if(m_wram[count+0/2] == 0xc200)
237      {
238         x = (m_wram[count+6/2] >> 8) | ((m_wram[count+8/2] & 0xff) << 8);
239         y = m_wram[count+8/2] >> 8;
240
241         x-=0x1100;
242
243         for(int yi=0;yi<8;yi++)
244         {
245            for(int xi=0;xi<8;xi++)
246            {
247               if(cliprect.contains(x+xi, y+yi))
248                  bitmap.pix32(y+yi, x+xi) = 0xffffff;
249            }
250         }
251      }
252   }
253
254   #if 0
229255   for(y=0;y<512;y++)
230256   {
231257      for(x=0;x<512;x++)
r21487r21488
244270         count++;
245271      }
246272   }
273   #endif
247274
248275   return 0;
249276}
r21487r21488
297324
298325WRITE8_MEMBER(gunpey_state::gunpey_blitter_w)
299326{
300   UINT16 *blit_buffer = m_blit_buffer;
327//   UINT16 *blit_buffer = m_blit_buffer;
301328   UINT16 *blit_ram = m_blit_ram;
302   UINT8 *blit_rom = memregion("blit_data")->base();
303   int x,y;
329//   UINT8 *blit_rom = memregion("blit_data")->base();
330//   int x,y;
304331
305332   //printf("gunpey_blitter_w offset %01x data %02x\n", offset,data);
306333
307334   blit_ram[offset] = data;
308335
336   #if 0
309337   if(offset == 0 && data == 2) // blitter trigger
310338   {
311339      int srcx = blit_ram[0x04]+(blit_ram[0x05]<<8);
r21487r21488
316344      int ysize = blit_ram[0x0e]+1;
317345      int color,color_offs;
318346
347      printf("%d %d %d %d\n",blit_ram[0x08]+(blit_ram[0x09]<<8),blit_ram[0x0a]+(blit_ram[0x0b]<<8),xsize,ysize);
348
319349      if(blit_ram[0x01] == 8) //1bpp?
320350      {
321351         // ...
r21487r21488
348378      ,blit_ram[0xc],blit_ram[0xd],blit_ram[0xe],blit_ram[0xf]);
349379*/
350380   }
351
381   #endif
352382}
353383
354384WRITE8_MEMBER(gunpey_state::gunpey_output_w)
r21487r21488
362392/***************************************************************************************/
363393
364394static ADDRESS_MAP_START( mem_map, AS_PROGRAM, 16, gunpey_state )
365   AM_RANGE(0x00000, 0x0ffff) AM_RAM
395   AM_RANGE(0x00000, 0x0ffff) AM_RAM AM_SHARE("wram")
366396//  AM_RANGE(0x50000, 0x500ff) AM_RAM
367397//  AM_RANGE(0x50100, 0x502ff) AM_NOP
368398   AM_RANGE(0x80000, 0xfffff) AM_ROM

Previous 199869 Revisions Next


© 1997-2024 The MAME Team