eol-style native update, small warning fix in EXI_Channel.h

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2591 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99 2009-03-07 08:35:01 +00:00
parent f0431631a8
commit 3f44ccb75e
20 changed files with 12688 additions and 12688 deletions

View File

@ -1,116 +1,116 @@
// 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 COMMONFUNCS_H #ifndef COMMONFUNCS_H
#define COMMONFUNCS_H #define COMMONFUNCS_H
#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
#ifndef _WIN32 #ifndef _WIN32
#if defined __APPLE__ #if defined __APPLE__
char* strndup (char const *s, size_t n); char* strndup (char const *s, size_t n);
size_t strnlen(const char *s, size_t n); size_t strnlen(const char *s, size_t n);
#else #else
#include <byteswap.h> #include <byteswap.h>
#endif // APPLE #endif // APPLE
#include <errno.h> #include <errno.h>
// go to debugger mode // go to debugger mode
#define Crash() {asm ("int $3");} #define Crash() {asm ("int $3");}
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0])) #define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
inline u32 _rotl(u32 x, int shift) { inline u32 _rotl(u32 x, int shift) {
shift &= 31; shift &= 31;
if (!shift) return x; if (!shift) return x;
return (x << shift) | (x >> (32 - shift)); return (x << shift) | (x >> (32 - shift));
} }
inline u32 _rotr(u32 x, int shift) { inline u32 _rotr(u32 x, int shift) {
shift &= 31; shift &= 31;
if (!shift) return x; if (!shift) return x;
return (x >> shift) | (x << (32 - shift)); return (x >> shift) | (x << (32 - shift));
} }
#define SLEEP(x) usleep(x*1000) #define SLEEP(x) usleep(x*1000)
#else // WIN32 #else // WIN32
// Function Cross-Compatibility // Function Cross-Compatibility
#define strcasecmp _stricmp #define strcasecmp _stricmp
#define strncasecmp _strnicmp #define strncasecmp _strnicmp
#define unlink _unlink #define unlink _unlink
#define snprintf _snprintf #define snprintf _snprintf
char* strndup (char const *s, size_t n); char* strndup (char const *s, size_t n);
// 64 bit offsets for windows // 64 bit offsets for windows
#define fseek _fseeki64 #define fseek _fseeki64
#define ftell _ftelli64 #define ftell _ftelli64
#define atoll _atoi64 #define atoll _atoi64
#define stat64 _stat64 #define stat64 _stat64
#define SLEEP(x) Sleep(x) #define SLEEP(x) Sleep(x)
#if _M_IX86 #if _M_IX86
#define Crash() {__asm int 3} #define Crash() {__asm int 3}
#else #else
extern "C" { extern "C" {
__declspec(dllimport) void __stdcall DebugBreak(void); __declspec(dllimport) void __stdcall DebugBreak(void);
} }
#define Crash() {DebugBreak();} #define Crash() {DebugBreak();}
#endif // M_IX86 #endif // M_IX86
#endif // WIN32 ndef #endif // WIN32 ndef
// Dolphin's min and max functions // Dolphin's min and max functions
#undef min #undef min
#undef max #undef max
template<class T> template<class T>
inline T min(const T& a, const T& b) {return a > b ? b : a;} inline T min(const T& a, const T& b) {return a > b ? b : a;}
template<class T> template<class T>
inline T max(const T& a, const T& b) {return a > b ? a : b;} inline T max(const T& a, const T& b) {return a > b ? a : b;}
// Generic function to get last error message. // Generic function to get last error message.
// Call directly after the command or use the error num. // Call directly after the command or use the error num.
// This function might change the error code. // This function might change the error code.
// Defined in Misc.cpp. // Defined in Misc.cpp.
const char* GetLastErrorMsg(); const char* GetLastErrorMsg();
namespace Common namespace Common
{ {
inline u8 swap8(u8 _data) {return _data;} inline u8 swap8(u8 _data) {return _data;}
#ifdef _WIN32 #ifdef _WIN32
inline u16 swap16(u16 _data) {return _byteswap_ushort(_data);} inline u16 swap16(u16 _data) {return _byteswap_ushort(_data);}
inline u32 swap32(u32 _data) {return _byteswap_ulong (_data);} inline u32 swap32(u32 _data) {return _byteswap_ulong (_data);}
inline u64 swap64(u64 _data) {return _byteswap_uint64(_data);} inline u64 swap64(u64 _data) {return _byteswap_uint64(_data);}
#elif __linux__ #elif __linux__
inline u16 swap16(u16 _data) {return bswap_16(_data);} inline u16 swap16(u16 _data) {return bswap_16(_data);}
inline u32 swap32(u32 _data) {return bswap_32(_data);} inline u32 swap32(u32 _data) {return bswap_32(_data);}
inline u64 swap64(u64 _data) {return bswap_64(_data);} inline u64 swap64(u64 _data) {return bswap_64(_data);}
#else #else
// Slow generic implementation. // Slow generic implementation.
inline u16 swap16(u16 data) {return (data >> 8) | (data << 8);} inline u16 swap16(u16 data) {return (data >> 8) | (data << 8);}
inline u32 swap32(u32 data) {return (swap16(data) << 16) | swap16(data >> 16);} inline u32 swap32(u32 data) {return (swap16(data) << 16) | swap16(data >> 16);}
inline u64 swap64(u64 data) {return ((u64)swap32(data) << 32) | swap32(data >> 32);} inline u64 swap64(u64 data) {return ((u64)swap32(data) << 32) | swap32(data >> 32);}
#endif #endif
inline u16 swap16(const u8* _pData) {return swap16(*(const u16*)_pData);} inline u16 swap16(const u8* _pData) {return swap16(*(const u16*)_pData);}
inline u32 swap32(const u8* _pData) {return swap32(*(const u32*)_pData);} inline u32 swap32(const u8* _pData) {return swap32(*(const u32*)_pData);}
inline u64 swap64(const u8* _pData) {return swap64(*(const u64*)_pData);} inline u64 swap64(const u8* _pData) {return swap64(*(const u64*)_pData);}
} // namespace Common } // namespace Common
#endif // COMMONFUNCS #endif // COMMONFUNCS

View File

@ -1,163 +1,163 @@
// 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 COMMON_PATHS_H #ifndef COMMON_PATHS_H
#define COMMON_PATHS_H #define COMMON_PATHS_H
// Library suffix/prefix // Library suffix/prefix
#ifdef _WIN32 #ifdef _WIN32
#define PLUGIN_PREFIX "" #define PLUGIN_PREFIX ""
#define PLUGIN_SUFFIX ".dll" #define PLUGIN_SUFFIX ".dll"
#elif defined __APPLE__ #elif defined __APPLE__
#define PLUGIN_PREFIX "lib" #define PLUGIN_PREFIX "lib"
#define PLUGIN_SUFFIX ".dylib" #define PLUGIN_SUFFIX ".dylib"
#else #else
#define PLUGIN_PREFIX "lib" #define PLUGIN_PREFIX "lib"
#define PLUGIN_SUFFIX ".so" #define PLUGIN_SUFFIX ".so"
#endif #endif
// Directory seperators, do we need this? // Directory seperators, do we need this?
#define DIR_SEP "/" #define DIR_SEP "/"
#define DIR_SEP_CHR '/' #define DIR_SEP_CHR '/'
#if defined __APPLE__ #if defined __APPLE__
#define PLUGINS_DIR "Contents/PlugIns" #define PLUGINS_DIR "Contents/PlugIns"
#else #else
#define PLUGINS_DIR "Plugins" #define PLUGINS_DIR "Plugins"
#endif #endif
#define ROOT_DIR "." #define ROOT_DIR "."
#define USERDATA_DIR "User" #define USERDATA_DIR "User"
#define SYSDATA_DIR "Sys" #define SYSDATA_DIR "Sys"
// Where data directory is // Where data directory is
#ifdef _WIN32 #ifdef _WIN32
#define DOLPHIN_DATA_DIR "Dolphin" #define DOLPHIN_DATA_DIR "Dolphin"
#elif defined __APPLE__ #elif defined __APPLE__
#define DOLPHIN_DATA_DIR "Library/Application Support/Dolphin" #define DOLPHIN_DATA_DIR "Library/Application Support/Dolphin"
#else #else
#define DOLPHIN_DATA_DIR ".dolphin" #define DOLPHIN_DATA_DIR ".dolphin"
#endif #endif
// Dirs in both User and Sys // Dirs in both User and Sys
#define EUR_DIR "EUR" #define EUR_DIR "EUR"
#define USA_DIR "USA" #define USA_DIR "USA"
#define JAP_DIR "JAP" #define JAP_DIR "JAP"
// Dirs in User // Dirs in User
#define GC_USER_DIR "GC" #define GC_USER_DIR "GC"
#define WII_USER_DIR "Wii" #define WII_USER_DIR "Wii"
#define WII_SYSCONF_DIR "shared2/sys" #define WII_SYSCONF_DIR "shared2/sys"
#define CONFIG_DIR "Config" #define CONFIG_DIR "Config"
#define GAMECONFIG_DIR "GameConfig" #define GAMECONFIG_DIR "GameConfig"
#define MAPS_DIR "Maps" #define MAPS_DIR "Maps"
#define CACHE_DIR "Cache" #define CACHE_DIR "Cache"
#define STATESAVES_DIR "StateSaves" #define STATESAVES_DIR "StateSaves"
#define SCREENSHOTS_DIR "ScreenShots" #define SCREENSHOTS_DIR "ScreenShots"
#define DUMP_DIR "Dump" #define DUMP_DIR "Dump"
#define LOGS_DIR "Logs" #define LOGS_DIR "Logs"
#define MAIL_LOGS_DIR "Mail" #define MAIL_LOGS_DIR "Mail"
// Dirs in Sys // Dirs in Sys
#define GC_SYS_DIR "GC" #define GC_SYS_DIR "GC"
#define WII_SYS_DIR "Wii" #define WII_SYS_DIR "Wii"
// Filenames // Filenames
#define DOLPHIN_CONFIG "Dolphin.ini" #define DOLPHIN_CONFIG "Dolphin.ini"
#define DEBUGGER_CONFIG "Debugger.ini" #define DEBUGGER_CONFIG "Debugger.ini"
#define LOGGER_CONFIG "Logger.ini" #define LOGGER_CONFIG "Logger.ini"
#define TOTALDB "totaldb.dsy" #define TOTALDB "totaldb.dsy"
#define DEFAULT_GFX_PLUGIN PLUGIN_PREFIX "Plugin_VideoOGL" PLUGIN_SUFFIX #define DEFAULT_GFX_PLUGIN PLUGIN_PREFIX "Plugin_VideoOGL" PLUGIN_SUFFIX
#define DEFAULT_DSP_PLUGIN PLUGIN_PREFIX "Plugin_DSP_HLE" PLUGIN_SUFFIX #define DEFAULT_DSP_PLUGIN PLUGIN_PREFIX "Plugin_DSP_HLE" PLUGIN_SUFFIX
#define DEFAULT_PAD_PLUGIN PLUGIN_PREFIX "Plugin_PadSimple" PLUGIN_SUFFIX #define DEFAULT_PAD_PLUGIN PLUGIN_PREFIX "Plugin_PadSimple" PLUGIN_SUFFIX
#define DEFAULT_WIIMOTE_PLUGIN PLUGIN_PREFIX "Plugin_Wiimote" PLUGIN_SUFFIX #define DEFAULT_WIIMOTE_PLUGIN PLUGIN_PREFIX "Plugin_Wiimote" PLUGIN_SUFFIX
#define FONT_ANSI "font_ansi.bin" #define FONT_ANSI "font_ansi.bin"
#define FONT_SJIS "font_sjis.bin" #define FONT_SJIS "font_sjis.bin"
#define DSP_ROM "dsp_rom.bin" #define DSP_ROM "dsp_rom.bin"
#define DSP_COEF "dsp_coef.bin" #define DSP_COEF "dsp_coef.bin"
#define GC_IPL "IPL.bin" #define GC_IPL "IPL.bin"
#define GC_SRAM "SRAM.raw" #define GC_SRAM "SRAM.raw"
#define GC_MEMCARDA "MemoryCardA" #define GC_MEMCARDA "MemoryCardA"
#define GC_MEMCARDB "MemoryCardB" #define GC_MEMCARDB "MemoryCardB"
#define WII_EUR_SETTING "setting-eur.txt" #define WII_EUR_SETTING "setting-eur.txt"
#define WII_USA_SETTING "setting-usa.txt" #define WII_USA_SETTING "setting-usa.txt"
#define WII_JAP_SETTING "setting-jpn.txt" #define WII_JAP_SETTING "setting-jpn.txt"
#define WII_SYSCONF "SYSCONF" #define WII_SYSCONF "SYSCONF"
#define MEMORY_DUMP_FILE "mainram.dump" #define MEMORY_DUMP_FILE "mainram.dump"
// Shorts - dirs // Shorts - dirs
// User dirs // User dirs
#define FULL_USERDATA_DIR ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP #define FULL_USERDATA_DIR ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP
#define FULL_GC_USER_DIR FULL_USERDATA_DIR GC_USER_DIR DIR_SEP #define FULL_GC_USER_DIR FULL_USERDATA_DIR GC_USER_DIR DIR_SEP
//#define GC_USER_EUR_DIR FULL_GC_USER_DIR EUR_DIR //#define GC_USER_EUR_DIR FULL_GC_USER_DIR EUR_DIR
//#define GC_USER_USA_DIR FULL_GC_USER_DIR USA_DIR //#define GC_USER_USA_DIR FULL_GC_USER_DIR USA_DIR
//#define GC_USER_JAP_DIR FULL_GC_USER_DIR JAP_DIR //#define GC_USER_JAP_DIR FULL_GC_USER_DIR JAP_DIR
#define FULL_WII_USER_DIR FULL_USERDATA_DIR WII_USER_DIR DIR_SEP #define FULL_WII_USER_DIR FULL_USERDATA_DIR WII_USER_DIR DIR_SEP
#define FULL_WII_ROOT_DIR FULL_USERDATA_DIR WII_USER_DIR // This is the "root" for Wii fs, so that it may be used with created devices #define FULL_WII_ROOT_DIR FULL_USERDATA_DIR WII_USER_DIR // This is the "root" for Wii fs, so that it may be used with created devices
#define FULL_GAMECONFIG_DIR FULL_USERDATA_DIR GAMECONFIG_DIR DIR_SEP #define FULL_GAMECONFIG_DIR FULL_USERDATA_DIR GAMECONFIG_DIR DIR_SEP
#define FULL_CONFIG_DIR FULL_USERDATA_DIR CONFIG_DIR DIR_SEP #define FULL_CONFIG_DIR FULL_USERDATA_DIR CONFIG_DIR DIR_SEP
#define FULL_CACHE_DIR FULL_USERDATA_DIR CACHE_DIR DIR_SEP #define FULL_CACHE_DIR FULL_USERDATA_DIR CACHE_DIR DIR_SEP
#define FULL_STATESAVES_DIR FULL_USERDATA_DIR STATESAVES_DIR DIR_SEP #define FULL_STATESAVES_DIR FULL_USERDATA_DIR STATESAVES_DIR DIR_SEP
#define FULL_SCREENSHOTS_DIR FULL_USERDATA_DIR SCREENSHOTS_DIR DIR_SEP #define FULL_SCREENSHOTS_DIR FULL_USERDATA_DIR SCREENSHOTS_DIR DIR_SEP
#define FULL_DUMP_DIR FULL_USERDATA_DIR DUMP_DIR DIR_SEP #define FULL_DUMP_DIR FULL_USERDATA_DIR DUMP_DIR DIR_SEP
#define FULL_LOGS_DIR FULL_USERDATA_DIR LOGS_DIR DIR_SEP #define FULL_LOGS_DIR FULL_USERDATA_DIR LOGS_DIR DIR_SEP
#define FULL_MAIL_LOGS_DIR FULL_LOGS_DIR MAIL_LOGS_DIR DIR_SEP #define FULL_MAIL_LOGS_DIR FULL_LOGS_DIR MAIL_LOGS_DIR DIR_SEP
#define FULL_MAPS_DIR FULL_USERDATA_DIR MAPS_DIR DIR_SEP #define FULL_MAPS_DIR FULL_USERDATA_DIR MAPS_DIR DIR_SEP
// Sys dirs // Sys dirs
#define FULL_SYSDATA_DIR ROOT_DIR DIR_SEP SYSDATA_DIR DIR_SEP #define FULL_SYSDATA_DIR ROOT_DIR DIR_SEP SYSDATA_DIR DIR_SEP
#define FULL_GC_SYS_DIR FULL_SYSDATA_DIR GC_SYS_DIR DIR_SEP #define FULL_GC_SYS_DIR FULL_SYSDATA_DIR GC_SYS_DIR DIR_SEP
//#define GC_SYS_EUR_DIR FULL_GC_SYS_DIR EUR_DIR //#define GC_SYS_EUR_DIR FULL_GC_SYS_DIR EUR_DIR
//#define GC_SYS_USA_DIR FULL_GC_SYS_DIR USA_DIR //#define GC_SYS_USA_DIR FULL_GC_SYS_DIR USA_DIR
//#define GC_SYS_JAP_DIR FULL_GC_SYS_DIR JAP_DIR //#define GC_SYS_JAP_DIR FULL_GC_SYS_DIR JAP_DIR
#define FULL_WII_SYS_DIR FULL_SYSDATA_DIR WII_SYS_DIR DIR_SEP #define FULL_WII_SYS_DIR FULL_SYSDATA_DIR WII_SYS_DIR DIR_SEP
// Shorts - files // Shorts - files
// User files // User files
#define CONFIG_FILE FULL_CONFIG_DIR DOLPHIN_CONFIG #define CONFIG_FILE FULL_CONFIG_DIR DOLPHIN_CONFIG
#define DEBUGGER_CONFIG_FILE FULL_CONFIG_DIR DEBUGGER_CONFIG #define DEBUGGER_CONFIG_FILE FULL_CONFIG_DIR DEBUGGER_CONFIG
#define LOGGER_CONFIG_FILE FULL_CONFIG_DIR LOGGER_CONFIG #define LOGGER_CONFIG_FILE FULL_CONFIG_DIR LOGGER_CONFIG
#define TOTALDB_FILE FULL_SYSDATA_DIR TOTALDB #define TOTALDB_FILE FULL_SYSDATA_DIR TOTALDB
#define MAINRAM_DUMP_FILE FULL_DUMP_DIR MEMORY_DUMP_FILE #define MAINRAM_DUMP_FILE FULL_DUMP_DIR MEMORY_DUMP_FILE
#define GC_SRAM_FILE FULL_USERDATA_DIR GC_USER_DIR DIR_SEP GC_SRAM #define GC_SRAM_FILE FULL_USERDATA_DIR GC_USER_DIR DIR_SEP GC_SRAM
// Sys files // Sys files
#define FONT_ANSI_FILE FULL_GC_SYS_DIR FONT_ANSI #define FONT_ANSI_FILE FULL_GC_SYS_DIR FONT_ANSI
#define FONT_SJIS_FILE FULL_GC_SYS_DIR FONT_SJIS #define FONT_SJIS_FILE FULL_GC_SYS_DIR FONT_SJIS
#define DSP_ROM_FILE FULL_GC_SYS_DIR DSP_ROM #define DSP_ROM_FILE FULL_GC_SYS_DIR DSP_ROM
#define DSP_COEF_FILE FULL_GC_SYS_DIR DSP_COEF #define DSP_COEF_FILE FULL_GC_SYS_DIR DSP_COEF
#define WII_EUR_SETTING_FILE FULL_WII_SYS_DIR WII_EUR_SETTING #define WII_EUR_SETTING_FILE FULL_WII_SYS_DIR WII_EUR_SETTING
#define WII_USA_SETTING_FILE FULL_WII_SYS_DIR WII_USA_SETTING #define WII_USA_SETTING_FILE FULL_WII_SYS_DIR WII_USA_SETTING
#define WII_JAP_SETTING_FILE FULL_WII_SYS_DIR WII_JAP_SETTING #define WII_JAP_SETTING_FILE FULL_WII_SYS_DIR WII_JAP_SETTING
#define WII_SYSCONF_FILE FULL_WII_USER_DIR WII_SYSCONF_DIR DIR_SEP WII_SYSCONF #define WII_SYSCONF_FILE FULL_WII_USER_DIR WII_SYSCONF_DIR DIR_SEP WII_SYSCONF
#define FULL_WII_MENU_DIR FULL_WII_USER_DIR "title" DIR_SEP "00000001" DIR_SEP "00000002" DIR_SEP "content" #define FULL_WII_MENU_DIR FULL_WII_USER_DIR "title" DIR_SEP "00000001" DIR_SEP "00000002" DIR_SEP "content"
#endif // COMMON_PATHS_H #endif // COMMON_PATHS_H

View File

@ -1,58 +1,58 @@
// 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/
// This header contains type definitions that are shared between the Dolphin // This header contains type definitions that are shared between the Dolphin
// core and the plugin specs. Any definitions that are only used by the core // core and the plugin specs. Any definitions that are only used by the core
// should be placed in "Common.h" instead. // should be placed in "Common.h" instead.
#ifndef _COMMONTYPES_H #ifndef _COMMONTYPES_H
#define _COMMONTYPES_H #define _COMMONTYPES_H
#ifdef _WIN32 #ifdef _WIN32
#include <tchar.h> #include <tchar.h>
typedef unsigned __int8 u8; typedef unsigned __int8 u8;
typedef unsigned __int16 u16; typedef unsigned __int16 u16;
typedef unsigned __int32 u32; typedef unsigned __int32 u32;
typedef unsigned __int64 u64; typedef unsigned __int64 u64;
typedef signed __int8 s8; typedef signed __int8 s8;
typedef signed __int16 s16; typedef signed __int16 s16;
typedef signed __int32 s32; typedef signed __int32 s32;
typedef signed __int64 s64; typedef signed __int64 s64;
#else #else
typedef unsigned char u8; typedef unsigned char u8;
typedef unsigned short u16; typedef unsigned short u16;
typedef unsigned int u32; typedef unsigned int u32;
typedef unsigned long long u64; typedef unsigned long long u64;
typedef char s8; typedef char s8;
typedef short s16; typedef short s16;
typedef int s32; typedef int s32;
typedef long long s64; typedef long long s64;
// For using windows lock code // For using windows lock code
#define TCHAR char #define TCHAR char
#define LONG int #define LONG int
#endif // _WIN32 #endif // _WIN32
#endif // _COMMONTYPES_H #endif // _COMMONTYPES_H

View File

@ -1,153 +1,153 @@
// 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 _LOG_H #ifndef _LOG_H
#define _LOG_H #define _LOG_H
namespace LogTypes namespace LogTypes
{ {
enum LOG_TYPE { enum LOG_TYPE {
ACTIONREPLAY, ACTIONREPLAY,
AUDIO, AUDIO,
AUDIO_INTERFACE, AUDIO_INTERFACE,
BOOT, BOOT,
COMMANDPROCESSOR, COMMANDPROCESSOR,
COMMON, COMMON,
CONSOLE, CONSOLE,
DISCIO, DISCIO,
DSPHLE, DSPHLE,
DSPINTERFACE, DSPINTERFACE,
DVDINTERFACE, DVDINTERFACE,
DYNA_REC, DYNA_REC,
EXPANSIONINTERFACE, EXPANSIONINTERFACE,
GEKKO, GEKKO,
GPFIFO, GPFIFO,
HLE, HLE,
MASTER_LOG, MASTER_LOG,
MEMMAP, MEMMAP,
OSREPORT, OSREPORT,
PERIPHERALINTERFACE, PERIPHERALINTERFACE,
PIXELENGINE, PIXELENGINE,
SERIALINTERFACE, SERIALINTERFACE,
STREAMINGINTERFACE, STREAMINGINTERFACE,
VIDEO, VIDEO,
VIDEOINTERFACE, VIDEOINTERFACE,
WII_IOB, WII_IOB,
WII_IPC, WII_IPC,
WII_IPC_DVD, WII_IPC_DVD,
WII_IPC_ES, WII_IPC_ES,
WII_IPC_FILEIO, WII_IPC_FILEIO,
WII_IPC_HLE, WII_IPC_HLE,
WII_IPC_NET, WII_IPC_NET,
WII_IPC_SD, WII_IPC_SD,
WII_IPC_WIIMOTE, WII_IPC_WIIMOTE,
NUMBER_OF_LOGS // Must be last NUMBER_OF_LOGS // Must be last
}; };
enum LOG_LEVELS { enum LOG_LEVELS {
LERROR = 1, // Bad errors - that still don't deserve a PanicAlert. LERROR = 1, // Bad errors - that still don't deserve a PanicAlert.
LWARNING, // Something is suspicious. LWARNING, // Something is suspicious.
LINFO, // General information. LINFO, // General information.
LDEBUG, // Strictly for detailed debugging - might make things slow. LDEBUG, // Strictly for detailed debugging - might make things slow.
}; };
} // namespace } // namespace
/* /*
FIXME: FIXME:
- Debug_run() - run only in debug time - Debug_run() - run only in debug time
- Compile the log functions according to LOGLEVEL - Compile the log functions according to LOGLEVEL
*/ */
#ifdef LOGGING #ifdef LOGGING
#define LOGLEVEL 4 //LogTypes::LDEBUG #define LOGLEVEL 4 //LogTypes::LDEBUG
#else #else
#ifndef LOGLEVEL #ifndef LOGLEVEL
#define LOGLEVEL 2 //LogTypes::LWARNING #define LOGLEVEL 2 //LogTypes::LWARNING
#endif // loglevel #endif // loglevel
#endif // logging #endif // logging
#define ERROR_LOG(...) {} #define ERROR_LOG(...) {}
#define WARN_LOG(...) {} #define WARN_LOG(...) {}
#define INFO_LOG(...) {} #define INFO_LOG(...) {}
#define DEBUG_LOG(...) {} #define DEBUG_LOG(...) {}
extern void __Log(int logNumber, const char* text, ...); extern void __Log(int logNumber, const char* text, ...);
// Let the compiler optimize this out // Let the compiler optimize this out
#define GENERIC_LOG(t,v, ...) {if (v <= LOGLEVEL) __Log(t + (v)*100, __VA_ARGS__);} #define GENERIC_LOG(t,v, ...) {if (v <= LOGLEVEL) __Log(t + (v)*100, __VA_ARGS__);}
#if LOGLEVEL >= 1 //LogTypes::LERROR #if LOGLEVEL >= 1 //LogTypes::LERROR
#undef ERROR_LOG #undef ERROR_LOG
#define ERROR_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LERROR, __VA_ARGS__)} #define ERROR_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LERROR, __VA_ARGS__)}
#endif // loglevel LERROR+ #endif // loglevel LERROR+
#if LOGLEVEL >= 2 //LogTypes::LWARNING #if LOGLEVEL >= 2 //LogTypes::LWARNING
#undef WARN_LOG #undef WARN_LOG
#define WARN_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LWARNING, __VA_ARGS__)} #define WARN_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LWARNING, __VA_ARGS__)}
#endif // loglevel LWARNING+ #endif // loglevel LWARNING+
#if LOGLEVEL >= 3 //LogTypes::LINFO #if LOGLEVEL >= 3 //LogTypes::LINFO
#undef INFO_LOG #undef INFO_LOG
#define INFO_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LINFO, __VA_ARGS__)} #define INFO_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LINFO, __VA_ARGS__)}
#endif // loglevel LINFO+ #endif // loglevel LINFO+
#if LOGLEVEL >= 4 //LogTypes::LDEBUG #if LOGLEVEL >= 4 //LogTypes::LDEBUG
#undef DEBUG_LOG #undef DEBUG_LOG
#define DEBUG_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LDEBUG, __VA_ARGS__)} #define DEBUG_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LDEBUG, __VA_ARGS__)}
#endif // loglevel LDEBUG+ #endif // loglevel LDEBUG+
#if LOGLEVEL >= 4 //LogTypes::LDEBUG #if LOGLEVEL >= 4 //LogTypes::LDEBUG
#define _dbg_assert_(_t_, _a_) \ #define _dbg_assert_(_t_, _a_) \
if (!(_a_)) {\ if (!(_a_)) {\
ERROR_LOG(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \ ERROR_LOG(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \
__LINE__, __FILE__, __TIME__); \ __LINE__, __FILE__, __TIME__); \
if (!PanicYesNo("*** Assertion (see log)***\n")) {Crash();} \ if (!PanicYesNo("*** Assertion (see log)***\n")) {Crash();} \
} }
#define _dbg_assert_msg_(_t_, _a_, ...)\ #define _dbg_assert_msg_(_t_, _a_, ...)\
if (!(_a_)) {\ if (!(_a_)) {\
ERROR_LOG(_t_, __VA_ARGS__); \ ERROR_LOG(_t_, __VA_ARGS__); \
if (!PanicYesNo(__VA_ARGS__)) {Crash();} \ if (!PanicYesNo(__VA_ARGS__)) {Crash();} \
} }
#define _dbg_update_() Host_UpdateLogDisplay(); #define _dbg_update_() Host_UpdateLogDisplay();
#else // not debug #else // not debug
#define _dbg_clear_() #define _dbg_clear_()
#define _dbg_update_() ; #define _dbg_update_() ;
#ifndef _dbg_assert_ #ifndef _dbg_assert_
#define _dbg_assert_(_t_, _a_) ; #define _dbg_assert_(_t_, _a_) ;
#define _dbg_assert_msg_(_t_, _a_, _desc_, ...) ; #define _dbg_assert_msg_(_t_, _a_, _desc_, ...) ;
#endif // dbg_assert #endif // dbg_assert
#endif // LOGLEVEL LDEBUG #endif // LOGLEVEL LDEBUG
#define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_) #define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_)
#ifdef _WIN32 #ifdef _WIN32
#define _assert_msg_(_t_, _a_, _fmt_, ...) \ #define _assert_msg_(_t_, _a_, _fmt_, ...) \
if (!(_a_)) {\ if (!(_a_)) {\
if (!PanicYesNo(_fmt_, __VA_ARGS__)) {Crash();} \ if (!PanicYesNo(_fmt_, __VA_ARGS__)) {Crash();} \
} }
#else // not win32 #else // not win32
#define _assert_msg_(_t_, _a_, _fmt_, ...) \ #define _assert_msg_(_t_, _a_, _fmt_, ...) \
if (!(_a_)) {\ if (!(_a_)) {\
if (!PanicYesNo(_fmt_, ##__VA_ARGS__)) {Crash();} \ if (!PanicYesNo(_fmt_, ##__VA_ARGS__)) {Crash();} \
} }
#endif // WIN32 #endif // WIN32
#endif // LOG_H #endif // LOG_H

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/
#include "Common.h" #include "Common.h"
// Generic function to get last error message. // Generic function to get last error message.
// Call directly after the command or use the error num. // Call directly after the command or use the error num.
// This function might change the error code. // This function might change the error code.
const char *GetLastErrorMsg() const char *GetLastErrorMsg()
{ {
// FIXME : not thread safe. // FIXME : not thread safe.
// Caused by sloppy use in logging in FileUtil.cpp, primarily. What to do, what to do ... // Caused by sloppy use in logging in FileUtil.cpp, primarily. What to do, what to do ...
static char errStr[255] = {0}; static char errStr[255] = {0};
#ifdef _WIN32 #ifdef _WIN32
DWORD dw = GetLastError(); DWORD dw = GetLastError();
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) errStr, 254, NULL ); (LPTSTR) errStr, 254, NULL );
#else #else
// Thread safe (XSI-compliant) // Thread safe (XSI-compliant)
strerror_r(errno, errStr, 255); strerror_r(errno, errStr, 255);
#endif #endif
return errStr; return errStr;
} }
#ifdef __APPLE__ #ifdef __APPLE__
// strlen with cropping after size n // strlen with cropping after size n
size_t strnlen(const char *s, size_t n) size_t strnlen(const char *s, size_t n)
{ {
const char *p = (const char *)memchr(s, 0, n); const char *p = (const char *)memchr(s, 0, n);
return(p ? p-s : n); return(p ? p-s : n);
} }
#endif #endif
// strdup with cropping after size n // strdup with cropping after size n
char* strndup(char const *s, size_t n) char* strndup(char const *s, size_t n)
{ {
size_t len = strnlen(s, n); size_t len = strnlen(s, n);
char *dup = (char *)malloc(len + 1); char *dup = (char *)malloc(len + 1);
if (dup == NULL) if (dup == NULL)
return NULL; return NULL;
dup[len] = '\0'; dup[len] = '\0';
return (char *)memcpy(dup, s, len); return (char *)memcpy(dup, s, len);
} }

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 MSGHANDLER_H #ifndef MSGHANDLER_H
#define MSGHANDLER_H #define MSGHANDLER_H
// Message alerts // Message alerts
enum MSG_TYPE enum MSG_TYPE
{ {
INFORMATION, INFORMATION,
QUESTION, QUESTION,
WARNING, WARNING,
}; };
typedef bool (*MsgAlertHandler)(const char* caption, const char* text, typedef bool (*MsgAlertHandler)(const char* caption, const char* text,
bool yes_no, int Style); bool yes_no, int Style);
void RegisterMsgAlertHandler(MsgAlertHandler handler); void RegisterMsgAlertHandler(MsgAlertHandler handler);
extern bool MsgAlert(const char* caption, bool yes_no, int Style, const char* format, ...); extern bool MsgAlert(const char* caption, bool yes_no, int Style, const char* format, ...);
#ifdef _WIN32 #ifdef _WIN32
#define SuccessAlert(format, ...) MsgAlert("Information", false, INFORMATION, format, __VA_ARGS__) #define SuccessAlert(format, ...) MsgAlert("Information", false, INFORMATION, format, __VA_ARGS__)
#define PanicAlert(format, ...) MsgAlert("Warning", false, WARNING, format, __VA_ARGS__) #define PanicAlert(format, ...) MsgAlert("Warning", false, WARNING, format, __VA_ARGS__)
#define PanicYesNo(format, ...) MsgAlert("Warning", true, WARNING, format, __VA_ARGS__) #define PanicYesNo(format, ...) MsgAlert("Warning", true, WARNING, format, __VA_ARGS__)
#define AskYesNo(format, ...) MsgAlert("Question", true, QUESTION, format, __VA_ARGS__) #define AskYesNo(format, ...) MsgAlert("Question", true, QUESTION, format, __VA_ARGS__)
#else #else
#define SuccessAlert(format, ...) MsgAlert("SUCCESS", false, INFORMATION, format, ##__VA_ARGS__) #define SuccessAlert(format, ...) MsgAlert("SUCCESS", false, INFORMATION, format, ##__VA_ARGS__)
#define PanicAlert(format, ...) MsgAlert("PANIC", false, WARNING, format, ##__VA_ARGS__) #define PanicAlert(format, ...) MsgAlert("PANIC", false, WARNING, format, ##__VA_ARGS__)
#define PanicYesNo(format, ...) MsgAlert("PANIC", true, WARNING, format, ##__VA_ARGS__) #define PanicYesNo(format, ...) MsgAlert("PANIC", true, WARNING, format, ##__VA_ARGS__)
#define AskYesNo(format, ...) MsgAlert("ASK", true, QUESTION, format, ##__VA_ARGS__) #define AskYesNo(format, ...) MsgAlert("ASK", true, QUESTION, format, ##__VA_ARGS__)
#endif #endif
#endif //MSGHANDLER #endif //MSGHANDLER

View File

@ -38,7 +38,7 @@ private:
union UEXI_STATUS union UEXI_STATUS
{ {
u32 hex; u32 hex;
struct struct _EXISTATUS
{ {
unsigned EXIINTMASK : 1; //31 unsigned EXIINTMASK : 1; //31
unsigned EXIINT : 1; //30 unsigned EXIINT : 1; //30
@ -60,7 +60,7 @@ private:
union UEXI_CONTROL union UEXI_CONTROL
{ {
u32 hex; u32 hex;
struct struct _EXICONTROL
{ {
unsigned TSTART : 1; unsigned TSTART : 1;
unsigned DMA : 1; unsigned DMA : 1;

File diff suppressed because it is too large Load Diff

View File

@ -1,444 +1,444 @@
// 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/
// ======================================================= // =======================================================
// File description // File description
// ------------- // -------------
/* Here we handle /dev/es requests. We have cases for these functions, the exact /* Here we handle /dev/es requests. We have cases for these functions, the exact
DevKitPro/libogc name is in parenthesis: DevKitPro/libogc name is in parenthesis:
0x20 GetTitleID (ES_GetTitleID) (Input: none, Output: 8 bytes) 0x20 GetTitleID (ES_GetTitleID) (Input: none, Output: 8 bytes)
0x1d GetDataDir (ES_GetDataDir) (Input: 8 bytes, Output: 30 bytes) 0x1d GetDataDir (ES_GetDataDir) (Input: 8 bytes, Output: 30 bytes)
0x1b DiGetTicketView (Input: none, Output: 216 bytes) 0x1b DiGetTicketView (Input: none, Output: 216 bytes)
0x16 GetConsumption (Input: 8 bytes, Output: 0 bytes, 4 bytes) // there are two output buffers 0x16 GetConsumption (Input: 8 bytes, Output: 0 bytes, 4 bytes) // there are two output buffers
0x12 GetNumTicketViews (ES_GetNumTicketViews) (Input: 8 bytes, Output: 4 bytes) 0x12 GetNumTicketViews (ES_GetNumTicketViews) (Input: 8 bytes, Output: 4 bytes)
0x14 GetTMDViewSize (ES_GetTMDViewSize) (Input: ?, Output: ?) // I don't get this anymore, 0x14 GetTMDViewSize (ES_GetTMDViewSize) (Input: ?, Output: ?) // I don't get this anymore,
it used to come after 0x12 it used to come after 0x12
but only the first two are correctly supported. For the other four we ignore any potential but only the first two are correctly supported. For the other four we ignore any potential
input and only write zero to the out buffer. However, most games only use first two, input and only write zero to the out buffer. However, most games only use first two,
but some Nintendo developed games use the other ones to: but some Nintendo developed games use the other ones to:
0x1b: Mario Galaxy, Mario Kart, SSBB 0x1b: Mario Galaxy, Mario Kart, SSBB
0x16: Mario Galaxy, Mario Kart, SSBB 0x16: Mario Galaxy, Mario Kart, SSBB
0x12: Mario Kart 0x12: Mario Kart
0x14: Mario Kart: But only if we don't return a zeroed out buffer for the 0x12 question, 0x14: Mario Kart: But only if we don't return a zeroed out buffer for the 0x12 question,
and instead answer for example 1 will this question appear. and instead answer for example 1 will this question appear.
*/ */
// ============= // =============
#include "WII_IPC_HLE_Device_es.h" #include "WII_IPC_HLE_Device_es.h"
#include "../PowerPC/PowerPC.h" #include "../PowerPC/PowerPC.h"
#include "../VolumeHandler.h" #include "../VolumeHandler.h"
CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 _DeviceID, const std::string& _rDeviceName, const std::string& _rDefaultContentFile) CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 _DeviceID, const std::string& _rDeviceName, const std::string& _rDefaultContentFile)
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName) : IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
, m_pContentLoader(NULL) , m_pContentLoader(NULL)
, m_TitleID(-1) , m_TitleID(-1)
, AccessIdentID(0x6000000) , AccessIdentID(0x6000000)
{ {
m_pContentLoader = new DiscIO::CNANDContentLoader(_rDefaultContentFile); m_pContentLoader = new DiscIO::CNANDContentLoader(_rDefaultContentFile);
// check for cd ... // check for cd ...
if (m_pContentLoader->IsValid()) if (m_pContentLoader->IsValid())
{ {
m_TitleID = m_pContentLoader->GetTitleID(); m_TitleID = m_pContentLoader->GetTitleID();
} }
else if (VolumeHandler::IsValid()) else if (VolumeHandler::IsValid())
{ {
m_TitleID = ((u64)0x00010000 << 32) | VolumeHandler::Read32(0); m_TitleID = ((u64)0x00010000 << 32) | VolumeHandler::Read32(0);
} }
else else
{ {
m_TitleID = ((u64)0x00010000 << 32) | 0xF00DBEEF; m_TitleID = ((u64)0x00010000 << 32) | 0xF00DBEEF;
} }
INFO_LOG(WII_IPC_ES, "Set default title to %08x/%08x", m_TitleID>>32, m_TitleID); INFO_LOG(WII_IPC_ES, "Set default title to %08x/%08x", m_TitleID>>32, m_TitleID);
} }
CWII_IPC_HLE_Device_es::~CWII_IPC_HLE_Device_es() CWII_IPC_HLE_Device_es::~CWII_IPC_HLE_Device_es()
{ {
delete m_pContentLoader; delete m_pContentLoader;
} }
bool CWII_IPC_HLE_Device_es::Open(u32 _CommandAddress, u32 _Mode) bool CWII_IPC_HLE_Device_es::Open(u32 _CommandAddress, u32 _Mode)
{ {
Memory::Write_U32(GetDeviceID(), _CommandAddress+4); Memory::Write_U32(GetDeviceID(), _CommandAddress+4);
return true; return true;
} }
bool CWII_IPC_HLE_Device_es::Close(u32 _CommandAddress) bool CWII_IPC_HLE_Device_es::Close(u32 _CommandAddress)
{ {
INFO_LOG(WII_IPC_ES, "ES: Close"); INFO_LOG(WII_IPC_ES, "ES: Close");
Memory::Write_U32(0, _CommandAddress + 4); Memory::Write_U32(0, _CommandAddress + 4);
return true; return true;
} }
bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress) bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
{ {
SIOCtlVBuffer Buffer(_CommandAddress); SIOCtlVBuffer Buffer(_CommandAddress);
INFO_LOG(WII_IPC_ES, "%s (0x%x)", GetDeviceName().c_str(), Buffer.Parameter); INFO_LOG(WII_IPC_ES, "%s (0x%x)", GetDeviceName().c_str(), Buffer.Parameter);
// Prepare the out buffer(s) with zeroes as a safety precaution // Prepare the out buffer(s) with zeroes as a safety precaution
// to avoid returning bad values // to avoid returning bad values
for (u32 i = 0; i < Buffer.NumberPayloadBuffer; i++) for (u32 i = 0; i < Buffer.NumberPayloadBuffer; i++)
{ {
Memory::Memset(Buffer.PayloadBuffer[i].m_Address, 0, Memory::Memset(Buffer.PayloadBuffer[i].m_Address, 0,
Buffer.PayloadBuffer[i].m_Size); Buffer.PayloadBuffer[i].m_Size);
} }
switch (Buffer.Parameter) switch (Buffer.Parameter)
{ {
case IOCTL_ES_OPENTITLECONTENT: case IOCTL_ES_OPENTITLECONTENT:
{ {
u32 CFD = AccessIdentID++; u32 CFD = AccessIdentID++;
u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address);
u32 Index = Memory::Read_U32(Buffer.InBuffer[0].m_Address+8); u32 Index = Memory::Read_U32(Buffer.InBuffer[0].m_Address+8);
m_ContentAccessMap[CFD].m_Position = 0; m_ContentAccessMap[CFD].m_Position = 0;
m_ContentAccessMap[CFD].m_pContent = AccessContentDevice(TitleID).GetContentByIndex(Index); m_ContentAccessMap[CFD].m_pContent = AccessContentDevice(TitleID).GetContentByIndex(Index);
_dbg_assert_(WII_IPC_ES, m_ContentAccessMap[CFD].m_pContent != NULL); _dbg_assert_(WII_IPC_ES, m_ContentAccessMap[CFD].m_pContent != NULL);
Memory::Write_U32(CFD, _CommandAddress + 0x4); Memory::Write_U32(CFD, _CommandAddress + 0x4);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_OPENTITLECONTENT: TitleID: %08x/%08x Index %i -> got CFD %x", TitleID>>32, TitleID, Index, CFD); INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_OPENTITLECONTENT: TitleID: %08x/%08x Index %i -> got CFD %x", TitleID>>32, TitleID, Index, CFD);
return true; return true;
} }
break; break;
case IOCTL_ES_OPENCONTENT: case IOCTL_ES_OPENCONTENT:
{ {
u32 CFD = AccessIdentID++; u32 CFD = AccessIdentID++;
u32 Index = Memory::Read_U32(Buffer.InBuffer[0].m_Address); u32 Index = Memory::Read_U32(Buffer.InBuffer[0].m_Address);
m_ContentAccessMap[CFD].m_Position = 0; m_ContentAccessMap[CFD].m_Position = 0;
m_ContentAccessMap[CFD].m_pContent = AccessContentDevice(m_TitleID).GetContentByIndex(Index); m_ContentAccessMap[CFD].m_pContent = AccessContentDevice(m_TitleID).GetContentByIndex(Index);
_dbg_assert_(WII_IPC_ES, m_ContentAccessMap[CFD].m_pContent != NULL); _dbg_assert_(WII_IPC_ES, m_ContentAccessMap[CFD].m_pContent != NULL);
Memory::Write_U32(CFD, _CommandAddress + 0x4); Memory::Write_U32(CFD, _CommandAddress + 0x4);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_OPENCONTENT: Index %i -> got CFD %x", Index, CFD); INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_OPENCONTENT: Index %i -> got CFD %x", Index, CFD);
return true; return true;
} }
break; break;
case IOCTL_ES_READCONTENT: case IOCTL_ES_READCONTENT:
{ {
_dbg_assert_(WII_IPC_ES, Buffer.NumberInBuffer == 1); _dbg_assert_(WII_IPC_ES, Buffer.NumberInBuffer == 1);
u32 CFD = Memory::Read_U32(Buffer.InBuffer[0].m_Address); u32 CFD = Memory::Read_U32(Buffer.InBuffer[0].m_Address);
u32 Size = Buffer.PayloadBuffer[0].m_Size; u32 Size = Buffer.PayloadBuffer[0].m_Size;
u32 Addr = Buffer.PayloadBuffer[0].m_Address; u32 Addr = Buffer.PayloadBuffer[0].m_Address;
_dbg_assert_(WII_IPC_ES, m_ContentAccessMap.find(CFD) != m_ContentAccessMap.end()); _dbg_assert_(WII_IPC_ES, m_ContentAccessMap.find(CFD) != m_ContentAccessMap.end());
SContentAccess& rContent = m_ContentAccessMap[CFD]; SContentAccess& rContent = m_ContentAccessMap[CFD];
u8* pSrc = &rContent.m_pContent->m_pData[rContent.m_Position]; u8* pSrc = &rContent.m_pContent->m_pData[rContent.m_Position];
u8* pDest = Memory::GetPointer(Addr); u8* pDest = Memory::GetPointer(Addr);
if (rContent.m_Position + Size > rContent.m_pContent->m_Size) if (rContent.m_Position + Size > rContent.m_pContent->m_Size)
{ {
Size = rContent.m_pContent->m_Size-rContent.m_Position; Size = rContent.m_pContent->m_Size-rContent.m_Position;
} }
if (Size > 0) if (Size > 0)
{ {
memcpy(pDest,pSrc, Size); memcpy(pDest,pSrc, Size);
rContent.m_Position += Size; rContent.m_Position += Size;
} }
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_READCONTENT: CFD %x, Addr 0x%x, Size %i -> stream pos %i", CFD, Addr, Size, rContent.m_Position); INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_READCONTENT: CFD %x, Addr 0x%x, Size %i -> stream pos %i", CFD, Addr, Size, rContent.m_Position);
Memory::Write_U32(Size, _CommandAddress + 0x4); Memory::Write_U32(Size, _CommandAddress + 0x4);
return true; return true;
} }
break; break;
case IOCTL_ES_CLOSECONTENT: case IOCTL_ES_CLOSECONTENT:
{ {
_dbg_assert_(WII_IPC_ES, Buffer.NumberInBuffer == 1); _dbg_assert_(WII_IPC_ES, Buffer.NumberInBuffer == 1);
u32 CFD = Memory::Read_U32(Buffer.InBuffer[0].m_Address); u32 CFD = Memory::Read_U32(Buffer.InBuffer[0].m_Address);
CContentAccessMap::iterator itr = m_ContentAccessMap.find(CFD); CContentAccessMap::iterator itr = m_ContentAccessMap.find(CFD);
m_ContentAccessMap.erase(itr); m_ContentAccessMap.erase(itr);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_CLOSECONTENT: CFD %x", CFD); INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_CLOSECONTENT: CFD %x", CFD);
Memory::Write_U32(0, _CommandAddress + 0x4); Memory::Write_U32(0, _CommandAddress + 0x4);
return true; return true;
} }
break; break;
case IOCTL_ES_SEEKCONTENT: case IOCTL_ES_SEEKCONTENT:
{ {
u32 CFD = Memory::Read_U32(Buffer.InBuffer[0].m_Address); u32 CFD = Memory::Read_U32(Buffer.InBuffer[0].m_Address);
u32 Addr = Memory::Read_U32(Buffer.InBuffer[1].m_Address); u32 Addr = Memory::Read_U32(Buffer.InBuffer[1].m_Address);
u32 Mode = Memory::Read_U32(Buffer.InBuffer[2].m_Address); u32 Mode = Memory::Read_U32(Buffer.InBuffer[2].m_Address);
_dbg_assert_(WII_IPC_ES, m_ContentAccessMap.find(CFD) != m_ContentAccessMap.end()); _dbg_assert_(WII_IPC_ES, m_ContentAccessMap.find(CFD) != m_ContentAccessMap.end());
SContentAccess& rContent = m_ContentAccessMap[CFD]; SContentAccess& rContent = m_ContentAccessMap[CFD];
switch (Mode) switch (Mode)
{ {
case 0: // SET case 0: // SET
rContent.m_Position = Addr; rContent.m_Position = Addr;
break; break;
case 1: // CUR case 1: // CUR
rContent.m_Position += Addr; rContent.m_Position += Addr;
break; break;
case 2: // END case 2: // END
rContent.m_Position = rContent.m_pContent->m_Size + Addr; rContent.m_Position = rContent.m_pContent->m_Size + Addr;
break; break;
} }
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_SEEKCONTENT: CFD %x, Addr 0x%x, Mode %i -> Pos %i", CFD, Addr, Mode, rContent.m_Position); INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_SEEKCONTENT: CFD %x, Addr 0x%x, Mode %i -> Pos %i", CFD, Addr, Mode, rContent.m_Position);
Memory::Write_U32(rContent.m_Position, _CommandAddress + 0x4); Memory::Write_U32(rContent.m_Position, _CommandAddress + 0x4);
return true; return true;
} }
break; break;
case IOCTL_ES_GETTITLEDIR: case IOCTL_ES_GETTITLEDIR:
{ {
u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address);
char* pTitleID = (char*)&TitleID; char* pTitleID = (char*)&TitleID;
char* Path = (char*)Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address); char* Path = (char*)Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address);
sprintf(Path, "/%08x/%08x/data", (u32)(TitleID >> 32) & 0xFFFFFFFF, (u32)TitleID & 0xFFFFFFFF); sprintf(Path, "/%08x/%08x/data", (u32)(TitleID >> 32) & 0xFFFFFFFF, (u32)TitleID & 0xFFFFFFFF);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEDIR: %s)", Path); INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEDIR: %s)", Path);
} }
break; break;
case IOCTL_ES_GETTITLEID: case IOCTL_ES_GETTITLEID:
{ {
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "CWII_IPC_HLE_Device_es: IOCTL_ES_GETTITLEID no out buffer"); _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "CWII_IPC_HLE_Device_es: IOCTL_ES_GETTITLEID no out buffer");
Memory::Write_U64(m_TitleID, Buffer.PayloadBuffer[0].m_Address); Memory::Write_U64(m_TitleID, Buffer.PayloadBuffer[0].m_Address);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEID: %08x/%08x", m_TitleID>>32, m_TitleID); INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_GETTITLEID: %08x/%08x", m_TitleID>>32, m_TitleID);
} }
break; break;
case IOCTL_ES_SETUID: case IOCTL_ES_SETUID:
{ {
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 1, "CWII_IPC_HLE_Device_es: IOCTL_ES_GETTITLEID no in buffer"); _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 1, "CWII_IPC_HLE_Device_es: IOCTL_ES_GETTITLEID no in buffer");
u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address);
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_SETUID titleID: %08x/%08x", TitleID>>32, TitleID ); INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_SETUID titleID: %08x/%08x", TitleID>>32, TitleID );
} }
break; break;
case IOCTL_ES_GETVIEWCNT: case IOCTL_ES_GETVIEWCNT:
{ {
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 1, "CWII_IPC_HLE_Device_es: IOCTL_ES_GETVIEWCNT no in buffer"); _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 1, "CWII_IPC_HLE_Device_es: IOCTL_ES_GETVIEWCNT no in buffer");
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "CWII_IPC_HLE_Device_es: IOCTL_ES_GETVIEWCNT no out buffer"); _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "CWII_IPC_HLE_Device_es: IOCTL_ES_GETVIEWCNT no out buffer");
u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address);
// [TODO] here we should have a map from title id to tickets or something like that... // [TODO] here we should have a map from title id to tickets or something like that...
if (IsValid(TitleID)) if (IsValid(TitleID))
{ {
Memory::Write_U32(1, Buffer.PayloadBuffer[0].m_Address); Memory::Write_U32(1, Buffer.PayloadBuffer[0].m_Address);
} }
else else
{ {
Memory::Write_U32(0, Buffer.PayloadBuffer[0].m_Address); Memory::Write_U32(0, Buffer.PayloadBuffer[0].m_Address);
} }
INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_GETVIEWCNT for titleID: %08x/%08x", TitleID>>32, TitleID ); INFO_LOG(WII_IPC_ES, "ES: IOCTL_ES_GETVIEWCNT for titleID: %08x/%08x", TitleID>>32, TitleID );
Memory::Write_U32(0, _CommandAddress + 0x4); Memory::Write_U32(0, _CommandAddress + 0x4);
return true; return true;
} }
break; break;
case IOCTL_ES_GETTITLECNT: case IOCTL_ES_GETTITLECNT:
{ {
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 0, "IOCTL_ES_GETTITLECNT has an in buffer"); _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 0, "IOCTL_ES_GETTITLECNT has an in buffer");
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "IOCTL_ES_GETTITLECNT has no out buffer"); _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "IOCTL_ES_GETTITLECNT has no out buffer");
_dbg_assert_msg_(WII_IPC_ES, Buffer.PayloadBuffer[0].m_Size == 4, "IOCTL_ES_GETTITLECNT payload[0].size != 4"); _dbg_assert_msg_(WII_IPC_ES, Buffer.PayloadBuffer[0].m_Size == 4, "IOCTL_ES_GETTITLECNT payload[0].size != 4");
// TODO // TODO
Memory::Write_U32(1, Buffer.PayloadBuffer[0].m_Address); Memory::Write_U32(1, Buffer.PayloadBuffer[0].m_Address);
ERROR_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLECNT: TODO... 1"); ERROR_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLECNT: TODO... 1");
} }
break; break;
case IOCTL_ES_GETTITLES: case IOCTL_ES_GETTITLES:
{ {
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 1, "IOCTL_ES_GETTITLES has an in buffer"); _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 1, "IOCTL_ES_GETTITLES has an in buffer");
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "IOCTL_ES_GETTITLES has no out buffer"); _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "IOCTL_ES_GETTITLES has no out buffer");
u32 Count = Memory::Read_U32(Buffer.InBuffer[0].m_Address); u32 Count = Memory::Read_U32(Buffer.InBuffer[0].m_Address);
std::vector<u64> TitleIDs; std::vector<u64> TitleIDs;
TitleIDs.push_back(0x0000000100000002ULL); TitleIDs.push_back(0x0000000100000002ULL);
// TitleIDs.push_back(0x0001000248414341); // TitleIDs.push_back(0x0001000248414341);
// TitleIDs.push_back(0x0001000146414b45); // TitleIDs.push_back(0x0001000146414b45);
for (int i = 0; i < (int)TitleIDs.size(); i++) for (int i = 0; i < (int)TitleIDs.size(); i++)
{ {
Memory::Write_U64(TitleIDs[i], Buffer.PayloadBuffer[0].m_Address + i*8); Memory::Write_U64(TitleIDs[i], Buffer.PayloadBuffer[0].m_Address + i*8);
ERROR_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLES: %08x/%08x", TitleIDs[i] >> 32, TitleIDs[i]); ERROR_LOG(WII_IPC_ES, "IOCTL_ES_GETTITLES: %08x/%08x", TitleIDs[i] >> 32, TitleIDs[i]);
} }
} }
break; break;
// =============================================================================================== // ===============================================================================================
// unsupported functions // unsupported functions
// =============================================================================================== // ===============================================================================================
case IOCTL_ES_LAUNCH: case IOCTL_ES_LAUNCH:
{ {
_dbg_assert_(WII_IPC_ES, Buffer.NumberInBuffer == 2); _dbg_assert_(WII_IPC_ES, Buffer.NumberInBuffer == 2);
u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address);
u32 view = Memory::Read_U32(Buffer.InBuffer[1].m_Address); u32 view = Memory::Read_U32(Buffer.InBuffer[1].m_Address);
u64 ticketid = Memory::Read_U64(Buffer.InBuffer[1].m_Address+4); u64 ticketid = Memory::Read_U64(Buffer.InBuffer[1].m_Address+4);
u32 devicetype =Memory::Read_U32(Buffer.InBuffer[1].m_Address+12); u32 devicetype =Memory::Read_U32(Buffer.InBuffer[1].m_Address+12);
u64 titleid = Memory::Read_U64(Buffer.InBuffer[1].m_Address+16); u64 titleid = Memory::Read_U64(Buffer.InBuffer[1].m_Address+16);
u16 access = Memory::Read_U16(Buffer.InBuffer[1].m_Address+24); u16 access = Memory::Read_U16(Buffer.InBuffer[1].m_Address+24);
PanicAlert("IOCTL_ES_LAUNCH: src titleID %08x/%08x -> start %08x/%08x \n" PanicAlert("IOCTL_ES_LAUNCH: src titleID %08x/%08x -> start %08x/%08x \n"
"This means that dolphin tries to relaunch the WiiMenu or" "This means that dolphin tries to relaunch the WiiMenu or"
"launches code from the an URL. Both wont work and dolphin will prolly hang...", "launches code from the an URL. Both wont work and dolphin will prolly hang...",
TitleID>>32, TitleID, titleid>>32, titleid ); TitleID>>32, TitleID, titleid>>32, titleid );
Memory::Write_U32(0, _CommandAddress + 0x4); Memory::Write_U32(0, _CommandAddress + 0x4);
ERROR_LOG(WII_IPC_ES, "IOCTL_ES_LAUNCH"); ERROR_LOG(WII_IPC_ES, "IOCTL_ES_LAUNCH");
return true; return true;
} }
break; break;
case IOCTL_ES_GETVIEWS: case IOCTL_ES_GETVIEWS:
{ {
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 2, "IOCTL_ES_GETVIEWS no in buffer"); _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberInBuffer == 2, "IOCTL_ES_GETVIEWS no in buffer");
_dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "IOCTL_ES_GETVIEWS no out buffer"); _dbg_assert_msg_(WII_IPC_ES, Buffer.NumberPayloadBuffer == 1, "IOCTL_ES_GETVIEWS no out buffer");
u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address);
u32 Count = Memory::Read_U32(Buffer.InBuffer[1].m_Address); u32 Count = Memory::Read_U32(Buffer.InBuffer[1].m_Address);
_dbg_assert_msg_(WII_IPC_ES, TitleID==0x0000000100000002ull, "IOCTL_ES_GETVIEWS: TitleID != 00000001/00000002"); _dbg_assert_msg_(WII_IPC_ES, TitleID==0x0000000100000002ull, "IOCTL_ES_GETVIEWS: TitleID != 00000001/00000002");
/* write ticket data... hmmm /* write ticket data... hmmm
typedef struct _tikview { typedef struct _tikview {
u32 view; u32 view;
u64 ticketid; u64 ticketid;
u32 devicetype; u32 devicetype;
u64 titleid; u64 titleid;
u16 access_mask; u16 access_mask;
u8 reserved[0x3c]; u8 reserved[0x3c];
u8 cidx_mask[0x40]; u8 cidx_mask[0x40];
u16 padding; u16 padding;
tiklimit limits[8]; tiklimit limits[8];
} __attribute__((packed)) tikview; } __attribute__((packed)) tikview;
*/ */
Memory::Write_U32(1, Buffer.PayloadBuffer[0].m_Address); Memory::Write_U32(1, Buffer.PayloadBuffer[0].m_Address);
Memory::Write_U64(m_TitleID, Buffer.PayloadBuffer[0].m_Address+4); Memory::Write_U64(m_TitleID, Buffer.PayloadBuffer[0].m_Address+4);
Memory::Write_U32(0x00010001, Buffer.PayloadBuffer[0].m_Address+12); Memory::Write_U32(0x00010001, Buffer.PayloadBuffer[0].m_Address+12);
Memory::Write_U64(m_TitleID, Buffer.PayloadBuffer[0].m_Address+16); Memory::Write_U64(m_TitleID, Buffer.PayloadBuffer[0].m_Address+16);
Memory::Write_U16(0x777, Buffer.PayloadBuffer[0].m_Address+24); Memory::Write_U16(0x777, Buffer.PayloadBuffer[0].m_Address+24);
Memory::Write_U32(0, _CommandAddress + 0x4); Memory::Write_U32(0, _CommandAddress + 0x4);
_dbg_assert_msg_(WII_IPC_ES, 0, "IOCTL_ES_GETVIEWS: this looks really wrong..."); _dbg_assert_msg_(WII_IPC_ES, 0, "IOCTL_ES_GETVIEWS: this looks really wrong...");
ERROR_LOG(WII_IPC_ES, "IOCTL_ES_LAUNCH"); ERROR_LOG(WII_IPC_ES, "IOCTL_ES_LAUNCH");
return true; return true;
} }
break; break;
case IOCTL_ES_GETSTOREDTMDSIZE: case IOCTL_ES_GETSTOREDTMDSIZE:
{ {
_dbg_assert_msg_(WII_IPC_ES, 0, "IOCTL_ES_GETSTOREDTMDSIZE: this looks really wrong..."); _dbg_assert_msg_(WII_IPC_ES, 0, "IOCTL_ES_GETSTOREDTMDSIZE: this looks really wrong...");
/* u64 TitleId = Memory::Read_U64(Buffer.InBuffer[0].m_Address); /* u64 TitleId = Memory::Read_U64(Buffer.InBuffer[0].m_Address);
u32 OutBuffer = Memory::Read_U32(Buffer.PayloadBuffer[0].m_Address); u32 OutBuffer = Memory::Read_U32(Buffer.PayloadBuffer[0].m_Address);
Memory::Write_U32(0, OutBuffer); Memory::Write_U32(0, OutBuffer);
printf("ES_GetStoredTmdSize(%llx)\n", TitleId); printf("ES_GetStoredTmdSize(%llx)\n", TitleId);
LOG(WII_IPC_ES, "CWII_IPC_HLE_Device_es command:" LOG(WII_IPC_ES, "CWII_IPC_HLE_Device_es command:"
" IOCTL_ES_GETSTOREDTMDSIZE: 0x%x", OutBuffer);*/ " IOCTL_ES_GETSTOREDTMDSIZE: 0x%x", OutBuffer);*/
} }
break; break;
case IOCTL_ES_GETTMDVIEWCNT: case IOCTL_ES_GETTMDVIEWCNT:
_dbg_assert_msg_(WII_IPC_ES, 0, "IOCTL_ES_GETTMDVIEWCNT: this looks really wrong..."); _dbg_assert_msg_(WII_IPC_ES, 0, "IOCTL_ES_GETTMDVIEWCNT: this looks really wrong...");
break; break;
case IOCTL_ES_GETCONSUMPTION: // (Input: 8 bytes, Output: 0 bytes, 4 bytes) case IOCTL_ES_GETCONSUMPTION: // (Input: 8 bytes, Output: 0 bytes, 4 bytes)
_dbg_assert_msg_(WII_IPC_ES, 0, "IOCTL_ES_GETCONSUMPTION: this looks really wrong..."); _dbg_assert_msg_(WII_IPC_ES, 0, "IOCTL_ES_GETCONSUMPTION: this looks really wrong...");
break; break;
case IOCTL_ES_DIGETTICKETVIEW: // (Input: none, Output: 216 bytes) case IOCTL_ES_DIGETTICKETVIEW: // (Input: none, Output: 216 bytes)
_dbg_assert_msg_(WII_IPC_ES, 0, "IOCTL_ES_DIGETTICKETVIEW: this looks really wrong..."); _dbg_assert_msg_(WII_IPC_ES, 0, "IOCTL_ES_DIGETTICKETVIEW: this looks really wrong...");
break; break;
default: default:
_dbg_assert_msg_(WII_IPC_ES, 0, "CWII_IPC_HLE_Device_es: 0x%x", Buffer.Parameter); _dbg_assert_msg_(WII_IPC_ES, 0, "CWII_IPC_HLE_Device_es: 0x%x", Buffer.Parameter);
DumpCommands(_CommandAddress, 8); DumpCommands(_CommandAddress, 8);
INFO_LOG(WII_IPC_ES, "CWII_IPC_HLE_Device_es command:" INFO_LOG(WII_IPC_ES, "CWII_IPC_HLE_Device_es command:"
"Parameter: 0x%08x", Buffer.Parameter); "Parameter: 0x%08x", Buffer.Parameter);
break; break;
} }
// Write return value (0 means OK) // Write return value (0 means OK)
Memory::Write_U32(0, _CommandAddress + 0x4); Memory::Write_U32(0, _CommandAddress + 0x4);
return true; return true;
} }
DiscIO::CNANDContentLoader& CWII_IPC_HLE_Device_es::AccessContentDevice(u64 _TitleID) const DiscIO::CNANDContentLoader& CWII_IPC_HLE_Device_es::AccessContentDevice(u64 _TitleID) const
{ {
if (m_pContentLoader->IsValid() && m_pContentLoader->GetTitleID() == _TitleID) if (m_pContentLoader->IsValid() && m_pContentLoader->GetTitleID() == _TitleID)
return* m_pContentLoader; return* m_pContentLoader;
PanicAlert("Try to access unknown title content (%08x/%08x). Dolphin will prolly crash now.", _TitleID>>32, _TitleID); PanicAlert("Try to access unknown title content (%08x/%08x). Dolphin will prolly crash now.", _TitleID>>32, _TitleID);
return* m_pContentLoader; return* m_pContentLoader;
} }
bool CWII_IPC_HLE_Device_es::IsValid(u64 _TitleID) const bool CWII_IPC_HLE_Device_es::IsValid(u64 _TitleID) const
{ {
if (m_pContentLoader->IsValid() && m_pContentLoader->GetTitleID() == _TitleID) if (m_pContentLoader->IsValid() && m_pContentLoader->GetTitleID() == _TitleID)
return true; return true;
return false; return false;
} }

