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

Author Topic: Arcana SNES translation project/problem creating graphics of language characters  (Read 10111 times)

RetGal

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
First of all, greetings everyone; this is my first message in this forum, hope I not only solve my problems but contribute to the community.

Sticking to the point: my intention is to translate the SNES game Arcana into Spanish.

I know there is a translation made by Traducciones Lukas, but it has an unsettleling issue: it misses any Spanish characters:

¡¿
áéíóúñ
ÁÉÍÓÚÑ

I have tried to read the US ROM using crystaltile2 and Tile Molester, find the graphic tiles and modify some of them to create the characters I need; unfortunately, the ROM seems to be compressed, and I have no idea how to spot them (I think I found something similar to the alphabet using Tile Molester codec 2bpp, but characters seem really messy)
EDIT: just to show the part of the ROM I found those tiles:



They start around $050250, and each grphic is 9px tall; all are capital letters, but just a few seem to have small letter. Either way, modifying these graphics do not affect the outcome in the text of the game (they do not look like the font used ingame, either).

Even using x86-64 bsnes emulator editing tools to read the VRAM and try to spot them, but wasn't able to advance using this path.

Even after reading MANUAL DE TRADUCCIÓN DE VIDEO JUEGOS, EL FASCINANTE MUNDO DEL ROMHACKING (Videogames Translation Manual, the fascinating world of romhacking) from Pablo Muñoz Sánchez, that has a lot of practical examples and learn about DTE and MTE, I could not get any further with the Arcana ROM.

I have found also a ROM with the Portuguese translation, that has created some characters like "á", "ó" and "é", shared in both languages, so I tried to contact a Hexagon Traduções team member to give some clue to decompress/spot and edit the characters I needed. Alas, this team is no longer active and the member I could contact with could not help (he has now his own life, and I respect that so I did not disturb him anymore)

This is why I finally open this topic, trying to call out for any help to my intentions (spot the language character graphics and create the Spanish words with VWF if possible for cases like the "¡" and the "í")

I need to say: I have not studied computing nor programing in any informatic language; I am just a curious guy that has minimal interaction with programing (just modding some videogames very roughly, and starting to translate Emerald Dragon to Spanish following the clues in the PDF of Pablo, succesing in create VWF and the new Spanish characters and starting the script just to find a few more problems I try to solve)

Thanks anybody that understand my motivations and try to help; my best regards to all.
« Last Edit: April 05, 2020, 11:16:06 am by RetGal »

Sarah Shinespark

  • Full Member
  • ***
  • Posts: 100
  • Creator of Arcana: Seal of Rimsala
    • View Profile
Oh, wow! I commend you on starting this. Don't know about how to get the graphics uncompressed (that would help me too), but maybe you can get exhal to work with it! Also ask on the Discord, might be more populated than the forums.

I can help with locating text like ROOKS displayed above his card; those letters use tile numbers (like 04 05 = LV). The values are stored in ROM:
Code: [Select]
$07/8EDF FINIS (appears 2x for some reason)
$07/8F6E SLEEP (appears 3x for some reason)
$07/8FEC ROOKS
$07/9020 EFRITE
$07/903A SALAH

Raeven0

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
The left panel in your screenshot says it's parsing as 4bpp, not 2bpp. But I don't know this program. It could be lying.

The letter graphics have to enter VRAM at some point, unless the game is doing some pointless time-wasting wizardry like manually writing a tilemap. Use the bsnes VRAM tools while text is on the screen. Note where the graphics are in VRAM. Also use the tilemap viewer to note where their tiles are on the layer that shows text. When you dismiss the text and go do something else, are the graphics removed from VRAM? If so, they are dynamically loaded and you can trace where they are sourced from next time you trigger a text box. If not, they are at least semi-static, and you will need to watch VRAM as you restart the game and note at what point in game initialization the graphics are loaded, then trace their source back from there.

Another possible lead: IPS is a simple format. An IPS file starts with the literal ASCII characters "PATCH" and ends with the literal ASCII characters "EOF". In between, now in hexadecimal (so use a hex editor), are any number of hunks of the form:
  • 3-byte FILE-OFFSET, 2-byte DATA-LENGTH, DATA; or
  • 3-byte FILE-OFFSET, $0000, 2-byte RUN-LENGTH, 1-byte DATA
Since the Portuguese patch is good, use it to identify which parts of the ROM are relevant and narrow your search to those and vicinity. The first few areas touched by the Portuguese patch are:
Code: [Select]
$002fc8, $000e bytes
$00310f, $000a bytes
$0032f2, $0020 bytes
I don't know the game or the code base, but from looking at the patch I would roughly guess that the graphics are in bank $00, and if so at addresses no greater than $8000.
« Last Edit: April 12, 2020, 12:04:35 pm by Raeven0 »

Sarah Shinespark

  • Full Member
  • ***
  • Posts: 100
  • Creator of Arcana: Seal of Rimsala
    • View Profile
When you do get to replacing the text, there are some opcodes (byte used as commands) to work around. They're mostly lower values than the alphabet, but sometimes they come in a group of four (like 10 1E FA 0C which clears the text and speaking portrait). Otherwise the common ones are 0D for newline, 7F for pause, 00 for end of text. Text doesn't wrap automatically so I've had to playtest a bunch to see if my newlines were in the right spots. Keep savestates handy  :thumbsup:

RetGal

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Thanks both of you for the tips  :cookie:  I am going to put them to work and share what I find out (it will take me a while, not the fastest guy but I have neither a deadline hehe  :beer: )

The left panel in your screenshot says it's parsing as 4bpp, not 2bpp. But I don't know this program. It could be lying.

My bad, I miswrote 2bpp instead of 4bpp; later, when I edited to add the image, I didn't notice the typo  :P

EDIT 18/Apr/2020:

Just sharing what I found out so far:

• First I opened the translation IPS I have (Lukas' one in SPanish and Hexagon's one in Portuguese); just readed how many lines have each one and calculate difference:

B090 - A920 = 770 bytes (1904 in binary); this may be the maximum size of the tiles modifications.

• I noticed Lukas save space translating just a few names, whilst Hexagon do a complete name translation:

(I know both Spanish and Portuguese so is easy to spot the translated names in both languages)

What I deduce from this is that 770 (1904) includes these translations, so the tile modifications are smaller.

• After reading both files I am sure both are vastly just translation, so I focus in the first part of Hexagon's IPS, that is the only great area that looks different:

I am pretty sure, with all the stated, taht this is where the tiles I am looking for are stored.

Since the Portuguese patch is good, use it to identify which parts of the ROM are relevant and narrow your search to those and vicinity. The first few areas touched by the Portuguese patch are:
Code: [Select]
$002fc8, $000e bytes
$00310f, $000a bytes
$0032f2, $0020 bytes
If I understood you right (I repeat, I have not studied properly programation, just learning by doing) the first lines of the Portuguese IPS (the lines I think are the ones I am looking for) modify Arcana's ROM in spot $002fc8 for 0e (14) bytes; $00310f for 0a (10) bytes; and $0032f2 for 20 (32) bytes, is this right? Sorry if I misunderstood.

Anyway, with this in mind, I firstly made a copy of Arcana (U) (the original ROM) and applied the Portuguese patch, calling it Arcana (P); I also run it to check it did the job fine. And so, I opened both (U) and (P), and went to $002fc8 in both  and check if there where any changes...

I found something! At first they looked similar to me, but there is code changed above $002fc8, specificaly line $002f10 for 8 bytes:

Is better in $00310f, where the changes are around this byte:


Now I am not sure what to do next; surely I will run the game in bsnes-accuracy (runs the game 30fps instead of 60fps) and check VRAM, to follow what happens with text loaded and when is unloaded, or what...

This, however, will be later; but I wanted to share what I feel is (imo) a huge improve :)

Thanks for the tips, have a nice day ^_^

EDIT 19/Apr/2020:

More findings:

• Using bsnes-accuracy I see the letters are displayed in BG3; not only that, they are being writen as they are displayed, AND being removed from BG3 as they disappear from screen; so I believe this is what you @Raeven0 were meaning with "time-wasting wizardry like manually writing a tilemap". Also, if this info helps, it is better visible in 2bpp than 4bpp in VRAM.




• Also, names like EFRITE and DARWIN with other letters are loaded in BG1 (4bpp) even if none of these names are displayed on screen.

Unfortunately, I am unable to continue since I do really not understand the debugger and what to do with (or where to focus in) the million commands that are being run every frame...

And now, the meaning of why I upload:

• I decided to open the .smc in HxD, locate where the intro text is stored in ROM and modify it with values from 20 to EF and check what is displayed in screen.

Original text:



Changing with values 21 to EF (respecting the first "E" as a reference, and the hex values "0D" that seems to be jump of line):


(notice that all that text is not displayed at the same time, I modified the image to show the total length; the real final screen just show this length):


I did this for mainly two reasons:

1) Knowing exactly the tiles that are already converted in Portuguese letters (this is, which ones have been modified); they are:

2a -- from * to ã
3c -- from < to í
57 -- from W to ó
58 -- from X to ê
6b -- from k to ç
67 -- from w to á
69 -- from y to é

2) The other reason was to, if not crashing, display what non-commonly values (like 80, 90, A0 and so on) would display on screen; just curious to think if this can help to spot this glitchy graphics in the ROM if I use the 2bpp codec (since BG3 seems to use it) or not at all.

Anyway, I noticed the numbers from 2 to 8 (the ones in the first line) have a similar width, specifically 8 pixels (or 9, if the space between graphics is included), so applying what I learned in the PDF of Pablo Muñóz I did a search in hex of the values "080808080808" (and after it "090909090909"), in order to find where in ROM is stored the VWF.

It worked! searching "090909090909" I spoted an area with similar values, and finally deduced this being the VWF, starting in $002c34 with the values 04 05 05(this being the width of the space, the ! and the " symbols respectively)




So, in order to be sure, I changed the value I deduced was for the ã (0A) and changed for the one I believe fited better for the symbol size (07), saved and...




 :o :laugh: :crazy: :woot!:

So, knowing this information, is it possible to use it to trace where in the ROM are stored the propper tiles that the values in the area $002c34 onwards modify? They must be close, and thinking about it this is pretty close to the $002fc8 that the Portuguese patch start to touch (and the $002f10 I also spoted the ROM really changes)

Also, maybe it is possible to take advantage of values 23, 24, 25, 26, 3d, and 40 (#, $, %, &, = and @) since they do not display any graphic, and store there the tiles I want to create.

So far I am quite happy with the improvements, even if I am just walking around what I really want (modify the propper tiles, not just spot them in ROM).

Have a nice day.
« Last Edit: April 19, 2020, 05:36:51 am by RetGal »

Sarah Shinespark

  • Full Member
  • ***
  • Posts: 100
  • Creator of Arcana: Seal of Rimsala
    • View Profile
Wow, great job!
Yeah the thing with debuggers is learning to use "breakpoints" and tracing. That lets you scroll through code that was executed, and control when it starts and stops. I have a lot of RAM and ROM addresses on the Data Crystal page, maybe something there will help.

I would check a tracelog when it's drawing those characters and look for LDAs from ROM. Also could be transferred in blocks using DMA; use DMA logging to see when that happens. Hope that helps.

Raeven0

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
Well now, that is some incredible investigative work.

I did not know this was a variable-width font. What you're seeing in VRAM is a buffer for assembling VWF text, which is needed because the SNES, being tile-based, can only directly use specific sizes for its graphics. If you set the tile viewer's "Width" to 16, you can see how the VRAM tiles are physically stored. bsnes has a separate "Tilemap Viewer" tool for viewing how the raw VRAM tiles are assembled on screen.

Possibly easier/faster than tracing a VWF data source: bsnes has a "Memory Editor" tool. You can directly change ROM without having to change/reload/patch the file all over again. Take a guess about which bytes contain graphical data, change those bytes, and trigger some text. Aim to corrupt several bytes, not just one or two: at 2bpp, a row of an 8x8 tile requires 2 bytes, so a corruption of 2 bytes is only sufficient to change a single row of a single tile. If (as seems likely) the data is compressed, you will have to set a Read breakpoint on the data and reverse-engineer the compression/decompression algorithm.

See also http://www.romhacking.net/forum/index.php?topic=24593.msg392891#msg392891 where the writer has found the code that performs decompression and notes that it is probably the same already-reverse-engineered comp/decomp algorithm as in the developers' other games.

But if you do want to rigorously trace the VWF data source . . . Click a tile in the VRAM viewer to see the "Selected Tile Address" at the bottom of the viewer. In the breakpoint editor (Debugger > Tools > Breakpoint Editor), add a breakpoint for "W"rites at that address, with a source of S-PPU VRAM. Trigger the dialogue to appear, and the emulator will halt on the code that writes the data to VRAM.

For a VWF, the data is probably buffered in WRAM (console RAM), then pushed to VRAM. If so, in the bsnes tile viewer, set Source = S-CPU Bus, Address = 7e0000, Bit Depth = 2bpp, and Width = 16, then mash the right arrow button next to Address until you find the graphics buffer in RAM that matches what you see in VRAM.

You can set a Write breakpoint on a WRAM address (using Source = S-CPU Bus) where you find text graphics. Probably you'll find a "STA", which writes the value of processor variable "A" to that address. This "A" probably came from a "LDA" just before the "STA", and "LDA" loads a value from some address into A. How did that value get into that address, well, you can set a Write breakpoint on it to find out... Eventually you'll reach a load from ROM. That's your tile data.
« Last Edit: April 19, 2020, 03:42:31 pm by Raeven0 »

torha

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
I too am impressed with what you figured out. +1

Code: [Select]
00ad14 = font table
80bd21 lda $80ac2b,x [80ac2b] A:0000 X:0000 Y:0000 S:1fed D:1dc6 DB:7e nvmxdIZC V:195 H:1308 F:48
80bd25 sta $00       [001dc6] A:ad14 X:0000 Y:0000 S:1fed D:1dc6 DB:7e NvmxdIzC V:195 H:1356 F:48

00ac34 = width table
80bd27 lda $80ac2d,x [80ac2d] A:ad14 X:0000 Y:0000 S:1fed D:1dc6 DB:7e NvmxdIzC V:196 H:  30 F:48
80bd2b sta $02       [001dc8] A:3400 X:0000 Y:0000 S:1fed D:1dc6 DB:7e nvmxdIzC V:196 H:  78 F:48
80bd2d lda $80ac2f,x [80ac2f] A:3400 X:0000 Y:0000 S:1fed D:1dc6 DB:7e nvmxdIzC V:196 H: 116 F:48
80bd31 sta $04       [001dca] A:00ac X:0000 Y:0000 S:1fed D:1dc6 DB:7e nvmxdIzC V:196 H: 164 F:48

Something with font data processing or caching
Code: [Select]
font data
80bd8a lda [$00],y   [00ad14] A:0000 X:0000 Y:0000 S:1fed D:1dc6 DB:7e nvmxdIZC V:196 H:1048 F:48
80bd8c and #$f0ff             A:0000 X:0000 Y:0000 S:1fed D:1dc6 DB:7e nvmxdIZC V:196 H:1110 F:48
80bd8f sta $7e6800,x [7e6800] A:0000 X:0000 Y:0000 S:1fed D:1dc6 DB:7e nvmxdIZC V:196 H:1134 F:48
80bd93 iny                    A:0000 X:0000 Y:0000 S:1fed D:1dc6 DB:7e nvmxdIZC V:196 H:1182 F:48
80bd94 inx                    A:0000 X:0000 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIzC V:196 H:1196 F:48
80bd95 inx                    A:0000 X:0001 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIzC V:196 H:1210 F:48
80bd96 lda #$0000             A:0000 X:0002 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIzC V:196 H:1224 F:48
80bd99 sta $7e6800,x [7e6802] A:0000 X:0002 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIZC V:196 H:1248 F:48
80bd9d inx                    A:0000 X:0002 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIZC V:196 H:1296 F:48

80bd9e lda [$00],y   [00ad15] A:0000 X:0003 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIzC V:196 H:1310 F:48
80bda0 xba                    A:0000 X:0003 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIZC V:197 H:   8 F:48
80bda1 asl a                  A:0000 X:0003 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIZC V:197 H:  28 F:48
80bda2 asl a                  A:0000 X:0003 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIZc V:197 H:  42 F:48
80bda3 asl a                  A:0000 X:0003 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIZc V:197 H:  56 F:48
80bda4 asl a                  A:0000 X:0003 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIZc V:197 H:  70 F:48
80bda5 xba                    A:0000 X:0003 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIZc V:197 H:  84 F:48
80bda6 sta $7e6800,x [7e6803] A:0000 X:0003 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIZc V:197 H: 104 F:48
80bdaa iny                    A:0000 X:0003 Y:0001 S:1fed D:1dc6 DB:7e nvmxdIZc V:197 H: 152 F:48
80bdab iny                    A:0000 X:0003 Y:0002 S:1fed D:1dc6 DB:7e nvmxdIzc V:197 H: 166 F:48
80bdac inx                    A:0000 X:0003 Y:0003 S:1fed D:1dc6 DB:7e nvmxdIzc V:197 H: 180 F:48
80bdad inx                    A:0000 X:0004 Y:0003 S:1fed D:1dc6 DB:7e nvmxdIzc V:197 H: 194 F:48
80bdae lda #$0000             A:0000 X:0005 Y:0003 S:1fed D:1dc6 DB:7e nvmxdIzc V:197 H: 208 F:48
80bdb1 sta $7e6800,x [7e6805] A:0000 X:0005 Y:0003 S:1fed D:1dc6 DB:7e nvmxdIZc V:197 H: 232 F:48
80bdb5 inx                    A:0000 X:0005 Y:0003 S:1fed D:1dc6 DB:7e nvmxdIZc V:197 H: 280 F:48
80bdb6 cpx $08       [001dce] A:0000 X:0006 Y:0003 S:1fed D:1dc6 DB:7e nvmxdIzc V:197 H: 294 F:48
80bdb8 bcc $bd8a     [80bd8a] A:0000 X:0006 Y:0003 S:1fed D:1dc6 DB:7e NvmxdIzc V:197 H: 332 F:48
80bdba bra $bdd1     [80bdd1] A:0000 X:0024 Y:0012 S:1fed D:1dc6 DB:7e nvmxdIZC V:199 H:1090 F:48

To be continued?


edit: I think the goofiness comes in that each font character is stored as 36 bytes? Something like 24x12 @ 1bpp?
« Last Edit: April 19, 2020, 11:29:02 pm by torha »

RetGal

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Finally DONE :)
« Reply #8 on: April 20, 2020, 02:38:59 am »
First of all, thanks again all of you for your tips but also for your words, they mean so much  :)

In the end I did what I do best: destroying source code and see what happens on screen  :P So I started to modify bytes of the lines Hexagon's patch modified.

And just by doing I found the tiles I wanted to find; not only that, by playing around with bytes I discovered the way the tiles are decoded from ROM to VRAM.

• Letter tiles start in $002d14, and are coded every 18 bytes (12 in HEX).
• Each tile is 12 pixels height (and variable width, but drawn like 8 )
• The way are coded is converting the HEX value of the byte in binary (0 = black, 1 = white), in the following performance:
- First line of 8 pixels is coded by the first byte, from 00 to FF.
- Second line is divided in two parts of 4 pixels and coded by the next 2 bytes; first one from 00 to 0F, and the second one from the 00 to 0F BUT inverted (then, if logic says 04, it must be 40; if 0C, then C0; and if 00... well, 00).
- Same for third line (4th byte), forth (5th and 6th bytes), until reaching the 12th line (17th and 18th bytes)

Practical example:

"ñ" can be coded like 00 01 40 28 00 00 38 02 40 64 06 40 24 00 00 00 00 00 in the following fashion:



Even if width is finally 06, "ñ" is drawn this way; as all the other letters.

So, I spend most of yesterday playing around with the code, taking notes and writing directly from the ROM. May this be the proof of what the result is:


(notice the emulator is speed up for showing more information in a shorter video and smaller gif, hehe)

 :thumbsup: :thumbsup: :thumbsup: :beer: :beer: :beer:

I may say my doubts are finally solved, I have achieved what I wanted, and even have enough space to put all 14 tiles I wanted:
¡¿
áéíóúñ
ÁÉÍÓÚÑ

From now on, the problems I must solve are:

• Writing the script from zero, or "improve" Lukas' translation with these new tiles... I may contact him (Lukas) somehow, and ask him permission to do this.
• Put these changes not in a ROM but in a IPS file. I have been taking notes carefully of each byte and area of bytes I modified so I have trace of what I did and where.
• Solve minor problems (for instance, in the .gif I attach sometimes the first paragraf, "Según las antiguas leyendas, hombres valerosos [...]" sometimes just display "S" and jumps directly to "Las disputas entre [...]"; this happens randomly each time I reset or reload the ROM, even if I do not modify anything on the code in between.



• Aside, making this translation compatible with other mods (like Fast Patch or any other).
• Also aside, doing some minor changes not related with translation but music, but this is really out of place of what we have been discussing, hehehe.

So, be this topic solved, but just as a chapter of the path I must follow to do a complete and grammatically accurate translation in Spanish of this beloved game.

Thank you all again for your words, even if I did not follow the tips propperly, since they gave me the inspiration to go ahead and succeed  :) ;) hope to read you again.
« Last Edit: April 20, 2020, 08:40:34 am by RetGal »

torha

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Ah! Clever, very nice job! Thanks for cleanly explaining the whole process and filling in all the holes. :)

Now others won't go through the same pain.

Sarah Shinespark

  • Full Member
  • ***
  • Posts: 100
  • Creator of Arcana: Seal of Rimsala
    • View Profile
Re: Finally DONE :)
« Reply #10 on: April 20, 2020, 03:11:43 pm »
Wow, awesome progress! All that documentation is the mark of a great developer  8)

• Solve minor problems (for instance, in the .gif I attach sometimes the first paragraf, "Según las antiguas leyendas, hombres valerosos [...]" sometimes just display "S" and jumps directly to "Las disputas entre [...]"; this happens randomly each time I reset or reload the ROM, even if I do not modify anything on the code in between.


Whoa that is weird. I've seen lots of display errors from corrupting text opcodes, but usually that's like changing the text speed or the spacing between lines.

• Also aside, doing some minor changes not related with translation but music, but this is really out of place of what we have been discussing, hehehe.
Curious, what did you have in mind? Music is loaded into RAM $1064, and sound effects are loaded into $1066. Just trace them if you want to change a song ID. Here's a list of the IDs  :thumbsup: (I got carried away naming the unnamed sfx and music lol)

RetGal

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Re: Finally DONE :)
« Reply #11 on: April 20, 2020, 05:16:22 pm »
Curious, what did you have in mind? Music is loaded into RAM $1064, and sound effects are loaded into $1066. Just trace them if you want to change a song ID. Here's a list of the IDs  :thumbsup: (I got carried away naming the unnamed sfx and music lol)

That is really useful info, thanks!  :laugh:

Few months ago I downloaded some songs of Arcana in midi, like "The symphony of Elemen" and "Second Armageddon", and noticed in FL studio there are instruments (like in a lot of other songs) that play the same notes at the same time during all the song. Is a small side project, but just want to try to improve some melodies by adding some short-length chords or puntual notes replacing, if possible. It may sound like "you crazy, man" and I do not want to take much more that what I can embrace... but I should try at least  ;D

I plan to use the sound room to select the song and use bsnes tools the way I have learned here to trace the place in ROM where they are stored, but now with your info I have lot of work done   :beer: :thumbsup:

Will try in near future, first I will finish to translate some chapter (almost done chapter 1 and town dialogs) and share how it looks and if there is some bugs like the random "S" thing stated before.

Have a nice day :) (btw some unnamed songs have hilarious titles :laugh: )

Raeven0

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
Re: Finally DONE :)
« Reply #12 on: April 20, 2020, 07:12:54 pm »
• Put these changes not in a ROM but in a IPS file. I have been taking notes carefully of each byte and area of bytes I modified so I have trace of what I did and where.
• Solve minor problems (for instance, in the .gif I attach sometimes the first paragraf, "Según las antiguas leyendas, hombres valerosos [...]" sometimes just display "S" and jumps directly to "Las disputas entre [...]"; this happens randomly each time I reset or reload the ROM, even if I do not modify anything on the code in between.
Hand-writing an IPS patch is a useful exercise that everyone should do exactly once, before moving on to utilities like this one that do the patch tracking for you.

The screenshot with the weird text shows snes9x, which has some emulation timing bugs that will never be fixed. Check the behavior in bsnes. If it works correctly, then your text is fine and the problem is one of the snes9x bugs.

RetGal

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Re: Finally DONE :)
« Reply #13 on: April 21, 2020, 01:13:54 am »
The screenshot with the weird text shows snes9x, which has some emulation timing bugs that will never be fixed. Check the behavior in bsnes. If it works correctly, then your text is fine and the problem is one of the snes9x bugs.



 :thumbsup: :thumbsup: (tested a few times just to be sure)

I normally use snes9x since this emulator allows me to fast-forward the game, so I can see more stuff in less time; at least, I have not found this feature in bsnes. Anyway, if the snes9x has this kind of unreliability bugs, I should use more often bsnes and get used to save states now and then, hehe, thanks for the advice  :beer:

April 26, 2020, 03:45:50 am - (Auto Merged - Double Posts are not allowed before 7 days.)
After these last days of translation (using Lukas work as base, who agreed to share it with me after being asked), fast-forwarding the game to reach parts of the game unreachable from the Stage Select screen, and above all learning what those strange in between group of bytes in the middle of sentences meant by playing with them, I may say the translation to Spanish with custom tiles is completed.

This includes storyline, battles, town, inventories and descriptions, to name a few.

Now these are the main stones I shall overcome:

• Problem trying to change words "New Game", "Continue" and "File" to "Nuevo", "Continuar" and "Fila" found in around $BA578 (the modification of tile of half "W" in New displays glitch in a really messy and uncomprehensible way the rest of them). I am sure that tile contains some code that rules other thinks like position of next tile, but cannot figure out.




• Changing states "SLEEP" and "FINIS" to more Spanish-friendly words (like "YACE_"/"CAIDO" and "R.I.P"/"D.E.P"); I did not find the tiles, nor the lines that rule that. Kind of uncool.



• And my focus now: modifying the ending credits to add. After looking for them yesterday, I found the tiles of the letters.


Original credits


(How I spoted the tiles by removing code)

Following the logic deduced found in the game ("everything related is commonly close in code") also spoted the credits themselves starting in $B5884; it is quite the thing, since:
♦ Each letter graphic is divided in various tiles (at least 2 tiles tall and in 2 BG).
♦ They seem to use a 5-byte group kind of logic to display them.
♦ As far as I have checked, credits are not displayed in order but stored quite randomly (first 5-group do not rule the first credit letter, but another in the middle-way of them).
♦ Because of that is not as easy as spot "Character Designers" and rewrite to "Diseño de Personaje".



This is the output when I change from $B5884 to $B5888 to 00 00 00 00 00:


_______________________________

Appart from that, and talking about forum rules:

♣ I do not know if I may open a new topic for asking these questions, since they are not related with the original topic ("tile modification", but "tile management"), so not sure if I am maintaining the forum clean of unnecesary topics or just messing up one with miscelanous questions.

♣ I do not know if I should open a topic in "Personal Projects" area to make an official announcement, since it is not as finished as I want, and expose the remaining issues there.

Any advice is welcome, btw  ::)
« Last Edit: April 26, 2020, 03:45:51 am by RetGal »

Sarah Shinespark

  • Full Member
  • ***
  • Posts: 100
  • Creator of Arcana: Seal of Rimsala
    • View Profile
Re: Finally DONE :)
« Reply #14 on: April 26, 2020, 12:25:33 pm »

