diff --git a/360/main.c b/360/main.c index 4cdd16b786..e01b6127c9 100644 --- a/360/main.c +++ b/360/main.c @@ -147,24 +147,57 @@ static void set_default_settings(void) g_console.mode_switch = MODE_MENU; } -int main(int argc, char *argv[]) +static void get_environment_settings (void) { //for devkits only, we will need to mount all partitions for retail //in a different way //DmMapDevkitDrive(); + MountAll(); XSetFileCacheSize(0x100000); XMountUtilityDriveEx(XMOUNTUTILITYDRIVE_FORMAT0,8192, 0); - - ssnes_main_clear_state(); + // detect install environment + DWORD license_mask; + + if (XContentGetLicenseMask(&license_mask, NULL) != ERROR_SUCCESS) + { + printf("SSNES was launched as a standalone DVD, or using DVD emulation, or from the development area of the HDD.\n"); + } + else + { + XContentQueryVolumeDeviceType("GAME",&g_console.volume_device_type, NULL); + + switch(g_console.volume_device_type) + { + case XCONTENTDEVICETYPE_HDD: + printf("SSNES was launched from a content package on HDD.\n"); + break; + case XCONTENTDEVICETYPE_MU: + printf("SSNES was launched from a content package on USB or Memory Unit.\n"); + break; + case XCONTENTDEVICETYPE_ODD: + printf("SSNES was launched from a content package on Optical Disc Drive.\n"); + break; + default: + printf("SSNES was launched from a content package on an unknown device type.\n"); + break; + + } + } +} + +int main(int argc, char *argv[]) +{ + get_environment_settings(); + + ssnes_main_clear_state(); config_set_defaults(); set_default_settings(); xdk360_video_init(); - menu_init(); begin_loop: diff --git a/general.h b/general.h index 4a7e28af40..5561ca652f 100644 --- a/general.h +++ b/general.h @@ -189,6 +189,9 @@ struct console_settings uint32_t mode_switch; uint32_t *supported_resolutions; uint32_t supported_resolutions_count; +#ifdef _XBOX + DWORD volume_device_type; +#endif char rom_path[PATH_MAX]; char aspect_ratio_name[PATH_MAX]; char default_rom_startup_dir[PATH_MAX];