Merge remote-tracking branch 'origin/master' into feature/recompiler_improvements

This commit is contained in:
OBattler
2026-01-10 02:12:49 +01:00
139 changed files with 7451 additions and 7196 deletions

View File

@@ -481,6 +481,8 @@ extern void cdrom_close(void);
extern void cdrom_insert(const uint8_t id);
extern void cdrom_exit(const uint8_t id);
extern int cdrom_is_empty(const uint8_t id);
extern int cdrom_is_playing(const uint8_t id);
extern int cdrom_is_paused(const uint8_t id);
extern void cdrom_eject(const uint8_t id);
extern void cdrom_reload(const uint8_t id);

View File

@@ -71,23 +71,6 @@ typedef enum {
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;
/* Audio sample structure */
typedef struct {
char filename[512];

View File

@@ -172,6 +172,7 @@ typedef struct hard_disk_t {
uint32_t hpc;
uint32_t tracks;
uint32_t speed_preset;
uint32_t audio_profile;
uint32_t num_zones;
uint32_t phy_cyl;
@@ -233,6 +234,7 @@ extern double hdd_seek_get_time(hard_disk_t *hdd, uint32_t dst_addr, uint8_
int hdd_preset_get_num(void);
const char *hdd_preset_getname(int preset);
extern const char *hdd_preset_get_internal_name(int preset);
extern uint32_t hdd_preset_get_rpm(int preset);
extern int hdd_preset_get_from_internal_name(char *s);
extern void hdd_preset_apply(int hdd_id);

View File

@@ -0,0 +1,83 @@
/*
* 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 hard disk audio emulation.
*
* Authors: Toni Riikonen, <riikonen.toni@gmail.com>
*
* Copyright 2026 Toni Riikonen.
*/
#ifndef EMU_HDD_AUDIO_H
#define EMU_HDD_AUDIO_H
#include <stdint.h>
#include <86box/hdd.h>
#ifdef __cplusplus
extern "C" {
#endif
#define HDD_AUDIO_PROFILE_MAX 64
/* Spindle motor states */
typedef enum {
HDD_SPINDLE_STOPPED = 0,
HDD_SPINDLE_STARTING,
HDD_SPINDLE_RUNNING,
HDD_SPINDLE_STOPPING
} hdd_spindle_state_t;
/* Audio sample configuration structure */
typedef struct {
char filename[512];
float volume;
} hdd_audio_sample_config_t;
/* HDD audio profile configuration */
typedef struct {
int id;
char name[128];
char internal_name[64];
uint32_t rpm;
hdd_audio_sample_config_t spindlemotor_start;
hdd_audio_sample_config_t spindlemotor_loop;
hdd_audio_sample_config_t spindlemotor_stop;
hdd_audio_sample_config_t seek_track;
} hdd_audio_profile_config_t;
/* Functions for profile management */
extern void hdd_audio_load_profiles(void);
extern int hdd_audio_get_profile_count(void);
extern const hdd_audio_profile_config_t *hdd_audio_get_profile(int id);
extern const char *hdd_audio_get_profile_name(int id);
extern const char *hdd_audio_get_profile_internal_name(int id);
extern uint32_t hdd_audio_get_profile_rpm(int id);
extern int hdd_audio_get_profile_by_internal_name(const char *internal_name);
/* HDD audio initialization and cleanup */
extern void hdd_audio_init(void);
extern void hdd_audio_reset(void);
extern void hdd_audio_close(void);
extern void hdd_audio_callback(int16_t *buffer, int length);
extern void hdd_audio_seek(hard_disk_t *hdd, uint32_t new_cylinder);
/* Per-drive spindle control */
extern void hdd_audio_spinup_drive(int hdd_index);
extern void hdd_audio_spindown_drive(int hdd_index);
extern hdd_spindle_state_t hdd_audio_get_drive_spindle_state(int hdd_index);
/* Legacy functions for backward compatibility - operate on all drives */
extern void hdd_audio_spinup(void);
extern void hdd_audio_spindown(void);
extern hdd_spindle_state_t hdd_audio_get_spindle_state(void);
#ifdef __cplusplus
}
#endif
#endif /* EMU_HDD_AUDIO_H */

View File

@@ -165,7 +165,9 @@ extern uint16_t scancode_map[768];
extern uint16_t scancode_config_map[768];
extern void (*keyboard_send)(uint16_t val);
extern void kbd_adddata_xt_common(uint16_t val);
extern void kbd_adddata_process(uint16_t val, void (*adddata)(uint16_t val));
extern void kbd_adddata_process_10x(uint16_t val, void (*adddata)(uint16_t val));
extern const scancode scancode_xt[512];
@@ -211,6 +213,7 @@ extern void keyboard_close(void);
extern void keyboard_set_table(const scancode *ptr);
extern void keyboard_poll_host(void);
extern void keyboard_process(void);
extern void keyboard_process_10x(void);
extern uint16_t keyboard_convert(int ch);
extern void keyboard_input(int down, uint16_t scan);
extern void keyboard_all_up(void);

View File

@@ -387,8 +387,7 @@ extern void * machine_snd;
/* Core functions. */
extern int machine_count(void);
extern int machine_available(int m);
extern const char * machine_getname(void);
extern const char * machine_getname_ex(int m);
extern const char * machine_getname(int m);
extern const char * machine_get_internal_name(void);
extern const char * machine_get_nvr_name(void);
extern int machine_get_machine_from_internal_name(const char *s);
@@ -1204,6 +1203,7 @@ extern int machine_at_spitfire_init(const machine_t *);
extern int machine_at_ma30d_init(const machine_t *);
/* i440EX */
extern int machine_at_brio83xx_init(const machine_t *);
extern int machine_at_p6i440e2_init(const machine_t *);
/* i440BX */

View File

@@ -50,8 +50,8 @@
#define NET_TYPE_PCAP 2 /* use the (Win)Pcap API */
#define NET_TYPE_VDE 3 /* use the VDE plug API */
#define NET_TYPE_TAP 4 /* use a linux TAP device */
#define NET_TYPE_NMSWITCH 5 /* use the network multicast switch provider */
#define NET_TYPE_NRSWITCH 6 /* use the network remote switch provider */
#define NET_TYPE_NLSWITCH 5 /* use the local switch provider */
#define NET_TYPE_NRSWITCH 6 /* use the remote switch provider */
#define NET_MAX_FRAME 1518
/* Queue size must be a power of 2 */
@@ -60,6 +60,8 @@
#define NET_QUEUE_COUNT 4
#define NET_CARD_MAX 4
#define NET_HOST_INTF_MAX 64
#define NET_SWITCH_GRP_MIN 1
#define NET_SWITCH_GRP_MAX 10
#define NET_PERIOD_10M 0.8
#define NET_PERIOD_100M 0.08
@@ -132,7 +134,7 @@ extern const netdrv_t net_slirp_drv;
extern const netdrv_t net_vde_drv;
extern const netdrv_t net_tap_drv;
extern const netdrv_t net_null_drv;
extern const netdrv_t net_netswitch_drv;
extern const netdrv_t net_switch_drv;
struct _netcard_t {
const device_t *device;

View File

@@ -153,6 +153,7 @@ extern void plat_language_code_r(int id, char *outbuf, int len);
extern void plat_get_cpu_string(char *outbuf, uint8_t len);
extern void plat_set_thread_name(void *thread, const char *name);
extern void plat_break(void);
extern void plat_send_to_clipboard(unsigned char *rgb, int width, int height);
/* Resource management. */
extern wchar_t *plat_get_string(int id);

View File

@@ -2,5 +2,7 @@
#define SOUND_AZT2316A_H
extern void azt2316a_enable_wss(uint8_t enable, void *priv);
extern void aztpr16_update_mixer(void *priv);
extern void aztpr16_wss_mode(uint8_t mode, void *priv);
#endif /*SOUND_AZT2316A*/

View File

@@ -8,16 +8,17 @@
#define SB_SUBTYPE_CLONE_AZT2316A_0X11 1 /* Aztech Sound Galaxy Pro 16 AB, DSP 3.1 - SBPRO2 clone */
#define SB_SUBTYPE_CLONE_AZT1605_0X0C 2 /* Aztech Sound Galaxy Nova 16 Extra /
Packard Bell Forte 16, DSP 2.1 - SBPRO2 clone */
#define SB_SUBTYPE_ESS_ES688 3 /* ESS Technology ES688 */
#define SB_SUBTYPE_ESS_ES1688 4 /* ESS Technology ES1688 */
#define SB_SUBTYPE_CLONE_AZTPR16_0X09 3 /* Aztech Sound Galaxy Pro 16 Extra */
#define SB_SUBTYPE_ESS_ES688 4 /* ESS Technology ES688 */
#define SB_SUBTYPE_ESS_ES1688 5 /* ESS Technology ES1688 */
/* ESS-related */
#define IS_ESS(dsp) ((dsp)->sb_subtype >= SB_SUBTYPE_ESS_ES688) /* Check for future ESS cards here */
#define IS_NOT_ESS(dsp) ((dsp)->sb_subtype < SB_SUBTYPE_ESS_ES688) /* Check for future ESS cards here */
/* aztech-related */
#define IS_AZTECH(dsp) ((dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZT2316A_0X11 || (dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZT1605_0X0C) /* check for future AZT cards here */
#define AZTECH_EEPROM_SIZE 16
#define IS_AZTECH(dsp) ((dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZT2316A_0X11 || (dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZT1605_0X0C || (dsp)->sb_subtype == SB_SUBTYPE_CLONE_AZTPR16_0X09) /* check for future AZT cards here */
#define AZTECH_EEPROM_SIZE 36
typedef struct sb_dsp_t {
int sb_type;

View File

@@ -103,6 +103,9 @@ extern void sound_cd_thread_reset(void);
extern void sound_fdd_thread_init(void);
extern void sound_fdd_thread_end(void);
extern void sound_hdd_thread_init(void);
extern void sound_hdd_thread_end(void);
extern void closeal(void);
extern void inital(void);
extern void givealbuffer(const void *buf);
@@ -110,6 +113,7 @@ extern void givealbuffer_music(const void *buf);
extern void givealbuffer_wt(const void *buf);
extern void givealbuffer_cd(const void *buf);
extern void givealbuffer_fdd(const void *buf, const uint32_t size);
extern void givealbuffer_hdd(const void *buf, const uint32_t size);
#define sb_vibra16c_onboard_relocate_base sb_vibra16s_onboard_relocate_base
#define sb_vibra16cl_onboard_relocate_base sb_vibra16s_onboard_relocate_base
@@ -130,6 +134,7 @@ extern const device_t azt2316a_device;
extern const device_t acermagic_s20_device;
extern const device_t mirosound_pcm10_device;
extern const device_t azt1605_device;
extern const device_t aztpr16_device;
/* C-Media CMI8x38 */
extern const device_t cmi8338_device;

View File

@@ -0,0 +1,28 @@
#ifndef SOUND_UTIL_H
#define SOUND_UTIL_H
#include <stdint.h>
/* WAV file header structure */
typedef struct wav_header_t {
char riff[4];
uint32_t file_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;
/* Load a WAV file and return stereo 16-bit samples
* Returns allocated buffer (caller must free) or NULL on error
* sample_count receives the number of stereo sample pairs */
int16_t *sound_load_wav(const char *filename, int *sample_count);
#endif /* SOUND_UTIL_H */

View File

@@ -145,6 +145,9 @@ typedef struct monitor_t {
int mon_renderedframes;
atomic_int mon_actualrenderedframes;
atomic_int mon_screenshots;
atomic_int mon_screenshots_clipboard;
atomic_int mon_screenshots_raw;
atomic_int mon_screenshots_raw_clipboard;
uint32_t *mon_pal_lookup;
int *mon_cga_palette;
int mon_pal_lookup_static; /* Whether it should not be freed by the API. */