.nolist #include "ion.inc" #include "keypad.inc" .list #define lcounter $86EC #define namelen $86EC+2 #define name $86EC+3 ;11 bytes #define txtrow $86EC+17 #define txtcol $86EC+16 #define templen $86EC+18 #define tempmessage $86EC+19 #define othernamelen $86EC+100 #define othername $86EC+101 #define progname $86EC+120 #define progsize $86EC+200 .org $9D93 .db $BB,$6D ret jr nc,start .db "TI-ICQ v0.1 Beta",0 start: set 2,(iy+43) bcall(_disableapd) bcall(_clrscrnfull) bcall(_cleartextshad) bcall(_homeup) ld hl,EnterNickname bcall(_puts) bcall(_newline) ld hl,name ld bc,11 bcall(4C30h) ;memclear xor a ld (namelen),a bcall(_cursoron) ld ix,name nicknameloop: ei \ halt bcall(_getcsc) or a jr z,nicknameloop cp skMode ret z cp skEnter jr z,nicknamedone cp skDel jr z,nicknamebackspace ld hl,chartable-10 ld d,0 ld e,a add hl,de ld a,(hl) cp '.' jr z,nicknameloop ld (ix),a inc ix push ix bcall(_putc) ld hl,namelen inc (hl) pop ix ld a,(namelen) cp 8 jr nz,nicknameloop jr nicknamedone nicknamebackspace: ld a,(namelen) or a jr z,nicknameloop dec ix xor a ld (ix),a ld hl,curcol dec (hl) ld a,' ' push ix bcall(_putc) ld hl,curcol dec (hl) pop ix ld hl,namelen dec (hl) jr nicknameloop nicknamedone: ld a,(namelen) or a jr z,nicknameloop bcall(_cursoroff) bcall(_clrscrnfull) bcall(_grbufclr) ld ix,icqlogo ld c,2 ld b,16 xor a ld l,a call ionLargeSprite call ionFastCopy ld hl,20 ld (pencol),hl ld hl,name bcall(_vputs) ld a,70 ld (pencol),a ld hl,title bcall(_vputs) ld hl,18*256 ld (pencol),hl ld hl,help1 bcall(_vputs) ld hl,24*256 ld (pencol),hl ld hl,help12 bcall(_vputs) ld hl,34*256 ld (pencol),hl ld hl,help2 bcall(_vputs) ld hl,40*256 ld (pencol),hl ld hl,help22 bcall(_vputs) ld hl,50*256 ld (pencol),hl ld hl,help3 bcall(_vputs) ld hl,56*256 ld (pencol),hl ld hl,help32 bcall(_vputs) ld hl,19 ld de,6*256+95 bcall(_invertrect) ld h,1 ld bc,19*256+7 ld de,95*256+7 bcall(_iline) ld bc,19*256+(62-6) ld de,19*256 bcall(_iline) ld bc,95*256+(62-6) ld de,95*256 bcall(_iline) ld hl,9*256+21 ld (txtcol),hl MainLoop: call ReceiveByte or a call nz,SomethingThere bcall(_getcsc) cp skZoom ret z cp skYEqu call z,SendMessage jr MainLoop SendMessage: ld hl,57*256+20 ld de,63*256+94 bcall(_clearrect) ld hl,57*256+21 ld (pencol),hl xor a ld (templen),a ld ix,tempmessage sendmessageloop: call ReceiveByte or a jr z,nothingcoming ld hl,(pencol) push hl push ix call SomethingThere pop ix pop hl ld (pencol),hl nothingcoming: ei \ halt bcall(_getcsc) or a jr z,sendmessageloop cp skEnter jr z,sendmessagedone ; cp skDel ; jr z,sendmessagebackspace ld hl,chartable-10 ld d,0 ld e,a add hl,de ld a,(hl) cp '.' jr z,sendmessageloop ld (ix),a inc ix push ix bcall(_vputmap) ld hl,templen inc (hl) ld hl,templen bcall(_sstringlength) pop ix cp 94-22 jr c,sendmessageloop sendmessagedone: ld a,$11 call SendByte ld a,(templen) call SendByte ld a,(templen) ld b,a ld ix,tempmessage sendloop: push bc ld a,(ix) call SendByte nop inc ix pop bc djnz sendloop ld hl,57*256+20 ld de,63*256+94 bcall(_clearrect) ret SomethingThere: cp $11 ;Message jp z,GetMessage ; cp $22 ;File ; jr z,GetFile ret GetMessage: call ReceiveByte or a jr z,GetMessage ld b,a ld hl,(txtcol) ld (pencol),hl messagedisploop: push bc getlooptemp: call ReceiveByte or a jr z,getlooptemp push af ld a,(pencol) cp 90 jr c,allok ld a,21 ld (pencol),a ld a,(penrow) add a,6 ld (penrow),a cp 51 jr nz,allok ld a,9 ld (penrow),a ld hl,8*256+20 ld de,56*256+94 bcall(_clearrect) allok: pop af bcall(_vputmap) pop bc djnz messagedisploop ld hl,(pencol) ld (txtcol),hl ret icqlogo: .db %00000001,%10000000 .db %00000010,%11011110 .db %00110101,%11110010 .db %01011101,%11101110 .db %01001101,%11011110 .db %00100110,%11011110 .db %11110011,%11111100 .db %10011111,%11111111 .db %01001111,%11011111 .db %01111111,%11101111 .db %11011111,%11111110 .db %10011101,%10111000 .db %10011011,%10011100 .db %01101111,%11001100 .db %00001011,%01101100 .db %00001110,%00111000 .db "................." .db "................." chartable: .db ".WRMH." .db "...VQLG...ZUPKFC" .db ". YTOJEBX.XSNIDA" .db "................" .db "................" EnterNickname: .db "Nickname?",0 title: .db "TI-ICQ",0 help1: .db "F1",0 help12: .db "Text",0 help2: .db "F2",0 help22: .db "File",0 help3: .db "F3",0 help32: .db "Exit",0 fileshow: .db "File: ",0 promptaccept: .db "Accept (Y/N)?",0 prompttransfer: .db "File transfer from:",0 transferring: .db "Transfering...",0 testprog: .db 5,"ATEST",0,0,0 #include "linkrout.h" .end