sdvx: Allow setting digital amp level from sdvxio

For SDVX 1-4: passes amp values through as-is

For SDVX5: ignores the amp volume control (as the game uses windows volume controls, which will work without any hooks)
This commit is contained in:
Will Xyen
2020-08-14 04:38:38 -07:00
parent 22c69cf883
commit b99abc5d39
9 changed files with 79 additions and 16 deletions
+11 -8
View File
@@ -37,7 +37,12 @@ static bool aciodrv_kfca_watchdog_start(uint8_t node_id)
*/
}
static bool aciodrv_kfca_amp(uint8_t node_id)
bool aciodrv_kfca_amp(
uint8_t node_id,
uint8_t primary,
uint8_t headphone,
uint8_t unused,
uint8_t subwoofer)
{
struct ac_io_message msg;
@@ -45,12 +50,10 @@ static bool aciodrv_kfca_amp(uint8_t node_id)
msg.cmd.code = ac_io_u16(AC_IO_CMD_KFCA_AMP_CONTROL);
msg.cmd.nbytes = 4;
// yes this sets the amp to 100% volume
// TODO: expose this to sdvxio instead at some point
msg.cmd.raw[0] = 0;
msg.cmd.raw[1] = 0;
msg.cmd.raw[2] = 0;
msg.cmd.raw[3] = 0;
msg.cmd.raw[0] = primary;
msg.cmd.raw[1] = headphone;
msg.cmd.raw[2] = unused;
msg.cmd.raw[3] = subwoofer;
if (!aciodrv_send_and_recv(
&msg, offsetof(struct ac_io_message, cmd.raw) + 1)) {
@@ -69,7 +72,7 @@ bool aciodrv_kfca_init(uint8_t node_id)
return false;
}
if (!aciodrv_kfca_amp(node_id)) {
if (!aciodrv_kfca_amp(node_id, 0, 0, 0, 0)) {
return false;
}
+18
View File
@@ -30,4 +30,22 @@ bool aciodrv_kfca_poll(
const struct ac_io_kfca_poll_out *pout,
struct ac_io_kfca_poll_in *pin);
/**
* Set the KFCA digital amp level
*
* @param node_id Id of the node to query (0 based).
* @param primary primary volume (96-0)
* @param headphone headphone volume (96-0)
* @param unused unknown volume (96-0) (unused)
* @param subwoofer subwoofer volume (96-0)
* @return True on success, false on error.
* @note Note 96 (or 100?) is lowest volume level, 0 is highest
*/
bool aciodrv_kfca_amp(
uint8_t node_id,
uint8_t primary,
uint8_t headphone,
uint8_t unused,
uint8_t subwoofer);
#endif