Author Topic: 8th Playable Character Possible?! (Updating!)  (Read 123507 times)

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1802
  • Nu-chan
    • View Profile
    • Hi trig!
Re: 8th Playable Character Possible?! (Updating!)
« Reply #330 on: March 23, 2009, 04:09:00 am »
Vehek, I have a question regarding something you posted in the six letter names topic.

Found how to stop the sixth letter from being greyed out.
This is the original code in the game.
Quote
$C1/0919 9D 00 0D    STA $0D00,x[$7E:0D1B]   A:0029 X:001B Y:014E P:envMxdizc
$C1/091C 9D 02 0D    STA $0D02,x[$7E:0D1D]   A:0029 X:001B Y:014E P:envMxdizc
$C1/091F 9D 04 0D    STA $0D04,x[$7E:0D1F]   A:0029 X:001B Y:014E P:envMxdizc
$C1/0922 9D 06 0D    STA $0D06,x[$7E:0D21]   A:0029 X:001B Y:014E P:envMxdizc
$C1/0925 9D 08 0D    STA $0D08,x[$7E:0D23]   A:0029 X:001B Y:014E P:envMxdizc
'29' is what makes a white tile. You have to write another '29' to $0D0A,x to light up the 6th letter.

Do you know what value makes a red tile?

Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1765
    • View Profile
Re: 8th Playable Character Possible?! (Updating!)
« Reply #331 on: March 23, 2009, 07:42:36 pm »
Where? In the menu?
If so, normally, #$04 after the letter in the BG tilemap.


Code: ( (At least some) Numbers in menu) [Select]
C2/F21A 69 D4       ADC #$D4
$C2/F21C 99 00 00    STA $0000,y
$C2/F21F A5 7E       LDA $7E    [$00:007E]
$C2/F221 99 01 00    STA $0001,y
« Last Edit: March 23, 2009, 07:44:41 pm by Vehek »

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1802
  • Nu-chan
    • View Profile
    • Hi trig!
Re: 8th Playable Character Possible?! (Updating!)
« Reply #332 on: March 24, 2009, 01:21:31 am »
Thanks, that was what I was looking for.

I've been reanalyzing the red HP issue from ages ago. Justin posted this solution:

02F0A7 - Changing this to 01 makes all numbers White
- ^^

The only problem with it is it turns all HP white - even injured PCs.

Code: [Select]
Writing HP Code Disassembly:
$C2/A1F0 C2 30 REP #$30
$C2/A1F2 9C 5D 0D STZ $0D5D
$C2/A1F5 AD 90 9A LDA $9A90 //Load Portrait number
$C2/A1F8 29 07 00 AND #$0007
$C2/A1FB 8D 4D 0D STA $0D4D  [$7E:0D4D]
$C2/A1FE 0A ASL A
$C2/A1FF AA TAX
$C2/A200 BD 38 0D LDA $0D38,x[$7E:40D2] //Load value at $7E0D38+Portrait number*2
$C2/A203 CD 93 9A CMP $9A93  [$7E:9A93] //Compare to PC's current HP
$C2/A206 90 06 BCC $06    [$A20E] //If that value is less than that, skip the next two instructions.
$C2/A208 A9 04 00 LDA #$0004 //Create a red number.
$C2/A20B 8D 5D 0D STA $0D5D  [$7E:0D5D]
$C2/A20E A9 20 00 LDA #$0020
$C2/A211 0C 4D 0D TSB $0D4D  [$7E:0D4D]
$C2/A214 28 PLP
$C2/A215 60 RTS

I've commented a few key points in the code.

The value loaded at $C2/A200 for the 8th character is $DC00, or 56320. Since its HP will never be that high, it's always red. From what I've seen so far, that can easily be changed.

Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1765
    • View Profile
Re: 8th Playable Character Possible?! (Updating!)
« Reply #333 on: March 24, 2009, 02:10:55 am »
Code: (Determines Red HP point) [Select]
$C2/8142 BD 3F 26    LDA $263F,x[$7E:272F]
$C2/8145 8F 04 42 00 STA $004204[$00:4204]
$C2/8149 E2 20       SEP #$20
$C2/814B A9 0A       LDA #$0A
$C2/814D 8F 06 42 00 STA $004206[$00:4206]
$C2/8151 C2 20       REP #$20
$C2/8153 EA          NOP
$C2/8154 8A          TXA
$C2/8155 18          CLC
$C2/8156 69 50 00    ADC #$0050
$C2/8159 AA          TAX
$C2/815A C8          INY
$C2/815B C8          INY
$C2/815C AF 14 42 00 LDA $004214[$00:4214]
$C2/8160 99 36 0D    STA $0D36,y[$7E:0D3E]
$C2/8163 C0 0E 00    CPY #$000E
$C2/8166 90 DA       BCC $DA    [$8142]
That CPY #$000E stops the game from calculating the 8th character's critical HP point.
However, that isn't enough.

