Bug Fixes

If you are stuck in the Dunan Unification Wars; or wish for more details on the gameplay systems, this is the place.
Post Reply
Julian
Posts: 73
Joined: Wed Jan 29, 2014 9:17 pm

Re: Bug Fixes

Post by Julian »

JiN88 wrote: Thu Sep 02, 2021 10:28 pm I have always wondered if that was ever a bug or something.

Btw, have you taken a look at the Flour? I remember looking at the dialogue text dump and found that it did hint at collecting more than 1 bag of flour (Normally you can't and they'll just put out a generic option for you). Not sure if it was ever intended or just they double mistranslated it from the number of flint/boots options.

80110ff4 031: "Huh? Flour?{eol}How many bags do you want?"
80111020 032: "1 bag is fine."
80111034 033: "2 bags please."
80111048 034: "3 bags...please..."

80113820 024: You got 1 bag of flour
80113838 025: You got 2 bags of flour
80113850 026: You got 3 bags of flour

Also, Mercenary Fortress is a bit weird. At the top out of bound area there are some objects like Lava texture (for the fire at the furnace), Crates, oil spill, rope, doors, etc. (non-interactive); Just a guess but it's probably an early technique where they load object out of bound only for it to zip back in (Only a few areas I know that has this. It seems like an abandoned idea). There's also a sprite sheet that shows a lump of coal/flint that grows bigger and bigger (never seen it used).
The original text from Pohl with the request:

「よく聞いておぼえるんだぞ。
ええと・・・・倉庫に行って『ブーツ』を
2足もらってきてくれ、[PROMPT]それから、かじ屋で『火打ち石』を
3つもらって・・・・[PROMPT]あとは道具屋で『こむぎこ』を
買ってきてくれよ。」

I don't speak Japanese, but throwing the last part into deepl, I don't see any mentions of multiple flours. I do see the lines for asking for multiples, it was probably originally set up like flint and boots but changed at some point, and the text just remained.

As for the flint - man the mercenary fortress is such a pita, so many duplicated files, have a really rough time pinpointing the event scripts. So I'm not sure what all 0x1E scripts are being called when the flaming rag is thrown. It looks like this switch gets called twice, but the second time it terminates before getting to the switch. The only code dealing with 0x27 I'm seeing in this switch block is the addition of 0x27 to the Key Item list. There's another block with a 0x27 but I have no idea what it's doing.

As for the code I wrote, I don't think I like it. If someone cheats in other key items, or has a map due to NG+ or something, I don't want that code to possibly break it. So I think I'll just have to write proper code somewhere else and just hook a jump in here instead. Not a huge deal for what I'm working on.
User avatar
Pyriel
Webmaster
Posts: 1227
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

I wouldn't be entirely surprised if the one thing the devs responsible for porting to PSP actually did was running an analysis to see what was effectively dead code, but with no checking to see if the code was dead due to errors. Probably not, but it's possible.

I added a screenshot of the code in question to my post. That might help. Or if you can supply what's going on in the PSP version, I might be able to confirm with some certainty that the code serves the same purpose for those instances of 0x27. The main difference, other than the PSP having some additional op codes, and possibly some differing interpretations from our disassemblers, appears to be that they pulled a lot into the main executable. On the PSX, a lot of the calls are to anonymous-ish addresses in external modules.
Julian
Posts: 73
Joined: Wed Jan 29, 2014 9:17 pm

Re: Bug Fixes

Post by Julian »

Ah, interesting. I found the PSP version of that, it's the case following the rag/rope.

I haven't fully analyzed it, but it seems to do a nulled out call to "add key item". The code right after the loop ends seems to do a proper "add key item" call for flour (0x28), before jumping to the end of the switch statement.

I think this looks like just unused code..? I'll see if I can find the 0x1E calls and try to force it go down this path.

Image
You do not have the required permissions to view the files attached to this post.
User avatar
Pyriel
Webmaster
Posts: 1227
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

Yeah, that looks like it to me. Add_KI? there is probably the multi-purpose crap my screenshot references. They have a lot of old-school code where the functions can do any of like five to a hundred marginally related things based on one or two of the arguments passed.

That particular function was already commented up in my disassembler files because it came into play quite a bit in the GS1 save load for pulling in armor, runes, and such. One of the first things it does is load a value from +0x58 of the SP (on the PSX anyway), and that should be the "task" it's being asked to perform. At least that's what my GS1 load notes say. It looks like the PSP makes more use of the T registers for passing arguments, though. If that's the case, it looks like something has changed with the argument values, at least a little bit. Edit: Disregard that. I was looking at the bottom call instead of the one that's actually relevant. It looks like the T registers are getting the same values.
Julian
Posts: 73
Joined: Wed Jan 29, 2014 9:17 pm

Re: Bug Fixes

Post by Julian »

Yeah, I took a look and it does seem to be multi-purpose. A2 of 0xC seems to indicate "add key item". The call in this case statement has a -1 in a2, which makes me think it's a nulled out/error code or something, but it *could* mean another instruction.
User avatar
Pyriel
Webmaster
Posts: 1227
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

Anyway, I reckon all that needs to happen is the search through item bag needs to be switched with a search through the key items. Basically copy/pasting the code from early except looking for 0x27. There's a possibility that the 0x28 item ID is involved, though, or that the item briefly hits your bag before being enshrined forever in your key items. Hopefully not.
JiN88
Posts: 90
Joined: Tue Dec 20, 2016 11:40 pm

Re: Bug Fixes

Post by JiN88 »

