Responsive native drawing and mouse mapping
===========================================

Scope: only ui-work/port1/bilingual/ui/native.asm is owned by this change.
Engine code, caches, full 256-entry histories, allocation arena and process
stack are preserved. Object expansion and title/icon changes are separate.

Geometry
Given inclusive untransformed bounds (left,top,right,bottom), reject inverted
signed intervals and dimensions outside 1..32767. Let W/H be pixel counts.
When W>44 and H>84:
  cell = floor(min(W-44,H-84)/8)
  board = 8*cell
  x = left + floor((W-board)/2)
  y = top + 8 + floor((H-84-board)/2)
The footer starts at top+max(H-50,0). If no positive cell fits, no board can
be selected. Default 300x340 gives cell32, board256, origin22,8 and footer290.
The board is centered in its reserved area; all cells remain exactly square.

The 13 geometry/last-paint words use existing STATE+0x100..0x118 space.
The last private word remains ART_SEG at STATE+0x148. No initialized DGROUP,
arena or process-stack reservation is enlarged by these fields.
BG_COLOR uses the previously unused word at STATE+0x0a..0x0b, between NOTICE
at0x08..0x09 and BOARD at0x40..0x7f. The paint stores the known square color
7 or15 before calling graphics, then reloads it for the edge cleanup below.
It replaces a second identical parity calculation without changing color.

Drawing
The unchanged 32-pixel logical board, existing piece bitmaps and highlight
use native translation followed by equal X/Y scale cell/32. Integer cell
sizes make this an exact 16.16 scale. GrSetNullTransform resets the GState
before drawing file/rank labels and the footer at ordinary 10-point size.
No application-owned scaled bitmap, full-board surface or backing store is
allocated. The old kernel's transformed bitmap routine does use transient
scratch storage per piece, freed before returning; this is not zero-allocation
rendering. See API.md for the verified formula and target qualifications.

At native cell43 the supplied 1.2 scaler produced stray final bitmap columns,
including608 yellow pixels absent from all source tiles. Giving each bitmap
an integer physical origin did not fix it, so that experiment was reverted.
The final renderer repaints only logical cell x27..31,y1..31 in square color
after each bitmap, before selection highlighting. All24 source tile variants
end by bitmap x22 (cell x24); check_artwork_margins.py verifies the blank margin.
Native pixel QA found608 yellow pixels reduced to zero, with22,478 protected
piece-interior pixels unchanged. The cell border and highlight remain intact.

An artwork handle lock is held once for the entire paint. draw_piece saves
DS before selecting the locked bitmap segment and restores it afterward.
The normal exit releases the artwork lock exactly once, clears ART_SEG and
records the last-painted bounds. Tiny views avoid locking artwork at all.

Resize correctness
Before BeginUpdate, expose queries current bounds and compares them with the
last-painted bounds. On change it invalidates the complete viewport using
old WinInvalRect, so retained pixels cannot leave an old-size board behind.
Unchanged exposes keep their ordinary update region. Current hit geometry
is separate from last-painted bounds: a mouse event queued before expose
cannot suppress the needed repaint. No guessed resize-message ID is used.

Mouse mapping
START_SELECT refreshes geometry through a temporary native GState, preserving
incoming coordinates, then rejects margins using half-open board bounds.
Unsigned deltas after subtraction reject points above/left as well as below/
right. Bounded divisions by the positive physical cell size give file/rank;
rank is inverted to preserve a1=0..h8=63. Existing side selection, automatic
queen promotion and keyboard editing/submission are unchanged.

Verified old kernel calls (not modern ordinal assumptions)
  GrGetWinBounds      0x1b8
  GrApplyTranslation  0x136
  GrApplyScale        0x135
  GrSetNullTransform  0x139
  WinInvalRect        0x1e1

The independent 16-bit helper/paint tests cover ordinary, signed, overflowing
and tiny bounds; all-square hits; mouse/keyboard equivalence; balanced state
handles; scaling/reset sequences; and resize invalidation. Graphics and input
routing boundaries in that CPU harness are modeled. Actual native viewport
expansion, transformed pixels, moved-window clicks and memory pressure remain
separate acceptance evidence; do not infer them from helper arithmetic alone.

Native independent4 startup/renderer controls confirm actual628x429 viewport,
344-pixel board and43-pixel cells, with full-size e2-e4 mouse input and engine
reply. Final moved/resized-window, fresh-icon, two-language and pressure tests
belong to the separately hash-bound native acceptance report.

Assembly source SHA256: 56a740b05a201c2b7d645aaee63a959c7dab2f6cc185b966ad97caf1000d3f03
