Golden Sun Hacking Community
December 14, 2017, 10:21:56 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
  Home Forum DC Wiki Help Search Calendar Downloads Login Register  
  Show Posts
Pages: [1] 2 3 4
1  General Hacking / General Editor / Re: Making text editor. on: Yesterday at 04:13:06 PM
I'm gonna addsome functions to the drive you made, these ones were identified by normmatt:

ROM:08003BC0 ; unsigned int __fastcall DrawCharacter(int src, int dest, int src_offset, int bg_color)
ROM:08003BC0 DrawCharacter
ROM:08003EB8 ; unsigned int __fastcall DrawCharacter_0(int src, int dest, int src_offset, int bg_color)
ROM:08003EB8 DrawCharacter_0
ROM:08001F14 DrawString
ROM:0800348C GetCharacterAddressInFont

One of the drawcharacter is for the normal font, while the other is for the big characters font (no clue which one's which)
2  General Hacking / General Editor / Re: Making text editor. on: December 11, 2017, 01:47:08 AM
Alright.. I have a tiny bit of info...


Quote
"in this case the opcode is: 16 03 01 00 18 01 00 00 83 C1 00 00 The text in this opcode is 83 C1 which is translated to your partner name. Soon after this opcode we have a 0B 03 (big text) with 83 C1 81 49 81 49 that is: (Partner name) + "!!" But when testing I only saw the :(Partner name) + "!!", when the character summons him/her. I didn't see the summon name by it self as the 16 03 opcode is sugesting. That opcode is kinda weird, maybe this opcode will need some brute force search. t's not like there is much text in that opcode format. About all of it is or user created names and or '!' and or '?'. The only thing we need to take a look is that player name + 'Da'(japanese) + '!'. I think its the only of those 16 03 opcodes we might need to change. Do you have any clue to why a japanse would put a 'Da' after a name? (maybe something we need to translate)
When I looked at the code on this, it looked like this command (0316) is for getting the number of characters in the text string.

0316 EXPR TEXT
EXPR = Refers to where in memory to set the number of characters in text to.
TEXT = The text to check (Using CX83 will read from the text variables)

Does that make any sense?


I think it does make sense for this control code.

It's not like there is much text in that opcode format as earth said. I think we can leave it like that. What do you say?
3  General Hacking / General Editor / Re: Making text editor. on: December 10, 2017, 05:04:06 AM
You are welcome. Still got to document the other commands, though. = Hopefully I can get at least half of those in this month. (?)

Sounds good. I also have it in my Hacking Docs folder. (Misc. Docs link in my signature.)


That'll be most helpful! thanks fox

Meanwhile I'll keep working on the graphic task.
4  General Hacking / General Editor / Re: Making text editor. on: December 07, 2017, 02:19:18 AM
Yeah, sounds like a good way to go... Especially if we ever want those tools to be used for more than just translating...
As for the script table? I am not sure exactly what that refers to, but I don't imagine it to be a problem? (Re-pointing is easy if you got the space. Right?)
(A bit random, but I kind of hate Python when it comes to file management. C# does a pretty good job, though.)

I've already started documenting. The document is at https://docs.google.com/document/d/19HGbHkmIUfvd7fc0_gEpcuAjtwagtr7HpLv2dwE5jPg/edit
It it is to list most of the functions in the game. (Functions being the code blocks that were intended to be called.)

This is just the start, and there's a long way to go. But it's nice seeing the first section (0000+) only has a small number of commands.

0000 = Unused (Pointer is 00000000)
0001 xxxx xxxx EXPR = Set var to EXPR (xxxx=Type (2/3) , xxxx (2nd) =Index)
0002 xxxx EXPR = Conditional jump (in script) if EXPR=0.
0003 xxxx = Simple Jump
0004 = Related to ending script?
0005 EXPR = Loads PSI3 file. (Index being EXPR) Current position is not saved.
0006 EXPR = Loads/calls PSI3 file. (Index being EXPR) Current position is saved.
0007 xxxx = Function call (For same 0x1C byte entry)
0008 = Return from sub-function. (Does nothing if in main function?)
0009 xxxx = Function call? (Another 0x1C byte entry?)
000A EXPR = Sets slot EXPR (0-7) to type 0x9.
000B EXPR = Gets the on flags for the engine block EXPR (0/1)
000C = Nothing (Just returns 0 to continue script.)
000D = Sets PSI3 file id(Not sure?) to 0000, but doesn't load it? (Unknown purpose.)
000E = Unused (Pointer is 00000000)
000F = Unused (Pointer is 00000000)

In the code, these ^ are pretty much separated into two groups, interesting enough. 0001,0004-0009 in the first group, 0002,0003,000A-000D in the other group.

Amazing!! Well the dumper's ready then (i'll send you a link to a drive folder so you can post there all your findings if you want and check what we have done so far).


Nice, I'll bookmark the file to check it out throughly. I'll edit this post if I have any questions!
5  General Hacking / General Editor / Re: Making text editor. on: December 04, 2017, 12:34:51 PM
Oh no, you're fine. It's no problem.... This'll be very useful during research.
Was more or less saying that going forward, I will be trying to use this other way. (I might include the arguments too. though I left those out of my example.)

I see. Glad it was useful!

One question, suppose all the functions have been identified properly, I guess we'll have to code them to make a decent dumper/inserter that, in case of the dumper writes down the XML plus the japanese text, and in the case of the inserter, reads up the xml formatted text and writes down the opcodes + translated text, am I right?

of course, we'd need to take into consideration the fact that the sizes of each script will be different, and thus we'll need to modify the script table...I think that's how it was supposed to go down.


6  General Hacking / General Editor / Re: Making text editor. on: December 03, 2017, 07:29:49 PM
Oh cool. That's nice.

One thing, though.  It looks a bit unorganized and rushed.

I'd prefer the commands written the 16-bit way (That is the way they are written, right?).... and for them to be in order by their number... So like....

Something like below, but I'll have to work quite a bit on it....

---

General / Control Flow?
0000
0001
0002 = conditional jump, test player's gender
0003 = simple jump
0004 = End of script
0005
0006
0007 = function call

(Not sure if there are categories for 0100+ and 0200+)


???
0300
0301
0302
0303
0304
0305
0306
0307 = Set variable
0308 = Normal Text box
0309 = for text that spans 3 lines
030A
030B = Text box with large letters
030C = for one line
030D = options
030E = End
030F
0310
0311 =  Box with Title (Where will you go?)
0312 = Box without Title (just a text box)
0313 = default option (no option chose)
0314 = option (Deikle Village)
0315 = end of menu
0316
0317 = popup message: This are special text boxes that are really small and appear in the middle of the screen
0318 = wait for key press on pop up text box??

0363 = set actual place in the game's menu

037D = set name sprite
037E = set visible or invisible (portrait) Invisible are for NPC which doesn't have any portraits


???
0478 = sets portrait.
0479 = sets eye expression and mouth expression.
047A
047B
047C
047D = adds extra sprites if the portrait is wider.

Yeah, it's a bit rushed, sorry >_< they are written by how you'd find them on the script files.

7  General Hacking / General Editor / Re: Making text editor. on: December 03, 2017, 04:41:21 AM
Okay. Thanks! Wow. A lot to take in.

And that sounds nice. I kind of wish there was a key. (Hex values that represent each control code.) I'll probably get them as I document the game code. (Depending on how much time I devote to it.) ; (Though, I guess you're working on that... if going by your posts.)

