[Scummvm-cvs-logs] CVS: descumm descumm6.cpp,1.2,1.3
Mutwin Kraus
mutle at users.sourceforge.net
Mon Mar 18 11:00:15 CET 2002
Update of /cvsroot/scummvm/descumm
In directory usw-pr-cvs1:/tmp/cvs-serv23342/descumm
Modified Files:
descumm6.cpp
Log Message:
Added Big Endian Comaptibility, just needed to define SCUMM_BIG_ENDIAN while compiling
Index: descumm6.cpp
===================================================================
RCS file: /cvsroot/scummvm/descumm/descumm6.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** descumm6.cpp 11 Nov 2001 10:38:19 -0000 1.2
--- descumm6.cpp 18 Mar 2002 18:59:31 -0000 1.3
***************
*** 47,50 ****
--- 47,62 ----
#define JUMP_OPCODE 0x73
+ #if defined(SCUMM_BIG_ENDIAN)
+
+ uint32 inline TO_LE_32(uint32 a) {
+ return ((a>>24)&0xFF) + ((a>>8)&0xFF00) + ((a<<8)&0xFF0000) + ((a<<24)&0xFF000000);
+ }
+
+ uint16 inline TO_LE_16(uint16 a) {
+ return ((a>>8)&0xFF) + ((a<<8)&0xFF00);
+ }
+
+ #endif
+
struct StackEnt {
byte type;
***************
*** 266,274 ****
int get_byte() {
! return (byte)(*cur_pos++);
}
int get_word() {
int i = *((short*)cur_pos);
cur_pos+=2;
return i;
--- 278,290 ----
int get_byte() {
! return (byte)(*cur_pos++);
}
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;
***************
*** 1510,1515 ****
output = buf = (char*)malloc(8192);
!
! switch( *((long*)mem) ) {
case 'RCSL':
printf("Script# %d\n", (unsigned char)mem[8]);
--- 1526,1535 ----
output = buf = (char*)malloc(8192);
!
! #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