Fixed Linux up to compile in codeblocks again. Added Onepad plugin project file.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1790 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-09-08 21:41:46 +00:00
parent eec90508ff
commit e03e8bff40
11 changed files with 2390 additions and 64 deletions

View File

@ -1,6 +1,6 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
@ -50,9 +50,9 @@ union tDMA_CHCR {
u32 reserved1 : 1;
u32 MOD : 2;
u32 ASP : 2;
u32 TTE : 1;
u32 TIE : 1;
u32 STR : 1;
u32 TTE : 1;
u32 TIE : 1;
u32 STR : 1;
u32 reserved2 : 7;
u32 TAG : 16;
};
@ -86,7 +86,7 @@ struct DMACh {
// HW defines
enum HWaddress
{
{
RCNT0_COUNT = 0x10000000,
RCNT0_MODE = 0x10000010,
RCNT0_TARGET = 0x10000020,
@ -120,7 +120,7 @@ enum HWaddress
GIF_CNT = 0x10003080,
GIF_P3CNT = 0x10003090,
GIF_P3TAG = 0x100030A0,
// Vif Memory Locations
VIF0_STAT = 0x10003800,
VIF0_FBRST = 0x10003810,
@ -142,7 +142,7 @@ enum HWaddress
VIF0_C1 = 0x10003950,
VIF0_C2 = 0x10003960,
VIF0_C3 = 0x10003970,
VIF1_STAT = 0x10003c00,
VIF1_FBRST = 0x10003c10,
VIF1_ERR = 0x10003c20,
@ -166,7 +166,7 @@ enum HWaddress
VIF1_C1 = 0x10003d50,
VIF1_C2 = 0x10003d60,
VIF1_C3 = 0x10003d70,
VIF0_FIFO = 0x10004000,
VIF1_FIFO = 0x10005000,
GIF_FIFO = 0x10006000,
@ -253,7 +253,7 @@ enum HWaddress
SIO_BGR = 0x1000F150,
SIO_TXFIFO = 0x1000F180,
SIO_RXFIFO = 0x1000F1C0,
SBUS_F200 = 0x1000F200, //MSCOM
SBUS_F210 = 0x1000F210, //SMCOM
SBUS_F220 = 0x1000F220, //MSFLG
@ -264,7 +264,7 @@ enum HWaddress
MCH_RICM = 0x1000F430,
MCH_DRD = 0x1000F440,
DMAC_ENABLER = 0x1000F520,
DMAC_ENABLEW = 0x1000F590,
@ -295,7 +295,7 @@ enum HWaddress
enum INTCIrqs
{
INTC_GS = 0,
INTC_SBUS,
INTC_SBUS,
INTC_VBLANK_S,
INTC_VBLANK_E,
INTC_VIF0,
@ -332,7 +332,7 @@ enum DMACIrqs
DMAC_SIF2,
DMAC_FROM_SPR,
DMAC_TO_SPR,
// We're setting error conditions through hwDmacIrq, so these correspond to the conditions above.
DMAC_STALL_SIS = 13,
DMAC_MFIFO_EMPTY = 14, // Transfer?
@ -379,7 +379,7 @@ enum vif1_stat_flags
// These are the stat flags that are the same for vif0 & vif1,
// for occassions where we don't neccessarily know which we are using.
enum vif_stat_flags
enum vif_stat_flags
{
VIF_STAT_VPS_W = (1),
VIF_STAT_VPS_D = (2),
@ -396,7 +396,7 @@ enum vif_stat_flags
VIF_STAT_ER1 = (1<<13)
};
//GIF_STAT
//GIF_STAT
enum gif_stat_flags
{
GIF_STAT_M3R = (1), // GIF_MODE Mask
@ -423,7 +423,7 @@ enum gif_mode_flags
//DMA interrupts & masks
enum DMAInter
{
{
BEISintr = 0x8000,
VIF0intr = 0x10001,
VIF1intr = 0x20002,
@ -445,8 +445,8 @@ union tDMAC_CTRL {
u32 RELE : 1;
u32 MFD : 2;
u32 STS : 2;
u32 STD : 2;
u32 RCYC : 3;
u32 STD : 2;
u32 RCYC : 3;
u32 reserved1 : 21;
};
u32 _u32;
@ -522,7 +522,7 @@ struct DMACregisters
u32 padding1[3];
tDMAC_PCR pcr;
u32 padding2[3];
tDMAC_SQWC sqwc;
u32 padding3[3];
tDMAC_RBSR rbsr;
@ -555,7 +555,7 @@ static __forceinline u8* dmaGetAddr(u32 mem)
p = (u8*)dmaGetAddrBase(mem);
#ifdef _WIN32
#ifdef _WIN32
// do manual LUT since IPU/SPR seems to use addrs 0x3000xxxx quite often
// linux doesn't suffer from this because it has better vm support
if( memLUT[ (p-PS2MEM_BASE)>>12 ].aPFNs == NULL ) {
@ -577,7 +577,7 @@ static __forceinline void *dmaGetAddr(u32 addr) {
u8 *ptr;
// if (addr & 0xf) { DMA_LOG("*PCSX2*: DMA address not 128bit aligned: %8.8x", addr); }
// Need to check the physical address as well as just the "SPR" flag, as VTLB doesnt seem to handle it
if ((addr & 0x80000000) || (addr & 0x70000000) == 0x70000000) return (void*)&psS[addr & 0x3ff0];
@ -589,21 +589,21 @@ static __forceinline void *dmaGetAddr(u32 addr) {
return ptr;
}
#endif
#endif
static __forceinline u32 *_dmaGetAddr(DMACh *dma, u32 addr, u32 num)
static __forceinline u32 *_dmaGetAddr(DMACh *dma, u32 addr, u32 num)
{
u32 *ptr = (u32*)dmaGetAddr(addr);
if (ptr == NULL)
u32 *ptr = (u32*)dmaGetAddr(addr);
if (ptr == NULL)
{
// DMA Error
psHu32(DMAC_STAT) |= DMAC_STAT_BEIS; /* BUS error */
// DMA End
psHu32(DMAC_STAT) |= 1<<num;
dma->chcr.STR = 0;
psHu32(DMAC_STAT) |= 1<<num;
dma->chcr.STR = 0;
}
return ptr;
}

View File

@ -19,6 +19,7 @@
<Project filename="../../plugins/GSnull/Linux/GSnull.cbp" />
<Project filename="../../plugins/SPU2null/Linux/SPU2null.cbp" />
<Project filename="../../plugins/PadNull/Linux/PadNull.cbp" />
<Project filename="../../plugins/onepad/Linux/OnePad.cbp" />
<Project filename="../../tools/bin2cpp/bin2cpp.cbp" />
</Workspace>
</CodeBlocks_workspace_file>

View File

@ -36,6 +36,7 @@
<Option output="$(SvnRootDir)/bin/pcsx2-dev" prefix_auto="1" extension_auto="1" />
<Option working_dir="$(SvnRootDir)/bin/" />
<Option object_output="./.objs/devel" />
<Option external_deps="../../tools/bin/bin2cpp;" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
@ -60,6 +61,7 @@
<Option output="$(SvnRootDir)/bin/pcsx2" prefix_auto="1" extension_auto="1" />
<Option working_dir="$(SvnRootDir)/bin/" />
<Option object_output="./.objs/release" />
<Option external_deps="../../tools/bin/bin2cpp;" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
@ -302,10 +304,19 @@
<Unit filename="../gui/Panels/SpeedhacksPanel.cpp" />
<Unit filename="../gui/Panels/VideoPanel.cpp" />
<Unit filename="../gui/Plugins.cpp" />
<Unit filename="../gui/Resources/AppIcon.h" />
<Unit filename="../gui/Resources/AppIcon.png">
<Unit filename="../gui/Resources/AppIcon16.h" />
<Unit filename="../gui/Resources/AppIcon16.png">
<Option compile="1" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/AppIcon32.h" />
<Unit filename="../gui/Resources/AppIcon32.png">
<Option compile="1" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/AppIcon64.h" />
<Unit filename="../gui/Resources/AppIcon64.png">
<Option compile="1" />
<Option weight="0" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/BackgroundLogo.h" />

View File

@ -26,7 +26,7 @@ Panels::GameFixesPanel::GameFixesPanel( wxWindow& parent, int idealWidth ) :
wxStaticBoxSizer& groupSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("PCSX2 Gamefixes") );
// NOTE: Oder of checkboxes must match the order of the bits in the GamefixOptions structure!
// NOTE: Order of checkboxes must match the order of the bits in the GamefixOptions structure!
// NOTE2: Don't make this static, because translations can change at run-time :)

View File

@ -1,7 +1,9 @@
#!/bin/sh
../../../tools/bin/bin2cpp BackgroundLogo.png
../../../tools/bin/bin2cpp AppIcon.png
../../../tools/bin/bin2cpp AppIcon16.png
../../../tools/bin/bin2cpp AppIcon32.png
../../../tools/bin/bin2cpp AppIcon64.png
../../../tools/bin/bin2cpp ConfigIcon_Cpu.png
../../../tools/bin/bin2cpp ConfigIcon_Paths.png

View File

@ -16,10 +16,6 @@
<Compiler>
<Add option="-g" />
</Compiler>
<Linker>
<Add option="`pkg-config gtk+-2.0 --libs`" />
<Add option="-shared" />
</Linker>
</Target>
<Target title="Release">
<Option output="../../../bin/plugins/libPadnull.so.0.1.0" prefix_auto="0" extension_auto="0" />
@ -45,6 +41,10 @@
<Add directory="../../PadNull" />
<Add directory="../../../common/include" />
</Compiler>
<Linker>
<Add option="`pkg-config gtk+-2.0 --libs`" />
<Add option="-shared" />
</Linker>
<Unit filename="Config.cpp" />
<Unit filename="Config.h" />
<Unit filename="PadLinux.cpp" />

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="OnePad" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="../../../bin/plugins/libOnePAD.so.0.1.0" prefix_auto="0" extension_auto="0" />
<Option object_output="obj/Debug/" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="../../../bin/plugins/libOnePAD.so.0.1.0" prefix_auto="0" extension_auto="0" />
<Option object_output="obj/Release/" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="`pkg-config gtk+-2.0 --cflags`" />
<Add option="`pkg-config sdl --cflags`" />
<Add option="-fPIC" />
<Add option="-m32" />
<Add directory="../Linux" />
<Add directory="../../onepad" />
<Add directory="../../../common/include" />
</Compiler>
<Linker>
<Add option="`pkg-config gtk+-2.0 --libs`" />
<Add option="`pkg-config sdl --libs`" />
<Add option="-shared" />
</Linker>
<Unit filename="callbacks.h" />
<Unit filename="gui.cpp" />
<Unit filename="ini.cpp" />
<Unit filename="interface.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="interface.h" />
<Unit filename="linux.cpp" />
<Unit filename="linux.h" />
<Unit filename="onepad.glade" />
<Unit filename="support.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="support.h" />
<Unit filename="../analog.cpp" />
<Unit filename="../analog.h" />
<Unit filename="../bitwise.h" />
<Unit filename="../controller.cpp" />
<Unit filename="../controller.h" />
<Unit filename="../joystick.cpp" />
<Unit filename="../joystick.h" />
<Unit filename="../keyboard.cpp" />
<Unit filename="../keyboard.h" />
<Unit filename="../onepad.cpp" />
<Unit filename="../onepad.h" />
<Extensions>
<code_completion />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,8 @@
#include "interface.h"
#include "support.h"
#define VERSION 1
#define GLADE_HOOKUP_OBJECT(component,widget,name) \
g_object_set_data_full (G_OBJECT (component), name, \
gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)

View File

@ -18,16 +18,16 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* Theoretically, this header is for anything to do with keyboard input.
* Pragmatically, event handing's going in here too.
*/
#include "keyboard.h"
__forceinline int FindKey(int key, int pad)
#include "keyboard.h"
int FindKey(int key, int pad)
{
for (int p = 0; p < MAX_SUB_KEYS; p++)
for (int i = 0; i < MAX_KEYS; i++)
@ -71,7 +71,7 @@ void PollForX11KeyboardInput(int pad)
KeySym key;
int keyPress = 0, keyRelease = 0;
int i;
// keyboard input
while (XPending(GSdsp) > 0)
{
@ -82,7 +82,7 @@ void PollForX11KeyboardInput(int pad)
key = XLookupKeysym((XKeyEvent *) & E, 0);
i = FindKey(key, pad);
// Analog controls.
if ((i > PAD_RY) && (i <= PAD_R_LEFT))
{
@ -103,10 +103,10 @@ void PollForX11KeyboardInput(int pad)
}
i += 0xff00;
}
if (i != -1)
if (i != -1)
{
clear_bit(keyRelease, i);
clear_bit(keyRelease, i);
set_bit(keyPress, i);
}
//PAD_LOG("Key pressed:%d\n", i);
@ -114,22 +114,22 @@ void PollForX11KeyboardInput(int pad)
event.evt = KEYPRESS;
event.key = key;
break;
case KeyRelease:
key = XLookupKeysym((XKeyEvent *) & E, 0);
i = FindKey(key, pad);
// Analog Controls.
if ((i > PAD_RY) && (i <= PAD_R_LEFT))
{
Analog::ResetPad(pad, Analog::AnalogToPad(i));
i += 0xff00;
}
if (i != -1)
if (i != -1)
{
clear_bit(keyPress, i);
clear_bit(keyPress, i);
set_bit(keyRelease, i);
}
@ -153,13 +153,13 @@ void PollForX11KeyboardInput(int pad)
bool PollX11Keyboard(char* &temp, u32 &pkey)
{
GdkEvent *ev = gdk_event_get();
if (ev != NULL)
{
if (ev->type == GDK_KEY_PRESS)
{
if (ev->key.keyval == GDK_Escape)
if (ev->key.keyval == GDK_Escape)
{
temp = "Unknown";
pkey = NULL;
@ -169,11 +169,11 @@ bool PollX11Keyboard(char* &temp, u32 &pkey)
temp = KeysymToChar(ev->key.keyval);
pkey = ev->key.keyval;
}
return true;
}
}
return false;
}
#else

View File

@ -18,16 +18,16 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __KEYBOARD_H__
#define __KEYBOARD_H__
#include "onepad.h"
#ifdef __LINUX__
#include "Linux/linux.h"
extern Display *GSdsp;
extern void PollForX11KeyboardInput(int pad);
extern bool PollX11Keyboard(char* &temp, u32 &pkey);
@ -38,10 +38,10 @@ extern WNDPROC GSwndProc;
extern HWND GShwnd;
#endif
extern char* KeysymToChar(int keysym);
extern void PollForKeyboardInput(int pad);
extern void SetAutoRepeat(bool autorep);
extern __forceinline int FindKey(int key, int pad);
extern int FindKey(int key, int pad);
#endif
#endif