It is currently Fri Oct 20, 2017 11:55 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Emulator files
PostPosted: Mon Jun 13, 2016 4:57 am 
Offline

Joined: Tue Sep 27, 2011 8:20 pm
Posts: 23
Hey guys,

I am new to programming for the NES (but not to programming).

After I write an ASM program and the assembler outputs an ASM file, or EEPROM file, or whatever, how do I get the file into a format that the emulator understands? I know an emulator does just that; it emulates the hardware. So if I feed it whatever the assembler spits out, does it think it's a NES ROM, or do I have to convert it into something else first?

I want to use Nestopia for my emulator if that helps.


Top
 Profile  
 
 Post subject: Re: Emulator files
PostPosted: Mon Jun 13, 2016 5:41 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
1. The assembler will output a binary file of sorts, not an .asm file. The assembler reads an .asm file.

2. The answer depends on what assembler you're using. Several of the "simple" ones just require that you add the raw 16-byte .NES header either through .db statements in the .asm file, or by pre-creating it (say, in a hex editor) and prepending it to your binary file (ex. asm6 mygame.asm mygame.bin followed by copy /b header.bin + mygame.bin mygame.nes). You can read about the NES file format here. Don't worry about the "NES 2.0 header" crap, it's overkill for getting started. One may look something like this (see the code block in that post, not the attached files).


Top
 Profile  
 
 Post subject: Re: Emulator files
PostPosted: Mon Jun 13, 2016 6:29 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19113
Location: NE Indiana, USA (NTSC)
Which assembler are you using? ca65, asm6, or NESASM? The subtleties differ among the three. But if you have correctly configured asm6 or NESASM, the assembler will output a .nes file for use in your emulator. Or if you have correctly configured ca65, the assembler will output .o files, and then ld65 links those into a .nes file for use in your emulator.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Ti_ and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group