News: 11 March 2016 - Forum Rules

Author Topic: Entering Fonts for Kanji  (Read 2346 times)

Zaikal

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Entering Fonts for Kanji
« on: April 24, 2018, 12:21:53 pm »
I am currently altering the font graphics for Link to the Past but I am about to reach an impasse as I slowly make my way to the kanji graphics. I am still in the middle of changing the hiragana graphics but seeing the amount of kanji that lie after the katakana graphics makes me wonder what I am to do with the kanji graphics.

Considering how many kana graphics there are, there won't be any English alphabet letters left for the kanji graphics. There might not even be enough to finish the katakana graphics.

What should I do with the kanji graphics? Should I replace them with even more Latin letters or maybe reuse English alphabet letters?

FAST6191

  • Hero Member
  • *****
  • Posts: 3244
    • View Profile
Re: Entering Fonts for Kanji
« Reply #1 on: April 24, 2018, 05:20:45 pm »
I don't follow.
How are you modifying them?

If you are replacing things for a translation or something then OK. Who cares if there is Japanese that the end game will never stick on the screen? If you are altering them for some kind of size change then why are you also replacing things?

Psyklax

  • Hero Member
  • *****
  • Posts: 1112
    • View Profile
    • Psyklax Translations
Re: Entering Fonts for Kanji
« Reply #2 on: April 24, 2018, 06:06:36 pm »
What in God's name are you doing?! I think you misunderstood what another poster on the forum told you.

You do NOT need to edit the Japanese in the ROM! They're just pictures, nothing more. If you're trying to find text in the ROM, you do NOT need to do anything to the graphics! Relative searching is just a way to figure out where some text is, and then make a table, but even relative searching is hardly necessary. Besides, this is Link To The Past, for crying out loud, a game that is already in English, and probably has documentation out there detailing its inner workings.

Look, the way games use text, they have a bunch of bytes, and each byte refers to a different character. Different games have ways of dealing with kanji, but let's start with NES games that use no kanji as a starting point.

Most games draw the kana in the graphics banks in the typical Japanese order: a, i, u, e, o, ka, ki, and so on. Then, based on that order, a game will know where to find a particular graphic for a character and put it on the screen. In a byte we can go from 00 to FF, so let's say "a" is 01, "i" is 02, and so on, with hiragana and katakana, and punctuation and numbers and a capital English alphabet if need be. That'll all fit in the 256 limit we have for one byte. So when the game sees 04, it puts the graphic in that position on the screen - in this case, "e".

Kanji is a problem because it invariably needs more than 256 characters, so there are different ways of doing it. The simplest is to use two bytes for each character, giving a total of 65,536 possibilities, but that's not very economical so 16-bit console games don't usually use it. Another way is having, say, four banks of characters, and saying which bank you want. So 00 01 picks bank one, 00 02 picks bank two... then you can use whatever characters you need in that bank, then switch with that two-byte code.

I really hope you're following what I'm writing because I'm rushing a bit, now that I realise you got some terrible advice and got off on the wrong foot. :) But please, stop drawing all over the kanji because you're wasting your time! What the guy in the other thread meant to say - but phrased it poorly - was "yes, if there is no English alphabet, you should replace SOME of the kana with it", but not the whole thing! Just do your A to Z and be done with it, that's all you need.

