mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Removing old LLE plugin
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2927 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1,100 +0,0 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
#include "../Globals.h"
|
||||
#include "Common.h"
|
||||
|
||||
|
||||
extern u32 m_addressPBs;
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// Get the parameter block location - Example SSBM: We get the addr 8049cf00, first we
|
||||
// always get 0 and go to AXLIST_STUDIOADDR, then we end up at AXLIST_PBADDR.
|
||||
// --------------
|
||||
bool AXTask(u32& _uMail)
|
||||
{
|
||||
u32 uAddress = _uMail;
|
||||
DEBUG_LOG(DSPHLE, "AXTask - ================================================================");
|
||||
DEBUG_LOG(DSPHLE, "AXTask - AXCommandList-Addr: 0x%08x", uAddress);
|
||||
|
||||
bool bExecuteList = true;
|
||||
|
||||
while (bExecuteList)
|
||||
{
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// SSBM: We get the addr 8049cf00, first we always get 0
|
||||
u16 iCommand = Memory_Read_U16(uAddress);
|
||||
uAddress += 2;
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
switch (iCommand)
|
||||
{
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// ?
|
||||
case 0: // AXLIST_STUDIOADDR: //00
|
||||
{
|
||||
uAddress += 4;
|
||||
DEBUG_LOG(DSPHLE, "AXLIST AXLIST_SBUFFER: %08x", uAddress);
|
||||
}
|
||||
break;
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
case 2: // AXLIST_PBADDR: // 02
|
||||
{
|
||||
m_addressPBs = Memory_Read_U32(uAddress);
|
||||
uAddress += 4;
|
||||
DEBUG_LOG(DSPHLE, "AXLIST PB address: %08x", m_addressPBs);
|
||||
bExecuteList = false;
|
||||
}
|
||||
break;
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
case 7: // AXLIST_SBUFFER: // 7
|
||||
{
|
||||
// Hopefully this is where in main ram to write.
|
||||
uAddress += 4;
|
||||
DEBUG_LOG(DSPHLE, "AXLIST AXLIST_SBUFFER: %08x", uAddress);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
default:
|
||||
{
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Stop the execution of this TaskList
|
||||
DEBUG_LOG(DSPHLE, "AXLIST default: %08x", uAddress);
|
||||
bExecuteList = false;
|
||||
// ---------------------------------------------------------------------------------------
|
||||
}
|
||||
break;
|
||||
} // end of switch
|
||||
}
|
||||
|
||||
DEBUG_LOG(DSPHLE, "AXTask - done, send resume");
|
||||
DEBUG_LOG(DSPHLE, "AXTask - ================================================================");
|
||||
|
||||
// now resume
|
||||
return true;
|
||||
}
|
||||
// =======================================================================================
|
||||
|
||||
|
@ -1,382 +0,0 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// Includes
|
||||
// --------------
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string> // So that we can test if std::string == abc
|
||||
#include <windows.h>
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
#include "UCode_AXStructs.h" // they are only in a virtual dir called UCodes AX
|
||||
// =====================
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// Declarations and definitions
|
||||
// --------------
|
||||
|
||||
// ----------------------------------
|
||||
// Settings
|
||||
// --------------
|
||||
#define NUMBER_OF_PBS 64 // Todo: move this to a logging class
|
||||
|
||||
// -----------------------------------
|
||||
// Externals
|
||||
// --------------
|
||||
extern u32 m_addressPBs;
|
||||
float ratioFactor;
|
||||
int globaliSize;
|
||||
short globalpBuffer;
|
||||
u32 gLastBlock;
|
||||
// --------------
|
||||
|
||||
// -----------------------------------
|
||||
// Vectors and other things
|
||||
// --------------
|
||||
std::vector<u32> gloopPos(64);
|
||||
std::vector<u32> gsampleEnd(64);
|
||||
std::vector<u32> gsamplePos(64);
|
||||
std::vector<u32> gratio(64);
|
||||
std::vector<u32> gratiohi(64);
|
||||
std::vector<u32> gratiolo(64);
|
||||
std::vector<u32> gfrac(64);
|
||||
std::vector<u32> gcoef(64);
|
||||
|
||||
// PBSampleRateConverter mixer
|
||||
std::vector<u16> gvolume_left(64);
|
||||
std::vector<u16> gvolume_right(64);
|
||||
std::vector<u16> gmixer_control(64);
|
||||
std::vector<u16> gcur_volume(64);
|
||||
std::vector<u16> gcur_volume_delta(64);
|
||||
|
||||
|
||||
std::vector<u16> gaudioFormat(64);
|
||||
std::vector<u16> glooping(64);
|
||||
std::vector<u16> gsrc_type(64);
|
||||
std::vector<u16> gis_stream(64);
|
||||
|
||||
// loop
|
||||
std::vector<u16> gloop1(64);
|
||||
std::vector<u16> gloop2(64);
|
||||
std::vector<u16> gloop3(64);
|
||||
std::vector<u16> gadloop1(64);
|
||||
std::vector<u16> gadloop2(64);
|
||||
std::vector<u16> gadloop3(64);
|
||||
|
||||
// updates
|
||||
std::vector<u16> gupdates1(64);
|
||||
std::vector<u16> gupdates2(64);
|
||||
std::vector<u16> gupdates3(64);
|
||||
std::vector<u16> gupdates4(64);
|
||||
std::vector<u16> gupdates5(64);
|
||||
std::vector<u32> gupdates_addr(64);
|
||||
|
||||
// Other things
|
||||
std::vector<u16> Jump(64); // this is 1 or 0
|
||||
std::vector<int> musicLength(64);
|
||||
std::vector< std::vector<int> > vector1(64, std::vector<int>(100,0));
|
||||
std::vector<int> numberRunning(64);
|
||||
|
||||
int j = 0;
|
||||
int k = 0;
|
||||
__int64 l = 0;
|
||||
int iupd = 0;
|
||||
bool iupdonce = false;
|
||||
std::vector<u16> viupd(15); // the length of the update frequency bar
|
||||
int vectorLength = 15; // the length of the playback history bar and how long
|
||||
// old blocks are shown
|
||||
|
||||
std::vector<u16> vector62(vectorLength);
|
||||
std::vector<u16> vector63(vectorLength);
|
||||
|
||||
int ReadOutPBs(AXParamBlock * _pPBs, int _num);
|
||||
// =====================
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// Main logging function
|
||||
// --------------
|
||||
void Logging()
|
||||
{
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Control how often the screen is updated
|
||||
j++;
|
||||
l++;
|
||||
if (j>1000000) // TODO: make the update frequency adjustable from the logging window
|
||||
{
|
||||
|
||||
AXParamBlock PBs[NUMBER_OF_PBS];
|
||||
int numberOfPBs = ReadOutPBs(PBs, NUMBER_OF_PBS);
|
||||
|
||||
// =======================================================================================
|
||||
// Vector1 is a vector1[64][100] vector
|
||||
/*
|
||||
Move all items back like this
|
||||
1 to 2
|
||||
2 3
|
||||
3 ...
|
||||
*/
|
||||
// ----------------
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
for (int j = 1; j < vectorLength; j++)
|
||||
{
|
||||
vector1.at(i).at(j-1) = vector1.at(i).at(j);
|
||||
}
|
||||
}
|
||||
// =================
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Enter the latest value
|
||||
for (int i = 0; i < numberOfPBs; i++)
|
||||
{
|
||||
vector1.at(i).at(vectorLength-1) = PBs[i].running;
|
||||
}
|
||||
// -----------------
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Count how many blocks we have running now
|
||||
int jj = 0;
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
for (int j = 0; j < vectorLength-1; j++)
|
||||
{
|
||||
if (vector1.at(i).at(j) == 1)
|
||||
{
|
||||
jj++;
|
||||
}
|
||||
numberRunning.at(i) = jj;
|
||||
}
|
||||
}
|
||||
// --------------
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Write the first row
|
||||
char buffer [1000] = "";
|
||||
std::string sbuff;
|
||||
//sbuff = sbuff + " Nr | | frac ratio | old new \n"; // 5
|
||||
sbuff = sbuff + " Nr pos / end lpos | voll volr curv vold mix | isl[pre yn1 yn2] iss | frac ratio[hi lo] | 1 2 3 4 5\n";
|
||||
// --------------
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Read out values for all blocks
|
||||
for (int i = 0; i < numberOfPBs; i++)
|
||||
{
|
||||
if (numberRunning.at(i) > 0)
|
||||
{
|
||||
// =======================================================================================
|
||||
// Write the playback bar
|
||||
// -------------
|
||||
for (int j = 0; j < vectorLength; j++)
|
||||
{
|
||||
if(vector1.at(i).at(j) == 0)
|
||||
{
|
||||
sbuff = sbuff + " ";
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(buffer, "%c", 177);
|
||||
sbuff = sbuff + buffer; strcpy(buffer, "");
|
||||
}
|
||||
}
|
||||
// ==============
|
||||
|
||||
|
||||
// ================================================================================================
|
||||
int sampleJump;
|
||||
int loopJump;
|
||||
//if (PBs[i].running && PBs[i].adpcm_loop_info.yn1 && PBs[i].mixer.volume_left)
|
||||
if (true)
|
||||
{
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// AXPB base
|
||||
//int running = pb.running;
|
||||
gcoef[i] = PBs[i].unknown1;
|
||||
|
||||
sampleJump = ((PBs[i].audio_addr.cur_addr_hi << 16) | PBs[i].audio_addr.cur_addr_lo) - gsamplePos[i];
|
||||
loopJump = ((PBs[i].audio_addr.loop_addr_hi << 16) | PBs[i].audio_addr.loop_addr_lo) - gloopPos[i];
|
||||
|
||||
gloopPos[i] = (PBs[i].audio_addr.loop_addr_hi << 16) | PBs[i].audio_addr.loop_addr_lo;
|
||||
gsampleEnd[i] = (PBs[i].audio_addr.end_addr_hi << 16) | PBs[i].audio_addr.end_addr_lo;
|
||||
gsamplePos[i] = (PBs[i].audio_addr.cur_addr_hi << 16) | PBs[i].audio_addr.cur_addr_lo;
|
||||
|
||||
// PBSampleRateConverter src
|
||||
|
||||
gratio[i] = (u32)(((PBs[i].src.ratio_hi << 16) + PBs[i].src.ratio_lo) * ratioFactor);
|
||||
gratiohi[i] = PBs[i].src.ratio_hi;
|
||||
gratiolo[i] = PBs[i].src.ratio_lo;
|
||||
gfrac[i] = PBs[i].src.cur_addr_frac;
|
||||
|
||||
// adpcm_loop_info
|
||||
gadloop1[i] = PBs[i].adpcm.pred_scale;
|
||||
gadloop2[i] = PBs[i].adpcm.yn1;
|
||||
gadloop3[i] = PBs[i].adpcm.yn2;
|
||||
|
||||
gloop1[i] = PBs[i].adpcm_loop_info.pred_scale;
|
||||
gloop2[i] = PBs[i].adpcm_loop_info.yn1;
|
||||
gloop3[i] = PBs[i].adpcm_loop_info.yn2;
|
||||
|
||||
// updates
|
||||
gupdates1[i] = PBs[i].updates.num_updates[0];
|
||||
gupdates2[i] = PBs[i].updates.num_updates[1];
|
||||
gupdates3[i] = PBs[i].updates.num_updates[2];
|
||||
gupdates4[i] = PBs[i].updates.num_updates[3];
|
||||
gupdates5[i] = PBs[i].updates.num_updates[4];
|
||||
|
||||
gupdates_addr[i] = (PBs[i].updates.data_hi << 16) | PBs[i].updates.data_lo;
|
||||
|
||||
gaudioFormat[i] = PBs[i].audio_addr.sample_format;
|
||||
glooping[i] = PBs[i].audio_addr.looping;
|
||||
gsrc_type[i] = PBs[i].src_type;
|
||||
gis_stream[i] = PBs[i].is_stream;
|
||||
|
||||
// mixer
|
||||
gvolume_left[i] = PBs[i].mixer.volume_left;
|
||||
gvolume_right[i] = PBs[i].mixer.volume_right;
|
||||
|
||||
gmixer_control[i] = PBs[i].mixer_control;
|
||||
gcur_volume[i] = PBs[i].vol_env.cur_volume;
|
||||
gcur_volume_delta[i] = PBs[i].vol_env.cur_volume_delta;
|
||||
|
||||
// other stuff
|
||||
Jump[i] = (gfrac[i] >> 16); // This is 1 or 0
|
||||
musicLength[i] = gsampleEnd[i] - gloopPos[i];
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// PRESETS
|
||||
// ---------------------------------------------------------------------------------------
|
||||
/*
|
||||
/" Nr pos / end lpos | voll volr curv vold mix | isl[pre yn1 yn2] iss | frac ratio[hi lo] | 1 2 3 4 5\n";
|
||||
"---------------|00 12341234/12341234 12341234 | 00000 00000 00000 0000 00000 | 0[000 00000 00000] 0 | 00000 00000[0 00000] |
|
||||
*/
|
||||
sprintf(buffer,"%c%i %08i/%08i %08i | %05i %05i %05i %04i %05i | %i[%03i %05i %05i] %i | %05i %05i[%i %05i] | %i %i %i %i %i",
|
||||
223, i, gsamplePos[i], gsampleEnd[i], gloopPos[i],
|
||||
gvolume_left[i], gvolume_right[i], gcur_volume[i], gcur_volume_delta[i], gmixer_control[i],
|
||||
glooping[i], gloop1[i], gloop2[i], gloop3[i], gis_stream[i],
|
||||
gfrac[i], gratio[i], gratiohi[i], gratiolo[i],
|
||||
gupdates1[i], gupdates2[i], gupdates3[i], gupdates4[i], gupdates5[i]
|
||||
);
|
||||
// =======================================================================================
|
||||
|
||||
// write a new line
|
||||
sbuff = sbuff + buffer; strcpy(buffer, "");
|
||||
sbuff = sbuff + "\n";
|
||||
|
||||
} // end of if (true)
|
||||
|
||||
|
||||
} // end of big loop - for (int i = 0; i < numberOfPBs; i++)
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// Write global values
|
||||
sprintf(buffer, "\nParameter blocks span from %08x | to %08x | distance %i %i\n", m_addressPBs, gLastBlock, (gLastBlock-m_addressPBs), (gLastBlock-m_addressPBs) / 192);
|
||||
sbuff = sbuff + buffer; strcpy(buffer, "");
|
||||
// ==============
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// Show update frequency
|
||||
// ---------------
|
||||
sbuff = sbuff + "\n";
|
||||
if(!iupdonce)
|
||||
{
|
||||
/*
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
viupd.at(i) == 0;
|
||||
}
|
||||
*/
|
||||
viupd.at(0) = 1;
|
||||
viupd.at(1) = 1;
|
||||
viupd.at(2) = 1;
|
||||
iupdonce = true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)viupd.size(); i++) // 0, 1,..., 9
|
||||
{
|
||||
if (i < (int)viupd.size()-1)
|
||||
{
|
||||
viupd.at(viupd.size()-i-1) = viupd.at(viupd.size()-i-2); // move all forward
|
||||
}
|
||||
else
|
||||
{
|
||||
viupd.at(0) = viupd.at(viupd.size()-1);
|
||||
}
|
||||
|
||||
// Correction
|
||||
if (viupd.at(viupd.size()-3) == 1 && viupd.at(viupd.size()-2) == 1 && viupd.at(viupd.size()-1) == 1)
|
||||
{
|
||||
viupd.at(0) = 0;
|
||||
}
|
||||
if(viupd.at(0) == 0 && viupd.at(1) == 1 && viupd.at(2) == 1 && viupd.at(3) == 0)
|
||||
{
|
||||
viupd.at(0) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)viupd.size(); i++)
|
||||
{
|
||||
if(viupd.at(i) == 0)
|
||||
sbuff = sbuff + " ";
|
||||
else
|
||||
sbuff = sbuff + ".";
|
||||
}
|
||||
// ================
|
||||
|
||||
|
||||
// =======================================================================================
|
||||
// Print
|
||||
// ---------------
|
||||
// Console::ClearScreen();
|
||||
INFO_LOG(DSPHLE, "%s", sbuff.c_str());
|
||||
sbuff.clear(); strcpy(buffer, "");
|
||||
// ---------------
|
||||
k=0;
|
||||
j=0;
|
||||
// ---------------
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
// =======================================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -1,23 +0,0 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
void Logging();
|
||||
|
||||
#endif
|
@ -1,114 +0,0 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
|
||||
|
||||
// Turn on and off logging modes
|
||||
// --------------
|
||||
//#define LOG1 // writes selected parameters only and with more readable formatting
|
||||
//#define LOG2 // writes all parameters
|
||||
|
||||
#include "Common.h"
|
||||
#include "../Globals.h"
|
||||
#include "CommonTypes.h" // Pluginspecs
|
||||
|
||||
#include "UCode_AXStructs.h" // For the AXParamBlock structure
|
||||
|
||||
|
||||
u32 m_addressPBs = 0;
|
||||
extern u32 gLastBlock;
|
||||
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
int m = 0;
|
||||
int n = 0;
|
||||
#ifdef LOG2
|
||||
bool logall = true;
|
||||
#else
|
||||
bool logall = false;
|
||||
#endif
|
||||
int ReadOutPBs(AXParamBlock * _pPBs, int _num)
|
||||
{
|
||||
int count = 0;
|
||||
u32 blockAddr = m_addressPBs;
|
||||
u32 OldblockAddr = blockAddr;
|
||||
u32 paraAddr = blockAddr;
|
||||
|
||||
// reading and 'halfword' swap
|
||||
n++;
|
||||
//FIXME if (n > 20 && logall) {Console::ClearScreen();}
|
||||
for (int i = 0; i < _num; i++)
|
||||
{
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Check if there is something here.
|
||||
const short * pSrc = (const short *)g_dspInitialize.pGetMemoryPointer(blockAddr);
|
||||
// -------------
|
||||
|
||||
if (pSrc != NULL) // only read non-blank blocks
|
||||
{
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Create a shortcut that let us update struct members
|
||||
short * pDest = (short *) & _pPBs[i];
|
||||
|
||||
if (n > 20 && logall) {DEBUG_LOG(DSPHLE, "%c%i:", 223, i);} // logging
|
||||
|
||||
// --------------
|
||||
// Here we update the PB. We do it by going through all 192 / 2 = 96 u16 values
|
||||
for (size_t p = 0; p < sizeof(AXParamBlock) / 2; p++)
|
||||
{
|
||||
paraAddr += 2;
|
||||
|
||||
if(pSrc != NULL)
|
||||
{
|
||||
if (pSrc[p] != 0 && n > 20 && logall)
|
||||
{
|
||||
DEBUG_LOG(DSPHLE, "%i %04x | ", p, Common::swap16(pSrc[p]));
|
||||
}
|
||||
}
|
||||
|
||||
pDest[p] = Common::swap16(pSrc[p]);
|
||||
|
||||
}
|
||||
|
||||
if(n > 20 && logall) {DEBUG_LOG(DSPHLE, "\n");} // logging
|
||||
// --------------
|
||||
// Here we update the block address to the starting point of the next PB
|
||||
blockAddr = (_pPBs[i].next_pb_hi << 16) | _pPBs[i].next_pb_lo;
|
||||
// --------------
|
||||
// save some values
|
||||
count++;
|
||||
gLastBlock = paraAddr; // blockAddr
|
||||
// ============
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
} // end of the big loop
|
||||
if (n > 20) {n = 0;} // for logging
|
||||
|
||||
|
||||
// return the number of readed PBs
|
||||
return count;
|
||||
}
|
||||
// =======================================================================================
|
||||
|
||||
#endif
|
@ -1,146 +0,0 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
#ifdef _WIN32
|
||||
|
||||
|
||||
#ifndef UCODE_AX_STRUCTS
|
||||
#define UCODE_AX_STRUCTS
|
||||
|
||||
struct PBMixer
|
||||
{
|
||||
u16 volume_left;
|
||||
u16 unknown;
|
||||
u16 volume_right;
|
||||
u16 unknown2;
|
||||
|
||||
u16 unknown3[8];
|
||||
u16 unknown4[6];
|
||||
};
|
||||
|
||||
struct PBInitialTimeDelay
|
||||
{
|
||||
u16 unknown[7];
|
||||
};
|
||||
|
||||
// Update data - read these each 1ms subframe and use them!
|
||||
// It seems that to provide higher time precisions for MIDI events, some games
|
||||
// use this thing to update the parameter blocks per 1ms sub-block (a block is 5ms).
|
||||
// Using this data should fix games that are missing MIDI notes.
|
||||
struct PBUpdates
|
||||
{
|
||||
u16 num_updates[5];
|
||||
u16 data_hi; // These point to main RAM. Not sure about the structure of the data.
|
||||
u16 data_lo;
|
||||
};
|
||||
|
||||
struct PBUnknown
|
||||
{
|
||||
s16 unknown[9];
|
||||
};
|
||||
|
||||
struct PBVolumeEnvelope
|
||||
{
|
||||
u16 cur_volume;
|
||||
s16 cur_volume_delta;
|
||||
};
|
||||
|
||||
struct PBUnknown2
|
||||
{
|
||||
u16 unknown_reserved[3];
|
||||
};
|
||||
|
||||
struct PBAudioAddr
|
||||
{
|
||||
u16 looping;
|
||||
u16 sample_format;
|
||||
u16 loop_addr_hi; // Start of loop (this will point to a shared "zero" buffer if one-shot mode is active)
|
||||
u16 loop_addr_lo;
|
||||
u16 end_addr_hi; // End of sample (and loop), inclusive
|
||||
u16 end_addr_lo;
|
||||
u16 cur_addr_hi;
|
||||
u16 cur_addr_lo;
|
||||
};
|
||||
|
||||
struct PBADPCMInfo
|
||||
{
|
||||
s16 coefs[16];
|
||||
u16 unknown;
|
||||
u16 pred_scale;
|
||||
s16 yn1;
|
||||
s16 yn2;
|
||||
};
|
||||
|
||||
struct PBSampleRateConverter
|
||||
{
|
||||
u16 ratio_hi;
|
||||
u16 ratio_lo;
|
||||
u16 cur_addr_frac;
|
||||
u16 last_samples[4];
|
||||
};
|
||||
|
||||
struct PBADPCMLoopInfo
|
||||
{
|
||||
u16 pred_scale;
|
||||
u16 yn1;
|
||||
u16 yn2;
|
||||
};
|
||||
|
||||
struct AXParamBlock
|
||||
{
|
||||
u16 next_pb_hi;
|
||||
u16 next_pb_lo;
|
||||
|
||||
u16 this_pb_hi;
|
||||
u16 this_pb_lo;
|
||||
|
||||
u16 src_type; // Type of sample rate converter (2 = none, ?, linear)
|
||||
u16 unknown1;
|
||||
|
||||
u16 mixer_control;
|
||||
u16 running; // 1=RUN 0=STOP
|
||||
u16 is_stream; // 1 = stream, 0 = one shot
|
||||
|
||||
PBMixer mixer;
|
||||
PBInitialTimeDelay initial_time_delay;
|
||||
PBUpdates updates;
|
||||
PBUnknown unknown2;
|
||||
PBVolumeEnvelope vol_env;
|
||||
PBUnknown2 unknown3;
|
||||
PBAudioAddr audio_addr;
|
||||
PBADPCMInfo adpcm;
|
||||
PBSampleRateConverter src;
|
||||
PBADPCMLoopInfo adpcm_loop_info;
|
||||
u16 unknown_maybe_padding[3];
|
||||
};
|
||||
|
||||
enum {
|
||||
AUDIOFORMAT_ADPCM = 0,
|
||||
AUDIOFORMAT_PCM8 = 0x19,
|
||||
AUDIOFORMAT_PCM16 = 0xA,
|
||||
};
|
||||
|
||||
enum {
|
||||
SRCTYPE_LINEAR = 1,
|
||||
SRCTYPE_NEAREST = 2,
|
||||
MIXCONTROL_RAMPING = 8,
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif // win32
|
||||
|
Reference in New Issue
Block a user