View File

@ -1,295 +1,295 @@
// 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 "stdafx.h" #include "stdafx.h"
#include "NANDContentLoader.h" #include "NANDContentLoader.h"
#include "AES/aes.h" #include "AES/aes.h"
#include "MathUtil.h" #include "MathUtil.h"
#include "FileUtil.h" #include "FileUtil.h"
#include "Log.h" #include "Log.h"
namespace DiscIO namespace DiscIO
{ {
class CBlobBigEndianReader class CBlobBigEndianReader
{ {
public: public:
CBlobBigEndianReader(DiscIO::IBlobReader& _rReader) : m_rReader(_rReader) {} CBlobBigEndianReader(DiscIO::IBlobReader& _rReader) : m_rReader(_rReader) {}
u32 Read32(u64 _Offset) u32 Read32(u64 _Offset)
{ {
u32 Temp; u32 Temp;
m_rReader.Read(_Offset, 4, (u8*)&Temp); m_rReader.Read(_Offset, 4, (u8*)&Temp);
return(Common::swap32(Temp)); return(Common::swap32(Temp));
} }
private: private:
DiscIO::IBlobReader& m_rReader; DiscIO::IBlobReader& m_rReader;
}; };
CNANDContentLoader::CNANDContentLoader(const std::string& _rName) CNANDContentLoader::CNANDContentLoader(const std::string& _rName)
: m_TitleID(-1) : m_TitleID(-1)
, m_BootIndex(-1) , m_BootIndex(-1)
, m_Valid(false) , m_Valid(false)
{ {
if (File::IsDirectory(_rName.c_str())) if (File::IsDirectory(_rName.c_str()))
{ {
m_Valid = CreateFromDirectory(_rName); m_Valid = CreateFromDirectory(_rName);
} }
else if (File::Exists(_rName.c_str())) else if (File::Exists(_rName.c_str()))
{ {
m_Valid = CreateFromWAD(_rName); m_Valid = CreateFromWAD(_rName);
} }
else else
{ {
// _dbg_assert_msg_(BOOT, 0, "CNANDContentLoader loads neither folder nor file"); // _dbg_assert_msg_(BOOT, 0, "CNANDContentLoader loads neither folder nor file");
} }
} }
CNANDContentLoader::~CNANDContentLoader() CNANDContentLoader::~CNANDContentLoader()
{ {
for (size_t i=0; i<m_Content.size(); i++) for (size_t i=0; i<m_Content.size(); i++)
{ {
delete [] m_Content[i].m_pData; delete [] m_Content[i].m_pData;
} }
m_Content.clear(); m_Content.clear();
} }
SNANDContent* CNANDContentLoader::GetContentByIndex(int _Index) SNANDContent* CNANDContentLoader::GetContentByIndex(int _Index)
{ {
for (size_t i=0; i<m_Content.size(); i++) for (size_t i=0; i<m_Content.size(); i++)
{ {
if (m_Content[i].m_Index == _Index) if (m_Content[i].m_Index == _Index)
return &m_Content[i]; return &m_Content[i];
} }
return NULL; return NULL;
} }
bool CNANDContentLoader::CreateFromWAD(const std::string& _rName) bool CNANDContentLoader::CreateFromWAD(const std::string& _rName)
{ {
DiscIO::IBlobReader* pReader = DiscIO::CreateBlobReader(_rName.c_str()); DiscIO::IBlobReader* pReader = DiscIO::CreateBlobReader(_rName.c_str());
if (pReader == NULL) if (pReader == NULL)
return false; return false;
bool Result = ParseWAD(*pReader); bool Result = ParseWAD(*pReader);
delete pReader; delete pReader;
return Result; return Result;
} }
bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath) bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
{ {
std::string TMDFileName(_rPath); std::string TMDFileName(_rPath);
TMDFileName += "/title.tmd"; TMDFileName += "/title.tmd";
FILE* pTMDFile = fopen(TMDFileName.c_str(), "rb"); FILE* pTMDFile = fopen(TMDFileName.c_str(), "rb");
if (pTMDFile == NULL) { if (pTMDFile == NULL) {
ERROR_LOG(DISCIO, "CreateFromDirectory: error opening %s", ERROR_LOG(DISCIO, "CreateFromDirectory: error opening %s",
TMDFileName.c_str()); TMDFileName.c_str());
return false; return false;
} }
u64 Size = File::GetSize(TMDFileName.c_str()); u64 Size = File::GetSize(TMDFileName.c_str());
u8* pTMD = new u8[(u32)Size]; u8* pTMD = new u8[(u32)Size];
fread(pTMD, (size_t)Size, 1, pTMDFile); fread(pTMD, (size_t)Size, 1, pTMDFile);
fclose(pTMDFile); fclose(pTMDFile);
////// //////
u32 numEntries = Common::swap16(pTMD + 0x01de); u32 numEntries = Common::swap16(pTMD + 0x01de);
m_BootIndex = Common::swap16(pTMD + 0x01e0); m_BootIndex = Common::swap16(pTMD + 0x01e0);
m_TitleID = Common::swap64(pTMD + 0x018C); m_TitleID = Common::swap64(pTMD + 0x018C);
m_Content.resize(numEntries); m_Content.resize(numEntries);
for (u32 i = 0; i < numEntries; i++) for (u32 i = 0; i < numEntries; i++)
{ {
SNANDContent& rContent = m_Content[i]; SNANDContent& rContent = m_Content[i];
rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i); rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i);
rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i); rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i);
rContent.m_Type = Common::swap16(pTMD + 0x01ea + 0x24*i); rContent.m_Type = Common::swap16(pTMD + 0x01ea + 0x24*i);
rContent.m_Size = (u32)Common::swap64(pTMD + 0x01ec + 0x24*i); rContent.m_Size = (u32)Common::swap64(pTMD + 0x01ec + 0x24*i);
rContent.m_pData = NULL; rContent.m_pData = NULL;
char szFilename[1024]; char szFilename[1024];
sprintf(szFilename, "%s/%08x.app", _rPath.c_str(), rContent.m_ContentID); sprintf(szFilename, "%s/%08x.app", _rPath.c_str(), rContent.m_ContentID);
FILE* pFile = fopen(szFilename, "rb"); FILE* pFile = fopen(szFilename, "rb");
// i have seen TMDs which index to app which doesn't exist... // i have seen TMDs which index to app which doesn't exist...
if (pFile != NULL) if (pFile != NULL)
{ {
u64 Size = File::GetSize(szFilename); u64 Size = File::GetSize(szFilename);
rContent.m_pData = new u8[(u32)Size]; rContent.m_pData = new u8[(u32)Size];
_dbg_assert_msg_(BOOT, rContent.m_Size==Size, "TMDLoader: Filesize doesnt fit (%s %i)", szFilename, i); _dbg_assert_msg_(BOOT, rContent.m_Size==Size, "TMDLoader: Filesize doesnt fit (%s %i)", szFilename, i);
fread(rContent.m_pData, (size_t)Size, 1, pFile); fread(rContent.m_pData, (size_t)Size, 1, pFile);
fclose(pFile); fclose(pFile);
} else { } else {
ERROR_LOG(DISCIO, "CreateFromDirectory: error opening %s", ERROR_LOG(DISCIO, "CreateFromDirectory: error opening %s",
szFilename); szFilename);
} }
} }
return true; return true;
} }
bool CNANDContentLoader::IsWiiWAD(const std::string& _rName) bool CNANDContentLoader::IsWiiWAD(const std::string& _rName)
{ {
DiscIO::IBlobReader* pReader = DiscIO::CreateBlobReader(_rName.c_str()); DiscIO::IBlobReader* pReader = DiscIO::CreateBlobReader(_rName.c_str());
if (pReader == NULL) if (pReader == NULL)
return false; return false;
CBlobBigEndianReader Reader(*pReader); CBlobBigEndianReader Reader(*pReader);
bool Result = false; bool Result = false;
// check for wii wad // check for wii wad
if (Reader.Read32(0x00) == 0x20) if (Reader.Read32(0x00) == 0x20)
{ {
u32 WADTYpe = Reader.Read32(0x04); u32 WADTYpe = Reader.Read32(0x04);
switch(WADTYpe) switch(WADTYpe)
{ {
case 0x49730000: case 0x49730000:
case 0x69620000: case 0x69620000:
Result = true; Result = true;
} }
} }
delete pReader; delete pReader;
return Result; return Result;
} }
void CNANDContentLoader::AESDecode(u8* _pKey, u8* _IV, u8* _pSrc, u32 _Size, u8* _pDest) void CNANDContentLoader::AESDecode(u8* _pKey, u8* _IV, u8* _pSrc, u32 _Size, u8* _pDest)
{ {
AES_KEY AESKey; AES_KEY AESKey;
AES_set_decrypt_key(_pKey, 128, &AESKey); AES_set_decrypt_key(_pKey, 128, &AESKey);
AES_cbc_encrypt(_pSrc, _pDest, _Size, &AESKey, _IV, AES_DECRYPT); AES_cbc_encrypt(_pSrc, _pDest, _Size, &AESKey, _IV, AES_DECRYPT);
} }
u8* CNANDContentLoader::CreateWADEntry(DiscIO::IBlobReader& _rReader, u32 _Size, u64 _Offset) u8* CNANDContentLoader::CreateWADEntry(DiscIO::IBlobReader& _rReader, u32 _Size, u64 _Offset)
{ {
if (_Size > 0) if (_Size > 0)
{ {
u8* pTmpBuffer = new u8[_Size]; u8* pTmpBuffer = new u8[_Size];
_dbg_assert_msg_(BOOT, pTmpBuffer!=0, "WiiWAD: Cant allocate memory for WAD entry"); _dbg_assert_msg_(BOOT, pTmpBuffer!=0, "WiiWAD: Cant allocate memory for WAD entry");
if (!_rReader.Read(_Offset, _Size, pTmpBuffer)) if (!_rReader.Read(_Offset, _Size, pTmpBuffer))
{ {
ERROR_LOG(DISCIO, "WiiWAD: Could not read from file"); ERROR_LOG(DISCIO, "WiiWAD: Could not read from file");
PanicAlert("WiiWAD: Could not read from file"); PanicAlert("WiiWAD: Could not read from file");
} }
return pTmpBuffer; return pTmpBuffer;
} }
return NULL; return NULL;
} }
void CNANDContentLoader::GetKeyFromTicket(u8* pTicket, u8* pTicketKey) void CNANDContentLoader::GetKeyFromTicket(u8* pTicket, u8* pTicketKey)
{ {
u8 CommonKey[16] = {0xeb,0xe4,0x2a,0x22,0x5e,0x85,0x93,0xe4,0x48,0xd9,0xc5,0x45,0x73,0x81,0xaa,0xf7}; u8 CommonKey[16] = {0xeb,0xe4,0x2a,0x22,0x5e,0x85,0x93,0xe4,0x48,0xd9,0xc5,0x45,0x73,0x81,0xaa,0xf7};
u8 IV[16]; u8 IV[16];
memset(IV, 0, sizeof IV); memset(IV, 0, sizeof IV);
memcpy(IV, pTicket + 0x01dc, 8); memcpy(IV, pTicket + 0x01dc, 8);
AESDecode(CommonKey, IV, pTicket + 0x01bf, 16, pTicketKey); AESDecode(CommonKey, IV, pTicket + 0x01bf, 16, pTicketKey);
} }
bool CNANDContentLoader::ParseTMD(u8* pDataApp, u32 pDataAppSize, u8* pTicket, u8* pTMD) bool CNANDContentLoader::ParseTMD(u8* pDataApp, u32 pDataAppSize, u8* pTicket, u8* pTMD)
{ {
u8 DecryptTitleKey[16]; u8 DecryptTitleKey[16];
u8 IV[16]; u8 IV[16];
GetKeyFromTicket(pTicket, DecryptTitleKey); GetKeyFromTicket(pTicket, DecryptTitleKey);
u32 numEntries = Common::swap16(pTMD + 0x01de); u32 numEntries = Common::swap16(pTMD + 0x01de);
m_BootIndex = Common::swap16(pTMD + 0x01e0); m_BootIndex = Common::swap16(pTMD + 0x01e0);
m_TitleID = Common::swap64(pTMD + 0x018C); m_TitleID = Common::swap64(pTMD + 0x018C);
u8* p = pDataApp; u8* p = pDataApp;
m_Content.resize(numEntries); m_Content.resize(numEntries);
for (u32 i=0; i<numEntries; i++) for (u32 i=0; i<numEntries; i++)
{ {
SNANDContent& rContent = m_Content[i]; SNANDContent& rContent = m_Content[i];
rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i); rContent.m_ContentID = Common::swap32(pTMD + 0x01e4 + 0x24*i);
rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i); rContent.m_Index = Common::swap16(pTMD + 0x01e8 + 0x24*i);
rContent.m_Type = Common::swap16(pTMD + 0x01ea + 0x24*i); rContent.m_Type = Common::swap16(pTMD + 0x01ea + 0x24*i);
rContent.m_Size= (u32)Common::swap64(pTMD + 0x01ec + 0x24*i); rContent.m_Size= (u32)Common::swap64(pTMD + 0x01ec + 0x24*i);
u32 RoundedSize = ROUND_UP(rContent.m_Size, 0x40); u32 RoundedSize = ROUND_UP(rContent.m_Size, 0x40);
rContent.m_pData = new u8[RoundedSize]; rContent.m_pData = new u8[RoundedSize];
memset(IV, 0, sizeof IV); memset(IV, 0, sizeof IV);
memcpy(IV, pTMD + 0x01e8 + 0x24*i, 2); memcpy(IV, pTMD + 0x01e8 + 0x24*i, 2);
AESDecode(DecryptTitleKey, IV, p, RoundedSize, rContent.m_pData); AESDecode(DecryptTitleKey, IV, p, RoundedSize, rContent.m_pData);
p += RoundedSize; p += RoundedSize;
} }
return true; return true;
} }
bool CNANDContentLoader::ParseWAD(DiscIO::IBlobReader& _rReader) bool CNANDContentLoader::ParseWAD(DiscIO::IBlobReader& _rReader)
{ {
CBlobBigEndianReader ReaderBig(_rReader); CBlobBigEndianReader ReaderBig(_rReader);
// get header size // get header size
u32 HeaderSize = ReaderBig.Read32(0); u32 HeaderSize = ReaderBig.Read32(0);
if (HeaderSize != 0x20) if (HeaderSize != 0x20)
{ {
_dbg_assert_msg_(BOOT, (HeaderSize==0x20), "WiiWAD: Header size != 0x20"); _dbg_assert_msg_(BOOT, (HeaderSize==0x20), "WiiWAD: Header size != 0x20");
return false; return false;
} }
// get header // get header
u8 Header[0x20]; u8 Header[0x20];
_rReader.Read(0, HeaderSize, Header); _rReader.Read(0, HeaderSize, Header);
u32 HeaderType = ReaderBig.Read32(0x4); u32 HeaderType = ReaderBig.Read32(0x4);
if ((0x49730000 != HeaderType) && (0x69620000 != HeaderType)) if ((0x49730000 != HeaderType) && (0x69620000 != HeaderType))
return false; return false;
u32 CertificateChainSize = ReaderBig.Read32(0x8); u32 CertificateChainSize = ReaderBig.Read32(0x8);
u32 Reserved = ReaderBig.Read32(0xC); u32 Reserved = ReaderBig.Read32(0xC);
u32 TicketSize = ReaderBig.Read32(0x10); u32 TicketSize = ReaderBig.Read32(0x10);
u32 TMDSize = ReaderBig.Read32(0x14); u32 TMDSize = ReaderBig.Read32(0x14);
u32 DataAppSize = ReaderBig.Read32(0x18); u32 DataAppSize = ReaderBig.Read32(0x18);
u32 FooterSize = ReaderBig.Read32(0x1C); u32 FooterSize = ReaderBig.Read32(0x1C);
_dbg_assert_msg_(BOOT, Reserved==0x00, "WiiWAD: Reserved must be 0x00"); _dbg_assert_msg_(BOOT, Reserved==0x00, "WiiWAD: Reserved must be 0x00");
u32 Offset = 0x40; u32 Offset = 0x40;
u8* pCertificateChain = CreateWADEntry(_rReader, CertificateChainSize, Offset); Offset += ROUND_UP(CertificateChainSize, 0x40); u8* pCertificateChain = CreateWADEntry(_rReader, CertificateChainSize, Offset); Offset += ROUND_UP(CertificateChainSize, 0x40);
u8* pTicket = CreateWADEntry(_rReader, TicketSize, Offset); Offset += ROUND_UP(TicketSize, 0x40); u8* pTicket = CreateWADEntry(_rReader, TicketSize, Offset); Offset += ROUND_UP(TicketSize, 0x40);
u8* pTMD = CreateWADEntry(_rReader, TMDSize, Offset); Offset += ROUND_UP(TMDSize, 0x40); u8* pTMD = CreateWADEntry(_rReader, TMDSize, Offset); Offset += ROUND_UP(TMDSize, 0x40);
u8* pDataApp = CreateWADEntry(_rReader, DataAppSize, Offset); Offset += ROUND_UP(DataAppSize, 0x40); u8* pDataApp = CreateWADEntry(_rReader, DataAppSize, Offset); Offset += ROUND_UP(DataAppSize, 0x40);
u8* pFooter = CreateWADEntry(_rReader, FooterSize, Offset); Offset += ROUND_UP(FooterSize, 0x40); u8* pFooter = CreateWADEntry(_rReader, FooterSize, Offset); Offset += ROUND_UP(FooterSize, 0x40);
bool Result = ParseTMD(pDataApp, DataAppSize, pTicket, pTMD); bool Result = ParseTMD(pDataApp, DataAppSize, pTicket, pTMD);
return Result; return Result;
} }
} // namespace end } // namespace end