Again, is there a specific reason you wanted to get into LTTP? It's really not a good first choice, given that it's already in English (I'll never understand why people do this). I highly recommend starting with a NES game which isn't already translated (there are hundreds) and use FCEUX to help you with debugging. Transitioning from NES to SNES is easier than starting from scratch with the SNES. Even if it's a game you don't care much about, it's better than wasting time on something that really doesn't need it.

Any other questions, please ask. I really don't like seeing people get in a pickle like this. :D

Zaikal

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Entering Fonts for Kanji
« Reply #3 on: April 24, 2018, 10:52:49 pm »
Oh, ok I think I'm starting to understand a bit better.

So assuming that the JP ROM has no English alphabet, I would have to replace kana graphics with the English alphabet A-Z and a-z. This doesn't have to take up all of the kana, just up until I have input all of the alphabet. This means if "z" replaces "ネ" then I would have the range of alphabet corresponding to あ-ネ. However, if the JP ROM does possess the English alphabet, then I wouldn't have to do any font graphics editing.

As for kanji, I am interpreting it as there are 4 banks of kanji characters and the 2nd pair of bytes indicates which bank to draw from. I'm assuming this means that the 1st pair indicates which kanji is being represented from the appropriate bank. This would mean 30 03 corresponds to the kanji with a byte value of 30 from bank 3 of the kanji characters.

I hope I am understanding this correctly. Please correct me if I'm wrong!

I chose LTTP because I thought it might be a good starting base for someone who has no experience with ROM hacking. Would you recommend I put LTTP on the back burner and perhaps revisit it once I get a better understanding of ROM hacking?

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7185
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Entering Fonts for Kanji
« Reply #4 on: April 25, 2018, 01:53:06 am »
I'm fairly sure Japanese A Link to the Past has at least the uppercase English characters. I don't know if it has all the punctuation needed (often they don't. Japanese games with some English font are likely to have characters like ! and ? but not often would they have an apostraphe, for example.

There are many different ways a game could store kanji.
I've seen games where kana is stored as single byte and kanji is stored as a two bytes. (say for example, a hex sequence of 01 xx could mean kanji xx in bank 1 but characters 04+ are single-bytes.
That is the same idea as Shift-JIS: Shift-JIS is backwards compatible with ASCII as it treats values under 80 as normal ASCII text while 80+ indicates the first byte of a two-byte kanji ID.
But that is just a general example, I don't know how this game exactly stores text so I don't know the exact values.

I would say first just try to find some kana text in the game, without worrying about the kanji at first. Once you find some kana then you can work out how the kanji is stored.
"My watch says 30 chickens" Google, 2018

Psyklax

  • Hero Member
  • *****
  • Posts: 1112
    • View Profile
    • Psyklax Translations
Re: Entering Fonts for Kanji
« Reply #5 on: April 25, 2018, 06:06:39 am »
You got the first part correct, however...

30 03 corresponds to the kanji with a byte value of 30 from bank 3 of the kanji characters.

That's not exactly what I meant. I was describing how one particular game did it, and every game is different. Some games are happy with 256 byte values for everything: kana, alphabet, numbers, punctuation, plus enough kanji to get by. Games with huge amounts of text need a different system.

I chose LTTP because I thought it might be a good starting base for someone who has no experience with ROM hacking. Would you recommend I put LTTP on the back burner and perhaps revisit it once I get a better understanding of ROM hacking?

I just don't know what you hope to achieve from hacking LTTP at all. Why translate a game that's already translated? If your intention is just to get into hacking somehow, your best bet is to start with something simple, and by that I mean 8-bit.

My first hack was a Game Boy Color game with lots of text in a big cartridge. The 8-bit CPU made it relatively simple, there was no kanji to complicate things, there was tons of room inside the ROM... it was pretty simple.

I do think the NES is even better though: the CPU is even simpler to understand (for me), there's a ton of documentation and previous hacks, plus of course people like me and KingMike can give you excellent advice given our experience on the system. ;)

Just find a game that's not been translated and have a go, the simpler the better. Any questions, let us know. :)

Zaikal

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Entering Fonts for Kanji
« Reply #6 on: April 25, 2018, 12:31:59 pm »
Thanks for the advice everyone! I'm gonna shelf LTTP for now and try to start on something on the NES.

Do you guys have any advice on finding random games that haven't been translated yet?

Mauron

  • Submission Reviewer
  • Hero Member
  • *****
  • Posts: 551
    • View Profile
Re: Entering Fonts for Kanji
« Reply #7 on: April 26, 2018, 12:57:43 pm »
The Translation Request List in the wiki should be a good list of untranslated games.
Mauron wuz here.

filler

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 989
  • "WINNERS DON'T SELL REPROS"
    • View Profile
    • Filler's Translation Projects
Re: Entering Fonts for Kanji
« Reply #8 on: April 26, 2018, 01:44:36 pm »