Sign in to follow this  
cjlm007

If I use AngelScript in PSP, shall I make some configs?

Recommended Posts

If you use GNUC (which I believe you do) you shouldn't have to do any specific configuration for the PSP, since as_config.h is already prepared for this.

Let me know if there are any problems. It's been a while since I heard from anyone using the library for the PSP so it is possible that some things may have broken with the latest changes.

Regards,
Andreas

Share this post


Link to post
Share on other sites
I do it with PSP by using a PSP library. This library can use in WIN32 and PSP.
When I run my program in WIN32, it can work well. But when I compile it to my PSP, when I run it, the program can't work..
If I drop the codes all about the AngelScript, it can work well both in WIN32 and PSP

Share this post


Link to post
Share on other sites
Could you give me the list of preprocessor defines that the compiler adds by default for the PSP? This can be done with:


touch foo.h; cpp -dM foo.h


It could be that some define that as_config.h uses to detect the PSP as target is not defined, and that some other one can be used instead.

Otherwise, what seems to be the problem on the PSP? Have you tried debugging the library? Where does it cause an error?

Share this post


Link to post
Share on other sites
Yes I have debugged. In file "scriptbuilder.cpp" 's "int CScriptBuilder::BuildScriptFromFile(..)" function, I found the program meet the mistake in line: int r = LoadScriptSection(filename);

here is my #defines
#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __CHAR_BIT__ 8
#define __WCHAR_MAX__ 65535U
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __FLT_EVAL_METHOD__ 2
#define __DBL_MIN_10_EXP__ (-307)
#define __FINITE_MATH_ONLY__ 0
#define __GNUC_PATCHLEVEL__ 5
#define _stdcall __attribute__((__stdcall__))
#define __SHRT_MAX__ 32767
#define __LDBL_MAX__ 1.18973149535723176502e+4932L
#define __LDBL_MAX_EXP__ 16384
#define __SCHAR_MAX__ 127
#define __USER_LABEL_PREFIX__ _
#define __STDC_HOSTED__ 1
#define __WIN32 1
#define __LDBL_HAS_INFINITY__ 1
#define __DBL_DIG__ 15
#define __FLT_EPSILON__ 1.19209290e-7F
#define __tune_i686__ 1
#define __LDBL_MIN__ 3.36210314311209350626e-4932L
#define __DECIMAL_DIG__ 21
#define __LDBL_HAS_QUIET_NAN__ 1
#define __GNUC__ 3
#define _cdecl __attribute__((__cdecl__))
#define __DBL_MAX__ 1.7976931348623157e+308
#define __WINNT 1
#define __DBL_HAS_INFINITY__ 1
#define __WINNT__ 1
#define _fastcall __attribute__((__fastcall__))
#define __USING_SJLJ_EXCEPTIONS__ 1
#define __DBL_MAX_EXP__ 1024
#define __WIN32__ 1
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __GXX_ABI_VERSION 1002
#define __FLT_MIN_EXP__ (-125)
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DBL_HAS_QUIET_NAN__ 1
#define __REGISTER_PREFIX__
#define __cdecl __attribute__((__cdecl__))
#define __NO_INLINE__ 1
#define __i386 1
#define __FLT_MANT_DIG__ 24
#define __VERSION__ "3.4.5 (mingw-vista special r3)"
#define _WIN32 1
#define _X86_ 1
#define i386 1
#define __i386__ 1
#define __SIZE_TYPE__ unsigned int
#define __FLT_RADIX__ 2
#define __LDBL_EPSILON__ 1.08420217248550443401e-19L
#define __MSVCRT__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MAX_10_EXP__ 38
#define __LONG_MAX__ 2147483647L
#define __FLT_HAS_INFINITY__ 1
#define __stdcall __attribute__((__stdcall__))
#define __LDBL_MANT_DIG__ 64
#define __WCHAR_TYPE__ short unsigned int
#define __FLT_DIG__ 6
#define __INT_MAX__ 2147483647
#define WIN32 1
#define __MINGW32__ 1
#define __FLT_MAX_EXP__ 128
#define __DBL_MANT_DIG__ 53
#define __WINT_TYPE__ short unsigned int
#define __LDBL_MIN_EXP__ (-16381)
#define __LDBL_MAX_10_EXP__ 4932
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __tune_pentiumpro__ 1
#define __fastcall __attribute__((__fastcall__))
#define WINNT 1
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN_10_EXP__ (-37)
#define __GNUC_MINOR__ 4
#define __DBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
#define __PTRDIFF_TYPE__ int
#define __LDBL_MIN_10_EXP__ (-4931)
#define __LDBL_DIG__ 18
#define __declspec(x) __attribute__((x))

Share this post


Link to post
Share on other sites
Your defines are identifying the target system as Win32/x86. You need to add the same command line options that you use to build the PSP binary to get the defines for the PSP.

Anyway, since the error is in the CScriptBuilder the problem is probably that the PSP doesn't allow you to read files, or need to do it in a different way. You'll likely have to modify the CScriptBuilder, or completely replace it with something else. Unfortunately I don't know PSP so I can't help you with that.

Regards,
Andreas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this