/************************************************************************** * * Othello II v2.53 - 08/02/2004 * * Copyright (C) 2000-2004 François LEIBER * * This file is part of Othello II. * * Othello II 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. * * Othello II 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., 675 Mass Ave, Cambridge, MA 02139, USA. * *************************************************************************/ INT_HANDLER Ancien1 = NULL, Ancien4 = NULL, Ancien5 = NULL; volatile short Compteur = 0; // Permet à la réflexion de dépendre uniquement du temps DEFINE_INT_HANDLER(Int5) { if (Compteur != 0) Compteur--; } // Compteur est décrémenté 10 fois par seconde ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Redirige les interruptions 1, 4 et 5 vers rien en sauvegardant les précédentes ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void init_int() { Ancien1 = GetIntVec(AUTO_INT_1); Ancien4 = GetIntVec(AUTO_INT_4); Ancien5 = GetIntVec(AUTO_INT_5); SetIntVec(AUTO_INT_1, DUMMY_HANDLER); SetIntVec(AUTO_INT_4, DUMMY_HANDLER); SetIntVec(AUTO_INT_5, Int5); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Restaure les interruptions qui avaient été modifiées ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void restaure_int() { SetIntVec(AUTO_INT_1, Ancien1); SetIntVec(AUTO_INT_4, Ancien4); SetIntVec(AUTO_INT_5, Ancien5); pokeIO(0x600017, HW2 ? 0xCC : 0xB2); OSTimerRestart(2); }