13h Problem ... WITH CODE 
Author Message
 13h Problem ... WITH CODE

Quote:

>I make use of a programmer's code and edit it into game_7.cpp
>(in the attachment) ... After I compiled it and ran it , it works as
>what I want but it hangs after it ran . The screen is freezed .

>Pls help . See the attactment .

You rocde uses a lot of things that aren't defined by the C language (
e.g. conio.h, dos.h, mem.h, int86(), getch(), absolute memory addresses).
You would be better off posting yuor question to a platform related newsgroup
where these things have some meaning (maybe comp.os.msdos.programmer).

--
-----------------------------------------


-----------------------------------------



Thu, 06 Jan 2000 03:00:00 GMT  
 13h Problem ... WITH CODE

Quote:

> I make use of a programmer's code and edit it into game_7.cpp
> (in the attachment) ... After I compiled it and ran it , it works as
> what I want but it hangs after it ran . The screen is freezed .

Several comments:
1) The .cpp extension indicates th program is written in C++ rather than
C, although, admittedly I did not see an C++ constructs in the code.

 comp.lang.c++                      The C++ Programming Language

2) The following headers are compiler/platform extensions, not part of
standard C, as such, you will get a more complete and valid answer by
asking in a NewsGroup for you platform/OS combination.

Quote:
> #include <conio.h>
[snip]
> #include <dos.h>
> #include <mem.h>

Try:
 comp.os.msdos.programmer               DOS O/S Related Issues
 comp.os.ms-windows.programmer.misc     MS/Windows Programming

[snip]

Quote:
> void main()

There are two, and only two, proper ways to define main, and one of
those methods is only provided for backward compatability.

int main( int argc, char **argv ){}   /* The is the preferred method. */

int main( void ){}      /* To avoid breaking code, this is allowed. */

Quote:
> {
>         int i,j;//,x,y;
>         BITMAP bmp,bg;

>         load_bmp("rocket.bmp",&bmp);        /* open the file */

>         set_mode(VGA_256_COLOR_MODE);       /* set the video mode. */

>         /* draw the background */
>         for(i=0;i<200;i++)
>                 memset(&VGA[320*i],220-i,SCREEN_WIDTH);

>         bg.width=bmp.width;
>         bg.height=bmp.height;
>         printf("BG_W = %d\n",bg.width);
>         printf("BG_H = %d\n",bg.height);
>         getch();
>         for (i=0;i<320-bmp.width;i+=bmp.width/3)
>         {
>                 read_bg(&bg,i,100-bmp.height/2);
>                 draw_transparent_bitmap(&bmp,i,100-bmp.height/2,0);
>                 draw_transparent_bitmap(&bg,i,100-bmp.height/2,0);
>         }

>         free(bmp.data);                     /* free up memory used */
>         printf("free bmp\n");
>         getch();
>         free(bg.data);
>         printf("free bg\n");
>         getch();
>         set_mode(TEXT_MODE);                /* set the video mode back
> to */
>         getch();
>         return;
> }

It is not possible for me to compile and test this code; 1) I don't know
what compiler it was written for, 2) I probably don't have a copy handy
anyway.

Always include the following information with a question:

        Your Platform and Operating System.
                (although, you did not do this, it is obvious from the code.)
        The compilers available to you.
        The code you think is causing the problem, always make the code
complete
                (you did this).
        A detailed description of the problem with any error messages generated
                (you did this).

This way, we can either; Answer your question, or direct you to a
NewsGroup where you will be able to get an answer.

--
********************************************

********************************************
The real art of conversation is not only to
say the right thing in the right place, but
to leave unsaid the wrong thing in a tempting moment.
                                Dorothy Nevil



Thu, 06 Jan 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. _int86( ) & VGA mode 13h

2. 13h or X

3. MCGA and Mode 13h

4. Video Mode 13h amd Mode X in C

5. Working with the partition table - Interrupt 13H

6. Better than 13h???

7. Printing strings in VGA 13h mode

8. initialising and using vga mode 13h

9. Initializing and using vga mode 13h

10. mode 13h using Turbo C++ 4.5???

11. 13h

12. mode 13h text function

 

 
Powered by phpBB® Forum Software