;Remotely execute code include "settings.inc" include "ti83plus.inc" include "equates.inc" SEGMENT Main GLOBALS ON EXTERN StartApp,PutSApp,sRemoteLinkError ExecCode: res 1,(iy+36) ld hl,rawKeyHookPtr ld de,tempSwapArea ld bc,4 ldir ld hl,flags+34h ldi ld hl,execCodeHandler call APP_PUSH_ERRORH ld hl,rawKeyHook in a,(6) B_CALL EnRawKeyHook call clearAllScreens ld b,(iy+9) ld c,(iy+1Ch) push bc res 6,(iy+1Ch) set 7,(iy+9) ld hl,sEnterCode ld de,ioPrompt ld bc,16 ldir ld (textShadCur),bc B_CALL GetStringInput call APP_POP_ERRORH call restoreRawKeyHook B_CALL ReloadAppEntryVecs B_CALL RunIndicOff pop bc res 4,b ld (iy+9),b ld (iy+1Ch),c ld a,58h ld (cxCurApp),a ld hl,(editTop) ld (editCursor),hl ld (editTail),hl ld hl,sRemoteLinkError call APP_PUSH_ERRORH B_CALL ClrLCDFull B_CALL HomeUp ld hl,sSendingCode call PutSApp ld hl,sTempExecProg rst 20h B_CALL ChkFindSym ex de,hl ld e,(hl) inc hl ld d,(hl) inc de inc de inc de inc de inc de ld (ramCode),de ld hl,sHeaderPacket ld de,ramCode+2 ld bc,11 ldir ld hl,13 ld (header+2),hl ld hl,0CA03h ld (header),hl ld (iy+1Bh),10h ld hl,ramCode ld (iMathPtr5),hl B_CALL SendPacket B_CALL Get4BytesNC B_CALL SendAck ld hl,sTempExecProg rst 20h B_CALL ChkFindSym inc de inc de ld hl,3 B_CALL InsertMem ld a,0BBh ld (de),a inc de ld a,6Ch ld (de),a inc de ld a,3Fh ld (de),a ld (sndRecState),a ld hl,sTempExecProg rst 20h B_CALL ChkFindSym ex de,hl ld e,(hl) inc hl ld d,(hl) inc de inc de inc de ld (hl),d dec hl ld (hl),e inc de inc de B_CALL SendRAMVarData ld a,03h B_CALL SendAByte ld a,92h B_CALL SendAByte xor a B_CALL SendAByte xor a B_CALL SendAByte res indicOnly,(iy+indicFlags) ld hl,sTempExecProg rst 20h B_CALL ChkFindSym B_CALL DelVarArc B_CALL NewLine B_CALL DispDone B_CALL GetKey call APP_POP_ERRORH call clearAllScreens jr StartApp clearAllScreens: B_CALL ClrLCDFull ld hl,cmdShadow ld de,cmdShadow+1 ld (hl),' ' ld bc,127 ldir ld hl,textShadow ld de,textShadow+1 ld (hl),' ' ld bc,127 ldir ret execCodeHandler: call restoreRawKeyHook jr StartApp restoreRawKeyHook: ld hl,tempSwapArea ld de,rawKeyHookPtr ld bc,4 ldir ld de,flags+34h ldi ret rawKeyHook: add a,e cp kColon jr z,exitHookNormally cp kLeft jr z,exitHookNormally cp kRight jr z,exitHookNormally cp kEnter jr z,exitHookNormally cp kUp jr z,exitHookNormally cp kDown jr z,exitHookNormally cp kClear jr z,exitHookNormally cp k0 jp m,cancelHook cp kSpace jr z,cancelHook cp kEE jr z,cancelHook cp kCapG jp p,cancelHook exitHookNormally: or a ret cancelHook: xor a ret sTempExecProg: DB 03h,2Dh,00h,00h sEnterCode: DB "Enter hex code: ",0 sSendingCode: DB "Sending...",0 sHeaderPacket: DB TempProgObj,"ZLINKTMP",0,0,0