View File

@ -1,312 +1,312 @@
/* /*
Automatic generated header by: Automatic generated header by:
wxInclude by Kim De Deyn, use --help for more information. wxInclude by Kim De Deyn, use --help for more information.
Version 1.0, compiled at Sep 12 2007 17:26:17 Version 1.0, compiled at Sep 12 2007 17:26:17
Header: myheader Header: myheader
Macros: no Macros: no
Const: yes Const: yes
*/ */
#ifndef _WXINCLUDE_MYHEADER_0_H_ #ifndef _WXINCLUDE_MYHEADER_0_H_
#define _WXINCLUDE_MYHEADER_0_H_ #define _WXINCLUDE_MYHEADER_0_H_
static const unsigned char Toolbar_Log_png[] = { static const unsigned char Toolbar_Log_png[] = {
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18,
0x00, 0x00, 0x00, 0x18, 0x08, 0x06, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x18, 0x08, 0x06, 0x00, 0x00, 0x00, 0xE0,
0x77, 0x3D, 0xF8, 0x00, 0x00, 0x05, 0xC0, 0x49, 0x44, 0x41, 0x77, 0x3D, 0xF8, 0x00, 0x00, 0x05, 0xC0, 0x49, 0x44, 0x41,
0x54, 0x78, 0x9C, 0xB5, 0x56, 0x79, 0x6C, 0x14, 0x75, 0x14, 0x54, 0x78, 0x9C, 0xB5, 0x56, 0x79, 0x6C, 0x14, 0x75, 0x14,
0xFE, 0x66, 0xF6, 0xE8, 0x5E, 0xED, 0x1E, 0x6D, 0x77, 0xDB, 0xFE, 0x66, 0xF6, 0xE8, 0x5E, 0xED, 0x1E, 0x6D, 0x77, 0xDB,
0xED, 0x1E, 0x3D, 0x96, 0x5E, 0x58, 0x5A, 0xDA, 0xD2, 0x42, 0xED, 0x1E, 0x3D, 0x96, 0x5E, 0x58, 0x5A, 0xDA, 0xD2, 0x42,
0xA5, 0x35, 0x6D, 0x38, 0x24, 0xB6, 0x85, 0x42, 0x29, 0x06, 0xA5, 0x35, 0x6D, 0x38, 0x24, 0xB6, 0x85, 0x42, 0x29, 0x06,
0xAD, 0x78, 0x80, 0x5A, 0xA2, 0x26, 0x42, 0x62, 0x48, 0x10, 0xAD, 0x78, 0x80, 0x5A, 0xA2, 0x26, 0x42, 0x62, 0x48, 0x10,
0x83, 0x09, 0x68, 0x8C, 0x4D, 0x4A, 0x0C, 0x12, 0x45, 0x12, 0x83, 0x09, 0x68, 0x8C, 0x4D, 0x4A, 0x0C, 0x12, 0x45, 0x12,
0x30, 0x2A, 0x04, 0xFF, 0x30, 0x8A, 0x04, 0x08, 0x06, 0x91, 0x30, 0x2A, 0x04, 0xFF, 0x30, 0x8A, 0x04, 0x08, 0x06, 0x91,
0x48, 0xC2, 0x65, 0x15, 0xA5, 0x45, 0x10, 0x28, 0x45, 0xE9, 0x48, 0xC2, 0x65, 0x15, 0xA5, 0x45, 0x10, 0x28, 0x45, 0xE9,
0x96, 0x76, 0xDB, 0xED, 0x76, 0x69, 0xF7, 0x9A, 0x99, 0x1D, 0x96, 0x76, 0xDB, 0xED, 0x76, 0x69, 0xF7, 0x9A, 0x99, 0x1D,
0xDF, 0x0C, 0x52, 0xA9, 0x85, 0xF8, 0x8F, 0xFE, 0x92, 0x97, 0xDF, 0x0C, 0x52, 0xA9, 0x85, 0xF8, 0x8F, 0xFE, 0x92, 0x97,
0xDF, 0xCC, 0xFC, 0x66, 0xBE, 0xF7, 0xDE, 0xF7, 0xBE, 0xF7, 0xDF, 0xCC, 0xFC, 0x66, 0xBE, 0xF7, 0xDE, 0xF7, 0xBE, 0xF7,
0x76, 0x81, 0xFF, 0x79, 0x29, 0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0xE9, 0x84, 0x91, 0x27, 0xB6, 0x3C, 0x8B, 0x8E, 0xD7, 0x16, 0xE9, 0x84, 0x91, 0x27, 0xB6, 0x3C, 0x8B, 0x8E,
0xE2, 0x7E, 0xAB, 0x63, 0x35, 0x52, 0xC9, 0xB6, 0x6D, 0x5B, 0xE2, 0x7E, 0xAB, 0x63, 0x35, 0x52, 0xC9, 0xB6, 0x6D, 0x5B,
0x8D, 0x57, 0x3A, 0x9E, 0x83, 0xB3, 0xE3, 0x79, 0x28, 0x3B, 0x8D, 0x57, 0x3A, 0x9E, 0x83, 0xB3, 0xE3, 0x79, 0x28, 0x3B,
0xD6, 0x80, 0x7D, 0xF7, 0x99, 0xBF, 0xE9, 0x7C, 0xBB, 0x15, 0xD6, 0x80, 0x7D, 0xF7, 0x99, 0xBF, 0xE9, 0x7C, 0xBB, 0x15,
0xCC, 0xD6, 0xA7, 0xC0, 0x6E, 0x59, 0x09, 0xE5, 0x1B, 0xCB, 0xCC, 0xD6, 0xA7, 0xC0, 0x6E, 0x59, 0x09, 0xE5, 0x1B, 0xCB,
0x61, 0x22, 0xBE, 0xB3, 0xC9, 0x6A, 0xC9, 0x5A, 0xC9, 0x4A, 0x61, 0x22, 0xBE, 0xB3, 0xC9, 0x6A, 0xC9, 0x5A, 0xC9, 0x4A,
0xC8, 0x1E, 0xF8, 0x67, 0xE2, 0x3F, 0x5F, 0x7F, 0x02, 0x1C, 0xC8, 0x1E, 0xF8, 0x67, 0xE2, 0x3F, 0x5F, 0x7F, 0x02, 0x1C,
0xAC, 0x2A, 0x6C, 0xAB, 0x0A, 0x12, 0x89, 0x00, 0x00, 0x00, 0xAC, 0x2A, 0x6C, 0xAB, 0x0A, 0x12, 0x89, 0x00, 0x00, 0x00,
0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82
}; };
static const unsigned char Toolbar_Zoom_png[] = { static const unsigned char Toolbar_Zoom_png[] = {
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x18,
0x00, 0x00, 0x00, 0x18, 0x08, 0x06, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x18, 0x08, 0x06, 0x00, 0x00, 0x00, 0xE0,
0x77, 0x3D, 0xF8, 0x00, 0x00, 0x05, 0x1C, 0x49, 0x44, 0x41, 0x77, 0x3D, 0xF8, 0x00, 0x00, 0x05, 0x1C, 0x49, 0x44, 0x41,
0x54, 0x78, 0x9C, 0xB5, 0x95, 0x6B, 0x6C, 0x14, 0x55, 0x18, 0x54, 0x78, 0x9C, 0xB5, 0x95, 0x6B, 0x6C, 0x14, 0x55, 0x18,
0x86, 0x9F, 0x99, 0x9D, 0x9D, 0xBD, 0x74, 0x77, 0xBB, 0xDB, 0x86, 0x9F, 0x99, 0x9D, 0x9D, 0xBD, 0x74, 0x77, 0xBB, 0xDB,
0x42, 0x8B, 0xF4, 0x4A, 0x57, 0x28, 0x2D, 0xA4, 0x14, 0xB0, 0x42, 0x8B, 0xF4, 0x4A, 0x57, 0x28, 0x2D, 0xA4, 0x14, 0xB0,
0x96, 0x0A, 0x04, 0xA1, 0x5C, 0x02, 0x96, 0x4B, 0x81, 0x6A, 0x96, 0x0A, 0x04, 0xA1, 0x5C, 0x02, 0x96, 0x4B, 0x81, 0x6A,
0x55, 0xAE, 0x82, 0xA0, 0x09, 0xC4, 0x00, 0x11, 0x03, 0x14, 0x55, 0xAE, 0x82, 0xA0, 0x09, 0xC4, 0x00, 0x11, 0x03, 0x14,
0x02, 0x05, 0x6F, 0x44, 0x40, 0x91, 0x10, 0x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, 0x25, 0xF6, 0x6D, 0xAD, 0x58, 0x50, 0xBA, 0x9D, 0xF7, 0x1F, 0x25, 0xF6, 0x6D, 0xAD,
0x28, 0x42, 0x5D, 0x59, 0x24, 0xBD, 0x58, 0x5A, 0xAC, 0xBF, 0x28, 0x42, 0x5D, 0x59, 0x24, 0xBD, 0x58, 0x5A, 0xAC, 0xBF,
0xB8, 0xAA, 0xD8, 0xA8, 0xAD, 0x28, 0x52, 0xB4, 0xE5, 0x93, 0xB8, 0xAA, 0xD8, 0xA8, 0xAD, 0x28, 0x52, 0xB4, 0xE5, 0x93,
0xA8, 0x5B, 0x31, 0x89, 0xD9, 0xE2, 0xAE, 0xFE, 0xA7, 0xE0, 0xA8, 0x5B, 0x31, 0x89, 0xD9, 0xE2, 0xAE, 0xFE, 0xA7, 0xE0,
0xB7, 0x54, 0x3A, 0x19, 0x69, 0x49, 0x01, 0xCE, 0xA5, 0xE3, 0xB7, 0x54, 0x3A, 0x19, 0x69, 0x49, 0x01, 0xCE, 0xA5, 0xE3,
0x99, 0xB2, 0xAC, 0x90, 0xA9, 0x25, 0x13, 0x71, 0xAE, 0x2C, 0x99, 0xB2, 0xAC, 0x90, 0xA9, 0x25, 0x13, 0x71, 0xAE, 0x2C,
0xBA, 0xFB, 0x33, 0xFC, 0x07, 0x07, 0x66, 0xCF, 0x92, 0x85, 0xBA, 0xFB, 0x33, 0xFC, 0x07, 0x07, 0x66, 0xCF, 0x92, 0x85,
0x17, 0xB4, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x17, 0xB4, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E,
0x44, 0xAE, 0x42, 0x60, 0x82 0x44, 0xAE, 0x42, 0x60, 0x82
}; };
#endif #endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,264 +1,264 @@
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com) // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
// //
// This software is provided 'as-is', without any express or implied warranty. // This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software. // In no event will the authors be held liable for any damages arising from the use of this software.
// //
// Permission is granted to anyone to use this software for any purpose, // Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely, // including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions: // subject to the following restrictions:
// //
// 1. The origin of this software must not be misrepresented; // 1. The origin of this software must not be misrepresented;
// you must not claim that you wrote the original software. // you must not claim that you wrote the original software.
// If you use this software in a product, an acknowledgment // If you use this software in a product, an acknowledgment
// in the product documentation would be appreciated but is not required. // in the product documentation would be appreciated but is not required.
// //
// 2. Altered source versions must be plainly marked as such, // 2. Altered source versions must be plainly marked as such,
// and must not be misrepresented as being the original software. // and must not be misrepresented as being the original software.
// //
// 3. This notice may not be removed or altered from any source distribution. // 3. This notice may not be removed or altered from any source distribution.
#ifndef SFML_EVENT_HPP #ifndef SFML_EVENT_HPP
#define SFML_EVENT_HPP #define SFML_EVENT_HPP
namespace sf namespace sf
{ {
namespace Key namespace Key
{ {
enum Code enum Code
{ {
A = 'a', A = 'a',
B = 'b', B = 'b',
C = 'c', C = 'c',
D = 'd', D = 'd',
E = 'e', E = 'e',
F = 'f', F = 'f',
G = 'g', G = 'g',
H = 'h', H = 'h',
I = 'i', I = 'i',
J = 'j', J = 'j',
K = 'k', K = 'k',
L = 'l', L = 'l',
M = 'm', M = 'm',
N = 'n', N = 'n',
O = 'o', O = 'o',
P = 'p', P = 'p',
Q = 'q', Q = 'q',
R = 'r', R = 'r',
S = 's', S = 's',
T = 't', T = 't',
U = 'u', U = 'u',
V = 'v', V = 'v',
W = 'w', W = 'w',
X = 'x', X = 'x',
Y = 'y', Y = 'y',
Z = 'z', Z = 'z',
Num0 = '0', Num0 = '0',
Num1 = '1', Num1 = '1',
Num2 = '2', Num2 = '2',
Num3 = '3', Num3 = '3',
Num4 = '4', Num4 = '4',
Num5 = '5', Num5 = '5',
Num6 = '6', Num6 = '6',
Num7 = '7', Num7 = '7',
Num8 = '8', Num8 = '8',
Num9 = '9', Num9 = '9',
Escape = 256, Escape = 256,
LControl, LControl,
LShift, LShift,
LAlt, LAlt,
LSystem, LSystem,
RControl, RControl,
RShift, RShift,
RAlt, RAlt,
RSystem, RSystem,
Menu, Menu,
LBracket, LBracket,
RBracket, RBracket,
SemiColon, SemiColon,
Comma, Comma,
Period, Period,
Quote, Quote,
Slash, Slash,
BackSlash, BackSlash,
Tilde, Tilde,
Equal, Equal,
Dash, Dash,
Space, Space,
Return, Return,
Back, Back,
Tab, Tab,
PageUp, PageUp,
PageDown, PageDown,
End, End,
Home, Home,
Insert, Insert,
Delete, Delete,
Add, Add,
Subtract, Subtract,
Multiply, Multiply,
Divide, Divide,
Left, Left,
Right, Right,
Up, Up,
Down, Down,
Numpad0, Numpad0,
Numpad1, Numpad1,
Numpad2, Numpad2,
Numpad3, Numpad3,
Numpad4, Numpad4,
Numpad5, Numpad5,
Numpad6, Numpad6,
Numpad7, Numpad7,
Numpad8, Numpad8,
Numpad9, Numpad9,
F1, F1,
F2, F2,
F3, F3,
F4, F4,
F5, F5,
F6, F6,
F7, F7,
F8, F8,
F9, F9,
F10, F10,
F11, F11,
F12, F12,
F13, F13,
F14, F14,
F15, F15,
Pause, Pause,
Count // For internal use Count // For internal use
}; };
} }
namespace Mouse namespace Mouse
{ {
enum Button enum Button
{ {
Left, Left,
Right, Right,
Middle, Middle,
XButton1, XButton1,
XButton2, XButton2,
Count // For internal use Count // For internal use
}; };
} }
namespace Joy namespace Joy
{ {
enum Axis enum Axis
{ {
AxisX, AxisX,
AxisY, AxisY,
AxisZ, AxisZ,
AxisR, AxisR,
AxisU, AxisU,
AxisV, AxisV,
AxisPOV, AxisPOV,
Count // For internal use Count // For internal use
}; };
} }
class Event class Event
{ {
public : public :
struct KeyEvent struct KeyEvent
{ {
Key::Code Code; Key::Code Code;
bool Alt; bool Alt;
bool Control; bool Control;
bool Shift; bool Shift;
}; };
struct TextEvent struct TextEvent
{ {
// I'm not sure we need this... // I'm not sure we need this...
unsigned short Unicode; unsigned short Unicode;
}; };
struct MouseMoveEvent struct MouseMoveEvent
{ {
int X; int X;
int Y; int Y;
}; };
struct MouseButtonEvent struct MouseButtonEvent
{ {
Mouse::Button Button; Mouse::Button Button;
int X; int X;
int Y; int Y;
}; };
struct MouseWheelEvent struct MouseWheelEvent
{ {
int Delta; int Delta;
}; };
struct JoyMoveEvent struct JoyMoveEvent
{ {
unsigned int JoystickId; unsigned int JoystickId;
Joy::Axis Axis; Joy::Axis Axis;
float Position; float Position;
}; };
struct JoyButtonEvent struct JoyButtonEvent
{ {
unsigned int JoystickId; unsigned int JoystickId;
unsigned int Button; unsigned int Button;
}; };
struct SizeEvent struct SizeEvent
{ {
unsigned int Width; unsigned int Width;
unsigned int Height; unsigned int Height;
}; };
enum EventType enum EventType
{ {
Closed, Closed,
Resized, Resized,
LostFocus, LostFocus,
GainedFocus, GainedFocus,
TextEntered, TextEntered,
KeyPressed, KeyPressed,
KeyReleased, KeyReleased,
MouseWheelMoved, MouseWheelMoved,
MouseButtonPressed, MouseButtonPressed,
MouseButtonReleased, MouseButtonReleased,
MouseMoved, MouseMoved,
MouseEntered, MouseEntered,
MouseLeft, MouseLeft,
JoyButtonPressed, JoyButtonPressed,
JoyButtonReleased, JoyButtonReleased,
JoyMoved JoyMoved
}; };
// Member data // Member data
EventType Type; EventType Type;
union union
{ {
KeyEvent Key; KeyEvent Key;
TextEvent Text; TextEvent Text;
MouseMoveEvent MouseMove; MouseMoveEvent MouseMove;
MouseButtonEvent MouseButton; MouseButtonEvent MouseButton;
MouseWheelEvent MouseWheel; MouseWheelEvent MouseWheel;
JoyMoveEvent JoyMove; JoyMoveEvent JoyMove;
JoyButtonEvent JoyButton; JoyButtonEvent JoyButton;
SizeEvent Size; SizeEvent Size;
}; };
}; };
} // namespace sf } // namespace sf
#endif // SFML_EVENT_HPP #endif // SFML_EVENT_HPP

View File

@ -1,189 +1,189 @@
// 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 <vector> #include <vector>
#include <algorithm> #include <algorithm>
#include "VideoCommon.h" #include "VideoCommon.h"
#include "Statistics.h" #include "Statistics.h"
#include "VertexShaderManager.h" #include "VertexShaderManager.h"
#include "VertexLoader.h" #include "VertexLoader.h"
#include "VertexLoaderManager.h" #include "VertexLoaderManager.h"
static int s_attr_dirty; // bitfield static int s_attr_dirty; // bitfield
static VertexLoader *g_VertexLoaders[8]; static VertexLoader *g_VertexLoaders[8];
namespace VertexLoaderManager namespace VertexLoaderManager
{ {
typedef std::map<VertexLoaderUID, VertexLoader *> VertexLoaderMap; typedef std::map<VertexLoaderUID, VertexLoader *> VertexLoaderMap;
static VertexLoaderMap g_VertexLoaderMap; static VertexLoaderMap g_VertexLoaderMap;
// TODO - change into array of pointers. Keep a map of all seen so far. // TODO - change into array of pointers. Keep a map of all seen so far.
void Init() void Init()
{ {
MarkAllDirty(); MarkAllDirty();
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
g_VertexLoaders[i] = NULL; g_VertexLoaders[i] = NULL;
} }
void Shutdown() void Shutdown()
{ {
for (VertexLoaderMap::iterator iter = g_VertexLoaderMap.begin(); iter != g_VertexLoaderMap.end(); ++iter) for (VertexLoaderMap::iterator iter = g_VertexLoaderMap.begin(); iter != g_VertexLoaderMap.end(); ++iter)
{ {
delete iter->second; delete iter->second;
} }
g_VertexLoaderMap.clear(); g_VertexLoaderMap.clear();
} }
namespace { namespace {
struct entry { struct entry {
std::string text; std::string text;
u64 num_verts; u64 num_verts;
bool operator < (const entry &other) const { bool operator < (const entry &other) const {
return num_verts > other.num_verts; return num_verts > other.num_verts;
} }
}; };
} }
void AppendListToString(std::string *dest) void AppendListToString(std::string *dest)
{ {
std::vector<entry> entries; std::vector<entry> entries;
size_t total_size = 0; size_t total_size = 0;
for (VertexLoaderMap::const_iterator iter = g_VertexLoaderMap.begin(); iter != g_VertexLoaderMap.end(); ++iter) for (VertexLoaderMap::const_iterator iter = g_VertexLoaderMap.begin(); iter != g_VertexLoaderMap.end(); ++iter)
{ {
entry e; entry e;
iter->second->AppendToString(&e.text); iter->second->AppendToString(&e.text);
e.num_verts = iter->second->GetNumLoadedVerts(); e.num_verts = iter->second->GetNumLoadedVerts();
entries.push_back(e); entries.push_back(e);
total_size += e.text.size() + 1; total_size += e.text.size() + 1;
} }
sort(entries.begin(), entries.end()); sort(entries.begin(), entries.end());
dest->reserve(dest->size() + total_size); dest->reserve(dest->size() + total_size);
for (std::vector<entry>::const_iterator iter = entries.begin(); iter != entries.end(); ++iter) { for (std::vector<entry>::const_iterator iter = entries.begin(); iter != entries.end(); ++iter) {
dest->append(iter->text); dest->append(iter->text);
} }
} }
void MarkAllDirty() void MarkAllDirty()
{ {
s_attr_dirty = 0xff; s_attr_dirty = 0xff;
} }
static void RefreshLoader(int vtx_attr_group) static void RefreshLoader(int vtx_attr_group)
{ {
if ((s_attr_dirty >> vtx_attr_group) & 1) if ((s_attr_dirty >> vtx_attr_group) & 1)
{ {
VertexLoaderUID uid; VertexLoaderUID uid;
uid.InitFromCurrentState(vtx_attr_group); uid.InitFromCurrentState(vtx_attr_group);
VertexLoaderMap::iterator iter = g_VertexLoaderMap.find(uid); VertexLoaderMap::iterator iter = g_VertexLoaderMap.find(uid);
if (iter != g_VertexLoaderMap.end()) if (iter != g_VertexLoaderMap.end())
{ {
g_VertexLoaders[vtx_attr_group] = iter->second; g_VertexLoaders[vtx_attr_group] = iter->second;
} }
else else
{ {
VertexLoader *loader = new VertexLoader(g_VtxDesc, g_VtxAttr[vtx_attr_group]); VertexLoader *loader = new VertexLoader(g_VtxDesc, g_VtxAttr[vtx_attr_group]);
g_VertexLoaderMap[uid] = loader; g_VertexLoaderMap[uid] = loader;
g_VertexLoaders[vtx_attr_group] = loader; g_VertexLoaders[vtx_attr_group] = loader;
INCSTAT(stats.numVertexLoaders); INCSTAT(stats.numVertexLoaders);
} }
} }
s_attr_dirty &= ~(1 << vtx_attr_group); s_attr_dirty &= ~(1 << vtx_attr_group);
} }
void RunVertices(int vtx_attr_group, int primitive, int count) void RunVertices(int vtx_attr_group, int primitive, int count)
{ {
if (!count) if (!count)
return; return;
RefreshLoader(vtx_attr_group); RefreshLoader(vtx_attr_group);
g_VertexLoaders[vtx_attr_group]->RunVertices(vtx_attr_group, primitive, count); g_VertexLoaders[vtx_attr_group]->RunVertices(vtx_attr_group, primitive, count);
} }
int GetVertexSize(int vtx_attr_group) int GetVertexSize(int vtx_attr_group)
{ {
RefreshLoader(vtx_attr_group); RefreshLoader(vtx_attr_group);
return g_VertexLoaders[vtx_attr_group]->GetVertexSize(); return g_VertexLoaders[vtx_attr_group]->GetVertexSize();
} }
} // namespace } // namespace
void LoadCPReg(u32 sub_cmd, u32 value) void LoadCPReg(u32 sub_cmd, u32 value)
{ {
switch (sub_cmd & 0xF0) switch (sub_cmd & 0xF0)
{ {
case 0x30: case 0x30:
VertexShaderManager::SetTexMatrixChangedA(value); VertexShaderManager::SetTexMatrixChangedA(value);
break; break;
case 0x40: case 0x40:
VertexShaderManager::SetTexMatrixChangedB(value); VertexShaderManager::SetTexMatrixChangedB(value);
break; break;
case 0x50: case 0x50:
g_VtxDesc.Hex &= ~0x1FFFF; // keep the Upper bits g_VtxDesc.Hex &= ~0x1FFFF; // keep the Upper bits
g_VtxDesc.Hex |= value; g_VtxDesc.Hex |= value;
s_attr_dirty = 0xFF; s_attr_dirty = 0xFF;
break; break;
case 0x60: case 0x60:
g_VtxDesc.Hex &= 0x1FFFF; // keep the lower 17Bits g_VtxDesc.Hex &= 0x1FFFF; // keep the lower 17Bits
g_VtxDesc.Hex |= (u64)value << 17; g_VtxDesc.Hex |= (u64)value << 17;
s_attr_dirty = 0xFF; s_attr_dirty = 0xFF;
break; break;
case 0x70: case 0x70:
_assert_((sub_cmd & 0x0F) < 8); _assert_((sub_cmd & 0x0F) < 8);
g_VtxAttr[sub_cmd & 7].g0.Hex = value; g_VtxAttr[sub_cmd & 7].g0.Hex = value;
s_attr_dirty |= 1 << (sub_cmd & 7); s_attr_dirty |= 1 << (sub_cmd & 7);
break; break;
case 0x80: case 0x80:
_assert_((sub_cmd & 0x0F) < 8); _assert_((sub_cmd & 0x0F) < 8);
g_VtxAttr[sub_cmd & 7].g1.Hex = value; g_VtxAttr[sub_cmd & 7].g1.Hex = value;
s_attr_dirty |= 1 << (sub_cmd & 7); s_attr_dirty |= 1 << (sub_cmd & 7);
break; break;
case 0x90: case 0x90:
_assert_((sub_cmd & 0x0F) < 8); _assert_((sub_cmd & 0x0F) < 8);
g_VtxAttr[sub_cmd & 7].g2.Hex = value; g_VtxAttr[sub_cmd & 7].g2.Hex = value;
s_attr_dirty |= 1 << (sub_cmd & 7); s_attr_dirty |= 1 << (sub_cmd & 7);
break; break;
// Pointers to vertex arrays in GC RAM // Pointers to vertex arrays in GC RAM
case 0xA0: case 0xA0:
arraybases[sub_cmd & 0xF] = value; arraybases[sub_cmd & 0xF] = value;
cached_arraybases[sub_cmd & 0xF] = Memory_GetPtr(value); cached_arraybases[sub_cmd & 0xF] = Memory_GetPtr(value);
break; break;
case 0xB0: case 0xB0:
arraystrides[sub_cmd & 0xF] = value & 0xFF; arraystrides[sub_cmd & 0xF] = value & 0xFF;
break; break;
} }
} }
void RecomputeCachedArraybases() void RecomputeCachedArraybases()
{ {
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
{ {
cached_arraybases[i] = Memory_GetPtr(arraybases[i]); cached_arraybases[i] = Memory_GetPtr(arraybases[i]);
} }
} }

View File

@ -1,62 +1,62 @@
// 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 "VideoCommon.h" #include "VideoCommon.h"
#include <stdio.h> #include <stdio.h>
#include <malloc.h> #include <malloc.h>
static FILE* pfLog = NULL; static FILE* pfLog = NULL;
void __Log(const char *fmt, ...) void __Log(const char *fmt, ...)
{ {
char* Msg = (char*)alloca(strlen(fmt)+512); char* Msg = (char*)alloca(strlen(fmt)+512);
va_list ap; va_list ap;
va_start( ap, fmt ); va_start( ap, fmt );
vsnprintf( Msg, strlen(fmt)+512, fmt, ap ); vsnprintf( Msg, strlen(fmt)+512, fmt, ap );
va_end( ap ); va_end( ap );
g_VideoInitialize.pLog(Msg, FALSE); g_VideoInitialize.pLog(Msg, FALSE);
if (pfLog == NULL) if (pfLog == NULL)
pfLog = fopen(FULL_LOGS_DIR "oglgfx.txt", "w"); pfLog = fopen(FULL_LOGS_DIR "oglgfx.txt", "w");
if (pfLog != NULL) if (pfLog != NULL)
fwrite(Msg, strlen(Msg), 1, pfLog); fwrite(Msg, strlen(Msg), 1, pfLog);
#ifdef _WIN32 #ifdef _WIN32
// DWORD tmp; // DWORD tmp;
// WriteConsole(hConsole, Msg, (DWORD)strlen(Msg), &tmp, 0); // WriteConsole(hConsole, Msg, (DWORD)strlen(Msg), &tmp, 0);
#else #else
//printf("%s", Msg); //printf("%s", Msg);
#endif #endif
} }
void __Log(int type, const char *fmt, ...) void __Log(int type, const char *fmt, ...)
{ {
char* Msg = (char*)alloca(strlen(fmt)+512); char* Msg = (char*)alloca(strlen(fmt)+512);
va_list ap; va_list ap;
va_start( ap, fmt ); va_start( ap, fmt );
vsnprintf( Msg, strlen(fmt)+512, fmt, ap ); vsnprintf( Msg, strlen(fmt)+512, fmt, ap );
va_end( ap ); va_end( ap );
g_VideoInitialize.pLog(Msg, FALSE); g_VideoInitialize.pLog(Msg, FALSE);
#ifdef _WIN32 #ifdef _WIN32
// DWORD tmp; // DWORD tmp;
// WriteConsole(hConsole, Msg, (DWORD)strlen(Msg), &tmp, 0); // WriteConsole(hConsole, Msg, (DWORD)strlen(Msg), &tmp, 0);
#endif #endif
} }

View File

@ -1,235 +1,235 @@
// 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 "Common.h" #include "Common.h"
#include "VideoCommon.h" #include "VideoCommon.h"
#include "XFMemory.h" #include "XFMemory.h"
#include "CPMemory.h" #include "CPMemory.h"
#include "NativeVertexWriter.h" #include "NativeVertexWriter.h"
#include "VertexShaderManager.h" #include "VertexShaderManager.h"
#include "PixelShaderManager.h" #include "PixelShaderManager.h"
// LoadXFReg 0x10 // LoadXFReg 0x10
void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData) void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
{ {
u32 address = baseAddress; u32 address = baseAddress;
for (int i = 0; i < (int)transferSize; i++) for (int i = 0; i < (int)transferSize; i++)
{ {
address = baseAddress + i; address = baseAddress + i;
// Setup a Matrix // Setup a Matrix
if (address < 0x1000) if (address < 0x1000)
{ {
VertexManager::Flush(); VertexManager::Flush();
VertexShaderManager::InvalidateXFRange(address, address + transferSize); VertexShaderManager::InvalidateXFRange(address, address + transferSize);
//PRIM_LOG("xfmem write: 0x%x-0x%x\n", address, address+transferSize); //PRIM_LOG("xfmem write: 0x%x-0x%x\n", address, address+transferSize);
u32* p1 = &xfmem[address]; u32* p1 = &xfmem[address];
memcpy_gc(p1, &pData[i], transferSize*4); memcpy_gc(p1, &pData[i], transferSize*4);
i += transferSize; i += transferSize;
} }
else if (address < 0x2000) else if (address < 0x2000)
{ {
u32 data = pData[i]; u32 data = pData[i];
switch (address) switch (address)
{ {
case 0x1000: // error case 0x1000: // error
break; break;
case 0x1001: // diagnostics case 0x1001: // diagnostics
break; break;
case 0x1002: // internal state 0 case 0x1002: // internal state 0
break; break;
case 0x1003: // internal state 1 case 0x1003: // internal state 1
break; break;
case 0x1004: // xf_clock case 0x1004: // xf_clock
break; break;
case 0x1005: // clipdisable case 0x1005: // clipdisable
if (data & 1) { // disable clipping detection if (data & 1) { // disable clipping detection
} }
if (data & 2) { // disable trivial rejection if (data & 2) { // disable trivial rejection
} }
if (data & 4) { // disable cpoly clipping acceleration if (data & 4) { // disable cpoly clipping acceleration
} }
break; break;
case 0x1006: //SetGPMetric case 0x1006: //SetGPMetric
break; break;
case 0x1008: //__GXXfVtxSpecs, wrote 0004 case 0x1008: //__GXXfVtxSpecs, wrote 0004
xfregs.hostinfo = *(INVTXSPEC*)&data; xfregs.hostinfo = *(INVTXSPEC*)&data;
break; break;
case 0x1009: //GXSetNumChans (no) case 0x1009: //GXSetNumChans (no)
if ((u32)xfregs.nNumChans != (data & 3)) { if ((u32)xfregs.nNumChans != (data & 3)) {
VertexManager::Flush(); VertexManager::Flush();
xfregs.nNumChans = data & 3; xfregs.nNumChans = data & 3;
} }
break; break;
case 0x100a: //GXSetChanAmbientcolor case 0x100a: //GXSetChanAmbientcolor
if (xfregs.colChans[0].ambColor != data) { if (xfregs.colChans[0].ambColor != data) {
VertexManager::Flush(); VertexManager::Flush();
xfregs.colChans[0].ambColor = data; xfregs.colChans[0].ambColor = data;
VertexShaderManager::SetMaterialColor(0, data); VertexShaderManager::SetMaterialColor(0, data);
} }
break; break;
case 0x100b: //GXSetChanAmbientcolor case 0x100b: //GXSetChanAmbientcolor
if (xfregs.colChans[1].ambColor != data) { if (xfregs.colChans[1].ambColor != data) {
VertexManager::Flush(); VertexManager::Flush();
xfregs.colChans[1].ambColor = data; xfregs.colChans[1].ambColor = data;
VertexShaderManager::SetMaterialColor(1, data); VertexShaderManager::SetMaterialColor(1, data);
} }
break; break;
case 0x100c: //GXSetChanMatcolor (rgba) case 0x100c: //GXSetChanMatcolor (rgba)
if (xfregs.colChans[0].matColor != data) { if (xfregs.colChans[0].matColor != data) {
VertexManager::Flush(); VertexManager::Flush();
xfregs.colChans[0].matColor = data; xfregs.colChans[0].matColor = data;
VertexShaderManager::SetMaterialColor(2, data); VertexShaderManager::SetMaterialColor(2, data);
} }
break; break;
case 0x100d: //GXSetChanMatcolor (rgba) case 0x100d: //GXSetChanMatcolor (rgba)
if (xfregs.colChans[1].matColor != data) { if (xfregs.colChans[1].matColor != data) {
VertexManager::Flush(); VertexManager::Flush();
xfregs.colChans[1].matColor = data; xfregs.colChans[1].matColor = data;
VertexShaderManager::SetMaterialColor(3, data); VertexShaderManager::SetMaterialColor(3, data);
} }
break; break;
case 0x100e: // color0 case 0x100e: // color0
if (xfregs.colChans[0].color.hex != (data & 0x7fff) ) { if (xfregs.colChans[0].color.hex != (data & 0x7fff) ) {
VertexManager::Flush(); VertexManager::Flush();
xfregs.colChans[0].color.hex = data; xfregs.colChans[0].color.hex = data;
} }
break; break;
case 0x100f: // color1 case 0x100f: // color1
if (xfregs.colChans[1].color.hex != (data & 0x7fff) ) { if (xfregs.colChans[1].color.hex != (data & 0x7fff) ) {
VertexManager::Flush(); VertexManager::Flush();
xfregs.colChans[1].color.hex = data; xfregs.colChans[1].color.hex = data;
} }
break; break;
case 0x1010: // alpha0 case 0x1010: // alpha0
if (xfregs.colChans[0].alpha.hex != (data & 0x7fff) ) { if (xfregs.colChans[0].alpha.hex != (data & 0x7fff) ) {
VertexManager::Flush(); VertexManager::Flush();
xfregs.colChans[0].alpha.hex = data; xfregs.colChans[0].alpha.hex = data;
} }
break; break;
case 0x1011: // alpha1 case 0x1011: // alpha1
if (xfregs.colChans[1].alpha.hex != (data & 0x7fff) ) { if (xfregs.colChans[1].alpha.hex != (data & 0x7fff) ) {
VertexManager::Flush(); VertexManager::Flush();
xfregs.colChans[1].alpha.hex = data; xfregs.colChans[1].alpha.hex = data;
} }
break; break;
case 0x1012: // dual tex transform case 0x1012: // dual tex transform
if (xfregs.bEnableDualTexTransform != (data & 1)) { if (xfregs.bEnableDualTexTransform != (data & 1)) {
VertexManager::Flush(); VertexManager::Flush();
xfregs.bEnableDualTexTransform = data & 1; xfregs.bEnableDualTexTransform = data & 1;
} }
break; break;
case 0x1013: case 0x1013:
case 0x1014: case 0x1014:
case 0x1015: case 0x1015:
case 0x1016: case 0x1016:
case 0x1017: case 0x1017:
DEBUG_LOG(VIDEO, "xf addr: %x=%x\n", address, data); DEBUG_LOG(VIDEO, "xf addr: %x=%x\n", address, data);
break; break;
case 0x1018: case 0x1018:
//_assert_msg_(GX_XF, 0, "XF matrixindex0"); //_assert_msg_(GX_XF, 0, "XF matrixindex0");
VertexShaderManager::SetTexMatrixChangedA(data); //? VertexShaderManager::SetTexMatrixChangedA(data); //?
break; break;
case 0x1019: case 0x1019:
//_assert_msg_(GX_XF, 0, "XF matrixindex1"); //_assert_msg_(GX_XF, 0, "XF matrixindex1");
VertexShaderManager::SetTexMatrixChangedB(data); //? VertexShaderManager::SetTexMatrixChangedB(data); //?
break; break;
case 0x101a: case 0x101a:
VertexManager::Flush(); VertexManager::Flush();
VertexShaderManager::SetViewport((float*)&pData[i]); VertexShaderManager::SetViewport((float*)&pData[i]);
PixelShaderManager::SetViewport((float*)&pData[i]); PixelShaderManager::SetViewport((float*)&pData[i]);
i += 6; i += 6;
break; break;
case 0x101c: // paper mario writes 16777216.0f, 1677721.75 case 0x101c: // paper mario writes 16777216.0f, 1677721.75
break; break;
case 0x101f: // paper mario writes 16777216.0f, 5033165.0f case 0x101f: // paper mario writes 16777216.0f, 5033165.0f
break; break;
case 0x1020: case 0x1020:
VertexManager::Flush(); VertexManager::Flush();
VertexShaderManager::SetProjection((float*)&pData[i]); VertexShaderManager::SetProjection((float*)&pData[i]);
i += 7; i += 7;
return; return;
case 0x103f: // GXSetNumTexGens case 0x103f: // GXSetNumTexGens
if ((u32)xfregs.numTexGens != data) { if ((u32)xfregs.numTexGens != data) {
VertexManager::Flush(); VertexManager::Flush();
xfregs.numTexGens = data; xfregs.numTexGens = data;
} }
break; break;
case 0x1040: xfregs.texcoords[0].texmtxinfo.hex = data; break; case 0x1040: xfregs.texcoords[0].texmtxinfo.hex = data; break;
case 0x1041: xfregs.texcoords[1].texmtxinfo.hex = data; break; case 0x1041: xfregs.texcoords[1].texmtxinfo.hex = data; break;
case 0x1042: xfregs.texcoords[2].texmtxinfo.hex = data; break; case 0x1042: xfregs.texcoords[2].texmtxinfo.hex = data; break;
case 0x1043: xfregs.texcoords[3].texmtxinfo.hex = data; break; case 0x1043: xfregs.texcoords[3].texmtxinfo.hex = data; break;
case 0x1044: xfregs.texcoords[4].texmtxinfo.hex = data; break; case 0x1044: xfregs.texcoords[4].texmtxinfo.hex = data; break;
case 0x1045: xfregs.texcoords[5].texmtxinfo.hex = data; break; case 0x1045: xfregs.texcoords[5].texmtxinfo.hex = data; break;
case 0x1046: xfregs.texcoords[6].texmtxinfo.hex = data; break; case 0x1046: xfregs.texcoords[6].texmtxinfo.hex = data; break;
case 0x1047: xfregs.texcoords[7].texmtxinfo.hex = data; break; case 0x1047: xfregs.texcoords[7].texmtxinfo.hex = data; break;
case 0x1048: case 0x1048:
case 0x1049: case 0x1049:
case 0x104a: case 0x104a:
case 0x104b: case 0x104b:
case 0x104c: case 0x104c:
case 0x104d: case 0x104d:
case 0x104e: case 0x104e:
case 0x104f: case 0x104f:
DEBUG_LOG(VIDEO, "xf addr: %x=%x\n", address, data); DEBUG_LOG(VIDEO, "xf addr: %x=%x\n", address, data);
break; break;
case 0x1050: xfregs.texcoords[0].postmtxinfo.hex = data; break; case 0x1050: xfregs.texcoords[0].postmtxinfo.hex = data; break;
case 0x1051: xfregs.texcoords[1].postmtxinfo.hex = data; break; case 0x1051: xfregs.texcoords[1].postmtxinfo.hex = data; break;
case 0x1052: xfregs.texcoords[2].postmtxinfo.hex = data; break; case 0x1052: xfregs.texcoords[2].postmtxinfo.hex = data; break;
case 0x1053: xfregs.texcoords[3].postmtxinfo.hex = data; break; case 0x1053: xfregs.texcoords[3].postmtxinfo.hex = data; break;
case 0x1054: xfregs.texcoords[4].postmtxinfo.hex = data; break; case 0x1054: xfregs.texcoords[4].postmtxinfo.hex = data; break;
case 0x1055: xfregs.texcoords[5].postmtxinfo.hex = data; break; case 0x1055: xfregs.texcoords[5].postmtxinfo.hex = data; break;
case 0x1056: xfregs.texcoords[6].postmtxinfo.hex = data; break; case 0x1056: xfregs.texcoords[6].postmtxinfo.hex = data; break;
case 0x1057: xfregs.texcoords[7].postmtxinfo.hex = data; break; case 0x1057: xfregs.texcoords[7].postmtxinfo.hex = data; break;
default: default:
DEBUG_LOG(VIDEO, "xf addr: %x=%x\n", address, data); DEBUG_LOG(VIDEO, "xf addr: %x=%x\n", address, data);
break; break;
} }
} }
else if (address >= 0x4000) else if (address >= 0x4000)
{ {
// MessageBox(NULL, "1", "1", MB_OK); // MessageBox(NULL, "1", "1", MB_OK);
//4010 __GXSetGenMode //4010 __GXSetGenMode
} }
} }
} }
// TODO - verify that it is correct. Seems to work, though. // TODO - verify that it is correct. Seems to work, though.
void LoadIndexedXF(u32 val, int array) void LoadIndexedXF(u32 val, int array)
{ {
int index = val >> 16; int index = val >> 16;
int address = val & 0xFFF; //check mask int address = val & 0xFFF; //check mask
int size = ((val >> 12) & 0xF) + 1; int size = ((val >> 12) & 0xF) + 1;
//load stuff from array to address in xf mem //load stuff from array to address in xf mem
VertexManager::Flush(); VertexManager::Flush();
VertexShaderManager::InvalidateXFRange(address, address+size); VertexShaderManager::InvalidateXFRange(address, address+size);
//PRIM_LOG("xfmem iwrite: 0x%x-0x%x\n", address, address+size); //PRIM_LOG("xfmem iwrite: 0x%x-0x%x\n", address, address+size);
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++)
xfmem[address + i] = Memory_Read_U32(arraybases[array] + arraystrides[array]*index + i*4); xfmem[address + i] = Memory_Read_U32(arraybases[array] + arraystrides[array]*index + i*4);
} }

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,103 +1,103 @@
#include <gccore.h> #include <gccore.h>
#include <malloc.h> #include <malloc.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <ogcsys.h> #include <ogcsys.h>
#include <unistd.h> #include <unistd.h>
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
#include <debug.h> #include <debug.h>
#include <math.h> #include <math.h>
static void *xfb = NULL; static void *xfb = NULL;
u32 first_frame = 1; u32 first_frame = 1;
GXRModeObj *rmode; GXRModeObj *rmode;
void Initialise(); void Initialise();
int main() int main()
{ {
Initialise(); Initialise();
while(1) while(1)
{ {
s32 Size; s32 Size;
s32 SSize; s32 SSize;
u32 ID; u32 ID;
s32 getIDerr; s32 getIDerr;
s32 CARDerr; s32 CARDerr;
s32 EXIerr; s32 EXIerr;
VIDEO_ClearFrameBuffer(rmode, xfb, 0); VIDEO_ClearFrameBuffer(rmode, xfb, 0);
// Can't use printf since Dolphin overrides it // Can't use printf since Dolphin overrides it
std::cout<<"\x1b[0;0H"; // Position the cursor (at 0, 0) std::cout<<"\x1b[0;0H"; // Position the cursor (at 0, 0)
for (int channel = 0; channel < EXI_CHANNEL_MAX; ++channel) for (int channel = 0; channel < EXI_CHANNEL_MAX; ++channel)
for (int device = 0; device < EXI_DEVICE_MAX; ++device) for (int device = 0; device < EXI_DEVICE_MAX; ++device)
{ {
if (getIDerr = EXI_GetID(channel, device, &ID) == 1) if (getIDerr = EXI_GetID(channel, device, &ID) == 1)
{ {
std::cout<<"Channel "<<channel<<" Device "<<device<<"\tID = 0x"<<std::setbase(16)<<ID<<std::endl; std::cout<<"Channel "<<channel<<" Device "<<device<<"\tID = 0x"<<std::setbase(16)<<ID<<std::endl;
if ((channel == 0 && device == 0)||(channel == 1 && device == 0)) if ((channel == 0 && device == 0)||(channel == 1 && device == 0))
{ {
// It's a memcard slot // It's a memcard slot
if (CARDerr = CARD_ProbeEx(channel, &Size, &SSize) >= 0) if (CARDerr = CARD_ProbeEx(channel, &Size, &SSize) >= 0)
{ {
std::cout<<"\tMemcard has a size of "<<std::setbase(10)<<Size<<" and a Sector Size of "<<std::setbase(10)<<SSize<<std::endl; std::cout<<"\tMemcard has a size of "<<std::setbase(10)<<Size<<" and a Sector Size of "<<std::setbase(10)<<SSize<<std::endl;
} }
else if (CARDerr == -2) else if (CARDerr == -2)
std::cout<<"\tNot a Memcard!"<<std::endl; std::cout<<"\tNot a Memcard!"<<std::endl;
else else
std::cout<<"\tCARD Error "<<CARDerr<<std::endl; std::cout<<"\tCARD Error "<<CARDerr<<std::endl;
} }
else else
{ {
// It's not a memcard, what to do? - Just probe for now // It's not a memcard, what to do? - Just probe for now
if (EXIerr = EXI_ProbeEx(channel)){} if (EXIerr = EXI_ProbeEx(channel)){}
else else
std::cout<<"\tEXI Error "<<EXIerr<<std::endl; std::cout<<"\tEXI Error "<<EXIerr<<std::endl;
} }
} }
else else
std::cout<<"Channel "<<channel<<" Device "<<device<<std::endl<<"\tEXI_GetID Error "<<getIDerr<<std::endl; std::cout<<"Channel "<<channel<<" Device "<<device<<std::endl<<"\tEXI_GetID Error "<<getIDerr<<std::endl;
} }
VIDEO_WaitVSync(); VIDEO_WaitVSync();
} }
return 0; return 0;
} }
void Initialise() void Initialise()
{ {
// Initialise the video system // Initialise the video system
VIDEO_Init(); VIDEO_Init();
// This function initialises the attached controllers // This function initialises the attached controllers
PAD_Init(); PAD_Init();
// Obtain the preferred video mode from the system // Obtain the preferred video mode from the system
// This will correspond to the settings in the Wii menu // This will correspond to the settings in the Wii menu
rmode = VIDEO_GetPreferredMode(NULL); rmode = VIDEO_GetPreferredMode(NULL);
// Allocate memory for the display in the uncached region // Allocate memory for the display in the uncached region
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode)); xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
// Initialise the console, required for printf // Initialise the console, required for printf
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ); console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
// Set up the video registers with the chosen mode // Set up the video registers with the chosen mode
VIDEO_Configure(rmode); VIDEO_Configure(rmode);
// Tell the video hardware where our display memory is // Tell the video hardware where our display memory is
VIDEO_SetNextFramebuffer(xfb); VIDEO_SetNextFramebuffer(xfb);
// Make the display visible // Make the display visible
VIDEO_SetBlack(FALSE); VIDEO_SetBlack(FALSE);
// Flush the video register changes to the hardware // Flush the video register changes to the hardware
VIDEO_Flush(); VIDEO_Flush();
// Wait for Video setup to complete // Wait for Video setup to complete
VIDEO_WaitVSync(); VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync(); if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
} }