/* Loglan82 Compiler&Interpreter Copyright (C) 1981-1993 Institute of Informatics, University of Warsaw Copyright (C) 1993, 1994 LITA, Pau 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. ======================================================================= */ #include "graf.h" #define bound(x,y) ( x<0 || y<0 || x>719 || y>347 ) int pascal nocard( dummy ) void *dummy; { return 1; } #define index 0x3b4 /* 6845 ports */ #define data 0x3b5 #define mode 0x3b8 /* Herc ports */ #define status 0x3ba #define config 0x3bf static int cur_color; static int cur_x; static int cur_y; static char *page_drawn; static int page_drawn_no; static int page_viewed; #if WORD_32BIT #define HERC_BASE 0xE00B0000UL #define CHAR_BASE 0xE00FFA6EUL #else #define HERC_BASE 0xB0000000UL #define CHAR_BASE 0xFFA6000EUL #endif static void set_page_drawn( page ) int page; { if( page == 0 || page == 1 ) { page_drawn = (char *)( HERC_BASE + page * 0x8000); page_drawn_no = page; } } static void screen_off() { outportb( mode, '\0' ); } static void set_page_viewed( page ) int page; { if( page == 0 ) outportb( mode, '\x0a' ); else if( page == 1 ) outportb( mode, '\x8a' ); page_viewed = page; } static void clear_buffer( buf ) char *buf; { int i; for( i=0; i<0x7fff; i++ ) buf[i] = '\0'; } static void clear_gr_scr( page ) int page; { if( page_viewed == page ) screen_off(); clear_buffer( (char *)(HERC_BASE + page*0x8000) ); if( page_viewed == page ) set_page_viewed( page ); } static int in_graphics=0; void pascal gron( dummy ) int *dummy; { char i; static char params[16] = { '\x35', '\x2d', '\x2e', '\x07', '\x5b', '\x02', '\x57', '\x57', '\x02', '\x03', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00' }; if( in_graphics ) return; in_graphics = 1; atexit( groff ); /* { int i=0; geninterrupt (0x11); if (( AX & 0x30 ) == 0x30) for (i=0; i<0x800; i++) if (inportb(status) & 0x80) { i=-1; break; } if( i != -1 ) { fprintf( stderr, "This version runs only with HERCULES graphic card\n" ); exit( 1 ); } } */ outportb( config, 3 ); /* allows both graphics pages */ screen_off(); for( i=0; i>(i-x00)) ) ) point(&i,&j); } popxy(); if( chr != 0 ) { x00 += 8; move( &x00, &y00 ); } } void pascal hfont ( seg, ofs ) int *seg,*ofs; {} void pascal hfont8( seg, ofs ) int *seg,*ofs; {} .