It is currently Mon Sep 16, 2019 1:03 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Mar 23, 2014 7:58 pm 
Offline
User avatar

Joined: Sat Feb 16, 2013 11:52 am
Posts: 330
So, at each compiling the NESASM 3 generates a file with the extension .fns, with the ROM addresses to the program labels. It is formatted like this:
Code:
; main.asm
ResolveMetaAddresses             = $E174
Level_Draw_Loop                  = $E115
MetaTiles_Objects                = $807B
DecodeLevelObj                   = $E124
(...)


How can I use it in FCEUX instead of having to type the addresses manually at the debugger? It is tedious.

_________________
This is a block of text that can be added to posts you make. There is a 255 character limit.


Top
 Profile  
 
PostPosted: Sun Mar 23, 2014 8:06 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21591
Location: NE Indiana, USA (NTSC)
What you need to do is translate that to a .nes.0.nl file. Do you know any PC scripting languages like Perl or Python?

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
PostPosted: Sun Mar 23, 2014 8:14 pm 
Offline
User avatar

Joined: Sat Feb 16, 2013 11:52 am
Posts: 330
tepples wrote:
What you need to do is translate that to a .nes.0.nl file. Do you know any PC scripting languages like Perl or Python?


Nope. Only C. It seems easy enough, but I wouldn't refuse a script that is already done :lol:

Thanks for the heads up.

_________________
This is a block of text that can be added to posts you make. There is a 255 character limit.


Top
 Profile  
 
PostPosted: Mon Mar 24, 2014 1:24 am 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 1042
It looks like it could be done easily enough in AWK or sed just as well (I could do, but do not want to do so at this time).

Of course, you could do it in C, too; you don't need to use AWK, sed, Perl, or Python, to do this.

_________________
.


Top
 Profile  
 
PostPosted: Mon Mar 24, 2014 5:54 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7582
Location: Canada
If it's helpful, I've attached a little python program I use to create FCEUX debug files for my ca65 programs. It should be easy to modify to work with NESASM label files.

Documentation if you need it: http://www.fceux.com/web/help/fceux.html?NLFilesFormat.html


Edit: Python scripts were later disallowed on this forum. Uploading a ZIP with what I think was the original script.


Attachments:
fceux_symbols.py.zip [605 Bytes]
Downloaded 33 times
[The extension py has been deactivated and can no longer be displayed.]


Last edited by rainwarrior on Tue Jun 12, 2018 12:46 pm, edited 2 times in total.
Top
 Profile  
 
PostPosted: Mon Mar 24, 2014 6:07 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21591
Location: NE Indiana, USA (NTSC)
In case it disappears from Dropbox, I've attached it.


Attachments:
fceux_symbols.py.zip [605 Bytes]
Downloaded 114 times

_________________
Pin Eight | Twitter | GitHub | Patreon
Top
 Profile  
 
PostPosted: Thu Aug 15, 2019 7:44 am 
Offline

Joined: Wed Aug 14, 2019 7:53 pm
Posts: 1
Hello friends,

I just found myself in a situation where I thought it would be nice to be able to import NESASM's FNS files into FCEUX, so I took rainwarrior's script and made the necessary adjustments. Please excuse my horrendous formatting and whatnot - just wanted to get it working, and this is also my first time with Python.

It runs as a simple Python script with 1 argument - the FNS file for input. If it finds that file it will then ask you to input the beginning and ending hex addresses of each consecutive bank, then allocate symbols per bank accordingly.

Also given the convention to define variables in RAM using .rs, it looks in that same directory for a file called "Variables.txt" to create the nl file for RAM. "Variables.txt" would just have a bunch of variables declared as such:
;Assumes this comes somewhere after .rsset $0000
var1 .rs 1
var2 .rs 1
var3 .rs 1
;etc etc etc

Cheers,

M


Attachments:
fceux_symbols.py.zip [2.23 KiB]
Downloaded 12 times
Top
 Profile  
 
PostPosted: Fri Aug 16, 2019 7:32 am 
Offline
User avatar

Joined: Tue Apr 04, 2017 1:22 pm
Posts: 38
Location: Ohio, USA
Late to the party here, but this is the script I use to convert my projects (before I started using asm6f). Not sure if it works with multiple banks, I've only ever used it for NROM projects.

Code:
#!/usr/bin/env python3

import sys, re

with open(sys.argv[1], 'r') as fnsfile:
   for line in fnsfile:
      if ';' not in line:
         parts = re.split(r'\s*=\s*', line.strip())
         print('%s#%s#' % (parts[1], parts[0]))

Just paste it in a file like "fns2nl.py" and run it from your favorite command shell like "python3 fns2nl.py inputfile.fns > outputfile.0.nl"

_________________
http://zutanogames.com/ <-- my dev blog


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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