home *** CD-ROM | disk | FTP | other *** search
/ Der Mediaplex Sampler - Die 6 von Plex / 6_v_plex.zip / 6_v_plex / DISK3 / DFUE_100 / FAMITXT.ZIP / SCREEN.TXT < prev    next >
Text File  |  1994-02-07  |  8KB  |  197 lines

  1. TH
  2. TH  ############################################################################
  3. TH  #                                                                          #
  4. TH  #         Support for Megadrive - Famicom - PC-Engine - Handhelds          #
  5. TH  #                        More than just Amiga..                            #
  6. TH  #                                                                          #
  7. TH  #   16.8k HST/V32bis -- ASL -- Locked at 57.6k -- 2 Nodes -- 68030 40MHz   #
  8. TH  #                                                                          #
  9. TH  #     THIS FILE PASSED THROUGH TREASURE ISLAND BBS: +44 (0)992 451 191     #
  10. TH  #                                                                          #
  11. TH  ############################################################################
  12. 1HA
  13.  
  14.                 SNES GRAPHICS INFO FILE V1.0
  15.                 ----------------------------
  16.                      By DAX on 28/2/93
  17.  
  18. This is a short text file on how the data for the gfx on the SNES are
  19. set up..
  20. Everything is based around an 8x8 pixel 'Tile' and thinking in terms of
  21. tiles makes the whole thing a lot easier.
  22.  
  23. 4 Colour mode - 2 Bitplanes
  24. ---------------------------
  25. If you split the screen into 8x8 pixel tiles, the order of the graphics data
  26. is tile 0,1,2,3,4 etc.(with tile 0 being the first, and 1 being the one on
  27. the right of it.)
  28.  
  29. Then for each tile, the data is stored as shown below.
  30.         00 01 02 03 04 05 06 07
  31.         10 11 12 13 14 15 16 17    Each number representing one pixel in
  32.         20 21 22 23 24 25 26 27    the 8x8 tile.
  33.         30 31 32 33 34 35 36 37
  34.         40 41 42 43 44 45 46 47
  35.         50 51 52 53 54 55 56 57
  36.         60 61 62 63 64 65 66 67
  37.         70 71 72 73 74 75 76 77
  38.          
  39. The data is stored in the SNES binary in the following format.
  40.         Bitplane 0 ..   Line 00-07 (One Byte)
  41.                         Line 10-17
  42.                         Line 20-27
  43.                         Line 30-37
  44.                         Line 40-47
  45.                         Line 50-57
  46.                         Line 60-67
  47.                         Line 70-77
  48. then    Bitplane 1 ..   Line 00-07
  49.                         Line 10-17
  50.                         Line 20-27
  51.                         Line 30-37
  52.                         Line 40-47
  53.                         Line 50-57
  54.                         Line 60-67
  55.                         Line 70-77
  56. then comes the data for the next tile (the one on the right).etc.
  57.  
  58. 16 Colour - 4 Bitplanes
  59. -----------------------
  60. The data for this mode is stored in the same format, with one main change.
  61. The data is stored in the format
  62.         Bitplane 0 ..   Line 00-07
  63.                                |
  64.                         Line 70-77
  65.  
  66.         Bitplane 1 ..   Line 00-07
  67.                                |
  68.                         Line 70-77
  69.  
  70.         Bitplane 2 ..   Line 00-07
  71.                                |
  72.                         Line 70-77
  73.  
  74.         Bitplane 3 ..   Line 00-07
  75.                                |
  76.                         Line 70-77
  77.                          
  78. then the data for the next tile.
  79.  
  80. 256 Colour - 8 Bitplanes
  81. ------------------------
  82. This is simply an expansion of the 4 and 16 colour modes.
  83.         Bitplane 0 ..   Line 00-07
  84.                                |
  85.                         Line 70-77
  86.  
  87.         Bitplane 1 ..   Line 00-07
  88.                                |
  89.                         Line 70-77
  90.  
  91.         Bitplane 2 ..   Line 00-07
  92.                                |
  93.                         Line 70-77
  94.  
  95.         Bitplane 3 ..   Line 00-07
  96.                                |
  97.                         Line 70-77
  98.          
  99.         Bitplane 4 ..   Line 00-07
  100.                                |
  101.                         Line 70-77
  102.  
  103.         Bitplane 5 ..   Line 00-07
  104.                                |
  105.                         Line 70-77
  106.  
  107.         Bitplane 6 ..   Line 00-07
  108.                                |
  109.                         Line 70-77
  110.  
  111.         Bitplane 7 ..   Line 00-07
  112.                                |
  113.                         Line 70-77
  114.  
  115. then the data for the next tile.
  116.  
  117. 256 Colours - Mode 7 format
  118. ---------------------------
  119. This has some very major differences to the other graphics data formats
  120.  
  121. there are two mode7 modes, normal and EXTBG, the data is stored in the
  122. same way in both, apart from in EXTBG the Bitplane 7 value will be a 
  123. priority bit for the pixel, which cuts the colours down to 128.
  124.  
  125. Each byte of 'graphics data' is actually the colour value for that pixel
  126. on the screen, so if the value is 64, then the colour of that pixel will
  127. be the contents of colour register 64.
  128.  
  129. The data is stored in VRAM differently to the other modes, with the tile
  130. numbers, and the graphics data 'interleaved', starting at $0000 in VRAM,
  131. with alternate bytes containing one byte of tile, one byte of gfx - this
  132. is shown below.
  133.  
  134.         Word of VRAM.        HI                         LO
  135.         Bit  15  14  13  12  11  10  09  08  07  06  05  04  03  02  01  00
  136. content     |------------------------------||------------------------------|
  137.                Graphics data(CHAR DATA)             Tile number(NAME)
  138.  
  139. Because of the storing of 16 bit data in reverse format (LO-HI) this means
  140. that if you set the VRAM addr to $0.the first byte written should be the
  141. tile name for that position on screen and the second byte should be the first
  142. byte of the Mode7 graphics data.if the VRAM addr is set to $1 the first byte
  143. written will be the tile name for that position on scr, and the second byte
  144. should be the second byte of the mode7 graphics data.
  145.   ETC
  146.    
  147. In mode7 you can only have a maximum of 256 tiles, because of the fact that
  148. the mode7 data only takes up the first half of VRAM(32k) you can only have 16k
  149. of graphics data which is 256 tiles of 8x8 with 256 colours.
  150. This is quite a limitation, but can be used quite effectively.
  151.                   
  152. The tile numbers are stored in a format according to a 128x128 tile screen
  153. so tile 128($80) would be the tile below 0($0) on the screen, and so on.
  154. so VRAM addr $0 is the top left tile, and $1 is the one on the right of it
  155. $80 is the one on the left side, one row down.
  156.  
  157. the graphics data is stored based on an 8x8 tile again.
  158. but slightly different.
  159. Each byte(pixel) is stored so... 
  160.                         Bit number    Contents
  161.                                 0          Bitplane 0 pixel value
  162.                                 1          Bitplane 1 pixel value    
  163.                                 2          Bitplane 2 pixel value
  164.                                 3          Bitplane 3 pixel value
  165.                                 4          Bitplane 4 pixel value
  166.                                 5          Bitplane 5 pixel value
  167.                                 6          Bitplane 6 pixel value
  168.                                 7          Bitplane 7 pixel value /
  169.                                            (EXTBG mode - Priority value)
  170.                                             
  171. The data is then stored in the sequence
  172.                 00,01,02,03,04,05,06,07
  173.                 10,11,12,13,14,15,16,16  (Look at diagram at start of file
  174.                     |      |      |       for explanation)
  175.                 70,71,72,73,74,75,76,77
  176.                                          
  177. with one byte for each position(pixel), according to the 8x8 tile format,  
  178. with one tile after another.
  179.  
  180. ---------------------------------------------------------------------------
  181. I hope this text file helps those of you having trouble converting graphics
  182. for use on the SNES, I have been asked a few times recently for this info
  183. so I decided to type up this short text file on it.
  184. Hopefully it should explain it!
  185.  
  186. If you have any further questions contact :-
  187.                 Dax      or    Corsair
  188.  
  189. On the following BBS's
  190.                  
  191.                 The Graveyard           +44 (0)91 516 0560
  192.                 Treasure Island         +44 (0)992  451191 (Coders Conf)
  193.                 The Fun House           +44 (0)81 443 3174 (Coders Conf)
  194.                  
  195. Quick hellos to everyone who I know as I cannot be bothered to type
  196. out a list.
  197.