News: 11 March 2016 - Forum Rules

Author Topic: Need help finding Katana’s name in the SNES port of Street Fighter Alpha 2  (Read 3449 times)

SCD

  • RHDN Supporter
  • Hero Member
  • *****
  • Posts: 757
  • SPOOOOON!
    • View Profile
Hi everyone,

I need help on finding Katana’s name in the SNES port of Street Fighter Alpha 2, because I’m trying to make a restoration hack for it that will restore the red blood and change Katana’s name back to being Sodom.

I successfully restored the red blood and Sodom’s name for the ingame text:

But I can’t find the hex values for Katana’s name that is used for the select player screen, his versus portrait and his energy bar:

Does anybody know what hex values they used in the ROM so I can change them?

UPDATE: Sodom's name has been restored, but I still need help on restoring graphics for some of the stages, scroll down to the bottom of this page to see what I need help on.
« Last Edit: October 04, 2019, 10:31:45 am by SCD »

Psyklax

  • Hero Member
  • *****
  • Posts: 1112
    • View Profile
    • Psyklax Translations
The names are done differently for those bits: the character select screen name is stored at $A200 in VRAM, and is changed whenever you highlight a different character. It's DMAed in there from $7F06D0 (in the case of Sodom/Katana's name). Therefore it's stored as graphics, so you can't just change a few bytes and call it a day. You need to replace the existing graphics with his new name.

I haven't got time to figure out how it stores those names right now, because the data in the $7F bank is RAM which comes from somewhere... but I haven't figured out where exactly. However, if you go to $C0D66B, you can mess with the character select names. The first bytes is the offset for the graphics, the second is how far to indent it, the third is how many tiles the name uses. Try changing stuff in bsnes-plus while the game is running and you'll see. :)

If someone can help me with SNES DMA then that'd be good, cause I really want to know where this data is coming from.

DarkSamus993

  • Sr. Member
  • ****
  • Posts: 291
    • View Profile
Turns out Sodom's name was left in the USA version graphics for the character select and health bar (both are loaded from the same graphics file). This means the only change needed is the index to the name gfx.
Code: [Select]
; change "Katana" to "Sodom"
$C088CD (0x88CD) = [6D 00 06] change to --> [1D 00 06]  ; health bar
$C0D692 (0xD692) = [6D 00 06] change to --> [1D 00 06]  ; character select

For the vs. portrait name the game uses a font rather than separate gfx for each name like the character select. This means just the tilemap needs changed to display a different name.
Code: [Select]
; change "Katana" to "Sodom"
$C02260 (0x2260) =
[5C 25 14 25 15 25 00 25 01 25 26 25 27 25]
[00 25 01 25 1A 25 1B 25 00 25 01 25 5C 25]
[5C 25 48 25 49 25 34 25 35 25 5A 25 5B 25]
[34 25 35 25 4E 25 4F 25 34 25 35 25 5C 25]
change to -->
[5C 25 5C 25 24 25 25 25 1C 25 1D 25 06 25]
[07 25 1C 25 1D 25 18 25 19 25 5C 25 5C 25]
[5C 25 5C 25 58 25 59 25 50 25 51 25 3A 25]
[3B 25 50 25 51 25 4C 25 4D 25 5C 25 5C 25]


If someone can help me with SNES DMA then that'd be good, cause I really want to know where this data is coming from.
This is for the actual graphics, which fortunately didn't need changed.
Code: [Select]
; S-DD1 decompress GFX (character select names) and DMA to RAM ($7F0000)
; compressed GFX = $DA1634 - $DA1C00 ($05CD bytes, HiROM address mode)
$C0/D801 A2 34 16    LDX #$1634              A:20FF X:0040 Y:0062 D:0000 DB:BF S:1EB6 P:envMxdizc  ; source address
$C0/D804 86 10       STX $10    [$00:0010]   A:20FF X:1634 Y:0062 D:0000 DB:BF S:1EB6 P:envMxdizc
$C0/D806 A2 00 00    LDX #$0000              A:20FF X:1634 Y:0062 D:0000 DB:BF S:1EB6 P:envMxdizc  ; target address
$C0/D809 86 14       STX $14    [$00:0014]   A:20FF X:0000 Y:0062 D:0000 DB:BF S:1EB6 P:envMxdiZc
$C0/D80B A2 40 0F    LDX #$0F40              A:20FF X:0000 Y:0062 D:0000 DB:BF S:1EB6 P:envMxdiZc  ; decompressed size
$C0/D80E 86 00       STX $00    [$00:0000]   A:20FF X:0F40 Y:0062 D:0000 DB:BF S:1EB6 P:envMxdizc
$C0/D810 A9 9A       LDA #$9A                A:20FF X:0F40 Y:0062 D:0000 DB:BF S:1EB6 P:envMxdizc  ; source data bank ($9A | $40 = $DA)
$C0/D812 85 12       STA $12    [$00:0012]   A:209A X:0F40 Y:0062 D:0000 DB:BF S:1EB6 P:eNvMxdizc
$C0/D814 A9 7F       LDA #$7F                A:209A X:0F40 Y:0062 D:0000 DB:BF S:1EB6 P:eNvMxdizc  ; target data bank
$C0/D816 85 16       STA $16    [$00:0016]   A:207F X:0F40 Y:0062 D:0000 DB:BF S:1EB6 P:envMxdizc
$C0/D818 22 CF DF DA JSL $DADFCF[$DA:DFCF]   A:207F X:0F40 Y:0062 D:0000 DB:BF S:1EB6 P:envMxdizc  ; setup DMA

