Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for static mappings #74

Open
kuroya2mouse opened this issue Apr 26, 2024 · 1 comment
Open

Add support for static mappings #74

kuroya2mouse opened this issue Apr 26, 2024 · 1 comment

Comments

@kuroya2mouse
Copy link

Does Flex2 have static mapping support? S1-S3K have some objects in this format and Flex2 cannot open them

We also actively use static mappings for our objects and we don't have the opportunity to view them in Flex 2

As an example of static mapping:
Map_LConv_Wheel: dc.b $F0, $F, 0, 0, $FF, $F0

There is no offset table and only one tile to display in the game

As a result, we made own js-file for Flex 2 and now it works

mappings([
    [
        () => {
            const quantity = 1;
            return quantity > 0 && (({ mapping }, frameIndex) => {
                mapping.top = read(dc.b, signed);
                read(nybble);
                mapping.width = read(2) + 1;
                mapping.height = read(2) + 1;
                mapping.priority = read(1);
                mapping.palette = read(2);
                mapping.vflip = read(1);
                mapping.hflip = read(1);
                mapping.art = read(11);
                mapping.left = read(dc.w, signed);
                if (frameIndex === quantity - 1) return endFrame;
            });
        },
        ({ sprite }) => {
            return ({ mapping }) => {
                // top
                write(dc.b, mapping.top);
                write(nybble, 0);
                // size
                write(2, mapping.width - 1);
                write(2, mapping.height - 1);
                // 1 player
                write(1, mapping.priority);
                write(2, mapping.palette);
                write(1, mapping.vflip);
                write(1, mapping.hflip);
                write(11, mapping.art);
                // left
                write(dc.w, mapping.left);
            };
        },
    ],
]);

It would be great to see official support for this format.

Maybe you can add a checkbox so that you don't have to do a bunch of mapping for each game?
flex2

@kirjavascript
Copy link
Owner

I added support for checkboxes in mapping scripts, so I can do this. I'll put it in the next version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants