News:

As a consequence of the forum being updated and repaired, the chatbox has been lost.
However, you can still come say hi on our Discord server!

Main Menu

Making text editor.

Started by Lord Wolfram, 25, June, 2014, 01:34:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FrozenWrath

You're not a computer, Saturos.

You're a Proxian. So celebrate with us!

Lord Wolfram

Quote from: ScarletFlames on 05, July, 2014, 03:29:10 PM
You're not a computer, Saturos.

You're a Proxian. So celebrate with us!
Hahaha!
Thank you Scarlet!
By reading this my mood has become better.
What a terible morning for me it was.
Hahaha
:happy:   :happy:   :happy: :happy:
:Saturos: :Menardi: :Agatio::Karst:

Luna_blade

And you're absolutely sure you installed the right .NET Framework?
Otherwise, I don't have a clue what the problem is and then it might indeed be more usefull to switch to Java.
:happy:
:Babi:
:um:
:Luna_blade:
If it only would have worked...
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#23
QuoteAnd you're absolutely sure you installed the right .NET Framework?
By the way, which one was it again? Almost forgot that that was the problem... So thanks for mentioning.

@Swithcing to Java: How would it be more 'useful'? Are you referring to multi-platformness, or something else?


Quote@Fox. So in other words to translate that game I don't need datahandler.
Correct. A DLL is a Dynamic Link Library... Basically, it's like storing functions/code in an external file. I think they're useful for when you want to code in multiple languages. But I don't think you'll be needing it. (Unless you are trying to learn to code.)

Having DLLs may also be useful if you have many programs that use the same functions. (I think) Since it may save space, assuming programs cannot easily access code in other programs. ; However, I doubt that applies to us right now.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Lord Wolfram

I will dawnload JDK real soon.
Once I get it how will I use this(For What purpose?)?

And IDE...
For what will I use it?

Daddy Poi's Oily Gorillas

#25
JDK = Java Development Kit - I'm guessing it's the compiler, or something. (Read http://en.wikipedia.org/wiki/Java_Development_Kit for contents.)  I know it has to be downloaded separately if you use NetBeans, but I'm not sure about if you use Eclipse.
IDE = Integrated Development Environment - This is the program you code in.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 06, July, 2014, 05:48:09 AM
By the way, which one was it again? Almost forgot that that was the problem... So thanks for mentioning.

@Swithcing to Java: How would it be more 'useful'? Are you referring to multi-platformness, or something else?
VS 2008 supports 3.5 and later 4.0 I think...
More usefull because he fails to use VS... I guess a bad choice of words there.
Quote from: Fox on 06, July, 2014, 05:48:09 AM
Correct. A DLL is a Dynamic Link Library... Basically, it's like storing functions/code in an external file. I think they're useful for when you want to code in multiple languages. But I don't think you'll be needing it. (Unless you are trying to learn to code.)

Having DLLs may also be useful if you have many programs that use the same functions. (I think) Since it may save space, assuming programs cannot easily access code in other programs. ; However, I doubt that applies to us right now.
I forgot DLLs in .Net Framework are actually multi-language. I'd love to have a little discussion about why and how DLLs...

@Saturos: Good luck.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Lord Wolfram

#27
Which kit you suggest?which is needed?
I can't download too much because of limits of internet...

Daddy Poi's Oily Gorillas

#28
Java SE might be the one you're interested in.

I think SE means Standard Edition, and EE means Enterprise Edition.

Not sure of the main differences between the two at the moment, but it seems like EE does web applications...

Mouse over the plus signs on the left if it helps.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Lord Wolfram

#29
Alright downloading SE.
Downloading in process :um: :um: :um: :fury: :irate: :idea: hmm while it is loading I am thinking.
I downloaded this JDK file Name (jdk1.8.0_05) :?: is this correct file? or I must look for other?
I have to wait 6 minutes...I hate to wait sometimes :irate:

Now once again there is a problem! :!:
To instal this I need JDK in special folder or something :um:
I will ask help to my sister because I must go well then lets hope she will success.

Daddy Poi's Oily Gorillas

#30
jdk-7u45-windows-x64 = This is what's in my Downloads folder, so this might be the one.   File Description says... Java(TM) Platform SE binary

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

I think the latest might be u60.


Hmm... an ad advertising Java 8? I guess I'll have to put that on my list of things to keep an eye on. (Assuming it's not out yet?)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Lord Wolfram

shows error message.
it is not valid win 32 aplication.
oh well then I will look for other wersion.

Daddy Poi's Oily Gorillas