Code: [Select]
Disassembly:
$C2/EDD3 08          PHP
$C2/EDD4 E2 20       SEP #$20
$C2/EDD6 AD 5B 00    LDA $005B  [$7E:005B]
$C2/EDD9 30 05       BMI $05    [$EDE0]
$C2/EDDB AD 8C 0D    LDA $0D8C  [$7E:0D8C]
$C2/EDDE 29 07       AND #$07
$C2/EDE0 0A          ASL A
$C2/EDE1 0A          ASL A
$C2/EDE2 85 00       STA $00    [$00:0000]
$C2/EDE4 0A          ASL A
$C2/EDE5 0A          ASL A
$C2/EDE6 65 00       ADC $00    [$00:0000]
$C2/EDE8 8D 47 0D    STA $0D47  [$7E:0D47]
$C2/EDEB AD 5C 00    LDA $005C  [$7E:005C]
$C2/EDEE 8D 48 0D    STA $0D48  [$7E:0D48]

That STA $0D47 is placing in that #$DC, making the critical HP point way too high!
« Last Edit: March 24, 2009, 02:12:54 am by Vehek »

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1802
  • Nu-chan
    • View Profile
    • Hi trig!
Re: 8th Playable Character Possible?! (Updating!)
« Reply #334 on: March 24, 2009, 03:11:38 am »
Starting with this change, I'm treating the old name range as unused space.

02F0A7 - 00 - Original value used by game; altered in old fix.
028164 - 10 - Write up to 8thy/Schala in the comparing section.
02EDE9 - 23 2C - Unknown purpose, but needed to be moved.
02EDEF - 24 2C
02EE14 - 23 2C
02EE8A - 23 2C
02983D - 23 2C

justin3009

  • Fan Project Leader
  • God of War (+3000)
  • *
  • Posts: 3297
    • View Profile
Re: 8th Playable Character Possible?! (Updating!)
« Reply #335 on: March 24, 2009, 08:57:15 am »
Works pretty well up until the item menu.  Doesn't show it red nor does she breath heavily.  The rest works fine though.

Edit: Fixed it. 2C13B should be 23 2C
« Last Edit: March 24, 2009, 09:00:34 am by justin3009 »

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1802
  • Nu-chan
    • View Profile
    • Hi trig!
Re: 8th Playable Character Possible?! (Updating!)
« Reply #336 on: March 24, 2009, 01:12:45 pm »
I found three more locations that need to be adjusted.

02A25E - 23 2C
400004 - 23 2C
400009 - 23 2C

I've also explored the possibility of adding a seventh reserve PC slot (That might never be used, but still). The exchange menu works fine except for an issue with display if 8thy/Schala is in the first or second reserve slot. I had to relocate the first battle flags byte, which I have not yet thoroughly tested.



If anyone wants to fiddle, here are my changes so far:

003A96 - 25 2C
00045B - 25 2C
00049D - 25 2C
0004DF - 25 2C
0FFB87 - 25 2C
11F280 - 25 2C
0FFBAF - 25 2C
3DB2DF - 25 2C
01801D - 25 2C
018025 - 25 2C
01802A - 25 2C
012898 - 25 2C
0FE6DA - 25 2C
01AF3A - 25 2C
0180EC - 25 2C
0180F5 - 25 2C
018556 - 25 2C
018641 - 25 2C
0181ED - 25 2C
018589 - 25 2C
0183AF - 25 2C
0CF124 - 25 2C
01B7CF - 25 2C
01AF90 - 25 2C
0183D3 - 25 2C
02818B - 0A
3FF965 - 09
3FF854 - 09
02CD8F - 0A
000C5F - 25 2C - I think. Appears to be an initialization value; listed as part of an unknown routine.


Edit: Returning to more serious issues, I got the party leader fixed.

001A08 - 98
000C39 - 98

There might be bugs I didn't spot, so if anyone wants to explore on a clean ROM, set a read and write breakpoint at 7E0198.

Note that swapping party members is still broken; I'm going to take a look at that now.

