Forum

Kurok PSP errors

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Kurok PSP errors

Postby Max_Salivan » Wed Feb 15, 2012 12:45 pm

Hello,can something help me with engine?

my friend done some features for flitzkurok PC engine,and i want add it in kurok psp engine

if i compile it,i have a errors

http://rghost.ru/36531975
Sorry for my english :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: Kurok PSP errors

Postby Baker » Wed Feb 15, 2012 1:04 pm

List of errors?
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Kurok PSP errors

Postby Max_Salivan » Wed Feb 15, 2012 1:13 pm

Baker wrote:List of errors?

all errors are

qboolean does no name a type


http://savepic.su/1343096.htm
Sorry for my english :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: Kurok PSP errors

Postby Baker » Wed Feb 15, 2012 1:23 pm

In common.h ...

You have ...

Code: Select all
#if !defined BYTE_DEFINED
typedef unsigned char       byte;
#define BYTE_DEFINED 1
#endif

#undef true
#undef false

typedef enum {false, true}   qboolean;


But this needs to be ...
Code: Select all
#if !defined BYTE_DEFINED
typedef unsigned char       byte;
#define BYTE_DEFINED 1
#endif

#undef true
#undef false

#if defined(PSP) && defined(__cplusplus)  // <---------------------
typedef enum {qfalse, qtrue}   qboolean; // <---------------------------
#else // <-----------------------------------------------------------------
typedef enum {false, true}   qboolean;
#endif // <--------------------------------------------------


The PSP C++ files hates the qboolean datatype. So the above is required to work around the issue.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Kurok PSP errors

Postby Max_Salivan » Wed Feb 15, 2012 1:51 pm

Baker wrote:In common.h ...

You have ...

Code: Select all
#if !defined BYTE_DEFINED
typedef unsigned char       byte;
#define BYTE_DEFINED 1
#endif

#undef true
#undef false

typedef enum {false, true}   qboolean;


But this needs to be ...
Code: Select all
#if !defined BYTE_DEFINED
typedef unsigned char       byte;
#define BYTE_DEFINED 1
#endif

#undef true
#undef false

#if defined(PSP) && defined(__cplusplus)  // <---------------------
typedef enum {qfalse, qtrue}   qboolean; // <---------------------------
#else // <-----------------------------------------------------------------
typedef enum {false, true}   qboolean;
#endif // <--------------------------------------------------


The PSP C++ files hates the qboolean datatype. So the above is required to work around the issue.


arr-_-
http://savepic.su/1318524.htm
Sorry for my english :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: Kurok PSP errors

Postby Baker » Wed Feb 15, 2012 2:18 pm

in common.h add ...

#define bound(a, b, c) ((a) >= (c) ? (a) : (b) < (a) ? (a) : (b) > (c) ? (c) : (b))
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Kurok PSP errors

Postby Max_Salivan » Wed Feb 15, 2012 2:31 pm

Baker wrote:in common.h add ...

#define bound(a, b, c) ((a) >= (c) ? (a) : (b) < (a) ? (a) : (b) > (c) ? (c) : (b))


more errors

http://savepic.su/1311344.htm
Sorry for my english :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: Kurok PSP errors

Postby Baker » Wed Feb 15, 2012 9:56 pm

You'll probably have to open mathlib.h and mathlib.c and copy RotatePointAroundVector and VectorVectors into your new mathlib.h and mathlib.c

The function is missing.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Kurok PSP errors

Postby Max_Salivan » Thu Feb 16, 2012 3:29 am

Baker wrote:You'll probably have to open mathlib.h and mathlib.c and copy RotatePointAroundVector and VectorVectors into your new mathlib.h and mathlib.c

The function is missing.


ok,but i have new errors :shock:
http://savepic.su/1400255.htm
Sorry for my english :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: Kurok PSP errors

Postby Baker » Thu Feb 16, 2012 3:57 am

Max_Salivan wrote:ok,but i have new errors :shock:


Replace existing function in mathlib.c:

I don't know how to make ASM work on a PSP. But this will make the function work.

The ASM will still compile on the PC version, but for the PSP it will use native floating point functions.

Code: Select all
/*
=================
SinCos
=================
*/
void SinCos( float radians, float *sine, float *cosine )
{
#if defined(PSP)
   *sine   = sinf (radians);
   *cosine = cosf (radians);
#else   
   _asm
   {
      fld   dword ptr [radians]
      fsincos

      mov edx, dword ptr [cosine]
      mov eax, dword ptr [sine]

      fstp dword ptr [edx]
      fstp dword ptr [eax]
   }
#endif
}
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Kurok PSP errors

Postby revelator » Thu Feb 16, 2012 7:10 am

i think it uses gnu intel syntax, so basically the same gcc uses.
ill see if i can find something about it.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Kurok PSP errors

Postby revelator » Thu Feb 16, 2012 7:18 am

yep its standard x86 asm intel syntax so you can use a number of tools like nasm or gcc's own gas the syntax differs from ms format though so you might have to read up a bit on the differences. intels assembler should work to :)
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: Kurok PSP errors

Postby Baker » Thu Feb 16, 2012 8:03 am

I'm not so sure about that for a PSP. The PSP ASM I've seen doesn't look like that.

Looks like:

Code: Select all
asm __volatile__ ("\n\
ori $5,$0,0\n\
ori $17,$0,0\n\
loop:\n\
mul %1,%2\n\
mflo $16\n\

And he posted that the ASM code was giving him an error during the compile (in the screenshot). The PSP uses a MIPS processor. I also kind of think that the ASM in question is only a modest improvement over what a C compiler would probably do with that code. It's just calling a standard math function and returning it, it isn't like it is doing some wild and crazy span drawing stuff.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Kurok PSP errors

Postby Max_Salivan » Thu Feb 16, 2012 10:28 am

Baker wrote:I'm not so sure about that for a PSP. The PSP ASM I've seen doesn't look like that.

Looks like:

Code: Select all
asm __volatile__ ("\n\
ori $5,$0,0\n\
ori $17,$0,0\n\
loop:\n\
mul %1,%2\n\
mflo $16\n\

And he posted that the ASM code was giving him an error during the compile (in the screenshot). The PSP uses a MIPS processor. I also kind of think that the ASM in question is only a modest improvement over what a C compiler would probably do with that code. It's just calling a standard math function and returning it, it isn't like it is doing some wild and crazy span drawing stuff.


thanks for information)

i have a new errors-_-

http://savepic.su/1437126.htm


UPD:i am compile it
added
#define FL_MONSTERCLIP 8192 // Only solid to entities with FL_MONSTER


but doors and buttons dont work,i am pass through them
Sorry for my english :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: Kurok PSP errors

Postby revelator » Thu Feb 16, 2012 1:50 pm

i know its a mips but various sites state that its standard x86 asm hmm ? though that asm code looks a bit weird. it does resemble intel asm a bit but without the \n\ newlines also i dont recognize the ori calls. mul is pretty standard though and im not sure about mflo. codewarrior has a compiler/assembler for mips but its not free i think i wonder if rtems has one.
Productivity is a state of mind.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Next

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest