#pragma once // Standalone print wrapper around the emitter's plane-invert probe // (emit::probe_plane_invert_values, in emit_descriptor.h). plane_invert[k] is // "does plane k's wire byte need to be the bit-complement of the engine's // buffer byte"; the probe drives known full-screen fills and reads each // plane's wire byte, reconciling against the engine's fixed buffer convention // (plane0 bit=white, plane1 bit=red). See emit_descriptor.h for the detail. // This header just prints the result for eyeballing; the emitter uses the // values directly to fill plane_invert in the generated descriptor. #include #include "emit_descriptor.h" namespace emit { template void probe_plane_invert(const char *name, uint8_t plane0_cmd, uint8_t plane1_cmd, int plane_count) { const PlaneInvert r = probe_plane_invert_values(plane0_cmd, plane1_cmd, (size_t) plane_count); printf("=== %s plane-invert probe ===\n", name); printf(" white-fill plane0 wire=0x%02X -> is_1bpp=%s\n", r.w0_white & 0xFF, r.is_1bpp ? "true" : "false"); if (!r.is_1bpp) { printf(" => packed panel (bits_per_pixel>1): plane_invert unused, see diag pass\n"); return; } printf(" => plane_invert[0] = %s\n", r.inv0 ? "true" : "false"); if (plane_count > 1) { if (r.plane1_valid) printf(" => plane_invert[1] = %s (red-fill plane1 wire=0x%02X)\n", r.inv1 ? "true" : "false", r.w1_red & 0xFF); else printf(" => plane_invert[1] = (undetermined; no 2-arg writeScreenBuffer)\n"); } } } // namespace emit