~ppsspp/ppsspp/ppsspp_1.3.0

« back to all changes in this revision

Viewing changes to Core/HLE/sceAtrac.h

  • Committer: Sérgio Benjamim
  • Date: 2017-01-02 00:12:05 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20170102001205-cxbta9za203nmjwm
1.3.0 source (from ppsspp_1.3.0-r160.p5.l1762.a165.t83~56~ubuntu16.04.1.tar.xz).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 2012- PPSSPP Project.
 
2
 
 
3
// This program is free software: you can redistribute it and/or modify
 
4
// it under the terms of the GNU General Public License as published by
 
5
// the Free Software Foundation, version 2.0 or later versions.
 
6
 
 
7
// This program is distributed in the hope that it will be useful,
 
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
// GNU General Public License 2.0 for more details.
 
11
 
 
12
// A copy of the GPL 2.0 should have been included with the program.
 
13
// If not, see http://www.gnu.org/licenses/
 
14
 
 
15
// Official git repository and contact information can be found at
 
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
 
17
 
 
18
#pragma once
 
19
 
 
20
#include "sceAudiocodec.h"
 
21
 
 
22
class PointerWrap;
 
23
 
 
24
void Register_sceAtrac3plus();
 
25
void __AtracInit();
 
26
void __AtracDoState(PointerWrap &p);
 
27
void __AtracShutdown();
 
28
 
 
29
enum AtracStatus : u8 {
 
30
        ATRAC_STATUS_NO_DATA = 1,
 
31
        ATRAC_STATUS_ALL_DATA_LOADED = 2,
 
32
        ATRAC_STATUS_HALFWAY_BUFFER = 3,
 
33
        ATRAC_STATUS_STREAMED_WITHOUT_LOOP = 4,
 
34
        ATRAC_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.
 
38
        ATRAC_STATUS_STREAMED_LOOP_WITH_TRAILER = 6,
 
39
        ATRAC_STATUS_LOW_LEVEL = 8,
 
40
        ATRAC_STATUS_FOR_SCESAS = 16,
 
41
 
 
42
        ATRAC_STATUS_STREAMED_MASK = 4,
 
43
};
 
44
 
 
45
#if COMMON_LITTLE_ENDIAN
 
46
typedef AtracStatus AtracStatus_le;
 
47
#else
 
48
typedef swap_struct_t<AtracStatus, swap_32_t<AtracStatus> > AtracStatus_le;
 
49
#endif
 
50
 
 
51
typedef struct
 
52
{
 
53
    u32_le decodePos; // 0
 
54
    u32_le endSample; // 4
 
55
    u32_le loopStart; // 8
 
56
    u32_le loopEnd; // 12
 
57
    s32_le samplesPerChan; // 16
 
58
    char numFrame; // 20
 
59
    // 2: all the stream data on the buffer
 
60
    // 6: looping -> second buffer needed
 
61
    AtracStatus_le state; // 21
 
62
    char unk22;
 
63
    char numChan; // 23
 
64
    u16_le sampleSize; // 24
 
65
    u16_le codec; // 26
 
66
    u32_le dataOff; // 28
 
67
    u32_le curOff; // 32
 
68
    u32_le dataEnd; // 36
 
69
    s32_le loopNum; // 40
 
70
    u32_le streamDataByte; // 44
 
71
    u32_le unk48;
 
72
    u32_le unk52;
 
73
    u32_le buffer; // 56
 
74
    u32_le secondBuffer; // 60
 
75
    u32_le bufferByte; // 64
 
76
    u32_le secondBufferByte; // 68
 
77
    // make sure the size is 128
 
78
        u8 unk[56];
 
79
} SceAtracIdInfo;
 
80
 
 
81
typedef struct
 
82
{
 
83
        // size 128
 
84
    SceAudiocodecCodec codec;
 
85
        // size 128
 
86
    SceAtracIdInfo info;
 
87
} SceAtracId;
 
88
 
 
89
// provide some decoder interface
 
90
 
 
91
u32 _AtracAddStreamData(int atracID, u32 bufPtr, u32 bytesToAdd);
 
92
u32 _AtracDecodeData(int atracID, u8* outbuf, u32 outbufPtr, u32 *SamplesNum, u32* finish, int *remains);
 
93
int _AtracGetIDByContext(u32 contextAddr);
 
 
b'\\ No newline at end of file'