2 NEC-HE PC Engine Emulator 'ePCEngine'
3 SHARP X1twin Emulator 'eX1twin'
5 Origin : Ootake (joypad/cdrom)
7 : MESS (vdc/vce/vpc/cdrom)
8 Author : Takeda.Toshiya
10 Author : Kyuma.Ohta <whatisthis.sowhat _at_ gmail.com>
11 Date : 2019.02.09- Split from pce.cpp
13 [ PC-Engine around ADPCM]
20 #include "../msm5205.h"
21 #include "../scsi_host.h"
22 #include "../scsi_cdrom.h"
27 #define ADPCM_REMAIN_READ_BUF 0x80
28 #define ADPCM_REMAIN_WRITE_BUF 0x04
29 #define ADPCM_PLAY_FLAG 0x08
30 #define ADPCM_STOP_FLAG 0x01
32 #define EVENT_CLEAR_ACK 1
33 #define EVENT_SET_ACK 2
34 #define EVENT_FADE_IN 3
35 #define EVENT_FADE_OUT 4
37 void ADPCM::initialize()
39 adpcm_clock_divider = 1; // OK?
47 memset(ram, 0x00, sizeof(ram));
54 read_ptr = write_ptr = 0;
55 read_buf = write_buf = 0;
58 play_in_progress = false;
73 if(event_fader != -1) {
74 cancel_event(this, event_fader);
78 cancel_event(this, event_ack);
82 reg_0c |= ADPCM_STOP_FLAG;
83 reg_0c &= ~ADPCM_PLAY_FLAG;
85 //d_msm->change_clock_w((ADPCM_CLOCK / 6) / adpcm_clock_divider); // From mednafen 1.22.1
87 d_msm->set_volume((int)adpcm_volume);
88 //memset(ram, 0x00, sizeof(ram));
91 uint32_t ADPCM::read_signal(int ch)
96 reg_0c |= ADPCM_REMAIN_READ_BUF;
99 reg_0c &= ~ADPCM_REMAIN_READ_BUF;
103 reg_0c &= ~ADPCM_REMAIN_READ_BUF;
104 uint8_t _d = ram[read_ptr & 0xffff];
105 read_ptr = (read_ptr + 1) & 0xffff;
109 case SIG_ADPCM_DMACTRL:
112 case SIG_ADPCM_PLAY_IN_PROGRESS:
113 return ((play_in_progress) ? 0xffffffff : 0);
115 case SIG_ADPCM_STATUS_REG:
117 uint8_t data = reg_0c;
118 // Hack from Ootake v2.83.
119 if((play_in_progress)) {
129 case SIG_ADPCM_CMD_REG:
136 void ADPCM::reset_adpcm()
139 // reset ADPCM hardware
140 read_ptr = write_ptr = 0;
141 read_buf = write_buf = 0;
142 msm_ptr = half_addr = 0;
149 out_debug_log(_T("RESET ADPCM\n"));
150 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0x00, 0xffffffff);
151 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0x00, 0xffffffff);
155 set_dma_status(false);
156 adpcm_repeat = false;
157 //adpcm_stream = false;
160 void ADPCM::do_play()
162 reg_0c &= ~ADPCM_STOP_FLAG;
163 reg_0c |= ADPCM_PLAY_FLAG;
164 play_in_progress = true;
165 adpcm_paused = false;
166 adpcm_stopped = false;
169 void ADPCM::do_pause(bool pause)
171 //if(!(play_in_progress)) return;
173 reg_0c |= ADPCM_STOP_FLAG;
174 reg_0c &= ~ADPCM_PLAY_FLAG;
175 msm_last_cmd &= ~0x60;
178 out_debug_log(_T("ADPCM PAUSE PLAY PTR=%04x\n"), msm_ptr);
181 adpcm_paused = false;
183 reg_0c &= ~ADPCM_STOP_FLAG;
184 reg_0c |= ADPCM_PLAY_FLAG;
186 out_debug_log(_T("ADPCM UNPAUSE PLAY PTR=%04x\n"), msm_ptr);
190 void ADPCM::do_stop(bool do_irq)
192 reg_0c |= ADPCM_STOP_FLAG;
193 reg_0c &= ~ADPCM_PLAY_FLAG;
195 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0xffffffff, 0xffffffff);
197 msm_last_cmd &= ~0x60;
198 play_in_progress = false;
199 //set_dma_status(false);
200 out_debug_log(_T("ADPCM STOP PLAY PTR=%04x IRQ=%s\n"), msm_ptr, (do_irq) ? _T("YES") : _T("NO"));
204 void ADPCM::set_dma_status(bool flag)
207 //d_pce->write_signal(SIG_PCE_ADPCM_DMA, (flag) ? 0xffffffff : 0x00000000, 0xffffffff);
210 void ADPCM::write_signal(int ch, uint32_t data, uint32_t mask)
212 bool flag = ((data & mask) != 0);
213 //if(ch != SIG_ADPCM_VCLK) out_debug_log(_T("WRITE_SIGNAL SIG=%d DATA=%04x MASK=%04x\n"), ch, data, mask);
215 case SIG_ADPCM_DMACTRL:
216 if((data & 0x03) != 0) {
217 set_dma_status(true);
222 case SIG_ADPCM_PAUSE:
225 case SIG_ADPCM_DMA_ENABLED:
226 set_dma_status(flag);
227 if((flag)/* && (flag != dma_enabled)*/) {
228 reg_0c |= ADPCM_REMAIN_WRITE_BUF;
229 if(d_pce->read_signal(SIG_PCE_CDROM_DATA_IN) != 0) {
230 do_dma(d_pce->read_signal(SIG_PCE_CDROM_RAW_DATA));
231 out_debug_log(_T("Start DMA port $0B/ALREADY READ DATA ADPCM_WRITE_PTR=%04x ADPCM_READ_PTR=%04x MSM_START_ADDR=%04x\n"),write_ptr, read_ptr, msm_ptr);
233 out_debug_log(_T("Start DMA port $0B/WAIT FOR DATA\n"));
237 case SIG_ADPCM_RESET:
242 case SIG_ADPCM_COMMAND: // REG $0D
245 case SIG_ADPCM_WRITE_DMA_DATA:
248 case SIG_ADPCM_DO_DMA_TRANSFER:
249 if((play_in_progress) && !(adpcm_paused) && ((write_ptr & 0xffff) >= (msm_ptr & 0xffff))) {
250 // now streaming, wait dma not to overwrite buffer before it is played
251 reg_0b = 0x00;// From Ootake v2.38.
252 set_dma_status(false); // DON'T MODIFY PCE's DMA STATUS (HACK by K.O 20190212)
254 set_dma_status(true);
255 do_dma(d_pce->read_signal(SIG_PCE_CDROM_RAW_DATA));
258 case SIG_ADPCM_ADDR_HI: // REG $09
259 if((msm_last_cmd & 0x80) != 0) {
263 if((msm_last_cmd & 0x10) != 0) {
264 adpcm_length = (uint32_t)(addr_reg.w);
265 msm_length = adpcm_length;
266 out_debug_log(_T("SET ADDRESS REGISTER HIGH ; UPDATE LENGTH TO %04x\n"), adpcm_length);
269 case SIG_ADPCM_ADDR_LO: // REG $08
270 if((msm_last_cmd & 0x80) != 0) {
274 if((msm_last_cmd & 0x10) != 0) {
275 adpcm_length = (uint32_t)(addr_reg.w);
276 msm_length = adpcm_length;
277 out_debug_log(_T("SET ADDRESS REGISTER LOW ; UPDATE LENGTH TO %04x\n"), adpcm_length);
285 reg_0c |= ADPCM_REMAIN_WRITE_BUF;
288 reg_0c &= ~ADPCM_REMAIN_WRITE_BUF;
291 reg_0c &= ~ADPCM_REMAIN_WRITE_BUF;
292 ram[write_ptr & 0xffff] = data;
293 write_ptr = (write_ptr + 1) & 0xffff;
297 case SIG_ADPCM_FADE_IN:
300 case SIG_ADPCM_FADE_OUT:
303 case SIG_ADPCM_SET_DIVIDER:
304 adpcm_clock_divider = 0x10 - (data & 0x0f);
305 d_msm->change_clock_w((ADPCM_CLOCK / 6) / adpcm_clock_divider);
307 case SIG_ADPCM_CLEAR_ACK:
308 reg_0b &= 0xfc; // Clear status register.
314 void ADPCM::do_cmd(uint8_t cmd)
317 //out_debug_log(_T("ADPCM CMD=%02x\n"), cmd);
318 if(((cmd & 0x80) != 0) /*&& ((msm_last_cmd & 0x80) == 0)*/) {
321 msm_init(); // SAMPLE = 0x800, SSIS=0
322 out_debug_log(_T("ADPCM CMD RESET\n"));
327 if(((cmd & 0x02) != 0) /*&& ((msm_last_cmd & 0x02) == 0)*/) {
328 // ADPCM set write address
329 write_ptr = (uint32_t)(addr_reg.w);
330 write_buf = ((cmd & 0x01) == 0) ? 1 : 0;
331 written_size = 0; // OK?
332 //write_ptr = (write_ptr - write_buf) & 0xffff;
333 // It's ugly... (;_;)
334 uint32_t _clk = (ADPCM_CLOCK / 6) / adpcm_clock_divider;
335 if(((read_ptr & 0xffff) >= 0x4000) &&
336 ((write_ptr & 0xffff) == 0x0000) &&
337 (adpcm_length != 0x8000) &&
338 (adpcm_length != 0xffff) &&
340 adpcm_length = adpcm_length & 0x7fff;
342 msm_length = adpcm_length;
343 out_debug_log(_T("ADPCM SET WRITE ADDRESS ADDR=%04x BUF=%01x \n"), write_ptr, write_buf);
345 if(((cmd & 0x08) != 0) /*&& ((msm_last_cmd & 0x08) == 0)*/) {
346 // ADPCM set read address
347 read_ptr = (uint32_t)(addr_reg.w);
348 read_buf = ((cmd & 0x04) == 0) ? 2 : 1;
349 //read_ptr = ((cmd & 0x04) == 0) ? ((read_ptr - 1) & 0xffff) : read_ptr;
351 out_debug_log(_T("ADPCM SET READ ADDRESS ADDR=%04x BUF=%01x \n"), read_ptr, read_buf);
353 if(((cmd & 0x10) != 0) /*&& ((msm_last_cmd & 0x10) == 0)*/){
355 //d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0x00, 0xffffffff);
356 adpcm_stopped = false;
357 adpcm_length = (uint32_t)(addr_reg.w);
358 msm_length = adpcm_length;
359 out_debug_log(_T("ADPCM SET LENGTH TO %04x\n"), adpcm_length);
361 bool req_play = false;
362 bool req_play_0 = ((cmd & 0x40) != 0) ? true : false;
363 adpcm_repeat = ((cmd & 0x20) != 0) ? true : false;
365 if((play_in_progress) && !(adpcm_paused) && !(adpcm_repeat)) {
368 if(!(play_in_progress) && !(adpcm_paused) && (adpcm_repeat)) {
369 d_msm->change_clock_w((ADPCM_CLOCK / 6) / adpcm_clock_divider); // From mednafen 1.22.1
370 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0x00, 0xffffffff);
373 msm_init(); // SAMPLE = 0x800, SSI=0
376 if((play_in_progress) && !(adpcm_paused)) {
377 if(req_play) { // Update only
378 msm_ptr = read_ptr & 0xffff;
380 if(((adpcm_length & 0xffff) >= 0x8000) && ((adpcm_length & 0xffff) <= 0x80ff)) {
381 half_addr = (read_ptr + 0x85) & 0xffff;
383 half_addr = (read_ptr + (adpcm_length >> 1)) & 0xffff;
388 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0x00, 0xffffffff);
389 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0xffffffff, 0xffffffff);
390 adpcm_stream = false;
391 adpcm_repeat = false;
393 } else { // Not playing
395 msm_ptr = read_ptr & 0xffff;
396 half_addr = (msm_ptr + (adpcm_length / 2)) & 0xffff;
402 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0x00, 0xffffffff);
403 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0xffffffff, 0xffffffff);
404 adpcm_stream = false;
405 adpcm_repeat = false;
409 if((req_play) && !(play_in_progress)) {
410 msm_ptr = read_ptr & 0xffff;
411 half_addr = (msm_ptr + ((adpcm_length + 1) / 2)) & 0xffff;
412 if(((adpcm_length & 0xffff) >= 0x8000) && ((adpcm_length & 0xffff) <= 0x80ff)) {
413 half_addr = (read_ptr + 0x85) & 0xffff;
418 out_debug_log(_T("ADPCM START PLAY(%s) START=%04x LENGTH=%04x HALF=%04x\n"), (dma_enabled) ? _T("DMA") : _T("PIO"), msm_ptr, adpcm_length, half_addr);
419 } else if((req_play) /*&& (cmd != msm_last_cmd)*/){
420 msm_ptr = read_ptr & 0xffff;
421 half_addr = (msm_ptr + (adpcm_length / 2)) & 0xffff;
422 if(((adpcm_length & 0xffff) >= 0x8000) && ((adpcm_length & 0xffff) <= 0x80ff)) {
423 half_addr = (read_ptr + 0x85) & 0xffff;
425 half_addr = (read_ptr + (adpcm_length >> 1)) & 0xffff;
427 out_debug_log(_T("ADPCM UPDATE HALF ADDRESS HALF=%04x LENGTH=%04x\n"), half_addr, adpcm_length);
428 } else /*if(cmd != msm_last_cmd)*/ { // !req_play
429 adpcm_repeat = false;
430 if(play_in_progress && !(adpcm_paused)) {
431 //adpcm_stopped = true;
432 //play_in_progress = false;
433 //d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0x00, 0xffffffff);
434 //d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0xffffffff, 0xffffffff);
437 //adpcm_stopped = true;
438 out_debug_log(_T("ADPCM STATUS UPDATE PLAY=%s\n"), (play_in_progress) ? _T("YES") : _T("NO"));
440 // used by Buster Bros to cancel an in-flight sample
441 // if repeat flag (bit5) is high, ADPCM should be fully played (from Ootake)
442 //if(!(req_play) && !(adpcm_repeat)) {
443 // d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0x00, 0xffffffff);
444 // d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0xffffffff, 0xffffffff);
446 // d_msm->reset_w(1);
453 void ADPCM::msm_init()
460 void ADPCM::do_vclk(bool flag)
464 if((play_in_progress) && !(adpcm_paused) && (adpcm_length > 0)) {
465 if(!((adpcm_length == 1) && ((msm_nibble & 1) == 0))) {
466 msm_data = (msm_nibble != 0) ? (ram[msm_ptr & 0xffff] & 0x0f) : ((ram[msm_ptr & 0xffff] & 0xf0) >> 4);
468 d_msm->data_w(msm_data);
471 if((msm_nibble == 0) && (play_in_progress) && !(adpcm_paused)) {
472 if((written_size > 0) /*&& !(adpcm_stopped)*/) written_size--;
473 // Increment pointers.
475 if((adpcm_length == 0) && ((msm_last_cmd & 0x10) == 0)){
476 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0xffffffff, 0xffffffff);
477 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0x00, 0xffffffff);
478 if((msm_last_cmd & 0x40) != 0) {
482 adpcm_repeat = false;
483 adpcm_stream = false;
485 if(adpcm_length > 0) adpcm_length--;
486 msm_ptr = (msm_ptr + 1) & 0xffff;
488 if((adpcm_repeat) && (msm_length >= 0x8000) && (msm_length <= 0x80ff)) {
489 if(msm_ptr == (half_addr & 0xffff)) {
490 half_addr = (half_addr + 0x85) & 0xffff;
491 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0x00, 0xffffffff);
492 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0xffffffff, 0xffffffff);
494 //out_debug_log(_T("PLAY PASSED TO THE HALF ADDR=%08x SIZE=%04x LENGTH=%04x\n"), msm_ptr, written_size, msm_length);
495 } else if(msm_length < 0x7fff) {
496 if(msm_ptr == (half_addr & 0xffff)) {
497 half_addr = (half_addr + (msm_length & 0xffff) - 1024) & 0xffff;
498 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0x00, 0xffffffff);
499 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0xffffffff, 0xffffffff);
501 //out_debug_log(_T("PLAY PASSED TO THE HALF ADDR=%08x SIZE=%04x LENGTH=%04x\n"), msm_ptr, written_size, msm_length);
503 if((msm_ptr == 0x8000) || (msm_ptr == 0x0000)) {
504 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0x00, 0xffffffff);
505 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0xffffffff, 0xffffffff);
511 if((adpcm_length == 0)) {
512 if((msm_last_cmd & 0x10) == 0) {
513 if(!(adpcm_stopped)) {
514 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0x0, 0xffffffff);
515 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0xffffffff, 0xffffffff);
516 if((msm_last_cmd & 0x40) != 0) {
520 out_debug_log(_T("PLAY REACHED TO THE END ADDR=%08x SIZE=%04x LENGTH=%04x\n"), msm_ptr, written_size, adpcm_length);
521 adpcm_stopped = true;
523 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0x0, 0xffffffff);
526 } else if((msm_ptr & 0xffff) == (half_addr & 0xffff)) {
527 //if(!(adpcm_stopped)) {
528 if((msm_last_cmd & 0x10) == 0) {
529 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0xffffffff, 0xffffffff);
530 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0x0, 0xffffffff);
531 out_debug_log(_T("PLAY PASSED TO THE HALF ADDR=%08x SIZE=%04x LENGTH=%04x\n"), msm_ptr, written_size, adpcm_length);
536 else if((!((dma_enabled) && (adpcm_length >= 0x8000) && (adpcm_length <= 0x80ff)) &&
537 !(adpcm_length < 0x7fff)) &&
538 (((msm_ptr & 0xffff) == 0x8000) || ((msm_ptr & 0xffff) == 0x0000))) {
539 // 20181213 K.O: Porting from Ootake v2.83.Thanks to developers of Ootake.
540 //set_cdrom_irq_line(PCE_CD_IRQ_SAMPLE_FULL_PLAY, CLEAR_LINE);
541 if((msm_last_cmd & 0x10) == 0) {
542 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0xffffffff, 0xffffffff);
543 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0x0, 0xffffffff);
545 out_debug_log(_T("SPECIAL HALF ADDRESS MSM_ADDR=%08x\n"), msm_ptr);
548 if(!(adpcm_stopped)) {
549 msm_ptr = (msm_ptr + 1) & 0xffff;
552 if((msm_last_cmd & 0x10) == 0) {
553 if(adpcm_length > 0) {
556 if(!(adpcm_stopped)) {
557 if((msm_last_cmd & 0x10) == 0) {
558 d_pce->write_signal(SIG_PCE_ADPCM_HALF, 0x0, 0xffffffff);
559 d_pce->write_signal(SIG_PCE_ADPCM_FULL, 0xffffffff, 0xffffffff);
560 if((msm_last_cmd & 0x40) != 0) {
563 out_debug_log(_T("PLAY REACHED TO THE END2 ADDR=%08x SIZE=%04x LENGTH=%04x\n"), msm_ptr, written_size, adpcm_length);
564 adpcm_stopped = true;
573 if((dma_enabled) /*&& (written_size <= 0) && !(adpcm_stopped)*/) {
574 if(d_pce->read_signal(SIG_PCE_CDROM_DATA_IN) != 0) {
575 //do_pause(false); // Unpause if paused && data in.
576 do_dma(d_pce->read_signal(SIG_PCE_CDROM_RAW_DATA));
582 } else { // nibble = 1
588 bool ADPCM::do_dma(uint8_t data)
590 ram[write_ptr & 0xffff] = data;
591 write_ptr = (write_ptr + 1) & 0xffff;
592 written_size = (written_size + 1) & 0xffff;;
595 reg_0c &= ~ADPCM_REMAIN_WRITE_BUF;
600 void ADPCM::set_ack(int clocks)
602 if(event_ack != -1) cancel_event(this, event_ack);
605 d_pce->write_signal(SIG_PCE_CDROM_SET_ACK, 0xff, 0xff);
607 double us = (((double)clocks) * 1.0e6) / ((double)CPU_CLOCKS);
608 register_event(this, EVENT_SET_ACK, us, false, &event_ack);
612 void ADPCM::clear_ack(int clocks)
614 if(event_ack != -1) cancel_event(this, event_ack);
617 d_pce->write_signal(SIG_PCE_CDROM_CLEAR_ACK, 0xff, 0xff);
619 double us = (((double)clocks) * 1.0e6) / ((double)CPU_CLOCKS);
620 register_event(this, EVENT_CLEAR_ACK, us, false, &event_ack);
624 void ADPCM::fade_in(int usec)
626 if(event_fader != -1) {
627 cancel_event(this, event_fader);
629 register_event(this, EVENT_FADE_IN, (double)usec, true, &event_fader);
631 d_msm->set_volume((int)adpcm_volume);
634 void ADPCM::fade_out(int usec)
636 if(event_fader != -1) {
637 cancel_event(this, event_fader);
639 register_event(this, EVENT_FADE_OUT, (double)usec, true, &event_fader);
640 adpcm_volume = 100.0;
641 d_msm->set_volume((int)adpcm_volume);
644 void ADPCM::event_callback(int id, int err)
647 case EVENT_CLEAR_ACK:
649 d_pce->write_signal(SIG_PCE_CDROM_CLEAR_ACK, 0xff, 0xff);
653 d_pce->write_signal(SIG_PCE_CDROM_SET_ACK, 0xff, 0xff);
656 if((adpcm_volume += 0.1) >= 100.0) {
657 cancel_event(this, event_fader);
659 adpcm_volume = 100.0;
661 d_msm->set_volume((int)adpcm_volume);
664 if((adpcm_volume -= 0.1) <= 0.0) {
665 cancel_event(this, event_fader);
669 d_msm->set_volume((int)adpcm_volume);
674 void ADPCM::mix(int32_t* buffer, int cnt)
676 d_msm->mix(buffer, cnt);
679 #define STATE_VERSION 7
681 bool ADPCM::process_state(FILEIO* state_fio, bool loading)
683 if(!state_fio->StateCheckUint32(STATE_VERSION)) {
686 if(!state_fio->StateCheckInt32(this_device_id)) {
689 state_fio->StateValue(addr_reg);
690 state_fio->StateValue(reg_0b);
691 state_fio->StateValue(reg_0c);
692 state_fio->StateValue(msm_last_cmd);
694 state_fio->StateBuffer(ram, sizeof(ram), 1);
696 state_fio->StateValue(read_ptr);
697 state_fio->StateValue(read_buf);
698 state_fio->StateValue(write_ptr);
699 state_fio->StateValue(write_buf);
701 state_fio->StateValue(msm_data);
702 state_fio->StateValue(msm_ptr);
703 state_fio->StateValue(msm_nibble);
704 state_fio->StateValue(msm_length);
705 state_fio->StateValue(half_addr);
706 state_fio->StateValue(adpcm_length);
708 state_fio->StateValue(written_size);
709 state_fio->StateValue(dma_enabled);
710 state_fio->StateValue(play_in_progress);
711 state_fio->StateValue(adpcm_paused);
712 state_fio->StateValue(adpcm_stream);
713 state_fio->StateValue(adpcm_repeat);
714 state_fio->StateValue(adpcm_stopped);
715 state_fio->StateValue(adpcm_volume);
716 state_fio->StateValue(event_fader);
717 state_fio->StateValue(event_ack);