0 Members and 3 Guests are viewing this topic.
In other news, Frey continues kicking unprecedented levels of ass.
.nolist#include "ti83plus.inc".list#define p_GetArc $55E7#define p_ReadArcApp $5658#define p_CopyArc $568D#define TokenHook_Temp appBackUpScreen-2#define AxiomTokens appBackUpScreen.org $71E0TokenHook_NotAxe: ld bc,('A'<<8)+(StrPROGRAM&$FF)TokenHook_CheckIfChanged: ld de,textShadow ld a,(de) xor b ret nz push hl ld h,StrPROGRAM>>8 ld l,c B_CALL(_Mov7B) B_CALL(_saveShadow) B_CALL(_rstrShadow) pop hl xor a retTokenHook: .db $83 ld a,(cxCurApp) cp kPrgmEd ret nz ld bc,(EditTop) ld a,(bc) cp tDecPt jr nz,TokenHook_NotAxeTokenHook_MaybeAxe: inc bc ld a,(bc) cp tDecPt jr z,TokenHook_IsAxe sub tA cp tTheta-tA+1 jr nc,TokenHook_NotAxeTokenHook_IsAxe: push hl push de ld bc,('P'<<8)+(StrAXESRC&$FF) call TokenHook_CheckIfChanged call z,TokenHook_AxiomSearch pop de ld hl,AxeTokens ld b,0 jr TokenHook_CompareLoop_StartTokenHook_CompareLoop: cp e inc hl jr z,TokenHook_LowByteMatchTokenHook_NoMatch: inc hl ld c,(hl) inc c add hl,bcTokenHook_CompareLoop_Start: ld a,(hl) or a jr nz,TokenHook_CompareLoopTokenHook_DoneNoMatch: add hl,hl ld hl,AxiomTokens jr nc,TokenHook_CompareLoop_Start pop hl retTokenHook_LowByteMatch: ld a,(hl) cp d jr nz,TokenHook_NoMatchTokenHook_Match: ld de,localTokStr push de ld c,17 ldir pop hl pop bc retTokenHook_AxiomSearch: ld hl,AxiomTokens B_CALL(_BufClr) ld hl,-768 ld (TokenHook_Temp),hl ld de,(editTop) push de ld hl,(editCursor) push hl push de B_CALL(_BufToBtm) ld hl,(editCursor) pop de or a sbc hl,de inc hl ld b,h ld c,l ex de,hl call TokenHook_AxiomSearch_LoopTokenHook_AxiomSearch_Done: pop hl ld (editTop),hl B_CALL(_BufToTop) pop hl ld (editTop),hl retTokenHook_AxiomSearch_CheckHeader: call ReadArc inc de add a,c ld bc,$C0DE sbc hl,bc ld c,a ret z pop bcTokenHook_AxiomSearch_Loop__: pop bcTokenHook_AxiomSearch_Loop_: pop hlTokenHook_AxiomSearch_Loop: ld a,tAsmComp cpir ret po push hl dec hl dec hl ld a,(hl) cp t2ByteTok jr nz,TokenHook_AxiomSearch_Loop_TokenHook_AxiomSearch_Backtrack: dec hl ld a,(hl) cp tSpace jr z,TokenHook_AxiomSearch_Backtrack sub tColon cp tEnter-tColon+1 jr nc,TokenHook_AxiomSearch_Loop_TokenHook_AxiomSearch_FindAxiom: pop hl push hl push bc dec hl rst 20h ld hl,OP1 ld d,AppVarObj ld (hl),d call p_GetArc+1 jr c,TokenHook_AxiomSearch_Loop__TokenHook_AxiomSearch_FoundAxiom: ex de,hl ld c,b call TokenHook_AxiomSearch_CheckHeader ld b,32+1TokenHook_AxiomSearch_ScanAxiom: call ReadArc inc de ld a,h or l jr z,TokenHook_AxiomSearch_EndOfAxiom add hl,de ld de,5 add hl,de ex de,hl djnz TokenHook_AxiomSearch_ScanAxiomTokenHook_AxiomSearch_EndOfAxiom: call TokenHook_AxiomSearch_CheckHeader call ReadArc inc de ld a,c ld b,h ld c,l ld hl,(TokenHook_Temp) add hl,bc jr c,TokenHook_AxiomSearch_Loop__ ld (TokenHook_Temp),hl sbc hl,bc push bc ld bc,appBackUpScreen+768 add hl,bc pop bc ex de,hl call p_CopyArc+5 jr TokenHook_AxiomSearch_Loop__ReadArc: ex de,hl xor a cp c jr z,ReadArc_RAM push bc push hl call p_ReadArcApp+11 pop de inc de pop bc retReadArc_RAM: ld e,(hl) inc hl ld d,(hl) ex de,hl retAxeTokens: .db $F4,$03,5,"Copy(" .db $FE,$03,5,"Exch(" .db $0E,$04,5,"Freq(" .db $66,$01,5,"Buff(" .db $62,$01,5,"sign{" .db $06,$00,5,Lconvert,"Char" .db $08,$04,4,Lconvert,"Hex" .db $02,$04,5,"Data(" .db $4E,$01,7,"Bitmap(" .db $02,$00,4,Lconvert,"Tok" .db $80,$04,7,"#Axiom(" .db $04,$04,5,"Rect(" .db $06,$04,6,"RectI(" .db $58,$02,3,LrecurV,"ar" .db $5A,$02,4,"app",LrecurV .db $5C,$02,3,"grp" .db $F6,$01,4,"port" .db $52,$01,5,"Text " .db $D8,$01,8,"Pt-Mask(" .db $DA,$01,7,"pt-Get(" .db $D0,$01,3,"Get" .db $14,$04,5,"rotC(" .db $16,$04,6,"rotCC(" .db $18,$04,6,"flipV(" .db $1A,$04,6,"flipH(" .db $C8,$03,7,"inData(" .db $B8,$01,5,"input" .db $74,$01,6,"float{" .db $72,$01,4,"nib{" .db $F6,$03,9,"#Realloc(" .db $68,$01,6,"#Icon(" .db $80,$01,2,Llambda,"(" .db $38,$03,5,"Load(" .db $3A,$03,5,"Next(" .db $14,$03,7,"Render(" .db $3C,$03,6,"DrawL(" .db $3E,$03,6,"DrawR(" .db $16,$03,6,"DrawS(" .db $82,$03,6,"Print(" .db $44,$03,3,"Up(" .db $46,$03,5,"Down(" .db $5C,$03,5,"Left(" .db $40,$03,6,"Right(" .db $42,$03,4,"New(" .db $5E,$03,7,"Delete(" .db 0StrPROGRAM: .db "PROGRAM"StrAXESRC: .db "AXE SRC"#if (StrPROGRAM>>8) != (StrAXESRC>>8) .error "StrPROGRAM and StrAXESRC must have the same MSB"#endif
.nolist#include "ti83plus.inc".list#define cxPrevApp cxPrev+cxCurApp-cxMain#define p_GetArc $55E7#define p_ReadArcApp $5658#define p_CopyArc $568D#define TokenHook_Temp appRawKeyHandle#define AxiomTokens statVars#define AxiomTokens_End curGStyle.org $71E0TokenHook: .db $83 ld a,(cxCurApp) cp kPrgmEd ret nz ld bc,(EditTop) ld a,(bc) cp tDecPt ret nz inc bc ld a,(bc) cp tDecPt jr z,TokenHook_IsAxe sub tA cp tTheta-tA+1 ret ncTokenHook_IsAxe: push hl ld hl,cxPrevApp ld a,kPrgmEd cp (hl) jr z,TokenHook_SkipAxiomSearchTokenHook_AxiomSearch: ld (hl),a push de ld hl,AxiomTokens ld (iy+statFlags),h B_CALL(_BufClr) ld hl,AxiomTokens-AxiomTokens_End ld (TokenHook_Temp),hl B_CALL(_IsAtTop) push de push hl B_CALL(_BufToBtm) B_CALL(_IsAtTop) sbc hl,de ld b,h ld c,l ex de,hl call TokenHook_AxiomSearch_Loop pop hl ld (editTop),hl B_CALL(_BufToTop) pop hl ld (editTop),hl pop deTokenHook_SkipAxiomSearch: ld hl,AxeTokens ld b,0 jr TokenHook_CompareLoop_StartTokenHook_CompareLoop: cp e inc hl jr z,TokenHook_LowByteMatchTokenHook_NoMatch: inc hl ld c,(hl) inc c add hl,bcTokenHook_CompareLoop_Start: ld a,(hl) or a jr nz,TokenHook_CompareLoopTokenHook_DoneNoMatch: add hl,hl ld hl,AxiomTokens jr nc,TokenHook_CompareLoop_Start pop hl retTokenHook_LowByteMatch: ld a,(hl) cp d jr nz,TokenHook_NoMatchTokenHook_Match: ld de,localTokStr push de ld c,17 ldir pop hl pop bc retTokenHook_AxiomSearch_CheckHeader: call ReadArc inc de add a,c ld bc,$C0DE sbc hl,bc ld c,a ret z pop bcTokenHook_AxiomSearch_Loop__: pop bcTokenHook_AxiomSearch_Loop_: pop hlTokenHook_AxiomSearch_Loop: ld a,tAsmComp cpir ret po push hl dec hl dec hl ld a,(hl) cp t2ByteTok jr nz,TokenHook_AxiomSearch_Loop_TokenHook_AxiomSearch_Backtrack: dec hl ld a,(hl) cp tSpace jr z,TokenHook_AxiomSearch_Backtrack sub tColon cp tEnter-tColon+1 jr nc,TokenHook_AxiomSearch_Loop_TokenHook_AxiomSearch_FindAxiom: pop hl push hl push bc dec hl rst 20h ld hl,OP1 ld (hl),AppVarObj ld a,tRParen ld bc,10 cpir dec hl ld (hl),b ld l,OP1&$FF call p_GetArc+1 jr c,TokenHook_AxiomSearch_Loop__TokenHook_AxiomSearch_FoundAxiom: ex de,hl ld c,b call TokenHook_AxiomSearch_CheckHeader ld b,32+1TokenHook_AxiomSearch_ScanAxiom: call ReadArc inc de ld a,h or l jr z,TokenHook_AxiomSearch_EndOfAxiom add hl,de ld de,5 add hl,de ex de,hl djnz TokenHook_AxiomSearch_ScanAxiomTokenHook_AxiomSearch_EndOfAxiom: call TokenHook_AxiomSearch_CheckHeader call ReadArc inc de ld a,c ld b,h ld c,l ld hl,(TokenHook_Temp) add hl,bc jr c,TokenHook_AxiomSearch_Loop__ ld (TokenHook_Temp),hl sbc hl,bc push bc ld bc,curGStyle add hl,bc pop bc ex de,hl call p_CopyArc+5 jr TokenHook_AxiomSearch_Loop__ReadArc: ex de,hl xor a cp c jr z,ReadArc_RAM push bc push hl call p_ReadArcApp+11 pop de inc de pop bc retReadArc_RAM: ld e,(hl) inc hl ld d,(hl) ex de,hl retAxeTokens: .db $F4,$03,5,"Copy(" .db $FE,$03,5,"Exch(" .db $0E,$04,5,"Freq(" .db $66,$01,5,"Buff(" .db $62,$01,5,"sign{" .db $06,$00,5,Lconvert,"Char" .db $08,$04,4,Lconvert,"Hex" .db $02,$04,5,"Data(" .db $4E,$01,7,"Bitmap(" .db $02,$00,4,Lconvert,"Tok" .db $80,$04,7,"#Axiom(" .db $04,$04,5,"Rect(" .db $06,$04,6,"RectI(" .db $58,$02,3,LrecurV,"ar" .db $5A,$02,4,"app",LrecurV .db $5C,$02,3,"grp" .db $F6,$01,4,"port" .db $52,$01,5,"Text " .db $D8,$01,8,"Pt-Mask(" .db $DA,$01,7,"pt-Get(" .db $D0,$01,3,"Get" .db $14,$04,5,"rotC(" .db $16,$04,6,"rotCC(" .db $18,$04,6,"flipV(" .db $1A,$04,6,"flipH(" .db $C8,$03,7,"inData(" .db $B8,$01,5,"input" .db $74,$01,6,"float{" .db $72,$01,4,"nib{" .db $F6,$03,9,"#Realloc(" .db $68,$01,6,"#Icon(" .db $80,$01,2,Llambda,"(" .db $38,$03,5,"Load(" .db $3A,$03,5,"Next(" .db $14,$03,7,"Render(" .db $3C,$03,6,"DrawL(" .db $3E,$03,6,"DrawR(" .db $16,$03,6,"DrawS(" .db $82,$03,6,"Print(" .db $44,$03,3,"Up(" .db $46,$03,5,"Down(" .db $5C,$03,5,"Left(" .db $40,$03,6,"Right(" .db $42,$03,4,"New(" .db $5E,$03,7,"Delete(" .db 0