└── pcsxr ├── NEWS ├── ChangeLog ├── pixmaps ├── cd.png ├── cdr.png ├── gpu.png ├── pad.png ├── spu.png ├── pcsxr.png ├── play.png ├── sio1.png ├── iso-open.png ├── memcard.png ├── iso-reopen.png ├── pcsxr-icon.png └── Makefile.am ├── win32 ├── gui │ ├── about.bmp │ ├── pcsxr.bmp │ ├── pcsxr.ico │ ├── AboutDlg.h │ ├── plugin.h │ ├── AboutDlg.c │ └── Win32.h ├── zlib │ ├── inffast.h │ ├── gzclose.c │ ├── uncompr.c │ ├── compress.c │ ├── inftrees.h │ ├── adler32.c │ └── inffixed.h ├── glue │ ├── sys │ │ └── mman.h │ └── stdint.h ├── config.h ├── psxida │ ├── ida_debug.h │ ├── ida_registers.h │ └── ida_plugin.cpp ├── psxida.sln ├── psxida.vcxproj.user └── intl │ ├── intl-compat.c │ ├── dgettext.c │ ├── hash-string.h │ ├── gettextP.h │ ├── gettext.c │ ├── loadinfo.h │ ├── gettext.h │ ├── textdomain.c │ ├── libintl.h │ ├── explodename.c │ ├── libgettext.h │ └── finddomain.c ├── po ├── LINGUAS ├── Makevars └── POTFILES.in ├── .gitignore ├── libpcsxcore ├── gpu.h ├── ix86_64 │ ├── README │ ├── iGte.h │ ├── ix86_3dnow.c │ └── ix86_fpu.c ├── ppc │ ├── ppc.c │ ├── ppc.h │ ├── pGte.h │ ├── reguse.h │ └── pasm.s ├── socket.h ├── ppf.h ├── spu.c ├── psxhle.h ├── Makefile.am ├── mdec.h ├── decode_xa.h ├── cdriso.h ├── spu.h ├── psxbios.h ├── psxcounters.h ├── gte.h ├── system.h ├── ix86 │ └── iGte.h ├── psxcommon.c ├── sio.h ├── debug.h ├── misc.h ├── coff.h ├── psxhw.h ├── psxhle.c ├── psxdma.h ├── cheat.h ├── cdrom.h ├── psxdma.c ├── gpu.c ├── psxcommon.h ├── psxmem.h └── socket.c ├── gui ├── AboutDlg.h ├── MemcardDlg.h ├── DebugMemory.h ├── Cheat.h ├── ConfDlg.h ├── Linux.h └── AboutDlg.c ├── README └── AUTHORS /pcsxr/NEWS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pcsxr/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/ChangeLog -------------------------------------------------------------------------------- /pcsxr/pixmaps/cd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/cd.png -------------------------------------------------------------------------------- /pcsxr/pixmaps/cdr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/cdr.png -------------------------------------------------------------------------------- /pcsxr/pixmaps/gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/gpu.png -------------------------------------------------------------------------------- /pcsxr/pixmaps/pad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/pad.png -------------------------------------------------------------------------------- /pcsxr/pixmaps/spu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/spu.png -------------------------------------------------------------------------------- /pcsxr/pixmaps/pcsxr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/pcsxr.png -------------------------------------------------------------------------------- /pcsxr/pixmaps/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/play.png -------------------------------------------------------------------------------- /pcsxr/pixmaps/sio1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/sio1.png -------------------------------------------------------------------------------- /pcsxr/pixmaps/iso-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/iso-open.png -------------------------------------------------------------------------------- /pcsxr/pixmaps/memcard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/memcard.png -------------------------------------------------------------------------------- /pcsxr/win32/gui/about.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/win32/gui/about.bmp -------------------------------------------------------------------------------- /pcsxr/win32/gui/pcsxr.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/win32/gui/pcsxr.bmp -------------------------------------------------------------------------------- /pcsxr/win32/gui/pcsxr.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/win32/gui/pcsxr.ico -------------------------------------------------------------------------------- /pcsxr/pixmaps/iso-reopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/iso-reopen.png -------------------------------------------------------------------------------- /pcsxr/pixmaps/pcsxr-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lab313ru/psxida/HEAD/pcsxr/pixmaps/pcsxr-icon.png -------------------------------------------------------------------------------- /pcsxr/po/LINGUAS: -------------------------------------------------------------------------------- 1 | zh_CN 2 | zh_TW 3 | pt_BR 4 | ru_RU 5 | it 6 | fr_FR 7 | hu_HU 8 | ko_KR 9 | es 10 | -------------------------------------------------------------------------------- /pcsxr/.gitignore: -------------------------------------------------------------------------------- 1 | /win32/Debug/ 2 | /win32/Release/ 3 | /win32/Debug_x64/ 4 | /win32/Release_x64/ 5 | *.opendb 6 | *.opensdf 7 | *.suo 8 | *.sdf 9 | *.aps -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/gpu.h: -------------------------------------------------------------------------------- 1 | #ifndef __GPU_H__ 2 | #define __GPU_H__ 3 | 4 | int gpuReadStatus(); 5 | 6 | void psxDma2(u32 madr, u32 bcr, u32 chcr); 7 | void gpuInterrupt(); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/ix86_64/README: -------------------------------------------------------------------------------- 1 | This is the AMD64 dynamic recompiler. 2 | Made from opcodes from PCSX2 0.9.3 and the x86 recompiler modified to fit. ie. currently no AMD64/SSE specific code advantages. 3 | -------------------------------------------------------------------------------- /pcsxr/pixmaps/Makefile.am: -------------------------------------------------------------------------------- 1 | pixmapdir = "$(datadir)/pcsxr" 2 | pixmap_DATA = pcsxr.png iso-open.png iso-reopen.png cd.png cdr.png gpu.png memcard.png pad.png play.png sio1.png spu.png 3 | 4 | icondir = "$(datadir)/pixmaps" 5 | icon_DATA = pcsxr-icon.png 6 | 7 | EXTRA_DIST = pcsxr.png iso-open.png iso-reopen.png cd.png cdr.png gpu.png memcard.png pad.png play.png sio1.png spu.png pcsxr-icon.png 8 | -------------------------------------------------------------------------------- /pcsxr/win32/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /pcsxr/win32/glue/sys/mman.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2008, Wei Mingzhi. All rights reserved. 3 | // 4 | // Use, redistribution and modification of this code is unrestricted 5 | // as long as this notice is preserved. 6 | // 7 | // This code is provided with ABSOLUTELY NO WARRANTY. 8 | // 9 | 10 | #ifndef MMAN_H 11 | #define MMAN_H 12 | 13 | #include 14 | 15 | #define mmap(start, length, prot, flags, fd, offset) \ 16 | ((unsigned char *)VirtualAlloc(NULL, (length), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE)) 17 | 18 | #define munmap(start, length) do { VirtualFree((start), (length), MEM_RELEASE); } while (0) 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /pcsxr/win32/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /pcsxr/win32/config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2008, Wei Mingzhi. All rights reserved. 3 | // 4 | // Use, redistribution and modification of this code is unrestricted as long as this 5 | // notice is preserved. 6 | // 7 | 8 | #ifndef CONFIG_H 9 | #define CONFIG_H 10 | 11 | #ifndef __i386__ 12 | #define __i386__ 1 13 | #endif 14 | 15 | #include 16 | 17 | #ifndef MAXPATHLEN 18 | #define MAXPATHLEN 256 19 | #endif 20 | 21 | #ifndef PACKAGE_VERSION 22 | #define PACKAGE_VERSION "1.9" 23 | #endif 24 | 25 | #ifndef PREFIX 26 | #define PREFIX "./" 27 | #endif 28 | 29 | #ifdef _MSC_VER 30 | #pragma warning (disable:4133) 31 | #pragma warning (disable:4142) 32 | #pragma warning (disable:4244) 33 | #pragma warning (disable:4996) 34 | #pragma warning (disable:4018) 35 | #pragma warning (disable:4761) 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/ppc/ppc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ix86 core v0.5.1 3 | * Authors: linuzappz 4 | * alexey silinov 5 | */ 6 | 7 | #if defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__) || defined (__powerpc64__) || defined (__POWERPC__) 8 | 9 | #include 10 | #include 11 | 12 | #include "ppc.h" 13 | 14 | // General Purpose hardware registers 15 | int cpuHWRegisters[NUM_HW_REGISTERS] = { 16 | 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 17 | 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 18 | }; 19 | 20 | u32 *ppcPtr; 21 | 22 | void ppcInit() { 23 | } 24 | void ppcSetPtr(u32 *ptr) { 25 | ppcPtr = ptr; 26 | } 27 | void ppcAlign(int bytes) { 28 | // forward align 29 | ppcPtr = (u32*)(((u32)ppcPtr + bytes) & ~(bytes - 1)); 30 | } 31 | 32 | void ppcShutdown() { 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /pcsxr/win32/psxida/ida_debug.h: -------------------------------------------------------------------------------- 1 | #ifndef _IDA_DEBUG_H_ 2 | #define _IDA_DEBUG_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #define trim trim_ 11 | 12 | // Very simple class to store pending events 13 | enum queue_pos_t 14 | { 15 | IN_FRONT, 16 | IN_BACK 17 | }; 18 | 19 | struct eventlist_t : public std::deque 20 | { 21 | private: 22 | bool synced; 23 | public: 24 | // save a pending event 25 | void enqueue(const debug_event_t &ev, queue_pos_t pos) 26 | { 27 | if (pos != IN_BACK) 28 | push_front(ev); 29 | else 30 | push_back(ev); 31 | } 32 | 33 | // retrieve a pending event 34 | bool retrieve(debug_event_t *event) 35 | { 36 | if (empty()) 37 | return false; 38 | // get the first event and return it 39 | *event = front(); 40 | pop_front(); 41 | return true; 42 | } 43 | }; 44 | 45 | #endif -------------------------------------------------------------------------------- /pcsxr/gui/AboutDlg.h: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2002 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef ABOUTDLG_H 20 | #define ABOUTDLG_H 21 | 22 | void RunAboutDialog(void); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /pcsxr/gui/MemcardDlg.h: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2002 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef MEMCARDDLG_H 20 | #define MEMCARDDLG_H 21 | 22 | void OnConf_Mcds(); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /pcsxr/win32/psxida.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "psxida", "psxida.vcxproj", "{9EEA62F5-46DC-4C07-AFE1-F72F9D6B9E3E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9EEA62F5-46DC-4C07-AFE1-F72F9D6B9E3E}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {9EEA62F5-46DC-4C07-AFE1-F72F9D6B9E3E}.Debug|Win32.Build.0 = Debug|Win32 16 | {9EEA62F5-46DC-4C07-AFE1-F72F9D6B9E3E}.Release|Win32.ActiveCfg = Release|Win32 17 | {9EEA62F5-46DC-4C07-AFE1-F72F9D6B9E3E}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /pcsxr/gui/DebugMemory.h: -------------------------------------------------------------------------------- 1 | /* Memory Viewer/Dumper for PCSX-Reloaded 2 | * Copyright (C) 2010, Wei Mingzhi . 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef DEBUGMEMORY_H 20 | #define DEBUGMEMORY_H 21 | 22 | void RunDebugMemoryDialog(); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /pcsxr/README: -------------------------------------------------------------------------------- 1 | PCSX-Reloaded 2 | ------------------------------- 3 | 4 | PCSX-Reloaded is a forked version of the dead PCSX emulator, with a nicer 5 | interface and several improvements to stability and functionality. 6 | 7 | PCSX-Reloaded uses the PSEMU plugin interface to provide most functionality; 8 | without them, you will not be able to use it to play games. PCSX-Reloaded 9 | provides a number of plugins to provide basic functionality out of the box. 10 | 11 | PCSX-Reloaded has a very capable Internal HLE BIOS that can run many games 12 | without problems. It is recommended that you use it. However, if you own a 13 | real PlayStation, you may be able to use your own BIOS image. PCSX-Reloaded 14 | will find it in ~/.pcsx/bios/ or /usr/share/psemu/bios/ if you place it there. 15 | This can improve compatibility, especially with certain games and with the 16 | use of memory cards. 17 | 18 | See the doc/ folder in the source, or /usr/share/doc/pcsx/ on Debian systems, 19 | for more detailed information on PCSX-Reloaded. A UNIX manpage is also 20 | available. 21 | -------------------------------------------------------------------------------- /pcsxr/win32/glue/stdint.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2008, Wei Mingzhi. All rights reserved. 3 | // 4 | // Use, redistribution and modification of this code is unrestricted 5 | // as long as this notice is preserved. 6 | // 7 | // This code is provided with ABSOLUTELY NO WARRANTY. 8 | // 9 | 10 | #ifndef __STDINT_H 11 | #define __STDINT_H 12 | 13 | #ifdef _MSC_VER 14 | 15 | typedef __int8 int8_t; 16 | typedef __int16 int16_t; 17 | typedef __int32 int32_t; 18 | typedef __int64 int64_t; 19 | 20 | typedef unsigned __int8 uint8_t; 21 | typedef unsigned __int16 uint16_t; 22 | typedef unsigned __int32 uint32_t; 23 | typedef unsigned __int64 uint64_t; 24 | 25 | #else 26 | 27 | typedef signed char int8_t; 28 | typedef signed short int16_t; 29 | typedef signed int int32_t; 30 | typedef signed __int64 int64_t; 31 | 32 | typedef unsigned char uint8_t; 33 | typedef unsigned short uint16_t; 34 | typedef unsigned int uint32_t; 35 | typedef unsigned __int64 uint64_t; 36 | 37 | #endif 38 | 39 | #define intptr_t int32_t 40 | #define uintptr_t uint32_t 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /pcsxr/win32/gui/AboutDlg.h: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2003 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef _PCSX_ABOUTDLG_H_ 20 | #define _PCSX_ABOUTDLG_H_ 21 | 22 | LRESULT WINAPI AboutDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /pcsxr/win32/gui/plugin.h: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2003 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | // Windows Specific Plugin Functions 20 | #ifndef __PLUGIN_H__ 21 | #define __PLUGIN_H__ 22 | 23 | #include "plugins.h" 24 | 25 | void GetStateFilename(char *out, int i); 26 | 27 | #endif /* __PLUGIN_H__ */ 28 | -------------------------------------------------------------------------------- /pcsxr/gui/Cheat.h: -------------------------------------------------------------------------------- 1 | /* Cheat Support for PCSX-Reloaded 2 | * Copyright (C) 2009, Wei Mingzhi . 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef GUI_CHEAT_H 20 | #define GUI_CHEAT_H 21 | 22 | void RunCheatListDialog(); 23 | void RunCheatSearchDialog(); 24 | 25 | // last chosen cheat filename is kept in here 26 | extern gchar *cheat_last_filename; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/socket.h: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2003 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, see . 16 | */ 17 | 18 | #ifndef __SOCKET_H__ 19 | #define __SOCKET_H__ 20 | 21 | int StartServer(); 22 | void StopServer(); 23 | 24 | void GetClient(); 25 | void CloseClient(); 26 | 27 | int HasClient(); 28 | 29 | int ReadSocket(char * buffer, int len); 30 | int RawReadSocket(char * buffer, int len); 31 | void WriteSocket(char * buffer, int len); 32 | 33 | void SetsBlock(); 34 | void SetsNonblock(); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/ppf.h: -------------------------------------------------------------------------------- 1 | /* PPF Patch Support for PCSX-Reloaded 2 | * Copyright (c) 2009, Wei Mingzhi . 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef __PPF_H__ 20 | #define __PPF_H__ 21 | 22 | void BuildPPFCache(); 23 | void FreePPFCache(); 24 | void CheckPPFCache(unsigned char *pB, unsigned char m, unsigned char s, unsigned char f); 25 | 26 | int LoadSBI(const char *filename); 27 | boolean CheckSBI(const u8 *time); 28 | void UnloadSBI(void); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /pcsxr/win32/psxida.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | d:\ida68\idaq.exe 5 | $(OutDir) 6 | WindowsLocalDebugger 7 | 8 | 9 | d:\ida68\idaq.exe 10 | $(OutDir) 11 | WindowsLocalDebugger 12 | 13 | 14 | d:\ida68\idaq.exe 15 | WindowsLocalDebugger 16 | $(OutDir) 17 | 18 | 19 | d:\ida68\idaq.exe 20 | WindowsLocalDebugger 21 | $(OutDir) 22 | 23 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/ppc/ppc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ppc definitions v0.5.1 3 | * Authors: linuzappz 4 | * alexey silinov 5 | */ 6 | 7 | #ifndef __PPC_H__ 8 | #define __PPC_H__ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | // include basic types 15 | #include "../psxcommon.h" 16 | #include "ppc_mnemonics.h" 17 | 18 | #define NUM_HW_REGISTERS 29 19 | 20 | /* general defines */ 21 | #define write8(val) *(u8 *)ppcPtr = val; ppcPtr++; 22 | #define write16(val) *(u16*)ppcPtr = val; ppcPtr+=2; 23 | #define write32(val) *(u32*)ppcPtr = val; ppcPtr+=4; 24 | #define write64(val) *(u64*)ppcPtr = val; ppcPtr+=8; 25 | 26 | #define CALLFunc(FUNC) \ 27 | { \ 28 | u32 _func = (FUNC); \ 29 | ReleaseArgs(); \ 30 | if ((_func & 0x1fffffc) == _func) { \ 31 | BLA(_func); \ 32 | } else { \ 33 | LIW(0, _func); \ 34 | MTCTR(0); \ 35 | BCTRL(); \ 36 | } \ 37 | } 38 | 39 | extern int cpuHWRegisters[NUM_HW_REGISTERS]; 40 | 41 | extern u32 *ppcPtr; 42 | extern u8 *j8Ptr[32]; 43 | extern u32 *j32Ptr[32]; 44 | 45 | void ppcInit(); 46 | void ppcSetPtr(u32 *ptr); 47 | void ppcShutdown(); 48 | 49 | void ppcAlign(int bytes); 50 | void returnPC(); 51 | void recRun(void (*func)(), u32 hw1, u32 hw2); 52 | u8 dynMemRead8(u32 mem); 53 | u16 dynMemRead16(u32 mem); 54 | u32 dynMemRead32(u32 mem); 55 | void dynMemWrite32(u32 mem, u32 val); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | #endif 61 | -------------------------------------------------------------------------------- /pcsxr/win32/psxida/ida_registers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum psx_registers 4 | { 5 | psx_r0, psx_at, psx_v0, psx_v1, psx_a0, psx_a1, psx_a2, psx_a3, 6 | psx_t0, psx_t1, psx_t2, psx_t3, psx_t4, psx_t5, psx_t6, psx_t7, 7 | psx_s0, psx_s1, psx_s2, psx_s3, psx_s4, psx_s5, psx_s6, psx_s7, 8 | psx_t8, psx_t9, psx_k0, psx_k1, psx_gp, psx_sp, psx_fp, psx_ra, psx_lo, psx_hi, 9 | 10 | psx_pc, 11 | 12 | psx_Index, psx_Random, psx_EntryLo0, psx_BPC, 13 | psx_Context, psx_BDA, psx_PIDMask, psx_DCIC, 14 | psx_BadVAddr, psx_BDAM, psx_EntryHi, psx_BPCM, 15 | psx_Status, psx_Cause, psx_EPC, psx_PRid, 16 | psx_Config, psx_LLAddr, psx_WatchLO, psx_WatchHI, 17 | psx_XContext, psx_Reserved1, psx_Reserved2, psx_Reserved3, 18 | psx_Reserved4, psx_Reserved5, psx_ECC, psx_CacheErr, 19 | psx_TagLo, psx_TagHi, psx_ErrorEPC, psx_Reserved6, 20 | 21 | psx_VXY0, psx_VZ0, psx_VXY1, psx_VZ1, psx_VXY2, psx_VZ2, psx_RGB, psx_OTZ, 22 | psx_IR0, psx_IR1, psx_IR2, psx_IR3, psx_SXY0, psx_SXY1, psx_SXY2, psx_SXYP, 23 | psx_SZ0, psx_SZ1, psx_SZ2, psx_SZ3, psx_RGB0, psx_RGB1, psx_RGB2, psx_RES1, 24 | psx_MAC0, psx_MAC1, psx_MAC2, psx_MAC3, psx_IRGB, psx_ORGB, psx_LZCS, psx_LZCR, 25 | 26 | psx_R11R12, psx_R13R21, psx_R22R23, psx_R31R32, psx_R33, psx_TRX, psx_TRY, psx_TRZ, 27 | psx_L11L12, psx_L13L21, psx_L22L23, psx_L31L32, psx_L33, psx_RBK, psx_BBK, psx_GBK, 28 | psx_LR1LR2, psx_LR3LG1, psx_LG2LG3, psx_LB1LB2, psx_LB3, psx_RFC, psx_GFC, psx_BFC, 29 | psx_OFX, psx_OFY, psx_H, psx_DQA, psx_DQB, psx_ZSF3, psx_ZSF4, psx_FLAG, 30 | }; -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/spu.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | /* 21 | * Sound (SPU) functions. 22 | */ 23 | 24 | #include "spu.h" 25 | 26 | void CALLBACK SPUirq(void) { 27 | psxHu32ref(0x1070) |= SWAPu32(0x200); 28 | } 29 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/psxhle.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __PSXHLE_H__ 21 | #define __PSXHLE_H__ 22 | 23 | #include "psxcommon.h" 24 | #include "r3000a.h" 25 | #include "plugins.h" 26 | 27 | extern void (*psxHLEt[256])(); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /pcsxr/gui/ConfDlg.h: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2002 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef CONFDLG_H 20 | #define CONFDLG_H 21 | 22 | // Helper Functions 23 | void UpdatePluginsBIOS(); 24 | 25 | // Functions Callbacks 26 | void OnConf_Graphics(); 27 | void OnConf_Sound(); 28 | void OnConf_CdRom(); 29 | void OnConf_Pad(); 30 | void OnConf_Cpu(); 31 | void OnConf_Net(); 32 | void OnConf_Sio1(); 33 | 34 | void ConfigurePlugins(); 35 | 36 | typedef struct { 37 | GtkWidget *Combo; 38 | GList *glist; 39 | char plist[255][255]; /* TODO Comment this out */ 40 | int plugins; /* TODO Comment this out and replace with glist count */ 41 | } PluginConf; 42 | 43 | extern PluginConf GpuConfS; 44 | extern PluginConf SpuConfS; 45 | extern PluginConf CdrConfS; 46 | extern PluginConf Pad1ConfS; 47 | extern PluginConf Pad2ConfS; 48 | extern PluginConf NetConfS; 49 | #ifdef ENABLE_SIO1API 50 | extern PluginConf Sio1ConfS; 51 | #endif 52 | extern PluginConf BiosConfS; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -DLOCALE_DIR=\"${datadir}/locale/\" \ 2 | -I$(top_srcdir)/include 3 | 4 | noinst_LIBRARIES = libpcsxcore.a 5 | 6 | libpcsxcore_a_SOURCES = \ 7 | psxbios.c \ 8 | cdrom.c \ 9 | psxcounters.c \ 10 | psxdma.c \ 11 | disr3000a.c \ 12 | gpu.c \ 13 | gpu.h \ 14 | spu.c \ 15 | sio.c \ 16 | psxhw.c \ 17 | mdec.c \ 18 | psxmem.c \ 19 | misc.c \ 20 | plugins.c \ 21 | decode_xa.c \ 22 | r3000a.c \ 23 | psxinterpreter.c \ 24 | gte.c \ 25 | psxhle.c \ 26 | cdrom.h \ 27 | coff.h \ 28 | debug.c \ 29 | debug.h \ 30 | decode_xa.h \ 31 | ecm.h \ 32 | gte.h \ 33 | mdec.h \ 34 | misc.h \ 35 | plugins.h \ 36 | psemu_plugin_defs.h \ 37 | psxbios.h \ 38 | psxcommon.c \ 39 | psxcommon.h \ 40 | psxcounters.h \ 41 | psxdma.h \ 42 | psxhle.h \ 43 | psxhw.h \ 44 | psxmem.h \ 45 | r3000a.h \ 46 | sio.h \ 47 | sjisfont.h \ 48 | spu.h \ 49 | system.h \ 50 | cdriso.c \ 51 | cdriso.h \ 52 | cheat.c \ 53 | cheat.h \ 54 | socket.c \ 55 | socket.h \ 56 | ppf.c \ 57 | ppf.h 58 | 59 | if ARCH_X86_64 60 | libpcsxcore_a_SOURCES += \ 61 | ix86_64/iGte.h \ 62 | ix86_64/iR3000A-64.c \ 63 | ix86_64/ix86-64.c \ 64 | ix86_64/ix86-64.h \ 65 | ix86_64/ix86_cpudetect.c \ 66 | ix86_64/ix86_fpu.c \ 67 | ix86_64/ix86_3dnow.c \ 68 | ix86_64/ix86_mmx.c \ 69 | ix86_64/ix86_sse.c 70 | else 71 | if ARCH_X86 72 | libpcsxcore_a_SOURCES += \ 73 | ix86/iGte.h \ 74 | ix86/iR3000A.c \ 75 | ix86/ix86.c \ 76 | ix86/ix86.h 77 | endif 78 | endif 79 | 80 | if ARCH_PPC 81 | libpcsxcore_a_SOURCES += \ 82 | ppc/pGte.h \ 83 | ppc/pR3000A.c \ 84 | ppc/ppc.c \ 85 | ppc/ppc.h \ 86 | ppc/ppc_mnemonics.h \ 87 | ppc/reguse.c \ 88 | ppc/reguse.h 89 | libpcsxcore_a_CCASFLAGS = -x assembler-with-cpp -mregnames -D__POWERPC__ 90 | endif 91 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/mdec.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __MDEC_H__ 21 | #define __MDEC_H__ 22 | 23 | #include "psxcommon.h" 24 | #include "r3000a.h" 25 | #include "psxhw.h" 26 | #include "psxdma.h" 27 | 28 | void mdecInit(); 29 | void mdecWrite0(u32 data); 30 | void mdecWrite1(u32 data); 31 | u32 mdecRead0(); 32 | u32 mdecRead1(); 33 | void psxDma0(u32 madr, u32 bcr, u32 chcr); 34 | void psxDma1(u32 madr, u32 bcr, u32 chcr); 35 | void mdec1Interrupt(); 36 | int mdecFreeze(gzFile f, int Mode); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/decode_xa.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __DECODE_XA_H__ 21 | #define __DECODE_XA_H__ 22 | 23 | #include "psxcommon.h" 24 | 25 | typedef struct { 26 | s32 y0, y1; 27 | } ADPCM_Decode_t; 28 | 29 | typedef struct { 30 | int freq; 31 | int nbits; 32 | int stereo; 33 | int nsamples; 34 | ADPCM_Decode_t left, right; 35 | short pcm[16384]; 36 | } xa_decode_t; 37 | 38 | s32 xa_decode_sector( xa_decode_t *xdp, 39 | unsigned char *sectorp, 40 | int is_first_sector ); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/intl-compat.c: -------------------------------------------------------------------------------- 1 | /* intl-compat.c - Stub functions to call gettext functions from GNU gettext 2 | Library. 3 | Copyright (C) 1995 Software Foundation, Inc. 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ 18 | 19 | #include "intlconfig.h" 20 | 21 | #include "libgettext.h" 22 | 23 | /* @@ end of prolog @@ */ 24 | 25 | 26 | #undef gettext 27 | #undef dgettext 28 | #undef dcgettext 29 | #undef textdomain 30 | #undef bindtextdomain 31 | 32 | 33 | char * 34 | bindtextdomain (domainname, dirname) 35 | const char *domainname; 36 | const char *dirname; 37 | { 38 | return bindtextdomain__ (domainname, dirname); 39 | } 40 | 41 | 42 | char * 43 | dcgettext (domainname, msgid, category) 44 | const char *domainname; 45 | const char *msgid; 46 | int category; 47 | { 48 | return dcgettext__ (domainname, msgid, category); 49 | } 50 | 51 | 52 | char * 53 | dgettext (domainname, msgid) 54 | const char *domainname; 55 | const char *msgid; 56 | { 57 | return dgettext__ (domainname, msgid); 58 | } 59 | 60 | 61 | char * 62 | gettext (msgid) 63 | const char *msgid; 64 | { 65 | return gettext__ (msgid); 66 | } 67 | 68 | 69 | char * 70 | textdomain (domainname) 71 | const char *domainname; 72 | { 73 | return textdomain__ (domainname); 74 | } 75 | -------------------------------------------------------------------------------- /pcsxr/po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = PCSX-Reloaded 22 | 23 | # This is the email address or URL to which the translators shall report 24 | # bugs in the untranslated strings: 25 | # - Strings which are not entire sentences, see the maintainer guidelines 26 | # in the GNU gettext documentation, section 'Preparing Strings'. 27 | # - Strings which use unclear terms or require additional context to be 28 | # understood. 29 | # - Strings which make invalid assumptions about notation of date, time or 30 | # money. 31 | # - Pluralisation problems. 32 | # - Incorrect English spelling. 33 | # - Incorrect formatting. 34 | # It can be your email address, or a mailing list address where translators 35 | # can write to without being subscribed, or the URL of a web page through 36 | # which the translators can contact you. 37 | MSGID_BUGS_ADDRESS = whistler_wmz@users.sf.net 38 | 39 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 40 | # message catalogs shall be used. It is usually empty. 41 | EXTRA_LOCALE_CATEGORIES = 42 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/cdriso.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 PCSX-df Team * 3 | * Copyright (C) 2009 Wei Mingzhi * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef CDRISO_H 22 | #define CDRISO_H 23 | 24 | #include 25 | 26 | int handleecm(const char *isoname, FILE* cdh, s32* accurate_length); 27 | int aropen(FILE* fparchive, const char* _fn); 28 | void cdrIsoInit(void); 29 | int cdrIsoActive(void); 30 | int handlearchive(const char *isoname, s32* accurate_length); 31 | 32 | extern unsigned int cdrIsoMultidiskCount; 33 | extern unsigned int cdrIsoMultidiskSelect; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /pcsxr/AUTHORS: -------------------------------------------------------------------------------- 1 | PCSX Upstream Authors: Linuzappz 2 | Shadow 3 | Pete Bernett 4 | NoComp 5 | Nik3d 6 | Akumax 7 | 8 | PCSX Copyright: (c) 1999-2003 Pcsx Team 9 | (c) 1998 Vision Thing 10 | 11 | df Upstream Authors: Ryan Schultz 12 | Andrew Burton 13 | Stephen Chao 14 | Marcus Comstedt 15 | Stefan Sikora 16 | 17 | df Copyright: (c) 2005 Ryan Schultz 18 | (c) 2005 Andrew Burton 19 | (c) 2007 Stephen Chao 20 | (c) 2006 Marcus Comstedt 21 | 22 | PCSX-Reloaded Authors/Contributors: avlex (Help on xcode project) 23 | Benoît Gschwind (MDEC decoder improvements) 24 | ckain (Various bugfixes) 25 | Dario (Various bugfixes) 26 | edgbla (Root counters, SIO1, various core/plugin fixes) 27 | Firnis (GTE code from PCSX-Revolution Project) 28 | Hopkat (Sound plugin improvements, core fixes) 29 | Gabriele Gorla (MDEC decoder) 30 | MaddTheSane (Various bugfixes) 31 | maggix (Snow Leopard compile fix) 32 | NeToU (Bugfix) 33 | notaz (Various psxbios fixes) 34 | Peter Collingbourne (Various core/psxbios fixes) 35 | siveritas (Bugfix) 36 | shalma (GTE Divider, many core improvements, sound plugin fixes) 37 | Tristin Celestin (PulseAudio support) 38 | UTunnels (Mode 1 ISO support) 39 | VoidMage (Build system cleanups) 40 | Wei Mingzhi (Input plugin, iso/cheat support, misc stuff) 41 | (And others which I cannot keep track of) 42 | 43 | PCSX-Reloaded Translators: 99skull (Korean) 44 | Delirious (Hungarian) 45 | edgbla (Russian) 46 | Giovanni Scafora (Italian) 47 | Imanol08 (Spanish) 48 | Jean-André Santoni (French) 49 | Tibério Vítor (Brazilian Portuguese) 50 | Wei Mingzhi (Simplified & Traditional Chinese) 51 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/spu.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __SPU_H__ 21 | #define __SPU_H__ 22 | 23 | #include "psxcommon.h" 24 | #include "plugins.h" 25 | #include "r3000a.h" 26 | #include "psxmem.h" 27 | 28 | #define H_SPUirqAddr 0x0da4 29 | #define H_SPUaddr 0x0da6 30 | #define H_SPUdata 0x0da8 31 | #define H_SPUctrl 0x0daa 32 | #define H_SPUstat 0x0dae 33 | #define H_SPUon1 0x0d88 34 | #define H_SPUon2 0x0d8a 35 | #define H_SPUoff1 0x0d8c 36 | #define H_SPUoff2 0x0d8e 37 | 38 | void CALLBACK SPUirq(void); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/dgettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the dgettext(3) function 2 | Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software Foundation, 16 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 | 18 | #include 19 | 20 | #if defined HAVE_LOCALE_H || defined _LIBC 21 | # include 22 | #endif 23 | 24 | #ifdef _LIBC 25 | # include 26 | #else 27 | # include "libgettext.h" 28 | #endif 29 | 30 | /* @@ end of prolog @@ */ 31 | 32 | /* Names for the libintl functions are a problem. They must not clash 33 | with existing names and they should follow ANSI C. But this source 34 | code is also used in GNU C Library where the names have a __ 35 | prefix. So we have to make a difference here. */ 36 | #ifdef _LIBC 37 | # define DGETTEXT __dgettext 38 | # define DCGETTEXT __dcgettext 39 | #else 40 | # define DGETTEXT dgettext__ 41 | # define DCGETTEXT dcgettext__ 42 | #endif 43 | 44 | /* Look up MSGID in the DOMAINNAME message catalog of the current 45 | LC_MESSAGES locale. */ 46 | char * 47 | DGETTEXT (domainname, msgid) 48 | const char *domainname; 49 | const char *msgid; 50 | { 51 | return DCGETTEXT (domainname, msgid, LC_MESSAGES); 52 | } 53 | 54 | #ifdef _LIBC 55 | /* Alias for function name in GNU C Library. */ 56 | weak_alias (__dgettext, dgettext); 57 | #endif 58 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/psxbios.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __PSXBIOS_H__ 21 | #define __PSXBIOS_H__ 22 | 23 | #include "psxcommon.h" 24 | #include "r3000a.h" 25 | #include "psxmem.h" 26 | #include "misc.h" 27 | #include "sio.h" 28 | 29 | extern char *biosA0n[256]; 30 | extern char *biosB0n[256]; 31 | extern char *biosC0n[256]; 32 | 33 | void psxBiosInit(); 34 | void psxBiosShutdown(); 35 | void psxBiosException(); 36 | void psxBiosFreeze(int Mode); 37 | 38 | extern void (*biosA0[256])(); 39 | extern void (*biosB0[256])(); 40 | extern void (*biosC0[256])(); 41 | 42 | extern boolean hleSoftCall; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/hash-string.h: -------------------------------------------------------------------------------- 1 | /* Implements a string hashing function. 2 | Copyright (C) 1995, 1997 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public 15 | License along with the this program; see the file COPYING. If not, 16 | write to the Free Software Foundation, Inc., 51 Franklin Street, 17 | Fifth Floor, Boston, MA 02110-1301 USA. */ 18 | 19 | /* @@ end of prolog @@ */ 20 | 21 | #ifndef PARAMS 22 | # if __STDC__ 23 | # define PARAMS(Args) Args 24 | # else 25 | # define PARAMS(Args) () 26 | # endif 27 | #endif 28 | 29 | /* We assume to have `unsigned long int' value with at least 32 bits. */ 30 | #define HASHWORDBITS 32 31 | 32 | 33 | /* Defines the so called `hashpjw' function by P.J. Weinberger 34 | [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 35 | 1986, 1987 Bell Telephone Laboratories, Inc.] */ 36 | static unsigned long hash_string PARAMS ((const char *__str_param)); 37 | 38 | static inline unsigned long 39 | hash_string (str_param) 40 | const char *str_param; 41 | { 42 | unsigned long int hval, g; 43 | const char *str = str_param; 44 | 45 | /* Compute the hash value for the given string. */ 46 | hval = 0; 47 | while (*str != '\0') 48 | { 49 | hval <<= 4; 50 | hval += (unsigned long) *str++; 51 | g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4)); 52 | if (g != 0) 53 | { 54 | hval ^= g >> (HASHWORDBITS - 8); 55 | hval ^= g; 56 | } 57 | } 58 | return hval; 59 | } 60 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/psxcounters.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Blade_Arma * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __PSXCOUNTERS_H__ 21 | #define __PSXCOUNTERS_H__ 22 | 23 | #include "psxcommon.h" 24 | #include "r3000a.h" 25 | #include "psxmem.h" 26 | #include "plugins.h" 27 | 28 | extern u32 psxNextCounter, psxNextsCounter; 29 | 30 | void psxRcntInit(); 31 | void psxRcntUpdate(); 32 | 33 | void psxRcntWcount(u32 index, u32 value); 34 | void psxRcntWmode(u32 index, u32 value); 35 | void psxRcntWtarget(u32 index, u32 value); 36 | 37 | u32 psxRcntRcount(u32 index); 38 | u32 psxRcntRmode(u32 index); 39 | u32 psxRcntRtarget(u32 index); 40 | 41 | s32 psxRcntFreeze(gzFile f, s32 Mode); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/gte.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __GTE_H__ 21 | #define __GTE_H__ 22 | 23 | #include "psxcommon.h" 24 | #include "r3000a.h" 25 | 26 | void gteMFC2(); 27 | void gteCFC2(); 28 | void gteMTC2(); 29 | void gteCTC2(); 30 | void gteLWC2(); 31 | void gteSWC2(); 32 | 33 | void gteRTPS(); 34 | void gteNCLIP(); 35 | void gteOP(); 36 | void gteDPCS(); 37 | void gteINTPL(); 38 | void gteMVMVA(); 39 | void gteNCDS(); 40 | void gteCDP(); 41 | void gteNCDT(); 42 | void gteNCCS(); 43 | void gteCC(); 44 | void gteNCS(); 45 | void gteNCT(); 46 | void gteSQR(); 47 | void gteDCPL(); 48 | void gteDPCT(); 49 | void gteAVSZ3(); 50 | void gteAVSZ4(); 51 | void gteRTPT(); 52 | void gteGPF(); 53 | void gteGPL(); 54 | void gteNCCT(); 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/system.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __SYSTEM_H__ 21 | #define __SYSTEM_H__ 22 | 23 | int SysInit(); // Init mem and plugins 24 | void SysReset(); // Resets mem 25 | void SysPrintf(const char *fmt, ...); // Printf used by bios syscalls 26 | void SysMessage(const char *fmt, ...); // Message used to print msg to users 27 | void *SysLoadLibrary(const char *lib); // Loads Library 28 | void *SysLoadSym(void *lib, const char *sym); // Loads Symbol from Library 29 | const char *SysLibError(); // Gets previous error loading sysbols 30 | void SysCloseLibrary(void *lib); // Closes Library 31 | void SysUpdate(); // Called on VBlank (to update i.e. pads) 32 | void SysRunGui(); // Returns to the Gui 33 | void SysClose(); // Close mem and plugins 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /pcsxr/win32/psxida/ida_plugin.cpp: -------------------------------------------------------------------------------- 1 | #define VERSION "1.0.0" 2 | #define NAME "PsxIda" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | extern debugger_t debugger; 9 | 10 | static bool plugin_inited; 11 | 12 | static void print_version() 13 | { 14 | static const char format[] = NAME " debugger plugin v%s;\nAuthor: Dr. MefistO [Lab 313] ."; 15 | info(format, VERSION); 16 | msg(format, VERSION); 17 | } 18 | 19 | // Initialize debugger plugin 20 | static bool init_plugin(void) 21 | { 22 | if (ph.id != PLFM_MIPS) 23 | return false; 24 | 25 | return true; 26 | } 27 | 28 | // Initialize debugger plugin 29 | static int idaapi init(void) 30 | { 31 | if (init_plugin()) 32 | { 33 | dbg = &debugger; 34 | plugin_inited = true; 35 | 36 | print_version(); 37 | return PLUGIN_KEEP; 38 | } 39 | return PLUGIN_SKIP; 40 | } 41 | 42 | // Terminate debugger plugin 43 | static void idaapi term(void) 44 | { 45 | if (plugin_inited) 46 | { 47 | //term_plugin(); 48 | plugin_inited = false; 49 | } 50 | } 51 | 52 | // The plugin method - usually is not used for debugger plugins 53 | static void idaapi run(int /*arg*/) 54 | { 55 | 56 | } 57 | 58 | //-------------------------------------------------------------------------- 59 | char comment[] = NAME " debugger plugin by Dr. MefistO."; 60 | 61 | char help[] = 62 | NAME " debugger plugin by Dr. MefistO.\n" 63 | "\n" 64 | "This module lets you to debug PS1 games in IDA.\n"; 65 | 66 | //-------------------------------------------------------------------------- 67 | // 68 | // PLUGIN DESCRIPTION BLOCK 69 | // 70 | //-------------------------------------------------------------------------- 71 | plugin_t PLUGIN = 72 | { 73 | IDP_INTERFACE_VERSION, 74 | PLUGIN_PROC | PLUGIN_HIDE | PLUGIN_DBG, // plugin flags 75 | init, // initialize 76 | 77 | term, // terminate. this pointer may be NULL. 78 | 79 | run, // invoke plugin 80 | 81 | comment, // long comment about the plugin 82 | // it could appear in the status line 83 | // or as a hint 84 | 85 | help, // multiline help about the plugin 86 | 87 | NAME " debugger plugin", // the preferred short name of the plugin 88 | 89 | "" // the preferred hotkey to run the plugin 90 | }; 91 | -------------------------------------------------------------------------------- /pcsxr/win32/zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (z_const Bytef *)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if (err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if (err != Z_STREAM_END) { 50 | inflateEnd(&stream); 51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 52 | return Z_DATA_ERROR; 53 | return err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = inflateEnd(&stream); 58 | return err; 59 | } 60 | -------------------------------------------------------------------------------- /pcsxr/win32/gui/AboutDlg.c: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2003 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include 20 | #include 21 | #include "resource.h" 22 | #include "AboutDlg.h" 23 | #include "psxcommon.h" 24 | 25 | char *LabelAuthors = { N_( 26 | "PCSXR - A PlayStation Emulator\n\n" 27 | "Original Authors:\n" 28 | "main coder: linuzappz\n" 29 | "co-coders: shadow\n" 30 | "ex-coders: Nocomp, Pete Bernett, nik3d\n" 31 | "Webmaster: AkumaX") 32 | }; 33 | 34 | char *LabelGreets = { N_( 35 | "PCSX-df Authors:\n" 36 | "Ryan Schultz, Andrew Burton, Stephen Chao,\n" 37 | "Marcus Comstedt, Stefan Sikora\n\n" 38 | "PCSX-Reloaded By:\n" 39 | "edgbla, shalma, Wei Mingzhi, et al.\n\n" 40 | "http://pcsxr.codeplex.com/") 41 | }; 42 | 43 | LRESULT WINAPI AboutDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { 44 | switch (uMsg) { 45 | case WM_INITDIALOG: 46 | SetWindowText(hDlg, _("About")); 47 | 48 | Button_SetText(GetDlgItem(hDlg, IDOK), _("OK")); 49 | Static_SetText(GetDlgItem(hDlg, IDC_PCSXR_ABOUT_TEXT), _("PCSXR EMU\n")); 50 | Static_SetText(GetDlgItem(hDlg, IDC_PCSXR_ABOUT_AUTHORS), _(LabelAuthors)); 51 | Static_SetText(GetDlgItem(hDlg, IDC_PCSXR_ABOUT_GREETS), _(LabelGreets)); 52 | Button_SetText(GetDlgItem(hDlg,IDOK), _("OK")); 53 | return TRUE; 54 | 55 | case WM_COMMAND: 56 | switch (wParam) { 57 | case IDOK: 58 | EndDialog(hDlg, TRUE); 59 | return TRUE; 60 | } 61 | break; 62 | 63 | case WM_CLOSE: 64 | EndDialog(hDlg, TRUE); 65 | return TRUE; 66 | } 67 | return FALSE; 68 | } 69 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/ix86/iGte.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __IGTE_H__ 21 | #define __IGTE_H__ 22 | 23 | #include "../r3000a.h" 24 | #include "../psxmem.h" 25 | 26 | #define CP2_FUNC(f) \ 27 | void gte##f(); \ 28 | static void rec##f() { \ 29 | iFlushRegs(); \ 30 | MOV32ItoM((u32)&psxRegs.code, (u32)psxRegs.code); \ 31 | CALLFunc ((u32)gte##f); \ 32 | /* branch = 2; */\ 33 | } 34 | 35 | CP2_FUNC(MFC2); 36 | CP2_FUNC(MTC2); 37 | CP2_FUNC(CFC2); 38 | CP2_FUNC(CTC2); 39 | CP2_FUNC(LWC2); 40 | CP2_FUNC(SWC2); 41 | CP2_FUNC(RTPS); 42 | CP2_FUNC(OP); 43 | CP2_FUNC(NCLIP); 44 | CP2_FUNC(DPCS); 45 | CP2_FUNC(INTPL); 46 | CP2_FUNC(MVMVA); 47 | CP2_FUNC(NCDS); 48 | CP2_FUNC(NCDT); 49 | CP2_FUNC(CDP); 50 | CP2_FUNC(NCCS); 51 | CP2_FUNC(CC); 52 | CP2_FUNC(NCS); 53 | CP2_FUNC(NCT); 54 | CP2_FUNC(SQR); 55 | CP2_FUNC(DCPL); 56 | CP2_FUNC(DPCT); 57 | CP2_FUNC(AVSZ3); 58 | CP2_FUNC(AVSZ4); 59 | CP2_FUNC(RTPT); 60 | CP2_FUNC(GPF); 61 | CP2_FUNC(GPL); 62 | CP2_FUNC(NCCT); 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/ppc/pGte.h: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2003 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef PGET_H 20 | #define PGET_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | int psxCP2time[64] = { 27 | 2, 16 , 1 , 1, 1, 1 , 8, 1, // 00 28 | 1 , 1 , 1 , 1, 6 , 1 , 1 , 1, // 08 29 | 8 , 8, 8, 19, 13 , 1 , 44 , 1, // 10 30 | 1 , 1 , 1 , 17, 11 , 1 , 14 , 1, // 18 31 | 30 , 1 , 1 , 1, 1, 1 , 1 , 1, // 20 32 | 5 , 8 , 17 , 1, 1, 5, 6, 1, // 28 33 | 23 , 1 , 1 , 1, 1, 1 , 1 , 1, // 30 34 | 1 , 1 , 1 , 1, 1, 6 , 5 , 39 // 38 35 | }; 36 | 37 | #define CP2_FUNC(f) \ 38 | void gte##f(); \ 39 | static void rec##f() { \ 40 | if (pc < cop2readypc) idlecyclecount += (cop2readypc - pc)>>2; \ 41 | iFlushRegs(0); \ 42 | LIW(0, (u32)psxRegs.code); \ 43 | STW(0, OFFSET(&psxRegs, &psxRegs.code), GetHWRegSpecial(PSXREGS)); \ 44 | FlushAllHWReg(); \ 45 | CALLFunc ((u32)gte##f); \ 46 | cop2readypc = pc + psxCP2time[_fFunct_(psxRegs.code)]<<2; \ 47 | } 48 | 49 | CP2_FUNC(MFC2); 50 | CP2_FUNC(MTC2); 51 | CP2_FUNC(CFC2); 52 | CP2_FUNC(CTC2); 53 | CP2_FUNC(LWC2); 54 | CP2_FUNC(SWC2); 55 | CP2_FUNC(RTPS); 56 | CP2_FUNC(OP); 57 | CP2_FUNC(NCLIP); 58 | CP2_FUNC(DPCS); 59 | CP2_FUNC(INTPL); 60 | CP2_FUNC(MVMVA); 61 | CP2_FUNC(NCDS); 62 | CP2_FUNC(NCDT); 63 | CP2_FUNC(CDP); 64 | CP2_FUNC(NCCS); 65 | CP2_FUNC(CC); 66 | CP2_FUNC(NCS); 67 | CP2_FUNC(NCT); 68 | CP2_FUNC(SQR); 69 | CP2_FUNC(DCPL); 70 | CP2_FUNC(DPCT); 71 | CP2_FUNC(AVSZ3); 72 | CP2_FUNC(AVSZ4); 73 | CP2_FUNC(RTPT); 74 | CP2_FUNC(GPF); 75 | CP2_FUNC(GPL); 76 | CP2_FUNC(NCCT); 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | #endif 82 | -------------------------------------------------------------------------------- /pcsxr/win32/gui/Win32.h: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2003 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef __WIN32_H__ 20 | #define __WIN32_H__ 21 | 22 | typedef struct { 23 | HWND hWnd; // Main window handle 24 | HINSTANCE hInstance; // Application instance 25 | HMENU hMenu; // Main window menu 26 | } AppData; 27 | 28 | extern AppData gApp; 29 | extern HANDLE hConsole; 30 | 31 | extern int StatesC; 32 | extern int AccBreak; 33 | extern int ConfPlug; 34 | extern int CancelQuit; 35 | extern char cfgfile[256]; 36 | extern int Running; 37 | extern boolean UseGui; 38 | extern char PcsxrDir[256]; 39 | 40 | void strcatz(char *dst, char *src); 41 | 42 | LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM); 43 | BOOL CALLBACK ConfigureMcdsDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam); 44 | BOOL CALLBACK ConfigureCpuDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam); 45 | BOOL CALLBACK ConfigureNetPlayDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam); 46 | 47 | LRESULT WINAPI CheatDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam); 48 | LRESULT WINAPI CheatSearchDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam); 49 | 50 | void ConfigurePlugins(HWND hWnd); 51 | 52 | int Open_File_Proc(char *file); 53 | int Open_Iso_Proc(char *file); 54 | void Open_Mcd_Proc(HWND hW, int MCDID); 55 | void CreateMainWindow(int nCmdShow); 56 | void RunGui(); 57 | void PADhandleKey(int key); 58 | 59 | int LoadConfig(); 60 | void SaveConfig(); 61 | 62 | void ResetMenuSlots(); 63 | void UpdateMenuItems(); 64 | 65 | void InitLanguages(); 66 | char *GetLanguageNext(); 67 | void CloseLanguages(); 68 | void ChangeLanguage(char *lang); 69 | 70 | #endif /* __WIN32_H__ */ 71 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/ix86_64/iGte.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __IGTE_H__ 21 | #define __IGTE_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #include "../r3000a.h" 28 | #include "../psxmem.h" 29 | 30 | #define CP2_FUNC(f) \ 31 | void gte##f(); \ 32 | static void rec##f() { \ 33 | iFlushRegs(); \ 34 | MOV32ItoM((uptr)&psxRegs.code, (u32)psxRegs.code); \ 35 | CALLFunc((uptr)gte##f); \ 36 | /* branch = 2; */\ 37 | } 38 | 39 | CP2_FUNC(MFC2); 40 | CP2_FUNC(MTC2); 41 | CP2_FUNC(CFC2); 42 | CP2_FUNC(CTC2); 43 | CP2_FUNC(LWC2); 44 | CP2_FUNC(SWC2); 45 | CP2_FUNC(RTPS); 46 | CP2_FUNC(OP); 47 | CP2_FUNC(NCLIP); 48 | CP2_FUNC(DPCS); 49 | CP2_FUNC(INTPL); 50 | CP2_FUNC(MVMVA); 51 | CP2_FUNC(NCDS); 52 | CP2_FUNC(NCDT); 53 | CP2_FUNC(CDP); 54 | CP2_FUNC(NCCS); 55 | CP2_FUNC(CC); 56 | CP2_FUNC(NCS); 57 | CP2_FUNC(NCT); 58 | CP2_FUNC(SQR); 59 | CP2_FUNC(DCPL); 60 | CP2_FUNC(DPCT); 61 | CP2_FUNC(AVSZ3); 62 | CP2_FUNC(AVSZ4); 63 | CP2_FUNC(RTPT); 64 | CP2_FUNC(GPF); 65 | CP2_FUNC(GPL); 66 | CP2_FUNC(NCCT); 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | #endif 72 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/gettextP.h: -------------------------------------------------------------------------------- 1 | /* Header describing internals of gettext library 2 | Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 | Written by Ulrich Drepper , 1995. 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software Foundation, 17 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ 18 | 19 | #ifndef _GETTEXTP_H 20 | #define _GETTEXTP_H 21 | 22 | #include "loadinfo.h" 23 | 24 | /* @@ end of prolog @@ */ 25 | 26 | #ifndef PARAMS 27 | # if __STDC__ 28 | # define PARAMS(args) args 29 | # else 30 | # define PARAMS(args) () 31 | # endif 32 | #endif 33 | 34 | #ifndef internal_function 35 | # define internal_function 36 | #endif 37 | 38 | #ifndef W 39 | # define W(flag, data) ((flag) ? SWAP (data) : (data)) 40 | #endif 41 | 42 | 43 | #ifdef _LIBC 44 | # include 45 | # define SWAP(i) bswap_32 (i) 46 | #else 47 | static nls_uint32 SWAP PARAMS ((nls_uint32 i)); 48 | 49 | static inline nls_uint32 50 | SWAP (i) 51 | nls_uint32 i; 52 | { 53 | return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); 54 | } 55 | #endif 56 | 57 | 58 | struct loaded_domain 59 | { 60 | const char *data; 61 | int use_mmap; 62 | size_t mmap_size; 63 | int must_swap; 64 | nls_uint32 nstrings; 65 | struct string_desc *orig_tab; 66 | struct string_desc *trans_tab; 67 | nls_uint32 hash_size; 68 | nls_uint32 *hash_tab; 69 | }; 70 | 71 | struct binding 72 | { 73 | struct binding *next; 74 | char *domainname; 75 | char *dirname; 76 | }; 77 | 78 | struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname, 79 | char *__locale, 80 | const char *__domainname)) 81 | internal_function; 82 | void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain)) 83 | internal_function; 84 | void _nl_unload_domain PARAMS ((struct loaded_domain *__domain)) 85 | internal_function; 86 | 87 | /* @@ begin of epilog @@ */ 88 | 89 | #endif /* gettextP.h */ 90 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/gettext.c: -------------------------------------------------------------------------------- 1 | /* Implementation of gettext(3) function. 2 | Copyright (C) 1995, 1997 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software Foundation, 16 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 | 18 | #include "intlconfig.h" 19 | 20 | #ifdef _LIBC 21 | # define __need_NULL 22 | # include 23 | #else 24 | # ifdef STDC_HEADERS 25 | # include /* Just for NULL. */ 26 | # else 27 | # ifdef HAVE_STRING_H 28 | # include 29 | # else 30 | # define NULL ((void *) 0) 31 | # endif 32 | # endif 33 | #endif 34 | 35 | #ifdef _LIBC 36 | # include 37 | #else 38 | # include "libgettext.h" 39 | #endif 40 | 41 | /* @@ end of prolog @@ */ 42 | 43 | /* Names for the libintl functions are a problem. They must not clash 44 | with existing names and they should follow ANSI C. But this source 45 | code is also used in GNU C Library where the names have a __ 46 | prefix. So we have to make a difference here. */ 47 | #ifdef _LIBC 48 | # define GETTEXT __gettext 49 | # define DGETTEXT __dgettext 50 | #else 51 | # define GETTEXT gettext__ 52 | # define DGETTEXT dgettext__ 53 | #endif 54 | 55 | #include // Added by Wei Mingzhi 5-4-2010 56 | 57 | /* Look up MSGID in the current default message catalog for the current 58 | LC_MESSAGES locale. If not found, returns MSGID itself (the default 59 | text). */ 60 | char * 61 | GETTEXT (msgid) 62 | const char *msgid; 63 | { 64 | // return DGETTEXT (NULL, msgid); 65 | 66 | // 5-24-2010 Wei Mingzhi 67 | // Hack for UTF-8 support 68 | char *t = DGETTEXT(NULL, msgid); 69 | char buf[16384]; 70 | static char bufout[16384]; 71 | 72 | if (MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)t, -1, (LPWSTR)buf, sizeof(buf)) == 0) { 73 | return t; 74 | } 75 | 76 | if (WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)buf, -1, (LPSTR)bufout, sizeof(bufout), NULL, NULL) == 0) { 77 | return t; 78 | } 79 | 80 | return bufout; 81 | } 82 | 83 | #ifdef _LIBC 84 | /* Alias for function name in GNU C Library. */ 85 | weak_alias (__gettext, gettext); 86 | #endif 87 | -------------------------------------------------------------------------------- /pcsxr/gui/Linux.h: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2002 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef __LINUX_H__ 20 | #define __LINUX_H__ 21 | 22 | #include "config.h" 23 | 24 | #include "../libpcsxcore/psxcommon.h" 25 | #include 26 | 27 | #include "Cheat.h" 28 | 29 | #define DEFAULT_MEM_CARD_1 "/.pcsxr/memcards/card1.mcd" 30 | #define DEFAULT_MEM_CARD_2 "/.pcsxr/memcards/card2.mcd" 31 | #define MEMCARD_DIR "/.pcsxr/memcards/" 32 | #define PLUGINS_DIR "/.pcsxr/plugins/" 33 | #define PLUGINS_CFG_DIR "/.pcsxr/plugins/cfg/" 34 | #define PCSXR_DOT_DIR "/.pcsxr/" 35 | #define BIOS_DIR "/.pcsxr/bios/" 36 | #define STATES_DIR "/.pcsxr/sstates/" 37 | #define CHEATS_DIR "/.pcsxr/cheats/" 38 | #define PATCHES_DIR "/.pcsxr/patches/" 39 | 40 | #define OLD_SLOT 1000 41 | #define NUM_OLD_SLOTS 2 42 | #define LAST_OLD_SLOT (OLD_SLOT + NUM_OLD_SLOTS - 1) 43 | 44 | extern gboolean UseGui; 45 | extern int StatesC; 46 | char cfgfile[MAXPATHLEN]; /* ADB Comment this out - make a local var, or at least use gchar funcs */ 47 | char cfgfile_basename[MAXPATHLEN]; /* ADB Comment this out - make a local var, or at least use gchar funcs */ 48 | 49 | int LoadConfig(); 50 | void SaveConfig(); 51 | 52 | void StartGui(); 53 | 54 | void autoloadCheats(); // try load cheat file from default path and filename 55 | 56 | void PADhandleKey(int key); 57 | 58 | int UpdateMenuSlots(); 59 | 60 | gchar* get_state_filename(int i); 61 | gchar* get_cdrom_label_id(const gchar* suffix); // get cdrom label and id and append suffix to string 62 | gchar* get_cdrom_label_trim(); // trim cdrom label out of whitespaces 63 | 64 | void state_save(gchar *state_filename); 65 | void state_load(gchar *state_filename); 66 | 67 | int match(const char* string, char* pattern); 68 | int plugins_configured(); 69 | 70 | void UpdatePluginsBIOS(); 71 | 72 | void SysErrorMessage(gchar *primary, gchar *secondary); 73 | void SysInfoMessage(gchar *primary, gchar *secondary); 74 | 75 | #endif /* __LINUX_H__ */ 76 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/loadinfo.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996, 1997 Free Software Foundation, Inc. 2 | This file is part of the GNU C Library. 3 | Contributed by Ulrich Drepper , 1996. 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software Foundation, 17 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ 18 | 19 | #ifndef PARAMS 20 | # if __STDC__ 21 | # define PARAMS(args) args 22 | # else 23 | # define PARAMS(args) () 24 | # endif 25 | #endif 26 | 27 | /* Encoding of locale name parts. */ 28 | #define CEN_REVISION 1 29 | #define CEN_SPONSOR 2 30 | #define CEN_SPECIAL 4 31 | #define XPG_NORM_CODESET 8 32 | #define XPG_CODESET 16 33 | #define TERRITORY 32 34 | #define CEN_AUDIENCE 64 35 | #define XPG_MODIFIER 128 36 | 37 | #define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE) 38 | #define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER) 39 | 40 | 41 | struct loaded_l10nfile 42 | { 43 | const char *filename; 44 | int decided; 45 | 46 | const void *data; 47 | 48 | struct loaded_l10nfile *next; 49 | struct loaded_l10nfile *successor[1]; 50 | }; 51 | 52 | 53 | extern const char *_nl_normalize_codeset PARAMS ((const unsigned char *codeset, 54 | size_t name_len)); 55 | 56 | extern struct loaded_l10nfile * 57 | _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list, 58 | const char *dirlist, size_t dirlist_len, int mask, 59 | const char *language, const char *territory, 60 | const char *codeset, 61 | const char *normalized_codeset, 62 | const char *modifier, const char *special, 63 | const char *sponsor, const char *revision, 64 | const char *filename, int do_allocate)); 65 | 66 | 67 | extern const char * __cdecl _nl_expand_alias PARAMS ((const char *name)); 68 | 69 | extern int _nl_explode_name PARAMS ((char *name, const char **language, 70 | const char **modifier, 71 | const char **territory, 72 | const char **codeset, 73 | const char **normalized_codeset, 74 | const char **special, 75 | const char **sponsor, 76 | const char **revision)); 77 | -------------------------------------------------------------------------------- /pcsxr/win32/zlib/compress.c: -------------------------------------------------------------------------------- 1 | /* compress.c -- compress a memory buffer 2 | * Copyright (C) 1995-2005 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Compresses the source buffer into the destination buffer. The level 13 | parameter has the same meaning as in deflateInit. sourceLen is the byte 14 | length of the source buffer. Upon entry, destLen is the total size of the 15 | destination buffer, which must be at least 0.1% larger than sourceLen plus 16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. 17 | 18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, 20 | Z_STREAM_ERROR if the level parameter is invalid. 21 | */ 22 | int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) 23 | Bytef *dest; 24 | uLongf *destLen; 25 | const Bytef *source; 26 | uLong sourceLen; 27 | int level; 28 | { 29 | z_stream stream; 30 | int err; 31 | 32 | stream.next_in = (z_const Bytef *)source; 33 | stream.avail_in = (uInt)sourceLen; 34 | #ifdef MAXSEG_64K 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | #endif 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | stream.opaque = (voidpf)0; 45 | 46 | err = deflateInit(&stream, level); 47 | if (err != Z_OK) return err; 48 | 49 | err = deflate(&stream, Z_FINISH); 50 | if (err != Z_STREAM_END) { 51 | deflateEnd(&stream); 52 | return err == Z_OK ? Z_BUF_ERROR : err; 53 | } 54 | *destLen = stream.total_out; 55 | 56 | err = deflateEnd(&stream); 57 | return err; 58 | } 59 | 60 | /* =========================================================================== 61 | */ 62 | int ZEXPORT compress (dest, destLen, source, sourceLen) 63 | Bytef *dest; 64 | uLongf *destLen; 65 | const Bytef *source; 66 | uLong sourceLen; 67 | { 68 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 69 | } 70 | 71 | /* =========================================================================== 72 | If the default memLevel or windowBits for deflateInit() is changed, then 73 | this function needs to be updated. 74 | */ 75 | uLong ZEXPORT compressBound (sourceLen) 76 | uLong sourceLen; 77 | { 78 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 79 | (sourceLen >> 25) + 13; 80 | } 81 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/ppc/reguse.h: -------------------------------------------------------------------------------- 1 | #ifndef __REGUSE_H__ 2 | #define __REGUSE_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | // include basic types 9 | #include "../psxcommon.h" 10 | 11 | #define REGUSE_NONE 0x0000 12 | #define REGUSE_UNKNOWN 0x0001 13 | 14 | //sub functions 15 | #define REGUSE_SPECIAL 0x0002 16 | #define REGUSE_REGIMM 0x0004 17 | #define REGUSE_COP0 0x0006 18 | #define REGUSE_COP2 0x0008 19 | #define REGUSE_BASIC 0x000a 20 | #define REGUSE_SUBMASK 0x000e /* sub function mask */ 21 | 22 | #define REGUSE_ACC 0x0010 /* accumulator */ 23 | #define REGUSE_LOGIC 0x0020 /* logic operations */ 24 | #define REGUSE_MULT 0x0030 /* multiplier */ 25 | #define REGUSE_JUMP 0x0040 /* jump to dest */ 26 | #define REGUSE_JUMPR 0x0050 /* jump to reg */ 27 | #define REGUSE_BRANCH 0x0060 /* branch */ 28 | #define REGUSE_MEM_R 0x0070 /* read from memory */ 29 | #define REGUSE_MEM_W 0x0080 /* write to memory */ 30 | #define REGUSE_MEM 0x0090 /* read and write to memory */ 31 | #define REGUSE_SYS 0x00a0 /* syscall */ 32 | #define REGUSE_GTE 0x00b0 /* gte operation */ 33 | #define REGUSE_SUB 0x00f0 /* sub usage */ 34 | #define REGUSE_TYPEM 0x00f0 /* type mask */ 35 | 36 | 37 | #define REGUSE_RS_R 0x0100 38 | #define REGUSE_RS_W 0x0200 39 | #define REGUSE_RS (REGUSE_RS_R | REGUSE_RS_W) 40 | #define REGUSE_RT_R 0x0400 41 | #define REGUSE_RT_W 0x0800 42 | #define REGUSE_RT (REGUSE_RT_R | REGUSE_RT_W) 43 | #define REGUSE_RD_R 0x1000 44 | #define REGUSE_RD_W 0x2000 45 | #define REGUSE_RD (REGUSE_RD_R | REGUSE_RD_W) 46 | 47 | #define REGUSE_R31_W 0x4000 /* writes to link register (r31) */ 48 | #define REGUSE_PC 0x8000 /* reads pc */ 49 | 50 | #define REGUSE_LO_R 0x10000 51 | #define REGUSE_LO_W 0x20000 52 | #define REGUSE_LO (REGUSE_LO_R | REGUSE_LO_W) 53 | #define REGUSE_HI_R 0x40000 54 | #define REGUSE_HI_W 0x80000 55 | #define REGUSE_HI (REGUSE_HI_R | REGUSE_HI_W) 56 | 57 | #define REGUSE_COP0_RD_R 0x100000 58 | #define REGUSE_COP0_RD_W 0x200000 59 | #define REGUSE_COP0_RD (REGUSE_COP0_RD_R | REGUSE_COP0_RD_W) 60 | #define REGUSE_COP0_STATUS 0x400000 61 | #define REGUSE_EXCEPTION 0x800000 62 | 63 | #define REGUSE_COP2_RT_R 0x1000000 64 | #define REGUSE_COP2_RT_W 0x2000000 65 | #define REGUSE_COP2_RT (REGUSE_COP2_RT_R | REGUSE_COP2_RT_W) 66 | #define REGUSE_COP2_RD_R 0x4000000 67 | #define REGUSE_COP2_RD_W 0x8000000 68 | #define REGUSE_COP2_RD (REGUSE_COP2_RD_R | REGUSE_COP2_RD_W) 69 | 70 | 71 | // specific register use 72 | #define REGUSE_READ 1 73 | #define REGUSE_WRITE 2 74 | #define REGUSE_RW 3 75 | 76 | int useOfPsxReg(u32 code, int use, int psxreg) __attribute__ ((__pure__));; 77 | int nextPsxRegUse(u32 pc, int psxreg) __attribute__ ((__pure__));; 78 | int isPsxRegUsed(u32 pc, int psxreg) __attribute__ ((__pure__));; 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #endif 84 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/psxcommon.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #include "psxcommon.h" 21 | #include "r3000a.h" 22 | #include "psxbios.h" 23 | 24 | #include "cheat.h" 25 | #include "ppf.h" 26 | 27 | PcsxConfig Config; 28 | boolean NetOpened = FALSE; 29 | 30 | int Log = 0; 31 | FILE *emuLog = NULL; 32 | 33 | // It is safe if these overflow 34 | u32 rewind_counter=0; 35 | u8 vblank_count_hideafter=0; 36 | 37 | int EmuInit() { 38 | return psxInit(); 39 | } 40 | 41 | void EmuReset() { 42 | FreeCheatSearchResults(); 43 | FreeCheatSearchMem(); 44 | 45 | psxReset(); 46 | } 47 | 48 | void EmuShutdown() { 49 | ClearAllCheats(); 50 | FreeCheatSearchResults(); 51 | FreeCheatSearchMem(); 52 | 53 | FreePPFCache(); 54 | 55 | psxShutdown(); 56 | 57 | CleanupMemSaveStates(); 58 | } 59 | 60 | void EmuUpdate() { 61 | // Do not allow hotkeys inside a softcall from HLE BIOS 62 | if (!Config.HLE || !hleSoftCall) 63 | SysUpdate(); 64 | 65 | ApplyCheats(); 66 | 67 | if (vblank_count_hideafter) { 68 | if (!(--vblank_count_hideafter)) { 69 | GPU_showScreenPic(NULL); 70 | } 71 | } 72 | 73 | if (Config.RewindInterval > 0 && !(++rewind_counter%Config.RewindInterval)) { 74 | CreateRewindState(); 75 | } 76 | } 77 | 78 | void __Log(char *fmt, ...) { 79 | va_list list; 80 | #ifdef LOG_STDOUT 81 | char tmp[1024]; 82 | #endif 83 | 84 | va_start(list, fmt); 85 | #ifndef LOG_STDOUT 86 | vfprintf(emuLog, fmt, list); 87 | #else 88 | vsprintf(tmp, fmt, list); 89 | SysPrintf(tmp); 90 | #endif 91 | va_end(list); 92 | } 93 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/sio.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | 21 | #ifndef _SIO_H_ 22 | #define _SIO_H_ 23 | 24 | #include "psxcommon.h" 25 | #include "r3000a.h" 26 | #include "psxmem.h" 27 | #include "plugins.h" 28 | #include "psemu_plugin_defs.h" 29 | 30 | #define MCD_SECT_SIZE (8 * 16) 31 | #define MCD_SIZE (1024 * MCD_SECT_SIZE) 32 | 33 | extern char Mcd1Data[MCD_SIZE], Mcd2Data[MCD_SIZE]; 34 | 35 | void sioWrite8(unsigned char value); 36 | void sioWriteStat16(unsigned short value); 37 | void sioWriteMode16(unsigned short value); 38 | void sioWriteCtrl16(unsigned short value); 39 | void sioWriteBaud16(unsigned short value); 40 | 41 | unsigned char sioRead8(); 42 | unsigned short sioReadStat16(); 43 | unsigned short sioReadMode16(); 44 | unsigned short sioReadCtrl16(); 45 | unsigned short sioReadBaud16(); 46 | 47 | void netError(); 48 | 49 | void sioInterrupt(); 50 | int sioFreeze(gzFile f, int Mode); 51 | 52 | void LoadMcd(int mcd, char *str); 53 | void LoadMcds(char *mcd1, char *mcd2); 54 | void SaveMcd(char *mcd, char *data, uint32_t adr, int size); 55 | void CreateMcd(char *mcd); 56 | void ConvertMcd(char *mcd, char *data); 57 | 58 | typedef struct { 59 | char Title[48 + 1]; // Title in ASCII 60 | char sTitle[48 * 2 + 1]; // Title in Shift-JIS 61 | char ID[12 + 1]; 62 | char Name[16 + 1]; 63 | int IconCount; 64 | short Icon[16 * 16 * 3]; 65 | unsigned char Flags; 66 | } McdBlock; 67 | 68 | void GetMcdBlockInfo(int mcd, int block, McdBlock *info); 69 | 70 | void CALLBACK SIO1irq(void); 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/debug.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __DEBUG_H__ 21 | #define __DEBUG_H__ 22 | 23 | enum breakpoint_types { 24 | BE, BR1, BR2, BR4, BW1, BW2, BW4 25 | }; 26 | 27 | void StartDebugger(); 28 | void StopDebugger(); 29 | 30 | void DebugVSync(); 31 | void ProcessDebug(); 32 | 33 | void DebugCheckBP(u32 address, enum breakpoint_types type); 34 | 35 | void PauseDebugger(); 36 | void ResumeDebugger(); 37 | 38 | extern char *disRNameGPR[]; 39 | extern char *disRNameCP2D[]; 40 | extern char *disRNameCP2C[]; 41 | extern char *disRNameCP0[]; 42 | 43 | char* disR3000AF(u32 code, u32 pc); 44 | 45 | /* 46 | * Specficies which logs should be activated. 47 | */ 48 | 49 | //#define LOG_STDOUT 50 | 51 | //#define PAD_LOG __Log 52 | //#define SIO1_LOG __Log 53 | //#define GTE_LOG __Log 54 | //#define CDR_LOG __Log("%8.8lx %8.8lx: ", psxRegs.pc, psxRegs.cycle); __Log 55 | //#define CDR_LOG_IO __Log("%8.8lx %8.8lx: ", psxRegs.pc, psxRegs.cycle); __Log 56 | 57 | //#define PSXHW_LOG __Log("%8.8lx %8.8lx: ", psxRegs.pc, psxRegs.cycle); __Log 58 | //#define PSXBIOS_LOG __Log("%8.8lx %8.8lx: ", psxRegs.pc, psxRegs.cycle); __Log 59 | //#define PSXDMA_LOG __Log 60 | //#define PSXMEM_LOG __Log("%8.8lx %8.8lx: ", psxRegs.pc, psxRegs.cycle); __Log 61 | //#define PSXCPU_LOG __Log 62 | 63 | #if defined(PSXCPU_LOG) || defined(PSXDMA_LOG) || defined(CDR_LOG) || defined(PSXHW_LOG) || \ 64 | defined(PSXBIOS_LOG) || defined(PSXMEM_LOG) || defined(GTE_LOG) || defined(PAD_LOG) || defined(SIO1_LOG) 65 | #define EMU_LOG __Log 66 | #endif 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /pcsxr/po/POTFILES.in: -------------------------------------------------------------------------------- 1 | [type: gettext/glade]data/pcsxr.ui 2 | gui/AboutDlg.c 3 | gui/AboutDlg.h 4 | gui/Cheat.c 5 | gui/Cheat.h 6 | gui/ConfDlg.c 7 | gui/ConfDlg.h 8 | gui/Config.c 9 | gui/DebugMemory.c 10 | gui/DebugMemory.h 11 | gui/GtkGui.c 12 | gui/Linux.h 13 | gui/LnxMain.c 14 | gui/MemcardDlg.c 15 | gui/MemcardDlg.h 16 | gui/nopic.h 17 | gui/Plugin.c 18 | libpcsxcore/cdriso.c 19 | libpcsxcore/cdrom.c 20 | libpcsxcore/cheat.c 21 | libpcsxcore/debug.c 22 | libpcsxcore/decode_xa.c 23 | libpcsxcore/disr3000a.c 24 | libpcsxcore/gte.c 25 | libpcsxcore/mdec.c 26 | libpcsxcore/misc.c 27 | libpcsxcore/plugins.c 28 | libpcsxcore/ppf.c 29 | libpcsxcore/psxbios.c 30 | libpcsxcore/psxcommon.c 31 | libpcsxcore/psxcounters.c 32 | libpcsxcore/psxdma.c 33 | libpcsxcore/psxhle.c 34 | libpcsxcore/psxhw.c 35 | libpcsxcore/psxinterpreter.c 36 | libpcsxcore/psxmem.c 37 | libpcsxcore/r3000a.c 38 | libpcsxcore/sio.c 39 | libpcsxcore/socket.c 40 | libpcsxcore/spu.c 41 | plugins/dfcdrom/cdr.c 42 | [type: gettext/glade]plugins/dfcdrom/cdrcfg-0.1df/dfcdrom.ui 43 | plugins/dfcdrom/cdrcfg-0.1df/main.c 44 | plugins/dfcdrom/cdr-linux.c 45 | plugins/dfcdrom/cdr-null.c 46 | plugins/dfcdrom/cfg.c 47 | plugins/dfinput/analog.c 48 | plugins/dfinput/cfg.c 49 | plugins/dfinput/cfg-gtk.c 50 | [type: gettext/glade]plugins/dfinput/dfinput.ui 51 | plugins/dfinput/pad.c 52 | plugins/dfinput/sdljoy.c 53 | plugins/dfinput/xkb.c 54 | plugins/dfnet/cfg.c 55 | plugins/dfnet/dfnet.c 56 | [type: gettext/glade]plugins/dfnet/dfnet.ui 57 | plugins/dfnet/dfnet.h 58 | plugins/dfnet/gui.c 59 | plugins/dfnet/unix.c 60 | plugins/dfsound/adsr.c 61 | plugins/dfsound/alsa.c 62 | plugins/dfsound/cfg.c 63 | plugins/dfsound/dma.c 64 | plugins/dfsound/freeze.c 65 | plugins/dfsound/nullsnd.c 66 | plugins/dfsound/oss.c 67 | plugins/dfsound/pulseaudio.c 68 | plugins/dfsound/registers.c 69 | plugins/dfsound/reverb.c 70 | plugins/dfsound/spu.c 71 | [type: gettext/glade]plugins/dfsound/spucfg-0.1df/dfsound.ui 72 | plugins/dfsound/xa.c 73 | plugins/dfxvideo/cfg.c 74 | plugins/dfxvideo/draw.c 75 | plugins/dfxvideo/fps.c 76 | plugins/dfxvideo/gpu.c 77 | [type: gettext/glade]plugins/dfxvideo/gpucfg-0.1df/dfxvideo.ui 78 | plugins/dfxvideo/key.c 79 | plugins/dfxvideo/menu.c 80 | plugins/dfxvideo/prim.c 81 | plugins/dfxvideo/soft.c 82 | plugins/dfxvideo/zn.c 83 | plugins/peopsxgl/cfg.c 84 | plugins/peopsxgl/draw.c 85 | plugins/peopsxgl/fps.c 86 | plugins/peopsxgl/gpu.c 87 | plugins/peopsxgl/gpucfg/main.c 88 | [type: gettext/glade]plugins/peopsxgl/gpucfg/peopsxgl.ui 89 | plugins/peopsxgl/key.c 90 | plugins/peopsxgl/menu.c 91 | plugins/peopsxgl/prim.c 92 | plugins/peopsxgl/soft.c 93 | plugins/peopsxgl/texture.c 94 | plugins/bladesio1/gui.c 95 | plugins/bladesio1/cfg.c 96 | plugins/bladesio1/sio1.c 97 | [type: gettext/glade]plugins/bladesio1/sio1.ui 98 | plugins/bladesio1/sio1.h 99 | win32/gui/AboutDlg.c 100 | win32/gui/CheatDlg.c 101 | win32/gui/ConfigurePlugins.c 102 | win32/gui/plugin.c 103 | win32/gui/WndMain.c 104 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/ppc/pasm.s: -------------------------------------------------------------------------------- 1 | 2 | #if defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__) || defined (__powerpc64__) || defined (__POWERPC__) 3 | 4 | #if defined (ELF) || defined (__linux__) 5 | #define C(label) label 6 | #else 7 | #define C(label) _##label 8 | #endif 9 | 10 | #define OLD_REGISTER_OFFSET (19*4) 11 | #define SP_SIZE (OLD_REGISTER_OFFSET+4+8) 12 | 13 | /*asm void recRun(register void (*func)(), register u32 hw1, register u32 hw2)*/ 14 | .text 15 | .align 4 16 | .globl C(recRun) 17 | C(recRun): 18 | /* prologue code */ 19 | mflr r0 20 | stmw r13, -(32-13)*4(r1) 21 | stw r0, 4(r1) 22 | stwu r1, -((32-13)*4+8)(r1) 23 | 24 | /* execute code */ 25 | mtctr r3 26 | mr r31, r4 27 | mr r30, r5 28 | bctrl 29 | /* 30 | } 31 | asm void returnPC() 32 | {*/ 33 | .text 34 | .align 4 35 | .globl C(returnPC) 36 | C(returnPC): 37 | // end code 38 | lwz r0, (32-13)*4+8+4(r1) 39 | addi r1, r1, (32-13)*4+8 40 | mtlr r0 41 | lmw r13, -(32-13)*4(r1) 42 | blr 43 | //}*/ 44 | 45 | // Memory functions that only works with a linear memory 46 | 47 | .text 48 | .align 4 49 | .globl C(dynMemRead8) 50 | C(dynMemRead8): 51 | // assumes that memory pointer is in r30 52 | addis r2,r3,-0x1f80 53 | srwi. r4,r2,16 54 | bne+ .norm8 55 | cmplwi r2,0x1000 56 | blt- .norm8 57 | b C(psxHwRead8) 58 | .norm8: 59 | clrlwi r5,r3,3 60 | lbzx r3,r5,r30 61 | blr 62 | 63 | .text 64 | .align 4 65 | .globl C(dynMemRead16) 66 | C(dynMemRead16): 67 | // assumes that memory pointer is in r30 68 | addis r2,r3,-0x1f80 69 | srwi. r4,r2,16 70 | bne+ .norm16 71 | cmplwi r2,0x1000 72 | blt- .norm16 73 | b C(psxHwRead16) 74 | .norm16: 75 | clrlwi r5,r3,3 76 | lhbrx r3,r5,r30 77 | blr 78 | 79 | .text 80 | .align 4 81 | .globl C(dynMemRead32) 82 | C(dynMemRead32): 83 | // assumes that memory pointer is in r30 84 | addis r2,r3,-0x1f80 85 | srwi. r4,r2,16 86 | bne+ .norm32 87 | cmplwi r2,0x1000 88 | blt- .norm32 89 | b C(psxHwRead32) 90 | .norm32: 91 | clrlwi r5,r3,3 92 | lwbrx r3,r5,r30 93 | blr 94 | 95 | /* 96 | N P Z 97 | 0 0 0 X 98 | - 0 0 1 X 99 | 1 0 0 X 100 | 1 0 1 X 101 | 102 | P | (!N & Z) 103 | P | !(N | !Z) 104 | */ 105 | 106 | .text 107 | .align 4 108 | .globl C(dynMemWrite32) 109 | C(dynMemWrite32): 110 | // assumes that memory pointer is in r30 111 | addis r2,r3,-0x1f80 112 | srwi. r5,r2,16 113 | bne+ .normw32 114 | cmplwi r2,0x1000 115 | blt .normw32 116 | b C(psxHwWrite32) 117 | .normw32: 118 | mtcrf 0xFF, r3 119 | clrlwi r5,r3,3 120 | crandc 0, 2, 0 121 | cror 2, 1, 0 122 | bne+ .okw32 123 | // write test 124 | li r2,0x0130 125 | addis r2,r2,0xfffe 126 | cmplw r3,r2 127 | bnelr 128 | .okw32: 129 | stwbrx r4,r5,r30 130 | blr 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/misc.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __MISC_H__ 21 | #define __MISC_H__ 22 | 23 | #include "psxcommon.h" 24 | #include "coff.h" 25 | #include "plugins.h" 26 | #include "r3000a.h" 27 | #include "psxmem.h" 28 | 29 | #undef s_addr 30 | 31 | typedef struct { 32 | unsigned char id[8]; 33 | u32 text; 34 | u32 data; 35 | u32 pc0; 36 | u32 gp0; 37 | u32 t_addr; 38 | u32 t_size; 39 | u32 d_addr; 40 | u32 d_size; 41 | u32 b_addr; 42 | u32 b_size; 43 | u32 s_addr; 44 | u32 s_size; 45 | u32 SavedSP; 46 | u32 SavedFP; 47 | u32 SavedGP; 48 | u32 SavedRA; 49 | u32 SavedS0; 50 | } EXE_HEADER; 51 | 52 | extern char CdromId[10]; 53 | extern char CdromLabel[33]; 54 | 55 | int LoadCdrom(); 56 | int LoadCdromFile(const char *filename, EXE_HEADER *head); 57 | int CheckCdrom(); 58 | int Load(const char *ExePath); 59 | 60 | int SaveState(const char *file); 61 | int SaveStateMem(const u32 id); 62 | int SaveStateGz(gzFile f, long* gzsize); 63 | int LoadState(const char *file); 64 | int LoadStateMem(const u32 id); 65 | int LoadStateGz(gzFile f); 66 | int CheckState(const char *file); 67 | 68 | int SendPcsxInfo(); 69 | int RecvPcsxInfo(); 70 | 71 | void CreateRewindState(); // Creates save state and stores it to volatile memory 72 | void RewindState(); // Restores state previously created with CreateRewindState(); 73 | void CleanupMemSaveStates(); // Removes all save states stored by memory funcs like CreateRewindState() 74 | 75 | void trim(char *str); 76 | u16 calcCrc(u8 *d, int len); 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /pcsxr/win32/zlib/inftrees.h: -------------------------------------------------------------------------------- 1 | /* inftrees.h -- header to use inftrees.c 2 | * Copyright (C) 1995-2005, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 0001eeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1444, which is the sum of 852 for literal/length codes and 592 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribtution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 30 6 15" for distance codes returns 592. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in inflate.c and infback.c. If the root table size is 47 | changed, then these maximum sizes would be need to be recalculated and 48 | updated. */ 49 | #define ENOUGH_LENS 852 50 | #define ENOUGH_DISTS 592 51 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 52 | 53 | /* Type of code to build for inflate_table() */ 54 | typedef enum { 55 | CODES, 56 | LENS, 57 | DISTS 58 | } codetype; 59 | 60 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, 61 | unsigned codes, code FAR * FAR *table, 62 | unsigned FAR *bits, unsigned short FAR *work)); 63 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/coff.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1995 3 | * Ted Lemon (hereinafter referred to as the author) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 | * SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef __ECOFF_H__ 30 | #define __ECOFF_H__ 31 | 32 | /* 33 | * Some ECOFF definitions. 34 | */ 35 | typedef struct filehdr { 36 | u16 f_magic; /* magic number */ 37 | u16 f_nscns; /* number of sections */ 38 | u32 f_timdat; /* time & date stamp */ 39 | u32 f_symptr; /* file pointer to symbolic header */ 40 | u32 f_nsyms; /* sizeof(symbolic hdr) */ 41 | u16 f_opthdr; /* sizeof(optional hdr) */ 42 | u16 f_flags; /* flags */ 43 | } FILHDR; 44 | 45 | typedef struct scnhdr { 46 | char s_name[8]; /* section name */ 47 | u32 s_paddr; /* physical address, aliased s_nlib */ 48 | u32 s_vaddr; /* virtual address */ 49 | u32 s_size; /* section size */ 50 | u32 s_scnptr; /* file ptr to raw data for section */ 51 | u32 s_relptr; /* file ptr to relocation */ 52 | u32 s_lnnoptr; /* file ptr to gp histogram */ 53 | u16 s_nreloc; /* number of relocation entries */ 54 | u16 s_nlnno; /* number of gp histogram entries */ 55 | u32 s_flags; /* flags */ 56 | } SCNHDR; 57 | 58 | typedef struct aouthdr { 59 | u16 magic; /* magic */ 60 | u16 vstamp; /* version stamp */ 61 | u32 tsize; /* text size in bytes, padded to DW bdry */ 62 | u32 dsize; /* initialized data */ 63 | u32 bsize; /* uninitialized data */ 64 | u32 entry; /* entry pt. */ 65 | u32 text_start; /* base of text used for this file */ 66 | u32 data_start; /* base of data used for this file */ 67 | } AOUTHDR; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/psxhw.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __PSXHW_H__ 21 | #define __PSXHW_H__ 22 | 23 | #include "psxcommon.h" 24 | #include "r3000a.h" 25 | #include "psxmem.h" 26 | #include "sio.h" 27 | #include "psxcounters.h" 28 | 29 | #define HW_DMA0_MADR (psxHu32ref(0x1080)) // MDEC in DMA 30 | #define HW_DMA0_BCR (psxHu32ref(0x1084)) 31 | #define HW_DMA0_CHCR (psxHu32ref(0x1088)) 32 | 33 | #define HW_DMA1_MADR (psxHu32ref(0x1090)) // MDEC out DMA 34 | #define HW_DMA1_BCR (psxHu32ref(0x1094)) 35 | #define HW_DMA1_CHCR (psxHu32ref(0x1098)) 36 | 37 | #define HW_DMA2_MADR (psxHu32ref(0x10a0)) // GPU DMA 38 | #define HW_DMA2_BCR (psxHu32ref(0x10a4)) 39 | #define HW_DMA2_CHCR (psxHu32ref(0x10a8)) 40 | 41 | #define HW_DMA3_MADR (psxHu32ref(0x10b0)) // CDROM DMA 42 | #define HW_DMA3_BCR (psxHu32ref(0x10b4)) 43 | #define HW_DMA3_CHCR (psxHu32ref(0x10b8)) 44 | 45 | #define HW_DMA4_MADR (psxHu32ref(0x10c0)) // SPU DMA 46 | #define HW_DMA4_BCR (psxHu32ref(0x10c4)) 47 | #define HW_DMA4_CHCR (psxHu32ref(0x10c8)) 48 | 49 | #define HW_DMA6_MADR (psxHu32ref(0x10e0)) // GPU DMA (OT) 50 | #define HW_DMA6_BCR (psxHu32ref(0x10e4)) 51 | #define HW_DMA6_CHCR (psxHu32ref(0x10e8)) 52 | 53 | #define HW_DMA_PCR (psxHu32ref(0x10f0)) 54 | #define HW_DMA_ICR (psxHu32ref(0x10f4)) 55 | 56 | #define DMA_INTERRUPT(n) \ 57 | if (SWAPu32(HW_DMA_ICR) & (1 << (16 + n))) { \ 58 | HW_DMA_ICR |= SWAP32(1 << (24 + n)); \ 59 | psxHu32ref(0x1070) |= SWAP32(8); \ 60 | } 61 | 62 | void psxHwReset(); 63 | u8 psxHwRead8(u32 add); 64 | u16 psxHwRead16(u32 add); 65 | u32 psxHwRead32(u32 add); 66 | void psxHwWrite8(u32 add, u8 value); 67 | void psxHwWrite16(u32 add, u16 value); 68 | void psxHwWrite32(u32 add, u32 value); 69 | int psxHwFreeze(gzFile f, int Mode); 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/psxhle.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | /* 21 | * Internal PSX HLE functions. 22 | */ 23 | 24 | #include "psxhle.h" 25 | 26 | static void hleDummy() { 27 | psxRegs.pc = psxRegs.GPR.n.ra; 28 | 29 | psxBranchTest(); 30 | } 31 | 32 | static void hleA0() { 33 | u32 call = psxRegs.GPR.n.t1 & 0xff; 34 | 35 | if (biosA0[call]) biosA0[call](); 36 | 37 | psxBranchTest(); 38 | } 39 | 40 | static void hleB0() { 41 | u32 call = psxRegs.GPR.n.t1 & 0xff; 42 | 43 | if (biosB0[call]) biosB0[call](); 44 | 45 | psxBranchTest(); 46 | } 47 | 48 | static void hleC0() { 49 | u32 call = psxRegs.GPR.n.t1 & 0xff; 50 | 51 | if (biosC0[call]) biosC0[call](); 52 | 53 | psxBranchTest(); 54 | } 55 | 56 | static void hleBootstrap() { // 0xbfc00000 57 | SysPrintf("hleBootstrap\n"); 58 | CheckCdrom(); 59 | LoadCdrom(); 60 | SysPrintf("CdromLabel: \"%s\": PC = %8.8x (SP = %8.8x)\n", CdromLabel, (unsigned int)psxRegs.pc, (unsigned int)psxRegs.GPR.n.sp); 61 | } 62 | 63 | typedef struct { 64 | u32 _pc0; 65 | u32 gp0; 66 | u32 t_addr; 67 | u32 t_size; 68 | u32 d_addr; 69 | u32 d_size; 70 | u32 b_addr; 71 | u32 b_size; 72 | u32 S_addr; 73 | u32 s_size; 74 | u32 _sp,_fp,_gp,ret,base; 75 | } EXEC; 76 | 77 | static void hleExecRet() { 78 | EXEC *header = (EXEC*)PSXM(psxRegs.GPR.n.s0); 79 | 80 | SysPrintf("ExecRet %x: %x\n", psxRegs.GPR.n.s0, header->ret); 81 | 82 | psxRegs.GPR.n.ra = header->ret; 83 | psxRegs.GPR.n.sp = header->_sp; 84 | psxRegs.GPR.n.s8 = header->_fp; 85 | psxRegs.GPR.n.gp = header->_gp; 86 | psxRegs.GPR.n.s0 = header->base; 87 | 88 | psxRegs.GPR.n.v0 = 1; 89 | psxRegs.pc = psxRegs.GPR.n.ra; 90 | } 91 | 92 | void (*psxHLEt[256])() = { 93 | hleDummy, hleA0, hleB0, hleC0, 94 | hleBootstrap, hleExecRet, 95 | hleDummy, hleDummy 96 | }; 97 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/psxdma.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __PSXDMA_H__ 21 | #define __PSXDMA_H__ 22 | 23 | #include "psxcommon.h" 24 | #include "r3000a.h" 25 | #include "psxhw.h" 26 | #include "psxmem.h" 27 | 28 | #define GPUDMA_INT(eCycle) { \ 29 | psxRegs.interrupt |= (1 << PSXINT_GPUDMA); \ 30 | psxRegs.intCycle[PSXINT_GPUDMA].cycle = eCycle; \ 31 | psxRegs.intCycle[PSXINT_GPUDMA].sCycle = psxRegs.cycle; \ 32 | } 33 | 34 | #define SPUDMA_INT(eCycle) { \ 35 | psxRegs.interrupt |= (1 << PSXINT_SPUDMA); \ 36 | psxRegs.intCycle[PSXINT_SPUDMA].cycle = eCycle; \ 37 | psxRegs.intCycle[PSXINT_SPUDMA].sCycle = psxRegs.cycle; \ 38 | } 39 | 40 | #define MDECOUTDMA_INT(eCycle) { \ 41 | psxRegs.interrupt |= (1 << PSXINT_MDECOUTDMA); \ 42 | psxRegs.intCycle[PSXINT_MDECOUTDMA].cycle = eCycle; \ 43 | psxRegs.intCycle[PSXINT_MDECOUTDMA].sCycle = psxRegs.cycle; \ 44 | } 45 | 46 | #define MDECINDMA_INT(eCycle) { \ 47 | psxRegs.interrupt |= (1 << PSXINT_MDECINDMA); \ 48 | psxRegs.intCycle[PSXINT_MDECINDMA].cycle = eCycle; \ 49 | psxRegs.intCycle[PSXINT_MDECINDMA].sCycle = psxRegs.cycle; \ 50 | } 51 | 52 | #define GPUOTCDMA_INT(eCycle) { \ 53 | psxRegs.interrupt |= (1 << PSXINT_GPUOTCDMA); \ 54 | psxRegs.intCycle[PSXINT_GPUOTCDMA].cycle = eCycle; \ 55 | psxRegs.intCycle[PSXINT_GPUOTCDMA].sCycle = psxRegs.cycle; \ 56 | } 57 | 58 | #define CDRDMA_INT(eCycle) { \ 59 | psxRegs.interrupt |= (1 << PSXINT_CDRDMA); \ 60 | psxRegs.intCycle[PSXINT_CDRDMA].cycle = eCycle; \ 61 | psxRegs.intCycle[PSXINT_CDRDMA].sCycle = psxRegs.cycle; \ 62 | } 63 | 64 | /* 65 | DMA5 = N/A (PIO) 66 | */ 67 | 68 | void psxDma3(u32 madr, u32 bcr, u32 chcr); 69 | void psxDma4(u32 madr, u32 bcr, u32 chcr); 70 | void psxDma6(u32 madr, u32 bcr, u32 chcr); 71 | void spuInterrupt(); 72 | void mdec0Interrupt(); 73 | void gpuotcInterrupt(); 74 | void cdrDmaInterrupt(); 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/gettext.h: -------------------------------------------------------------------------------- 1 | /* Internal header for GNU gettext internationalization functions. 2 | Copyright (C) 1995, 1997 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public 15 | License along with this program; see the file COPYING. If not, 16 | write to the Free Software Foundation, Inc., 51 Franklin Street, 17 | Fifth Floor, Boston, MA 02110-1301 USA. */ 18 | 19 | #ifndef _GETTEXT_H 20 | #define _GETTEXT_H 1 21 | 22 | #include 23 | 24 | #if HAVE_LIMITS_H || _LIBC 25 | # include 26 | #endif 27 | 28 | /* @@ end of prolog @@ */ 29 | 30 | /* The magic number of the GNU message catalog format. */ 31 | #define _MAGIC 0x950412de 32 | #define _MAGIC_SWAPPED 0xde120495 33 | 34 | /* Revision number of the currently used .mo (binary) file format. */ 35 | #define MO_REVISION_NUMBER 0 36 | 37 | /* The following contortions are an attempt to use the C preprocessor 38 | to determine an unsigned integral type that is 32 bits wide. An 39 | alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but 40 | doing that would require that the configure script compile and *run* 41 | the resulting executable. Locally running cross-compiled executables 42 | is usually not possible. */ 43 | 44 | #if __STDC__ 45 | # define UINT_MAX_32_BITS 4294967295U 46 | #else 47 | # define UINT_MAX_32_BITS 0xFFFFFFFF 48 | #endif 49 | 50 | /* If UINT_MAX isn't defined, assume it's a 32-bit type. 51 | This should be valid for all systems GNU cares about because 52 | that doesn't include 16-bit systems, and only modern systems 53 | (that certainly have ) have 64+-bit integral types. */ 54 | 55 | #ifndef UINT_MAX 56 | # define UINT_MAX UINT_MAX_32_BITS 57 | #endif 58 | 59 | #if UINT_MAX == UINT_MAX_32_BITS 60 | typedef unsigned nls_uint32; 61 | #else 62 | # if USHRT_MAX == UINT_MAX_32_BITS 63 | typedef unsigned short nls_uint32; 64 | # else 65 | # if ULONG_MAX == UINT_MAX_32_BITS 66 | typedef unsigned long nls_uint32; 67 | # else 68 | /* The following line is intended to throw an error. Using #error is 69 | not portable enough. */ 70 | "Cannot determine unsigned 32-bit data type." 71 | # endif 72 | # endif 73 | #endif 74 | 75 | 76 | /* Header for binary .mo file format. */ 77 | struct mo_file_header 78 | { 79 | /* The magic number. */ 80 | nls_uint32 magic; 81 | /* The revision number of the file format. */ 82 | nls_uint32 revision; 83 | /* The number of strings pairs. */ 84 | nls_uint32 nstrings; 85 | /* Offset of table with start offsets of original strings. */ 86 | nls_uint32 orig_tab_offset; 87 | /* Offset of table with start offsets of translation strings. */ 88 | nls_uint32 trans_tab_offset; 89 | /* Size of hashing table. */ 90 | nls_uint32 hash_tab_size; 91 | /* Offset of first hashing entry. */ 92 | nls_uint32 hash_tab_offset; 93 | }; 94 | 95 | struct string_desc 96 | { 97 | /* Length of addressed string. */ 98 | nls_uint32 length; 99 | /* Offset of string in file. */ 100 | nls_uint32 offset; 101 | }; 102 | 103 | /* @@ begin of epilog @@ */ 104 | 105 | #endif /* gettext.h */ 106 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/textdomain.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the textdomain(3) function. 2 | Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 | Written by Ulrich Drepper , 1995. 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software Foundation, 17 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ 18 | 19 | #include "intlconfig.h" 20 | 21 | #if defined STDC_HEADERS || defined _LIBC 22 | # include 23 | #endif 24 | 25 | #if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC 26 | # include 27 | #else 28 | # include 29 | # ifndef memcpy 30 | # define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) 31 | # endif 32 | #endif 33 | 34 | #ifdef _LIBC 35 | # include 36 | #else 37 | # include "libgettext.h" 38 | #endif 39 | 40 | /* @@ end of prolog @@ */ 41 | 42 | /* Name of the default text domain. */ 43 | extern const char _nl_default_default_domain[]; 44 | 45 | /* Default text domain in which entries for gettext(3) are to be found. */ 46 | extern const char *_nl_current_default_domain; 47 | 48 | 49 | /* Names for the libintl functions are a problem. They must not clash 50 | with existing names and they should follow ANSI C. But this source 51 | code is also used in GNU C Library where the names have a __ 52 | prefix. So we have to make a difference here. */ 53 | #ifdef _LIBC 54 | # define TEXTDOMAIN __textdomain 55 | # ifndef strdup 56 | # define strdup(str) __strdup (str) 57 | # endif 58 | #else 59 | # define TEXTDOMAIN textdomain__ 60 | #endif 61 | 62 | /* Set the current default message catalog to DOMAINNAME. 63 | If DOMAINNAME is null, return the current default. 64 | If DOMAINNAME is "", reset to the default of "messages". */ 65 | char * 66 | TEXTDOMAIN (domainname) 67 | const char *domainname; 68 | { 69 | char *old; 70 | 71 | /* A NULL pointer requests the current setting. */ 72 | if (domainname == NULL) 73 | return (char *) _nl_current_default_domain; 74 | 75 | old = (char *) _nl_current_default_domain; 76 | 77 | /* If domain name is the null string set to default domain "messages". */ 78 | if (domainname[0] == '\0' 79 | || strcmp (domainname, _nl_default_default_domain) == 0) 80 | _nl_current_default_domain = _nl_default_default_domain; 81 | else 82 | { 83 | /* If the following malloc fails `_nl_current_default_domain' 84 | will be NULL. This value will be returned and so signals we 85 | are out of core. */ 86 | #if defined _LIBC || defined HAVE_STRDUP 87 | _nl_current_default_domain = strdup (domainname); 88 | #else 89 | size_t len = strlen (domainname) + 1; 90 | char *cp = (char *) malloc (len); 91 | if (cp != NULL) 92 | memcpy (cp, domainname, len); 93 | _nl_current_default_domain = cp; 94 | #endif 95 | } 96 | 97 | if (old != _nl_default_default_domain) 98 | free (old); 99 | 100 | return (char *) _nl_current_default_domain; 101 | } 102 | 103 | #ifdef _LIBC 104 | /* Alias for function name in GNU C Library. */ 105 | weak_alias (__textdomain, textdomain); 106 | #endif 107 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/cheat.h: -------------------------------------------------------------------------------- 1 | /* Cheat Support for PCSX-Reloaded 2 | * Copyright (C) 2009, Wei Mingzhi . 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef CHEAT_H 20 | #define CHEAT_H 21 | 22 | #define all_extension_cht "*.cht" 23 | #define dot_extension_cht ".cht" 24 | #define tla_extension_cht "cht" 25 | 26 | typedef struct { 27 | uint32_t Addr; 28 | uint16_t Val; 29 | } CheatCode; 30 | 31 | typedef struct { 32 | char *Descr; 33 | int First; // index of the first cheat code 34 | int n; // number of cheat codes for this cheat 35 | int Enabled; 36 | } Cheat; 37 | 38 | void ClearAllCheats(); 39 | 40 | void LoadCheats(const char *filename); 41 | void SaveCheats(const char *filename); 42 | 43 | void ApplyCheats(); 44 | 45 | int AddCheat(const char *descr, char *code); 46 | void RemoveCheat(int index); 47 | int EditCheat(int index, const char *descr, char *code); 48 | 49 | void FreeCheatSearchResults(); 50 | void FreeCheatSearchMem(); 51 | void CheatSearchBackupMemory(); 52 | 53 | void CheatSearchEqual8(u8 val); 54 | void CheatSearchEqual16(u16 val); 55 | void CheatSearchEqual32(u32 val); 56 | void CheatSearchNotEqual8(u8 val); 57 | void CheatSearchNotEqual16(u16 val); 58 | void CheatSearchNotEqual32(u32 val); 59 | void CheatSearchRange8(u8 min, u8 max); 60 | void CheatSearchRange16(u16 min, u16 max); 61 | void CheatSearchRange32(u32 min, u32 max); 62 | void CheatSearchIncreasedBy8(u8 val); 63 | void CheatSearchIncreasedBy16(u16 val); 64 | void CheatSearchIncreasedBy32(u32 val); 65 | void CheatSearchDecreasedBy8(u8 val); 66 | void CheatSearchDecreasedBy16(u16 val); 67 | void CheatSearchDecreasedBy32(u32 val); 68 | void CheatSearchIncreased8(); 69 | void CheatSearchIncreased16(); 70 | void CheatSearchIncreased32(); 71 | void CheatSearchDecreased8(); 72 | void CheatSearchDecreased16(); 73 | void CheatSearchDecreased32(); 74 | void CheatSearchDifferent8(); 75 | void CheatSearchDifferent16(); 76 | void CheatSearchDifferent32(); 77 | void CheatSearchNoChange8(); 78 | void CheatSearchNoChange16(); 79 | void CheatSearchNoChange32(); 80 | 81 | extern Cheat *Cheats; 82 | extern CheatCode *CheatCodes; 83 | extern int NumCheats; 84 | extern int NumCodes; 85 | 86 | extern s8 *prevM; 87 | extern u32 *SearchResults; 88 | extern int NumSearchResults; 89 | 90 | #define PREVM(mem) (&prevM[mem]) 91 | #define PrevMu8(mem) (*(u8 *)PREVM(mem)) 92 | #define PrevMu16(mem) (SWAP16(*(u16 *)PREVM(mem))) 93 | #define PrevMu32(mem) (SWAP32(*(u32 *)PREVM(mem))) 94 | 95 | // cheat types 96 | #define CHEAT_CONST8 0x30 /* 8-bit Constant Write */ 97 | #define CHEAT_CONST16 0x80 /* 16-bit Constant Write */ 98 | #define CHEAT_INC16 0x10 /* 16-bit Increment */ 99 | #define CHEAT_DEC16 0x11 /* 16-bit Decrement */ 100 | #define CHEAT_INC8 0x20 /* 8-bit Increment */ 101 | #define CHEAT_DEC8 0x21 /* 8-bit Decrement */ 102 | #define CHEAT_SLIDE 0x50 /* Slide Codes */ 103 | #define CHEAT_MEMCPY 0xC2 /* Memory Copy */ 104 | 105 | #define CHEAT_EQU8 0xE0 /* 8-bit Equal To */ 106 | #define CHEAT_NOTEQU8 0xE1 /* 8-bit Not Equal To */ 107 | #define CHEAT_LESSTHAN8 0xE2 /* 8-bit Less Than */ 108 | #define CHEAT_GREATERTHAN8 0xE3 /* 8-bit Greater Than */ 109 | #define CHEAT_EQU16 0xD0 /* 16-bit Equal To */ 110 | #define CHEAT_NOTEQU16 0xD1 /* 16-bit Not Equal To */ 111 | #define CHEAT_LESSTHAN16 0xD2 /* 16-bit Less Than */ 112 | #define CHEAT_GREATERTHAN16 0xD3 /* 16-bit Greater Than */ 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/ix86_64/ix86_3dnow.c: -------------------------------------------------------------------------------- 1 | // stop compiling if NORECBUILD build (only for Visual Studio) 2 | #if !(defined(_MSC_VER) && defined(PCSX2_NORECBUILD)) 3 | 4 | #include "ix86-64.h" 5 | 6 | /**********************/ 7 | /* 3DNOW instructions */ 8 | /**********************/ 9 | 10 | /* femms */ 11 | void FEMMS( void ) 12 | { 13 | write16( 0x0E0F ); 14 | } 15 | 16 | void PFCMPEQMtoR( x86IntRegType to, uptr from ) 17 | { 18 | MEMADDR_OP(0, VAROP2(0x0F, 0x0F), true, to, from, 1); 19 | write8( 0xB0 ); 20 | } 21 | 22 | void PFCMPGTMtoR( x86IntRegType to, uptr from ) 23 | { 24 | MEMADDR_OP(0, VAROP2(0x0F, 0x0F), true, to, from, 1); 25 | write8( 0xA0 ); 26 | } 27 | 28 | void PFCMPGEMtoR( x86IntRegType to, uptr from ) 29 | { 30 | MEMADDR_OP(0, VAROP2(0x0F, 0x0F), true, to, from, 1); 31 | write8( 0x90 ); 32 | } 33 | 34 | void PFADDMtoR( x86IntRegType to, uptr from ) 35 | { 36 | MEMADDR_OP(0, VAROP2(0x0F, 0x0F), true, to, from, 1); 37 | write8( 0x9E ); 38 | } 39 | 40 | void PFADDRtoR( x86IntRegType to, x86IntRegType from ) 41 | { 42 | RexRB(0, to, from); 43 | write16( 0x0F0F ); 44 | ModRM( 3, to, from ); 45 | write8( 0x9E ); 46 | } 47 | 48 | void PFSUBMtoR( x86IntRegType to, uptr from ) 49 | { 50 | MEMADDR_OP(0, VAROP2(0x0F, 0x0F), true, to, from, 1); 51 | write8( 0x9A ); 52 | } 53 | 54 | void PFSUBRtoR( x86IntRegType to, x86IntRegType from ) 55 | { 56 | RexRB(0, to, from); 57 | write16( 0x0F0F ); 58 | ModRM( 3, to, from ); 59 | write8( 0x9A ); 60 | } 61 | 62 | void PFMULMtoR( x86IntRegType to, uptr from ) 63 | { 64 | MEMADDR_OP(0, VAROP2(0x0F, 0x0F), true, to, from, 1); 65 | write8( 0xB4 ); 66 | } 67 | 68 | void PFMULRtoR( x86IntRegType to, x86IntRegType from ) 69 | { 70 | RexRB(0, to, from); 71 | write16( 0x0F0F ); 72 | ModRM( 3, to, from ); 73 | write8( 0xB4 ); 74 | } 75 | 76 | void PFRCPMtoR( x86IntRegType to, uptr from ) 77 | { 78 | MEMADDR_OP(0, VAROP2(0x0F, 0x0F), true, to, from, 1); 79 | write8( 0x96 ); 80 | } 81 | 82 | void PFRCPRtoR( x86IntRegType to, x86IntRegType from ) 83 | { 84 | RexRB(0, to, from); 85 | write16( 0x0F0F ); 86 | ModRM( 3, to, from ); 87 | write8( 0x96 ); 88 | } 89 | 90 | void PFRCPIT1RtoR( x86IntRegType to, x86IntRegType from ) 91 | { 92 | RexRB(0, to, from); 93 | write16( 0x0F0F ); 94 | ModRM( 3, to, from ); 95 | write8( 0xA6 ); 96 | } 97 | 98 | void PFRCPIT2RtoR( x86IntRegType to, x86IntRegType from ) 99 | { 100 | RexRB(0, to, from); 101 | write16( 0x0F0F ); 102 | ModRM( 3, to, from ); 103 | write8( 0xB6 ); 104 | } 105 | 106 | void PFRSQRTRtoR( x86IntRegType to, x86IntRegType from ) 107 | { 108 | RexRB(0, to, from); 109 | write16( 0x0F0F ); 110 | ModRM( 3, to, from ); 111 | write8( 0x97 ); 112 | } 113 | 114 | void PFRSQIT1RtoR( x86IntRegType to, x86IntRegType from ) 115 | { 116 | RexRB(0, to, from); 117 | write16( 0x0F0F ); 118 | ModRM( 3, to, from ); 119 | write8( 0xA7 ); 120 | } 121 | 122 | void PF2IDMtoR( x86IntRegType to, uptr from ) 123 | { 124 | MEMADDR_OP(0, VAROP2(0x0F, 0x0F), true, to, from, 1); 125 | write8( 0x1D ); 126 | } 127 | 128 | void PF2IDRtoR( x86IntRegType to, x86IntRegType from ) 129 | { 130 | RexRB(0, to, from); 131 | write16( 0x0F0F ); 132 | ModRM( 3, to, from ); 133 | write8( 0x1D ); 134 | } 135 | 136 | void PI2FDMtoR( x86IntRegType to, uptr from ) 137 | { 138 | MEMADDR_OP(0, VAROP2(0x0F, 0x0F), true, to, from, 1); 139 | write8( 0x0D ); 140 | } 141 | 142 | void PI2FDRtoR( x86IntRegType to, x86IntRegType from ) 143 | { 144 | RexRB(0, to, from); 145 | write16( 0x0F0F ); 146 | ModRM( 3, to, from ); 147 | write8( 0x0D ); 148 | } 149 | 150 | void PFMAXMtoR( x86IntRegType to, uptr from ) 151 | { 152 | MEMADDR_OP(0, VAROP2(0x0F, 0x0F), true, to, from, 1); 153 | write8( 0xA4 ); 154 | } 155 | 156 | void PFMAXRtoR( x86IntRegType to, x86IntRegType from ) 157 | { 158 | RexRB(0, to, from); 159 | write16( 0x0F0F ); 160 | ModRM( 3, to, from ); 161 | write8( 0xA4 ); 162 | } 163 | 164 | void PFMINMtoR( x86IntRegType to, uptr from ) 165 | { 166 | MEMADDR_OP(0, VAROP2(0x0F, 0x0F), true, to, from, 1); 167 | write8( 0x94 ); 168 | } 169 | 170 | void PFMINRtoR( x86IntRegType to, x86IntRegType from ) 171 | { 172 | RexRB(0, to, from); 173 | write16( 0x0F0F ); 174 | ModRM( 3, to, from ); 175 | write8( 0x94 ); 176 | } 177 | 178 | #endif 179 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/cdrom.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __CDROM_H__ 21 | #define __CDROM_H__ 22 | 23 | #include "psxcommon.h" 24 | #include "decode_xa.h" 25 | #include "r3000a.h" 26 | #include "plugins.h" 27 | #include "psxmem.h" 28 | #include "psxhw.h" 29 | #include "psxcommon.h" 30 | 31 | #define btoi(b) ((b) / 16 * 10 + (b) % 16) /* BCD to u_char */ 32 | #define itob(i) ((i) / 10 * 16 + (i) % 10) /* u_char to BCD */ 33 | 34 | #define MSF2SECT(m, s, f) (((m) * 60 + (s) - 2) * 75 + (f)) 35 | 36 | #define CD_FRAMESIZE_RAW 2352 37 | #define DATA_SIZE (CD_FRAMESIZE_RAW - 12) 38 | 39 | #define SUB_FRAMESIZE 96 40 | 41 | typedef struct { 42 | unsigned char OCUP; 43 | unsigned char Reg1Mode; 44 | unsigned char Reg2; 45 | unsigned char CmdProcess; 46 | unsigned char Ctrl; 47 | unsigned char Stat; 48 | 49 | unsigned char StatP; 50 | 51 | unsigned char Transfer[CD_FRAMESIZE_RAW]; 52 | unsigned int transferIndex; 53 | 54 | unsigned char Prev[4]; 55 | unsigned char Param[8]; 56 | unsigned char Result[16]; 57 | 58 | unsigned char ParamC; 59 | unsigned char ParamP; 60 | unsigned char ResultC; 61 | unsigned char ResultP; 62 | unsigned char ResultReady; 63 | unsigned char Cmd; 64 | unsigned char Readed; 65 | unsigned char SetlocPending; 66 | u32 Reading; 67 | 68 | unsigned char ResultTN[6]; 69 | unsigned char ResultTD[4]; 70 | unsigned char SetSectorPlay[4]; 71 | unsigned char SetSectorEnd[4]; 72 | unsigned char SetSector[4]; 73 | unsigned char Track; 74 | boolean Play, Muted; 75 | int CurTrack; 76 | int Mode, File, Channel; 77 | int Reset; 78 | int RErr; 79 | int FirstSector; 80 | 81 | xa_decode_t Xa; 82 | 83 | int Init; 84 | 85 | u16 Irq; 86 | u8 IrqRepeated; 87 | u32 eCycle; 88 | 89 | u8 Seeked; 90 | u8 ReadRescheduled; 91 | 92 | u8 DriveState; 93 | u8 FastForward; 94 | u8 FastBackward; 95 | 96 | u8 AttenuatorLeftToLeft, AttenuatorLeftToRight; 97 | u8 AttenuatorRightToRight, AttenuatorRightToLeft; 98 | u8 AttenuatorLeftToLeftT, AttenuatorLeftToRightT; 99 | u8 AttenuatorRightToRightT, AttenuatorRightToLeftT; 100 | 101 | struct { 102 | unsigned char Track; 103 | unsigned char Index; 104 | unsigned char Relative[3]; 105 | unsigned char Absolute[3]; 106 | } subq; 107 | unsigned char TrackChanged; 108 | } cdrStruct; 109 | 110 | extern cdrStruct cdr; 111 | 112 | void cdrReset(); 113 | void cdrAttenuate(s16 *buf, int samples, int stereo); 114 | 115 | void cdrInterrupt(); 116 | void cdrReadInterrupt(); 117 | void cdrDecodedBufferInterrupt(); 118 | void cdrLidSeekInterrupt(); 119 | void cdrPlayInterrupt(); 120 | void cdrDmaInterrupt(); 121 | void LidInterrupt(); 122 | unsigned char cdrRead0(void); 123 | unsigned char cdrRead1(void); 124 | unsigned char cdrRead2(void); 125 | unsigned char cdrRead3(void); 126 | void cdrWrite0(unsigned char rt); 127 | void cdrWrite1(unsigned char rt); 128 | void cdrWrite2(unsigned char rt); 129 | void cdrWrite3(unsigned char rt); 130 | int cdrFreeze(gzFile f, int Mode); 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /pcsxr/gui/AboutDlg.c: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2002 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include "Linux.h" 20 | #include 21 | 22 | #define ABOUT_VERSION "svn" 23 | 24 | void RunAboutDialog(void) { 25 | GtkBuilder *builder; 26 | GtkWidget *AboutDlg; 27 | 28 | const gchar *authors[] = { 29 | "PCSX-Reloaded Team:", 30 | "edgbla ", 31 | "shalma", 32 | "Wei Mingzhi ", 33 | "", 34 | "Contributors:", 35 | "Benoît Gschwind", 36 | "Dario", 37 | "Firnis", 38 | "Gabriele Gorla", 39 | "Hopkat", 40 | "Peter Collingbourne", 41 | "Tristin Celestin", 42 | "(See the included AUTHORS file for more details.)", 43 | "", 44 | "PCSX-df Team:", 45 | "Ryan Schultz ", 46 | "Andrew Burton ", 47 | "Stephen Chao ", 48 | "Stefan Sikora ", 49 | "", 50 | "PCSX Team:", 51 | "Linuzappz ", 52 | "Shadow", 53 | "Pete Bernert", 54 | "NoComp", 55 | "Nik3d", 56 | NULL 57 | }; 58 | 59 | const gchar *artists[] = { 60 | "Ryan Schultz ", 61 | "Romain Lafourcade", 62 | "perchibald", 63 | NULL 64 | }; 65 | 66 | const gchar *documenters[] = { 67 | "Ryan Schultz ", 68 | NULL 69 | }; 70 | 71 | const gchar *copyright = N_( 72 | "(C) 1999-2003 PCSX Team\n" 73 | "(C) 2005-2009 PCSX-df Team\n" 74 | "(C) 2009-2014 PCSX-Reloaded Team"); 75 | 76 | const gchar *license = N_( 77 | "This program is free software: you can redistribute it and/or modify " 78 | "it under the terms of the GNU General Public License as published by " 79 | "the Free Software Foundation, either version 3 of the License, or " 80 | "(at your option) any later version.\n" 81 | "\n" 82 | "This program is distributed in the hope that it will be useful, " 83 | "but WITHOUT ANY WARRANTY; without even the implied warranty of " 84 | "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " 85 | "GNU General Public License for more details.\n" 86 | "\n" 87 | "You should have received a copy of the GNU General Public License " 88 | "along with this program. If not, see ."); 89 | 90 | builder = gtk_builder_new(); 91 | 92 | if (!gtk_builder_add_from_file(builder, PACKAGE_DATA_DIR "pcsxr.ui", NULL)) { 93 | g_warning("Error: interface could not be loaded!"); 94 | return; 95 | } 96 | 97 | AboutDlg = GTK_WIDGET(gtk_builder_get_object(builder, "AboutDlg")); 98 | 99 | gtk_window_set_title(GTK_WINDOW(AboutDlg), _("About")); 100 | gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(AboutDlg), "PCSX-Reloaded"); 101 | gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(AboutDlg), ABOUT_VERSION); 102 | gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(AboutDlg), "http://pcsxr.codeplex.com/"); 103 | gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(AboutDlg), "http://pcsxr.codeplex.com/"); 104 | gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(AboutDlg), authors); 105 | gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(AboutDlg), _(copyright)); 106 | gtk_about_dialog_set_documenters(GTK_ABOUT_DIALOG(AboutDlg), documenters); 107 | gtk_about_dialog_set_artists(GTK_ABOUT_DIALOG(AboutDlg), artists); 108 | gtk_about_dialog_set_translator_credits(GTK_ABOUT_DIALOG(AboutDlg), _("translator-credits")); 109 | gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG (AboutDlg), _("A PlayStation emulator.")); 110 | gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(AboutDlg), _(license)); 111 | gtk_about_dialog_set_wrap_license(GTK_ABOUT_DIALOG(AboutDlg), TRUE); 112 | 113 | gtk_dialog_run(GTK_DIALOG(AboutDlg)); 114 | gtk_widget_destroy(AboutDlg); 115 | 116 | g_object_unref(builder); 117 | } 118 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/psxdma.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | /* 21 | * Handles PSX DMA functions. 22 | */ 23 | 24 | #include "psxdma.h" 25 | 26 | // Dma0/1 in Mdec.c 27 | // Dma3 in CdRom.c 28 | 29 | void spuInterrupt() { 30 | HW_DMA4_CHCR &= SWAP32(~0x01000000); 31 | DMA_INTERRUPT(4); 32 | } 33 | 34 | void psxDma4(u32 madr, u32 bcr, u32 chcr) { // SPU 35 | u16 *ptr; 36 | u32 size; 37 | 38 | switch (chcr) { 39 | case 0x01000201: //cpu to spu transfer 40 | #ifdef PSXDMA_LOG 41 | PSXDMA_LOG("*** DMA4 SPU - mem2spu *** %x addr = %x size = %x\n", chcr, madr, bcr); 42 | #endif 43 | ptr = (u16 *)PSXM(madr); 44 | if (ptr == NULL) { 45 | #ifdef PSXDMA_LOG 46 | PSXDMA_LOG("*** DMA4 SPU - mem2spu *** NULL Pointer!!!\n"); 47 | #endif 48 | break; 49 | } 50 | SPU_writeDMAMem(ptr, (bcr >> 16) * (bcr & 0xffff) * 2); 51 | 52 | // Jungle Book - max 0.333x DMA length 53 | // Harry Potter and the Philosopher's Stone - max 0.5x DMA length 54 | //u32 dmalen=64 + ((bcr >> 18) * (bcr & 0xffff)); // less linear to DMA length which should work with both games above? 55 | SPUDMA_INT((bcr >> 16) * (bcr & 0xffff) / 2); 56 | return; 57 | 58 | case 0x01000200: //spu to cpu transfer 59 | #ifdef PSXDMA_LOG 60 | PSXDMA_LOG("*** DMA4 SPU - spu2mem *** %x addr = %x size = %x\n", chcr, madr, bcr); 61 | #endif 62 | ptr = (u16 *)PSXM(madr); 63 | if (ptr == NULL) { 64 | #ifdef PSXDMA_LOG 65 | PSXDMA_LOG("*** DMA4 SPU - spu2mem *** NULL Pointer!!!\n"); 66 | #endif 67 | break; 68 | } 69 | size = (bcr >> 16) * (bcr & 0xffff) * 2; 70 | SPU_readDMAMem(ptr, size); 71 | psxCpu->Clear(madr, size); 72 | 73 | #if 1 74 | SPUDMA_INT((bcr >> 16) * (bcr & 0xffff) / 2); 75 | #else 76 | // Experimental burst dma transfer (0.333x max) 77 | SPUDMA_INT((bcr >> 16) * (bcr & 0xffff) / 3); 78 | #endif 79 | return; 80 | 81 | #ifdef PSXDMA_LOG 82 | default: 83 | PSXDMA_LOG("*** DMA4 SPU - unknown *** %x addr = %x size = %x\n", chcr, madr, bcr); 84 | break; 85 | #endif 86 | } 87 | 88 | HW_DMA4_CHCR &= SWAP32(~0x01000000); 89 | DMA_INTERRUPT(4); 90 | } 91 | 92 | 93 | void psxDma6(u32 madr, u32 bcr, u32 chcr) { 94 | u32 size; 95 | u32 *mem = (u32 *)PSXM(madr); 96 | 97 | #ifdef PSXDMA_LOG 98 | PSXDMA_LOG("*** DMA6 OT *** %x addr = %x size = %x\n", chcr, madr, bcr); 99 | #endif 100 | 101 | if (chcr == 0x11000002) { 102 | if (mem == NULL) { 103 | #ifdef PSXDMA_LOG 104 | PSXDMA_LOG("*** DMA6 OT *** NULL Pointer!!!\n"); 105 | #endif 106 | HW_DMA6_CHCR &= SWAP32(~0x01000000); 107 | DMA_INTERRUPT(6); 108 | return; 109 | } 110 | 111 | // already 32-bit size 112 | size = bcr; 113 | 114 | while (bcr--) { 115 | *mem-- = SWAP32((madr - 4) & 0xffffff); 116 | madr -= 4; 117 | } 118 | mem++; *mem = 0xffffff; 119 | 120 | #if 1 121 | GPUOTCDMA_INT( size ); 122 | #else 123 | // Experimental burst dma transfer (0.333x max) 124 | GPUOTCDMA_INT( size/3 ); 125 | #endif 126 | return; 127 | } 128 | #ifdef PSXDMA_LOG 129 | else { 130 | // Unknown option 131 | PSXDMA_LOG("*** DMA6 OT - unknown *** %x addr = %x size = %x\n", chcr, madr, bcr); 132 | } 133 | #endif 134 | 135 | HW_DMA6_CHCR &= SWAP32(~0x01000000); 136 | DMA_INTERRUPT(6); 137 | } 138 | 139 | void gpuotcInterrupt() 140 | { 141 | HW_DMA6_CHCR &= SWAP32(~0x01000000); 142 | DMA_INTERRUPT(6); 143 | } 144 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/libintl.h: -------------------------------------------------------------------------------- 1 | /* This file is part of a Windows32 DLL Interface to: 2 | GNU gettext - internationalization aids 3 | Copyright (C) 1996, 1998 Free Software Foundation, Inc. 4 | 5 | This file was written by Franco Bez 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU Lesser General Public License as published by 9 | the Free Software Foundation; either version 2, or (at your option) 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ 20 | 21 | /* REPLACEMENT FOR ORIGINAL LIBINTL.H for use with Windows32 */ 22 | 23 | #if !defined(__LIBINTL_H_INCLUDED) 24 | #define __LIBINTL_H_INCLUDED 25 | 26 | #if defined(__cplusplus) 27 | extern "C" { 28 | #endif 29 | 30 | /* See if we allready know what we want static or dll linkage or none at all*/ 31 | #if defined DONT_USE_GETTEXT || ( defined USE_SAFE_GETTEXT_DLL && defined USE_GETTEXT_STATIC ) || ( defined USE_GETTEXT_DLL && defined USE_SAFE_GETTEXT_DLL ) || ( defined USE_GETTEXT_DLL && defined USE_GETTEXT_STATIC ) 32 | /* TWO IS HARDLY POSSIBLE */ 33 | #undef USE_GETTEXT_DLL 34 | #undef USE_GETTEXT_STATIC 35 | #undef USE_SAFE_GETTEXT_DLL 36 | #endif /* MORE THAN ONE - OR NONE AT ALL */ 37 | 38 | #if !defined USE_GETTEXT_DLL && !defined USE_SAFE_GETTEXT_DLL && !defined USE_GETTEXT_STATIC && !defined DONT_USE_GETTEXT 39 | /* not explicitly defined so try to guess it - 40 | if GNUC is used - we use static linkage by default 41 | because at the moment this is the only plattform 42 | for which a static lib is available 43 | else we use the DLL built with GNUC */ 44 | # define USE_GETTEXT_STATIC 45 | #endif /* NONE */ 46 | 47 | /* NOW ONLY ONE OF 48 | DONT_USE_GETTEXT , USE_GETTEXT_DLL , USE_SAFE_GETTEXT_DLL , USE_GETTEXT_STATIC 49 | IS DEFINED */ 50 | 51 | #if defined USE_GETTEXT_DLL 52 | /* exported functions in DLL gnu_gettext.dll 53 | you should link with import library 54 | -lgnu_gettext (for mingw32) OR gnu_gettext.lib (MSVC) */ 55 | __declspec(dllimport) char *gettext(const char *__msgid); 56 | __declspec(dllimport) char *dgettext(const char *__domainname,const char *__msgid); 57 | __declspec(dllimport) char *dcgettext(const char *__domainname,const char *__msgid, int __category); 58 | __declspec(dllimport) char *textdomain(const char *__domainname); 59 | __declspec(dllimport) char *bindtextdomain(const char *__domainname,const char *__dirname); 60 | /* calling _putenv from within the DLL */ 61 | __declspec(dllexport) int gettext_putenv(const char *envstring); 62 | #endif /* DLL */ 63 | 64 | #if defined USE_SAFE_GETTEXT_DLL 65 | /* Uses DLL gnu_gettext.dll ONLY if present, otherwise NO translation will take place 66 | you should link with "safe_gettext_dll.o -lstdc++" see README for safe_gettext_dll for Details */ 67 | /* The safe gettext functions */ 68 | extern char *gettext(const char *szMsgId); 69 | extern char *dgettext(const char *szDomain,const char *szMsgId); 70 | extern char *dcgettext(const char *szDomain,const char *szMsgId,int iCategory); 71 | extern char *textdomain(const char *szDomain); 72 | extern char *bindtextdomain(const char *szDomain,const char *szDirectory); 73 | /* calling _putenv from within the DLL */ 74 | extern int gettext_putenv(const char *envstring); 75 | #endif /* SAFE DLL */ 76 | 77 | #if defined USE_GETTEXT_STATIC 78 | /* exported functions in static library libintl.a 79 | and supporting macros 80 | you should link with -lintl (mingw32) */ 81 | extern char *gettext__(const char *__msgid); 82 | extern char *dgettext__(const char *__domainname,const char *__msgid); 83 | extern char *dcgettext__(const char *__domainname,const char *__msgid, int __category); 84 | extern char *textdomain__(const char *__domainname); 85 | extern char *bindtextdomain__(const char *__domainname,const char *__dirname); 86 | #define gettext(szMsgId) gettext__(szMsgId) 87 | #define dgettext(szDomain,szMsgId) dgettext__(szDomain,szMsgId) 88 | #define dcgettext(szDomain,szMsgId,iCategory) dcgettext__(szDomain,szMsgId,iCategory) 89 | #define textdomain(szDomain) textdomain__(szDomain) 90 | #define bindtextdomain(szDomain,szDirectory) bindtextdomain__(szDomain,szDirectory) 91 | // dummy - for static linkage - calling _putenv from within the DLL 92 | #define gettext_putenv(a) _putenv(a) 93 | #endif /* STATIC */ 94 | 95 | #if defined DONT_USE_GETTEXT 96 | /* DON'T USE GETTEXT AT ALL 97 | MAKROS TO MAKE CODE COMPILE WELL, BUT GETTEXT WILL NOT BE USESD 98 | */ 99 | # define gettext(Msgid) (Msgid) 100 | # define dgettext(Domainname, Msgid) (Msgid) 101 | # define dcgettext(Domainname, Msgid, Category) (Msgid) 102 | # define textdomain(Domainname) ((char *) Domainname) 103 | # define bindtextdomain(Domainname, Dirname) ((char *) Dirname) 104 | // dummy - for static linkage - calling _putenv from within the DLL 105 | # define gettext_putenv(a) _putenv(a) 106 | #endif /* DON'T USE AT ALL */ 107 | 108 | #if defined(__cplusplus) 109 | } /* extern "C" */ 110 | #endif 111 | 112 | #endif /*!defined(__LIBINTL_H_INCLUDED)*/ 113 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/explodename.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 2 | Contributed by Ulrich Drepper , 1995. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software Foundation, 16 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 | 18 | #include "intlconfig.h" 19 | 20 | #if defined STDC_HEADERS || defined _LIBC 21 | # include 22 | #endif 23 | 24 | #if defined HAVE_STRING_H || defined _LIBC 25 | # include 26 | #else 27 | # include 28 | #endif 29 | #include 30 | 31 | #include "loadinfo.h" 32 | 33 | /* On some strange systems still no definition of NULL is found. Sigh! */ 34 | #ifndef NULL 35 | # if defined __STDC__ && __STDC__ 36 | # define NULL ((void *) 0) 37 | # else 38 | # define NULL 0 39 | # endif 40 | #endif 41 | 42 | /* @@ end of prolog @@ */ 43 | 44 | int 45 | _nl_explode_name (name, language, modifier, territory, codeset, 46 | normalized_codeset, special, sponsor, revision) 47 | char *name; 48 | const char **language; 49 | const char **modifier; 50 | const char **territory; 51 | const char **codeset; 52 | const char **normalized_codeset; 53 | const char **special; 54 | const char **sponsor; 55 | const char **revision; 56 | { 57 | enum { undecided, xpg, cen } syntax; 58 | char *cp; 59 | int mask; 60 | 61 | *modifier = NULL; 62 | *territory = NULL; 63 | *codeset = NULL; 64 | *normalized_codeset = NULL; 65 | *special = NULL; 66 | *sponsor = NULL; 67 | *revision = NULL; 68 | 69 | /* Now we determine the single parts of the locale name. First 70 | look for the language. Termination symbols are `_' and `@' if 71 | we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ 72 | mask = 0; 73 | syntax = undecided; 74 | *language = cp = name; 75 | while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@' 76 | && cp[0] != '+' && cp[0] != ',') 77 | ++cp; 78 | 79 | if (*language == cp) 80 | /* This does not make sense: language has to be specified. Use 81 | this entry as it is without exploding. Perhaps it is an alias. */ 82 | cp = strchr (*language, '\0'); 83 | else if (cp[0] == '_') 84 | { 85 | /* Next is the territory. */ 86 | cp[0] = '\0'; 87 | *territory = ++cp; 88 | 89 | while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@' 90 | && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') 91 | ++cp; 92 | 93 | mask |= TERRITORY; 94 | 95 | if (cp[0] == '.') 96 | { 97 | /* Next is the codeset. */ 98 | syntax = xpg; 99 | cp[0] = '\0'; 100 | *codeset = ++cp; 101 | 102 | while (cp[0] != '\0' && cp[0] != '@') 103 | ++cp; 104 | 105 | mask |= XPG_CODESET; 106 | 107 | if (*codeset != cp && (*codeset)[0] != '\0') 108 | { 109 | *normalized_codeset = _nl_normalize_codeset (*codeset, 110 | cp - *codeset); 111 | if (strcmp (*codeset, *normalized_codeset) == 0) 112 | free ((char *) *normalized_codeset); 113 | else 114 | mask |= XPG_NORM_CODESET; 115 | } 116 | } 117 | } 118 | 119 | if (cp[0] == '@' || (syntax != xpg && cp[0] == '+')) 120 | { 121 | /* Next is the modifier. */ 122 | syntax = cp[0] == '@' ? xpg : cen; 123 | cp[0] = '\0'; 124 | *modifier = ++cp; 125 | 126 | while (syntax == cen && cp[0] != '\0' && cp[0] != '+' 127 | && cp[0] != ',' && cp[0] != '_') 128 | ++cp; 129 | 130 | mask |= XPG_MODIFIER | CEN_AUDIENCE; 131 | } 132 | 133 | if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_')) 134 | { 135 | syntax = cen; 136 | 137 | if (cp[0] == '+') 138 | { 139 | /* Next is special application (CEN syntax). */ 140 | cp[0] = '\0'; 141 | *special = ++cp; 142 | 143 | while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_') 144 | ++cp; 145 | 146 | mask |= CEN_SPECIAL; 147 | } 148 | 149 | if (cp[0] == ',') 150 | { 151 | /* Next is sponsor (CEN syntax). */ 152 | cp[0] = '\0'; 153 | *sponsor = ++cp; 154 | 155 | while (cp[0] != '\0' && cp[0] != '_') 156 | ++cp; 157 | 158 | mask |= CEN_SPONSOR; 159 | } 160 | 161 | if (cp[0] == '_') 162 | { 163 | /* Next is revision (CEN syntax). */ 164 | cp[0] = '\0'; 165 | *revision = ++cp; 166 | 167 | mask |= CEN_REVISION; 168 | } 169 | } 170 | 171 | /* For CEN syntax values it might be important to have the 172 | separator character in the file name, not for XPG syntax. */ 173 | if (syntax == xpg) 174 | { 175 | if (*territory != NULL && (*territory)[0] == '\0') 176 | mask &= ~TERRITORY; 177 | 178 | if (*codeset != NULL && (*codeset)[0] == '\0') 179 | mask &= ~XPG_CODESET; 180 | 181 | if (*modifier != NULL && (*modifier)[0] == '\0') 182 | mask &= ~XPG_MODIFIER; 183 | } 184 | 185 | return mask; 186 | } 187 | -------------------------------------------------------------------------------- /pcsxr/win32/zlib/adler32.c: -------------------------------------------------------------------------------- 1 | /* adler32.c -- compute the Adler-32 checksum of a data stream 2 | * Copyright (C) 1995-2011 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #include "zutil.h" 9 | 10 | #define local static 11 | 12 | local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); 13 | 14 | #define BASE 65521 /* largest prime smaller than 65536 */ 15 | #define NMAX 5552 16 | /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ 17 | 18 | #define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} 19 | #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); 20 | #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); 21 | #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); 22 | #define DO16(buf) DO8(buf,0); DO8(buf,8); 23 | 24 | /* use NO_DIVIDE if your processor does not do division in hardware -- 25 | try it both ways to see which is faster */ 26 | #ifdef NO_DIVIDE 27 | /* note that this assumes BASE is 65521, where 65536 % 65521 == 15 28 | (thank you to John Reiser for pointing this out) */ 29 | # define CHOP(a) \ 30 | do { \ 31 | unsigned long tmp = a >> 16; \ 32 | a &= 0xffffUL; \ 33 | a += (tmp << 4) - tmp; \ 34 | } while (0) 35 | # define MOD28(a) \ 36 | do { \ 37 | CHOP(a); \ 38 | if (a >= BASE) a -= BASE; \ 39 | } while (0) 40 | # define MOD(a) \ 41 | do { \ 42 | CHOP(a); \ 43 | MOD28(a); \ 44 | } while (0) 45 | # define MOD63(a) \ 46 | do { /* this assumes a is not negative */ \ 47 | z_off64_t tmp = a >> 32; \ 48 | a &= 0xffffffffL; \ 49 | a += (tmp << 8) - (tmp << 5) + tmp; \ 50 | tmp = a >> 16; \ 51 | a &= 0xffffL; \ 52 | a += (tmp << 4) - tmp; \ 53 | tmp = a >> 16; \ 54 | a &= 0xffffL; \ 55 | a += (tmp << 4) - tmp; \ 56 | if (a >= BASE) a -= BASE; \ 57 | } while (0) 58 | #else 59 | # define MOD(a) a %= BASE 60 | # define MOD28(a) a %= BASE 61 | # define MOD63(a) a %= BASE 62 | #endif 63 | 64 | /* ========================================================================= */ 65 | uLong ZEXPORT adler32(adler, buf, len) 66 | uLong adler; 67 | const Bytef *buf; 68 | uInt len; 69 | { 70 | unsigned long sum2; 71 | unsigned n; 72 | 73 | /* split Adler-32 into component sums */ 74 | sum2 = (adler >> 16) & 0xffff; 75 | adler &= 0xffff; 76 | 77 | /* in case user likes doing a byte at a time, keep it fast */ 78 | if (len == 1) { 79 | adler += buf[0]; 80 | if (adler >= BASE) 81 | adler -= BASE; 82 | sum2 += adler; 83 | if (sum2 >= BASE) 84 | sum2 -= BASE; 85 | return adler | (sum2 << 16); 86 | } 87 | 88 | /* initial Adler-32 value (deferred check for len == 1 speed) */ 89 | if (buf == Z_NULL) 90 | return 1L; 91 | 92 | /* in case short lengths are provided, keep it somewhat fast */ 93 | if (len < 16) { 94 | while (len--) { 95 | adler += *buf++; 96 | sum2 += adler; 97 | } 98 | if (adler >= BASE) 99 | adler -= BASE; 100 | MOD28(sum2); /* only added so many BASE's */ 101 | return adler | (sum2 << 16); 102 | } 103 | 104 | /* do length NMAX blocks -- requires just one modulo operation */ 105 | while (len >= NMAX) { 106 | len -= NMAX; 107 | n = NMAX / 16; /* NMAX is divisible by 16 */ 108 | do { 109 | DO16(buf); /* 16 sums unrolled */ 110 | buf += 16; 111 | } while (--n); 112 | MOD(adler); 113 | MOD(sum2); 114 | } 115 | 116 | /* do remaining bytes (less than NMAX, still just one modulo) */ 117 | if (len) { /* avoid modulos if none remaining */ 118 | while (len >= 16) { 119 | len -= 16; 120 | DO16(buf); 121 | buf += 16; 122 | } 123 | while (len--) { 124 | adler += *buf++; 125 | sum2 += adler; 126 | } 127 | MOD(adler); 128 | MOD(sum2); 129 | } 130 | 131 | /* return recombined sums */ 132 | return adler | (sum2 << 16); 133 | } 134 | 135 | /* ========================================================================= */ 136 | local uLong adler32_combine_(adler1, adler2, len2) 137 | uLong adler1; 138 | uLong adler2; 139 | z_off64_t len2; 140 | { 141 | unsigned long sum1; 142 | unsigned long sum2; 143 | unsigned rem; 144 | 145 | /* for negative len, return invalid adler32 as a clue for debugging */ 146 | if (len2 < 0) 147 | return 0xffffffffUL; 148 | 149 | /* the derivation of this formula is left as an exercise for the reader */ 150 | MOD63(len2); /* assumes len2 >= 0 */ 151 | rem = (unsigned)len2; 152 | sum1 = adler1 & 0xffff; 153 | sum2 = rem * sum1; 154 | MOD(sum2); 155 | sum1 += (adler2 & 0xffff) + BASE - 1; 156 | sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; 157 | if (sum1 >= BASE) sum1 -= BASE; 158 | if (sum1 >= BASE) sum1 -= BASE; 159 | if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1); 160 | if (sum2 >= BASE) sum2 -= BASE; 161 | return sum1 | (sum2 << 16); 162 | } 163 | 164 | /* ========================================================================= */ 165 | uLong ZEXPORT adler32_combine(adler1, adler2, len2) 166 | uLong adler1; 167 | uLong adler2; 168 | z_off_t len2; 169 | { 170 | return adler32_combine_(adler1, adler2, len2); 171 | } 172 | 173 | uLong ZEXPORT adler32_combine64(adler1, adler2, len2) 174 | uLong adler1; 175 | uLong adler2; 176 | z_off64_t len2; 177 | { 178 | return adler32_combine_(adler1, adler2, len2); 179 | } 180 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/gpu.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010, shalma. 2 | * Portions Copyright (c) 2002, Pete Bernert. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include "psxhw.h" 20 | #include "gpu.h" 21 | #include "psxdma.h" 22 | 23 | #define GPUSTATUS_ODDLINES 0x80000000 24 | #define GPUSTATUS_DMABITS 0x60000000 // Two bits 25 | #define GPUSTATUS_READYFORCOMMANDS 0x10000000 // DMA block ready 26 | #define GPUSTATUS_READYFORVRAM 0x08000000 27 | #define GPUSTATUS_IDLE 0x04000000 // CMD ready 28 | #define GPUSTATUS_MODE 0x02000000 // Data request mode 29 | 30 | #define GPUSTATUS_DISPLAYDISABLED 0x00800000 31 | #define GPUSTATUS_INTERLACED 0x00400000 32 | #define GPUSTATUS_RGB24 0x00200000 33 | #define GPUSTATUS_PAL 0x00100000 34 | #define GPUSTATUS_DOUBLEHEIGHT 0x00080000 35 | #define GPUSTATUS_WIDTHBITS 0x00070000 // Three bits 36 | #define GPUSTATUS_MASKENABLED 0x00001000 37 | #define GPUSTATUS_MASKDRAWN 0x00000800 38 | #define GPUSTATUS_DRAWINGALLOWED 0x00000400 39 | #define GPUSTATUS_DITHER 0x00000200 40 | 41 | // Taken from PEOPS SOFTGPU 42 | u32 lUsedAddr[3]; 43 | 44 | static inline boolean CheckForEndlessLoop(u32 laddr) { 45 | if (laddr == lUsedAddr[1]) return TRUE; 46 | if (laddr == lUsedAddr[2]) return TRUE; 47 | 48 | if (laddr < lUsedAddr[0]) lUsedAddr[1] = laddr; 49 | else lUsedAddr[2] = laddr; 50 | 51 | lUsedAddr[0] = laddr; 52 | 53 | return FALSE; 54 | } 55 | 56 | static u32 gpuDmaChainSize(u32 addr) { 57 | u32 size; 58 | u32 DMACommandCounter = 0; 59 | 60 | lUsedAddr[0] = lUsedAddr[1] = lUsedAddr[2] = 0xffffff; 61 | 62 | // initial linked list ptr (word) 63 | size = 1; 64 | 65 | do { 66 | addr &= 0x1ffffc; 67 | 68 | if (DMACommandCounter++ > 2000000) break; 69 | if (CheckForEndlessLoop(addr)) break; 70 | 71 | 72 | // # 32-bit blocks to transfer 73 | size += psxMu8( addr + 3 ); 74 | 75 | 76 | // next 32-bit pointer 77 | addr = psxMu32( addr & ~0x3 ) & 0xffffff; 78 | size += 1; 79 | } while (addr != 0xffffff); 80 | 81 | 82 | return size; 83 | } 84 | 85 | int gpuReadStatus() { 86 | int hard; 87 | 88 | 89 | // GPU plugin 90 | hard = GPU_readStatus(); 91 | 92 | 93 | // Gameshark Lite - wants to see VRAM busy 94 | // - Must enable GPU 'Fake Busy States' hack 95 | if( (hard & GPUSTATUS_IDLE) == 0 ) 96 | hard &= ~GPUSTATUS_READYFORVRAM; 97 | 98 | return hard; 99 | } 100 | 101 | void psxDma2(u32 madr, u32 bcr, u32 chcr) { // GPU 102 | u32 *ptr; 103 | u32 size, bs; 104 | 105 | switch (chcr) { 106 | case 0x01000200: // vram2mem 107 | #ifdef PSXDMA_LOG 108 | PSXDMA_LOG("*** DMA2 GPU - vram2mem *** %lx addr = %lx size = %lx\n", chcr, madr, bcr); 109 | #endif 110 | ptr = (u32 *)PSXM(madr); 111 | if (ptr == NULL) { 112 | #ifdef PSXDMA_LOG 113 | PSXDMA_LOG("*** DMA2 GPU - vram2mem *** NULL Pointer!!!\n"); 114 | #endif 115 | break; 116 | } 117 | // BA blocks * BS words (word = 32-bits) 118 | size = (bcr >> 16) * (bcr & 0xffff); 119 | GPU_readDataMem(ptr, size); 120 | psxCpu->Clear(madr, size); 121 | 122 | #if 1 123 | // already 32-bit word size ((size * 4) / 4) 124 | GPUDMA_INT(size); 125 | #else 126 | // Experimental burst dma transfer (0.333x max) 127 | GPUDMA_INT(size/3); 128 | #endif 129 | return; 130 | 131 | case 0x01000201: // mem2vram 132 | bs=(bcr & 0xffff); 133 | size = (bcr >> 16) * bs; // BA blocks * BS words (word = 32-bits) 134 | #ifdef PSXDMA_LOG 135 | PSXDMA_LOG("*** DMA 2 - GPU mem2vram *** %lx addr = %lxh, BCR %lxh => size %d = BA(%d) * BS(%xh)\n", 136 | chcr, madr, bcr, size, size / bs, size / (bcr >> 16)); 137 | #endif 138 | ptr = (u32 *)PSXM(madr); 139 | if (ptr == NULL) { 140 | #ifdef PSXDMA_LOG 141 | PSXDMA_LOG("*** DMA2 GPU - mem2vram *** NULL Pointer!!!\n"); 142 | #endif 143 | break; 144 | } 145 | GPU_writeDataMem(ptr, size); 146 | 147 | #if 0 148 | // already 32-bit word size ((size * 4) / 4) 149 | GPUDMA_INT(size); 150 | #else 151 | // X-Files video interlace. Experimental delay depending of BS. 152 | GPUDMA_INT( (7 * size) / bs ); 153 | #endif 154 | return; 155 | 156 | case 0x00000401: // Vampire Hunter D: title screen linked list update (see psxhw.c) 157 | case 0x01000401: // dma chain 158 | #ifdef PSXDMA_LOG 159 | PSXDMA_LOG("*** DMA 2 - GPU dma chain *** %8.8lx addr = %lx size = %lx\n", chcr, madr, bcr); 160 | #endif 161 | 162 | size = gpuDmaChainSize(madr); 163 | GPU_dmaChain((u32 *)psxM, madr & 0x1fffff); 164 | 165 | // Tekken 3 = use 1.0 only (not 1.5x) 166 | 167 | // Einhander = parse linked list in pieces (todo) 168 | // Final Fantasy 4 = internal vram time (todo) 169 | // Rebel Assault 2 = parse linked list in pieces (todo) 170 | // Vampire Hunter D = allow edits to linked list (todo) 171 | GPUDMA_INT(size); 172 | return; 173 | 174 | #ifdef PSXDMA_LOG 175 | default: 176 | PSXDMA_LOG("*** DMA 2 - GPU unknown *** %lx addr = %lx size = %lx\n", chcr, madr, bcr); 177 | break; 178 | #endif 179 | } 180 | 181 | HW_DMA2_CHCR &= SWAP32(~0x01000000); 182 | DMA_INTERRUPT(2); 183 | } 184 | 185 | void gpuInterrupt() { 186 | HW_DMA2_CHCR &= SWAP32(~0x01000000); 187 | DMA_INTERRUPT(2); 188 | } 189 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/ix86_64/ix86_fpu.c: -------------------------------------------------------------------------------- 1 | // stop compiling if NORECBUILD build (only for Visual Studio) 2 | 3 | #ifdef __x86_64__ 4 | 5 | #if !(defined(_MSC_VER) && defined(PCSX2_NORECBUILD)) 6 | 7 | #include 8 | #include 9 | #include "ix86-64.h" 10 | 11 | /********************/ 12 | /* FPU instructions */ 13 | /********************/ 14 | 15 | /* fild m32 to fpu reg stack */ 16 | void FILD32( uptr from ) 17 | { 18 | MEMADDR_OP(0, VAROP1(0xDB), false, 0, from, 0); 19 | } 20 | 21 | /* fistp m32 from fpu reg stack */ 22 | void FISTP32( uptr from ) 23 | { 24 | MEMADDR_OP(0, VAROP1(0xDB), false, 3, from, 0); 25 | } 26 | 27 | /* fld m32 to fpu reg stack */ 28 | void FLD32( uptr from ) 29 | { 30 | MEMADDR_OP(0, VAROP1(0xD9), false, 0, from, 0); 31 | } 32 | 33 | // fld st(i) 34 | void FLD(int st) { write16(0xc0d9+(st<<8)); } 35 | 36 | void FLD1() { write16(0xe8d9); } 37 | void FLDL2E() { write16(0xead9); } 38 | 39 | /* fst m32 from fpu reg stack */ 40 | void FST32( uptr to ) 41 | { 42 | MEMADDR_OP(0, VAROP1(0xD9), false, 2, to, 0); 43 | } 44 | 45 | /* fstp m32 from fpu reg stack */ 46 | void FSTP32( uptr to ) 47 | { 48 | MEMADDR_OP(0, VAROP1(0xD9), false, 3, to, 0); 49 | } 50 | 51 | // fstp st(i) 52 | void FSTP(int st) { write16(0xd8dd+(st<<8)); } 53 | 54 | /* fldcw fpu control word from m16 */ 55 | void FLDCW( uptr from ) 56 | { 57 | MEMADDR_OP(0, VAROP1(0xD9), false, 5, from, 0); 58 | } 59 | 60 | /* fnstcw fpu control word to m16 */ 61 | void FNSTCW( uptr to ) 62 | { 63 | MEMADDR_OP(0, VAROP1(0xD9), false, 7, to, 0); 64 | } 65 | 66 | void FNSTSWtoAX( void ) 67 | { 68 | write16( 0xE0DF ); 69 | } 70 | 71 | void FXAM() 72 | { 73 | write16(0xe5d9); 74 | } 75 | 76 | void FDECSTP() { write16(0xf6d9); } 77 | void FRNDINT() { write16(0xfcd9); } 78 | void FXCH(int st) { write16(0xc8d9+(st<<8)); } 79 | void F2XM1() { write16(0xf0d9); } 80 | void FSCALE() { write16(0xfdd9); } 81 | 82 | /* fadd ST(src) to fpu reg stack ST(0) */ 83 | void FADD32Rto0( x86IntRegType src ) 84 | { 85 | write8( 0xD8 ); 86 | write8( 0xC0 + src ); 87 | } 88 | 89 | /* fadd ST(0) to fpu reg stack ST(src) */ 90 | void FADD320toR( x86IntRegType src ) 91 | { 92 | write8( 0xDC ); 93 | write8( 0xC0 + src ); 94 | } 95 | 96 | /* fsub ST(src) to fpu reg stack ST(0) */ 97 | void FSUB32Rto0( x86IntRegType src ) 98 | { 99 | write8( 0xD8 ); 100 | write8( 0xE0 + src ); 101 | } 102 | 103 | /* fsub ST(0) to fpu reg stack ST(src) */ 104 | void FSUB320toR( x86IntRegType src ) 105 | { 106 | write8( 0xDC ); 107 | write8( 0xE8 + src ); 108 | } 109 | 110 | /* fsubp -> substract ST(0) from ST(1), store in ST(1) and POP stack */ 111 | void FSUBP( void ) 112 | { 113 | write8( 0xDE ); 114 | write8( 0xE9 ); 115 | } 116 | 117 | /* fmul ST(src) to fpu reg stack ST(0) */ 118 | void FMUL32Rto0( x86IntRegType src ) 119 | { 120 | write8( 0xD8 ); 121 | write8( 0xC8 + src ); 122 | } 123 | 124 | /* fmul ST(0) to fpu reg stack ST(src) */ 125 | void FMUL320toR( x86IntRegType src ) 126 | { 127 | write8( 0xDC ); 128 | write8( 0xC8 + src ); 129 | } 130 | 131 | /* fdiv ST(src) to fpu reg stack ST(0) */ 132 | void FDIV32Rto0( x86IntRegType src ) 133 | { 134 | write8( 0xD8 ); 135 | write8( 0xF0 + src ); 136 | } 137 | 138 | /* fdiv ST(0) to fpu reg stack ST(src) */ 139 | void FDIV320toR( x86IntRegType src ) 140 | { 141 | write8( 0xDC ); 142 | write8( 0xF8 + src ); 143 | } 144 | 145 | void FDIV320toRP( x86IntRegType src ) 146 | { 147 | write8( 0xDE ); 148 | write8( 0xF8 + src ); 149 | } 150 | 151 | /* fadd m32 to fpu reg stack */ 152 | void FADD32( uptr from ) 153 | { 154 | MEMADDR_OP(0, VAROP1(0xD8), false, 0, from, 0); 155 | } 156 | 157 | /* fsub m32 to fpu reg stack */ 158 | void FSUB32( uptr from ) 159 | { 160 | MEMADDR_OP(0, VAROP1(0xD8), false, 4, from, 0); 161 | } 162 | 163 | /* fmul m32 to fpu reg stack */ 164 | void FMUL32( uptr from ) 165 | { 166 | MEMADDR_OP(0, VAROP1(0xD8), false, 1, from, 0); 167 | } 168 | 169 | /* fdiv m32 to fpu reg stack */ 170 | void FDIV32( uptr from ) 171 | { 172 | MEMADDR_OP(0, VAROP1(0xD8), false, 6, from, 0); 173 | } 174 | 175 | /* fabs fpu reg stack */ 176 | void FABS( void ) 177 | { 178 | write16( 0xE1D9 ); 179 | } 180 | 181 | /* fsqrt fpu reg stack */ 182 | void FSQRT( void ) 183 | { 184 | write16( 0xFAD9 ); 185 | } 186 | 187 | void FPATAN(void) { write16(0xf3d9); } 188 | void FSIN(void) { write16(0xfed9); } 189 | 190 | /* fchs fpu reg stack */ 191 | void FCHS( void ) 192 | { 193 | write16( 0xE0D9 ); 194 | } 195 | 196 | /* fcomi st, st(i) */ 197 | void FCOMI( x86IntRegType src ) 198 | { 199 | write8( 0xDB ); 200 | write8( 0xF0 + src ); 201 | } 202 | 203 | /* fcomip st, st(i) */ 204 | void FCOMIP( x86IntRegType src ) 205 | { 206 | write8( 0xDF ); 207 | write8( 0xF0 + src ); 208 | } 209 | 210 | /* fucomi st, st(i) */ 211 | void FUCOMI( x86IntRegType src ) 212 | { 213 | write8( 0xDB ); 214 | write8( 0xE8 + src ); 215 | } 216 | 217 | /* fucomip st, st(i) */ 218 | void FUCOMIP( x86IntRegType src ) 219 | { 220 | write8( 0xDF ); 221 | write8( 0xE8 + src ); 222 | } 223 | 224 | /* fcom m32 to fpu reg stack */ 225 | void FCOM32( uptr from ) 226 | { 227 | MEMADDR_OP(0, VAROP1(0xD8), false, 2, from, 0); 228 | } 229 | 230 | /* fcomp m32 to fpu reg stack */ 231 | void FCOMP32( uptr from ) 232 | { 233 | MEMADDR_OP(0, VAROP1(0xD8), false, 3, from, 0); 234 | } 235 | 236 | #define FCMOV32( low, high ) \ 237 | { \ 238 | write8( low ); \ 239 | write8( high + from ); \ 240 | } 241 | 242 | void FCMOVB32( x86IntRegType from ) { FCMOV32( 0xDA, 0xC0 ); } 243 | void FCMOVE32( x86IntRegType from ) { FCMOV32( 0xDA, 0xC8 ); } 244 | void FCMOVBE32( x86IntRegType from ) { FCMOV32( 0xDA, 0xD0 ); } 245 | void FCMOVU32( x86IntRegType from ) { FCMOV32( 0xDA, 0xD8 ); } 246 | void FCMOVNB32( x86IntRegType from ) { FCMOV32( 0xDB, 0xC0 ); } 247 | void FCMOVNE32( x86IntRegType from ) { FCMOV32( 0xDB, 0xC8 ); } 248 | void FCMOVNBE32( x86IntRegType from ) { FCMOV32( 0xDB, 0xD0 ); } 249 | void FCMOVNU32( x86IntRegType from ) { FCMOV32( 0xDB, 0xD8 ); } 250 | 251 | #endif 252 | 253 | #endif 254 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/psxcommon.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | /* 21 | * This file contains common definitions and includes for all parts of the 22 | * emulator core. 23 | */ 24 | 25 | #ifndef __PSXCOMMON_H__ 26 | #define __PSXCOMMON_H__ 27 | 28 | #include "config.h" 29 | 30 | // System includes 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | // Define types 44 | typedef int8_t s8; 45 | typedef int16_t s16; 46 | typedef int32_t s32; 47 | typedef int64_t s64; 48 | typedef intptr_t sptr; 49 | 50 | typedef uint8_t u8; 51 | typedef uint16_t u16; 52 | typedef uint32_t u32; 53 | typedef uint64_t u64; 54 | typedef uintptr_t uptr; 55 | 56 | typedef uint8_t boolean; 57 | 58 | #ifndef TRUE 59 | #define TRUE 1 60 | #endif 61 | 62 | #ifndef FALSE 63 | #define FALSE 0 64 | #endif 65 | 66 | // Local includes 67 | #include "system.h" 68 | #include "debug.h" 69 | 70 | #if defined (__LINUX__) || defined (__MACOSX__) 71 | #define strnicmp strncasecmp 72 | #endif 73 | #define __inline inline 74 | 75 | // Enables NLS/internationalization if active 76 | #ifdef ENABLE_NLS 77 | 78 | #include 79 | 80 | #undef _ 81 | #define _(String) gettext(String) 82 | #ifdef gettext_noop 83 | # define N_(String) gettext_noop (String) 84 | #else 85 | # define N_(String) (String) 86 | #endif 87 | 88 | //If running under Mac OS X, use the Localizable.strings file instead. 89 | #elif defined(_MACOSX) 90 | #ifdef PCSXRCORE 91 | __private_extern char* Pcsxr_locale_text(char* toloc); 92 | #define _(String) Pcsxr_locale_text(String) 93 | #define N_(String) String 94 | #else 95 | #ifndef PCSXRPLUG 96 | #warning please define the plug being built to use Mac OS X localization! 97 | #define _(msgid) msgid 98 | #define N_(msgid) msgid 99 | #else 100 | //Kludge to get the preprocessor to accept PCSXRPLUG as a variable. 101 | #define PLUGLOC_x(x,y) x ## y 102 | #define PLUGLOC_y(x,y) PLUGLOC_x(x,y) 103 | #define PLUGLOC PLUGLOC_y(PCSXRPLUG,_locale_text) 104 | __private_extern char* PLUGLOC(char* toloc); 105 | #define _(String) PLUGLOC(String) 106 | #define N_(String) String 107 | #endif 108 | #endif 109 | #else 110 | 111 | #define _(msgid) msgid 112 | #define N_(msgid) msgid 113 | 114 | #endif 115 | 116 | extern FILE *emuLog; 117 | extern int Log; 118 | 119 | void __Log(char *fmt, ...); 120 | 121 | typedef struct { 122 | char Gpu[MAXPATHLEN]; 123 | char Spu[MAXPATHLEN]; 124 | char Cdr[MAXPATHLEN]; 125 | char Pad1[MAXPATHLEN]; 126 | char Pad2[MAXPATHLEN]; 127 | char Net[MAXPATHLEN]; 128 | char Sio1[MAXPATHLEN]; 129 | char Mcd1[MAXPATHLEN]; 130 | char Mcd2[MAXPATHLEN]; 131 | char Bios[MAXPATHLEN]; 132 | char BiosDir[MAXPATHLEN]; 133 | char PluginsDir[MAXPATHLEN]; 134 | char PatchesDir[MAXPATHLEN]; 135 | char IsoImgDir[MAXPATHLEN]; 136 | boolean Xa; 137 | boolean SioIrq; 138 | boolean Mdec; 139 | boolean PsxAuto; 140 | u8 Cdda; 141 | boolean HLE; 142 | boolean SlowBoot; 143 | boolean Debug; 144 | boolean PsxOut; 145 | boolean SpuIrq; 146 | boolean RCntFix; 147 | boolean UseNet; 148 | boolean VSyncWA; 149 | boolean NoMemcard; 150 | boolean Widescreen; 151 | boolean HideCursor; 152 | boolean SaveWindowPos; 153 | s32 WindowPos[2]; 154 | u8 Cpu; // CPU_DYNAREC or CPU_INTERPRETER 155 | u8 PsxType; // PSX_TYPE_NTSC or PSX_TYPE_PAL 156 | u32 RewindCount; 157 | u32 RewindInterval; 158 | u32 AltSpeed1; // Percent relative to natural speed. 159 | u32 AltSpeed2; 160 | u8 HackFix; 161 | #ifdef _WIN32 162 | char Lang[256]; 163 | #endif 164 | } PcsxConfig; 165 | 166 | extern PcsxConfig Config; 167 | extern boolean NetOpened; 168 | 169 | // It is safe if these overflow 170 | extern u32 rewind_counter; 171 | extern u8 vblank_count_hideafter; 172 | 173 | #define gzfreeze(ptr, size) { \ 174 | if (Mode == 1) gzwrite(f, ptr, size); \ 175 | if (Mode == 0) gzread(f, ptr, size); \ 176 | } 177 | 178 | // Make the timing events trigger faster as we are currently assuming everything 179 | // takes one cycle, which is not the case on real hardware. 180 | // FIXME: Count the proper cycle and get rid of this 181 | #define BIAS 2 182 | #define PSXCLK 33868800 /* 33.8688 MHz */ 183 | 184 | enum { 185 | PSX_TYPE_NTSC = 0, 186 | PSX_TYPE_PAL 187 | }; // PSX Types 188 | 189 | enum { 190 | CPU_DYNAREC = 0, 191 | CPU_INTERPRETER 192 | }; // CPU Types 193 | 194 | enum { 195 | CDDA_ENABLED_LE = 0, 196 | CDDA_DISABLED, 197 | CDDA_ENABLED_BE 198 | }; // CDDA Types 199 | 200 | int EmuInit(); 201 | void EmuReset(); 202 | void EmuShutdown(); 203 | void EmuUpdate(); 204 | 205 | #endif 206 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/psxmem.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __PSXMEMORY_H__ 21 | #define __PSXMEMORY_H__ 22 | 23 | #include "psxcommon.h" 24 | 25 | #if defined(__BIGENDIAN__) 26 | 27 | #define _SWAP16(b) ((((unsigned char *)&(b))[0] & 0xff) | (((unsigned char *)&(b))[1] & 0xff) << 8) 28 | #define _SWAP32(b) ((((unsigned char *)&(b))[0] & 0xff) | ((((unsigned char *)&(b))[1] & 0xff) << 8) | ((((unsigned char *)&(b))[2] & 0xff) << 16) | (((unsigned char *)&(b))[3] << 24)) 29 | 30 | #define SWAP16(v) ((((v) & 0xff00) >> 8) +(((v) & 0xff) << 8)) 31 | #define SWAP32(v) ((((v) & 0xff000000ul) >> 24) + (((v) & 0xff0000ul) >> 8) + (((v) & 0xff00ul)<<8) +(((v) & 0xfful) << 24)) 32 | #define SWAPu32(v) SWAP32((u32)(v)) 33 | #define SWAPs32(v) SWAP32((s32)(v)) 34 | 35 | #define SWAPu16(v) SWAP16((u16)(v)) 36 | #define SWAPs16(v) SWAP16((s16)(v)) 37 | 38 | #else 39 | 40 | #define SWAP16(b) (b) 41 | #define SWAP32(b) (b) 42 | 43 | #define SWAPu16(b) (b) 44 | #define SWAPu32(b) (b) 45 | 46 | #endif 47 | 48 | extern s8 *psxM; 49 | #define psxMs8(mem) psxM[(mem) & 0x1fffff] 50 | #define psxMs16(mem) (SWAP16(*(s16 *)&psxM[(mem) & 0x1fffff])) 51 | #define psxMs32(mem) (SWAP32(*(s32 *)&psxM[(mem) & 0x1fffff])) 52 | #define psxMu8(mem) (*(u8 *)&psxM[(mem) & 0x1fffff]) 53 | #define psxMu16(mem) (SWAP16(*(u16 *)&psxM[(mem) & 0x1fffff])) 54 | #define psxMu32(mem) (SWAP32(*(u32 *)&psxM[(mem) & 0x1fffff])) 55 | 56 | #define psxMs8ref(mem) psxM[(mem) & 0x1fffff] 57 | #define psxMs16ref(mem) (*(s16 *)&psxM[(mem) & 0x1fffff]) 58 | #define psxMs32ref(mem) (*(s32 *)&psxM[(mem) & 0x1fffff]) 59 | #define psxMu8ref(mem) (*(u8 *)&psxM[(mem) & 0x1fffff]) 60 | #define psxMu16ref(mem) (*(u16 *)&psxM[(mem) & 0x1fffff]) 61 | #define psxMu32ref(mem) (*(u32 *)&psxM[(mem) & 0x1fffff]) 62 | 63 | extern s8 *psxP; 64 | #define psxPs8(mem) psxP[(mem) & 0xffff] 65 | #define psxPs16(mem) (SWAP16(*(s16 *)&psxP[(mem) & 0xffff])) 66 | #define psxPs32(mem) (SWAP32(*(s32 *)&psxP[(mem) & 0xffff])) 67 | #define psxPu8(mem) (*(u8 *)&psxP[(mem) & 0xffff]) 68 | #define psxPu16(mem) (SWAP16(*(u16 *)&psxP[(mem) & 0xffff])) 69 | #define psxPu32(mem) (SWAP32(*(u32 *)&psxP[(mem) & 0xffff])) 70 | 71 | #define psxPs8ref(mem) psxP[(mem) & 0xffff] 72 | #define psxPs16ref(mem) (*(s16 *)&psxP[(mem) & 0xffff]) 73 | #define psxPs32ref(mem) (*(s32 *)&psxP[(mem) & 0xffff]) 74 | #define psxPu8ref(mem) (*(u8 *)&psxP[(mem) & 0xffff]) 75 | #define psxPu16ref(mem) (*(u16 *)&psxP[(mem) & 0xffff]) 76 | #define psxPu32ref(mem) (*(u32 *)&psxP[(mem) & 0xffff]) 77 | 78 | extern s8 *psxR; 79 | #define psxRs8(mem) psxR[(mem) & 0x7ffff] 80 | #define psxRs16(mem) (SWAP16(*(s16 *)&psxR[(mem) & 0x7ffff])) 81 | #define psxRs32(mem) (SWAP32(*(s32 *)&psxR[(mem) & 0x7ffff])) 82 | #define psxRu8(mem) (*(u8* )&psxR[(mem) & 0x7ffff]) 83 | #define psxRu16(mem) (SWAP16(*(u16 *)&psxR[(mem) & 0x7ffff])) 84 | #define psxRu32(mem) (SWAP32(*(u32 *)&psxR[(mem) & 0x7ffff])) 85 | 86 | #define psxRs8ref(mem) psxR[(mem) & 0x7ffff] 87 | #define psxRs16ref(mem) (*(s16*)&psxR[(mem) & 0x7ffff]) 88 | #define psxRs32ref(mem) (*(s32*)&psxR[(mem) & 0x7ffff]) 89 | #define psxRu8ref(mem) (*(u8 *)&psxR[(mem) & 0x7ffff]) 90 | #define psxRu16ref(mem) (*(u16*)&psxR[(mem) & 0x7ffff]) 91 | #define psxRu32ref(mem) (*(u32*)&psxR[(mem) & 0x7ffff]) 92 | 93 | extern s8 *psxH; 94 | #define psxHs8(mem) psxH[(mem) & 0xffff] 95 | #define psxHs16(mem) (SWAP16(*(s16 *)&psxH[(mem) & 0xffff])) 96 | #define psxHs32(mem) (SWAP32(*(s32 *)&psxH[(mem) & 0xffff])) 97 | #define psxHu8(mem) (*(u8 *)&psxH[(mem) & 0xffff]) 98 | #define psxHu16(mem) (SWAP16(*(u16 *)&psxH[(mem) & 0xffff])) 99 | #define psxHu32(mem) (SWAP32(*(u32 *)&psxH[(mem) & 0xffff])) 100 | 101 | #define psxHs8ref(mem) psxH[(mem) & 0xffff] 102 | #define psxHs16ref(mem) (*(s16 *)&psxH[(mem) & 0xffff]) 103 | #define psxHs32ref(mem) (*(s32 *)&psxH[(mem) & 0xffff]) 104 | #define psxHu8ref(mem) (*(u8 *)&psxH[(mem) & 0xffff]) 105 | #define psxHu16ref(mem) (*(u16 *)&psxH[(mem) & 0xffff]) 106 | #define psxHu32ref(mem) (*(u32 *)&psxH[(mem) & 0xffff]) 107 | 108 | extern u8 **psxMemWLUT; 109 | extern u8 **psxMemRLUT; 110 | 111 | #define PSXM(mem) (psxMemRLUT[(mem) >> 16] == 0 ? NULL : (u8*)(psxMemRLUT[(mem) >> 16] + ((mem) & 0xffff))) 112 | #define PSXMs8(mem) (*(s8 *)PSXM(mem)) 113 | #define PSXMs16(mem) (SWAP16(*(s16 *)PSXM(mem))) 114 | #define PSXMs32(mem) (SWAP32(*(s32 *)PSXM(mem))) 115 | #define PSXMu8(mem) (*(u8 *)PSXM(mem)) 116 | #define PSXMu16(mem) (SWAP16(*(u16 *)PSXM(mem))) 117 | #define PSXMu32(mem) (SWAP32(*(u32 *)PSXM(mem))) 118 | 119 | #define PSXMu32ref(mem) (*(u32 *)PSXM(mem)) 120 | 121 | #if !defined(PSXREC) && (defined(__x86_64__) || defined(__i386__) || defined(__ppc__)) && !defined(NOPSXREC) 122 | #define PSXREC 123 | #endif 124 | 125 | int psxMemInit(); 126 | void psxMemReset(); 127 | void psxMemShutdown(); 128 | 129 | u8 psxMemRead8 (u32 mem); 130 | u16 psxMemRead16(u32 mem); 131 | u32 psxMemRead32(u32 mem); 132 | void psxMemWrite8 (u32 mem, u8 value); 133 | void psxMemWrite16(u32 mem, u16 value); 134 | void psxMemWrite32(u32 mem, u32 value); 135 | void *psxMemPointer(u32 mem); 136 | 137 | #endif 138 | -------------------------------------------------------------------------------- /pcsxr/libpcsxcore/socket.c: -------------------------------------------------------------------------------- 1 | /* Pcsx - Pc Psx Emulator 2 | * Copyright (C) 1999-2003 Pcsx Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, see . 16 | */ 17 | 18 | #ifdef _WIN32 19 | #include 20 | #endif 21 | 22 | #include "psxcommon.h" 23 | #include "socket.h" 24 | 25 | #ifndef _WIN32 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #endif 33 | 34 | static int server_socket = 0; 35 | static int client_socket = 0; 36 | 37 | static char tbuf[513]; 38 | static int ptr = 0; 39 | 40 | #define PORT_NUMBER 12345 41 | 42 | int StartServer() { 43 | struct in_addr localhostaddr; 44 | struct sockaddr_in localsocketaddr; 45 | 46 | #ifdef _WIN32 47 | WSADATA wsaData; 48 | 49 | if (WSAStartup(MAKEWORD(2, 0), &wsaData) != 0) 50 | return -1; 51 | #endif 52 | 53 | server_socket = socket(AF_INET, SOCK_STREAM, 0); 54 | 55 | #ifdef _WIN32 56 | if (server_socket == INVALID_SOCKET) 57 | return -1; 58 | #else 59 | if (server_socket == -1) 60 | return -1; 61 | #endif 62 | 63 | SetsNonblock(); 64 | 65 | memset((void *)&localhostaddr, 0, sizeof(localhostaddr)); 66 | memset(&localsocketaddr, 0, sizeof(struct sockaddr_in)); 67 | 68 | #ifdef _WIN32 69 | localhostaddr.S_un.S_addr = htonl(INADDR_ANY); 70 | #else 71 | localhostaddr.s_addr = htonl(INADDR_ANY); 72 | #endif 73 | localsocketaddr.sin_family = AF_INET; 74 | localsocketaddr.sin_addr = localhostaddr; 75 | localsocketaddr.sin_port = htons(PORT_NUMBER); 76 | 77 | if (bind(server_socket, (struct sockaddr *) &localsocketaddr, sizeof(localsocketaddr)) < 0) 78 | return -1; 79 | 80 | if (listen(server_socket, 1) != 0) 81 | return -1; 82 | 83 | return 0; 84 | } 85 | 86 | void StopServer() { 87 | #ifdef _WIN32 88 | shutdown(server_socket, SD_BOTH); 89 | closesocket(server_socket); 90 | WSACleanup(); 91 | #else 92 | shutdown(server_socket, SHUT_RDWR); 93 | close(server_socket); 94 | #endif 95 | } 96 | 97 | void GetClient() { 98 | int new_socket; 99 | char hello[256]; 100 | 101 | new_socket = accept(server_socket, 0, 0); 102 | 103 | #ifdef _WIN32 104 | if (new_socket == INVALID_SOCKET) 105 | return; 106 | #else 107 | if (new_socket == -1) 108 | return; 109 | #endif 110 | if (client_socket) 111 | CloseClient(); 112 | client_socket = new_socket; 113 | 114 | #ifndef _WIN32 115 | { 116 | int flags; 117 | flags = fcntl(client_socket, F_GETFL, 0); 118 | fcntl(client_socket, F_SETFL, flags | O_NONBLOCK); 119 | } 120 | #endif 121 | 122 | sprintf(hello, "000 PCSXR Version %s - Debug console\r\n", PACKAGE_VERSION); 123 | WriteSocket(hello, strlen(hello)); 124 | ptr = 0; 125 | } 126 | 127 | void CloseClient() { 128 | if (client_socket) { 129 | #ifdef _WIN32 130 | shutdown(client_socket, SD_BOTH); 131 | closesocket(client_socket); 132 | #else 133 | shutdown(client_socket, SHUT_RDWR); 134 | close(client_socket); 135 | #endif 136 | client_socket = 0; 137 | } 138 | } 139 | 140 | int HasClient() { 141 | return client_socket ? 1 : 0; 142 | } 143 | 144 | int ReadSocket(char * buffer, int len) { 145 | int r; 146 | char * endl; 147 | 148 | if (!client_socket) 149 | return -1; 150 | 151 | r = recv(client_socket, tbuf + ptr, 512 - ptr, 0); 152 | 153 | if (r == 0) { 154 | client_socket = 0; 155 | if (!ptr) 156 | return 0; 157 | } 158 | #ifdef _WIN32 159 | if (r == SOCKET_ERROR) 160 | #else 161 | if (r == -1) 162 | #endif 163 | { 164 | if (ptr == 0) 165 | return -1; 166 | r = 0; 167 | } 168 | ptr += r; 169 | tbuf[ptr] = 0; 170 | 171 | endl = strstr(tbuf, "\r\n"); 172 | 173 | if (endl) { 174 | r = endl - tbuf; 175 | strncpy(buffer, tbuf, r); 176 | 177 | r += 2; 178 | memmove(tbuf, tbuf + r, 512 - r); 179 | ptr -= r; 180 | memset(tbuf + r, 0, 512 - r); 181 | r -= 2; 182 | 183 | } else { 184 | r = 0; 185 | } 186 | 187 | buffer[r] = 0; 188 | 189 | return r; 190 | } 191 | 192 | int RawReadSocket(char * buffer, int len) { 193 | int r = 0; 194 | int mlen = len < ptr ? len : ptr; 195 | 196 | if (!client_socket) 197 | return -1; 198 | 199 | if (ptr) { 200 | memcpy(buffer, tbuf, mlen); 201 | ptr -= mlen; 202 | memmove(tbuf, tbuf + mlen, 512 - mlen); 203 | } 204 | 205 | if (len - mlen) 206 | r = recv(client_socket, buffer + mlen, len - mlen, 0); 207 | 208 | if (r == 0) { 209 | client_socket = 0; 210 | if (!ptr) 211 | return 0; 212 | } 213 | #ifdef _WIN32 214 | if (r == SOCKET_ERROR) 215 | #else 216 | if (r == -1) 217 | #endif 218 | { 219 | if (ptr == 0) 220 | return -1; 221 | r = 0; 222 | } 223 | 224 | r += mlen; 225 | 226 | return r; 227 | } 228 | 229 | void WriteSocket(char * buffer, int len) { 230 | if (!client_socket) 231 | return; 232 | 233 | send(client_socket, buffer, len, 0); 234 | } 235 | 236 | void SetsBlock() { 237 | #ifdef _WIN32 238 | u_long b = 0; 239 | ioctlsocket(server_socket, FIONBIO, &b); 240 | #else 241 | int flags = fcntl(server_socket, F_GETFL, 0); 242 | fcntl(server_socket, F_SETFL, flags & ~O_NONBLOCK); 243 | #endif 244 | } 245 | 246 | void SetsNonblock() { 247 | #ifdef _WIN32 248 | u_long b = 1; 249 | ioctlsocket(server_socket, FIONBIO, &b); 250 | #else 251 | int flags = fcntl(server_socket, F_GETFL, 0); 252 | fcntl(server_socket, F_SETFL, flags | O_NONBLOCK); 253 | #endif 254 | } 255 | -------------------------------------------------------------------------------- /pcsxr/win32/zlib/inffixed.h: -------------------------------------------------------------------------------- 1 | /* inffixed.h -- table for decoding fixed codes 2 | * Generated automatically by makefixed(). 3 | */ 4 | 5 | /* WARNING: this file should *not* be used by applications. 6 | It is part of the implementation of this library and is 7 | subject to change. Applications should only use zlib.h. 8 | */ 9 | 10 | static const code lenfix[512] = { 11 | {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, 12 | {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, 13 | {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, 14 | {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, 15 | {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, 16 | {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, 17 | {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, 18 | {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, 19 | {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, 20 | {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, 21 | {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, 22 | {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, 23 | {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, 24 | {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, 25 | {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, 26 | {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, 27 | {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, 28 | {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, 29 | {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, 30 | {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, 31 | {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, 32 | {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, 33 | {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, 34 | {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, 35 | {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, 36 | {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, 37 | {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, 38 | {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, 39 | {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, 40 | {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, 41 | {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, 42 | {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, 43 | {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, 44 | {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, 45 | {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, 46 | {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, 47 | {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, 48 | {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, 49 | {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, 50 | {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, 51 | {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, 52 | {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, 53 | {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, 54 | {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, 55 | {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, 56 | {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, 57 | {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, 58 | {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, 59 | {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, 60 | {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, 61 | {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, 62 | {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, 63 | {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, 64 | {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, 65 | {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, 66 | {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, 67 | {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, 68 | {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, 69 | {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, 70 | {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, 71 | {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, 72 | {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, 73 | {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, 74 | {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, 75 | {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, 76 | {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, 77 | {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, 78 | {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, 79 | {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, 80 | {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, 81 | {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, 82 | {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, 83 | {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, 84 | {0,9,255} 85 | }; 86 | 87 | static const code distfix[32] = { 88 | {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, 89 | {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, 90 | {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, 91 | {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, 92 | {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, 93 | {22,5,193},{64,5,0} 94 | }; 95 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/libgettext.h: -------------------------------------------------------------------------------- 1 | /* Message catalogs for internationalization. 2 | Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software Foundation, 16 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ 17 | 18 | /* Because on some systems (e.g. Solaris) we sometimes have to include 19 | the systems libintl.h as well as this file we have more complex 20 | include protection above. But the systems header might perhaps also 21 | define _LIBINTL_H and therefore we have to protect the definition here. */ 22 | 23 | #if !defined _LIBINTL_H || !defined _LIBGETTEXT_H 24 | #ifndef _LIBINTL_H 25 | # define _LIBINTL_H 1 26 | #endif 27 | #define _LIBGETTEXT_H 1 28 | 29 | /* We define an additional symbol to signal that we use the GNU 30 | implementation of gettext. */ 31 | #define __USE_GNU_GETTEXT 1 32 | 33 | #include 34 | 35 | #if HAVE_LOCALE_H 36 | # include 37 | #endif 38 | 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* @@ end of prolog @@ */ 45 | 46 | #ifndef PARAMS 47 | # if __STDC__ || defined __cplusplus 48 | # define PARAMS(args) args 49 | # else 50 | # define PARAMS(args) () 51 | # endif 52 | #endif 53 | 54 | #ifndef NULL 55 | # if !defined __cplusplus || defined __GNUC__ 56 | # define NULL ((void *) 0) 57 | # else 58 | # define NULL (0) 59 | # endif 60 | #endif 61 | 62 | #if !HAVE_LC_MESSAGES 63 | /* This value determines the behaviour of the gettext() and dgettext() 64 | function. But some system does not have this defined. Define it 65 | to a default value. */ 66 | # define LC_MESSAGES (-1) 67 | #endif 68 | 69 | 70 | /* Declarations for gettext-using-catgets interface. Derived from 71 | Jim Meyering's libintl.h. */ 72 | struct _msg_ent 73 | { 74 | const char *_msg; 75 | int _msg_number; 76 | }; 77 | 78 | 79 | #if HAVE_CATGETS 80 | /* These two variables are defined in the automatically by po-to-tbl.sed 81 | generated file `cat-id-tbl.c'. */ 82 | extern const struct _msg_ent _msg_tbl[]; 83 | extern int _msg_tbl_length; 84 | #endif 85 | 86 | 87 | /* For automatical extraction of messages sometimes no real 88 | translation is needed. Instead the string itself is the result. */ 89 | #define gettext_noop(Str) (Str) 90 | 91 | /* Look up MSGID in the current default message catalog for the current 92 | LC_MESSAGES locale. If not found, returns MSGID itself (the default 93 | text). */ 94 | extern char *gettext PARAMS ((const char *__msgid)); 95 | extern char *gettext__ PARAMS ((const char *__msgid)); 96 | 97 | /* Look up MSGID in the DOMAINNAME message catalog for the current 98 | LC_MESSAGES locale. */ 99 | extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid)); 100 | extern char *dgettext__ PARAMS ((const char *__domainname, 101 | const char *__msgid)); 102 | 103 | /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY 104 | locale. */ 105 | extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid, 106 | int __category)); 107 | extern char *dcgettext__ PARAMS ((const char *__domainname, 108 | const char *__msgid, int __category)); 109 | 110 | 111 | /* Set the current default message catalog to DOMAINNAME. 112 | If DOMAINNAME is null, return the current default. 113 | If DOMAINNAME is "", reset to the default of "messages". */ 114 | extern char *textdomain PARAMS ((const char *__domainname)); 115 | extern char *textdomain__ PARAMS ((const char *__domainname)); 116 | 117 | /* Specify that the DOMAINNAME message catalog will be found 118 | in DIRNAME rather than in the system locale data base. */ 119 | extern char *bindtextdomain PARAMS ((const char *__domainname, 120 | const char *__dirname)); 121 | extern char *bindtextdomain__ PARAMS ((const char *__domainname, 122 | const char *__dirname)); 123 | 124 | #if ENABLE_NLS 125 | 126 | /* Solaris 2.3 has the gettext function but dcgettext is missing. 127 | So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4 128 | has dcgettext. */ 129 | # if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT) 130 | 131 | # define gettext(Msgid) \ 132 | dgettext (NULL, Msgid) 133 | 134 | # define dgettext(Domainname, Msgid) \ 135 | dcgettext (Domainname, Msgid, LC_MESSAGES) 136 | 137 | # if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7 138 | /* This global variable is defined in loadmsgcat.c. We need a sign, 139 | whether a new catalog was loaded, which can be associated with all 140 | translations. */ 141 | extern int _nl_msg_cat_cntr; 142 | 143 | # define dcgettext(Domainname, Msgid, Category) \ 144 | (__extension__ \ 145 | ({ \ 146 | char *__result; \ 147 | if (__builtin_constant_p (Msgid)) \ 148 | { \ 149 | static char *__translation__; \ 150 | static int __catalog_counter__; \ 151 | if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \ 152 | { \ 153 | __translation__ = \ 154 | dcgettext__ (Domainname, Msgid, Category); \ 155 | __catalog_counter__ = _nl_msg_cat_cntr; \ 156 | } \ 157 | __result = __translation__; \ 158 | } \ 159 | else \ 160 | __result = dcgettext__ (Domainname, Msgid, Category); \ 161 | __result; \ 162 | })) 163 | # endif 164 | # endif 165 | 166 | #else 167 | 168 | # define gettext(Msgid) (Msgid) 169 | # define dgettext(Domainname, Msgid) (Msgid) 170 | # define dcgettext(Domainname, Msgid, Category) (Msgid) 171 | # define textdomain(Domainname) ((char *) Domainname) 172 | # define bindtextdomain(Domainname, Dirname) ((char *) Dirname) 173 | 174 | #endif 175 | 176 | /* @@ begin of epilog @@ */ 177 | 178 | #ifdef __cplusplus 179 | } 180 | #endif 181 | 182 | #endif 183 | -------------------------------------------------------------------------------- /pcsxr/win32/intl/finddomain.c: -------------------------------------------------------------------------------- 1 | /* Handle list of needed message catalogs 2 | Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3 | Written by Ulrich Drepper , 1995. 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software Foundation, 17 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ 18 | 19 | #include "intlconfig.h" 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #if defined STDC_HEADERS || defined _LIBC 27 | # include 28 | #else 29 | # ifdef HAVE_MALLOC_H 30 | # include 31 | # else 32 | void free (); 33 | # endif 34 | #endif 35 | 36 | #if defined HAVE_STRING_H || defined _LIBC 37 | # include 38 | #else 39 | # include 40 | # ifndef memcpy 41 | # define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) 42 | # endif 43 | #endif 44 | #if !HAVE_STRCHR && !defined _LIBC 45 | # ifndef strchr 46 | # define strchr index 47 | # endif 48 | #endif 49 | 50 | #if defined HAVE_UNISTD_H || defined _LIBC 51 | # include 52 | #endif 53 | 54 | #include "gettext.h" 55 | #include "gettextP.h" 56 | #ifdef _LIBC 57 | # include 58 | #else 59 | # include "libgettext.h" 60 | #endif 61 | 62 | /* @@ end of prolog @@ */ 63 | /* List of already loaded domains. */ 64 | static struct loaded_l10nfile *_nl_loaded_domains; 65 | 66 | 67 | /* Return a data structure describing the message catalog described by 68 | the DOMAINNAME and CATEGORY parameters with respect to the currently 69 | established bindings. */ 70 | struct loaded_l10nfile * 71 | internal_function 72 | _nl_find_domain (dirname, locale, domainname) 73 | const char *dirname; 74 | char *locale; 75 | const char *domainname; 76 | { 77 | struct loaded_l10nfile *retval; 78 | const char *language; 79 | const char *modifier; 80 | const char *territory; 81 | const char *codeset; 82 | const char *normalized_codeset; 83 | const char *special; 84 | const char *sponsor; 85 | const char *revision; 86 | const char *alias_value; 87 | int mask; 88 | 89 | /* LOCALE can consist of up to four recognized parts for the XPG syntax: 90 | 91 | language[_territory[.codeset]][@modifier] 92 | 93 | and six parts for the CEN syntax: 94 | 95 | language[_territory][+audience][+special][,[sponsor][_revision]] 96 | 97 | Beside the first part all of them are allowed to be missing. If 98 | the full specified locale is not found, the less specific one are 99 | looked for. The various parts will be stripped off according to 100 | the following order: 101 | (1) revision 102 | (2) sponsor 103 | (3) special 104 | (4) codeset 105 | (5) normalized codeset 106 | (6) territory 107 | (7) audience/modifier 108 | */ 109 | 110 | /* If we have already tested for this locale entry there has to 111 | be one data set in the list of loaded domains. */ 112 | retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, 113 | strlen (dirname) + 1, 0, locale, NULL, NULL, 114 | NULL, NULL, NULL, NULL, NULL, domainname, 0); 115 | if (retval != NULL) 116 | { 117 | /* We know something about this locale. */ 118 | int cnt; 119 | 120 | if (retval->decided == 0) 121 | _nl_load_domain (retval); 122 | 123 | if (retval->data != NULL) 124 | return retval; 125 | 126 | for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) 127 | { 128 | if (retval->successor[cnt]->decided == 0) 129 | _nl_load_domain (retval->successor[cnt]); 130 | 131 | if (retval->successor[cnt]->data != NULL) 132 | break; 133 | } 134 | return cnt >= 0 ? retval : NULL; 135 | /* NOTREACHED */ 136 | } 137 | 138 | /* See whether the locale value is an alias. If yes its value 139 | *overwrites* the alias name. No test for the original value is 140 | done. */ 141 | alias_value = _nl_expand_alias (locale); 142 | if (alias_value != NULL) 143 | { 144 | #if defined _LIBC || defined HAVE_STRDUP 145 | locale = strdup (alias_value); 146 | if (locale == NULL) 147 | return NULL; 148 | #else 149 | size_t len = strlen (alias_value) + 1; 150 | locale = (char *) malloc (len); 151 | if (locale == NULL) 152 | return NULL; 153 | 154 | memcpy (locale, alias_value, len); 155 | #endif 156 | } 157 | 158 | /* Now we determine the single parts of the locale name. First 159 | look for the language. Termination symbols are `_' and `@' if 160 | we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ 161 | mask = _nl_explode_name (locale, &language, &modifier, &territory, 162 | &codeset, &normalized_codeset, &special, 163 | &sponsor, &revision); 164 | 165 | /* Create all possible locale entries which might be interested in 166 | generalization. */ 167 | retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, 168 | strlen (dirname) + 1, mask, language, territory, 169 | codeset, normalized_codeset, modifier, special, 170 | sponsor, revision, domainname, 1); 171 | if (retval == NULL) 172 | /* This means we are out of core. */ 173 | return NULL; 174 | 175 | if (retval->decided == 0) 176 | _nl_load_domain (retval); 177 | if (retval->data == NULL) 178 | { 179 | int cnt; 180 | for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) 181 | { 182 | if (retval->successor[cnt]->decided == 0) 183 | _nl_load_domain (retval->successor[cnt]); 184 | if (retval->successor[cnt]->data != NULL) 185 | break; 186 | } 187 | } 188 | 189 | /* The room for an alias was dynamically allocated. Free it now. */ 190 | if (alias_value != NULL) 191 | free (locale); 192 | 193 | return retval; 194 | } 195 | 196 | 197 | #ifdef _LIBC 198 | static void __attribute__ ((unused)) 199 | free_mem (void) 200 | { 201 | struct loaded_l10nfile *runp = _nl_loaded_domains; 202 | 203 | while (runp != NULL) 204 | { 205 | struct loaded_l10nfile *here = runp; 206 | if (runp->data != NULL) 207 | _nl_unload_domain ((struct loaded_domain *) runp->data); 208 | runp = runp->next; 209 | free (here); 210 | } 211 | } 212 | 213 | text_set_element (__libc_subfreeres, free_mem); 214 | #endif 215 | --------------------------------------------------------------------------------