Fix compiling in Linux for the most part

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@732 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1 2008-09-29 21:22:44 +00:00
parent 3d25b525dd
commit d98c60a0da
14 changed files with 50 additions and 75 deletions

View File

@ -20,6 +20,9 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <stdio.h>
#include <stdlib.h>
@ -75,9 +78,8 @@ CPBView::CPBView(wxWindow* parent, const wxWindowID id, const wxPoint& pos, cons
// Print values from 0 to 63 // Print values from 0 to 63
char buffer [33]; char buffer [33];
itoa(i, buffer, 10);
sprintf(buffer, "%02i", i); sprintf(buffer, "%02i", i);
int Item = InsertItem(0, buffer); int Item = InsertItem(0, wxString::FromAscii(buffer));
wxListItem item; wxListItem item;
@ -109,9 +111,7 @@ CPBView::MSWDrawSubItem(wxPaintDC& rPainDC, int item, int subitem)
// don't change 0, it has the block values // don't change 0, it has the block values
if(subitem > 0) if(subitem > 0)
{ {
//#ifdef __WXMSW__ // what's this? should I use that? #ifdef __WXMSW__ // what's this? should I use that?
// =======================================================================================
const wxChar* bgColor = _T("#ffffff"); const wxChar* bgColor = _T("#ffffff");
wxBrush bgBrush(bgColor); wxBrush bgBrush(bgColor);
wxPen bgPen(bgColor); wxPen bgPen(bgColor);
@ -121,13 +121,10 @@ CPBView::MSWDrawSubItem(wxPaintDC& rPainDC, int item, int subitem)
rPainDC.SetBrush(bgBrush); rPainDC.SetBrush(bgBrush);
rPainDC.SetPen(bgPen); rPainDC.SetPen(bgPen);
rPainDC.DrawRectangle(SubItemRect); rPainDC.DrawRectangle(SubItemRect);
// ======================================================================================= #endif
// =======================================================================================
// A somewhat primitive attempt to show the playing history for a certain block. // A somewhat primitive attempt to show the playing history for a certain block.
// ---------------------------------------------------------------------------------------
wxString text; wxString text;
// ---------------------------------------------------------------------------------------
if(subitem == 1) if(subitem == 1)
{ {
char cbuff [33]; char cbuff [33];
@ -152,9 +149,12 @@ CPBView::MSWDrawSubItem(wxPaintDC& rPainDC, int item, int subitem)
{ {
text.Printf(wxT("0x%08x"), m_CachedRegs[subitem][item]); text.Printf(wxT("0x%08x"), m_CachedRegs[subitem][item]);
} }
#ifdef __WXMSW__
rPainDC.DrawText(text, SubItemRect.GetLeft() + 10, SubItemRect.GetTop() + 4); rPainDC.DrawText(text, SubItemRect.GetLeft() + 10, SubItemRect.GetTop() + 4);
// ======================================================================================= #else
// May not show up pretty in !Win32
rPainDC.DrawText(text, 10, 4);
#endif
return(true); return(true);
} }

View File

@ -19,6 +19,7 @@
#define __PBView_h__ #define __PBView_h__
#include <wx/listctrl.h> #include <wx/listctrl.h>
#include <wx/dcclient.h>
#include "Common.h" #include "Common.h"

View File

@ -1,7 +1,6 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include "Common.h"
#include "Globals.h" #include "Globals.h"
void __Log(int, const char *fmt, ...) void __Log(int, const char *fmt, ...)

View File

@ -20,15 +20,16 @@
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// =======================================================================================
// Includes // Includes
// ---------------------------------------------------------------------------------------
#include "../Globals.h"
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <string> // so that we can test std::string == abc #include <string> // so that we can test std::string == abc
#ifdef _WIN32
#include <windows.h> #include <windows.h>
#endif
#include "Common.h"
#include "../UCodes/UCodes.h" #include "../UCodes/UCodes.h"
#include "../UCodes/UCode_AXStructs.h" #include "../UCodes/UCode_AXStructs.h"
@ -36,27 +37,12 @@
#include "../Debugger/PBView.h" #include "../Debugger/PBView.h"
#include "../Debugger/Debugger.h" #include "../Debugger/Debugger.h"
// =======================================================================================
// =======================================================================================
// Declarations
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
// Externals // Externals
// ---------------------------------------------------------------------------------------
float ratioFactor; // a global to get the ratio factor from MixAdd float ratioFactor; // a global to get the ratio factor from MixAdd
// ---------------------------------------------------------------------------------------
// =======================================================================================
// ---------------------------------------------------------------------------------------
// Parameter blocks // Parameter blocks
// ---------------------------------------------------------------------------------------
std::vector<u32> gloopPos(64); std::vector<u32> gloopPos(64);
std::vector<u32> gsampleEnd(64); std::vector<u32> gsampleEnd(64);
std::vector<u32> gsamplePos(64); std::vector<u32> gsamplePos(64);
@ -90,33 +76,33 @@ std::vector<u16> gis_stream(64);
std::vector<u16> gupdates4(64); std::vector<u16> gupdates4(64);
std::vector<u16> gupdates5(64); std::vector<u16> gupdates5(64);
std::vector<u32> gupdates_addr(64); std::vector<u32> gupdates_addr(64);
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
// Counters // Counters
// ---------------------------------------------------------------------------------------
int j = 0; int j = 0;
int k = 0; int k = 0;
__int64 l = 0; long int l = 0;
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
// More stuff // More stuff
// ---------------------------------------------------------------------------------------
std::vector< std::vector<int> > vector1(64, std::vector<int>(100,0)); std::vector< std::vector<int> > vector1(64, std::vector<int>(100,0));
int vectorLength = 8; int vectorLength = 8;
std::vector<u16> vector62(vectorLength); std::vector<u16> vector62(vectorLength);
std::vector<u16> vector63(vectorLength); std::vector<u16> vector63(vectorLength);
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
// Classes // Classes
// ---------------------------------------------------------------------------------------
extern CDebugger* m_frame; extern CDebugger* m_frame;
// ---------------------------------------------------------------------------------------
// I placed this in CUCode_AX because there was some kind of problem to call it otherwise, // I placed this in CUCode_AX because there was some kind of problem to call it otherwise,
@ -128,16 +114,16 @@ void CUCode_AX::Logging(short* _pBuffer, int _iSize, int a)
int numberOfPBs = ReadOutPBs(PBs, NUMBER_OF_PBS); int numberOfPBs = ReadOutPBs(PBs, NUMBER_OF_PBS);
// ---------------------------------------------------------------------------------------
// Control how often the screen is updated // Control how often the screen is updated
j++; j++;
l++; l++;
if (j>20) if (j>20)
{ {
// =======================================================================================
// Move all items back - vector1 is a vector1[64][100] vector, I think // Move all items back - vector1 is a vector1[64][100] vector, I think
// ---------------------------------------------------------------------------------------
/* /*
1 to 2 1 to 2
2 3 2 3
@ -150,20 +136,20 @@ void CUCode_AX::Logging(short* _pBuffer, int _iSize, int a)
vector1.at(i).at(j-1) = vector1.at(i).at(j); vector1.at(i).at(j-1) = vector1.at(i).at(j);
} }
} }
// =======================================================================================
// ---------------------------------------------------------------------------------------
// Save the latest value // Save the latest value
// ---------------------------------------------------------------------------------------
for (int i = 0; i < numberOfPBs; i++) for (int i = 0; i < numberOfPBs; i++)
{ {
vector1.at(i).at(vectorLength-1) = PBs[i].running; vector1.at(i).at(vectorLength-1) = PBs[i].running;
} }
// ---------------------------------------------------------------------------------------
// =======================================================================================
// go through all blocks, or only some // go through all blocks, or only some
for (int i = 0; i < numberOfPBs; i++) for (int i = 0; i < numberOfPBs; i++)
{ {
@ -172,9 +158,9 @@ void CUCode_AX::Logging(short* _pBuffer, int _iSize, int a)
if(true) if(true)
{ {
// =======================================================================================
// Playback history for the GUI debugger // Playback history for the GUI debugger
// ---------------------------------------------------------------------------------------
std::string sbuff; std::string sbuff;
for (int j = 0; j < vectorLength; j++) for (int j = 0; j < vectorLength; j++)
@ -192,14 +178,13 @@ void CUCode_AX::Logging(short* _pBuffer, int _iSize, int a)
u32 run = atoi( sbuff.c_str()); u32 run = atoi( sbuff.c_str());
m_frame->m_GPRListView->m_CachedRegs[1][i] = run; m_frame->m_GPRListView->m_CachedRegs[1][i] = run;
sbuff.clear(); sbuff.clear();
// ================================================================================================
// We could chose to update these only if a block is currently running - Later I'll add options // We could chose to update these only if a block is currently running - Later I'll add options
// to see both the current and the lastets active value. // to see both the current and the lastets active value.
//if (PBs[i].running) //if (PBs[i].running)
if (true) if (true)
{ {
// ---------------------------------------------------------------------------------------
// AXPB base // AXPB base
gcoef[i] = PBs[i].unknown1; gcoef[i] = PBs[i].unknown1;
@ -242,7 +227,6 @@ void CUCode_AX::Logging(short* _pBuffer, int _iSize, int a)
gvolume_right[i] = PBs[i].mixer.volume_right; gvolume_right[i] = PBs[i].mixer.volume_right;
} }
// ================================================================================================
// hopefully this is false if we don't have a debugging window and so it doesn't cause a crash // hopefully this is false if we don't have a debugging window and so it doesn't cause a crash
if(m_frame) if(m_frame)
{ {
@ -284,7 +268,7 @@ void CUCode_AX::Logging(short* _pBuffer, int _iSize, int a)
// =======================================================================================
// New values are written so update - DISABLED - It flickered a lot, even worse than a // New values are written so update - DISABLED - It flickered a lot, even worse than a
// console window. I'll add a console window later to show the current status. // console window. I'll add a console window later to show the current status.
//if(m_frame) //if(m_frame)
@ -292,14 +276,13 @@ void CUCode_AX::Logging(short* _pBuffer, int _iSize, int a)
{ {
//m_frame->NotifyUpdate(); //m_frame->NotifyUpdate();
} }
// =======================================================================================
k=0; k=0;
j=0; j=0;
} // end of if (j>20) } // end of if (j>20)
// ---------------------------------------------------------------------------------------
} // end of function } // end of function
// =======================================================================================

View File

@ -15,7 +15,6 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "../Globals.h" #include "../Globals.h"
#ifdef _WIN32 #ifdef _WIN32

View File

@ -15,7 +15,6 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "../Globals.h" #include "../Globals.h"
#include "../DSPHandler.h" #include "../DSPHandler.h"
#include "UCodes.h" #include "UCodes.h"

View File

@ -15,7 +15,6 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "../Globals.h" #include "../Globals.h"
#include "../DSPHandler.h" #include "../DSPHandler.h"
#include "UCodes.h" #include "UCodes.h"

View File

@ -15,7 +15,6 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "../Globals.h" #include "../Globals.h"
#include "UCodes.h" #include "UCodes.h"
#include "UCode_Jac.h" #include "UCode_Jac.h"

View File

@ -15,7 +15,6 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "../Globals.h" #include "../Globals.h"
#include "../DSPHandler.h" #include "../DSPHandler.h"
#include "UCodes.h" #include "UCodes.h"

View File

@ -18,7 +18,6 @@
// Games that uses this UCode: // Games that uses this UCode:
// Zelda: The Windwaker, Mario Sunshine, Mario Kart // Zelda: The Windwaker, Mario Sunshine, Mario Kart
#include "Common.h"
#include "../Globals.h" #include "../Globals.h"
#include "UCodes.h" #include "UCodes.h"
#include "UCode_Zelda.h" #include "UCode_Zelda.h"

View File

@ -15,7 +15,6 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "../Globals.h" #include "../Globals.h"
#include "UCodes.h" #include "UCodes.h"

View File

@ -18,7 +18,6 @@
// ======================================================================================= // =======================================================================================
// Includes // Includes
// ------------------ // ------------------
#include "Common.h"
#include "Globals.h" #include "Globals.h"
#include "ChunkFile.h" #include "ChunkFile.h"
#include "resource.h" #include "resource.h"

View File

@ -83,8 +83,8 @@ void ExecuteDisplayList(u32 address, u32 size)
#ifdef DATAREADER_INLINE #ifdef DATAREADER_INLINE
u32 old_pVideoData = g_pVideoData; u32 old_pVideoData = g_pVideoData;
const u32 startAddress = (u32)Memory_GetPtr(address); const u8* startAddress = Memory_GetPtr(address);
g_pVideoData = startAddress; g_pVideoData = *startAddress;
#endif #endif
// temporarily swap dl and non-dl(small "hack" for the stats) // temporarily swap dl and non-dl(small "hack" for the stats)
Xchg(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims); Xchg(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims);
@ -93,7 +93,7 @@ void ExecuteDisplayList(u32 address, u32 size)
Xchg(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads); Xchg(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads);
#ifdef DATAREADER_INLINE #ifdef DATAREADER_INLINE
while((g_pVideoData - startAddress) < size) while((g_pVideoData - *startAddress) < size)
#else #else
while((memoryReader.GetReadAddress() - address) < size) while((memoryReader.GetReadAddress() - address) < size)
#endif #endif

View File

@ -324,7 +324,7 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs)
INFO_LOG("view: topleft=(%f,%f), wh=(%f,%f), z=(%f,%f)\n",rawViewport[3]-rawViewport[0]-342,rawViewport[4]+rawViewport[1]-342, INFO_LOG("view: topleft=(%f,%f), wh=(%f,%f), z=(%f,%f)\n",rawViewport[3]-rawViewport[0]-342,rawViewport[4]+rawViewport[1]-342,
2 * rawViewport[0], 2 * rawViewport[1], (rawViewport[5]-rawViewport[2])/16777215.0f, rawViewport[5]/16777215.0f); 2 * rawViewport[0], 2 * rawViewport[1], (rawViewport[5]-rawViewport[2])/16777215.0f, rawViewport[5]/16777215.0f);
glViewport((int)(rawViewport[3]-rawViewport[0]-342) * MValueX,Renderer::GetTargetHeight()-((int)(rawViewport[4]-rawViewport[1]-342)) * MValueY, abs((int)(2 * rawViewport[0])) * MValueX, abs((int)(2 * rawViewport[1])) * MValueY); glViewport((int)(rawViewport[3]-rawViewport[0]-342) * MValueX,Renderer::GetTargetHeight()-((int)(rawViewport[4]-rawViewport[1]-342)) * MValueY, abs((int)(2 * rawViewport[0])) * MValueX, abs((int)(2 * rawViewport[1])) * MValueY);
glDepthRange((rawViewport[5]-rawViewport[2])/-16777215.0f, rawViewport[5]/16777215.0f); glDepthRange(-(0.0f - (rawViewport[5]-rawViewport[2])/-16777215.0f), rawViewport[5]/16777215.0f);
} }
if (bProjectionChanged) { if (bProjectionChanged) {
@ -344,7 +344,7 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs)
g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[8] = 0.0f;
g_fProjectionMatrix[9] = 0.0f; g_fProjectionMatrix[9] = 0.0f;
g_fProjectionMatrix[10] = rawProjection[4]; g_fProjectionMatrix[10] = rawProjection[4];
g_fProjectionMatrix[11] = rawProjection[5]; g_fProjectionMatrix[11] = -(0.0f-rawProjection[5]);
g_fProjectionMatrix[12] = 0.0f; g_fProjectionMatrix[12] = 0.0f;
g_fProjectionMatrix[13] = 0.0f; g_fProjectionMatrix[13] = 0.0f;
@ -365,7 +365,7 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs)
g_fProjectionMatrix[8] = 0.0f; g_fProjectionMatrix[8] = 0.0f;
g_fProjectionMatrix[9] = 0.0f; g_fProjectionMatrix[9] = 0.0f;
g_fProjectionMatrix[10] = rawProjection[4]; g_fProjectionMatrix[10] = rawProjection[4];
g_fProjectionMatrix[11] = rawProjection[5]; g_fProjectionMatrix[11] = -(0.0f-rawProjection[5]);
g_fProjectionMatrix[12] = 0; g_fProjectionMatrix[12] = 0;
g_fProjectionMatrix[13] = 0; g_fProjectionMatrix[13] = 0;