CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/Core/HLE/sceAtrac.h
Views: 1401
// Copyright (c) 2012- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#pragma once1819#include "sceAudiocodec.h"2021class PointerWrap;2223void Register_sceAtrac3plus();24void __AtracInit();25void __AtracDoState(PointerWrap &p);26void __AtracShutdown();27void __AtracLoadModule(int version, u32 crc);2829enum AtracStatus : u8 {30ATRAC_STATUS_NO_DATA = 1,31ATRAC_STATUS_ALL_DATA_LOADED = 2,32ATRAC_STATUS_HALFWAY_BUFFER = 3,33ATRAC_STATUS_STREAMED_WITHOUT_LOOP = 4,34ATRAC_STATUS_STREAMED_LOOP_FROM_END = 5,35// This means there's additional audio after the loop.36// i.e. ~~before loop~~ [ ~~this part loops~~ ] ~~after loop~~37// The "fork in the road" means a second buffer is needed for the second path.38ATRAC_STATUS_STREAMED_LOOP_WITH_TRAILER = 6,39ATRAC_STATUS_LOW_LEVEL = 8,40ATRAC_STATUS_FOR_SCESAS = 16,4142ATRAC_STATUS_STREAMED_MASK = 4,43};4445#if COMMON_LITTLE_ENDIAN46typedef AtracStatus AtracStatus_le;47#else48typedef swap_struct_t<AtracStatus, swap_32_t<AtracStatus> > AtracStatus_le;49#endif5051struct SceAtracIdInfo {52u32_le decodePos; // 053u32_le endSample; // 454u32_le loopStart; // 855u32_le loopEnd; // 1256s32_le samplesPerChan; // 1657char numFrame; // 2058// 2: all the stream data on the buffer59// 6: looping -> second buffer needed60AtracStatus_le state; // 2161char unk22;62char numChan; // 2363u16_le sampleSize; // 2464u16_le codec; // 2665u32_le dataOff; // 2866u32_le curOff; // 3267u32_le dataEnd; // 3668s32_le loopNum; // 4069u32_le streamDataByte; // 4470u32_le unk48;71u32_le unk52;72u32_le buffer; // 5673u32_le secondBuffer; // 6074u32_le bufferByte; // 6475u32_le secondBufferByte; // 6876// make sure the size is 12877u8 unk[56];78};7980struct SceAtracContext {81// size 12882SceAudiocodecCodec codec;83// size 12884SceAtracIdInfo info;85};8687// External interface used by sceSas.88u32 AtracSasAddStreamData(int atracID, u32 bufPtr, u32 bytesToAdd);89u32 AtracSasDecodeData(int atracID, u8* outbuf, u32 outbufPtr, u32 *SamplesNum, u32* finish, int *remains);90int AtracSasGetIDByContext(u32 contextAddr);919293