[request]: Phantasy Star Online Episode III: C.A.R.D. Revolution NTSC USA

Game Hacks, Trainers, Cheats

Moderator: Ralf@gc-forever

Post Reply
User avatar
capzlk
Posts: 72
Joined: Tue Sep 15, 2015 9:18 pm

[request]: Phantasy Star Online Episode III: C.A.R.D. Revolution NTSC USA

Post by capzlk » Sun Apr 19, 2020 10:39 pm

One of my favorite games, Phantasy Star Online Episode III: C.A.R.D. Revolution has a few cheats listed here but these are only for the PAL version of the game.

I'd love to be able to play my imported American version in widescreen. Is there something special about this version causing there to not be a wide screen cheat as of yet?
User avatar
Capsule
Posts: 1
Joined: Sun Mar 10, 2019 1:22 am
Location: San Francisco Bay Area
Contact:

Re: [request]: Phantasy Star Online Episode III: C.A.R.D. Revolution NTSC USA

Post by Capsule » Thu Sep 10, 2020 9:22 pm

I second this. Been waiting for this for a while now.
Phantasy Star Online C.A.R.D. & B6 Battler
cearp
Posts: 8
Joined: Mon Sep 10, 2018 4:04 pm

Re: [request]: Phantasy Star Online Episode III: C.A.R.D. Revolution NTSC USA

Post by cearp » Sat Nov 07, 2020 5:51 pm

I took a little look at this, thought I'd manage it but I got stuck!
I'm confident the addresses I've found are correct, but I'm just having trouble making the branch code.

@Ralf - if you don't mind, I would really appreciate a little explanation/help.

Here's your EUR code:

Code: Select all

16:9 Aspect Ratio (Widescreen) [Ralf]
20384C94 FC200818
06000088 00000010
C042DEE8 EFBD00B2
FC40E890 48384C08
04384C98 4BC7B3F0
E2000001 80008000
After commenting this to make it understandable:

Code: Select all

# if (base address + 384C94) == FC200818:
20384C94 FC200818
# write the next 0x10 bytes to (base address + 88)
06000088 00000010
# the bytes we're writing
C042DEE8 EFBD00B2
FC40E890 48384C08
# write 4BC7B3F0 to (base address + 384C98)
# 4BC7B3F0 makes us branch to 0x80000088, to execute the code of the 16 bytes above.
04384C98 4BC7B3F0
# end if (closes the first line's if)
# and set base address and pointer address to 0x80000000
E2000001 80008000
I have some questions, really just curious and want to learn, I couldn't figure these things out.
  • What's the default base address? (I assume 0x80000000)
  • Any reason you don't set the base and pointer at the top, is it maybe just to save a line?
  • Wouldn't setting the addresses at the end change them only for the next code?
    I am confused because, if a different code ran before this one, and it changed the base address, how would this code ever use the base address it needs? (because we only set it at the bottom)
  • Also, is there a reason you set the pointer address to 0x8000000? I don't believe it is being used.
Looking at the 16 bytes that get written, Dolphin tells me that we branch to 80384C9C:
Image

But when I use an online disassembler, I get 80384c14 - an address difference of 0x88.

Code: Select all

C0 42 DE E8    lfs   f2, -0x2118(r2)
EF BD 00 B2    fmuls f29, f29, f2
FC 40 E8 90    fmr   f2, f29
48 38 4C 08    b     0x384c14
I guess this difference of 0x88 matches up with the 0x88 in the 2nd line of your code? (06000088 00000010)?

Anyway, comparing memory dumps, the USA equivalent of 384C94 is 383DC4.
Here's my NON-WORKING attempt:

Code: Select all

20383DC4 FC200818
06000088 00000010
C042DEE8 EFBD00B2
FC40E890 48383d38
04383DC8 XXXXXXXX - can't get this branch correct, when that's fixed I think the code will work, we want to branch to 0x80000088. Using 4BC7B3F0 (like in your EU code) doesn't work and branches me somewhere else...(???)
E2000001 80008000
Is there a tool you use for converting instructions to hex?

Thank you Ralf for your time, and all the work you have done on the PSO games!
Ralf@gc-forever
Posts: 2048
Joined: Sun Mar 16, 2014 9:31 am

Re: [request]: Phantasy Star Online Episode III: C.A.R.D. Revolution NTSC USA

Post by Ralf@gc-forever » Sun Nov 08, 2020 3:22 pm

cearp wrote:What's the default base address? (I assume 0x80000000)
Yep, 0x80000000 is the default base address (GC main memory address range: 0x80000000 to 0x817FFFFF).
cearp wrote:Any reason you don't set the base and pointer at the top, is it maybe just to save a line?
The code handler already did it (base address (ba) = 0x80000000, pointer (po) = 0x80000000).
cearp wrote:Wouldn't setting the addresses at the end change them only for the next code?
Yes. If you modify the ba/po you should always reset it to its original values at the end of code.
cearp wrote:Also, is there a reason you set the pointer address to 0x8000000? I don't believe it is being used.
The code don't use the po. Anyway, it has a terminator code line and so we should also reset the pointer (using a "E2000001 80000000" or "E2000001 00000000" code line makes no sense).
cearp wrote:Anyway, comparing memory dumps, the USA equivalent of 384C94 is 383DC4.
Below is all info you need to port the widescreen code to NTSC-U region.

Code: Select all


