diff --git a/bin/sprinter-cc b/bin/sprinter-cc index 45e1e22..c015294 100755 --- a/bin/sprinter-cc +++ b/bin/sprinter-cc @@ -40,11 +40,16 @@ # --constseg W3CODE (writable statics stay in W2). In huge # the resident page SHARES W3 with trampoline banks: crt0 # captures/restores it (W3_RESIDENT), mkexe gets -W. -# Rules: W3 code must NOT switch the W3 page; W1/W2 code that -# swaps W3 to another page must restore it; no writable data -# belongs in W3 (code + rodata only). From a __banked -# context the resident W3 code is unreachable (but resident -# -> __banked via the W1 trampoline is fine). +# Rules: W3 code must NOT switch the W3 page — this includes +# opening a graphics batch bracket itself (_bgi_begin/_bgi_end +# map the video bank via the SAME port 0xE2; doing that from +# W3 code executes from video RAM -> white screen). Calling +# HOME graphics primitives is fine: they open and close the +# bracket internally and restore the page before returning. +# W1/W2 code that swaps W3 to another page must restore it; +# no writable data belongs in W3 (code + rodata only). From a +# __banked context the resident W3 code is unreachable (but +# resident -> __banked via the W1 trampoline is fine). # --mkexe FLAG extra mkexe flag (repeatable; e.g. --mkexe -p --mkexe 0) # --max-allocs N SDCC --max-allocs-per-node (default: 100000 — smaller/ # faster code at the cost of compile time; pass a lower @@ -154,7 +159,12 @@ done # W3-модули едут в область W3CODE @0xC000 и вызываются напрямую (без # трамплинов). Работает поверх small-лейаута: main-код с 0x4100 (W1/W2), # W3 свободно, DSS маппит все страницы образа сам (проверено tests/w3probe). -# --w3 подразумевает small; с huge несовместим (там W3 занят банками). +# --w3 подразумевает small ПО УМОЛЧАНИЮ, но поддержан во всех режимах +# tiny|small|big|huge. В huge резидент ДЕЛИТ окно W3 с трамплин-банками +# (порт 0xE2): crt0_banked запоминает резидентную страницу и возвращает её +# дефолтом после загрузки банков, а трамплин bank.s сохраняет/восстанавливает +# W3 на каждый __banked вызов (см. W3_RESIDENT ниже). Следствие: резидент -> +# __banked работает, обратное — НЕТ (из банка резидентной страницы в W3 нет). if [[ ${#W3_SPECS[@]} -gt 0 ]]; then [[ -z "$USER_SET_MEMORY" ]] && MEMORY_MODE="small" # --w3 → small по умолчанию case "$MEMORY_MODE" in