[Reverse-engineering] [th01] .BOS bitplane pointers

No idea why ZUN split the 6 slots into 4 with a regular alpha plane,
and 2 with a negated alpha plane. The latter are only used for Sariel's
animations.

Part of P0095, funded by Yanga.
This commit is contained in:
nmlgc 2020-05-29 14:01:34 +02:00
parent 6b2a54d8d2
commit 416aa4ccef
3 changed files with 439 additions and 399 deletions

32
th01/formats/bos.hpp Normal file
View File

@ -0,0 +1,32 @@
/// Uncompressed 16-color 16w×h sprite format
/// -----------------------------------------
#define BOS_IMAGES_PER_SLOT 8
struct bos_image_t {
dots16_t *B;
dots16_t *R;
dots16_t *G;
dots16_t *E;
dots16_t *alpha;
};
struct bos_t {
bos_image_t image[BOS_IMAGES_PER_SLOT];
};
// Regular
// -------
#define BOS_SLOT_COUNT 4
extern bos_t bos_images[BOS_SLOT_COUNT];
// -------
// Fast
// ----
// These… only have functions to direct byte-aligned blitting onto page 0, in
// exchange for the alpha plane being pre-negated at load time? No idea why.
// That 1-instruction negation is certainly not what makes the original code
// slow.
#define BOS_FAST_SLOT_COUNT 2
extern bos_t bos_fast_images[BOS_FAST_SLOT_COUNT];
// ----
/// -----------------------------------------

19
th01/formats/bos[bss].asm Normal file
View File

@ -0,0 +1,19 @@
BOS_SLOT_COUNT = 4
BOS_FAST_SLOT_COUNT = 2
BOS_IMAGES_PER_SLOT = 8
bos_image_t struc
BOS_B dd ?
BOS_R dd ?
BOS_G dd ?
BOS_E dd ?
BOS_alpha dd ?
bos_image_t ends
bos_t struc
BOS_image bos_image_t BOS_IMAGES_PER_SLOT dup (<?>)
bos_t ends
public _bos_images, _bos_fast_images
_bos_images bos_t BOS_SLOT_COUNT dup(<?>)
_bos_fast_images bos_t BOS_FAST_SLOT_COUNT dup(<?>)

File diff suppressed because it is too large Load Diff