Changeset 56278 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 8, 2015 5:21:10 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r56085 r56278 1335 1335 } 1336 1336 1337 /* Convert SB Pro to SB16 mixer volume (left + right). */ 1338 static inline void sb16ConvVolumeOldToNew(PSB16STATE pThis, unsigned reg, uint8_t val) 1339 { 1340 /* Left channel. */ 1341 pThis->mixer_regs[reg + 0] = (val & 0xf0) | RT_BIT(3); 1342 /* Right channel (the register immediately following). */ 1343 pThis->mixer_regs[reg + 1] = (val << 4) | RT_BIT(3); 1344 } 1345 1337 1346 static IO_WRITE_PROTO(mixer_write_datab) 1338 1347 { … … 1353 1362 break; 1354 1363 1355 case 0x04: 1356 /* Translate from old style stream volume (L/R). */ 1357 pThis->mixer_regs[0x32] = (val & 0xf0) >> 3; 1358 pThis->mixer_regs[0x33] = (val & 0x0f) << 1; 1364 case 0x04: /* Translate from old style voice volume (L/R). */ 1365 sb16ConvVolumeOldToNew(pThis, 0x32, val); 1359 1366 fUpdateStream = true; 1360 1367 break; 1361 1368 1362 case 0x22: 1363 /* Translate from old style master volume (L/R). */ 1364 pThis->mixer_regs[0x30] = (val & 0xf0) >> 3; 1365 pThis->mixer_regs[0x31] = (val & 0x0f) << 1; 1369 case 0x22: /* Translate from old style master volume (L/R). */ 1370 sb16ConvVolumeOldToNew(pThis, 0x30, val); 1366 1371 fUpdateMaster = true; 1367 1372 break; 1368 1373 1369 case 0x26: 1370 /* Translate from old style MIDI volume (L/R). */ 1371 pThis->mixer_regs[0x34] = (val & 0xf0) >> 3; 1372 pThis->mixer_regs[0x35] = (val & 0x0f) << 1; 1373 break; 1374 1375 case 0x28: 1376 /* Translate from old style CD volume (L/R). */ 1377 pThis->mixer_regs[0x36] = (val & 0xf0) >> 3; 1378 pThis->mixer_regs[0x37] = (val & 0x0f) << 1; 1379 break; 1380 1381 case 0x2E: 1382 /* Translate from old style line volume (L/R). */ 1383 pThis->mixer_regs[0x38] = (val & 0xf0) >> 3; 1384 pThis->mixer_regs[0x39] = (val & 0x0f) << 1; 1374 case 0x26: /* Translate from old style MIDI volume (L/R). */ 1375 sb16ConvVolumeOldToNew(pThis, 0x34, val); 1376 break; 1377 1378 case 0x28: /* Translate from old style CD volume (L/R). */ 1379 sb16ConvVolumeOldToNew(pThis, 0x36, val); 1380 break; 1381 1382 case 0x2E: /* Translate from old style line volume (L/R). */ 1383 sb16ConvVolumeOldToNew(pThis, 0x38, val); 1385 1384 break; 1386 1385
Note:
See TracChangeset
for help on using the changeset viewer.