SNES.3 6.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ----------------------------------------------------------------------------
  2. |For those of you who don't know how the SNES does do it's graphics, it |
  3. |uses tiles (surprise surprise!). |
  4. | |
  5. |There are different MODEs on the SNES; the most famous being MODE 7. |
  6. |Most people think that $2106 (Screen Pixelation: Look in SNES.1 for an ex- |
  7. |planation on this register) is MODE 7. *** THIS IS NOT MODE 7!!! ***. |
  8. |So, the next time the pixels get really "big" (almost making them look like |
  9. |look like IBM-clone 320x200x256 MODE 13h graphics), and your friend says |
  10. |"WOW! MODE 7 is really awesome," punch him/her in the nose for me. Just |
  11. |joking. :-) |
  12. | |
  13. |I'll be explaining MODE 1. I know how MODE 7 works, but since i've never |
  14. |used it, don't plan on me explaining it in the near future. Sorry to those |
  15. |who were looking for a MODE 7 document. Look elsewhere... |
  16. | |
  17. |MODE # of BGs MaxColour/Tile Palettes Colours |
  18. |----------------------------------------------------------------------------|
  19. |0 4 4 8 32 |
  20. |1 3 16/16/4 8 128 |
  21. | |
  22. |MODE 0 is good for geometric shapes (if you were going to rotate a wire- |
  23. |frame cube, or something like that), basic star scrolls, or a very 'bland' |
  24. |text scroller... it's pretty cool and doesn't take up much space. |
  25. | |
  26. |I'm going to explain MODE 1, since MODE 0 is the same thing but with less |
  27. |bitplanes. :-) |
  28. | |
  29. |MODE 1 is really best for things; detailed star scrolls, text scrollers, |
  30. |geometric shapes, and filled objects. It's the most common used MODE in the |
  31. |the professional SNES programming world. |
  32. | |
  33. |You need to "setup the plane" to tell it what tile goes where. If you want |
  34. |demo-code, check out 'test.asm' in 'test.lzh'. |
  35. |----------------------------------------------------------------------------|
  36. |So, lets assume we have a character (a 8x8 tile) which we want to work with |
  37. |to figure out the SNES's colour scheme: |
  38. | |
  39. |TestCHR1 dcb $00,$00,$00,$00,$00,$00,$00,$00 ; '@' |
  40. |TestCHR2 dcb $00,$3C,$4E,$5E,$5E,$40,$3C,$00 ; '@' |
  41. | |
  42. |You're probably wondering how the two lines above turn into actual graphic |
  43. |data on your monitor or television set. Very simple. Consider each byte |
  44. |(each new $xx statement) a new pixel line. Tile size is 8x8. |
  45. | |
  46. | %00000000 = $00 |
  47. | %00000000 = $00 This is TestCHR1 |
  48. | %00000000 = $00 |
  49. | %00000000 = $00 |
  50. | %00000000 = $00 |
  51. | %00000000 = $00 |
  52. | %00000000 = $00 |
  53. | %00000000 = $00 |
  54. | |
  55. | %00000000 = $00 |
  56. | %00111100 = $3C This is TestCHR2 |
  57. | %01001110 = $4E |
  58. | %01011110 = $5E |
  59. | %01011110 = $5E |
  60. | %01000000 = $40 |
  61. | %00111100 = $3C |
  62. | %00000000 = $00 |
  63. | |
  64. |The at-symbol ('@') is visible in TestCHR2. Now you're probably wondering |
  65. |"Well, that tells me how to define a pixel on and off; what about the colour|
  66. |itself!" Once again, very simple, but a tad more complex: |
  67. | |
  68. |If you have a 0 for bitplane 0, a 0 for bitplane 1, a 0 for bitplane 2, |
  69. |and a 0 for bitplane 3, you get color #0; eg.: |
  70. | 0000 = Color #0 |
  71. | ||||___________Bitplane 0 |
  72. | |||__________Bitplane 1 |
  73. | ||_________Bitplane 2 |
  74. | |________Bitplane 3 |
  75. | |
  76. |So, now, think about a 0 for bitplane 0, a 1 for bitplane 1 and 2, and a 0 |
  77. |for bitplane 3: |
  78. | 0110 = Color #6 |
  79. | ||||___________Bitplane 0 |
  80. | |||__________Bitplane 1 |
  81. | |_________Bitplane 2 |
  82. | |________Bitplane 3 |
  83. | |
  84. |Keep in mind, this is the best explanation i've ever seen done about SNES |
  85. |pixel color definition. Until I see better, I'd have to say this is the |
  86. |best it's gonna get. |
  87. |The result above gives you the color # per pixel; it's interesting. It's an |
  88. |"overlay" method, so-to-speak, not to confuse this w/ main and sub-screens. |
  89. ----------------------------------------------------------------------------