That's because x64 is for 64-bit computers like mine. I think you have a 32-bit one, so you'll have to get the 32-bit version.

Which I believe is this one:
Windows x86   127.91 MB     jdk-7u60-windows-i586.exe
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 09, July, 2014, 12:18:23 PM
That's because x64 is for 64-bit computers like mine. I think you have a 32-bit one, so you'll have to get the 32-bit version.

Which I believe is this one:
Windows x86   127.91 MB     jdk-7u60-windows-i586.exe
There's about 99% chance he has 32bit, because he runs XP IIRC.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#34
So does 64-bit support start at Vista? (I use to use that until I got a new computer that uses W8... about 7-ish months ago.)

Oh, and Java 8 JDK page: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Lord Wolfram

#35
We can celebrate because I successfully installed everything I the mighty Saturos need!
:happy:
:Saturos:

So Fox what we shall do now?
There are always support teem.
http://gbatemp.net/threads/summon-night-craft-sword-monogatari.227224/page-21

Hahaha. yeah it is me!

Daddy Poi's Oily Gorillas

#36
I think I saw that topic (And your posts there) when I first looked up that topic after you first mentioned summon night at one point... I also looked up the topic at romhacking.net, and that's when I believe I found that github project... I think.

As for where to start? It depends on what you want to do. I do know it helps a lot to know assembly.

(By what you want to do.. I mean like... what do you want to translate at the current moment? In case there are several different script tables or something... Not sure, since I haven't documented much of the game beause of laziness... it's a huge file.)

Edit: I guess for starters, you can at least add in code that can load the ROM to a buffer and later save back to the file: (FYI: This is in my GS Editor for Java.) You'll need to call the two functions openFile and saveFile when necessary. The dialog argument is whether to use the current path or ask for a new one. (If there's no current path, it'll ask for a new one.) For example, saveFile(0) for Save, and saveFile(1) for Save As...

[border][heightmax=300]   byte[] buffer;
   int pos = 0;
   String path;

   void openFile(int dialog) {
      if ((path == null) || (dialog == 1)) {
         final JFileChooser fc = new JFileChooser();
         switch (fc.showOpenDialog(null)) {
         case JFileChooser.APPROVE_OPTION:
            path = fc.getSelectedFile().getAbsolutePath();
            break;
         case JFileChooser.CANCEL_OPTION:
            buffer = null;
            return;
         }
      }
      try {
         FileInputStream input = new FileInputStream(new File(path));
         byte[] data = new byte[input.available()];
         input.read(data);
         input.close();
         buffer = data;
         return;
      } catch (FileNotFoundException ex) {
         // Messagebox FileNotFound
         javax.swing.JOptionPane.showMessageDialog(null, "File not found: "
               + path);// , "InfoBox: " + location,
                     // JOptionPane.INFORMATION_MESSAGE);
         buffer = null;
         return;
      } catch (IOException ex) {
         javax.swing.JOptionPane
               .showMessageDialog(null, "IO error: " + path);
         buffer = null;
         return;
      }
      // return null;
   }

   int saveFile(int dialog) {
      if ((path == null) || (dialog == 1)) {
         final JFileChooser fc = new JFileChooser();
         switch (fc.showSaveDialog(null)) {
         case JFileChooser.APPROVE_OPTION:
            path = fc.getSelectedFile().getAbsolutePath();
            break;
         case JFileChooser.CANCEL_OPTION:
            return -1;
         }
      }
      try {
         FileOutputStream output = new FileOutputStream(new File(path));
         // byte fileData[] = new byte[output.available()];
         output.write(buffer);
         output.close();
         // return fileData;
         return 0;
      } catch (FileNotFoundException ex) {
         return -1;
         // Messagebox FileNotFound
         // javax.swing.JOptionPane.showMessageDialog(null,"File not found.")//,
         // "InfoBox: " + location, JOptionPane.INFORMATION_MESSAGE);
      } catch (IOException ex) {
         return -1;
      }
   }[/heightmax][/border]
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Lord Wolfram

