It is currently Mon May 21, 2018 9:26 pm

 All times are UTC - 7 hours

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Chr filesPosted: Wed Sep 21, 2016 3:30 am

Joined: Mon Sep 12, 2016 7:41 pm
Posts: 33
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?

Top

 Post subject: Re: Chr filesPosted: Wed Sep 21, 2016 4:14 am

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1144
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.

_________________
https://kasumi.itch.io/indivisible

Top

 Post subject: Re: Chr filesPosted: Wed Sep 21, 2016 9:51 pm

Joined: Sat Mar 30, 2013 12:24 am
Posts: 334
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.

_________________
www.mteegfx.com

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC - 7 hours