>「よく聞いておぼえるんだぞ。
ええと・・・・倉庫に行って『ブーツ』を
2足もらってきてくれ、[PROMPT]それから、かじ屋で『火打ち石』を
3つもらって・・・・[PROMPT]あとは道具屋で『こむぎこ』を
買ってきてくれよ。」

Where did you get this? I wouldn't mind trying to see through what the Jap text dump is like.
User avatar
Pyriel
Webmaster
Posts: 1227
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

IIRC the PSP version has a proper dictionary file in Unicode/UTF-16 instead of the custom font and encoding the PSX used, with text strings littered throughout thousands of files.
Julian
Posts: 73
Joined: Wed Jan 29, 2014 9:17 pm

Re: Bug Fixes

Post by Julian »

Yes, the PSP text files are MUCH neater. Although 3800+ lines being shoved in a single file where ordering often has little to no rhyme or reason... You know, I think I'll take that over the nightmare that the PSX sounds like. The file is always loaded in memory, and there's a simple function that takes in the index and returns the address that is used all over the place, so it's very easy to find the assembly that's loading the hardcoded index and then calling that function.

As for the text I extracted it myself. I fully plan on open sourcing the tools once I complete this project. (the code is such a mess right now it's embarrassing XD) The extractor is simple, though. As Pyriel said, the text is all in UTF-16. Here's the op codes I've identified:

Code: Select all


{ 0x42, 0x26, 0x31, 0x32 } = Hero Name (S1/S2)
{ 0x42, 0x26, 0x60, 0x24 } = Castle (S1/S2)
{ 0x42, 0x26, 0x61, 0x24 } = Army Name (S2)
{ 0x42, 0x26, 0x62, 0x24 } = Total number, result of some math calculations, usually used in inns (S2, dunno if S1)
{ 0x42, 0x26, 0x64, 0x24 } = Character level variable in S1 used for recruiting that one person, Greenhill Nanami name S2
{ 0x42, 0x26, 0x63, 0x24 } = Recruited characters variable in S1 used in recruiting that one person, Greenhill Hero name S2
{ 0x42, 0x26, 0x69, 0x24 } = Suiko1 Hero name in S2
{ 0x42, 0x26, 0xA0, 0x25 } = Suiko1 Castle name in S2
{ 0x28, 0x22 } = Prompt, new screen
{ 0x20, 0x22 } = New line
{ 0xCE, 0x25, (byte)(i + 0x30), 0x00 } = Pause i (S1, S2)
{ 0x06, 0x26, (byte)(i + 0x30), 0x00 } = Delay i (S2 only?)
{ 0x42, 0x26, 0xBC, 0x25, (byte)(i + 0x30), 0x00 } = Unknown (s2)
{ 0x42, 0x26, 0xB2, 0x25, (byte)(i + 0x30), 0x00 } = Unknown (s2)
{ 0x52, 0x22, (byte)(i + 0x30), 0x00 } = Color i (S2, dunno if S1 - probably?)
There's an odd thing with Pause in S1, where it's done right before or right after a prompt (don't recall) it has a second {(i+0x30),0x00}.
JiN88
Posts: 90
Joined: Tue Dec 20, 2016 11:40 pm

Re: Bug Fixes

Post by JiN88 »

Care to explain the process or some tool? I really have no idea how any of these works. I only know of the EN text dump because Pyriel dumped it somewhere a long time ago.
User avatar
Pyriel
Webmaster
Posts: 1227
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

I mean, I can do a Japanese dump if I dig up the program I wrote. It has the Latin and Japanese character translations in it. Nobody ever asked for it, and Japanese wasn't too useful to me because I did my dump mostly to look for untranslated lines.
JiN88
Posts: 90
Joined: Tue Dec 20, 2016 11:40 pm

Re: Bug Fixes

Post by JiN88 »

Would appreciate if you could. If possible, please do the JP demo and EN demo as well. The EN demo definitely has more character lines for finishing the Trial Road that the Wiki left out on.
User avatar
Pyriel
Webmaster
Posts: 1227
Joined: Wed Aug 18, 2004 1:20 pm

Re: Bug Fixes

Post by Pyriel »

You'd have to point me in the direction of the demos. I don't have them.
JiN88
Posts: 90
Joined: Tue Dec 20, 2016 11:40 pm

Re: Bug Fixes

Post by JiN88 »

Suikoden 2 JP Demo

-links removed-

The 2nd one is for Suikoden 2 EN demo. I don't remember if that was the website I downloaded from but it's definitely somewhere on the internet. I'll edit it if I find another link. I do have a .zip file of it though.

-links removed-

Interesting, turns out someone managed to upload 2 prototype version of it just this year. I'm in the midst of downloading them so I don't know if it's exactly as the demo version, but the file size is definitely 1/2 the size of the complete version.

EDIT: DO NOT link to ROMs/ISOs on this forum. This should not even have to be explained.

Edit 1: Sorry didn't know about the links. Anyway the JP demo can be googled. En demo is harder to find but the Product ID is Sled-02742. There's also 2 prototype which you can google it; they were released just a few months ago.
Last edited by JiN88 on Wed Sep 08, 2021 7:36 pm, edited 1 time in total.
Julian
Posts: 73
Joined: Wed Jan 29, 2014 9:17 pm

Re: Bug Fixes

Post by Julian »

Probably shouldn't be linking those here.

Anyway, if you're interested here's the original text dump I did of S2 from the PSP version. I don't think it has any of those op codes replaced, so when you see weird unicode characters... that's what they are.
You do not have the required permissions to view the files attached to this post.
Post Reply