Merge branch 'master' of github.com:OBattler/86Box

This commit is contained in:
TC1995
2018-02-26 14:36:25 +01:00
4 changed files with 125 additions and 33 deletions

View File

@@ -9,7 +9,7 @@
* Implementation of the IDE emulation for hard disks and ATAPI * Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices. * CD-ROM devices.
* *
* Version: @(#)hdc_ide.c 1.0.26 2018/02/14 * Version: @(#)hdc_ide.c 1.0.28 2018/02/25
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -1137,6 +1137,33 @@ void writeide(int ide_board, uint16_t addr, uint8_t val)
{ {
cdrom[atapi_cdrom_drives[ide->channel]].error = 0; cdrom[atapi_cdrom_drives[ide->channel]].error = 0;
} }
if ((val >= WIN_SEEK) && (val <= 0x7F))
{
if (ide_drive_is_zip(ide))
{
zip[atapi_zip_drives[ide->channel]].status = READY_STAT;
}
else if (ide_drive_is_cdrom(ide))
{
cdrom[atapi_cdrom_drives[ide->channel]].status = READY_STAT;
}
else
{
ide->atastat = READY_STAT;
}
timer_process();
if (ide_drive_is_zip(ide))
{
zip[atapi_zip_drives[ide->channel]].callback = 100LL*IDE_TIME;
}
if (ide_drive_is_cdrom(ide))
{
cdrom[atapi_cdrom_drives[ide->channel]].callback = 100LL*IDE_TIME;
}
idecallback[ide_board]=100LL*IDE_TIME;
timer_update_outstanding();
return;
}
switch (val) switch (val)
{ {
case WIN_SRST: /* ATAPI Device Reset */ case WIN_SRST: /* ATAPI Device Reset */
@@ -1166,7 +1193,6 @@ void writeide(int ide_board, uint16_t addr, uint8_t val)
return; return;
case WIN_RESTORE: case WIN_RESTORE:
case WIN_SEEK:
if (ide_drive_is_zip(ide)) if (ide_drive_is_zip(ide))
{ {
zip[atapi_zip_drives[ide->channel]].status = READY_STAT; zip[atapi_zip_drives[ide->channel]].status = READY_STAT;
@@ -1888,6 +1914,27 @@ void callbackide(int ide_board)
zip_id = atapi_zip_drives[cur_ide[ide_board]]; zip_id = atapi_zip_drives[cur_ide[ide_board]];
zip_id_other = atapi_zip_drives[cur_ide[ide_board] ^ 1]; zip_id_other = atapi_zip_drives[cur_ide[ide_board] ^ 1];
if ((ide->command >= WIN_SEEK) && (ide->command <= 0x7F))
{
if (ide_drive_is_zip(ide) || ide_drive_is_cdrom(ide))
{
goto abort_cmd;
}
if (ide_drive_is_zip(ide))
{
zip[zip_id].status = READY_STAT | DSC_STAT;
}
else if (ide_drive_is_cdrom(ide))
{
cdrom[cdrom_id].status = READY_STAT | DSC_STAT;
}
else
{
ide->atastat = READY_STAT | DSC_STAT;
}
ide_irq_raise(ide);
return;
}
switch (ide->command) switch (ide->command)
{ {
/* Initialize the Task File Registers as follows: Status = 00h, Error = 01h, Sector Count = 01h, Sector Number = 01h, /* Initialize the Task File Registers as follows: Status = 00h, Error = 01h, Sector Count = 01h, Sector Number = 01h,
@@ -1920,7 +1967,6 @@ void callbackide(int ide_board)
return; return;
case WIN_RESTORE: case WIN_RESTORE:
case WIN_SEEK:
if (ide_drive_is_zip(ide) || ide_drive_is_cdrom(ide)) if (ide_drive_is_zip(ide) || ide_drive_is_cdrom(ide))
{ {
goto abort_cmd; goto abort_cmd;

View File

@@ -5,7 +5,6 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <wchar.h> #include <wchar.h>
#include <fluidsynth.h>
#include "../86box.h" #include "../86box.h"
#include "../config.h" #include "../config.h"
#include "../device.h" #include "../device.h"
@@ -17,10 +16,31 @@
#include "sound.h" #include "sound.h"
#define FLUID_CHORUS_DEFAULT_N 3
#define FLUID_CHORUS_DEFAULT_LEVEL 2.0f
#define FLUID_CHORUS_DEFAULT_SPEED 0.3f
#define FLUID_CHORUS_DEFAULT_DEPTH 8.0f
#define FLUID_CHORUS_DEFAULT_TYPE FLUID_CHORUS_MOD_SINE
#define RENDER_RATE 100 #define RENDER_RATE 100
#define BUFFER_SEGMENTS 10 #define BUFFER_SEGMENTS 10
enum fluid_chorus_mod {
FLUID_CHORUS_MOD_SINE = 0,
FLUID_CHORUS_MOD_TRIANGLE = 1
};
enum fluid_interp {
FLUID_INTERP_NONE = 0,
FLUID_INTERP_LINEAR = 1,
FLUID_INTERP_DEFAULT = 4,
FLUID_INTERP_4THORDER = 4,
FLUID_INTERP_7THORDER = 7,
FLUID_INTERP_HIGHEST = 7
};
extern void givealbuffer_midi(void *buf, uint32_t size); extern void givealbuffer_midi(void *buf, uint32_t size);
extern void pclog(const char *format, ...); extern void pclog(const char *format, ...);
extern void al_set_midi(int freq, int buf_size); extern void al_set_midi(int freq, int buf_size);
@@ -29,27 +49,27 @@ extern int soundon;
static void *fluidsynth_handle; /* handle to FluidSynth DLL */ static void *fluidsynth_handle; /* handle to FluidSynth DLL */
/* Pointers to the real functions. */ /* Pointers to the real functions. */
static fluid_settings_t*(*f_new_fluid_settings)(void); static void * (*f_new_fluid_settings)(void);
static void (*f_delete_fluid_settings)(fluid_settings_t *settings); static void (*f_delete_fluid_settings)(void *settings);
static int (*f_fluid_settings_setnum)(fluid_settings_t *settings, const char *name, double val); static int (*f_fluid_settings_setnum)(void *settings, const char *name, double val);
static int (*f_fluid_settings_getnum)(fluid_settings_t *settings, const char *name, double *val); static int (*f_fluid_settings_getnum)(void *settings, const char *name, double *val);
static fluid_synth_t * (*f_new_fluid_synth)(fluid_settings_t *settings); static void * (*f_new_fluid_synth)(void *settings);
static int (*f_delete_fluid_synth)(fluid_synth_t *synth); static int (*f_delete_fluid_synth)(void *synth);
static int (*f_fluid_synth_noteon)(fluid_synth_t *synth, int chan, int key, int vel); static int (*f_fluid_synth_noteon)(void *synth, int chan, int key, int vel);
static int (*f_fluid_synth_noteoff)(fluid_synth_t *synth, int chan, int key); static int (*f_fluid_synth_noteoff)(void *synth, int chan, int key);
static int (*f_fluid_synth_cc)(fluid_synth_t *synth, int chan, int ctrl, int val); static int (*f_fluid_synth_cc)(void *synth, int chan, int ctrl, int val);
static int (*f_fluid_synth_sysex)(fluid_synth_t *synth, const char *data, int len, char *response, int *response_len, int *handled, int dryrun); static int (*f_fluid_synth_sysex)(void *synth, const char *data, int len, char *response, int *response_len, int *handled, int dryrun);
static int (*f_fluid_synth_pitch_bend)(fluid_synth_t *synth, int chan, int val); static int (*f_fluid_synth_pitch_bend)(void *synth, int chan, int val);
static int (*f_fluid_synth_program_change)(fluid_synth_t *synth, int chan, int program); static int (*f_fluid_synth_program_change)(void *synth, int chan, int program);
static int (*f_fluid_synth_sfload)(fluid_synth_t *synth, const char *filename, int reset_presets); static int (*f_fluid_synth_sfload)(void *synth, const char *filename, int reset_presets);
static int (*f_fluid_synth_sfunload)(fluid_synth_t *synth, unsigned int id, int reset_presets); static int (*f_fluid_synth_sfunload)(void *synth, unsigned int id, int reset_presets);
static int (*f_fluid_synth_set_interp_method)(fluid_synth_t *synth, int chan, int interp_method); static int (*f_fluid_synth_set_interp_method)(void *synth, int chan, int interp_method);
static void (*f_fluid_synth_set_reverb)(fluid_synth_t *synth, double roomsize, double damping, double width, double level); static void (*f_fluid_synth_set_reverb)(void *synth, double roomsize, double damping, double width, double level);
static void (*f_fluid_synth_set_reverb_on)(fluid_synth_t *synth, int on); static void (*f_fluid_synth_set_reverb_on)(void *synth, int on);
static void (*f_fluid_synth_set_chorus)(fluid_synth_t *synth, int nr, double level, double speed, double depth_ms, int type); static void (*f_fluid_synth_set_chorus)(void *synth, int nr, double level, double speed, double depth_ms, int type);
static void (*f_fluid_synth_set_chorus_on)(fluid_synth_t *synth, int on); static void (*f_fluid_synth_set_chorus_on)(void *synth, int on);
static int (*f_fluid_synth_write_s16)(fluid_synth_t *synth, int len, void *lout, int loff, int lincr, void *rout, int roff, int rincr); static int (*f_fluid_synth_write_s16)(void *synth, int len, void *lout, int loff, int lincr, void *rout, int roff, int rincr);
static int (*f_fluid_synth_write_float)(fluid_synth_t *synth, int len, void *lout, int loff, int lincr, void *rout, int roff, int rincr); static int (*f_fluid_synth_write_float)(void *synth, int len, void *lout, int loff, int lincr, void *rout, int roff, int rincr);
static char* (*f_fluid_version_str)(void); static char* (*f_fluid_version_str)(void);
static dllimp_t fluidsynth_imports[] = { static dllimp_t fluidsynth_imports[] = {
{ "new_fluid_settings", &f_new_fluid_settings }, { "new_fluid_settings", &f_new_fluid_settings },
@@ -80,8 +100,8 @@ static dllimp_t fluidsynth_imports[] = {
typedef struct fluidsynth typedef struct fluidsynth
{ {
fluid_settings_t* settings; void* settings;
fluid_synth_t* synth; void* synth;
int samplerate; int samplerate;
int sound_font; int sound_font;

View File

@@ -8,13 +8,13 @@
* *
* Emulation of the Tseng Labs ET4000. * Emulation of the Tseng Labs ET4000.
* *
* Version: @(#)vid_et4000.c 1.0.3 2017/11/04 * Version: @(#)vid_et4000.c 1.0.4 2018/02/25
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
* *
* Copyright 2008-2017 Sarah Walker. * Copyright 2008-2018 Sarah Walker.
* Copyright 2016,2017 Miran Grca. * Copyright 2016-2018 Miran Grca.
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
@@ -45,6 +45,18 @@ typedef struct et4000_t
uint8_t banking; uint8_t banking;
} et4000_t; } et4000_t;
static uint8_t crtc_mask[0x40] =
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
void et4000_out(uint16_t addr, uint8_t val, void *p) void et4000_out(uint16_t addr, uint8_t val, void *p)
{ {
et4000_t *et4000 = (et4000_t *)p; et4000_t *et4000 = (et4000_t *)p;
@@ -75,6 +87,7 @@ void et4000_out(uint16_t addr, uint8_t val, void *p)
if ((svga->crtcreg == 7) && (svga->crtc[0x11] & 0x80)) if ((svga->crtcreg == 7) && (svga->crtc[0x11] & 0x80))
val = (svga->crtc[7] & ~0x10) | (val & 0x10); val = (svga->crtc[7] & ~0x10) | (val & 0x10);
old = svga->crtc[svga->crtcreg]; old = svga->crtc[svga->crtcreg];
val &= crtc_mask[svga->crtcreg];
svga->crtc[svga->crtcreg] = val; svga->crtc[svga->crtcreg] = val;
if (old != val) if (old != val)
{ {

View File

@@ -8,13 +8,13 @@
* *
* Trident TVGA (8900D) emulation. * Trident TVGA (8900D) emulation.
* *
* Version: @(#)vid_tvga.c 1.0.3 2017/11/04 * Version: @(#)vid_tvga.c 1.0.4 2018/02/26
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
* *
* Copyright 2008-2017 Sarah Walker. * Copyright 2008-2018 Sarah Walker.
* Copyright 2016,2017 Miran Grca. * Copyright 2016-2018 Miran Grca.
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
@@ -52,6 +52,18 @@ typedef struct tvga_t
uint32_t vram_mask; uint32_t vram_mask;
} tvga_t; } tvga_t;
static uint8_t crtc_mask[0x40] =
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x7f, 0xff, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xef,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0x7f, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x03,
0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
static void tvga_recalcbanking(tvga_t *tvga); static void tvga_recalcbanking(tvga_t *tvga);
void tvga_out(uint16_t addr, uint8_t val, void *p) void tvga_out(uint16_t addr, uint8_t val, void *p)
{ {
@@ -123,6 +135,7 @@ void tvga_out(uint16_t addr, uint8_t val, void *p)
if ((svga->crtcreg == 7) && (svga->crtc[0x11] & 0x80)) if ((svga->crtcreg == 7) && (svga->crtc[0x11] & 0x80))
val = (svga->crtc[7] & ~0x10) | (val & 0x10); val = (svga->crtc[7] & ~0x10) | (val & 0x10);
old = svga->crtc[svga->crtcreg]; old = svga->crtc[svga->crtcreg];
val &= crtc_mask[svga->crtcreg];
svga->crtc[svga->crtcreg] = val; svga->crtc[svga->crtcreg] = val;
if (old != val) if (old != val)
{ {