/*============================================================================== * common.h: Macros, switches and constants. Must be included by every .c file. * * $Id: common.h,v 1.3 2004/04/16 14:47:07 Olivier Exp $ * * - GhostBuster for TI89 Titanium - * Copyright (C) 2004 Olivier Armand * and Kevin Kofler * * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * * In addition, as a special exception, Olivier Armand and Kevin Kofler give * permission to link the code of this program with the ttunpack decompression * library by the TI-Chess Team, and distribute linked combinations including * the two. You must obey the GNU General Public License in all respects for * all of the code used other than the ttunpack decompression library. If you * modify this program, you may extend this exception to your version of the * program, but you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. * *==============================================================================*/ #ifndef COMMON_H #define COMMON_H /* GhostBuster switches */ // #define CHECK_89_SCREEN_WIDTH /* For xST_helpMsg(). Uncomment when debugging. */ #define MIN_AMS 207 // TODO: remove #include /* Macros */ #if defined CHECK_89_SCREEN_WIDTH #define xST_helpMsg(s) do { \ /* don't forget the 'busy' indicator */ \ if (DrawStrWidth(s, F_4x6) >= 140 ) { \ ST_helpMsg("/!\\ The following help msg is too long."); \ ngetchx(); } \ ST_helpMsg(s); } while (0) #else #define xST_helpMsg(s) ST_helpMsg(s) #endif /* not CHECK_89_SCREEN_WIDTH */ #define fatal(s) do {xST_helpMsg(s); exit(0);} while (0) #define MAX_SYM_LEN (8*2+3) /* for TokenizeName() */ /* for debugging purposes: */ #define DB_msg(s) {ST_helpMsg(s);} #define DB_msg_pause(s) {DB_msg(s); ngetchx(); ST_eraseHelp();} #define DB_msg_break(s) {DB_msg(s); DB_break();} #define DB_break() {asm("0: bra.s 0b");} #define DB_pause() {ngetchx();} #define DB_mark(s) {asm("/* MARK : "#s" */");} #endif /* not COMMON_H */