/* MikMod module player (c) 1999 Miodrag Vallat and others - see file AUTHORS for complete list. 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. */ /*============================================================================== $Id: os2video.inc,v 1.1.1.1 2004/01/16 02:07:31 raph Exp $ OS/2 console i/o routines ==============================================================================*/ static HVIO hvio = 0; static VIOCURSORINFO viocursorinfo; static BYTE clearscreen [2] = { ' ', A_NORMAL }; static BYTE mvattr = A_NORMAL; #define attrset(a) mvattr = a void clear(void) { /* overwrite entire screen with 0s */ clearscreen [1] = mvattr; VioWrtNCell(clearscreen, winy * winx, 0, 0, hvio); } void mvaddnstr(int y,int x,const char *str,int len) { char buffer[STORAGELEN]; int l=strlen(str); strncpy(buffer,str,len); if (lwidth-x>0) { clearscreen[1] = mvattr; VioWrtNCell(clearscreen, win->width - x, win->y + y, win->x + x, hvio); } } static int _mik_kbhit(void) { KBDKEYINFO k; if (KbdPeek(&k, 0)) return 0; else return (k.fbStatus & KBDTRF_FINAL_CHAR_IN); } static int win_getch(void) { int c = 0; if (_mik_kbhit()) { c = getch(); if ((!c) || (c == 0xe0)) c = 0x100 | getch(); } return c; }