;fStat, xStat, and yStat Variable remover ;version 1.0 by Thermo Nuclear Calcware #include "asm86.h" #include "Ti86asm.inc" #include "Ti86ops.inc" ;---------------------------------Identification Junk------------ .org _asm_exec_ram nop jp ASMstart .dw $0000 .dw TitleStr ;----------------------------------------------------------------- ASMstart: call _runindicoff ;turn off the run indicator call _clrScrn ;clear the LCD and text shadow ld hl,$0001 ld (_penCol),hl ;setup the pencol and penRow ld hl,TitleStr ;the title call _vputs ;put it on the LCD ld hl,$FC00 ;load hl with the address of the video mem call Invert ;invert 7 lines at the top of the screen call ExistfStat call ExistxStat call ExistyStat jp Setup ExistfStat: ld hl,$0802 ld (_penCol),hl ld hl,fStat+1 ;output "fStat" to the screen call _vputs ld a,$5E ld (_penCol),a ld hl,fStat-1 ;put stat name in hl rst 20h ;move10toop1 rst 10h ;findsym call nc,SetYes ;set hl with the address of "Yes" if fStat found call c,SetNo ;no if not found call _vputs ;put it to the screen ret ExistxStat: ld hl,$0F02 ;same for xStat ld (_penCol),hl ld hl,xStat+1 call _vputs ld a,$5E ld (_penCol),a ld hl,xStat-1 rst 20h rst 10h call nc,SetYes call c,SetNo call _vputs ret ExistyStat: ld hl,$1602 ;and yStat too ld (_penCol),hl ld hl,yStat+1 call _vputs ld a,$5E ld (_penCol),a ld hl,yStat-1 rst 20h rst 10h call nc,SetYes call c,SetNo call _vputs ret Setup: ld hl,Pos ;set up the scroll bar. ld (hl),$01 call MakeNew ;draw it. GetKey: call _getkey cp kExit jp z,Exit cp kUp call z,MoveUp cp kDown call z,MoveDown cp kDel jp z,DelWhich jp GetKey DelWhich: ;figure out which one the cursor is over ld a,(Pos) cp $01 ;if Pos=1 then Delete fStat jp z,DelfStat cp $02 jp z,DelxStat ;and so on cp $03 jp z,DelyStat DelfStat: ld hl,fStat-1 ;put stat name in hl rst 20h rst 10h call nc,_delvar ;delete if it exists call DelOld call ExistfStat call MakeNew jp GetKey DelxStat: ld hl,xStat-1 ;same as fStat rst 20h rst 10h call nc,_delvar call DelOld call ExistxStat call MakeNew jp GetKey DelyStat: ld hl,yStat-1 ;same rst 20h rst 10h call nc,_delvar call DelOld call ExistyStat call MakeNew jp GetKey SetNo: ld hl,No ;load hl with the adress of "No" ret SetYes: ld hl,Yes ;load with "Yes" ret MoveUp: call DelOld ;delete old bar ld hl,Pos ;find out where the bar was dec (hl) ld a,$00 cp (hl) ;check if it should be scrolled call z,JumpDown ; if yes then goto Jump Down call MakeNew ;draw the new bar xor a ret MoveDown: call DelOld ld hl,Pos inc (hl) ld a,$04 cp (hl) call z,JumpUp call MakeNew xor a ret JumpUp: ld hl,Pos ;check position pointer ld (hl),$01 ;put it back at the top ret JumpDown: ld hl,Pos ld (hl),$03 ret MakeNew: ld a,(Pos) ;load the position 1-7 ld h,a ;into h ld l,$70 ; call MUL_HL ld de,$FC10 ;add offset add hl,de call Invert ;draw the bar ret DelOld: ld a,(Pos) ld h,a ld l,$70 call MUL_HL ld de,$FC10 add hl,de call Invert ret Invert: ld bc,112 InvertLoop: ld a,(hl) cpl ld (hl),a inc hl dec bc ld a,b or c jr nz,InvertLoop ret Exit: jp _clrScrn ;---------Text--------- Yes: .db "Yes",0 No: .db "No ",0 Pos: .db 0 fStat: .db $5,"fStat",0 xStat: .db $5,"xStat",0 yStat: .db $5,"yStat",0 TitleStr: .db "Stat Remover v2.0 Detected?",0 Detected: .db "Detected?",0 .end