{
  "kind": "hwanse-draw-flags-color-key-review",
  "status": "object-flag-and-blt-flag-boundary-reviewed",
  "source": [
    "Hwanse2.exe",
    "docs/DIRECTDRAW_NOTES.md",
    "out/directdraw_flow.json",
    "out/render_pipeline_model_review.json",
    "out/surface_wrapper_catalog_review.json"
  ],
  "summary": {
    "objectFlagField": "object+0x2c",
    "lowBitsClipSlotMask": "0x00000007",
    "scaledBranchMask": "0x00000208",
    "centeredScaleBit": "object+0x2d bit 0x02",
    "clipRectTable": "0x0055ab08 + (object+0x2c & 7) * 0x10",
    "surfaceWrapperTable": "0x0055abd8",
    "normalDrawFlagGlobal": "0x004676f4",
    "scaledDrawFlagGlobal": "0x004676f8",
    "knownBltCalls": 11,
    "byteEvidenceRows": 17,
    "colorKeyConclusion": "CNS pixels and palette entries are not enough to decide transparency. The original renderer requests opaque/fill/source-color-key behavior through DirectDraw call flags and draw context. object+0x2c controls clipping/scale branches; the exact color-key flag value is carried by caller arguments or globals 0x004676f4/0x004676f8."
  },
  "objectFlagConsumers": [
    {
      "field": "object+0x28",
      "mask": "0x0000ffff",
      "consumerVaHex": "0x00416ceb",
      "meaning": "active object source/frame index",
      "status": "grounded"
    },
    {
      "field": "object+0x28",
      "mask": "0x00ff0000",
      "consumerVaHex": "0x00416cf9",
      "meaning": "active object surface-wrapper slot",
      "status": "grounded"
    },
    {
      "field": "object+0x2c",
      "mask": "0x00000208",
      "consumerVaHex": "0x00416d79 / 0x00419a2a",
      "meaning": "selects scaled/alternate rect branch and clipping helper 0x0041a742",
      "status": "grounded"
    },
    {
      "field": "object+0x2c",
      "mask": "0x00000007",
      "consumerVaHex": "0x0041712d / 0x00419af9 / 0x00419b5f",
      "meaning": "selects clip/viewport rect slot from 0x0055ab08 + (flags & 7) * 0x10",
      "status": "grounded"
    },
    {
      "field": "object+0x2d",
      "mask": "0x02",
      "consumerVaHex": "0x00416dfd / 0x00419a3c",
      "meaning": "applies centered scale/anchor correction using object+0x30/+0x34 and wrapper cell size",
      "status": "grounded"
    },
    {
      "field": "object+0x30 / object+0x34",
      "mask": null,
      "consumerVaHex": "0x00416d86 / 0x00419a46",
      "meaning": "16.16-like scale/anchor factors used only in scaled/centered branches",
      "status": "grounded-as-factor"
    }
  ],
  "directDrawCallClasses": [
    {
      "vaHex": "0x0041769b",
      "method": "Flip",
      "vtableOffsetHex": "0x2c",
      "role": "fullscreen/page-flip presentation",
      "flagSource": "literal 0, 0 arguments",
      "boundary": "presentation only; not sprite transparency"
    },
    {
      "vaHex": "0x00417722",
      "method": "Blt",
      "vtableOffsetHex": "0x14",
      "role": "surface copy/update helper",
      "flagSource": "caller flags OR 0x01000000",
      "boundary": "copy path; transparency depends on caller/global flags, not CNS alone"
    },
    {
      "vaHex": "0x004177d7",
      "method": "BltFast-like",
      "vtableOffsetHex": "0x1c",
      "role": "fast copy/update helper when graphics flag 0x80 is set",
      "flagSource": "caller flags OR 0x10",
      "boundary": "fast path; source color-key request is flag/context state"
    },
    {
      "vaHex": "0x0041784b",
      "method": "Blt",
      "vtableOffsetHex": "0x14",
      "role": "copy/update fallback when graphics flag 0x80 is clear",
      "flagSource": "caller flags OR 0x01000000",
      "boundary": "copy path fallback"
    },
    {
      "vaHex": "0x00417938",
      "method": "Blt",
      "vtableOffsetHex": "0x14",
      "role": "surface fill/clear helper",
      "flagSource": "immediate 0x01000400 with DDBLTFX-sized local block",
      "boundary": "fill/clear class; not source sprite transparency"
    },
    {
      "vaHex": "0x00417b4b",
      "method": "Blt",
      "vtableOffsetHex": "0x14",
      "role": "windowed/scaled presentation helper",
      "flagSource": "immediate 0x01000400 with DDBLTFX-sized local block",
      "boundary": "presentation/fill class"
    },
    {
      "vaHex": "0x00417b8a",
      "method": "Blt",
      "vtableOffsetHex": "0x14",
      "role": "windowed/scaled presentation helper",
      "flagSource": "immediate 0x01000400 with DDBLTFX-sized local block",
      "boundary": "presentation/fill class"
    },
    {
      "vaHex": "0x00417bdf",
      "method": "Blt",
      "vtableOffsetHex": "0x14",
      "role": "windowed/scaled presentation helper",
      "flagSource": "immediate 0x01000400 with DDBLTFX-sized local block",
      "boundary": "presentation/fill class"
    },
    {
      "vaHex": "0x00419b4a",
      "method": "Blt",
      "vtableOffsetHex": "0x14",
      "role": "generic wrapper draw, scaled/alternate branch",
      "flagSource": "global 0x004676f8",
      "boundary": "sprite/object draw; exact flag value still depends on init/runtime state"
    },
    {
      "vaHex": "0x00419bc4",
      "method": "BltFast-like",
      "vtableOffsetHex": "0x1c",
      "role": "generic wrapper draw, normal fast branch",
      "flagSource": "global 0x004676f4",
      "boundary": "sprite/object draw; exact flag value still depends on init/runtime state"
    },
    {
      "vaHex": "0x00419bf2",
      "method": "Blt",
      "vtableOffsetHex": "0x14",
      "role": "generic wrapper draw, normal fallback branch",
      "flagSource": "global 0x004676f4",
      "boundary": "sprite/object draw; exact flag value still depends on init/runtime state"
    }
  ],
  "byteEvidence": [
    {
      "vaHex": "0x00416ceb",
      "fileOffsetHex": "0x000160eb",
      "bytes": "8b 45 08 8b 40 28 25 ff ff 00",
      "available": true,
      "label": "active object source id",
      "meaning": "object+0x28 low word is masked to source/frame index"
    },
    {
      "vaHex": "0x00416cf9",
      "fileOffsetHex": "0x000160f9",
      "bytes": "8b 45 08 8b 40 28 c1 e8 10 25 ff 00 00 00 8b",
      "available": true,
      "label": "active object surface slot",
      "meaning": "object+0x28 high word indexes 0x0055abd8 surface-wrapper table"
    },
    {
      "vaHex": "0x00416d79",
      "fileOffsetHex": "0x00016179",
      "bytes": "f7 40 2c 08 02 00 00 0f 84 fd 03 00",
      "available": true,
      "label": "active object scaled branch",
      "meaning": "test object+0x2c against 0x0208; true branch uses alternate/scaled rect handling"
    },
    {
      "vaHex": "0x00416dfd",
      "fileOffsetHex": "0x000161fd",
      "bytes": "f6 40 2d 02 0f 84 af 00 00 00",
      "available": true,
      "label": "centered scale/anchor bit",
      "meaning": "test byte object+0x2d against 0x02 inside the scaled branch"
    },
    {
      "vaHex": "0x0041712d",
      "fileOffsetHex": "0x0001652d",
      "bytes": "8b 45 08 8b 40 2c 83 e0 07 c1 e0 04",
      "available": true,
      "label": "active object clip slot",
      "meaning": "object+0x2c & 0x07 selects a clip/viewport rect from 0x0055ab08 + slot*0x10"
    },
    {
      "vaHex": "0x00419a2a",
      "fileOffsetHex": "0x00018e2a",
      "bytes": "f7 40 2c 08 02 00 00 0f 84 23 01 00",
      "available": true,
      "label": "generic wrapper scaled branch",
      "meaning": "generic grid draw path repeats the object+0x2c 0x0208 branch test"
    },
    {
      "vaHex": "0x00419a3c",
      "fileOffsetHex": "0x00018e3c",
      "bytes": "f6 40 2d 02 0f 84 ae 00 00 00",
      "available": true,
      "label": "generic wrapper centered bit",
      "meaning": "generic grid draw path repeats the object+0x2d 0x02 centered correction test"
    },
    {
      "vaHex": "0x00419af9",
      "fileOffsetHex": "0x00018ef9",
      "bytes": "8b 40 2c 83 e0 07 c1 e0 04 05 08 ab 55 00",
      "available": true,
      "label": "generic scaled clip slot",
      "meaning": "scaled branch uses object+0x2c & 0x07 to select 0x0055ab08 clipping rect"
    },
    {
      "vaHex": "0x00419b5f",
      "fileOffsetHex": "0x00018f5f",
      "bytes": "8b 40 2c 83 e0 07 c1 e0 04 05 08 ab 55 00",
      "available": true,
      "label": "generic normal clip slot",
      "meaning": "normal branch uses object+0x2c & 0x07 to select 0x0055ab08 clipping rect"
    },
    {
      "vaHex": "0x00417722",
      "fileOffsetHex": "0x00016b22",
      "bytes": "ff 50 14 89 45 fc 83 7d",
      "available": true,
      "label": "Blt call",
      "meaning": "copy/update helper calls vtable +0x14 after OR-ing caller flags with 0x01000000"
    },
    {
      "vaHex": "0x004177d7",
      "fileOffsetHex": "0x00016bd7",
      "bytes": "ff 50 1c 89 45 fc e9 6f",
      "available": true,
      "label": "BltFast-like call",
      "meaning": "graphics flag 0x80 path calls vtable +0x1c after OR-ing caller flags with 0x10"
    },
    {
      "vaHex": "0x0041784b",
      "fileOffsetHex": "0x00016c4b",
      "bytes": "ff 50 14 89 45 fc 83 7d",
      "available": true,
      "label": "Blt fallback call",
      "meaning": "non-0x80 copy/update path calls vtable +0x14 after OR-ing caller flags with 0x01000000"
    },
    {
      "vaHex": "0x0041790e",
      "fileOffsetHex": "0x00016d0e",
      "bytes": "68 00 04 00 01 6a 00 6a 00 8b 45 0c",
      "available": true,
      "label": "fill flags immediate",
      "meaning": "pushes 0x01000400 with a DDBLTFX-sized local block before Blt"
    },
    {
      "vaHex": "0x00417938",
      "fileOffsetHex": "0x00016d38",
      "bytes": "ff 50 14 89 45 88 83 7d",
      "available": true,
      "label": "fill Blt call",
      "meaning": "surface fill/clear helper calls vtable +0x14"
    },
    {
      "vaHex": "0x00419b29",
      "fileOffsetHex": "0x00018f29",
      "bytes": "a1 f8 76 46 00 50 8d 45 e4 50 8b 45 08 8b 00 50",
      "available": true,
      "label": "scaled branch Blt flags global",
      "meaning": "scaled branch loads flags from 0x004676f8 before Blt"
    },
    {
      "vaHex": "0x00419ba0",
      "fileOffsetHex": "0x00018fa0",
      "bytes": "8d 45 e4 50 8b 45 08 8b 00 50 8b 45 10 8b 40 04",
      "available": true,
      "label": "normal branch BltFast flags global",
      "meaning": "fast branch loads flags from 0x004676f4 before vtable +0x1c call"
    },
    {
      "vaHex": "0x00419bd1",
      "fileOffsetHex": "0x00018fd1",
      "bytes": "a1 f4 76 46 00 50 8d 45 e4 50 8b 45 08 8b 00 50",
      "available": true,
      "label": "normal branch Blt flags global",
      "meaning": "normal Blt branch loads flags from 0x004676f4 before vtable +0x14 call"
    }
  ],
  "verification": {
    "hasExe": true,
    "object2cScaledBranchBytesAvailable": true,
    "object2cGenericBranchBytesAvailable": true,
    "normalBltFlagGlobalGrounded": true,
    "surfaceCopyBltCallGrounded": true,
    "notSimplyTransparencyBit": true
  },
  "modelBoundaries": [
    {
      "area": "object+0x2c",
      "conclusion": "partially decoded draw-control field: low 3 clip-slot bits plus 0x0208 branch flag; not a standalone transparency bit",
      "status": "promoted"
    },
    {
      "area": "DirectDraw flags",
      "conclusion": "call/context state carries copy/fill/source-color-key behavior; exact global values remain init/runtime dependent",
      "status": "partial"
    },
    {
      "area": "CNS transparent pixels",
      "conclusion": "source pixels remain necessary but insufficient; draw call must request source color-key semantics",
      "status": "boundary-fixed"
    }
  ],
  "openQuestions": [
    "Trace initialization/writes for globals 0x004676f4 and 0x004676f8 to name the exact DirectDraw flag set used by sprite/object draws.",
    "Trace the 0x0055ab08 rect table initializer to name clip slot 0..7 semantically.",
    "Confirm whether the vtable +0x1c fast path is the executable's BltFast-compatible slot or a wrapper-specific surface method layout.",
    "Tie individual battle/helper draw records to object+0x2c values when runtime samples or additional static writers are found."
  ]
}
