mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
This may be needless paranoia, but I always get nervous about order of
evaluation when there are multiple side-effects on the same variable (in this case the internal state modified by va_arg()) in the same expression. So let's just humor me and do the va_arg() calls one at a time. svn-id: r20970
This commit is contained in:
parent
41e7bb67e4
commit
005861cb14
@ -449,14 +449,19 @@ int AdlibDriver::snd_unkOpcode3(va_list &list) {
|
||||
}
|
||||
|
||||
int AdlibDriver::snd_readByte(va_list &list) {
|
||||
uint8 *ptr = _soundData + READ_LE_UINT16(&_soundData[va_arg(list, int) << 1]) + va_arg(list, int);
|
||||
int a = va_arg(list, int);
|
||||
int b = va_arg(list, int);
|
||||
uint8 *ptr = _soundData + READ_LE_UINT16(&_soundData[a << 1]) + b;
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
int AdlibDriver::snd_writeByte(va_list &list) {
|
||||
uint8 *ptr = _soundData + READ_LE_UINT16(&_soundData[va_arg(list, int) << 1]) + va_arg(list, int);
|
||||
int a = va_arg(list, int);
|
||||
int b = va_arg(list, int);
|
||||
int c = va_arg(list, int);
|
||||
uint8 *ptr = _soundData + READ_LE_UINT16(&_soundData[a << 1]) + b;
|
||||
uint8 oldValue = *ptr;
|
||||
*ptr = (uint8)va_arg(list, int);
|
||||
*ptr = (uint8)c;
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
@ -567,7 +572,7 @@ void AdlibDriver::callbackProcess() {
|
||||
unkOutput1(table);
|
||||
} else {
|
||||
int8 opcode = 0;
|
||||
while (1 && table.dataptr) {
|
||||
while (table.dataptr) {
|
||||
uint16 command = READ_LE_UINT16(table.dataptr);
|
||||
table.dataptr += 2;
|
||||
if (command & 0x0080) {
|
||||
|
Loading…
Reference in New Issue
Block a user