øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2256.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index355b-3.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=17.40e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index355b-3.html.zxP9h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ à�~oOKtext/htmlISO-8859-1gzip8:Ö~oÿÿÿÿÿÿÿÿWed, 11 Mar 2020 01:21:45 GMT0ó°° ®0®P®€§²ð®P9h^U~o Battle Background

Author Topic: Battle Background  (Read 709 times)

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Battle Background
« on: August 01, 2016, 09:50:17 AM »
Lets use this thread to share knowledge on: Battle Background

 :edit:
Master Table: D4BA21 - 8 bytes per entry.
ASM Code: C1335A
« Last Edit: August 02, 2016, 03:29:20 AM by Squall »

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: Background
« Reply #1 on: August 01, 2016, 10:03:28 AM »
So far I have looked in the first 4 bytes:
Byte 0: ID of something; This ID*3 is used as index in D84196 (3 bytes each).
 - From there we get address of something that is decompressed in 7F:C000 (through C3:0002)
 - In D84157 (3 bytes each) with ID*3 we get ram address (where above was decompressed), usually 7F:C000
 - that address is written in $72
 - after decompressed thing is copied in $9009 and $ 8809

Byte 1: Palette1 ID
 - In $D4BB31 with  Palette1 ID * 32 we get 16 color palette in $7E29 and $F540

Byte 2: Palette2 ID
 - In $D4BB31 with  Palette2 ID * 32 we get 16 color palette in $7E49 and $F560

Byte 3: ID of something
 - In $D4C86D with ID * 2 - we get Offset
 - in $72 addres is made by $D40000 + Offset
 - the thing pointed by the address is decompressed in $7F:7000
*this last decompression is custom, not type 2
« Last Edit: August 01, 2016, 10:10:59 AM by Squall »

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: Battle Background
« Reply #2 on: August 01, 2016, 05:06:57 PM »
Code: [Select]
D8/4196-D8/41D4 Data Pointers to battle background tilesets [3bytes * 21 entries]
D8/41D5-D8/DE35 4bpp Battle background tilesets [x bytes * 9 entries] [Compressed unheaded type02]

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: Battle Background
« Reply #3 on: August 02, 2016, 06:51:03 AM »
Byte 4: if FF then $BCA8 = 1 else
 - In D4C736 with ID*2 we get Offset
 - Offset is written in $7E
 - address is formed in $7E-80 - $D40000+Offset

Byte 5: if FF then $BCA9 = 1 else
 - In D4C736 with ID*2 we get Offset
 - Offset is written in $82
 - address is formed in $82-84 - $D40000+Offset

Byte 6:
 - in D4C5B1 with ID*2 we get Offset
 - address is fored in $70-72 - $D40000 + Offset
 - area $A809:8C is filled with FF
 - [$70] -> A809 until FF or total len of 80

Byte 7:
 - written in $F8BD
 - ID*2 is written in $F8BE

After all params are parsed, the subroutine stop ...
There is strange bit EOR, OR, AND ... on $7000:500 - I have no clue what it does ... simple decipher? The result then is Type2 unheaded compressed data ...