Major commit, cleaning a lot of old stuff.

IBM.H is gone, video stuff re-organized. Keyboard stuff reorganized.
Machines that have their own video, mouse and/or keyboard now have all this in their machine file.
Fixed and other cleanups here and there.
This commit is contained in:
waltje
2017-11-05 01:57:04 -05:00
parent f5d4436672
commit 7c67e867c8
238 changed files with 5139 additions and 7832 deletions

View File

@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../plat.h"
#include "../plat_midi.h"

View File

@@ -5,7 +5,6 @@
#include <wchar.h>
#include "munt/c_interface/c_interface.h"
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../mem.h"
#include "../rom.h"

View File

@@ -13,7 +13,6 @@
# include <AL/alext.h>
#endif
#include "../86box.h"
#include "../ibm.h"
#include "sound.h"
@@ -102,7 +101,7 @@ void initalmain(int argc, char *argv[])
}
void inital(ALvoid)
void inital(void)
{
if (initialized) return;

View File

@@ -8,7 +8,6 @@
#include <wchar.h>
#include <math.h>
#include "../86box.h"
#include "../ibm.h"
#include "../dma.h"
#include "../pic.h"
#include "../timer.h"

View File

@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../mca.h"
#include "../device.h"

View File

@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../dma.h"
#include "../pic.h"

View File

@@ -4,9 +4,9 @@
#include <string.h>
#include <stdarg.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../io.h"
#include "../nmi.h"
#include "../mem.h"
#include "../pci.h"
#include "../timer.h"

View File

@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../device.h"
#include "sound.h"

View File

@@ -7,7 +7,6 @@
#include <wchar.h>
#include <math.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../io.h"
#include "../mem.h"

View File

@@ -4,8 +4,8 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../nmi.h"
#include "../pic.h"
#include "../dma.h"
#include "../timer.h"

View File

@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../machine/machine.h"
#include "../lpt.h"

View File

@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../machine/machine.h"
#include "../timer.h"

View File

@@ -8,7 +8,7 @@
*
* Roland MPU-401 emulation.
*
* Version: @(#)snd_mpu401.c 1.0.5 2017/10/19
* Version: @(#)snd_mpu401.c 1.0.6 2017/11/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* DOSBox Team,
@@ -26,7 +26,6 @@
#include <stdarg.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../io.h"
#include "../pic.h"

View File

@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../io.h"
#include "../timer.h"
#include "sound.h"

View File

@@ -4,7 +4,7 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../cpu/cpu.h"
#include "../io.h"
#include "../pic.h"
#include "../pit.h"
@@ -15,8 +15,9 @@
#include "filters.h"
#include "snd_mpu401.h"
#include "snd_opl.h"
#include "snd_pas16.h"
#include "snd_sb.h"
#include "snd_sb_dsp.h"
#include "snd_pas16.h"
/* Original PAS uses

View File

@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pic.h"
#include "../timer.h"

View File

@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../dma.h"
#include "../pic.h"

View File

@@ -8,7 +8,7 @@
*
* Sound Blaster emulation.
*
* Version: @(#)sound_sb.c 1.0.3 2017/10/16
* Version: @(#)sound_sb.c 1.0.4 2017/11/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -23,7 +23,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../mca.h"
#include "../mem.h"

View File

@@ -8,15 +8,30 @@
*
* Sound Blaster emulation.
*
* Version: @(#)sound_sb.h 1.0.0 2017/05/30
* Version: @(#)sound_sb.h 1.0.2 2017/11/04
*
* Author: Sarah Walker, <http://pcem-emulator.co.uk/>
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* TheCollector1995, <mariogplayer@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016-2017 Miran Grca.
* Copyright 2016-2017 TheCollector1995.
*/
#ifndef SOUND_SND_SB_H
# define SOUND_SND_SB_H
#define SADLIB 1 /* No DSP */
#define SB1 2 /* DSP v1.05 */
#define SB15 3 /* DSP v2.00 */
#define SB2 4 /* DSP v2.01 - needed for high-speed DMA */
#define SBPRO 5 /* DSP v3.00 */
#define SBPRO2 6 /* DSP v3.02 + OPL3 */
#define SB16 7 /* DSP v4.05 + OPL3 */
#define SADGOLD 8 /* AdLib Gold */
#define SND_WSS 9 /* Windows Sound System */
#define SND_PAS16 10 /* Pro Audio Spectrum 16 */
extern device_t sb_1_device;
extern device_t sb_15_device;
@@ -27,3 +42,6 @@ extern device_t sb_pro_v2_device;
extern device_t sb_pro_mcv_device;
extern device_t sb_16_device;
extern device_t sb_awe32_device;
#endif /*SOUND_SND_SB_H*/

View File

@@ -10,7 +10,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pic.h"
#include "../dma.h"
@@ -19,6 +18,7 @@
#include "sound.h"
#include "midi.h"
#include "snd_mpu401.h"
#include "snd_sb.h"
#include "snd_sb_dsp.h"
/*The recording safety margin is intended for uneven "len" calls to the get_buffer mixer calls on sound_sb*/

View File

@@ -5,7 +5,6 @@
#include <wchar.h>
#include <time.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../device.h"
#include "sound.h"

View File

@@ -3,7 +3,6 @@
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../pit.h"
#include "sound.h"
#include "snd_speaker.h"

View File

@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../device.h"
#include "sound.h"

View File

@@ -9,7 +9,6 @@
#include <wchar.h>
#include <math.h>
#include "../86box.h"
#include "../ibm.h"
#include "../io.h"
#include "../pic.h"
#include "../dma.h"

View File

@@ -3,7 +3,6 @@
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "snd_ym7128.h"

View File

@@ -8,7 +8,7 @@
*
* Sound emulation core.
*
* Version: @(#)sound.c 1.0.6 2017/10/16
* Version: @(#)sound.c 1.0.8 2017/11/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -22,7 +22,6 @@
#include <stdlib.h>
#include <wchar.h>
#include "../86box.h"
#include "../ibm.h"
#include "../device.h"
#include "../timer.h"
#include "../cdrom/cdrom.h"
@@ -43,17 +42,34 @@
#include "filters.h"
int sound_card_current = 0;
static int sound_card_last = 0;
typedef struct
{
typedef struct {
char name[64];
char internal_name[24];
device_t *device;
} SOUND_CARD;
int sound_card_current = 0;
int sound_pos_global = 0;
int soundon = 1;
static int sound_card_last = 0;
static struct {
void (*get_buffer)(int32_t *buffer, int len, void *p);
void *priv;
} sound_handlers[8];
static int sound_handlers_num;
static int64_t sound_poll_time = 0LL, sound_poll_latch;
static int16_t cd_buffer[CDROM_NUM][CD_BUFLEN * 2];
static float cd_out_buffer[CD_BUFLEN * 2];
static int16_t cd_out_buffer_int16[CD_BUFLEN * 2];
static thread_t *sound_cd_thread_h;
static event_t *sound_cd_event;
static unsigned int cd_vol_l, cd_vol_r;
static int cd_buf_update = CD_BUFLEN / SOUNDBUFLEN;
static SOUND_CARD sound_cards[] =
{
{ "None", "none", NULL },
@@ -130,29 +146,6 @@ void sound_card_init(void)
sound_card_last = sound_card_current;
}
static struct
{
void (*get_buffer)(int32_t *buffer, int len, void *p);
void *priv;
} sound_handlers[8];
static int sound_handlers_num;
static int64_t sound_poll_time = 0LL, sound_poll_latch;
int sound_pos_global = 0;
int soundon = 1;
static int16_t cd_buffer[CDROM_NUM][CD_BUFLEN * 2];
static float cd_out_buffer[CD_BUFLEN * 2];
static int16_t cd_out_buffer_int16[CD_BUFLEN * 2];
static thread_t *sound_cd_thread_h;
static event_t *sound_cd_event;
static unsigned int cd_vol_l, cd_vol_r;
static int cd_buf_update = CD_BUFLEN / SOUNDBUFLEN;
int sound_is_float = 1;
void sound_set_cd_volume(unsigned int vol_l, unsigned int vol_r)
{
cd_vol_l = vol_l;

View File

@@ -12,6 +12,7 @@
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -19,41 +20,50 @@
# define EMU_SOUND_H
void sound_add_handler(void (*get_buffer)(int32_t *buffer, int len, void *p), void *p);
#define SOUNDBUFLEN (48000/50)
extern int sound_card_current;
#define CD_FREQ 44100
#define CD_BUFLEN (CD_FREQ / 10)
int sound_card_available(int card);
char *sound_card_getname(int card);
extern int ppispeakon;
extern int gated,
speakval,
speakon;
extern int sound_pos_global;
extern int sound_card_current;
extern void sound_add_handler(void (*get_buffer)(int32_t *buffer, \
int len, void *p), void *p);
extern int sound_card_available(int card);
extern char *sound_card_getname(int card);
#ifdef EMU_DEVICE_H
device_t *sound_card_getdevice(int card);
extern device_t *sound_card_getdevice(int card);
#endif
int sound_card_has_config(int card);
char *sound_card_get_internal_name(int card);
int sound_card_get_from_internal_name(char *s);
void sound_card_init();
void sound_set_cd_volume(unsigned int vol_l, unsigned int vol_r);
extern int sound_card_has_config(int card);
extern char *sound_card_get_internal_name(int card);
extern int sound_card_get_from_internal_name(char *s);
extern void sound_card_init(void);
extern void sound_set_cd_volume(unsigned int vol_l, unsigned int vol_r);
#define CD_FREQ 44100
#define CD_BUFLEN (CD_FREQ / 10)
extern void sound_speed_changed(void);
extern int sound_pos_global;
void sound_speed_changed();
extern void sound_realloc_buffers(void);
extern int sound_is_float;
void sound_realloc_buffers(void);
extern void sound_init(void);
extern void sound_reset(void);
void sound_init();
void sound_reset();
extern void sound_cd_thread_end(void);
extern void sound_cd_thread_reset(void);
void sound_cd_thread_end();
void sound_cd_thread_reset();
void closeal(void);
void initalmain(int argc, char *argv[]);
void inital();
void givealbuffer(void *buf);
void givealbuffer_cd(void *buf);
extern void closeal(void);
extern void initalmain(int argc, char *argv[]);
extern void inital(void);
extern void givealbuffer(void *buf);
extern void givealbuffer_cd(void *buf);
#endif /*EMU_SOUND_H*/