Advertisement
Guest User

260b-hardcode.patch

a guest
Feb 9th, 2013
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.44 KB | None | 0 0
  1. --- hooks.cpp.orig  2013-02-09 19:51:18.559475705 -0500
  2. +++ hooks.cpp   2013-02-09 19:52:00.659476275 -0500
  3. @@ -159,7 +159,7 @@
  4.         dma = (dma_t *) 0x08aedc04;
  5.         break;
  6.    
  7. # The function that calculates the game's CRC32 value errors out, returning this value
  8. # We are basically hard-coding the version as "ET 2.60b"
  9. -   case 0x6ab49f82:
  10. +   case 0x00000000:
  11.         version = "ET 2.60b";
  12.        
  13.         writeJump((void *) 0x08188250, (void *) SNDDMA_Init);
  14. @@ -218,34 +218,27 @@
  15.         break;
  16.    
  17. # For some reason, std::cout is causing segmentation faults.
  18.     default:
  19. -       std::cout << "You are not running a recognized version of Enemy Territory or RTCW (CRC32 = " << (void *) CRC32  << ")" << std::endl;
  20.         return; // we don't need to exit( 1 )
  21.     }
  22.    
  23. -   std::cout << "Found " << version << " (CRC32 = " << (void *) CRC32 << ")" << std::endl;
  24.    
  25.     if (backend == OSS) {
  26. -       std::cout << "Using default OSS backend." << std::endl;
  27.         return;
  28.     }
  29.  #ifdef __ALSA
  30.     else if (backend == ALSA) {
  31. -       std::cout << "Using ALSA backend." << std::endl;
  32.         etalsa = new EtALSA(dma);
  33.     }
  34.  #endif
  35.  #ifdef __SDL
  36.     else if (backend == SDL) {
  37. -       std::cout << "Using SDL backend." << std::endl;
  38.         etsdl = new EtSDL(dma, (void *) sdl_audio_callback, quake3);
  39.     }
  40.  #endif
  41.     else {
  42. -       std::cout << "Requested backend is not available, using OSS." << std::endl;
  43.         return;
  44.     }
  45.    
  46. -   std::cout << "et-sdl-sound-" << __ETSDL_VERSION << " (" << __DATE__ << " " << __TIME__ << ", " << __VERSION__ << ") loaded." << std::endl;
  47.  }
  48.  
  49.  void writeAddr(void *addr, void *dest)
  50. @@ -273,16 +266,13 @@
  51.  
  52.  void printMem(void *addr, int size)
  53.  {
  54. -   std::cout << addr << ": ";
  55.     for (int i = 0; i < size; i++)
  56.         printf("%02x ", ((unsigned char*) addr)[i]);
  57. -   std::cout << std::endl;
  58.  }
  59.  
  60.  qboolean SNDDMA_Init(void)
  61.  {
  62.  #ifdef __DEBUG
  63. -   std::cout << "SNDDMA_Init()" << std::endl;
  64.  #endif
  65.  
  66.  #ifdef __ALSA
  67. @@ -300,7 +290,6 @@
  68.  int SNDDMA_GetDMAPos(void)
  69.  {
  70.  #ifdef __DEBUG
  71. -   std::cout << "SNDDMA_GetDMAPos()" << std::endl;
  72.  #endif
  73.  
  74.  #ifdef __ALSA
  75. @@ -319,7 +308,6 @@
  76.  void SNDDMA_Shutdown(void)
  77.  {
  78.  #ifdef __DEBUG
  79. -   std::cout << "SNDDMA_Shutdown()" << std::endl;
  80.  #endif
  81.  
  82.  #ifdef __ALSA
  83. @@ -336,7 +324,6 @@
  84.  void SNDDMA_BeginPainting(void)
  85.  {
  86.  #ifdef __DEBUG
  87. -   std::cout << "SNDDMA_BeginPainting()" << std::endl;
  88.  #endif
  89.  
  90.  #ifdef __ALSA
  91. @@ -353,7 +340,6 @@
  92.  void SNDDMA_Submit(void)
  93.  {
  94.  #ifdef __DEBUG
  95. -   std::cout << "SNDDMA_Submit()" << std::endl;
  96.  #endif
  97.  
  98.  #ifdef __ALSA
  99. @@ -378,10 +364,6 @@
  100.     char filename[PATH_MAX];
  101.     ssize_t len;
  102.    
  103. # readlink is not defined. Not sure where it came from
  104. -   if ((len = readlink("/proc/self/exe", filename, sizeof(filename) - 1)) < 1) {
  105. -       std::cout << "Can't find actual binary." << std::endl;
  106. -       return 0x00000000;
  107. -   }
  108.     filename[len] = '\0';
  109.    
  110.     // read file
  111. @@ -389,7 +371,6 @@
  112.     exe.open(filename);
  113.    
  114.     if (!exe.is_open() | !exe.good()) {
  115. -       std::cout << "Can't open " << filename << std::endl;
  116.         return 0x00000000;
  117.     }
  118.    
  119. @@ -402,7 +383,6 @@
  120.     exe.read((char*) file, fsize);
  121.     exe.close();
  122.    
  123. -   std::cout << "Read " << filename << " (" << fsize << " bytes)" << std::endl;
  124.    
  125.     // generate crc_table
  126.     unsigned int crc_table[256];
  127.  
  128. --- Makefile.orig   2013-02-09 19:50:41.392808411 -0500
  129. +++ Makefile    2013-02-09 19:51:08.566142152 -0500
  130. @@ -1,6 +1,6 @@
  131.  # Makefile for et-sdl-sound
  132.  
  133. -_GCC_PATH=/usr/x86_64-pc-linux-gnu/gcc-bin/3.4.6/
  134. +_GCC_PATH=/usr/bin/
  135.  
  136.  LD = $(_GCC_PATH)g++
  137.  CPP = $(_GCC_PATH)g++
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement