______________________________________________________________________ OVERKILL 32,000 Author: giangurgolo Released: August 13, 2011 ______________________________________________________________________ This is an updated bugfix and modification of the old hack originally titled "Displayable 32766 damage/healing". Includes headered & unheadered patches for the Final Fantasy III (U) (V1.0 & V1.1) [!] ROM. ______________________________________________________________________ DESCRIPTION ______________________________________________________________________ Basically, this patch makes FF6 capable of displaying 5 digits when 10,000+ damage/healing is dealt. Only up to 32000 (#$7D00/#$8300) damage/healing is allowed because of negative numbers using the values 8000-FFFF. Also, since damage is stored as a signed short, only 15 bits are available (the 16th bit is the negative bit, ie. healing). Which is why more than 65535 (#$FFFF) damage is not possible in this scope. This can display anything with 5 digits, though, so if omeone can make a hack moving the healing bits to a different memory address, allowing for this hack to deal up to 65000 damage, it would be welcomed! What it does is squeeze 5 digits into 4 tiles. This is why the digits are of a custom font because the original font would cause an unappealing overlap of digits, making it harder to read. The reason why it is drawn like this and not 5 digits in 5 tiles is due to VRAM issues concerning space partitioning. There is not enough room in the VRAM (nor in the OAM) for a 5th tile to be used since multiple values are stored, forcefully occupying the entire block reserved for damage/healing values. To do this in ASM with 4bpp graphics was not trivial but quite difficult to figure out. I had to revise it twice because the code wasn't efficient enough to prevent an NMI from interrupting it before it was done. Spells that hit multiple monsters (eg. Quake, WWind, Merton) display 5 digits too, and use different routines since it involves showing several damages simultaneously. This was causing interrupt problems, but I put a WAI (wait for interrupt) at the beginning of the new code and it seemed to have fixed it at first. Actually, it only fixed it in Snes9x; not in ZSNES. Disabling the NMI (STZ $4200) instead of WAI finally solved the issue in both emulators. If you get weird effects or invisible results on screen when there's multiple damages/healings it probably has its origins in the interrupt issue. As far as I can tell, that has been fixed but nothing is certain. Special thanks to Imzogelmo for the feedback and beta testing, as well as assassin17 and Terii Senshi for the offsets of the damage truncation and compressed battle numerals. Also credit goes to Novalia Spirit for finding several bugs with the draining spells, HP/MP recovery items, and HP/MP display problems in the battle submenus. ______________________________________________________________________ F.A.Q. ______________________________________________________________________ Q: Why not just use 5 tiles instead of trying to squeeze them into 4 tiles? A: This is what was attempted many times before it was decided it was impossible. There are two reasons why it won't work: 1. The VRAM does not allocate enough space for storing a 5th digit for all of the damages which can be displayed simultaneously on the screen. 2. The OAM does not allocate enough space for storing a 5th digit. Therefore it is probably safer and simpler to continue using 4 tiles for the reasons given. Q: Why only 32000? Why not 99999? A: Total damage/healing is stored in two bytes, and the highest number in two bytes is 65535. Q: Well, why not 65535? A: As inferred in the description above, the highest bit is set for healing. Therefore, the hex values from 32768-65535 are used for healing. In hex, they are negative values and healing is basically negative damage. Thus, anything over 32767 cannot be displayed. Q: Why not 32767? A: Some of the upper values are used for other more obscure things, so it is safer to stick with a nice round number like 32,000. Q: Is it possible to do up to 32000? A: It is very easy. In fact, it has been proven that it is mathematically possible to do over 100,000 damage given the right stats, equipment and spells. Q: What's the point? Isn't 9999 enough? A: On any other game where it is much harder to deal so much damage/healing, such as FF5, probably so. But with something like FF6 where the ease of hitting the damage/healing cap of 9999 is so high, the desire for something greater is somewhat justified.