;Noshell v1.2 ; (C) 2007 by Brandon Wilson. All rights reserved. ;v1.2 Changelog ;Nothing really, just version change to feel special ;v1.1 Changelog ;Forgot :) ;v1.0 Changelog ;Forgot :) ;v0.2 Changelog ;All but a few MirageOS library routines supported ;v0.1b Changelog ;Initial release ;Main screen: ;1. Install ;2. Uninstall ;3. Configure ;4. Start Shell ;5. About ;6. Quit ;Configure screen: ; - Auto-launch user interface ; - Allow program writeback ; - Program Display Settings... ; - Show BASIC programs ; - Show MirageOS BASIC programs ; - Show nostub assembly programs ; - Show Ion assembly programs ; - Show MirageOS assembly programs ; - Use interface: ; built-in ; any external ones detected ;MirageOS library routines NOT supported (because I'm lazy and they're pretty external interface-specific): ;gettext ;gettextv ;delfolder ;createfolder ;folder_menu_start ;general_key_routine ;renamefolder ;sysmain ;move_gui_prog include "settings.inc" NOLIST include "ti83plus.inc" LIST include "equates.inc" include "header.asm" SEGMENT MAIN GLOBALS ON EXTERN IPutS,getAppNameLen,IGetKey,parserHook,VPutSAppCenter,VPutSApp,BHL_plus_DE,getDataByte,parserHookChained EXTERN tempHookBlock Var wProgSize,2 Var wByteCount,2 Var tempByte,1 Var wDataPtr,2 Var bDataPage,1 Var wUserMemPtr,2 Var wProgOffset,2 Var wTempWord,2 Var SPbackup,2 Var flagByte,1 Var oldHookBlock,4 wProgBytes equ cmdShadow+60 bNameBackup equ cmdShadow+62 mirTempByte equ cmdShadow+70 libraryVectors equ cmdShadow+80 randData equ cmdShadow+104 StartApp: B_CALL ClrLCDFull ld (iy+sGrFlags),0 call getNoshellSettings set graphDraw,(iy+graphFlags) set write_on_graph,(iy+sGrFlags) res textEraseBelow,(iy+textFlags) set textWrite,(iy+sGrFlags) res appTextSave,(iy+appFlags) call drawHeader ld hl,sMainMenu ld a,9 ld (penRow),a ld b,6 $$: ld a,5 ld (penCol),a call VPutSApp ld a,(penRow) add a,9 ld (penRow),a djnz $B call isNoshellInstalled jr c,$F ld hl,plotSScreen+(12*9) jr grayDone $$: ld hl,plotSScreen+(12*18) grayDone: ld b,7 call grayOut ld hl,plotSScreen+(12*36) ld b,7 call grayOut call ifastcopy mainKeyLoop: call IGetKey cp kQuit jr z,ExitApp cp kClear jr z,ExitApp call isNoshellInstalled jr c,$F cp k2 jr z,uninstallNoshell $$: call isNoshellInstalled jr nc,$F cp k1 jr z,installNoshell $$: cp k3 jr z,ConfigureNoshell cp k4 jr z,StartShell cp k5 jr z,ShowAboutScreen cp k6 jr z,ExitApp jr mainKeyLoop ConfigureNoshell: call drawHeader ld hl,0707h ld (penCol),hl ld hl,sConfigureOptions ld b,8 $$: ld a,7 ld (penCol),a call VPutSApp ld a,(penRow) add a,7 ld (penRow),a djnz $B redrawOptions: ld a,7 ld (penRow),a ld a,(flagByte) rla jr c,$F ld hl,unfilledBox jr dispOption $$: ld hl,filledBox dispOption: xor a ld (penCol),a ld de,sFont_record ld bc,8 ldir ld hl,sFont_record B_CALL VPutMapRec ld hl,plotSScreen+(12*14) ld b,63-14 call grayOut call ifastcopy configureKeyLoop: call IGetKey cp kEnter jr z,toggleWriteback cp kClear jr z,saveSettings cp kQuit jr nz,configureKeyLoop ExitApp: B_CALL ClrLCDFull ld (iy+sGrFlags),0 B_JUMP JForceCmdNoChar toggleWriteback: ld a,(flagByte) xor 80h ld (flagByte),a jr redrawOptions saveSettings: call saveNoshellAppVar jr StartApp saveNoshellAppVar: res avarArchived,(iy+noshellFlags) ld hl,bNoshellAppVar rst 20h B_CALL ChkFindSym call c,recreateNoshellAppVar B_CALL ChkFindSym ld a,b or a jr z,$F B_CALL Arc_Unarc set avarArchived,(iy+noshellFlags) $$: ld hl,bNoshellAppVar rst 20h B_CALL ChkFindSym inc de ;size byte inc de ;size byte inc de ;ID byte inc de ;ID byte inc de ;future use ld a,(flagByte) ld (de),a inc de ld hl,oldHookBlock ld bc,4 ldir bit avarArchived,(iy+noshellFlags) ret z B_CALL Arc_Unarc ret drawHeader: B_CALL GrBufClr xor a ld (penRow),a ld hl,sNoshell call VPutSAppCenter ld hl,plotSScreen ld b,7 jr invert_lines installNoshell: bit parserHookActive,(iy+hookflags4) jr z,installNoshell_1 call drawHeader ld a,15 ld (penRow),a ld hl,sAlreadyExists call VPutSAppCenter ld a,50 ld (penRow),a ld hl,sPressEnter call VPutSAppCenter ld a,57 ld (penRow),a ld hl,sOrChain call VPutSAppCenter ld a,25 ld (penRow),a B_CALL ZeroOP1 ld a,(parserHookPtr+2) push af ld hl,4000h ld de,8040h B_CALL FindAppHeaderSubField pop bc jr nz,installNoshell_1 ld a,b inc hl push af B_CALL GetFieldSize pop af ld de,OP1 ld bc,8 B_CALL FlashToRam ld hl,OP1 call VPutSAppCenter call ifastcopy call IGetKey cp kAdd jr z,chainParserHook cp kEnter jr nz,StartApp installNoshell_1: ld hl,parserHook installNoshell_2: in a,(6) B_CALL SetParserHook ld hl,sNoshellInstalled $$: push hl call drawHeader ld a,25 ld (penRow),a pop hl call VPutSAppCenter pressAnyKeyReturn: ld a,57 ld (penRow),a ld hl,sPressAnyKey call VPutSAppCenter call ifastcopy call IGetKey jr StartApp chainParserHook: ld hl,parserHookPtr ld de,oldHookBlock ld bc,4 ldir ld hl,parserHookPtr ld de,tempHookBlock ld bc,4 ldir ld a,(flagByte) or 40h ld (flagByte),a call saveNoshellAppVar ld hl,parserHookChained jr installNoshell_2 uninstallNoshell: res parserHookActive,(iy+hookflags4) ld hl,sNoshellUninstalled jr $B StartShell: jr ExitApp ShowAboutScreen: call drawHeader ld a,7 ld (penRow),a ld hl,sAuthor call VPutSAppCenter ld a,14 ld (penRow),a ld hl,sYear call VPutSAppCenter ld a,25 ld (penRow),a ld hl,sThanks ld b,4 $$: push bc call VPutSAppCenter pop bc ld a,(penRow) add a,7 ld (penRow),a djnz $B jr pressAnyKeyReturn grayOut: ld d,10101010b grayOut_loop: ld c,12 $$: ld a,d and (hl) ld (hl),a inc hl dec c jr nz,$B rrc d djnz grayOut_loop ret isNoshellInstalled: ;Carry set if not installed bit parserHookActive,(iy+hookflags4) scf ret z ld c,a in a,(6) ld b,a ld a,(parserHookPtr+2) cp b scf ld a,c ret nz or a ret recreateNoshellAppVar: ld hl,bNoshellAppVar rst 20h ld hl,16 B_CALL CreateAppVar inc de inc de ld hl,defaultAppVarData ld bc,16 ldir ld hl,bNoshellAppVar rst 20h B_CALL ChkFindSym ret getNoshellSettings: ld hl,bNoshellAppVar rst 20h B_CALL ChkFindSym jr nc,$F call recreateNoshellAppVar $$: ld hl,bNoshellAppVar rst 20h B_CALL ChkFindSym ex de,hl ld a,b or a jr z,inRAM ld de,9 call BHL_plus_DE call getDataByte ld c,a $$: call getDataByte dec c jr nz,$B inRAM: call getDataByte ;size byte call getDataByte ;size byte call getDataByte ;ID byte call getDataByte ;ID byte call getDataByte ;future use call getDataByte ;flag byte ld (flagByte),a call getDataByte ld (oldHookBlock),a call getDataByte ld (oldHookBlock+1),a call getDataByte ld (oldHookBlock+2),a call getDataByte ld (oldHookBlock+3),a ret sNoshell: DB "Noshell v1.2",0 sAuthor: DB "Brandon Wilson",0 sYear: DB "2007",0 sThanks: DB "Thanks to:",0 DB "Fred Sparks",0 DB "Jonathan Martin",0 DB "for the idea.",0 sMainMenu: DB "1. Install",0 DB "2. Uninstall",0 DB "3. Configure",0 DB "4. Start Shell",0 DB "5. About",0 DB "6. Quit",0 sNoshellInstalled: DB "Noshell Installed!",0 sNoshellUninstalled: DB "Noshell Uninstalled!",0 sPressAnyKey: DB "Press any key...",0 sConfigureOptions: DB "Allow program writeback",0 DB "Auto-start shell",0 DB "Show BASIC programs",0 DB "Show BASIC shell progs",0 DB "Show assembly programs",0 DB "Show Ion programs",0 DB "Show MirageOS programs",0 DB "Interface:",0 sAlreadyExists: DB "Parser hook in use by:",0 sPressEnter: DB "Press ",LlBrack,"ENTER] to overwrite",0 sOrChain: DB "or ",LlBrack,"+] to chain with Noshell.",0 bNoshellAppVar: DB AppVarObj,"Noshell",0 defaultAppVarData: DB 5Ah,0A5h,00h,00h DB 00h,00h,00h,00h DB 00h,00h,00h,00h,00h,00h,00h,00h filledBox: DB 06h,00h,3Eh,3Eh,3Eh,3Eh,3Eh,00h unfilledBox: DB 06h,00h,3Eh,22h,22h,22h,3Eh,00h COMMENT ~ B_CALL ClrLCDFull B_CALL HomeUp bit parserHookActive,(iy+hookflags4) jr z,installParserHook in a,(6) ld b,a ld a,(parserHookPtr+2) cp b jr z,uninstallParserHook ld hl,sOverwrite call IPutS B_CALL ZeroOP1 push bc ld a,b ld hl,4000h ld de,8040h B_CALL FindAppHeaderSubField pop bc jr nz,$F inc hl ld a,b push bc B_CALL GetFieldSize pop af ld de,OP1 ld bc,8 B_CALL FlashToRam ld a,3 ld (curRow),a ld hl,OP1 call getAppNameLen ld a,16 sub b srl a ld (curCol),a ld hl,OP1 call IPutS $$: call IGetKey cp kQuit jr z,ExitApp cp kClear jr z,ExitApp cp kEnter jr nz,$B jr installParserHook uninstallParserHook: res parserHookActive,(iy+hookflags4) ld hl,sUninstalled call IPutS call IGetKey jr ExitApp installParserHook: ld hl,parserHook in a,(6) B_CALL SetParserHook B_CALL ClrLCDFull B_CALL HomeUp ld hl,sInstalled call IPutS call IGetKey jr ExitApp sInstalled: DB "Noshell has been" DB "installed. " DB " " DB " Press any key",0CEh,0 sUninstalled: DB "Noshell has been" DB "uninstalled. " DB " " DB " Press any key",0CEh,0 sOverwrite: DB " Parser hook is " DB " in use by: " DB " " DB " " DB " " DB "Press ",LlBrack,"ENTER] to" DB " overwrite and " DB "continue anyway.",0 ~