summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/imagedev/floppy.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/imagedev/floppy.h')
-rw-r--r--src/devices/imagedev/floppy.h48
1 files changed, 41 insertions, 7 deletions
diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h
index c9fdc220ad3..79f3f7c583f 100644
--- a/src/devices/imagedev/floppy.h
+++ b/src/devices/imagedev/floppy.h
@@ -15,6 +15,7 @@
#include "formats/fsmgr.h"
#include "sound/samples.h"
#include "softlist_dev.h"
+#include "screen.h"
class floppy_sound_device;
@@ -27,14 +28,14 @@ public:
format_registration();
void add(floppy_format_type format);
- void add(filesystem_manager_type fs);
+ void add(const filesystem_manager_t &fs);
void add_fm_containers();
void add_mfm_containers();
void add_pc_formats();
std::vector<floppy_format_type> m_formats;
- std::vector<filesystem_manager_type> m_fs;
+ std::vector<const filesystem_manager_t *> m_fs;
};
class floppy_image_device : public device_t,
@@ -79,7 +80,7 @@ public:
virtual ~floppy_image_device();
void set_formats(std::function<void (format_registration &fr)> formats);
- floppy_image_format_t *get_formats() const;
+ const std::vector<floppy_image_format_t *> &get_formats() const;
const std::vector<fs_info> &get_create_fs() const { return m_create_fs; }
const std::vector<fs_info> &get_io_fs() const { return m_io_fs; }
floppy_image_format_t *get_load_format() const;
@@ -157,9 +158,11 @@ public:
protected:
struct fs_enum : public filesystem_manager_t::floppy_enumerator {
floppy_image_device *m_fid;
+ const filesystem_manager_t *m_manager;
+
fs_enum(floppy_image_device *fid) : filesystem_manager_t::floppy_enumerator(), m_fid(fid) {};
- virtual void add(const filesystem_manager_t *manager, floppy_format_type type, u32 image_size, const char *name, const char *description) override;
+ virtual void add(floppy_format_type type, u32 image_size, const char *name, const char *description) override;
virtual void add_raw(const char *name, u32 key, const char *description) override;
};
@@ -186,9 +189,9 @@ protected:
std::vector<uint32_t> variants;
std::unique_ptr<floppy_image> image;
char extension_list[256];
- floppy_image_format_t *fif_list;
+ std::vector<floppy_image_format_t *> fif_list;
std::vector<fs_info> m_create_fs, m_io_fs;
- std::vector<std::unique_ptr<filesystem_manager_t>> m_fs_managers;
+ std::vector<const filesystem_manager_t *> m_fs_managers;
emu_timer *index_timer;
/* Physical characteristics, filled by setup_characteristics */
@@ -229,11 +232,12 @@ protected:
/* Current floppy zone cache */
attotime cache_start_time, cache_end_time, cache_weak_start;
+ attotime amplifier_freakout_time;
int cache_index;
u32 cache_entry;
bool cache_weak;
- bool image_dirty;
+ bool image_dirty, track_dirty;
int ready_counter;
load_cb cur_load_cb;
@@ -264,6 +268,35 @@ protected:
// Sound
bool m_make_sound;
floppy_sound_device* m_sound_out;
+
+ // Flux visualization
+ struct flux_per_pixel_info {
+ uint32_t m_position; // 0-199999999 Angular position in the track, 0xffffffff if not in the floppy image
+ uint16_t m_r; // Distance from the center
+ uint8_t m_combined_track; // No need to store head, it's y >= flux_screen_sy/2
+ uint8_t m_color; // Computed gray level from the flux counts
+ };
+
+ struct flux_per_combined_track_info {
+ std::vector<flux_per_pixel_info *> m_pixels[2];
+ uint32_t m_span;
+ uint8_t m_track;
+ uint8_t m_subtrack;
+ };
+
+ std::vector<flux_per_pixel_info> m_flux_per_pixel_infos;
+ std::vector<flux_per_combined_track_info> m_flux_per_combined_track_infos;
+
+ optional_device<screen_device> m_flux_screen;
+
+ static constexpr int flux_screen_sx = 501;
+ static constexpr int flux_screen_sy = 1002;
+ static constexpr int flux_min_r = 100;
+ static constexpr int flux_max_r = 245;
+
+ void flux_image_prepare();
+ void flux_image_compute_for_track(int track, int head);
+ uint32_t flux_screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect);
};
#define DECLARE_FLOPPY_IMAGE_DEVICE(Type, Name, Interface) \
@@ -285,6 +318,7 @@ DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_35_HD, floppy_35_hd, "floppy_3_
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_35_ED, floppy_35_ed, "floppy_3_5")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SSSD_35T, floppy_525_sssd_35t, "floppy_5_25")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SD_35T, floppy_525_sd_35t, "floppy_5_25")
+DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_VTECH, floppy_525_vtech, "floppy_5_25")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SSSD, floppy_525_sssd, "floppy_5_25")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SD, floppy_525_sd, "floppy_5_25")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SSDD, floppy_525_ssdd, "floppy_5_25")