Golden Sun Hacking Community
February 23, 2018, 06:35:21 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 ... 5
1  General Hacking / General Editor / Re: Making text editor. on: January 25, 2018, 03:32:15 PM
So like... something like this? (Incomplete, there's a lot of stuff that I haven't studied.)

Sorry the lack of reply, I was kind of busy.

I'll send it to earth to see if that's what he wanted. Thanks a lot!!!
2  General Hacking / General Editor / Re: Making text editor. on: January 16, 2018, 02:25:51 PM
Good news!

The person that made the script format (earthdarkness) is back, so I'll share this infor with him, he'll find it really useful:).

Btw, about the big text, which function is the one that draws it on the screen????  How does it work?

I'm asking because we wanted to change it from 2byte reading to 1byte per char reading as it had been done with the normal text.
3  General Hacking / General Editor / Re: Making text editor. on: December 18, 2017, 06:04:24 PM
Well, yes.... That is basically it. THUMB is cut-down ARM. However, I usually say ARM for 32-bit instructions, and THUMB for 16-bit instructions. (Kind of how it is labeled in VBA's Tools>Disassemble...)

Quote
So that area is where the functions are stored is that right? As in, each call in the control codes refer to the functions in that place you pointed out.
Well, kind of indirectly. I guess you can kind of think of it like a tree, but the root/parent functions for the control codes/commands aren't in this area. (However, they may call some of these functions, may need to check into that.)
In what I posted, I was going through the code to list what looked like functions that can be called. (Generally.) Usually they're easy to tell because most functions (not all) are nested in push and pop instructions.

Quote
As normmatt explained us, at least one DrawCharacter is called to draw normal text, while the other is called when the text box contains BIG characters (if you play the game, just the first text to show up will have a bigger font and be displayed in the middle of the screen)
Maybe. What I read from a quick read of the code /seemed/ to contradict your statement (at least at first)... But until I have figured out where everything is. I can't say whether I've misread or not... While Summon Night's code seems easy to read (compared to some games), I do make mistakes....

08001F14 calls
- 08003BC0
- 08003EB8

080020A8 calls
- 0800348C then 080041C8
- 080043E4 (at end)


I see, thanks for the explanation! Glad it's not as hard to read as other functions! That's a slight relief :P
4  General Hacking / General Editor / Re: Making text editor. on: December 14, 2017, 02:14:35 PM
Are there only like ~two ARM functions in this game (and the rest is THUMB.) or am I missing something?


---
@What do you say?
Sure, I guess.

---

@Next post: Thanks! I've added them, but I need to figure out those others in the area...
Quote
08001D0C = Stores table addresses to RAM.
 03002970 | 08BDA40C 098C8D9C 09718FFC 094D446C 09E2261C
08001D3C = File look up(table number, index of file) ; Returns address
08001D5C = File look up(table number, index of file) ; Returns size
08001D78 = File look up(table address, index of file) ; Returns address
08001D88 = File look up(table address, index of file) ; Returns size

08001D94 =
08001D98 =
08001DC4 =
08001DE8 =
08001E14 =
08001E38 =
08001E4C =
08001E64 =
08001E70 =
08001EA0 =
08001ED4 =
08001EE4 =
08001EFC =
08001F14 = DrawString(dest, textAddr, , src_offset (16-bit), bg_color)
080020A8 = (Text related)
080022B4 = (Text related) - Alternates between calling 08003B9C and 08003BA8 for each text character. No idea if it was meant to clear character.
08002388 =
080026CC =
08002A64 =
08002CB4 =
080031E8 =
0800348C = GetCharacterAddressInFont(text character id)
0800350C =
08003620 =
08003664 =
080036C4 =
080036F8 = (Text related) Draw string? (dest?,srcText,?)
0800379C = “
08003840 =
0800393C =
08003A20 =
08003B9C =
08003BA8 =
08003BC0 = DrawCharacter(src, dest, src_offset, bg_color)
08003EB8 = DrawCharacter_0(src, dest, src_offset, bg_color)
080041C8 =
080043E4 =

080044B0 = -- From here on down - I/O stuff (Indirectly)

Those two: DrawCharacter and DrawCharacter_0... Seem like each are called alternatingly... (Every other character using one, the other "every other character" using the other? Hmm.... But as with what I have in the quote, there's clearly more stuff to look into... so...

Glad it was useful!! One question about your first statement, how you differentiatie between ARM and THUMB functions? I though THUMB was just a subset of ARM, just with 16bits instructions.

So that area is where the functions are stored is that right? As in, each call in the control codes refer to the functions in that place you pointed out.

As normmatt explained us, at least one DrawCharacter is called to draw normal text, while the other is called when the text box contains BIG characters (if you play the game, just the first text to show up will have a bigger font and be displayed in the middle of the screen)
5  General Hacking / General Editor / Re: Making text editor. on: December 13, 2017, 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)
6  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?
7  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.
8  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!
9  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.


10  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.

11  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
12  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.
13  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
14  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.
15  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
Pages: [1] 2 3 ... 5
Cbox
February 19, 2018, 09:50:20 PM
KyleRunner: "difficult thing about the army": I'm very good at taking orders, so I don't have issues with autority or discipline. The most difficult thing is to be away from my family sometimes. I lived an entire year away from my son, so I'd say that was the most hard part by far. Now it's great!
February 19, 2018, 05:51:35 AM
Fox: I'm happy to see we have plenty of people serving the country here. :)
February 19, 2018, 05:47:15 AM
Fox: Civilian here.
February 19, 2018, 03:05:38 AM
Majora: Good for you, something to be proud of. Air Force, here
February 19, 2018, 02:11:31 AM
Fox: That's good to hear... just checking if there were any possibility of doubt. What would you say was your most difficult thing about the army?
February 18, 2018, 12:39:38 PM
KyleRunner: Well, it was a destiny kinda thing, but I was very happy when I decided to join. It was just like I thought it would be (not in the beginning, though). I'm very pleased with my decision.
February 17, 2018, 11:32:41 PM
Fox: That's awesome!  Trying to figure what question I want to ask Something about how you felt when you made the decision to do the army, and whether it was different than your expectations/etc.
February 17, 2018, 01:53:41 PM
KyleRunner: Wow... My english got rusty. Anyway... I'm in the army now. My life turned 180. But I think it was for the best.
February 16, 2018, 12:45:45 AM
Fox: Hm? So where does that make you today?
February 16, 2018, 12:06:38 AM
KyleRunner: Five years ago I could not even imagine where I am today. I hope it works well for you too!
February 12, 2018, 07:22:50 PM
Fox: 2018 - The year that I will probably be working a manufacturing job. xP What would I have thought, if I told myself this five years ago. Eh?
January 28, 2018, 08:35:28 PM
Fox: You referring to changing the PC/leader sprite to someone else? - I forgot to mention that you can do this using VBA's memory viewer. (Found under Tools.)
January 28, 2018, 03:46:22 PM
shenlong: Hi, Im following up on @Raijinken's question about the sprite change... How do I access that to change it? and can you tell me what the values are for the characters? newbie here
January 26, 2018, 10:12:00 PM
roger: h a p p y  b i r t h d a y  z m a n
January 26, 2018, 01:38:04 AM
Fox: (Assuming you're going for "E")
January 26, 2018, 01:37:06 AM
Fox: So like... https://i.imgur.com/cI4Bgoy.png = Does not explain how it works, but follows this type of thinking.
January 25, 2018, 09:57:44 PM
Fox: Hm... Actually, this gives me an idea! What if the lighthouse becons on each lighthouse were actually portals?
January 25, 2018, 09:56:19 PM
Fox: Hard to explain without a diagram or something... but I could decide on that later. Right now, it turned out I dreamed of something! Something to do with going into the dark dimension... and to go between light and dark, required some energy (energy sphere/warp portal?) to be on... I forget most of the details of the dream now, but it's like you could get trapped in the dark world. Er...
January 25, 2018, 04:56:04 PM
KyleRunner: Can't understand... but... nice!
January 24, 2018, 06:20:33 AM
Fox: Third approach idea = Scan char tables and set up an array that helps to quickly jump over bits that are scanned in the char tables.... to kind of mimic an actual tree a bit better/ and reduce unnecessary scans.).... (untested, but what to know what it's speed is like.)

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.055 seconds with 20 queries.