Author Topic: Enabling Tile Animations (wip)  (Read 3533 times)

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1351
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Enabling Tile Animations (wip)
« on: August 02, 2022, 06:28:50 pm »
So...

There is a certain order of enabling tile animations...
Using a hex editor to change these values:

West Cape Pallet
3DF9E7 88 (was 7F)
3DF9E8 00 (was 00) - no change.

Dactlys Nest Pallet
3DFA67 88 (was 53)
3DFA68 00 (was 04)...

Ocean Palace(blue) Pallet
3DF9FB 88 (was 18)
3DF9FC 00 (was 01)...

Frogs house/Algetty Pallet
3DFA3D C4 (was 00)
3DFA3C 02 (was 92)...


North Cape Pallet
3DFA4D 88 (was 3B)
3DFA4E 00 (was 03)...


These unlock the static tile set layer 3 to enable animations on layer 3 via the pallet animations... Where there weren't layers retail animations used--otherwise the layer 3 will be static and not moving!
I am trying to build the full list does anybody does anyone know more about this or can add to it would be appreciated!! 🙏

This could help us build the tile set editor!!

~Z
« Last Edit: August 02, 2022, 06:29:51 pm by Zakyrus »

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1351
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: Enabling Tile Animations (wip)
« Reply #1 on: August 02, 2022, 11:09:29 pm »
So what's the correlation between these locations and how can we use that data as a plugin?
~Z

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1764
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enabling Tile Animations (wip)
« Reply #2 on: August 03, 2022, 01:28:49 pm »
Code: [Select]
3DF290 3DF30F PTR N "Pointers to unknown data (+3DF310, local, first at 3DF310)" 2004.12.07
3DF310 3DF9CC ??? N "Unknown Data (related to Location L1&2 Tilesets, 12 bytes each)" 2004.12.07
3DF9CD 3DFA7C ??? N Unknown Data (related to Locations) 2003.07.10
3DFA7D 3DFFE4 ??? N Unknown Data (related to Locations) 2003.07.10

Looks like they all fall into that second group.

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1351
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: Enabling Tile Animations (wip)
« Reply #3 on: August 03, 2022, 02:02:30 pm »
Code: [Select]
3DF290 3DF30F PTR N "Pointers to unknown data (+3DF310, local, first at 3DF310)" 2004.12.07
3DF310 3DF9CC ??? N "Unknown Data (related to Location L1&2 Tilesets, 12 bytes each)" 2004.12.07
3DF9CD 3DFA7C ??? N Unknown Data (related to Locations) 2003.07.10
3DFA7D 3DFFE4 ??? N Unknown Data (related to Locations) 2003.07.10

Looks like they all fall into that second group.

I didn't know that they were that big 12 bytes a that's got to be a lot of data maybe they're segments of tiles that have animations somehow involved...

~Z

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1764
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enabling Tile Animations (wip)
« Reply #4 on: August 03, 2022, 03:45:18 pm »
I'm not sure on the number or size of the second and third groups. I'll do some testing later.

Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1756
    • View Profile
Re: Enabling Tile Animations (wip)
« Reply #5 on: August 03, 2022, 04:31:03 pm »
Ran a trace log on one of those offsets in the OP. So going off the raw machine code, those offsets for the second and third groups of unknown data are off by a few bytes.
The data Zakyrus was editing starts at 3DF9C7, two bytes per palette-set. The value it loads is used as an offset into unknown data starting at 3DFA77, and that's about as far as I've analyzed.
Code: [Select]
FD/E2A5:        AEFE01          LDX $01FE
FD/E2A8:        BF0300F6        LDA $F60003,X ;Palette number in location data
FD/E2AC:        0A              ASL A
FD/E2AD:        AA              TAX
FD/E2AE:        C220            REP #$20
FD/E2B0:        BFC7F9FD        LDA $FDF9C7,X
FD/E2B4:        AA              TAX
FD/E2B5:        A92005          LDA #$0520
FD/E2B8:        8D8121          STA $2181
FD/E2BB:        A90C00          LDA #$000C
FD/E2BE:        8518            STA $18
FD/E2C0:        E220            SEP #$20
FD/E2C2:        A900            LDA #$00
FD/E2C4:        8D8321          STA $2183
FD/E2C7:        A00000          LDY #$0000
FD/E2CA:        BF77FAFD        LDA $FDFA77,X
FD/E2CE:        29F0            AND #$F0
FD/E2D0:        F032            BEQ $E304

