Users browsing this thread: 1 Guest(s)
Antifreeze Hack

#1
Posts: 3,964
Threads: 279
Thanks Received: 233
Thanks Given: 55
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Antifreeze Hack
by madsiur
version 1.0a
released on 02/12/2022
apply to FF3us 1.0 (no header)
wiki entry
download
readme

Files

Code:
antifreeze-C2-nh.ips: Patch for monsters and characters that use free space in bank $C2
antifreeze-EX-nh.ips: Patch for monsters and characters that use free space in bank $EE
antifreeze-character-C2-nh.ips: Patch for characters only that use free space in bank $C2
antifreeze-character-EX-nh.ips: Patch for characters only that use free space in bank $EE
antifreeze-monster-C2-nh.ips: Patch for monsters only that use free space in bank $C2
antifreeze-monster-EX-nh.ips: Patch for monsters only that use free space in bank $EE
/asm: Folder containing the bass assembly file of each hack

Description

This hack repurpose the unused "repel Magitek" item flag in FF3usME to make it repel the Freeze status instead ($D85006 bit 3 in the item data). It also repurpose the "block Magitek" flag in the monster data for the same purpose ($CF0014 bit 3). Although you can't set Freeze on a monster in the original game, that option could be useful for a spell or a rage that set Freeze.

The bank $C2 hack use free space at $C26480 and the EX hack use some at $EEAF01. At most antifreeze-XX-nh will use 44 ($2C) bytes of free space and the character or monster only hacks use about half that amount. Those free space offsets can be changed in a ASM file by changing the offset of the "seek($EEAF01)" macro call.

To assemble the hack use bass v14 by typing a command such as "bass -o rom.smc antifreeze-C2.asm".
  Find
Quote  
[-] The following 4 users say Thank You to madsiur for this post:
  • Gi Nattak (01-17-2022), Lightning (01-21-2022), SSJ Rick (01-19-2022), Warrax (01-18-2022)

#2
Posts: 311
Threads: 20
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2017
Reputation: 2
Status
None
Great idea! I always felt the Ice equipment (like Ice Shield) should block Freeze. Is there any way to also have monsters be immune to the freeze attack with the "block" Magitek box checked? I never found that box to do anything either, unless I am wrong. The only thing stopping me from granting characters like Gau a Cold Dust ability/rage is the fact that it ruins boss battles.
  Find
Quote  

#3
Posts: 3,964
Threads: 279
Thanks Received: 233
Thanks Given: 55
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(01-21-2022, 04:52 PM)Lightning Wrote: Is there any way to also have monsters be immune to the freeze attack with the "block" Magitek box checked? I never found that box to do anything either, unless I am wrong.

I think it is possible, monsters seems to have the Blocked Status 4 byte as well, the one where the Freeze element is. I can look into it when I get the time.
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • Lightning (01-22-2022)

#4
Posts: 3,964
Threads: 279
Thanks Received: 233
Thanks Given: 55
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
I updated the hack to version 1.0a. The new addition is that I added patches for monster blocking the Freeze status. Although you can't set Freeze on a monster in the original game, that option could be useful for a spell or a rage that set Freeze.
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • Lightning (02-14-2022)

#5
Posts: 311
Threads: 20
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2017
Reputation: 2
Status
None
Great patch, thanks!
  Find
Quote  

#6
Posts: 377
Threads: 34
Thanks Received: 9
Thanks Given: 6
Joined: Dec 2018
Reputation: 18
Status
Moog
DrakeyC encountered an oversight with this patch, wherein the Block Magitek flag continues to block the original statuses as well as the new one. This can cause some complications when Magitek mode inflicts Magitek status. As such, we worked together in Discord to create this amendment, which removes the Magitek protection and additionally makes the Block Clear flag protect against Slow and Stop.

Code:
;; |-------------------------------------------|
;; | Antifreeze and Antislow Hack              |
;; | by: madsiur (mangled by C-Dude)           |
;; | version: 1.1                              |
;; | released on: May 7th, 2023                |
;; | apply to: FF3us 1.0 (no header)           |
;; | use xKas 0.6                              |
;; |-------------------------------------------|

hirom

;;macro seek(variable offset) {
;;  origin (offset & $3FFFFF)
;;  base offset
;;}

;; equipment properties setting hook
org $C2291A
jsr free_space_a
nop
nop

;; monster properties setting hook
org $C22E24
jsr free_space_b

;; new code
org $C26469       ;; you can change this free space offset as long as it's in bank $C2
free_space_a:
eor $D2             ;; equipment immunities
ora #$0018            ;; exclude magitek and clear %%NEW%%
sta $331C,x         ;; make not vulnerable to
lda #$ffff            ;; start by assuming nothing is blocked
sta $3330,x            ;; save it as blocked statuses 3 and 4 for this character
lda $D2             ;; equipment immunities
bit #$0008          ;; check if the "repel magitek" flag is set
beq exit_a          ;; exit if not
lda $3330,x            ;; get currently blocked statuses 3 and 4 for this character
and #$FDFF          ;; remove Freeze bit
sta $3330,x         ;; make not vulnerable to Freeze
lda $d2                ;; get $11D2 again, equipment immunities for status bytes 1 and 2
bit #$0010            ;; bit 4 of this status, which is Clear
beq exit_a            ;; exit if not
lda $3330,x            ;; currently blocked statuses 3 and 4
and #$ffeb            ;; exclude Slow and Stop
sta $3330,x            ;; save the result
exit_a:
rts

free_space_b:
ora #$0008            ;; exclude magitek  %%NEW%%
sta $331C,y         ;; original code
lda $CF0014,x       ;; monster blocked status bytes 1-2
bit #$0008          ;; check if the "block magitek" flag is set
beq exit_b          ;; exit if not
lda #$FDFF          ;; not vulnerable to Freeze
and $3330,y
sta $3330,y         ;; make monster not vulnerable to Freeze
exit_b:
rts
I've also mangled your code to make it use xKas, because, well, I have xKas.
Apologies if this is overstepping, Madsiur; I can always remove it if that's your desire.
  Find
Quote  
[-] The following 1 user says Thank You to C-Dude for this post:
  • DrakeyC (05-08-2023)

#7
Posts: 3,964
Threads: 279
Thanks Received: 233
Thanks Given: 55
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
Thanks C-Dude!  Hello
  Find
Quote  
[-] The following 1 user says Thank You to madsiur for this post:
  • DrakeyC (05-08-2023)

#8
Posts: 732
Threads: 36
Thanks Received: 12
Thanks Given: 41
Joined: Jan 2016
Reputation: 6
Status
None
So, I found an oversight in your new code C-Dude, but was able to fix it (it feels so weird to type that).

Code:
bit #$0008          ;; check if the "repel magitek" flag is set
beq exit_a          ;; exit if not

The way you had this previously set up was, in hex, F0 1A. But it was causing it to exit the entire function, including the Clear/Slow & Stop check, if the Repel Freeze flag wasn't going. I changed it to F0 09 to just skip the code to block Freeze instead of exiting, and Clear/Slow & Stop works properly now on its own.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite