Retooled ZIP emulation into more expansible Removable Disk emulation, ZIP 100 and 250 types remain selectable, alongside the new 86Box (ie. generic) option.

This commit is contained in:
OBattler
2025-07-25 16:30:40 +02:00
parent 733e0e3dca
commit 64e85fdfbc
38 changed files with 1254 additions and 1051 deletions

View File

@@ -6,7 +6,7 @@
*
* This file is part of the 86Box distribution.
*
* Handle the platform-side of CDROM/ZIP/MO drives.
* Handle the platform-side of CDROM/RDisk/MO drives.
*
*
*
@@ -34,7 +34,7 @@
#include <86box/cdrom.h>
#include <86box/cdrom_image.h>
#include <86box/mo.h>
#include <86box/zip.h>
#include <86box/rdisk.h>
#include <86box/scsi_disk.h>
#include <86box/plat.h>
#include <86box/ui.h>
@@ -220,58 +220,58 @@ mo_reload(uint8_t id)
}
void
zip_eject(uint8_t id)
rdisk_eject(uint8_t id)
{
zip_t *dev = (zip_t *) zip_drives[id].priv;
rdisk_t *dev = (rdisk_t *) rdisk_drives[id].priv;
zip_disk_close(dev);
if (zip_drives[id].bus_type) {
rdisk_disk_close(dev);
if (rdisk_drives[id].bus_type) {
/* Signal disk change to the emulated machine. */
zip_insert(dev);
rdisk_insert(dev);
}
ui_sb_update_icon_state(SB_ZIP | id, 1);
ui_sb_update_icon_state(SB_RDISK | id, 1);
#if 0
media_menu_update_zip(id);
media_menu_update_rdisk(id);
#endif
ui_sb_update_tip(SB_ZIP | id);
ui_sb_update_tip(SB_RDISK | id);
config_save();
}
void
zip_mount(uint8_t id, char *fn, uint8_t wp)
rdisk_mount(uint8_t id, char *fn, uint8_t wp)
{
zip_t *dev = (zip_t *) zip_drives[id].priv;
rdisk_t *dev = (rdisk_t *) rdisk_drives[id].priv;
zip_disk_close(dev);
zip_drives[id].read_only = wp;
zip_load(dev, fn, 0);
rdisk_disk_close(dev);
rdisk_drives[id].read_only = wp;
rdisk_load(dev, fn, 0);
ui_sb_update_icon_state(SB_ZIP | id, strlen(zip_drives[id].image_path) ? 0 : 1);
ui_sb_update_icon_state(SB_RDISK | id, strlen(rdisk_drives[id].image_path) ? 0 : 1);
#if 0
media_menu_update_zip(id);
media_menu_update_rdisk(id);
#endif
ui_sb_update_tip(SB_ZIP | id);
ui_sb_update_tip(SB_RDISK | id);
config_save();
}
void
zip_reload(uint8_t id)
rdisk_reload(uint8_t id)
{
zip_t *dev = (zip_t *) zip_drives[id].priv;
rdisk_t *dev = (rdisk_t *) rdisk_drives[id].priv;
zip_disk_reload(dev);
if (strlen(zip_drives[id].image_path) == 0) {
ui_sb_update_icon_state(SB_ZIP | id, 1);
rdisk_disk_reload(dev);
if (strlen(rdisk_drives[id].image_path) == 0) {
ui_sb_update_icon_state(SB_RDISK | id, 1);
} else {
ui_sb_update_icon_state(SB_ZIP | id, 0);
ui_sb_update_icon_state(SB_RDISK | id, 0);
}
#if 0
media_menu_update_zip(id);
media_menu_update_rdisk(id);
#endif
ui_sb_update_tip(SB_ZIP | id);
ui_sb_update_tip(SB_RDISK | id);
config_save();
}