From 31bc1f61496191e006b93cdb1f3537832cc04ae1 Mon Sep 17 00:00:00 2001 From: Eric Auer Date: Sun, 1 Jun 2008 22:44:19 +0000 Subject: [PATCH] Added support for BUFFERSHIGH as alias to BUFFERS: No new code but useful for people who are used to writing HIGH everywhere. Thanks to Christian Wallbaum the hint that config.txt had both. Removed code which called int 16.1 in a loop before 16.0 - this would only be useful if you invoke HLT before each int 16.1 ... git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1366 6ac86273-5f31-0410-b378-82cca8765d1b --- docs/config.txt | 4 +++- kernel/config.c | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/config.txt b/docs/config.txt index dc7c7ed..87c525b 100644 --- a/docs/config.txt +++ b/docs/config.txt @@ -45,7 +45,9 @@ space will be used for further buffers until something else allocates the HMA space for something else. Even then, at least nn buffers will always be available. You can set nn to a negative value to disable the use of unused HMA space: BUFFERS=-10 only uses 10 buffers, further -free space in the HMA will just stay unused. +free space in the HMA will just stay unused. Because the buffers can +use the HMA anyway, BUFFERSHIGH does the same as BUFFERS for now, but +shows a note about that to inform the user that it does not use UMB. Example: buffers=20 COUNTRY diff --git a/kernel/config.c b/kernel/config.c index 9d76d5e..766c92c 100644 --- a/kernel/config.c +++ b/kernel/config.c @@ -172,6 +172,7 @@ UCOUNT Menus BSS_INIT(0); STATIC VOID CfgMenuColor(BYTE * pLine); STATIC VOID Config_Buffers(BYTE * pLine); +STATIC VOID CfgBuffersHigh(BYTE * pLine); STATIC VOID sysScreenMode(BYTE * pLine); STATIC VOID sysVersion(BYTE * pLine); STATIC VOID CfgBreak(BYTE * pLine); @@ -271,6 +272,7 @@ STATIC struct table commands[] = { {"BREAK", 1, CfgBreak}, {"BUFFERS", 1, Config_Buffers}, + {"BUFFERSHIGH", 1, CfgBuffersHigh}, /* as BUFFERS - we use HMA anyway */ {"COMMAND", 1, InitPgm}, {"COUNTRY", 1, Country}, {"DOS", 1, Dosmem}, @@ -757,6 +759,7 @@ UWORD GetBiosKey(int timeout) { do { + /* optionally HLT here - timer will IRQ even if no keypress */ r.a.x = 0x0100; /* are there keys available ? */ init_call_intr(0x16, &r); if (!(r.flags & FLG_ZERO)) { @@ -769,10 +772,13 @@ UWORD GetBiosKey(int timeout) } /* blocking wait (timeout < 0): fetch it */ +#if 0 do { + /* optionally HLT here */ r.a.x = 0x0100; init_call_intr(0x16, &r); } while (r.flags & FLG_ZERO); +#endif r.a.x = 0x0000; init_call_intr(0x16, &r); return r.a.x; @@ -918,6 +924,12 @@ STATIC void Config_Buffers(BYTE * pLine) Config.cfgBuffers = nBuffers; } +STATIC void CfgBuffersHigh(BYTE * pLine) +{ + Config_Buffers(pLine); + printf("Note: BUFFERS will be in HMA or low RAM, not in UMB\n"); +} + /** Set screen mode - rewritten to use init_call_intr() by RE / ICD */