FF6 Hacking
Antifreeze Hack - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Hacks, Resources and Tutorials (https://www.ff6hacking.com/forums/forum-1.html)
+--- Forum: Jidoor Auction House (https://www.ff6hacking.com/forums/forum-4.html)
+---- Forum: Patches, Bugfixes, Tweaks (https://www.ff6hacking.com/forums/forum-15.html)
+---- Thread: Antifreeze Hack (/thread-4166.html)



Antifreeze Hack - madsiur - 01-17-2022

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".


RE: Antifreeze Hack - Lightning - 01-21-2022

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.


RE: Antifreeze Hack - madsiur - 01-21-2022

(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.


RE: Antifreeze Hack - madsiur - 02-12-2022

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.


RE: Antifreeze Hack - Lightning - 02-14-2022

Great patch, thanks!


RE: Antifreeze Hack - C-Dude - 05-07-2023

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.


RE: Antifreeze Hack - madsiur - 05-08-2023

Thanks C-Dude!  Hello


RE: Antifreeze Hack - DrakeyC - 06-24-2023

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.