PAL
80384C94: FC200818  frsp   f1,f1         ; f1: fovy
80384C98: FC40E890  fmr    f2,f29        ; f2: aspect ratio (hook)
80384C9C: FC60F090  fmr    f3,f30        ; f3: positive distance to near clipping plane
80384CA0: FC80F890  fmr    f4,f31        ; f4: positive distance to far  clipping plane
80384CA4: 4BF9AACD  bl     0x8031f770    ; SDK MTXPerspective function call
80384CA8: 3C608054  lis    r3,-32684
80384CAC: 3863C910  subi   r3,r3,14064
80384CB0: 38800000  li     r4,0
80384CB4: 4BFB38A9  bl     0x8033855c
80384CB8: 38000000  li     r0,0
80384CBC: 3C608054  lis    r3,-32684
80384CC0: 3883C910  subi   r4,r3,14064
80384CC4: 90040040  stw    r0,64(r4)
80384CC8: D3C40044  stfs   f30,68(r4)
80384CCC: D3E40048  stfs   f31,72(r4)
80384CD0: D3A4004C  stfs   f29,76(r4)
80384CD4: C042DEE0  lfs    f2,-8480(r2)
80384CD8: 806DCE14  lwz    r3,-12780(r13)
80384CDC: A0030006  lhz    r0,6(r3)
80384CE0: C822DEF8  lfd    f1,-8456(r2)
80384CE4: 9001002C  stw    r0,44(r1)
80384CE8: 3C004330  lis    r0,17200
80384CEC: 90010028  stw    r0,40(r1)
80384CF0: C8010028  lfd    f0,40(r1)
80384CF4: EC200828  fsubs  f1,f0,f1
80384CF8: C0040014  lfs    f0,20(r4)
80384CFC: EC010032  fmuls  f0,f1,f0
80384D00: EC420032  fmuls  f2,f2,f0
80384D04: D0440050  stfs   f2,80(r4)
80384D08: C062DEE4  lfs    f3,-8476(r2)
80384D0C: EC031024  fdivs  f0,f3,f2
80384D10: D0040054  stfs   f0,84(r4)
80384D14: 3C608054  lis    r3,-32684
80384D18: 3863D3A8  subi   r3,r3,11352
80384D1C: D0430018  stfs   f2,24(r3)
80384D20: C002DEE8  lfs    f0,-8472(r2)  ; f0: 1.3333 (_SDA2_BASE_ (rtoc) FP constant)


16:9 aspect ratio patch

80000088: C042DEE8  lfs    f2,-8472(r2)  ; f2: 1.3333 (_SDA2_BASE_ (rtoc) FP constant)
8000008C: EFBD00B2  fmuls  f29,f29,f2    ; f29: new aspect ratio = old aspect ratio * 1.3333 
80000090: FC40E890  fmr    f2,f29        ; f2: aspect ratio (for MTXPerspective function)
80000094: 48384C08  b      0x80384C9C

80384C98: 4BC7B3F0  b      0x80000088


Stuff that must be ported:

- Conditional & hook addresses (0x80384C94 & 0x80384C98)
- 1.3333 FP constant offset    (0xDEE8)
- Branch instruction offsets   (0x00384C08 & 0xFFC7B3F0)


US version

Conditional address: 0x80383DC4
Hook address:        0x80383DC8
FP constant offset:  0x????     (there's a chance, that the US version uses the same offset as the PAL version)

Branch instruction offsets calculation

0x80383DCC - 0x80000094 = 0x00383D38 -> branch instruction: 48383D38
0x80000088 - 0x80383DC8 = 0xFFC7C2C0 -> branch instruction: 4BC7C2C0

16:9 Aspect Ratio (Widescreen) code
20383DC4 FC200818
06000088 00000010
C042???? EFBD00B2
FC40E890 48383D38
04384C98 4BC7C2C0
E2000001 80008000

cearp wrote:Is there a tool you use for converting instructions to hex?
An assembler (and disassembler) tool is part of the WiiRD package:

"powerpc-gekko-as.exe"
"powerpc-gekko-objcopy.exe"
"vdappc.exe"

PPC assembler example (asm.s = source file, asm.bin = binary file):

powerpc-gekko-as.exe -mgekko -mregnames -o asm.o asm.s
powerpc-gekko-objcopy.exe -O binary asm.o asm.bin
cearp
Posts: 8
Joined: Mon Sep 10, 2018 4:04 pm

Re: [request]: Phantasy Star Online Episode III: C.A.R.D. Revolution NTSC USA

Post by cearp » Wed Nov 11, 2020 1:03 pm

Thank you very much Ralf! I really appreciate it, and will see if I can find that offset :)

Ralf@gc-forever wrote:
Sun Nov 08, 2020 3:22 pm
cearp wrote:Wouldn't setting the addresses at the end change them only for the next code?
Yes. If you modify the ba/po you should always reset it to its original values at the end of code.
Is any part of your code changing the the ba or po? I didn't think it was. I think that's why I was confused that you were 'resetting' them at the end.
But if it is just good practice to do it always, that makes sense.
Axl IVVI
Posts: 2
Joined: Tue Oct 20, 2020 8:31 pm
Location: Hell most days

Re: [request]: Phantasy Star Online Episode III: C.A.R.D. Revolution NTSC USA

Post by Axl IVVI » Sat Dec 12, 2020 2:07 am

I just wish the have all cards code was savable.
Post Reply