Previous 15994 Revisions Next

r6030 Saturday 10th October, 2009 at 14:54:50 UTC by Wilbert Pol
[GAMEBOY] Moved some more global video variables into a struct.
[src/mess/includes]gb.h
[src/mess/machine]gb.c
[src/mess/video]gb.c

src/mess/video/gb.c
r6029r6030
4545
4646#define _NR_GB_VID_REGS      0x40
4747
48static UINT8 *gb_oam;
49UINT8 *gb_vram;
50static UINT8 *gb_vram_ptr;
51static UINT8   *gb_chrgen;   /* Character generator           */
52static UINT8   *gb_bgdtab;   /* Background character table    */
53static UINT8   *gb_wndtab;   /* Window character table        */
54static UINT8   gb_tile_no_mod;
55static UINT8   *gbc_chrgen;   /* Character generator           */
56static UINT8   *gbc_bgdtab;   /* Background character table    */
57static UINT8   *gbc_wndtab;   /* Window character table        */
58
5948struct layer_struct {
6049   UINT8  enabled;
6150   UINT8  *bg_tiles;
r6029r6030
10897   struct layer_struct   layer[2];
10998   emu_timer   *lcd_timer;
11099   int gbc_mode;
100
101   UINT8   *gb_vram;      /* Pointer to VRAM */
102   UINT8   *gb_oam;      /* Pointer to OAM memory */
103   UINT8   *gb_vram_ptr;
104   UINT8   *gb_chrgen;      /* Character generator */
105   UINT8   *gb_bgdtab;      /* Background character table */
106   UINT8   *gb_wndtab;      /* Window character table */
107   UINT8   gb_tile_no_mod;
108   UINT8   *gbc_chrgen;   /* CGB Character generator */
109   UINT8   *gbc_bgdtab;   /* CGB Background character table */
110   UINT8   *gbc_wndtab;   /* CGB Window character table */
111111} gb_lcd;
112112
113113static void (*update_scanline)( running_machine *machine );
r6029r6030
225225static void gb_select_sprites( void )
226226{
227227   int   i, /*yindex,*/ line, height;
228   UINT8   *oam = gb_oam + 39 * 4;
228   UINT8   *oam = gb_lcd.gb_oam + 39 * 4;
229229
230230   gb_lcd.sprCount = 0;
231231
r6029r6030
282282   yindex = gb_lcd.current_line;
283283   line = gb_lcd.current_line + 16;
284284
285   oam = gb_oam + 39 * 4;
286   vram = gb_vram;
285   oam = gb_lcd.gb_oam + 39 * 4;
286   vram = gb_lcd.gb_vram;
287287   for (i = 39; i >= 0; i--)
288288   {
289289      /* if sprite is on current line && x-coordinate && x-coordinate is < 168 */
r6029r6030
375375         if ( gb_lcd.layer[0].enabled )
376376         {
377377            gb_lcd.layer[0].bgline = ( SCROLLY + gb_lcd.current_line ) & 0xFF;
378            gb_lcd.layer[0].bg_map = gb_bgdtab;
379            gb_lcd.layer[0].bg_tiles = gb_chrgen;
378            gb_lcd.layer[0].bg_map = gb_lcd.gb_bgdtab;
379            gb_lcd.layer[0].bg_tiles = gb_lcd.gb_chrgen;
380380            gb_lcd.layer[0].xindex = SCROLLX >> 3;
381381            gb_lcd.layer[0].xshift = SCROLLX & 7;
382382            gb_lcd.layer[0].xstart = 0;
r6029r6030
392392               xpos = 0;
393393
394394            gb_lcd.layer[1].bgline = gb_lcd.window_lines_drawn;
395            gb_lcd.layer[1].bg_map = gb_wndtab;
396            gb_lcd.layer[1].bg_tiles = gb_chrgen;
395            gb_lcd.layer[1].bg_map = gb_lcd.gb_wndtab;
396            gb_lcd.layer[1].bg_tiles = gb_lcd.gb_chrgen;
397397            gb_lcd.layer[1].xindex = 0;
398398            gb_lcd.layer[1].xshift = 0;
399399            gb_lcd.layer[1].xstart = xpos;
r6029r6030
436436               i = gb_lcd.layer[l].xend;
437437            i = i - xindex;
438438
439            tile_index = ( map[ gb_lcd.layer[l].xindex ] ^ gb_tile_no_mod ) * 16;
439            tile_index = ( map[ gb_lcd.layer[l].xindex ] ^ gb_lcd.gb_tile_no_mod ) * 16;
440440            data = tiles[ tile_index ] | ( tiles[ tile_index+1 ] << 8 );
441441            data <<= gb_lcd.layer[l].xshift;
442442
r6029r6030
464464
465465                  gb_lcd.layer[l].xindex = ( gb_lcd.layer[l].xindex + 1 ) & 31;
466466                  gb_lcd.layer[l].xshift = 0;
467                  tile_index = ( map[ gb_lcd.layer[l].xindex ] ^ gb_tile_no_mod ) * 16;
467                  tile_index = ( map[ gb_lcd.layer[l].xindex ] ^ gb_lcd.gb_tile_no_mod ) * 16;
468468                  data = tiles[ tile_index ] | ( tiles[ tile_index+1 ] << 8 );
469469               }
470470            }
r6029r6030
522522   yindex = gb_lcd.current_line + SGB_YOFFSET;
523523   line = gb_lcd.current_line + 16;
524524
525   oam = gb_oam + 39 * 4;
526   vram = gb_vram;
525   oam = gb_lcd.gb_oam + 39 * 4;
526   vram = gb_lcd.gb_vram;
527527   for (i = 39; i >= 0; i--)
528528   {
529529      /* if sprite is on current line && x-coordinate && x-coordinate is < 168 */
r6029r6030
694694         if ( gb_lcd.layer[0].enabled )
695695         {
696696            gb_lcd.layer[0].bgline = ( SCROLLY + gb_lcd.current_line ) & 0xFF;
697            gb_lcd.layer[0].bg_map = gb_bgdtab;
698            gb_lcd.layer[0].bg_tiles = gb_chrgen;
697            gb_lcd.layer[0].bg_map = gb_lcd.gb_bgdtab;
698            gb_lcd.layer[0].bg_tiles = gb_lcd.gb_chrgen;
699699            gb_lcd.layer[0].xindex = SCROLLX >> 3;
700700            gb_lcd.layer[0].xshift = SCROLLX & 7;
701701            gb_lcd.layer[0].xstart = 0;
r6029r6030
712712               xpos = 0;
713713
714714            gb_lcd.layer[1].bgline = gb_lcd.window_lines_drawn;
715            gb_lcd.layer[1].bg_map = gb_wndtab;
716            gb_lcd.layer[1].bg_tiles = gb_chrgen;
715            gb_lcd.layer[1].bg_map = gb_lcd.gb_wndtab;
716            gb_lcd.layer[1].bg_tiles = gb_lcd.gb_chrgen;
717717            gb_lcd.layer[1].xindex = 0;
718718            gb_lcd.layer[1].xshift = 0;
719719            gb_lcd.layer[1].xstart = xpos;
r6029r6030
795795               i = gb_lcd.layer[l].xend;
796796            i = i - xindex;
797797
798            tile_index = (map[gb_lcd.layer[l].xindex] ^ gb_tile_no_mod) * 16;
798            tile_index = (map[gb_lcd.layer[l].xindex] ^ gb_lcd.gb_tile_no_mod) * 16;
799799            data = tiles[tile_index] | ( tiles[tile_index + 1] << 8 );
800800            data <<= gb_lcd.layer[l].xshift;
801801
r6029r6030
826826
827827                  gb_lcd.layer[l].xindex = ( gb_lcd.layer[l].xindex + 1 ) & 31;
828828                  gb_lcd.layer[l].xshift = 0;
829                  tile_index = ( map[ gb_lcd.layer[l].xindex ] ^ gb_tile_no_mod ) * 16;
829                  tile_index = ( map[ gb_lcd.layer[l].xindex ] ^ gb_lcd.gb_tile_no_mod ) * 16;
830830                  data = tiles[ tile_index ] | ( tiles[ tile_index + 1 ] << 8 );
831831                  sgb_palette = sgb_pal_map[ ( gb_lcd.end_x - i ) >> 3 ][ gb_lcd.current_line >> 3 ] << 2;
832832               }
r6029r6030
887887   yindex = gb_lcd.current_line;
888888   line = gb_lcd.current_line + 16;
889889
890   oam = gb_oam + 39 * 4;
890   oam = gb_lcd.gb_oam + 39 * 4;
891891   for (i = 39; i >= 0; i--)
892892   {
893893      /* if sprite is on current line && x-coordinate && x-coordinate is < 168 */
r6029r6030
905905         xindex = oam[1] - 8;
906906         if (oam[3] & 0x40)         /* flip y ? */
907907         {
908            data = *((UINT16 *) &gb_vram[ ((oam[3] & 0x8)<<10) + (oam[2] & tilemask) * 16 + (height - 1 - line + oam[0]) * 2]);
908            data = *((UINT16 *) &gb_lcd.gb_vram[ ((oam[3] & 0x8)<<10) + (oam[2] & tilemask) * 16 + (height - 1 - line + oam[0]) * 2]);
909909         }
910910         else
911911         {
912            data = *((UINT16 *) &gb_vram[ ((oam[3] & 0x8)<<10) + (oam[2] & tilemask) * 16 + (line - oam[0]) * 2]);
912            data = *((UINT16 *) &gb_lcd.gb_vram[ ((oam[3] & 0x8)<<10) + (oam[2] & tilemask) * 16 + (line - oam[0]) * 2]);
913913         }
914914#ifndef LSB_FIRST
915915         data = (data << 8) | (data >> 8);
r6029r6030
10041004         if ( gb_lcd.layer[0].enabled )
10051005         {
10061006            gb_lcd.layer[0].bgline = ( SCROLLY + gb_lcd.current_line ) & 0xFF;
1007            gb_lcd.layer[0].bg_map = gb_bgdtab;
1008            gb_lcd.layer[0].gbc_map = gbc_bgdtab;
1007            gb_lcd.layer[0].bg_map = gb_lcd.gb_bgdtab;
1008            gb_lcd.layer[0].gbc_map = gb_lcd.gbc_bgdtab;
10091009            gb_lcd.layer[0].xindex = SCROLLX >> 3;
10101010            gb_lcd.layer[0].xshift = SCROLLX & 7;
10111011            gb_lcd.layer[0].xstart = 0;
r6029r6030
10221022               xpos = 0;
10231023
10241024            gb_lcd.layer[1].bgline = gb_lcd.window_lines_drawn;
1025            gb_lcd.layer[1].bg_map = gb_wndtab;
1026            gb_lcd.layer[1].gbc_map = gbc_wndtab;
1025            gb_lcd.layer[1].bg_map = gb_lcd.gb_wndtab;
1026            gb_lcd.layer[1].gbc_map = gb_lcd.gbc_wndtab;
10271027            gb_lcd.layer[1].xindex = 0;
10281028            gb_lcd.layer[1].xshift = 0;
10291029            gb_lcd.layer[1].xstart = xpos;
r6029r6030
10591059            }
10601060            map = gb_lcd.layer[l].bg_map + ( ( gb_lcd.layer[l].bgline << 2 ) & 0x3E0 );
10611061            gbcmap = gb_lcd.layer[l].gbc_map + ( ( gb_lcd.layer[l].bgline << 2 ) & 0x3E0 );
1062            tiles = ( gbcmap[ gb_lcd.layer[l].xindex ] & 0x08 ) ? gbc_chrgen : gb_chrgen;
1062            tiles = ( gbcmap[ gb_lcd.layer[l].xindex ] & 0x08 ) ? gb_lcd.gbc_chrgen : gb_lcd.gb_chrgen;
10631063
10641064            /* Check for vertical flip */
10651065            if ( gbcmap[ gb_lcd.layer[l].xindex ] & 0x40 )
r6029r6030
10781078               i = gb_lcd.layer[l].xend;
10791079            i = i - xindex;
10801080
1081            tile_index = ( map[ gb_lcd.layer[l].xindex ] ^ gb_tile_no_mod ) * 16;
1081            tile_index = ( map[ gb_lcd.layer[l].xindex ] ^ gb_lcd.gb_tile_no_mod ) * 16;
10821082            data = tiles[ tile_index ] | ( tiles[ tile_index + 1 ] << 8 );
10831083            /* Check for horinzontal flip */
10841084            if ( gbcmap[ gb_lcd.layer[l].xindex ] & 0x20 )
r6029r6030
11241124
11251125                  gb_lcd.layer[l].xindex = ( gb_lcd.layer[l].xindex + 1 ) & 31;
11261126                  gb_lcd.layer[l].xshift = 0;
1127                  tiles = ( gbcmap[ gb_lcd.layer[l].xindex ] & 0x08 ) ? gbc_chrgen : gb_chrgen;
1127                  tiles = ( gbcmap[ gb_lcd.layer[l].xindex ] & 0x08 ) ? gb_lcd.gbc_chrgen : gb_lcd.gb_chrgen;
11281128
11291129                  /* Check for vertical flip */
11301130                  if ( gbcmap[ gb_lcd.layer[l].xindex ] & 0x40 )
r6029r6030
11351135                  {
11361136                     tiles += ( ( gb_lcd.layer[l].bgline & 0x07 ) << 1 );
11371137                  }
1138                  tile_index = ( map[ gb_lcd.layer[l].xindex ] ^ gb_tile_no_mod ) * 16;
1138                  tile_index = ( map[ gb_lcd.layer[l].xindex ] ^ gb_lcd.gb_tile_no_mod ) * 16;
11391139                  data = tiles[ tile_index ] | ( tiles[ tile_index + 1 ] << 8 );
11401140               }
11411141            }
r6029r6030
12881288   int vram_size = 0x2000;
12891289   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
12901290
1291   memset( &gb_lcd, 0, sizeof(gb_lcd) );
1292
12911293   if (mode == GB_VIDEO_CGB) vram_size = 0x4000;
12921294
1293   if (!memory_region(machine, "gfx1")) gb_vram = memory_region_alloc( machine, "gfx1", vram_size, 0 );
1294   if (!memory_region(machine, "gfx2")) gb_oam = memory_region_alloc( machine, "gfx2", 0x100, 0 );
1295   memset( gb_vram, 0, vram_size );
1296   memset( &gb_lcd, 0, sizeof(gb_lcd) );
1295   gb_lcd.gb_vram = memory_region_alloc( machine, "gfx1", vram_size, 0 );
1296   gb_lcd.gb_oam = memory_region_alloc( machine, "gfx2", 0x100, 0 );
1297   memset( gb_lcd.gb_vram, 0, vram_size );
12971298
1298   gb_vram_ptr = gb_vram;
1299   gb_chrgen = gb_vram;
1300   gb_bgdtab = gb_vram + 0x1C00;
1301   gb_wndtab = gb_vram + 0x1C00;
1299   gb_lcd.gb_vram_ptr = gb_lcd.gb_vram;
1300   gb_lcd.gb_chrgen = gb_lcd.gb_vram;
1301   gb_lcd.gb_bgdtab = gb_lcd.gb_vram + 0x1C00;
1302   gb_lcd.gb_wndtab = gb_lcd.gb_vram + 0x1C00;
13021303
13031304   gb_lcd.gb_vid_regs[0x06] = 0xFF;
13041305   for( i = 0x0c; i < _NR_GB_VID_REGS; i++ )
r6029r6030
13281329      /* set the scanline update function */
13291330      update_scanline = gb_update_scanline;
13301331
1331      memcpy( gb_oam, dmg_oam_fingerprint, 0x100 );
1332      memcpy( gb_lcd.gb_oam, dmg_oam_fingerprint, 0x100 );
13321333
13331334      break;
13341335   case GB_VIDEO_MGB:
r6029r6030
13391340      /* Initialize part of VRAM. This code must be deleted when we have added the bios dump */
13401341      for( i = 1; i < 0x0D; i++ )
13411342      {
1342         gb_vram[ 0x1903 + i ] = i;
1343         gb_vram[ 0x1923 + i ] = i + 0x0C;
1343         gb_lcd.gb_vram[ 0x1903 + i ] = i;
1344         gb_lcd.gb_vram[ 0x1923 + i ] = i + 0x0C;
13441345      }
1345      gb_vram[ 0x1910 ] = 0x19;
1346      gb_lcd.gb_vram[ 0x1910 ] = 0x19;
13461347
13471348
1348      memcpy( gb_oam, mgb_oam_fingerprint, 0x100 );
1349      memcpy( gb_lcd.gb_oam, mgb_oam_fingerprint, 0x100 );
13491350
13501351      /* Make sure the VBlank interrupt is set when the first instruction gets executed */
13511352      timer_set(machine,  cputag_clocks_to_attotime(machine, "maincpu", 1), NULL, 0, gb_video_init_vbl );
r6029r6030
13761377      /* set the scanline update function */
13771378      update_scanline = cgb_update_scanline;
13781379
1379      memcpy( gb_oam, cgb_oam_fingerprint, 0x100 );
1380      memcpy( gb_lcd.gb_oam, cgb_oam_fingerprint, 0x100 );
13801381
1381      gb_chrgen = gb_vram;
1382      gbc_chrgen = gb_vram + 0x2000;
1383      gb_bgdtab = gb_wndtab = gb_vram + 0x1C00;
1384      gbc_bgdtab = gbc_wndtab = gb_vram + 0x3C00;
1382      gb_lcd.gb_chrgen = gb_lcd.gb_vram;
1383      gb_lcd.gbc_chrgen = gb_lcd.gb_vram + 0x2000;
1384      gb_lcd.gb_bgdtab = gb_lcd.gb_wndtab = gb_lcd.gb_vram + 0x1C00;
1385      gb_lcd.gbc_bgdtab = gb_lcd.gbc_wndtab = gb_lcd.gb_vram + 0x3C00;
13851386
13861387      /* HDMA disabled */
13871388      gb_lcd.hdma_enabled = 0;
r6029r6030
20362037
20372038READ8_HANDLER( gb_vram_r )
20382039{
2039   return ( gb_lcd.vram_locked == LOCKED ) ? 0xFF : gb_vram_ptr[offset];
2040   return ( gb_lcd.vram_locked == LOCKED ) ? 0xFF : gb_lcd.gb_vram_ptr[offset];
20402041}
20412042
20422043WRITE8_HANDLER( gb_vram_w )
r6029r6030
20452046   {
20462047      return;
20472048   }
2048   gb_vram_ptr[offset] = data;
2049   gb_lcd.gb_vram_ptr[offset] = data;
20492050}
20502051
20512052READ8_HANDLER( gb_oam_r )
20522053{
2053   return ( gb_lcd.oam_locked == LOCKED ) ? 0xFF : gb_oam[offset];
2054   return ( gb_lcd.oam_locked == LOCKED ) ? 0xFF : gb_lcd.gb_oam[offset];
20542055}
20552056
20562057WRITE8_HANDLER( gb_oam_w )
r6029r6030
20592060   {
20602061      return;
20612062   }
2062   gb_oam[offset] = data;
2063   gb_lcd.gb_oam[offset] = data;
20632064}
20642065
20652066WRITE8_HANDLER ( gb_video_w )
r6029r6030
20672068   switch (offset)
20682069   {
20692070   case 0x00:                  /* LCDC - LCD Control */
2070      gb_chrgen = gb_vram + ((data & 0x10) ? 0x0000 : 0x0800);
2071      gb_tile_no_mod = (data & 0x10) ? 0x00 : 0x80;
2072      gb_bgdtab = gb_vram + ((data & 0x08) ? 0x1C00 : 0x1800 );
2073      gb_wndtab = gb_vram + ((data & 0x40) ? 0x1C00 : 0x1800 );
2071      gb_lcd.gb_chrgen = gb_lcd.gb_vram + ((data & 0x10) ? 0x0000 : 0x0800);
2072      gb_lcd.gb_tile_no_mod = (data & 0x10) ? 0x00 : 0x80;
2073      gb_lcd.gb_bgdtab = gb_lcd.gb_vram + ((data & 0x08) ? 0x1C00 : 0x1800 );
2074      gb_lcd.gb_wndtab = gb_lcd.gb_vram + ((data & 0x40) ? 0x1C00 : 0x1800 );
20742075      /* if LCD controller is switched off, set STAT and LY to 00 */
20752076      if ( ! ( data & 0x80 ) )
20762077      {
r6029r6030
21552156      break;
21562157   case 0x06:                  /* DMA - DMA Transfer and Start Address */
21572158      {
2158         UINT8 *P = gb_oam;
2159         UINT8 *P = gb_lcd.gb_oam;
21592160         offset = (UINT16) data << 8;
21602161         for (data = 0; data < 0xA0; data++)
21612162            *P++ = memory_read_byte (space, offset++);
r6029r6030
22212222   switch( offset )
22222223   {
22232224   case 0x00:      /* LCDC - LCD Control */
2224      gb_chrgen = gb_vram + ((data & 0x10) ? 0x0000 : 0x0800);
2225      gbc_chrgen = gb_vram + ((data & 0x10) ? 0x2000 : 0x2800);
2226      gb_tile_no_mod = (data & 0x10) ? 0x00 : 0x80;
2227      gb_bgdtab = gb_vram + ((data & 0x08) ? 0x1C00 : 0x1800);
2228      gbc_bgdtab = gb_vram + ((data & 0x08) ? 0x3C00 : 0x3800);
2229      gb_wndtab = gb_vram + ((data & 0x40) ? 0x1C00 : 0x1800);
2230      gbc_wndtab = gb_vram + ((data & 0x40) ? 0x3C00 : 0x3800);
2225      gb_lcd.gb_chrgen = gb_lcd.gb_vram + ((data & 0x10) ? 0x0000 : 0x0800);
2226      gb_lcd.gbc_chrgen = gb_lcd.gb_vram + ((data & 0x10) ? 0x2000 : 0x2800);
2227      gb_lcd.gb_tile_no_mod = (data & 0x10) ? 0x00 : 0x80;
2228      gb_lcd.gb_bgdtab = gb_lcd.gb_vram + ((data & 0x08) ? 0x1C00 : 0x1800);
2229      gb_lcd.gbc_bgdtab = gb_lcd.gb_vram + ((data & 0x08) ? 0x3C00 : 0x3800);
2230      gb_lcd.gb_wndtab = gb_lcd.gb_vram + ((data & 0x40) ? 0x1C00 : 0x1800);
2231      gb_lcd.gbc_wndtab = gb_lcd.gb_vram + ((data & 0x40) ? 0x3C00 : 0x3800);
22312232      /* if LCD controller is switched off, set STAT to 00 */
22322233      if ( ! ( data & 0x80 ) )
22332234      {
r6029r6030
23142315      logerror( "Write to undocumented register: %X = %X\n", offset, data );
23152316      break;
23162317   case 0x0F:      /* VBK - VRAM bank select */
2317      gb_vram_ptr = gb_vram + ( data & 0x01 ) * 0x2000;
2318      gb_lcd.gb_vram_ptr = gb_lcd.gb_vram + ( data & 0x01 ) * 0x2000;
23182319      data |= 0xFE;
23192320      break;
23202321   case 0x11:      /* HDMA1 - HBL General DMA - Source High */
r6029r6030
24312432   gb_lcd.gb_vid_regs[offset] = data;
24322433}
24332434
2435
2436UINT8 *gb_get_vram_ptr(running_machine *machine)
2437{
2438   return gb_lcd.gb_vram_ptr;
2439}
2440
src/mess/includes/gb.h
r6029r6030
112112   GB_VIDEO_CGB
113113};
114114
115extern UINT8 *gb_vram;
116
117115PALETTE_INIT( gb );
118116PALETTE_INIT( gbp );
119117PALETTE_INIT( sgb );
r6029r6030
123121READ8_HANDLER( gb_video_r );
124122WRITE8_HANDLER( gb_video_w );
125123void gb_video_init( running_machine *machine, int mode );
124UINT8 *gb_get_vram_ptr(running_machine *machine);
126125
127126
128127#endif /* GB_H_ */
src/mess/machine/gb.c
r6029r6030
12571257                        break;
12581258                     case 0x0B:   /* PAL_TRN */
12591259                        {
1260                           UINT8 *gb_vram = gb_get_vram_ptr( space->machine );
12601261                           UINT16 I, col;
12611262
12621263                           for( I = 0; I < 2048; I++ )
r6029r6030
12921293                        break;
12931294                     case 0x13:   /* CHR_TRN */
12941295                        if( sgb_data[1] & 0x1 )
1295                           memcpy( sgb_tile_data + 4096, gb_vram + 0x0800, 4096 );
1296                           memcpy( sgb_tile_data + 4096, gb_get_vram_ptr(space->machine) + 0x0800, 4096 );
12961297                        else
1297                           memcpy( sgb_tile_data, gb_vram + 0x0800, 4096 );
1298                           memcpy( sgb_tile_data, gb_get_vram_ptr(space->machine) + 0x0800, 4096 );
12981299                        break;
12991300                     case 0x14:   /* PCT_TRN */
13001301                        {
13011302                           int I;
13021303                           UINT16 col;
1304                           UINT8 *gb_vram = gb_get_vram_ptr( space->machine );
13031305                           if( sgb_hack )
13041306                           {
13051307                              memcpy( sgb_tile_map, gb_vram + 0x1000, 2048 );
r6029r6030
13211323                        }
13221324                        break;
13231325                     case 0x15:   /* ATTR_TRN */
1324                        memcpy( sgb_atf_data, gb_vram + 0x0800, 4050 );
1326                        memcpy( sgb_atf_data, gb_get_vram_ptr( space->machine ) + 0x0800, 4050 );
13251327                        break;
13261328                     case 0x16:   /* ATTR_SET */
13271329                        {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team