• Changing states "SLEEP" and "FINIS" to more Spanish-friendly words (like "YACE_"/"CAIDO" and "R.I.P"/"D.E.P"); I did not find the tiles, nor the lines that rule that. Kind of uncool.


The tile numbers for FINIS is at 0x38EDF. Tiles for SLEEP are at 0x38F6E. They're repeated a few other places for some reason, but format is like this (reading every other byte and skipping the 10's):
16 13 18 13 0A: F I N I S
0A 0C 15 15 02: S L E E P
This pattern also holds true for character NAMES, HP, MP, LV. The tiles I've logged are as follows, may have to find how to add more that aren't listed. I'll be a sweetie and alphabetize them for ya.
A: 11
D: 0F
E: 15
F: 16
H: 01
H: 0E (SYLPH)
I: 13
L: 0C
K: 09
M: 03
M: 12
N: 18
O: 08
P: 02
P: 0D (SYLPH)
R: 07
S: 0A
T: 14
X: 17
Y: 0B
0: 30
1: 31
2: 32...
 : 06 or 10
(DARWIN and EFRITE's tiles 21+ are all blended together and not reusable)

Quote
Appart from that, and talking about forum rules:

♣ I do not know if I may open a new topic for asking these questions, since they are not related with the original topic ("tile modification", but "tile management"), so not sure if I am maintaining the forum clean of unnecesary topics or just messing up one with miscelanous questions.

♣ I do not know if I should open a topic in "Personal Projects" area to make an official announcement, since it is not as finished as I want, and expose the remaining issues there.

Any advice is welcome, btw  ::)
Might want to ask KingMike or another mod to move it, but this definitely qualifies as a project!

RetGal

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
The tile numbers for FINIS is at 0x38EDF. Tiles for SLEEP are at 0x38F6E. They're repeated a few other places for some reason, but format is like this (reading every other byte and skipping the 10's):
16 13 18 13 0A: F I N I S
0A 0C 15 15 02: S L E E P
This pattern also holds true for character NAMES, HP, MP, LV. The tiles I've logged are as follows, may have to find how to add more that aren't listed. I'll be a sweetie and alphabetize them for ya.
A: 11
D: 0F
E: 15
F: 16
H: 01
H: 0E (SYLPH)
I: 13
L: 0C
K: 09
M: 03
M: 12
N: 18
O: 08
P: 02
P: 0D (SYLPH)
R: 07
S: 0A
T: 14
X: 17
Y: 0B
0: 30
1: 31
2: 32...
 : 06 or 10
(DARWIN and EFRITE's tiles 21+ are all blended together and not reusable)
Might want to ask KingMike or another mod to move it, but this definitely qualifies as a project!

As always, thanks for the answer ^_^ is quite amazing thinking that one week ago I have close to nothing done and look now :D

Related to what I found in credits, I want to share what I found so far. As thought, each letter is coded by 5 bites; each byte rules one thing.

Lets take the first one found in ROM, $B5884 to $B5888, this is, 43 01 82 3C 00. This codifies the last "S" in "CHARACTER DESIGNERS"

♠ First byte states the horizontal position:


♠ Second byte states the vertical position (most of the letters has this value set in 01):


♠ Third pair states the letter displayed:


I have played with this byte for a while and mapped the following correlations:

00 = A
02 = B
04 = C
06 = D
08 = E
0A = F
0C = G
0E = H
20 = I
22 = J
24 = K
26 = L
28 = M
2A = N
2C = O
2E = P
40 = Q
42 = R
44 = S
46 = T
48 = U
4A = V
4C = W
4E = X
60 = Y
62 = Z
64 to 68 = special letters for the Debug Director "KOBY"
6A = Special Symbol for the Script Writer SDF Hashiguchi
80 = ER
81 = RS
82 = S
84 = TO
86 = R
A0 onward = Special tiles for the sprite "The End"

It seems that 01 displays _A (being _ an empty space), 03 = _B, 05 = _C and so on. And that values which first digit is odd shows half tile.

♠ Fourth byte states if the letter color is white (3E) or orange (3C)


Other values result in tiles not related (there is not other colors available, as far as I tried)

♠ Last byte is always 00 and states the obvious :P
______________________

I find myself happy with this, I may use the "KOBY" tiles to create some Spanish ones to translate also this credits (like "DESIGNERS" to "DISEÑADORES" and "MUSIC" to "MÚSICA")... but I also realize this seems pretty tricky, will take this easy, he he he.

Anyway, thanks for the advise, I will contact KingMike soon enough (not before trying to translate this last part  :P )

Sarah Shinespark

  • Full Member
  • ***
  • Posts: 100
  • Creator of Arcana: Seal of Rimsala
    • View Profile
At a glance, it looks like those credits 5-blocks are doing the letters right to left  :huh:
Half tiles being odd numbers is an interesting find, I wonder if that's a credits thing or if the rest are like that too. Looks like the credits 5-block pattern stops around THE END like you said, B6F13-B6F17. Some of the byte 5's are 01 or 02 btw.

EDIT: Oh, I emailed ya a little something. Trying to be more efficient at automating stuff so I'm not spending all day writing things by hand!
« Last Edit: April 26, 2020, 11:41:37 pm by Sarah Shinespark »

RetGal

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
EDIT: Oh, I emailed ya a little something. Trying to be more efficient at automating stuff so I'm not spending all day writing things by hand!

Thanks! That saved me at least a few hours making it easier to translate more efficiently  ;D and it's working:



Even Axs is thankful xDDD

Some of the byte 5's are 01 or 02 btw.

You are right, so there must be a reason; so, paying attention to that, I noticed a pattern (I take bytes $B5928 to $B597C as example)

02 B9 01 08 3C -- E (from EXECUTIVE)
00 16 01 42 3C -- R
00 0E 01 08 3C -- E
00 06 01 04 3C -- C
00 FE 01 48 3C -- U
00 F6 01 06 3C -- D
00 EE 01 2C 3C -- O
00 E6 01 42 3C -- R
02 DE 01 2E 3C -- P
00 19 01 44 3C -- S
00 12 01 86 3C -- R
00 02 01 84 3C -- TO
00 F9 01 04 3C -- C
00 F1 01 08 3C -- E
00 E9 01 42 3C -- R
00 E4 01 20 3C -- I
02 DD 01 06 3C -- D

See that when a new word starts there is a 02 (I am assuming 02 is the first byte, and not the last one as I stated before)

The tile numbers for FINIS is at 0x38EDF. Tiles for SLEEP are at 0x38F6E. They're repeated a few other places for some reason, but format is like this (reading every other byte and skipping the 10's):
16 13 18 13 0A: F I N I S
0A 0C 15 15 02: S L E E P