@rip/uncompress = If it is compressed in the ROM, another option is to just dig it out of the game's RAM where it is decompressed?

I have collected everything I know about how the control codes work in-game, with some examples. Also, how the script is read by the game.

Here's the file: https://www.mediafire.com/file/os9sqb59xpdbbw7/List%20of%20Hajimari%20no%20Ishi%20Control%20Codes.txt
8  General Hacking / General Editor / Re: Making text editor. on: December 01, 2017, 03:46:14 AM
Okay. Thanks! Wow. A lot to take in.

And that sounds nice. I kind of wish there was a key. (Hex values that represent each control code.) I'll probably get them as I document the game code. (Depending on how much time I devote to it.) ; (Though, I guess you're working on that... if going by your posts.)

@rip/uncompress = If it is compressed in the ROM, another option is to just dig it out of the game's RAM where it is decompressed?

if it's useful, the uncompressed script inside the gba are stored at 0x02006000 which is in the WRAM. Some control codes were documented with their hex value, once I'm done I'll share them.
9  General Hacking / General Editor / Re: Making text editor. on: December 01, 2017, 12:04:28 AM
Well, any work to bring the translation project 1 step closer to finishing is good work.... (Even if it's minor.)

Sounds good. Where might I find the most updated English script, anyway?  Not too familiar with PSI3 files, but I'll look at them. I think before I was studying system related text (Uncompressed)... But all that is nice to know.

The most updated english script is here: https://github.com/salixa/SNSC3-Translation

As you can see, it's formatted differently because some progress was made in identyfying the control codes. Alas I don't have all the info available.

Arount here, page 5-6 there's some tools to rip and uncompress the english script, using a C function first and passing the scripts through DSDECMP
10  General Hacking / General Editor / Re: Making text editor. on: November 30, 2017, 08:33:37 PM
I should probably look into this again.

Would be fun if I could find a way to make it use Golden Sun's text compression!

Just remember, I make *no promises*, though.... Esp. since that last time I looked at it (years ago),.... it turned out I didn't make much progress...  I forget if we documented any of the code or not. So I'll need to find those addresses again. - It'll likely be a complex task...


@Script = So do we have it in a text document? One line per index? (If the game does it by index? Forget. Edit: Oh yes, you have it one per file by address... went to the link in the earlier post.) I know that lines can have funny stuff going on in them, though. But I'll need to think what's actually needed in the event /all/ the text is being compressed at the same time. (And with the possibility of modifying the code.)


For now, I will just look... then decide if I'll do anything a bit later.


---
I think I'll document the functions.... There's likely going to be a lot of code editing(?) if this goes through?
And with the compression format theory, you don't really have to go to 8-bit char... could keep it 16-bit. (Maybe, at least with a slightly modified version of the compression format.) ... Since that's what would be in the char trees... where-as, the text data would be variable bits. (In theory.) ; But I think I'm interested in making it 8-bits when it is in the char trees... should I ever have a decent enough plan....

That would be definitely useful fox! Hopefully your try yields good results this time.

As a reminder of where we are right now: the script is currently compressed using LZ77, and it's made of PSI3 files or varying lengths. Each of this script files have a subset of different control codes, that tell the game how to show the information (portraits, type of text box, if the dialogue branches etc) A lot of them have been identified and I'm doing my best to document them, it will take a day or two though. It's not a complete list but I'm sure it'll be useful too.
11  General Hacking / General Editor / Re: Making text editor. on: November 29, 2017, 06:29:38 PM
Hey everyone! sorry for necro bumping this post again.


I'm still working on Hajimari no Ishi, and while we made a LOT of progress translating the script, we need help inserting it back into the rom.

Hopefully Aent is not busy enough to help us back, or another person with similar hacking knowledge.


Thank you! Happy
12  General Hacking / General Editor / Re: Post your GBA ASM Questions here. on: January 19, 2016, 07:45:22 PM
how to toggle debugging on/off on vba sdl h?????
13  General Hacking / General Editor / Re: Post your GBA ASM Questions here. on: October 08, 2015, 04:30:27 PM
Hmm... Interesting? So those images make it look like he has already made the font arrangement/swapped to 8-bit.... But I guessing he never released the tools on that end? (Only the extraction ones?) Or did I miss something?

Spoiler for Hidden:
That moment when you find out you can't keep multiple spoilers open at a time on romhacking.net.... almost makes gshc spoilers seem much better than I thought... after thinking they were tacky.

exactly, dissapeared without a trace, such a shame.
They are horrible indeed. You can try contacting blackdog61, the guy can give you sound advice. for sure.
14  General Hacking / General Editor / Re: Post your GBA ASM Questions here. on: October 07, 2015, 10:55:31 PM
Can't say... I'm probably the only one here at GSHC ("here" applies to those that pop in regularly) to consider it...(?)  I remember looking into the code a long time ago... and I believe at some point deciding not to really work on it... for some reason? Could have been due to how time consuming it might have been(?) (Not sure of its difficulty level...)

VWF = ???

I take it that http://forum.goldensunhacking.net/index.php?topic=2488.msg44352#msg44352 is still the latest update?

While one method /might/ be to have the 8-bit chars be indexes to a 16-bit char table... (In some way... while noting char pairs...) It's probably better to just go straight to 8-bit chars and update the font..? I um... Not know how difficult that is... sso may need to look it up. What tool was being used to import the text again? https://github.com/wangds/sncsm3 This one? (I think it was obsolete?)

And if I'm lucky... (Assuming I jump back in this? Haven't quite decided.) ...perhaps I will see about putting the GS Text Compression in the game.... But anyway.. It's probably unlikely that I'll do that... especially since compression might not be necessary... But you never know.


