Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Dstexcomp

From GameBrew
Revision as of 03:03, 27 December 2012 by HydeWing (talk | contribs) (Created page with "{{Infobox homebrew | title = dstexcomp | image = File:Dstexcompds.png | type = PC Utility | version = 0.1 30March2009 | licence = Mixed | author...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
dstexcomp
File:Dstexcompds.png
General
Author(s)kvance (Kevin Vance)
TypePC Utility
Version0.1 30March2009
LicenceMixed
Links
[Media:Dstexcomp01.tar.gz Download]
Website
Advertisements

<htmlet>adsense</htmlet>


This is an attempt at a Nintendo DS texture compressor. It takes any image as input, and can output the NDS formatted texture in a variety of ways.

Installation

dstexcomp requires Python 2.5 and the following libraries:

Python Imaging Library
NumPy
SciPy
pyprocessing

It will optionally use Psyco if you have it.

User guide

Hardware texture compression on the NDS allows you to display very large textures for the device. You can store two compressed 1024x512 textures on a device with a total screen size of 256x384. There is no performance penalty, as the hardware can decompress them on the fly. Unfortunately, the tools to generate compressed textures are not available to the homebrew community.

Compressed textures have a slightly complicated format, and the hardware is not very forgiving about how they are stored. The texture is divided into three parts:

Pixmap: The pixels of the texture, grouped into 4x4 blocks
Index: A map from each pixel block to a part of the palette
Palette: The list of colors, used in groups of 2 or 4

The pixmap can be stored in texture slots 0 or 2. The index must be stored in slot 1. This prevents textures larger than 1024x512, since the index would be in the middle of them. Palettes are stored normally.

Example NDS Binary.

Example C Source Code.

Advertising: