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

Author Topic: [Technical] [SNES] Mega Man X re-translation  (Read 1391 times)

Her-Saki

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
[Technical] [SNES] Mega Man X re-translation
« on: February 17, 2018, 03:05:03 pm »


He said damn, censor him!

I have re-translated Rockman X and the script was completed, but once inserted scroll fails and the portrait is out of place (despite I have expanded the letterbox just changing the CMP value). All is done but these little yet necessary details.
I could provide the partial patch and script if required. Thanks in advance.
"Ask me about ROMs and your suffering will be legendary"

Midna

  • Hero Member
  • *****
  • Posts: 688
  • Resident Panel de Pon Nut
    • View Profile
Re: [Technical] [SNES] Mega Man X re-translation
« Reply #1 on: February 18, 2018, 08:40:49 am »
He said damn, censor him!

I know it's a joke, but Capcom did literally exactly the same thing as you when the Mega Man X Collection came out, so...

Her-Saki

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: [Technical] [SNES] Mega Man X re-translation
« Reply #2 on: February 18, 2018, 08:55:18 am »
The only thing that that MMX in the collection does differently is add the swear? I think the original script still deserves to be shown.
"Ask me about ROMs and your suffering will be legendary"

Lenophis

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 951
  • The return of the sombrero!
    • View Profile
    • Slick Productions
Re: [Technical] [SNES] Mega Man X re-translation
« Reply #3 on: February 18, 2018, 11:01:52 am »
I have re-translated Rockman X and the script was completed, but once inserted scroll fails and the portrait is out of place (despite I have expanded the letterbox just changing the CMP value). All is done but these little yet necessary details.
I could provide the partial patch and script if required. Thanks in advance.
Despite your actual question never being asked, I can only surmise what you are asking is that you don't know why X's portrait is where it is. Since you aren't fully stating what you did, questions now have to be asked:
What did you use to insert the new dialogue?
What assembly changes have you done?
v1.0 or v1.1 of the game?
Are there any other formatting characters with the dialogue?
Are you sure the pointers are right?


https://ff6randomizer.codeplex.com/ - Randomize your FF6 experience!

Her-Saki

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: [Technical] [SNES] Mega Man X re-translation
« Reply #4 on: February 18, 2018, 11:20:39 am »
Quote
Despite your actual question never being asked, I can only surmise what you are asking is that you don't know why X's portrait is where it is. Since you aren't fully stating what you did, questions now have to be asked:
What did you use to insert the new dialogue?
What assembly changes have you done?
v1.0 or v1.1 of the game?
Are there any other formatting characters with the dialogue?
Are you sure the pointers are right?

0 - Scroll fails and the portrait is out of place (should I say "fix this!"?).
1 - Dialogue is okay, there are just those bugs (I also said everything else is done).
2 - I have documented the X axis letterbox size routine with Bsnes and changed the CMP value after bypassing the routine, however, I couldn't trace the portrait and scroll routine aaaand that's why I'm here asking for help.
3 - 1.0, I have not found any doc regarding version differences and DIFF file just shows garbage (location differences instead of real ones), so I just stuck on 1.0.
4 and 5 - See #1 answer.
"Ask me about ROMs and your suffering will be legendary"

DarkSamus993

  • Full Member
  • ***
  • Posts: 196
    • View Profile
Re: [Technical] [SNES] Mega Man X re-translation
« Reply #5 on: February 18, 2018, 06:58:02 pm »
Scroll fails and the portrait is out of place (should I say "fix this!"?).

This code handles loading the x/y coordinate data for the portraits:
Code: [Select]
87ABBC LDA $0B       [000EF3] A:0120 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdizc
87ABBE AND #$00FF             A:6800 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdizc
87ABC1 ASL A                  A:0000 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdiZc
87ABC2 TAX                    A:0000 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdiZc
87ABC3 LDA $D176,x   [86D176] A:0000 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdiZc  ; xPos
87ABC6 AND #$00FF             A:6840 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdizc
87ABC9 CLC                    A:0040 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdizc
87ABCA ADC $1E4D     [861E4D] A:0040 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdizc
87ABCD STA $05       [000EED] A:1CA2 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdizc
87ABCF LDA $D177,x   [86D177] A:1CA2 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdizc  ; yPos
87ABD2 AND #$00FF             A:C068 X:0000 Y:00A7 S:012E D:0EE8 DB:86 NvmXdizc
87ABD5 CLC                    A:0068 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdizc
87ABD6 ADC $1E50     [861E50] A:0068 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdizc
87ABD9 STA $08       [000EF0] A:0168 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdizc
87ABDB LDA #$A8E8             A:0168 X:0000 Y:00A7 S:012E D:0EE8 DB:86 nvmXdizc
87ABDE STA $31       [000F19] A:A8E8 X:0000 Y:00A7 S:012E D:0EE8 DB:86 NvmXdizc
87ABE0 SEP #$20               A:A8E8 X:0000 Y:00A7 S:012E D:0EE8 DB:86 NvmXdizc
87ABE2 LDY $0B       [000EF3] A:A8E8 X:0000 Y:00A7 S:012E D:0EE8 DB:86 NvMXdizc
87ABE4 LDA $D194,y   [86D194] A:A8E8 X:0000 Y:0000 S:012E D:0EE8 DB:86 nvMXdiZc  ; compressed gfx index
87ABE7 STA $10       [000EF8] A:A86F X:0000 Y:0000 S:012E D:0EE8 DB:86 nvMXdizc
87ABE9 TAX                    A:A86F X:0000 Y:0000 S:012E D:0EE8 DB:86 nvMXdizc
87ABEA LDA $7F8300,x [7F836F] A:A86F X:006F Y:0000 S:012E D:0EE8 DB:86 nvMXdizc
87ABEE ORA $D18A,y   [86D18A] A:A822 X:006F Y:0000 S:012E D:0EE8 DB:86 nvMXdizc  ; horizontal flip
87ABF1 ORA #$30               A:A862 X:006F Y:0000 S:012E D:0EE8 DB:86 nvMXdizc
87ABF3 STA $11       [000EF9] A:A872 X:006F Y:0000 S:012E D:0EE8 DB:86 nvMXdizc
87ABF5 LDA #$7A               A:A872 X:006F Y:0000 S:012E D:0EE8 DB:86 nvMXdizc
87ABF7 STA $16       [000EFE] A:A87A X:006F Y:0000 S:012E D:0EE8 DB:86 nvMXdizc
87ABF9 LDA $0B       [000EF3] A:A87A X:006F Y:0000 S:012E D:0EE8 DB:86 nvMXdizc
87ABFB ASL A                  A:A800 X:006F Y:0000 S:012E D:0EE8 DB:86 nvMXdiZc
87ABFC TAX                    A:A800 X:006F Y:0000 S:012E D:0EE8 DB:86 nvMXdiZc
87ABFD JMP ($AC00,x) [87AC00] A:A800 X:0000 Y:0000 S:012E D:0EE8 DB:86 nvMXdiZc

So the portrait data for the intro stage dialogue would be:
Code: [Select]
Vile:
$86D178 = $C0 = xPos
$86D179 = $58 = yPos
$86D18B = $00 = hFlip (left)
$86D195 = $70 = compGFX (Vile)
Code: [Select]
X:
$86D176 = $40 = xPos
$86D177 = $68 = yPos
$86D18A = $40 = hFlip (right)
$86D194 = $6F = compGFX (X)
Code: [Select]
Zero:
$86D17A = $C0 = xPos
$86D17B = $68 = yPos
$86D18C = $00 = hFlip (left)
$86D196 = $71 = compGFX (Zero)

The text scrolling not working could either be incorrect control codes being inserted with the text, or you broke something with your assembly changes. If you could provide a patch I'd be happy to take a look.

1.0, I have not found any doc regarding version differences and DIFF file just shows garbage (location differences instead of real ones), so I just stuck on 1.0.
They fixed some bugs in v1.1, see here: https://tcrf.net/Mega_Man_X#Revision_Changes

Her-Saki

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: [Technical] [SNES] Mega Man X re-translation
« Reply #6 on: February 19, 2018, 11:14:16 am »


