Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /storage/content/49/145849/famitracker.com/public_html/forum/classes/dbHandler.php on line 29 FamiTracker
Login:
Menu:
Post: Author:
FamiTracker > General > Bug Reports & Feature Requests > BIN export broken? Owner: rainwarrior New post
Page 1 of 1 Sort:  
BIN export broken? Posted: 2013-02-13 00:46 Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#44426
I cannot seem to make a working NSF/NES from a BIN export + NSF driver anymore. This appears to have started with 0.4.1, and continues with 0.4.2

I am using the process I described earlier here:
[url=http://famitracker.com/forum/posts.php?id=3681]http://famitracker.com/forum/posts.php?id=3681

It compiles fine, but nothing plays, and depending on the data in music.bin it seems I get a bad opcode now and then. Not sure what is going on.

Has anyone else tried bin export? jsr, are you able to build a working NSF/NES from BIN?

Posted: 2013-02-13 00:55  (Last Edited: 2013-02-13 01:08) Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#44428
Oh! Interestingly, the ASM export seems to work fine.

Since ASM should be the same as BIN, fixing this should just be a matter of figuring out what's different in the produced BIN, perhaps the pointer linkages are broken?

Edit: looking at the ASM, it seems that the pointers are all absolute. Weren't they relative, previously? I used to be able to locate a BIN wherever I wanted in the ROM-- are they now tied to a specific location?

Being able to stick several music BINs into one ROM has been an important feature for me in the past, so if this is the case, this might be impossible now. However, the labels in the ASM export solve this problem nicely, so maybe the solution is to drop BIN support entirely, unless it has some other use. Multiple ASMs can be included by using .scope directives.

Also, I have a suggestion. In driver.s, define ft_music_addr inside .ifdef INC_MUSIC, since its definition needs to be removed if you want to redefine it in RAM somewhere (like the comments above suggest).

Posted: 2013-02-13 23:16 Reply | Quote
jsr
Administrator

Avatar

Member for: 5925 days
Location: Sweden
Status: Offline

#44474
I tried BIN export and it seems to work fine here. As you figured out, BIN files are relocatable while ASM is not. So there is a flag in driver.s, named RELOCATE_MUSIC, that must be enabled when BIN files are used.
This should be documented somewhere, I forgot to do that.

Using ASM will remove the overhead introduced by relocation, though it's a pretty small one. The bigger benefit of ASM export is easier debugging and better support for custom bank switching, etc.

Also, that label cannot be moved since the binaries included in famitracker are compiled without INC_MUSIC, but still requires it (its content is filled in by the exporter). But I could include a small example with a song pointer list and that variable in RAM perhaps.

_______________________
Programmer and developer
Posted: 2013-02-14 01:12 Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#44480
Ah okay, with RELOCATE_MUSIC it seems to work fine.

Ah, the suggestion about ft_music_addr was just so that someone can use the NSF driver source without making any modifications to it. That way I don't have to distribute the NSF driver with a source release, or describe modifications to it. Maybe an alternative would be to put something like .ifndef OMIT_MUSIC_ADDR around it, for people that want to define it themselves elsewhere.

Page 1 of 1 Sort: