Page 1 of 3

Sprites.chr is not appearing in PPU viewer

Posted: Mon Oct 13, 2014 11:56 pm
by Tsutarja
I don't know if I'm doing this correctly, but I just added my sprites.chr file to my program, but when I run my code, it won't appear in the PPU viewer (I'm using FCEUX for testing). I added both font.chr (contains background tiles) and sprites.chr files with .incbin"<file-name-here>", but only the background tiles appear in the PPU viewer.

This is how it is in the code:

Code: Select all

 .bank 2
 .org $0000
 .incbin "Font.chr"
 .incbin "Sprites.chr"
Here is full code if you need it: http://pastebin.com/qkBqk2y9

Re: Sprites.chr is not appearing in PPU viewer

Posted: Tue Oct 14, 2014 1:01 am
by Drag
Make sure your two .chr files don't add up to be over 8kb, because on the NES, the background uses 4kb, and the sprites use 4kb.

Re: Sprites.chr is not appearing in PPU viewer

Posted: Tue Oct 14, 2014 2:39 am
by Tsutarja
Drag wrote:Make sure your two .chr files don't add up to be over 8kb, because on the NES, the background uses 4kb, and the sprites use 4kb.
The background has 31 tiles and sprites has 2 tiles. No way either of those would be more than 4kb.

Re: Sprites.chr is not appearing in PPU viewer

Posted: Tue Oct 14, 2014 5:05 am
by Denine
Make sure your background .chr file is 4kb. If it is smaller, then sprites .chr file might be simply included right after background. See PPU viewer if you can find your sprite tiles on the background "side" of the viewer.
To avoid this you can either(in your case, since you are using NROM+CHR ROM):
-Make background file excatly 4kb. It have to have 256 tiles, even if latter are empty.
-Changing the end of the assembly file to:
.bank 2
.org $0000
.incbin "Font.chr"
.org $1000
.incbin "Sprites.chr"

Re: Sprites.chr is not appearing in PPU viewer

Posted: Tue Oct 14, 2014 7:34 am
by tokumaru
Did you set the palettes correctly at $3F00-$3F1F? FCEUX will not show anything if the palette isn't set (you can cycle through the palettes in the viewer IIRC).

Did you select the correct pattern tables for each side through bits 3 and 4 of register $2000 (PPUCTRL)? If both are pointing to the background pattern table that's all you'll see.

Re: Sprites.chr is not appearing in PPU viewer

Posted: Tue Oct 14, 2014 10:58 am
by Kasumi
I think Denine's got it right. I downloaded the file from pastebin, changed nothing inside. I supplied two different 4 KB CHR files and it displayed both in FCEUX's PPU viewer just fine.

Alternatively Font.chr is actually 8 KB. The number of tiles used doesn't necessarily correspond to the size of the file. Which version of NESASM are you using?

Re: Sprites.chr is not appearing in PPU viewer

Posted: Tue Oct 14, 2014 11:00 pm
by Tsutarja
I use NESASM 3. I'm also using YY-CHR for making the graphics if that matters.

Re: Sprites.chr is not appearing in PPU viewer

Posted: Wed Oct 15, 2014 12:14 am
by 3gengames
You have to set the palette to see them in fceux's viewer.

Re: Sprites.chr is not appearing in PPU viewer

Posted: Wed Oct 15, 2014 12:33 am
by Tsutarja
I did set all 8 palettes. I'll have to see if I can limit the chr file sizes to see if that fixes this problem. Looking at the earlier messages, it's very well possible that my chr files are over 4kb

Re: Sprites.chr is not appearing in PPU viewer

Posted: Wed Oct 15, 2014 12:43 am
by 3gengames
Should be 8KB exactly. YY-Chr should save that normally, using 2 pages. At least from what I remember.

Re: Sprites.chr is not appearing in PPU viewer

Posted: Wed Oct 15, 2014 1:51 am
by Tsutarja
I just checked my chr files, and it seems like they both are 16kb. Maybe it's best that I put all graphics to the same file, but just start sprites with 4kb offset to get them right after the first background table.

Re: Sprites.chr is not appearing in PPU viewer

Posted: Wed Oct 15, 2014 1:55 am
by 3gengames
Save to the right file format, too. If your settings aren't right on the editor, then it won't output right file format/size for the file, no matter the extension.

Re: Sprites.chr is not appearing in PPU viewer

Posted: Wed Oct 15, 2014 2:07 am
by Tsutarja
What are the correct settings then? I attached image of the settings that appear on the main editor screen, but I don't know if that's what you meant. Anyway, I got the sprite to appear on the PPU viewer by adding it to the font.chr with a 4kb offset. Now I just need to make it appear on screen.
yychr.png

Re: Sprites.chr is not appearing in PPU viewer

Posted: Wed Oct 15, 2014 2:19 am
by Kasumi
Here is a blank 4KB file. If your YY-CHR is like mine (yours is newer than mine), YY-CHR will save a file that is the exact same size as it was when it was opened. So open this and paste your background tiles in. Save it as font.chr. Open it again and put your sprite tiles in. Save it as sprites.chr.

I'd say your file is still too big, because YY-CHR shows 256 tiles in its left window. 256 tiles is 4 KB. You can scroll down which means your file is bigger than 4KB. And it looks like you can actually scroll quite a bit which means your file is probably still 16 KB and not even 8KB.

Edit: Actually I learned a new thing about YY-CHR today. The filesize is at the top in hex. 000000/004000. $4000 is how big your file is. $4000 is 16KB.

Edit2: I'll attach a blank 8KB file as well in case that's your preferred method.

Re: Sprites.chr is not appearing in PPU viewer

Posted: Wed Oct 15, 2014 2:40 am
by Tsutarja
I'll have to leave that for later. I got a new problem. I was trying to set up a proper code for updating either background and/or sprites if necessary and I messed something up. The screen is black now, but I can see stuff on the Nametable Viewer just fine.

Here is the code: http://pastebin.com/sAee4cD3