+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Implement an English font.
Pages: [1] 2
Author Topic: Implement an English font.  (Read 1553 times)
Rai
Guest
« on: April 21, 2007, 03:57:35 pm »

All the text is dumped for this one game that I'm working on, and it's to the point where everything can be translated. But the big problem is that the game has no English font and I don't believe with my small amount of ASM knowledge I can implement one. So basically you put in English text and you get scrambled crap. So I need to figure out a way to implement an English font, but I don't know ASM. The only other choice is to use two byte Japanese English which is takes up way too much space. I need to figure out a way to add an English font. Seriously though, I can't figure out this ASM stuff.
Tauwasser
Guest
« Reply #1 on: April 21, 2007, 04:17:15 pm »

Well, you have two or more problems. First, you need to work out how to change it to one-byte text. Then you need to find the font in the rom and insert a proper english font. Also, you're either going to have many line breaks and ugly fugly font, or you needa vwf hacked in as well.
As I saw from the other some five threads you have, you don't have enough knowledge nor seem willing to learn these essentials :-/

cYa,

Tauwasser
Rai
Guest
« Reply #2 on: April 21, 2007, 04:33:57 pm »

Quote from: Tauwasser on April 21, 2007, 04:17:15 pm
Well, you have two or more problems. First, you need to work out how to change it to one-byte text. Then you need to find the font in the rom and insert a proper english font. Also, you're either going to have many line breaks and ugly fugly font, or you needa vwf hacked in as well.
As I saw from the other some five threads you have, you don't have enough knowledge nor seem willing to learn these essentials :-/

cYa,

Tauwasser
I know the essentials, but I don't know have the knowledge. I'm just trying to make so that if I type uncompressed English is in a hex editor, it displays like that in game. In this game you can only type Japanese characters, and Japanese English characters which are two bytes. You see, an uncompressed JSIS table already has a regular English font in it, where each thing takes up one byte. However, the game lacks this font. I basically want to insert an English font.
« Last Edit: April 21, 2007, 04:51:39 pm by Rai »
Gemini
Guest
« Reply #3 on: April 21, 2007, 04:54:08 pm »

Whether you like it or not, you gotta learn asm and rewrite all the code needed for allowing what you seek.
Rai
Guest
« Reply #4 on: April 21, 2007, 05:15:17 pm »

Well I know that, it's just this stuff is so confusing. So I got a debugger okay, but now what do I do with it? How do I know where the text is? How do I know how it loads the text based on all those ASM codes? I understand what the codes mean, but I don't understand how that helps you understand what the game is doing. Even if I knew how the game loaded the code, it would not help change it so that the text is one byte. I basically have to get it so the game reads two byte English, as one byte English. But still I'm confused, how would I get it to recognize the value for the regular English letters, as opposed to the 2 byte Japanese English letters? Right now English only works if you type in those two byte Japanese English letters, you type regular English, you get garbage. Once this is done and the script is translated, all that'll be left is images to translate.
« Last Edit: April 21, 2007, 05:38:11 pm by Rai »
Ryusui
Guest
« Reply #5 on: April 21, 2007, 05:38:54 pm »

It's not confusing. You're flailing around in the deep end.

What I suggest is you find a project on a platform such as SNES or Game Boy and learn the basics from that instead.
creaothceann
Guest
« Reply #6 on: April 21, 2007, 05:52:12 pm »

Quote from: Rai on April 21, 2007, 05:15:17 pm
I understand what the codes mean, but I don't understand how that helps you understand what the game is doing.

"No hack for you!"


... You need to understand the algorithms of the game. Write the ASM code down, then try to translate it into high-level code, then try to understand what is happenening - the purpose of each involved routine. Then you can alter the algorithm and re-translate it back to ASM.
Suzaku
Guest
« Reply #7 on: April 21, 2007, 06:00:24 pm »

Take a step back and think about exactly what you want to do. Don't even think about it in terms of code at this point. You should be able to logically identify the routines you'll need to find and tweak or completely rewrite.