Edit again: Either way, I'm in no rush... and will hypothetically-speaking be months until I would show progress if I do.(?) ... so assume I've filled in no positions...

VWF = Variable Width Font

I use the gbatemp thread, but this one has information from Aent. He made exactly the same attempt, but dissapeared and never reported back (his mail's saviorkross@hotmail.com, but no idea if you will contact him, i couldn't at least) he made a tool to get the script:

as far as things goes i think that aent taking care of the hacking part as he must be decyphering the missing opcodes. that is an useful part. as you say now we need to find a way to make the script fit.

I've been working on it on and off in my spare time, but I am pretty new to all this. That tutorial you posted was quite helpful so my thanks to whomever wrote it and to you for posting it.

Ideally I want to break the limit of the current text blocks(PSI3 segments which is what is shown in my last post) so we can have a fuller translation. As it is now, each text block links to the others either by an index number to an array of pointers or a pointer of it's hex location. Still investigating that. If for instance, you take one segment, say the mine entrance right after the intro, and replace it with another. As soon as you leave after fighting VE it will warp you to the new location instead of the mine. In my case it was from there to the shop in the first town. If I walked out of the shop then, it took me outside into the town as it normally would. This tells me that the locations that they lead to aren't linked to the current text blocks location in the game file. If we were to pull out all the text blocks, put our full translation in and put them back in, they would run out of room. Sort of like putting 4 rectangles where 4 squares are supposed to fit. The way to fix this is put them in as normal and once we run out of room for the next one to fit, move it to free space and adjust the pointers as needed for all the text blocks. With luck it will be some sort of array, but I'm not sure honestly. I have located a value that if changed links to various locations and battles but more investigating is needed. As for the max rom space issue of 32mb, I'm not sure how close we'll come to that. I forget how much free space was said in the other thread. Something like 280kb? I'll have more on that situation soon I hope.

