UUpdate svn:eol-style=native ( r1438 ) for Source/*.h

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2385 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99 2009-02-23 06:17:57 +00:00
parent 578c402d2c
commit 473cd01181
27 changed files with 1618 additions and 1618 deletions

View File

@ -1,28 +1,28 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _COLORUTIL_H #ifndef _COLORUTIL_H
#define _COLORUTIL_H #define _COLORUTIL_H
namespace ColorUtil namespace ColorUtil
{ {
u32 Decode5A3(u16 val); u32 Decode5A3(u16 val);
} // namespace } // namespace
#endif #endif

View File

@ -1,52 +1,52 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _CONSOLE_H #ifndef _CONSOLE_H
#define _CONSOLE_H #define _CONSOLE_H
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Includes // Includes
// ¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯
#include <iostream> #include <iostream>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#endif #endif
////////////////////////////// //////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Declarations // Declarations
// ¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯
namespace Console namespace Console
{ {
// Settings // Settings
extern bool WriteToFile; extern bool WriteToFile;
// Functions // Functions
void Open(int Width = 80, int Height = 100, char * Name = "Console", bool File = false); void Open(int Width = 80, int Height = 100, char * Name = "Console", bool File = false);
void Close(); void Close();
int Print(const char *fmt, ...); int Print(const char *fmt, ...);
void ClearScreen(); void ClearScreen();
#ifdef _WIN32 #ifdef _WIN32
HWND GetHwnd(void); HWND GetHwnd(void);
#endif #endif
} // Console } // Console
/////////////////////////////// ///////////////////////////////
#endif // _CONSOLE_H #endif // _CONSOLE_H

View File

@ -1,69 +1,69 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef __SETUP_h__ #ifndef __SETUP_h__
#define __SETUP_h__ #define __SETUP_h__
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
// File description // File description
/* ¯¯¯¯¯¯¯¯¯¯¯¯ /* ¯¯¯¯¯¯¯¯¯¯¯¯
Compilation settings. I avoid placing this in Common.h or some place where lots of files needs Compilation settings. I avoid placing this in Common.h or some place where lots of files needs
to be rebuilt if any of these settings are changed. I'd rather have it in as few files as possible. to be rebuilt if any of these settings are changed. I'd rather have it in as few files as possible.
This file can be kept on the ignore list in your SVN program. It allows local optional settings This file can be kept on the ignore list in your SVN program. It allows local optional settings
depending on what works on your computer. depending on what works on your computer.
////////////////////////*/ ////////////////////////*/
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
// Settings // Settings
// ¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯
// This may remove sound artifacts in Wario Land Shake It and perhaps other games // This may remove sound artifacts in Wario Land Shake It and perhaps other games
//#define SETUP_AVOID_SOUND_ARTIFACTS //#define SETUP_AVOID_SOUND_ARTIFACTS
/* This may fix a problem with Stop and Start that I described in the comments to revision 2,139, /* This may fix a problem with Stop and Start that I described in the comments to revision 2,139,
and in the comments in the File Description for PluginManager.cpp */ and in the comments in the File Description for PluginManager.cpp */
//#define SETUP_FREE_VIDEO_PLUGIN_ON_BOOT //#define SETUP_FREE_VIDEO_PLUGIN_ON_BOOT
//#define SETUP_FREE_DSP_PLUGIN_ON_BOOT //#define SETUP_FREE_DSP_PLUGIN_ON_BOOT
//#define SETUP_DONT_FREE_PLUGIN_ON_STOP //#define SETUP_DONT_FREE_PLUGIN_ON_STOP
/* This will avoid deleting the g_EmuThread after Stop, that may hang when we are rendering to a child /* This will avoid deleting the g_EmuThread after Stop, that may hang when we are rendering to a child
window, however, I didn't seem to need this any more */ window, however, I didn't seem to need this any more */
//#define SETUP_AVOID_CHILD_WINDOW_RENDERING_HANG //#define SETUP_AVOID_CHILD_WINDOW_RENDERING_HANG
// Build with playback rerecording options // Build with playback rerecording options
//#define SETUP_AVOID_OPENGL_SCREEN_MESSAGE_HANG //#define SETUP_AVOID_OPENGL_SCREEN_MESSAGE_HANG
// Use a timer to wait for threads for stop instead of WaitForEternity() // Use a timer to wait for threads for stop instead of WaitForEternity()
/* I tried that this worked with these options /* I tried that this worked with these options
SETUP_FREE_VIDEO_PLUGIN_ON_BOOT SETUP_FREE_VIDEO_PLUGIN_ON_BOOT
SETUP_DONT_FREE_PLUGIN_ON_STOP SETUP_DONT_FREE_PLUGIN_ON_STOP
then the Confirm on Close message box doesn't hang, and we have a controlled Shutdown process then the Confirm on Close message box doesn't hang, and we have a controlled Shutdown process
without any hanged threads. The downside is a few error messages in the ShutDown() of the without any hanged threads. The downside is a few error messages in the ShutDown() of the
OpenGL plugin, so I still need FreeLibrary() to clean it, even with this option. */ OpenGL plugin, so I still need FreeLibrary() to clean it, even with this option. */
//#define SETUP_TIMER_WAITING //#define SETUP_TIMER_WAITING
// Build with playback rerecording options // Build with playback rerecording options
//#define RERECORDING //#define RERECORDING
// Build with music modification // Build with music modification
//#define MUSICMOD //#define MUSICMOD
/////////////////////////// ///////////////////////////
#endif // __SETUP_h__ #endif // __SETUP_h__

View File

@ -1,35 +1,35 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#pragma once #pragma once
#include <vector> #include <vector>
struct STileMetaContent struct STileMetaContent
{ {
u32 m_ContentID; u32 m_ContentID;
u16 m_Index; u16 m_Index;
u16 m_Type; u16 m_Type;
u32 m_Size; u32 m_Size;
u8* m_pData; u8* m_pData;
}; };
// [TODO]: this global internal stuff sux... the whole data should be inside the ES // [TODO]: this global internal stuff sux... the whole data should be inside the ES
// but this is the easiest way atm // but this is the easiest way atm
extern std::vector<STileMetaContent> m_TileMetaContent; extern std::vector<STileMetaContent> m_TileMetaContent;

View File