FD/E2D2:        C910            CMP #$10
FD/E2D4:        F034            BEQ $E30A
FD/E2D6:        C980            CMP #$80
FD/E2D8:        F030            BEQ $E30A
FD/E2DA:        BF77FAFD        LDA $FDFA77,X
FD/E2DE:        992005          STA $0520,Y
FD/E2E1:        E8              INX
FD/E2E2:        BF77FAFD        LDA $FDFA77,X
FD/E2E6:        992105          STA $0521,Y
FD/E2E9:        E8              INX
FD/E2EA:        BF77FAFD        LDA $FDFA77,X
FD/E2EE:        992205          STA $0522,Y
FD/E2F1:        E8              INX
FD/E2F2:        A900            LDA #$00
FD/E2F4:        992305          STA $0523,Y
FD/E2F7:        992405          STA $0524,Y
FD/E2FA:        BF77FAFD        LDA $FDFA77,X
FD/E2FE:        992505          STA $0525,Y
FD/E301:        E8              INX
FD/E302:        8074            BRA $E378

FD/E304:        E8              INX
FD/E305:        992005          STA $0520,Y
FD/E308:        806E            BRA $E378

FD/E30A:        48              PHA
FD/E30B:        BF77FAFD        LDA $FDFA77,X
FD/E30F:        992005          STA $0520,Y
FD/E312:        E8              INX
FD/E313:        BF77FAFD        LDA $FDFA77,X
FD/E317:        992105          STA $0521,Y
FD/E31A:        E8              INX
FD/E31B:        BF77FAFD        LDA $FDFA77,X
FD/E31F:        992205          STA $0522,Y
FD/E322:        E8              INX
FD/E323:        A900            LDA #$00
FD/E325:        992305          STA $0523,Y
FD/E328:        992405          STA $0524,Y
FD/E32B:        BF77FAFD        LDA $FDFA77,X
FD/E32F:        992505          STA $0525,Y
FD/E332:        E8              INX
FD/E333:        BF77FAFD        LDA $FDFA77,X
FD/E337:        992605          STA $0526,Y
FD/E33A:        E8              INX
FD/E33B:        BF77FAFD        LDA $FDFA77,X
FD/E33F:        992705          STA $0527,Y
FD/E342:        E8              INX
FD/E343:        BF77FAFD        LDA $FDFA77,X
FD/E347:        992805          STA $0528,Y
FD/E34A:        E8              INX
FD/E34B:        68              PLA
FD/E34C:        C980            CMP #$80
FD/E34E:        D028            BNE $E378

FD/E350:        C221            REP #$21
FD/E352:        8A              TXA
FD/E353:        6977FA          ADC #$FA77
FD/E356:        992905          STA $0529,Y
FD/E359:        A90000          LDA #$0000
FD/E35C:        E220            SEP #$20
FD/E35E:        A9FD            LDA #$FD
FD/E360:        992B05          STA $052B,Y
FD/E363:        B92005          LDA $0520,Y
FD/E366:        290F            AND #$0F
FD/E368:        850E            STA $0E
FD/E36A:        640F            STZ $0F
FD/E36C:        C220            REP #$20
FD/E36E:        8A              TXA
FD/E36F:        38              SEC
FD/E370:        650E            ADC $0E
FD/E372:        AA              TAX
FD/E373:        A90000          LDA #$0000
FD/E376:        E220            SEP #$20

FD/E378:        98              TYA
FD/E379:        18              CLC
FD/E37A:        690C            ADC #$0C
FD/E37C:        A8              TAY
FD/E37D:        C948            CMP #$48
FD/E37F:        F003            BEQ $E384
FD/E381:        4CCAE2          JMP $E2CA