Edit 2: The extra slot for reserve party members seems to have completely broken battles. I've reverted my ROM for now.
« Last Edit: March 24, 2009, 07:14:41 pm by Mauron »

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1802
  • Nu-chan
    • View Profile
    • Hi trig!
Re: 8th Playable Character Possible?! (Updating!)
« Reply #337 on: March 30, 2009, 01:43:08 am »
I was poking around in the color code for HP, and found this little tidbit.

$C2/A20E   A9 20 00   LDA #$0020

Adjusting that changes what image loads for the attack icon.

justin3009

  • Fan Project Leader
  • God of War (+3000)
  • *
  • Posts: 3297
    • View Profile
Re: 8th Playable Character Possible?! (Updating!)
« Reply #338 on: March 30, 2009, 08:55:34 am »
Neato.  That could eliminate the whole swap icon thing.

justin3009

  • Fan Project Leader
  • God of War (+3000)
  • *
  • Posts: 3297
    • View Profile
Re: 8th Playable Character Possible?! (Updating!)
« Reply #339 on: March 30, 2009, 11:02:11 am »
Possible palette bug fix sorta?

02F4F9 - Change this to 16 (Stated Earlier)
242B24 - Change this to 08 01.  It loads up the palette correctly in the character swap and when you select a PC in the menu then leave the PC.  I'm not sure what down side this causes.

Found the palette issue in the menu for 8thy

2F556 - Changing this to any values like, 20, 22, 24, 26, 28, 2A, 2C, 2E

20 = 8thy (Screwy)
22 = Crono
24 = Marle
etc etc..

Changing it to any other PC's palette, it works perfectly.  There's just something for 8thy's that's not loading right.

Edit: Setting a breakpoint to it reads this

Quote from: SNES9X
$C2/F3DC BF 48 F5 C2 LDA $C2F548,x[$C2:F556] A:190E X:000E Y:0070 P:envMXdIzc
$C2/F403 AF 56 F5 C2 LDA $C2F556[$C2:F556]   A:1A40 X:0090 Y:0090 P:envmXdIzC

The normal PC's read
Quote from: SNES9X
$C2/F3DC BF 48 F5 C2 LDA $C2F548,x[$C2:F548] A:FF00 X:0000 Y:0092 P:envMXdIZc
only, but 8thy's reads another value.  Strangely, altering it doesn't do any difference at all in the menus.
« Last Edit: March 30, 2009, 11:27:20 am by justin3009 »

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1802
  • Nu-chan
    • View Profile
    • Hi trig!
Re: 8th Playable Character Possible?! (Updating!)
« Reply #340 on: March 30, 2009, 12:20:30 pm »
It looks to me like C2F548-C2F557 contains two byte groups consisting of the starting sprite location and the palette. I haven't found where the value it stores is loaded though.

justin3009

  • Fan Project Leader
  • God of War (+3000)
  • *
  • Posts: 3297
    • View Profile
Re: 8th Playable Character Possible?! (Updating!)
« Reply #341 on: March 30, 2009, 12:48:48 pm »
It's probably not any help but Crono's palette is being stored to 7E95A2...I think 8thy's would be 7E967A, but SNES9X refuses to load the things Zsnes has so I'm not entirely sure.

Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1765
    • View Profile
Re: 8th Playable Character Possible?! (Updating!)
« Reply #342 on: March 30, 2009, 12:51:08 pm »
Did you see what I was messing with last year?
This
« Last Edit: March 30, 2009, 01:16:51 pm by Vehek »

justin3009

  • Fan Project Leader
  • God of War (+3000)
  • *
  • Posts: 3297
    • View Profile
Re: 8th Playable Character Possible?! (Updating!)
« Reply #343 on: March 30, 2009, 12:58:54 pm »
Oh woops, I completely over-looked that tidbit.  Thanks for the reminder.

Edit: Random note, 8thy's palette in the shop menu is loaded from 242B0E (The shit?  That's a huge jump)

Edit 2: 3FF634 3FF63F - Both should be 08 and 8thy's equipment will show up perfect in the shop menu.
« Last Edit: March 30, 2009, 01:17:26 pm by justin3009 »

Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1765
    • View Profile
Re: 8th Playable Character Possible?! (Updating!)
« Reply #344 on: March 30, 2009, 01:26:37 pm »
Edit 2: 3FF634 3FF63F - Both should be 08 and 8thy's equipment will show up perfect in the shop menu.
That doesn't seem safe to me. Wouldn't that stop any characters from being grayed out? (The PC numbers have no bits in common with 0x08.)
« Last Edit: March 30, 2009, 01:30:41 pm by Vehek »