diff --git a/src/device/cartridge.c b/src/device/cartridge.c index 639095f72..bbcbad661 100644 --- a/src/device/cartridge.c +++ b/src/device/cartridge.c @@ -33,7 +33,7 @@ typedef struct cart_t { uint32_t base; } cart_t; -char cart_fns[2][512]; +char cart_fns[2][MAX_IMAGE_PATH_LEN]; char *cart_image_history[2][CART_IMAGE_HISTORY]; static cart_t carts[2]; diff --git a/src/device/cassette.c b/src/device/cassette.c index 0577ae06f..b2d8f7a1c 100644 --- a/src/device/cassette.c +++ b/src/device/cassette.c @@ -43,7 +43,7 @@ pc_cassette_t *cassette; -char cassette_fname[512]; +char cassette_fname[MAX_IMAGE_PATH_LEN]; char cassette_mode[512]; char * cassette_image_history[CASSETTE_IMAGE_HISTORY]; unsigned long cassette_pos; diff --git a/src/floppy/fdd.c b/src/floppy/fdd.c index 35676258c..14627a3f9 100644 --- a/src/floppy/fdd.c +++ b/src/floppy/fdd.c @@ -104,7 +104,7 @@ static fdd_pending_op_t fdd_pending[FDD_NUM]; /* BIOS boot status tracking */ static bios_boot_status_t bios_boot_status = BIOS_BOOT_POST; -char floppyfns[FDD_NUM][512]; +char floppyfns[FDD_NUM][MAX_IMAGE_PATH_LEN]; char *fdd_image_history[FDD_NUM][FLOPPY_IMAGE_HISTORY]; pc_timer_t fdd_poll_time[FDD_NUM]; diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index d9c105546..0a6b2461a 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -47,7 +47,7 @@ /* Recently used images */ #define MAX_PREV_IMAGES 10 -#define MAX_IMAGE_PATH_LEN 2048 +#define MAX_IMAGE_PATH_LEN 4096 /* Max UUID Length */ #define MAX_UUID_LEN 64 diff --git a/src/include/86box/cartridge.h b/src/include/86box/cartridge.h index 3afe1c3fc..66fa34e1a 100644 --- a/src/include/86box/cartridge.h +++ b/src/include/86box/cartridge.h @@ -21,7 +21,7 @@ extern "C" { #define CART_IMAGE_HISTORY 10 -extern char cart_fns[2][512]; +extern char cart_fns[2][MAX_IMAGE_PATH_LEN]; extern char *cart_image_history[2][CART_IMAGE_HISTORY]; extern void cart_load(int drive, char *fn); diff --git a/src/include/86box/cassette.h b/src/include/86box/cassette.h index dc85bfc26..82aebeef6 100644 --- a/src/include/86box/cassette.h +++ b/src/include/86box/cassette.h @@ -157,7 +157,7 @@ void pc_cas_advance(pc_cassette_t *cas); extern pc_cassette_t *cassette; -extern char cassette_fname[512]; +extern char cassette_fname[MAX_IMAGE_PATH_LEN]; extern char cassette_mode[512]; extern char * cassette_image_history[CASSETTE_IMAGE_HISTORY]; extern unsigned long cassette_pos; diff --git a/src/include/86box/cdrom.h b/src/include/86box/cdrom.h index 82c59ccd6..487676023 100644 --- a/src/include/86box/cdrom.h +++ b/src/include/86box/cdrom.h @@ -323,8 +323,8 @@ typedef struct cdrom { void *priv; - char image_path[1024]; - char prev_image_path[1280]; + char image_path[MAX_IMAGE_PATH_LEN]; + char prev_image_path[MAX_IMAGE_PATH_LEN + 256]; uint32_t sound_on; uint32_t cdrom_capacity; diff --git a/src/include/86box/fdd.h b/src/include/86box/fdd.h index ef2a33489..5e526ab6d 100644 --- a/src/include/86box/fdd.h +++ b/src/include/86box/fdd.h @@ -96,7 +96,7 @@ typedef struct DRIVE { } DRIVE; extern DRIVE drives[FDD_NUM]; -extern char floppyfns[FDD_NUM][512]; +extern char floppyfns[FDD_NUM][MAX_IMAGE_PATH_LEN]; extern char *fdd_image_history[FDD_NUM][FLOPPY_IMAGE_HISTORY]; extern pc_timer_t fdd_poll_time[FDD_NUM]; extern int ui_writeprot[FDD_NUM]; diff --git a/src/include/86box/hdd.h b/src/include/86box/hdd.h index e471cb54e..88855552b 100644 --- a/src/include/86box/hdd.h +++ b/src/include/86box/hdd.h @@ -161,7 +161,7 @@ typedef struct hard_disk_t { void *priv; - char fn[1024]; /* Name of current image file */ + char fn[MAX_IMAGE_PATH_LEN]; /* Name of current image file */ /* Differential VHD parent file */ char vhd_parent[1280]; diff --git a/src/include/86box/mo.h b/src/include/86box/mo.h index 5d48579eb..53e342ed6 100644 --- a/src/include/86box/mo.h +++ b/src/include/86box/mo.h @@ -113,8 +113,8 @@ typedef struct mo_drive_t { FILE *fp; void *priv; - char image_path[1024]; - char prev_image_path[1024]; + char image_path[MAX_IMAGE_PATH_LEN]; + char prev_image_path[MAX_IMAGE_PATH_LEN + 256]; char *image_history[MO_IMAGE_HISTORY]; diff --git a/src/include/86box/rdisk.h b/src/include/86box/rdisk.h index 6f0255847..fff53ec63 100644 --- a/src/include/86box/rdisk.h +++ b/src/include/86box/rdisk.h @@ -91,8 +91,8 @@ typedef struct rdisk_drive_t { FILE *fp; void *priv; - char image_path[1024]; - char prev_image_path[1024]; + char image_path[MAX_IMAGE_PATH_LEN]; + char prev_image_path[MAX_IMAGE_PATH_LEN + 256]; char *image_history[RDISK_IMAGE_HISTORY]; diff --git a/src/machine/m_elt.c b/src/machine/m_elt.c index b965486d1..1f440bad2 100644 --- a/src/machine/m_elt.c +++ b/src/machine/m_elt.c @@ -33,9 +33,9 @@ #include #include #include +#include <86box/86box.h> #include <86box/timer.h> #include <86box/fdd.h> -#include <86box/86box.h> #include <86box/device.h> #include <86box/fdc.h> #include <86box/fdc_ext.h> diff --git a/src/qt/qt_harddrive_common.cpp b/src/qt/qt_harddrive_common.cpp index eb814ebfd..7ec75d47d 100644 --- a/src/qt/qt_harddrive_common.cpp +++ b/src/qt/qt_harddrive_common.cpp @@ -17,6 +17,7 @@ #include extern "C" { +#include <86box/86box.h> #include <86box/hdd.h> #include <86box/scsi.h> #include <86box/cdrom.h> diff --git a/src/qt/qt_machinestatus.cpp b/src/qt/qt_machinestatus.cpp index 2e6203f24..e6ab80688 100644 --- a/src/qt/qt_machinestatus.cpp +++ b/src/qt/qt_machinestatus.cpp @@ -17,9 +17,9 @@ #include "qt_machinestatus.hpp" extern "C" { +#include <86box/86box.h> #include <86box/hdd.h> #include <86box/timer.h> -#include <86box/86box.h> #include <86box/device.h> #include <86box/cartridge.h> #include <86box/cassette.h> diff --git a/src/qt/qt_settings_bus_tracking.cpp b/src/qt/qt_settings_bus_tracking.cpp index aee57da1b..77865be72 100644 --- a/src/qt/qt_settings_bus_tracking.cpp +++ b/src/qt/qt_settings_bus_tracking.cpp @@ -19,9 +19,13 @@ #include #include +extern "C" { +#include "86box/86box.h" #include "86box/hdd.h" #include "86box/scsi.h" #include "86box/cdrom.h" +} + #include "qt_settings_bus_tracking.hpp" SettingsBusTracking::SettingsBusTracking() diff --git a/src/qt/qt_settingsotherremovable.cpp b/src/qt/qt_settingsotherremovable.cpp index 7b3bb89f6..567eaa3e2 100644 --- a/src/qt/qt_settingsotherremovable.cpp +++ b/src/qt/qt_settingsotherremovable.cpp @@ -18,6 +18,7 @@ #include "ui_qt_settingsotherremovable.h" extern "C" { +#include <86box/86box.h> #include <86box/timer.h> #include <86box/scsi_device.h> #include <86box/mo.h>