Page 1 of 1
Really Noob question
Posted: Tue Feb 09, 2010 5:52 pm
by mattheweston
I understand that you code a game in assembler, but how do you get from that to the .Rom file that you can play on an emulator?
Posted: Tue Feb 09, 2010 5:57 pm
by GradualGames
You use one of several freely available tools called assemblers. They read your assembly language text file (you can create one in any text editor like notepad for example) and transform it into a file containing nothing but opcodes that an NES can understand (this is the ROM). I'm not sure from your post what your background is, but you should feel free to ask any and all questions you might have if you are interested in learning NES programming. There are tons of people here who are very knowledgeable and helpful.
Re: Really Noob question
Posted: Tue Feb 09, 2010 6:15 pm
by tokumaru
mattheweston wrote:I understand that you code a game in assembler
Just to clarify: The name of the language is "assembly", "assembler" is the program that converts assembly programs into machine language.
but how do you get from that to the .Rom file that you can play on an emulator?
Like Gradualore said, you use an assembler, which converts the source code into machine language. However, assemblers don't output valid NES ROMs by themselves (seeing as they can be used for various machines that use the same CPU, not only the NES), so it's your responsibility to make sure that the output file has a valid iNES header, all the PRG-ROM banks in order, followed by the CHR-ROM banks (if any). If you don't obey the structure, emulators will not recognize your file as a NES ROM.
Posted: Tue Feb 09, 2010 6:26 pm
by mattheweston
I hold a BA in comp sci having took a class in Assembly language programming. I guess I was a weirdo as I actually loved programming in Assembly. =)
Posted: Tue Feb 09, 2010 6:34 pm
by tokumaru
mattheweston wrote:I guess I was a weirdo as I actually loved programming in Assembly. =)
We're all weirdos here, assembly is fun as hell! =D
Posted: Tue Feb 09, 2010 8:24 pm
by GradualGames
If you've got a solid programming background and know a bit of assembly I'd recommend
Micahel Martin's NES 101 tutorial to get started (if that's what you're looking for). He has a complete program in there that shows you all the basics (well perhaps not all, but enough of), and even includes an assembler written in perl called P65.
Posted: Thu Feb 11, 2010 9:00 pm
by mattheweston
So any assembler that can "assemble" 6502 code will work?
Posted: Fri Feb 12, 2010 5:47 am
by tokumaru
mattheweston wrote:So any assembler that can "assemble" 6502 code will work?
Yes. You just have to make sure that they output a file that respects the structure of a NES ROM. NES ROMs contain a 16-byte header, followed by the PRG-ROM banks and then the CHR-ROM banks (if the game uses CHR-RAM there are no CHR-ROM banks in the ROM).
Posted: Tue Mar 09, 2010 11:29 pm
by ehguacho
try NESASSEMBLER, it's the most common assembler used to get your .asm game program into a .rom file
Posted: Wed Mar 10, 2010 1:43 am
by Jeroen
^^i'm gonna have to disagree and say that "asm6" is probably the better program

Posted: Wed Mar 10, 2010 2:57 am
by tokumaru
Yeah, if you haven't picked an assembler yet, don't start out with NESASM, please. The only excuse for using NESASM is if you started learning from a tutorial that used it and are already spoiled by it, but if you have the choice, don't go with it, or you'll soon find yourself wanting to switch to something else.
Please pick anything but NESASM. ASM6 is probably at the same level of complexity (i.e. very low, you can get a ROM ready without hassle), but it's much less buggy and much more versatile.