mirror of
https://github.com/libretro/gambatte-libretro.git
synced 2024-11-23 07:49:48 +00:00
Revert "added per-sound channel individual volume core options (#166)"
This commit is contained in:
parent
566abfb6ab
commit
8ee716676c
@ -24,7 +24,6 @@
|
|||||||
#include "serial_io.h"
|
#include "serial_io.h"
|
||||||
#endif
|
#endif
|
||||||
#include "gbint.h"
|
#include "gbint.h"
|
||||||
#include "sound.h"
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
@ -141,7 +140,6 @@ public:
|
|||||||
void *rombank1_ptr() const;
|
void *rombank1_ptr() const;
|
||||||
void *zeropage_ptr() const;
|
void *zeropage_ptr() const;
|
||||||
void *oamram_ptr() const;
|
void *oamram_ptr() const;
|
||||||
PSG *getPSG() const;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1145,17 +1145,6 @@ static void check_variables(void)
|
|||||||
/* Interframe blending option has its own handler */
|
/* Interframe blending option has its own handler */
|
||||||
check_frame_blend_variable();
|
check_frame_blend_variable();
|
||||||
|
|
||||||
char sound_channel_volume_base_str[] = "gambatte_channel_1_volume";
|
|
||||||
var.key = sound_channel_volume_base_str;
|
|
||||||
for (unsigned c = 0; c < 4; c++) {
|
|
||||||
sound_channel_volume_base_str[17] = c+'1';
|
|
||||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
|
||||||
{
|
|
||||||
gb.getPSG()->setSoChanVolume(unsigned(atoi(var.value)), c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_NETWORK
|
#ifdef HAVE_NETWORK
|
||||||
|
|
||||||
gb_serialMode = SERIAL_NONE;
|
gb_serialMode = SERIAL_NONE;
|
||||||
|
@ -322,86 +322,6 @@ struct retro_core_option_definition option_defs_us[] = {
|
|||||||
},
|
},
|
||||||
"10"
|
"10"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"gambatte_channel_1_volume",
|
|
||||||
"Square 1 Channel volume %",
|
|
||||||
"Modify Square 1 Volume %.",
|
|
||||||
{
|
|
||||||
{ "0", NULL },
|
|
||||||
{ "10", NULL },
|
|
||||||
{ "20", NULL },
|
|
||||||
{ "30", NULL },
|
|
||||||
{ "40", NULL },
|
|
||||||
{ "50", NULL },
|
|
||||||
{ "60", NULL },
|
|
||||||
{ "70", NULL },
|
|
||||||
{ "80", NULL },
|
|
||||||
{ "90", NULL },
|
|
||||||
{ "100", NULL },
|
|
||||||
{ NULL, NULL },
|
|
||||||
},
|
|
||||||
"100"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"gambatte_channel_2_volume",
|
|
||||||
"Square 2 Channel volume %",
|
|
||||||
"Modify Square 2 Volume %.",
|
|
||||||
{
|
|
||||||
{ "0", NULL },
|
|
||||||
{ "10", NULL },
|
|
||||||
{ "20", NULL },
|
|
||||||
{ "30", NULL },
|
|
||||||
{ "40", NULL },
|
|
||||||
{ "50", NULL },
|
|
||||||
{ "60", NULL },
|
|
||||||
{ "70", NULL },
|
|
||||||
{ "80", NULL },
|
|
||||||
{ "90", NULL },
|
|
||||||
{ "100", NULL },
|
|
||||||
{ NULL, NULL },
|
|
||||||
},
|
|
||||||
"100"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"gambatte_channel_3_volume",
|
|
||||||
"Wave Channel volume %",
|
|
||||||
"Modify Wave Volume %.",
|
|
||||||
{
|
|
||||||
{ "0", NULL },
|
|
||||||
{ "10", NULL },
|
|
||||||
{ "20", NULL },
|
|
||||||
{ "30", NULL },
|
|
||||||
{ "40", NULL },
|
|
||||||
{ "50", NULL },
|
|
||||||
{ "60", NULL },
|
|
||||||
{ "70", NULL },
|
|
||||||
{ "80", NULL },
|
|
||||||
{ "90", NULL },
|
|
||||||
{ "100", NULL },
|
|
||||||
{ NULL, NULL },
|
|
||||||
},
|
|
||||||
"100"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"gambatte_channel_4_volume",
|
|
||||||
"Noise Channel volume %",
|
|
||||||
"Modify Noise Volume %.",
|
|
||||||
{
|
|
||||||
{ "0", NULL },
|
|
||||||
{ "10", NULL },
|
|
||||||
{ "20", NULL },
|
|
||||||
{ "30", NULL },
|
|
||||||
{ "40", NULL },
|
|
||||||
{ "50", NULL },
|
|
||||||
{ "60", NULL },
|
|
||||||
{ "70", NULL },
|
|
||||||
{ "80", NULL },
|
|
||||||
{ "90", NULL },
|
|
||||||
{ "100", NULL },
|
|
||||||
{ NULL, NULL },
|
|
||||||
},
|
|
||||||
"100"
|
|
||||||
},
|
|
||||||
#ifdef HAVE_NETWORK
|
#ifdef HAVE_NETWORK
|
||||||
{
|
{
|
||||||
"gambatte_show_gb_link_settings",
|
"gambatte_show_gb_link_settings",
|
||||||
|
@ -62,7 +62,6 @@ public:
|
|||||||
void *rombank1_ptr() const { return cart_.romdata(0) + 0x4000; }
|
void *rombank1_ptr() const { return cart_.romdata(0) + 0x4000; }
|
||||||
void *zeropage_ptr() const { return (void*)(ioamhram_ + 0x0180); }
|
void *zeropage_ptr() const { return (void*)(ioamhram_ + 0x0180); }
|
||||||
void *oamram_ptr() const { return (void*)ioamhram_; }
|
void *oamram_ptr() const { return (void*)ioamhram_; }
|
||||||
PSG *psg_ptr() const { return (PSG*)&psg_; }
|
|
||||||
#else
|
#else
|
||||||
void loadSavedata() { cart_.loadSavedata(); }
|
void loadSavedata() { cart_.loadSavedata(); }
|
||||||
void saveSavedata() { cart_.saveSavedata(); }
|
void saveSavedata() { cart_.saveSavedata(); }
|
||||||
|
@ -219,10 +219,6 @@ void *GB::zeropage_ptr() const {
|
|||||||
void *GB::oamram_ptr() const {
|
void *GB::oamram_ptr() const {
|
||||||
return p_->cpu.oamram_ptr();
|
return p_->cpu.oamram_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
PSG *GB::getPSG() const {
|
|
||||||
return p_->cpu.mem_.psg_ptr();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -51,11 +51,6 @@ namespace gambatte
|
|||||||
, rsum_(0x8000) // initialize to 0x8000 to prevent borrows from high word, xor away later
|
, rsum_(0x8000) // initialize to 0x8000 to prevent borrows from high word, xor away later
|
||||||
, enabled_(false)
|
, enabled_(false)
|
||||||
{
|
{
|
||||||
// init as full volume
|
|
||||||
setSoChanVolume(100, 0);
|
|
||||||
setSoChanVolume(100, 1);
|
|
||||||
setSoChanVolume(100, 2);
|
|
||||||
setSoChanVolume(100, 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PSG::init(const bool cgb)
|
void PSG::init(const bool cgb)
|
||||||
@ -103,10 +98,10 @@ namespace gambatte
|
|||||||
uint_least32_t *const buf = buffer_ + bufferPos_;
|
uint_least32_t *const buf = buffer_ + bufferPos_;
|
||||||
|
|
||||||
std::memset(buf, 0, cycles * sizeof(uint_least32_t));
|
std::memset(buf, 0, cycles * sizeof(uint_least32_t));
|
||||||
ch1_.update(buf, (soChVol_[0] * soVol_ * 0x1999999A) >> 32, cycles);
|
ch1_.update(buf, soVol_, cycles);
|
||||||
ch2_.update(buf, (soChVol_[1] * soVol_ * 0x1999999A) >> 32, cycles);
|
ch2_.update(buf, soVol_, cycles);
|
||||||
ch3_.update(buf, (soChVol_[2] * soVol_ * 0x1999999A) >> 32, cycles);
|
ch3_.update(buf, soVol_, cycles);
|
||||||
ch4_.update(buf, (soChVol_[3] * soVol_ * 0x1999999A) >> 32, cycles);
|
ch4_.update(buf, soVol_, cycles);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PSG::generateSamples(unsigned long const cycleCounter, bool const doubleSpeed)
|
void PSG::generateSamples(unsigned long const cycleCounter, bool const doubleSpeed)
|
||||||
@ -186,14 +181,6 @@ namespace gambatte
|
|||||||
+ ((nr50 >> 4 & 0x7) + 1) * so2Mul) * 64;
|
+ ((nr50 >> 4 & 0x7) + 1) * so2Mul) * 64;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PSG::setSoChanVolume(const unsigned percent, const unsigned ch)
|
|
||||||
{
|
|
||||||
if( ch > 3 || percent > 100 )
|
|
||||||
return; // invalid arg
|
|
||||||
|
|
||||||
soChVol_[ch] = int(percent / 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PSG::mapSo(const unsigned nr51)
|
void PSG::mapSo(const unsigned nr51)
|
||||||
{
|
{
|
||||||
const unsigned long tmp = nr51 * so1Mul + (nr51 >> 4) * so2Mul;
|
const unsigned long tmp = nr51 * so1Mul + (nr51 >> 4) * so2Mul;
|
||||||
|
@ -71,7 +71,6 @@ public:
|
|||||||
void setNr44(unsigned data) { ch4_.setNr4(data); }
|
void setNr44(unsigned data) { ch4_.setNr4(data); }
|
||||||
|
|
||||||
void setSoVolume(unsigned nr50);
|
void setSoVolume(unsigned nr50);
|
||||||
void setSoChanVolume(unsigned percent, unsigned ch);
|
|
||||||
void mapSo(unsigned nr51);
|
void mapSo(unsigned nr51);
|
||||||
unsigned getStatus() const;
|
unsigned getStatus() const;
|
||||||
|
|
||||||
@ -84,7 +83,6 @@ private:
|
|||||||
std::size_t bufferPos_;
|
std::size_t bufferPos_;
|
||||||
unsigned long lastUpdate_;
|
unsigned long lastUpdate_;
|
||||||
unsigned long soVol_;
|
unsigned long soVol_;
|
||||||
unsigned long soChVol_[4];
|
|
||||||
uint_least32_t rsum_;
|
uint_least32_t rsum_;
|
||||||
bool enabled_;
|
bool enabled_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user