;GroupTool v1.1 by Brandon Wilson ;11/21/05 - 04/27/06 ; ;GroupTool is a TI-83 Plus Flash application that will let you view the contents of any group variable on the ;calculator without ungrouping it first. You can ungroup individual variables from any group variable. ; ;You can also hide and unhide group variables from the TI-OS menu while still able to extract from them. ; ;Please do not modify the contents of this file or republish it without both my prior knowledge and permission. include "ti83plus.inc" EXT_APP equ 1 ;This definition is required of all apps cseg ;This linker directive is required of all apps. db 080h,0Fh ;Field: Program length db 00h,00h,00h,00h ;Length=0 (N/A for unsigned apps) db 080h,012h ;Field: Program type db 01h,04h ;Type= Shareware, TI-83Plus db 080h,021h ;Field: App ID db 01h ;Id = 1 db 080h,031h ;Field: App Build db 01h ;Build = 1 db 080h,048h ;Field: App Name db "GrpTool " ;Name = "GrpTool " must be 8 characters db 080h,081h ;Field: App Pages db 01h ;App Pages = 1 db 080h,090h ;No default splash screen db 03h,026h ,09h,04h, 04h,06fh,01bh,80h ;Field: Date stamp- 5/12/1999 db 02h,0dh,040h ;Dummy encrypted TI date stamp signature db 0a1h ,06bh ,099h ,0f6h ,059h ,0bch ,067h db 0f5h ,085h ,09ch ,09h ,06ch ,0fh ,0b4h ,03h ,09bh ,0c9h db 03h ,032h ,02ch ,0e0h ,03h ,020h ,0e3h ,02ch ,0f4h ,02dh db 073h ,0b4h ,027h ,0c4h ,0a0h ,072h ,054h ,0b9h ,0eah ,07ch db 03bh ,0aah ,016h ,0f6h ,077h ,083h ,07ah ,0eeh ,01ah ,0d4h db 042h ,04ch ,06bh ,08bh ,013h ,01fh ,0bbh ,093h ,08bh ,0fch db 019h ,01ch ,03ch ,0ech ,04dh ,0e5h ,075h db 80h,7Fh ;Field: Program Image length db 0,0,0,0 ;Length=0, N/A db 0,0,0,0 ;Reserved db 0,0,0,0 ;Reserved db 0,0,0,0 ;Reserved db 0,0,0,0 ;Reserved _MoveToNextSym equ 4A53h bSelectedItem equ appBackUpScreen bTemp equ appBackUpScreen+1 bName equ appBackUpScreen+2 symTablePtr equ appBackUpScreen+11 wTemp equ appBackUpScreen+13 bTopScreenItem equ appBackUpScreen+15 bCurScreenItem equ appBackUpScreen+16 bNumVars equ appBackUpScreen+17 wSymTemp equ appBackUpScreen+18 wSymTemp2 equ appBackUpScreen+20 romPage equ appBackUpScreen+22 romOffset equ appBackUpScreen+23 bTemp2 equ appBackUpScreen+25 wEndOffset equ appBackUpScreen+26 wEndPage equ appBackUpScreen+28 bSelectedItem2 equ appBackUpScreen+29 bVarType equ appBackUpScreen+30 bSelectedItemScr equ appBackUpScreen+31 bSelectedItem3 equ appBackUpScreen+32 wStartOffset equ appBackUpScreen+33 bStartPage equ appBackUpScreen+35 bInsName equ appBackUpScreen+36 bTemp3 equ appBackUpScreen+45 bDispType equ appBackUpScreen+46 ;0 = alphabetic; 1 = size; 2 = type bIndex equ appBackUpScreen+47 wVarSize equ appBackUpScreen+48 bNumVars2 equ appBackUpScreen+50 bBuffer equ appBackUpScreen+51 ;array of 3-byte structs, word for offset and byte for page groupToolFlags equ asm_Flag1 showHidden equ 0 showVisible equ 1 showAll equ 2 varFound equ 3 ;temp for myFindAlphaUp curMenu equ 4 overwriteOffset equ 5 ungrpToFlash equ 6 renameGroup equ 7 startApp: B_CALL ForceFullScreen B_CALL CanAlphIns xor a ld (winTop),a B_CALL ClrLCDFull B_CALL HomeUp ld a,1 ld (bSelectedItem),a call setTextInverse ld hl,bTitleText call PutSApp call resTextInverse B_CALL NewLine ld b,1 ld hl,bViewText ld de,16 dispMenuLoop: ld a,(bSelectedItem) cp b call z,setTextInverse ld a,b add a,30h B_CALL PutC ld a,':' B_CALL PutC call resTextInverse push hl call PutSApp pop hl add hl,de B_CALL NewLine inc b ld a,b cp 5 jr nz,dispMenuLoop ld hl,57*256 ld (penCol),hl ld hl,bAboutText ld de,statVars ld bc,33 ldir ld hl,statVars B_CALL VPutS menuKeyLoop: B_CALL GetKey cp kClear jr z,exitApp cp kQuit jr z,exitApp cp kUp jr z,menuUp cp kDown jr z,menuDown cp kEnter jr z,menuEnter cp k1 jp m,menuKeyLoop cp k5 jp p,menuKeyLoop sub k1-1 ld (bSelectedItem),a executeChoice: ld hl,wMenuJumpTable-16 ld de,16 ld b,a execLoop: add hl,de djnz execLoop ld a,(hl) ld e,a inc hl ld a,(hl) ld d,a ex de,hl jp (hl) menuEnter: ld a,(bSelectedItem) jr executeChoice menuUp: ld a,(bSelectedItem) cp 1 jr nz,menuUpGood ld (curRow),a xor a ld (curCol),a ld a,31h B_CALL PutC ld a,':' B_CALL PutC ld a,4 ld (bSelectedItem),a ld (curRow),a xor a ld (curCol),a ld a,34h call setTextInverse B_CALL PutC ld a,':' B_CALL PutC call resTextInverse jr menuKeyLoop menuUpGood: ld (curRow),a xor a ld (curCol),a ld a,(bSelectedItem) add a,30h B_CALL PutC ld a,':' B_CALL PutC ld a,(bSelectedItem) dec a ld (bSelectedItem),a ld (curRow),a xor a ld (curCol),a ld a,(bSelectedItem) add a,30h call setTextInverse B_CALL PutC ld a,':' B_CALL PutC call resTextInverse jr menuKeyLoop menuDown: ld a,(bSelectedItem) cp 4 jr nz,menuDownGood ld (curRow),a xor a ld (curCol),a ld a,34h B_CALL PutC ld a,':' B_CALL PutC ld a,1 ld (bSelectedItem),a ld (curRow),a xor a ld (curCol),a ld a,31h call setTextInverse B_CALL PutC ld a,':' B_CALL PutC call resTextInverse jr menuKeyLoop menuDownGood: ld (curRow),a xor a ld (curCol),a ld a,(bSelectedItem) add a,30h B_CALL PutC ld a,':' B_CALL PutC ld a,(bSelectedItem) inc a ld (bSelectedItem),a ld (curRow),a xor a ld (curCol),a ld a,(bSelectedItem) add a,30h call setTextInverse B_CALL PutC ld a,':' B_CALL PutC call resTextInverse jr menuKeyLoop exitApp: res lwrCaseActive,(iy+appLwrCaseFlag) B_CALL ClrLCDFull B_CALL HomeUp B_JUMP JForceCmdNoChar groupVar: res appAutoScroll,(iy+appFlags) res renameGroup,(iy+groupToolFlags) B_CALL ClrLCDFull B_CALL HomeUp ld a,(bSelectedItem) cp 2 jr z,showVisibleVars cp 3 jr z,showHiddenVars showAllVars: set showAll,(iy+groupToolFlags) res showHidden,(iy+groupToolFlags) res showVisible,(iy+groupToolFlags) jr titleContinue showVisibleVars: res showAll,(iy+groupToolFlags) res showHidden,(iy+groupToolFlags) set showVisible,(iy+groupToolFlags) jr titleContinue showHiddenVars: res showAll,(iy+groupToolFlags) set showHidden,(iy+groupToolFlags) res showVisible,(iy+groupToolFlags) titleContinue: call setTextInverse ld hl,sSelectVar call PutSApp call resTextInverse B_CALL NewLine ld hl,symTable ld (symTablePtr),hl ld hl,bDummyVar rst 20h call myFindAlphaUp jr c,noneFound ld hl,bDummyVar rst 20h xor a ld (bNumVars),a findLoop: call myFindAlphaUp jr c,findLoopDone ld a,(bNumVars) inc a ld (bNumVars),a jr findLoop findLoopDone: ld hl,bDummyVar rst 20h call myFindAlphaUp xor a ld (bTemp),a ld (bSelectedItem),a ld (bTopScreenItem),a inc a ld (bCurScreenItem),a groupDispLoop: ld a,(bTemp) ld b,a ld a,(bTopScreenItem) add a,b ld b,a ld a,(bSelectedItem) cp b call z,setTextInverse ld a,b add a,31h call setCorrectNum push bc B_CALL PutC pop bc ld a,b call setColonArrow B_CALL PutC call resTextInverse ld hl,op1+1 call PutSApp B_CALL EraseEOL B_CALL NewLine call myFindAlphaUp jr c,groupKeyLoop ld a,(bTemp) inc a ld (bTemp),a cp 7 jr nz,groupDispLoop groupKeyLoop: B_CALL GetKey cp kClear jr z,startApp cp kQuit jr z,exitApp cp kUp jr z,groupUp cp kDown jr z,groupDown cp kEnter jr nz,gklCont ld a,(bSelectedItem) jr groupEnter gklCont: cp k0 jp m,groupKeyLoop cp kCapZ jp p,groupKeyLoop cp kEE jr z,groupKeyLoop cp kSpace jr z,groupKeyLoop cp k0 jr nz,execContinue ld a,9 ld (bSelectedItem),a jr groupEnter execContinue: cp kCapA jp p,execContinue2 jr z,execContinue2 sub k0 dec a ld (bSelectedItem),a jr groupEnter execContinue2: sub kCapA add a,10 ld (bSelectedItem),a jr groupEnter setCorrectNum: cp 30h jp m,scnNothing cp 3Ah jr z,scnZero ret m add a,6 cp LcapZ+1 ret m scnNothing: ld a,' ' ret scnZero: ld a,'0' ret changeStatus: ld hl,bDummyVar rst 20h ld a,(bSelectedItem) inc a ld b,a csLoop: push bc call myFindAlphaUp pop bc djnz csLoop ld hl,(wSymTemp2) ld de,7 or a sbc hl,de ld a,(hl) cp 40h jp m,csSwitchToVisible sub 40h ld (hl),a jr startApp csSwitchToVisible: add a,40h ld (hl),a jr startApp groupUp: ld a,(bSelectedItem) or a jr z,groupKeyLoop ;scrolling necessary? ld a,(bCurScreenItem) cp 1 jr z,upScrolling ld (curRow),a xor a ld (curCol),a ld a,(bSelectedItem) add a,31h call setCorrectNum B_CALL PutC ld a,(bSelectedItem) call setColonArrow B_CALL PutC ld a,(bCurScreenItem) dec a ld (curRow),a ld (bCurScreenItem),a xor a ld (curCol),a ld a,(bSelectedItem) dec a ld (bSelectedItem),a call setTextInverse add a,31h call setCorrectNum B_CALL PutC ld a,(bSelectedItem) call setColonArrow B_CALL PutC call resTextInverse jr groupKeyLoop upScrolling: ld a,(bTopScreenItem) dec a ld (bTopScreenItem),a ld a,(bSelectedItem) dec a ld (bSelectedItem),a xor a ld (bTemp),a ld hl,0001h ld (curRow),hl ld hl,bDummyVar rst 20h ld a,(bTopScreenItem) inc a ld b,a upScrollingLoop: push bc call myFindAlphaUp pop bc djnz upScrollingLoop jr groupDispLoop groupDown: ld a,(bNumVars) ld b,a ld a,(bSelectedItem) inc a cp b jr z,groupKeyLoop ld a,(bCurScreenItem) cp 7 jr z,downScrolling ld (curRow),a xor a ld (curCol),a ld a,(bSelectedItem) add a,31h call setCorrectNum B_CALL PutC ld a,(bSelectedItem) call setColonArrow B_CALL PutC ld a,(bCurScreenItem) inc a ld (bCurScreenItem),a ld (curRow),a xor a ld (curCol),a ld a,(bSelectedItem) inc a ld (bSelectedItem),a call setTextInverse add a,31h call setCorrectNum B_CALL PutC ld a,(bSelectedItem) call setColonArrow B_CALL PutC call resTextInverse jr groupKeyLoop downScrolling: ld a,(bTopScreenItem) inc a ld (bTopScreenItem),a ld a,(bSelectedItem) inc a ld (bSelectedItem),a xor a ld (bTemp),a ld hl,0001h ld (curRow),hl ld hl,bDummyVar rst 20h ld a,(bTopScreenItem) inc a ld b,a downScrollingLoop: push bc call myFindAlphaUp pop bc djnz downScrollingLoop jr groupDispLoop groupEnter: ld b,a ld a,(bNumVars) cp b jp m,groupKeyLoop ld a,b ld (bSelectedItem),a bit renameGroup,(iy+groupToolFlags) jr nz,renameVar bit showAll,(iy+groupToolFlags) jr z,changeStatus res curMenu,(iy+groupToolFlags) ld a,2 ld (bDispType),a ld hl,bBuffer ld b,233 eraseBufferLoop: ld (hl),0 inc hl djnz eraseBufferLoop jr unselectAll ;----------------------------------------------------------------------------- renameVar: set lwrCaseActive,(iy+appLwrCaseFlag) B_CALL ClrLCDFull ld hl,0107h ld (curRow),hl ld hl,bDummyVar rst 20h ld a,(bSelectedItem) inc a ld b,a renLoop: push bc call myFindAlphaUp pop bc djnz renLoop ld hl,op1+1 call PutSApp ld hl,curCol ld (hl),10 ld hl,sGroupType call PutSApp renStartOver: B_CALL ClrTxtShd B_CALL HomeUp B_CALL EraseEOL ld hl,sNamePrompt call PutSApp ld hl,bInsName ld (wTemp),hl ld de,bInsName+1 ld (hl),0 ld bc,9 ldir ld a,' ' ld (curUnder),a renKeyLoop2: B_CALL CursorOn renKeyLoop: B_CALL GetKey cp kClear jr z,renStartOver cp kLeft jr z,renLeft cp kRight jr z,renRight cp kQuit jr z,exitApp cp kEnter jr z,renDone cp 0FCh jr nz,renContinueNormal ld a,(keyExtend) cp k83_00End+73 jp m,renKeyLoop cp k83_00End+98+1 jp p,renKeyLoop sub k83_00End+73-61h jr renContinue renContinueNormal: cp k0 jp m,renKeyLoop cp kEE jr z,renKeyLoop cp kSpace jr z,renKeyLoop cp kCapZ+1 jp p,renKeyLoop B_CALL CursorOff cp kCapA jp p,renIsLetter ld b,a ld hl,(wTemp) ld de,bInsName B_CALL cphlde jr z,renKeyLoop2 ld a,b sub k0-30h jr renContinue renIsLetter: sub kCapA-41h renContinue: push af B_CALL CursorOff pop af ld hl,(wTemp) ld (hl),a B_CALL PutMap ld (curUnder),a ld hl,curCol ld a,12 cp (hl) jr z,renKeyLoop2 inc (hl) ld hl,(wTemp) inc hl ld (wTemp),hl ld a,' ' ld (curUnder),a jr renKeyLoop2 renLeft: B_CALL CursorOff ld hl,(wTemp) ld de,bInsName B_CALL cphlde jr z,renKeyLoop2 dec hl ld (wTemp),hl ld hl,curCol ld a,5 cp (hl) jr z,renKeyLoop2 dec (hl) jr renKeyLoop2 renRight: B_CALL CursorOff ld hl,(wTemp) xor a cp (hl) jr z,renKeyLoop2 ld hl,curCol ld a,12 cp (hl) jr z,renKeyLoop2 inc (hl) ld hl,(wTemp) inc hl ld (wTemp),hl ld a,' ' ld (curUnder),a jr renKeyLoop2 renDone: B_CALL CursorOff B_CALL op1toop5 B_CALL ChkFindSym dec hl dec hl dec hl dec hl dec hl ld de,bBuffer ld bc,5 ldir ld hl,bInsName-1 rst 20h ld a,05h ld (op1),a B_CALL ChkFindSym jr nc,memHandler ld hl,0 B_CALL CreateProg ld (hl),17h dec hl dec hl dec hl dec hl dec hl ld (wTemp),de ex de,hl ld hl,bBuffer ld bc,5 ldir B_CALL op5toop1 B_CALL ChkFindSym dec hl dec hl dec hl ld de,(wTemp) ld a,e ld (hl),a dec hl ld a,d ld (hl),a dec hl ld (hl),0 B_CALL ChkFindSym B_CALL DelVarArc jr startApp ;----------------------------------------------------------------------------- dispContents: res ungrpToFlash,(iy+groupToolFlags) set fullScrnDraw,(iy+apiFlg4) B_CALL ClrLCDFull B_CALL GrBufClr B_CALL HomeUp bit curMenu,(iy+groupToolFlags) call z,setTextInverse ld hl,sSelect call PutSApp call resTextInverse ld hl,curCol inc (hl) bit curMenu,(iy+groupToolFlags) call nz,setTextInverse ld hl,sExtract call PutSApp call resTextInverse B_CALL NewLine ld hl,skgData bit curMenu,(iy+groupToolFlags) jr nz,extractKey B_CALL HomeUp call SoftKey ld hl,bDummyVar rst 20h ld a,(bSelectedItem) inc a ld b,a geLoop: push bc call myFindAlphaUp pop bc djnz geLoop ld hl,(wSymTemp2) dec hl dec hl dec hl ld a,(hl) ld e,a dec hl ld a,(hl) ld d,a dec hl ld a,(hl) ld (romPage),a ld b,a ex de,hl ld (romOffset),hl xor a ld (bTemp),a ld (bSelectedItem2),a call myLoadCIndPaged call myLoadDEIndPaged inc de inc de inc de ld hl,(romOffset) ld a,(romPage) ld b,a call BHL_plus_DE ld (wEndOffset),hl ld a,b ld (wEndPage),a ld hl,(romOffset) ld a,(romPage) ld b,a ld de,9 call BHL_plus_DE call myLoadCIndPaged ld d,0 ld e,c inc de inc de call BHL_plus_DE xor a ld (bSelectedItem3),a ld (bSelectedItemScr),a ld (bTopScreenItem),a ld (wStartOffset),hl ld a,b ld (bStartPage),a xor a ld (bNumVars2),a findNumVarsLoop: ld a,(bNumVars2) inc a ld (bNumVars2),a res overwriteOffset,(iy+groupToolFlags) call traverseGroupVar jr nc,findNumVarsLoop dispContentsLoop: ld a,(bTopScreenItem) ld (bTemp3),a dcl1: set overwriteOffset,(iy+groupToolFlags) ld a,(bTemp3) inc a call traverseGroupVar push af B_CALL NewLine ld a,(bSelectedItemScr) ld b,a ld a,(bTemp) cp b jr z,_dclSelected ld hl,bBuffer-3 ld de,3 ld a,(bTemp3) inc a ld b,a _disp1: add hl,de djnz _disp1 bit 7,(hl) jr z,_dclu1 ld a,Lblock jr _dclDone _dclu1: ld a,' ' jr _dclDone _dclSelected: ld hl,bBuffer-3 ld de,3 ld a,(bTemp3) inc a ld b,a _disp2: add hl,de djnz _disp2 bit 7,(hl) jr z,_dclu2 ld a,LblockArrow jr _dclDone _dclu2: ld a,Lconvert _dclDone: B_CALL PutC call fixNames ld hl,bInsName call PutSApp B_CALL EraseEOL call dispVarType pop af jr c,dispContentsLoopDone ld a,(bTemp3) inc a ld (bTemp3),a ld a,(bTemp) inc a ld (bTemp),a cp 6 jr nz,dcl1 dispContentsLoopDone: ld hl,0001h ld (curRow),hl dispContentsKeyLoop: B_CALL GetKey cp kClear jr z,contentClear cp kQuit jr z,exitApp cp kLeft jr z,dcSwitch cp kRight jr z,dcSwitch cp kUp jr z,dcUp cp kDown jr z,dcDown cp kTrace jr z,selectAll cp kGraph jr z,unselectAll cp kEnter jr z,dispContentsEnter jr dispContentsKeyLoop contentClear: set showAll,(iy+groupToolFlags) res showHidden,(iy+groupToolFlags) res showVisible,(iy+groupToolFlags) ld a,1 ld (bSelectedItem),a jr groupVar dispContentsEnter: ld hl,bBuffer-3 ld de,3 ld a,(bSelectedItem3) inc a ld b,a dceLoop: add hl,de djnz dceLoop bit 7,(hl) jr z,dceSelect res 7,(hl) call dispPosition jr dispContentsKeyLoop dceSelect: set 7,(hl) call dispPosition jr dispContentsKeyLoop selectAll: ld hl,bBuffer ld de,3 ld b,233 saLoop: set 7,(hl) add hl,de djnz saLoop jr dispContents unselectAll: ld hl,bBuffer ld de,3 ld b,233 uaLoop: res 7,(hl) add hl,de djnz uaLoop jr dispContents dcSwitch: bit curMenu,(iy+groupToolFlags) jr z,dcSwitchTo2 res curMenu,(iy+groupToolFlags) jr dispContents dcSwitchTo2: set curMenu,(iy+groupToolFlags) jr dispContents extractKey: ld hl,0001h ld (curRow),hl bit ungrpToFlash,(iy+groupToolFlags) call z,setTextInverse ld a,'1' B_CALL PutC ld a,':' B_CALL PutC call resTextInverse ld hl,sExtractChoice1 call PutSApp B_CALL NewLine bit ungrpToFlash,(iy+groupToolFlags) call nz,setTextInverse ld a,'2' B_CALL PutC ld a,':' B_CALL PutC call resTextInverse ld hl,sExtractChoice2 call PutSApp extractKeyLoop: B_CALL GetKey cp kClear jr z,contentClear cp kQuit jr z,exitApp cp kLeft jr z,dcSwitch cp kRight jr z,dcSwitch cp kEnter jr z,eklEnter cp kUp jr z,eklUpDown cp kDown jr z,eklUpDown cp k1 jr z,ekl1 cp k2 jr z,ekl2 jr extractKeyLoop ekl1: res ungrpToFlash,(iy+groupToolFlags) jr eklEnter ekl2: set ungrpToFlash,(iy+groupToolFlags) jr eklEnter eklUpDown: bit ungrpToFlash,(iy+groupToolFlags) jr z,eklToFlash res ungrpToFlash,(iy+groupToolFlags) jr extractKey eklToFlash: set ungrpToFlash,(iy+groupToolFlags) jr extractKey eklEnter: B_CALL ClrLCDFull B_CALL HomeUp ld hl,bExtractText call PutSApp B_CALL NewLine xor a ld (bTemp),a _findVarsLoop: ld a,(bTemp) inc a ld (bTemp),a call traverseGroupVar push af ld a,(bIndex) ld b,a ld hl,bBuffer-3 ld de,3 _getVar: add hl,de djnz _getVar bit 7,(hl) jr z,_unselectedVar ld hl,curCol inc (hl) ld hl,bInsName ld de,bName+1 ld bc,9 ldir ld a,(bVarType) ld (bName),a call fixNames ld hl,bInsName call PutSApp call dispVarType ld hl,memHandler call APP_PUSH_ERRORH call extractVar ;this is the kicker bit ungrpToFlash,(iy+groupToolFlags) jr z,_skipArchive ld hl,_skipArchive call APP_PUSH_ERRORH ld hl,bName rst 20h B_CALL Arc_Unarc ld hl,curCol ld (hl),0 ld a,'*' B_CALL PutC call APP_POP_ERRORH _skipArchive: call APP_POP_ERRORH set appAutoScroll,(iy+appFlags) B_CALL NewLine _unselectedVar: pop af jr c,_findVarsLoopDone jr _findVarsLoop _findVarsLoopDone: res appAutoScroll,(iy+appFlags) B_CALL DispDone B_CALL GetKey cp kQuit jr z,exitApp jr startApp extractVar: ld hl,bBuffer-3 ld de,3 ld a,(bIndex) ld b,a evLoop: add hl,de djnz evLoop ld a,(hl) and 01111111b ld b,a inc hl ld a,(hl) ld e,a inc hl ld a,(hl) ld d,a ex de,hl ld a,(bVarType) and 01Fh cp 0Bh jr z,createWind cp 0Fh jr z,createWind cp 10h jr z,createWind cp 07h jr z,createPic cp 04h jr z,createString cp 02h jr z,createMatrix cp 03h jr z,createYVar cp 11h jr z,createTable cp 08h jr z,createGDB cp 01h jr z,createRList cp 0Dh jr z,createCList cp 05h jr z,createProgram cp 06h jr z,createProtProgram cp 15h jr z,createAppVar or a jr z,createReal ret memHandler: B_CALL ClrLCDFull B_CALL HomeUp call setTextInverse ld hl,sErrMem call PutSApp call resTextInverse B_CALL NewLine call setTextInverse ld a,'1' B_CALL PutC ld a,':' B_CALL PutC call resTextInverse ld hl,sQuit call PutSApp mhKeyLoop: B_CALL GetKey cp kQuit jr z,exitApp cp kClear jr z,startApp cp kEnter jr z,startApp jr mhKeyLoop createReal: call myLoadCIndPaged xor a ld (op1),a ld de,5 call BHL_plus_DE call myLoadCIndPaged ld de,op1+1 ld a,c ld (de),a inc de xor a ld (de),a call myLoadDEIndPaged ld a,b ld (romPage),a ld (romOffset),hl B_CALL FindSym jr c,_crSkipDel B_CALL DelVarArc _crSkipDel: B_CALL CreateReal ld a,(romPage) ld hl,(romOffset) ld bc,9 B_CALL FlashToRam ret createWind: ld de,9 call BHL_plus_DE call myLoadDEIndPaged ld a,0D0h cp e jr nz,_cwSkipUnknown call myLoadCIndPaged _cwSkipUnknown: ld (romOffset),hl ld a,b ld (romPage),a call cwWriteFP ld a,XMINt B_CALL StoSysTok call cwWriteFP ld a,XMAXt B_CALL StoSysTok call cwWriteFP ld a,XSCLt B_CALL StoSysTok call cwWriteFP ld a,YMINt B_CALL StoSysTok call cwWriteFP ld a,YMAXt B_CALL StoSysTok call cwWriteFP ld a,YSCLt B_CALL StoSysTok call cwWriteFP ld a,THETMINt B_CALL StoSysTok call cwWriteFP ld a,THETMAXt B_CALL StoSysTok call cwWriteFP ld a,THETSTEPt B_CALL StoSysTok call cwWriteFP ld a,TMINt B_CALL StoSysTok call cwWriteFP ld a,TMAXt B_CALL StoSysTok call cwWriteFP ld a,TSTEPt B_CALL StoSysTok call cwWriteFP ld a,PLOTSTARTt B_CALL StoSysTok call cwWriteFP ld a,NMAXt B_CALL StoSysTok call cwWriteFP call cwWriteFP call cwWriteFP ld a,NMINt B_CALL StoSysTok call cwWriteFP call cwWriteFP call cwWriteFP call cwWriteFP ld a,PLOTSTEPt B_CALL StoSysTok call cwWriteFP ld a,XRESt B_CALL StoSysTok ret cwWriteFP: ld a,(romPage) ld b,a ld hl,(romOffset) ld de,op1 call myLoadCIndPaged ld a,c ld (de),a inc de call myLoadCIndPaged ld a,c ld (de),a inc de call myLoadCIndPaged ld a,c ld (de),a inc de call myLoadCIndPaged ld a,c ld (de),a inc de call myLoadCIndPaged ld a,c ld (de),a inc de call myLoadCIndPaged ld a,c ld (de),a inc de call myLoadCIndPaged ld a,c ld (de),a inc de call myLoadCIndPaged ld a,c ld (de),a inc de call myLoadCIndPaged ld a,c ld (de),a ld (romOffset),hl ld a,b ld (romPage),a ret createGDB: call myLoadCIndPaged ld a,c ld (op1),a ld de,5 call BHL_plus_DE ld de,op1+1 ld (wVarSize),de ld d,3 cgdbNameLoop: push de call myLoadCIndPaged ld a,c ld de,(wVarSize) ld (de),a inc de ld (wVarSize),de pop de dec d jr nz,cpicNameLoop ld de,(wVarSize) xor a ld (de),a call myLoadDEIndPaged ld (wVarSize),de ld a,b ld (romPage),a ld (romOffset),hl B_CALL FindSym jr c,_cgSkipDel B_CALL DelVarArc _cgSkipDel: ld hl,(wVarSize) B_CALL CreateProg inc de inc de ld a,(romPage) ld hl,(romOffset) ld bc,(wVarSize) B_CALL FlashToRam B_CALL op4toop1 B_CALL ChkFindSym ld (hl),08h ret createPic: call myLoadCIndPaged ld a,c ld (op1),a ld de,5 call BHL_plus_DE ld de,op1+1 ld (wVarSize),de ld d,3 cpicNameLoop: push de call myLoadCIndPaged ld a,c ld de,(wVarSize) ld (de),a inc de ld (wVarSize),de pop de dec d jr nz,cpicNameLoop ld de,(wVarSize) xor a ld (de),a call myLoadDEIndPaged ld (wVarSize),de ld a,b ld (romPage),a ld (romOffset),hl B_CALL FindSym jr c,_cpicSkipDel B_CALL DelVarArc _cpicSkipDel: ld hl,(wVarSize) B_CALL CreatePict inc de inc de ld a,(romPage) ld hl,(romOffset) ld bc,(wVarSize) B_CALL FlashToRam ret createString: call myLoadCIndPaged ld a,c ld (op1),a ld de,5 call BHL_plus_DE ld de,op1+1 ld (wVarSize),de ld d,3 csNameLoop: push de call myLoadCIndPaged ld a,c ld de,(wVarSize) ld (de),a inc de ld (wVarSize),de pop de dec d jr nz,csNameLoop ld de,(wVarSize) xor a ld (de),a call myLoadDEIndPaged ld (wVarSize),de ld a,b ld (romPage),a ld (romOffset),hl B_CALL FindSym jr c,_csSkipDel B_CALL DelVarArc _csSkipDel: ld hl,(wVarSize) B_CALL CreateStrng inc de inc de ld hl,(romOffset) ld bc,(wVarSize) ld a,b or c ret z ld a,(romPage) B_CALL FlashToRam ret createYVar: call myLoadCIndPaged ld a,c ld (op1),a ld de,5 call BHL_plus_DE ld de,op1+1 ld (wVarSize),de ld d,3 cyNameLoop: push de call myLoadCIndPaged ld a,c ld de,(wVarSize) ld (de),a inc de ld (wVarSize),de pop de dec d jr nz,cyNameLoop ld de,(wVarSize) xor a ld (de),a call myLoadDEIndPaged ld (wVarSize),de ld a,b ld (romPage),a ld (romOffset),hl B_CALL FindSym jr c,_cySkipDel B_CALL DelVarArc _cySkipDel: ld hl,(wVarSize) B_CALL CreateEqu inc de inc de ld hl,(romOffset) ld bc,(wVarSize) ld a,b or c ret z ld a,(romPage) B_CALL FlashToRam ret createMatrix: ld de,6 call BHL_plus_DE ld a,02h ld (op1),a ld de,op1+1 ld (wVarSize),de ld d,3 cmNameLoop: push de call myLoadCIndPaged ld a,c ld de,(wVarSize) ld (de),a inc de ld (wVarSize),de pop de dec d jr nz,cmNameLoop ld de,(wVarSize) xor a ld (de),a call myLoadDEIndPaged ld (wVarSize),de ld a,b ld (romPage),a ld (romOffset),hl B_CALL FindSym jr c,_cmSkipDel B_CALL DelVarArc _cmSkipDel: ld hl,(wVarSize) B_CALL CreateRMat push bc ld bc,(wVarSize) ld a,b or c pop bc ret z inc de inc de ld a,(romPage) ld hl,(romOffset) push af push hl ld hl,(wVarSize) push de B_CALL htimesl pop de push hl pop bc ld hl,0 _cmSizeLoop: inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl dec bc ld a,b or c jr nz,_cmSizeLoop push hl pop bc pop hl pop af B_CALL FlashToRam ret createCList: ld a,0Dh ld (op1),a ld de,op1+1 ld (wVarSize),de ld de,6 call BHL_plus_DE call myLoadCIndPaged ld d,c cclNameSkip: push de call myLoadCIndPaged ld a,c ld de,(wVarSize) ld (de),a inc de ld (wVarSize),de pop de dec d jr nz,cclNameSkip ld de,(wVarSize) xor a ld (de),a call myLoadDEIndPaged ld (wVarSize),de ld a,b ld (romPage),a ld (romOffset),hl B_CALL FindSym jr c,_cclSkipDel B_CALL DelVarArc _cclSkipDel: ld hl,(wVarSize) B_CALL CreateCList inc de inc de push bc ld bc,(wVarSize) ld a,b or c pop bc ret z ld a,(romPage) push af ld hl,(romOffset) ld bc,(wVarSize) ld a,b or c ret z push hl ld hl,0 _cclSizeLoop: inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl dec bc ld a,b or c jr nz,_cclSizeLoop push hl pop bc pop hl pop af B_CALL FlashToRam ret createRList: ld a,01h ld (op1),a ld de,op1+1 ld (wVarSize),de ld de,6 call BHL_plus_DE call myLoadCIndPaged ld d,c crlNameSkip: push de call myLoadCIndPaged ld a,c ld de,(wVarSize) ld (de),a inc de ld (wVarSize),de pop de dec d jr nz,crlNameSkip ld de,(wVarSize) xor a ld (de),a call myLoadDEIndPaged ld (wVarSize),de ld a,b ld (romPage),a ld (romOffset),hl B_CALL FindSym jr c,_crlSkipDel B_CALL DelVarArc _crlSkipDel: ld hl,(wVarSize) B_CALL CreateRList inc de inc de push bc ld bc,(wVarSize) ld a,b or c pop bc ret z ld a,(romPage) push af ld hl,(romOffset) ld bc,(wVarSize) ld a,b or c ret z push hl ld hl,0 _crlSizeLoop: inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl inc hl dec bc ld a,b or c jr nz,_crlSizeLoop push hl pop bc pop hl pop af B_CALL FlashToRam ret createTable: ld de,11 call BHL_plus_DE push hl push bc ld a,b ld de,op1 ld bc,9 B_CALL FlashToRam ld a,TBLMINt B_CALL StoSysTok pop bc pop hl ld de,9 call BHL_plus_DE ld a,b ld de,op1 ld bc,9 B_CALL FlashToRam ld a,TBLSTEPt B_CALL StoSysTok ret createProgram: ld de,6 call BHL_plus_DE call myLoadCIndPaged ld d,c cpNameSkip: push de call myLoadCIndPaged pop de dec d jr nz,cpNameSkip call myLoadDEIndPaged ld (wVarSize),de ld a,b ld (romPage),a ld (romOffset),hl ld hl,bInsName-1 rst 20h ld a,(bVarType) ld (op1),a B_CALL ChkFindSym jr c,_cpSkipDel B_CALL DelVarArc _cpSkipDel: ld hl,(wVarSize) B_CALL CreateProg inc de inc de ld hl,(romOffset) ld bc,(wVarSize) ld a,b or c ret z ld a,(romPage) B_CALL FlashToRam ret createProtProgram: ld de,6 call BHL_plus_DE call myLoadCIndPaged ld d,c cppNameSkip: push de call myLoadCIndPaged pop de dec d jr nz,cppNameSkip call myLoadDEIndPaged ld (wVarSize),de ld a,b ld (romPage),a ld (romOffset),hl ld hl,bInsName-1 rst 20h ld a,(bVarType) ld (op1),a B_CALL ChkFindSym jr c,_cppSkipDel B_CALL DelVarArc _cppSkipDel: ld hl,(wVarSize) B_CALL CreateProtProg inc de inc de ld hl,(romOffset) ld bc,(wVarSize) ld a,b or c ret z ld a,(romPage) B_CALL FlashToRam ret createAppVar: ld de,6 call BHL_plus_DE call myLoadCIndPaged ld d,c cavNameSkip: push de call myLoadCIndPaged pop de dec d jr nz,cavNameSkip call myLoadDEIndPaged ld (wVarSize),de ld a,b ld (romPage),a ld (romOffset),hl ld hl,bInsName-1 rst 20h ld a,(bVarType) ld (op1),a B_CALL ChkFindSym jr c,_cavSkipDel B_CALL DelVarArc _cavSkipDel: ld hl,(wVarSize) B_CALL CreateAppVar inc de inc de ld hl,(romOffset) ld bc,(wVarSize) ld a,b or c ret z ld a,(romPage) B_CALL FlashToRam ret fixNames: ld a,(bVarType) and 01Fh cp 02h jr z,fixMatrix cp 04h jr z,fixString cp 07h jr z,fixPic cp 03h jr z,fixEqu cp 08h jr z,fixGDB cp 10h jr z,fixWind2 cp 0Fh jr z,fixWind cp 11h jr z,fixTable cp 05h ret z cp 06h ret z cp 01h jr z,fixList cp 0Dh jr z,fixList ret fixMatrix: ld hl,bInsName ld (hl),LlBrack inc hl ld a,(hl) add a,41h ld (hl),a inc hl ld (hl),']' inc hl ld (hl),0 ret fixEqu: ld a,(bInsName+1) bit 4,a jr nz,fixEqu1 bit 5,a jr nz,fixEqu2 bit 6,a jr nz,fixEqu3 ld a,(bInsName+1) sub 80h ld hl,sEqu4 ld d,0 ld e,a add hl,de ld a,(hl) ld de,bInsName ld (de),a inc de xor a ld (de),a ret sEqu4: db "uvw" fixEqu1: ld hl,bInsName ld (hl),'Y' inc hl ld a,(bInsName+1) cp 19h jr z,fixEqu1S add a,71h fixEquF: ld (hl),a inc hl ld (hl),0 ret fixEqu1S: ld a,80h jr fixEquF fixEqu2: ld a,(bInsName+1) sub 1Fh ld b,a ld hl,sEqu2-3 ld de,3 fe2Loop: add hl,de djnz fe2Loop ld de,bInsName ld bc,3 ldir ld (hl),0 ret sEqu2: db "X",81h,LsubT db "Y",81h,LsubT db "X",82h,LsubT db "Y",82h,LsubT db "X",83h,LsubT db "Y",83h,LsubT db "X",84h,LsubT db "Y",84h,LsubT db "X",85h,LsubT db "Y",85h,LsubT db "X",86h,LsubT db "Y",86h,LsubT fixEqu3: ld hl,bInsName ld (hl),'r' inc hl ld a,(bInsName+1) add a,41h jr fixEquF fixPic: ld a,(bInsName+1) ld hl,sPic ld de,bInsName ld bc,4 ldir cp 9 jr z,fixString0 add a,31h ld (bInsName+3),a xor a ld (bInsName+4),a ret sPic: db "Pic",0,0 fixString: ld a,(bInsName+1) ld hl,sStr ld de,bInsName ld bc,4 ldir cp 9 jr z,fixString0 add a,31h ld (bInsName+3),a xor a ld (bInsName+4),a ret fixString0: ld a,'0' ld (bInsName+3),a xor a ld (bInsName+4),a ret sStr: db "Str",0,0 fixGDB: ld a,(bInsName+1) ld hl,sGDB ld de,bInsName ld bc,4 ldir cp 9 jr z,fixString0 add a,31h ld (bInsName+3),a xor a ld (bInsName+4),a ret sGDB: db "GDB",0,0 fixWind2: ld hl,sWindow ld de,bInsName ld bc,7 ldir ret fixWind: ld hl,sRclWindow ld de,bInsName ld bc,7 ldir ret fixTable: ld hl,sTblSet ld de,bInsName ld bc,7 ldir ret fixList: ld a,(bInsName+1) cp 06h jp p,fixList2 ld hl,bListNames-3 ld de,3 ld a,(bInsName+1) inc a ld b,a flLoop: add hl,de djnz flLoop ld de,bInsName ld bc,3 ldir ret fixList2: ld a,LlistL ld (bInsName),a ret bListNames: db 'L',Lsub1,0 db 'L',Lsub2,0 db 'L',Lsub3,0 db 'L',Lsub4,0 db 'L',Lsub5,0 db 'L',Lsub6,0 dcUp: ld a,(bSelectedItem3) or a jr z,dispContentsKeyLoop ld a,(bSelectedItemScr) or a jr z,dcUpScroll call dispSpace ld a,(bSelectedItem3) dec a ld (bSelectedItem3),a ld a,(bSelectedItemScr) dec a ld (bSelectedItemScr),a call dispPosition jr dispContentsKeyLoop dcUpScroll: B_CALL HomeUp ld a,(bTopScreenItem) dec a ld (bTopScreenItem),a set overwriteOffset,(iy+groupToolFlags) call traverseGroupVar ld a,(bSelectedItem3) dec a ld (bSelectedItem3),a or a jr z,dcUpSkip xor a ld (bTemp),a jr dispContentsLoop dcUpSkip: ld hl,(wStartOffset) ld (romOffset),hl ld a,(bStartPage) ld (romPage),a xor a ld (bTemp),a jr dispContentsLoop dcDown: res overwriteOffset,(iy+groupToolFlags) ld a,(bSelectedItem3) inc a call traverseGroupVar jr c,dispContentsKeyLoop ld a,(bSelectedItemScr) cp 5 jr z,dcDownScroll call dispSpace ld a,(bSelectedItem3) inc a ld (bSelectedItem3),a ld a,(bSelectedItemScr) inc a ld (bSelectedItemScr),a call dispPosition jr dispContentsKeyLoop dcDownScroll: B_CALL HomeUp ld a,(bTopScreenItem) inc a ld (bTopScreenItem),a set overwriteOffset,(iy+groupToolFlags) call traverseGroupVar ld a,(bSelectedItem3) inc a ld (bSelectedItem3),a xor a ld (bTemp),a jr dispContentsLoop dispSpace: ld a,(bSelectedItemScr) inc a ld (curRow),a xor a ld (curCol),a ld hl,bBuffer-3 ld de,3 ld a,(bSelectedItem3) inc a ld b,a _disp3: add hl,de djnz _disp3 bit 7,(hl) jr z,_dispSpace ld a,Lblock B_CALL PutC ret _dispSpace: ld a,' ' B_CALL PutC ret dispPosition: ld a,(bSelectedItemScr) inc a ld (curRow),a xor a ld (curCol),a ld hl,bBuffer-3 ld de,3 ld a,(bSelectedItem3) inc a ld b,a _disp4: add hl,de djnz _disp4 bit 7,(hl) jr z,_dispPosition ld a,LblockArrow B_CALL PutC ret _dispPosition: ld a,Lconvert B_CALL PutC ret traverseGroupVar: push af xor a ld (bIndex),a ld a,(bStartPage) ld b,a pop af ld hl,(wStartOffset) tgvLoop: push af ld a,(bIndex) inc a push hl push bc ld b,a ld hl,bBuffer-3 ld de,3 tgvbLoop: add hl,de djnz tgvbLoop pop bc ld a,(hl) or b ld (hl),a ex de,hl pop hl inc de ld a,l ld (de),a ld a,h inc de ld (de),a call myLoadCIndPaged ld a,c ld (bVarType),a ld de,5 call BHL_plus_DE call myLoadCIndPaged ld a,c ld (bTemp2),a ld de,bInsName ld a,(bVarType) and 01Fh cp 02h jr z,_gdbVar cp 04h jr z,_gdbVar cp 07h jr z,_gdbVar cp 03h jr z,_equVar cp 08h jr z,_gdbVar cp 0Fh jr z,_windVar cp 10h jr z,_windVar cp 11h jr z,_tableVar cp 0Ch jr z,_simpleVar or a jr nz,tgvLoop2 _simpleVar: ld a,(bTemp2) ld (de),a inc de xor a ld (de),a jr tgvContinue _tableVar: call myLoadDEIndPaged jr tgvContinue _windVar: call myLoadCIndPaged call myLoadCIndPaged ld a,(bTemp2) ld (de),a inc de xor a ld (de),a jr tgvContinue _equVar: _gdbVar: ld a,(bTemp2) ld (de),a inc de ld a,2 ld (bTemp2),a tgvLoop2: push de call myLoadCIndPaged pop de ld a,c ld (de),a inc de ld a,(bTemp2) dec a ld (bTemp2),a jr nz,tgvLoop2 ld (de),a call myLoadDEIndPaged tgvContinue: call _incFlash ld a,(bIndex) inc a ld (bIndex),a ld a,(wEndPage) cp b jr z,okayCrap2 jp p,notAtEnd2 okayCrap2: ld de,(wEndOffset) B_CALL cphlde jr nc,notAtEnd3 jr z,notAtEnd3 notAtEnd2: pop af dec a jr nz,tgvLoop xor a ;clear carry, screws with parent bit overwriteOffset,(iy+groupToolFlags) ret z ld (romOffset),hl ld a,b ld (romPage),a ret notAtEnd3: pop af scf ret _incFlash: ld a,(bVarType) and 01Fh cp 02h jr z,_ifMatrix cp 11h jr z,_ifTable or a jr z,_ifReal cp 0Ch jr z,_ifCplx cp 0Dh jr z,_ifCList cp 0Fh jr z,_ifWind cp 10h jr z,_ifWind cp 01h jr z,_ifList _ifNormal: call BHL_plus_DE ret _ifMatrix: push bc push hl ex de,hl B_CALL htimesl push hl pop bc ld de,0 _ifmLoop: inc de inc de inc de inc de inc de inc de inc de inc de inc de dec bc ld a,b or c jr nz,_ifmLoop pop hl pop bc call BHL_plus_DE ret _ifWind: call myLoadDEIndPaged call BHL_plus_DE ret _ifTable: ld de,20 call BHL_plus_DE ret _ifCplx: ld de,20 call BHL_plus_DE ret _ifReal: ld de,11 call BHL_plus_DE ret _ifCList: ld a,e or a jr z,_ifNormal ld c,e _ifCListLoop: ld de,18 call BHL_plus_DE dec c jr nz,_ifCListLoop ret _ifList: ld a,e or a jr z,_ifNormal ld c,e _ifListLoop: ld de,9 call BHL_plus_DE dec c jr nz,_ifListLoop ret ;----------------------------------------------------------------------------- myLoadCIndPaged: B_CALL LoadCIndPaged inc_BHL: inc hl bit 7,h ret z inc b res 7,h set 6,h ret myLoadDEIndPaged: B_CALL LoadDEIndPaged jr inc_BHL BHL_plus_DE: add hl,de bit 7,h ret z inc b res 7,h set 6,h ret VPutSApp: ld a,(hl) inc hl inc a dec a ret z push hl push de B_CALL VPutMap pop de pop hl jr VPutSApp setColonArrow: inc a ld d,a ld a,(bTopScreenItem) inc a cp d jr z,sca1 add a,6 cp d jr nz,sca2 ld a,(bNumVars) cp d jr z,sca2 ld a,1Fh ret sca1: cp 1 jr z,sca2 ld a,1Eh ret sca2: ld a,03Ah ret noneFound: B_CALL ClrLCDFull B_CALL HomeUp ld hl,sNoneFound call PutSApp noneFoundLoop: B_CALL GetKey cp kQuit jr z,exitApp cp kClear jr z,startApp cp kEnter jr z,startApp jr noneFoundLoop Traverse_symTable: ld hl,(symTablePtr) ld (wSymTemp),hl ld d,0 ld bc,(pTemp) loop: or a sbc hl,bc ret c jr nz,loopContinue scf ret loopContinue: add hl,bc ld a,(hl) dec hl ld c,(hl) inc hl and 1Fh ld e,6 sbc hl,de ld e,3 push af cp AppVarObj jr z,movetonext cp ProgObj jr z,movetonext cp ProtProgObj jr z,movetonext cp TempProgObj jr z,movetonext cp 17h jr z,movetonext dec hl ld a,(hl) inc hl cp tVarLst jr nz,movetonext1 movetonext: ld e,(hl) inc e movetonext1: or a sbc hl,de push hl add hl,de dec e ld b,e ld de,op1 ld a,17h ld (de),a inc de dec hl storeLoop: ld a,(hl) ld (de),a dec hl inc de djnz storeLoop xor a ld (de),a pop hl ld (symTablePtr),hl pop af cp 17h jr nz,Traverse_symTable bit showAll,(iy+groupToolFlags) jr nz,valid bit showVisible,(iy+groupToolFlags) jr nz,tsCheckVisible ld a,(op1+1) cp 40h jp p,Traverse_symTable valid: ld a,(op1+1) cp 40h ret p add a,40h ld (op1+1),a ret tsCheckVisible: ld a,(op1+1) cp 40h jp m,Traverse_symTable jr valid myFindAlphaUp: res varFound,(iy+groupToolFlags) B_CALL op1toop3 ld hl,bDummyVar2 rst 20h B_CALL op1toop2 ld hl,symTable ld (symTablePtr),hl myfauLoop: call Traverse_symTable jr c,myfauLoopDone ld hl,op1 ld de,op3 call isHLBigger jr z,myfauLoop jp p,myfauLoop ld hl,op1 ld de,op2 call isHLBigger jp m,myfauLoop set varFound,(iy+groupToolFlags) B_CALL op1toop2 ld hl,(symTablePtr) ld (wTemp),hl ld hl,(wSymTemp) ld (wSymTemp2),hl jr myfauLoop myfauLoopDone: bit varFound,(iy+groupToolFlags) jr z,myfauDone B_CALL op2toop1 ld hl,(wTemp) ld (symTablePtr),hl or a ret myfauDone: scf ret isHLBigger: push de push hl call cmpstr pop hl pop de jr c,_ihlb or a ret _ihlb: dec de dec hl isHLBiggerLoop: inc de inc hl ld a,(de) cp (hl) jr z,isHLBiggerLoop ret cmpstr: ld a,(de) cp (hl) jr nz,cmpstrfail or a jr z,cmpstrmaybefail ld a,(hl) or a jr z,cmpstrmaybefail cmpstrcontinue: inc hl inc de jr cmpstr cmpstrmaybefail: ld a,(hl) or a jr nz,cmpstrcontinue ld a,(de) or a jr nz,cmpstrcontinue ret cmpstrfail: scf ret setTextInverse: set textInverse,(iy+textFlags) ret resTextInverse: res textInverse,(iy+textFlags) ret PutSApp: ld a,(hl) or a ret z B_CALL PutC inc hl jr PutSApp SoftKey: push hl ld bc,7 ld de,95*256+7 ld h,1 B_CALL ILine ld b,19 ld d,b ld e,0 B_CALL ILine ld b,38 ld d,b B_CALL ILine ld b,57 ld d,b B_CALL ILine ld b,76 ld d,b B_CALL ILine ld b,0 ld d,b ;B_CALL ILine ld b,95 ld d,b ;B_CALL ILine pop hl ld a,57 ld (penRow),a ld a,3 SoftKeyLoop: ld (penCol),a push af call VPutSApp pop af add a,19 cp 98 jr nz,SoftKeyLoop ret SoftKeyG: push hl ld de,appBackUpScreen ld hl,skgPic ld bc,26 ldir ld de,56*256 skgLoop: push de ld hl,appBackUpScreen B_CALL DisplayImage pop de ld a,e add a,19 ld e,a cp 95 jr nz,skgLoop pop hl ld a,57 ld (penRow),a ld a,3 skgLoop2: ld (penCol),a push af call VPutSApp pop af add a,19 cp 98 jr nz,skgLoop2 ret dispVarType: ld a,(bVarType) and 01Fh inc a ld b,a ld hl,sVarTable-6 ld de,6 dvtLoop: add hl,de djnz dvtLoop ld a,10 ld (curCol),a jr PutSApp sSelect: db "SELECT",0 sExtract: db "EXTRACT",0 sNoneFound: db "No groups found",0 sSelectVar: db "Select Group",0 sErrMem: db "ERR:MEMORY",0 sQuit: db "Quit",0 bDummyVar: db 17h,01h,0 bDummyVar2: db 17h,7Ch,7Ch,7Ch,7Ch,7Ch,7Ch,7Ch,7Ch,0 bViewTitle: db "VIEW",0,0,0,0 bUngroupTitle: db "UNGROUP",0 bHideTitle: db "HIDE",0,0,0,0 bUnhideTitle: db "UNHIDE",0 bTitleText: db "GroupTool",0 bAboutText: db "v1.1 by Brandon Wilson",0 bViewText: db "View/Ungroup",0CEh,0 wMenuJumpTable: dw groupVar bHideText: db "Hide",0CEh,0,0,0,0,0,0,0,0,0 dw groupVar bUnhideText: db "Unhide",0CEh,0,0,0,0,0,0,0 dw groupVar bQuitText: db "Quit",0,0,0,0,0,0,0,0,0,0 dw exitApp sNamePrompt: db "Name=",0 bExtractText: db "Ungrouping:",0 sTblSet: db "TblSet",0 sWindow: db "RclWind",0 sRclWindow: db "Window",0 sVarTable: db "REAL",0,0 db "LIST",0,0 db "MATRX",0 db "EQU",0,0,0 db "STRNG",0 db "PRGM",0,0 db "PRGM",0,0 db "PIC",0,0,0 db "GDB",0,0,0 db "WIND",0,0 db "WIND",0,0 db "WIND",0,0 db "CPLX",0,0 db "LIST",0,0 db "WIND",0,0 db "WIND",0,0 db "ZSTO",0,0 db "TABLE",0 db 0,0,0,0,0,0 db 0,0,0,0,0,0 db 0,0,0,0,0,0 db "APPV",0,0 sExtractChoice1: db "To RAM",0CEh,0 sExtractChoice2: db "To Flash",0CEh,0 sGroupType: db "GROUP",0 skgData: db 0 db 0 db 0 db "All+",0 db "All-",0 skgPic: db 8,17 db 00111111b,11111111b,00000000b db 01000000b,00000000b,10000000b db 10000000b,00000000b,01000000b db 10000000b,00000000b,01000000b db 10000000b,00000000b,01000000b db 10000000b,00000000b,01000000b db 01000000b,00000000b,10000000b db 00111111b,11111111b,00000000b