Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Slayer-X

One little error

This topic is 6923 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, if you're using DirectDraw, just use IDirectDraw::WaitForVerticalBlank(). Other than that, I can't help. Just be aware that most conio.h functions (especially that one) will FAIL in a restricted and/or Windows NT/2000 environment.

Whoops, just reread your question: The correct prototype for _inp is the following

int __cdecl _inp(unsigned short);

I'm pretty sure leaving out the 'short' would give you an error.

- Splat

[This message has been edited by Splat (edited November 07, 1999).]

Share this post


Link to post
Share on other sites
Advertisement
OK, I'm probably missing your point, but why are you prototyping the conio func? Its already done; just include conio.h.

I would guess that the error it gives you is because it doesn't know what __cdecl is. Are you sure you have the correct # of _'s. It looks like it thinks __cdecl is a var, and then obviously wants a comma to separate it from the next var name.

Rock

Share this post


Link to post
Share on other sites
I know that it thinks that __cdecl is var, and I'm prototyping it because I have 2 different conio.h files and one includes the funtion I need. It has the same error with that include file, so I was just going to use the funtion that I needed. But it is still giving me the same error. Here's more code:

#define __cdecl _cdecl

/* function prototypes */

int _cdecl _inp(unsigned);


#define VGA_INPUT_STATUS_1 0x3DA
// VGA status reg1, bit 3 is the vsync
// when 1 - retrace in progress
// when 0 - no retrace
#define VGA_VSYNC_MASK 0x80 // masks off unwanted bit of the status reg.

// Function: wait_for_vsync
// Purpose: waits for the vertical retrace
//
// Input: none
// Output: none
void wait_for_vsync();

---Game Code---

void wait_for_vsync()
{
while(_inp(VGA_INPUT_STATUS_1) & VGA_VSYNC_MASK)
{
// do nothing: VGA is in retrace
}

// Now wiat for vsync and exit

while(!(_inp(VGA_INPUT_STATUS_1) & VGA_VSYNC_MASK))
{
// Do nothing: wait for the start of retrace
}

// retrace is starting so exit
}

Share this post


Link to post
Share on other sites
You might check the header, it might not have anything in it, because i think he's right it seems like the compiler doesn't know what that _...... is.

-King
MXF ENTERTAINMENT

Share this post


Link to post
Share on other sites
I have my pong clone almost complete, the only thing i need to do is get the vsync working. I'm using the _inp function from conio.h in my program to get the bits to test for the vsync. All I need is this one line working:

int __cdecl _inp(unsigned);

My compiler says I need a comma, like this:

int __cdecl ,_inp(unsigned);

But when I do that it gives my some stupid error. Please help.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!