Hi
@h0ffman
I guess that you can set PORTS int ($68) in proper way If not then give me a sign. Then int routine which I used for example to fix RollingThunder keyboard is
Code:
IntLvlTwoPorts:
movem.l d0-d1/a0-a2,-(a7)
lea _custom,a0
move.w intreqr(a0),d0
btst #INTB_PORTS,d0
beq .end
lea _ciaa,a1
btst #CIAICRB_SP,ciaicr(a1)
beq .end
;read key and store him
move.b ciasdr(a1),d0
or.b #CIACRAF_SPMODE,ciacra(a1)
not.b d0
ror.b #1,d0
spl d1
and.w #$7f,d0
lea keys(pc),a2
move.b d1,(a2,d0.w)
;handshake
moveq #3-1,d1
.wait1 move.b vhposr(a0),d0
.wait2 cmp.b vhposr(a0),d0
beq .wait2
dbf d1,.wait1
;set input mode
and.b #~(CIACRAF_SPMODE),ciacra(a1)
.end move.w #INTF_PORTS,intreq(a0)
tst.w intreqr(a0)
movem.l (a7)+,d0-d1/a0-a2
rte
keys: dcb.b $80,0
and then you can check key 'ESC' in following manner
Code:
KEY_ESC = $45
CheckKeyESC:
lea keys(pc),a0
tst.b KEY_ESC(a0) ;on 68020+ you can do tst.b keys+KEY_ESC(pc) instead of lea and tst
beq .exit
;
;key 'ESC' was pressed, insert some code here
;
.exit rts
For more details, please check WHDLoad dev package and look into keyboard.s file.
Regards