scnfrmt.txt 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. [Image]
  2. SNES Screen Format
  3. [Image]
  4. SNES GRAPHICS INFO FILE V1.0
  5. ----------------------------
  6. By DAX on 28/2/93
  7. This is a short text file on how the data for the gfx on the SNES are
  8. set up..
  9. Everything is based around an 8x8 pixel 'Tile' and thinking in terms of
  10. tiles makes the whole thing a lot easier.
  11. 4 Colour mode - 2 Bitplanes
  12. ---------------------------
  13. If you split the screen into 8x8 pixel tiles, the order of the graphics data
  14. is tile 0,1,2,3,4 etc.(with tile 0 being the first, and 1 being the one on
  15. the right of it.)
  16. Then for each tile, the data is stored as shown below.
  17. 00 01 02 03 04 05 06 07
  18. 10 11 12 13 14 15 16 17 Each number representing one pixel in
  19. 20 21 22 23 24 25 26 27 the 8x8 tile.
  20. 30 31 32 33 34 35 36 37
  21. 40 41 42 43 44 45 46 47
  22. 50 51 52 53 54 55 56 57
  23. 60 61 62 63 64 65 66 67
  24. 70 71 72 73 74 75 76 77
  25. The data is stored in the SNES binary in the following format.
  26. Bitplane 0 .. Line 00-07 (One Byte)
  27. Line 10-17
  28. Line 20-27
  29. Line 30-37
  30. Line 40-47
  31. Line 50-57
  32. Line 60-67
  33. Line 70-77
  34. then Bitplane 1 .. Line 00-07
  35. Line 10-17
  36. Line 20-27
  37. Line 30-37
  38. Line 40-47
  39. Line 50-57
  40. Line 60-67
  41. Line 70-77
  42. then comes the data for the next tile (the one on the right).etc.
  43. 16 Colour - 4 Bitplanes
  44. -----------------------
  45. The data for this mode is stored in the same format, with one main change.
  46. The data is stored in the format
  47. Bitplane 0 .. Line 00-07
  48. |
  49. Line 70-77
  50. Bitplane 1 .. Line 00-07
  51. |
  52. Line 70-77
  53. Bitplane 2 .. Line 00-07
  54. |
  55. Line 70-77
  56. Bitplane 3 .. Line 00-07
  57. |
  58. Line 70-77
  59. then the data for the next tile.
  60. 256 Colour - 8 Bitplanes
  61. ------------------------
  62. This is simply an expansion of the 4 and 16 colour modes.
  63. Bitplane 0 .. Line 00-07
  64. |
  65. Line 70-77
  66. Bitplane 1 .. Line 00-07
  67. |
  68. Line 70-77
  69. Bitplane 2 .. Line 00-07
  70. |
  71. Line 70-77
  72. Bitplane 3 .. Line 00-07
  73. |
  74. Line 70-77
  75. Bitplane 4 .. Line 00-07
  76. |
  77. Line 70-77
  78. Bitplane 5 .. Line 00-07
  79. |
  80. Line 70-77
  81. Bitplane 6 .. Line 00-07
  82. |
  83. Line 70-77
  84. Bitplane 7 .. Line 00-07
  85. |
  86. Line 70-77
  87. then the data for the next tile.
  88. 256 Colours - Mode 7 format
  89. ---------------------------
  90. This has some very major differences to the other graphics data formats
  91. there are two mode7 modes, normal and EXTBG, the data is stored in the
  92. same way in both, apart from in EXTBG the Bitplane 7 value will be a
  93. priority bit for the pixel, which cuts the colours down to 128.
  94. Each byte of 'graphics data' is actually the colour value for that pixel
  95. on the screen, so if the value is 64, then the colour of that pixel will
  96. be the contents of colour register 64.
  97. The data is stored in VRAM differently to the other modes, with the tile
  98. numbers, and the graphics data 'interleaved', starting at $0000 in VRAM,
  99. with alternate bytes containing one byte of tile, one byte of gfx - this
  100. is shown below.
  101. Word of VRAM. HI LO
  102. Bit 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
  103. content |------------------------------||------------------------------|
  104. Graphics data(CHAR DATA) Tile number(NAME)
  105. Because of the storing of 16 bit data in reverse format (LO-HI) this means
  106. that if you set the VRAM addr to $0.the first byte written should be the
  107. tile name for that position on screen and the second byte should be the first
  108. byte of the Mode7 graphics data.if the VRAM addr is set to $1 the first byte
  109. written will be the tile name for that position on scr, and the second byte
  110. should be the second byte of the mode7 graphics data.
  111. ETC
  112. In mode7 you can only have a maximum of 256 tiles, because of the fact that
  113. the mode7 data only takes up the first half of VRAM(32k) you can only have 16k
  114. of graphics data which is 256 tiles of 8x8 with 256 colours.
  115. This is quite a limitation, but can be used quite effectively.
  116. The tile numbers are stored in a format according to a 128x128 tile screen
  117. so tile 128($80) would be the tile below 0($0) on the screen, and so on.
  118. so VRAM addr $0 is the top left tile, and $1 is the one on the right of it
  119. $80 is the one on the left side, one row down.
  120. the graphics data is stored based on an 8x8 tile again.
  121. but slightly different.
  122. Each byte(pixel) is stored so...
  123. Bit number Contents
  124. 0 Bitplane 0 pixel value
  125. 1 Bitplane 1 pixel value
  126. 2 Bitplane 2 pixel value
  127. 3 Bitplane 3 pixel value
  128. 4 Bitplane 4 pixel value
  129. 5 Bitplane 5 pixel value
  130. 6 Bitplane 6 pixel value
  131. 7 Bitplane 7 pixel value /
  132. (EXTBG mode - Priority value)
  133. The data is then stored in the sequence
  134. 00,01,02,03,04,05,06,07
  135. 10,11,12,13,14,15,16,16 (Look at diagram at start of file
  136. | | | for explanation)
  137. 70,71,72,73,74,75,76,77
  138. with one byte for each position(pixel), according to the 8x8 tile format,
  139. with one tile after another.
  140. ---------------------------------------------------------------------------
  141. I hope this text file helps those of you having trouble converting graphics
  142. for use on the SNES, I have been asked a few times recently for this info
  143. so I decided to type up this short text file on it.
  144. Hopefully it should explain it!
  145. [Image]
  146. © 1996 Damaged Cybernetics
  147. [Image]