MakeGradient by Shiru


This is old custom tool that I used in a number of SNES homebrew projects,
updated a bit to release it to the general public. It helps to prepare data for
the HDMA-driven color math gradients that is a well recognizeable feature of
the SNES graphics.

The idea behind the tool is that you can design such a gradient using a modern
graphics editor that that layers and blending modes support, such as Gimp or
Photoshop. Load a 256x224 screenshot of your in-game graphics there. Create a
new opaque layer with Addition or Subtraction blend mode (100% opacity). Create
a vertical only gradient on that layer using gradient tool, colorizing, and see
how it affects the picture. Once it looks as desired, hide the screenshot layer
and export the picture with gradient into a 24-bit BMP file. Now you can load
the file to the tool, to check how it applies to actual SNES graphics, with the
15-bit color, and actual Add/Sub blending math; then get converted data as text
for assembler source code.

The data can be prepared in a few formats, for different use cases:

RGB 3xHDMA       data is supposed to be directed to the COLDATA register ($2132)
                 using three HDMA channels in the transfer mode 0 (one register
                 write once).
				 
RGB 2xHDMA       data is supposed to be directed to the COLDATA as well, but
                 using just two HDMA channels, one in the transfer mode 2 (one
				 register write twice) and other in mode 2.
				 
Gray 1xHDMA      color of the gradient is omited, the grayscale data is to be
                 directed to the COLDATA register using one HDMA channel in the
				 transfer mode 0.
				 
Palette 2xHDMA - data is supposed to be directed to the same entry of the palette
                 using CGADD ($2121) and CGDATA ($2122) registers and one HDMA
				 channel in the transfer mode 3 (two registers write twice each).


				 
v1.0 11.05.17 - First public release
     02.04.12 - Initial private version, got many updates since

	 

Mail:	shiru@mail.ru
Web:    http:// shiru.untergrund.net
Donate: http://www.justgiving.com/Shiru