Skip to content

Commit 6664219

Browse files
committed
Add stubs for missing AWACS regs
1 parent 1453bd2 commit 6664219

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

devices/sound/awacs.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ uint32_t AwacsScreamer::snd_ctrl_read(uint32_t offset, int size) {
192192
return this->is_busy;
193193
case AWAC_CODEC_STATUS_REG:
194194
return (AWAC_AVAILABLE << 8) | (AWAC_MAKER_CRYSTAL << 16) | (AWAC_REV_SCREAMER << 20);
195+
case AWAC_CLIP_COUNT:
196+
return this->clip_count;
195197
default:
196198
LOG_F(ERROR, "%s: unsupported register at offset 0x%X", this->name.c_str(), offset);
197199
}
@@ -217,6 +219,8 @@ void AwacsScreamer::snd_ctrl_write(uint32_t offset, uint32_t value, int size) {
217219
if (!subframe)
218220
this->control_regs[reg_num] = data;
219221
break;
222+
case AWAC_CLIP_COUNT:
223+
this->clip_count = BYTESWAP_32(value);
220224
default:
221225
LOG_F(ERROR, "%s: unsupported register at offset 0x%X", this->name.c_str(),
222226
offset);

devices/sound/awacs.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ enum {
9595
AWAC_SOUND_CTRL_REG = 0x00,
9696
AWAC_CODEC_CTRL_REG = 0x10,
9797
AWAC_CODEC_STATUS_REG = 0x20,
98+
AWAC_CLIP_COUNT = 0x30,
99+
AWAC_BYTE_SWAP = 0x40,
98100
};
99101

100102
/** Apple source calls this kValidData but doesn't explain
@@ -185,7 +187,8 @@ class AwacsScreamer : public MacioSndCodec {
185187
private:
186188
uint32_t snd_ctrl_reg = 0;
187189
uint16_t control_regs[8] = {}; // control registers, each 12-bits wide
188-
uint8_t is_busy = 0;
190+
uint8_t is_busy = 0;
191+
uint32_t clip_count = 0;
189192

190193
std::unique_ptr<AudioProcessor> audio_proc;
191194
};

0 commit comments

Comments
 (0)