It is currently Wed Nov 22, 2017 12:44 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed May 03, 2017 11:10 am 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 300
Location: Colorado USA
When you look at the graphics of games like Donkey Kong or Super Mario Bros, you would notice that the CHR bank has one bank of 255 tiles for the nametable, and has another 255 tiles for the sprites. How is it able to have them both be on screen at the same time?


Top
 Profile  
 
PostPosted: Wed May 03, 2017 11:21 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10117
Location: Rio de Janeiro - Brazil
DementedPurple wrote:
When you look at the graphics of games like Donkey Kong or Super Mario Bros

Or pretty much every other NES game, really.

Quote:
How is it able to have them both be on screen at the same time?

Because they're referenced in different places. Background tiles are referenced in the name tables, while sprite tiles are referenced in the OAM, so it's possible to point them to different pattern tables. This is completely optional though, since the PPU control register ($2000) lets you choose which pattern table is used for which layer.


Top
 Profile  
 
PostPosted: Wed May 03, 2017 11:46 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10117
Location: Rio de Janeiro - Brazil
Oh, and there's also the case of 8x16-pixel sprites, that can use tiles from both pattern tables. Since 8x16 sprites use pairs of tiles, we can address 256 pairs, or 512 tiles. When sprites are set to 8x16 mode, the sprite pattern table bit is ignored.


Top
 Profile  
 
PostPosted: Wed May 03, 2017 12:54 pm 
Online
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1463
I really think you should start working through an NES development tutorial, like Nerdy Nights or Doug's tutorial.
Your current questions are pretty basic and you could probably answer them yourself if you had a general understanding of the system.

Nerdy Nights:
http://nintendoage.com/forum/messagevie ... eadid=7155

Doug's tutorial:
https://nesdoug.com/

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


Top
 Profile  
 
PostPosted: Wed May 03, 2017 1:05 pm 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 300
Location: Colorado USA
DRW wrote:
I really think you should start working through an NES development tutorial, like Nerdy Nights or Doug's tutorial.
Your current questions are pretty basic and you could probably answer them yourself if you had a general understanding of the system.

I already knew a lot, I'm just making sure I understand what I'm reading. I think I have enough knowledge to reprogram Donkey Kong with my own code. And I don't mean to be rude, but I'm sorry my curiosity annoys you. I doubt you were any better when you were 12 years old. I have a hard time believing you were ever a newbie. I'm just curious about something that I have a passion for, and I'm looking at the pros for help. Imagine if you asked Steve Jobs how a computer works, and all he said was "That's a stupid question". That would be pretty disappointing.


Top
 Profile  
 
PostPosted: Wed May 03, 2017 1:30 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5825
Location: Canada
DementedPurple wrote:
Imagine if you asked Steve Jobs how a computer works, and all he said was "That's a stupid question". That would be pretty disappointing.

Yet completely in character for Steve Jobs.

(Steve Wozniak on the other hand would probably love to explain...)


Top
 Profile  
 
PostPosted: Wed May 03, 2017 1:34 pm 
Offline
User avatar

Joined: Sat Jan 09, 2016 9:21 pm
Posts: 245
Location: Central Illinois, USA
DementedPurple wrote:
I already knew a lot, I'm just making sure I understand what I'm reading.


That's fine. You might ask in a way that explains what you DO know, and explains why you think your answer wasn't answered by the standard docs.

Quote:
I think I have enough knowledge to reprogram Donkey Kong with my own code. And I don't mean to be rude, but I'm sorry my curiosity annoys you. I doubt you were any better when you were 12 years old. I have a hard time believing you were ever a newbie. I'm just curious about something that I have a passion for, and I'm looking at the pros for help.


Your curiosity doesn't annoy us, and we're glad you have a passion for it. Everyone here has been a newbie at some point (heck, I still am). But he's just suggesting that the questions you are asking are clearly explained in a lot of the documentation. (And you might also post it in the newbie help center, where people would expect questions like this)

