Add volume control for the pulse audio backend. Unfortunately that can not be done...
[dolphin.git] / Source / Plugins / Plugin_DSP_LLE / Src / Globals.cpp
blobd58c052cb7196ba8bdeafb67bac333399d0f92e3
1 // Copyright (C) 2003 Dolphin Project.
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.
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.
12 // A copy of the GPL 2.0 should have been included with the program.
13 // If not, see http://www.gnu.org/licenses/
15 // Official SVN repository and contact information can be found at
16 // http://code.google.com/p/dolphin-emu/
18 #include <iostream> // I hope this doesn't break anything
19 #include <stdio.h>
20 #include <stdarg.h>
22 #include "Common.h" // for Common::swap
23 #include "DSPCore.h"
24 #include "Globals.h"
26 // =======================================================================================
27 // For PB address detection
28 // --------------
30 // This will only work on GC, not Wii.
31 u32 RAM_MASK = 0x1FFFFFF;
33 u16 Memory_Read_U16(u32 _uAddress)
35 return Common::swap16(*(u16*)&g_dsp.cpu_ram[_uAddress & RAM_MASK]);
38 u32 Memory_Read_U32(u32 _uAddress)
40 return Common::swap32(*(u32*)&g_dsp.cpu_ram[_uAddress & RAM_MASK]);
43 void* Memory_Get_Pointer(u32 _uAddress)
45 return &g_dsp.cpu_ram[_uAddress & RAM_MASK];
48 #if PROFILE
50 #define PROFILE_MAP_SIZE 0x10000
52 u64 g_profileMap[PROFILE_MAP_SIZE];
53 bool g_profile = false;
55 void ProfilerStart()
57 g_profile = true;
60 void ProfilerAddDelta(int _addr, int _delta)
62 if (g_profile)
64 g_profileMap[_addr] += _delta;
68 void ProfilerInit()
70 memset(g_profileMap, 0, sizeof(g_profileMap));
73 void ProfilerDump(u64 count)
75 FILE* pFile = fopen("DSP_Prof.txt", "wt");
76 if (pFile != NULL)
78 fprintf(pFile, "Number of DSP steps: %llu\n\n", count);
79 for (int i=0; i<PROFILE_MAP_SIZE;i++)
81 if (g_profileMap[i] > 0)
83 fprintf(pFile, "0x%04X: %llu\n", i, g_profileMap[i]);
87 fclose(pFile);
91 #endif