Post Ao7rl8bK7Z8JLHGnZI by foone@digipres.club
 (DIR) More posts by foone@digipres.club
 (DIR) Post #Ao7rKM5hrDV1MVi6oy by foone@digipres.club
       2024-11-17T06:47:55Z
       
       0 likes, 0 repeats
       
       the GBA stores sprite rotation HOW?
       
 (DIR) Post #Ao7rR5jV4i6YegXHF2 by foone@digipres.club
       2024-11-17T06:49:10Z
       
       0 likes, 0 repeats
       
       so there's 128 sprites that start in RAM at 0x07000000, they're 6 bytes long, and the second sprite starts at 0x07000008yeah they're 6 bytes long but stored every 8 bytes
       
 (DIR) Post #Ao7rUALKOJG3p1hAa8 by foone@digipres.club
       2024-11-17T06:49:43Z
       
       0 likes, 0 repeats
       
       the 2 bytes between each object are the sprite rotation.But they're not the sprite rotation for the sprite they're next to!
       
 (DIR) Post #Ao7rY3Ewk2Lqx1Yyau by leo@60228.dev
       2024-11-17T06:50:24Z
       
       0 likes, 0 repeats
       
       @foone isnt it just an affine matrix
       
 (DIR) Post #Ao7rcpBePzaqoWIWYK by MenhirMike@mastodon.social
       2024-11-17T06:51:16Z
       
       0 likes, 0 repeats
       
       @foone WTF. I guess it’s nice that it supports free rotation rather than just flipping, and I don’t know how it compares to e.g., Sega’s Scaler hardware, but this is definitely a case of “every developer first wrote a bunch of helper functions” https://gbadev.net/gbadoc/sprites.html
       
 (DIR) Post #Ao7rgXm765QDyD7tJo by foone@digipres.club
       2024-11-17T06:51:28Z
       
       0 likes, 0 repeats
       
       instead, it takes a total of 32 bytes (4 sprites) to encode one single sprite rotation entry. So the first rotation group is at 0x7000006, 0x700000e, 0x7000016, 0x700001e
       
 (DIR) Post #Ao7ri3dW7gOn4lpLyC by drsbaitso@infosec.exchange
       2024-11-17T06:51:36Z
       
       0 likes, 0 repeats
       
       @foone This is gonna be one of those psychic traumas that I randomly remember twice a decade, and have to spend ten minutes pondering exactly what effects that had on the minds of the programmers who developed it, isn't it?
       
 (DIR) Post #Ao7rl8bK7Z8JLHGnZI by foone@digipres.club
       2024-11-17T06:51:52Z
       
       0 likes, 0 repeats
       
       and then inside the 6 bytes that define sprites, there's a bitfield that determines which rotation group it uses.
       
 (DIR) Post #Ao7rl9KhOrQfc0V2IK by foone@digipres.club
       2024-11-17T06:52:14Z
       
       0 likes, 0 repeats
       
       so there's 32 rotation groups, but they're interleaved inside the sprites. for... reasons
       
 (DIR) Post #Ao7ruSQflm3DRcjSDI by jens@social.finkhaeuser.de
       2024-11-17T06:54:18Z
       
       0 likes, 0 repeats
       
       @foone So several sprites can use the same rotation? Makes sense, in a way.
       
 (DIR) Post #Ao7ry4CDoFaXRfh4mu by leo@60228.dev
       2024-11-17T06:55:06Z
       
       0 likes, 0 repeats
       
       @foone i assume this would simplify the address generation logic quite a bit
       
 (DIR) Post #Ao7tIgfkZ6bwWUtyvQ by foone@digipres.club
       2024-11-17T07:10:02Z
       
       0 likes, 0 repeats
       
       @jens sharing rotations makes sensestuffing them inbetween each sprite? less so
       
 (DIR) Post #Ao7uFviwFQasI1dtKq by jens@social.finkhaeuser.de
       2024-11-17T07:20:40Z
       
       0 likes, 0 repeats
       
       @foone Yeah, that's the point I meant.I'm not sure why this interleaving is being done. The only halfway sensible thing I can imagine is that accessing those sprites and rotation group chunks at those addresses is way faster for some obscure hardware reason than not?