diff --git a/audio/drivers/gx_audio.c b/audio/drivers/gx_audio.c index 0c3eaa4aee..439ea8d0eb 100644 --- a/audio/drivers/gx_audio.c +++ b/audio/drivers/gx_audio.c @@ -27,7 +27,7 @@ #include #endif -#include "../../gfx/gx/gx_sdk_defines.h" +#include "../../gfx/drivers/gx_sdk_defines.h" #define CHUNK_FRAMES 64 #define CHUNK_SIZE (CHUNK_FRAMES * sizeof(uint32_t)) diff --git a/frontend/platform/platform_gx.c b/frontend/platform/platform_gx.c index 041a05c9f5..0e91b261b7 100644 --- a/frontend/platform/platform_gx.c +++ b/frontend/platform/platform_gx.c @@ -19,7 +19,7 @@ #include "../../driver.h" #include "../../general.h" #include "../../libretro_private.h" -#include "../../gfx/gx/gx_sdk_defines.h" +#include "../../gfx/drivers/gx_sdk_defines.h" #include diff --git a/frontend/platform/platform_psp.c b/frontend/platform/platform_psp.c index f29b924495..4d79dc845e 100644 --- a/frontend/platform/platform_psp.c +++ b/frontend/platform/platform_psp.c @@ -25,7 +25,7 @@ #include #include -#include "../../gfx/psp/psp_sdk_defines.h" +#include "../../gfx/drivers/psp_sdk_defines.h" #include #include "../../general.h" diff --git a/frontend/platform/platform_wii.c b/frontend/platform/platform_wii.c index 13a30c1184..d859cf26ef 100644 --- a/frontend/platform/platform_wii.c +++ b/frontend/platform/platform_wii.c @@ -21,7 +21,7 @@ #include #include #include -#include "../../gfx/gx/ppc_asm.h" +#include "../../gfx/drivers/ppc_asm.h" #include #include #include diff --git a/gfx/gx/gx_gfx.c b/gfx/drivers/gx_gfx.c similarity index 100% rename from gfx/gx/gx_gfx.c rename to gfx/drivers/gx_gfx.c diff --git a/gfx/gx/gx_gfx.h b/gfx/drivers/gx_gfx.h similarity index 100% rename from gfx/gx/gx_gfx.h rename to gfx/drivers/gx_gfx.h diff --git a/gfx/gx/gx_gfx_inl.h b/gfx/drivers/gx_gfx_inl.h similarity index 100% rename from gfx/gx/gx_gfx_inl.h rename to gfx/drivers/gx_gfx_inl.h diff --git a/gfx/gx/gx_sdk_defines.h b/gfx/drivers/gx_sdk_defines.h similarity index 100% rename from gfx/gx/gx_sdk_defines.h rename to gfx/drivers/gx_sdk_defines.h diff --git a/gfx/gx/ppc_asm.h b/gfx/drivers/ppc_asm.h similarity index 100% rename from gfx/gx/ppc_asm.h rename to gfx/drivers/ppc_asm.h diff --git a/gfx/psp/psp1_gfx.c b/gfx/drivers/psp1_gfx.c similarity index 100% rename from gfx/psp/psp1_gfx.c rename to gfx/drivers/psp1_gfx.c diff --git a/gfx/psp/psp1_gfx.h b/gfx/drivers/psp1_gfx.h similarity index 100% rename from gfx/psp/psp1_gfx.h rename to gfx/drivers/psp1_gfx.h diff --git a/gfx/drivers/psp_sdk_defines.h b/gfx/drivers/psp_sdk_defines.h new file mode 100644 index 0000000000..51759c0264 --- /dev/null +++ b/gfx/drivers/psp_sdk_defines.h @@ -0,0 +1,96 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2014 - Hans-Kristian Arntzen + * Copyright (C) 2011-2015 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#ifndef _PSP_SDK_DEFINES_H +#define _PSP_SDK_DEFINES_H + +/*============================================================ + ERROR PROTOTYPES +============================================================ */ + +#if defined(PSP) +#define SCE_OK 0 +#endif + +/*============================================================ + DISPLAY PROTOTYPES +============================================================ */ + +#if defined(SN_TARGET_PSP2) +#define PSP_DISPLAY_PIXEL_FORMAT_8888 (SCE_DISPLAY_PIXELFORMAT_A8B8G8R8) + +#define DisplaySetFrameBuf(topaddr, bufferwidth, pixelformat, sync) sceDisplaySetFrameBuf(topaddr, sync) + +#define PSP_FB_WIDTH 960 +#define PSP_FB_HEIGHT 544 +#define PSP_PITCH_PIXELS 1024 + +#elif defined(PSP) +#define DisplaySetFrameBuf(topaddr, bufferwidth, pixelformat, sync) sceDisplaySetFrameBuf(topaddr, bufferwidth, pixelformat, sync) + +#define SCE_DISPLAY_UPDATETIMING_NEXTVSYNC 1 + +#define PSP_FB_WIDTH 512 +#define PSP_FB_HEIGHT 512 +#define PSP_PITCH_PIXELS 512 + +#endif + +/*============================================================ + INPUT PROTOTYPES +============================================================ */ + +#if defined(SN_TARGET_PSP2) + +#define STATE_BUTTON(state) ((state).buttons) +#define STATE_ANALOGLX(state) ((state).lx) +#define STATE_ANALOGLY(state) ((state).ly) +#define STATE_ANALOGRX(state) ((state).rx) +#define STATE_ANALOGRY(state) ((state).ry) +#define DEFAULT_SAMPLING_MODE (SCE_CTRL_MODE_DIGITALANALOG) + +#define PSP_CTRL_LEFT SCE_CTRL_LEFT +#define PSP_CTRL_DOWN SCE_CTRL_DOWN +#define PSP_CTRL_RIGHT SCE_CTRL_RIGHT +#define PSP_CTRL_UP SCE_CTRL_UP +#define PSP_CTRL_START SCE_CTRL_START +#define PSP_CTRL_SELECT SCE_CTRL_SELECT +#define PSP_CTRL_TRIANGLE SCE_CTRL_TRIANGLE +#define PSP_CTRL_SQUARE SCE_CTRL_SQUARE +#define PSP_CTRL_CROSS SCE_CTRL_CROSS +#define PSP_CTRL_CIRCLE SCE_CTRL_CIRCLE +#define PSP_CTRL_L SCE_CTRL_L +#define PSP_CTRL_R SCE_CTRL_R + +#define CtrlPeekBufferPositive(port, pad_data, bufs) sceCtrlPeekBufferPositive(port, pad_data, bufs) + +#elif defined(PSP) + +#define PSP_CTRL_L PSP_CTRL_LTRIGGER +#define PSP_CTRL_R PSP_CTRL_RTRIGGER + +#define STATE_BUTTON(state) ((state).Buttons) +#define STATE_ANALOGLX(state) ((state).Lx) +#define STATE_ANALOGLY(state) ((state).Ly) +#define STATE_ANALOGRX(state) ((state).Rx) +#define STATE_ANALOGRY(state) ((state).Ry) + +#define DEFAULT_SAMPLING_MODE (PSP_CTRL_MODE_ANALOG) + +#define CtrlPeekBufferPositive(port, pad_data, bufs) sceCtrlPeekBufferPositive(pad_data, bufs) +#endif + +#endif diff --git a/griffin/griffin.c b/griffin/griffin.c index 35a67190f8..5a131f3544 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -224,9 +224,9 @@ VIDEO DRIVER #endif #if defined(GEKKO) -#include "../gfx/gx/gx_gfx.c" +#include "../gfx/drivers/gx_gfx.c" #elif defined(PSP) -#include "../gfx/psp/psp1_gfx.c" +#include "../gfx/drivers/psp1_gfx.c" #elif defined(XENON) #include "../gfx/drivers/xenon360_gfx.c" #endif diff --git a/input/drivers/psp_input.c b/input/drivers/psp_input.c index 9b3b4990fc..c34879184b 100644 --- a/input/drivers/psp_input.c +++ b/input/drivers/psp_input.c @@ -25,7 +25,7 @@ #include #endif -#include "../../gfx/psp/psp_sdk_defines.h" +#include "../../gfx/drivers/psp_sdk_defines.h" #include "../../driver.h" #include "../../libretro.h" diff --git a/wii/mem2_manager.c b/wii/mem2_manager.c index a45fe45eb9..3bd212d54f 100644 --- a/wii/mem2_manager.c +++ b/wii/mem2_manager.c @@ -5,7 +5,7 @@ #include #include #include -#include "../gfx/gx/ppc_asm.h" +#include "../gfx/drivers/ppc_asm.h" #include #include #include diff --git a/wii/vi_encoder.c b/wii/vi_encoder.c index d51264ef31..b2fdf3729b 100644 --- a/wii/vi_encoder.c +++ b/wii/vi_encoder.c @@ -40,7 +40,7 @@ #include #include #include -#include "../gfx/gx/ppc_asm.h" +#include "../gfx/drivers/ppc_asm.h" #include "vi_encoder.h"