home *** CD-ROM | disk | FTP | other *** search
- Volume 1, Number 8 11 Jun 1988
- +---------------------------------------------------------------+
- | |
- | - C News - |
- | |
- | International |
- | C Programming & Compiler Review |
- | Newsletter |
- | |
- +---------------------------------------------------------------+
- US Office:
- Editor Barry Lynch
- Technical Editor Marshall Presnell
-
- Australian Office:
- Editor David Nugent
- Asst Editor Kevin Bergin
-
- C News is published monthly by the C BBS as its official
- newsletter. You are encouraged to submit articles for publication
- in C News. Articles should be related to C programming and can be
- Tutorials, reviews or articles of interest to the C programming
- community. All Operating systems are fairly represented and this
- newsletter shows no favoritism to any one in particular. Instruct-
- ions on how to submit articles for publication is included on the
- last page.
-
- C News is the property of the C BBS and is Copyright 1988 by the
- the C BBS. All rights are reserved and distribution is limited to
- electronic distribution and personal printed copies. C News cannot
- be resold at any profit, by any organization. All material enclosed
- within the newsletter is the opinions of the writers and not the
- C BBS or it's Sysop.
- C News 1-08 11 Jun 1988
-
- =================================================================
- TABLE OF CONTENTS
- =================================================================
-
-
- 1. EDITORIAL
- The Heap: messages from the editor.................... 1
-
- 2. BUG Report: MSC C 5.01 & QC 1.01
- PrintF Function ..................................... 2
-
- 3. SOFTWARE REVIEW
- Public Domain: ........................................... 4
- EZ-Window V1.1 by Barry Lynch
-
- 4. Programming for The Hercules Graphics
- Card by David Cheslow ............................... 5
-
- 5. LATEST VERSIONS OF COMMERCIAL/Public Domain ............. 16
- Software by Barry Lynch
-
- 6. NOTES
- Article Submission Standards ............................. 17
- Address's ............................................... 18
- USER Response Form ....................................... 19
-
- 7. INDEX ................................................... 20
-
- 8. Distribution Points ..................................... 22
-
- C News 1-08 Page 1 11 Jun 1988
-
- ================================================================
- The Heap: Messages from the editor
- ================================================================
-
- C News is alive and well again. This issue marks the debut.
- of a new section: Current Versions of Commercial and Public Domain
- Software. You will notice that there are quite a few files and
- compilers missing. In time I will get around to them all, but as I
- do not use all of the compilers on the market. Finding out what the
- lastest version is, is a challenge. Therefore, if you are using
- a compiler that does not have a version number listed. Please place
- a netmail message in the C Echo or on the C BBS. Thanks for your
- support in this matter.
-
- Along the same lines, I would like to ask all C Shareware/Public
- Domain authors to send copies of their products to the C BBS. So
- that may be reviewed and highlighted in future issues of C News.
- C News is for all users, readers, and developers.
-
- This issue also features the first in a series of articles on
- programming the Hercules Graphics Adapter. This article also,
- focuses around a compiler other than the big three <MSC, Borland
- and Lattice>. MIX C. This is a trend that I would like to see
- more of.
-
- Finally, as I put the finishing touches on Issue 8, I cannot
- help but feel somewhat proud of what we have created. The users
- make C News what it is, and I hope it continues.
-
- Barry Lynch
-
- Burke, VA
- C News 1-08 Page 2 11 Jun 1988
-
- ================================================================
- BUG Report: Microsoft Strikes Again!
- ================================================================
-
- *** Editors Note: The following is the text file included
- with the Official Microsoft Patch. Copyright Microsoft
- 1988.
-
-
- This file contains replacement object files to correct a
- problem with formatted output in the Microsoft C 5.10 runtime.
- Specificly, printf would not zero fill floating point numbers when
- the specified precision is zero. The cprintf() function also has
- this problem. This is demonstrated by the following example.
-
-
- #include <stdio.h>
-
- main(void)
- {
-
- printf("%04.0f\n", 12.34);
-
- }
-
- The current runtime library will output ' 12'. With this update,
- the library will output '0012'.
-
- The following is a list of the files in this archive.
-
-
- README.DOC This file.
- UPDATE.BAT DOS batch file to update all libraries.
- UPDATE.CMD OS/2 batch file to update all libraries.
-
- OUTPUT.S OUTPUT.OBJ for small model libraries.
- OUTPUT.M OUTPUT.OBJ for medium model libraries.
- OUTPUT.C OUTPUT.OBJ for compact model libraries.
- OUTPUT.L OUTPUT.OBJ for large model libraries.
- OUTPUT.CRT OUTPUT.OBJ for CDLLOBJS.LIB
- OUTPUT.DLL OUTPUT.OBJ for LLIBCDLL.LIB
- OUTPUT.MT OUTPUT.OBJ for LLIBCMT.LIB
-
- CPRINTF.S CPRINTF.OBJ for small model libraries.
- CPRINTF.M CPRINTF.OBJ for medium model libraries.
- CPRINTF.C CPRINTF.OBJ for compact model libraries.
- CPRINTF.L CPRINTF.OBJ for large model libraries.
- CPRINTF.CRT CPRINTF.OBJ for CDLLOBJS.LIB
- CPRINTF.DLL CPRINTF.OBJ for LLIBCDLL.LIB
- CPRINTF.MT CPRINTF.OBJ for LLIBCMT.LIB
-
-
- C News 1-08 Page 3 11 Jun 1988
-
- ================================================================
- Bug Report: Microsoft Strikes Again
- ================================================================
-
- To update your libraries, you should place all these files in
- the same directory as the libraries and type UPDATE. The process
- may take a some time depending on the number of libraries you
- created during installation.
-
-
- The update procedure will create a backup of each library with
- the file extension .BAK. After you assure yourself that the update
- completed without error (for example insufficient disk space), you
- can delete the backups. The original combined libraries can always
- be regenerated using the SETUP program and the distribution disks.
- C News 1-08 Page 4 11 Jun 1988
-
- ================================================================
- PUBLIC DOMAIN SOFTWARE REVIEWS:
- ================================================================
-
- Filename: EZWIND.ARC
-
- This is another of the "add-on graphics libraries" that are
- available for the more popular MS-DOS C compilers on the market
- today. Others include: WindowBoss, and C Spot Run. All are
- excellent and I was curious as to why someone thought they had to
- create another.
-
- This version of EZ Window (1.1) is for Microsoft C 5.0 and
- QuickC. At this time, it is not known if versions are available
- for TurboC, MIX C, or Datalight. EZ Window's main selling point
- is the ease of use. I have played with all of the major and
- minor windows libraries that are in the Public Domain. This is
- not the most powerful by any means. But the creation and manip-
- ulation of Text Windows, with sound effects and shadowing is quite
- simple. The author <Don Fordham> has done an excellent job on the
- documentation, that helps in the ease of use. The sample programs
- that are included are simple, and stress the point. All in all,
- this is a simple, non-pretentious package that is highly recommended
- for all C programmers.
-
- Source Included: No, except for sample programs.
- Compiler: Microsoft only. Supports Small and Large models.
-
-
- C News 1-08 Page 5 11 Jun 1988
-
- ================================================================
- Programming for the Hercules Graphics Card by David Cheslow.
- ================================================================
-
- This is the first in a series of articles about the Hercules
- Graphics Adapter, specifically, the graphics modes of that adapter.
- The Hercules is not supported by many standard compiler libraries
- and, when it is supported, it is usually underutilized.
-
- Since this is the first article about the subject, some general
- information on the Hercules is appropriate. The Hercules (when in
- text mode) is 100% compatible with the IBM Monochrome Graphics
- Adapter. Because there are so many good public domain libraries
- which support the Monochrome, this column will not address issues
- pertaining to that mode. When the Hercules is in graphics mode,
- however, it can produce dazzling 720 x 348 pixel monochrome
- graphics. Because IBM never endorsed a monochrome graphics
- standard the BIOS which is in IBM and clone machines offers no
- support for the Hercules defacto standard. In order to make use
- of the terrific resolution of the Hercules graphics modes, you must
- either buy software from Hercules or write the routines yourself.
- The first option is not altogether satisfactory because in order to
- distribute the Hercules software you must make an agreement with
- Hercules. For commercial software developers this is not a serious
- problem, but for the hacker or public domain software developer this
- is just too much trouble. Because of this, very few public domain
- programs support the Hercules graphics mode.
-
- This article will, over the next several months, provide a complete
- graphics environment for the Hercules graphics mode. By 'complete' I
- mean a windowing environment with pulldown menus, multiple resizable
- moveable scrollable popup windows, animation, multiple fonts, and a
- bunch of graphics primitives for freestyle drawing. In as much as I
- haven't written all of the routines yet, I may have to revisit older
- routines from time to time to make them compatible with other not
- yet written routines. Whenever possible, the code that is provided
- will be completely portable. In addition, assembler routines will be
- provided to increase the speed of some routines. I will attempt to
- keep the assembler routines to a minimum (after all, this is a
- newsletter for 'C' programmers not assembler programmers). The routines
- will be provided only when they are needed to provide added portability
- or when they improve performance substantially.
-
- One of the joys of graphics programming is using the mouse as an
- input device. I will occasionally digress from the subject of
- Hercules graphics and wander off into the world of mouse functions.
- These functions will be presented so as to be compatible with all the
- IBM graphics modes.
-
- One caveat before I begin. I use the MIX Power C medium memory model
- compiler, it is the only compiler I own. I chose the Power C
- compiler because it is fully functional and dirt cheap.
- C News 1-08 Page 6 11 Jun 1988
- ================================================================
- Programming for the Hercules Graphics Card by David Cheslow.
- ================================================================
-
- Since I have only the one compiler, I am not qualified to
- review its capabilities compared to other compilers but I am
- satisfied with it. The Power C compiler comes with its own
- assembler which is not entirely compatible with MASM. When I
- present assembler code with the Hercules routines, I will do my
- best to provide MASM compatible code ... I guarantee nothing.
- I hope that readers of this article will provide me with feedback
- about using these routines with other compilers and assemblers.
-
- That's about enough background for this month ... on with the
- show! This time I will present routines for:
-
- 1) Detecting a Hercules graphics adapter;
- 2) Switching the Hercules into/out of graphics mode;
- 3) Switching between graphics 'pages';
- 4) Blanking/restoring the Hercules adapter;
- 5) Detecting a mouse driver; and
- 6) Turning the mouse cursor on/off
-
- This group of functions doesn't really let you do anything - I
- apologize for this. These functions, while not visibly spect-
- acular, are the foundation upon which we are going to build the
- really fun stuff. It is important that these functions are fully
- understood. Please spend some time reading and examining them until
- you are comfortable with the concepts used.
-
- If it's any consolation, my next article will cover 1) multiple
- raster fonts, 2) horizontal and vertical lines, 3) filled boxes and
- several more mouse functions. Stay tuned!
-
- 1) Detecting a Hercules graphics adapter
-
- Detection of a Hercules adapter is accomplished in two steps. First,
- we must ask the ROM BIOS what type of adapter IT thinks is attached.
- If the BIOS indicates that a monochrome adapter is NOT present then
- we know that the adapter can not possibly be Hercules compatible
- (remember that the Hercules is 100% compatible with the IBM Monchrome
- Adapter). If, however, the BIOS indicates that a monochrome adapter
- IS installed, then we must determine the amount of RAM memory the
- adapter has. The Monchrome has only 4000 bytes of memory (80 x 25
- characters + 80 x 25 attributes); the Hercules has 65536 bytes (2
- graphics 'pages' with 32768 bytes per 'page'). Actually, only 31320
- bytes are used on each 'page' (the others are left blank), but more
- about that later.
-
-
-
-
-
- C News 1-08 Page 7 11 Jun 1988
- ================================================================
- Programming for the Hercules Graphics Card by David Cheslow.
- ================================================================
-
-
- Determining what graphics adapter is installed is actually pretty
- easy in this particular case. The Monochrome can only exist in
- one mode (#7). No other graphics adapter can exist in this mode.
- Since the Hercules is 100% compatible with the Monochrome, all we
- have to do is determine the current video mode. If it is 7 then a
- Monochrome or Hercules is installed and we can continue with our
- checks.
-
- This is the first of many functions I will present that require an
- 'int86' function. The prototype for the 'int86' function is -
- void int86(int i, union REGS r1, union REGS r2). Where i is the DOS
- interrupt number to be performed, r1 is a union containing the
- various NON-SEGMENT registers to be used when calling the interrupt,
- and r2 is an identical union in which the register values will be
- saved after the interrupt is completed. This is a rather involved
- function to implement in assembler and since my compiler has an
- 'int86' function I have never tried to write one. If your compiler
- doesn't have one please leave me a note on the Virginia (USA) C BBS
- and I will include one in a later article. Has anyone out there
- already written one?
-
- Here's the function:
-
- int h_isherc(void)
- {
- external char far *h_p;
- union REGS regs;
- char save_byte;
- regs.h.ah=15;
- int86(16,®s,®s);
- if(regs.h.al!=7) return(-1);
- h_p=H_MEMLOC;
- save_byte=*(h_p+65535);
- *(h_p+65535)=170;
- if(*(h_p+65535)!=170) return(1);
- *(h_p+65535)=85;
- if(*(h_p+65535)!=85) return(1);
- *(h_p+65535)=save byte;
- return(0);
- }
-
- LOCAL VARIABLES:
-
- 'regs' is a union used in the 'int86' function.
-
- 'save_byte' is used to store the contents of the last byte of
- Hercules memory.
-
- C News 1-08 Page 8 11 Jun 1988
- ================================================================
- Programming for the Hercules Graphics Card by David Cheslow.
- ================================================================
-
- PROCEDURE:
-
- Ascii 15 is loaded into the ah register and BIOS interupt #16 is
- called to return the current video mode (which is returned in the
- al register).
-
- If the al register contains any value other than 7, then -1 is
- returned by the function to indicate that a color adapter of some
- sort is attached.
-
- 'h_p' is initialized to point to Hercules memory. Be sure to call
- this function before any other Hercules functions or you will wipe
- out the operating system and have to reboot the computer.
-
- If the al register contains 7, however, the last byte of Hercules
- memory is saved in 'save_byte' and an attempt is made to change the
- that byte to ascii 170 (binary 10101010). The byte is read again to
- determine whether or not the change was successful. The possibility
- exists that the last byte of Hercules memory already contained ascii
- 170, so the byte is changed to ascii 85 (binary 01010101, which is
- mutually exclusive of ascii 170) and the byte is checked again to see
- whether or not the change was successful.
-
- If either of the changes was unsuccessful, then the function returns
- 1 to indicate that the adapter is Monochrome (or doesn't have enough
- memory to be Hercules compatible).
-
- Finally, the byte of Hercules memory is restored to its original
- value and the function returns 0 to indicate that a Hercules
- compatible graphics adapter is installed.
-
- 2) Switch the Hercules into/out of graphics mode
-
- Some compilers offer a function to accomplish this, the name of the
- function might be something like 'setvmode' or 'mode'. If your
- compiler has this function, check to see if your compiler supports
- the mouse. If your compiler supports both the Hercules mode and the
- mouse, then you're in luck! These lucky people probably won't need
- this function. If the compiler causes a click sound when changing
- to Hercules graphics mode, read on, we will cure that problem in this
- routine.
-
- If your compiler has Hercules OR mouse support, but not the other,
- then you will need to use the function presented here. We must per-
- form some special programming to make the Hercules and the mouse work
- together. If your compiler does not support both, then chances are
- pretty good that this special programming was not implemented.
- Improper implementation of this function may cause damage to your
-
- C News 1-08 Page 9 11 Jun 1988
- ================================================================
- Programming for the Hercules Graphics Card by David Cheslow.
- ================================================================
-
- graphics adapter or monitor - YOU accept full responsibility for
- what happens if you use it! The author, C BBS and affiliated dis-
- tributors, and C NEWS absolve themselves of ANY responsibility with
- regard to this function! As written, it has been fully tested and
- works better than any other similar function I have seen ... but,
- USE IT AT YOUR OWN RISK!
-
- To use this function you will need an 'outp' function. The prototype
- for an 'outp' function is - void outp(unsigned p, int c). The result
- is that (char)int c is sent out port p. In assembler the function
- goes something like this:
-
- PUSH BP
- MOV BP,SP
- MOV DX,[BP+6]
- MOV AX,[BP+8]
- OUT DX,AL
- POP BP
-
- Where [BP+6] and [BP+8] are the parameters unsigned p and int c
- respectively.
-
- Here's the function:
-
- int h_init(mode)
- int mode;
- {
- extern int h_vpage,h_apage,h_xpos,h_ypos;
- extern int h_pmode,h_vmode,h_color,h_start;
- extern int h_xmax,h_xmin,h_ymax,h_ymin;
- extern char far *h_p;
- char text[]={97,80,82,15,25,6,25,25,2,13,11,12,0,0,0,0};
- char graph[]={53,45,46,7,91,2,87,87,2,3,0,0,0,0,0,0};
- char *ptr;
- unsigned i;
- union REGS reg;
- outp(MODEPORT,((h_vmode==99)?2:0));
- ptr=((mode==99)?graph:text);
- regs.h.ah=0;
- regs.h.al=((mode==99)?6:7);
- int86(0x10,®,®);
- outp(MODEPORT,((mode==99)?2:0);
- for(i=0;i<16;i++)
- {
- outp(ADDRPORT,i);
- outp(DATAPORT,*(ptr+i));
- }
-
-
- C News 1-08 Page 10 11 Jun 1988
- ================================================================
- Programming for the Hercules Graphics Card by David Cheslow.
- ================================================================
-
- h_vpage=h_apage=h_xmin=h_ymin=h_ypos=h_xpos=h_pmode=h_start=0;
- h_vmode=((mode==99)?99:7);
- h_xmax=719;
- h_ymax=347;
- h_color=1;
- if(mode==99)
- {
- for(i=0;i<=65535;i++) *(h_p+i)=0;
- }
- outp(MODEPORT,((mode==99)?10:8));
- return(h_vmode);
- }
-
- PARAMETERS:
-
- 'mode' is the only parameter passed to the h_init function, if
- 'mode'==99 then graphics mode will be initialized, any other value
- will cause text mode to be initialized.
-
- LOCAL VARIABLES:
-
- 'text[]' and 'graph[]' are arrays of character variables which will
- be sent out of the DATAPORT to initialize the proper mode.
-
- 'ptr' is a pointer into the 'text[]' or 'graph[]' arrays.
-
- 'i' is a counter used for the two 'for' loops (i.e. loading the
- DATAPORT registers and clearing Hercules RAM).
-
- 'regs' is a union used by the 'int86' function.
-
- PROCEDURE:
-
- Unfortunately, the MODEPORT is an output only port, therefore we have
- to keep track of the current mode information and output the proper
- byte based on that data. For this reason, your programs must never
- return to DOS without first restoring the Hercules to text mode.
- Other programs have no way to determine the current video mode.
-
- The 4th bit of MODEPORT controls whether or not the adapter is
- on or off, when the bit is 1 the adapter is on, otherwise the adapter
- is off. Turning the adapter off eliminates the flicker associated
- with changing video modes and reduces the stress on the adapter and
- monitor during the video mode change. The 2nd bit controls (together
- with the DATAPORT registers) whether graphics or text mode is sel-
- ected. To turn the adapter off we send 2 out of MODEPORT if we are in
- graphics mode, 0 if we are in text mode.
-
-
- C News 1-08 Page 11 11 Jun 1988
- ================================================================
- Programming for the Hercules Graphics Card by David Cheslow.
- ================================================================
-
- 'ptr' is set to point to the array 'graph[]' if 'mode'==99, other-
- wise it is set to point to 'text[]'.
-
- The ah register is set equal to 0 and the al register is set to 6.
- These are the registers needed to request a change to CGA high
- resolution graphics mode using DOS interrupt 10.
-
- If we are selecting text mode, 7 is placed in al to select Monochome
- mode.
-
- DOS interrupt 10 Hex is issued with the values previously set in the
- ah and al registers. This tricks the mouse driver (if present) into
- thinking that a graphics mode is selected. CAUTION - be sure that 6
- is in the al register, other values (i.e. the ones used to select EGA
- modes) may cause damage to your monitor! If you screw this up, you
- will hear a loud zap sound (like sticking a fork in a toaster while
- it's on) when you run this function ... if it zaps, turn your monitor
- off FAST and you might be able to save it! You should not hear any
- even slightly alarming sound when this function runs. Just be sure
- that 6 is in register al and you will have no trouble. If you are
- not at all brave, and you don't want to use the mouse then you can
- simply delete the line with the 'int86' function call.
-
- The 2nd bit of mode port is set to 1 to request graphics mode or 0 to
- request text mode. This is only part of the process, however, the
- DATAPORT values must also be changed to the appropriate values.
-
- Send the 16 array values out of the DATAPORT after addressing each of
- the 16 ADDRPORT registers. It is always necessary to reprogram all
- 16 of these registers for each mode change, even though both modes
- have several values that are the same.
-
- Reset the external variables to their default values.
-
- Set all 65535 bytes of Hercules RAM to ascii 0 if we are selecting
- graphics mode. This is not necessary if we are selecting text mode
- because the BIOS will clear that memory for us. ** See ASM SPEEDUP **
-
- Turn the adapter back on by setting bit 4 to 1.
-
- Return the current video mode value, 7 indicates text mode, 99
- indicates graphics.
-
-
-
-
-
-
-
- C News 1-08 Page 12 11 Jun 1988
- ================================================================
- Programming for the Hercules Graphics Card by David Cheslow.
- ================================================================
-
- ASM SPEEDUP:
-
- If your compiler has a function to initialize FAR memory to a
- CHARACTER ascii value then you have an easy speedup to replace the
- loop which clears Hercules memory. This function might be called
- something like 'farmemset' or 'farmemfill'. If you are using a
- large memory model then look for 'memset' or 'memfill'. Double
- check that the function addresses FAR memory or you'll get a system
- crash for sure! All we are really trying to accomplish here is to
- fill 65536 bytes of far memory, starting at 'h_p', with the character
- ascii 0. This speedup (and several similar ones) will be used in many
- of the functions presented in future articles so your time will be
- well spent getting it right. This speedup will make the routine
- almost instantaneous! If your compiler doesn't have such a function
- then try this ASM routine:
-
- PUSH BP
- MOV BP,SP
- MOV DI,[BP+6]
- MOV ES,[BP+8]
- MOV AX,[BP+10]
- MOV CX,[BP+12]
- JCXZ QUIT:
- CLD
- REP STOSB
- QUIT: RETFAR
-
- Where [BP+6] is the offset portion of a far pointer, [BP+8] is the
- segment portion of a far pointer, [BP+10] is the character to fill
- with and [BP+12] is the number of bytes to fill.
-
- Before using this ASM code, be sure to check whether or not your
- compilers requires you to preserve the ES segment register.
-
- 3) Switching between the two Hercules graphics 'pages'
-
- After that last one this should be a breeze. The Hercules maintains
- 2 separate graphics pages and allows an almost instantaneous switch
- between them. Much of the information about the techniques used in
- this function have already been covered, so the description will be
- brief. Unfortunately, I know of no way to make the mouse cursor
- appear on the second graphics page. Anybody got any ideas?
-
-
-
-
-
-
-
- C News 1-08 Page 13 11 Jun 1988
- ================================================================
- Programming for the Hercules Graphics Card by David Cheslow.
- ================================================================
-
- Here's the function:
-
- int h_setvpage(page)
- int page;
- {
- extern int h_vpage;
- int old_page;
- if(h_vmode==99)
- {
- outp(MODEPORT,10+((page==1)?128:0));
- }
- old_page=h_vpage;
- h_vpage=page;
- return(old_page);
- }
-
-
- PARAMETER:
-
- The only parameter passed to this function is the page which is
- to be made the visible page. If the value is 1 then the second
- page is made visible. Any other value causes the first page (#0)
- to become visible.
-
- LOCAL VARIABLE:
-
- 'old_page' is used to store the number of the page which is visible
- when the function is called. This is also the value returned by the
- function.
-
- PROCEDURE:
-
- The 8th bit of MODEPORT determines which page is currently visible.
- Since the pages are only meaningful in graphics mode and because
- we wouldn't be changing the visible page unless the adapter is on,
- we know that the 2nd and 4th bits are 1. To select page 1, we add
- 128; for page 0, we add 0.
-
- 'old_page' is set equal to the external variable which contains the
- previously visible page. The new visible page is loaded into h_vpage
- and the previously visible page is returned.
-
-
-
-
-
-
-
-
- C News 1-08 Page 14 11 Jun 1988
- ================================================================
- Programming for the Hercules Graphics Card by David Cheslow.
- ================================================================
-
- 4) Turning the Hercules adapter on/off
-
- If you followed the h_init and the h_setvpage functions then this
- one should be obvious.
-
- void h_onoff(on)
- int on;
- {
- outp(MODEPORT,((on)?8:0)+((h_vpage)?128:0)+((h_vmode==99)?2:0));
- }
-
- If the parameter 'on' has a value other than 0 the adapter is turned
- on, otherwise it is turned off.
-
- 5) Detect the presence of a mouse driver
-
- The mouse is controlled by making calls to interrupt 33 hex with
- various values in the NON-SEGMENT registers. The 'int86' function
- works well for this. When register ax is 0 the mouse driver
- is initialized and returns the number of buttons on the mouse in
- the bx register. The ax register contains -1 if a mouse is present,
- otherwise it contains 0.
-
- Here is the function:
-
- int m_int(buttons)
- int *buttons;
- {
- union REGS reg;
- reg.x.ax=0;
- int86(0x33,®,®);
- *buttons=reg.x.bx;
- return(reg.x.ax);
- }
-
- When calling this function note that a pointer to 'buttons' is
- passed as the parameter. The function call will look like this -
- x=m_init(&y).
-
- 6) Turning the mouse cursor on/off
-
- Call the mouse interrupt with 1 in the ax register turns the mouse
- cursor on. If 2 is in ax then the mouse cursor is turned off. Note
- that the number of calls to mouse on must be the same as the number
- of calls to mouse off. In other words, if the mouse on call is made
- twice then the mouse off call must be made twice to turn the cursor
- off.
-
-
- C News 1-08 Page 15 11 Jun 1988
- ================================================================
- Programming for the Hercules Graphics Card by David Cheslow.
- ================================================================
-
- Here's the function:
-
- void m_cursor(on)
- int on;
- {
- union REGS reg;
- reg.x.ax=((on)?1:2);
- int86(0x33,®,®);
- }
-
- If 'on' ==0 then the mouse cursor is turned off, otherwise it is
- turned on.
-
- THE DEMO:
-
- If you are using the demo program with a mouse installed, note
- that the mouse can not move over the entire screen. The fix for
- that will be in my next article. Other than that, the demo should
- be self explanatory. The only functions you need to compile it
- are 'printf' 'getch' and 'exit'.
-
- C News 1-08 Page 16 11 Jun 1988
- ================================================================
- Latest Versions of Commercial/PD Software.
- ================================================================
-
- Compilers: Ver:
- --------- ----
-
- Microsoft C 5.10
- QuickC 1.01
-
- TurboC 1.5 /* With a rumored 2.0 out */
- Datalight ?
- MIX C ?
- PowerC ?
- Lattice C ?
- Watcom 6.0
-
- C News 1-08 Page 17 11 Jun 1988
- ================================================================
- ARTICLE SUBMISSION STANDARDS AND ADDRESSES
- ================================================================
-
-
- As I have repeatedly stated in this newsletter and previous
- issues, I would like to see user-submitted articles, reviews or
- questions. Listed below are the standards that should be
- followed to make my job easier as an editor.
-
-
- - Articles should be submitted in a ASCII non-formatted
- file. (Margins 0-65 PLEASE)
-
- - If the article include code fragments as examples. Then
- you can include the entire source file if you like for
- inclusion with the newsletter.
-
- - Book or magazine reviews should follow the same format,
- that is outlined in this issue. The publisher, author,
- title, and ISBN number are a must.
-
- - Compiler/and or product reviews, should include the
- version number and manufacture. If possible, reviews
- should include a sample program with benchmarks.
-
-
- If you have any questions you can contact me at the
- address's included on the next page.
-
- C News 1-08 Page 18 11 Jun 1988
- ================================================================
- ADDRESSES
- ================================================================
-
- The C BBS is located at:
-
- C BBS
- % BCL Limited
- P.O. Box 9162
- McLean VA, 22102
-
-
- or you can send netmail to:
-
-
- 1:109/713
-
-
-
-
- C News 1-08 Page 19 11 Jun 1988
- ================================================================
- USER RESPONSE FORM
- ================================================================
-
- This form will be included as a regular feature in all future
- issues of C NEWS.
-
-
-
- What did you think of the content of this Issue? _____________
-
- _______________________________________________________________
-
- What improvements can you think of that would make C News a
- better tool for the C Community?
-
- _______________________________________________________________
-
- _______________________________________________________________
-
-
- What is your favorite section or sections? ___________________
-
- _______________________________________________________________
-
-
- What don't you like about C News? ____________________________
-
- _______________________________________________________________
-
-
- Additional Comments: _________________________________________
-
- _______________________________________________________________
-
- _______________________________________________________________
-
- _______________________________________________________________
-
- C News 1-08 Page 20 11 Jun 1988
- ================================================================
- INDEX
- ================================================================
-
- Subject: Issue:
-
- Articles:
-
- Additional Comments of Filename Wild.. 6
- Beginning C Functions 7
- C Spot Run: A User Supported Library 7
- Filename Wildcard Expansion in MSC 4
- Integrated Environment: TC & QC 5
- Programming the Hercules Graphics Card 8
- Talking with a Fossil 5
- TurboC and Interrupts: A few Questions 2
-
- Book Reviews:
-
- C Chest: and other treasures. 6
- C Database Development 1
- C Programming Guide 1
- C Programming Language 1
- C Programmer's Guide to Serial Communications 3
- C Programmer's Library 1
- C Primer Plus 1
- C the Complete Reference 2
- Crafting C Tools for the IBM PC 2
- Learning to Program in C 1
- Microsoft C Programming on the IBM PC 1
- MS-DOS Developer's Guide 4
- Programming in Windows 3
- Reliable Data Structures in C 1
- TurboC: Memory Resident Utilities 5
- TurboC Programmer's Reference Book 2
-
-
- Compilers:
-
- QuickC 1
-
- Software Reviews:
-
- Bplus11.arc 3
- C_Dates.arc 4
- Cdate.arc 4
- Casm.arc 3
- C-subr.arc 4
- Docu.arc 3
- Ezwind.arc 8
- Jcl-src.arc 4
- Mscpopup.arc 3
- Ndmake41.arc 4
- C News 1-08 Page 21 11 Jun 1988
- ================================================================
- INDEX
- ================================================================
-
-
- Subject: Issue:
-
- Software Reviews Cont:
-
- Nuc-subr.arc 3
- Prndoc.arc 6
- Sed.arc 6
- Shift_c.arc 4
- Sysact11.arc 4
- Tp_to_qc.arc 3
- Xenixarc.arc 4
-
- C News 1-08 Page 22 30 May 1988
-
- ================================================================
- DISTRIBUTION POINTS
- ================================================================
-
-
- Board Name Number Net/Node Sysop
-
- United States
-
- C BBS (703) 440-0240 1:109/713 Barry Lynch
- Burke, VA
-
- Jaz C-Scape (904) 724-1377 1:112/1027 Tom Evans
- Jacksonville, FL
-
-
- Eastern C Board (201) 247-6748 1:107/335 Todd Lehr
-
-
-
-
-
- Canada
-
- Another BBS System (416) 465-7752 1:148/208 Mark Bowman
- Toronto, Canada
-
- Europe
-
- Fido_N1_1 31-8350-37156 2:500/1 Henk Wevers
- The Netherlands
-
- Australia
-
- Alpha-Centuri BBS 011-61-3-874-3559 3:632/348 David Nugent
-
-
-
-
-
-
-
-