Files
gw-basic-2026/include
Eremey Valetov 54e5ecd6ec Use far heap for TUI screen buffer on 16-bit DOS
The 4KB screen buffer (80x25x2 bytes) was allocated from near heap via
calloc(), which exhausted the 64KB data segment on 16-bit DOS. Now uses
_fcalloc()/_ffree() from OpenWatcom's far heap on 16-bit, keeping the
buffer outside DGROUP.

The TUI now works fully on 16-bit FreeDOS: full-screen editor, F-key
bar, cursor positioning, and scroll -- all via BIOS INT 10h through the
DOS HAL, with the screen buffer in far memory.

Changes:
- tui.h: GW_FAR macro (expands to __far on 16-bit, nothing elsewhere),
  tui.screen declared as tui_cell_t GW_FAR *
- tui.c: _fcalloc/_ffree for 16-bit, _fmemmove for scroll_up()
- TUI_CELL() macro works unchanged (far pointer dereference is
  transparent)
2026-04-10 14:37:10 -04:00
..