Trouble importing Windows/Linux saves to Mac

Jan 20, 2009 at 3:42 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Jan 19, 2009
Location:
Posts: 7
Age: 39
Hello,

I recently downloaded Cave Story for Mac (Intel) and I thought that I'd try to use my Windows/Linux saves with it. I discovered that the game stores the Profile.dat inside its preferences file (the .plist file) and it looks like it stores it as raw Hex values. So, I opened the "profile.dat" file with 0xED, copied the Hex and pasted it into the plist file (in-between the < and > characters). On first glance it looked like it would work, but when I tried to load the save the game crashed.

Is there a better method of converting the saves?
 
Jan 20, 2009 at 11:08 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6224
Age: 39
Pronouns: he/him
The problem is that you need to reverse the byte order for 011-012 (Horiz. position), 015-016 (Vert. position), 01C-01D (Max HP), 020-021 (Current HP), 02C-02D (Equipped items), 034-036 (Time), 15C-15D (Slot 1 Teleporter Location), 164-165 (Slot 2 Teleporter Location), 16C-16D (Slot 3 Teleporter Location), 174-175 (Slot 4 Teleporter Location), 17C-17D (Slot 5 Teleporter Location), 184-185 (Slot 6 Teleporter Location), 18C-18D (Slot 7 Teleporter Location), and 194-195 (Slot 8 Teleporter Location).

Tell me if it works. :p

(Basically, as an example, if Max HP was 03 00 then make it 00 03)
 
Jan 21, 2009 at 2:08 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Just the byte order? What about the bit order?
 
Jan 21, 2009 at 4:09 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Jan 19, 2009
Location:
Posts: 7
Age: 39
Celtic Minstrel said:
Just the byte order? What about the bit order?

Just the byte order. The beginning of the Profile.dat was identical to the one found in the Mac .plist file. I'll try this once I get home.
 
Jan 21, 2009 at 5:56 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Jan 19, 2009
Location:
Posts: 7
Age: 39
Well, I either messed something up or you were missing something. I tried it, but the game crashed anyway.
 
