INNER CODE UNIT · TypeScript
color
mantou132/nesbox · packages/arcade/src/index.ts:122
const color = ((b[offset + 1] << 8) & 0xff00) | (b[offset] & 0xff);
currentFrame[index++] = ((color >> 11) & 0x1f) << 3;
currentFrame[index++] = ((color >> 5) & 0x3f) << 2;
currentFrame[index++] = (color & 0x1f) << 3;
currentFrame[index++] = 255;
}
} else {
const b = new Uint8Array(this.#fbneo!.HEAP8.buffer, vidImagePtr, pixelCount << 2);
let index = 0;
for (let i = 0; i < pixelCount; i++) {
const offset = i << 2;
currentFrame[index++] = b[offset + 2];
currentFrame[index++] = b[offset + 1];
currentFrame[index++] = b[offset];
currentFrame[index++] = 255;
}
}
},