;;; -*- TI-Asm -*- ;;; ;;; Mimas - Assembly language IDE for the TI-83 Plus ;;; ;;; Copyright (C) 2010 Benjamin Moody ;;; ;;; This program is free software: you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as ;;; published by the Free Software Foundation; either version 3 of the ;;; License, or (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . ;; EditProgramImports: ;; ;; Display a full-screen dialog, allowing the user to edit the current ;; program's list of imported libraries. ;; ;; Destroys: ;; - AF, BC, DE, HL ;; - OP1-OP6 ;; - penRow, penCol, minPenCol ;; - Contents of LCD, plotSScreen, and saveSScreen EditProgramImports_Error: call ShowErrorPopup EditProgramImports: BCALL _CanAlphIns ld hl,EditProgramImports_Error call APP_PUSH_ERRORH EditProgramImports_Restart: ld hl,(curProgHeader + PROGHEADER_IMPORT_START) ld d,h ld e,l EditProgramImports_Loop: ld bc,(curProgHeader + PROGHEADER_IMPORT_END) or a sbc hl,bc add hl,bc jr nc,EditProgramImports_Empty VERTICAL_MENU_ALPHA 10, 6, 1, 92, ImportMenuInit, ImportMenuShow, ImportMenuNext, ImportMenuPrev, Invert7Rows, Invert7Rows cp kDel jr z,EditProgramImports_Delete cp kWindow jr nz,EditProgramImports_Key EditProgramImports_Delete: ld bc,-9 call InsDelProgramImportMem jr EditProgramImports_Restart EditProgramImports_Empty: push hl push de call ImportMenuInit call XBufCpy call GetKey pop de pop hl EditProgramImports_Key: SWITCH_BEGIN SWITCH_CASE kClear, EditProgramImports_Done SWITCH_CASE kIns, EditProgramImports_Insert SWITCH_CASE kQuit, EditProgramImports_Done SWITCH_CASE kYequ, EditProgramImports_Insert SWITCH_CASE kGraph, EditProgramImports_Done SWITCH_END jr EditProgramImports_Loop EditProgramImports_Done: call APP_POP_ERRORH ret EditProgramImports_Insert: push de push hl res editableProgsOnly,(iy + asm_Flag2) ld hl,addLibraryLabel call ShowProgramMenu pop hl pop de jr c,EditProgramImports_Loop ld hl,(curProgHeader + PROGHEADER_IMPORT_START) ld bc,9 call InsDelProgramImportMem ld hl,OP1 ldir jr EditProgramImports_Restart ImportMenuInit: ld hl,importEditLabel ld (dialogTitle),hl ld hl,importMenuSoftKeys jq_ DialogInitCustom ImportMenuShow: ld bc,9 call GetProgramData inc hl jq_ BufVPutS8 ImportMenuNext: ld de,9 add hl,de ld de,(curProgHeader + PROGHEADER_IMPORT_END) sbc hl,de add hl,de ccf ret ImportMenuPrev: ld de,-9 add hl,de ld de,(curProgHeader + PROGHEADER_IMPORT_START) or a sbc hl,de add hl,de ret