.nolist #include "ti83plus.inc" .list tempAddress equ appBackUpScreen tempSize equ tempAddress+2 myPage equ tempSize+1 .org userMem-2 .db 0BBh,6Dh bcall(_RclX) bcall(_convOP1) ld (myPage),a ld hl,sDumpAppVar rst 20h bcall(_chkFindSym) jr c,doesNotExist bcall(_DelVarArc) doesNotExist: ld hl,sDumpAppVar rst 20h ld hl,4000h bcall(_createAppVar) inc de inc de ld hl,4000h getPageLoop: ld a,(myPage) ld bc,128 push de push bc push hl call GetSmallDump pop hl pop bc pop de jr nc,noErrorDetected ld a,(myPage) push de push bc push hl call GetSmallDump pop hl pop bc pop de jr c,errorDetected noErrorDetected: add hl,bc ex de,hl add hl,bc ex de,hl bit 7,h jr z,getPageLoop ret errorDetected: ld hl,sError bcall(_PutS) ret sError: .db "Error!",0 sDumpAppVar: .db AppVarObj,"PAGEDUMP",0 GetSmallDump: ;A => source page ;HL => source address ;C => number of bytes to receive ;DE => location to store bytes ld (tempAddress),de ld (address),hl ld (page),a ld a,c ld (tempSize),a ld (address+2),a ld hl,errorHandler call APP_PUSH_ERRORH ld (iy+1Bh),0 ld hl,6F23h ld (header),hl ld hl,06h ld (header+2),hl ld hl,packetData ld (iMathPtr5),hl bcall(4ED6h) ;_SendPacket bcall(4F1Bh) ;_Get4BytesNC ld bc,(tempSize) ld b,c ld hl,(tempAddress) receiveDataLoop: push hl push bc bcall(_RecAByteIO) pop bc pop hl ld (hl),a inc hl djnz receiveDataLoop bcall(_RecAByteIO) bcall(_RecAByteIO) bcall(_SendAck) call APP_POP_ERRORH xor a jr getDumpDone errorHandler: scf getDumpDone: res indicOnly,(iy+indicFlags) res onInterrupt,(iy+onFlags) ret packetData: page: .db 00h .db 00h address:.dw 0000h .dw 128 .end end