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:
.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.
You might want to push a _homeup into there somewhere, and also be sure to ei after _Puts, because the OS likes to turn off interrupts improperly in order to do _puts, _putc, _vputs, and _vputmap.
Kerm, there's a " ld hl,0 \ ld (curRow),hl" instead of _HomeUp.
That gCn wasn't displaying it was fixed by you moments ago.
I'll try the ei, though.
Wait, so you mean everything's working happily now? Or it still isn't displaying Broadcasted! on the calc side?
That it's still displaying "oadcasted!" is the problem now.
Argh, I see no logical reason for that whatsoever. Sad Can you try homeup instead and see if that makes a difference? (and ei after it)
.org $9D93, not $9D95 Smile
_player1537 wrote:
.org $9D93, not $9D95 Smile
Bahahaha nice catch! Very Happy And calcdude, I notice you're not using the DCS SDK. Whazzup with that?
Oh my, I did do that, didn't I x.x
Well, that would do it.
Kerm, can I send 0-length packets?
Also, I'm not using the SDK because I never bothered to download it :/
You can only send at least 1 byte and at most 255-byte frames. You should download it; it uses Brass and does pretty much everything for you, although you're one of the rare cases that looks like you already have everything pretty nicely set up.
So, with thanks to TechNOM, madmax, and ParkerR, I've been testing parts of the underlying networking for Chess. Currently it's not much, but game negotiation (which allows multiple chess games to occur on one hub) seems to be working fine.
I'll continue on this and eventually it should actually allow the playing of chess games Smile
This is great! You should definitely hold onto that framework for other users to use to build their own games, perhaps? Smile
calcdude84se wrote:
So, with thanks to TechNOM, madmax, and ParkerR, I've been testing parts of the underlying networking for Chess. Currently it's not much, but game negotiation (which allows multiple chess games to occur on one hub) seems to be working fine.
I'll continue on this and eventually it should actually allow the playing of chess games Smile


Your welcome, I love testing.
Hmm a CALCnet chess game would definitively be great. I bet not many people could play in classes, though, since a chess game can last over an hour. Razz
On the contrary, that would be perfect for playing in a long class in my opinion. Very Happy Not that I sanction game-playing in class at all.
Be sure to include a single-player AI that can only be beat by a Vulcan...
Oh noes, don't make him make a chess AI! Very Happy I hear that those are slightly challenging.
Cool! A chess game via CalcNet! Nice Idea! I'll download when it's finished! Very Happy
Sorunome wrote:
Cool! A chess game via CalcNet! Nice Idea! I'll download when it's finished! Very Happy
I hope you'll be helping to test it before it's finished!
I have access to several school calcs and a link cable for 2-player testing. I just need to find someone who plays chess.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement