Can't compiled the pg.c.....HELP ME

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
royonimusha
Posts: 2
Joined: Sun Jun 26, 2005 9:06 pm

Can't compiled the pg.c.....HELP ME

Post by royonimusha »

I add a function which name is pgPixel to pg.c and I also add it to pg.h,but when I load the "mk.bat",can't be compiled the pg.c.who'd love to help me?much thanks!

Code: Select all

void pgPixel(unsigned long x,unsigned long y,unsigned long color)
{
  unsigned char *vptr0;
  vptr0=pgGetVramAddr(0,0);
  *(unsigned short *)(vptr0+x*2+y*1024)=color;
}
The window of MS-DOS send the error information following:

Code: Select all

pg.c:in function pgPixel:
pg.c :121: stray:'\241' in program
.........
Knox
Posts: 13
Joined: Sun May 15, 2005 11:51 pm
Location: Yorkshire, England

Post by Knox »

This is what I use:

Code: Select all

void pgPutPixel(unsigned long x,unsigned long y,unsigned short color)
{
	unsigned char *vptr;
	vptr=pgGetVramAddr(x,y);
	*(unsigned short *)vptr=color;
}
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Re: Can't compiled the pg.c.....HELP ME

Post by Shine »

royonimusha wrote:The window of MS-DOS send the error information following:

Code: Select all

pg.c:in function pgPixel:
pg.c :121: stray:'\241' in program
.........
This means you have a special character in line 121. Delete this line and enter it again.

But if you use nem's pgGetVramAddr, you should use the x and y parameter, like royonimusha posted, then you don't need to calculate the offset yourself.
Post Reply