home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!csd4.csd.uwm.edu!pegasus
- From: pegasus@csd4.csd.uwm.edu (David R Hucke)
- Subject: Curious bug...
- Message-ID: <1992Jul22.050021.3974@uwm.edu>
- Originator: pegasus@csd4.csd.uwm.edu
- Sender: news@uwm.edu (USENET News System)
- Organization: Computing Services Division, University of Wisconsin - Milwaukee
- Date: Wed, 22 Jul 1992 05:00:21 GMT
- Lines: 58
-
- Hello everybody!
-
- I have a program that I have written in Quick C 2.5 that doesn't work right and
- I am stumped.
-
- I use a program called "TheDraw" to create menus which are saved as binary
- screen dumps to a disk file. This program below reads the file in and
- puts it into an array. Then the array is put in the screen.
-
- What happens is this: When I run the program in the QC Environment it
- works fine. The characters are correct, and the colors are not correct.
-
- When I run the program from DOS (outside of the QC Environment) the characters
- are correct but the colors are not correct.
-
- Can somebody tell me what is wrong here?
-
-
- #include <stdio.h>
-
- main()
- {
-
- short far *SCREEN = (short far *) 0xB8000000;
- short menu[8][20];
- short x,y;
- FILE *file;
- int i,j,z;
-
- if(!(file = fopen("c:\\test.scn","r"))){
- printf("Unable to open file!\n");
- exit(99);
- }
- for(j=0;j<8;j++)
- for(i=0;i<20;i++){
- fscanf(file,"%c%c",&x,&y); /* reading in attribute and
- character bytes */
- menu[j][i] = (short)((y<<8)+x); /* putting together screen
- character ---> attribute
- and character. Shifting
- one of the bytes. */
- }
- fclose(file);
- for(j=0;j<8;j++)
- for(i=0;i<20;i++)
- *(SCREEN+((j+5)*80)+(30+i)) = (int)menu[j][i];
- }
-
-
- Thank you for the help.
-
- ===
- pegasus@csd4.csd.uwm.edu
-
- --
- pegasus@csd4.csd.uwm.edu David R. Hucke
- UW-Milwaukee Film Major
- --
-