[A83] Re: Direct Input...


[Prev][Next][Index][Thread]

[A83] Re: Direct Input...




I don't reset the key port, and the program works fine!

=TI-83- prgm!!
groupnumber equ 8265h ;=saferam1
keyvalue equ 8266h    ;=saferam1+1
.org 9327h
	ld hl,text
	call _puts
	call _newline

direct:
  ld a,0feh 			;Enable group 1.
  out (1),a
  in a,(1) 			;'Required Syntax'
  ld (keyvalue),a
  ld a,1
  ld (groupnumber),a
  call validcheck

  ld a,0fdh 			;Enable group 2.
  out (1),a
  in a,(1)
  ld (keyvalue),a
  cp 191
  jp z,stop
  ld a,2
  ld (groupnumber),a
  call validcheck

  ld a,0fbh
  out (1),a
  in a,(1)
  ld (keyvalue),a
  ld a,3
  ld (groupnumber),a
  call validcheck

  ld a,0f7h
  out (1),a
  in a,(1)
  ld (keyvalue),a
  ld a,4
  ld (groupnumber),a
  call validcheck

  ld a,0efh
  out (1),a
  in a,(1)
  ld (keyvalue),a
  ld a,5
  ld (groupnumber),a
  call validcheck

  ld a,0dfh
  out (1),a
  in a,(1)
  ld (keyvalue),a
  ld a,6
  ld (groupnumber),a
  call validcheck

  ld a,0bfh
  out (1),a
  in a,(1)
  ld (keyvalue),a
  ld a,7
  ld (groupnumber),a
  call validcheck
  jr direct

validcheck:
	res onInterrupt,(iy+onFlags)
	ld a,(keyvalue)
	cp 255
	jr nz,disp
	ret
disp:
	ld h,0
	ld a,(keyvalue)
	ld l,a
	call _disphl
	ld a,7
	ld (curcol),a
	ld a,(groupnumber)
	ld l,a
	ld h,0
	call _disphl
	call _newline
	ret

stop:
	ld hl,191
	call _disphl
	ld a,7
	ld (curcol),a
	ld hl,2
	call _disphl
	call _newline
	ret
text:
	.db "DIRECT 1.0      By SUCKER"
	.db "       value:   group:",0
.end
END


>With 'Direct Input' you have to reset the keyboard (via outputting $FF
>trough port 1), do you have to wait a little for the hardware to react? Or
>can you just go on with the next output (to actually switch the the
>groups)?


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp