Having trouble with rainwarrior's ca65 template
Moderator: Moderators
- battagline
- Posts: 152
- Joined: Wed Sep 05, 2018 11:13 am
- Location: Colorado
- Contact:
Having trouble with rainwarrior's ca65 template
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
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
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com
- rainwarrior
- Posts: 8734
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Having trouble with rainwarrior's ca65 template
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.
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.
- battagline
- Posts: 152
- Joined: Wed Sep 05, 2018 11:13 am
- Location: Colorado
- Contact:
Re: Having trouble with rainwarrior's ca65 template
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?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 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
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com
- rainwarrior
- Posts: 8734
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Having trouble with rainwarrior's ca65 template
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)
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)
- battagline
- Posts: 152
- Joined: Wed Sep 05, 2018 11:13 am
- Location: Colorado
- Contact:
Re: Having trouble with rainwarrior's ca65 template
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
https://www.embed.com
Or if you're bored at work
https://www.classicsolitaire.com
- samophlange
- Posts: 50
- Joined: Sun Apr 08, 2018 11:45 pm
- Location: Southern California
Re: Having trouble with rainwarrior's ca65 template
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 piecesbattagline 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!
Re: Having trouble with rainwarrior's ca65 template
The PPU loads 2 tilesets. #0 and #1.single 8K file with both tile & sprite data in it. The top half is the tile data and the bottom is the sprite data.
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
Re: Having trouble with rainwarrior's ca65 template
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. oupsiedougeff 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.
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.
Re: Having trouble with rainwarrior's ca65 template
It only affects IRQs. So if you switch in your last IRQ, it won't cause any trouble.
Re: Having trouble with rainwarrior's ca65 template
I see. Now I just need to first make my first IRQ behave properly before switching bg<->sprite banks Thank you for the information!