CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

KEYSTRUC.INC (6832B)


      1 ;
      2 ; Copyright 2020 Electronic Arts Inc.
      3 ;
      4 ; TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 
      5 ; software: you can redistribute it and/or modify it under the terms of 
      6 ; the GNU General Public License as published by the Free Software Foundation, 
      7 ; either version 3 of the License, or (at your option) any later version.
      8 
      9 ; TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 ; in the hope that it will be useful, but with permitted additional restrictions 
     11 ; under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 ; distributed with this program. You should have received a copy of the 
     13 ; GNU General Public License along with permitted additional restrictions 
     14 ; with this program. If not, see [https://github.com/electronicarts/CnC_Remastered_Collection]>.
     15 
     16 ;***************************************************************************
     17 ;**   C O N F I D E N T I A L --- W E S T W O O D   A S S O C I A T E S   **
     18 ;***************************************************************************
     19 ;*                                                                         *
     20 ;*                 Project Name : Westwood 32 bit Library                  *
     21 ;*                                                                         *
     22 ;*                    File Name : KEYSTRUC.INC                             *
     23 ;*                                                                         *
     24 ;*                   Programmer : Phil W. Gorrow                           *
     25 ;*                                                                         *
     26 ;*                   Start Date : July 13, 1994                            *
     27 ;*                                                                         *
     28 ;*                  Last Update : July 13, 1994   [PWG]                    *
     29 ;*                                                                         *
     30 ;*-------------------------------------------------------------------------*
     31 ;* Functions:                                                              *
     32 ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     33 
     34 STRUC	KeyboardType
     35 	SoundOn			DW	?	; toggled by alt S
     36 	MusicOn			DW	?	; toggled by alt M
     37 	KeyFlags			DD	?	; all but repeat for now
     38 	Break				DW	?
     39 	KeyMouseMove	DB	6  DUP(?)
     40 	ScreenEdge		DW	18 DUP (?)
     41 	Bits				DB	8  DUP (?)
     42 	CondPassKey		DW	17 DUP (?) 
     43 	CondPassCond	DW	17 DUP (?)
     44 	EscRoutine		DD	?
     45 	ExtCodes			DB	16 DUP (?)
     46 	ExtNums			DB	16 DUP (?)
     47 	ExtRemap			DB	16 DUP (?)
     48 	ExtRemapEnd		DB	?
     49 	ExtKeyboard		DB	?
     50 	KeyBuffer		DW	128 DUP(?) ; set to empty
     51 	KeyBufferHead	DD	?	; set to first entry
     52 	KeyBufferTail	DD	?	; set to head for empty buffer
     53 	KeyLock			DW	?	; num and caps lock bits
     54 	KeyNums			DB	89 DUP (?)
     55 	KeysCapsLock	DB	16 DUP (?)
     56 	KeysNumLock		DB	16 DUP (?)
     57 	KeysUpDown		DB	16 DUP (?)
     58 	KeyStream		DB	16 DUP (?)
     59 	PassCount		DW	?
     60 	KeyStreamIndex	DW	?
     61 	LastKeyE0		DB	?
     62 	LastKeyE1		DB	?
     63 	PassAlways		DB	10 DUP (?)
     64 	PassAlwaysEnd	DB	?		; invalid code to END PassAlways
     65 	CtrlFlags		DB	?
     66 	Buffer			DW	?
     67 	Time				DW	?
     68 	XYAdjust			DB	26 DUP (?)
     69 	EdgeConv			DW	16 DUP (?)
     70 	MouseUpdate		DW	?
     71 	MouseX			DD	?
     72 	LocalMouseX		DW	?
     73 	MouseY			DD	?
     74 	LocalMouseY		DW	?
     75 	IsExtKey			DB	?
     76 	ExtIndex			DW	?
     77 
     78 	KeyOldRMI			DD	?	; The origianl RM interrupt seg:off.
     79 	KeyOldPMIOffset	DD	?	; The origianl PM interrupt offset		
     80 	KeyOldPMISelector	DD	?	; The original PM interrupt segment.
     81 
     82 	KeyCodeOffset			DW	?	; Offset of the code in the RM stuff.
     83 	CallKeyRMIntOffset	DW	?	; Offset of function to call DOS timer interrupt.
     84 	CallKeyRMIntAddr		DD	?	; PM address of CallRealIntOffset for speed.
     85 	PMIssuedKeyInt			DD	?	; did Protected mode pass this through?
     86 
     87 	BrkOldRMI				DD	?	; The origianl RM interrupt seg:off.
     88 	BrkOldPMIOffset		DD	?	; The origianl PM interrupt offset		
     89 	BrkOldPMISelector		DD	?	; The original PM interrupt segment.
     90 
     91 	BrkCodeOffset			DW	?	; Offset of the code in the RM stuff.
     92 	CallBrkRMIntOffset	DW	?	; Offset of function to call DOS timer interrupt.
     93 	CallBrkRMIntAddr		DD	?	; PM address of CallRealIntOffset for speed.
     94 	PMIssuedBrkInt			DD	?	; did Protected mode pass this through?
     95 	KeyIntDisabled			DD	?
     96 
     97 	DbgOldPMIOffset		DD	?	; The origianl PM interrupt offset		
     98 	DbgOldPMISelector		DD	?	; The original PM interrupt segment.
     99 
    100 	;---------------------------------------------------------------------------
    101 	; Begin definition of Mouse Specific Variables for real mode
    102 	;---------------------------------------------------------------------------
    103 	Button				DB	?	; current value of the mouse button
    104 	MDisabled			DB	?	; Is the mouse driver disabled
    105 	MInput				DB	?	; Defaults to mouse input allowed.
    106 	Adjust				DW	?	; flag to adjust coordinates if necessary
    107 	MouseStepX			DW	?	; step values if the mouse moves at
    108 	MouseStepY			DW	?	;   more than one pixel at a time
    109 	MouseOffsetX		DW	?	; Fractional step values used if a mouse
    110 	MouseOffsetY		DW	?	;   moves at less than one pixel at a time
    111 	MState				DD	?	; Tracks if mouse is hidden (TRUE) or not (FALSE)
    112 	MouseXOld     		DW	?	; Holds last MouseX and MouseY to determine if 
    113 	MouseYOld     		DW	?	;   mouse needs to be redrawn
    114 	MCState				DW	?	; Tracks if mouse conditional hidden (TRUE) or not
    115 	MouseCXLeft			DD	?	; Conditional hide mouse left x position
    116 	MouseCYUpper		DD	?	; Conditional hide mouse top y position
    117 	MouseCXRight		DD	?	; Conditional hide mouse right x position
    118 	MouseCYLower		DD	?	; Conditional hide mouse lower y position
    119 	MouseCursor   		DD	?	; Pointer to the mouse cursor to draw
    120 	MouseCursorSize	DW	?	; Size of mouse cursor draw area
    121 	MouseBuffer   		DD	?	; Pointer to buffer mouse is saved in
    122 	MouseXHot     		DD	?	; Offset to mouse's x hot spot
    123 	MouseYHot     		DD	?	; Offset to mouse's y hot spot
    124 	MouseBuffX			DD	?	; X position background was saved at
    125 	MouseBuffY			DD	?	; Y position background was saved at
    126 	MouseBuffW			DD	?	; Width of the region saved for mouse
    127 	MouseBuffH			DD	?	; Height of the region saved for mouse
    128 	MouseWidth			DD	?	; Mouse cursor theoretical width
    129 	MouseHeight			DD	?	; Mouse cursor theoretical height
    130 	MouseCodeOffset	DW	?	; Offset to the real mode code offset
    131 	MouseRight			DD	?	; Right hand side of the screen
    132 	MouseBottom			DD	?	; Bottom of the screen
    133 
    134 
    135 	ShadowPtr			dw	?
    136 	DrawMousePtr 		dw	?
    137 
    138 	VGAMouseDraw		dw	?
    139 	VGAMouseShadow		dw	?
    140 
    141 	VESAMouseDraw		dw	?
    142 	VESAMouseShadow	dw	?
    143 
    144 	VesaPtr				dd ?	
    145 	VesaBankTable	   DD	8 dup (?)
    146 	Adjust_XPos			dd ?
    147 	Adjust_YPos			dd ?
    148 
    149 
    150 ENDS
    151 
    152 ; InitFlags that are set to have a fully functional interrupt.
    153 IF_ALLOC_RM			equ	1		; Allocation of RM was successful.
    154 IF_SET_VECTORS		equ	2		; Vectors have been set.
    155 IF_LOCKED_PM_CODE	equ	4		; Locked PM code for DPMI.
    156 IF_LOCKED_PM_DATA	equ	8		; Locked PM code for DPMI.
    157 IF_RATE_CHANGE		equ	10		; Timer rate was changed.
    158 IF_FUNCTIONAL		equ	20		; Timer is in and functional.
    159 IF_LOCKED_RM_CODE	equ	40