; »»»»»»»»»»»»»»»»»»»»»»»»»» Protection Program «««««««««««««««««««««««««««««« ; ; This is a little program that I wrote. All it does is protects every program on the calc ; or just the opposite. When you run it, everything is pretty much self explainatory, ; except that you have to press '2nd' to select what you want to do. ; I am working on an autodetect program that lets you select which one to protect. ; Look for it in the future. ; ; I tried to explain as much stuff as possible, if you don't understand anything ; just email me and I'll try to help you out. Please understand that I am still ; learning also. ;-] ; ; ______________________________________________________________________________ ; ; »» You are free to use this but a little thanks to me would be appreciated. «« ; ______________________________________________________________________________ ; ; ; Please send all questions to Jimmy Conner at »» TIMagic@yahoo.com «« ; http://www.angelfire.com/tx/timagic/ TI-82/83 Page ; ; ; »»»»»»»»»»»»»» This should always be opened in WIN 95 Word pad!!! «««««««««««««««« ; .NOLIST ; Required #define equ .equ ; Include these so the program will compile right #define EQU .equ ; '' '' '' '' '' '' '' '' #define END .end ; '' '' '' '' '' '' '' '' #define length 8265h ; My var for the length of the program name #define prog 8266h ; My var to protect or not #include "ti83asm.inc" ; Include these so the program will compile right #include "tokens.inc" ; '' '' '' '' '' '' '' '' .LIST ; Required .org 9327h ; ALL TI-83 Programs start here in memory call _clrLCDFull ; Clear Screen call _runIndicOff ; Turns off Runindicator set textinverse, (iy+textflags) ; Toggle text inverse on call _homeup ; Goto 0,0 of screen ld hl,timagic ; Load String All Protected call _puts ; Output it to screen res textinverse, (iy+textflags) ; Reset text inverse (off) call _newline ; New Line ld hl, protect ; Load String All Protected call _puts ; Output it to screen call _newline ; New Line ld hl, unprotect ; Load String All Protected call _puts ; Output it call _newline ; New Line ld hl, exit ; Load String All Protected call _puts ; Output it ld a, 00h ; Put it at row 1 ld (curcol), a ; '' '' '' '' ld a, 02h ; Put it at Column 3 ld (currow), a ; '' '' '' '' upordownloop: ld a, 1Ch ; Load the Store Symbol call _putmap ; Put it on the screen getkey: ld a, 0ffh ; Reset keyport out (1), a ; Necessary code ld a, 0bfh ; Enable row with 2nd out (1), a ; Necessary code in a, (1) ; Get # of any key pressed->a cp 223 ; Is it the # for 2nd jp z, pressed2nd ; If so then go there ld a, 0ffh ; Reset keyport out (1), a ; Necessary code ld a, 0feh ; Enable row with arrows out (1), a ; Necessary code in a, (1) ; Get # of any key pressed -> a cp 0 ; If no key then loop again jp z, getkey ; '' '' '' '' '' '' cp 254 ; Down? jp z, down ; If so then go there cp 247 ; Up? jp z, up ; If so then go there jp getkey ; If anything else then reloop delay: PUSH AF ; Hide current AF value (sort of) PUSH BC ; Hide current BC value (sort of) LD BC, 9FFFh ; Delay length->bc delayLoop: DEC BC ; bc-1->bc LD A, B ; Find where it is at OR C ; '' '' ' ' ' JR NZ, delayLoop ; If not done reloop POP BC ; Unhide current BC value (sort of) POP AF ; Unhide current AF value (sort of) ret down: ld a, 20h ; Load a space call _putmap ; Put it on the screen ld a, (currow) ; Get what row we are at cp 4 ; Is it the bottom row? (row 5) jp z, upordownloop ; If so don't move down add a, 1 ; add one to currow ld (currow), a ; '' '' '' '' call delay ; Goto the delay loop to slow down the movement call delay ; '' '' '' '' '' '' '' '' '' jp upordownloop ; Go move the arrow up: ld a, 20h ; Load a space call _putmap ; Put it on the screen ld a, (currow) ; Get what row we are at cp 2 ; Is it the top row? (row 3) jp z, upordownloop ; If so don't move up add a, -1 ; subtract one from currow ld (currow), a ; '' '' '' '' call delay ; Goto the delay loop to slow down the movement call delay ; '' '' '' '' '' '' '' '' '' jp upordownloop ; Go move the arrow pressed2nd: ld a, (currow) ; Get what row we are at cp 2 ; Is it at protect all? jp z, protectall ; If so then goto protect all cp 3 ; Is it at unprotect all? jp z, unprotectall ; If so then goto unprotect all cp 4 ; Is it at quit? jp z, quit ; If so then goto quit quit: call _clrlcdfull ; Clear the Current Screen call _clrscrnfull ; Clear the Home Screen call _homeup ; Goto to the top ld hl, thankyou ; Load text call _puts ; Display it call _newline ; Goto the next line ld hl, thankyou2 ; Load text call _puts ; Display it call _newline ; Goto the next line ld hl, thankyou3 ; Load text call _puts ; Display it call _newline ; Goto the next line ld hl, thankyou4 ; Load text call _puts ; Display it call _newline ; Goto the next line ld hl, thankyou5 ; Load text call _puts ; Display it call _newline ; Goto the next line ret ; Quit the assembly program protectall: ld a, 06h ; Load the protected program symbol ld (prog), a ; Stick it in my var jp detect ; Goto the protection loop and do its stuff unprotectall: ld a, 05h ; Load the unprotected program symbol ld (prog), a ; Stick it in my var jp detect ; Goto the protection loop and do its stuff detect: ld hl, (progptr) ; Start here to look for programs` startdetect: ld a, (hl) ; Get the type and %00011111 ; Need to mask out bits 0-4 in order to check cp $06 ; Is it a protected program? jp z, program ; If so jump to the program cp $05 ; Is it a program, but not protected? jp z, program ; If so jump to the program cp $01 ; Is it a list? jp z, next ; If so jump to the next loop cp $0D ; Is it a complex list? jp z, next ; If so jump to the next loop jp quit program: ld a, (prog) ; Load what type of protection we want ld (hl), a ; Stick that in the program type next: ; Enter here to goto the next one dec hl ; Skip the first pointer dec hl ; Skip the last part of the pointer dec hl ; Should be at the length ld b, (hl) ; Load that so we can loop past it next2: dec hl ; Dec hl to goto next letter in name djnz next2 ; Loop until the end of the name dec hl ; Should be at the next item after this jp startdetect ; Go find next item timagic: .db "TI-Magic Protect", 0 ; 0 terminated string for title protect: .db " Protect All", 0 ; 0 terminated string for protect unprotect: .db " Unprotect All", 0 ; 0 terminated string for unprotect exit: .db " Exit", 0 ; 0 terminated string for Exit thankyou: .db "TI-Magic", 0 ; 0 terminated string thankyou2: .db "Productions", 0 ; 0 terminated string thankyou3: .db "By Jimmy Conner", 0 ; 0 terminated string thankyou4: .db "TIMagic", 0 ; 0 terminated string thankyou5: .db " @yahoo.com", 0 ; 0 terminated string .end END ; ; »»»»»»» TIMagic@yahoo.com ««««««« ;