FLTK: More compatibility improvements for non-Nestopia cores

This commit is contained in:
rdanbrook
2025-05-23 22:08:36 -06:00
parent 67885ae378
commit 65bcf78210
3 changed files with 18 additions and 8 deletions

View File

@@ -103,7 +103,14 @@ AudioManager::AudioManager(JGManager& jgm, SettingManager& setmgr)
bufend = bufstart = bufsamples = 0;
audinfo = jgm.get_audioinfo();
audinfo->buf = &buf_in[0];
if (audinfo->sampfmt == JG_SAMPFMT_INT16) {
audinfo->buf = &buf_in[0];
}
else {
audinfo->buf = &fltbuf_in[0];
}
spf = audinfo->spf;
// Resampler
@@ -180,7 +187,10 @@ void AudioManager::queue(size_t in_size) {
size_t numsamples = in_size / ffspeed;
src_short_to_float_array(buf_in, fltbuf_in, numsamples);
if (audinfo->sampfmt == JG_SAMPFMT_INT16) {
src_short_to_float_array(buf_in, fltbuf_in, numsamples);
}
srcdata.input_frames = numsamples / audinfo->channels;
srcdata.end_of_input = 0;

View File

@@ -552,7 +552,7 @@ void FltkUi::about(Fl_Widget *w, void *data) {
Fl_Box text0(0, 144, 460, UI_SPACING, "Nestopia UE");
text0.labelfont(FL_BOLD);
Fl_Box text1(0, 166, 460, UI_SPACING, JG_VERSION);
Fl_Box text1(0, 166, 460, UI_SPACING, jgm->get_coreinfo()->version);
Fl_Box text2(0, 208, 460, UI_SPACING, "Cycle-Accurate Nintendo Entertainment System Emulator");

View File

@@ -47,8 +47,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace {
jg_inputstate_t coreinput[5]{};
jg_inputinfo_t *inputinfo[5]{nullptr};
constexpr int DEADZONE = 5120;
constexpr size_t MAXPORTS = 12;
jg_inputstate_t coreinput[MAXPORTS]{};
jg_inputinfo_t *inputinfo[MAXPORTS]{nullptr};
jg_inputstate_t uistate;
jg_inputinfo_t uiinfo;
@@ -70,9 +73,6 @@ bool uiprev[NDEFS_UI]{};
uint8_t undef8{};
uint16_t undef16{};
constexpr int DEADZONE = 5120;
constexpr size_t MAXPORTS = 4;
SDL_Joystick *joystick[MAXPORTS]{nullptr};
int jsports[MAXPORTS]{};
int jsiid[MAXPORTS]{};