2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
15 #pragma off (unreferenced)
16 static char rcsid[] = "$Id: winmono.c,v 1.1.1.1 2001-01-19 03:30:15 bradleyb Exp $";
17 #pragma on (unreferenced)
28 static int WinMonoInitialized = 0;
29 static HANDLE hConOutput = 0;
33 // ----------------------------------------------------------------------------
35 // ----------------------------------------------------------------------------
40 if (WinMonoInitialized) return 1;
42 if (!AllocConsole()) return 0;
43 hConOutput = GetStdHandle(STD_OUTPUT_HANDLE);
44 if (hConOutput == INVALID_HANDLE_VALUE) return 0;
46 WinMonoInitialized = 1;
60 void mopen(short n, short row, short col, short width, short height, char *title)
62 if (!WinMonoInitialized) return;
68 if (!WinMonoInitialized) return;
72 void msetcursor(short row, short col)
79 SetConsoleCursorPosition(hConOutput, coord);
83 void mputc(short n, char c)
88 if (!WinMonoInitialized) return;
90 buf[0] = c; buf[1] = 0;
92 WriteConsole(hConOutput, buf, 1, &chwritten, NULL);
96 void mputc_at(short n, short row, short col, char c)
98 if (!WinMonoInitialized) return;
111 static char temp_m_buffer[1000];
113 void mprintf(short n, char *format, ...)
115 char *ptr = temp_m_buffer;
119 if (!WinMonoInitialized) return;
121 va_start(args, format);
122 vsprintf(temp_m_buffer, format, args);
123 WriteConsole(hConOutput, ptr, strlen(ptr), &chwritten, NULL);
127 void mprintf_at(short n, short row, short col, char *format, ...)
129 char *ptr = temp_m_buffer;
133 if (!WinMonoInitialized) return;
135 va_start(args, format);
136 vsprintf(temp_m_buffer, format, args);
137 msetcursor(row, col);
138 WriteConsole(hConOutput, ptr, strlen(ptr), &chwritten, NULL);
142 void drawbox(short n)
144 // Obsolete in the New Order
148 void mrefresh(short n)