Tool to find duplicate tiles

You can talk about almost anything that you want to on this board.

Moderator: Moderators

Post Reply
User avatar
DRW
Posts: 2277
Joined: Sat Sep 07, 2013 2:59 pm

Tool to find duplicate tiles

Post by DRW »

Is there a program that takes the .chr file of an NES project and tells you where you have duplicate tiles?
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Re: Tool to find duplicate tiles

Post by Kasumi »

NES Screen Tool will do this.

https://shiru.untergrund.net/software.shtml
ccovell
Posts: 1045
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Re: Tool to find duplicate tiles

Post by ccovell »

It's a bit ancient now, but you can always re-compile the C source to my program: http://www.chrismcovell.com/charlie.html
tepples
Posts: 22864
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Tool to find duplicate tiles

Post by tepples »

DRW wrote:Is there a program that takes the .chr file of an NES project and tells you where you have duplicate tiles?
I wrote an NES program that can do that.
User avatar
DRW
Posts: 2277
Joined: Sat Sep 07, 2013 2:59 pm

Re: Tool to find duplicate tiles

Post by DRW »

Thanks for your help.

ccovell's tool is the one that works best for me. (Since I have Windows XP, I didn't even need to recompile the file.)

With shiru's tool, I didn't find a way to list all duplicates at once. I only found the version where I click one tile and it shows me the duplicates of this one tile.
tepples wrote:I wrote an NES program that can do that.
If it's an NES program, how am I supposed to use an existing CHR file for a check?
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
User avatar
rainwarrior
Posts: 8759
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Tool to find duplicate tiles

Post by rainwarrior »

It would be a very simple tool to write for yourself:

Code: Select all

for (int t=0; t<256; ++t) // iterate over 256 16-byte tiles
{
	for (int u=0; u<t; ++u) // check every tile before this one
	{
		bool duplicate = true;
		for (int b=0; b<16; ++b)
		{
			if (chr[(t*16)+b] != chr[(u*16)+b])
			{
				duplicate = false;
				break;
			}
		}
		if (duplicate)
		{
			printf("Tile %02X duplicates tile %02X\n",t,u);
			break;
		}
	}
}
Post Reply