Users browsing this thread: 1 Guest(s)
Patch: Restored Ability Names (Update)

#11
Posts: 3,555
Threads: 261
Thanks Received: 634
Thanks Given: 251
Joined: Oct 2011
Reputation: 58
Status
Faith
The function $510D take a spell ID in A as parameter. This is what the menu RAM list for $9D89 and after. There could be other problems but this might be one. You should use a debugger and check what byte it loads (LDA $7E9D89,X):

Code:
$9D89 Length of Item List (used for other lists too)
$9D8A-$9E88 Item List (positions in inventory)
  Find
Quote  

#12
Posts: 4
Threads: 1
Thanks Received: 1
Thanks Given: 3
Joined: Dec 2017
Reputation: 0
Status
Slow
Hello Silentenigma, i found a bug in your hack.
The learning rate of spells in the extra item menu is shifted.
Don't know if this was already in Angelo's patch.

Greetz


Attached Files
.bmp  RestoredAbilityNames_full_00000.bmp (168.03 KB, 23 downloads)
  Find
Quote  
[-] The following 1 user says Thank You to Antamaru for this post:
  • silentenigma (02-25-2019)

#13
Posts: 630
Threads: 9
Thanks Received: 29
Thanks Given: 78
Joined: Jan 2016
Reputation: 6
Status
None
(11-09-2018, 01:10 PM)Antamaru Wrote: Hello Silentenigma, i found a bug in your hack.
The learning rate of spells in the extra item menu is shifted.
Don't know if this was already in Angelo's patch.

Greetz

That is possible to fix yourself. If you remove the colon and one of the two empty spaces after it, it'll shrink the string enough to fit in the space. Here's how it looks on my game where I did that. 

[Image: vNVVmB3.png]

Here's the code.

Code:
C3/5AF9: A2929E  LDX #$9E92     ; 7E/9E92
C3/5AFC: 8E8121  STX $2181      ; Set WRAM LBs
C3/5AFF: A9C1    LDA #$C1       ; Char: ":"
C3/5B01: 8D8021  STA $2180      ; Add to string
C3/5B04: A9FF    LDA #$FF       ; Space char
C3/5B06: 8D8021  STA $2180      ; Add to string
C3/5B09: 8D8021  STA $2180      ; Add to string
C3/5B0C: A9D7    LDA #$D7       ; Char: "×"
C3/5B0E: 8D8021  STA $2180      ; Add to string
C3/5B11: A5E0    LDA $E0        ; Learning rate
C3/5B13: 20E004  JSR $04E0      ; Turn into text
C3/5B16: A5F8    LDA $F8        ; Tens digit
C3/5B18: 8D8021  STA $2180      ; Add to string
C3/5B1B: A5F9    LDA $F9        ; Ones digit
C3/5B1D: 8D8021  STA $2180      ; Add to string
C3/5B20: 9C8021  STZ $2180      ; End string
C3/5B23: 4CD97F  JMP $7FD9      ; Draw string

The colon add at 5AFF along with the "add to string" command afterward, and one of the two "add to string" commands for the Space immediately after, are what you want to remove. Remove just one of the "add to string" commands for the space to leave one space between the Spell name and the "xLearn Rate" data. You don't want to just NOP out the commands, retype in the Hex and that'll give you room to add two spaces at the end of the string, invisible.

With those lines removed, it should look like this.

Code:
C3/5AF9: A2929E  LDX #$9E92     ; 7E/9E92
C3/5AFC: 8E8121  STX $2181      ; Set WRAM LBs
C3/5AFF: A9FF    LDA #$FF       ; Space char
C3/5B01: 8D8021  STA $2180      ; Add to string
C3/5B04: A9D7    LDA #$D7       ; Char: "×"
C3/5B06: 8D8021  STA $2180      ; Add to string
C3/5B09: A5E0    LDA $E0        ; Learning rate
C3/5B0B: 20E004  JSR $04E0      ; Turn into text
C3/5B0E: A5F8    LDA $F8        ; Tens digit
C3/5B10: 8D8021  STA $2180      ; Add to string
C3/5B13: A5F9    LDA $F9        ; Ones digit
C3/5B15: 8D8021  STA $2180      ; Add to string
C3/5B18: A9FF    LDA #$FF       ; Space char
C3/5B1A: 8D8021  STA $2180      ; Add to string
C3/5B1D: 8D8021  STA $2180      ; Add to string
C3/5B20: 9C8021  STZ $2180      ; End string
C3/5B23: 4CD97F  JMP $7FD9      ; Draw string

