2018-09-11 17:34:19 +00:00
|
|
|
; TH05 insists on only updating the affected byte, so...
|
|
|
|
if GAME eq 4
|
|
|
|
OR_INPUT_LOW macro value
|
2019-11-30 15:15:03 +00:00
|
|
|
or _key_det, value
|
2018-09-11 17:34:19 +00:00
|
|
|
endm
|
|
|
|
OR_INPUT_HIGH macro value
|
2019-11-30 15:15:03 +00:00
|
|
|
or _key_det, value
|
2018-09-11 17:34:19 +00:00
|
|
|
endm
|
|
|
|
else
|
|
|
|
OR_INPUT_LOW macro value
|
2019-11-30 15:15:03 +00:00
|
|
|
or _key_det.lo, low value
|
2018-09-11 17:34:19 +00:00
|
|
|
endm
|
|
|
|
OR_INPUT_HIGH macro value
|
2019-11-30 15:15:03 +00:00
|
|
|
or _key_det.hi, high value
|
2018-09-11 17:34:19 +00:00
|
|
|
endm
|
|
|
|
endif
|
|
|
|
|
2019-11-30 14:48:36 +00:00
|
|
|
public _input_reset_sense
|
2018-09-11 17:34:19 +00:00
|
|
|
_input_reset_sense label proc
|
|
|
|
xor ax, ax
|
2019-11-30 15:15:03 +00:00
|
|
|
mov _key_det, ax
|
2018-09-11 17:34:19 +00:00
|
|
|
mov js_stat, ax
|
|
|
|
|
2019-11-30 14:48:36 +00:00
|
|
|
public _input_sense
|
2018-09-11 17:34:19 +00:00
|
|
|
_input_sense proc far
|
|
|
|
xor ax, ax
|
|
|
|
mov es, ax
|
|
|
|
mov ah, byte ptr es:[531h]
|
|
|
|
test ah, 4
|
|
|
|
jz short @@down?
|
|
|
|
OR_INPUT_LOW INPUT_UP
|
|
|
|
|
|
|
|
@@down?:
|
|
|
|
test ah, 20h
|
|
|
|
jz short @@left?
|
|
|
|
OR_INPUT_LOW INPUT_DOWN
|
|
|
|
|
|
|
|
@@left?:
|
|
|
|
test ah, 8
|
|
|
|
jz short @@right?
|
|
|
|
OR_INPUT_LOW INPUT_LEFT
|
|
|
|
|
|
|
|
@@right?:
|
|
|
|
test ah, 10h
|
|
|
|
jz short @@num6?
|
|
|
|
OR_INPUT_LOW INPUT_RIGHT
|
|
|
|
|
|
|
|
@@num6?:
|
|
|
|
mov ah, byte ptr es:[533h]
|
|
|
|
test ah, 1
|
|
|
|
jz short @@num1?
|
|
|
|
OR_INPUT_LOW INPUT_RIGHT
|
|
|
|
|
|
|
|
@@num1?:
|
|
|
|
test ah, 4
|
|
|
|
jz short @@num2?
|
|
|
|
OR_INPUT_HIGH INPUT_DOWN_LEFT
|
|
|
|
|
|
|
|
@@num2?:
|
|
|
|
test ah, 8
|
|
|
|
jz short @@num3?
|
|
|
|
OR_INPUT_LOW INPUT_DOWN
|
|
|
|
|
|
|
|
@@num3?:
|
|
|
|
test ah, 10h
|
|
|
|
jz short @@num4?
|
|
|
|
OR_INPUT_HIGH INPUT_DOWN_RIGHT
|
|
|
|
|
|
|
|
@@num4?:
|
|
|
|
mov ah, byte ptr es:[532h]
|
|
|
|
test ah, 40h
|
|
|
|
jz short @@num7?
|
|
|
|
OR_INPUT_LOW INPUT_LEFT
|
|
|
|
|
|
|
|
@@num7?:
|
|
|
|
test ah, 4
|
|
|
|
jz short @@num8?
|
|
|
|
OR_INPUT_HIGH INPUT_UP_LEFT
|
|
|
|
|
|
|
|
@@num8?:
|
|
|
|
test ah, 8
|
|
|
|
jz short @@num9?
|
|
|
|
OR_INPUT_LOW INPUT_UP
|
|
|
|
|
|
|
|
@@num9?:
|
|
|
|
test ah, 10h
|
|
|
|
jz short @@z?
|
|
|
|
OR_INPUT_HIGH INPUT_UP_RIGHT
|
|
|
|
|
|
|
|
@@z?:
|
|
|
|
mov ah, byte ptr es:[52Fh]
|
|
|
|
test ah, 2
|
|
|
|
jz short @@x?
|
|
|
|
OR_INPUT_LOW INPUT_SHOT
|
|
|
|
|
|
|
|
@@x?:
|
|
|
|
test ah, 4
|
|
|
|
jz short @@q?
|
|
|
|
OR_INPUT_LOW INPUT_BOMB
|
|
|
|
|
|
|
|
@@q?:
|
|
|
|
mov ah, byte ptr es:[52Ch]
|
|
|
|
test ah, 1
|
|
|
|
jz short @@esc?
|
|
|
|
OR_INPUT_HIGH INPUT_Q
|
|
|
|
|
|
|
|
@@esc?:
|
|
|
|
mov ah, byte ptr es:[52Ah]
|
|
|
|
test ah, 1
|
|
|
|
jz short @@return?
|
|
|
|
OR_INPUT_HIGH INPUT_CANCEL
|
|
|
|
|
|
|
|
@@return?:
|
|
|
|
mov ah, byte ptr es:[52Dh]
|
|
|
|
test ah, 10h
|
|
|
|
jz short @@space?
|
|
|
|
OR_INPUT_HIGH INPUT_OK
|
|
|
|
|
|
|
|
@@space?:
|
|
|
|
mov ah, byte ptr es:[530h]
|
|
|
|
test ah, 10h
|
|
|
|
jz short @@shift?
|
|
|
|
OR_INPUT_LOW INPUT_SHOT
|
|
|
|
|
|
|
|
@@shift?:
|
|
|
|
mov ah, 2
|
|
|
|
int 18h
|
|
|
|
and al, 1
|
2019-11-30 15:15:03 +00:00
|
|
|
mov _shiftkey, al
|
2018-09-11 17:34:19 +00:00
|
|
|
cmp js_bexist, 0
|
|
|
|
jz short @@ret
|
|
|
|
call js_sense
|
2019-11-30 15:15:03 +00:00
|
|
|
or _key_det, ax
|
2018-09-11 17:34:19 +00:00
|
|
|
|
|
|
|
@@ret:
|
|
|
|
if GAME eq 5
|
2019-11-30 15:15:03 +00:00
|
|
|
mov ax, _key_det
|
2018-09-11 17:34:19 +00:00
|
|
|
endif
|
|
|
|
retf
|
|
|
|
_input_sense endp
|
|
|
|
even
|