Add dei ports 0x2 and 0x4 to audio devices
This commit is contained in:
parent
9c8ae94825
commit
c26c27a730
|
@ -303,3 +303,13 @@ audio_start(int idx, Uint8 *d, Uxn *u)
|
|||
note_off(&channel[idx], duration);
|
||||
}
|
||||
}
|
||||
|
||||
Uint8
|
||||
audio_get_vu(int instance) {
|
||||
return channel[instance].sample.env.vol * 255.0f;
|
||||
}
|
||||
|
||||
Uint16
|
||||
audio_get_position(int instance) {
|
||||
return channel[instance].sample.pos;
|
||||
}
|
||||
|
|
|
@ -70,10 +70,14 @@ clamp(int v, int min, int max)
|
|||
static Uint8
|
||||
audio_dei(int instance, Uint8 *d, Uint8 port)
|
||||
{
|
||||
/* TODO: get envelope */
|
||||
switch(port) {
|
||||
case 0x0:
|
||||
case 0x2:
|
||||
return audio_get_position(instance) >> 8;
|
||||
case 0x3:
|
||||
return audio_get_position(instance);
|
||||
case 0x4:
|
||||
return audio_get_vu(instance);
|
||||
case 0x0:
|
||||
case 0x8:
|
||||
case 0xa:
|
||||
case 0xc: return PEEK2(d + port);
|
||||
|
|
Loading…
Reference in New Issue