The Legend of Zelda Optimum is an optimization patch for The Legend of Zelda. It converts the ROM to MMC5, and its graphics format to CHR-ROM.
This patch is to be applied to the English version, The Legend of Zelda, not the Japanese version, Zelda no Densetsu. This hack was only tested on FCEUX 2.2.2. It was not tested on other emulators. Please see readme for details.
ZeldaTech (Overworld Editor) and DungeonMaster (Dungeon Editor) have been tested to work with this ROM.
According to the author, this is now the most enhanced Zelda ROM to work with, and is definitely recommended to anyone wanting to hack this game.
ROM: The Legend of Zelda
Hack: The Legend of Zelda Optimum
Author: RetroRain
Time Span from Start to Finish: On and off for about 2 weeks
Release Date: September 09, 2015
This patch is to be applied to the English version, The Legend of Zelda, not the Japanese version, Zelda no Densetsu. This hack was only tested on FCEUX 2.2.2. I have not tested it on other emulators.
The Legend of Zelda Optimum is an optimization patch for The Legend of Zelda. What it does is convert the ROM's mapper to MMC5, and its graphics format to CHR-ROM.
Both the PRG-ROM and CHR-ROM have been expanded, maxed out to the new mapper's limits. The total size of the ROM is now 2MB.
Having done this hack, I can tell you right now that Zelda has a lot of free space in it, more so because of the conversion to CHR-ROM and the expansion of the PRG-ROM, however, there is very little free space in the hardwired bank ($C000 - $FFFF). I wound up putting some of my mapper prep code in a switchable bank. If you want more free space in the hardwired bank, you'd have to move some of the game's original code over to one of the switchable banks. You can get away with doing this for code that is only executed once, like startup code.
The bankswitch routine is located at $FF43. So, in order to switch a 16K bank from $8000-$BFFF, all you have to do is load a bank number and JSR to $FF43.
Example:
LDA #$02 ; Jump to bank 02
JSR $FF43
The CHR-ROM setup I chose for this hack is 2K page-switching. It made the most sense, if you observe how the original game loads its graphics into the pattern tables. There is so much free CHR-ROM space in this game that it's not even funny! :P Shortage should not be a problem.
Please note that since this game is now using MMC5, if you exceed the #$FF limit of CHR pages, you will simply have to increment $5130 by 1, to access the next section of CHR pages. If you have any questions about $5130 or MMC5 in general, feel free to ask at acmlm.kafuka.org or www.romhacking.net.
The CHR page addresses are as follows:
$100 Top-Left 2K Page (Sprites)
$101 Bottom-Left 2K Page (Sprites)
$102 Top-Right 2K Page (Sprites)
$103 Bottom-Right 2K Page (Sprites)
$104 Top-Right 2K Page (Background)
$105 Bottom-Right 2K Page (Background)
$106 Current Bank loaded into $8000-$BFFF
Now let me explain some things.
Zelda uses 8x16 sprite mode. Before explaining it for MMC5, let me explain how it works in the original game.
Because Zelda uses 8x16 mode, both the left and right side of the pattern table CAN be used for sprites, but ONLY the right side of the pattern table is used for the background graphics. A quick example is if you let the story screen run, and once you see the items scrolling, pause the emulation, and try to find the small heart in the pattern table. All of the items are sprites, and the sprites in Zelda are on the left side of the pattern table. If you look hard on the left side of the pattern table, you will find that the small heart is no where to be found. But, you can find it on the bottom of the right side of the pattern table. And the right side is for the background graphics of the game. That is because in 8x16 sprite mode, 2 tiles are used for a single sprite. Which means, all tiles can be used as sprites if need be. Although from what I can see by playing Zelda, just that small heart from the background side is used for the story screen. If you don't understand 8x16, feel free to ask on the forums.
That being said, FCEUX's PPU Viewer may be useless to you when looking at the graphics for the game. Fortunately, Zelda doesn't use that many graphics tiles to begin with.
When you want to change the background graphics, ALWAYS write to at least 2 addresses. So if you write to $102, be sure you write that same number to $104. And if you write to $103, make sure to write that number to $105 also. This will ensure that the original game's graphics are being loaded into the pattern table, but you are also loading the "background" graphics, which are separate from the "sprites".
If you are confused, just open up the RAM Viewer in FCEUX, and play with $100-$105 to see what I mean.
With MMC5, there is an extra pattern table that is not being shown, which is for the background graphics, and yet it is the background graphics which are shown in the PPU Viewer. That is because of how the MMC5 mapper handles 8x16 mode, which makes the patern table useless. Well, not entirely useless, as you do get to see what background graphics are loaded. Simply put, MMC5 + CHR-ROM + 8x16 Sprite Mode breaks the PPU Viewer.
1st Quest Dungeon Enemy CHR Table is located at 0xC15D.
2nd Quest Dungeon Enemy CHR Table is located at 0xC166.
Both tables have the same values, but if you need to change them (like if you want a different set of enemies in your dungeon), you can.
I couldn't find a PRG-ROM bank RAM address at first glance, which tells you which bank is loaded into $8000-$BFFF, and I didn't feel like going crazy looking for one either, so I just had my bankswitch routine write to $106 before bankswitching, so if you ever want to know which bank is loaded, $106 will tell you! :)
If you have any questions, just ask on the forums. But as it stands, this is now the most enhanced Zelda ROM to work with! :D
If you wish to use this patch as a base for your Zelda hacks, please credit me for my work. Thank you.
~RetroRain
acmlm.kafuka.org
Legend of Zelda, The (USA).nes - NOINTRO
CRC32: 3FE272FB
MD5: D9A1631D5C32D35594B9484862A26CBA
SHA-1: DAB79C84934F9AA5DB4E7DAD390E5D0C12443FA2
SHA-256: 8F72DC2E98572EB4BA7C3A902BCA5F69C448FC4391837E5F8F0D4556280440AC