Changeset 55907 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- May 18, 2015 12:35:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r55445 r55907 1434 1434 #endif 1435 1435 1436 /* Convert SB16 to SB Pro mixer volume (left). */ 1437 static inline void sb16ConvVolumeL(PSB16STATE pThis, unsigned reg, uint8_t val) 1438 { 1439 /* High nibble in SBP mixer. */ 1440 pThis->mixer_regs[reg] = (pThis->mixer_regs[reg] & 0x0f) | (val & 0xf0); 1441 } 1442 1443 /* Convert SB16 to SB Pro mixer volume (right). */ 1444 static inline void sb16ConvVolumeR(PSB16STATE pThis, unsigned reg, uint8_t val) 1445 { 1446 /* Low nibble in SBP mixer. */ 1447 pThis->mixer_regs[reg] = (pThis->mixer_regs[reg] & 0xf0) | (val >> 4); 1448 } 1449 1436 1450 static IO_WRITE_PROTO(mixer_write_datab) 1437 1451 { … … 1449 1463 /* And update the actual volume, too. */ 1450 1464 fUpdateMaster = true; 1451 fUpdateStream 1465 fUpdateStream = true; 1452 1466 break; 1453 1467 1454 1468 case 0x04: 1455 1469 /* Translate from old style stream volume (L/R). */ 1456 pThis->mixer_regs[0x32] = val & 0xff;1457 pThis->mixer_regs[0x33] = val << 4;1470 pThis->mixer_regs[0x32] = (val & 0xf0) >> 3; 1471 pThis->mixer_regs[0x33] = (val & 0x0f) << 1; 1458 1472 fUpdateStream = true; 1459 1473 break; … … 1461 1475 case 0x22: 1462 1476 /* Translate from old style master volume (L/R). */ 1463 pThis->mixer_regs[0x30] = val & 0xff;1464 pThis->mixer_regs[0x31] = val << 4;1477 pThis->mixer_regs[0x30] = (val & 0xf0) >> 3; 1478 pThis->mixer_regs[0x31] = (val & 0x0f) << 1; 1465 1479 fUpdateMaster = true; 1466 1480 break; 1467 1481 1468 case 0x30: 1469 /* Translate to old style master volume (L). */ 1470 pThis->mixer_regs[0x22] = (pThis->mixer_regs[0x22] & 0x0f) | val; 1482 case 0x26: 1483 /* Translate from old style MIDI volume (L/R). */ 1484 pThis->mixer_regs[0x34] = (val & 0xf0) >> 3; 1485 pThis->mixer_regs[0x35] = (val & 0x0f) << 1; 1486 break; 1487 1488 case 0x28: 1489 /* Translate from old style CD volume (L/R). */ 1490 pThis->mixer_regs[0x36] = (val & 0xf0) >> 3; 1491 pThis->mixer_regs[0x37] = (val & 0x0f) << 1; 1492 break; 1493 1494 case 0x2E: 1495 /* Translate from old style line volume (L/R). */ 1496 pThis->mixer_regs[0x38] = (val & 0xf0) >> 3; 1497 pThis->mixer_regs[0x39] = (val & 0x0f) << 1; 1498 break; 1499 1500 case 0x30: /* Translate to old style master volume (L). */ 1501 sb16ConvVolumeL(pThis, 0x22, val); 1471 1502 fUpdateMaster = true; 1472 1503 break; 1473 1504 1474 case 0x31: 1475 /* Translate to old style master volume (R). */ 1476 pThis->mixer_regs[0x22] = (pThis->mixer_regs[0x22] & 0xf0) | (val >> 4); 1505 case 0x31: /* Translate to old style master volume (R). */ 1506 sb16ConvVolumeR(pThis, 0x22, val); 1477 1507 fUpdateMaster = true; 1478 1508 break; 1479 1509 1480 case 0x32: 1481 /* Translate to old style stream volume (L). */ 1482 pThis->mixer_regs[0x04] = (pThis->mixer_regs[0x04] & 0x0f) | val; 1510 case 0x32: /* Translate to old style voice volume (L). */ 1511 sb16ConvVolumeL(pThis, 0x04, val); 1483 1512 fUpdateStream = true; 1484 1513 break; 1485 1514 1486 case 0x33: 1487 /* Translate to old style stream volume (R). */ 1488 pThis->mixer_regs[0x04] = (pThis->mixer_regs[0x04] & 0xf0) | (val >> 4); 1515 case 0x33: /* Translate to old style voice volume (R). */ 1516 sb16ConvVolumeR(pThis, 0x04, val); 1489 1517 fUpdateStream = true; 1518 break; 1519 1520 case 0x34: /* Translate to old style MIDI volume (L). */ 1521 sb16ConvVolumeL(pThis, 0x26, val); 1522 break; 1523 1524 case 0x35: /* Translate to old style MIDI volume (R). */ 1525 sb16ConvVolumeR(pThis, 0x26, val); 1526 break; 1527 1528 case 0x36: /* Translate to old style CD volume (L). */ 1529 sb16ConvVolumeL(pThis, 0x28, val); 1530 break; 1531 1532 case 0x37: /* Translate to old style CD volume (R). */ 1533 sb16ConvVolumeR(pThis, 0x28, val); 1534 break; 1535 1536 case 0x38: /* Translate to old style line volume (L). */ 1537 sb16ConvVolumeL(pThis, 0x2E, val); 1538 break; 1539 1540 case 0x39: /* Translate to old style line volume (R). */ 1541 sb16ConvVolumeR(pThis, 0x2E, val); 1490 1542 break; 1491 1543
Note:
See TracChangeset
for help on using the changeset viewer.