Final Fantasy Hacktics

Modding => PSX FFT Hacking => Topic started by: Choto on April 07, 2013, 07:38:57 pm

Title: ASM Starter kit
Post by: Choto on April 07, 2013, 07:38:57 pm

ASM Notes most useful files:
This file tells where in RAM data and tables are located when BATTLE.BIN is loaded into RAM

This file has all of the routines that I've documented, but haven't been uploaded to the Wiki

This is all the research I've done into how Effect.bin files work. Most of the data therein is related to E0001.bin, or cure


The rest is a mix of miscellaneous files I've acquired over time, from various different people. I will try to keep a collective list of all routines that are currently documented in the respective file routine locations on the Wiki. Meaning, if you see routines without notes in these files, it may already be documented and you should check the wiki before doing needless work.
**Disclaimer: I may forget to update this stuff so additional information may be collected over time.

HxD - This is a hex editor which you can open .bin files with to view and edit the hex within.

MassHexASM - An essential tool for writing code into hex values. More information can be found here: http://ffhacktics.com/smf/index.php?topic=7130.0

Psxrel - This is a debugger, essential for testing things in game. Pokeytax gives a short tutorial on using it here: http://ffhacktics.com/smf/index.php?topic=7937.0

If you are just starting out, it is highly suggested that you visit the tutorials section and read all of the ASM tutorials: http://ffhacktics.com/smf/index.php?topic=9204.0

Things may seem overwhelming at first, but with time and effort anybody can learn to ASM hack and truly make FFT do what they want. Re-reading things every once in awhile definitely helps as well. Sometimes it takes a couple swings of a hammer to break through a wall.

@ the other ASM guys:
Let me know if there's any other important stuff you guys think would be useful to beginners.
Title: Re: ASM Starter kit
Post by: flameman050 on April 08, 2013, 04:46:03 pm
Thanks! I'm half-dead after pulling an all nighter and all of these notes are still easy to follow! I have a feeling they're going to be a go to reference for me for a while.
Title: Re: ASM Starter kit
Post by: Choto on March 01, 2014, 06:01:24 pm
Posting some notes for Pride and anybody else who can get use out of them.
Title: Re: ASM Starter kit
Post by: Vanya on March 01, 2014, 06:43:54 pm
I support this. It should get pinned.
Title: Re: ASM Starter kit
Post by: formerdeathcorps on March 02, 2014, 05:15:35 pm
Thank you for posting this.  Is Pride still AWOL?
Title: Re: ASM Starter kit
Post by: Choto on March 02, 2014, 05:55:35 pm
no problemo! I'm not sure what his situation is, he was looking for notes the other day.
Title: Re: ASM Starter kit
Post by: Angel on March 04, 2014, 07:25:47 am
Pride is getting a replacement laptop soon, so he'll be a bit more alive in the near future.
Title: Re: ASM Starter kit
Post by: Choto on May 07, 2014, 07:23:37 pm
Posting a more recent version of both Data Locations and Battle.Bin routines 2. Most of the routines in that file aren't posted on the wiki, only their locations are posted with a broken red link. /lazy
Title: Re: ASM Starter kit
Post by: Dokurider on May 12, 2014, 04:12:47 pm
I think what you guys can include are actual examples of instructions in action. Branching was a huge stumbling block because I couldn't see how it actually functioned and I thought for the longest time they just worked like conditional jumps (just type the address and go). And not having examples to deduce functionality from is what triggered me to make my help topic. So for instance, you can do:

r17 = 0x0080 + 0x0040 + 0x008 = 0x00c8

andi r2, r17, 0x0040
beq r2, r0, 0x000c
nop (Must be blank because the system executes the next command before actually jumping)
sb r1, 0x0000(r3)
sb r0, 0x0000(r3) (Branch jumps to here)


Stuff like that I'd imagine would help out some aspiring ASMers.
Title: Re: ASM Starter kit
Post by: Xifanie on May 12, 2014, 05:54:48 pm
I don't see why it couldn't be:

andi r2, r17, 0x0040
beq r2, r0, 0x0008
sb r0, 0x0000(r3)
sb r1, 0x0000(r3)
whatever (Branch jumps to here)

Also, storing r1 is not something exactly common. It's only ever used for memory addresses. I don't think other uses could be problematic, but seeing what ASM can do on console, I try to be safer than sorry. I really doubt storing 2 values consecutively to the same address causes any issue.

Especially since, what your code does is:

Branch TRUE:
sb r0, 0x0000(r3)

Branch FALSE:
sb r1, 0x0000(r3)
sb r0, 0x0000(r3)

In the end, your branch is useless since in both instances it writes 0x00 to the location.
Title: Re: ASM Starter kit
Post by: Dokurider on May 12, 2014, 06:06:59 pm
Oops, you're right. I guess I should've cribbed it from existing code rather than just making it up as I went along. Still, my ultimate point stands.
Title: Re: ASM Starter kit
Post by: Choto on May 12, 2014, 07:02:08 pm
that's a good idea Doku, maybe i'll throw a little code snippets tutorial together this summer. Getting used to the commands is one of the most important hurdles.
Title: Re: ASM Starter kit
Post by: Glain on May 13, 2014, 12:03:01 pm
That sounds sort of like the things we did in the ASM tutorials... maybe we should link those from here?
Title: Re: ASM Starter kit
Post by: Choto on May 13, 2014, 07:36:12 pm
Yep, there's already a link to the tutorial index Glain. I just had flashbacks checking the tutorials out for the first time in years lol.. perspective is crazy.
Title: Re: ASM Starter kit
Post by: nitwit on July 20, 2014, 10:38:06 pm
Choto, should I download all the attachments on this page?  Are some of them newer than the others?  Why not move them all to the first post?
Title: Re: ASM Starter kit
Post by: Choto on July 21, 2014, 06:10:03 pm
Yeah I should move them to the first post. The one down farther is more up to date.