예제 #1
0
/* HBL elf entry point */
int __entry_menu(int argc, char **argv)
{
   InitFunctionPointers();
   memoryInitialize();
   __init();
   fsdev_init();

   int ret = main(argc, argv);

   fsdev_exit();
//   __fini();
   memoryRelease();
   return ret;
}
예제 #2
0
BOOL WriteGlobalFlagsToKernel( _In_ DWORD Flag )
{
    if(InitFunctionPointers())
    {
        SYSTEM_FLAGS_INFORMATION sfi = {0};
        sfi.Flags = Flag;
        if (g_PoolTaggingEnabled)
        {
            sfi.Flags |= FLG_POOL_ENABLE_TAGGING;
        }
        return SUCCEEDED(g_NtSetSystemInformation(SystemFlagsInformation, &sfi, sizeof(sfi)));
    }
    return FALSE;
}
예제 #3
0
BOOL ReadGlobalFlagsFromKernel( _Out_ DWORD* Flag )
{
    if(InitFunctionPointers())
    {
        ULONG Length = 0;
        SYSTEM_FLAGS_INFORMATION sfi = {0};
        sfi.Flags = 0;
        assert(sizeof(SYSTEM_FLAGS_INFORMATION) == 4);
        assert(sizeof(sfi) == 4);
        if(SUCCEEDED(g_NtQuerySystemInformation(SystemFlagsInformation, &sfi, sizeof(sfi), &Length)) && Length == sizeof(sfi))
        {
            *Flag = sfi.Flags;
            return TRUE;
        }
    }
    return FALSE;
}
예제 #4
0
void UpdateValidFlags()
{
    g_ValidRegistryFlags = 0;
    g_ValidKernelFlags = 0;
    g_ValidImageFlags = 0;
    for( size_t n = 0; n < g_FlagCount; ++n )
    {
        g_ValidRegistryFlags |= (g_Flags[n].wDest & DEST_REGISTRY) ? g_Flags[n].dwFlag : 0;
        g_ValidKernelFlags |= (g_Flags[n].wDest & DEST_KERNEL) ? g_Flags[n].dwFlag : 0;
        g_ValidImageFlags |= (g_Flags[n].wDest & DEST_IMAGE) ? g_Flags[n].dwFlag : 0;
    }

    if(!InitFunctionPointers())
    {
        return;
    }
    OSVERSIONINFOW osv = {sizeof(osv), NULL};
    g_RtlGetVersion(&osv);
    if(osv.dwMajorVersion > 5 || (osv.dwMajorVersion == 5 && osv.dwMinorVersion >= 2))
    {
        g_PoolTaggingEnabled = 1;
    }
}
예제 #5
0
int main(int argc, char **argv)
{
#else
int __entry_menu(int argc, char **argv)
{
   InitFunctionPointers();
#endif
#if 1
   setup_os_exceptions();
#else
   InstallExceptionHandler();
#endif
   socket_lib_init();
#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
   log_init(PC_DEVELOPMENT_IP_ADDRESS, PC_DEVELOPMENT_TCP_PORT);
#endif
   devoptab_list[STD_OUT] = &dotab_stdout;
   devoptab_list[STD_ERR] = &dotab_stdout;
   memoryInitialize();
   mount_sd_fat("sd");
   VPADInit();

   verbosity_enable();
   DEBUG_VAR(argc);
   DEBUG_STR(argv[0]);
   DEBUG_STR(argv[1]);
#if 0
   int argc_ = 2;
//   char* argv_[] = {WIIU_SD_PATH "retroarch/retroarch.elf", WIIU_SD_PATH "rom.nes", NULL};
   char* argv_[] = {WIIU_SD_PATH "retroarch/retroarch.elf", WIIU_SD_PATH "rom.sfc", NULL};

   rarch_main(argc_, argv_, NULL);
#else
   rarch_main(argc, argv, NULL);
#endif
//   int frames = 0;
   do
   {
      unsigned sleep_ms = 0;
      int ret = runloop_iterate(&sleep_ms);

      if (ret == 1 && sleep_ms > 0)
       retro_sleep(sleep_ms);
      task_queue_ctl(TASK_QUEUE_CTL_WAIT, NULL);
      if (ret == -1)
       break;

   }while(1);
//   }while(frames++ < 300);

   main_exit(NULL);
   unmount_sd_fat("sd");
   memoryRelease();
   fflush(stdout);
   fflush(stderr);
#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
   log_deinit();
#endif

   return 0;
}
예제 #6
0
파일: isacfix.c 프로젝트: Morningxxx/webRTC
int16_t WebRtcIsacfix_EncoderInit(ISACFIX_MainStruct *ISAC_main_inst,
                                  int16_t  CodingMode)
{
  int k;
  int16_t statusInit;
  ISACFIX_SubStruct *ISAC_inst;

  statusInit = 0;
  /* typecast pointer to rela structure */
  ISAC_inst = (ISACFIX_SubStruct *)ISAC_main_inst;

  /* flag encoder init */
  ISAC_inst->initflag |= 2;

  if (CodingMode == 0)
    /* Adaptive mode */
    ISAC_inst->ISACenc_obj.new_framelength  = INITIAL_FRAMESAMPLES;
  else if (CodingMode == 1)
    /* Instantaneous mode */
    ISAC_inst->ISACenc_obj.new_framelength = 480;    /* default for I-mode */
  else {
    ISAC_inst->errorcode = ISAC_DISALLOWED_CODING_MODE;
    statusInit = -1;
  }

  ISAC_inst->CodingMode = CodingMode;

  WebRtcIsacfix_InitMaskingEnc(&ISAC_inst->ISACenc_obj.maskfiltstr_obj);
  WebRtcIsacfix_InitPreFilterbank(&ISAC_inst->ISACenc_obj.prefiltbankstr_obj);
  WebRtcIsacfix_InitPitchFilter(&ISAC_inst->ISACenc_obj.pitchfiltstr_obj);
  WebRtcIsacfix_InitPitchAnalysis(&ISAC_inst->ISACenc_obj.pitchanalysisstr_obj);

  WebRtcIsacfix_InitRateModel(&ISAC_inst->ISACenc_obj.rate_data_obj);


  ISAC_inst->ISACenc_obj.buffer_index   = 0;
  ISAC_inst->ISACenc_obj.frame_nb    = 0;
  ISAC_inst->ISACenc_obj.BottleNeck      = 32000; /* default for I-mode */
  ISAC_inst->ISACenc_obj.MaxDelay    = 10;    /* default for I-mode */
  ISAC_inst->ISACenc_obj.current_framesamples = 0;
  ISAC_inst->ISACenc_obj.s2nr     = 0;
  ISAC_inst->ISACenc_obj.MaxBits    = 0;
  ISAC_inst->ISACenc_obj.bitstr_seed   = 4447;
  ISAC_inst->ISACenc_obj.payloadLimitBytes30  = STREAM_MAXW16_30MS << 1;
  ISAC_inst->ISACenc_obj.payloadLimitBytes60  = STREAM_MAXW16_60MS << 1;
  ISAC_inst->ISACenc_obj.maxPayloadBytes      = STREAM_MAXW16_60MS << 1;
  ISAC_inst->ISACenc_obj.maxRateInBytes       = STREAM_MAXW16_30MS << 1;
  ISAC_inst->ISACenc_obj.enforceFrameSize     = 0;

  /* Init the bistream data area to zero */
  for (k=0; k<STREAM_MAXW16_60MS; k++){
    ISAC_inst->ISACenc_obj.bitstr_obj.stream[k] = 0;
  }

#ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
  WebRtcIsacfix_InitPostFilterbank(&ISAC_inst->ISACenc_obj.interpolatorstr_obj);
#endif

  InitFunctionPointers();

  return statusInit;
}