Skip navigation
NintendoAge
Welcome, Guest! Please Login or Join
Loading...

Homebrew CHR-ROM and CHR-Files declaration help Don't understand how this works

Jun 30 at 2:59:11 AM
oleSchool (0)
avatar
(Jonathon Wright) < Little Mac >
Posts: 72 - Joined: 11/02/2011
Hawaii
Profile
Well, that didn't take long. I'm back and have a couple noob questions.  

I'm learning the use of nesasm syntax and in the header file I read I needed to specify the "number of 8K chr-rom banks". 
So not knowing alot, I put a 1 and found a few examples, here it is simply enough:

.ineschr 1

From the nerdynights tutorial week 2, I seems that a pattern table consists of 256 8x8 pixel tiles. So I downloaded yy-chr, which I used to create those 256 tiles for graphics (I filled up 00-FF tiles with all kinds of random graphics of letters and numbers). Based on that, logically it seems 1 .chr file = 1 pattern table.
When I was done, I saved it as "test.chr", and I noticed the test.chr file size was 28Kbytes no matter what I changed in any of the tiles. 

This led me to a few questions: 

1.) Do I need to put ".ineschr 4" for my ineschr header entry since 28 divided by 8 = 3.5 times (rounding up to 4)?... probably not, so I'm thinking I don't understand the ineschr entry. 
2.) If I'm using mapper 0, that means I can only have 1 .chr file correct? Or I guess it would depend on how ya'll answer #1 above. If I can have 4, then how do I switch to the other ones is the obvious question. 

Just trying to understand but I got lost in the weeds a bit on this one and need a little help understanding. 
Thanks gang...remember, noob here, be gentle  

Oleschool
 

-------------------------
"It's Dangerous to go alone. Take This!"
The Old Man

https://www.youtube.com/channel/U...

Jun 30 at 9:16:36 AM
KHAN Games (89)
avatar
(Kevin Hanley) < Master Higgins >
Posts: 8124 - Joined: 06/21/2007
Florida
Profile
Not sure how yy-chr works, but the file you're going to want to use needs to be 8kb, like the tutorial says. That will contain a pattern table for sprites (256 tiles), and a pattern table for background tiles (256 more tiles).

If yours only had 256 tiles and it was still somehow 28kb, it must be saving in the wrong palette format or something.

Here's a blank file you can use!

https://www.dropbox.com/s/20kxbqb...

Oh, and to answer your questions:

1) Your current statement of 1 chr file is correct.
2) Yes, mapper 0 can only have one chr file. Otherwise you can move to CNROM and add a few more! (There's an advanced nerdy nights tutorial that covers this, if you decide to change!)

https://wiki.nesdev.com/w/index.p...

-------------------------

gauauu: look, we all paid $10K at some point in our lives for the privilege of hanging out with Kevin



Edited: 06/30/2019 at 09:19 AM by KHAN Games

Jun 30 at 8:05:16 PM
oleSchool (0)
avatar
(Jonathon Wright) < Little Mac >
Posts: 72 - Joined: 11/02/2011
Hawaii
Profile
Thank you sir!

That was easy... your file opened up in yy-chr just fine and it had 512 tiles. It also remained 8kbytes no matter what I added to the tiles, perfect!

I'm assuming the 1st pattern table is 0000-0FFF and the second is 1000-1FFF? That's how yy-chr is reading it.
Either way very cool. I'll leave the ineschr declaration to "1" and stay on mapper 0 until my training wheels are ready to come off, haha!

I guess the .chr file I was using had some weird format or something, who knows, glad to be moving ahead, thanks again!

P.S. Very cool vid with you and Mike C., you're story of how difficult it was to make frogger was pretty mind blowing... I still have no idea what sprite 0 is but I'm sure I'll learn it soon enough.

-------------------------
"It's Dangerous to go alone. Take This!"
The Old Man

https://www.youtube.com/channel/U...


Edited: 06/30/2019 at 08:06 PM by oleSchool

Jun 30 at 8:14:26 PM
dougeff (13)
avatar
< Eggplant Wizard >
Posts: 349 - Joined: 12/29/2015
Profile
One of the downsides to YY-CHR is that it can't change the size of a file. So you need to start with a file of correct size.

8192 or 0x2000 bytes. Which is 2 sets of 256 tiles.

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


Edited: 06/30/2019 at 08:15 PM by dougeff

Jun 30 at 9:06:34 PM
oleSchool (0)
avatar
(Jonathon Wright) < Little Mac >
Posts: 72 - Joined: 11/02/2011
Hawaii
Profile
@dougeff

Thanks! I'll definitely make sure that happens from now on. The file that KHAN Games gave me was 8K, so what I did is downloaded it. Then made a copy of it to use for my games, now I'll always have a 8Kb chr file I can use as my blank template. 

Definitely still learning alot about yy-chr though. 

-------------------------
"It's Dangerous to go alone. Take This!"
The Old Man

https://www.youtube.com/channel/U...

Jul 01 at 9:08:59 AM
KHAN Games (89)
avatar
(Kevin Hanley) < Master Higgins >
Posts: 8124 - Joined: 06/21/2007
Florida
Profile
Originally posted by: oleSchool

@dougeff

Thanks! I'll definitely make sure that happens from now on. The file that KHAN Games gave me was 8K, so what I did is downloaded it. Then made a copy of it to use for my games, now I'll always have a 8Kb chr file I can use as my blank template. 

Definitely still learning alot about yy-chr though. 

Creating a blank 8kb file to use for graphics was one of the hardest things to figure out how to do when I started programming a decade ago. The files I use today are still direct copies of the original one I started using back then. At some point I split it in half with a hex editor so that I can swap background or sprites while retaining the other 4kb. Anyway, happy to help. And thanks for the kind words about the video. Mike's youtube stuff is awesome!

Keep the questions coming as they pop up. We're here for ya.
 

-------------------------

gauauu: look, we all paid $10K at some point in our lives for the privilege of hanging out with Kevin


Jul 01 at 2:31:09 PM
oleSchool (0)
avatar
(Jonathon Wright) < Little Mac >
Posts: 72 - Joined: 11/02/2011
Hawaii
Profile
Originally posted by: KHAN Games
 
Originally posted by: oleSchool

@dougeff

Thanks! I'll definitely make sure that happens from now on. The file that KHAN Games gave me was 8K, so what I did is downloaded it. Then made a copy of it to use for my games, now I'll always have a 8Kb chr file I can use as my blank template. 

Definitely still learning alot about yy-chr though. 

Creating a blank 8kb file to use for graphics was one of the hardest things to figure out how to do when I started programming a decade ago. The files I use today are still direct copies of the original one I started using back then. At some point I split it in half with a hex editor so that I can swap background or sprites while retaining the other 4kb. Anyway, happy to help. And thanks for the kind words about the video. Mike's youtube stuff is awesome!

Keep the questions coming as they pop up. We're here for ya.
 

Thats awesome to know I’m not the only one who had to do this haha! 

Many thanks on the offer to help, NintendoAge folks seem very willing to do that and that’s why I come here. 

I could ask ask a bunch more questions honestly , but I learn better when I figure it out on my own, but this time I got stuck lol.

im sure I’ll be back many times though, this stuff isn’t easy. If you could I’d like to get some sort of nesasm reference guide to the use of all the nonopcode function / declarations like .dw, .db, .org, .bank, etc. I’m learning them but having documentation would be better and I can’t find any. 

Thanks!

OleSchool  

 

-------------------------
"It's Dangerous to go alone. Take This!"
The Old Man

https://www.youtube.com/channel/U...