Users browsing this thread: 1 Guest(s)
add some custom F1 target

#1
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
Hi!  Hello

So i wanted to add new F1 targets, basically duplicate this target for many other statuses:

Code:
(3F)    // targets all allies with reflect status

C2/1FC7: 20 4E 20     JSR $204E
C2/1FCA: 80 D5        BRA $1FA1


Sets all monsters and characters with Reflect status as targets

C2/204E: 08           PHP
C2/204F: C2 20        REP #$20       (Set 16-bit Accumulator)
C2/2051: 64 B8        STZ $B8        (start off with no targets)
C2/2053: A2 12        LDX #$12
C2/2055: BD F7 3E     LDA $3EF7,X
C2/2058: 10 05        BPL $205F      (Branch if not Reflect status)
C2/205A: BD 18 30     LDA $3018,X
C2/205D: 04 B8        TSB $B8        (mark entity as target)
C2/205F: CA           DEX 
C2/2060: CA           DEX 
C2/2061: 10 F2        BPL $2055      (loop for all entities)
C2/2063: 28           PLP 
C2/2064: 60           RTS

according to what i'm reading here ldx loads 12(constant) and it's used to scroll all allies and enemies slots to see if they have reflect... 
in RAM map there's no info about $3EF7 but probably it tells which statuses the X target has at the moment.
The problem is that i really don't get where's the mention to the fact that the status checked is right reflect and not any other status... do you know the answer?


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#2
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
  Find
Quote  

#3
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
In battle, the fighters status, allies and monsters, are stored at $3EE4 and $3EF8 structures. Each two bytes, in both structures, corresponds to a fighter.

For the $3EE4 structure, the first byte is the status 1 and the second byte is the status 2. For the $3EF8 structure, the first byte is the status 3 and the second byte is the status 4.

In summary, they follow the same bit structure from $11AA to $11AD. However, they are stored as two byte status by fighter:
Code:
$11AA -> $3EE4,X
$11AB -> $3EE5,X
$11AC -> $3EF8,X
$11AD -> $3EF9,X

You can check the wiki for the $11AA - $11AD bits for all status here.

As a note, the code uses $3EF7. However, the register works in 16-bit mode and it will load two bytes instead of one. In this case, the highest byte will be from $3EF8 instead of $3EF7.
  Find
Quote  

#4
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
in that case it's pointing to status 3 and bit 7(the highest bit i guess) is reflect status... too bad, it's not good to be copied in an easy way Sad
gonna edit the load and check part, i guess...  Shrug

EDIT: man... i can do the same thing with this stuff:
bcc -> flag 0 clear
bne -> flag 1 clear
bvc -> flag 6 clear

too bad there's no branch for flags 2,3,4,5 despite i know it wouldn't make sense since i can find an use for that only due to this absurd code made from FF6 developers! Laugh


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#5
Posts: 127
Threads: 8
Thanks Received: 21
Thanks Given: 12
Joined: Jan 2012
Reputation: 13
Status
None
(03-01-2016, 06:53 PM)Tenkarider Wrote: EDIT:  man... i can do the same thing with this stuff:
bcc -> flag 0 clear
bne -> flag 1 clear
bvc -> flag 6 clear

too bad there's no branch for flags 2,3,4,5 despite i know it wouldn't make sense since i can find an use for that only due to this absurd code made from FF6 developers! Laugh

I think you're confused here. When using load operations (like LDA or LDX) bits 7 and 1 of the program register will be changed.

bit 7 is set if bit 7 is set for the loaded value. This is the Negative indicator and is for interpreting the value as signed (positive or negative)

bit 1 is set if the loaded value is 0. This is the Zero indicator and is not set by bit 1 of the loaded value.

Look for BIT or AND to test the bits of the loaded value.
  Find
Quote  

#6
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
Actually i've already solved this problem 2 days ago and made 22 new targets based on status, yeah i used AND with CMP to check all the status i needed...
Unfortunately this type of target won't work on Disappear status because well... i can't target it  Tongue
Too bad, if that worked i'd be able to easily implement "chase the coward" feature and other nice stuff...

Meanwhile i'm gonna searching for some other interesting RAM value stored in a table(the values that requires an X value to access them)
my first choice should fall on character's level > 1 as target check... 
and since there's space for other 4-5 targets i'll search further for other values.
Any brainstorming suggestion is accepted, just in the case  Objection!


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite