Example #1
0
static void rmenu_xui_frame(void)
{
   XUIMessage msg;
   XUIMessageRender msgRender;
   D3DXMATRIX matOrigView;
   D3DVIEWPORT vp_full;
   LPDIRECT3DDEVICE d3dr;
   d3d_video_t *d3d = NULL;
   menu_handle_t *menu   = menu_driver_get_ptr();
   driver_t      *driver = driver_get_ptr();

   if (!menu)
      return;

   d3d = (d3d_video_t*)driver->video_data;
   
   if (!d3d)
      return;

   d3dr = (LPDIRECT3DDEVICE)d3d->dev;

   if (!d3dr)
      return;

   (void)menu;

   vp_full.X = 0;
   vp_full.Y = 0;
   vp_full.Width = d3d->screen_width;
   vp_full.Height = d3d->screen_height;
   vp_full.MinZ = 0.0f;
   vp_full.MaxZ = 1.0f;
   d3d_set_viewport(d3dr, &vp_full);

   app.RunFrame();
   XuiTimersRun();
   XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) );

   XuiRenderGetViewTransform( app.GetDC(), &matOrigView );

   XuiMessageRender( &msg, &msgRender, app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL );
   XuiSendMessage( app.GetRootObj(), &msg );

   XuiRenderSetViewTransform( app.GetDC(), &matOrigView );

   const char *message = rarch_main_msg_queue_pull();

   if (message)
      xui_render_message(message);
   else
   {
      const char *message = rarch_main_msg_queue_pull();
      if (message)
         xui_render_message(message);
   }

   XuiRenderEnd( app.GetDC() );

   d3d_set_viewport(d3dr, &d3d->final_viewport);
}
Example #2
0
static void rmenu_xui_frame(void)
{
   XUIMessage msg;
   XUIMessageRender msgRender;
   D3DXMATRIX matOrigView;
   LPDIRECT3DDEVICE d3dr;
   const char *message;
   D3DVIEWPORT vp_full = {0};
   d3d_video_t *d3d = NULL;
   menu_handle_t *menu   = menu_driver_get_ptr();
   driver_t      *driver = driver_get_ptr();
   global_t      *global = global_get_ptr();

   if (!menu)
      return;

   d3d = (d3d_video_t*)driver->video_data;
   
   if (!d3d)
      return;

   d3dr = (LPDIRECT3DDEVICE)d3d->dev;

   if (!d3dr)
      return;

   menu_display_set_viewport(menu);

   app.RunFrame();
   XuiTimersRun();
   XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) );

   XuiRenderGetViewTransform( app.GetDC(), &matOrigView );

   XuiMessageRender( &msg, &msgRender, app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL );
   XuiSendMessage( app.GetRootObj(), &msg );

   XuiRenderSetViewTransform( app.GetDC(), &matOrigView );

   message = rarch_main_msg_queue_pull();

   if (message)
      xui_render_message(message);
   else
   {
      message = rarch_main_msg_queue_pull();
      if (message)
         xui_render_message(message);
   }

   XuiRenderEnd( app.GetDC() );

   menu_display_unset_viewport(menu);
}
Example #3
0
static void xui_frame(void *data)
{
   XUIMessage msg;
   XUIMessageRender msgRender;
   D3DXMATRIX matOrigView;
   LPDIRECT3DDEVICE d3dr;
   const char *message   = NULL;
   D3DVIEWPORT vp_full   = {0};
   d3d_video_t *d3d      = (d3d_video_t*)video_driver_get_ptr(false);
   
   if (!d3d)
      return;

   d3dr = (LPDIRECT3DDEVICE)d3d->dev;

   if (!d3dr)
      return;

   menu_display_ctl(MENU_DISPLAY_CTL_SET_VIEWPORT, NULL);

   app.RunFrame();
   XuiTimersRun();
   XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) );

   XuiRenderGetViewTransform( app.GetDC(), &matOrigView );

   XuiMessageRender( &msg, &msgRender,
         app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL );
   XuiSendMessage( app.GetRootObj(), &msg );

   XuiRenderSetViewTransform( app.GetDC(), &matOrigView );

   runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &message);

   if (message)
      xui_render_message(message);
   else
   {
      runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &message);

      if (message)
         xui_render_message(message);
   }

   XuiRenderEnd( app.GetDC() );

   menu_display_ctl(MENU_DISPLAY_CTL_UNSET_VIEWPORT, NULL);
}
Example #4
0
static void xui_frame(void *data, video_frame_info_t *video_info)
{
   XUIMessage msg;
   XUIMessageRender msgRender;
   D3DXMATRIX matOrigView;
   const char *message   = NULL;
   D3DVIEWPORT9 vp_full  = {0};
   d3d9_video_t *d3d     = (d3d9_video_t*)video_driver_get_ptr(false);

   if (!d3d)
      return;

   xui_frame_count++;

   menu_display_set_viewport(video_info->width, video_info->height);

   app.RunFrame();
   XuiTimersRun();
   XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) );

   XuiRenderGetViewTransform( app.GetDC(), &matOrigView );

   XuiMessageRender( &msg, &msgRender,
         app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL );
   XuiSendMessage( app.GetRootObj(), &msg );

   XuiRenderSetViewTransform( app.GetDC(), &matOrigView );

#if 0
   /* TODO/FIXME - update this code */
   rarch_ctl(RARCH_CTL_MSG_QUEUE_PULL, &message);

   if (message)
      xui_render_message(message);
   else
   {
      rarch_ctl(RARCH_CTL_MSG_QUEUE_PULL, &message);

      if (message)
         xui_render_message(message);
   }
#endif

   XuiRenderEnd( app.GetDC() );

   menu_display_unset_viewport(video_info->width, video_info->height);
}
Example #5
0
void menu_loop(void)
{
   g_console.menu_enable = true;

   HRESULT hr;
   xdk360_video_t *vid = (xdk360_video_t*)g_d3d;

   if(g_console.emulator_initialized)
      video_xdk360.set_swap_block_state(NULL, true);

   do
   {
      g_frame_count++;
      if(g_console.emulator_initialized)
      {
         rarch_render_cached_frame();
      }
      else
         vid->d3d_render_device->Clear(0, NULL, D3DCLEAR_TARGET,
	   D3DCOLOR_ARGB(255, 32, 32, 64), 1.0f, 0);

      XINPUT_STATE state;
      XInputGetState(0, &state);

      g_console.menu_enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) 
		      && (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_console.emulator_initialized)
		      && IS_TIMER_EXPIRED());
      g_console.mode_switch = g_console.menu_enable ? MODE_MENU : MODE_EMULATION;

      app.RunFrame();			/* Update XUI */
      hr = app.Render();		/* Render XUI */
      hr = XuiTimersRun();	/* Update XUI timers */

      if(g_console.mode_switch == MODE_EMULATION && !g_console.frame_advance_enable)
      {
         SET_TIMER_EXPIRATION(30);
      }

      video_xdk360.swap(NULL);
   }while(g_console.menu_enable);

   if(g_console.emulator_initialized)
      video_xdk360.set_swap_block_state(NULL, false);

   g_console.ingame_menu_enable = false;
}
Example #6
0
static void rmenu_xui_frame(void)
{
   d3d_video_t *d3d = (d3d_video_t*)driver.video_data;
   LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;

   D3DVIEWPORT vp_full;
   vp_full.X = 0;
   vp_full.Y = 0;
   vp_full.Width = d3d->screen_width;
   vp_full.Height = d3d->screen_height;
   vp_full.MinZ = 0.0f;
   vp_full.MaxZ = 1.0f;
   d3d_set_viewport(d3dr, &vp_full);

   app.RunFrame();
   XuiTimersRun();
   XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) );

   D3DXMATRIX matOrigView;
   XuiRenderGetViewTransform( app.GetDC(), &matOrigView );

   XUIMessage msg;
   XUIMessageRender msgRender;
   XuiMessageRender( &msg, &msgRender,
         app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL );
   XuiSendMessage( app.GetRootObj(), &msg );

   XuiRenderSetViewTransform( app.GetDC(), &matOrigView );

   const char *message = msg_queue_pull(xui_msg_queue);

   if (message)
      xui_render_message(message);
   else
   {
      const char *message = msg_queue_pull(g_extern.msg_queue);
      if (message)
         xui_render_message(message);
   }

   XuiRenderEnd( app.GetDC() );

   d3d_set_viewport(d3dr, &d3d->final_viewport);
}
Example #7
0
bool menu_iterate_xui(void)
{
   xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
   LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->d3d_render_device;

   app.RunFrame(); /* Update XUI */

   XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) );

   D3DXMATRIX matOrigView;
   XuiRenderGetViewTransform( app.GetDC(), &matOrigView );

   XUIMessage msg;
   XUIMessageRender msgRender;
   XuiMessageRender( &msg, &msgRender, app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL );
   XuiSendMessage( app.GetRootObj(), &msg );

   XuiRenderSetViewTransform( app.GetDC(), &matOrigView );

   XuiRenderEnd( app.GetDC() );
   XuiTimersRun();
   return true;
}
Example #8
0
bool rmenu_iterate(void)
{
   static bool preinit = true;
   const char *msg;

   xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)driver.video_data;

   if(preinit)
   {
      g_extern.console.rmenu.input_loop = INPUT_LOOP_MENU;
      g_extern.draw_menu = true;
      preinit = false;
   }

   g_extern.frame_count++;

   XINPUT_STATE state;
   XInputGetState(0, &state);

   bool rmenu_enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) 
         && (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.console.emulator_initialized)
         && IS_TIMER_EXPIRED(0));

   rarch_render_cached_frame();

   g_extern.console.rmenu.mode = rmenu_enable ? MODE_MENU : MODE_EMULATION;

   switch(g_extern.console.rmenu.input_loop)
   {
      case INPUT_LOOP_FILEBROWSER:
      case INPUT_LOOP_MENU:
         app.RunFrame(); /* Update XUI */
         if((state.Gamepad.wButtons & XINPUT_GAMEPAD_B) && hCur != app.hMainScene)
            XuiSceneNavigateBack(hCur, app.hMainScene, XUSER_INDEX_ANY);
         break;
      case INPUT_LOOP_RESIZE_MODE:
         ingame_menu_resize();
         break;
      default:
         break;
   }

   if(g_extern.console.rmenu.mode == MODE_EMULATION || g_extern.console.rmenu.mode == MODE_EXIT)
      goto deinit;

   msg = msg_queue_pull(g_extern.msg_queue);

   if (msg)
   {
      device_ptr->font_ctx->render_msg(device_ptr, msg);
   }

   device_ptr->ctx_driver->swap_buffers();

   return true;

deinit:
   if(!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
   {
      // set a timer delay so that we don't instantly switch back to the menu when
      // press and holding L3 + R3 in the emulation loop (lasts for 30 frame ticks)
      SET_TIMER_EXPIRATION(0, 30);
   }

   g_extern.console.rmenu.state.ingame_menu.enable = false;
   g_extern.draw_menu = false;
   preinit = true;

   return false;
}
Example #9
0
void menu_loop(void)
{
   HRESULT hr;
   xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;

   g_extern.console.rmenu.state.rmenu.enable = true;

   d3d->block_swap = true;

   g_extern.console.rmenu.input_loop = INPUT_LOOP_MENU;

   do
   {
      if(g_extern.console.emulator_initialized)
         rarch_render_cached_frame();
      else
      {
         d3d->d3d_render_device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0, 0, 0, 0), 1.0f, 0);
         d3d->frame_count++;
      }

      XINPUT_STATE state;
      XInputGetState(0, &state);

      g_extern.console.rmenu.state.rmenu.enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) 
      && (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.console.emulator_initialized)
      && IS_TIMER_EXPIRED(d3d));

      g_extern.console.rmenu.mode = g_extern.console.rmenu.state.rmenu.enable ? MODE_MENU : MODE_EMULATION;

      switch(g_extern.console.rmenu.input_loop)
      {
     	  case INPUT_LOOP_FILEBROWSER:
			  /*
			  if(((state.Gamepad.wButtons & XINPUT_GAMEPAD_Y) && hCur != app.hMainScene))
			  {
				uint64_t action = (1 << RMENU_DEVICE_NAV_A);
				browser_update(browser, action, rarch_console_get_rom_ext());
				SET_TIMER_EXPIRATION(d3d, 15);
			  }
			  */
         case INPUT_LOOP_MENU:
            app.RunFrame(); /* Update XUI */
            if((state.Gamepad.wButtons & XINPUT_GAMEPAD_B) && hCur != app.hMainScene)
               XuiSceneNavigateBack(hCur, app.hMainScene, XUSER_INDEX_ANY);
            break;
         case INPUT_LOOP_RESIZE_MODE:
            ingame_menu_resize();
            break;
         default:
            break;
      }

      hr = app.Render();   /* Render XUI */
      hr = XuiTimersRun(); /* Update XUI timers */

      if(g_extern.console.rmenu.mode == MODE_EMULATION && !g_extern.console.screen.state.frame_advance.enable)
      {
         SET_TIMER_EXPIRATION(d3d, 30);
      }

      const char *message = msg_queue_pull(g_extern.msg_queue);

      if (message)
      {
		  xdk360_console_format(message);
         xdk360_console_draw();
      }

      context->swap_buffers();
   }while(g_extern.console.rmenu.state.rmenu.enable);

   d3d->block_swap = false;

   g_extern.console.rmenu.state.ingame_menu.enable = false;
}
Example #10
0
void menu_loop(void)
{
   HRESULT hr;
   xdk360_video_t *d3d9 = (xdk360_video_t*)driver.video_data;

   g_console.menu_enable = true;

   d3d9->block_swap = true;

   g_console.input_loop = INPUT_LOOP_MENU;

   do
   {
      if(g_console.emulator_initialized)
	  {
         rarch_render_cached_frame();
	  }
	  else
	  {
         d3d9->d3d_render_device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0, 0, 0, 0), 1.0f, 0);
         d3d9->frame_count++;
	  }

      XINPUT_STATE state;
      XInputGetState(0, &state);

      g_console.menu_enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) 
      && (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_console.emulator_initialized)
      && IS_TIMER_EXPIRED(d3d9));

      g_console.mode_switch = g_console.menu_enable ? MODE_MENU : MODE_EMULATION;

      switch(g_console.input_loop)
      {
         case INPUT_LOOP_MENU:
            app.RunFrame();			/* Update XUI */
            if(state.Gamepad.wButtons & XINPUT_GAMEPAD_B && hCur != app.hMainScene)
               XuiSceneNavigateBack(hCur, app.hMainScene, XUSER_INDEX_ANY);
            break;
         case INPUT_LOOP_RESIZE_MODE:
            ingame_menu_resize();
            break;
         default:
            break;
      }

      hr = app.Render();		/* Render XUI */
      hr = XuiTimersRun();	/* Update XUI timers */

      if(g_console.mode_switch == MODE_EMULATION && !g_console.frame_advance_enable)
      {
         SET_TIMER_EXPIRATION(d3d9, 30);
      }

      const char *message = msg_queue_pull(g_extern.msg_queue);

      if (message)
      {
         if(IS_TIMER_EXPIRED(d3d9))
         {
            xdk360_console_format(message);
            SET_TIMER_EXPIRATION(d3d9, 30);
         }
         xdk360_console_draw();
      }

      gfx_ctx_swap_buffers();
   }while(g_console.menu_enable);

   d3d9->block_swap = false;

   g_console.ingame_menu_enable = false;
}