- CALCNet Chess
- 25 Mar 2011 07:42:47 pm
- Last edited by calcdude84se on 27 Mar 2011 06:51:38 pm; edited 1 time in total
So, Kerm tasked me to write a program involving CalcNet/gCn.
I decided to start by just writing programs to make sure I knew how to do things...
But this program doesn't work
Code:
Just for reference, I defined sendID as $86F3, and so on as in http://dcs.cemetech.net/index.php?title=Interfacing_CALCnet2
So, what it should do is send a 1-byte broadcast packet, then display "Broadcasted!". (Right before and through to right before "loop")
It does display "oadcasted!", and I can quit using "clear", which is only possible in the "loop" section. So presumably it works, but gCnClient doesn't say that it has a new calc and the text doesn't display right.
I decided to start by just writing programs to make sure I knew how to do things...
But this program doesn't work
Code:
.binarymode TI8X
.variablename CNCHESS
#include "../rsrc/ti83plus.inc"
#include "../rsrc/dcs7.inc"
#include "../rsrc/calcnet.inc"
.org $9d95
.db $bb,$6d
xor d
ret
jr Start
.dw $0000
.db $07,$00
.dw $0000
.dw $0000
Start:
bcall(_RunIndicOff)
bcall(_ClrScrnFull)
ld hl,0
ld (curRow),hl
call Cn2_Setup
;Send broadcast
ld hl,id
ld de,sendID
ld bc,5
ldir
ld hl,$8001
ld (sendSize),hl
broadcastLoop:
ld a,(sendSize+1)
bit 7,a
jr nz,broadcastLoop
ld hl,broadcasted
bcall(_PutS)
loop:
call Cn2_GetK
cp skClear
jr z,quit
ld hl,receiveSize+1
ld a,(hl)
and $7F
ld (hl),a
jr loop
quit:
call Cn2_Setdown
ret
id:
.db 0,0,0,0,0
broadcasted:
.db "Broadcasted!",0
Just for reference, I defined sendID as $86F3, and so on as in http://dcs.cemetech.net/index.php?title=Interfacing_CALCnet2
So, what it should do is send a 1-byte broadcast packet, then display "Broadcasted!". (Right before and through to right before "loop")
It does display "oadcasted!", and I can quit using "clear", which is only possible in the "loop" section. So presumably it works, but gCnClient doesn't say that it has a new calc and the text doesn't display right.