[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.11,1.12

Ludvig Strigeus strigeus at users.sourceforge.net
Sun Apr 14 13:23:02 CEST 2002


Update of /cvsroot/scummvm/scummvm/simon
In directory usw-pr-cvs1:/tmp/cvs-serv5565

Modified Files:
	simon.cpp 
Log Message:
fixed a few endianness bugs

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** simon.cpp	14 Apr 2002 18:13:08 -0000	1.11
--- simon.cpp	14 Apr 2002 20:22:36 -0000	1.12
***************
*** 5782,5786 ****
  
  void SimonState::o_unk_120(uint a) {
! 	uint16 id = READ_BE_UINT16_UNALIGNED(&a);
  	_lock_word |= 0x4000;
  	_vc_ptr = (byte*)&id;
--- 5782,5786 ----
  
  void SimonState::o_unk_120(uint a) {
! 	uint16 id = TO_BE_16(a);
  	_lock_word |= 0x4000;
  	_vc_ptr = (byte*)&id;
***************
*** 6056,6060 ****
  
  void SimonState::o_unk_99_simon1(uint a) {
! 	uint16 b = READ_BE_UINT16_UNALIGNED(&a);
  	_lock_word |= 0x4000;
  	_vc_ptr = (byte*)&b;
--- 6056,6060 ----
  
  void SimonState::o_unk_99_simon1(uint a) {
! 	uint16 b = TO_BE_16(a);
  	_lock_word |= 0x4000;
  	_vc_ptr = (byte*)&b;
***************
*** 6066,6071 ****
  	uint16 items[2];
  	
! 	items[0] = READ_BE_UINT16_UNALIGNED(&a);
! 	items[1] = READ_BE_UINT16_UNALIGNED(&b);
  
  	_lock_word |= 0x4000;
--- 6066,6071 ----
  	uint16 items[2];
  	
! 	items[0] = TO_BE_16(a);
! 	items[1] = TO_BE_16(a);
  
  	_lock_word |= 0x4000;
***************
*** 7179,7185 ****
  	p = dst + num_1 * 8;
  
! 	*(uint16*)(p+4) = READ_BE_UINT16_UNALIGNED(&height);
! 	*(uint16*)(p+6) = READ_BE_UINT16_UNALIGNED(&width);
! 	dst += READ_BE_UINT32_UNALIGNED(&*(uint32*)p);
  
  	memset(dst, 0, count);
--- 7179,7185 ----
  	p = dst + num_1 * 8;
  
! 	*(uint16*)(p+4) = TO_BE_16(height);
! 	*(uint16*)(p+6) = TO_BE_16(width);
! 	dst += READ_BE_UINT32_UNALIGNED(p);
  
  	memset(dst, 0, count);
***************
*** 8597,8601 ****
  	do {
  		if (!(_game & GAME_SIMON2)) {
! 			opcode = READ_BE_UINT16_UNALIGNED(&*(uint16*)src);
  			src+=2;
  		} else {
--- 8597,8601 ----
  	do {
  		if (!(_game & GAME_SIMON2)) {
! 			opcode = READ_BE_UINT16_UNALIGNED((uint16*)src);
  			src+=2;
  		} else {
***************
*** 8616,8625 ****
  			case 'x': fprintf(_dump_file,"\n"); return;
  			case 'b':	fprintf(_dump_file,"%d ", *src++); break;
! 			case 'd':	fprintf(_dump_file,"%d ", READ_BE_UINT16_UNALIGNED(&*(uint16*)src)); src+=2; break;
! 			case 'v':	fprintf(_dump_file,"[%d] ", READ_BE_UINT16_UNALIGNED(&*(uint16*)src)); src+=2; break;
! 			case 'i':	fprintf(_dump_file,"%d ", (int16)READ_BE_UINT16_UNALIGNED(&*(uint16*)src)); src+=2; break;
  			case 'q': 
  				while (*(uint16*)src != 0xE703) {
! 					fprintf(_dump_file,"(%d,%d) ", READ_BE_UINT16_UNALIGNED(&((uint16*)src)[0]), READ_BE_UINT16_UNALIGNED(&((uint16*)src)[1]));
  					src += 4;
  				}
--- 8616,8625 ----
  			case 'x': fprintf(_dump_file,"\n"); return;
  			case 'b':	fprintf(_dump_file,"%d ", *src++); break;
! 			case 'd':	fprintf(_dump_file,"%d ", READ_BE_UINT16_UNALIGNED(src)); src+=2; break;
! 			case 'v':	fprintf(_dump_file,"[%d] ", READ_BE_UINT16_UNALIGNED(src)); src+=2; break;
! 			case 'i':	fprintf(_dump_file,"%d ", (int16)READ_BE_UINT16_UNALIGNED(src)); src+=2; break;
  			case 'q': 
  				while (*(uint16*)src != 0xE703) {
! 					fprintf(_dump_file,"(%d,%d) ", READ_BE_UINT16_UNALIGNED(src), READ_BE_UINT16_UNALIGNED(src+2));
  					src += 4;
  				}





More information about the Scummvm-git-logs mailing list