;Log viewer/routines include "settings.inc" include "ti83plus.inc" include "equates.inc" SEGMENT Main GLOBALS ON EXTERN StartApp,PutSApp,DialogBox,VPutSAppCenter,Logging,ExitApp,VPutSApp,ConvOP1,loadAppVar EXTERN sPressAnyKey,curChoice,logPage,tempByte,sLinkManAppVar SetupLog: call loadAppVar ld (iy+sGrFlags),0 B_CALL GrBufClr in a,(2) and 80h jr z,SetupLog83P ld l,1 ld h,15 ld e,93 ld d,47 call DialogBox ld hl,sSelectPage ld a,17 ld (penRow),a call VPutSAppCenter ld a,38 ld (penRow),a ld hl,sEnterToContinue call VPutSAppCenter ld a,(appData+9) or a jr z,$F sub 84h $$: ld (curChoice),a drawPageChoices: ld b,0 ld hl,27*256+9 ld (penCol),hl ld hl,sPageTable drawPageChoicesLoop: ld a,(curChoice) cp b jr nz,$F set textInverse,(iy+textFlags) $$: call VPutSApp res textInverse,(iy+textFlags) ld a,(penCol) add a,10 ld (penCol),a inc b ld a,b cp 4 jr nz,drawPageChoicesLoop setupKeyLoop: B_CALL GetKey cp kEnter jr z,DoSetupLog cp kLeft jr z,moveLeft cp kRight jr z,moveRight cp kClear jr z,Logging cp kQuit jr z,ExitApp jr setupKeyLoop moveLeft: ld a,(curChoice) or a jr z,setupKeyLoop dec a ld (curChoice),a jr drawPageChoices moveRight: ld a,(curChoice) cp 3 jr z,setupKeyLoop inc a ld (curChoice),a jr drawPageChoices DoSetupLog: ld a,(curChoice) add a,84h ld (logPage),a ld hl,sLinkManAppVar rst 20h B_CALL ChkFindSym ld a,b or a jr z,$F B_CALL Arc_Unarc $$: ld hl,sLinkManAppVar rst 20h B_CALL ChkFindSym ld hl,13 add hl,de ld a,(logPage) ld (hl),a call DoEraseLog SetupLogDone: ld l,13 ld h,15 ld e,79 ld d,47 call DialogBox ld hl,sSetupDone ld a,20 ld (penRow),a call VPutSAppCenter ld a,35 ld (penRow),a ld hl,sPressAnyKey call VPutSAppCenter B_CALL GetKey jr Logging SetupLog83P: ld l,2 ld h,15 ld e,90 ld d,47 call DialogBox ld hl,sEnterMaxSize ld a,17 ld (penRow),a call VPutSAppCenter ld a,38 ld (penRow),a ld hl,sEnterToContinue call VPutSAppCenter ld a,2 ld (SmallEditCancelParse),a ld a,33 ld (SmallEditColumnLeft),a ld a,60 ld (SmallEditColumnRight),a ld a,26 ld (SmallEditRow),a xor a ld (SmallEditPromptString),a B_CALL InitSmallEditLine ld hl,SetupLogFailed call APP_PUSH_ERRORH B_CALL StartSmallEdit ld (tempByte),a B_CALL OP1ToOP6 call APP_POP_ERRORH ld a,(tempByte) push af B_CALL RunIndicOff B_CALL ReleaseSEdit pop af cp kQuit jr z,$F B_CALL OP6ToOP1 call ConvOP1 dec de ld a,d or e inc de jr nz,$F inc de $$: push de ld hl,sLinkLog rst 20h B_CALL ChkFindSym jr c,$F B_CALL DelVarArc ld hl,sLinkLog rst 20h $$: pop hl push hl B_CALL CreateAppVar pop bc inc de inc de ex de,hl B_CALL MemClear jr SetupLogDone SetupLogFailed: B_CALL RunIndicOff B_CALL ReleaseSEdit ld (iy+sGrFlags),0 B_CALL GrBufClr ld l,2 ld h,15 ld e,90 ld d,47 call DialogBox ld hl,sInvalidNumber1 ld a,24 ld (penRow),a call VPutSAppCenter ld hl,sInvalidNumber2 ld a,31 ld (penRow),a call VPutSAppCenter B_CALL GetKey jr SetupLog83P EraseLog: call loadAppVar ld a,(appData+9) or a jr z,SetupLog call DoEraseLog ld (iy+sGrFlags),0 B_CALL GrBufClr ld l,13 ld h,15 ld e,79 ld d,47 call DialogBox ld hl,sLogDeleted in a,(2) and 80h jr z,$F ld hl,sLogErased $$: ld a,20 ld (penRow),a call VPutSAppCenter ld a,35 ld (penRow),a ld hl,sPressAnyKey call VPutSAppCenter B_CALL GetKey jr Logging DoEraseLog: in a,(2) and 80h jr nz,$F ld hl,sLinkLog B_CALL ChkFindSym ret c B_CALL DelVarArc ret $$: di ld a,(logPage) out (7),a ld hl,8000h ld bc,4000h B_CALL MemClear ld a,81h out (7),a ret DoLog: in a,(2) and 80h jr z,DoLog83P ld a,(appData+9) or a ret z out (7),a push bc ld hl,8000h $$: call getNextPointer jr nc,$B pop bc ld (hl),b ld a,81h out (7),a ret DoLog83P: ret ViewLog: B_CALL ClrLCDFull B_CALL HomeUp call isLogValid jr nc,$F ld hl,sNoLogFound call PutSApp B_CALL GetKey jr Logging $$: B_CALL GetKey jr Logging isLogValid: scf ret getNextPointer: ld a,(hl) or a scf ret z inc hl call getTypeOffset add hl,de xor a ret getTypeOffset: ld de,0 cp 68h ret z cp 2Bh ret z cp 2Ch ret z cp 29h ret z cp 2Ah ret z cp 2Dh ret z cp 70h ret z cp 47h ret z cp 74h ret z cp 6Eh ret z cp 6Dh ret z ld de,2 cp 87h ret z ld de,5 cp 6Fh ret z ld de,8 ret ; DB 68h ; DW readyPacket ; DB 2Bh ; DW enableKeyEcho ; DB 2Ch ; DW disableKeyEcho ; DB 29h ; DW enableLockdown ; DB 2Ah ; DW disableLockdown ; DB 2Dh ; DW getDeviceInfo ; DB 70h ; DW testguard2Packet ; DB 47h ; DW unknown47h ; DB 74h ; DW unknown74h ; DB 87h ; DW remoteControl ; DB 6Eh ; DW getCalcID ; DB 6Fh ; DW memoryDump ; DB 6Dh ; DW getScreenContents ; DB 0C9h ; DW receiveVar ; DB 0CAh ; DW receiveVarAndRun ; DB 0A2h ; DW sendVar ; DB 88h ; DW deleteVar ; DB 89h ; DW remoteExecution ; DB 0B7h ; DW receiveRAMVar ; DB 06h ; DW receiveVarNormal sNoLogFound: DB "A valid log was " DB "not found. " DB " " DB "Press any key",0CEh,0 sLinkLog: DB AppVarObj,"LinkLog",0 sLogErased: DB "Log Page Erased",0 sLogDeleted: DB "Log AppVar Deleted",0 sSelectPage: DB "Select RAM page:",0 sEnterToContinue: DB "Press ",LlBrack,"ENTER] to continue.",0 sPageTable: DB "84h",0 DB "85h",0 DB "86h",0 DB "87h",0 sSetupDone: DB "Setup Successful",0 sEnterMaxSize: DB "Enter max AppVar size:",0 sInvalidNumber1: DB "You did not enter a",0 sInvalidNumber2: DB "valid number. Try again.",0