mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 05:17:40 -07:00
Allow CartGameSolarSensor::LightLevel
to be set explicitly (#2179)
Some checks are pending
macOS / ${{ matrix.arch }} (arm64) (push) Waiting to run
macOS / ${{ matrix.arch }} (x86_64) (push) Waiting to run
macOS / Universal binary (push) Blocked by required conditions
Ubuntu / x86_64 (push) Waiting to run
Ubuntu / aarch64 (push) Waiting to run
Windows / build (push) Waiting to run
Some checks are pending
macOS / ${{ matrix.arch }} (arm64) (push) Waiting to run
macOS / ${{ matrix.arch }} (x86_64) (push) Waiting to run
macOS / Universal binary (push) Blocked by required conditions
Ubuntu / x86_64 (push) Waiting to run
Ubuntu / aarch64 (push) Waiting to run
Windows / build (push) Waiting to run
* Allow `CartGameSolarSensor::LightLevel` to be set explicitly * Add `CartGameSolarSensor::GetLightLevel` * Update GBACart.cpp --------- Co-authored-by: Kemal Afzal <RSDuck@users.noreply.github.com>
This commit is contained in:
parent
7a4255b732
commit
3877a8e46b
@ -582,6 +582,11 @@ int CartGameSolarSensor::SetInput(int num, bool pressed)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CartGameSolarSensor::SetLightLevel(u8 level) noexcept
|
||||
{
|
||||
LightLevel = std::clamp<u8>(level, 0, 10);
|
||||
}
|
||||
|
||||
void CartGameSolarSensor::ProcessGPIO()
|
||||
{
|
||||
if (GPIO.data & 4) return; // Boktai chip select
|
||||
|
@ -158,6 +158,8 @@ public:
|
||||
void DoSavestate(Savestate* file) override;
|
||||
|
||||
int SetInput(int num, bool pressed) override;
|
||||
void SetLightLevel(u8 level) noexcept;
|
||||
[[nodiscard]] u8 GetLightLevel() const noexcept { return LightLevel; }
|
||||
|
||||
protected:
|
||||
void ProcessGPIO() override;
|
||||
|
Loading…
Reference in New Issue
Block a user