Download here.
I'm gonna include the program I use to dump the text blocks as well as a .bat file to use with DSDecmp. Just unzip to a folder with "sn3.gba" in it.(without the quotes). Doubleclick dumptexts.exe and it will dump the encrypted texts to the folder "output". Their names will be in the form of "decimal_hex". Then, with DSDecmp.exe in the original folder, doubleclick dsdecmp_folder.bat and it should make a folder called output_dec. Those will be the decompressed ones as shown in my last post. They include the original script, events, etc, albeit in a fairly unreadable form except for the actual script. For those of you who wish to see the code of dumptexts.exe, it's in src. You'll need GCC to compile most likely. I plan to include any programs/tools I create and their source as I don't want my progress for better or worse to be lost if something beyond my control should happen, lol. Beware I have some experience with C, but am certainly no expert and use google quite often.

If any questions/comments/tips/criticisms, etc I'll try and be more active here to see them. I can't promise I'm the answer to what you've been looking for, but I'm willing to try and help, lol. My apologies for the late response as well as the text-wall.


p.s. Offsets.txt will be created as well. It's just a list of all the starting locations of the compressed segments in hex. Also, not all the txt files will be story dialogue. Some are just empty rooms or lead to battles and such. Also, some might be two different parts of one location. For instance, in the first game I had one for the intro dialogue and one for map items. ("...may..." cutscene for the dialogue and in a separate text for picking up the entrance ticket as well as the placement and teleport location of the stairs)

Yeah, updating the font will be best too since it's too big.

Thanks for the reply though, hope it's not hard as it seems to be.

Edit: Here's aent latest progress before disappearing:

http://oi58.tinypic.com/jsk5yu.jpg
http://oi61.tinypic.com/28jcdgi.jpg

