Total newb

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

arfink
Posts: 64
Joined: Fri Apr 28, 2006 7:07 pm
Location: MN, USA

Total newb

Post by arfink »

OK, here goes nothing. I have never programmed in assembler before, and the extent of my NES hacking has gone about as far as making a couple NROM mapper eprom carts with ROMS on them from teh internets. I want to learn how to make something of my own for the NES. Where should I start? My current programming knowledge consists of mostly very old variants of BASIC like Tandy 102 basic and Applesoft. I don't know any C either. Any suggestions?
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

Start with a program that clears the screen, then displays "Hello World" on the screen.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
MottZilla
Posts: 2835
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

You'll also need to learn about the 6502 CPU. http://www.6502.org has alot of information.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Keep reading a 6502 doc and a NES doc over and over, until they make sense. It may take a while! =) You'll know when it's the time to try coding.

If something makes absolutely no sense to you, you can ask about it here, but you have to show some effort, because no one likes to help lazy people. :D
arfink
Posts: 64
Joined: Fri Apr 28, 2006 7:07 pm
Location: MN, USA

Post by arfink »

No kidding. Just wanted to get some ideas of where to begin. With Applesoft it was pretty obvious where to start, but Apple is like that. (or was...)

Alrighty then, I'll get to it. Thanks guys!
User avatar
noattack
Posts: 147
Joined: Tue Feb 13, 2007 9:02 pm
Location: Richmond, VA

Post by noattack »

Also, head over to nintendoage.com, check out the 'Brewery' section of the forums, and read through the 'Nerdy Nights' tutorials. In conjunction with the resources on this site, you'll start to get your bearings. Good luck!
User avatar
Memblers
Site Admin
Posts: 3901
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

Learn numbering systems like hex and binary. Know how to use a hex editor.

The first thing I did was find source code that I could assemble, and started messing around with that. I'd say to jump right in. I had no programming background when I started, other than (ab)using QBASIC.

And as for C, it's a language where you describe to a compiler the assembly code you want it to create. It's a generic description of assembly, you won't need to know it.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Memblers wrote:And as for C, it's a language where you describe to a compiler the assembly code you want it to create. It's a generic description of assembly, you won't need to know it.
But you should know at least one language used for making PC programs, even if only to make the tools for converting data to be used by your NES programs.
arfink
Posts: 64
Joined: Fri Apr 28, 2006 7:07 pm
Location: MN, USA

Post by arfink »

Thanks guys.

@tepples: FreeBasic or Python, problem solved.

@memblers: sounds good, number systems I should be able to figure out without much trouble. Then I'll begin by hacking around with other people's code

@noattack: thanks for the info, I'll look into that too.
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

tepples wrote:But you should know at least one language used for making PC programs, even if only to make the tools for converting data to be used by your NES programs.
Celius and Memblers seem to like making their tools for the NES itself. After all, if we use PC tools to make PC programs, why not on the NES? =)

Seriously, I know that some things just can't be done on the NES. My BMP to level map converter is a pretty good example, as it works with images as big as 20MB. and editing everything tile by tile on the NES would be a pain in the ass.

So yeah, I agree that knowing how to program for a PC does help a lot.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

I liked the idea for editing small levels, but like you said, there are some things it doesn't work for. Visual Basic seems to offer lots of potential with easy drag-and-drop functionality for making the layout of the program.
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

If you have a chance, try this 6502 simulator here. This is very useful for testing how your code react when you start to learn this language.

I used it a few time to debug some code and I could see which register were affected, trace it, find where the bug was.

Now what I want is a Nes simulator :)
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

tokumaru wrote:Celius and Memblers seem to like making their tools for the NES itself. After all, if we use PC tools to make PC programs, why not on the NES? =)
There are a few problems with that:
  • Sometimes you have to use floating-point math and transcendental functions such as cos() and exp() to make frequency lookup tables for music players or trig lookup tables for aiming code. Those are part of the C standard library on PCs, but not everybody wants to try extracting them from the version of Applesoft BASIC that comes with AppleWin just to use them in an NES program.
  • PC-based tools can close themselves automatically when they finish, allowing use from within makefiles. Which major NES emulator lets the emulated ROM cause the emulator to either exit or load a different ROM?
  • You still have to extract the completed data from SRAM in order to put it into your finished ROM.
Banshaku wrote:Now what I want is a Nes simulator
Does FCEU-ABCSOUP comes close?
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

tepples wrote:Does FCEU-ABCSOUP comes close?
I don't know what you mean by FCEU-ABCSOUP. Do you mean all flavor of FCEUltra? Sorry, I'm just not used to this expression.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

FCEU-ABCSOUP refers to the alphabet soup of FCE Ultra debugger mods: FCEUD, FCEUXD, FCEUXD SP, FCEUX, etc. Readers can substitute their favorite.
Post Reply