mirror of
https://github.com/holub/mame
synced 2025-04-24 09:20:02 +03:00
Fixed an issue with legacy floppy loading caused by filetype() now being a std::string
This caused 'mame a800 -flop1 brucelee' to fail on startup, but after this fix the image mounts but incorrectly.
This commit is contained in:
parent
9f03cc1aef
commit
d3b374d545
@ -439,7 +439,7 @@ image_init_result legacy_floppy_image_device::internal_floppy_device_load(bool i
|
||||
{
|
||||
/* opening an image */
|
||||
floppy_flags = !is_readonly() ? FLOPPY_FLAGS_READWRITE : FLOPPY_FLAGS_READONLY;
|
||||
err = floppy_open_choices((void *) image, &image_ioprocs, filetype().c_str(), floppy_options, floppy_flags, &m_floppy);
|
||||
err = floppy_open_choices((void *) image, &image_ioprocs, filetype(), floppy_options, floppy_flags, &m_floppy);
|
||||
if (err)
|
||||
goto error;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ static floppy_image_legacy *floppy_init(void *fp, const struct io_procs *procs,
|
||||
|
||||
/* main code for identifying and maybe opening a disk image; not exposed
|
||||
* directly because this function is big and hideous */
|
||||
static floperr_t floppy_open_internal(void *fp, const struct io_procs *procs, const char *extension,
|
||||
static floperr_t floppy_open_internal(void *fp, const struct io_procs *procs, const std::string &extension,
|
||||
const struct FloppyFormat *floppy_options, int max_options, int flags, floppy_image_legacy **outfloppy,
|
||||
int *outoption)
|
||||
{
|
||||
@ -118,7 +118,7 @@ static floperr_t floppy_open_internal(void *fp, const struct io_procs *procs, co
|
||||
/* vote on the best format */
|
||||
for (i = 0; (i < max_options) && floppy_options[i].construct; i++)
|
||||
{
|
||||
if (!extension || !floppy_options[i].extensions || image_find_extension(floppy_options[i].extensions, extension))
|
||||
if (extension.empty() || !floppy_options[i].extensions || image_find_extension(floppy_options[i].extensions, extension.c_str()))
|
||||
{
|
||||
if (floppy_options[i].identify)
|
||||
{
|
||||
@ -188,7 +188,7 @@ floperr_t floppy_identify(void *fp, const struct io_procs *procs, const char *ex
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_open(void *fp, const struct io_procs *procs, const char *extension,
|
||||
floperr_t floppy_open(void *fp, const struct io_procs *procs, const std::string &extension,
|
||||
const struct FloppyFormat *format, int flags, floppy_image_legacy **outfloppy)
|
||||
{
|
||||
return floppy_open_internal(fp, procs, extension, format, 1, flags, outfloppy, nullptr);
|
||||
@ -196,7 +196,7 @@ floperr_t floppy_open(void *fp, const struct io_procs *procs, const char *extens
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_open_choices(void *fp, const struct io_procs *procs, const char *extension,
|
||||
floperr_t floppy_open_choices(void *fp, const struct io_procs *procs, const std::string &extension,
|
||||
const struct FloppyFormat *formats, int flags, floppy_image_legacy **outfloppy)
|
||||
{
|
||||
return floppy_open_internal(fp, procs, extension, formats, INT_MAX, flags, outfloppy, nullptr);
|
||||
|
@ -164,8 +164,8 @@ LEGACY_FLOPPY_OPTIONS_EXTERN(default);
|
||||
OPTION_GUIDE_EXTERN(floppy_option_guide);
|
||||
|
||||
/* opening, closing and creating of floppy images */
|
||||
floperr_t floppy_open(void *fp, const struct io_procs *procs, const char *extension, const struct FloppyFormat *format, int flags, floppy_image_legacy **outfloppy);
|
||||
floperr_t floppy_open_choices(void *fp, const struct io_procs *procs, const char *extension, const struct FloppyFormat *formats, int flags, floppy_image_legacy **outfloppy);
|
||||
floperr_t floppy_open(void *fp, const struct io_procs *procs, const std::string &extension, const struct FloppyFormat *format, int flags, floppy_image_legacy **outfloppy);
|
||||
floperr_t floppy_open_choices(void *fp, const struct io_procs *procs, const std::string &extension, const struct FloppyFormat *formats, int flags, floppy_image_legacy **outfloppy);
|
||||
floperr_t floppy_create(void *fp, const struct io_procs *procs, const struct FloppyFormat *format, util::option_resolution *parameters, floppy_image_legacy **outfloppy);
|
||||
void floppy_close(floppy_image_legacy *floppy);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user