Really Noob question
Moderator: Moderators
-
mattheweston
- Posts: 25
- Joined: Tue Feb 09, 2010 5:48 pm
Really Noob question
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?
- GradualGames
- Posts: 1106
- Joined: Sun Nov 09, 2008 9:18 pm
- Location: Pennsylvania, USA
- Contact:
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
Just to clarify: The name of the language is "assembly", "assembler" is the program that converts assembly programs into machine language.mattheweston wrote:I understand that you code a game in assembler
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.but how do you get from that to the .Rom file that you can play on an emulator?
-
mattheweston
- Posts: 25
- Joined: Tue Feb 09, 2010 5:48 pm
- GradualGames
- Posts: 1106
- Joined: Sun Nov 09, 2008 9:18 pm
- Location: Pennsylvania, USA
- Contact:
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.
-
mattheweston
- Posts: 25
- Joined: Tue Feb 09, 2010 5:48 pm
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).mattheweston wrote:So any assembler that can "assemble" 6502 code will work?
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.
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.