PS3 Mysis releases Source Code of Custom xai plugin w/ Explanations

Discussion in 'PS3 News' started by STLcardsWS, Jan 26, 2017.

By STLcardsWS on Jan 26, 2017 at 12:15 AM
  1. 6,195
    3,891
    123
    STLcardsWS

    STLcardsWS Administrator

    Joined:
    Sep 18, 2014
    Messages:
    6,195
    Likes Received:
    3,891
    Trophy Points:
    123
    It was back in January of 2016 we seen developer @mysis release CFW Setting v0.1, the devs Custom xai plugin , now the dev has decided to release the source code and explained some of it functions , to help other developer's who may be able to utilize this XMB Modification that brought new functionality to PS3 (CFW) XMB. What will the development community do with this latest source code release from @mysis.

    R9EVrX8.jpg


    • Hi there,

      Due to some request and the lack of time I currently have, I hereby release the source of my custom xai_plugin and I will also explain on code side whats needed to create your own xai_plugin that can be fed with commands from XMB.

      The minimum amount of code needed is provided as a reboot template, but it does not contain the required xmb xml modification to call.

      When you create your prx it will have some entry point:
      It all comes down into specifying two interfaces:
      (Continue to next tab -->)

    • =Main module interface=

      We first have to tell that our prx module is having an interface for VSH:
      The view is provided when our entry function is called.
      1 is the main exporting interface of our module.
      The functions we provide are basically: init, start, stop, exit functionalities.

      In our init function, we then specify the second interface.

    • =Plugin interface=

      Now comes the most interesting part. Modules can register different kinds of interfaces.
      We can also register our own interfaces!
      Common interfaces i have encountered and documented:

      • 1 - the main talking interface
      • 'XMM0' - for overall XMB module plugin information and control (load/unload/...)
      • 'XMB2' - for XMB UI interaction
      • 'MOD0' - for your own module behavior (LoadOpinion)
      • 'CAT0' - for XMB category behavior
      • 'Z'
      • 'ACT0' - for XMB module action communication
      So, we need to set up another interface, that is the 'ACT0' one. This can have only 1 function handler, which will be responsible for handling the commands from the XMB xml. When XMB tries to execute a command from xml it basically loads the module, checks if ACT0 is registered and then calls the handler from it. This is how we register it:
      Afterwards you just will just have to parse within our handler whatever data is sent:
      Code:
      void xai_plugin_interface_action::xai_plugin_action(const char * action)
      {
          cellFsUnlink("/dev_hdd0/tmp/turnoff");
          if(strcmp(action,"soft_reboot_action")==0)
          {
              sys_sm_shutdown(SYS_SOFT_REBOOT);
          }
          else if(strcmp(action,"hard_reboot_action")==0)
          {
              sys_sm_shutdown(SYS_HARD_REBOOT);
          }
      }
      

    • =XMB xml=

      When you modify the XMB xml files and add your view and table you use:

      Code:
      <Pair key="module_name"><String>xai_plugin</String></Pair>
      <Pair key="module_action"><String>soft_reboot_action</String></Pair>
      Sony and other people for example in a similar fashion use this with the webbrowser_plugin and provide a URL as module_action.

      Here you can find more information about the other plugins: http://www.psdevwiki.com/ps3/Plugin_Interfaces

      Template code, containing soft and hard reboot functionality: https://www.dropbox.com/s/qpy133wudq0kkce/xai_plugin_reboot_template_src.rar?dl=1

      My xai_plugin source: https://www.dropbox.com/s/sp31la3wh7rz40d/xai_plugin_src.rar?dl=1

      I apologize for the badly written code, but sometimes the compiler did not produce the code/data i needed :)

      /mysis​


    Custom xai-plugin Source Code:
    dropbox.com
    Source: psx-place.com
     
    Last edited: Jan 26, 2017

Comments

Discussion in 'PS3 News' started by STLcardsWS, Jan 26, 2017.

Share This Page