diff --git a/Makefile.wii b/Makefile.wii index c9760a1694..4a0838a6d9 100644 --- a/Makefile.wii +++ b/Makefile.wii @@ -39,7 +39,7 @@ CFLAGS += -DHAVE_FILE_LOGGER CFLAGS += -Iconsole/logger endif -CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DRARCH_CONSOLE -DHAVE_CONFIGFILE=1 -DGEKKO -DHW_RVL -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"0.9.6\" -Dmain=rarch_main -Wno-char-subscripts +CFLAGS += -std=gnu99 -DHAVE_DEFAULT_RETROPAD_INPUT -DHAVE_RGUI -DRARCH_CONSOLE -DHAVE_CONFIGFILE=1 -DGEKKO -DHW_RVL -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"0.9.6\" -Dmain=rarch_main -Wno-char-subscripts ifeq ($(DEBUG), 1) CFLAGS += -O0 -g diff --git a/console/griffin/griffin.c b/console/griffin/griffin.c index 74587104f6..7a08a07405 100644 --- a/console/griffin/griffin.c +++ b/console/griffin/griffin.c @@ -285,12 +285,14 @@ MENU #include "../rmenu/rmenu.c" #endif +#ifdef HAVE_RGUI +#include "../rgui/rgui.c" +#include "../rgui/list.c" +#endif + #if defined(_XBOX360) #include "../../360/frontend-xdk/menu.cpp" #elif defined(_XBOX1) #include "../../xbox1/frontend/RetroLaunch/IoSupport.cpp" #include "../../xbox1/frontend/RetroLaunch/Surface.cpp" -#elif defined(GEKKO) -#include "../../wii/frontend/rgui.c" -#include "../../wii/frontend/list.c" #endif diff --git a/wii/frontend/list.c b/console/rgui/list.c similarity index 100% rename from wii/frontend/list.c rename to console/rgui/list.c diff --git a/wii/frontend/list.h b/console/rgui/list.h similarity index 100% rename from wii/frontend/list.h rename to console/rgui/list.h diff --git a/wii/frontend/rgui.c b/console/rgui/rgui.c similarity index 99% rename from wii/frontend/rgui.c rename to console/rgui/rgui.c index 32e6691231..3dc8c363ef 100644 --- a/wii/frontend/rgui.c +++ b/console/rgui/rgui.c @@ -732,4 +732,3 @@ const char *rgui_iterate(rgui_handle_t *rgui, rgui_action_t action) return found ? rgui->path_buf : NULL; } - diff --git a/wii/frontend/rgui.h b/console/rgui/rgui.h similarity index 100% rename from wii/frontend/rgui.h rename to console/rgui/rgui.h diff --git a/wii/frontend/main.c b/wii/frontend/main.c index 18739fd007..8a5c281ecf 100644 --- a/wii/frontend/main.c +++ b/wii/frontend/main.c @@ -17,11 +17,12 @@ #undef main #include -#include "rgui.h" #include "../../driver.h" #include "../../general.h" #include "../../libretro.h" +#include "../../console/rgui/rgui.h" + #include "../../console/rarch_console_input.h" #include "../../console/rarch_console_main_wrap.h" diff --git a/xbox1/frontend/RetroLaunch/IoSupport.cpp b/xbox1/frontend/RetroLaunch/IoSupport.cpp index cb0d3065f6..5652d68e81 100644 --- a/xbox1/frontend/RetroLaunch/IoSupport.cpp +++ b/xbox1/frontend/RetroLaunch/IoSupport.cpp @@ -24,106 +24,107 @@ HRESULT xbox_io_mount(char *szDrive, char *szDevice) { - char szSourceDevice[48]; - char szDestinationDrive[16]; + char szSourceDevice[48]; + char szDestinationDrive[16]; - snprintf(szSourceDevice, sizeof(szSourceDevice), "\\Device\\%s", szDevice); - snprintf(szDestinationDrive, sizeof(szDestinationDrive), "\\??\\%s", szDrive); + snprintf(szSourceDevice, sizeof(szSourceDevice), "\\Device\\%s", szDevice); + snprintf(szDestinationDrive, sizeof(szDestinationDrive), "\\??\\%s", szDrive); - STRING DeviceName = - { - strlen(szSourceDevice), - strlen(szSourceDevice) + 1, - szSourceDevice - }; + STRING DeviceName = + { + strlen(szSourceDevice), + strlen(szSourceDevice) + 1, + szSourceDevice + }; - STRING LinkName = - { - strlen(szDestinationDrive), - strlen(szDestinationDrive) + 1, - szDestinationDrive - }; + STRING LinkName = + { + strlen(szDestinationDrive), + strlen(szDestinationDrive) + 1, + szDestinationDrive + }; - IoCreateSymbolicLink(&LinkName, &DeviceName); + IoCreateSymbolicLink(&LinkName, &DeviceName); - return S_OK; + return S_OK; } HRESULT xbox_io_unmount(char *szDrive) { - char szDestinationDrive[16]; - snprintf(szDestinationDrive, sizeof(szDestinationDrive), "\\??\\%s", szDrive); + char szDestinationDrive[16]; + snprintf(szDestinationDrive, sizeof(szDestinationDrive), "\\??\\%s", szDrive); - STRING LinkName = - { - strlen(szDestinationDrive), - strlen(szDestinationDrive) + 1, - szDestinationDrive - }; + STRING LinkName = + { + strlen(szDestinationDrive), + strlen(szDestinationDrive) + 1, + szDestinationDrive + }; - IoDeleteSymbolicLink(&LinkName); + IoDeleteSymbolicLink(&LinkName); - return S_OK; + return S_OK; } HRESULT xbox_io_remount(char *szDrive, char *szDevice) { - char szSourceDevice[48]; - snprintf(szSourceDevice, sizeof(szSourceDevice), "\\Device\\%s", szDevice); + char szSourceDevice[48]; + snprintf(szSourceDevice, sizeof(szSourceDevice), "\\Device\\%s", szDevice); - xbox_io_unmount(szDrive); + xbox_io_unmount(szDrive); - ANSI_STRING filename; - OBJECT_ATTRIBUTES attributes; - IO_STATUS_BLOCK status; - HANDLE hDevice; - NTSTATUS error; - DWORD dummy; + ANSI_STRING filename; + OBJECT_ATTRIBUTES attributes; + IO_STATUS_BLOCK status; + HANDLE hDevice; + NTSTATUS error; + DWORD dummy; - RtlInitAnsiString(&filename, szSourceDevice); - InitializeObjectAttributes(&attributes, &filename, OBJ_CASE_INSENSITIVE, NULL); + RtlInitAnsiString(&filename, szSourceDevice); + InitializeObjectAttributes(&attributes, &filename, OBJ_CASE_INSENSITIVE, NULL); - if (!NT_SUCCESS(error = NtCreateFile(&hDevice, GENERIC_READ | + if (!NT_SUCCESS(error = NtCreateFile(&hDevice, GENERIC_READ | SYNCHRONIZE | FILE_READ_ATTRIBUTES, &attributes, &status, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_OPEN, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT))) - { - return E_FAIL; - } + { + return E_FAIL; + } - if (!DeviceIoControl(hDevice, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &dummy, NULL)) - { - CloseHandle(hDevice); - return E_FAIL; - } + if (!DeviceIoControl(hDevice, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &dummy, NULL)) + { + CloseHandle(hDevice); + return E_FAIL; + } - CloseHandle(hDevice); - xbox_io_mount(szDrive, szDevice); + CloseHandle(hDevice); + xbox_io_mount(szDrive, szDevice); - return S_OK; + return S_OK; } HRESULT xbox_io_remap(char *szMapping) { - char szMap[32]; - strlcpy(szMap, szMapping, sizeof(szMap)); + char szMap[32]; + strlcpy(szMap, szMapping, sizeof(szMap)); - char *pComma = strstr(szMap, ","); - if (pComma) - { - *pComma = 0; + char *pComma = strstr(szMap, ","); - // map device to drive letter - xbox_io_unmount(szMap); - xbox_io_mount(szMap, &pComma[1]); - return S_OK; - } + if (pComma) + { + *pComma = 0; - return E_FAIL; + // map device to drive letter + xbox_io_unmount(szMap); + xbox_io_mount(szMap, &pComma[1]); + return S_OK; + } + + return E_FAIL; } HRESULT xbox_io_shutdown(void) { - HalInitiateShutdown(); - return S_OK; -} \ No newline at end of file + HalInitiateShutdown(); + return S_OK; +} diff --git a/xbox1/frontend/RetroLaunch/Surface.cpp b/xbox1/frontend/RetroLaunch/Surface.cpp index 639b7cc3f7..e80b561f08 100644 --- a/xbox1/frontend/RetroLaunch/Surface.cpp +++ b/xbox1/frontend/RetroLaunch/Surface.cpp @@ -22,10 +22,10 @@ bool d3d_surface_new(d3d_surface_t *surface, const char *filename) { xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data; - surface->m_pTexture = NULL; - surface->m_pVertexBuffer = NULL; + surface->m_pTexture = NULL; + surface->m_pVertexBuffer = NULL; - HRESULT ret = D3DXCreateTextureFromFileExA(d3d->d3d_render_device, // d3d device + HRESULT ret = D3DXCreateTextureFromFileExA(d3d->d3d_render_device, // d3d device filename, // filename D3DX_DEFAULT, // width D3DX_DEFAULT, // height @@ -40,93 +40,93 @@ bool d3d_surface_new(d3d_surface_t *surface, const char *filename) NULL, // pallete &surface->m_pTexture); // texture - if (FAILED(ret)) - { - RARCH_ERR("Error occurred during D3DXCreateTextureFromFileExA().\n"); - return false; - } + if(FAILED(ret)) + { + RARCH_ERR("Error occurred during D3DXCreateTextureFromFileExA().\n"); + return false; + } - // create a vertex buffer for the quad that will display the texture + // create a vertex buffer for the quad that will display the texture ret = d3d->d3d_render_device->CreateVertexBuffer(4 * sizeof(DrawVerticeFormats), D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_MANAGED, &surface->m_pVertexBuffer); - if (FAILED(ret)) - { - RARCH_ERR("Error occurred during CreateVertexBuffer().\n"); - surface->m_pTexture->Release(); - return false; - } + if (FAILED(ret)) + { + RARCH_ERR("Error occurred during CreateVertexBuffer().\n"); + surface->m_pTexture->Release(); + return false; + } - return true; + return true; } void d3d_surface_free(d3d_surface_t *surface) { - // free the vertex buffer - if (surface->m_pVertexBuffer) - { - surface->m_pVertexBuffer->Release(); - surface->m_pVertexBuffer = NULL; - } + // free the vertex buffer + if (surface->m_pVertexBuffer) + { + surface->m_pVertexBuffer->Release(); + surface->m_pVertexBuffer = NULL; + } - // free the texture - if (surface->m_pTexture) - { - surface->m_pTexture->Release(); - surface->m_pTexture = NULL; - } + // free the texture + if (surface->m_pTexture) + { + surface->m_pTexture->Release(); + surface->m_pTexture = NULL; + } } bool d3d_surface_render(d3d_surface_t *surface, int x, int y, int32_t w, int32_t h) { xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data; - if (surface->m_pTexture == NULL || surface->m_pVertexBuffer == NULL) - return false; + if (surface->m_pTexture == NULL || surface->m_pVertexBuffer == NULL) + return false; - float fX = static_cast(x); - float fY = static_cast(y); + float fX = static_cast(x); + float fY = static_cast(y); // create the new vertices DrawVerticeFormats newVerts[] = - { - // x, y, z, color, u ,v + { + // x, y, z, color, u ,v {fX, fY, 0.0f, 0, 0, 0}, {fX + w, fY, 0.0f, 0, 1, 0}, {fX + w, fY + h, 0.0f, 0, 1, 1}, {fX, fY + h, 0.0f, 0, 0, 1} - }; + }; - // load the existing vertices + // load the existing vertices DrawVerticeFormats *pCurVerts; - HRESULT ret = surface->m_pVertexBuffer->Lock(0, 0, (unsigned char**)&pCurVerts, 0); + HRESULT ret = surface->m_pVertexBuffer->Lock(0, 0, (unsigned char**)&pCurVerts, 0); - if (FAILED(ret)) - { - RARCH_ERR("Error occurred during m_pVertexBuffer->Lock().\n"); - return false; - } + if (FAILED(ret)) + { + RARCH_ERR("Error occurred during m_pVertexBuffer->Lock().\n"); + return false; + } - // copy the new verts over the old verts - memcpy(pCurVerts, newVerts, 4 * sizeof(DrawVerticeFormats)); + // copy the new verts over the old verts + memcpy(pCurVerts, newVerts, 4 * sizeof(DrawVerticeFormats)); - surface->m_pVertexBuffer->Unlock(); + surface->m_pVertexBuffer->Unlock(); d3d->d3d_render_device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); - d3d->d3d_render_device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - d3d->d3d_render_device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); + d3d->d3d_render_device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); + d3d->d3d_render_device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - // also blend the texture with the set alpha value - d3d->d3d_render_device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); - d3d->d3d_render_device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); - d3d->d3d_render_device->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE); + // also blend the texture with the set alpha value + d3d->d3d_render_device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); + d3d->d3d_render_device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); + d3d->d3d_render_device->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE); - // draw the quad - d3d->d3d_render_device->SetTexture(0, surface->m_pTexture); - d3d->d3d_render_device->SetStreamSource(0, surface->m_pVertexBuffer, sizeof(DrawVerticeFormats)); - d3d->d3d_render_device->SetVertexShader(D3DFVF_CUSTOMVERTEX); - d3d->d3d_render_device->DrawPrimitive(D3DPT_QUADLIST, 0, 1); + // draw the quad + d3d->d3d_render_device->SetTexture(0, surface->m_pTexture); + d3d->d3d_render_device->SetStreamSource(0, surface->m_pVertexBuffer, sizeof(DrawVerticeFormats)); + d3d->d3d_render_device->SetVertexShader(D3DFVF_CUSTOMVERTEX); + d3d->d3d_render_device->DrawPrimitive(D3DPT_QUADLIST, 0, 1); - return true; + return true; }