News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Famicom Disk System RAM/Rom Expansion  (Read 1290 times)

darthueba

  • Newbie
  • *
  • Posts: 4
    • View Profile
Famicom Disk System RAM/Rom Expansion
« on: December 01, 2018, 06:13:36 pm »
Do any of you guys know if it's possible to expand the space in a rom for the Famicom Disk System? I ask because I wanna be able to play the Zelda 1 & 2 with the FDS sound, but the fan translations are limited by RAM space, and I'm hoping there's a way to fit the entire original English Script.

Is there any way to do something like this?

Disch

  • Hero Member
  • *****
  • Posts: 2694
  • NES Junkie
    • View Profile
Re: Famicom Disk System RAM/Rom Expansion
« Reply #1 on: December 02, 2018, 01:17:40 am »
Do any of you guys know if it's possible to expand the space in a rom for the Famicom Disk System? [snip] the fan translations are limited by RAM space

RAM expansion?  Or ROM expansion?

RAM expansion is simply not possible.  Sorry.  At least not without hacking up a custom emulator.

"ROM" expansion is possible but probably wouldn't help.  The disks themselves are fixed size, but you can add as many as you need.  The problem is, whenever you want to access new data you have to read it off the disk (slooooow loading times), so you're probably going to be capped by RAM size.

You *might* be able to keep the text compressed in RAM and only decompress it when it's displayed on screen -- but the tradeoff to that is you'd have to keep a decompression routine in RAM... and... given how sparse the text is in these games... it probably would end up costing you more space than it would save.  *MAYBE* you could recycle the map decompression routine to also decompress text -- but I don't know how effective that'd be.


TL;DR:  I'm certainly not going to say it's impossible to fit a larger script in, but it's certainly no small task, and whatever the solution is, it probably does NOT involve expanding the game in any way, but probably involves using the space you have more efficiently.

Truth be told the FDS is kind of a garbage platform, and the Zelda sound effects sound like ear-piercingly awful record scratches anyway, so you're not missing much.



EDIT:

If you want to be REALLY clever... since the text prints super slow in these games anyway (only like 1 or 2 characters per frame) -- and since the game effectively comes to a complete halt during that time.... You probably could just read the data off the disk while it's printing, completely bypassing the need to store it in RAM at all.  You might have a loading spike of a few frames once the text first starts to print, but after that the printing itself would be fine.

..... assuming the player has the correct disk inserted.  If they don't, you have to show the "please insert X disk" prompt and do all that BS.

This is an option, but probably not a very good one.  It was a neat idea, though.  =)

EDIT 2:  This kind of real-time reading off the disk would probably be REAL HARD on the actual disk drive, too, so you probably wouldn't want to do this if this game is going to be played on a real system.
« Last Edit: December 02, 2018, 01:34:57 am by Disch »

Psyklax

  • Hero Member
  • *****
  • Posts: 953
    • View Profile
    • Psyklax Translations
Re: Famicom Disk System RAM/Rom Expansion
« Reply #2 on: December 02, 2018, 05:15:26 am »
If you want to be REALLY clever... since the text prints super slow in these games anyway (only like 1 or 2 characters per frame) -- and since the game effectively comes to a complete halt during that time.... You probably could just read the data off the disk while it's printing, completely bypassing the need to store it in RAM at all.  You might have a loading spike of a few frames once the text first starts to print, but after that the printing itself would be fine.

..... assuming the player has the correct disk inserted.  If they don't, you have to show the "please insert X disk" prompt and do all that BS.

This is an option, but probably not a very good one.  It was a neat idea, though.  =)

EDIT 2:  This kind of real-time reading off the disk would probably be REAL HARD on the actual disk drive, too, so you probably wouldn't want to do this if this game is going to be played on a real system.

Ha, that sounds like a REALLY bad idea. :D In fact, I'd be surprised if it's even possible.

