It is currently Sat Nov 17, 2018 11:58 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Fri Sep 07, 2018 11:14 am 
Offline
User avatar

Joined: Wed Sep 05, 2018 11:13 am
Posts: 146
Location: Colorado
So I've been playing around with rainwarrior's ca65 template, and when I change out the background tiles, the sprites disappear from the PPU Viewer in FCEUX, and no cursor shows up. If I swap out the sprite file I don't have the same issue. I'm not sure what's going on here, I've tried sizing it the same but that doesn't seem to matter. What kind of magic is going on in that .chr file that I'm not aware of?

I'm using photoshop to make my sprites and I'm using yy-chr to export the new .chr files.

Any suggestions?

Thanks

_________________
A few of my web games
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com


Top
 Profile  
 
PostPosted: Fri Sep 07, 2018 11:27 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6956
Location: Canada
Well, I suspect a similar problem as in your other post. Most likely this sounds like your CHR file is too small. What is its size?

You can divide the CHR up into separate files however you like, and incbin them all in the TILES segment. The first 4kb goes to background, the second 4kb goes to sprites. How you put that together is up to you, but if you don't fill up that first 4kb you won't be putting anything in the second 4kb where sprites go.


Top
 Profile  
 
PostPosted: Fri Sep 07, 2018 11:36 am 
Offline
User avatar

Joined: Wed Sep 05, 2018 11:13 am
Posts: 146
Location: Colorado
rainwarrior wrote:
Well, I suspect a similar problem as in your other post. Most likely this sounds like your CHR file is too small. What is its size?

You can divide the CHR up into separate files however you like, and incbin them all in the TILES segment. The first 4kb goes to background, the second 4kb goes to sprites. How you put that together is up to you, but if you don't fill up that first 4kb you won't be putting anything in the second 4kb where sprites go.


Thanks for the help. So do I need to size the .chr file to exactly 4K? It looks like they are saving out at 8K, but there really isn't much there. Maybe I'm not using yy-chr right? Does yy-chr have some way to configure it to export a 4K file. It looks like yy-chr has enough space for 16x16 sprites. Is it expecting me to put both the background tiles and the sprites into the same file?

Thanks again for your help

_________________
A few of my web games
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com


Top
 Profile  
 
PostPosted: Fri Sep 07, 2018 11:41 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6956
Location: Canada
You could put them both together in an 8k file if you want.

I can't tell you how to use YY-CHR, but 256 8x8 tiles is 4kb of CHR. (256 = 16x16, and I assuming you were counting sprite tiles as 16 per row?) Each tile is 16 bytes of CHR data. (2 bits per pixel / bpp)


Top
 Profile  
 
PostPosted: Fri Sep 07, 2018 12:05 pm 
Offline
User avatar

Joined: Wed Sep 05, 2018 11:13 am
Posts: 146
Location: Colorado
rainwarrior wrote:
You could put them both together in an 8k file if you want.

I can't tell you how to use YY-CHR, but 256 8x8 tiles is 4kb of CHR. (256 = 16x16, and I assuming you were counting sprite tiles as 16 per row?) Each tile is 16 bytes of CHR data. (2 bits per pixel / bpp)



All right! So it looks like yy-chr makes a single 8K file with both tile & sprite data in it. The top half is the tile data and the bottom is the sprite data.

What do most people use? I had seen yy-chr thrown around in the forums and elsewhere as a tool for creating the .chr files. I'm not particularly fond of yy-chr, but I have no idea what my other options are.

Thanks again!

_________________
A few of my web games
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com


Top
 Profile  
 
PostPosted: Fri Sep 07, 2018 6:27 pm 
Offline
User avatar

Joined: Sun Apr 08, 2018 11:45 pm
Posts: 22
Location: Southern California
battagline wrote:

All right! So it looks like yy-chr makes a single 8K file with both tile & sprite data in it. The top half is the tile data and the bottom is the sprite data.

What do most people use? I had seen yy-chr thrown around in the forums and elsewhere as a tool for creating the .chr files. I'm not particularly fond of yy-chr, but I have no idea what my other options are.

Thanks again!


I found Shiru's NES Screen Tool to be easier to use than yy-chr, and it has options to work with CHR data in 4k or 8k pieces


Top
 Profile  
 
PostPosted: Fri Sep 07, 2018 6:42 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2333
Location: DIGDUG
Quote:
single 8K file with both tile & sprite data in it. The top half is the tile data and the bottom is the sprite data.


The PPU loads 2 tilesets. #0 and #1.

Background can use either 0 or 1. Sprites can use 0 or 1. They can both use the same tileset, if you like. Background can use tileset 0 for the top half of the screen and 1 for the bottom half of the screen (by changing it halfway).

PPU control register does this, with these bits

xxxB Sxxx

Where B is the bit for BG tileset, S is the bit for Sprite tileset.

For most nes games, it doesn't matter which you choose, but apparently, for mapper MMC3, is matters. The wiki says "The standard configuration is to use PPU $0000-$0FFF for background tiles and $1000-$1FFF for sprite tiles", so I suppose you are correct...ish.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Fri Sep 07, 2018 9:29 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2047
Location: Fukuoka, Japan
dougeff wrote:
For most nes games, it doesn't matter which you choose, but apparently, for mapper MMC3, is matters. The wiki says "The standard configuration is to use PPU $0000-$0FFF for background tiles and $1000-$1FFF for sprite tiles", so I suppose you are correct...ish.


I would love to know more about that possible "quirk". After reading that message, halfway I thought "oh! why I didn't think about putting the fonts into the sprite bank so I can just switch to bg in sprite, idiot!" (I was going to switch one bank inside BG one for that) but you mention and mmc3 issue. oupsie :lol:

Maybe another thread would be more appropriate? I'm curious about it since it would impact how I continue for code inside intro/cutscene which often doesn't require much sprites.


Top
 Profile  
 
PostPosted: Sat Sep 08, 2018 12:55 am 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 820
It only affects IRQs. So if you switch in your last IRQ, it won't cause any trouble.


Top
 Profile  
 
PostPosted: Sat Sep 08, 2018 7:53 am 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2047
Location: Fukuoka, Japan
I see. Now I just need to first make my first IRQ behave properly before switching bg<->sprite banks :lol: Thank you for the information!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: pwnskar, yaros and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group