FD/E384:        A900            LDA #$00
FD/E386:        992005          STA $0520,Y
FD/E389:        992C05          STA $052C,Y
FD/E38C:        993805          STA $0538,Y
FD/E38F:        994405          STA $0544,Y
FD/E392:        995005          STA $0550,Y
FD/E395:        995C05          STA $055C,Y
FD/E398:        AB              PLB
FD/E399:        2B              PLD
FD/E39A:        28              PLP
FD/E39B:        6B              RTL

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1351
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: Enabling Tile Animations (wip)
« Reply #6 on: August 03, 2022, 05:44:48 pm »
Cool that's basically the two bytes for enabling the animations on a tile set that doesn't use it yet.. at least for later three as far as I know.

This could really help us with a tile set editor with animations!

So it's basically (and I've only just started getting into the op codes and debugger stuff)... Various flags to turn on animations for various locations. ...? (I presume)

I want to say that that data field is the index range of 0 to the max of either the millennial Fair Tile set or its pallet one of the two either way hold the animation indecies... For enabling or disabling animation)

~Z
« Last Edit: August 03, 2022, 05:46:00 pm by Zakyrus »

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1764
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enabling Tile Animations (wip)
« Reply #7 on: August 11, 2022, 11:46:29 pm »
Code: [Select]
3DF290 3DF30F PTR N "Pointers to L1&2 tile animations (+3DF310, local, first at 3DF310)" 2004.12.07
3DF310 3DF9C6 DATA N "L1&2 tile animations, 12+ bytes each" 2004.12.07
3DF9C7 3DFA76 PTR N Pointers to L3 tile animations, (+3DFA77, local, first at 3DFA77) 2003.07.10
3DFA77 3DFFE4 DATA N Layer 3 tile animations, 6-48 bytes each 2003.07.10

Layer 1 and 2 tile animations contain twelve packets that can vary in size. The minimum is 1 byte, haven't figured out the maximum yet.

Layer 3 tile animations have six packets, minimum 1 byte in size. The format here is different.

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1351
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: Enabling Tile Animations (wip)
« Reply #8 on: August 12, 2022, 05:55:57 pm »
Code: [Select]
3DF290 3DF30F PTR N "Pointers to L1&2 tile animations (+3DF310, local, first at 3DF310)" 2004.12.07
3DF310 3DF9C6 DATA N "L1&2 tile animations, 12+ bytes each" 2004.12.07
3DF9C7 3DFA76 PTR N Pointers to L3 tile animations, (+3DFA77, local, first at 3DFA77) 2003.07.10
3DFA77 3DFFE4 DATA N Layer 3 tile animations, 6-48 bytes each 2003.07.10

Layer 1 and 2 tile animations contain twelve packets that can vary in size. The minimum is 1 byte, haven't figured out the maximum yet.

Layer 3 tile animations have six packets, minimum 1 byte in size. The format here is different.

Sweet that's a start.
As I mentioned before it's kind of a staggered order of what turns on the animation for a specific tile set or not...

I'll play around with this a little bit more later and try to document this much as I can.

~Z

Reld

  • Guru of Time
  • Porrean (+50)
  • *
  • Posts: 64
    • View Profile
Re: Enabling Tile Animations (wip)
« Reply #9 on: December 18, 2022, 10:05:26 pm »
The data Mauron has labeled as layer 3 tile animation data is actually palette animation data like Zakyrus was originally saying. Mauron's right about the number of packets (6), although it's probably worth noting that there's overlap between some of the packet groups. If a packet is unused it just gets a single $00 byte.

It's been a little while since I looked at it, but here are my notes on the format of the data.:

Code: [Select]
***************************************************************************************************************************
MODE 10: PALETTE SEQUENCE, LINEAR ORDER
***************************************************************************************************************************
1T UU VV WW ZZYYXX
---------------------------------------------------------------------------------------------------------------------------
T = number of "sets" - 1
UU = CGRAM offset (start position in screen palette)
VV = number of colors per "set"
WW = delay
XXYYZZ = pointer to start of palette data in ROM (note: pointers are little-endian)
---------------------------------------------------------------------------------------------------------------------------
Loads a series of color "sets" in a linear sequence with VV colors each starting at XXYYZZ
loops back to first "set" at end
---------------------------------------------------------------------------------------------------------------------------
Example:
13 11 03 09 6875F6
---------------------------------------------------------------------------------------------------------------------------


