New to this, where do I begin?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

User avatar
muffins
Posts: 8
Joined: Wed Mar 10, 2010 8:34 pm
Location: Maine

New to this, where do I begin?

Post by muffins »

Hi all. I'm just like anyone that has loved playing NES games since their creation and would love nothing more to make my own as a hobby. I've programmed in C++, BASIC in the BlitzMax IDE, and some assembly using PCSpim (MIPS if you've got a Linux box). I've attempted making my own games with object-oriented languages but never assembly.

My goal is to start out programming NES ROMs that would work on an emulator and then maybe eventually learn how to get them on a cartridge like a PowerPak. I'm very enthusiastic and motivated but I cannot for the life of me sort out what I need to learn and in what order to learn it. I've tried following some tutorials but I always feel like nothing starts from the ground up or they're glossing over details too much. This seems like a great place to start, and so I'm hoping to get some advice from the seasoned veterans here on where to begin and how to progress.
Denine
Posts: 397
Joined: Wed Feb 17, 2010 5:42 pm

Post by Denine »

Did you tried GBA Guy's Tutorial?
http://patater.com/gbaguy/nesasm.htm
Everything is nicely written.
Unfortunelly,there's only one mapper-NROM.
But if you don't plan a long game then it's perfect.
User avatar
muffins
Posts: 8
Joined: Wed Mar 10, 2010 8:34 pm
Location: Maine

Post by muffins »

I actually have tried going through this (this is in fact the only tutorial I've tried to follow) and found that I am not using something that he included correctly or it just doesn't work. I've tried to compile his sample code and I keep getting outlandish errors. Turns out GBAGuy has also disappeared from the internet.
User avatar
Jeroen
Posts: 1048
Joined: Tue Jul 03, 2007 1:49 pm

Post by Jeroen »

DONT USE THE GBAGUY TUTORIAL. It's full of errors and stuff. JUST DONT
Denine
Posts: 397
Joined: Wed Feb 17, 2010 5:42 pm

Post by Denine »

Hm,I've did whole Dizzy Rain with GBA GUY tutorial.
So,it's not that bad I guess.
Hm..so,what kind of errors?
Maybe I'll be able to use your help.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Denine wrote:Did you tried GBA Guy's Tutorial?
The consensus on this board seems to be that NES 101 has fewer errors.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Yeah, please stop recommending GBA Guy's tutorials. From reading them it is clear that he didn't have a good understanding of the platform. His "classes" are full of "I don't know this", "I don't know that", "just do it like this but I don't know why", which shows that he doesn't know what he's talking about. Most of his programs don't work on real hardware because they are all wrong.

Note that I'm not attacking the guy, I'm sure he had the best intentions while writing the tutorials, but he didn't have enough knowledge to do it, so if you want to be a good programmer you shouldn't start learning from code that is just plain wrong.
Denine
Posts: 397
Joined: Wed Feb 17, 2010 5:42 pm

Post by Denine »

So,it's seems I'm Screewed ^^"
Ok,I got it,GBA Guy's tutorials isn't best.
What tutorial(and assembler)is best?
Maybe muffins should start with that.
User avatar
muffins
Posts: 8
Joined: Wed Mar 10, 2010 8:34 pm
Location: Maine

Post by muffins »

So I made it to Day 5 of his tutorial (Link HERE) and tried compiling the code he has on that page using the exact same files as instructed (so our.pal, our.asm, our.bkg, and our.spr are all in the same folder as nesasm.exe) and upon doing a change directory in DOS to the nesasm folder and typing "nesasm our.asm", the assembler clearly tries to run but it says "Can not open input file 'our.asm'!"
User avatar
muffins
Posts: 8
Joined: Wed Mar 10, 2010 8:34 pm
Location: Maine

Post by muffins »

I've been reading through NES 101 and I have no idea what he's talking about in the "Organizing the iNES file" and "The Main Loop" sections. My guess is that I don't know enough of what I should to make it through this tutorial. Apparently I need something more basic. :oops:
WJYkK
Posts: 60
Joined: Thu Dec 24, 2009 12:23 am
Location: Igloo and Bear Land (Canada)
Contact:

Post by WJYkK »

Oh hey, another reason we need a good tutorial on nesdevWiki! You know, the ones where author(s) explain the code as if they completely understand it yet simple enough to explain to the most inexperienced ones.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

muffins wrote:Apparently I need something more basic. :oops:
Do you also need something more visual?

NES programs are commonly distributed in a format originally defined by a now obsolete emulator called iNES. (See iNES on the wiki.) There are three parts to an iNES file: a 16-byte header, the PRG ROM (connected to the CPU), and the CHR ROM (connected to the PPU).
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

muffins wrote:"Organizing the iNES file"
He's talking about how to make a valid NES file, the structure your file has to obey for it to be recognized as a NES program by emulators. NES ROMs have a 16-byte header that describes them, followed by the program ROM banks, followed by the CHR-ROM banks, if any (there is no CHR-ROM data in games that use CHR-RAM). Most of that section is about properly setting up the header.
"The Main Loop"
Games are interactive programs, which means that they have to constantly process input and update the simulated world (move characters, things like that). Since this is a continuous and repetitive process, this logic stays inside a loop, which repeats over and over again.

The "main loop" is where all game-related logic is. It runs once per frame, so that every frame you can read input, react to that input, move the game entities around (little steps at a time), check for collisions and react to them, prepare background and sprite updates, and so on.
User avatar
muffins
Posts: 8
Joined: Wed Mar 10, 2010 8:34 pm
Location: Maine

Post by muffins »

Thanks for the continued help, all :) Something more visual would certainly be nice because a lot of the terminology is meaningless to me if I can't directly relate it to how it fits in with the NES or the game.

I understand what a game is and how one is made using higher-level languages (since I've made a couple basic ones) and I know basics of assembly insofar as a basic instruction set involving logic gates, branches and jumps for program flow, and stores and loads to move data back and forth between memory and the processor. I am by no means a hardcore programmer; I've just dabbled in it and related my undergraduate work in mathematics (my major) and physics (minor) to the programming in order to produce a simple game. I just have no idea how all of this fits in with assembly language and the NES.

I'm currently reading through bunnyboy's NES ASM tutorial and it is the perfect level of reading for me though I feel like I won't be able to do much with it as far as making a game goes once I'm done.
User avatar
MetalSlime
Posts: 186
Joined: Tue Aug 19, 2008 11:01 pm
Location: Japan

Post by MetalSlime »

Here's how I learned NES programming:

I started with bunnyboy's Nerdy Nights tutorials. They are really good at teaching the basics and explaining some confusing things like attributes. I even printed them out so that I'd have them handy to use for reference. I recommend these tutorials to everybody starting out.

After finishing the tutorials, I played around writing my own programs and asking questions here whenever I got stuck. The stuff I wrote was really sloppy and bad, but this stage was really important for me because I got really familiar with 6502 assembly and the NES hardware. You have to get your hands dirty. During this time I also read every new thread posted here in the Nesdev and Newbie forums, even if I didn't understand everything people were talking about at the time. I found that over time more and more of the stuff I read on the forums "clicked".

Once I became familiar with 6502 and the NES hardware, I started tracing commercial games in FCEUXD's debugger to see how the pros did things and this really helped me with organization and writing cleaner code.

Disch's NMI/Frame document was also a big eye opener for me, but it's intermediate/advanced so you should save it until you've mastered the basics of 6502 and the PPU.
Post Reply