Esempio n. 1
0
        private bool SetDiskControlExtInterface(void *data)
        {
            if (data == null)
            {
                return(false);
            }

            retro_disk_control_ext_callback inCallback = Marshal.PtrToStructure <retro_disk_control_ext_callback>((IntPtr)data);

            _wrapper.Disk = new DiskInterface(_wrapper, inCallback);
            return(true);
        }
Esempio n. 2
0
 public DiskInterface(Wrapper wrapper, retro_disk_control_ext_callback callback)
 {
     _wrapper  = wrapper;
     _callback = new retro_disk_control_ext_callback()
     {
         set_eject_state     = callback.set_eject_state ?? ((bool ejected) => false),
         get_eject_state     = callback.get_eject_state ?? (() => false),
         get_image_index     = callback.get_image_index ?? (() => 0),
         set_image_index     = callback.set_image_index ?? ((uint index) => false),
         get_num_images      = callback.get_num_images ?? (() => 0),
         replace_image_index = callback.replace_image_index ?? ((uint index, ref retro_game_info info) => false),
         add_image_index     = callback.add_image_index ?? (() => false),
         set_initial_image   = callback.set_initial_image ?? ((uint index, IntPtr path) => false),
         get_image_path      = callback.get_image_path ?? ((uint index, IntPtr path, ulong len) => false),
         get_image_label     = callback.get_image_label ?? ((uint index, IntPtr label, ulong len) => false)
     };
 }