Skip to content

Commit

Permalink
Merge pull request #475 from b1ackmai1er/master
Browse files Browse the repository at this point in the history
Roll out kbd preinit into cga, gdc and vga driver
  • Loading branch information
wwarthen authored Dec 16, 2024
2 parents 70cc884 + cee3f8a commit 5bb168e
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
Binary file added Source/Fonts/fontcgac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Source/Fonts/fontcgau.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Source/HBIOS/gdc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ KBDENABLE .SET TRUE ; INCLUDE KBD KEYBOARD SUPPORT
; GDC DRIVER - INITIALIZATION
;======================================================================
;
GDC_PREINIT:
LD IY,GDC_IDAT ; POINTER TO INSTANCE DATA
JP KBD_PREINIT ; INITIALIZE KEYBOARD
; RET

GDC_INIT:
LD IY,GDC_IDAT ; POINTER TO INSTANCE DATA
Expand Down
12 changes: 6 additions & 6 deletions Source/HBIOS/hbios.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3885,6 +3885,12 @@ HB_PCINITTBL:
#IF (UFENABLE)
.DW UF_PREINIT
#ENDIF
#IF (VGAENABLE)
.DW VGA_PREINIT
#ENDIF
#IF (GDCENABLE)
.DW GDC_PREINIT
#ENDIF
#IF (TMSENABLE)
.DW TMS_PREINIT
#ENDIF
Expand Down Expand Up @@ -5315,12 +5321,6 @@ SYS_RESWARM:
; RESTART SYSTEM AS THOUGH POWER HAD JUST BEEN TURNED ON
;
SYS_RESCOLD:
;
; TURN OFF SPURIOUS INTERRUPT SOURCES
;
;;;#IF ((INTMODE == 2) & KBDINTS))
;;; CALL KBD_DEINIT
;;;#ENDIF
#IFDEF APPBOOT
JP HB_RESTART
#ELSE
Expand Down
15 changes: 7 additions & 8 deletions Source/HBIOS/kbd.asm
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ KBD_CON_IOF .EQU $20 ; XLAT DISABLED, MOUSE DISABLED, NO INTS
; KEYBOARD PRE-INITIALIZATION
;__________________________________________________________________________________________________
;
; TO BE CALLED PRIOR TO INITERRUPTS BEING ENABLED
; TO BE CALLED PRIOR TO INTERRUPTS BEING ENABLED
; MUST BE CALLED FROM VIDEO DRIVER PREINIT WITH IY SET
; THIS PREVENTS INTRERRUPT ISSUES IF 8242 HAS INTERRUPTS ENABLED
; THIS PREVENTS INTERRUPT ISSUES IF 8242 HAS INTERRUPTS ENABLED
;
; AT STARTUP. NOT USING IT FOR NOW BECAUSE IT IS NOT A PROBLEM IF
; YOU DON'T USE THE KEYBOARD DURING BOOT.
Expand Down Expand Up @@ -156,11 +156,11 @@ KBD_INIT:
CP KBDMODE_VRC ; VRC?
JR Z,KBD_INIT1 ; IF SO, MUST ASSUME PRESENT
;
HB_DI ; DISABLE INTERRUPTS WHILE WE PROBE
; HB_DI ; DISABLE INTERRUPTS WHILE WE PROBE
LD A,KBD_CON_CST ; CONTROLLER SELF TEST
CALL KBD_PUTCMD ; SEND IT
CALL KBD_GETDATA_P ; CONTROLLER SHOULD RESPOND WITH $55 (ACK)
HB_EI ; RESTORE INTERRUPTS
; HB_EI ; RESTORE INTERRUPTS
;
CP $55 ; IS IT THERE?
JR Z,KBD_INIT1 ; IF SO, CONTINUE
Expand Down Expand Up @@ -386,15 +386,14 @@ KBD_RESET:
LD A,$FF ; RESET COMMAND
CALL KBD_PUTDATA ; SEND IT
CALL KBD_GETDATA ; GET THE ACK
LD B,0 ; SETUP LOOP COUNTER
LD B,KBD_WAITTO ; SETUP LOOP COUNTER
KBD_RESET0:
PUSH BC ; PRESERVE COUNTER
CALL KBD_GETDATA ; TRY TO GET THE RESPONSE
POP BC ; RECOVER COUNTER
JR NZ,KBD_RESET1 ; GOT A BYTE? IF SO, GET OUT OF LOOP
DJNZ KBD_RESET0 ; LOOP TILL COUNTER EXHAUSTED
KBD_RESET1:
; LD A,B
XOR A ; SIGNAL SUCCESS (RESPONSE IS IGNORED...)
RET ; DONE
;
Expand Down Expand Up @@ -549,8 +548,8 @@ KBD_DEC1: ; PROCESS NEXT SCANCODE
RET Z ; NO KEY READY, RETURN WITH A=0, Z SET
LD (KBD_SCANCODE),A ; SAVE SCANCODE

KBD_DEC2: ; DETECT AND HANDLE SPECIAL KEYCODES
LD A,(KBD_SCANCODE) ; GET THE CURRENT SCANCODE
;KBD_DEC2: ; DETECT AND HANDLE SPECIAL KEYCODES
; LD A,(KBD_SCANCODE) ; GET THE CURRENT SCANCODE
CP $AA ; KEYBOARD INSERTION?
JR NZ,KBD_DEC3 ; NOPE, BYPASS
CALL LDELAY ; WAIT A BIT
Expand Down
2 changes: 1 addition & 1 deletion Source/HBIOS/prp.asm
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ PRPSD_TYPESDXC .EQU 4 ; SDXC CARD (V3)
PRPSD_STOK .EQU 0 ; OK
PRPSD_STINVUNIT .EQU -1 ; INVALID UNIT
PRPSD_STRDYTO .EQU -2 ; TIMEOUT WAITING FOR CARD TO BE READY
PRPSD_STINITTO .EQU -3 ; INITIALIZATOIN TIMEOUT
PRPSD_STINITTO .EQU -3 ; INITIALIZATION TIMEOUT
PRPSD_STCMDTO .EQU -4 ; TIMEOUT WAITING FOR COMMAND RESPONSE
PRPSD_STCMDERR .EQU -5 ; COMMAND ERROR OCCURRED (REF PRPSD_RC)
PRPSD_STDATAERR .EQU -6 ; DATA ERROR OCCURRED (REF PRPSD_TOK)
Expand Down
13 changes: 2 additions & 11 deletions Source/HBIOS/ps2iface.inc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ KBDQPUTX .DB 0 ; QUEUE INDEX
; .DB $55 ; GUARD BYTE FOR DEBUGGING ; NOTE THAT SCAN CODES ARE BEING
KBDQ .FILL KBDQSIZ,0 ; CIRCULAR KEYBOARD BUFFER ; BUFFERED. ONE KEY PRESS CAN
; .DB $AA ; GUARD BYTE FOR DEBUGGING ; GENERATE SEVERAL SCAN CODES

;
;__________________________________________________________________________________________________
; RESET THE QUEUE TO EMPTY
;__________________________________________________________________________________________________
Expand Down Expand Up @@ -58,17 +58,8 @@ KBD_INT:
; CALL KBDQDBG
;
RET
;;;;__________________________________________________________________________________________________
;;;; KEYBOARD DEINITIALIZATION
;;;;__________________________________________________________________________________________________
;;;;
;;;KBD_DEINIT:
;;; LD IY,(KBD_IDAT) ; SETUP PORT POINTER
;;; LD A,KBD_CON_WCR ; LOAD WRITE COMMAND
;;; CALL KBD_CMDOUT ; WRITE IT
;;; LD A,KBD_CON_IOF ; LOAD DISABLE INTERRUPTS CFG
;;; JP KBD_DTAOUT ; WRITE IT
#ENDIF
;
;__________________________________________________________________________________________________
; KEYBOARD READ
;__________________________________________________________________________________________________
Expand Down
5 changes: 5 additions & 0 deletions Source/HBIOS/vga.asm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ KBDENABLE .SET TRUE ; INCLUDE KBD KEYBOARD SUPPORT
; VGA DRIVER - INITIALIZATION
;======================================================================
;
VGA_PREINIT:
LD IY,VGA_IDAT ; POINTER TO INSTANCE DATA
JP KBD_PREINIT ; INITIALIZE KEYBOARD
; RET
;
VGA_INIT:
LD IY,VGA_IDAT ; POINTER TO INSTANCE DATA
;
Expand Down

0 comments on commit 5bb168e

Please sign in to comment.