Merge branch 'master' into force-critical-input-trickle

This commit is contained in:
tildearrow 2023-08-12 21:52:12 -05:00
commit bbeb3df9f6
189 changed files with 7585 additions and 3187 deletions

View file

@ -1440,8 +1440,8 @@ namespace IGFD
SYSTEMTIME localTime;
char timebuf[100];
infos.fileSize=dent.dwin_size;
if (FileTimeToSystemTime(&dent.dwin_mtime,&systemTime)==TRUE) {
infos.fileSize=dent->dwin_size;
if (FileTimeToSystemTime(&dent->dwin_mtime,&systemTime)==TRUE) {
if (SystemTimeToTzSpecificLocalTime(NULL,&systemTime,&localTime)==TRUE) {
snprintf(timebuf,99,"%d/%.2d/%.2d %.2d:%.2d",localTime.wYear,localTime.wMonth,localTime.wDay,localTime.wHour,localTime.wMinute);
} else {
@ -1730,9 +1730,9 @@ namespace IGFD
//time_t st_ctime; /* time of last status change - not sure out of ntfs */
#ifdef _WIN32
if (vInfos->fileType != 'd')
if (vInfos.fileType != 'd')
{
vInfos->formatedFileSize = prFormatFileSize(vInfos->fileSize);
vInfos.formatedFileSize = prFormatFileSize(vInfos.fileSize);
}
#else
std::string fpn;

View file

@ -97,7 +97,9 @@
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
//#define ImDrawIdx unsigned int
#ifndef IS_MOBILE
#define ImDrawIdx unsigned int
#endif
//---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
//struct ImDrawList;

View file

@ -96,7 +96,9 @@
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
//#define ImDrawIdx unsigned int
#ifndef IS_MOBILE
#define ImDrawIdx unsigned int
#endif
//---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
//struct ImDrawList;

View file

@ -2224,10 +2224,22 @@ ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* ttf_data, int ttf_size, float si
ImFont* ImFontAtlas::AddFontFromMemoryCompressedTTF(const void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
{
// workaround for big-endian
#ifdef TA_BIG_ENDIAN
unsigned char* beData=(unsigned char*)IM_ALLOC(compressed_ttf_size);
for (int i=0; i<compressed_ttf_size; i++) {
beData[i]=compressed_ttf_data[i^3];
}
compressed_ttf_data=beData;
#endif
const unsigned int buf_decompressed_size = stb_decompress_length((const unsigned char*)compressed_ttf_data);
unsigned char* buf_decompressed_data = (unsigned char*)IM_ALLOC(buf_decompressed_size);
stb_decompress(buf_decompressed_data, (const unsigned char*)compressed_ttf_data, (unsigned int)compressed_ttf_size);
#ifdef TA_BIG_ENDIAN
IM_FREE(beData);
#endif
ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
IM_ASSERT(font_cfg.FontData == NULL);
font_cfg.FontDataOwnedByAtlas = true;

View file

@ -532,6 +532,9 @@ nfdresult_t NFD_OpenDialogMultiple( const std::vector<std::string>& filterList,
nfdselcallback_t selCallback )
{
nfdresult_t nfdResult = NFD_ERROR;
NFDWinEvents* winEvents;
bool hasEvents=true;
DWORD eventID=0;
HRESULT coResult = COMInit();
@ -566,6 +569,16 @@ nfdresult_t NFD_OpenDialogMultiple( const std::vector<std::string>& filterList,
goto end;
}
// Pass the callback
winEvents=new NFDWinEvents(selCallback);
if ( !SUCCEEDED(fileOpenDialog->Advise(winEvents,&eventID)) ) {
// error... ignore
hasEvents=false;
winEvents->Release();
} else {
winEvents->Release();
}
// Set a flag for multiple options
DWORD dwFlags;
result = fileOpenDialog->GetOptions(&dwFlags);
@ -613,8 +626,12 @@ nfdresult_t NFD_OpenDialogMultiple( const std::vector<std::string>& filterList,
}
end:
if ( fileOpenDialog )
if (fileOpenDialog) {
if (hasEvents) {
fileOpenDialog->Unadvise(eventID);
}
fileOpenDialog->Release();
}
COMUninit(coResult);

View file

@ -1,4 +1,4 @@
# modification disclaimer
this is a modified version of Nuked-OPL3 which implements channel muting in the core.
this is a modified version of Nuked-OPL3 which implements channel muting in the core, and resampling function.
see [this issue](https://github.com/tildearrow/furnace/issues/414) for more information.

5
extern/opl/opl3.c vendored
View file

@ -1362,6 +1362,11 @@ void OPL3_Reset(opl3_chip *chip, uint32_t samplerate)
#endif
}
void OPL3_Resample(opl3_chip *chip, uint32_t samplerate)
{
chip->rateratio = (samplerate << RSM_FRAC) / 49716;
}
void OPL3_WriteReg(opl3_chip *chip, uint16_t reg, uint8_t v)
{
uint8_t high = (reg >> 8) & 0x01;

1
extern/opl/opl3.h vendored
View file

@ -158,6 +158,7 @@ struct _opl3_chip {
void OPL3_Generate(opl3_chip *chip, int16_t *buf);
void OPL3_GenerateResampled(opl3_chip *chip, int16_t *buf);
void OPL3_Reset(opl3_chip *chip, uint32_t samplerate);
void OPL3_Resample(opl3_chip *chip, uint32_t samplerate);
void OPL3_WriteReg(opl3_chip *chip, uint16_t reg, uint8_t v);
void OPL3_WriteRegBuffered(opl3_chip *chip, uint16_t reg, uint8_t v);
void OPL3_GenerateStream(opl3_chip *chip, int16_t *sndptr, uint32_t numsamples);

View file

@ -226,7 +226,7 @@ void k053260_core::voice_t::write(u8 address, u8 data)
m_start = (m_start & ~0x00ff00) | (u32(data) << 8);
break;
case 6: // start address bit 16-20
m_start = (m_start & ~0x1f0000) | (u32(bitfield(data, 16, 5)) << 16);
m_start = (m_start & ~0x1f0000) | (u32(bitfield(data, 0, 5)) << 16);
break;
case 7: // volume
m_volume = bitfield(data, 0, 7);