MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / adlib_reg

Function adlib_reg

src/Engine/Adlib/adlplayer.cpp:299–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297*/
298
299void adlib_reg(int i, int v)
300{
301 if (opl[0]==0) return;
302 int v2, i3, v3;
303 i3 = -1;
304 Transpose(i, v, &v2, &i3, &v3);
305
306 OPLWrite(opl[0], 0, i);
307 OPLWrite(opl[0], 1, v);
308 OPLWrite(opl[1], 0, i);
309 if (i >= 0x20 && i <= 0x3f) //no tremolo/vibrato
310 v2 = (v2 & 0x3F);
311 if (i >= 0xE0 && i <= 0xFC)
312 {
313 if ((slot_array[i & 0x1f] & 1) == 1) //wave form
314 v2 = v2 & 0x02;
315 }
316 // if ((i >= 0x60 && i <= 0x7F) && ((slot_array[i & 0x1f] & 1) == 1)) //altered attack/decoy
317 // v2 = v2 ^ 0x20;
318 OPLWrite(opl[1], 1, v2);
319 if (i3 != -1)
320 {
321 OPLWrite(opl[1], 0, i3);
322 OPLWrite(opl[1], 1, v3);
323 }
324}
325
326
327// initialises adlib parameters

Callers 5

adlib_initFunction · 0.85
adlib_set_amplitudeFunction · 0.85
adlib_reset_channelsFunction · 0.85
adlib_play_noteFunction · 0.85

Calls 2

TransposeFunction · 0.85
OPLWriteFunction · 0.85

Tested by

no test coverage detected