Jan 21, 2009 at 10:34 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6224
Age: 39
Pronouns: he/him
Can you give me a working mac save? (Up to or past the part where the egg chamber teleporter activates in arthur's house would be good) I can check it over the weekend or tonight to find any further differences between the mac and pc profile.dat formats.
 
Jan 22, 2009 at 11:27 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Jan 19, 2009
Location:
Posts: 7
Age: 39
Hmmm...

I'll probably not have the time to do it this week (gotta finish the - no working - Windows version first), but I promise to give you one during next week.
 
Jan 27, 2009 at 12:55 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Jan 19, 2009
Location:
Posts: 7
Age: 39
How many posts do I need until I can save attacments? RS'ed it for ya:

http://rapidshare.de/files/43902537/com.nakiwo.Doukutsu.plist.html

EDIT: You might have trouble opening the file, I guess. This is the "Profile.dat" portion in plain Hex:

Code:
 446f3034 31323230 00000015 00000000 0001521b 0000c000 00000002 00100000
00100000 00000000 00000000 00000002 00000000 00012eb6 00000002 00000003
0000000a 00000000 00000000 00000005 00000003 0000000a 0000000a 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000002 00000004
00000001 00000007 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000001 00001771
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 464c4147 01000000
00000000 00000000 f0060001 0010000e 00000000 00030000 00000000 00000000
00600100 9d020000 00010400 40000010 00c0000b 00004000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00040000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00070000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
 
Jan 27, 2009 at 2:55 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Actually, a plist file is a plain text (xml) file, so anyone should be able to open it.
 
Jan 27, 2009 at 10:45 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6224
Age: 39
Pronouns: he/him
I'll throw it into a hex editor to test it as soon as I am able.
 
Jan 30, 2009 at 4:28 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6224
Age: 39
Pronouns: he/him
(Note that these addresses do not include the mac version specific header)

008-00B (Current map)
00C-00F (Current song) [not tested]
010-013 (Horiz. position + ???)
014-017 (Vert. position + ???)
018-01B (Facing direction)
01C-01D (Max HP)
01E-01F (Whimsical Star)
020-021 (Current HP)
024-027 (Current Weapon)
02C-02F (Equipped items)
034-037 (Time)
038-03B (Slot 1 Weapon Type)
03C-03F (Slot 1 Weapon Level)
040-043 (Slot 1 Weapon Energy)
044-047 (Slot 1 Weapon Max Ammo)
048-04B (Slot 1 Weapon Current Ammo)
04C-04F (Slot 2 Weapon Type)
050-053 (Slot 2 Weapon Level)
054-057 (Slot 2 Weapon Energy)
058-05B (Slot 2 Weapon Max Ammo)
05C-05F (Slot 2 Weapon Current Ammo)
060-063 (Slot 3 Weapon Type)
064-067 (Slot 3 Weapon Level)
068-06B (Slot 3 Weapon Energy)
06C-06F (Slot 3 Weapon Max Ammo)
070-073 (Slot 3 Weapon Current Ammo)
074-077 (Slot 4 Weapon Type)
078-07B (Slot 4 Weapon Level)
07C-07F (Slot 4 Weapon Energy)
080-083 (Slot 4 Weapon Max Ammo)
084-087 (Slot 4 Weapon Current Ammo)
088-08B (Slot 5 Weapon Type)
08C-08F (Slot 5 Weapon Level)
090-093 (Slot 5 Weapon Energy)
094-097 (Slot 5 Weapon Max Ammo)
098-09B (Slot 5 Weapon Current Ammo)
09C-09F (Slot 6 Weapon Type)
0A0-0A3 (Slot 6 Weapon Level)
0A4-0A7 (Slot 6 Weapon Energy)
0A8-0AB (Slot 6 Weapon Max Ammo)
0AC-0AF (Slot 6 Weapon Current Ammo)
0B0-0B3 (Slot 7 Weapon Type)
0B4-0B7 (Slot 7 Weapon Level)
0B8-0BB (Slot 7 Weapon Energy)
0BC-0BF (Slot 7 Weapon Max Ammo)
0C0-0C3 (Slot 7 Weapon Current Ammo)
0C4-0C7 (Slot 8 Weapon Type)
0C8-0CB (Slot 8 Weapon Level)
0CC-0CF (Slot 8 Weapon Energy)
0D0-0D3 (Slot 8 Weapon Max Ammo)
0D4-0D7 (Slot 8 Weapon Current Ammo)
0D8-0DB (Inventory R1C1)
0DC-0DF (Inventory R1C2)
0E0-0E3 (Inventory R1C3)
0E4-0E7 (Inventory R1C4)
0E8-0EB (Inventory R1C5)
0EC-0EF (Inventory R1C6)
0F0-0F3 (Inventory R2C1)
0F4-0F7 (Inventory R2C2)
0F8-0FB (Inventory R2C3)
0FC-0FF (Inventory R2C4)
100-103 (Inventory R2C5)
104-107 (Inventory R2C6)
108-10B (Inventory R3C1)
10C-10F (Inventory R3C2)
110-113 (Inventory R3C3)
114-117 (Inventory R3C4)
118-11B (Inventory R3C5)
11C-11F (Inventory R3C6)
120-123 (Inventory R4C1)
124-127 (Inventory R4C2)
128-12B (Inventory R4C3)
12C-12F (Inventory R4C4)
130-133 (Inventory R4C5)
134-137 (Inventory R4C6)
138-13B (Inventory R5C1)
13C-13F (Inventory R5C2)
140-143 (Inventory R5C3)
144-147 (Inventory R5C4)
148-14B (Inventory R5C5)
14C-14F (Inventory R5C6)
150-153 (Inventory R6C1)
154-157 (Inventory R6C2)
158-15B (Slot 1 Teleporter Menu)
15C-15F (Slot 1 Teleporter Location)
160-163 (Slot 2 Teleporter Menu)
164-167 (Slot 2 Teleporter Location)
168-16B (Slot 3 Teleporter Menu)
16C-16F (Slot 3 Teleporter Location)
170-173 (Slot 4 Teleporter Menu)
174-177 (Slot 4 Teleporter Location)
178-17B (Slot 5 Teleporter Menu)
17C-17F (Slot 5 Teleporter Location)
180-183 (Slot 6 Teleporter Menu)
184-187 (Slot 6 Teleporter Location)
188-18B (Slot 7 Teleporter Menu)
18C-18F (Slot 7 Teleporter Location)
190-193 (Slot 8 Teleporter Menu)
194-197 (Slot 8 Teleporter Location)

It works, I converted your mac save to a pc save. If I got anything wrong (I haven't tested the teleporters, though they should be fine) then let me know.
 
Jan 30, 2009 at 4:33 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
andwhyisit said:
(Note that these addresses do not include the mac version specific header)
By this, do you mean the XML content above the profile.dat? You should only take into consideration the portion of the file enclosed between <data> and </data> (I think that's the tag) which occurs directly after <key>profile.dat</key>

Remember, it's a plist and hence plaintext. If you're going to convert all the saves to Mac-friendly versions, don't simply upload the plist, because it also contains all the user's preferences (which in Windows are set using DoConfig.exe). You only need the portion in the <data> tags, plus instructions on how to use it which involve editing the plist file.
 
Jan 30, 2009 at 4:47 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6224
Age: 39
Pronouns: he/him
Celtic Minstrel said:
By this, do you mean the XML content above the profile.dat? You should only take into consideration the portion of the file enclosed between <data> and </data> (I think that's the tag) which occurs directly after <key>profile.dat</key>

Remember, it's a plist and hence plaintext. If you're going to convert all the saves to Mac-friendly versions, don't simply upload the plist, because it also contains all the user's preferences (which in Windows are set using DoConfig.exe). You only need the portion in the <data> tags, plus instructions on how to use it which involve editing the plist file.
As long as the start of the save data (offsets 000-007) is "Do041220" then that is fine by me. I guess it is my fault for opening a .plist file in a hex editor.

I hope someone creates a Profile.dat conversion tool from this one day.
 
Jan 31, 2009 at 4:35 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
I could probably write a quick conversion script in Python, actually...

Basically, within each of the ranges listed, the overall byte order has to be swapped? So, for example:

00C-00F "6fd4e5c3"

becomes

00C-00F "c3e5d46f"

?

(Where the quoted string is hex.)

And also in the 000-007 range?
 
Jan 31, 2009 at 11:30 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6224
Age: 39
Pronouns: he/him
Celtic Minstrel said:
I could probably write a quick conversion script in Python, actually...
You would still need to check if the whimsical star data needs to be swapped. But that is awesome, thanks.

Celtic Minstrel said:
Basically, within each of the ranges listed, the overall byte order has to be swapped? So, for example:

00C-00F "6fd4e5c3"

becomes

00C-00F "c3e5d46f"

?

(Where the quoted string is hex.)
Yes.

Celtic Minstrel said:
And also in the 000-007 range?
No. The 000-007 range stays the same.
 
Feb 3, 2009 at 3:42 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Okay, I noticed you seem to have ignored two ranges...

022-02B ???
030-033 ???

Should they be swapped? Or portions of them?
 
Feb 3, 2009 at 10:55 PM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6224
Age: 39
Pronouns: he/him
I'll check the current weapon offset later to see if it is multiple byte, but I think most of that is just unused space and that "current weapon" is a single byte value.

EDIT: The "current weapon" offset is set to 0, like the whimsical star data and the current music data I cannot test it with this save.
 
Feb 4, 2009 at 2:19 AM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
So, how should I treat those sections? Could they represent event flags or something?
 
Feb 4, 2009 at 4:16 AM
Administrator
Forum Administrator
"Life begins and ends with Nu."
Join Date: Jul 15, 2007
Location: Australia
Posts: 6224
Age: 39
Pronouns: he/him
Celtic Minstrel said:
So, how should I treat those sections? Could they represent event flags or something?
Flags do not start until 21C, as indicated by 218-21B. Though I would like to point out that the flags, by the looks of things, do not need to be reversed since they are in single byte values. The bit order is not affected by the byte order switch. Just leave those sections as they are for now.

To test these last few things I really need a mac save in an area with background music, the whimsical star activated and working, and the current weapon that is selected being something other than the polar star, snake, machine gun, or spur. Can anyone get me one?
 
Feb 4, 2009 at 2:14 PM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Would my save in the Prefab Hut do? I could probably select the missile launcher or the bubbler and re-save it.

By the way, did the Mac save you looked at have tabs (09) at regular intervals? Because, mine does...

Also, if flags start at 21C, then what's in 198-21B? And how many bytes of flags are there, and is there anything after them?
 
Back
Top