SHARE
TWEET

FF8.EXE - pseudo - Sound play function

MaKiPL Mar 7th, 2016 (edited) 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. signed int __cdecl PlaySound(unsigned int a1, unsigned int a2, unsigned int a3, unsigned int a4, int a5)
  2. {
  3.   signed int result; //Bool?
  4.   int v6;
  5.   int *v7;
  6.   int v8;
  7.  
  8.  
  9.   if ( !dword_1CD0AE8 ) //Is sound initialized? dword_1CD0AE8 is probably shared bool for sound loaded)
  10.   {
  11.     WriteDebugString(aSfx_playSoundN); //Write debug: "SOUND NOT INITIALIZED"
  12.     return 0;
  13.   }
  14.  
  15.  
  16.   if ( a1 > 0x1F || a2 > (unsigned __int16)dword_1CD1784 || a3 > 0x7F || a4 > 0x7F )
  17.   {
  18.     WriteDebugString(aSoundParamet_3); //Write debug: "SOUND PARAMETER ERROR - sfx_play ()\n"
  19.     WriteDebugString(aWilliamPleaseC); //Write debug:  "William - please check your parameter"
  20.     return 0;
  21.   }
  22.  
  23.  
  24.   v6 = (int)((char *)dword_1CD1788 + 24 * a2);
  25.   v7 = &dword_1CD0B00[24 * a1];  //Array for sounds?
  26.   v8 = dword_1CD179C != 0;
  27.   if ( !sub_469C50(a1, a2, v8) )
  28.     return 0;
  29.   sub_46A470(a1, a3, 0);
  30.   sub_46AB60(a1, a5, 0);
  31.   if ( v8 == 1 )
  32.   {
  33.     sub_46E310(v7[1], 1120403456, 1);
  34.     sub_46E340(v7[1], 1128792064, 1);
  35.     if ( dword_1CD0B0C )
  36.     {
  37.       sub_46E310(v7[3], 1120403456, 1);
  38.       sub_46E340(v7[3], 1128792064, 1);
  39.     }
  40.     sub_46A590();
  41.   }
  42.   else
  43.   {
  44.     sub_46A9D0(a1, a4, 0);
  45.   }
  46.   if ( v7[2] )
  47.   {
  48.     sub_46DFF0(*v7, 0);
  49.     sub_46AFD0((DWORD_PTR)&dword_1CD0B00[24 * a1], v6);
  50.     result = 1;
  51.   }
  52.   else
  53.   {
  54.     sub_46DFF0(*v7, *(_BYTE *)(v6 + 8));
  55.     result = 1;
  56.   }
  57.   return result;
  58. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top