View Single Post
Old 22nd March 2018, 05:08 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
Join Date: Feb 2007
Location: In my hat.
Posts: 16,255

Yes, that is to be expected. I know that the mask and item ID numbers are different in the JP version than they are in the US and PAL versions.

This difference is caused by the fact that the US version removed several "beta" items and legacy cruft from the index database in ROM, which conflicts with offsets the JP version uses. (The new collector's edition / GC Version JP ROM fixes this and uses the table proposed by the US version along with the new save format, just fyi.)

So it's an easy fix:
# usual conversions to get JP N64 save working on US ROM in Project64
zs zelda.fla -J false "-=" 3

# B-button icon assignment:  Gilded Sword (4F in US/PAL)
zs zelda.fla -e 0 4F

# C-button left, down, and right assignments (only C-right needs change)
zs zelda.fla -e 1 01 -e 2 00 -e 3 39

# The entire Masks subscreen (except blanks) needs to be fixed with this.
zs zelda.fla -I M 0 0 3E             -I M 2 0 47 -I M 3 0 45 -I M 4 0 40 -I M 5 0 32
zs zelda.fla -I M 0 1 3A -I M 1 1 46 -I M 2 1 39 -I M 3 1 42 -I M 4 1 48 -I M 5 1 33
zs zelda.fla                         -I M 2 2 37             -I M 4 2 36 -I M 5 2 34
zs zelda.fla -I M 0 3 43             -I M 2 3 3B -I M 3 3 44

# Finally (optional), change Link's name from the Hiragana "AAA" to "Link".
zs zelda.fla -N 152C312E3E3E3E3E
(Hmm...doing this, I realize I should probably update the -I command to read mask and item subscreen offsets supplied by the user as (row horizontal, column vertical) or (y, x), not (x, y)...little bit of a counter-intuitive detail I noticed. This isn't some OpenGL program; it's just a memory array of bytes that the (row, column) coordinate system should fit better.)

Your save file now looks like this (at least on my end):

I probably should have done that for you before uploading the .fla file, sorry. When I saw that I got your save working I was pretty quick to just leave it at that and upload the solution, but I did notice the Bunny Hood appeared then instantly disappeared off Link's head. This happens when player_mask is set to a mask ID that doesn't match what's on any of the 3 C-button mappings. (It was supposed to, but again the C-button IDs you have stored were compatible with the JP version and not US, which we have fixed with the command above.)

Please let me know if you see any other incompatibilities besides the mask ID numbers and the file name code page for naming Link. Those (and owl statue save formatting or lack thereof, of course) have always been the only two differences I had stumbled on between JP and non-JP save files, but maybe you'll see another one.

Originally Posted by buckchow View Post
I haven't looked at the updated source yet, but I'm guessing that the new -J option is doing more than just setting "is_old_JAP" to TRUE. Over 7,000 bytes are different between the save you attached and the one produced by using a build from the now-old source with that flag set.
Correct. Those 7,000+ bytes are coming from the Pictograph Box picture, which is a 5-bit-per-pixel (i.e., I5) 160x112 frame buffer image. 160 px * 112 px * 5/8 fractional byte pixels = 11,200 bytes (which adds up to the difference in end - start offsets for the photo documented in the wiki for the repository).

So because the US and PAL versions cannot store the Pictograph Box in regular Song-of-Time saves like the JP version can (they have to use the second 8-KiB half of the 16-KiB save block as a backup duplication), at most 11,200 bytes should be different as a result of XOR'ing old_JAP_save.

This (consequential of not having support for owl-statue-saving) and the item and mask ID enumerations, are the only two differences I've discovered between old-JP-formatted save files and the newer format.
Reply With Quote