For example, 0x8260 used to give us the character 'A'. Now, just 0x60 produces the same character so we save a fair amount of space for adding in the translation. Another thing to notice is the gaps between letters. This will have to be repaired with a variable width font when the time comes. That will most likely be one of the last things I do.
15  General Hacking / General Editor / Re: Post your GBA ASM Questions here. on: October 07, 2015, 04:17:19 AM
Anyone interested in helping with some ASM stuff for hajimari no ishi? I'm looking for someone that can change the sjis to ascii  ( so that each char occupies 1 byte instead of 2). Also a VWF to help that change.
Pages: [1] 2 3 4
Cbox
Yesterday at 09:19:38 PM
Fox: Okay, so that Summon Night games adds the fram number to the seed, before generating another seed via mul/add....  (GS1-GS3 never adds the fram number.) ... So um, that makes sense! ;  Summon Night:  ((seed + frame) * 0x343FD + 0x269E3C) >> 0x10 ; Which is also on the list here: https://en.wikipedia.org/wiki/Linear_congruential_generator
December 12, 2017, 11:10:45 PM
Fox: Yes, and there could be contests. Maybe ones where 1st/2nd/3rd place get a cash reward, but eh. Dunno.... Kind of thinking about making a topic about how people got their job, and what was their experience. (e.g. Did they use references of people already working in the job, and various other things.)
December 09, 2017, 04:24:14 AM
Majora: Import old forum posts for reference, perhaps take posts containing important info like documentation away from the old stickied forum post model and make them into their own pages on a site with an in-built search bar. Might help with SEO, too. If nothing else, perhaps whipping them into PDFs and hosting them via Scribd? The possibilities are boundless when it comes to restructuring a site
December 09, 2017, 04:20:02 AM
Majora: Just a nice idea to have even if it doesn't come to fruition. Updating, modernizing, always a good idea. Could probably do something pretty nifty using a good Wordpress theme
December 09, 2017, 04:15:45 AM
Majora: Would be kind of neat to do something like that for GSHC. Could change it up a bit to show all tweets/instagram posts/facebook posts/golden sun subreddit posts all in one sidebar. It would be cool in that it gives the site it's on (and the topic in general) appear more lively and active, which is a plus
December 09, 2017, 04:14:19 AM
Majora: That does sound interesting. One cool thing I've seen some sites use is a sort of unique take on a sidebar option that acts like a social media integration (like, "See GSHC's latest Tweets"). It displays activity from a variety of related sites, such as Reddit, Twitter, Instagram, etc.
December 09, 2017, 12:58:53 AM
Fox: And the way it'd work via code is not that all users would instantly get nicknames the minute you register... but rather, the moment you view a name if it doesn't have a nickname, it gets one. (My Thoughts.)
December 09, 2017, 12:53:55 AM
Fox: (I was thinking that it would be "Name (Nickname)" ... The nickname is what you first known the user as, and you can change that yourself... and the Name is what the user wants to be called... Something like that.
December 09, 2017, 12:47:56 AM
Fox: So like... for starters, one idea I had was to make it so anyone can name anyone... much like how it works on Skype, and you (the namer) would be the only one to see it, and such...
December 09, 2017, 12:45:02 AM
Fox: Would need to be carefully thought out and tested, though.
December 09, 2017, 12:43:02 AM
Fox: I'm thinking I could make it so that name changes can happen whenever... (Without any limit)... Since I believe there's a way to do it with minimum confusion. (I think.) Hmm....
December 09, 2017, 12:31:36 AM
Fox: (I mean an offline version... at least initially.)
December 09, 2017, 12:25:01 AM
Fox: Now that I have thought about it a bit more, would I be right to assume that GSHC would be one of the most interesting websites to administrate, or no? It's sad to see not much going on with it. == I almost want to make a concept website at some point. :D Anyway, how is everyone doing today?
December 06, 2017, 12:12:59 AM
Fox: Like... Start using Github or something... Do like how many of those other projects such as Citra (WIP 3DS Emulator) does. Etc.
December 06, 2017, 12:08:12 AM
Fox: No idea. I just wish OpenGoldenSun would release it as unfinished, but oh well.
December 05, 2017, 06:52:09 AM
MaxiPower: Bummed out that the open golden sun project is dead it seems with no actitivy in close to a year at this point. Is there any hope left in any other projects?
November 27, 2017, 10:25:28 AM
Fox: (When I say research, mainly refering to the data in the game, though checking websites can count to a degree.)
November 27, 2017, 09:52:27 AM
Fox: Maybe. But Dark Dawn is meh, hahah... I still research it, though, because data can be interesting.
November 27, 2017, 05:28:36 AM
Portakin: I'm here! This game is underrated!
November 25, 2017, 08:03:23 PM
Fox: .... and the email listed in that post makes me think we should just make a new rules topic with most of the same information. (So the old ones can be sort o archived.)

Affiliates
Temple of Kraden Golden Sunrise
Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.068 seconds with 20 queries.