[A86] TI-OS link routines


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

[A86] TI-OS link routines




I was wondering how to use the TI-OS link routines
and made this program. The thing is the sending part times out 
and give a garbled Error 00 [and a bunch of gibberish] but 
doesnt crash. When the program is run on both calcs it will 
work like it is supposed to and show you are player 1 on the 
calc that ran the program first, and you are player 2 on the 
calc that ran the program second. The timeout of the sending 
routine seems to cause some strange error. Here is the code.
Any help is appreiciated.


-------------------------------------------------------
#include "ti86asm.inc"
.org _asm_exec_ram


 call _clrLCD
 call _flushallmenus
 call _homeup
 set 4,(iy+35)

recieveit:
 call linkget
; or a		;if a==0:no byte recived. (or a is done in 
routine)
 jr nz,showit ;otherwise show it
sendit:
 call _homeup
 ld hl,sendbytetxt
 call _puts
 call _homeup
 ld a,1  ;1 is the byte to send
 call linksend
showit:
 inc a ;if 0 then p1, if 1 then p2
 ld (player),a ;store it
 call _homeup
 ld hl,youareplayertxt
 call _puts
 ld a,(player)
 ld l,a
 xor a
 ld h,a
 ld bc,$1600
 call _dispAHL
 jp pause ;ends here
; ret 

cancelsend:
 call _clrLCD
 call _homeup
 ld hl,canceltxt
 call _puts
 jp pause ;ends here
; ret

pause:
; push af
kloop:
 halt 
 halt
 call _get_key
 cp K_ENTER
 jr nz,kloop
; pop af
 ret

player:
.db 0

sendbytetxt:
 .text "Sending Byte"
canceltxt:
 .text "canceled"
youareplayertxt:
 .text "You are player"


linksend:
;a = byte to send
 push af
 ld a,$C0
 out (7),a
 ld a,10
 ld (_ASAP_IND),a
 pop af
 call _linkExec ;$571c
 xor a
 ret

linkget:
 ld a,$C0
 out (7),a
 in a,(7) ;check if either line low
 and 3
 cp 3
 ret z
 ld a,21
 ld (_ASAP_IND),a
 call _linkExec
;a = byte recieved
 or a
 ret




Ricky Cobb
http://tiparadise.any.za.net/
arcadesdude@operamail.com
[IM]
icq 41440378
msn arcadesdude
y!  arcadesdude
aim arcadesdude