Previous 15994 Revisions Next

r6871 Saturday 2nd January, 2010 at 15:45:08 UTC by Angelo Salese
Made some improvements with the aid of Dox
[src/mess/drivers]supracan.c

src/mess/drivers/supracan.c
r6870r6871
7575
7676   count = 0;
7777
78   for (y=0;y<32;y++)
78   for (y=0;y<64;y++)
7979   {
80      for (x=0;x<32;x += 4)
80      for (x=0;x<32;x += 8)
8181      {
82         *BITMAP_ADDR16(bitmap, y, 128+x+0) = (supracan_rram[count] >> 12) & 0x000f;
83         *BITMAP_ADDR16(bitmap, y, 128+x+1) = (supracan_rram[count] >>  8) & 0x000f;
84         *BITMAP_ADDR16(bitmap, y, 128+x+2) = (supracan_rram[count] >>  4) & 0x000f;
85         *BITMAP_ADDR16(bitmap, y, 128+x+3) = (supracan_rram[count] >>  0) & 0x000f;
82         static UINT16 dot_data;
83
84         /* FIXME: likely to be clutted */
85         dot_data = supracan_rram[count] ^ 0xffff;
86
87         *BITMAP_ADDR16(bitmap, y, 128+x+0) = ((dot_data >> 14) & 0x0003) + 0x20;
88         *BITMAP_ADDR16(bitmap, y, 128+x+1) = ((dot_data >> 12) & 0x0003) + 0x20;
89         *BITMAP_ADDR16(bitmap, y, 128+x+2) = ((dot_data >> 10) & 0x0003) + 0x20;
90         *BITMAP_ADDR16(bitmap, y, 128+x+3) = ((dot_data >>  8) & 0x0003) + 0x20;
91         *BITMAP_ADDR16(bitmap, y, 128+x+4) = ((dot_data >>  6) & 0x0003) + 0x20;
92         *BITMAP_ADDR16(bitmap, y, 128+x+5) = ((dot_data >>  4) & 0x0003) + 0x20;
93         *BITMAP_ADDR16(bitmap, y, 128+x+6) = ((dot_data >>  2) & 0x0003) + 0x20;
94         *BITMAP_ADDR16(bitmap, y, 128+x+7) = ((dot_data >>  0) & 0x0003) + 0x20;
8695         count++;
8796      }
8897   }
r6870r6871
139148         acan_dma_regs.count = data;
140149         break;
141150      case 0x0a/2: // Control
151         //if(acan_dma_regs.dest != 0xf00200)
152         //   printf("%08x %08x %02x %04x\n",acan_dma_regs.source,acan_dma_regs.dest,acan_dma_regs.count + 1,data);
142153         if(data & 0x8800)
143154         {
144155            verboselog(space->machine, 0, "supracan_dma_w: Kicking off a DMA from %08x to %08x, %d bytes\n", acan_dma_regs.source, acan_dma_regs.dest, acan_dma_regs.count + 1);
145            //if(acan_dma_regs.dest != 0xf00200)
146            //   printf("%08x %08x %02x %04x\n",acan_dma_regs.source,acan_dma_regs.dest,acan_dma_regs.count + 1,data);
147156            for(i = 0; i <= acan_dma_regs.count; i++)
148157            {
149158               if(data & 0x1000)
r6870r6871
178187   AM_RANGE( 0x000000, 0x07ffff ) AM_ROM AM_REGION( "cart", 0 )
179188   AM_RANGE( 0xe80204, 0xe80205 ) AM_READ( supracan_unk1_r )
180189   AM_RANGE( 0xe80300, 0xe80301 ) AM_READ( supracan_unk1_r )
181   AM_RANGE( 0xe88400, 0xe88bff ) AM_RAM   /* Unknown, some data gets copied here during boot */
182   AM_RANGE( 0xe88c00, 0xe8efff ) AM_RAM_WRITE( supracan_sprchar_w ) AM_BASE( &supracan_sprcharram ) /* Unknown DMA target, likely gfx-related */
190   AM_RANGE( 0xe88400, 0xe8efff ) AM_RAM   /* sample table + sample data */
183191   AM_RANGE( 0xe8f000, 0xe8ffff ) AM_RAM_WRITE( supracan_soundram_w ) AM_BASE( &supracan_soundram_16 )
184192   AM_RANGE( 0xe90000, 0xe9001f ) AM_WRITE( supracan_sound_w )
185193   AM_RANGE( 0xe90020, 0xe9002b ) AM_WRITE( supracan_dma_w )
r6870r6871
190198   AM_RANGE( 0xf44200, 0xf443ff ) AM_RAM AM_BASE(&supracan_vram)   /* Foreground tilemap layer */
191199   AM_RANGE( 0xf44400, 0xf445ff ) AM_RAM AM_BASE(&supracan_rram)   /* ROZ layer tiles */
192200   AM_RANGE( 0xf44600, 0xf44fff ) AM_RAM   /* Unknown, stuff gets written here. Zoom table?? */
193   AM_RANGE( 0xfc0000, 0xfcffff ) AM_RAM   /* System work ram */
201   AM_RANGE( 0xfc0000, 0xfcffff ) AM_RAM_WRITE( supracan_sprchar_w ) AM_BASE( &supracan_sprcharram )   /* System work ram */
194202   AM_RANGE( 0xff8000, 0xffffff ) AM_RAM   /* System work ram */
195203ADDRESS_MAP_END
196204
r6870r6871
210218      gfx[offset*2+0] = (supracan_charram[offset] & 0xff00) >> 8;
211219      gfx[offset*2+1] = (supracan_charram[offset] & 0x00ff) >> 0;
212220
213      gfx_element_mark_dirty(space->machine->gfx[0], offset/32);
221      gfx_element_mark_dirty(space->machine->gfx[0], offset/16);
214222   }
215223}
216224
r6870r6871
370378   8*8*8
371379};
372380
381static const gfx_layout supracan_sprlayout =
382{
383   8,8,
384   RGN_FRAC(1,1),
385   4,
386   { 0,1,2,3 },
387   { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
388   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
389   8*32
390};
373391
374392static GFXDECODE_START( supracan )
375393   GFXDECODE_ENTRY( "ram_gfx",  0, supracan_gfxlayout,   0, 1 )
376   GFXDECODE_ENTRY( "spr_gfx",  0, supracan_gfxlayout,   0, 2 )
394   GFXDECODE_ENTRY( "spr_gfx",  0, supracan_sprlayout,   0, 2 )
377395GFXDECODE_END
378396
379397static MACHINE_DRIVER_START( supracan )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team