Skip to content

Why is one color missing? #774

@zt1514

Description

@zt1514

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions