Commit e98725b0 authored by James's avatar James
Browse files

Update to new version of upstream, fix game region issues

parent ee0044ef
......@@ -11,7 +11,7 @@
namespace AudioCore {
LibRetroSink::LibRetroSink() {}
LibRetroSink::LibRetroSink(std::string target_device_name) {}
LibRetroSink::~LibRetroSink() {}
......@@ -19,10 +19,6 @@ unsigned int LibRetroSink::GetNativeSampleRate() const {
return native_sample_rate; // We specify this.
}
std::vector<std::string> LibRetroSink::GetDeviceList() const {
return {"LibRetro"};
}
void LibRetroSink::EnqueueSamples(const s16* samples, size_t sample_count) {
LibRetro::SubmitAudio(samples, sample_count);
}
......@@ -31,7 +27,9 @@ size_t LibRetroSink::SamplesInQueue() const {
return 0;
}
void LibRetroSink::SetDevice(int device_id) {}
std::vector<std::string> ListLibretroSinkDevices() {
return std::vector<std::string>{"LibRetro"};
}
} // namespace AudioCore
......
......@@ -21,7 +21,7 @@ namespace AudioCore {
class LibRetroSink final : public Sink {
public:
LibRetroSink();
explicit LibRetroSink(std::string target_device_name);
~LibRetroSink() override;
unsigned int GetNativeSampleRate() const override;
......@@ -29,16 +29,12 @@ public:
void EnqueueSamples(const s16* samples, size_t sample_count) override;
size_t SamplesInQueue() const override;
std::vector<std::string> GetDeviceList() const override;
void SetDevice(int device_id) override;
private:
std::vector<s16> samples;
};
void audio_callback();
void audio_set_state(bool new_state);
std::vector<std::string> ListLibretroSinkDevices();
} // namespace AudioCore
......@@ -24,7 +24,7 @@ namespace AudioCore {
// g_sink_details is ordered in terms of desirability, with the best choice at the top.
const std::vector<SinkDetails> g_sink_details = {
#ifdef HAVE_LIBRETRO
{"libretro", []() { return std::make_unique<LibRetroSink>(); }},
SinkDetails{"libretro", &std::make_unique<LibRetroSink, std::string>, &ListLibretroSinkDevices},
#endif
#ifdef HAVE_CUBEB
SinkDetails{"cubeb", &std::make_unique<CubebSink, std::string>, &ListCubebSinkDevices},
......
......@@ -55,6 +55,11 @@ void retro_init() {
LOG_DEBUG(Frontend, "Initialising core...");
// Set up LLE cores
for (const auto& service_module : Service::service_module_map) {
Settings::values.lle_modules.emplace(service_module.name, false);
}
LibRetro::Input::Init();
}
......@@ -219,19 +224,19 @@ void UpdateSettings() {
auto region = LibRetro::FetchVariable("citra_region_value", "Auto");
std::map<std::string, int> region_values;
region_values["Auto"] = 0;
region_values["Japan"] = 1;
region_values["USA"] = 2;
region_values["Europe"] = 3;
region_values["Australia"] = 4;
region_values["China"] = 5;
region_values["Korea"] = 6;
region_values["Taiwan"] = 7;
region_values["Auto"] = -1;
region_values["Japan"] = 0;
region_values["USA"] = 1;
region_values["Europe"] = 2;
region_values["Australia"] = 3;
region_values["China"] = 4;
region_values["Korea"] = 5;
region_values["Taiwan"] = 6;
auto result = region_values.find(region);
if (result == region_values.end()) {
LOG_ERROR(Frontend, "Invalid region: {}.", region);
Settings::values.region_value = 0;
Settings::values.region_value = -1;
} else {
Settings::values.region_value = result->second;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment