mirror of https://github.com/FDOS/kernel.git
Repair arrow keys for console.asm + fixes for Turbo C
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@605 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
4c88863f24
commit
7bc5f8b31e
|
@ -47,8 +47,8 @@ static BYTE *date_hRcsId =
|
||||||
|
|
||||||
#define REVISION_MAJOR 1
|
#define REVISION_MAJOR 1
|
||||||
#define REVISION_MINOR 1
|
#define REVISION_MINOR 1
|
||||||
#define REVISION_SEQ 29
|
#define REVISION_SEQ 30
|
||||||
#define BUILD "2029"
|
#define BUILD "2030"
|
||||||
#define SUB_BUILD ""
|
#define SUB_BUILD ""
|
||||||
#define KERNEL_VERSION_STRING "1.1.29" /*#REVISION_MAJOR "." #REVISION_MINOR "." #REVISION_SEQ */
|
#define KERNEL_VERSION_STRING "1.1.30" /*#REVISION_MAJOR "." #REVISION_MINOR "." #REVISION_SEQ */
|
||||||
#define KERNEL_BUILD_STRING "2029" /*#BUILD SUB_BUILD */
|
#define KERNEL_BUILD_STRING "2030" /*#BUILD SUB_BUILD */
|
||||||
|
|
|
@ -106,6 +106,26 @@ ConRead2:
|
||||||
jmp _IOExit
|
jmp _IOExit
|
||||||
|
|
||||||
|
|
||||||
|
checkkey:
|
||||||
|
mov ah,1
|
||||||
|
add ah,[cs:kbdType]
|
||||||
|
int 16h ; Get status, if zf=0 al=char
|
||||||
|
jz keydone ; Jump if no char available
|
||||||
|
checke0: cmp al,0xe0 ; must check for 0xe0 scan code
|
||||||
|
jne .ret
|
||||||
|
cmp ax,0x00e0 ; check for Greek alpha
|
||||||
|
je .ret
|
||||||
|
mov al,0
|
||||||
|
.ret: retn
|
||||||
|
|
||||||
|
readkey:
|
||||||
|
mov ah,[cs:kbdType]
|
||||||
|
int 16h
|
||||||
|
jmp short checke0
|
||||||
|
|
||||||
|
keydone: pop cx
|
||||||
|
jmp _IODone
|
||||||
|
|
||||||
;
|
;
|
||||||
; Name:
|
; Name:
|
||||||
; KbdRdChar
|
; KbdRdChar
|
||||||
|
@ -129,8 +149,7 @@ KbdRdChar:
|
||||||
; and previous is erased in any case
|
; and previous is erased in any case
|
||||||
or al,al ; Test to see if it was set
|
or al,al ; Test to see if it was set
|
||||||
jnz KbdRdRtn ; Exit if it was, returning it
|
jnz KbdRdRtn ; Exit if it was, returning it
|
||||||
mov ah, [cs:kbdType]
|
call readkey ; get keybd char in al, ah=scan
|
||||||
int 16h ; get keybd char in al, ah=scan
|
|
||||||
or ax,ax ; Zero ?
|
or ax,ax ; Zero ?
|
||||||
jz KbdRdChar ; Loop if it is
|
jz KbdRdChar ; Loop if it is
|
||||||
cmp ax,CTL_PRT_SCREEN ; Ctrl-Print screen?
|
cmp ax,CTL_PRT_SCREEN ; Ctrl-Print screen?
|
||||||
|
@ -143,22 +162,16 @@ KbdRd1:
|
||||||
KbdRdRtn:
|
KbdRdRtn:
|
||||||
retn
|
retn
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
global CommonNdRdExit
|
global CommonNdRdExit
|
||||||
CommonNdRdExit: ; *** tell if key waiting and return its ASCII if yes
|
CommonNdRdExit: ; *** tell if key waiting and return its ASCII if yes
|
||||||
mov al,[cs:uScanCode] ; Test for last scan code
|
mov al,[cs:uScanCode] ; Test for last scan code
|
||||||
; now AL is set if previous key was extended,
|
; now AL is set if previous key was extended,
|
||||||
or al,al ; Was it zero ?
|
or al,al ; Was it zero ?
|
||||||
jnz ConNdRd2 ; Jump if there's a char waiting
|
jnz ConNdRd2 ; Jump if there's a char waiting
|
||||||
mov ah,1
|
call checkkey
|
||||||
add ah,[cs:kbdType]
|
|
||||||
int 16h ; Get status, if zf=0 al=char
|
|
||||||
jz ConNdRd4 ; Jump if no char available
|
|
||||||
or ax,ax ; Zero ?
|
or ax,ax ; Zero ?
|
||||||
jnz ConNdRd1 ; Jump if not zero
|
jnz ConNdRd1 ; Jump if not zero
|
||||||
mov ah,[cs:kbdType]
|
call readkey
|
||||||
int 16h ; get status, if zf=0 al=char
|
|
||||||
jmp short CommonNdRdExit
|
jmp short CommonNdRdExit
|
||||||
; if char was there but 0, fetch and retry...
|
; if char was there but 0, fetch and retry...
|
||||||
; (why do we check uScanCode here?)
|
; (why do we check uScanCode here?)
|
||||||
|
@ -196,8 +209,7 @@ KbdInpCh1:
|
||||||
int 16h ; get status, if zf=0 al=char
|
int 16h ; get status, if zf=0 al=char
|
||||||
jz KbdInpRtnZero ; Jump if zero
|
jz KbdInpRtnZero ; Jump if zero
|
||||||
; returns 0 or the last key that was waiting in AL
|
; returns 0 or the last key that was waiting in AL
|
||||||
mov ah,[cs:kbdType]
|
call readkey
|
||||||
int 16h ; get keybd char in al, ah=scan
|
|
||||||
jmp short KbdInpCh1
|
jmp short KbdInpCh1
|
||||||
; just read any key that is waiting, then check if
|
; just read any key that is waiting, then check if
|
||||||
; more keys are waiting. if not, return AL of this
|
; more keys are waiting. if not, return AL of this
|
||||||
|
@ -270,17 +282,11 @@ ConInStat:
|
||||||
or al,al ; Was it zero ?
|
or al,al ; Was it zero ?
|
||||||
jnz ConCharReady ; Jump if there's a char waiting
|
jnz ConCharReady ; Jump if there's a char waiting
|
||||||
; return previously cached ext char if any
|
; return previously cached ext char if any
|
||||||
mov ah,1
|
call checkkey
|
||||||
add ah,[cs:kbdType]
|
|
||||||
int 16h ; get status, if zf=0 al=char
|
|
||||||
jz ConNoChar ; Jump if zero
|
|
||||||
; if no key waiting, return AL=0 / "none waiting"
|
|
||||||
|
|
||||||
or ax,ax ; Zero ?
|
or ax,ax ; Zero ?
|
||||||
jnz ConIS1 ; Jump if not zero
|
jnz ConIS1 ; Jump if not zero
|
||||||
; if non-zero key waiting, take it
|
; if non-zero key waiting, take it
|
||||||
mov ah,[cs:kbdType]
|
call readkey
|
||||||
int 16h ; get status, if zf=0 al=char
|
|
||||||
jmp short ConInStat
|
jmp short ConInStat
|
||||||
; if zero key was waiting, fetch 2nd part etc. (???)
|
; if zero key was waiting, fetch 2nd part etc. (???)
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "portab.h"
|
#include "portab.h"
|
||||||
#include "init-mod.h"
|
#include "init-mod.h"
|
||||||
#include "init-dat.h"
|
#include "init-dat.h"
|
||||||
|
#include "lol.h"
|
||||||
|
|
||||||
#ifdef VERSION_STRINGS
|
#ifdef VERSION_STRINGS
|
||||||
static char *RcsId =
|
static char *RcsId =
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "init-mod.h"
|
#include "init-mod.h"
|
||||||
#include "init-dat.h"
|
#include "init-dat.h"
|
||||||
#include "dyndata.h"
|
#include "dyndata.h"
|
||||||
|
#include "lol.h"
|
||||||
#ifdef VERSION_STRINGS
|
#ifdef VERSION_STRINGS
|
||||||
static BYTE *dskRcsId =
|
static BYTE *dskRcsId =
|
||||||
"$Id$";
|
"$Id$";
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include "portab.h"
|
#include "portab.h"
|
||||||
#include "init-mod.h"
|
#include "init-mod.h"
|
||||||
|
#include "lol.h"
|
||||||
|
|
||||||
#ifdef VERSION_STRINGS
|
#ifdef VERSION_STRINGS
|
||||||
static BYTE *RcsId =
|
static BYTE *RcsId =
|
||||||
|
|
|
@ -682,7 +682,7 @@ void CheckContinueBootFromHarddisk(void)
|
||||||
bootedFrom
|
bootedFrom
|
||||||
);
|
);
|
||||||
|
|
||||||
if (GetBiosKey(InitKernelConfig.BootHarddiskSeconds) != -1)
|
if (GetBiosKey(InitKernelConfig.BootHarddiskSeconds) != (UWORD)-1)
|
||||||
{
|
{
|
||||||
/* user has hit a key, continue to boot from floppy/CD */
|
/* user has hit a key, continue to boot from floppy/CD */
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
@ -703,7 +703,7 @@ void CheckContinueBootFromHarddisk(void)
|
||||||
init_call_intr(0x13, &r);
|
init_call_intr(0x13, &r);
|
||||||
|
|
||||||
{
|
{
|
||||||
void (far *reboot)() = (void (far*)()) MK_FP(0x0,0x7c00);
|
void (far *reboot)(void) = (void (far*)(void)) MK_FP(0x0,0x7c00);
|
||||||
|
|
||||||
(*reboot)();
|
(*reboot)();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue