BITS 16
CPU 8086
%include "turbopas.mac"
%define stickLimit 0x8000
segment CODE
extern stick0x, stick0y, stick1x, stick1y, stickMask
; procedure stickUpdate;
pProcedure stickUpdate
mov dx, 0x201
mov cx, stickLimit
xor ax, ax
mov bx, ax
mov di, ax
mov si, ax
mov ah, [stickMask]
push bp
mov bp, bx
cli
; using SP for zero inside the loop increases speed ~20 clocks per loop
mov es, sp
mov sp, bx
out dx, al
.loop:
in al, dx
and al, ah
ror al, 1
adc bx, sp
ror al, 1
adc di, sp
ror al, 1
adc si, sp
ror al, 1
adc bp, sp
or al, al
loopnz .loop
mov sp, es
sti
mov [stick0x], bx
mov [stick0y], di
mov [stick1x], si
mov [stick1y], bp
pop bp
retf
%macro asmButton 1
mov dx, 0x201
in al, dx
and al, %1
xor al, %1
retf
%endmacro
; function button0a:boolean;
pProcedure button0a
asmButton 0x10
; function button0b:boolean;
pProcedure button0b
asmButton 0x20
; function button1a:boolean;
pProcedure button1a
asmButton 0x40
; function button1b:boolean;
pProcedure button1b
asmButton 0x80
GHiero wrote:I have a bug to report, the current 1.6 will always choose Adlib sound over Tandy/PCjr. sound, even if the /tandySound switch is used. Not quite as relevant to the PCjr. (unless you have a GameMaster sidecar) as to the Tandy, but still.
Users browsing this forum: No registered users and 7 guests