Quote:
Imagine if you asked Steve Jobs how a computer works, and all he said was "That's a stupid question". That would be pretty disappointing.


That's actually the kind of jerk answer I would have expected from Steve Jobs. (dang, rainwarrior beat me to it)

_________________
My games: http://www.bitethechili.com


Top
 Profile  
 
PostPosted: Wed May 03, 2017 1:55 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1827
Location: DIGDUG
Interesting side note, related to the sprite 0 post. You can change which pattern table the BG uses, mid frame.

Haunted Halloween 85, I think, does this for the title screen. Using one table for 'Haunted' and another for the rest.

https://youtu.be/cGf0ivVHPnU

And furthermore, more advanced mappers can change the entire graphics midframe (with magic).

I'll try to find a link to that later....

Oh right. Punch Out!

Edit-
It uses one tileset for the top of the screen, and then swapping (remapping) tiles midscreen, and using a second tileset for Little Mac and Mario. Yes. Little Mac is background. The only sprites are the opponent (and a tiny sprite on the far right which helps it know when to switch tiles).

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


Top
 Profile  
 
PostPosted: Wed May 03, 2017 2:43 pm 
Online
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1463
DementedPurple wrote:
And I don't mean to be rude, but I'm sorry my curiosity annoys you. I doubt you were any better when you were 12 years old. I have a hard time believing you were ever a newbie. I'm just curious about something that I have a passion for, and I'm looking at the pros for help.

That's not what I was talking about at all. I was talking about the fact that your questions are very basic and could be answered by simply looking them up or by doing a tutorial first.

You don't ask questions that simply indicate a lack of understanding.

For example, if you asked: "How do I update the screen during gameplay? Whenever I update it, the graphics get corrupted", then the answer might be: "You can only update a limited amount of background data per frame because it has to be done during vblank. You cannot update your whole screen every time. You need to design your game in a way that you can do partial updates. If it doesn't work like that yet, you need to redesign your general code."

This is a question that might justify an answer because even though you read the technical documentation, you might not yet be aware of the fact that you have only very few time during vblank.

A question like: "How did SMB do the status bar?" is also quite justified. But as soon as someone points you to sprite 0 split, you shouldn't ask: "What is a sprite 0 split?" Because that's something that is clearly explained in every beginner's tutorial and wiki and can be easily googled.

Likewise, the two CHR banks is one of the most basic stuff: One bank for background, one bank for sprites. (With the option to use the same bank for both.)

Since you're wondering how "Donkey Kong" has two CHR banks on screen, making it sound like this was some kind of special programming trick instead of the very thing that almost every single NES game does, I have to come to the conclusion that you didn't even read the beginner's tutorial. That's why I advised you to do so.

Yes, I have been a newbie myself. And when I asked a question about something very basic and an expert told me: "You will know this as soon as you finished the introduction tutorial", then guess what: I finished the introduction tutorial first. And then did I ask further questions that were still not clear to me. But often, doing the tutorial first already removed a lot of questions from my list.

Don't try to figure out stuff by asking about every single thing piece by piece. Take a tutorial and work through it.
If you have problems with a certain chapter, ask a specific question about that chapter.
If you have a question that wasn't covered yet ("They showed me how to draw the background, but how can I get it to scroll now?"), don't ask yet. Continue with the tutorial until you have finished it. Maybe the topic will come up and you'll learn it anyway.
If it doesn't come up, you have plenty of time afterwards, asking everything that the tutorial didn't cover or that you didn't understand.


And P.S.: Your "How does a computer work" question is not analoguous to the issue at hand. This one here is more about asking how a counting loop in C works: Asking this means you should do a tutorial first. Because you clearly didn't do a tutorial yet. Because if you did, you would know how a loop in C works and wouldn't have to ask.

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


Top
 Profile  
 
PostPosted: Wed May 03, 2017 3:56 pm 
Offline
User avatar

