News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: UN Squadron - Couple of translation niggles  (Read 7559 times)

4lorn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
UN Squadron - Couple of translation niggles
« on: November 19, 2011, 08:03:41 am »
Welcome, again, to another small problem I'm having. After finishing Light Crusader as far as I could, I've begun translating U.N. Squadron for the SNES to Portuguese. With some learning, testing and hard work, I can safely say I'm very close to a finished build - or getting it underway as soon as I understand something.

So far I've managed to track down, learn and successfully modify, the following things through debugs and some perseverance:

Intro text and end mission comment tilemaps
Mission briefings
Store dialogues
"Danger" and "Extinct" warning signs when hit by enemy fire (just graphic editing)
"Maintenance" (Option Menu) and "Mission Clear" tilemaps
Most locations and output of weapon names in-game
"POW" in-game readout (just graphic editing)

Those are the good news, in terms of personal achievements and getting things done on my own. I've hit two snags, however, and was wondering if anyone could tell me how to better understand what I'm dealing with.

The first problem is, of course, text that simply won't fit but must be used. At this point, there is only one instance where this occurs - "SCORE", which translates into "PONTOS".

I've been tracking most of these things with a combo of Virtual SNES (problematic, since it sometimes works and other times simply refuses to boot up, and I have no idea why, and yes it's the latest version) and Snes9x's debugging features. After some calculations with Lunar Address and Snes9x, here's what debugging tells me regarding ALSCORE (which is how the game stores the name; Level is OLLEVEL, btw):

$00/CEA9 BD 02 00    LDA $0002,x[$01:8F99]   A:0080 X:8F97 Y:0028 P:eNvMxdIzc

What I'm getting is that, it's loading a value (02) from X (8F97). This is where I'm stumped, since - assuming what I'm getting is true - I can't understand what, if anything, at that offset is handling text start and end, or even size. I might not even be near the right offset, since UNS is LoRom, and there are slightly more calculations required there.

The second problem is the "EXIT" panel in the store, as the last panel is nonexistent. The game is giving an instruction to repeat the previous tile in the series (the bottom part of "I") in the last one (which is the bottom part of "T", as both are graphically identical). I've seen this used in other main screens in the past, and couldn't quite get how to change that. It seems in this case, I'd have to draw a tile myself with the necessary word, then suppress/redirect the instruction and point to that.

Any ideas/suggestions/advice?

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7015
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: UN Squadron - Couple of translation niggles
« Reply #1 on: November 19, 2011, 12:33:13 pm »
$00/CEA9 BD 02 00    LDA $0002,x[$01:8F99]   A:0080 X:8F97 Y:0028 P:eNvMxdIzc

What I'm getting is that, it's loading a value (02) from X (8F97). This is where I'm stumped, since - assuming what I'm getting is true - I can't understand what, if anything, at that offset is handling text start and end, or even size. I might not even be near the right offset, since UNS is LoRom, and there are slightly more calculations required there.


It means 2 + X. Since X = 8F97, that means it will read from address $8F99 (2 + 8F97), in bank 1 (which, if this is LoROM, and the ROM does not have a header, is ROM address $8F99) ( (01 x 8000) + (8F99 % 8000) ).
"My watch says 30 chickens" Google, 2018

4lorn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: UN Squadron - Couple of translation niggles
« Reply #2 on: November 19, 2011, 01:31:20 pm »
Thank you for the answer, KingMike :) Though, it seems I'm reading this badly. Either it can't be loading X, because 8f99 is where ALSCORE is in the game (in that case, then it should be reading A instead, which leads me to 4EA9), or... there is no pointer, which I find hard to believe.

Messing around 4EA9 and 4EA0 *does* change things in ALSCORE and OLLEVEL, though these range from disappearing to inverting the letters.

Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3531
    • View Profile
    • Aeon Genesis
Re: UN Squadron - Couple of translation niggles
« Reply #3 on: November 19, 2011, 01:36:20 pm »
Are they sprites? Try pressing 5 in your emulator to turn off the sprite layer, and see if they disappear. It may be a sprite-text construct.

In either case, to relocate it you'll need to follow your trace backwards to see where 8F99 is loaded into X. AND you'll need to move the first two bytes (the "AL" in ALSCORE) with the word - even if it's not a sprite, they appear to be control information that gives positional and rotational information to the game.

