Chr files

A place for your artistic side. Discuss techniques and tools for pixel art on the NES, GBC, or similar platforms.

Moderator: Moderators

Post Reply
WizardBones
Posts: 33
Joined: Mon Sep 12, 2016 7:41 pm

Chr files

Post by WizardBones »

I was playing around with the sprite sizes and wanted to go from, 8x8 to 16 x 8. Now I am wondering how the Chr files work. After changing to 16x8, the top tile appears correct, but the bottom tile is just something random? So i'm wondering, should one rearrange the tiles in the CHR file a certain way? not exactly sure how the second tile of a 16x8 is determined.

Edit: it seems the bottom tile in a 8x16 sprite is the tile to the right of the top tile in the Chr file?
User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Re: Chr files

Post by Kasumi »

There are two sets of 256 tiles. One is usually used for the background, one is usually used for sprites.

Because there are 256 tiles in each set, and the range of a byte is 256, in 8x8 mode the byte written to the tile number is the tile used for the sprite in the set selected for sprites.

In 8x16 mode, things are a little different. All even tiles are the top tile, all odd tiles are the bottom tile. You cannot have an odd tile as the top tile. Since every two tiles are now paired, this would mean you only get 128 different choices in the 256 tile "sprite set". And so, you can use tiles from the background set for sprites as well.

Suppose the sprite set is set zero, the background set is set one.

A tile number of 0 specifies you want tile 0 and 1 of the sprite set. A tile number of 1 specifies you want tile 0 and 1 of the background set.

Basically whether the tile number is even or odd now selects whether you use the background of the sprite set. If the tile number given is odd, one is subtracted. If the tile number given is even, it's used.

The result of this potential subtraction is the tile number that will be used for the top tile in the given set. The one to the right of it in the same set is the bottom tile.
M_Tee
Posts: 430
Joined: Sat Mar 30, 2013 12:24 am
Contact:

Re: Chr files

Post by M_Tee »

I explained it with some image references here: http://www.mteegfx.com/post/12167953203 ... s-overview

It helps to use yychr for managing your chr files because it can reorganize the way it displays the chr file for 8x16.
Post Reply