[Scummvm-cvs-logs] CVS: descumm descumm5.cpp,1.3,1.4
Mutwin Kraus
mutle at users.sourceforge.net
Mon Mar 18 11:00:12 CET 2002
Update of /cvsroot/scummvm/descumm
In directory usw-pr-cvs1:/tmp/cvs-serv23281/descumm
Modified Files:
descumm5.cpp
Log Message:
Added Big Endian Comaptibility, just needed to define SCUMM_BIG_ENDIAN while compiling
Index: descumm5.cpp
===================================================================
RCS file: /cvsroot/scummvm/descumm/descumm5.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** descumm5.cpp 11 Nov 2001 10:38:19 -0000 1.3
--- descumm5.cpp 18 Mar 2002 18:59:23 -0000 1.4
***************
*** 111,114 ****
--- 111,125 ----
bool emit_if(char *before, char *after);
+ #if defined(SCUMM_BIG_ENDIAN)
+
+ unsigned long inline TO_LE_32(unsigned long a) {
+ return ((a>>24)&0xFF) + ((a>>8)&0xFF00) + ((a<<8)&0xFF0000) + ((a<<24)&0xFF000000);
+ }
+
+ unsigned short inline TO_LE_16(unsigned short a) {
+ return ((a>>8)&0xFF) + ((a<<8)&0xFF00);
+ }
+
+ #endif
int get_byte() {
***************
*** 117,121 ****
--- 128,136 ----
int get_word() {
+ #if defined(SCUMM_BIG_ENDIAN)
+ int i = TO_LE_16(*((short*)cur_pos));
+ #else
int i = *((short*)cur_pos);
+ #endif
cur_pos+=2;
return i;
***************
*** 1502,1506 ****
--- 1517,1525 ----
buf = (char*)malloc(4096);
+ #if defined(SCUMM_BIG_ENDIAN)
+ switch( TO_LE_32(*((long*)mem)) ) {
+ #else
switch( *((long*)mem) ) {
+ #endif
case 'RCSL':
printf("Script# %d\n", (unsigned char)mem[8]);
More information about the Scummvm-git-logs
mailing list