4lorn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: UN Squadron - Couple of translation niggles
« Reply #4 on: November 19, 2011, 01:43:11 pm »
@Gideon: The SCORE line doesn't seem to be a sprite or set of sprites. They only disappear by disabling BG Layer 3.

So. I guess this means I may have made a wrong trace to start with? Basically all others were made by looking up BG2, if I recall correctly...

Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3531
    • View Profile
    • Aeon Genesis
Re: UN Squadron - Couple of translation niggles
« Reply #5 on: November 19, 2011, 01:47:04 pm »
Can you paste the entire trace into pastebin.org or somewhere similar? If 8F99 is where ALSCORE is, and X=8F99, then you probably have the right trace.

4lorn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: UN Squadron - Couple of translation niggles
« Reply #6 on: November 19, 2011, 07:21:43 pm »
Ok, this was a strange last couple of hours. Internet connection goes off, and now I can't seem to trace anything with Snes9X, at least not what I was able to do earlier. Still, here's one of the logs I kept earlier (only the disassemble one):

Code: [Select]
$00/8F90 0E 20 A5       ASL $A520  [$00:A520]   A:0000 X:0000 Y:0000 P:EnvMXdIzc
$00/8F93 8F 38 60 18 STA $186038[$18:6038]   A:0000 X:0000 Y:0000 P:EnvMXdIzc
$00/8F97 60              RTS                     A:0000 X:0000 Y:0000 P:EnvMXdIzc
$00/8F98 A9 CA          LDA #$CA                A:0000 X:0000 Y:0000 P:EnvMXdIzc
$00/8F9A EB               XBA                     A:0000 X:0000 Y:0000 P:EnvMXdIzc
$00/8F9B AD 8D 0E        LDA $0E8D  [$00:0E8D]   A:0000 X:0000 Y:0000 P:EnvMXdIzc
$00/8F9E 0A               ASL A                   A:0000 X:0000 Y:0000 P:EnvMXdIzc
$00/8F9F 29 00            AND #$00                A:0000 X:0000 Y:0000 P:EnvMXdIzc

Meanwhile, a minor *.zst check and hack shows "SCORE" being used twice - one with the AL-prefix, the other without. The first one seems to lead to the ALSCORE in the ROM, though I'm unsure about the second. It's actually spelled "S C O R E" in the savestate, at offset 2A495. Using Lunar Address, it's converted into $05:A495.


Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3531
    • View Profile
    • Aeon Genesis
Re: UN Squadron - Couple of translation niggles
« Reply #7 on: November 19, 2011, 08:16:38 pm »
Ok, this was a strange last couple of hours. Internet connection goes off, and now I can't seem to trace anything with Snes9X, at least not what I was able to do earlier. Still, here's one of the logs I kept earlier (only the disassemble one):

...

Meanwhile, a minor *.zst check and hack shows "SCORE" being used twice - one with the AL-prefix, the other without. The first one seems to lead to the ALSCORE in the ROM, though I'm unsure about the second. It's actually spelled "S C O R E" in the savestate, at offset 2A495. Using Lunar Address, it's converted into $05:A495.

No, I meant, you need to follow your trace up from $00/CEA9 BD 02 00    LDA $0002,x[$01:8F99]   A:0080 X:8F97 Y:0028.

Also, 2A495 is VRAM. Specifically, that's probably tilemap data. BTW, what is the hex for "AL" in ALSCORE? Like I said, it's control data, so it's probably important.

4lorn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: UN Squadron - Couple of translation niggles
« Reply #8 on: November 20, 2011, 06:55:52 am »
Ah, sorry for that. I went back to working on this and I found myself falling asleep at 3 AM. :/

Here's the trace, cropped to the most relevant part:

Code: [Select]
$00/C89D C2 10       REP #$10                A:8E28 X:0022 Y:0001 P:envMXdIzc
$00/C89F A2 97 8F    LDX #$8F97              A:8E28 X:0022 Y:0001 P:envMxdIzc
$00/C8A2 20 8E CE    JSR $CE8E  [$00:CE8E]   A:8E28 X:8F97 Y:0001 P:eNvMxdIzc

$00/CE8E A9 00       LDA #$00                A:8E28 X:8F97 Y:0001 P:eNvMxdIzc
$00/CE90 EB          XBA                     A:8E00 X:8F97 Y:0001 P:envMxdIZc
$00/CE91 A5 6E       LDA $6E    [$00:006E]   A:008E X:8F97 Y:0001 P:eNvMxdIzc
$00/CE93 A8          TAY                     A:0028 X:8F97 Y:0001 P:envMxdIzc
$00/CE94 BD 00 00    LDA $0000,x[$01:8F97]   A:0028 X:8F97 Y:0028 P:envMxdIzc
$00/CE97 F0 40       BEQ $40    [$CED9]      A:000A X:8F97 Y:0028 P:envMxdIzc
$00/CE99 99 03 04    STA $0403,y[$01:042B]   A:000A X:8F97 Y:0028 P:envMxdIzc
$00/CE9C 4A          LSR A                   A:000A X:8F97 Y:0028 P:envMxdIzc
$00/CE9D 85 20       STA $20    [$00:0020]   A:0005 X:8F97 Y:0028 P:envMxdIzc
$00/CE9F BD 01 00    LDA $0001,x[$01:8F98]   A:0005 X:8F97 Y:0028 P:envMxdIzc
$00/CEA2 85 22       STA $22    [$00:0022]   A:0020 X:8F97 Y:0028 P:envMxdIzc
$00/CEA4 A9 80       LDA #$80                A:0020 X:8F97 Y:0028 P:envMxdIzc
$00/CEA6 99 00 04    STA $0400,y[$01:0428]   A:0080 X:8F97 Y:0028 P:eNvMxdIzc
$00/CEA9 BD 02 00    LDA $0002,x[$01:8F99]   A:0080 X:8F97 Y:0028 P:eNvMxdIzc
$00/CEAC 99 01 04    STA $0401,y[$01:0429]   A:0041 X:8F97 Y:0028 P:envMxdIzc

Btw, Gideon, AL in ALSCORE is hex 414C; OL in OLLEVEL is 4F4C.


Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3531
    • View Profile
    • Aeon Genesis
Re: UN Squadron - Couple of translation niggles
« Reply #9 on: November 20, 2011, 12:11:44 pm »
Ah, sorry for that. I went back to working on this and I found myself falling asleep at 3 AM. :/

Here's the trace, cropped to the most relevant part:

Code: [Select]
$00/C89F A2 97 8F    LDX #$8F97              A:8E28 X:0022 Y:0001 P:envMxdIzc

Well, that right there is your pointer.
« Last Edit: November 20, 2011, 12:23:10 pm by Gideon Zhi »

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7015
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: UN Squadron - Couple of translation niggles
« Reply #10 on: November 20, 2011, 12:14:53 pm »
Just looking at some screenshots, I would first suspect 41/4F (along with some of the bits in 4C) are the screen position of the text. The remaining bits of 4C probably control palette and horizontal/vertical flip.
"My watch says 30 chickens" Google, 2018

4lorn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: UN Squadron - Couple of translation niggles
« Reply #11 on: November 20, 2011, 05:20:16 pm »
@KingMike: Right on the money, they control position and palette values.

Well, as for the rest, I'm trying to relocate the text, keeping in mind to take note of the pointers, but I know I must be doing something wrong since I'm locking the game and/or messing with character placement on screen.

Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3531
    • View Profile
    • Aeon Genesis
Re: UN Squadron - Couple of translation niggles
« Reply #12 on: November 20, 2011, 05:23:24 pm »
Make sure you start copying the data at 8F97, and not just at 8F99.

4lorn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: UN Squadron - Couple of translation niggles
« Reply #13 on: November 20, 2011, 05:42:50 pm »
@Gideon: I kept that in mind ;) but I think there's something else. If I'm right in reading the values, then it's probably not just a case of repointing. Here's what I'm thinking. ". ALSCORE" begins at 8F97. As per the trace, A2978F is where it's loading the data from, with 978F pretty much being the pointer.

So I found free space nearby ALSCORE, at 99e0, and replaced the 00s with all the necessary values. Then I went to A2978F and switched it to A2E099. The good news is, it works, but writing "ALPONTOS" doesn't. Also, just keeping the original text means "SCORE" appears alright, but "LEVEL" disappears. Why?

This *may* happen because A2978F is followed by the this next bit of code:

20 8E CE A2 C1 8F 20