This is for the vs. screen portrait name tilemaps:
Code: [Select]
; DMA (vs. screen name) tilemap to VRAM
$C0/1C91 AD A2 07    LDA $07A2  [$BF:07A2]   A:2300 X:0038 Y:001C D:0000 DB:BF S:1EB6 P:envMxdiZC  ; player #1 ID
$C0/1C94 A2 C1 5E    LDX #$5EC1              A:2306 X:0038 Y:001C D:0000 DB:BF S:1EB6 P:envMxdizC  ; target address
$C0/1C97 20 A5 1C    JSR $1CA5  [$C0:1CA5]   A:2306 X:5EC1 Y:001C D:0000 DB:BF S:1EB6 P:envMxdizC  ; setup DMA
...
$C0/1C9A AD 22 0A    LDA $0A22  [$BF:0A22]   A:0048 X:0018 Y:0038 D:0000 DB:BF S:1EB6 P:envMxdizC  ; player #2 ID
$C0/1C9D A2 D2 5E    LDX #$5ED2              A:0011 X:0018 Y:0038 D:0000 DB:BF S:1EB6 P:envMxdizC  ; target address
$C0/1CA0 20 A5 1C    JSR $1CA5  [$C0:1CA5]   A:0011 X:5ED2 Y:0038 D:0000 DB:BF S:1EB6 P:envMxdizC  ; setup DMA

DMA traces using Snes9X Debugger:
Code: [Select]
; character select names GFX (uses S-DD1 chip for decompression)
DMA[7]: CPU->PPU Mode:0 0xDA1634->0x2180 Bytes:F40 (fixed) V:231

; character select ("Katana")
DMA[0]: CPU->PPU Mode:1 0x7F06D0->0x2118 Bytes:60 (inc) V:238 VRAM: 5100 (1,0) word  ; name gfx
DMA[0]: CPU->PPU Mode:1 0x7FF500->0x2118 Bytes:40 (inc) V:239 VRAM: 5F20 (1,0) word  ; tilemap

; vs. screen ("Katana")
DMA[0]: CPU->PPU Mode:1 0xC02260->0x2118 Bytes:1C (inc) V:230 VRAM: 5EC1 (1,0) word  ; tilemap (row 1)
DMA[0]: CPU->PPU Mode:1 0xC0227C->0x2118 Bytes:1C (inc) V:230 VRAM: 5EE1 (1,0) word  ; tilemap (row 2)

Psyklax

  • Hero Member
  • *****
  • Posts: 1112
    • View Profile
    • Psyklax Translations
Turns out Sodom's name was left in the USA version graphics for the character select and health bar (both are loaded from the same graphics file).

Damn, I looked through all the names by changing those addresses, but I must have missed Sodom. :) I know Katana was stuck on the end. I'm still a bit confused where these graphics come from before their DMA into the $7F bank, because they're nowhere in the ROM - in fact, they're nowhere on the address bus at all.

DarkSamus993

  • Sr. Member
  • ****
  • Posts: 291
    • View Profile
I'm still a bit confused where these graphics come from before their DMA into the $7F bank, because they're nowhere in the ROM - in fact, they're nowhere on the address bus at all.
My notes say where they are stored. The graphics are located at $DA1634 (0x1A1634, comp_len=Ox5CD, decomp_len=0xF40). They are stored compressed and the game uses the S-DD1 enhancement chip to decompress them to RAM at $7F0000.

Psyklax

  • Hero Member
  • *****
  • Posts: 1112
    • View Profile
    • Psyklax Translations
They are stored compressed and the game uses the S-DD1 enhancement chip to decompress them to RAM at $7F0000.

Aha! That explains it. I knew compression must be the reason, but I had no idea the game used a special chip for that, presumably doing it on the fly. I think I actually got that address, $DA1634, but when I saw what was there it was totally different. This explains it. Time to read up on the S-DD1 then. :)

EDIT: So Wikipedia says "Star Ocean and Street Fighter Alpha 2 are the only games that use this chip". No wonder it fooled me. :)
« Last Edit: September 29, 2019, 03:23:01 am by Psyklax »

SCD

  • RHDN Supporter
  • Hero Member
  • *****
  • Posts: 757
  • SPOOOOON!
    • View Profile
@DarkSamus993: Thank you for finding those hex addresses, I was able to change his name back to Sodom on those areas. That was very nice of you on helping me on this, you're the best.

@Psyklax: I also want to thank you for letting me know about bsnes-plus, this could be useful for future SNES projects.

UPDATE: I just discovered that the American & European versions of this game is a lot more censored than I thought, thanks to info from user RealGaea.

On Sodom's stage, his truck has his name on the license plate:

On Guy's stage, the word "KILL YOU" appears on the wall:

On Birdie's stage, there's people peeing in the urinals and when you use a super move, the left stall opens:

So I still need help on this hack, including restore this stuff for the European version as well.

Sorry about this, I did not know that Capcom USA censored a lot more things in the international versions of this port.
« Last Edit: October 04, 2019, 10:32:11 am by SCD »