The spaces added at the end, I remember, are because the game covers up some text with the magic text in the Esper menu. I don't recall the details, though. You may or may not need them depending on what you're doing, check your Esper menus and see.
  Find
Quote  
[-] The following 3 users say Thank You to DrakeyC for this post:
  • Antamaru (11-14-2018), silentenigma (02-25-2019), Warrax (02-26-2019)

#14
Posts: 18
Threads: 4
Thanks Received: 8
Thanks Given: 3
Joined: Feb 2016
Reputation: 0
Status
None
Antamaru, nice catch! Thank you. Yes, this would have been in Angelo's patch as well. Mea culpa!
DrakeyC, thank you very much for your solution! It looks nice. I will release an update incorporating your fix as soon as possible.

Edit:

This bug came up and was fixed during Angelo's original development, and I was tragically too lazy to read the whole thread back then.
The code at C3/5AF9 - C3/5B25, which generates the growth rate string, is shared between the Item submenu and the Skills>Esper submenu. To fix one trivially is to break the other.

It appears that Angelo dealt with this problem by realigning the spell list in the Esper menu. I, unaware of his reasons, thought the change looked unnecessary; so in order to improve the menu's appearance, I proceeded to revert his solution without realizing it.

Below is my new solution to fix the bug in the Item submenu, while still getting the most out of the Esper submenu. The " :" will always be added to the string; however, depending on which submenu is active, it will either be placed at the beginning (Esper menu) or at the end (Item submenu, invisible).
 
Code:
  C3/5AFF: A9 01         LDA #$01       ; Submenu I.D. for "Skills"
  C3/5B01: 20 E2 F0      JSR $F0E2      ; Jump to new subroutine $F0E2
  C3/5B04: 8D 80 21      STA $2180      ; Add to string
  C3/5B07: A9 D7         LDA #$D7       ; Char: "×"
  C3/5B09: 8D 80 21      STA $2180      ; Add to string
  C3/5B0C: A5 E0         LDA $E0        ; Learning rate
  C3/5B0E: 20 E0 04      JSR $04E0      ; Turn into text
  C3/5B11: A5 F8         LDA $F8        ; Tens digit
  C3/5B13: 8D 80 21      STA $2180      ; Add to string
  C3/5B16: A5 F9         LDA $F9        ; Ones digit
  C3/5B18: 8D 80 21      STA $2180      ; Add to string
  C3/5B1B: A9 00         LDA #$00       ; Submenu I.D. for "Items"
  C3/5B1D: 20 E2 F0      JSR $F0E2      ; Jump to new subroutine $F0E2
  C3/5B20: 9C 80 21      STZ $2180      ; End string
  C3/5B23: 4C D9 7F      JMP $7FD9      ; Draw string

New subroutine - Conditionally appends ": " to growth rate string, then loads char value for Space:
Code:
  C3/F0E2:   CD 2C 02    CMP $0220    ; Does current submenu I.D. equal accumulator value?
  C3/F0E5:   D0 0A       BNE $F0F1    ; If not, skip appending string
  C3/F0E7:   A9 C1       LDA #$C1     ; Char: ":"
  C3/F0E9:   8D 80 21    STA $2180    ; Add to string
  C3/F0EC:   A9 FF       LDA #$FF     ; Space char
  C3/F0EE:   8D 80 21    STA $2180    ; Add to string
  C3/F0F1:   A9 FF       LDA #$FF     ; Space char
  C3/F0F3:   60          RTS          ; Return

The updated patch uses 18 additional bytes of free space compared version 1.1.

The new version 1.2 can be found here.


Cheers!
Quote  
[-] The following 1 user says Thank You to silentenigma for this post:
  • Antamaru (03-06-2019)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite