Skip to content

Commit

Permalink
allow core to register disk control interface (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras authored Jun 16, 2024
1 parent 7d3e4b1 commit 1794a0f
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/libretro/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,19 +825,25 @@ bool libretro::Core::getDiskControlInterfaceVersion(unsigned* data)
bool libretro::Core::setDiskControlInterface(const struct retro_disk_control_callback* data)
{
memset(&_diskControlInterface, 0, sizeof(_diskControlInterface));
_diskControlInterface.set_eject_state = data->set_eject_state;
_diskControlInterface.get_eject_state = data->get_eject_state;
_diskControlInterface.get_image_index = data->get_image_index;
_diskControlInterface.set_image_index = data->set_image_index;
_diskControlInterface.get_num_images = data->get_num_images;
_diskControlInterface.replace_image_index = data->replace_image_index;
_diskControlInterface.add_image_index = data->add_image_index;
if (data)
{
_diskControlInterface.set_eject_state = data->set_eject_state;
_diskControlInterface.get_eject_state = data->get_eject_state;
_diskControlInterface.get_image_index = data->get_image_index;
_diskControlInterface.set_image_index = data->set_image_index;
_diskControlInterface.get_num_images = data->get_num_images;
_diskControlInterface.replace_image_index = data->replace_image_index;
_diskControlInterface.add_image_index = data->add_image_index;
}
return true;
}

bool libretro::Core::setDiskControlExtInterface(const struct retro_disk_control_ext_callback* data)
{
memcpy(&_diskControlInterface, data, sizeof(_diskControlInterface));
if (data)
memcpy(&_diskControlInterface, data, sizeof(_diskControlInterface));
else
memset(&_diskControlInterface, 0, sizeof(_diskControlInterface));
return true;
}

Expand Down

0 comments on commit 1794a0f

Please sign in to comment.