It is currently Mon Jun 26, 2017 11:51 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Fri Feb 24, 2017 4:46 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 590
Location: Sweden
DementedPurple wrote:
So how would I tell it what TV System, would I just give the name, would I have to use some quotation marks, would I just give it the name with no quotation marks, or does a number stand for that.

In my example the header is set to NTSC. If you want to change to PAL you would just change the third line:
Code:
TVSYSTEM  = $00 ;$00 = NTSC, $01 = PAL

into
Code:
TVSYSTEM  = $01 ;$00 = NTSC, $01 = PAL


I set up the three constants PRG_COUNT, SCROLL and TVSYSTEM so that I can quickly change them if I want to without messing with the header.
Note that SCROLL is the same thing as what is popularily called "nametable mirroring" (but mirroring is backwards: H-Scroll is Vertical Mirroring and V-Scroll is Horizontal Mirroring).

The wiki explains iNES and NES 2.0 headers.


Top
 Profile  
 
PostPosted: Mon Feb 27, 2017 8:42 am 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 262
Location: Colorado USA
I haven't been following a tutorial, I've been reading a book from the eighties.


Top
 Profile  
 
PostPosted: Mon Feb 27, 2017 10:25 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1601
Location: DIGDUG
Is it this one?

http://www.atariarchives.org/mlb/

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Tue Feb 28, 2017 10:53 am 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 262
Location: Colorado USA
dougeff wrote:

Yeah.


Top
 Profile  
 
PostPosted: Fri Mar 03, 2017 9:14 am 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 262
Location: Colorado USA
Would the ines header for the original NESASM assembler work with the newer NESASM3?


Top
 Profile  
 
PostPosted: Fri Mar 03, 2017 10:03 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 9757
Location: Rio de Janeiro - Brazil
The problem with building an NES game based only on a 6502 book it that the language is just one little piece of the puzzle... It's kinda like saying "I want to write a book about astrophysics in French": sure, you'll have to learn French in order to actually write the information down, but you do have to master the astrophysics too.

If you have previous game programming knowledge from other projects on other platforms, great, because these concepts (maps, objects, physics, AI, etc.) are generally the same no matter the platform. If you don't, these are subjects you should be researching as well.

As for the hardware-specific stuff, such as video, audio and input, knowledge of other platforms helps a lot too, since being familiar with the general concept allows you to simply look at the documentation (wiki) to know the specifics. If you don't yet know how old computers work (memory mapping, memory-mapped IO, mirroring, interrupts, timing, tiled graphics, etc.), a tutorial might gradually introduce these topics.


Top
 Profile  
 
PostPosted: Sat Mar 04, 2017 1:15 pm 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 262
Location: Colorado USA
So I've used every single 6502 assembler out there, And used an example iNES header for every one, and still, none of them work.


Top
 Profile  
 
PostPosted: Sat Mar 04, 2017 1:30 pm 
Offline
User avatar

Joined: Wed Oct 16, 2013 7:55 am
Posts: 115
DementedPurple wrote:
So I've used every single 6502 assembler out there, And used an example iNES header for every one, and still, none of them work.


Having made multiple NES games, I can assure you they *do* in fact work, you're just doing something wrong. If you are seeking help, you need to say what you've already tried, and what errors or unexpected behavior you're seeing.

https://opensource.com/life/16/10/how-a ... -questions


Top
 Profile  
 
PostPosted: Sat Mar 04, 2017 1:33 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 9757
Location: Rio de Janeiro - Brazil
The simplest possible way to build an iNES header is to use NESASM and its iNES directives. The second simplest way is to use ASM6 and build the header using .db statements (following the specification from the wiki) right before the .org $8000 statement that starts the PRG-ROM. The third way is to use ca65 and create a segment for the header, that you can fill using .byte statements.

You can download any NES program with source code written for any of these assemblers to see how the iNES header can be generated.

Edit: my old ASM6 templates demonstrate one way to get ASM6 to output correctly formed NES ROMs for a few different mappers, header included.


Top
 Profile  
 
PostPosted: Sat Mar 04, 2017 3:03 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1601
Location: DIGDUG
Quote:
none of them work.


Have you been able to assemble anything (even a broken output file)?

For example, using asm6, write a text file with the conetents....

LDA #01

And asm6 should assemble it into a 2 byte .bin file, when viewed in a hex editor should look like (A9 01).

Can you confirm this much. This is my definition of "works". Also, don't give up yet. I'm an idiot, and I made an NES game. It's doable.

Perhaps you should visit the IRC #nesdev channel and ask more questions there.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Sat Mar 04, 2017 4:48 pm 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 262
Location: Colorado USA
I get an accurate binary file, but the problem comes when I try to run it in an emulator. All I get is an error message saying "Corrupt file". The emulator I'm using is Nestopia.


Top
 Profile  
 
PostPosted: Sat Mar 04, 2017 5:19 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1601
Location: DIGDUG
That's the information I was looking for. The assemblers work, but you don't know how to assemble a functional NES ROM.

I suggest you start by taking some existing (working) example code, and assemble that. Nerdy Nights. Then modify it to learn / try things.

The most standard ROM (NROM256) is...

16 bytes header
32768 bytes program code
8192 bytes graphics.

40976 bytes exactly, total.

You need to write a header that says 2 banks PRG and 1 bank CHR and mapper 0, for that to work.

With a correct header and sized file, you will get a gray screen that does nothing, even if everything else is filled with zeroes.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Last edited by dougeff on Sat Mar 04, 2017 6:10 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Mar 04, 2017 5:47 pm 
Offline

Joined: Mon Jan 30, 2017 5:20 pm
Posts: 262
Location: Colorado USA
So I split the CHR and PRG data from a Super Mario Bros. ROM and removed the original iNES header. Now is there a way I could turn the binary file to a text document that can be compiled?


Top
 Profile  
 
PostPosted: Sat Mar 04, 2017 6:06 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 9757
Location: Rio de Janeiro - Brazil
Disassembling binary code back into assembly code is not a trivial thing to do (it may take months or even years to get something usable, depending on the complexity of the game), so this is not a very good approach.

If you want to experiment with existing sugar, use proper source code that's been officially released by the original author.


Top
 Profile  
 
PostPosted: Sat Mar 04, 2017 6:30 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1601
Location: DIGDUG
Try one of these...

viewtopic.php?f=22&t=12847

The newest version (0.4), and the asm6 source code.

EDIT, note this is a NROM 128 example.
16 bytes header
16384 bytes program...defined as 1 bank in the header
8192 bytes graphics...defined as 1 bank in the header
24592 bytes total.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 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