Joined: Wed Oct 16, 2013 7:55 am
Posts: 130
DementedPurple wrote:
I think I have enough knowledge to reprogram Donkey Kong with my own code.


Looking forward to your 2017 compo entry!


Top
 Profile  
 
PostPosted: Wed May 03, 2017 10:16 pm 
Offline

Joined: Fri Sep 30, 2016 8:57 pm
Posts: 15
it's more like steve jobs wrote a book about how computers work, and when you asked him how computers work, he said, "read the book"

curiosity is fine (and commendable) but you should absolutely extend it to reading actual documentation. it will help you. a lot.


Last edited by toggle switch on Wed May 03, 2017 10:19 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed May 03, 2017 10:17 pm 
Offline
User avatar

Joined: Sat Jan 09, 2016 9:21 pm
Posts: 245
Location: Central Illinois, USA
dustmop wrote:
Looking forward to your 2017 compo entry!


Dang it, I want a "like" button on phpBB

_________________
My games: http://www.bitethechili.com


Top
 Profile  
 
PostPosted: Wed May 03, 2017 11:28 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7272
Location: Chexbres, VD, Switzerland
Quote:
Your current questions are pretty basic and you could probably answer them yourself if you had a general understanding of the system.

I completely second what DRW said. This board is not stack overflow, we're not here to build a "database of question", and you're not encouraged to ask a question if you already know the answer. If your question can be answered by reading documenation about hardware (in this case it can) then I don't think it deserve to be asked here. I have nothing against newbie or anything - if you actually tried to do something but didn't understand I'd gladly answer without protesting.

But here you're basically asking "how does register $2000.3 and $2000.4 works" and you're even saying you already know the answer, so this therad is completely pointless. So please do not ask pointless questions - if you want to do so "just to build a database of questions and answer please use https://retrocomputing.stackexchange.com/ or anything else, not this site.

Quote:
I doubt you were any better when you were 12 years old.

I was about this age when I understood the basic working of the NES, and I understood the concept of left and right pattern table very easily - and I had to do so with english doccumentation when I only started learning that language since a single year ! There was much less documentation long ago, no tutorial, no wiki. Only magic kit and nesticle, and Yoshi's docs and the WWWThread forum. So sorry but yes I personally "was any better".

Quote:
Yet completely in character for Steve Jobs.

(Steve Wozniak on the other hand would probably love to explain...)

Not only that, but also I don't think Steve Jobs himself knew much about computers and programmings - he was the marketing guy.

Quote:
Dang it, I want a "like" button on phpBB

Please no, this isn't facebook.


Top
 Profile  
 
PostPosted: Thu May 04, 2017 2:09 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
Stuff like this probably should be the newbie section, but it's not a huge deal.

Even though there is a lot of documentation and tutorials, more than there was in the past, it's still useful to ask about basic things. Especially for a beginner, sometimes you don't exactly know what question to ask, and that makes it hard to look up the answer. As the saying goes, "you don't know what you don't know". A little bit of insight and follow-up questions, if needed, can set someone in the right direction. The newbie section was originally intended for exactly this kind of thing.

I can hardly believe it's been that long, but over the last 20 years I've seen it happen several times where someone young and excited shows up with a lot of questions. It can annoy people, but it's definitely a good thing. I was about 16 when I got into NESdev, and I was very annoying, it's a little embarrassing to think about. :lol: But I learned a lot.


Top
 Profile  
 
PostPosted: Thu May 04, 2017 8:25 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7272
Location: Chexbres, VD, Switzerland
Memblers wrote:
It's still useful to ask about basic things. Especially for a beginner, sometimes you don't exactly know what question to ask, and that makes it hard to look up the answer. As the saying goes, "you don't know what you don't know".

I have absolutely nothing against them asking the questions, but they should ask the smart way, and do a miniumum of preliminary reasearch. If he asked something he tried to understand that'd have been constructive. In this case it's not constructive because the question is trivial, and he even claims he already have the answer.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 11 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