(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
04-29-24 01:22 AM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - Final Fantasy 1 Hacking Data: Part II New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Gavin

Cheep-cheep
Vandalism is not tolerated


 





Since: 11-17-05
From: IL, USA

Last post: 6356 days
Last view: 6299 days
Posted on 12-13-05 03:28 PM Link | Quote
I'm starting up this thread again.

Battle Shit:

//if bit 1 is set, the character is dead, other status ailments are in this byte too, iirc
$6101	;char1 status byte

$6141 ;char2 status byte
$6181 ;char3 status byte
$61C1 ;char4 status byte

//used during battle to determine the sprite set to use for each character
// #$00 - dead
// #18 - kneeling/status ailment set
$6AD6	;char1 sprite position

$6ADA ;char2 sprite position
$6ADE ;char3 sprite position
$6AE2 ;char4 sprite position


//this draws the 4 windows that encapsule the 4 character's battle stats
$F2FE:A9 19     LDA #$19	;stat battle x position for all 4 stat windows

$F300:A2 15 LDX #$15
$F302:20 C6 F3 JSR $F3C6 ;draw window
$F305:A2 0F LDX #$0F
$F307:20 C6 F3 JSR $F3C6 ;draw window
$F30A:A2 09 LDX #$09
$F30C:20 C6 F3 JSR $F3C6 ;draw window
$F30F:A2 03 LDX #$03
$F311:20 C6 F3 JSR $F3C6 ;draw window


Not Battle Shit:

//window calling routines for the shopkeeper screens. it appears this is called for every window draw and change in option.
$AA3B:20 41 AA  JSR $AA41

$AA3E:4C 63 E0 JMP $E063 ;draw window
$AA41:AA TAX
$AA42:BD 40 AC LDA $AC40,X @ $AC43 = #$06 = X-coordinate
$AA45:85 38 STA $38 = #$06
$AA47:BD 45 AC LDA $AC45,X @ $AC48 = #$12 = Y-coordinate
$AA4A:85 39 STA $39 = #$12
$AA4C:BD 4A AC LDA $AC4A,X @ $AC4D = #$09 = Width
$AA4F:85 3C STA $3C = #$09
$AA51:BD 4F AC LDA $AC4F,X @ $AC52 = #$0A = Height
$AA54:85 3D STA $3D = #$0C
$AA56:A9 0E LDA #$0E
$AA58:85 57 STA $57 = #$0E
$AA5A:60 RTS
Gavin

Cheep-cheep
Vandalism is not tolerated


 





Since: 11-17-05
From: IL, USA

Last post: 6356 days
Last view: 6299 days
Posted on 12-14-05 08:38 PM Link | Quote
A few more battle-related values.

Also as a note: the values I posted about that determine which battle sprite should be displayed for each character, (i.e. $6AD6 for char1) are not entirely correct. They work for all non-dead sprites. Non-dead sprites are chosen in a different manner from a different routine I have not yet located, probably because non-dead sprites are 16x48 (vertical) and dead sprites are horizontal (assuming, use at your own risk).


6AD0 - count-down for how long to display battle windows
0x2Da32 - how long to pause when displaying battle text windows,
put into $6BAC SRAM and stored into $6AD0 for decrementing

610A - current/calculated health for character 1
Gavin

Cheep-cheep
Vandalism is not tolerated


 





Since: 11-17-05
From: IL, USA

Last post: 6356 days
Last view: 6299 days
Posted on 12-31-05 04:38 PM Link | Quote
Back again, bitches. This time with some SRAM/WRAM values. These labels are valid when the Weapon and Armor menus are opened respectively.


upper bit (1xxxxxxx) set means the weapon is currently equipped, as denoted by the "E"/"checked"/"Equipped" graphic next to the weapon/armor piece.

$6118 - Character 1, Weapon 1 slot (upper-left on menu)
$6119 - Character 1, Weapon 2 slot (upper-right on menu)
$611A - Character 1, Weapon 3 slot (bottom-left on menu)
$611B - Character 1, Weapon 4 slot (bottom-right on menu)
$611C - Character 1, Armor 1 slot (upper-left on menu)
$611D - Character 1, Armor 2 slot (upper-right on menu)
$611E - Character 1, Armor 3 slot (bottom-left on menu)
$611F - Character 1, Armor 4 slot (bottom-right on menu)

$6158 - Character 2, Weapon 1 slot (upper-left on menu)
$6159 - Character 2, Weapon 2 slot (upper-right on menu)
$615A - Character 2, Weapon 3 slot (bottom-left on menu)
$615B - Character 2, Weapon 4 slot (bottom-right on menu)
$615C - Character 2, Armor 1 slot (upper-left on menu)
$615D - Character 2, Armor 2 slot (upper-right on menu)
$615E - Character 2, Armor 3 slot (bottom-left on menu)
$615F - Character 2, Armor 4 slot (bottom-right on menu)

$6198 - Character 3, Weapon 1 slot (upper-left on menu)
$6199 - Character 3, Weapon 2 slot (upper-right on menu)
$619A - Character 3, Weapon 3 slot (bottom-left on menu)
$619B - Character 3, Weapon 4 slot (bottom-right on menu)
$619C - Character 3, Armor 1 slot (upper-left on menu)
$619D - Character 3, Armor 2 slot (upper-right on menu)
$619E - Character 3, Armor 3 slot (bottom-left on menu)
$619F - Character 3, Armor 4 slot (bottom-right on menu)

$61D8 - Character 4, Weapon 1 slot (upper-left on menu)
$61D9 - Character 4, Weapon 2 slot (upper-right on menu)
$61DA - Character 4, Weapon 3 slot (bottom-left on menu)
$61DB - Character 4, Weapon 4 slot (bottom-right on menu)
$61DC - Character 4, Armor 1 slot (upper-left on menu)
$61DD - Character 4, Armor 2 slot (upper-right on menu)
$61DE - Character 4, Armor 3 slot (bottom-left on menu)
dormento

Red Goomba


 





Since: 11-18-05

Last post: 6432 days
Last view: 6279 days
Posted on 01-01-06 09:51 AM Link | Quote
With the character data in SRAM in hand, you can do some nifty things, like, for example:


//unequip all items owned by the first character; part of a job change hack i'm doing
LDX #$08 ;loads number of equippable items
prox:
DEX ;next item
TXA ;loads AC with item number
BMI saida ;if no more items to unequip, finish it
LDA $6118,X ;gets position of item[X]
BEQ prox ;if theres nothing in that slot, get next item
BPL prox ;if the item is already unequipped (<#$80), get next item
EOR #$80 ;unequip this item
STA $6118,X ;store it back
JMP prox ;go to next item
saida:
RTS




(edited by dormento on 01-01-06 08:52 AM)
Gavin

Cheep-cheep
Vandalism is not tolerated


 





Since: 11-17-05
From: IL, USA

Last post: 6356 days
Last view: 6299 days
Posted on 06-17-06 12:12 AM Link | Quote
Just a few random pieces of bullshit:

////////////////////////////////////////////////////////////////////////////////
// SHOPKEEPER MENU JUNK //
////////////////////////////////////////////////////////////////////////////////

Just a few notes and crap, nothing too great...


////////////////////////////////////////////////////////////////////////////////
*ARMOR SHOP*
////////////////////////////////////////////////////////////////////////////////

//calls menu drawing routine and stuff. in a big set of function calls and data
$A3ED:A9 11 LDA #$11
$A3EF:20 5B AA JSR $AA5B ;calls the "Who will take this?" text writing routine
$A3F2:20 E4 A8 JSR $A8E4 ;calls the character select text

--------------------------------

//calls menu drawing routine and stuff.
$A415:A9 14 LDA #$14
$A417:20 5B AA JSR $AA5B ;calls the "Who will sell?" text writing routine
$A41A:20 E4 A8 JSR $A8E4 ;calls the character select text

--------------------------------

//shopekeeper display loop routines
$A743:20 3C C4 JSR $C43C
$A746:20 FA A9 JSR $A9FA ;display sprites
$A749:20 00 FE JSR $FE00

////////////////////////////////////////////////////////////////////////////////
*MAGIC SHOP
////////////////////////////////////////////////////////////////////////////////

$A358:A9 25 LDA #$25
$A35A:20 5B AA JSR $AA5B ;calls the "Who will take this?" text writing routine
$A35D:4C 65 A3 JMP $A365 ;if nothing was selected go back and reset screen

$A360:A9 17 LDA #$17
$A362:20 5B AA JSR $AA5B ;calls the "Who will take this?" text writing routine
$A365:20 E4 A8 JSR $A8E4 ;calls the character select text
$A368:B0 ED BCS $A357 ;RTS, exits
$A36A:A5 62 LDA $62
$A36C:6A ROR
$A36D:6A ROR
$A36E:6A ROR
$A36F:29 C0 AND #$C0
$A371:8D 0A 03 STA $030A
$A374:20 89 A9 JSR $A989 ;sends up the magic select routine
$A377:B0 EC BCS $A365 ;if nothing was selected go back and reset screen

--------------------------------

//calls window drawing routine, more prominent in chronological code execution hierarchy.
$AA5B:48 PHA
$AA5C:A9 00 LDA #$00
$AA5E:20 3B AA JSR $AA3B
$AA61:68 PLA
$AA62:4C 26 AA JMP $AA26
$AA65:A9 0E LDA #$0E
$AA67:20 5B AA JSR $AA5B

$A8E9:A9 FB LDA #$FB
$A8EB:85 3E STA $3E = #$77
$A8ED:A9 A8 LDA #$A8
$A8EF:85 3F STA $3F = #$A9
$A8F1:20 32 AA JSR $AA32 ;draws the window's text
$A8F4:A9 04 LDA #$04
$A8F6:85 63 STA $63 = #$03 ;which set of pointers to load for hand sprite
$A8F8:4C 07 A9 JMP $A907

//continously load menu pointers and wait for a selection of which character to sell stuff
$A924:A5 62 LDA $62 = #$00
$A926:0A ASL
$A927:A8 TAY
$A928:B1 3E LDA ($3E),Y @ $A980 = #$20
$A92A:85 64 STA $64 = #$28
$A92C:C8 INY
$A92D:B1 3E LDA ($3E),Y @ $A980 = #$20
$A92F:85 65 STA $65 = #$A0
$A931:20 27 A7 JSR $A727 ;set up bullshit, get joystick data i would assume. bankswap. do music and stuff.
$A934:A5 25 LDA $25 = #$00
$A9360 32 BNE $A96A
$A938:A5 24 LDA $24 = #$00
$A93A0 38 BNE $A974 ;looks for second character to sell shit
$A93C:A5 20 LDA $20 = #$00
$A93E:29 0C AND #$0C
$A940:C5 61 CMP $61 = #$00
$A942:F0 E0 BEQ $A924
$A944:85 61 STA $61 = #$00
$A946:C9 00 CMP #$00
$A948:F0 DA BEQ $A924

//window calling routines for the shopkeeper screens. it appears this is called for every window draw and change in option.
$AA3B:20 41 AA JSR $AA41
$AA3E:4C 63 E0 JMP $E063 ;draw window
$AA41:AA TAX
$AA42:BD 40 AC LDA $AC40,X @ $AC43 = #$06 = X-coordinate
$AA45:85 38 STA $38 = #$06
$AA47:BD 45 AC LDA $AC45,X @ $AC48 = #$12 = Y-coordinate
$AA4A:85 39 STA $39 = #$12
$AA4C:BD 4A AC LDA $AC4A,X @ $AC4D = #$09 = Width
$AA4F:85 3C STA $3C = #$09
$AA51:BD 4F AC LDA $AC4F,X @ $AC52 = #$0A = Height
$AA54:85 3D STA $3D = #$0C
$AA56:A9 0E LDA #$0E
$AA58:85 57 STA $57 = #$0E
$AA5A:60 RTS

//$611C - start of character 1 armor data

//loads character's armor inventory from savestate and into $0300-030F, for menu not shop
$BD9D:A6 66 LDX $66 = #$1C
$BD9F:A0 00 LDY #$00
$BDA1:BD 00 61 LDA $6100,X @ $611C = #$03
$BDA4:99 00 03 STA $0300,Y @ $0300 = #$13
$BDA7:BD 01 61 LDA $6101,X @ $611D = #$00
$BDAA:99 01 03 STA $0301,Y @ $0301 = #$00
$BDAD:BD 02 61 LDA $6102,X @ $611E = #$00
$BDB0:99 02 03 STA $0302,Y @ $0302 = #$01
$BDB3:BD 03 61 LDA $6103,X @ $611F = #$00
$BDB6:99 03 03 STA $0303,Y @ $0303 = #$C6
$BDB9:8A TXA
$BDBA:18 CLC
$BDBB:69 40 ADC #$40
$BDBD:AA TAX
$BDBE:98 TYA
$BDBF:18 CLC
$BDC0:69 04 ADC #$04
$BDC2:A8 TAY
$BDC3:C9 10 CMP #$10
$BDC5:90 DA BCC $BDA1
$BDC7:60 RTS

*********
*BATTLE:*
*********

//chose item to drink
$9647:20 3A 9A JSR $9A3A ;jumps to cursor selection routine, loops and waits for action
$964A:C9 02 CMP #$02
$964C0 03 BNE $9651
$964E:4C F5 95 JMP $95F5

//choose person to MAGIC on
$95DB:20 3A 9A JSR $9A3A ;jumps to cursor selection routine, loops and waits for action

to find more of these dialogues, set an execution breakpoint on $AA5B while in the shop.




I have a few crappy notes from FF1. Very disorganized, portions are years old and wrong. Read at your own risk.
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - ROM Hacking - Final Fantasy 1 Hacking Data: Part II |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.013 seconds; used 382.65 kB (max 465.18 kB)