mirror of
https://github.com/SourMesen/Mesen2.git
synced 2025-04-02 10:21:44 -04:00
Wave channel was playing the wrong audio on the title screen, because some writes were being blocked. It looks like the restriction on wave "ram" access that exists on GB don't exist on GBA Additionally, it seems like the wave data is supposed to be stored in a large shift register (not emulated yet), rather than an array of bytes
40 lines
No EOL
789 B
C++
40 lines
No EOL
789 B
C++
#pragma once
|
|
#include "pch.h"
|
|
#include "GBA/GbaTypes.h"
|
|
#include "Utilities/ISerializable.h"
|
|
#include "Utilities/Serializer.h"
|
|
|
|
class GbaApu;
|
|
class GbaConsole;
|
|
|
|
class GbaWaveChannel final : public ISerializable
|
|
{
|
|
private:
|
|
GbaWaveState _state = {};
|
|
GbaApu* _apu = nullptr;
|
|
GbaConsole* _console = nullptr;
|
|
void UpdateOutput();
|
|
|
|
public:
|
|
GbaWaveChannel(GbaApu* apu, GbaConsole* console);
|
|
|
|
GbaWaveState& GetState();
|
|
bool Enabled();
|
|
void Disable();
|
|
void ResetLengthCounter();
|
|
|
|
uint8_t GetRawOutput();
|
|
double GetOutput();
|
|
|
|
void ClockLengthCounter();
|
|
|
|
void Exec(uint32_t clocksToRun);
|
|
|
|
uint8_t Read(uint16_t addr);
|
|
void Write(uint16_t addr, uint8_t value);
|
|
|
|
void WriteRam(uint16_t addr, uint8_t value);
|
|
uint8_t ReadRam(uint16_t addr);
|
|
|
|
void Serialize(Serializer& s) override;
|
|
}; |