Merge branch 'master' into es5506_alt

This commit is contained in:
cam900 2022-07-02 13:28:49 +09:00 committed by GitHub
commit f3b9c6dde6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
647 changed files with 4326 additions and 256 deletions

View file

@ -1019,6 +1019,10 @@ static void OPLL_Operator(opll_t *chip) {
}
chip->ch_out = ismod1 ? routput : (output>>3);
if (!ismod1) {
chip->output_ch[(chip->cycles+1)%9] = chip->ch_out;
}
}
static void OPLL_DoRhythm(opll_t *chip) {

View file

@ -191,6 +191,8 @@ typedef struct {
int16_t output_m;
int16_t output_r;
int16_t output_ch[9];
} opll_t;
const opll_patch_t* OPLL_GetPatchROM(uint32_t chip_type);

View file

@ -245,6 +245,11 @@ void YMPSG_Write(ympsg_t *chip, uint8_t data)
chip->write_flag = 1;
}
void YMPSG_WriteStereo(ympsg_t *chip, uint8_t data)
{
chip->stereo = data;
}
uint16_t YMPSG_Read(ympsg_t *chip)
{
uint16_t data = 0;
@ -265,6 +270,7 @@ void YMPSG_Init(ympsg_t *chip, uint8_t real_sn, uint8_t noise_tap1, uint8_t nois
chip->noise_tap1 = noise_tap1;
chip->noise_tap2 = noise_tap2;
chip->noise_size = noise_size;
chip->stereo = 0xff;
for (i = 0; i < 17; i++)
{
chip->vol_table[i]=(real_sn?tipsg_vol[i]:ympsg_vol[i]) * 8192.0f;
@ -316,32 +322,62 @@ void YMPSG_Clock(ympsg_t *chip)
}
}
int YMPSG_GetOutput(ympsg_t *chip)
void YMPSG_GetOutput(ympsg_t *chip, int* left, int* right)
{
int sample = 0;
int sample_left = 0;
int sample_right = 0;
uint32_t i;
YMPSG_UpdateSample(chip);
if (chip->test & 1)
{
sample += chip->vol_table[chip->volume_out[chip->test >> 1]];
sample += chip->vol_table[16] * 3;
sample_left += chip->vol_table[chip->volume_out[chip->test >> 1]];
sample_left += chip->vol_table[16] * 3;
sample_right += chip->vol_table[chip->volume_out[chip->test >> 1]];
sample_right += chip->vol_table[16] * 3;
}
else if (!chip->mute)
{
sample += chip->vol_table[chip->volume_out[0]];
sample += chip->vol_table[chip->volume_out[1]];
sample += chip->vol_table[chip->volume_out[2]];
sample += chip->vol_table[chip->volume_out[3]];
if (chip->stereo&(0x10)) {
sample_left += chip->vol_table[chip->volume_out[0]];
}
if (chip->stereo&(0x01)) {
sample_right += chip->vol_table[chip->volume_out[0]];
}
if (chip->stereo&(0x20)) {
sample_left += chip->vol_table[chip->volume_out[1]];
}
if (chip->stereo&(0x02)) {
sample_right += chip->vol_table[chip->volume_out[1]];
}
if (chip->stereo&(0x40)) {
sample_left += chip->vol_table[chip->volume_out[2]];
}
if (chip->stereo&(0x04)) {
sample_right += chip->vol_table[chip->volume_out[2]];
}
if (chip->stereo&(0x80)) {
sample_left += chip->vol_table[chip->volume_out[3]];
}
if (chip->stereo&(0x08)) {
sample_right += chip->vol_table[chip->volume_out[3]];
}
}
else
{
for (i = 0; i < 4; i++)
{
if (!((chip->mute>>i) & 1))
sample += chip->vol_table[chip->volume_out[i]];
if (!((chip->mute>>i) & 1)) {
if (chip->stereo&(0x10<<i)) {
sample_left += chip->vol_table[chip->volume_out[i]];
}
if (chip->stereo&(0x01<<i)) {
sample_right += chip->vol_table[chip->volume_out[i]];
}
}
}
}
return sample;
*left=sample_left;
*right=sample_right;
}
void YMPSG_Test(ympsg_t *chip, uint16_t test)
@ -349,7 +385,7 @@ void YMPSG_Test(ympsg_t *chip, uint16_t test)
chip->test = (test >> 9) & 7;
}
/*
void YMPSG_Generate(ympsg_t *chip, int32_t *buf)
{
uint32_t i;
@ -373,7 +409,7 @@ void YMPSG_Generate(ympsg_t *chip, int32_t *buf)
}
out = YMPSG_GetOutput(chip);
*buf = (int32_t)(out * 8192.f);
}
}*/
void YMPSG_WriteBuffered(ympsg_t *chip, uint8_t data)
{

View file

@ -52,6 +52,8 @@ typedef struct {
uint8_t test;
uint8_t volume_out[4];
uint8_t stereo;
//
uint64_t writebuf_samplecnt;
uint32_t writebuf_cur;
@ -68,15 +70,16 @@ typedef struct {
void YMPSG_Write(ympsg_t *chip, uint8_t data);
void YMPSG_WriteStereo(ympsg_t *chip, uint8_t data);
uint16_t YMPSG_Read(ympsg_t *chip);
void YMPSG_Init(ympsg_t *chip, uint8_t real_sn, uint8_t noise_tap1, uint8_t noise_tap2, uint32_t noise_size);
void YMPSG_SetIC(ympsg_t *chip, uint32_t ic);
void YMPSG_Clock(ympsg_t *chip);
int YMPSG_GetOutput(ympsg_t *chip);
void YMPSG_GetOutput(ympsg_t *chip, int* left, int* right);
void YMPSG_Test(ympsg_t *chip, uint16_t test);
void YMPSG_Generate(ympsg_t *chip, int32_t *buf);
//void YMPSG_Generate(ympsg_t *chip, int32_t *buf);
void YMPSG_WriteBuffered(ympsg_t *chip, uint8_t data);
void YMPSG_SetMute(ympsg_t *chip, uint8_t mute);

View file

@ -23,7 +23,12 @@ static NSArray *BuildAllowedFileTypes( const std::vector<std::string>& filterLis
NSMutableArray *buildFilterList = [[NSMutableArray alloc] init];
std::string typebuf;
int index=-1;
for (const std::string& i: filterList) {
index++;
if (!(index&1)) {
continue;
}
typebuf="";
for (const char& j: i) {
if (j==' ' || j==',' || j ==';') {

View file

@ -211,7 +211,8 @@ static nfdresult_t AddFiltersToDialog( ::IFileDialog *fileOpenDialog, const std:
// Count rows to alloc
UINT filterCount = filterList.size()>>1; /* guaranteed to have one filter on a correct, non-empty parse */
assert(filterCount);
if (filterCount==0) filterCount=1;
if ( !filterCount )
{
NFDi_SetError("Error parsing filters.");
@ -219,12 +220,12 @@ static nfdresult_t AddFiltersToDialog( ::IFileDialog *fileOpenDialog, const std:
}
/* filterCount plus 1 because we hardcode the *.* wildcard after the while loop */
COMDLG_FILTERSPEC *specList = (COMDLG_FILTERSPEC*)NFDi_Malloc( sizeof(COMDLG_FILTERSPEC) * ((size_t)filterCount + 1) );
COMDLG_FILTERSPEC *specList = (COMDLG_FILTERSPEC*)NFDi_Malloc( sizeof(COMDLG_FILTERSPEC) * ((size_t)filterCount) );
if ( !specList )
{
return NFD_ERROR;
}
for (UINT i = 0; i < filterCount+1; ++i )
for (UINT i = 0; i < filterCount; ++i )
{
specList[i].pszName = NULL;
specList[i].pszSpec = NULL;
@ -236,19 +237,22 @@ static nfdresult_t AddFiltersToDialog( ::IFileDialog *fileOpenDialog, const std:
String name=filterList[i];
String spec=filterList[i+1];
for (char& i: spec) {
if (i==' ') i=',';
if (i==' ') i=';';
}
if (spec==".*") spec="*.*";
CopyNFDCharToWChar( name.c_str(), (wchar_t**)&specList[specIdx].pszName );
CopyNFDCharToWChar( spec.c_str(), (wchar_t**)&specList[specIdx].pszSpec );
++specIdx;
}
/* Add wildcard */
specList[specIdx].pszSpec = WILDCARD;
specList[specIdx].pszName = WILDCARD;
/* Add wildcard if specIdx is 0 */
if (specIdx==0) {
specList[specIdx].pszSpec = WILDCARD;
specList[specIdx].pszName = WILDCARD;
}
fileOpenDialog->SetFileTypes( filterCount+1, specList );
fileOpenDialog->SetFileTypes( filterCount, specList );
/* free speclist */
for ( size_t i = 0; i < filterCount; ++i )

View file

@ -40,6 +40,7 @@
#include "RtMidi.h"
#include <sstream>
#ifdef TARGET_OS_IPHONE
#if (TARGET_OS_IPHONE == 1)
#define AudioGetCurrentHostTime CAHostTimeBase::GetCurrentTime
@ -66,6 +67,7 @@
#define EndianS32_BtoN(n) n
#endif
#endif
// Default for Windows is to add an identifier to the port names; this
// flag can be defined (e.g. in your project file) to disable this behaviour.
@ -814,7 +816,7 @@ MidiOutApi :: ~MidiOutApi( void )
// time values.
// These are not available on iOS.
#if (TARGET_OS_IPHONE == 0)
#ifdef TARGET_OS_IPHONE
#include <CoreAudio/HostTime.h>
#include <CoreServices/CoreServices.h>
#endif