I'm thinking... lots of things, one of them being these bytes seem to follow the same size as "SCORE". At first, I tried replacing the second 20h (a space) and reflecting the change in the main text, but obviously, no cigar. If that really does govern the text, that means it's also pointless to trace "LEVEL" so I can repoint it, because there must be also a similar series of bytes managing that, and the same will happen. I'm gonna try a couple more things, though.

November 20, 2011, 07:19:10 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Oh, wow. Either this is the most brute force change I've made, or it really was that simple:




Here's what I did. As before, I repointed ALSCORE into 99E0. I repeated the same code - ". ALSCORE.", with both dots being 0Ah. Didn't work. So I thought maybe, just maybe, since it's messing around with LEVEL in any case, I'll try not including the 0A, which I think must be the value stating where "SCORE" must end. So I kept the first 0A (starting value) but didn't include an end value. The end result was ". ALSCORE.....", with the dots following SCORE being 00s. Then it occured to me "if this is somehow negating or overlapping the original LEVEL... It's a longshot, but why not just write it normally a few bits ahead?".

. ALPONTOS........NIVEL.........

And voila!  :crazy:

All I'm missing right now is a) placing an "Í" instead of "I" in "NIVEL", and b) finding where the instruction for the game to repeat the "EXIT" tile is, so I can type "SAIR". :D
« Last Edit: November 20, 2011, 07:19:10 pm by 4lorn »

Gideon Zhi

  • Discord Staff
  • Hero Member
  • *****
  • Posts: 3531
    • View Profile
    • Aeon Genesis
Re: UN Squadron - Couple of translation niggles
« Reply #14 on: November 20, 2011, 09:16:19 pm »
Glad you figured it out!

4lorn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: UN Squadron - Couple of translation niggles
« Reply #15 on: November 21, 2011, 04:38:02 am »
I also have to thank you both for putting me on the right track. ^_^

Now, to test that "EXIT"!

November 22, 2011, 10:42:27 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Silly me. I thought there was an instruction to repeat the inferior part of the tile, to use less space (something I've seen, for instance, in Nobunaga games), but it just happens that the lower half of "T" in "EXIT" is simply several tiles above the image. This means I can finally start translating this :) I'll try and make a topic about it on the personal projects page, sometime this week.
« Last Edit: November 22, 2011, 10:42:27 am by 4lorn »

4lorn

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: UN Squadron - Couple of translation niggles
« Reply #16 on: November 30, 2011, 05:56:26 pm »
Well, a small update about this. The good news is I've come to understand something else about the changes I'm making, more importantly about one of the alphabets Capcom included in the game. Specifically, the "MISSION CLEAR" one, which is composed of 4 tiles per letter. At first I was having issues regarding the "CLEAR" part, as anything beyond that would get cut off even when there was enough room. Turns out that, much like SCORE and LEVEL, it's preceeded by a handful of bytes that dicatate several things, one of which is to extend just how far text can be printed on-screen. As you can see below:



I can now manipulate it to extend beyond the previous limit. Not by much, but quite enough. Of course, now comes the bad news - surprisingly, it's still related to the previous problem I had with SCORE. Turns out that I completely missed something regarding it. Simply repointing the thing isn't quite enough because it produced two bad results. I can't believe it took me a while to notice the first, but here it is:



First pic is taken from the original, second from a backup where I've been experimenting. Notice the difference (other than the insane amount of money, sorry, I was testing)? That's right, the $ is missing. Because there is no longer an instruction to print that out (as I repointed the start of the word, but not the remaining values) it doesn't get shown. The second issue - not in the pictures - is that when you lose and the pilot's image fades away, it now also carries garbled tiles after the image is gone. This is probably due to the SCORE repointing as well, since it kind of overlaps over the pilot's picture (as in, PONTOS ---> PICTURE ---> NIVEL).

To add insult to injury, there's not a lot of room to repoint things. I even had to backtrack to a previous version today because of this. Since "MISSION" isn't terribly different from "MISSÃO", I just rewrote the original, but had to repoint "CLEAR" as it was bigger. And since it requires two lines (two + two tiles per line), it took away almost all the free room I had. In fact, the only room I had was to place it right below PONTOS, meaning all three lines I had are now gone, and repointing these to anywhere else seems to be a no go (I assume it requires the info to be on the same offset bank).

The only thing I can think of at this point is to do with SCORE what Capcom did for weapon names - that is, group letters closer in order to maintain legibility but use less space.