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

Why is one color missing? #774

Open
zt1514 opened this issue Nov 1, 2024 · 1 comment
Open

Why is one color missing? #774

zt1514 opened this issue Nov 1, 2024 · 1 comment

Comments

@zt1514
Copy link

zt1514 commented Nov 1, 2024

The original 24 x24 pixel image is as follows:
demo

After executing w4 run cart.wasm, the displayed image is as follows:
image

I executed w4 png2src demo.png --as and copied the code into main.ts as follows:

import * as w4 from "./wasm4";

const demoWidth = 24;
const demoHeight = 24;
const demoFlags = 1; // BLIT_2BPP
const demo = memory.data<u8>([0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x80, 0x00, 0x1a, 0x90, 0x00, 0x02, 0x80, 0x00, 0x1a, 0x90, 0x00, 0x02, 0x80, 0x00, 0x15, 0x50, 0x00, 0x02, 0x80, 0x00, 0x15, 0x50, 0x00, 0x02, 0x80, 0x00, 0x3f, 0xf0, 0x00, 0x02, 0x80, 0x00, 0x3f, 0xf0, 0x00, 0x02, 0x80, 0x00, 0x3f, 0xf0, 0x00, 0x02, 0x80, 0x00, 0x3f, 0xf0, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa]);
export function update(): void {
    w4.blit(demo, 0, 0, demoWidth, demoHeight, demoFlags);
}

The color of the pixel where blue should appear is not displayed.
Did I make a mistake in my operation?

@zt1514
Copy link
Author

zt1514 commented Nov 1, 2024

The four colors in original 24 x24 pixel image are :
#FFFFFF – White
#FF0000 – Red
#00FF00 – Green
#0000FF – Blue

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

1 participant