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

View File

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

View File

@ -1,69 +1,69 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __SETUP_h__
#define __SETUP_h__
////////////////////////////////////////////////////////////////////////////////////////
// File description
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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.
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.
////////////////////////*/
////////////////////////////////////////////////////////////////////////////////////////
// Settings
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// This may remove sound artifacts in Wario Land Shake It and perhaps other games
//#define SETUP_AVOID_SOUND_ARTIFACTS
/* 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 */
//#define SETUP_FREE_VIDEO_PLUGIN_ON_BOOT
//#define SETUP_FREE_DSP_PLUGIN_ON_BOOT
//#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
window, however, I didn't seem to need this any more */
//#define SETUP_AVOID_CHILD_WINDOW_RENDERING_HANG
// Build with playback rerecording options
//#define SETUP_AVOID_OPENGL_SCREEN_MESSAGE_HANG
// Use a timer to wait for threads for stop instead of WaitForEternity()
/* I tried that this worked with these options
SETUP_FREE_VIDEO_PLUGIN_ON_BOOT
SETUP_DONT_FREE_PLUGIN_ON_STOP
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
OpenGL plugin, so I still need FreeLibrary() to clean it, even with this option. */
//#define SETUP_TIMER_WAITING
// Build with playback rerecording options
//#define RERECORDING
// Build with music modification
//#define MUSICMOD
///////////////////////////
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __SETUP_h__
#define __SETUP_h__
////////////////////////////////////////////////////////////////////////////////////////
// File description
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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.
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.
////////////////////////*/
////////////////////////////////////////////////////////////////////////////////////////
// Settings
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// This may remove sound artifacts in Wario Land Shake It and perhaps other games
//#define SETUP_AVOID_SOUND_ARTIFACTS
/* 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 */
//#define SETUP_FREE_VIDEO_PLUGIN_ON_BOOT
//#define SETUP_FREE_DSP_PLUGIN_ON_BOOT
//#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
window, however, I didn't seem to need this any more */
//#define SETUP_AVOID_CHILD_WINDOW_RENDERING_HANG
// Build with playback rerecording options
//#define SETUP_AVOID_OPENGL_SCREEN_MESSAGE_HANG
// Use a timer to wait for threads for stop instead of WaitForEternity()
/* I tried that this worked with these options
SETUP_FREE_VIDEO_PLUGIN_ON_BOOT
SETUP_DONT_FREE_PLUGIN_ON_STOP
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
OpenGL plugin, so I still need FreeLibrary() to clean it, even with this option. */
//#define SETUP_TIMER_WAITING
// Build with playback rerecording options
//#define RERECORDING
// Build with music modification
//#define MUSICMOD
///////////////////////////
#endif // __SETUP_h__

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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