-void PSUB::save_state(FILEIO* state_fio)
-{
- state_fio->FputUint32(STATE_VERSION);
- state_fio->FputInt32(this_device_id);
-
- state_fio->FputBool(play);
- state_fio->FputBool(rec);
- state_fio->FputBool(is_wav);
- state_fio->FputBool(is_p6t);
- state_fio->Fwrite(rec_file_path, sizeof(rec_file_path), 1);
- if(rec && fio->IsOpened()) {
- int length_tmp = (int)fio->Ftell();
- fio->Fseek(0, FILEIO_SEEK_SET);
- state_fio->FputInt32(length_tmp);
- while(length_tmp != 0) {
- uint8 buffer_tmp[1024];
- int length_rw = min(length_tmp, (int)sizeof(buffer_tmp));
- fio->Fread(buffer_tmp, length_rw, 1);
- state_fio->Fwrite(buffer_tmp, length_rw, 1);
- length_tmp -= length_rw;
- }
- } else {
- state_fio->FputInt32(0);
- }
- state_fio->FputInt32(CasIntFlag);
- state_fio->FputInt32(CasIndex);
- state_fio->FputInt32(CasRecv);
- state_fio->FputInt32(CasMode);
- state_fio->FputInt32(CasBaud);
- state_fio->FputInt32(FileBaud);
- state_fio->Fwrite(CasData, sizeof(CasData), 1);
- state_fio->FputInt32(CasLength);
- state_fio->FputInt32(CasSkipFlag);
- state_fio->FputInt32(kbFlagFunc);
- state_fio->FputInt32(kbFlagGraph);
- state_fio->FputInt32(kbFlagCtrl);
- state_fio->FputInt32(kanaMode);
- state_fio->FputInt32(katakana);
- state_fio->FputInt32(p6key);
- state_fio->FputInt32(stick0);
- state_fio->FputInt32(StrigIntFlag);
- state_fio->FputInt32(StrigEventID);
-}
-
-bool PSUB::load_state(FILEIO* state_fio)