It is said by Pablitox :
The translation of the script is 100% complete
about text insertion:
Objects 100%
magic 100%
Weapons 100%
Techniques 99%some are missing
bestiary 99% pending boss data
script 5 % up till murno first conversation
howewer the scripts were destroyed or something.(don't understand exactly what happened with them.)
in other words we must translate dialogue and what tells villages.
make it like Atrius did.

Daddy Poi's Oily Gorillas

#38
Whoops... I guess I had poor wording. I meant which part of the game should we alter first? But I see it's between Techniques, Bestiary, and Script.

By the way, which place do you recommend to grab the translations from?

I know there is this: http://sntranslation.vacau.com/index.php , but I've been too lazy to register there at the moment. Edit: Until now.

I have a feeling that we won't have to worry much about String lengths, and instead, the length of the entire section, but I'll have to look into it to make sure. It all just depends on if I can make a program that can repoint all strings in the section. (It's probably better that I not mention this until I have a better understanding on what's going on...)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Lord Wolfram

#39
So this is that post about what must be done to finish project. so what do you all think can we do this?

   Here is what needs to be done

   VERY HIGH LEVEL OVERVIEW Richburn had developed tools which don't seem to be able to handle pointers changes correctly, and which use their own very specific formats for tables (i.e. characters matching to hex), for text dumped, for translation and opcodes. In my humble opinion, improving them to work ok in terms of pointers would be a real pain. However, the folders which Pablitox has been putting together contain good info, so it is worthy looking into them to understand the info available - with a view to re-creating a dumper and an inserter, with pointers accounted for this time. This is what I will detail here. Wastor, on his end, has done everything ok on Summon Nights 1, and has shared the info of "how" with us. So it is good to read all he gave us, try and get familiar with how it works on Summon Nights 1, and then see how much of that can be applied to Summon Nights 3.

   So step zero is to read all that has been shared. Info that is not useful: - Richburn's tools code is very not easy to read to me. So I wouldn't bother with the code. Do however read any txt/doc that comes with it. - There's a guy who did a font attempt with 2 ASCII characters for each 2-byte code used by the game. That's a waste of time in my opinion, because it was done to reduce the size of the text, and Pablitox's counting of the characters shows that we don't need to worry.

   Step 0 should also include reading all the PM's I sent to Pablitox :) :) and looking into the ROM itself while reading them.

   REPRODUCING WHAT WASTOR HAS DONE -SIMPLE STEP ALL IN JAPANESE Start with Summon Nights 1. Look into the ROM. Look for "PSI3" and you will find many occurrences. These mark the start of a block of text. There are many of them PSI3's, because the text is split into small sections, each section is "played" by the game when dialogue is presented. It is not 1 section per character chat, but one section for a few. The text is not directly readable, because it has been compressed. To be more precise, there are 2 layers: - PSI3 encapsulation (this one should be a simple matter of cutting out the bytes) - LZsomething compression. (Cue has created tools that handle that one - I haven't tried, so I don't know what parameters to use, but Wastor knows. Maybe you can even read it in one of his PM's. He was referring to http://www.romhacking.net/utilities/826/ if I understood well.) So there you have to: - split the PSI3 sections out of the ROM (write a specific program for that, in your vaforite language) - apply CUE's decompressor to them (batch file calling for each of them thousands of extraced files. Get parameters from Wastor.) - enjoy reading the Japanese text - get Pablitox to confirm this indeed seems to be the script, and point out the first few sentences (for later test). Also, you should be reading here that there are "non-text bytes" in the text. These are "opcodes", i.e. commands given to the game's engine to do extra things while presenting the text. Some typical ones are "press any key to display the next window of text", "change character portrait to show surprised look", etc. Each game has its own set of opcodes. Don't dig too much into these ones here, except for the ones that insert pointers. (See the text file that has some opcodes explained in it for Summon Nights 3.)

   And now it's time to re-insert. One complexity here: CUE's encrypter will not produce the same result as the gamer originally did. Right now, it is a pain because, if I got it well, I think it means you have to handle the in-text pointers right away. Not sure. Try to recompress and play directly. If it works, be happy! :) To rehash, take the same steps as before in reverse order: - compress the Jap' text with CUE's tool - re-create the PSI3 headers - insert the PSI3 sections back into the ROM. Note: you will probably need to insert useless bytes at the end of the PSI3 sections because the new ones are a bit shorter than the original ones. Play and verify that it works. Debug if it does not. :)

   REPRODUCING WHAT WASTOR HAS DONE - A BIT OF ENGLISH Now that this works, it's time to insert a bit of English and get familiar with these in-text pointers. Translate a bit of text (preferably at the start of the game, for ease of texting), making it longer than it was. the goal is to have longer text in English than when you re-compress with CUE's tool, but stay within the size of the re-compressed Japanese text. Insert line breaks /new window opcodes as needed for it to look ok. There should be pointers in the text. Ask Pablitox about them - from what I understand, they give a "jump" order depending on which of the heros you are playing, and probably other things. The "bad" thing here is that they are really offsets (either relative to the PSI3, or absolute offsetsin the ROM, I am not sure. I was not able to make Wastor explain that correctly, probably because of my limited Spanish, but you can try and be a pain to Pablitox until he gets the right explaination. Right, Pablitox? ;)) So, because you inserted larger text than in Japanese, the pointers will be wrong. You need to correct them. It's ok to start doing that manually in the insertion process, to test it out. Then re-run the rest of the chain (CUE encryption, PSI3 encapsulation, ROM insertion, play!) until you get them right. Once you have them right, you have to get your program to do it automatically for you (i.e. understand how they are calculated and make the program handle it).

   Once that is ok, you will have done all you can with Summon Nights 1. Training is over, it is time to go into the tough part! :) :) Just kidding. Anything from now on is related to Summon Nights 3.

   MORE INFO ON CREATING THE DUMPER You need to check the PSI3 struccture, to see if your tool from Summon Nights 1 to extract them and de-capsulate is still working or needs adapting. After that, you run CUE's tool and cross fingers that it works. If it doesn't, try and understand why (I mean - what difference do you see in the bytes?) and see if you can tweak any parameter the tool takes in order to make it work. If it doesn't, call for Cue's help through Pablitox. ;) If all goes well, then you have a long japanese text in front of you (split into many files). Get Pablitox to confirm that this is indeed the right thing, jut to be sure. Then you are on for the same thing as we did with Summon Nights 1. Re-insert the japanese as-is in order to get your toolchain ok. (Especially: if you changed things during the dumping, expect to change things during the insertion.) Once that works, translate a small part, correcting the pointers, with the same constrinats (don't get the compressed size bigger than the original compressed Japanese, but do get it bigger than the CUE-re-compressed Japanese.)

   FITTING INSIDE THE ROM After that, we are almost done preparing the tools. Almost. The last problem to take care of is to make it that text will fit inside the ROM. A bit of background info here: the ROM size for Summon Nights 3 is already at the maximum accepted by the GBA. So there is no magic here. And you can look for free sections that can be overwritten, but they are not very numerous and not very large, except for about 200KB at the end of the ROM. so keep in mind that you have that space to look forward to for later. You will have to sue 2 techniques to fit inside the ROM: change character encoding to ASCII, and relocate text. Text is currently encoded in SJIS. (You used the table of that name to get to the Japanese.) This means that, when you insert English back into the ROM, it is still encoded in SJIS. SJIS's encoding of A-Z and a-z characters is using 2 bytes for each character, which is a waste of space. So your mission is to replace SJIS with ASCII. What this means is: - you need to get your tool to produce ASCII instead of SJIS. Depends on how your tool is done - I leave that up to you. Maybe you only need to change the encoding of the text files, after text has been translated? (Notepad++ allows that for instance.) - you need to get the game to understand ASCII. This is the trickiest part. . First, locate the font's graphics in the ROM. CrystalTile2 or TileGGD can be used for that. I'm not good at it, so I can only wish you luck. . Then you need to find the routine that translates "character codes" (i.e. bytes in the table) to offsets within the font. You should start from a breakpoint on the location of the text, and step instructions until you find the right calculation. Have the address of the font at hand, it will help recognize an address that is within the range of the font. By "font" I really mean the font's graphics, here. Once you find it, you are ready for changes. The SJIS encoding of "A" is 8260. The ASCII encoding is 41. After that, characters are in the same order. So you need to add 8220 to the characgter codes read byb the game, before it goes on with its usual processing of the letters to display them. And that's it - you just divided by 2 the amount of space required!!!

   GETTING ENOUGH SPACE ON SCREEN Of course, there is more to do. One item comes to mind: you will need to use a variable-width font in order for the text to have enough space on screen to be displayed properly. As this is one of the last items you will get to,and i am not really that familiar with it yet, I suggest we tackle it (or you call for help on RHDN) once you get there.

   USING THE EXISTING TRANSLATION Pablitox has an existing translation of all of the Japanese text into English. Which is great, right? But we just changed the format in which the text was dumped, in order to match your new tools, and the format that Pablitox used was not insertable anyways, because all of the opcodes were erased... So, time for a new program, right? The translated text takes the following format: Japanese English Translator's name Note also that the name of the file containsthe initial address of the PSI3 block that contained it in the Japanese ROM.

   Good news: we don't care about the translator's name (sorry guys ;)). So you can create a program that will load in RAM all of the text in format "Japanese, original offset, English". Try and match it with the dumped text. Cross fingers that these guys didn't remove too many opcodes. If it doesn't work, then get these guys back to manual work to insert their translations into the dumped text. (After all, this is the only way to get things back into the ROM.)