win: Move remaining mount helper functions
We might want to consider renaming win_cdrom.c to something more fitting :P
This commit is contained in:
@@ -119,6 +119,9 @@ extern void do_stop(void);
|
|||||||
|
|
||||||
|
|
||||||
/* Platform-specific device support. */
|
/* Platform-specific device support. */
|
||||||
|
extern void floppy_mount(uint8_t id, wchar_t *fn, uint8_t wp);
|
||||||
|
extern void floppy_eject(uint8_t id);
|
||||||
|
extern void cdrom_mount(uint8_t id, wchar_t *fn);
|
||||||
extern void plat_cdrom_ui_update(uint8_t id, uint8_t reload);
|
extern void plat_cdrom_ui_update(uint8_t id, uint8_t reload);
|
||||||
extern void zip_eject(uint8_t id);
|
extern void zip_eject(uint8_t id);
|
||||||
extern void zip_mount(uint8_t id, wchar_t *fn, uint8_t wp);
|
extern void zip_mount(uint8_t id, wchar_t *fn, uint8_t wp);
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
#include <86box/config.h>
|
#include <86box/config.h>
|
||||||
|
#include <86box/timer.h>
|
||||||
|
#include <86box/fdd.h>
|
||||||
#include <86box/hdd.h>
|
#include <86box/hdd.h>
|
||||||
#include <86box/scsi_device.h>
|
#include <86box/scsi_device.h>
|
||||||
#include <86box/cdrom.h>
|
#include <86box/cdrom.h>
|
||||||
@@ -39,6 +41,29 @@
|
|||||||
#include <86box/win.h>
|
#include <86box/win.h>
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
floppy_mount(uint8_t id, wchar_t *fn, uint8_t wp)
|
||||||
|
{
|
||||||
|
fdd_close(id);
|
||||||
|
ui_writeprot[id] = wp;
|
||||||
|
fdd_load(id, fn);
|
||||||
|
ui_sb_update_icon_state(SB_FLOPPY | id, wcslen(floppyfns[id]) ? 0 : 1);
|
||||||
|
media_menu_update_floppy(id);
|
||||||
|
ui_sb_update_tip(SB_FLOPPY | id);
|
||||||
|
config_save();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
floppy_eject(uint8_t id)
|
||||||
|
{
|
||||||
|
fdd_close(id);
|
||||||
|
ui_sb_update_icon_state(SB_FLOPPY | id, 1);
|
||||||
|
media_menu_update_floppy(id);
|
||||||
|
ui_sb_update_tip(SB_FLOPPY | id);
|
||||||
|
config_save();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
plat_cdrom_ui_update(uint8_t id, uint8_t reload)
|
plat_cdrom_ui_update(uint8_t id, uint8_t reload)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -265,41 +265,6 @@ media_menu_init()
|
|||||||
media_menu_reset();
|
media_menu_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
fdd_mount(uint8_t id, wchar_t *fn, uint8_t wp)
|
|
||||||
{
|
|
||||||
fdd_close(id);
|
|
||||||
ui_writeprot[id] = wp;
|
|
||||||
fdd_load(id, fn);
|
|
||||||
|
|
||||||
config_save();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
fdd_eject(uint8_t id)
|
|
||||||
{
|
|
||||||
fdd_close(id);
|
|
||||||
config_save();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
cdrom_mount(uint8_t id, wchar_t *fn)
|
|
||||||
{
|
|
||||||
cdrom[id].prev_host_drive = cdrom[id].host_drive;
|
|
||||||
wcscpy(cdrom[id].prev_image_path, cdrom[id].image_path);
|
|
||||||
if (cdrom[id].ops && cdrom[id].ops->exit)
|
|
||||||
cdrom[id].ops->exit(&(cdrom[id]));
|
|
||||||
cdrom[id].ops = NULL;
|
|
||||||
memset(cdrom[id].image_path, 0, sizeof(cdrom[id].image_path));
|
|
||||||
cdrom_image_open(&(cdrom[id]), fn);
|
|
||||||
/* Signal media change to the emulated machine. */
|
|
||||||
if (cdrom[id].insert)
|
|
||||||
cdrom[id].insert(cdrom[id].priv);
|
|
||||||
cdrom[id].host_drive = (wcslen(cdrom[id].image_path) == 0) ? 0 : 200;
|
|
||||||
|
|
||||||
config_save();
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user