***************************************************************************************************************************
MODE 80: PALETTE SEQUENCE, ARBITRARY ORDER
***************************************************************************************************************************
8T UU VV WW ZZYYXX [Palette Offsets (count varies)]
---------------------------------------------------------------------------------------------------------------------------
T = number of steps - 1
UU = CGRAM offset (start position in screen palette)
VV = number of colors per "set"
WW = delay (number of frames - 1)
XXYYZZ = pointer to start of palette data in ROM (note: pointers are little-endian)
Palette Offsets = multiply by number of colors and add to pointer
---------------------------------------------------------------------------------------------------------------------------
Loads a series of color "sets" with VV colors each starting at XXYYZZ in the order specified by the Palette Offsets
loops back to first Palette Offset at end
---------------------------------------------------------------------------------------------------------------------------
Example:
8F 27 04 10 8075F6 00 00 00 01 02 03 04 05 05 05 05 05 04 03 02 01
---------------------------------------------------------------------------------------------------------------------------


***************************************************************************************************************************
MODE 20: FORWARD CYCLE EXISTING PALETTE
***************************************************************************************************************************
20 UU VV WW
---------------------------------------------------------------------------------------------------------------------------
UU = CGRAM offset (start position in screen palette)
VV = number of colors
WW = delay
---------------------------------------------------------------------------------------------------------------------------
Cycles VV colors in currently loaded palette in a forward direction
---------------------------------------------------------------------------------------------------------------------------
Example:
20 7D 02 0C
---------------------------------------------------------------------------------------------------------------------------

***************************************************************************************************************************
MODE 30: BACKWARD CYCLE EXISTING PALETTE
***************************************************************************************************************************
30 UU VV WW
---------------------------------------------------------------------------------------------------------------------------
UU = CGRAM offset (start position in screen palette)
VV = number of colors
WW = delay
---------------------------------------------------------------------------------------------------------------------------
Cycles VV colors in currently loaded palette in a backward direction
---------------------------------------------------------------------------------------------------------------------------
Example:
30 2D 02 0A

I've also attached a GIF I made that kind of illustrates how Mode 80 works.

Reld

  • Guru of Time
  • Porrean (+50)
  • *
  • Posts: 64
    • View Profile
Re: Enabling Tile Animations (wip)
« Reply #10 on: December 18, 2022, 11:02:57 pm »
These are my notes on the actual data itself. Not the most readable thing in the world, but could be useful.

Reld

  • Guru of Time
  • Porrean (+50)
  • *
  • Posts: 64
    • View Profile
Re: Enabling Tile Animations (wip)
« Reply #11 on: December 18, 2022, 11:45:42 pm »
Triple post. These are my old notes on the L1 & L2 tile animation data. I made these notes for myself, so I'm not sure if they'll make sense to anyone else or not.

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1351
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: Enabling Tile Animations (wip)
« Reply #12 on: January 14, 2023, 12:10:06 pm »
Triple post. These are my old notes on the L1 & L2 tile animation data. I made these notes for myself, so I'm not sure if they'll make sense to anyone else or not.

SUPER-F*CKING-DUPER ...in-CREDIBLE!! Fantastic!
Thank you so much! ...a few questions, though...

...Can this be expanded/elaborated upon?(for greater purposes like making a TF plugin)?
Secondly can you provide the formulae for calculating this(so I can make a TF/extras video on the subject?) Either way, this will be an honerable mention. ;)

ThAnk YoU!!

~z
« Last Edit: January 14, 2023, 12:10:54 pm by Zakyrus »

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1351
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: Enabling Tile Animations (wip)
« Reply #13 on: March 24, 2023, 05:18:04 pm »
Triple post. These are my old notes on the L1 & L2 tile animation data. I made these notes for myself, so I'm not sure if they'll make sense to anyone else or not.

Double-previous post, lol.

We so need an editor, that can "grid/pull-up graphical tile editor like this"

^ yeah those!

~Z