øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=553.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexfa48.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=8.360e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexfa48.html.zx�(h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ °Vz=OKtext/htmlISO-8859-1gzip8:Öz=ÿÿÿÿÿÿÿÿWed, 11 Mar 2020 00:10:13 GMT0ó°° ®0®P®€§²ð®Œ(h^ÿÿÿÿÿÿÿÿ›5z= Modifying spell mastery limits (FF3us)

Author Topic: Modifying spell mastery limits (FF3us)  (Read 2500 times)

Leviathan Mist

  • Schizophrenic Madman
  • *
  • Posts: 362
  • Gender: Male
  • Game over.
    • View Profile
    • Retro Gaming Central
Modifying spell mastery limits (FF3us)
« on: May 12, 2008, 02:01:19 PM »
Okay, I'm trying to up the AP required to learn a spell per battle, from 100% to 200%. I got this much so far:

Code: [Select]
Learn Spell

C2/604B: F0 1F        BEQ $606C   (If no spell to learn)
C2/604D: EB           XBA
C2/604E: A5 FB        LDA $FB     (Magic points gained from the battle)
C2/6050: 20 81 47     JSR $4781   (Multiply by spell learn rate)
C2/6053: 85 EE        STA $EE     (Store this amount in $EE)
C2/6055: B1 F4        LDA ($F4),Y
C2/6057: C9 FF        CMP #$FF
C2/6059: F0 11        BEQ $606C   (Branch if spell already known)
C2/605B: 18           CLC
C2/605C: 65 EE        ADC $EE     (Add amount learned to % known for spell)
C2/605E: B0 04        BCS $6064
C2/6060: C9 64        CMP #$64
C2/6062: 90 02        BCC $6066
C2/6064: A9 80        LDA #$80
C2/6066: 91 F4        STA ($F4),Y
C2/6068: A5 F1        LDA $F1
C2/606A: 04 F0        TSB $F0
C2/606C: 60           RTS

I found out myself that CMP#$64 is the variable that determines at what amount of AP each spell is mastered at. I simply change that to C8 and it works, but I can't get this number to span 3 numerals (for example, if it's at 150% learned, it'll only say 50%), and I can't get it to say "200%" instead of "100%" when the spell is learned. My guess is what I'm looking for has to do with the menu code and is not in the C2 bank, but unfortunately, I can't find any good leads in terms of ROM maps already available. Anyone wanna take a stab at it for me?

Lenophis

  • Forum Overlord
  • *
  • Posts: 1,688
  • Gender: Male
  • I sad
    • View Profile
    • Slick Productions
Re: Modifying spell mastery limits (FF3us)
« Reply #1 on: May 12, 2008, 02:31:49 PM »
Code: [Select]
C3/4F9E: 20B54F  JSR $4FB5
C3/4FA1: A20300  LDX #$0003    (X position of left half of spells)
C3/4FA4: 20C44F  JSR $4FC4     (draws the spell names)
C3/4FA7: E6E5    INC $E5
C3/4FA9: 20B54F  JSR $4FB5
C3/4FAC: A21000  LDX #$0010    (X position of right half of spells)
C3/4FAF: 20C44F  JSR $4FC4     (draws the spell names)
C3/4FB2: E6E5    INC $E5
C3/4FB4: 60      RTS
 
C3/4FB5: A00700  LDY #$0007    (spell letter length)
C3/4FB8: 84EB    STY $EB
C3/4FBA: A067F5  LDY #$F567    (spell name address)
C3/4FBD: 84EF    STY $EF
C3/4FBF: A9E6    LDA #$E6      (spell name bank)
C3/4FC1: 85F1    STA $F1
C3/4FC3: 60      RTS
 
Draw a column of spells
C3/4FC4: A5E6    LDA $E6
C3/4FC6: 1A      INC A
C3/4FC7: 209F80  JSR $809F
C3/4FCA: C220    REP #$20      (16 bit memory/accum.)
C3/4FCC: 8A      TXA
C3/4FCD: 8F899E7E STA $7E9E89
C3/4FD1: E220    SEP #$20      (8 bit memory/accum.)
C3/4FD3: A59E    LDA $9E
C3/4FD5: F067    BEQ $503E
C3/4FD7: 20EC50  JSR $50EC     (get the current spell to check)
C3/4FDA: 204D51  JSR $514D     (determine if spells are useable?)
C3/4FDD: 20EC50  JSR $50EC     (get the current spell to check)
C3/4FE0: C9FF    CMP #$FF
C3/4FE2: F036    BEQ $501A     (branch if no spell to draw)
C3/4FE4: 20A250  JSR $50A2     (get spells learned amount)
C3/4FE7: C9FF    CMP #$FF
C3/4FE9: D02F    BNE $501A     (branch if spell is already learned?)
C3/4FEB: 20EC50  JSR $50EC     (get the current spell to check)
C3/4FEE: 206784  JSR $8467     (draw the current spell name)
C3/4FF1: A2929E  LDX #$9E92    (position of MP cost)
C3/4FF4: 8E8121  STX $2181
C3/4FF7: A9FF    LDA #$FF
C3/4FF9: 8D8021  STA $2180     (insert a space)
C3/4FFC: 20EC50  JSR $50EC     (get the current spell to check)
C3/4FFF: 200D51  JSR $510D     (get spell's MP cost)
C3/5002: 20E004  JSR $04E0     (turn MP cost into digits)
C3/5005: A5F8    LDA $F8
C3/5007: 8D8021  STA $2180     (draw tens digit of MP cost)
C3/500A: A5F9    LDA $F9
C3/500C: 8D8021  STA $2180     (draw ones digit of MP cost)
C3/500F: A9FF    LDA #$FF
C3/5011: 8D8021  STA $2180     (insert a space)
C3/5014: 9C8021  STZ $2180
C3/5017: 4CD97F  JMP $7FD9     (draw MP cost)

Blank out the current spell (MP cost and spell learn rate too)
C3/501A: 7B      TDC
C3/501B: A5E5    LDA $E5
C3/501D: AA      TAX
C3/501E: A9FF    LDA #$FF
C3/5020: 9F899D7E STA $7E9D89,X
C3/5024: 20B951  JSR $51B9     (set's the text color to gray among other things)
C3/5027: A00B00  LDY #$000B
C3/502A: A28B9E  LDX #$9E8B    (position of where it is to be blanked)
C3/502D: 8E8121  STX $2181
C3/5030: A9FF    LDA #$FF
C3/5032: 8D8021  STA $2180     (insert a space)
C3/5035: 88      DEY
C3/5036: D0FA    BNE $5032     (do 11 times?)
C3/5038: 9C8021  STZ $2180
C3/503B: 4CD97F  JMP $7FD9     (display the blanked name)

C3/503E: 20EC50  JSR $50EC     (get the current spell to check)
C3/5041: C9FF    CMP #$FF
C3/5043: F0D5    BEQ $501A
C3/5045: 20A250  JSR $50A2     (get spell's learned rate)
C3/5048: C900    CMP #$00      (is it zero?)
C3/504A: F0CE    BEQ $501A     (branch if so)
C3/504C: 20EC50  JSR $50EC     (get the current spell to check)
C3/504F: 206784  JSR $8467     (draw the current spell name)
C3/5052: A2929E  LDX #$9E92    (position of spell progress)
C3/5055: 8E8121  STX $2181
C3/5058: 20EC50  JSR $50EC     (get the current spell to check)
C3/505B: 20A250  JSR $50A2     (get spell's learned rate)
C3/505E: C9FF    CMP #$FF      (is it learned?)
C3/5060: F026    BEQ $5088     (branch if so)
C3/5062: 48      PHA
C3/5063: 20B951  JSR $51B9
C3/5066: A92C    LDA #$2C
C3/5068: 8529    STA $29       (set text color to blue)
C3/506A: A9C7    LDA #$C7      (the "..." character in the font)
C3/506C: 8D8021  STA $2180
C3/506F: 68      PLA
C3/5070: 20E004  JSR $04E0     (turn spell progress into digits)
C3/5073: A5F8    LDA $F8
C3/5075: 8D8021  STA $2180     (draw the tens digit)
C3/5078: A5F9    LDA $F9
C3/507A: 8D8021  STA $2180     (draw the ones digit)
C3/507D: A9CD    LDA #$CD      (the "%" character in the font)
C3/507F: 8D8021  STA $2180
C3/5082: 9C8021  STZ $2180
C3/5085: 4CD97F  JMP $7FD9     (draw the contents of $2180)

C3/5088: A924    LDA #$24
C3/508A: 8529    STA $29       (set text color to...dunno)
C3/508C: 20EC50  JSR $50EC     (get the current spell to check)
C3/508F: 204D51  JSR $514D     (determine if spells are useable?)
C3/5092: A9FF    LDA #$FF
C3/5094: 8D8021  STA $2180
C3/5097: 8D8021  STA $2180
C3/509A: 8D8021  STA $2180
C3/509D: 8D8021  STA $2180     (four spaces, blank out spell's learn rate since it's already learned)
C3/50A0: 80E0    BRA $5082

Get spell's learned amount, or, if it's Gogo, branch below to check everybody
else in the party.
C3/50A2: 85E0    STA $E0
C3/50A4: 20DD4E  JSR $4EDD
C3/50A7: B90000  LDA $0000,Y
C3/50AA: C90C    CMP #$0C
C3/50AC: F017    BEQ $50C5     (Branch if it's Gogo)
C3/50AE: 8D0242  STA $4202
C3/50B1: A936    LDA #$36
C3/50B3: 8D0342  STA $4203
C3/50B6: 7B      TDC
C3/50B7: A5E0    LDA $E0
C3/50B9: C220    REP #$20      (16 bit memory/accum.)
C3/50BB: 6D1642  ADC $4216
C3/50BE: AA      TAX
C3/50BF: E220    SEP #$20      (8 bit memory/accum.)
C3/50C1: BD6E1A  LDA $1A6E,X
C3/50C4: 60      RTS
 
C3/50C5: 64E1    STZ $E1
C3/50C7: 7B      TDC
C3/50C8: A5E1    LDA $E1
C3/50CA: C528    CMP $28
C3/50CC: F014    BEQ $50E2
C3/50CE: 0A      ASL A
C3/50CF: AA      TAX
C3/50D0: B46D    LDY $6D,X
C3/50D2: F00E    BEQ $50E2
C3/50D4: B90000  LDA $0000,Y
C3/50D7: C90C    CMP #$0C
C3/50D9: B007    BCS $50E2      (Branch if it's Gogo or higher)
C3/50DB: 20AE50  JSR $50AE
C3/50DE: C9FF    CMP #$FF
C3/50E0: F009    BEQ $50EB
C3/50E2: E6E1    INC $E1
C3/50E4: A5E1    LDA $E1
C3/50E6: C904    CMP #$04
C3/50E8: D0DD    BNE $50C7
C3/50EA: 7B      TDC
C3/50EB: 60      RTS
 
C3/50EC: 7B      TDC
C3/50ED: A5E5    LDA $E5
C3/50EF: AA      TAX
C3/50F0: BF899D7E LDA $7E9D89,X
C3/50F4: 60      RTS
 
C3/50F5: 48      PHA
C3/50F6: AD1242  LDA $4212
C3/50F9: 2940    AND #$40
C3/50FB: F0F9    BEQ $50F6      (branch if not in H-blank)
C3/50FD: 68      PLA
C3/50FE: 8D1B21  STA $211B
C3/5101: 9C1B21  STZ $211B
C3/5104: A90E    LDA #$0E (14 = width of magic struct)
C3/5106: 8D1C21  STA $211C
C3/5109: 8D1C21  STA $211C
C3/510C: 60      RTS
 
C3/510D: 48      PHA            (save current spell)
C3/510E: 20F550  JSR $50F5
C3/5111: AE3421  LDX $2134
C3/5114: BFC56AC4 LDA $C46AC5,X  (magic data, MP cost)
C3/5118: 85E0    STA $E0        (store MP cost)
C3/511A: 68      PLA            (get current spell)
C3/511B: C999    CMP #$99       (is the current spell Step Mine?)
C3/511D: D00F    BNE $512E      (branch if not)
C3/511F: AD1B02  LDA $021B
C3/5122: 0A      ASL A
C3/5123: 85E0    STA $E0
C3/5125: AD1C02  LDA $021C
C3/5128: C91E    CMP #$1E
C3/512A: 9002    BCC $512E
C3/512C: E6E0    INC $E0        (add 1 to MP cost)
C3/512E: ADD711  LDA $11D7
C3/5131: 8940    BIT #$40       (Is "reduce MP consumption to 1" bit set?)
C3/5133: F005    BEQ $513A      (this could branch to the BIT #$20...)
C3/5135: 7B      TDC            (to keep the upper 8 bits of A clean...)
C3/5136: A901    LDA #$01       (MP cost is 1)
C3/5138: 8011    BRA $514B
C3/513A: ADD711  LDA $11D7
C3/513D: 8920    BIT #$20       (Is "halve MP consumption" bit set?)
C3/513F: F007    BEQ $5148
C3/5141: 7B      TDC            (to keep the upper 8 bits of A clean...)
C3/5142: A5E0    LDA $E0        (load current MP cost)
C3/5144: 1A      INC A          (add one so it rounds up)
C3/5145: 4A      LSR A          (cut in half)
C3/5146: 8003    BRA $514B
C3/5148: 7B      TDC            (to keep the upper 8 bits of A clean...)
C3/5149: A5E0    LDA $E0        (load MP cost)
C3/514B: AA      TAX            (transfer MP cost to X)
C3/514C: 60      RTS
 
C3/514D: C92A    CMP #$2A
C3/514F: F02A    BEQ $517B      (branch if spell is Warp)
C3/5151: C912    CMP #$12
C3/5153: F019    BEQ $516E      (branch if spell is X-zone)
C3/5155: 20F550  JSR $50F5
C3/5158: AE3421  LDX $2134
C3/515B: BFC36AC4 LDA $C46AC3,X  (Magic data, where used/damage type)
C3/515F: 2901    AND #$01
C3/5161: F009    BEQ $516C      (this can BRA to $51B9 just as easily)
C3/5163: 20EC50  JSR $50EC      (get the current spell to check)
C3/5166: 200D51  JSR $510D      (get MP cost)
C3/5169: 4C8851  JMP $5188      (BRA would work here)

C3/516C: 804B    BRA $51B9
C3/516E: 85E3    STA $E3
C3/5170: AD0102  LDA $0201      (load availability bits)
C3/5173: 8901    BIT #$01       (check for...?)
C3/5175: F0F5    BEQ $516C      (branch if not able to, and really, it can branch to $51B9 from here on its own easily enough)
C3/5177: A5E3    LDA $E3
C3/5179: 80DA    BRA $5155
C3/517B: 85E3    STA $E3
C3/517D: AD0102  LDA $0201
C3/5180: 8902    BIT #$02      (check for Warp useage)
C3/5182: F0E8    BEQ $516C     (branch if you can't Warp)
C3/5184: A5E3    LDA $E3
C3/5186: 80CD    BRA $5155
C3/5188: 86E2    STX $E2
C3/518A: 20DD4E  JSR $4EDD
C3/518D: B91400  LDA $0014,Y (Statuses)
C3/5190: 2920    AND #$20
C3/5192: F007    BEQ $519B
C3/5194: 20EC50  JSR $50EC     (get the current spell to check)
C3/5197: C923    CMP #$23
C3/5199: D01E    BNE $51B9     (branch if spell is Imp)
C3/519B: C220    REP #$20      (16 bit memory/accum.)
C3/519D: B90D00  LDA $000D,Y
C3/51A0: 85E0    STA $E0
C3/51A2: E220    SEP #$20      (8 bit memory/accum.)
C3/51A4: A6E2    LDX $E2
C3/51A6: E4E0    CPX $E0
C3/51A8: F002    BEQ $51AC
C3/51AA: B00D    BCS $51B9      (branch if spell isn't useable)
C3/51AC: 7B      TDC
C3/51AD: A5E5    LDA $E5
C3/51AF: AA      TAX
C3/51B0: A920    LDA #$20
C3/51B2: 8529    STA $29        (set text color to white)
C3/51B4: 9F099E7E STA $7E9E09,X
C3/51B8: 60      RTS
 
C3/51B9: 7B      TDC
C3/51BA: A5E5    LDA $E5
C3/51BC: AA      TAX
C3/51BD: A928    LDA #$28
C3/51BF: 8529    STA $29        (set text color to gray)
C3/51C1: 9F099E7E STA $7E9E09,X
C3/51C5: 60      RTS
 
C3/51C6: A920    LDA #$20
C3/51C8: 8529    STA $29        (set text color to white)
C3/51CA: C220    REP #$20       (16 bit memory/accum.)
C3/51CC: A9BF81  LDA #$81BF     (position of MP cost)
C3/51CF: 8F899E7E STA $7E9E89
C3/51D3: E220    SEP #$20       (8 bit memory/accum.)
C3/51D5: A28B9E  LDX #$9E8B     (where to look in VRAM)
C3/51D8: 8E8121  STX $2181
C3/51DB: 7B      TDC
C3/51DC: A54B    LDA $4B
C3/51DE: AA      TAX
C3/51DF: BF899D7E LDA $7E9D89,X
C3/51E3: 200D51  JSR $510D      (get MP cost)
C3/51E6: 20E004  JSR $04E0      (turn MP cost into digits)
C3/51E9: A5F8    LDA $F8
C3/51EB: 8D8021  STA $2180
C3/51EE: A5F9    LDA $F9
C3/51F0: 8D8021  STA $2180      (MP cost in the upper right hand corner of the menu)
C3/51F3: 9C8021  STZ $2180
C3/51F6: 4CD97F  JMP $7FD9

What you seek is at C3/5070, as you'll need to insert a couple extra instructions (LDA $F7, STA $2180) after the JSR $04E0, to get 3 digits displayed. This may cause some bleeding in certain situations, so you may need to insert an extra STA $2180 at C3/5094 to clean it up.

If you have any further questions, feel free to ask.

119 bugs fixed and counting.

Leviathan Mist

  • Schizophrenic Madman
  • *
  • Posts: 362
  • Gender: Male
  • Game over.
    • View Profile
    • Retro Gaming Central
Re: Modifying spell mastery limits (FF3us)
« Reply #2 on: May 14, 2008, 07:50:18 AM »
As you know, I am working on a semi-challenge hack which will be utilizing Master ZED's New Game + patch and Assassin's patch to increase stat limits to 255. I am working on making Vigor effective beyond 128 MP, and I believe I have found the function which causes damage output to cap out at 128 (the factor of 2 at C2/2BD0), but since the hexadecimal used isn't straightforward, and I don't know assembly, I can't figure out what to change it to in order to get the desired output. Here is the code:

Code: [Select]
C2/2B9D: AD A2 11     LDA $11A2   (Check if magic attack)
C2/2BA0: 4A           LSR
C2/2BA1: B0 03        BCS $2BA6
C2/2BA3: 4C 69 2B     JMP $2B69   (Magical Damage Calculation)
C2/2BA6: 08           PHP
C2/2BA7: AD AF 11     LDA $11AF   (Level)
C2/2BAA: 48           PHA
C2/2BAB: 85 E8        STA $E8
C2/2BAD: 7B           TDC
C2/2BAE: AD A6 11     LDA $11A6   (Battle Power)
C2/2BB1: C2 20        REP #$20    (Set 16-bit Accumulator)
C2/2BB3: E0 08        CPX #$08    (If monster then Battle Power *= 4)
C2/2BB5: 90 02        BCC $2BB9
C2/2BB7: 0A           ASL
C2/2BB8: 0A           ASL
C2/2BB9: 48           PHA
C2/2BBA: A5 B2        LDA $B2
C2/2BBC: 89 00 40     BIT #$4000
C2/2BBF: D0 0C        BNE $2BCD   (If Gauntlet is not equipped branch)
C2/2BC1: A3 01        LDA $01,S   (Battle Power *= 7/4)
C2/2BC3: 4A           LSR
C2/2BC4: 18           CLC
C2/2BC5: 63 01        ADC $01,S
C2/2BC7: 4A           LSR
C2/2BC8: 18           CLC
C2/2BC9: 63 01        ADC $01,S
C2/2BCB: 83 01        STA $01,S   
C2/2BCD: 68           PLA
C2/2BCE: E2 20        SEP #$20    (Set 8-bit Accumulator)
C2/2BD0: 6D AE 11     ADC $11AE   (Vigor * 2)
C2/2BD3: EB           XBA
C2/2BD4: 69 00        ADC #$00    (Clear High byte of A)
C2/2BD6: EB           XBA
C2/2BD7: 20 B7 47     JSR $47B7   (Multiplication Function 2)
C2/2BDA: A5 E8        LDA $E8
C2/2BDC: 85 EA        STA $EA
C2/2BDE: 68           PLA
C2/2BDF: 85 E8        STA $E8
C2/2BE1: C2 20        REP #$20    (Set 16-bit Accumulator)
C2/2BE3: A5 E9        LDA $E9
C2/2BE5: EB           XBA
C2/2BE6: 20 B7 47     JSR $47B7   (Multiplication Function 2)
C2/2BE9: 8D B0 11     STA $11B0   (Maximum Damage)
C2/2BEC: E0 08        CPX #$08    (If Player then multiple $11B0 by 3/2)
C2/2BEE: B0 2F        BCS $2C1F   (And add Battle Power)
C2/2BF0: AD A6 11     LDA $11A6   (Battle Power)
C2/2BF3: 29 FF        AND #$00FF
C2/2BF6: 0A           ASL
C2/2BF7: 6D B0 11     ADC $11B0   (Maximum Damage)
C2/2BFA: 4A           LSR
C2/2BFB: 18           CLC
C2/2BFC: 6D B0 11     ADC $11B0   (Maximum Damage)
C2/2BFF: 8D B0 11     STA $11B0   (Maximum Damage)
C2/2C02: BD 58 3C     LDA $3C58,X
C2/2C05: 4A           LSR
C2/2C06: 90 03        BCC $2C0B   (Check for offering)
C2/2C08: 4E B0 11     LSR $11B0   (Halves damage)
C2/2C0B: 89 08 00     BIT #$0008
C2/2C0E: F0 0F        BEQ $2C1F   (Check for Genji Glove)
C2/2C10: AD B0 11     LDA $11B0   (Maximum Damage)
C2/2C13: 4A           LSR
C2/2C14: 4A           LSR
C2/2C15: 49 FF FF     EOR #$FFFF
C2/2C18: 38           SEC
C2/2C19: 6D B0 11     ADC $11B0   (Maximum Damage)
C2/2C1B: 8D B0 11     STA $11B0   (Subtract 1/4 from Maximum Damage)
C2/2C1F: 28           PLP
C2/2C20: 60           RTS

Many thanks in advance.

Lenophis

  • Forum Overlord
  • *
  • Posts: 1,688
  • Gender: Male
  • I sad
    • View Profile
    • Slick Productions
Re: Modifying spell mastery limits (FF3us)
« Reply #3 on: May 14, 2008, 12:28:30 PM »
Based on how the physical damage formula is, it wouldn't make much of a difference if strength could reach 512, since it's mostly based on level. The stat getting that high would be for show in either case. Ideally, you'd want to re-work the physical damage portion, but that's a bit of a headache (just ask Kejardon).

To answer the question, I'm not sure what could be changed to do what you want, since this is a fairly solid section of code... :sad:

--Edit--
Yeah, the damage is based on damage. Good one... :sad:
« Last Edit: May 14, 2008, 01:40:00 PM by Lenophis »

119 bugs fixed and counting.

Leviathan Mist

  • Schizophrenic Madman
  • *
  • Posts: 362
  • Gender: Male
  • Game over.
    • View Profile
    • Retro Gaming Central
Re: Modifying spell mastery limits (FF3us)
« Reply #4 on: May 14, 2008, 12:31:25 PM »
Eh well, thanks for the info anyway...I'll leave that portion for now and possibly come back to it on a future date? I'm slowly putting the pieces together for my new hack, but with gaming, work, and sleep in the mix, I'm surprised I've come up with this much time to work on it

Imzogelmo

  • Ogopogo Aficianado
  • *
  • Posts: 241
  • Gender: Male
  • Ask me about my other job.
    • View Profile
    • NEPROMR
Re: Modifying spell mastery limits (FF3us)
« Reply #5 on: July 24, 2008, 02:49:49 AM »
It's a good idea, really. The problem is that you run up against the 16-bit limit of 65536, above which you'll have overflow (speaking of damage) unless it is very carefully capped for each multiply. A solution would be to give it some more room to work in, say a 3rd byte (24-bit) for damage. That would be a tremendous headache to do, since just about every damage-tracking function would need to be changed, but it could be done.  As for display, I'm not entirely sure that it could be done, but don't let that scare ya.

24-bit HP (for monsters) is something that can be done (which is a bit of a headache, but it can be successfully pulled off). You need:
1) data for all monsters
2) a function to initialize the data (remember, you need to set current and max)
3) a function to subtract/add damage/healing properly
4) functions to handle odd things like attacks that care about % of HP to damage, undeads, potions, etc.
5) a scan function mod to show the HP properly
5/31/16 - I have an assembly of the battle portion of C2, relocated to the F0 bank, which has both vanilla and patch code in my dropbox. I'll be updating it with additional patches as I have time. I will *not* be releasing it publicly, but ask me for the link and I'll share.