Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tools/PsfPlayer/Source/Iop_PsfSubSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
using namespace Iop;

#define FRAMES_PER_SEC (60)
#define SAMPLING_RATE (44100)
#define PS1_SAMPLING_RATE (44100)
#define PS2_SAMPLING_RATE (48000)

CPsfSubSystem::CPsfSubSystem(bool ps2Mode)
: m_iop(ps2Mode)
Expand All @@ -20,6 +21,10 @@ CPsfSubSystem::CPsfSubSystem(bool ps2Mode)
m_frameTicks = (cpuFreq / FRAMES_PER_SEC);
m_spuUpdateTicks = (cpuFreq / 1000);

SAMPLING_RATE = ps2Mode ? PS2_SAMPLING_RATE : PS1_SAMPLING_RATE;
SAMPLE_COUNT = ps2Mode ? PS2_SAMPLE_COUNT : PS1_SAMPLE_COUNT;
BLOCK_SIZE = ps2Mode ? PS2_BLOCK_SIZE : PS1_BLOCK_SIZE;

Reset();
}

Expand Down
14 changes: 11 additions & 3 deletions tools/PsfPlayer/Source/Iop_PsfSubSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,22 @@ namespace Iop
int m_frameCounter;
int m_spuUpdateCounter;

int SAMPLE_COUNT;
int BLOCK_SIZE;
int SAMPLING_RATE;

enum
{
SAMPLE_COUNT = 44,
BLOCK_SIZE = SAMPLE_COUNT * 2,
PS1_SAMPLE_COUNT = 44,
PS1_BLOCK_SIZE = PS1_SAMPLE_COUNT * 2,

PS2_SAMPLE_COUNT = 48,
PS2_BLOCK_SIZE = PS2_SAMPLE_COUNT * 2,

BLOCK_COUNT = 10,
};

int16 m_samples[BLOCK_SIZE * BLOCK_COUNT];
int16 m_samples[PS2_BLOCK_SIZE * BLOCK_COUNT];
int m_currentBlock;
};

Expand Down