From cfc8af3d05f121c278fd39169c9801bedb0a9c2a Mon Sep 17 00:00:00 2001 From: TC1995 Date: Tue, 16 Jun 2020 16:50:16 +0200 Subject: [PATCH] Fixed the fix 4. --- src/floppy/fdc_pii15xb.c | 9 +++++---- src/win/win_settings.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/floppy/fdc_pii15xb.c b/src/floppy/fdc_pii15xb.c index 38d7c53d3..b41f2e9e1 100644 --- a/src/floppy/fdc_pii15xb.c +++ b/src/floppy/fdc_pii15xb.c @@ -67,9 +67,9 @@ #include <86box/timer.h> #include <86box/plat.h> #include <86box/ui.h> +#include <86box/fdd.h> #include <86box/fdc.h> #include <86box/fdc_ext.h> -#include <86box/fdd.h> #define ROM_PII_151B L"floppy/dtk/pii-151b.rom" #define ROM_PII_158B L"floppy/dtk/pii-158b.rom" @@ -88,7 +88,7 @@ typedef struct { /* Load and enable a BIOS ROM if we have one, and is enabled. */ static void -set_bios(pii_t *dev, const wchar_t *fn) +set_bios(pii_t *dev, wchar_t *fn) { uint32_t temp; FILE *fp; @@ -127,20 +127,21 @@ pii_init(const device_t *info) { pii_t *dev; - dev = (pii_t *)mem_alloc(sizeof(pii_t)); + dev = (pii_t *)malloc(sizeof(pii_t)); memset(dev, 0x00, sizeof(pii_t)); dev->type = info->local; dev->bios_addr = device_get_config_hex20("bios_addr"); if (dev->bios_addr != 0x000000) { - switch (dev->type) + switch (dev->type) { case 151: set_bios(dev, ROM_PII_151B); break; case 158: set_bios(dev, ROM_PII_158B); break; + } } /* Attach the DP8473 chip. */ diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 7ade9ea24..8f5db211b 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -51,9 +51,9 @@ #include <86box/hdc.h> #include <86box/hdc_ide.h> #include <86box/zip.h> +#include <86box/fdd.h> #include <86box/fdc.h> #include <86box/fdc_ext.h> -#include <86box/fdd.h> #include <86box/network.h> #include <86box/sound.h> #include <86box/midi.h>