Say you wanted to program an arm to grab a glass and drink from it. Theoretically you could have:

A routine to move the arm
A routine to open and close the hand
A routine to drink from the glass.

If that's the case, the sequence would likely go like this:

1) move the arm (move the arm to the glass)
2) manipulate the hand (close the hand around the glass)
3) move the arm (raise the glass to the lips)
4) drink
5) move the arm (set the glass down)
6) manipulate the hand (release the class)
7) move the arm (return the arm to the starting position)

Hashing out this sequence requires little programming knowledge--it's all logic. You should be able to generalize what has to happen, then you can go about seeing how the game accomplishes the task. It probably has a routine for reading the font. Find that routine, and see how it works. Once you understand that, you may be able to change it from reading 2-bit characters to reading 1-bit characters. Repeat as necessary.

Step 1: Logic
Step 2: Huh?
Step 3: HAX!
Tauwasser
Guest
« Reply #8 on: April 21, 2007, 06:02:59 pm »

Well then somewhere there's a serious issue here. When you do know what every command does (and heck, even I don't know that..that's what spreadsheets are for...), you must be able to recognize the "meaning" behind it. It's like with language. You know what words mean, but all alone by themselves they don't have a statement, something they mean. Like: know; I; where; Berlin; am; in; now; right; . You could form multiple sentences out of that, but all by themselves the words don't mean much.

Same thing with assembler. Just take this for example:

Code:
...
$C0/F7B6 B7 20       LDA [$20],y[$FF:024F]         
$C0/F7B8 C8          INY                           
$C0/F7B9 C9 F0       CMP #$F0                       
$C0/F7BB 90 0E       BCC $0E    [$F7CB]             
$C0/F7BD 86 23       STX $23    [$00:0023]         
$C0/F7BF C2 20       REP #$20                       
$C0/F7C1 29 0F 00    AND #$000F                     
$C0/F7C4 0A          ASL A                         
$C0/F7C5 AA          TAX                           
$C0/F7C6 E2 20       SEP #$20                       
$C0/F7C8 7C CC FB    JMP ($FBCC,x)     
$C0/F7CB 1A          INC A                         
$C0/F7CC 4A          LSR A                         
$C0/F7CD 85 26       STA $26    [$00:0026]         
$C0/F7CF 90 0B       BCC $0B    [$F7DC]           
$C0/F7D1 B7 20       LDA [$20],y[$FF:024F]         
$C0/F7D3 9D 00 00    STA $0000,x[$7E:2000]         
$C0/F7D6 E8          INX                           
...

You can now sit and look at it line after line, but you need to get the whole picture instead of just each and every bit. It's part of a decompression routine here. Loads a byte, compares it to F0, if < 0 goes to the generic routine (which I only quoted partially...) if not takes the last four bit as an index in a pointer table at FBCC and jumps to that index.

Try to approach your code somehow and then you'll see what it does. In general, your debugger will have a breakpoint feature. Now, look up some offset for a string you already know and convert it to the appropriate address (and heck, that is a tough job, I still don't get addressing with SNES... ) err.. use Lunar Magic and hope it works right. Then set a breakpoint and it should break either a) when it's loading all the text into ram or b) when it's reading directly what to print to the screen. Either way, you can backtrack to your text routine and start messing with it and see how it works. And that's all there is to it as far as understanding goes.

EDIT: Suzaku, your code is broken. While doing said action, the routine is going to spill an error to brain v1.0 because there is no routine for "drinking" in there Tongue Also, bits aren't bytes...but whatever Smiley

cYa,

Tauwasser
Rai
Guest
« Reply #9 on: April 21, 2007, 06:23:39 pm »

Quote from: Ryusui on April 21, 2007, 05:38:54 pm
It's not confusing. You're flailing around in the deep end.

What I suggest is you find a project on a platform such as SNES or Game Boy and learn the basics from that instead.
I like the idea, got any suggestions?
RedComet
Guest
« Reply #10 on: April 21, 2007, 07:18:02 pm »

