Drawing, Vblank, and NMI - A doc I whipped up

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
Disch
Posts: 1849
Joined: Wed Nov 10, 2004 6:47 pm

Drawing, Vblank, and NMI - A doc I whipped up

Post by Disch » Wed Apr 15, 2009 11:24 am

I wrote this because "how do I use NMI properly" and related seem to be a common question here. And I was bored and needed a break from my other project.

Enjoy:

http://dischmeister.googlepages.com/nesdrawing.html

Celius
Posts: 2157
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius » Wed Apr 15, 2009 12:12 pm

Hey, this is pretty good! I'm glad to see that someone took the time to sit down and explain all this. Good work :) .

frantik
Posts: 339
Joined: Tue Mar 03, 2009 3:56 pm

Post by frantik » Wed Apr 15, 2009 12:22 pm

thanks a lot :) that was a great very indepth review of all the stuff we should know

the only thing i can think of to improve it would be to give examples of buffer loading routines, but i'm sure there's plenty of those about :)

User avatar
Bregalad
Posts: 7966
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Post by Bregalad » Wed Apr 15, 2009 12:36 pm

It's really a very great doccument, it was about time that someone took the effort of explaining all of that clearly. It's really perfect, even I learned something from it.

Oh and when you take the example of the frame being one hour, it'd make it even more sense if you make it being one day. The NMI is your alarm clock, and VBlank is your breakfast time. You have to not make it too long because you have to go to work (that is the work you have to do for the game engine on one frame). When finished, you go back home and sleep until next frame. Also this could explain slowdowns : If you have so much work to do that you haven't finished on morning, your alarm clock would still ring, and you should still take a breakfast, and after that you will return to your work (not begin another). When done you'd be so tired that you'd go immediately to bed (even if it's not night yet) and wait until next morning. Eventually, it can explain what happens when you read $2002, it just acknownledges the alarm clock. If you are constantly fetching it all the night you may not occasionally hear when it rings.
That makes sense in my opinion, but it's free of you to use it or not if you are making another version (the 1 frame = 1 hour example is good enough anyway).

This doc should be uploaded on romhacking.net (if it's not already done).
Useless, lumbering half-wits don't scare us.

User avatar
Jon
Posts: 47
Joined: Fri Apr 03, 2009 10:55 pm
Contact:

Post by Jon » Wed Apr 15, 2009 2:19 pm

Nice doc. Still reading through it, but keep getting interrupted at work. doh!

User avatar
Disch
Posts: 1849
Joined: Wed Nov 10, 2004 6:47 pm

Post by Disch » Wed Apr 15, 2009 4:02 pm

I actually had a lot of fun with this, and already have ideas for some other topics. I'm thinking of doing a doc series in the same vein as the C++ FAQ LITE, but for nesdev. You can sort of tell I even drifted into that style midway through the doc (the topics start turning into questions)

Anyway glad you guys liked it. I'll probably redraft this and organize it better. This actually started as a .txt document and then I quickly converted to html (which is why there's some oddities -- like **emphasis** instead of emphasis)

User avatar
Hamtaro126
Posts: 774
Joined: Thu Jan 19, 2006 5:08 pm

Re: Drawing, Vblank, and NMI - A doc I whipped up

Post by Hamtaro126 » Wed Apr 15, 2009 6:33 pm

Please fix the ''6502 Code'' stuff in that document, it's a tiny mess!

other than that, it's a nice document

User avatar
Banshaku
Posts: 2393
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku » Wed Apr 15, 2009 7:52 pm

This good be a nice candidate for the getting started section of the new wiki (if it ever sees the light of day).

Would it be an issue to post the content on it once it become available?

User avatar
Disch
Posts: 1849
Joined: Wed Nov 10, 2004 6:47 pm

Post by Disch » Wed Apr 15, 2009 8:08 pm

Wouldn't be an issue at all. I'm actually reformatting, reorganizing, and touching it up now. Will be a lot nicer, but will take me a while.

Anyway, yeah, go ahead and use that however you want.

User avatar
Banshaku
Posts: 2393
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku » Wed Apr 15, 2009 8:26 pm

Disch wrote:Wouldn't be an issue at all. I'm actually reformatting, reorganizing, and touching it up now. Will be a lot nicer, but will take me a while.

Anyway, yeah, go ahead and use that however you want.
Great then. I will be more than happy to mention the source since I think that even thought were fighting right now for the license for the content, mentioning who made it doesn't hurt (my stance on the matter). I think it's important to at least mention the people that did the effort to offer such nice content in the first place.

I'm reading it at the moment while working, eh, I mean "while taking my break at work" (Of course boss! I'm studying some "new" design pattern :P) and I like it. I like the example of data structure for the buffer (even thought we don't have to use them like you mentioned) since as a new programmer for the platform, you don't know yet how to do things unless you see those sample and try it for yourself after or have experience for a similar platform/way of programming. This make me things differently on how to do things and I like it. I never saw a "how to" like that for the nes before and this is great news.

Good work!

User avatar
noattack
Posts: 147
Joined: Tue Feb 13, 2007 9:02 pm
Location: Richmond, VA
Contact:

Post by noattack » Wed Apr 15, 2009 9:24 pm

Thanks, Disch. This is great for the slow learners like me.

User avatar
MetalSlime
Posts: 186
Joined: Tue Aug 19, 2008 11:01 pm
Location: Japan

Post by MetalSlime » Thu Apr 16, 2009 12:27 am

awesome document! Thanks a lot Disch.
MetalSlime runs away.

User avatar
Disch
Posts: 1849
Joined: Wed Nov 10, 2004 6:47 pm

Post by Disch » Thu Apr 16, 2009 7:52 am

http://nesdevhandbook.googlepages.com/index.html

It's a start! We'll see how much I can actually get done before getting bored and moving on. XD

User avatar
Bregalad
Posts: 7966
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Post by Bregalad » Thu Apr 16, 2009 8:41 am

Great ! What are the handbook's chapters to come ?

I guess what I wrote about raster effects could be a chapter (html version with demoes).

Other chapters should incude about hardware, PPU fetches, cart types, etc... Probably basic algorithm about how to make a game, collision detection, how to encode maps, basic compression suff.
Useless, lumbering half-wits don't scare us.

User avatar
Disch
Posts: 1849
Joined: Wed Nov 10, 2004 6:47 pm

Post by Disch » Thu Apr 16, 2009 11:20 am

Yeah I was thinking about stuff like that. OAM cycling, compression are things I was already thinking about. I like the idea of touching on collision detection too.

Post Reply