;Progger v0.01a ;Brandon Wilson ;This is a replacement for the BASIC parser, allowing archived programs to be run directly instead of copied/moved to RAM first. ;It's also a template for any major customizations you ever wanted to make to the BASIC parser. ;This is more a theory than anything, but I think it can work. ;v0.1 Changelog ;Initial release include "settings.inc" NOLIST include "ti83plus.inc" LIST include "equates.inc" include "header.asm" SEGMENT MAIN GLOBALS ON EXTERN PutSApp,IGetKey,vputstring,VStrLen,VPutSAppCenter,DispHexA,GetHexA,SoftKey,ParseInp,invert_lines,ifastcopy StartApp: res noPrograms,(iy+proggerFlags) ld (iy+sGrFlags),0 set graphDraw,(iy+graphFlags) set write_on_graph,(iy+sGrFlags) res textEraseBelow,(iy+textFlags) set textWrite,(iy+sGrFlags) res appTextSave,(iy+appFlags) B_CALL ClrLCDFull B_CALL GrBufClr xor a ld (penRow),a ld hl,sProggerTitle call VPutSAppCenter ld hl,plotSScreen ld b,7 call invert_lines call IsParserHookInstalled ld hl,sOptions1 jr c,$F ld hl,sOptions2 $$: call SoftKey call ifastcopy B_CALL ZeroOP1 ld a,ProgObj ld (OP1),a B_CALL FindAlphaUp jr nc,displayProgram notFound: set noPrograms,(iy+proggerFlags) ld hl,sNotFound-1 rst 20h displayProgram: ld hl,0103h ld (curRow),hl ld a,Lleft B_CALL PutC call EraseEOL B_CALL PushRealO1 B_CALL ChkFindSym ld a,b or a ld hl,OP1+1 jr z,$F dec hl ld (hl),'*' $$: push hl xor a ld b,a $$: cp (hl) inc hl jr z,$F inc b jr $B $$: ld a,16 sub b srl a ld (curCol),a pop hl call PutSApp B_CALL PopRealO1 ld a,14 ld (curCol),a ld a,Lconvert B_CALL PutC keyLoop: B_CALL GetKeyRetOff cp kYequ jr z,toggleHook cp kWindow jr z,toggleHook bit noPrograms,(iy+proggerFlags) jr nz,$F cp kLeft jr z,moveLeft cp kRight jr z,moveRight cp kZoom jr z,runProgram cp kEnter jr z,runProgram ; cp kTrace ; jr z,runProgram $$: cp kGraph jr z,ExitApp cp kQuit jr z,ExitApp cp kClear jr z,ExitApp cp kMode jr nz,keyLoop ExitApp: B_CALL ClrLCDFull B_CALL HomeUp ld (iy+sGrFlags),0 B_CALL GrBufClr B_JUMP JForceCmdNoChar moveLeft: B_CALL FindAlphaDn jr c,keyLoop jr displayProgram moveRight: B_CALL FindAlphaUp jr c,keyLoop jr displayProgram toggleHook: call IsParserHookInstalled jr c,$F B_CALL ClearParserHook jr StartApp $$: in a,(6) ld hl,parserHook B_CALL SetParserHook jr StartApp runProgram: B_CALL PushRealO1 call ParseInp B_CALL PopRealO1 jr displayProgram IsParserHookInstalled: scf bit 1,(iy+36h) ret z ld hl,(9BACh) ld de,parserHook B_CALL CpHLDE scf ret nz in a,(6) ld b,a ld a,(9BACh+2) cp b scf ret nz or a ret EraseEOL: ld a,(curCol) push af $$: ld a,' ' B_CALL PutC ld a,(curCol) cp 14 jr c,$B pop af ld (curCol),a ret parserHook: or a jr nz,notCondition0 call ParseInp or 1 ret notCondition0: xor a ret sProggerTitle: DB "Progger ",VER_STRING,0 sNotFound: DB "",0 sOptions1: DW 57*256+7 DB "Install",0 DW 57*256+42 DB "Run",0 DW 57*256+80 DB "Exit",0 sOptions2: DW 57*256+4 DB "Uninstall",0 DW 57*256+42 DB "Run",0 DW 57*256+80 DB "Exit",0