Applied all relevant PCem commits;
Extensively cleaned up and changed the CD-ROM code; Removed CD-ROM IOCTTL (it was causing performance and stability issues); Turned a lot of things into device_t's; Added the PS/1 Model 2011 XTA and standalone XTA hard disk controllers, ported from Varcem; Numerous FDC fixes for the PS/1 Model 2121; NVR changes ported from Varcem; The PCap code no longer requires libpcap to be compiled; Numerous fixes to various SCSI controllers; Updated NukedOPL to 1.8; Fixes to OpenAL initialization and closing, should give less Audio issues now; Revorked parts of the common (S)VGA code (also based on code from QEMU); Removed the Removable SCSI hard disks (they were a never finished experiment so there was no need to keep them there); Cleaned up the SCSI hard disk and Iomega ZIP code (but more cleanups of that are coming in the future); In some occasions (IDE hard disks in multiple sector mode and SCSI hard disks) the status bar icon is no longer updated, should improve performance a bit; Redid the way the tertiary and quaternary IDE controllers are configured (and they are now device_t's); Extensively reworked the IDE code and fixed quite a few bugs; Fixes to XT MFM, AT MFM, and AT ESDI code; Some changes to XTIDE and MCA ESDI code; Some fixes to the CD-ROM image handler.
This commit is contained in:
@@ -3,23 +3,24 @@
|
||||
*/
|
||||
#include "dbopl.h"
|
||||
#include "nukedopl.h"
|
||||
#include "sound.h"
|
||||
#include "snd_dbopl.h"
|
||||
|
||||
|
||||
int opl3_type = 0;
|
||||
int opl_type = 0;
|
||||
|
||||
|
||||
static struct
|
||||
{
|
||||
DBOPL::Chip chip;
|
||||
struct opl3_chip opl3chip;
|
||||
opl3_chip opl3chip;
|
||||
int addr;
|
||||
int timer[2];
|
||||
uint8_t timer_ctrl;
|
||||
uint8_t status_mask;
|
||||
uint8_t status;
|
||||
int is_opl3;
|
||||
|
||||
|
||||
void (*timer_callback)(void *param, int timer, int64_t period);
|
||||
void *timer_param;
|
||||
} opl[2];
|
||||
@@ -42,20 +43,19 @@ enum
|
||||
|
||||
void opl_init(void (*timer_callback)(void *param, int timer, int64_t period), void *timer_param, int nr, int is_opl3)
|
||||
{
|
||||
if (!is_opl3 || !opl3_type)
|
||||
opl[nr].timer_callback = timer_callback;
|
||||
opl[nr].timer_param = timer_param;
|
||||
opl[nr].is_opl3 = is_opl3;
|
||||
|
||||
if (!opl_type)
|
||||
{
|
||||
DBOPL::InitTables();
|
||||
opl[nr].chip.Setup(48000, is_opl3);
|
||||
opl[nr].timer_callback = timer_callback;
|
||||
opl[nr].timer_param = timer_param;
|
||||
opl[nr].is_opl3 = is_opl3;
|
||||
DBOPL::InitTables();
|
||||
opl[nr].chip.Setup(48000, is_opl3);
|
||||
}
|
||||
else
|
||||
{
|
||||
OPL3_Reset(&opl[nr].opl3chip, 48000);
|
||||
opl[nr].timer_callback = timer_callback;
|
||||
opl[nr].timer_param = timer_param;
|
||||
opl[nr].is_opl3 = is_opl3;
|
||||
opl[nr].opl3chip.newm = 0;
|
||||
OPL3_Reset(&opl[nr].opl3chip, 48000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,17 +87,22 @@ void opl_write(int nr, uint16_t addr, uint8_t val)
|
||||
{
|
||||
if (!(addr & 1))
|
||||
{
|
||||
if (!opl[nr].is_opl3 || !opl3_type)
|
||||
opl[nr].addr = (int)opl[nr].chip.WriteAddr(addr, val) & (opl[nr].is_opl3 ? 0x1ff : 0xff);
|
||||
if (!opl_type)
|
||||
opl[nr].addr = (int)opl[nr].chip.WriteAddr(addr, val) & 0x1ff;
|
||||
else
|
||||
opl[nr].addr = (int)OPL3_WriteAddr(&opl[nr].opl3chip, addr, val) & 0x1ff;
|
||||
if (!opl[nr].is_opl3)
|
||||
opl[nr].addr &= 0xff;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!opl[nr].is_opl3 || !opl3_type)
|
||||
if (!opl_type)
|
||||
opl[nr].chip.WriteReg(opl[nr].addr, val);
|
||||
else
|
||||
OPL3_WriteReg(&opl[nr].opl3chip, opl[nr].addr, val);
|
||||
else {
|
||||
OPL3_WriteRegBuffered(&opl[nr].opl3chip, (uint16_t) opl[nr].addr, val);
|
||||
if (opl[nr].addr == 0x105)
|
||||
opl[nr].opl3chip.newm = opl[nr].addr & 0x01;
|
||||
}
|
||||
|
||||
switch (opl[nr].addr)
|
||||
{
|
||||
@@ -148,20 +153,27 @@ uint8_t opl_read(int nr, uint16_t addr)
|
||||
void opl2_update(int nr, int16_t *buffer, int samples)
|
||||
{
|
||||
int c;
|
||||
Bit32s buffer_32[samples];
|
||||
|
||||
opl[nr].chip.GenerateBlock2(samples, buffer_32);
|
||||
|
||||
for (c = 0; c < samples; c++)
|
||||
buffer[c*2] = (int16_t)buffer_32[c];
|
||||
Bit32s buffer_32[SOUNDBUFLEN];
|
||||
|
||||
if (opl_type)
|
||||
{
|
||||
OPL3_GenerateStream(&opl[nr].opl3chip, buffer, samples);
|
||||
}
|
||||
else
|
||||
{
|
||||
opl[nr].chip.GenerateBlock2(samples, buffer_32);
|
||||
|
||||
for (c = 0; c < samples; c++)
|
||||
buffer[c*2] = (int16_t)buffer_32[c];
|
||||
}
|
||||
}
|
||||
|
||||
void opl3_update(int nr, int16_t *buffer, int samples)
|
||||
{
|
||||
int c;
|
||||
Bit32s buffer_32[samples*2];
|
||||
Bit32s buffer_32[SOUNDBUFLEN*2];
|
||||
|
||||
if (opl3_type)
|
||||
if (opl_type)
|
||||
{
|
||||
OPL3_GenerateStream(&opl[nr].opl3chip, buffer, samples);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user