* Changed the string hash of the script engine to SDBM.

* Reporting information about script data when an error occurs.
* More work on ticket #41 (array functions).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10813 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
FlavioJS 2007-06-26 21:03:31 +00:00
parent d3d77a69d1
commit a75ec9a547
5 changed files with 580 additions and 309 deletions

View File

@ -3,6 +3,10 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/06/26
* Changed the string hash of the script engine to SDBM.
* Reporting information about script data when an error occurs.
* More work on ticket #41 (array functions). [FlavioJS]
2007/06/22 2007/06/22
* Changed behavior of some guild-related code (according to X.4 tests): * Changed behavior of some guild-related code (according to X.4 tests):
- removed code that prevented Homunculus Resurrection during WoE - removed code that prevented Homunculus Resurrection during WoE

View File

@ -294,30 +294,35 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
} }
#endif #endif
unsigned char GetByte(unsigned long val, size_t num) uint8 GetByte(uint32 val, size_t num)
{ {
switch(num) { switch( num )
case 0: return (unsigned char)((val & 0x000000FF) ); {
case 1: return (unsigned char)((val & 0x0000FF00)>>0x08); case 0: return (uint8)((val & 0x000000FF) );
case 2: return (unsigned char)((val & 0x00FF0000)>>0x10); case 1: return (uint8)((val & 0x0000FF00) >> 0x08);
case 3: return (unsigned char)((val & 0xFF000000)>>0x18); case 2: return (uint8)((val & 0x00FF0000) >> 0x10);
case 3: return (uint8)((val & 0xFF000000) >> 0x18);
default: return 0; //better throw something here default: return 0; //better throw something here
} }
} }
unsigned short GetWord(unsigned long val, size_t num) uint16 GetWord(uint32 val, size_t num)
{ {
switch(num) { switch( num )
case 0: return (unsigned short)((val & 0x0000FFFF) ); {
case 1: return (unsigned short)((val & 0xFFFF0000)>>0x10); case 0: return (uint16)((val & 0x0000FFFF) );
case 1: return (uint16)((val & 0xFFFF0000) >> 0x10);
default: return 0; //better throw something here default: return 0; //better throw something here
} }
} }
unsigned short MakeWord(unsigned char byte0, unsigned char byte1) uint16 MakeWord(uint8 byte0, uint8 byte1)
{ {
return byte0 | (byte1<<0x08); return
((uint16)(byte0 ))|
((uint16)(byte1 << 0x08));
} }
unsigned long MakeDWord(unsigned short word0, unsigned short word1) uint32 MakeDWord(uint16 word0, uint16 word1)
{ {
return ((unsigned long)word0) return
| ((unsigned long)word1<<0x10); ((uint32)(word0 ))|
((uint32)(word1 << 0x10));
} }

View File

@ -38,9 +38,9 @@ void findfile(const char *p, const char *pat, void (func)(const char*));
// byte word dword access [Shinomori] // byte word dword access [Shinomori]
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
extern unsigned char GetByte(unsigned long val, size_t num); extern uint8 GetByte(uint32 val, size_t num);
extern unsigned short GetWord(unsigned long val, size_t num); extern uint16 GetWord(uint32 val, size_t num);
extern unsigned short MakeWord(unsigned char byte0, unsigned char byte1); extern uint16 MakeWord(uint8 byte0, uint8 byte1);
extern unsigned long MakeDWord(unsigned short word0, unsigned short word1); extern uint32 MakeDWord(uint16 word0, uint16 word1);
#endif /* _UTILS_H_ */ #endif /* _UTILS_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -44,8 +44,10 @@ struct script_code {
}; };
struct script_stack { struct script_stack {
int sp,sp_max,defsp; int sp;// number of entries in the stack
struct script_data *stack_data; int sp_max;// capacity of the stack
int defsp;
struct script_data *stack_data;// stack
struct linkdb_node **var_function; // ŠÖ<C5A0>ˆË¶•Ï<E280A2> struct linkdb_node **var_function; // ŠÖ<C5A0>ˆË¶•Ï<E280A2>
}; };