Game Modification Station / Re: FF6: AI Upgrade bug help
« on: July 12, 2014, 07:04:15 AM »Happy Hacking!
øA slickproductions.org /forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;u=276 e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index4aa9-3.html slickproductions.org /forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;u=276 e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index4aa9-3.html.z x uh^ ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ °V aÒ OK text/html ISO-8859-1 gzip 8:Ö aÒ ÿÿÿÿÿÿÿÿ Wed, 11 Mar 2020 05:36:45 GMT 0ó° °® 0® P® €§² ð® uh^ ÿÿÿÿÿÿÿÿï- aÒ
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
that's a lot of different changes to your ROM. try making a separate patch for each one, and applying them one at a time to figure out the culprit.
yeah, this sounds like quite a significant change. can you elaborate on what you're doing, and why you're doing it? why not just have the script issue a bunch of commands per turn, like you mentioned for your test scenario below?
FC 0C 01 02 ; If variable VAR001 is less than to 2
FC 0D 01 01 ; If variable VAR001 is greater than or equal to 1
FB 11 04 ; Branch forward in script 4 bytes
FE ; End If and reset targeting
FB 11 21 ; Branch forward in script 33 bytes
FC 15 03 00 ; If VAR003 has all the following bit cleared: 0
FC 17 4F 00 ; If target Back Row is valid, set it, and
E8 ; Landslide
FB 11 11 ; Branch forward in script 17 bytes
FE ; End If and reset targeting
FC 14 03 00 ; If VAR003 has all the following bit set: 0
FC 17 4E 00 ; If target Front Row is valid, set it, and
E8 ; Landslide
FB 11 04 ; Branch forward in script 4 bytes
FE ; End If and reset targeting
F1 52 ; Targeting: none
E8 ; Landslide
F9 00 03 00 ; VAR003 toggle bit: 0Other than "there is something wrong," there really isn't anything I could narrow down based on these screenshots. Any number of routines that execute could be an issue.
Doing STX $11A7 is an issue. If you are storing damage, you want to store to $11B0 or $F0, preferably $11B0. It's also an issue because a bit of this is used to call displaying text when a spell hits. That code is at C2/3262. If you're shifting $11A7, this bit may be misread. You'll also want to make sure that $1E70-$1E73 are actually free in ram. I'm not sure they are, but I do know that there's a big range of free ram in the $1440-$14FF range.
Of course, this may not be the issue at all.
PHX
LDA $11A7
PHA (Backup special byte 3)
PHP
LDA $3BB9,Y (Magic Defense)
BCC $0CD4 (Branch if concern MP or Magical damage)
LDA $3BB8,Y (Defense)
LDX #$03
STZ $1E70,x
LSR A (half M/Def stat)
ASL $11A7 (shift Special 3 bit (4-7) into Carry)
BCC 02
STA $1E70,x (Store current value)
DEX
BPL F1 (branch if all 4 bits haven't been checked)
PLP
LDA $3BB9,Y (Magic Defense)
BCC $0CD4 (Branch if concern MP or Magical damage)
LDA $3BB8,Y (Defense)
LDX #$03
SEC
SBC $1E70,x (subtract stored values based on m/def percentages (0 for values when bit wasn't set))
DEX
BPL FA
PLX
STX $11A7 (restore Special byte 3)
PLX
RTS
I can safely tell you that there isn't much to bank C5, but what is there is a mess that is difficult to figure out. Nothing in there is going to be wrong, it's the setup leading to the call.
INC $E9ED
INC $6284
LDA #$10 (16 = instrument set?)
STA $1300
LDA $B8 (load song ID from parameter byte)
STA $1301
LDA #$FF (Volume: FF = normal)
STA $1302
JSL $C50004 (Changes the music)
STZ $E9ED
RTS


PHX
LDA $11A7
PHA
PHP
LDA $3BB9,Y (Magic Defense)
BCC $0CD4 (Branch if concern MP or Magical damage)
LDA $3BB8,Y (Defense)
LDX #$03
STZ $1E70,x
LSR A
ASL $11A7
BCC 02
STA $1E70,x
DEX
BPL F1
PLP
LDA $3BB9,Y (Magic Defense)
BCC $0CD4 (Branch if concern MP or Magical damage)
LDA $3BB8,Y (Defense)
LDX #$03
SEC
SBC $1E70,x
DEX
BPL FA
PLX
STX $11A7
PLX
RTSLDA #$10 (16 = instrument set?)
STA $1300
LDA $B8 (load song ID from parameter byte)
STA $1301
LDA #$FF (Volume: FF = normal)
STA $1302
JSL $C50004 (Changes the music)
STZ $E9ED
RTSCA/BA02: A0 Set timer 0 to $4650 [5m: 00s: 00j], jump to subroutine $CABA09 if it expires. Flags:
(Countdown continues in menu and battle)
(Countdown shown while walking [must have tiles for it, only timer 0 can use])
(Unknown flag enabled 0x20 on event bank byte)
(Countdown overrides the game clock display)
Was that really what Edrin was asking? I don't see what PC slots have to do with this. I thought Edrin was expanding sprite sheets to player character-completeness.
The sprite pointers in towns and the overworld are split up. The lower 16-bit offsets are at 0xD0F2 while the bank byte and another value are at 0xD23C.
I don't know where this routine is used, but it's the only one in the disassembly that labels what these particular offsets are.Code: [Select]C0/69A3: BFF3D0C0 LDA $C0D0F3,X (Loads pointer to Map character graphcis)
C0/69A7: 852B STA $2B
C0/69A9: 852E STA $2E
C0/69AB: 8531 STA $31
C0/69AD: 8534 STA $34
C0/69AF: BF3CD2C0 LDA $C0D23C,X (Bank pointers and Number of Bytes to Copy per Tile for Map Char Gfx)
C0/69B3: 852C STA $2C
C0/69B5: 852F STA $2F
C0/69B7: 8532 STA $32
C0/69B9: 8535 STA $35
The routine for the behind-view sprite used when riding a chocobo is in bank $EE. It does not access a pointer table, instead calculating an address based on the assumption that all sheets are 0x16A0 bytes long.Code: (Novalia's Disassembly: Overworld chocobo rider sprite) [Select]EE/8943: ADFB11 LDA $11FB (Sprite number for map character)
EE/8946: 8D0242 STA $4202 (Save as multiplicand)
EE/8949: A9A0 LDA #$A0
EE/894B: 8D0342 STA $4203 (Set multiplier to 160)
EE/894E: EA NOP
EE/894F: EA NOP
EE/8950: EA NOP
EE/8951: AE1642 LDX $4216 (Product)
EE/8954: 866A STX $6A (Save the address temporarily)
EE/8956: A916 LDA #$16
EE/8958: 8D0342 STA $4203 (Set multiplier to 22)
EE/895B: EA NOP
EE/895C: EA NOP
EE/895D: EA NOP
EE/895E: AD1642 LDA $4216 (Load low byte of product)
EE/8961: 18 CLC (Clear Carry for addition)
EE/8962: 656B ADC $6B (Add middle byte of address)
EE/8964: 856B STA $6B (Save updated address)
EE/8966: AD1742 LDA $4217 (Load high byte of product)
EE/8969: 656C ADC $6C (Add to high byte of address)
EE/896B: 856C STA $6C (Save updated address)
EE/896D: 18 CLC (Clear Carry for addition)
EE/896E: A56A LDA $6A (Low byte of address)
EE/8970: 6980 ADC #$80 (Add 128)
EE/8972: 856A STA $6A (Save changes)
EE/8974: A56B LDA $6B (Middle byte of address)
EE/8976: 6901 ADC #$01 (Add one, or two if an overflow occurred)
EE/8978: 856B STA $6B (Save changes)
EE/897A: A56C LDA $6C (High byte of address)
EE/897C: 69D5 ADC #$D5 (Add #$D5, or #$D6 if an overflow occurred)
EE/897E: 856C STA $6C (Save changes; D5/0180+X)
Loads the palettes to RAM
C1/3E37: A918 LDA #$18
C1/3E39: 8510 STA $10
C1/3E3B: BF0063ED LDA $ED6300,X
C1/3E3F: 99AD81 STA $81AD,Y
C1/3E42: E8 INX
C1/3E43: C8 INY
C1/3E44: C610 DEC $10
C1/3E46: D0F3 BNE $3E3B
Writes palette from backup address to the address actually called by the sprites
C1/2DE0: A21800 LDX #$0018
C1/2DE3: B9AD81 LDA $81AD,Y
C1/2DE6: 99807F STA $7F80,Y (set character palette's 1 - 4)
C1/2DE9: C8 INY
C1/2DEA: CA DEX
C1/2DEB: D0F6 BNE $2DE3
C1/0A7B: A2007F LDX #$7F00 (pay attention to this one!)
C1/0A7E: 8E7243 STX $4372
C1/0A81: A97E LDA #$7E
C1/0A83: 8D7443 STA $4374
C1/0A86: A20001 LDX #$0100
C1/0A89: 8E7543 STX $4375
C1/0A8C: A980 LDA #$80
C1/0A8E: 8D0B42 STA $420B