Jump to content

  • Log In with Google      Sign In   
  • Create Account


One little error


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Slayer-X   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 November 1999 - 12:18 PM

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.


Sponsor:

#2 Splat   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 November 1999 - 10:04 AM

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).]


#3 Slayer-X   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 November 1999 - 10:05 AM

Well, it's a DOS pong game and it's the only thing wrong with it. 2000 lines and that one line is screwing it up.

#4 Rock2000   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 November 1999 - 10:15 AM

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


#5 Slayer-X   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 November 1999 - 10:22 AM

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
}


#6 King   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 November 1999 - 12:18 PM

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





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS