It is currently Sun Oct 22, 2017 9:36 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Thu Jun 09, 2016 3:49 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1787
Location: DIGDUG
First, I want to make sure you get this bit right...
The reason this is suspicious...
Code:
.inesprg 1   ; 1x 16KB PRG code

  .bank 0
  .org $A0E6


Is because you're clearly using 2 banks of PRG, and it should start at $8000...

Something like this...
Code:
.inesprg 2   ; 2 x 16KB PRG code

  .bank 0
  .org $8000


And maybe some more 'bank' directives, since nesasm complains when you put more than $2000 bytes in a single 'bank'.

Code:

 .bank 0

  .org $8000

 .bank 1

  .org $a000

  .bank 2

  .org $c000


 .bank 3

  .org $e000

 .bank 4

 ;inc graphics file here



I can't remember, it's been a while since I used nesasm.

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


Last edited by dougeff on Thu Jun 09, 2016 5:18 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Jun 09, 2016 3:56 pm 
Offline
User avatar

Joined: Sat Jul 25, 2015 1:22 pm
Posts: 501
Mind if I suggest a quick change to ASM6? I don't think you'd have to modify anything other than your headers and we can help you set those up. (It looks like they need to be modified anyway)

NESASM has a lot of bizarre quirks and it's not really preferred around here. It's a bit easier to get help with a more familiar assembler.


Top
 Profile  
 
PostPosted: Thu Jun 09, 2016 7:17 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3471
Location: Indianapolis
dougeff wrote:
And maybe some more 'bank' directives, since nesasm complains when you put more than $2000 bytes in a single 'bank'.


Actually it's even worse, when you overflow a bank, NESASM will build the ROM without giving any error or warning about it. I was dealing with that kind of fun stuff recently, helping someone with their project. When it comes to error messages (or lack of), working with NESASM can be a real nightmare. With NESASM 3 (one of them anyways*) you actually can put more than $2000 bytes in a bank, but if you don't do it right, you're screwed (no error or warning, just a hosed ROM).

*And to make things even more fun, there are 2 different branches of NESASM with different extensions people have added, and I think they have the same version number.. good luck. :P


Top
 Profile  
 
PostPosted: Thu Jun 09, 2016 7:36 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5732
Location: Canada
mariogamemaster wrote:
1. Write $00 to all RAM at $0000-$07FF and $6000-$7FFF.
...
7. Call the music INIT routine.


The code that clears RAM is at the location clrmem: in your code. This has to be done before you call INIT. If you clear RAM after INIT, you're erasing all the work the INIT routine just did and it's like you didn't call it at all.

Also note that the "clrmem" section is filling the region at $0200 with $FE instead of $00. This was for the OAM region at $200 which you have moved to $700, so you've got to swap what you're doing to these two locations. (i.e.: change the line that says STA $0700, x to STA $0200,x and vice versa.)


Memblers wrote:
...when you overflow a bank, NESASM will build the ROM without giving any error or warning about it.

This specifically is why I called it the "worst assembler I have ever used" in another thread. ;)

For mariogamemaster, though, this problem means that when you .incbin your NSF, it's likely that NESASM will silently cut off part of the file, ruining it.

Another piece of advice, instead of trying to remove 128 bytes from the beginning by hand, you might just put -128 on the end of your .org statement at the LOAD address, and include the original NSF file. (You don't need to save that 128 bytes of space.) By shifting the starting address back 128 bytes, you'll put the start of the data where it needs to be.


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

All times are UTC - 7 hours


Who is online

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