/* PowerComPress v0.9 Copyright (C) 2005 Jonas Gehring PowerComPress 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 2 of the License, or (at your option) any later version. PowerComPress 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 PowerComPress; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // C Source File // Created 14.06.2005; 23:18:46 #include #include #include "advdialogs.h" #include "pcpress.h" #include "boolsoft.h" #if defined(COMPILE_VTI) #warning Building the VTI-version #endif void *screenbuffer; // Program Entry point void _main(void) { // Save LCD contents if ((screenbuffer = malloc(LCD_SIZE)) == NULL) ExitPCP(OUTOFMEM); LCD_save(screenbuffer); // Save AUTO-INT handlers and redirect them to "nothing" save_int_1 = GetIntVec(AUTO_INT_1); save_int_5 = GetIntVec(AUTO_INT_5); SetIntVec(AUTO_INT_1, DUMMY_HANDLER); SetIntVec(AUTO_INT_5, DUMMY_HANDLER); ST_eraseHelp(); StartGUI(); ExitPCP(NORMAL); } // Exits the program void ExitPCP(short mode) { // Restore the old settings GrayOff(); LCD_restore(screenbuffer); free(screenbuffer); ClearKbdQueue(); SetIntVec(AUTO_INT_1, save_int_1); SetIntVec(AUTO_INT_5, save_int_5); if (mode == NORMAL) ST_helpMsg("PowerComPress "COMMENT_VERSION_STRING); else if (mode == OUTOFMEM) ST_helpMsg("Out of memory"); exit(0); }