Neat, thanks for finding the data (Geiger didn't trace it for some reason).

Now for the scroll, I have identified the routine, here it is:


Code: [Select]
$80/E8F1 80 D3       BRA $D3    [$E8C6]      A:01FA X:0000 Y:0002 P:envmXdiZC
$80/E8C6 C2 21       REP #$21                A:01FA X:0000 Y:0002 P:envmXdiZC
$80/E8C8 AE 37 1F    LDX $1F37  [$86:1F37]   A:01FA X:0000 Y:0002 P:envmXdiZc
$80/E8CB F0 08       BEQ $08    [$E8D5]      A:01FA X:0000 Y:0002 P:envmXdiZc
$80/E8D5 AD 34 1F    LDA $1F34  [$86:1F34]   A:01FA X:0000 Y:0002 P:envmXdiZc ;load #$02
$80/E8D8 29 FF 00    AND #$00FF              A:0002 X:0000 Y:0002 P:envmXdizc
$80/E8DB 65 BE       ADC $BE    [$00:00BE]   A:0002 X:0000 Y:0002 P:envmXdizc ;add $BE ($BE holds the scroll lenght)
$80/E8DD 85 BE       STA $BE    [$00:00BE]   A:0008 X:0000 Y:0002 P:envmXdizc ;store in $BE
$80/E8DF 29 F8 FF    AND #$FFF8              A:0008 X:0000 Y:0002 P:envmXdizc ;AND FFF8 returns -0 or -8
$80/E8E2 85 00       STA $00    [$00:0000]   A:0008 X:0000 Y:0002 P:envmXdizc ;$BE = 00
$80/E8E4 AD 38 1F    LDA $1F38  [$86:1F38]   A:0008 X:0000 Y:0002 P:envmXdizc
$80/E8E7 29 F8 FF    AND #$FFF8              A:0000 X:0000 Y:0002 P:envmXdiZc ;
$80/E8EA C5 00       CMP $00    [$00:0000]   A:0000 X:0000 Y:0002 P:envmXdiZc ;CMP $BE - $1F38 ($1F38 keeps changing
$80/E8EC D0 05       BNE $05    [$E8F3]      A:0000 X:0000 Y:0002 P:eNvmXdizc until not equal
$80/E8F3 20 E0 FB    JSR $FBE0  [$80:FBE0]   A:0000 X:0000 Y:0002 P:eNvmXdizc

$80/FBE0 A5 BE       LDA $BE    [$00:00BE]   A:0020 X:0000 Y:0002 P:eNvmXdizc ;if not equal copy BE on 1F38
$80/FBE2 8D 38 1F    STA $1F38  [$86:1F38]   A:0028 X:0000 Y:0002 P:envmXdizc
$80/FBE5 60          RTS                     A:0028 X:0000 Y:0002 P:envmXdizc

$80/E8F6 EA          NOP                     A:0028 X:0000 Y:0002 P:envmXdizc ;is this the routine to check if
$80/E8F7 EA          NOP                     A:0028 X:0000 Y:0002 P:envmXdizc it should stop scrolling or is unrelated?
$80/E8F8 A6 A4       LDX $A4    [$00:00A4]   A:0028 X:0000 Y:0002 P:envmXdizc (it uses the same accumulator value so I
$80/E8FA 18          CLC                     A:0028 X:0000 Y:0002 P:envmXdiZc think it could probably be related)
$80/E8FB 69 E0 00    ADC #$00E0              A:0028 X:0000 Y:0002 P:envmXdiZc
$80/E8FE 29 F8 FF    AND #$FFF8              A:0108 X:0000 Y:0002 P:envmXdizc
$80/E901 0A          ASL A                   A:0108 X:0000 Y:0002 P:envmXdizc
$80/E902 0A          ASL A                   A:0210 X:0000 Y:0002 P:envmXdizc
$80/E903 29 FF 07    AND #$07FF              A:0420 X:0000 Y:0002 P:envmXdizc
$80/E906 09 00 08    ORA #$0800              A:0420 X:0000 Y:0002 P:envmXdizc
$80/E909 9D 01 06    STA $0601,x[$86:0601]   A:0C20 X:0000 Y:0002 P:envmXdizc
$80/E90C E2 20       SEP #$20                A:0C20 X:0000 Y:0002 P:envmXdizc
$80/E90E A9 80       LDA #$80                A:0C20 X:0000 Y:0002 P:envMXdizc
$80/E910 9D 00 06    STA $0600,x[$86:0600]   A:0C80 X:0000 Y:0002 P:eNvMXdizc
$80/E913 A9 40       LDA #$40                A:0C80 X:0000 Y:0002 P:eNvMXdizc
$80/E915 9D 03 06    STA $0603,x[$86:0603]   A:0C40 X:0000 Y:0002 P:envMXdizc

Adding #$20 to $BE effectively fix the first sentence scroll, so the problem is identifying the conditions for the scroll to stop (since it reads text, and then increments BE until a certain point).
How should I trace that condition?
"Ask me about ROMs and your suffering will be legendary"

DarkSamus993

  • Full Member
  • ***
  • Posts: 196
    • View Profile
Re: [Technical] [SNES] Mega Man X re-translation
« Reply #7 on: February 19, 2018, 01:20:15 pm »
NOTE: I'm using the USA v1.0 rom since it's quicker for me to debug the text.

The text scroll length is stored with the text as a control byte.
Code: [Select]
; load text scroll length
80E998 LDA ($68),y   [84C90E] A:C90C X:000C Y:0001 S:01FC D:0000 DB:84 NvMXdizc
80E99A INY                    A:C907 X:000C Y:0001 S:01FC D:0000 DB:84 nvMXdizc
80E99B PLB                    A:C907 X:000C Y:0002 S:01FC D:0000 DB:84 nvMXdizc
80E99C RTS                    A:C907 X:000C Y:0002 S:01FD D:0000 DB:86 NvMXdizc

80E8BB STA $1F3A     [861F3A] A:C907 X:000C Y:0002 S:01FF D:0000 DB:86 NvMXdizc

That value is then decreased and the text is scrolled. This process loops until $1F3A equals zero.
Code: [Select]
; decrease text scroll value & scroll text
80E92F DEC $1F3A     [861F3A] A:01FA X:0040 Y:0002 S:01FF D:0000 DB:86 nvMXdizc
80E932 BNE $E8BE     [80E8BE] A:01FA X:0040 Y:0002 S:01FF D:0000 DB:86 nvMXdizc
80E8BE REP #$21               A:01FA X:0040 Y:0002 S:01FF D:0000 DB:86 nvMXdizc
80E8C0 LDX $1F37     [861F37] A:01FA X:0040 Y:0002 S:01FF D:0000 DB:86 nvmXdizc
80E8C3 BEQ $E8CD     [80E8CD] A:01FA X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdiZc
80E8CD LDA $1F34     [861F34] A:01FA X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdiZc
80E8D0 AND #$00FF             A:0002 X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdizc
80E8D3 ADC $BE       [0000BE] A:0002 X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdizc
80E8D5 STA $BE       [0000BE] A:0012 X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdizc
80E8D7 AND #$FFF8             A:0012 X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdizc
80E8DA STA $00       [000000] A:0010 X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdizc
80E8DC LDA $1F38     [861F38] A:0010 X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdizc
80E8DF AND #$FFF8             A:0010 X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdizc
80E8E2 CMP $00       [000000] A:0010 X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdizc
80E8E4 BNE $E8EB     [80E8EB] A:0010 X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdiZC
80E8E6 JSR $8100     [808100] A:0010 X:0000 Y:0002 S:01FF D:0000 DB:86 nvmXdiZC

Her-Saki

  • Jr. Member
  • **
  • Posts: 23
    • View Profile
Re: [Technical] [SNES] Mega Man X re-translation
« Reply #8 on: February 23, 2018, 11:23:00 am »
Well, it's done now, thank you so much for your help.
But I'm curious about the bugs in the TCRF page. Especially the bug in the Storm Eagle stage. "Get credit" means that if I die at the same time that the boss defeating him with the powered up Shotgun Ice it'll lead me to the staff roll? I have tried to die at the same time but Storm Eagle becomes invencible right after I explode. If I mount the ice platform that impacts him and then die by falling nothing happens. How exactly do you get credit with this bug?
"Ask me about ROMs and your suffering will be legendary"

DarkSamus993

  • Full Member
  • ***
  • Posts: 196
    • View Profile
Re: [Technical] [SNES] Mega Man X re-translation
« Reply #9 on: February 23, 2018, 04:03:05 pm »
Well, it's done now, thank you so much for your help.
You're welcome, I'm always happy to help out.

But I'm curious about the bugs in the TCRF page. Especially the bug in the Storm Eagle stage. "Get credit" means that if I die at the same time that the boss defeating him with the powered up Shotgun Ice it'll lead me to the staff roll? I have tried to die at the same time but Storm Eagle becomes invencible right after I explode. If I mount the ice platform that impacts him and then die by falling nothing happens. How exactly do you get credit with this bug?
It just means the game still counts Storm Eagle as being defeated. Here's a video of it in action: https://www.youtube.com/watch?v=QNrssqBvX-Q