Quote from: Rai on April 21, 2007, 05:15:17 pm
Well I know that, it's just this stuff is so confusing. So I got a debugger okay, but now what do I do with it? How do I know where the text is?

As you said the text is already dumped, so you know where it's at in the rom. Now what you have to do is determine where it's add in the console's memory. For SNES you have LunarAddress that'll convert between the address in the rom file and the actually SNES address. For the NES, ROM starts at $8000 and ends at $FFFF. Couple with a little mapper info, you can determine where the bank containing the text is gonna end up. An even easier method is to just find the pointer. Provided their "normal" pointers, the values of the pointers will be the address of their corresponding strings when their in ROM. Set a breakpoint for this address in your debugger and when it snaps you should be in the routine that reads the text.

Quote
How do I know how it loads the text based on all those ASM codes? I understand what the codes mean, but I don't understand how that helps you understand what the game is doing.

(Emphasis added.)

If you don't understand how, say, LDA [$20],y (using Tauwasser's example) is able to load data from rom, then you don't really understand what the codes mean.

Quote
Even if I knew how the game loaded the code, it would not help change it so that the text is one byte. I basically have to get it so the game reads two byte English, as one byte English. But still I'm confused, how would I get it to recognize the value for the regular English letters, as opposed to the 2 byte Japanese English letters? Right now English only works if you type in those two byte Japanese English letters, you type regular English, you get garbage. Once this is done and the script is translated, all that'll be left is images to translate.

Stop thinking in terms of English or Japanese. The game does not care whether the text is in English, Japanese, Klingon or any other language. It knows that it's been given a value that corresponds to a tile or set of tiles. It takes the hex value, performs a little math to get the address of the corresponding tile(s), and then loads the data for the graphics.  (Pixel based systems are probably slightly different but the same logic still applies - hex value becomes an address where the corresponding graphic is.)

That's it. Language or what I had for breakfast do not matter.
Shadowsithe
Guest
« Reply #11 on: April 21, 2007, 07:18:27 pm »

Quote from: Rai on April 21, 2007, 06:23:39 pm
Quote from: Ryusui on April 21, 2007, 05:38:54 pm
It's not confusing. You're flailing around in the deep end.

What I suggest is you find a project on a platform such as SNES or Game Boy and learn the basics from that instead.
I like the idea, got any suggestions?
Sylvanian Families Grin
Ryusui
Guest
« Reply #12 on: April 21, 2007, 08:14:06 pm »

Hardy har.

If anything, SF1 is a shining example of the kind of project a beginner with trouble learning ASM should avoid. I had no idea what I was getting myself into when I started: the shame of realizing I had inadvertently followed in the footsteps of my hated foes at Tokyopop and Dark Horse was a major impetus for going through all the trouble of completing it.

I was thinking more like a practice project: nothing he has to see to completion, but something to help him wrap his brain around the basics of text hacking. He could start with, say, hacking strings in The Legend of Zelda or Super Mario World...something he could readily get help with (of the step-by-step Invisiclues variety, hopefully) without getting stuck.
Rai
Guest
« Reply #13 on: April 21, 2007, 08:58:51 pm »

Quote from: Ryusui on April 21, 2007, 08:14:06 pm
Hardy har.

If anything, SF1 is a shining example of the kind of project a beginner with trouble learning ASM should avoid. I had no idea what I was getting myself into when I started: the shame of realizing I had inadvertently followed in the footsteps of my hated foes at Tokyopop and Dark Horse was a major impetus for going through all the trouble of completing it.

I was thinking more like a practice project: nothing he has to see to completion, but something to help him wrap his brain around the basics of text hacking. He could start with, say, hacking strings in The Legend of Zelda or Super Mario World...something he could readily get help with (of the step-by-step Invisiclues variety, hopefully) without getting stuck.
You're talking about Link to the Past correct?
Ryusui
Guest
« Reply #14 on: April 21, 2007, 09:33:05 pm »

Any one of them, though I hear A Link To The Past uses an odd system where line breaks are "merged" with the byte for the last character in a line.
Pages: [1] 2  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC