MCPcopy Create free account
hub / github.com/NetHack/NetHack / _resizeOvrBuffer

Function _resizeOvrBuffer

outdated/sys/msdos/ovlinit.c:71–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69void _resizeOvrBuffer(void);
70
71void
72_resizeOvrBuffer()
73{
74 mem_top = (unsigned far *) MK_FP(_psp, 0x02);
75 total = *mem_top - _psp;
76
77 ProgramSize = *(unsigned far *) MK_FP(_psp - 1, 0x03);
78 tmpbuffer = total - ProgramSize - RSRVD_TOTAL / 16;
79 memAlloc = min(MAX_OVRBUF / 16, tmpbuffer);
80 if (tmpbuffer >= MIN_OVRBUF / 16)
81 _ovrbuffer = memAlloc;
82 else {
83 _ovrbuffer = 1;
84 appFail = 1;
85 };
86
87 /*
88 * Remember, when inside this code, nothing has been setup on
89 * the system, so do NOT call any RTL functions for I/O or
90 * anything else that might rely on a startup function. This
91 * includes accessing any global objects as their constructors
92 * have not been called yet.
93 */
94}
95
96#pragma startup _resizeOvrBuffer 0 /* Put function in table */
97

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected