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 > Source and development > BIN export guide Owner: rainwarrior New post
Page 1 of 2 Sort: Goto Page: [1] [2] Next >>
BIN export guide Posted: 2012-07-13 22:49  (Last Edited: 2014-01-23 22:22) Reply | Quote
rainwarrior

Avatar

Member for: 3952 days
Location: Canada
Status: Offline

#36763
This is a guide for using the BIN export feature. I've never tried the NES/PRG export, but it appears some people have had problems with it. The BIN export is a bit more versatile, since you can edit the code and add/change whatever you need. This guide should hopefully make it easy to build NSFs and non-bankswitching NES or PRG ROMs.


First, get the software you need:

1. Download the NSF driver source for the version of Famitracker you are using: [url=http://famitracker.com/downloads.php]http://famitracker.com/downloads.php

2. Download the [url=http://www.cc65.org/]cc65 compiler: [url=ftp://ftp.musoftware.de/pub/uz/cc65/]ftp://ftp.musoftware.de/pub/uz/cc65/ (cc65-win32-2.13.3-1.zip)

3. Download my BIN export guide: [url=http://rainwarrior.ca/projects/nes/famitracker_bin_wrapper.zip]http://rainwarrior.ca/projects/nes/famitracker_bin_wrapper.zip


Setup:

1. Unzip the NSF driver to an empty folder you want to work in.

2. Unzip cc65 to that working folder.

3. Unzip my BIN export guide to that folder.


To build a ROM:

1. Open your FTM in Famitracker, choose File > Create NSF...

2. Under "Type of file" choose "BIN".

3. Click the Export button. I believe Famitracker 0.3.7 has a bug that fails to save if you have no DPCM samples. This can easily be fixed by opening an instrument and loading a DPCM sample.

4. After exporting check the progress window for this message:

[quote=Progress]* Samples located at: $C000[/quote]
Make a note of the address used; sometimes it is not $C000.

5. Place the exported music.bin and samples.bin in the working directory.

6. Adjust nes.cfg or prg.cfg so that the DPCM line's start address is the same as what was listed in the progress window.

7. Run build_nes.bat or build_prg.bat, this will create music.nes or music.prg.


And... these should work, if nothing went wrong.

Posted: 2012-07-14 21:36 Reply | Quote
TechEmporium

Avatar

Member for: 4287 days
Status: Offline

#36788
Somebody should sticky this thread; I've saved this for posterity.

Thanks, rainwarrior.

_______________________
Technology: the one thing that's hated & cursed at by all engineers, technologists, scientists & technicians!

(Lousy modern technology! )
Posted: 2012-07-14 21:49  (Last Edited: 2012-07-14 21:49) Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4785 days
Location: Canada
Status: Offline

#36789
No can do, sorry. I can't sticky existing threads (only my own, and only at the time of posting them). jsr would have to do it.

_______________________
Follow me on [url=https://twitter.com/jrlepage2a03]Twitter.
I record (some) NSFs on hardware. Feel free to [url=http://www.famitracker.com/forum/posts.php?id=3633]request a hardware render.
Posted: 2012-07-15 06:25  (Last Edited: 2012-07-15 07:26) Reply | Quote
TheSyntaxSinTax

Avatar

Member for: 3627 days
Location: California
Status: Offline

#36798
Hmm... tried it but still no dice on the PRG.

However, the NES option produces a working NES ROM that works just fine in my emulator.

I tried testing my EPROM chips (M27C512) with a dump from a working PRG and they work perfectly, so it's nothing wrong with my hardware or chip burner.

The DPCMs were marked at $C000, so no changes to the code were needed there.

Yeah, no idea what could be wrong here.

Surprisingly I did manage to get at least some sound out of it through a very bizarre convoluted method. I made a ROM, ran it through ReadNES (http://www.kevinselwyn.com/ReadNES/), and doubled up on the file size so that the PRG would be 64 kilobytes to fill up my whole chip. When played on my system, this produced a low, distorted sound on what sounded like the noise channel.

Maybe there's something wonky with my project file that I don't know about? Any chance you might be willing to take a look at the .ftm, rainwarrior?

Edit: BTW, I'm using the chip in the PRG slot of an NROM-128 board (if that makes any sort of difference whatsoever).

Edit 2:HMMMMmmmm... I just looked at the Info tab in my emulator (Jnes) and it lists the ROM as being Mapper 3. Any chance that might be an issue (last I checked, NROM was Mapper 0, right)? Or should that not effect the PRG?


Attachments:
syntaxsintax_vermillionflash.ftm (12 Kb)
Posted: 2012-07-15 10:02  (Last Edited: 2012-07-15 10:06) Reply | Quote
rainwarrior

Avatar

Member for: 3952 days
Location: Canada
Status: Offline

#36805
I had an error with prg.cfg that was sticking 16 bytes of zeroes at the top of the prg file by mistake. Redownload famitracker_bin_wrapper.zip and hopefully this one will work.

Mapper 3 does not bank switch PRG, so it's an okay substitute for NROM w.r.t. PRG. (CHR is a different story, but obviously not relevant to this project.)

Sorry about the error. I was in a hurry and neglected to check that the PRG was being generated correctly.

Posted: 2012-07-18 08:18  (Last Edited: 2012-07-18 08:47) Reply | Quote
TheSyntaxSinTax

Avatar

Member for: 3627 days
Location: California
Status: Offline

#36874
Hmm... so I tried running the PRG creator batch file with the new .cfg in the folder but still no dice with the 32kb on my 64kb chip. I even tried doubling the file through a batch file (copy /b music.prg +music.prg doubled.prg).

With 32kb I get no sound. When I have the doubled 64kb chip, I just get a monotonous machine gun-like sound from the noise channel.

Any idea what's going on here?

One thing I notice is that your .bat files are referencing "ca65" when the compiler is called "cc65". Perhaps this is definitely the file that you want to reference, but if it's not, I thought I'd make you aware.

Posted: 2012-07-18 18:10 Reply | Quote
rainwarrior

Avatar

Member for: 3952 days
Location: Canada
Status: Offline

#36890
ca65 is the assembler (.s to .o)

cc65 is the C compiler (.c to .s) which is not needed for this

ld65 is the linker (.o to finished binary)

Can you post the PRG you created, which I could try testing myself. Also, what was the original game in this cartridge?

Posted: 2012-07-19 06:46 Reply | Quote
TheSyntaxSinTax

Avatar

Member for: 3627 days
Location: California
Status: Offline

#36920
The NROM cartidge I'm using is the black label Baseball (I figure no great loss to the world with wrecking one of those). It's designated as an NROM-128 on the board.

Attached is both the prg created from the batch file as well as my original ftm, in case that helps.

One thing that I neglected to mention, since I didn't know if it makes a difference or not, is that this file was originally created with an older version of FamiTracker and then resaved with the current version once and it was released. Would that have any effect on how the ROM/Binary info is structured? One possibility might be (as time consuming as it may be) for me to re-create the song from scratch in a new file on the current version of FamiTracker. That is assuming that this is definitely the root of the problem.




Attachments:
syntaxsintax_vermillionflash.ftm (12 Kb)
music.prg (32 Kb)
Posted: 2012-07-19 07:36 Reply | Quote
rainwarrior

Avatar

Member for: 3952 days
Location: Canada
Status: Offline

#36926
I tried the .prg you just linked in my own dev cart and it runs just fine. I think the problem must be with your cart somewhere.

Maybe you want to try one of these: [url=http://www.retrousb.com/product_info.php?cPath=24&products_id=42]$4 ReproPak

They're set up for standard EPROM pinouts already.

Now, from what I've read I don't -think- there's a problem using a 27C512 in an NROM cart as-is, provided you properly duplicate your PRG to fill the ROM, but I have never tried this myself.

Just to be sure, this should duplicate your .prg properly:

copy /b music.prg + music.prg music64.prg

Other than that, I'm not sure what to suggest, but as far as I know this PRG should run fine on an NES.

Posted: 2012-07-19 07:51  (Last Edited: 2012-07-19 07:57) Reply | Quote
TheSyntaxSinTax

Avatar

Member for: 3627 days
Location: California
Status: Offline

#36927
Hmm... so how exactly is your dev cart set up? Do you use the ReproPak or a modified NES cart? What chips do you use? Etc.

I just find it completely bizarre myself. My cart accepts the game's original PRG in the zif slot, as well as copies of the original PRG on the EPROM. If the PRG created from the my FamiTracker files is valid, then there's no reason that it shouldn't work.

It's crazy I tell ya.

Posted: 2012-07-19 07:56  (Last Edited: 2012-07-19 08:02) Reply | Quote
rainwarrior

Avatar

Member for: 3952 days
Location: Canada
Status: Offline

#36928
It's a repropak with sockets for CHR and PRG. I've actually got it set up for AxROM specifically, so I'm using CHR-RAM (62256) and a 256k PRG (27C020), and there's an additional 74HC161 chip for mapping. ([url=https://dl.dropbox.com/u/883356/moon8_proto.jpg]photo) You can also add a CIClone chip (also from retrousb) if your NES is not modded to disabled the lockout chip.

In this case I duplicated the PRG to fill all 256k so that it doesn't matter which bank gets mapped in by the 74HC161.


I use a PowerPak most of the time, though; it's much easier to work with. I built this devcart to do final testing before I started to build a bunch of carts for a project of mine.

Posted: 2012-07-19 08:01 Reply | Quote
TheSyntaxSinTax

Avatar

Member for: 3627 days
Location: California
Status: Offline

#36929
Hmm... so are the chips in the PIC zif socketed? It's hard to tell from that angle.

Posted: 2012-07-19 08:03  (Last Edited: 2012-07-19 08:06) Reply | Quote
rainwarrior

Avatar

Member for: 3952 days
Location: Canada
Status: Offline

#36930
They're just regular IC sockets, not ZIF. I had to cut a hole in the face of the cart to make room for them though.

Also, some of my EPROMs are thicker and end up not fitting under the bar on my NES' cartridge socket. (The one pictured is an OTP EPROM, which fits fine.) I have a Famicom that I use when that comes up, but alternatively you can take your NES apart a bit and remove the cartridge tray.

Posted: 2012-07-19 08:18 Reply | Quote
TheSyntaxSinTax

Avatar

Member for: 3627 days
Location: California
Status: Offline

#36932
As far as NES systems are concerned, I have a NES top-loader, an AV-Famicom, and a Yobo Fc Game Console (one of the early ones that has the Famicom cart slot and comes with a 72 to 60 pin converter). I also have an additional 72 to 60 pin converter for testing on the Yobo and AV-Famicom at the same time. I had a classic "toaster" model for a while which I ditched a couple months ago, since I got tired of connector/lockout chip issues.

One thing I thought about was possibly trying out some other NROM boards. I went out and bought up a whole ton of NROM carts a few months ago on the cheap, so it might be worth my time to experiment with some of the different carts. Maybe there's just something wacky about the Baseball board? I might wanna try that before going with the ReproPak, since those are already bought and paid for.

Posted: 2012-07-20 09:36 Reply | Quote
TheSyntaxSinTax

Avatar

Member for: 3627 days
Location: California
Status: Offline

#36981
I can confirm for 100% fact that this BIN export guide will work for NROM-256 boards with a simple ZIF socket for the PRG slot. No additional rewiring required.

Page 1 of 2 Sort: Goto Page: [1] [2] Next >>