The problem with this request is that you need to understand how the FDS works. The stock NES has just 2KB of RAM, but because it can access 32KB of program ROM and 8KB of character ROM at any time, it's only used for real-time calculations and storing stuff like lives and score and whatever else a game needs to remember temporarily. The FDS, being disk-based (and a particularly slow disk at that), has to load EVERYTHING into RAM, since it doesn't have any ROM (aside from the BIOS, but that doesn't count). So there is 32KB of RAM in the system for the program data, and 8KB for the character data - which makes it essentially the same as a regular Famicom/NES cartridge without any MMC, 32+8KB.

What made the FDS a great idea at the time is that there were no MMCs in use at the time to expand the ROM inside the cartridges, but the disks could store around 64KB per side, for a total of a little under 128KB per disk. Given that the disks were cheaper than cartridges, and could store around 80KB more than regular cartridges, AND could save your game without a battery, AND you could buy new games really cheaply by copying them to a disk using the kiosks in shops in Japan... you could see why it was a great idea. Zelda 1 couldn't have been done on a cartridge at the time.

However, it didn't take so long for MMCs to be used in cartridges to allow extra ROM data to be accessed by the Famicom/NES, and there was no need to load it either. Eventually MMCs had the capability of utilising 256KB of ROM or more, and the use of battery back-up and SRAM in the cartridges increased the possibilities - not to mention extra chips for sound in games like the Japanese version of Castlevania III. Finally, all these games were still perfectly playable on a stock Famicom, so the advantages of FDS evaporated rather quickly, and the system was done.

History lesson over... :) So hopefully by now you realise that the FDS uses disks, not ROMs, and the system has a certain amount of RAM, and that's that. If the hackers couldn't get any more text in the game, it's a pity, but there's not much to be done. It's possible that there could be some compression or whatnot, but really I don't think you're missing much just playing it in Japanese. Zelda 2 certainly has more text, but it's still not much. Maybe one day I'll take a look at it and see if I can do a better job, but for now, it's not a priority.

darthueba

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Famicom Disk System RAM/Rom Expansion
« Reply #3 on: December 02, 2018, 12:17:29 pm »
OK. Thanks for letting me know. I can settle for one of those translation guides and the Japanese version for now. I do admit that i tried to edit the sprites of the text to have 2 letters for every space (for example, an actual "ga" instead of the katakata letter), but even that didn't work because of the limited number of letters. I guess my OCD desire of playing both versions is kinda a losing battle.

Psyklax

  • Hero Member
  • *****
  • Posts: 953
    • View Profile
    • Psyklax Translations
Re: Famicom Disk System RAM/Rom Expansion
« Reply #4 on: December 02, 2018, 04:13:32 pm »
I guess my OCD desire of playing both versions is kinda a losing battle.

I wouldn't say it's OCD: Zelda 2 is actually quite a different challenge from the Western version because of the different levelling system. For the record, I've beaten Zelda 2 multiple times - emulated US version, real hardware PAL version, and the English translation of the FDS version, so it's a topic I'm familiar with. :) I recommend the existing English patch, it's perfectly fine.

I've only beaten Zelda 1 on the US version - as far as I'm aware, there's very little difference with the FDS version.

goldenband

  • Sr. Member
  • ****
  • Posts: 291
    • View Profile
Re: Famicom Disk System RAM/Rom Expansion
« Reply #5 on: December 02, 2018, 04:56:22 pm »
OK. Thanks for letting me know. I can settle for one of those translation guides and the Japanese version for now. I do admit that i tried to edit the sprites of the text to have 2 letters for every space (for example, an actual "ga" instead of the katakata letter), but even that didn't work because of the limited number of letters. I guess my OCD desire of playing both versions is kinda a losing battle.

From what you're describing, I'm guessing Zelda II doesn't use the font that comes with the BIOS? When I was working on a FDS game a while back, with my extremely limited skills, I was partly stymied by confusion over where the fonts were stored until I realized they were being pulled from the BIOS ROM (IIRC).

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6810
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Famicom Disk System RAM/Rom Expansion
« Reply #6 on: December 02, 2018, 09:34:46 pm »
You can tell because the FDS BIOS font is the ubiquitous 1980s (English) game font used in not only almost every early NES game but many games on other consoles and arcade games.
Zelda II (FDS) can't be because it's Japanese (and I think it also had shading like SMB2 (Lost Levels).
"My watch says 30 chickens" Google, 2018

Bregalad

  • Hero Member
  • *****
  • Posts: 2604
    • View Profile
Re: Famicom Disk System RAM/Rom Expansion
« Reply #7 on: December 03, 2018, 03:07:06 am »
As already being said, expanding RAM is impossible and expanding ROM means increasing the number of disks, which is so much a major modification that it'd require extremely deep understanding and reverse-engineering of the game engine to achieve.

However you have to know that many FDS games did not use the maximum of space available on a disk side. Details on the nesdev wiki here.

Quote
Even if the FDS disc side image is always 65500 bytes, one WILL have to subtract all the bits taken by the gaps and CRCs to find the actual disc capacity. In this regard, the way the FDS image is made is not smart because all the bits that were saved by not dumping useless data should be wasted in zeroes at the end of the disc side. In addition to this, the programmer should be very careful for not using the whole disc side in FDS format, otherwise, the data might not fit the disc.

The actual disc capacity in bytes is (N = number of files):

65500 - 28300/8 - (2*N + 1)*(16 + 976)/8

For example, if 8 files are present on the disc, there's room for only 59854 bytes instead of the supposed 65500.

So you can expand files on a disk side until that side is filled up to full capacity. Emulators will most certainly support the disk sides with "extra" space up to 65500 bytes, but this will not work on real disks.