mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(360) Add some more XUI code - resource files from xzp files still
not loading - also added drive mounting code
This commit is contained in:
parent
94ff302111
commit
05607880f8
106
360/main.c
106
360/main.c
@ -18,23 +18,129 @@
|
||||
|
||||
#include <xtl.h>
|
||||
#include <stddef.h>
|
||||
#include <string>
|
||||
#include <xbdm.h>
|
||||
#include "menu.h"
|
||||
#include "xdk360_video.h"
|
||||
#include "../general.h"
|
||||
#include "shared.h"
|
||||
|
||||
#define DEVICE_MEMORY_UNIT0 1
|
||||
#define DEVICE_MEMORY_UNIT1 2
|
||||
#define DEVICE_MEMORY_ONBOARD 3
|
||||
#define DEVICE_CDROM0 4
|
||||
#define DEVICE_HARDISK0_PART1 5
|
||||
#define DEVICE_HARDISK0_SYSPART 6
|
||||
#define DEVICE_USB0 7
|
||||
#define DEVICE_USB1 8
|
||||
#define DEVICE_USB2 9
|
||||
#define DEVICE_TEST 10
|
||||
#define DEVICE_CACHE 11
|
||||
|
||||
typedef struct _STRING {
|
||||
USHORT Length;
|
||||
USHORT MaximumLength;
|
||||
PCHAR Buffer;
|
||||
} STRING;
|
||||
|
||||
extern "C" int __stdcall ObCreateSymbolicLink( STRING*, STRING*);
|
||||
|
||||
uint32_t mode_switch = MODE_MENU;
|
||||
int Mounted[20];
|
||||
|
||||
int ssnes_main(int argc, char *argv[]);
|
||||
|
||||
#undef main
|
||||
|
||||
static int DriveMounted(std::string path)
|
||||
{
|
||||
WIN32_FIND_DATA findFileData;
|
||||
memset(&findFileData,0,sizeof(WIN32_FIND_DATA));
|
||||
std::string searchcmd = path + "\\*.*";
|
||||
HANDLE hFind = FindFirstFile(searchcmd.c_str(), &findFileData);
|
||||
|
||||
if (hFind == INVALID_HANDLE_VALUE)
|
||||
return 0;
|
||||
|
||||
FindClose(hFind);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int Mount( int Device, char* MountPoint )
|
||||
{
|
||||
char MountConv[260];
|
||||
sprintf_s( MountConv,"\\??\\%s", MountPoint );
|
||||
|
||||
char * SysPath = NULL;
|
||||
switch( Device )
|
||||
{
|
||||
case DEVICE_MEMORY_UNIT0:
|
||||
SysPath = "\\Device\\Mu0";
|
||||
break;
|
||||
case DEVICE_MEMORY_UNIT1:
|
||||
SysPath = "\\Device\\Mu1";
|
||||
break;
|
||||
case DEVICE_MEMORY_ONBOARD:
|
||||
SysPath = "\\Device\\BuiltInMuSfc";
|
||||
break;
|
||||
case DEVICE_CDROM0:
|
||||
SysPath = "\\Device\\Cdrom0";
|
||||
break;
|
||||
case DEVICE_HARDISK0_PART1:
|
||||
SysPath = "\\Device\\Harddisk0\\Partition1";
|
||||
break;
|
||||
case DEVICE_HARDISK0_SYSPART:
|
||||
SysPath = "\\Device\\Harddisk0\\SystemPartition";
|
||||
break;
|
||||
case DEVICE_USB0:
|
||||
SysPath = "\\Device\\Mass0";
|
||||
break;
|
||||
case DEVICE_USB1:
|
||||
SysPath = "\\Device\\Mass1";
|
||||
break;
|
||||
case DEVICE_USB2:
|
||||
SysPath = "\\Device\\Mass2";
|
||||
break;
|
||||
case DEVICE_CACHE:
|
||||
SysPath = "\\Device\\Harddisk0\\Cache0";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
STRING sSysPath = { (USHORT)strlen( SysPath ), (USHORT)strlen( SysPath ) + 1, SysPath };
|
||||
STRING sMountConv = { (USHORT)strlen( MountConv ), (USHORT)strlen( MountConv ) + 1, MountConv };
|
||||
int res = ObCreateSymbolicLink( &sMountConv, &sSysPath );
|
||||
|
||||
if (res != 0)
|
||||
return res;
|
||||
|
||||
return DriveMounted(MountPoint);
|
||||
}
|
||||
|
||||
|
||||
static void MountAll()
|
||||
{
|
||||
memset(&Mounted,0,20);
|
||||
|
||||
Mounted[DEVICE_USB0] = Mount(DEVICE_USB0,"Usb0:");
|
||||
Mounted[DEVICE_USB1] = Mount(DEVICE_USB1,"Usb1:");
|
||||
Mounted[DEVICE_USB2] = Mount(DEVICE_USB2,"Usb2:");
|
||||
Mounted[DEVICE_HARDISK0_PART1] = Mount(DEVICE_HARDISK0_PART1,"Hdd1:");
|
||||
Mounted[DEVICE_HARDISK0_SYSPART] = Mount(DEVICE_HARDISK0_SYSPART,"HddX:");
|
||||
Mounted[DEVICE_MEMORY_UNIT0] = Mount(DEVICE_MEMORY_UNIT0,"Memunit0:");
|
||||
Mounted[DEVICE_MEMORY_UNIT1] = Mount(DEVICE_MEMORY_UNIT1,"Memunit1:");
|
||||
Mounted[DEVICE_MEMORY_ONBOARD] = Mount(DEVICE_MEMORY_ONBOARD,"OnBoardMU:");
|
||||
Mounted[DEVICE_CDROM0] = Mount(DEVICE_CDROM0,"Dvd:");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//for devkits only, we will need to mount all partitions for retail
|
||||
//in a different way
|
||||
//DmMapDevkitDrive();
|
||||
MountAll();
|
||||
ssnes_main_clear_state();
|
||||
|
||||
config_set_defaults();
|
||||
|
21
360/menu.cpp
21
360/menu.cpp
@ -26,13 +26,14 @@ HXUIOBJ hMainScene;
|
||||
/* Register custom classes */
|
||||
HRESULT CSSNES::RegisterXuiClasses (void)
|
||||
{
|
||||
return CSSNESMain::Register();
|
||||
CSSNESMain::Register();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/* Unregister custom classes */
|
||||
HRESULT CSSNES::UnregisterXuiClasses (void)
|
||||
{
|
||||
return CSSNESMain::Unregister();
|
||||
CSSNESMain::Unregister();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -51,16 +52,24 @@ int menu_init (void)
|
||||
}
|
||||
|
||||
/* Register font */
|
||||
hr = app.RegisterDefaultTypeface(L"Arial Unicode MS", L"file://game:/media/ssnes.ttf" );
|
||||
hr = app.RegisterDefaultTypeface(L"Arial Unicode MS", L"file://game/media/ssnes.ttf" );
|
||||
if (FAILED(hr))
|
||||
{
|
||||
OutputDebugString("Failed to register default typeface.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
app.LoadSkin( L"file://game:/media/ssnes.xzp#media\\ssnes_main_skin.xur");
|
||||
XuiSceneCreate( L"file://game:/media/ssnes.xzpmedia\\", L"ssnes_main.xur", NULL, &hMainScene);
|
||||
XuiSceneNavigateFirst( app.GetRootObj(), hMainScene, XUSER_INDEX_FOCUS);
|
||||
hr = app.LoadSkin( L"file://game:/media/ssnes.xzp#..\\..\\360\\media\\ssnes_main_skin.xur");
|
||||
if (FAILED(hr))
|
||||
{
|
||||
OutputDebugString("Failed to load skin.\n");
|
||||
}
|
||||
|
||||
hr = app.LoadFirstScene( L"file://game:/media/ssnes.xzp#..\\..\\360\\media\\ssnes_main.xur", NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
OutputDebugString("Failed to load first scene.\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -324,8 +324,8 @@
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="..\..\360\media\ssnes_main_skin.xui">
|
||||
<FileType>Document</FileType>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">xuipkg /nologo /d /o "$(OutDir)media\ssnes.xzp" %(RelativeDir)\*</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">$(OutDir)media\ssnes.xzp;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">xuipkg /nologo /o /d "$(OutDir)media\ssnes.xzp" %(RelativeDir)\*</Command>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">$(OutDir)media\ssnes.xzp;</Outputs>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">$(OutDir)media\ssnes.xzp;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">xuipkg /nologo /d /o "$(OutDir)media\ssnes.xzp" %(RelativeDir)\*</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release_LTCG|Xbox 360'">xuipkg /nologo /d /o "$(OutDir)media\ssnes.xzp" %(RelativeDir)\*</Command>
|
||||
|
@ -27,7 +27,7 @@
|
||||
<Filter Include="Source Files\conf">
|
||||
<UniqueIdentifier>{82e8787f-e939-4783-82e1-fcab34285121}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\skin">
|
||||
<Filter Include="Source Files\media">
|
||||
<UniqueIdentifier>{b7d54b1f-ffda-45f9-8175-7bf67010253d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
@ -205,10 +205,10 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="..\..\360\media\ssnes.ttf">
|
||||
<Filter>Source Files\skin</Filter>
|
||||
<Filter>Source Files\media</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="..\..\360\media\ssnes_main_skin.xui">
|
||||
<Filter>Source Files\skin</Filter>
|
||||
<Filter>Source Files\media</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="..\..\ssnes.cfg">
|
||||
<Filter>Source Files</Filter>
|
||||
|
Loading…
x
Reference in New Issue
Block a user