forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
royonimusha



Joined: 26 Jun 2005
Posts: 2

PostPosted: Mon Jun 27, 2005 7:03 pm    Post subject: Can't compiled the pg.c.....HELP ME Reply with quote

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:

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:

pg.c:in function pgPixel:
pg.c :121: stray:'\241' in program
.........
Back to top
View user's profile Send private message
Knox



Joined: 15 May 2005
Posts: 13
Location: Yorkshire, England

PostPosted: Mon Jun 27, 2005 8:02 pm    Post subject: Reply with quote

This is what I use:
Code:
void pgPutPixel(unsigned long x,unsigned long y,unsigned short color)
{
   unsigned char *vptr;
   vptr=pgGetVramAddr(x,y);
   *(unsigned short *)vptr=color;
}
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Mon Jun 27, 2005 11:37 pm    Post subject: Re: Can't compiled the pg.c.....HELP ME Reply with quote

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

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group