@ -1,41 +1,41 @@
// Copyright (C) 2003-2009 Dolphin Project. // Copyright (C) 2003-2009 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _SERIALINTERFACE_H #ifndef _SERIALINTERFACE_H
#define _SERIALINTERFACE_H #define _SERIALINTERFACE_H
#include "Common.h" #include "Common.h"
#include "SI_Device.h" #include "SI_Device.h"
class PointerWrap; class PointerWrap;
namespace SerialInterface namespace SerialInterface
{ {
void Init(); void Init();
void Shutdown(); void Shutdown();
void DoState(PointerWrap &p); void DoState(PointerWrap &p);
void UpdateDevices(); void UpdateDevices();
void RemoveDevice(int _iDeviceNumber); void RemoveDevice(int _iDeviceNumber);
void AddDevice(const TSIDevices _device, int _iDeviceNumber); void AddDevice(const TSIDevices _device, int _iDeviceNumber);
void HWCALL Read32(u32& _uReturnValue, const u32 _iAddress); void HWCALL Read32(u32& _uReturnValue, const u32 _iAddress);
void HWCALL Write32(const u32 _iValue, const u32 _iAddress); void HWCALL Write32(const u32 _iValue, const u32 _iAddress);
}; // end of namespace SerialInterface }; // end of namespace SerialInterface
#endif #endif

View File

@ -1,76 +1,76 @@
// Copyright (C) 2003-2009 Dolphin Project. // Copyright (C) 2003-2009 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _SIDEVICE_H #ifndef _SIDEVICE_H
#define _SIDEVICE_H #define _SIDEVICE_H
#include "Common.h" #include "Common.h"
// Devices can reply with these, but idk if we'll ever use them... // Devices can reply with these, but idk if we'll ever use them...
#define SI_ERROR_NO_RESPONSE 0x0008 // Nothing is attached #define SI_ERROR_NO_RESPONSE 0x0008 // Nothing is attached
#define SI_ERROR_UNKNOWN 0x0040 // Unknown device is attached #define SI_ERROR_UNKNOWN 0x0040 // Unknown device is attached
#define SI_ERROR_BUSY 0x0080 // Still detecting #define SI_ERROR_BUSY 0x0080 // Still detecting
// Device types // Device types
#define SI_TYPE_MASK 0x18000000u // ??? #define SI_TYPE_MASK 0x18000000u // ???
#define SI_TYPE_GC 0x08000000u #define SI_TYPE_GC 0x08000000u
// GC Controller types // GC Controller types
#define SI_GC_NOMOTOR 0x20000000u // No rumble motor #define SI_GC_NOMOTOR 0x20000000u // No rumble motor
#define SI_GC_STANDARD 0x01000000u #define SI_GC_STANDARD 0x01000000u
class ISIDevice class ISIDevice
{ {
protected: protected:
int m_iDeviceNumber; int m_iDeviceNumber;
public: public:
// Constructor // Constructor
ISIDevice(int _iDeviceNumber) : ISIDevice(int _iDeviceNumber) :
m_iDeviceNumber(_iDeviceNumber) m_iDeviceNumber(_iDeviceNumber)
{} {}
// Destructor // Destructor
virtual ~ISIDevice() {} virtual ~ISIDevice() {}
// Run the SI Buffer // Run the SI Buffer
virtual int RunBuffer(u8* _pBuffer, int _iLength); virtual int RunBuffer(u8* _pBuffer, int _iLength);
// Return true on new data // Return true on new data
virtual bool GetData(u32& _Hi, u32& _Low) = 0; virtual bool GetData(u32& _Hi, u32& _Low) = 0;
// Send a command directly (no detour per buffer) // Send a command directly (no detour per buffer)
virtual void SendCommand(u32 _Cmd) = 0; virtual void SendCommand(u32 _Cmd) = 0;
}; };
// SI Device IDs // SI Device IDs
enum TSIDevices enum TSIDevices
{ {
SI_DUMMY = 0, SI_DUMMY = 0,
SI_N64_MIC = 0x00010000, SI_N64_MIC = 0x00010000,
SI_N64_KEYBOARD = 0x00020000, SI_N64_KEYBOARD = 0x00020000,
SI_N64_MOUSE = 0x02000000, SI_N64_MOUSE = 0x02000000,
SI_N64_CONTROLLER = 0x05000000, SI_N64_CONTROLLER = 0x05000000,
SI_GBA = 0x00040000, SI_GBA = 0x00040000,
SI_GC_CONTROLLER = (SI_TYPE_GC | SI_GC_STANDARD), SI_GC_CONTROLLER = (SI_TYPE_GC | SI_GC_STANDARD),
SI_GC_KEYBOARD = (SI_TYPE_GC | 0x00200000), SI_GC_KEYBOARD = (SI_TYPE_GC | 0x00200000),
SI_GC_STEERING = SI_TYPE_GC, // (shuffle2)I think the "chainsaw" is the same (Or else it's just standard) SI_GC_STEERING = SI_TYPE_GC, // (shuffle2)I think the "chainsaw" is the same (Or else it's just standard)
}; };
extern ISIDevice* SIDevice_Create(TSIDevices _SIDevice, int _iDeviceNumber); extern ISIDevice* SIDevice_Create(TSIDevices _SIDevice, int _iDeviceNumber);
#endif #endif

View File

@ -1,90 +1,90 @@
// Copyright (C) 2003-2009 Dolphin Project. // Copyright (C) 2003-2009 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _SI_DEVICEGCCONTROLLER_H #ifndef _SI_DEVICEGCCONTROLLER_H
#define _SI_DEVICEGCCONTROLLER_H #define _SI_DEVICEGCCONTROLLER_H
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// standard gamecube controller // standard gamecube controller
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
class CSIDevice_GCController : public ISIDevice class CSIDevice_GCController : public ISIDevice
{ {
private: private:
// Commands // Commands
enum EBufferCommands enum EBufferCommands
{ {
CMD_INVALID = 0xFFFFFFFF, CMD_INVALID = 0xFFFFFFFF,
CMD_RESET = 0x00, CMD_RESET = 0x00,
CMD_ORIGIN = 0x41, CMD_ORIGIN = 0x41,
CMD_RECALIBRATE = 0x42, CMD_RECALIBRATE = 0x42,
}; };
struct SOrigin struct SOrigin
{ {
u8 uCommand; u8 uCommand;
u8 unk_1; u8 unk_1;
u8 uOriginStickX; u8 uOriginStickX;
u8 uOriginStickY; u8 uOriginStickY;
u8 uSubStickStickX; // ??? u8 uSubStickStickX; // ???
u8 uSubStickStickY; // ??? u8 uSubStickStickY; // ???
u8 uTrigger_L; // ??? u8 uTrigger_L; // ???
u8 uTrigger_R; // ??? u8 uTrigger_R; // ???
u8 unk_4; u8 unk_4;
u8 unk_5; u8 unk_5;
u8 unk_6; u8 unk_6;
u8 unk_7; u8 unk_7;
}; };
enum EDirectCommands enum EDirectCommands
{ {
CMD_RUMBLE = 0x40 CMD_RUMBLE = 0x40
}; };
union UCommand union UCommand
{ {
u32 Hex; u32 Hex;
struct struct
{ {
unsigned Parameter1 : 8; unsigned Parameter1 : 8;
unsigned Parameter2 : 8; unsigned Parameter2 : 8;
unsigned Command : 8; unsigned Command : 8;
unsigned : 8; unsigned : 8;
}; };
UCommand() {Hex = 0;} UCommand() {Hex = 0;}
UCommand(u32 _iValue) {Hex = _iValue;} UCommand(u32 _iValue) {Hex = _iValue;}
}; };
SOrigin m_origin; SOrigin m_origin;
int DeviceNum; int DeviceNum;
public: public:
// Constructor // Constructor
CSIDevice_GCController(int _iDeviceNumber); CSIDevice_GCController(int _iDeviceNumber);
// Run the SI Buffer // Run the SI Buffer
virtual int RunBuffer(u8* _pBuffer, int _iLength); virtual int RunBuffer(u8* _pBuffer, int _iLength);
// Return true on new data // Return true on new data
virtual bool GetData(u32& _Hi, u32& _Low); virtual bool GetData(u32& _Hi, u32& _Low);
// Send a command directly // Send a command directly
virtual void SendCommand(u32 _Cmd); virtual void SendCommand(u32 _Cmd);
}; };
#endif #endif

View File

@ -1,33 +1,33 @@
/********************************************************************* /*********************************************************************
Nintendo GameCube ADPCM Decoder Core Class Nintendo GameCube ADPCM Decoder Core Class
Original Author: Shinji Chiba <ch3@mail.goo.ne.jp> Original Author: Shinji Chiba <ch3@mail.goo.ne.jp>
Modified to fit Dolphin code style by ector Modified to fit Dolphin code style by ector
History: Mar.19 2001 - Create. History: Mar.19 2001 - Create.
*********************************************************************/ *********************************************************************/
#ifndef _STREAMADPCM_H #ifndef _STREAMADPCM_H
#define _STREAMADPCM_H #define _STREAMADPCM_H
#include "Common.h" #include "Common.h"
class PointerWrap; class PointerWrap;
#define ONE_BLOCK_SIZE 32 #define ONE_BLOCK_SIZE 32
#define SAMPLES_PER_BLOCK 28 #define SAMPLES_PER_BLOCK 28
#define MONO 1 #define MONO 1
#define STEREO 2 #define STEREO 2
class NGCADPCM class NGCADPCM
{ {
public: public:
static void InitFilter(); static void InitFilter();
static void DecodeBlock( short*pcm, u8 *adpcm); static void DecodeBlock( short*pcm, u8 *adpcm);
private: private:
static float iir1[STEREO], iir2[STEREO]; static float iir1[STEREO], iir2[STEREO];
static short DecodeSample(int, int, int); static short DecodeSample(int, int, int);
}; };
#endif #endif

View File

@ -1,31 +1,31 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _SDINTERFACE_H #ifndef _SDINTERFACE_H
#define _SDINTERFACE_H #define _SDINTERFACE_H
#include "Common.h" #include "Common.h"
#include <string> #include <string>
namespace SDInterface namespace SDInterface
{ {
bool IsCardInserted(); bool IsCardInserted();
void SetSourceType(bool isDumpFile); void SetSourceType(bool isDumpFile);
void SetSourcePath(const std::string path); void SetSourcePath(const std::string path);
} }
#endif #endif

View File

@ -1,60 +1,60 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef __ARCODE_ADDEDIT_h__ #ifndef __ARCODE_ADDEDIT_h__
#define __ARCODE_ADDEDIT_h__ #define __ARCODE_ADDEDIT_h__
#include <wx/wx.h> #include <wx/wx.h>
#include <wx/spinctrl.h> #include <wx/spinctrl.h>
#include "ISOProperties.h" #include "ISOProperties.h"
class CARCodeAddEdit : public wxDialog class CARCodeAddEdit : public wxDialog
{ {
public: public:
CARCodeAddEdit(int _selection, wxWindow* parent, CARCodeAddEdit(int _selection, wxWindow* parent,
wxWindowID id = 1, wxWindowID id = 1,
const wxString& title = wxT("Edit ActionReplay Code"), const wxString& title = wxT("Edit ActionReplay Code"),
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE); long style = wxDEFAULT_DIALOG_STYLE);
virtual ~CARCodeAddEdit(); virtual ~CARCodeAddEdit();
private: private:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
wxTextCtrl *EditCheatName; wxTextCtrl *EditCheatName;
wxSpinButton *EntrySelection; wxSpinButton *EntrySelection;
wxTextCtrl *EditCheatCode; wxTextCtrl *EditCheatCode;
enum { enum {
ID_EDITCHEAT_NAME_TEXT = 4550, ID_EDITCHEAT_NAME_TEXT = 4550,
ID_EDITCHEAT_NAME, ID_EDITCHEAT_NAME,
ID_ENTRY_SELECT, ID_ENTRY_SELECT,
ID_EDITCHEAT_CODE ID_EDITCHEAT_CODE
}; };
void CreateGUIControls(int selection); void CreateGUIControls(int selection);
void OnClose(wxCloseEvent& event); void OnClose(wxCloseEvent& event);
void SaveCheatData(wxCommandEvent& event); void SaveCheatData(wxCommandEvent& event);
void ChangeEntry(wxSpinEvent& event); void ChangeEntry(wxSpinEvent& event);
void UpdateTextCtrl(ActionReplay::ARCode arCode); void UpdateTextCtrl(ActionReplay::ARCode arCode);
int selection; int selection;
ActionReplay::ARCode tempEntries; ActionReplay::ARCode tempEntries;
}; };
#endif // __PATCH_ADDEDIT_h__ #endif // __PATCH_ADDEDIT_h__

View File

@ -1,45 +1,45 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef __SDCARD_WINDOW_h__ #ifndef __SDCARD_WINDOW_h__
#define __SDCARD_WINDOW_h__ #define __SDCARD_WINDOW_h__
#include <wx/wx.h> #include <wx/wx.h>
class wxSDCardWindow : public wxDialog class wxSDCardWindow : public wxDialog
{ {
public: public:
wxSDCardWindow(wxWindow* parent); wxSDCardWindow(wxWindow* parent);
virtual ~wxSDCardWindow(); virtual ~wxSDCardWindow();
protected: protected:
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
wxButton *m_Button_Close; wxButton *m_Button_Close;
enum enum
{ {
ID_BUTTON_CLOSE, ID_BUTTON_CLOSE,
}; };
void Init_ChildControls(); void Init_ChildControls();
void OnEvent_Window_Close(wxCloseEvent& event); void OnEvent_Window_Close(wxCloseEvent& event);
void OnEvent_ButtonClose_Press(wxCommandEvent& event); void OnEvent_ButtonClose_Press(wxCommandEvent& event);
}; };
#endif #endif

View File

@ -1,248 +1,248 @@
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Project description // Project description
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
// Name: SDL Input // Name: SDL Input
// Description: Common SDL Input Functions // Description: Common SDL Input Functions
// //
// Author: Falcon4ever (nJoy@falcon4ever.com, www.multigesture.net), JPeterson etc // Author: Falcon4ever (nJoy@falcon4ever.com, www.multigesture.net), JPeterson etc
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// //
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// //
// Licensetype: GNU General Public License (GPL) // Licensetype: GNU General Public License (GPL)
// //
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// //
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// //
// 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/
// //
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
#ifndef _SDL_h #ifndef _SDL_h
#define _SDL_h #define _SDL_h
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Include // Include
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
#include <iostream> // System #include <iostream> // System
#include <vector> #include <vector>
#include <cmath> #include <cmath>
#ifdef _WIN32 #ifdef _WIN32
#include <SDL.h> // Externals #include <SDL.h> // Externals
#else #else
#include <SDL/SDL.h> #include <SDL/SDL.h>
#endif #endif
#include "Common.h" // Common #include "Common.h" // Common
#include "ConsoleWindow.h" #include "ConsoleWindow.h"
//////////////////////////// ////////////////////////////
namespace InputCommon namespace InputCommon
{ {
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Settings // Settings
// ¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯
// Show a status window with the detected axes, buttons and so on // Show a status window with the detected axes, buttons and so on
//#define SHOW_PAD_STATUS //#define SHOW_PAD_STATUS
////////////////////////// //////////////////////////
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Structures // Structures
/* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ /* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
CONTROLLER_STATE buttons (PadState) = 0 or 1 CONTROLLER_STATE buttons (PadState) = 0 or 1
CONTROLLER_MAPPING buttons (joystick) = 0 or 1, 2, 3, 4, a certain joypad button CONTROLLER_MAPPING buttons (joystick) = 0 or 1, 2, 3, 4, a certain joypad button
Please remember: The axis limit is hardcoded here, if you allow more axises (for Please remember: The axis limit is hardcoded here, if you allow more axises (for
example for analog A and B buttons) you must first incrase the size of the axis array example for analog A and B buttons) you must first incrase the size of the axis array
size here size here
*/ */
struct CONTROLLER_STATE // GC PAD INFO/STATE struct CONTROLLER_STATE // GC PAD INFO/STATE
{ {
int buttons[8]; // Amount of buttons (A B X Y Z, L-Trigger R-Trigger Start) might need to change the triggers buttons int buttons[8]; // Amount of buttons (A B X Y Z, L-Trigger R-Trigger Start) might need to change the triggers buttons
int dpad; // Automatic SDL D-Pad (8 directions + neutral) int dpad; // Automatic SDL D-Pad (8 directions + neutral)
int dpad2[4]; // D-pad using buttons int dpad2[4]; // D-pad using buttons
int axis[6]; // 2 x 2 Axes (Main & Sub) int axis[6]; // 2 x 2 Axes (Main & Sub)
int halfpress; // Halfpress... you know, like not fully pressed ;)... int halfpress; // Halfpress... you know, like not fully pressed ;)...
SDL_Joystick *joy; // SDL joystick device SDL_Joystick *joy; // SDL joystick device
}; };
struct CONTROLLER_MAPPING // GC PAD MAPPING struct CONTROLLER_MAPPING // GC PAD MAPPING
{ {
int buttons[8]; // (See above) int buttons[8]; // (See above)
int dpad; // (See above) int dpad; // (See above)
int dpad2[4]; // (See above) int dpad2[4]; // (See above)
int axis[6]; // (See above) int axis[6]; // (See above)
int halfpress; // (See above) int halfpress; // (See above)
int enabled; // Pad attached? int enabled; // Pad attached?
int deadzone; // Deadzone... what else? int deadzone; // Deadzone... what else?
int ID; // SDL joystick device ID int ID; // SDL joystick device ID
int controllertype; // Hat: Hat or custom buttons int controllertype; // Hat: Hat or custom buttons
int triggertype; // Triggers range int triggertype; // Triggers range
std::string SDiagonal; std::string SDiagonal;
bool bSquareToCircle; bool bSquareToCircle;
int eventnum; // Linux Event Number, Can't be found dynamically yet int eventnum; // Linux Event Number, Can't be found dynamically yet
}; };
struct CONTROLLER_INFO // CONNECTED WINDOWS DEVICES INFO struct CONTROLLER_INFO // CONNECTED WINDOWS DEVICES INFO
{ {
int NumAxes; // Amount of Axes int NumAxes; // Amount of Axes
int NumButtons; // Amount of Buttons int NumButtons; // Amount of Buttons
int NumBalls; // Amount of Balls int NumBalls; // Amount of Balls
int NumHats; // Amount of Hats (POV) int NumHats; // Amount of Hats (POV)
std::string Name; // Joypad/stickname std::string Name; // Joypad/stickname
int ID; // SDL joystick device ID int ID; // SDL joystick device ID
bool Good; // Pad is good (it has at least one button or axis) bool Good; // Pad is good (it has at least one button or axis)
SDL_Joystick *joy; // SDL joystick device SDL_Joystick *joy; // SDL joystick device
}; };
enum enum
{ {
// CTL_L_SHOULDER and CTL_R_SHOULDER = 0 and 1 // CTL_L_SHOULDER and CTL_R_SHOULDER = 0 and 1
CTL_MAIN_X = 2, CTL_MAIN_X = 2,
CTL_MAIN_Y, CTL_MAIN_Y,
CTL_SUB_X, CTL_SUB_X,
CTL_SUB_Y CTL_SUB_Y
}; };
enum enum
{ {
CTL_L_SHOULDER = 0, CTL_L_SHOULDER = 0,
CTL_R_SHOULDER, CTL_R_SHOULDER,
CTL_A_BUTTON, CTL_A_BUTTON,
CTL_B_BUTTON, CTL_B_BUTTON,
CTL_X_BUTTON, CTL_X_BUTTON,
CTL_Y_BUTTON, CTL_Y_BUTTON,
CTL_Z_TRIGGER, CTL_Z_TRIGGER,
CTL_START CTL_START
}; };
// DPad Type // DPad Type
enum enum
{ {
CTL_DPAD_HAT = 0, // Automatically use the first hat that SDL finds CTL_DPAD_HAT = 0, // Automatically use the first hat that SDL finds
CTL_DPAD_CUSTOM // Custom directional pad settings CTL_DPAD_CUSTOM // Custom directional pad settings
}; };
// Trigger Type // Trigger Type
enum enum
{ {
CTL_TRIGGER_SDL = 0, // CTL_TRIGGER_SDL = 0, //
CTL_TRIGGER_XINPUT // The XBox 360 pad CTL_TRIGGER_XINPUT // The XBox 360 pad
}; };
enum enum
{ {
CTL_D_PAD_UP = 0, CTL_D_PAD_UP = 0,
CTL_D_PAD_DOWN, CTL_D_PAD_DOWN,
CTL_D_PAD_LEFT, CTL_D_PAD_LEFT,
CTL_D_PAD_RIGHT CTL_D_PAD_RIGHT
}; };
// Button type for the configuration // Button type for the configuration
enum enum
{ {
CTL_AXIS = 0, CTL_AXIS = 0,
CTL_HAT, CTL_HAT,
CTL_BUTTON, CTL_BUTTON,
CTL_KEY CTL_KEY
}; };
// XInput buttons // XInput buttons
enum enum
{ {
XI_TRIGGER_L = 0, XI_TRIGGER_L = 0,
XI_TRIGGER_R XI_TRIGGER_R
}; };
struct PadAxis struct PadAxis
{ {
int Lx; int Lx;
int Ly; int Ly;
int Rx; int Rx;
int Ry; int Ry;
int Tl; // Triggers int Tl; // Triggers
int Tr; int Tr;
}; };
struct PadWiimote struct PadWiimote
{ {
int A; int A;
int B; int B;
int One; int One;
int Two; int Two;
int P; int P;
int M; int M;
int H; int H;
int L, R, U, D; int L, R, U, D;
int Shake; int Shake;
int PitchL, PitchR; int PitchL, PitchR;
}; };
struct PadNunchuck struct PadNunchuck
{ {
int Z; int Z;
int C; int C;
int L, R, U, D; int L, R, U, D;
int Shake; int Shake;
}; };
struct CONTROLLER_STATE_NEW // GC PAD INFO/STATE struct CONTROLLER_STATE_NEW // GC PAD INFO/STATE
{ {
PadAxis Axis; // 6 Axes (Main, Sub, Triggers) PadAxis Axis; // 6 Axes (Main, Sub, Triggers)
SDL_Joystick *joy; // SDL joystick device SDL_Joystick *joy; // SDL joystick device
}; };
struct CONTROLLER_MAPPING_NEW // GC PAD MAPPING struct CONTROLLER_MAPPING_NEW // GC PAD MAPPING
{ {
PadAxis Axis; // (See above) PadAxis Axis; // (See above)
PadWiimote Wm; PadWiimote Wm;
PadNunchuck Nc; PadNunchuck Nc;
bool enabled; // Pad attached? bool enabled; // Pad attached?
int DeadZoneL; // Analog 1 Deadzone int DeadZoneL; // Analog 1 Deadzone
int DeadZoneR; // Analog 2 Deadzone int DeadZoneR; // Analog 2 Deadzone
int ID; // SDL joystick device ID int ID; // SDL joystick device ID
int controllertype; // D-Pad type: Hat or custom buttons int controllertype; // D-Pad type: Hat or custom buttons
int triggertype; // SDL or XInput trigger int triggertype; // SDL or XInput trigger
std::string SDiagonal; std::string SDiagonal;
bool bSquareToCircle; bool bSquareToCircle;
bool bCircle2Square; bool bCircle2Square;
bool bRollInvert; bool bRollInvert;
bool bPitchInvert; bool bPitchInvert;
}; };
//////////////////////////// ////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Declarations // Declarations
// ¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯
// General functions // General functions
bool SearchDevices(std::vector<CONTROLLER_INFO> &_joyinfo, int &NumPads, int &NumGoodPads); bool SearchDevices(std::vector<CONTROLLER_INFO> &_joyinfo, int &NumPads, int &NumGoodPads);
void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping, int controller, int NumButtons); void GetJoyState(CONTROLLER_STATE &_PadState, CONTROLLER_MAPPING _PadMapping, int controller, int NumButtons);
void GetButton(SDL_Joystick*, int,int,int,int, int&,int&,int&,int&,bool&,bool&, bool,bool,bool,bool,bool,bool); void GetButton(SDL_Joystick*, int,int,int,int, int&,int&,int&,int&,bool&,bool&, bool,bool,bool,bool,bool,bool);
// Value conversion // Value conversion
float Deg2Rad(float Deg); float Deg2Rad(float Deg);
float Rad2Deg(float Rad); float Rad2Deg(float Rad);
int Pad_Convert(int _val); int Pad_Convert(int _val);
float SquareDistance(float deg); float SquareDistance(float deg);
bool IsDeadZone(float DeadZone, int x, int y); bool IsDeadZone(float DeadZone, int x, int y);
std::vector<int> Square2Circle(int _x, int _y, int _pad, std::string SDiagonal, bool Circle2Square = false); std::vector<int> Square2Circle(int _x, int _y, int _pad, std::string SDiagonal, bool Circle2Square = false);
// Input configuration // Input configuration
std::string VKToString(int keycode); std::string VKToString(int keycode);
#ifndef _SDL_MAIN_ #ifndef _SDL_MAIN_
extern int g_LastPad; extern int g_LastPad;
#endif #endif
//////////////////////////// ////////////////////////////
} // InputCommon } // InputCommon
#endif // _SDL_h #endif // _SDL_h

View File

@ -1,45 +1,45 @@
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// //
// Licensetype: GNU General Public License (GPL) // Licensetype: GNU General Public License (GPL)
// //
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// //
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// //
// 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/
// //
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
#ifdef _WIN32 #ifdef _WIN32
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Includes // Includes
// ¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯
#include <iostream> #include <iostream>
////////////////////////////// //////////////////////////////
namespace XInput namespace XInput
{ {
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Declarations // Declarations
// ¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯
void Init(); void Init();
int GetXI(int Controller, int Button); int GetXI(int Controller, int Button);
bool IsConnected(int Controller); bool IsConnected(int Controller);
////////////////////////////// //////////////////////////////
} // XInput } // XInput
#endif #endif

View File

@ -1,34 +1,34 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _NATIVE_VERTEX_WRITER #ifndef _NATIVE_VERTEX_WRITER
#define _NATIVE_VERTEX_WRITER #define _NATIVE_VERTEX_WRITER
// TODO: rename // TODO: rename
namespace VertexManager namespace VertexManager
{ {
void AddVertices(int primitive, int numvertices); void AddVertices(int primitive, int numvertices);
void Flush(); // flushes the current buffer void Flush(); // flushes the current buffer
int GetRemainingSize(); // remaining space in the current buffer. int GetRemainingSize(); // remaining space in the current buffer.
// TODO: move, rename. // TODO: move, rename.
extern u8* s_pCurBufferPointer; extern u8* s_pCurBufferPointer;
} }
#endif #endif

View File

@ -1,132 +1,132 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _VIDEOCOMMON_H #ifndef _VIDEOCOMMON_H
#define _VIDEOCOMMON_H #define _VIDEOCOMMON_H
#include "Common.h" #include "Common.h"
#include "pluginspecs_video.h" #include "pluginspecs_video.h"
#if defined(_MSC_VER) && !defined(__x86_64__) && !defined(_M_X64) #if defined(_MSC_VER) && !defined(__x86_64__) && !defined(_M_X64)
void * memcpy_amd(void *dest, const void *src, size_t n); void * memcpy_amd(void *dest, const void *src, size_t n);
unsigned char memcmp_mmx(const void* src1, const void* src2, int cmpsize); unsigned char memcmp_mmx(const void* src1, const void* src2, int cmpsize);
#define memcpy_gc memcpy_amd #define memcpy_gc memcpy_amd
#define memcmp_gc memcmp_mmx #define memcmp_gc memcmp_mmx
#else #else
#define memcpy_gc memcpy #define memcpy_gc memcpy
#define memcmp_gc memcmp #define memcmp_gc memcmp
#endif #endif
enum { enum {
EFB_WIDTH = 640, EFB_WIDTH = 640,
EFB_HEIGHT = 528, EFB_HEIGHT = 528,
}; };
enum { enum {
XFB_WIDTH = 640, XFB_WIDTH = 640,
XFB_HEIGHT = 480, // 528 is max height ... ? or 538? XFB_HEIGHT = 480, // 528 is max height ... ? or 538?
// TODO: figure out what to do with PAL // TODO: figure out what to do with PAL
}; };
extern SVideoInitialize g_VideoInitialize; extern SVideoInitialize g_VideoInitialize;
// (mb2) for XFB update hack. TODO: find a static better place // (mb2) for XFB update hack. TODO: find a static better place
extern volatile u32 g_XFBUpdateRequested; extern volatile u32 g_XFBUpdateRequested;
void DebugLog(const char* _fmt, ...); void DebugLog(const char* _fmt, ...);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
inline u8 *Memory_GetPtr(u32 _uAddress) inline u8 *Memory_GetPtr(u32 _uAddress)
{ {
return g_VideoInitialize.pGetMemoryPointer(_uAddress);//&g_pMemory[_uAddress & RAM_MASK]; return g_VideoInitialize.pGetMemoryPointer(_uAddress);//&g_pMemory[_uAddress & RAM_MASK];
} }
inline u8 Memory_Read_U8(u32 _uAddress) inline u8 Memory_Read_U8(u32 _uAddress)
{ {
return *(u8*)g_VideoInitialize.pGetMemoryPointer(_uAddress);//g_pMemory[_uAddress & RAM_MASK]; return *(u8*)g_VideoInitialize.pGetMemoryPointer(_uAddress);//g_pMemory[_uAddress & RAM_MASK];
} }
inline u16 Memory_Read_U16(u32 _uAddress) inline u16 Memory_Read_U16(u32 _uAddress)
{ {
return Common::swap16(*(u16*)g_VideoInitialize.pGetMemoryPointer(_uAddress)); return Common::swap16(*(u16*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
} }
inline u32 Memory_Read_U32(u32 _uAddress) inline u32 Memory_Read_U32(u32 _uAddress)
{ {
return Common::swap32(*(u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress)); return Common::swap32(*(u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress));
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
inline u8* Memory_Read_U8_Ptr(u32 _uAddress) inline u8* Memory_Read_U8_Ptr(u32 _uAddress)
{ {
return (u8*)g_VideoInitialize.pGetMemoryPointer(_uAddress);//g_pMemory[_uAddress & RAM_MASK]; return (u8*)g_VideoInitialize.pGetMemoryPointer(_uAddress);//g_pMemory[_uAddress & RAM_MASK];
} }
inline u16* Memory_Read_U16_Unswapped_Ptr(u32 _uAddress) inline u16* Memory_Read_U16_Unswapped_Ptr(u32 _uAddress)
{ {
return (u16*)g_VideoInitialize.pGetMemoryPointer(_uAddress); return (u16*)g_VideoInitialize.pGetMemoryPointer(_uAddress);
} }
inline u32* Memory_Read_U32_Unswapped_Ptr(u32 _uAddress) inline u32* Memory_Read_U32_Unswapped_Ptr(u32 _uAddress)
{ {
return (u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress); return (u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
inline u32 Memory_Read_U32_Unswapped(u32 _uAddress) inline u32 Memory_Read_U32_Unswapped(u32 _uAddress)
{ {
return *(u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress); return *(u32*)g_VideoInitialize.pGetMemoryPointer(_uAddress);
} }
inline float Memory_Read_Float(u32 _uAddress) inline float Memory_Read_Float(u32 _uAddress)
{ {
union {u32 i; float f;} temp; union {u32 i; float f;} temp;
temp.i = Memory_Read_U32(_uAddress); temp.i = Memory_Read_U32(_uAddress);
return temp.f; return temp.f;
} }
struct TRectangle struct TRectangle
{ {
int left, top, right, bottom; int left, top, right, bottom;
}; };
// Logging // Logging
// ¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯
void DebugLog(const char* _fmt, ...); // This one goes to the main program void DebugLog(const char* _fmt, ...); // This one goes to the main program
void HandleGLError(); void HandleGLError();
#ifdef _WIN32 #ifdef _WIN32
#define ERROR_LOG(...) {LOG(VIDEO, __VA_ARGS__)} #define ERROR_LOG(...) {LOG(VIDEO, __VA_ARGS__)}
#define INFO_LOG(...) {LOG(VIDEO, __VA_ARGS__)} #define INFO_LOG(...) {LOG(VIDEO, __VA_ARGS__)}
#define PRIM_LOG(...) {LOG(VIDEO, __VA_ARGS__)} #define PRIM_LOG(...) {LOG(VIDEO, __VA_ARGS__)}
#define DEBUG_LOG(...) {LOG(VIDEO, __VA_ARGS__)} #define DEBUG_LOG(...) {LOG(VIDEO, __VA_ARGS__)}
#else #else
#define ERROR_LOG(...) {LOG(VIDEO, ##__VA_ARGS__)} #define ERROR_LOG(...) {LOG(VIDEO, ##__VA_ARGS__)}
#define INFO_LOG(...) {LOG(VIDEO, ##__VA_ARGS__)} #define INFO_LOG(...) {LOG(VIDEO, ##__VA_ARGS__)}
#define PRIM_LOG(...) {LOG(VIDEO, ##__VA_ARGS__)} #define PRIM_LOG(...) {LOG(VIDEO, ##__VA_ARGS__)}
#define DEBUG_LOG(...) {LOG(VIDEO, ##__VA_ARGS__)} #define DEBUG_LOG(...) {LOG(VIDEO, ##__VA_ARGS__)}
#endif #endif
#ifdef LOGGING #ifdef LOGGING
#define LOG_VTX() PRIM_LOG("vtx: %f %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[0], ((float*)VertexManager::s_pCurBufferPointer)[1], ((float*)VertexManager::s_pCurBufferPointer)[2]); #define LOG_VTX() PRIM_LOG("vtx: %f %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[0], ((float*)VertexManager::s_pCurBufferPointer)[1], ((float*)VertexManager::s_pCurBufferPointer)[2]);
#else #else
#define LOG_VTX() #define LOG_VTX()
#endif #endif
#endif // _VIDEOCOMMON_H #endif // _VIDEOCOMMON_H

View File

@ -1,40 +1,40 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Declarations and definitions // Declarations and definitions
// ------------- // -------------
// -------------------- // --------------------
// Settings // Settings
// ------------- // -------------
const int nFiles = 4; const int nFiles = 4;
const int StringSize = 5000; // Warning, mind this value, if exceeded a crash may occur const int StringSize = 5000; // Warning, mind this value, if exceeded a crash may occur
// -------------------- // --------------------
// Functions // Functions
// ------------- // -------------
void StartFile(int width, int height, char* fname); void StartFile(int width, int height, char* fname);
void StopFile(); void StopFile();
int PrintFile(int a, char *fmt, ...); int PrintFile(int a, char *fmt, ...);
void OpenConsole(); void OpenConsole();
void CloseConsole(); void CloseConsole();
#ifdef _WIN32 #ifdef _WIN32
HWND GetConsoleHwnd(void); HWND GetConsoleHwnd(void);
#endif #endif
///////////////////////////// /////////////////////////////

View File

@ -1,50 +1,50 @@
// Copyright (C) 2003-2009 Dolphin Project. // Copyright (C) 2003-2009 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef __SOUNDSTREAM_H__ #ifndef __SOUNDSTREAM_H__
#define __SOUNDSTREAM_H__ #define __SOUNDSTREAM_H__
#include "Common.h" #include "Common.h"
typedef void (*StreamCallback)(short* buffer, int numSamples, int bits, int rate, int channels); typedef void (*StreamCallback)(short* buffer, int numSamples, int bits, int rate, int channels);
class SoundStream class SoundStream
{ {
protected: protected:
int sampleRate; int sampleRate;
StreamCallback callback; StreamCallback callback;
// We set this to shut down the sound thread. // We set this to shut down the sound thread.
// 0=keep playing, 1=stop playing NOW. // 0=keep playing, 1=stop playing NOW.
volatile int threadData; volatile int threadData;
public: public:
SoundStream(int _sampleRate, StreamCallback _callback) : SoundStream(int _sampleRate, StreamCallback _callback) :
sampleRate(_sampleRate), callback(_callback), threadData(0) {} sampleRate(_sampleRate), callback(_callback), threadData(0) {}
virtual ~SoundStream() {} virtual ~SoundStream() {}
static bool isValid() { return false; } static bool isValid() { return false; }
virtual bool usesMixer() const { return false; } virtual bool usesMixer() const { return false; }
virtual bool Start() { return false; } virtual bool Start() { return false; }
virtual void SoundLoop() {} virtual void SoundLoop() {}
virtual void Stop() {} virtual void Stop() {}
virtual void Update() {} virtual void Update() {}
virtual int GetSampleRate() const { return sampleRate; } virtual int GetSampleRate() const { return sampleRate; }
}; };
#endif #endif

View File

@ -1,63 +1,63 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _PIXELSHADERCACHE_H #ifndef _PIXELSHADERCACHE_H
#define _PIXELSHADERCACHE_H #define _PIXELSHADERCACHE_H
#include "D3DBase.h" #include "D3DBase.h"
#include <map> #include <map>
#include "PixelShader.h" #include "PixelShader.h"
#include "VertexShader.h" #include "VertexShader.h"
typedef u32 tevhash; typedef u32 tevhash;
tevhash GetCurrentTEV(); tevhash GetCurrentTEV();
class PShaderCache class PShaderCache
{ {
struct PSCacheEntry struct PSCacheEntry
{ {
LPDIRECT3DPIXELSHADER9 shader; LPDIRECT3DPIXELSHADER9 shader;
int frameCount; int frameCount;
PSCacheEntry() PSCacheEntry()
{ {
shader = 0; shader = 0;
frameCount = 0; frameCount = 0;
} }
void Destroy() void Destroy()
{ {
if (shader) if (shader)
shader->Release(); shader->Release();
} }
}; };
typedef std::map<tevhash, PSCacheEntry> PSCache; typedef std::map<tevhash, PSCacheEntry> PSCache;
static PSCache pshaders; static PSCache pshaders;
public: public:
static void Init(); static void Init();
static void Cleanup(); static void Cleanup();
static void Shutdown(); static void Shutdown();
static void SetShader(); static void SetShader();
}; };
#endif // _PIXELSHADERCACHE_H #endif // _PIXELSHADERCACHE_H

View File

@ -1,57 +1,57 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _VERTEXSHADERCACHE_H #ifndef _VERTEXSHADERCACHE_H
#define _VERTEXSHADERCACHE_H #define _VERTEXSHADERCACHE_H
#include "D3DBase.h" #include "D3DBase.h"
#include <map> #include <map>
#include "PixelShader.h" #include "PixelShader.h"
#include "VertexShader.h" #include "VertexShader.h"
class VShaderCache class VShaderCache
{ {
struct VSCacheEntry struct VSCacheEntry
{ {
LPDIRECT3DVERTEXSHADER9 shader; LPDIRECT3DVERTEXSHADER9 shader;
int frameCount; int frameCount;
VSCacheEntry() VSCacheEntry()
{ {
shader = 0; shader = 0;
frameCount = 0; frameCount = 0;
} }
void Destroy() void Destroy()
{ {
if (shader) if (shader)
shader->Release(); shader->Release();
} }
}; };
typedef std::map<u32, VSCacheEntry> VSCache; typedef std::map<u32, VSCacheEntry> VSCache;
static VSCache vshaders; static VSCache vshaders;
public: public:
static void Init(); static void Init();
static void Cleanup(); static void Cleanup();
static void Shutdown(); static void Shutdown();
static void SetShader(); static void SetShader();
}; };
#endif // _VERTEXSHADERCACHE_H #endif // _VERTEXSHADERCACHE_H

View File

@ -1,30 +1,30 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _OSD_H #ifndef _OSD_H
#define _OSD_H #define _OSD_H
namespace OSD namespace OSD
{ {
// On-screen message display // On-screen message display
void AddMessage(const char* str, u32 ms); void AddMessage(const char* str, u32 ms);
void DrawMessages(); // draw the current messages on the screen. Only call once per frame. void DrawMessages(); // draw the current messages on the screen. Only call once per frame.
} // namespace } // namespace
#endif #endif

View File

@ -1,63 +1,63 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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 <map> #include <map>
#include <string> #include <string>
#include "BPMemory.h" #include "BPMemory.h"
#include "PixelShaderGen.h" #include "PixelShaderGen.h"
struct FRAGMENTSHADER struct FRAGMENTSHADER
{ {
FRAGMENTSHADER() : glprogid(0) { } FRAGMENTSHADER() : glprogid(0) { }
GLuint glprogid; // opengl program id GLuint glprogid; // opengl program id
#if defined(_DEBUG) || defined(DEBUGFAST) #if defined(_DEBUG) || defined(DEBUGFAST)
std::string strprog; std::string strprog;
#endif #endif
}; };
class PixelShaderCache class PixelShaderCache
{ {
struct PSCacheEntry struct PSCacheEntry
{ {
FRAGMENTSHADER shader; FRAGMENTSHADER shader;
int frameCount; int frameCount;
PSCacheEntry() : frameCount(0) {} PSCacheEntry() : frameCount(0) {}
~PSCacheEntry() {} ~PSCacheEntry() {}
void Destroy() { void Destroy() {
// printf("Destroying ps %i\n", shader.glprogid); // printf("Destroying ps %i\n", shader.glprogid);
glDeleteProgramsARB(1, &shader.glprogid); glDeleteProgramsARB(1, &shader.glprogid);
shader.glprogid = 0; shader.glprogid = 0;
} }
}; };
typedef std::map<PIXELSHADERUID, PSCacheEntry> PSCache; typedef std::map<PIXELSHADERUID, PSCacheEntry> PSCache;
static PSCache pshaders; static PSCache pshaders;
static PIXELSHADERUID s_curuid; // the current pixel shader uid (progressively changed as memory is written) static PIXELSHADERUID s_curuid; // the current pixel shader uid (progressively changed as memory is written)
public: public:
static void Init(); static void Init();
static void Cleanup(); static void Cleanup();
static void Shutdown(); static void Shutdown();
static FRAGMENTSHADER* GetShader(); static FRAGMENTSHADER* GetShader();
static bool CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrprogram); static bool CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrprogram);
static GLuint GetColorMatrixProgram(); static GLuint GetColorMatrixProgram();
}; };

View File

@ -1,38 +1,38 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _TEXTURECONVERSIONSHADER_H #ifndef _TEXTURECONVERSIONSHADER_H
#define _TEXTURECONVERSIONSHADER_H #define _TEXTURECONVERSIONSHADER_H
#include "Common.h" #include "Common.h"
#include "TextureDecoder.h" #include "TextureDecoder.h"
#include <Cg/cg.h> #include <Cg/cg.h>
namespace TextureConversionShader namespace TextureConversionShader
{ {
u16 GetBlockWidthInTexels(u32 format); u16 GetBlockWidthInTexels(u32 format);
u16 GetBlockHeightInTexels(u32 format); u16 GetBlockHeightInTexels(u32 format);
u16 GetEncodedSampleCount(u32 format); u16 GetEncodedSampleCount(u32 format);
const char *GenerateEncodingShader(u32 format); const char *GenerateEncodingShader(u32 format);
void SetShaderParameters(u32 width, u32 height, u32 offsetX, u32 offsetY, float pixelStride, u32 format); void SetShaderParameters(u32 width, u32 height, u32 offsetX, u32 offsetY, float pixelStride, u32 format);
} }
#endif #endif

View File

@ -1,59 +1,59 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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 <map> #include <map>
#include <string> #include <string>
#include "BPMemory.h" #include "BPMemory.h"
#include "VertexShaderGen.h" #include "VertexShaderGen.h"
struct VERTEXSHADER struct VERTEXSHADER
{ {
VERTEXSHADER() : glprogid(0) {} VERTEXSHADER() : glprogid(0) {}
GLuint glprogid; // opengl program id GLuint glprogid; // opengl program id
#if defined(_DEBUG) || defined(DEBUGFAST) #if defined(_DEBUG) || defined(DEBUGFAST)
std::string strprog; std::string strprog;
#endif #endif
}; };
class VertexShaderCache class VertexShaderCache
{ {
struct VSCacheEntry struct VSCacheEntry
{ {
VERTEXSHADER shader; VERTEXSHADER shader;
int frameCount; int frameCount;
VSCacheEntry() : frameCount(0) {} VSCacheEntry() : frameCount(0) {}
void Destroy() { void Destroy() {
// printf("Destroying vs %i\n", shader.glprogid); // printf("Destroying vs %i\n", shader.glprogid);
glDeleteProgramsARB(1, &shader.glprogid); glDeleteProgramsARB(1, &shader.glprogid);
shader.glprogid = 0; shader.glprogid = 0;
} }
}; };
typedef std::map<VERTEXSHADERUID, VSCacheEntry> VSCache; typedef std::map<VERTEXSHADERUID, VSCacheEntry> VSCache;
static VSCache vshaders; static VSCache vshaders;
public: public:
static void Init(); static void Init();
static void Cleanup(); static void Cleanup();
static void Shutdown(); static void Shutdown();
static VERTEXSHADER* GetShader(u32 components); static VERTEXSHADER* GetShader(u32 components);
static bool CompileVertexShader(VERTEXSHADER& ps, const char* pstrprogram); static bool CompileVertexShader(VERTEXSHADER& ps, const char* pstrprogram);
}; };

View File

@ -1,18 +1,18 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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 "XFMemory.h" #include "XFMemory.h"

View File

@ -1,40 +1,40 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef WIIMOTE_CONSOLE_H #ifndef WIIMOTE_CONSOLE_H
#define WIIMOTE_CONSOLE_H #define WIIMOTE_CONSOLE_H
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Includes // Includes
// ¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯
#include <iostream> #include <iostream>
#include "ConsoleWindow.h" #include "ConsoleWindow.h"
////////////////////////////// //////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Declarations // Declarations
// ¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯
std::string Tm(bool Ms = false); std::string Tm(bool Ms = false);
int PrintFile(int a, const char *fmt, ...); int PrintFile(int a, const char *fmt, ...);
void ClearScreen(); void ClearScreen();
#ifdef _WIN32 #ifdef _WIN32
HWND GetConsoleHwnd(void); HWND GetConsoleHwnd(void);
#endif #endif
/////////////////////////////// ///////////////////////////////
#endif // WIIMOTE_CONSOLE_H #endif // WIIMOTE_CONSOLE_H

View File

@ -1,109 +1,109 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef MAIN_H #ifndef MAIN_H
#define MAIN_H #define MAIN_H
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Includes // Includes
// ¯¯¯¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯¯¯¯
#include <iostream> // System #include <iostream> // System
//////////////////////////////// ////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Definitions and declarations // Definitions and declarations
// ¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯
#ifdef _WIN32 #ifdef _WIN32
#define sleep(x) Sleep(x) #define sleep(x) Sleep(x)
#else #else
#define sleep(x) usleep(x*1000) #define sleep(x) usleep(x*1000)
#endif #endif
void DoInitialize(); void DoInitialize();
double GetDoubleTime(); double GetDoubleTime();
int GetUpdateRate(); int GetUpdateRate();
void InterruptDebugging(bool Emu, const void* _pData); void InterruptDebugging(bool Emu, const void* _pData);
void ReadDebugging(bool Emu, const void* _pData, int Size); void ReadDebugging(bool Emu, const void* _pData, int Size);
bool IsFocus(); bool IsFocus();
void OpenConsole(bool Open = false); void OpenConsole(bool Open = false);
// Movement recording // Movement recording
#define RECORDING_ROWS 15 #define RECORDING_ROWS 15
#define WM_RECORDING_WIIMOTE 0 #define WM_RECORDING_WIIMOTE 0
#define WM_RECORDING_NUNCHUCK 1 #define WM_RECORDING_NUNCHUCK 1
#define WM_RECORDING_IR 2 #define WM_RECORDING_IR 2
struct SRecording struct SRecording
{ {
int x; int x;
int y; int y;
int z; int z;
double Time; double Time;
u8 IR[12]; u8 IR[12];
}; };
struct SRecordingAll struct SRecordingAll
{ {
std::vector<SRecording> Recording; std::vector<SRecording> Recording;
int HotKeySwitch, HotKeyWiimote, HotKeyNunchuck, HotKeyIR; int HotKeySwitch, HotKeyWiimote, HotKeyNunchuck, HotKeyIR;
int PlaybackSpeed; int PlaybackSpeed;
int IRBytes; int IRBytes;
}; };
#ifndef EXCLUDEMAIN_H #ifndef EXCLUDEMAIN_H
// General // General
extern bool g_EmulatorRunning; extern bool g_EmulatorRunning;
extern u32 g_ISOId; extern u32 g_ISOId;
extern bool g_FrameOpen; extern bool g_FrameOpen;
extern bool g_RealWiiMotePresent; extern bool g_RealWiiMotePresent;
extern bool g_RealWiiMoteInitialized; extern bool g_RealWiiMoteInitialized;
extern bool g_EmulatedWiiMoteInitialized; extern bool g_EmulatedWiiMoteInitialized;
extern bool g_WiimoteUnexpectedDisconnect; extern bool g_WiimoteUnexpectedDisconnect;
#ifdef _WIN32 #ifdef _WIN32
extern HWND g_ParentHWND; extern HWND g_ParentHWND;
#endif #endif
// Settings // Settings
extern accel_cal g_wm; extern accel_cal g_wm;
extern nu_cal g_nu; extern nu_cal g_nu;
// Debugging // Debugging
extern bool g_DebugAccelerometer; extern bool g_DebugAccelerometer;
extern bool g_DebugData; extern bool g_DebugData;
extern bool g_DebugComm; extern bool g_DebugComm;
extern bool g_DebugSoundData; extern bool g_DebugSoundData;
extern bool g_DebugCustom; extern bool g_DebugCustom;
// Update speed // Update speed
extern int g_UpdateCounter; extern int g_UpdateCounter;
extern double g_UpdateTime; extern double g_UpdateTime;
extern int g_UpdateWriteScreen; extern int g_UpdateWriteScreen;
extern int g_UpdateRate; extern int g_UpdateRate;
extern std::vector<int> g_UpdateTimeList; extern std::vector<int> g_UpdateTimeList;
// Movement recording // Movement recording
extern std::vector<SRecordingAll> VRecording; extern std::vector<SRecordingAll> VRecording;
//#if defined(HAVE_WX) && HAVE_WX && defined(__CONFIGDIALOG_h__) //#if defined(HAVE_WX) && HAVE_WX && defined(__CONFIGDIALOG_h__)
// extern ConfigDialog *frame; // extern ConfigDialog *frame;
//#endif //#endif
#endif #endif
//////////////////////////////// ////////////////////////////////
#endif // MAIN_H #endif // MAIN_H

View File

@ -1,41 +1,41 @@
// Copyright (C) 2003-2008 Dolphin Project. // Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0. // the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details. // GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program. // A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/ // If not, see http://www.gnu.org/licenses/
// 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/
#ifndef _CONFIG_H #ifndef _CONFIG_H
#define _CONFIG_H #define _CONFIG_H
struct Config struct Config
{ {
Config(); Config();
void Load(bool ChangePad = false, bool ChangeSaveByID = false); void Load(bool ChangePad = false, bool ChangeSaveByID = false);
void Save(int Slot = -1); void Save(int Slot = -1);
int CheckForDuplicateJoypads(bool OK); int CheckForDuplicateJoypads(bool OK);
// General // General
bool bShowAdvanced; // Only allow one of these bool bShowAdvanced; // Only allow one of these
bool bSaveByID; bool bSaveByID;
bool bCheckFocus; bool bCheckFocus;
bool bNoTriggerFilter; bool bNoTriggerFilter;
#ifdef RERECORDING #ifdef RERECORDING
bool bRecording; bool bRecording;
bool bPlayback; bool bPlayback;
#endif #endif
}; };
extern Config g_Config; extern Config g_Config;
#endif // _CONFIG_H #endif // _CONFIG_H