I also tried changing the 16 13 18 13 0A (F I N I S) in $38EDF to 00 05 15 02 00 (  D E P  , that is the Spanish way of saying RIP), and this happened:



So both Teefa and Darwin died (they were pretty damaged before a multiple attack, BTW) and just Teefa displays DEP. So this could mean the DEP is just for Teefa or just for that bottom-left place in formation:



So it seems the F I N I S in $38EDF is just for Teefa, and that is why there are some more over there, for other characters.
« Last Edit: April 27, 2020, 06:22:19 am by RetGal »

Sarah Shinespark

  • Full Member
  • ***
  • Posts: 100
  • Creator of Arcana: Seal of Rimsala
    • View Profile
That's really weird! But then there are 9 different "That's the best you could do?" quotes for all 9 characters.
BTW taking from Dao's text, use 10 for a space. (10 0F 11 08 10 = _DAO_)

RetGal

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Little update:

these last days I have just fighting with the credits more than I wanna admit and recurrent problems when modifying tiles. Right now, even if not that polished for my taste, I can show how it looks like a finished version, though:

Spoiler:

There are some things to improve:

♣ due to the lack of space, some translations are "poetic licenses"; for instance, PROGRAMERS (in the code P-R-O-G-R-A-M-ER-S, 9 letters) cannot be translated to its Spanish version PROGRAMADORES (using the provided tiles in ROM, P-R-O-G-R-A-M-A-D-OR-E-S, 12 letters), nor PROGRAMADO, nor PROGRAMACIÓN or any other word that starts with PROGRAM... so I translated to CÓDIGO (it means "code") that is shorter and is related with "source code" and programming.

I state all this since there is a bunch of credit words in this part of the ROM (mainly repeating the same word 2 or 3 more times or even never used for whatever reason, like MUSIC DIRECTOR (x3 in total), SDF HASHIGUCHI (x4 times but only use one of the displays 3 times, weird) or MESSAGE COORDINATOR (never displayed)). I tried to display them and even looking for the pointers that rule the appearance of the credits, unsuccessfully. I must try harder when I am not tired of looking at this, since with this extra letters I can make a more accurate translation.

♣ Change the "The End" ending for the Spanish "Fin". The tiles on screen look similar so it should not be difficult

However, after having troubles for days just to add the accent marks for these credits, and looking how the tiles are shown in the ROM, I have close to zero motivation to even try it and have another garble mess of pixels. Maybe in future since I think is a great detail but right now it implies a lot of effort.

BTW, I have created already the .ips and tested in an unmodified Arcana ROM, and works pretty solid. I will make a whole playthrough just to be sure lastests modifications do not affect previous parts of the game.

Thanks for reading.
« Last Edit: May 01, 2020, 06:22:24 am by RetGal »