mirror of
https://github.com/86Box/86Box.git
synced 2026-02-25 04:45:31 -07:00
* Initial spindle emulation working for windows atleast * Spingle motor spin-up, spin-down implemented with smooth transitions to motor-on loop. * Moved fdd audio emulation to a separate file * Multiple drives sound emulation * Single sector movement sound emulations implemented * Rename project to Immersive86Box and update details Updated README to reflect the new project name and added details about the Immersive86Box features and future plans. * Revise contribution guidelines in CONTRIBUTING.md * Update vulnerability reporting instructions * System fan-sound next feature after basic fdd sound emulation is ready * v0.5 multitrack audio seek sfx * Removed unnecessary stuff * no .vs folder for git * Added currently used fdd sound effects and readme.txt for source of the files and intallation instructions * Add audio emulation installation instructions Added instructions for audio emulation installation. * Code and audio samples merged * Simplify audio emulation installation instructions * FDC seeking fixed, not instant anymore drive is set to busy during the operation and when it's finished at call fdc to set the appropriate fdc flags. Also added time logic to fdd to calculate seek duration and a callback function for it. * FDD sound samples volume control * Menu options to enable / disable fdd sound for all drives. DISABLE_FDD_AUDIO definition added, to disable the feature via cmake/build. * Revert readme etc. changes * Revert "Revise contribution guidelines in CONTRIBUTING.md" This reverts commit98a0478225. * Revert "Update vulnerability reporting instructions" This reverts commit7d32cb659b. * Fixed merge issue * Removed excess files * Fixed PCJr seeking not to break the FDC implementation. Now seeking will take the "correct" amount of time for each system and the seek time is based on the track count. E.g. 40 track FDD system causes 40 track seek time to be 80/40 * 6ms * 40 tracks + 50ms = 480ms + 50ms -> 530ms. 80 track system full seek is 80/80 * 6ms * 80 + 50ms = 530ms, 40 track seek would take 240 + 50 = 290ms. * Fixed PS/1, PS/2 and PS/55 FDD issues. * FDD_AUDIO: Updating samples looked in executablePath/samples and if now found there, looks in the executable directory * Updated installation instructions * Removed samples path strcat use * fdd_audio 5.25 samples and support added * FDD audio timing/volume tunings * Timing fixes for authentity and special longer timings for PCJr * Fixed second drive motor keeps running when first drive is only accessed. * Fixed PCJr random failure issue, timings * CodeQL fix for load_wav-function. Check the filename to be proper filename * Revert "Fixed second drive motor keeps running when first drive is only accessed." This reverts commit307b173ae7. * Teac 5.25" drive samples added. Added per drive audio selection to FDD settings. * Fixed mistake in samples folder recreation --------- Co-authored-by: Toni Riikonen <domppari@hotmail.com>
86 lines
2.1 KiB
C
86 lines
2.1 KiB
C
/*
|
|
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
|
* running old operating systems and software designed for IBM
|
|
* PC systems and compatibles from 1981 through fairly recent
|
|
* system designs based on the PCI bus.
|
|
*
|
|
* This file is part of the 86Box distribution.
|
|
*
|
|
* Definitions for the floppy drive audio emulation.
|
|
*
|
|
* Authors: Toni Riikonen, <riikonen.toni@gmail.com>
|
|
*
|
|
* Copyright 2025 Toni Riikonen.
|
|
*/
|
|
#ifndef EMU_FDD_AUDIO_H
|
|
#define EMU_FDD_AUDIO_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifndef DISABLE_FDD_AUDIO
|
|
|
|
/* Motor sound states */
|
|
typedef enum {
|
|
MOTOR_STATE_STOPPED = 0,
|
|
MOTOR_STATE_STARTING,
|
|
MOTOR_STATE_RUNNING,
|
|
MOTOR_STATE_STOPPING
|
|
} motor_state_t;
|
|
|
|
/* WAV header structure */
|
|
typedef struct {
|
|
char riff[4];
|
|
uint32_t size;
|
|
char wave[4];
|
|
char fmt[4];
|
|
uint32_t fmt_size;
|
|
uint16_t audio_format;
|
|
uint16_t num_channels;
|
|
uint32_t sample_rate;
|
|
uint32_t byte_rate;
|
|
uint16_t block_align;
|
|
uint16_t bits_per_sample;
|
|
char data[4];
|
|
uint32_t data_size;
|
|
} wav_header_t;
|
|
|
|
/* Fade duration: 75ms at 48kHz = 3600 samples */
|
|
#define FADE_DURATION_MS 75
|
|
#define FADE_SAMPLES (48000 * FADE_DURATION_MS / 1000)
|
|
|
|
#else
|
|
|
|
typedef enum {
|
|
MOTOR_STATE_STOPPED = 0
|
|
} motor_state_t;
|
|
|
|
#endif /* DISABLE_FDD_AUDIO */
|
|
|
|
/* FDD audio initialization and cleanup */
|
|
extern void fdd_audio_init(void);
|
|
extern void fdd_audio_close(void);
|
|
|
|
/* Motor control for audio */
|
|
extern void fdd_audio_set_motor_enable(int drive, int motor_enable);
|
|
|
|
/* Single sector movement audio */
|
|
extern void fdd_audio_play_single_track_step(int drive, int from_track, int to_track);
|
|
|
|
/* Multi-track seek audio */
|
|
extern void fdd_audio_play_multi_track_seek(int drive, int from_track, int to_track);
|
|
|
|
/* Audio callback function */
|
|
extern void fdd_audio_callback(int16_t *buffer, int length);
|
|
|
|
/* State name helper function */
|
|
extern const char *fdd_audio_motor_state_name(motor_state_t state);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /*EMU_FDD_AUDIO_H*/ |