├── xb ├── android └── android_studio_project │ ├── app │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ │ └── strings.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ └── layout │ │ │ │ ├── activity_window_demo.xml │ │ │ │ └── activity_gpu_trace_viewer.xml │ │ │ └── java │ │ │ └── jp │ │ │ └── xenia │ │ │ ├── emulator │ │ │ ├── WindowDemoActivity.java │ │ │ └── GpuTraceViewerActivity.java │ │ │ └── XeniaRuntimeException.java │ └── proguard-rules.pro │ ├── settings.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── .gitignore │ └── build.gradle ├── third_party ├── .clang-format ├── crypto │ └── des │ │ ├── des_lookup.h │ │ ├── README.md │ │ ├── descbc.h │ │ ├── des3.h │ │ └── des_key.h ├── pugixml.lua ├── xxhash.lua ├── dxbc.lua ├── aes_128.lua ├── fmt.lua ├── mspack │ └── logging.cc ├── zstd.lua ├── tomlplusplus.lua ├── cxxopts.lua ├── mspack.lua ├── binutils │ └── README.md ├── imgui.lua ├── microprofile │ └── README.md ├── zarchive.lua ├── snappy.lua └── capstone.lua ├── assets ├── icon │ ├── 1024.png │ ├── 128.png │ ├── 16.png │ ├── 256.png │ ├── 32.png │ ├── 48.png │ ├── 512.png │ ├── 64.png │ ├── icon.ico │ └── extra │ │ ├── 114.png │ │ ├── 120.png │ │ ├── 144.png │ │ ├── 150.png │ │ ├── 152.png │ │ ├── 180.png │ │ ├── 192.png │ │ ├── 310.png │ │ ├── 36.png │ │ ├── 57.png │ │ ├── 60.png │ │ ├── 70.png │ │ ├── 72.png │ │ ├── 76.png │ │ └── 96.png └── discord │ └── app.png ├── src └── xenia │ ├── gpu │ ├── shaders │ │ ├── resolve_full_16bpp.cs.xesl │ │ ├── resolve_full_32bpp.cs.xesl │ │ ├── resolve_full_64bpp.cs.xesl │ │ ├── resolve_full_8bpp.cs.xesl │ │ ├── bytecode │ │ │ └── .clang-format │ │ ├── resolve_clear_32bpp.cs.xesl │ │ ├── resolve_clear_64bpp.cs.xesl │ │ ├── resolve_full_128bpp.cs.xesl │ │ ├── resolve_fast_32bpp_4xmsaa.cs.xesl │ │ ├── resolve_fast_64bpp_4xmsaa.cs.xesl │ │ ├── resolve_fast_32bpp_1x2xmsaa.cs.xesl │ │ ├── resolve_fast_64bpp_1x2xmsaa.cs.xesl │ │ ├── discrete_quad_1cp.hs.hlsl │ │ ├── discrete_quad_4cp.hs.hlsl │ │ ├── continuous_quad_1cp.hs.hlsl │ │ ├── continuous_quad_4cp.hs.hlsl │ │ ├── resolve_clear_32bpp_scaled.cs.xesl │ │ ├── resolve_clear_64bpp_scaled.cs.xesl │ │ ├── resolve_full_128bpp_scaled.cs.xesl │ │ ├── resolve_full_16bpp_scaled.cs.xesl │ │ ├── resolve_full_32bpp_scaled.cs.xesl │ │ ├── resolve_full_64bpp_scaled.cs.xesl │ │ ├── resolve_full_8bpp_scaled.cs.xesl │ │ ├── discrete_triangle_1cp.hs.hlsl │ │ ├── discrete_triangle_3cp.hs.hlsl │ │ ├── continuous_triangle_1cp.hs.hlsl │ │ ├── continuous_triangle_3cp.hs.hlsl │ │ ├── resolve_fast_32bpp_4xmsaa_scaled.cs.xesl │ │ ├── resolve_fast_64bpp_4xmsaa_scaled.cs.xesl │ │ ├── resolve_fast_32bpp_1x2xmsaa_scaled.cs.xesl │ │ ├── resolve_fast_64bpp_1x2xmsaa_scaled.cs.xesl │ │ ├── clear_uint2.ps.hlsl │ │ ├── fxaa.cs.hlsl │ │ ├── fxaa_extreme.cs.hlsl │ │ ├── apply_gamma_pwl.ps.xesl │ │ ├── apply_gamma_table.ps.xesl │ │ ├── texture_load_8bpb.cs.xesl │ │ ├── texture_load_128bpb.cs.xesl │ │ ├── apply_gamma_pwl.cs.xesl │ │ ├── apply_gamma_table.cs.xesl │ │ ├── apply_gamma_pwl_fxaa_luma.ps.xesl │ │ ├── apply_gamma_table_fxaa_luma.ps.xesl │ │ ├── texture_load_8bpb_scaled.cs.xesl │ │ ├── texture_load_128bpb_scaled.cs.xesl │ │ ├── texture_load_16bpb.cs.xesl │ │ ├── texture_load_32bpb.cs.xesl │ │ ├── texture_load_64bpb.cs.xesl │ │ ├── apply_gamma_pwl_fxaa_luma.cs.xesl │ │ ├── apply_gamma_table_fxaa_luma.cs.xesl │ │ ├── texture_load_bgrg8_rgbg8.cs.xesl │ │ ├── texture_load_gbgr8_grgb8.cs.xesl │ │ ├── texture_load_r5g6b5_b5g6r5.cs.xesl │ │ ├── tessellation_indexed.vs.hlsl │ │ ├── texture_load_r16_snorm_float.cs.xesl │ │ ├── texture_load_r16_unorm_float.cs.xesl │ │ ├── texture_load_r4g4b4a4_a4r4g4b4.cs.xesl │ │ ├── texture_load_r4g4b4a4_b4g4r4a4.cs.xesl │ │ ├── texture_load_r5g5b5a1_b5g5r5a1.cs.xesl │ │ ├── texture_load_16bpb_scaled.cs.xesl │ │ ├── texture_load_32bpb_scaled.cs.xesl │ │ ├── texture_load_64bpb_scaled.cs.xesl │ │ ├── texture_load_rg16_snorm_float.cs.xesl │ │ ├── texture_load_rg16_unorm_float.cs.xesl │ │ ├── texture_load_rgba16_snorm_float.cs.xesl │ │ ├── texture_load_rgba16_unorm_float.cs.xesl │ │ ├── texture_load_bgrg8_rgb8.cs.xesl │ │ ├── texture_load_gbgr8_rgb8.cs.xesl │ │ ├── texture_load_r10g11b11_rgba16.cs.xesl │ │ ├── texture_load_r11g11b10_rgba16.cs.xesl │ │ ├── float24_round.ps.hlsl │ │ ├── texture_load_r10g11b11_rgba16_snorm.cs.xesl │ │ ├── texture_load_r11g11b10_rgba16_snorm.cs.xesl │ │ ├── texture_load_r5g5b6_b5g6r5_swizzle_rbga.cs.xesl │ │ ├── texture_load_depth_float.cs.xesl │ │ ├── texture_load_dxt3aas1111_argb4.cs.xesl │ │ ├── texture_load_dxt3aas1111_bgra4.cs.xesl │ │ ├── texture_load_depth_unorm.cs.xesl │ │ ├── texture_load_r5g6b5_b5g6r5_scaled.cs.xesl │ │ ├── texture_load_r16_snorm_float_scaled.cs.xesl │ │ ├── texture_load_r16_unorm_float_scaled.cs.xesl │ │ ├── texture_load_r4g4b4a4_a4r4g4b4_scaled.cs.xesl │ │ ├── texture_load_r4g4b4a4_b4g4r4a4_scaled.cs.xesl │ │ ├── texture_load_r5g5b5a1_b5g5r5a1_scaled.cs.xesl │ │ ├── texture_load_rg16_snorm_float_scaled.cs.xesl │ │ ├── texture_load_rg16_unorm_float_scaled.cs.xesl │ │ ├── texture_load_rgba16_snorm_float_scaled.cs.xesl │ │ ├── texture_load_rgba16_unorm_float_scaled.cs.xesl │ │ ├── texture_load_r10g11b11_rgba16_scaled.cs.xesl │ │ ├── texture_load_r11g11b10_rgba16_scaled.cs.xesl │ │ ├── texture_load_r10g11b11_rgba16_snorm_scaled.cs.xesl │ │ ├── texture_load_r11g11b10_rgba16_snorm_scaled.cs.xesl │ │ ├── texture_load_r5g5b6_b5g6r5_swizzle_rbga_scaled.cs.xesl │ │ ├── texture_load_depth_float_scaled.cs.xesl │ │ ├── texture_load_depth_unorm_scaled.cs.xesl │ │ ├── tessellation_adaptive.vs.hlsl │ │ └── passthrough_position_xy.vs.xesl │ └── null │ │ └── premake5.lua │ ├── ui │ ├── shaders │ │ ├── bytecode │ │ │ └── .clang-format │ │ ├── guest_output_bilinear.ps.xesl │ │ ├── guest_output_ffx_fsr_rcas.ps.xesl │ │ ├── guest_output_ffx_cas_sharpen.ps.xesl │ │ ├── guest_output_ffx_cas_resample.ps.xesl │ │ ├── guest_output_bilinear_dither.ps.xesl │ │ ├── guest_output_ffx_fsr_rcas_dither.ps.xesl │ │ ├── guest_output_ffx_cas_sharpen_dither.ps.xesl │ │ ├── guest_output_ffx_cas_resample_dither.ps.xesl │ │ └── amd_language.xesli │ ├── vulkan │ │ └── functions │ │ │ ├── instance_khr_xcb_surface.inc │ │ │ ├── instance_khr_android_surface.inc │ │ │ ├── instance_khr_win32_surface.inc │ │ │ ├── instance_ext_debug_utils.inc │ │ │ ├── device_1_1_khr_bind_memory2.inc │ │ │ ├── device_khr_swapchain.inc │ │ │ ├── instance_khr_surface.inc │ │ │ ├── device_1_3_khr_maintenance4.inc │ │ │ ├── device_1_1_khr_get_memory_requirements2.inc │ │ │ ├── instance_1_1_khr_get_physical_device_properties2.inc │ │ │ └── instance_1_0.inc │ ├── windowed_app_main_android.cc │ ├── premake5.lua │ ├── windowed_app.cc │ └── d3d12 │ │ └── premake5.lua │ ├── app │ ├── main_resources.rc │ └── discord │ │ ├── premake5.lua │ │ └── discord_presence.h │ ├── cpu │ ├── ppc │ │ ├── testing │ │ │ ├── instr_fnabs.s │ │ │ ├── instr_vexptefp.s │ │ │ ├── instr_vaddshs.s │ │ │ ├── instr_vadduhm.s │ │ │ ├── instr_vsubuhm.s │ │ │ ├── instr_vor.s │ │ │ ├── instr_vand.s │ │ │ ├── instr_vandc.s │ │ │ ├── instr_vrlh.s │ │ │ ├── instr_vsrah.s │ │ │ ├── instr_vsrh.s │ │ │ ├── instr_vxor.s │ │ │ ├── instr_vavguh.s │ │ │ ├── instr_vor128.s │ │ │ ├── instr_fsqrt.s │ │ │ ├── instr_vand128.s │ │ │ ├── instr_vandc128.s │ │ │ ├── instr_vxor128.s │ │ │ ├── instr_vmsum4fp128.s │ │ │ ├── instr_vaddfp.s │ │ │ ├── instr_vsubfp.s │ │ │ ├── instr_nor.s │ │ │ ├── instr_vavgsh.s │ │ │ ├── instr_vpkpx.s │ │ │ ├── instr_fadd.s │ │ │ ├── instr_fmul.s │ │ │ ├── instr_vmaxfp.s │ │ │ ├── instr_vminfp.s │ │ │ ├── instr_vaddfp128.s │ │ │ ├── instr_vmaxfp128.s │ │ │ ├── instr_vminfp128.s │ │ │ ├── instr_vmsum3fp128.s │ │ │ ├── instr_vrfin.s │ │ │ ├── instr_vsubfp128.s │ │ │ ├── instr_vpkswus.s │ │ │ ├── instr_vpkswus128.s │ │ │ ├── instr_vspltisb.s │ │ │ ├── instr_vspltish.s │ │ │ ├── instr_vspltisw.s │ │ │ ├── instr_frsqrte.s │ │ │ ├── instr_vpkshus.s │ │ │ ├── instr_vpkuhus.s │ │ │ ├── instr_vpkshus128.s │ │ │ ├── instr_vpkuhus128.s │ │ │ ├── instr_lvl.s │ │ │ ├── instr_vupkhsb.s │ │ │ ├── instr_vupklsb.s │ │ │ ├── instr_vupkhsb128.s │ │ │ ├── instr_vupklsb128.s │ │ │ ├── instr_vcfsx.s │ │ │ ├── instr_vsubshs.s │ │ │ ├── instr_vsplth.s │ │ │ ├── instr_vspltw.s │ │ │ ├── instr_rlwimi.s │ │ │ ├── instr_vspltb.s │ │ │ ├── instr_vmaxsh.s │ │ │ ├── instr_vmaxuh.s │ │ │ ├── instr_vminsh.s │ │ │ ├── instr_vminuh.s │ │ │ ├── instr_vmrghb.s │ │ │ ├── instr_vmrglb.s │ │ │ ├── instr_fsel.s │ │ │ ├── instr_neg.s │ │ │ ├── instr_fabs.s │ │ │ ├── instr_vupklsh.s │ │ │ ├── instr_vupkhsh.s │ │ │ ├── seq_jumptable_constants.s │ │ │ ├── instr_ori.s │ │ │ ├── instr_vpkuwus.s │ │ │ └── instr_vpkuwus128.s │ │ └── ppc_emit.h │ ├── testing │ │ └── premake5.lua │ ├── premake5.lua │ ├── backend │ │ ├── x64 │ │ │ └── premake5.lua │ │ └── assembler.cc │ ├── stack_walker_posix.cc │ └── compiler │ │ └── passes │ │ └── conditional_group_subpass.cc │ ├── vfs │ ├── testing │ │ └── premake5.lua │ ├── device.cc │ └── premake5.lua │ ├── base │ ├── testing │ │ └── premake5.lua │ ├── premake5.lua │ ├── console_posix.cc │ ├── console.h │ ├── xxhash.h │ ├── platform_linux.h │ ├── README.md │ └── png_utils.h │ ├── patcher │ └── premake5.lua │ ├── apu │ ├── nop │ │ └── premake5.lua │ ├── xaudio2 │ │ └── premake5.lua │ ├── debug_visualizers.natvis │ ├── sdl │ │ └── premake5.lua │ ├── premake5.lua │ ├── apu_flags.cc │ ├── apu_flags.h │ └── audio_driver.cc │ ├── helper │ └── sdl │ │ └── premake5.lua │ ├── hid │ ├── nop │ │ ├── premake5.lua │ │ ├── nop_hid.cc │ │ └── nop_hid.h │ ├── xinput │ │ ├── premake5.lua │ │ ├── xinput_hid.cc │ │ └── xinput_hid.h │ ├── winkey │ │ ├── premake5.lua │ │ ├── winkey_hid.cc │ │ └── winkey_hid.h │ ├── premake5.lua │ ├── sdl │ │ ├── premake5.lua │ │ ├── sdl_hid.cc │ │ └── sdl_hid.h │ ├── skylander │ │ ├── premake5.lua │ │ └── skylander_portal.cc │ ├── hid_flags.cc │ └── hid_flags.h │ ├── premake5.lua │ ├── debug │ ├── ui │ │ └── premake5.lua │ └── gdb │ │ └── premake5.lua │ ├── kernel │ ├── debug_visualizers.natvis │ ├── util │ │ ├── ordinal_table_post.inc │ │ ├── export_table_post.inc │ │ ├── kernel_fwd.h │ │ └── shim_utils.cc │ ├── xbdm │ │ ├── xbdm_module_export_groups.inc │ │ └── xbdm_ordinals.h │ ├── kernel_flags.h │ ├── kernel_flags.cc │ ├── premake5.lua │ ├── xboxkrnl │ │ ├── xboxkrnl_error.h │ │ ├── xboxkrnl_video.h │ │ └── xboxkrnl_modules.h │ └── xam │ │ └── xam_ordinals.h │ ├── tools │ └── api-scanner │ │ └── README.md │ ├── cpp.hint │ └── config.h ├── docs ├── images │ ├── CPU-JIT.png │ └── shader_playground.png ├── ppc │ ├── core_instructions.pdf │ └── altivec_instructions.pdf └── instruction_tracing.md ├── tools ├── vswhere │ └── vswhere.exe ├── build │ ├── bin │ │ └── premake5.exe │ ├── premake5.lua │ └── scripts │ │ ├── build_paths.lua │ │ └── single_library.lua ├── shader-playground │ ├── App.config │ ├── README.md │ └── shader-playground.sln └── diff.py ├── .codacy.yaml ├── .github └── ISSUE_TEMPLATE │ └── config.yml ├── .gdbinit ├── .clang-format ├── .gitattributes └── xb.ps1 /xb: -------------------------------------------------------------------------------- 1 | xenia-build.py 2 | -------------------------------------------------------------------------------- /android/android_studio_project/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /third_party/.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: false 3 | -------------------------------------------------------------------------------- /assets/icon/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/1024.png -------------------------------------------------------------------------------- /assets/icon/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/128.png -------------------------------------------------------------------------------- /assets/icon/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/16.png -------------------------------------------------------------------------------- /assets/icon/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/256.png -------------------------------------------------------------------------------- /assets/icon/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/32.png -------------------------------------------------------------------------------- /assets/icon/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/48.png -------------------------------------------------------------------------------- /assets/icon/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/512.png -------------------------------------------------------------------------------- /assets/icon/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/64.png -------------------------------------------------------------------------------- /assets/icon/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/icon.ico -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_full_16bpp.cs.xesl: -------------------------------------------------------------------------------- 1 | #include "resolve_full_16bpp.xesli" 2 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_full_32bpp.cs.xesl: -------------------------------------------------------------------------------- 1 | #include "resolve_full_32bpp.xesli" 2 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_full_64bpp.cs.xesl: -------------------------------------------------------------------------------- 1 | #include "resolve_full_64bpp.xesli" 2 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_full_8bpp.cs.xesl: -------------------------------------------------------------------------------- 1 | #include "resolve_full_8bpp.xesli" 2 | -------------------------------------------------------------------------------- /android/android_studio_project/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name = "Xenia" -------------------------------------------------------------------------------- /assets/discord/app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/discord/app.png -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/bytecode/.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: false 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_clear_32bpp.cs.xesl: -------------------------------------------------------------------------------- 1 | #include "resolve_clear_32bpp.xesli" 2 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_clear_64bpp.cs.xesl: -------------------------------------------------------------------------------- 1 | #include "resolve_clear_64bpp.xesli" 2 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_full_128bpp.cs.xesl: -------------------------------------------------------------------------------- 1 | #include "resolve_full_128bpp.xesli" 2 | -------------------------------------------------------------------------------- /src/xenia/ui/shaders/bytecode/.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: false 3 | -------------------------------------------------------------------------------- /assets/icon/extra/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/114.png -------------------------------------------------------------------------------- /assets/icon/extra/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/120.png -------------------------------------------------------------------------------- /assets/icon/extra/144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/144.png -------------------------------------------------------------------------------- /assets/icon/extra/150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/150.png -------------------------------------------------------------------------------- /assets/icon/extra/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/152.png -------------------------------------------------------------------------------- /assets/icon/extra/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/180.png -------------------------------------------------------------------------------- /assets/icon/extra/192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/192.png -------------------------------------------------------------------------------- /assets/icon/extra/310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/310.png -------------------------------------------------------------------------------- /assets/icon/extra/36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/36.png -------------------------------------------------------------------------------- /assets/icon/extra/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/57.png -------------------------------------------------------------------------------- /assets/icon/extra/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/60.png -------------------------------------------------------------------------------- /assets/icon/extra/70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/70.png -------------------------------------------------------------------------------- /assets/icon/extra/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/72.png -------------------------------------------------------------------------------- /assets/icon/extra/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/76.png -------------------------------------------------------------------------------- /assets/icon/extra/96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/assets/icon/extra/96.png -------------------------------------------------------------------------------- /docs/images/CPU-JIT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/docs/images/CPU-JIT.png -------------------------------------------------------------------------------- /tools/vswhere/vswhere.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/tools/vswhere/vswhere.exe -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_fast_32bpp_4xmsaa.cs.xesl: -------------------------------------------------------------------------------- 1 | #include "resolve_fast_32bpp_4xmsaa.xesli" 2 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_fast_64bpp_4xmsaa.cs.xesl: -------------------------------------------------------------------------------- 1 | #include "resolve_fast_64bpp_4xmsaa.xesli" 2 | -------------------------------------------------------------------------------- /docs/ppc/core_instructions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/docs/ppc/core_instructions.pdf -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_fast_32bpp_1x2xmsaa.cs.xesl: -------------------------------------------------------------------------------- 1 | #include "resolve_fast_32bpp_1x2xmsaa.xesli" 2 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_fast_64bpp_1x2xmsaa.cs.xesl: -------------------------------------------------------------------------------- 1 | #include "resolve_fast_64bpp_1x2xmsaa.xesli" 2 | -------------------------------------------------------------------------------- /tools/build/bin/premake5.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/tools/build/bin/premake5.exe -------------------------------------------------------------------------------- /docs/images/shader_playground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/docs/images/shader_playground.png -------------------------------------------------------------------------------- /docs/ppc/altivec_instructions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/docs/ppc/altivec_instructions.pdf -------------------------------------------------------------------------------- /third_party/crypto/des/des_lookup.h: -------------------------------------------------------------------------------- 1 | #ifndef DES_LOOKUP_H 2 | #define DES_LOOKUP_H 3 | 4 | #endif // DES_LOOKUP_H 5 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/discrete_quad_1cp.hs.hlsl: -------------------------------------------------------------------------------- 1 | #define XE_TESSELLATION_CONTROL_POINT_COUNT 1 2 | #include "discrete_quad.hlsli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/discrete_quad_4cp.hs.hlsl: -------------------------------------------------------------------------------- 1 | #define XE_TESSELLATION_CONTROL_POINT_COUNT 4 2 | #include "discrete_quad.hlsli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/continuous_quad_1cp.hs.hlsl: -------------------------------------------------------------------------------- 1 | #define XE_TESSELLATION_CONTROL_POINT_COUNT 1 2 | #include "continuous_quad.hlsli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/continuous_quad_4cp.hs.hlsl: -------------------------------------------------------------------------------- 1 | #define XE_TESSELLATION_CONTROL_POINT_COUNT 4 2 | #include "continuous_quad.hlsli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_clear_32bpp_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | #define XE_RESOLVE_RESOLUTION_SCALED 2 | #include "resolve_clear_32bpp.xesli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_clear_64bpp_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | #define XE_RESOLVE_RESOLUTION_SCALED 2 | #include "resolve_clear_64bpp.xesli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_full_128bpp_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | #define XE_RESOLVE_RESOLUTION_SCALED 2 | #include "resolve_full_128bpp.xesli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_full_16bpp_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | #define XE_RESOLVE_RESOLUTION_SCALED 2 | #include "resolve_full_16bpp.xesli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_full_32bpp_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | #define XE_RESOLVE_RESOLUTION_SCALED 2 | #include "resolve_full_32bpp.xesli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_full_64bpp_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | #define XE_RESOLVE_RESOLUTION_SCALED 2 | #include "resolve_full_64bpp.xesli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_full_8bpp_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | #define XE_RESOLVE_RESOLUTION_SCALED 2 | #include "resolve_full_8bpp.xesli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/discrete_triangle_1cp.hs.hlsl: -------------------------------------------------------------------------------- 1 | #define XE_TESSELLATION_CONTROL_POINT_COUNT 1 2 | #include "discrete_triangle.hlsli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/discrete_triangle_3cp.hs.hlsl: -------------------------------------------------------------------------------- 1 | #define XE_TESSELLATION_CONTROL_POINT_COUNT 3 2 | #include "discrete_triangle.hlsli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/continuous_triangle_1cp.hs.hlsl: -------------------------------------------------------------------------------- 1 | #define XE_TESSELLATION_CONTROL_POINT_COUNT 1 2 | #include "continuous_triangle.hlsli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/continuous_triangle_3cp.hs.hlsl: -------------------------------------------------------------------------------- 1 | #define XE_TESSELLATION_CONTROL_POINT_COUNT 3 2 | #include "continuous_triangle.hlsli" 3 | -------------------------------------------------------------------------------- /src/xenia/app/main_resources.rc: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | 3 | MAINICON ICON "..\\..\\..\\assets\\icon\\icon.ico" 4 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_fast_32bpp_4xmsaa_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | #define XE_RESOLVE_RESOLUTION_SCALED 2 | #include "resolve_fast_32bpp_4xmsaa.xesli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_fast_64bpp_4xmsaa_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | #define XE_RESOLVE_RESOLUTION_SCALED 2 | #include "resolve_fast_64bpp_4xmsaa.xesli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_fast_32bpp_1x2xmsaa_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | #define XE_RESOLVE_RESOLUTION_SCALED 2 | #include "resolve_fast_32bpp_1x2xmsaa.xesli" 3 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/resolve_fast_64bpp_1x2xmsaa_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | #define XE_RESOLVE_RESOLUTION_SCALED 2 | #include "resolve_fast_64bpp_1x2xmsaa.xesli" 3 | -------------------------------------------------------------------------------- /src/xenia/ui/vulkan/functions/instance_khr_xcb_surface.inc: -------------------------------------------------------------------------------- 1 | // VK_KHR_xcb_surface functions used in Xenia. 2 | XE_UI_VULKAN_FUNCTION(vkCreateXcbSurfaceKHR) 3 | -------------------------------------------------------------------------------- /third_party/crypto/des/README.md: -------------------------------------------------------------------------------- 1 | cppDES 2 | ====== 3 | 4 | Taken from [this repository](https://github.com/fffaraz/cppDES) 5 | 6 | Modified for use by Xenia. -------------------------------------------------------------------------------- /.codacy.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | exclude_paths: 3 | - 'tools/**' 4 | - 'third_party/**' 5 | - 'docs/**' 6 | - 'android/**' 7 | - '**.md' 8 | - 'src/xenia/gpu/shaders/**' 9 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_fnabs.s: -------------------------------------------------------------------------------- 1 | test_fnabs_1: 2 | #_ REGISTER_IN f1 0x400C000000000000 3 | fnabs f2, f1 4 | blr 5 | #_ REGISTER_OUT f2 0xC00C000000000000 6 | -------------------------------------------------------------------------------- /src/xenia/ui/vulkan/functions/instance_khr_android_surface.inc: -------------------------------------------------------------------------------- 1 | // VK_KHR_android_surface functions used in Xenia. 2 | XE_UI_VULKAN_FUNCTION(vkCreateAndroidSurfaceKHR) 3 | -------------------------------------------------------------------------------- /android/android_studio_project/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/android/android_studio_project/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Xenia Discord server 3 | url: https://discord.gg/Q9mxZf9 4 | about: Tech support for Xenia belongs here. 5 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/clear_uint2.ps.hlsl: -------------------------------------------------------------------------------- 1 | cbuffer XeClearConstants : register(b0) { 2 | uint2 xe_clear_value; 3 | }; 4 | 5 | uint2 main() : SV_Target { 6 | return xe_clear_value; 7 | } 8 | -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/android/android_studio_project/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/android/android_studio_project/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /tools/shader-playground/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/android/android_studio_project/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/android/android_studio_project/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/android/android_studio_project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/android/android_studio_project/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/android/android_studio_project/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/android/android_studio_project/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/android/android_studio_project/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emoose/xenia/HEAD/android/android_studio_project/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/xenia/vfs/testing/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | test_suite("xenia-vfs-tests", project_root, ".", { 5 | links = { 6 | "xenia-vfs", 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /third_party/pugixml.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("pugixml") 3 | uuid("d1089e5e-46ae-48c9-bee6-d38c674c8f61") 4 | kind("StaticLib") 5 | language("C++") 6 | files({ 7 | "pugixml/src/pugixml.cpp", 8 | }) 9 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/fxaa.cs.hlsl: -------------------------------------------------------------------------------- 1 | #define FXAA_QUALITY__PRESET 12 2 | #define FXAA_QUALITY__SUBPIX 0.75 3 | #define FXAA_QUALITY__EDGE_THRESHOLD 0.166 4 | #define FXAA_QUALITY__EDGE_THRESHOLD_MIN 0.0833 5 | #include "fxaa.hlsli" 6 | -------------------------------------------------------------------------------- /src/xenia/ui/vulkan/functions/instance_khr_win32_surface.inc: -------------------------------------------------------------------------------- 1 | // VK_KHR_win32_surface functions used in Xenia. 2 | XE_UI_VULKAN_FUNCTION(vkCreateWin32SurfaceKHR) 3 | XE_UI_VULKAN_FUNCTION(vkGetPhysicalDeviceWin32PresentationSupportKHR) 4 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/fxaa_extreme.cs.hlsl: -------------------------------------------------------------------------------- 1 | #define FXAA_QUALITY__PRESET 39 2 | #define FXAA_QUALITY__SUBPIX 1.0 3 | #define FXAA_QUALITY__EDGE_THRESHOLD 0.063 4 | #define FXAA_QUALITY__EDGE_THRESHOLD_MIN 0.0312 5 | #include "fxaa.hlsli" 6 | -------------------------------------------------------------------------------- /src/xenia/base/testing/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | test_suite("xenia-base-tests", project_root, ".", { 5 | links = { 6 | "fmt", 7 | "xenia-base", 8 | }, 9 | }) 10 | -------------------------------------------------------------------------------- /third_party/xxhash.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("xxhash") 3 | uuid("40d4ce21-5448-4399-9f98-589b7e1c23b1") 4 | kind("StaticLib") 5 | language("C") 6 | includedirs({ 7 | "xxhash", 8 | }) 9 | files({ 10 | "xxhash/xxhash.c", 11 | }) 12 | -------------------------------------------------------------------------------- /third_party/dxbc.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("dxbc") 3 | uuid("c96688ca-51ca-406e-aeef-068734a67abe") 4 | kind("StaticLib") 5 | language("C++") 6 | includedirs({ 7 | "dxbc", 8 | }) 9 | files({ 10 | "dxbc/DXBCChecksum.cpp", 11 | }) 12 | -------------------------------------------------------------------------------- /src/xenia/ui/vulkan/functions/instance_ext_debug_utils.inc: -------------------------------------------------------------------------------- 1 | // VK_EXT_debug_utils functions used in Xenia. 2 | XE_UI_VULKAN_FUNCTION(vkCreateDebugUtilsMessengerEXT) 3 | XE_UI_VULKAN_FUNCTION(vkDestroyDebugUtilsMessengerEXT) 4 | XE_UI_VULKAN_FUNCTION(vkSetDebugUtilsObjectNameEXT) 5 | -------------------------------------------------------------------------------- /third_party/aes_128.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("aes_128") 3 | uuid("b50458bf-dd83-4c1a-8cad-61f5fbbfd720") 4 | kind("StaticLib") 5 | language("C") 6 | includedirs({ 7 | "aes_128", 8 | }) 9 | files({ 10 | "aes_128/unroll/aes.c", 11 | }) 12 | -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Xenia 3 | GPU Trace Viewer 4 | Window Demo 5 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vexptefp.s: -------------------------------------------------------------------------------- 1 | test_vexptefp_1: 2 | #_ REGISTER_IN v3 [40000000, 40400000, 40800000, 40A00000] 3 | vexptefp v4, v3 4 | blr 5 | #_ REGISTER_OUT v3 [40000000, 40400000, 40800000, 40A00000] 6 | #_ REGISTER_OUT v4 [40800000, 41000000, 41800000, 42000000] 7 | -------------------------------------------------------------------------------- /src/xenia/ui/vulkan/functions/device_1_1_khr_bind_memory2.inc: -------------------------------------------------------------------------------- 1 | // VK_KHR_bind_memory2 functions used in Xenia. 2 | // Promoted to Vulkan 1.1 core. 3 | XE_UI_VULKAN_FUNCTION_PROMOTED(vkBindBufferMemory2KHR, vkBindBufferMemory2) 4 | XE_UI_VULKAN_FUNCTION_PROMOTED(vkBindImageMemory2KHR, vkBindImageMemory2) 5 | -------------------------------------------------------------------------------- /third_party/fmt.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("fmt") 3 | uuid("b9ff4b2c-b438-42a9-971e-e0c19a711a13") 4 | kind("StaticLib") 5 | language("C++") 6 | 7 | includedirs({ 8 | "fmt/include", 9 | }) 10 | files({ 11 | "fmt/src/format.cc", 12 | "fmt/src/os.cc" 13 | }) 14 | -------------------------------------------------------------------------------- /android/android_studio_project/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Nov 01 23:19:20 MSK 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /android/android_studio_project/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /src/xenia/patcher/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-patcher") 6 | uuid("e1c75f76-9e7b-48f6-b17e-dbd20f7a1592") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base" 11 | }) 12 | recursive_platform_files() 13 | -------------------------------------------------------------------------------- /src/xenia/ui/vulkan/functions/device_khr_swapchain.inc: -------------------------------------------------------------------------------- 1 | // VK_KHR_swapchain functions used in Xenia. 2 | XE_UI_VULKAN_FUNCTION(vkAcquireNextImageKHR) 3 | XE_UI_VULKAN_FUNCTION(vkCreateSwapchainKHR) 4 | XE_UI_VULKAN_FUNCTION(vkDestroySwapchainKHR) 5 | XE_UI_VULKAN_FUNCTION(vkGetSwapchainImagesKHR) 6 | XE_UI_VULKAN_FUNCTION(vkQueuePresentKHR) 7 | -------------------------------------------------------------------------------- /third_party/mspack/logging.cc: -------------------------------------------------------------------------------- 1 | #include "xenia/base/logging.h" 2 | 3 | #include 4 | 5 | extern "C" void xenia_log(const char* fmt, ...) { 6 | char buffer[128]; 7 | va_list args; 8 | va_start(args, fmt); 9 | vsnprintf(buffer, sizeof(buffer), fmt, args); 10 | va_end(args); 11 | XELOGW("mspack: {}", buffer); 12 | } 13 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vaddshs.s: -------------------------------------------------------------------------------- 1 | test_vaddshs_1: 2 | #_ REGISTER_IN v3 [7FFF8001, 7FFF8003, 7FFF8005, 80068007] 3 | #_ REGISTER_IN v4 [00018001, 10000000, 42568124, 00000000] 4 | vaddshs v3, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [7fff8000, 7fff8003, 7fff8000, 80068007] 7 | #_ REGISTER_OUT v4 [00018001, 10000000, 42568124, 00000000] 8 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vadduhm.s: -------------------------------------------------------------------------------- 1 | test_vadduhm_1: 2 | #_ REGISTER_IN v3 [7FFF8001, 7FFF8003, 7FFF8005, 80068007] 3 | #_ REGISTER_IN v4 [00018001, 10000000, 42568124, 00000000] 4 | vadduhm v3, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [80000002, 8fff8003, c2550129, 80068007] 7 | #_ REGISTER_OUT v4 [00018001, 10000000, 42568124, 00000000] 8 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vsubuhm.s: -------------------------------------------------------------------------------- 1 | test_vsubuhm_1: 2 | #_ REGISTER_IN v3 [7FFF8001, 7FFF8003, 7FFF8005, 80068007] 3 | #_ REGISTER_IN v4 [00018001, 10000000, 42568124, 00000000] 4 | vsubuhm v3, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [7ffe0000, 6fff8003, 3da9fee1, 80068007] 7 | #_ REGISTER_OUT v4 [00018001, 10000000, 42568124, 00000000] 8 | -------------------------------------------------------------------------------- /tools/build/premake5.lua: -------------------------------------------------------------------------------- 1 | require("vstudio") 2 | 3 | include("scripts/build_paths.lua") 4 | include("scripts/force_compile_as_c.lua") 5 | include("scripts/force_compile_as_cc.lua") 6 | include("scripts/pkg_config.lua") 7 | include("scripts/platform_files.lua") 8 | include("scripts/single_library.lua") 9 | include("scripts/test_suite.lua") 10 | -------------------------------------------------------------------------------- /src/xenia/apu/nop/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-apu-nop") 6 | uuid("f37dbf3a-d200-4cc0-83f0-f801b1bdd862") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | "xenia-apu", 12 | }) 13 | local_platform_files() 14 | -------------------------------------------------------------------------------- /src/xenia/helper/sdl/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-helper-sdl") 6 | uuid("84b00ad3-fba3-4561-96c9-1f9993b14c9c") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "SDL2", 11 | }) 12 | local_platform_files() 13 | sdl2_include() 14 | -------------------------------------------------------------------------------- /src/xenia/hid/nop/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-hid-nop") 6 | uuid("887b6f26-b0c1-43c1-a013-a37e7b9634fd") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | "xenia-hid", 12 | }) 13 | local_platform_files() 14 | -------------------------------------------------------------------------------- /src/xenia/hid/xinput/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-hid-xinput") 6 | uuid("3d49e251-07a7-40ae-9bc6-aae984c85568") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | "xenia-hid", 12 | }) 13 | local_platform_files() 14 | -------------------------------------------------------------------------------- /src/xenia/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-core") 6 | uuid("970f7892-f19a-4bf5-8795-478c51757bec") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "fmt", 11 | "xenia-base", 12 | }) 13 | files({ 14 | "*.h", 15 | "*.cc", 16 | }) 17 | -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/xenia/apu/xaudio2/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-apu-xaudio2") 6 | uuid("7a54a497-24d9-4c0e-a013-8507a04231f9") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | "xenia-apu", 12 | }) 13 | local_platform_files() 14 | -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /third_party/zstd.lua: -------------------------------------------------------------------------------- 1 | include("third_party/zstd/contrib/premake/zstd.lua") 2 | 3 | group("third_party") 4 | project("zstd") 5 | uuid("df336aac-f0c8-11ed-a05b-0242ac120003") 6 | -- https://gitlab.kitware.com/cmake/cmake/-/issues/25744 7 | filter({"toolset:not msc"}) 8 | defines({ 9 | "ZSTD_DISABLE_ASM", 10 | }) 11 | project_zstd("zstd/lib/") 12 | -------------------------------------------------------------------------------- /.gdbinit: -------------------------------------------------------------------------------- 1 | # Ignore HighResolutionTimer custom event 2 | handle SIG34 nostop noprint 3 | # Ignore PosixTimer custom event 4 | handle SIG35 nostop noprint 5 | # Ignore PosixThread exit event 6 | handle SIG32 nostop noprint 7 | # Ignore PosixThread suspend event 8 | handle SIG36 nostop noprint 9 | # Ignore PosixThread user callback event 10 | handle SIG37 nostop noprint 11 | -------------------------------------------------------------------------------- /src/xenia/apu/debug_visualizers.natvis: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | id={id_}, allocated={is_allocated_}, enabled={is_enabled_} 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/xenia/hid/winkey/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-hid-winkey") 6 | uuid("fd16e19a-6219-4ab7-b95a-7c78523c50c3") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | "xenia-hid", 12 | "xenia-ui", 13 | }) 14 | local_platform_files() 15 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Google 3 | DerivePointerAlignment: false 4 | PointerAlignment: Left 5 | SortIncludes: true 6 | KeepEmptyLines: 7 | AtStartOfFile: false 8 | InsertNewlineAtEOF: true 9 | 10 | # Regroup causes unnecessary noise due to clang-format bug. 11 | IncludeBlocks: Preserve 12 | 13 | --- 14 | Language: Java 15 | DisableFormat: true 16 | SortIncludes: false 17 | -------------------------------------------------------------------------------- /src/xenia/debug/ui/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-debug-ui") 6 | uuid("9193a274-f4c2-4746-bd85-93fcfc5c3e38") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "imgui", 11 | "xenia-base", 12 | "xenia-cpu", 13 | "xenia-ui", 14 | }) 15 | local_platform_files() 16 | -------------------------------------------------------------------------------- /third_party/tomlplusplus.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("tomlplusplus") 3 | uuid("1e86cc51-3f8b-476d-9249-3b200424846b") 4 | if os.istarget("android") then 5 | -- ndk-build only supports StaticLib and SharedLib. 6 | kind("StaticLib") 7 | else 8 | kind("Utility") 9 | end 10 | language("C++") 11 | files({ 12 | "tomlplusplus/include/toml++/toml.hpp" 13 | }) 14 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vor.s: -------------------------------------------------------------------------------- 1 | test_vor_1: 2 | #_ REGISTER_IN v3 [FFFF0101, 7070FFFF, FFFFFFFF, 00000000] 3 | #_ REGISTER_IN v4 [80081010, 808F0000, 00000000, 8FFFFFFF] 4 | vor v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [FFFF0101, 7070FFFF, FFFFFFFF, 00000000] 7 | #_ REGISTER_OUT v4 [80081010, 808F0000, 00000000, 8FFFFFFF] 8 | #_ REGISTER_OUT v5 [FFFF1111, F0FFFFFF, FFFFFFFF, 8FFFFFFF] 9 | -------------------------------------------------------------------------------- /third_party/cxxopts.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("cxxopts") 3 | uuid("8b68cbe8-2da4-4f28-be14-9352eafa3168") 4 | if os.istarget("android") then 5 | -- ndk-build only supports StaticLib and SharedLib. 6 | kind("StaticLib") 7 | else 8 | kind("Utility") 9 | end 10 | language("C++") 11 | files({ 12 | "cxxopts/include/cxxopts.hpp", 13 | }) 14 | warnings("Off") 15 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vand.s: -------------------------------------------------------------------------------- 1 | test_vand_1: 2 | #_ REGISTER_IN v3 [FFFF0101, 7070FFFF, 7FFFFFFF, 00000000] 3 | #_ REGISTER_IN v4 [80081010, 808F0020, 7FFFFFF0, 8FFFFFFF] 4 | vand v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [FFFF0101, 7070FFFF, 7FFFFFFF, 00000000] 7 | #_ REGISTER_OUT v4 [80081010, 808F0020, 7FFFFFF0, 8FFFFFFF] 8 | #_ REGISTER_OUT v5 [80080000, 00000020, 7FFFFFF0, 00000000] 9 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vandc.s: -------------------------------------------------------------------------------- 1 | test_vandc_1: 2 | #_ REGISTER_IN v3 [FFFF0101, 7070FFFF, 7FFFFFFF, 00000000] 3 | #_ REGISTER_IN v4 [80081010, 808F0020, 7FFFFFF0, 8FFFFFFF] 4 | vandc v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [FFFF0101, 7070FFFF, 7FFFFFFF, 00000000] 7 | #_ REGISTER_OUT v4 [80081010, 808F0020, 7FFFFFF0, 8FFFFFFF] 8 | #_ REGISTER_OUT v5 [7FF70101, 7070FFDF, 0000000F, 00000000] 9 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vrlh.s: -------------------------------------------------------------------------------- 1 | test_vrlh_1: 2 | #_ REGISTER_IN v3 [12345678, 87654321, 11223344, 55667788] 3 | #_ REGISTER_IN v4 [000D000D, 000D000D, 000D000D, 000D000D] 4 | vrlh v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [12345678, 87654321, 11223344, 55667788] 7 | #_ REGISTER_OUT v4 [000D000D, 000D000D, 000D000D, 000D000D] 8 | #_ REGISTER_OUT v5 [82460ACF, B0EC2864, 42248668, CAAC0EF1] 9 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vsrah.s: -------------------------------------------------------------------------------- 1 | test_vsrah_1: 2 | #_ REGISTER_IN v3 [12345678, 87654321, 11223344, 55667788] 3 | #_ REGISTER_IN v4 [000D000D, 000D000D, 000D000D, 000D000D] 4 | vsrah v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [12345678, 87654321, 11223344, 55667788] 7 | #_ REGISTER_OUT v4 [000D000D, 000D000D, 000D000D, 000D000D] 8 | #_ REGISTER_OUT v5 [00000002, FFFC0002, 00000001, 00020003] 9 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vsrh.s: -------------------------------------------------------------------------------- 1 | test_vsrh_1: 2 | #_ REGISTER_IN v3 [12345678, 87654321, 11223344, 55667788] 3 | #_ REGISTER_IN v4 [000D000D, 000D000D, 000D000D, 000D000D] 4 | vsrh v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [12345678, 87654321, 11223344, 55667788] 7 | #_ REGISTER_OUT v4 [000D000D, 000D000D, 000D000D, 000D000D] 8 | #_ REGISTER_OUT v5 [00000002, 00040002, 00000001, 00020003] 9 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vxor.s: -------------------------------------------------------------------------------- 1 | test_vxor_1: 2 | #_ REGISTER_IN v3 [FFFF0101, 7070FFFF, FFFFFFFF, 00000000] 3 | #_ REGISTER_IN v4 [80081010, 808F0000, 7FFFFFFF, 8FFFFFFF] 4 | vxor v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [FFFF0101, 7070FFFF, FFFFFFFF, 00000000] 7 | #_ REGISTER_OUT v4 [80081010, 808F0000, 7FFFFFFF, 8FFFFFFF] 8 | #_ REGISTER_OUT v5 [7FF71111, F0FFFFFF, 80000000, 8FFFFFFF] 9 | -------------------------------------------------------------------------------- /src/xenia/hid/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-hid") 6 | uuid("88a4ef38-c550-430f-8c22-8ded4e4ef601") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | "xenia-hid-skylander", 12 | }) 13 | local_platform_files() 14 | removefiles({ 15 | "*_demo.cc", 16 | }) 17 | -------------------------------------------------------------------------------- /src/xenia/ui/vulkan/functions/instance_khr_surface.inc: -------------------------------------------------------------------------------- 1 | // VK_KHR_surface functions used in Xenia. 2 | XE_UI_VULKAN_FUNCTION(vkDestroySurfaceKHR) 3 | XE_UI_VULKAN_FUNCTION(vkGetPhysicalDeviceSurfaceCapabilitiesKHR) 4 | XE_UI_VULKAN_FUNCTION(vkGetPhysicalDeviceSurfaceFormatsKHR) 5 | XE_UI_VULKAN_FUNCTION(vkGetPhysicalDeviceSurfacePresentModesKHR) 6 | XE_UI_VULKAN_FUNCTION(vkGetPhysicalDeviceSurfaceSupportKHR) 7 | -------------------------------------------------------------------------------- /tools/diff.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | """python diff.py file1 file2 diff 4 | """ 5 | 6 | from difflib import unified_diff 7 | from sys import argv 8 | 9 | diff = unified_diff( 10 | open(argv[1], encoding="utf-8").readlines(), 11 | open(argv[2], encoding="utf-8").readlines()) 12 | with open(argv[3], "w", encoding="utf-8") as f: 13 | f.write("".join(diff)) 14 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vavguh.s: -------------------------------------------------------------------------------- 1 | test_vavguh_1: 2 | #_ REGISTER_IN v3 [00000001, 00020003, 00040005, 00060007] 3 | #_ REGISTER_IN v4 [00080009, 000A000B, 000C000D, 000E000F] 4 | vavguh v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [00000001, 00020003, 00040005, 00060007] 7 | #_ REGISTER_OUT v4 [00080009, 000A000B, 000C000D, 000E000F] 8 | #_ REGISTER_OUT v5 [00040005, 00060007, 00080009, 000A000B] 9 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vor128.s: -------------------------------------------------------------------------------- 1 | test_vor128_1: 2 | #_ REGISTER_IN v3 [FFFF0101, 7070FFFF, FFFFFFFF, 00000000] 3 | #_ REGISTER_IN v4 [80081010, 808F0000, 00000000, 8FFFFFFF] 4 | vor128 v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [FFFF0101, 7070FFFF, FFFFFFFF, 00000000] 7 | #_ REGISTER_OUT v4 [80081010, 808F0000, 00000000, 8FFFFFFF] 8 | #_ REGISTER_OUT v5 [FFFF1111, F0FFFFFF, FFFFFFFF, 8FFFFFFF] 9 | -------------------------------------------------------------------------------- /src/xenia/hid/sdl/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-hid-sdl") 6 | uuid("44f5b9a1-00f8-4825-acf1-5c93f26eba9b") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | "xenia-hid", 12 | "xenia-ui", 13 | "SDL2", 14 | }) 15 | local_platform_files() 16 | sdl2_include() 17 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_fsqrt.s: -------------------------------------------------------------------------------- 1 | test_fsqrt_1: 2 | #_ REGISTER_IN f1 1.0 3 | fsqrt f1, f1 4 | blr 5 | #_ REGISTER_OUT f1 1.0000000000000000 6 | 7 | test_fsqrt_2: 8 | #_ REGISTER_IN f1 64.0 9 | fsqrt f1, f1 10 | blr 11 | #_ REGISTER_OUT f1 8.0000000000000000 12 | 13 | test_fsqrt_3: 14 | #_ REGISTER_IN f1 0.5 15 | fsqrt f1, f1 16 | blr 17 | #_ REGISTER_OUT f1 0.70710678118654757 18 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vand128.s: -------------------------------------------------------------------------------- 1 | test_vand128_1: 2 | #_ REGISTER_IN v3 [FFFF0101, 7070FFFF, 7FFFFFFF, 00000000] 3 | #_ REGISTER_IN v4 [80081010, 808F0020, 7FFFFFF0, 8FFFFFFF] 4 | vand128 v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [FFFF0101, 7070FFFF, 7FFFFFFF, 00000000] 7 | #_ REGISTER_OUT v4 [80081010, 808F0020, 7FFFFFF0, 8FFFFFFF] 8 | #_ REGISTER_OUT v5 [80080000, 00000020, 7FFFFFF0, 00000000] 9 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vandc128.s: -------------------------------------------------------------------------------- 1 | test_vandc128_1: 2 | #_ REGISTER_IN v3 [FFFF0101, 7070FFFF, 7FFFFFFF, 00000000] 3 | #_ REGISTER_IN v4 [80081010, 808F0020, 7FFFFFF0, 8FFFFFFF] 4 | vandc128 v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [FFFF0101, 7070FFFF, 7FFFFFFF, 00000000] 7 | #_ REGISTER_OUT v4 [80081010, 808F0020, 7FFFFFF0, 8FFFFFFF] 8 | #_ REGISTER_OUT v5 [7FF70101, 7070FFDF, 0000000F, 00000000] 9 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vxor128.s: -------------------------------------------------------------------------------- 1 | test_vxor128_1: 2 | #_ REGISTER_IN v3 [FFFF0101, 7070FFFF, FFFFFFFF, 00000000] 3 | #_ REGISTER_IN v4 [80081010, 808F0000, 7FFFFFFF, 8FFFFFFF] 4 | vxor128 v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [FFFF0101, 7070FFFF, FFFFFFFF, 00000000] 7 | #_ REGISTER_OUT v4 [80081010, 808F0000, 7FFFFFFF, 8FFFFFFF] 8 | #_ REGISTER_OUT v5 [7FF71111, F0FFFFFF, 80000000, 8FFFFFFF] 9 | -------------------------------------------------------------------------------- /src/xenia/apu/sdl/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-apu-sdl") 6 | uuid("153b4e8b-813a-40e6-9366-4b51abc73c45") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-apu", 11 | "xenia-base", 12 | "xenia-helper-sdl", 13 | "SDL2", 14 | }) 15 | local_platform_files() 16 | sdl2_include() 17 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vmsum4fp128.s: -------------------------------------------------------------------------------- 1 | test_vmsum4fp128_1: 2 | #_ REGISTER_IN v3 [3f800000, 3fc00000, 3f8ccccd, 3ff33333] 3 | #_ REGISTER_IN v4 [40000000, 40700000, 4013d70a, 40b051eb] 4 | vmsum4fp128 v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [3f800000, 3fc00000, 3f8ccccd, 3ff33333] 7 | #_ REGISTER_OUT v4 [40000000, 40700000, 4013d70a, 40b051eb] 8 | #_ REGISTER_OUT v5 [41A5147B, 41A5147B, 41A5147B, 41A5147B] 9 | -------------------------------------------------------------------------------- /src/xenia/ui/vulkan/functions/device_1_3_khr_maintenance4.inc: -------------------------------------------------------------------------------- 1 | // VK_KHR_maintenance4 functions used in Xenia. 2 | // Promoted to Vulkan 1.3 core. 3 | XE_UI_VULKAN_FUNCTION_PROMOTED(vkGetDeviceBufferMemoryRequirementsKHR, 4 | vkGetDeviceBufferMemoryRequirements) 5 | XE_UI_VULKAN_FUNCTION_PROMOTED(vkGetDeviceImageMemoryRequirementsKHR, 6 | vkGetDeviceImageMemoryRequirements) 7 | -------------------------------------------------------------------------------- /third_party/mspack.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("mspack") 3 | uuid("0881692A-75A1-4E7B-87D8-BB9108CEDEA4") 4 | kind("StaticLib") 5 | language("C++") 6 | links({ 7 | "xenia-base", 8 | }) 9 | defines({ 10 | "HAVE_CONFIG_H", 11 | }) 12 | includedirs({ 13 | "mspack", 14 | }) 15 | files({ 16 | "mspack/logging.cc", 17 | "mspack/lzxd.c", 18 | "mspack/system.c", 19 | }) 20 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto whitespace=blank-at-eol,tab-in-indent,trailing-space,tabwidth=2 2 | 3 | *.bat text eol=crlf 4 | *.sh text eol=lf 5 | 6 | *.sln text eol=crlf -whitespace 7 | *.csproj text eol=crlf -whitespace merge=union 8 | *.vcxproj text eol=crlf -whitespace merge=union 9 | *.props text eol=crlf -whitespace merge=union 10 | 11 | src/**/shaders/bytecode/** linguist-generated=true 12 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vaddfp.s: -------------------------------------------------------------------------------- 1 | test_vaddfp_1: 2 | # v3 = [10.0, -10.0, 15.0, -15.0] 3 | # v4 = [-10.0, 20.0, -20.0, 30.0] 4 | #_ REGISTER_IN v3 [41200000, C1200000, 41700000, C1700000] 5 | #_ REGISTER_IN v4 [C1200000, 41A00000, C1A00000, 41F00000] 6 | vaddfp v3, v3, v4 7 | blr 8 | #_ REGISTER_OUT v3 [00000000, 41200000, C0A00000, 41700000] 9 | #_ REGISTER_OUT v4 [C1200000, 41A00000, C1A00000, 41F00000] 10 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vsubfp.s: -------------------------------------------------------------------------------- 1 | test_vsubfp_1: 2 | # v3 = [10.0, -10.0, 15.0, -15.0] 3 | # v4 = [-10.0, 20.0, -20.0, 30.0] 4 | #_ REGISTER_IN v3 [41200000, C1200000, 41700000, C1700000] 5 | #_ REGISTER_IN v4 [C1200000, 41A00000, C1A00000, 41F00000] 6 | vsubfp v3, v3, v4 7 | blr 8 | #_ REGISTER_OUT v3 [41A00000, C1F00000, 420C0000, C2340000] 9 | #_ REGISTER_OUT v4 [C1200000, 41A00000, C1A00000, 41F00000] 10 | -------------------------------------------------------------------------------- /src/xenia/ui/vulkan/functions/device_1_1_khr_get_memory_requirements2.inc: -------------------------------------------------------------------------------- 1 | // VK_KHR_get_memory_requirements2 functions used in Xenia. 2 | // Promoted to Vulkan 1.1 core. 3 | XE_UI_VULKAN_FUNCTION_PROMOTED(vkGetBufferMemoryRequirements2KHR, 4 | vkGetBufferMemoryRequirements2) 5 | XE_UI_VULKAN_FUNCTION_PROMOTED(vkGetImageMemoryRequirements2KHR, 6 | vkGetImageMemoryRequirements2) 7 | -------------------------------------------------------------------------------- /src/xenia/kernel/debug_visualizers.natvis: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {host_ptr_} 7 | 8 | host_ptr_ 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /third_party/binutils/README.md: -------------------------------------------------------------------------------- 1 | The patch found in this folder is for the binutils-2.24 snapshot. 2 | It's a rebase of Sebastian Biallas' ancient patch that was never upstreamed into 3 | mainline binutils: https://sourceware.org/ml/binutils/2007-03/msg00366.html 4 | 5 | You can find a snapshot of 2.24 here: 6 | http://mirrors.kernel.org/sourceware/binutils/releases/binutils-2.24.tar.gz 7 | 8 | Build on cygwin with: `bash -x -o igncr build.sh` 9 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_nor.s: -------------------------------------------------------------------------------- 1 | test_nor_cr_1: 2 | #_ REGISTER_IN r3 0x00000000FFFFFFFF 3 | nor. r3, r3, r3 4 | li r3, 0 5 | bne nor_cr_1_ne 6 | li r3, 1 7 | nor_cr_1_ne: 8 | blr 9 | #_ REGISTER_OUT r3 1 10 | 11 | test_nor_cr_1_constant: 12 | li r3, -1 13 | clrldi r3, r3, 32 14 | nor. r3, r3, r3 15 | li r3, 0 16 | bne nor_cr_1_constant_ne 17 | li r3, 1 18 | nor_cr_1_constant_ne: 19 | blr 20 | #_ REGISTER_OUT r3 1 21 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vavgsh.s: -------------------------------------------------------------------------------- 1 | #vavgsh isn't implemented 2 | #test_vavgsh_1: 3 | # #_ REGISTER_IN v3 [00000001, 00020003, 00040005, 00060007] 4 | # #_ REGISTER_IN v4 [00080009, 000A000B, 000C000D, 000E000F] 5 | # vavgsh v5, v3, v4 6 | # blr 7 | # #_ REGISTER_OUT v3 [00000001, 00020003, 00040005, 00060007] 8 | # #_ REGISTER_OUT v4 [00080009, 000A000B, 000C000D, 000E000F] 9 | # #_ REGISTER_OUT v5 [00040005, 00060007, 00080009, 000A000B] 10 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vpkpx.s: -------------------------------------------------------------------------------- 1 | #vpkpx isn't implemented yet 2 | #test_vpkpx_1: 3 | # #_ REGISTER_IN v3 [00101820, 01283038, 00404850, 01586068] 4 | # #_ REGISTER_IN v4 [01707880, 00889098, 01A0A8B0, 00B8C0C8] 5 | # vpkpx v5, v3, v4 6 | # blr 7 | # #_ REGISTER_OUT v3 [00101820, 01283038, 00404850, 01586068] 8 | # #_ REGISTER_OUT v4 [01707880, 00889098, 01A0A8B0, 00B8C0C8] 9 | # #_ REGISTER_OUT v5 [086494C7, 212AAD8D, B9F04653, D2B65F19] 10 | -------------------------------------------------------------------------------- /src/xenia/apu/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-apu") 6 | uuid("f4df01f0-50e4-4c67-8f54-61660696cc79") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "libavcodec", 11 | "libavutil", 12 | "libavformat", 13 | "xenia-base", 14 | }) 15 | includedirs({ 16 | project_root.."/third_party/FFmpeg", 17 | }) 18 | local_platform_files() 19 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_fadd.s: -------------------------------------------------------------------------------- 1 | test_fadd_1: 2 | #_ REGISTER_IN f1 1.0 3 | #_ REGISTER_IN f2 2.0 4 | fadd f3, f1, f2 5 | blr 6 | #_ REGISTER_OUT f3 3.0 7 | 8 | test_fadd_2: 9 | #_ REGISTER_IN f1 0.0 10 | #_ REGISTER_IN f2 0.0 11 | fadd f3, f1, f2 12 | blr 13 | #_ REGISTER_OUT f3 0.0 14 | 15 | test_fadd_3: 16 | #_ REGISTER_IN f1 -200.0 17 | #_ REGISTER_IN f2 200.0 18 | fadd f3, f1, f2 19 | blr 20 | #_ REGISTER_OUT f3 0.0 21 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_fmul.s: -------------------------------------------------------------------------------- 1 | test_fmul_1: 2 | #_ REGISTER_IN f1 5.0 3 | #_ REGISTER_IN f2 5.0 4 | fmul f3, f1, f2 5 | blr 6 | #_ REGISTER_OUT f3 25.0 7 | 8 | test_fmul_2: 9 | #_ REGISTER_IN f1 5.0 10 | #_ REGISTER_IN f2 0.0 11 | fmul f3, f1, f2 12 | blr 13 | #_ REGISTER_OUT f3 0.0 14 | 15 | test_fmul_3: 16 | #_ REGISTER_IN f1 -2.0 17 | #_ REGISTER_IN f2 2.0 18 | fmul f3, f1, f2 19 | blr 20 | #_ REGISTER_OUT f3 -4.0 21 | -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/layout/activity_window_demo.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /src/xenia/app/discord/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-app-discord") 6 | uuid("d14c0885-22d2-40de-ab28-7b234ef2b949") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "discord-rpc" 11 | }) 12 | includedirs({ 13 | project_root.."/third_party/discord-rpc/src" 14 | }) 15 | files({ 16 | "discord_presence.cc", 17 | "discord_presence.h" 18 | }) 19 | -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/res/layout/activity_gpu_trace_viewer.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vmaxfp.s: -------------------------------------------------------------------------------- 1 | test_vmaxfp_1: 2 | # v3 = [10.0, -10.0, 15.0, -15.0] 3 | # v4 = [-10.0, 20.0, -20.0, 30.0] 4 | #_ REGISTER_IN v3 [41200000, C1200000, 41700000, C1700000] 5 | #_ REGISTER_IN v4 [C1200000, 41A00000, C1A00000, 41F00000] 6 | vmaxfp v0, v3, v4 7 | blr 8 | #_ REGISTER_OUT v0 [41200000, 41A00000, 41700000, 41F00000] 9 | #_ REGISTER_OUT v3 [41200000, C1200000, 41700000, C1700000] 10 | #_ REGISTER_OUT v4 [C1200000, 41A00000, C1A00000, 41F00000] 11 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vminfp.s: -------------------------------------------------------------------------------- 1 | test_vminfp_1: 2 | # v3 = [10.0, -10.0, 15.0, -15.0] 3 | # v4 = [-10.0, 20.0, -20.0, 30.0] 4 | #_ REGISTER_IN v3 [41200000, C1200000, 41700000, C1700000] 5 | #_ REGISTER_IN v4 [C1200000, 41A00000, C1A00000, 41F00000] 6 | vminfp v0, v3, v4 7 | blr 8 | #_ REGISTER_OUT v0 [C1200000, C1200000, C1A00000, C1700000] 9 | #_ REGISTER_OUT v3 [41200000, C1200000, 41700000, C1700000] 10 | #_ REGISTER_OUT v4 [C1200000, 41A00000, C1A00000, 41F00000] 11 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vaddfp128.s: -------------------------------------------------------------------------------- 1 | test_vaddfp128_1: 2 | # v3 = [10.0, -10.0, 15.0, -15.0] 3 | # v4 = [-10.0, 20.0, -20.0, 30.0] 4 | #_ REGISTER_IN v3 [41200000, C1200000, 41700000, C1700000] 5 | #_ REGISTER_IN v4 [C1200000, 41A00000, C1A00000, 41F00000] 6 | vaddfp128 v0, v3, v4 7 | blr 8 | #_ REGISTER_OUT v0 [00000000, 41200000, C0A00000, 41700000] 9 | #_ REGISTER_OUT v3 [41200000, C1200000, 41700000, C1700000] 10 | #_ REGISTER_OUT v4 [C1200000, 41A00000, C1A00000, 41F00000] 11 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vmaxfp128.s: -------------------------------------------------------------------------------- 1 | test_vmaxfp128_1: 2 | # v3 = [10.0, -10.0, 15.0, -15.0] 3 | # v4 = [-10.0, 20.0, -20.0, 30.0] 4 | #_ REGISTER_IN v3 [41200000, C1200000, 41700000, C1700000] 5 | #_ REGISTER_IN v4 [C1200000, 41A00000, C1A00000, 41F00000] 6 | vmaxfp128 v0, v3, v4 7 | blr 8 | #_ REGISTER_OUT v0 [41200000, 41A00000, 41700000, 41F00000] 9 | #_ REGISTER_OUT v3 [41200000, C1200000, 41700000, C1700000] 10 | #_ REGISTER_OUT v4 [C1200000, 41A00000, C1A00000, 41F00000] 11 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vminfp128.s: -------------------------------------------------------------------------------- 1 | test_vminfp128_1: 2 | # v3 = [10.0, -10.0, 15.0, -15.0] 3 | # v4 = [-10.0, 20.0, -20.0, 30.0] 4 | #_ REGISTER_IN v3 [41200000, C1200000, 41700000, C1700000] 5 | #_ REGISTER_IN v4 [C1200000, 41A00000, C1A00000, 41F00000] 6 | vminfp128 v0, v3, v4 7 | blr 8 | #_ REGISTER_OUT v0 [C1200000, C1200000, C1A00000, C1700000] 9 | #_ REGISTER_OUT v3 [41200000, C1200000, 41700000, C1700000] 10 | #_ REGISTER_OUT v4 [C1200000, 41A00000, C1A00000, 41F00000] 11 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vmsum3fp128.s: -------------------------------------------------------------------------------- 1 | test_vmsum3fp128_1: 2 | # v3 = [1.0, 1.5, 1.1, 0.0] 3 | # v4 = [2.0, 3.75, 2.31, 0.0] 4 | #_ REGISTER_IN v3 [3f800000, 3fc00000, 3f8ccccd, 01020304] 5 | #_ REGISTER_IN v4 [40000000, 40700000, 4013d70a, 01020304] 6 | vmsum3fp128 v5, v3, v4 7 | blr 8 | #_ REGISTER_OUT v3 [3f800000, 3fc00000, 3f8ccccd, 01020304] 9 | #_ REGISTER_OUT v4 [40000000, 40700000, 4013d70a, 01020304] 10 | #_ REGISTER_OUT v5 [4122A7F0, 4122A7F0, 4122A7F0, 4122A7F0] 11 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vrfin.s: -------------------------------------------------------------------------------- 1 | test_vrfin_1: 2 | #_ REGISTER_IN v3 [3f800000, 3fc00000, 3f8ccccd, 3ff33333] 3 | # 1.0, 1.5, 1.1, 1.9 -> 1.0, 2.0, 1.0, 2.0 4 | vrfin v3, v3 5 | blr 6 | #_ REGISTER_OUT v3 [3f800000, 40000000, 3f800000, 40000000] 7 | 8 | test_vrfin_2: 9 | #_ REGISTER_IN v3 [bf800000, bfc00000, bf8ccccd, bff33333] 10 | # -1.0, -1.5, -1.1, -1.9 -> -1.0, -2.0, -1.0, -2.0 11 | vrfin v3, v3 12 | blr 13 | #_ REGISTER_OUT v3 [bf800000, c0000000, bf800000, c0000000] 14 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vsubfp128.s: -------------------------------------------------------------------------------- 1 | test_vsubfp128_1: 2 | # v3 = [10.0, -10.0, 15.0, -15.0] 3 | # v4 = [-10.0, 20.0, -20.0, 30.0] 4 | #_ REGISTER_IN v3 [41200000, C1200000, 41700000, C1700000] 5 | #_ REGISTER_IN v4 [C1200000, 41A00000, C1A00000, 41F00000] 6 | vsubfp128 v0, v3, v4 7 | blr 8 | #_ REGISTER_OUT v0 [41A00000, C1F00000, 420C0000, C2340000] 9 | #_ REGISTER_OUT v3 [41200000, C1200000, 41700000, C1700000] 10 | #_ REGISTER_OUT v4 [C1200000, 41A00000, C1A00000, 41F00000] 11 | -------------------------------------------------------------------------------- /src/xenia/base/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../.." 2 | include(project_root.."/tools/build") 3 | 4 | project("xenia-base") 5 | uuid("aeadaf22-2b20-4941-b05f-a802d5679c11") 6 | kind("StaticLib") 7 | language("C++") 8 | links({ 9 | "fmt", 10 | }) 11 | local_platform_files() 12 | removefiles({ 13 | "console_app_main_*.cc", 14 | "main_init_*.cc", 15 | }) 16 | files({ 17 | "debug_visualizers.natvis", 18 | }) 19 | 20 | if enableTests then 21 | include("testing") 22 | end 23 | -------------------------------------------------------------------------------- /src/xenia/gpu/null/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-gpu-null") 6 | uuid("42FCA0B3-4C20-4532-95E9-07D297013BE4") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | "xenia-gpu", 12 | "xenia-ui", 13 | "xenia-ui-vulkan", 14 | "xxhash", 15 | }) 16 | includedirs({ 17 | project_root.."/third_party/Vulkan-Headers/include", 18 | }) 19 | local_platform_files() 20 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vpkswus.s: -------------------------------------------------------------------------------- 1 | test_vpkswus_1: 2 | # {-1, -32768, 0, 32767} 3 | #_ REGISTER_IN v3 [FFFFFFFF, FFFF8000, 00000000, 00007FFF] 4 | # {-2, -32769, 1, 32768} 5 | #_ REGISTER_IN v4 [FFFFFFFE, FFFF7FFF, 00000001, 00008000] 6 | vpkswus v5, v3, v4 7 | blr 8 | #_ REGISTER_OUT v3 [FFFFFFFF, FFFF8000, 00000000, 00007FFF] 9 | #_ REGISTER_OUT v4 [FFFFFFFE, FFFF7FFF, 00000001, 00008000] 10 | # {0, 0, 0, 32767, 0, 0, 1, 32768} 11 | #_ REGISTER_OUT v5 [00000000, 00007FFF, 00000000, 00018000] 12 | -------------------------------------------------------------------------------- /third_party/imgui.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("imgui") 3 | uuid("ed9271c4-b0a1-42ef-8403-067b11bf49d0") 4 | kind("StaticLib") 5 | language("C++") 6 | includedirs({ 7 | "imgui", 8 | --"imgui/misc/freetype", 9 | --"freetype/include", 10 | "stb", 11 | }) 12 | files({ 13 | "imgui/imgui.cpp", 14 | "imgui/imgui_demo.cpp", 15 | "imgui/imgui_draw.cpp", 16 | "imgui/imgui_tables.cpp", 17 | "imgui/imgui_widgets.cpp", 18 | --"imgui/misc/freetype/imgui_freetype.cpp", 19 | }) 20 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vpkswus128.s: -------------------------------------------------------------------------------- 1 | test_vpkswus128_1: 2 | # {-1, -32768, 0, 32767} 3 | #_ REGISTER_IN v3 [FFFFFFFF, FFFF8000, 00000000, 00007FFF] 4 | # {-2, -32769, 1, 32768} 5 | #_ REGISTER_IN v4 [FFFFFFFE, FFFF7FFF, 00000001, 00008000] 6 | vpkswus128 v5, v3, v4 7 | blr 8 | #_ REGISTER_OUT v3 [FFFFFFFF, FFFF8000, 00000000, 00007FFF] 9 | #_ REGISTER_OUT v4 [FFFFFFFE, FFFF7FFF, 00000001, 00008000] 10 | # {0, 0, 0, 32767, 0, 0, 1, 32768} 11 | #_ REGISTER_OUT v5 [00000000, 00007FFF, 00000000, 00018000] 12 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vspltisb.s: -------------------------------------------------------------------------------- 1 | test_vspltisb_1: 2 | vspltisb v3, 0 3 | blr 4 | #_ REGISTER_OUT v3 [00000000, 00000000, 00000000, 00000000] 5 | 6 | test_vspltisb_2: 7 | vspltisb v3, 1 8 | blr 9 | #_ REGISTER_OUT v3 [01010101, 01010101, 01010101, 01010101] 10 | 11 | test_vspltisb_3: 12 | vspltisb v3, -1 13 | blr 14 | #_ REGISTER_OUT v3 [FFFFFFFF, FFFFFFFF, FFFFFFFF, FFFFFFFF] 15 | 16 | test_vspltisb_4: 17 | vspltisb v3, -2 18 | blr 19 | #_ REGISTER_OUT v3 [FEFEFEFE, FEFEFEFE, FEFEFEFE, FEFEFEFE] 20 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vspltish.s: -------------------------------------------------------------------------------- 1 | test_vspltish_1: 2 | vspltish v3, 0 3 | blr 4 | #_ REGISTER_OUT v3 [00000000, 00000000, 00000000, 00000000] 5 | 6 | test_vspltish_2: 7 | vspltish v3, 1 8 | blr 9 | #_ REGISTER_OUT v3 [00010001, 00010001, 00010001, 00010001] 10 | 11 | test_vspltish_3: 12 | vspltish v3, -1 13 | blr 14 | #_ REGISTER_OUT v3 [FFFFFFFF, FFFFFFFF, FFFFFFFF, FFFFFFFF] 15 | 16 | test_vspltish_4: 17 | vspltish v3, -2 18 | blr 19 | #_ REGISTER_OUT v3 [FFFEFFFE, FFFEFFFE, FFFEFFFE, FFFEFFFE] 20 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vspltisw.s: -------------------------------------------------------------------------------- 1 | test_vspltisw_1: 2 | vspltisw v3, 0 3 | blr 4 | #_ REGISTER_OUT v3 [00000000, 00000000, 00000000, 00000000] 5 | 6 | test_vspltisw_2: 7 | vspltisw v3, 1 8 | blr 9 | #_ REGISTER_OUT v3 [00000001, 00000001, 00000001, 00000001] 10 | 11 | test_vspltisw_3: 12 | vspltisw v3, -1 13 | blr 14 | #_ REGISTER_OUT v3 [FFFFFFFF, FFFFFFFF, FFFFFFFF, FFFFFFFF] 15 | 16 | test_vspltisw_4: 17 | vspltisw v3, -2 18 | blr 19 | #_ REGISTER_OUT v3 [FFFFFFFE, FFFFFFFE, FFFFFFFE, FFFFFFFE] 20 | -------------------------------------------------------------------------------- /third_party/microprofile/README.md: -------------------------------------------------------------------------------- 1 | # microprofile 2 | 3 | MicroProfile is a embeddable profiler in a single file, written in C++ 4 | 5 | It can display profile information in the application, or by generating captures via a minimal built in webserver. 6 | 7 | # Dependencies 8 | Microprofile supports generating compressed captures using miniz(http:/code.google.com/miniz). 9 | 10 | # License 11 | Licensed using unlicense.org 12 | 13 | # Screenshot 14 | ![Microprofile in action](https://pbs.twimg.com/media/BnvzublCEAA0Mqf.png:large) 15 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_frsqrte.s: -------------------------------------------------------------------------------- 1 | # frsqrte tests disabled because accuracy is CPU dependent. 2 | 3 | test_frsqrte_1: 4 | # _ REGISTER_IN f1 1.0 5 | # frsqrte f1, f1 6 | blr 7 | # _ REGISTER_OUT f1 0.99975585937500000 8 | # want: 0.97 9 | 10 | test_frsqrte_2: 11 | # _ REGISTER_IN f1 64.0 12 | # frsqrte f1, f1 13 | blr 14 | # _ REGISTER_OUT f1 0.12496948242187500 15 | 16 | test_frsqrte_3: 17 | # _ REGISTER_IN f1 0.5 18 | # frsqrte f1, f1 19 | blr 20 | # _ REGISTER_OUT f1 1.41381835937500000 21 | # want: 1.375 22 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vpkshus.s: -------------------------------------------------------------------------------- 1 | test_vpkshus_1: 2 | # {-1, -128, 0, 127, -2, -129, 1, 128} 3 | #_ REGISTER_IN v3 [FFFFFF80, 0000007F, FFFEFF7F, 00010080] 4 | # {-3, -130, 2, 129, -4, -131, 3, 130} 5 | #_ REGISTER_IN v4 [FFFDFF7E, 00020081, FFFCFF7D, 00030082] 6 | vpkshus v5, v3, v4 7 | blr 8 | #_ REGISTER_OUT v3 [FFFFFF80, 0000007F, FFFEFF7F, 00010080] 9 | #_ REGISTER_OUT v4 [FFFDFF7E, 00020081, FFFCFF7D, 00030082] 10 | # {0, 0, 0, 127, 0, 0, 1, 128, 0, 0, 2, 129, 0, 0, 3, 130} 11 | #_ REGISTER_OUT v5 [0000007F, 00000180, 00000281, 00000382] 12 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vpkuhus.s: -------------------------------------------------------------------------------- 1 | test_vpkuhus_1: 2 | # {0, 256, 1, 257, 2, 258, 3, 259} 3 | #_ REGISTER_IN v3 [00000100, 00010101, 00020102, 00030103] 4 | # {4, 260, 5, 261, 6, 262, 7, 263} 5 | #_ REGISTER_IN v4 [00040104, 00050105, 00060106, 00070107] 6 | vpkuhus v5, v3, v4 7 | blr 8 | #_ REGISTER_OUT v3 [00000100, 00010101, 00020102, 00030103] 9 | #_ REGISTER_OUT v4 [00040104, 00050105, 00060106, 00070107] 10 | # {0, 255, 1, 255, 2, 255, 3, 255, 4, 255, 5, 255, 6, 255, 7, 255} 11 | #_ REGISTER_OUT v5 [00FF01FF, 02FF03FF, 04FF05FF, 06FF07FF] 12 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vpkshus128.s: -------------------------------------------------------------------------------- 1 | test_vpkshus128_1: 2 | # {-1, -128, 0, 127, -2, -129, 1, 128} 3 | #_ REGISTER_IN v3 [FFFFFF80, 0000007F, FFFEFF7F, 00010080] 4 | # {-3, -130, 2, 129, -4, -131, 3, 130} 5 | #_ REGISTER_IN v4 [FFFDFF7E, 00020081, FFFCFF7D, 00030082] 6 | vpkshus128 v5, v3, v4 7 | blr 8 | #_ REGISTER_OUT v3 [FFFFFF80, 0000007F, FFFEFF7F, 00010080] 9 | #_ REGISTER_OUT v4 [FFFDFF7E, 00020081, FFFCFF7D, 00030082] 10 | # {0, 0, 0, 127, 0, 0, 1, 128, 0, 0, 2, 129, 0, 0, 3, 130} 11 | #_ REGISTER_OUT v5 [0000007F, 00000180, 00000281, 00000382] 12 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vpkuhus128.s: -------------------------------------------------------------------------------- 1 | test_vpkuhus128_1: 2 | # {0, 256, 1, 257, 2, 258, 3, 259} 3 | #_ REGISTER_IN v3 [00000100, 00010101, 00020102, 00030103] 4 | # {4, 260, 5, 261, 6, 262, 7, 263} 5 | #_ REGISTER_IN v4 [00040104, 00050105, 00060106, 00070107] 6 | vpkuhus128 v5, v3, v4 7 | blr 8 | #_ REGISTER_OUT v3 [00000100, 00010101, 00020102, 00030103] 9 | #_ REGISTER_OUT v4 [00040104, 00050105, 00060106, 00070107] 10 | # {0, 255, 1, 255, 2, 255, 3, 255, 4, 255, 5, 255, 6, 255, 7, 255} 11 | #_ REGISTER_OUT v5 [00FF01FF, 02FF03FF, 04FF05FF, 06FF07FF] 12 | -------------------------------------------------------------------------------- /tools/build/scripts/build_paths.lua: -------------------------------------------------------------------------------- 1 | build_root = "build" 2 | build_bin = build_root .. "/bin/%{cfg.platform}/%{cfg.buildcfg}" 3 | build_gen = build_root .. "/gen/%{cfg.platform}/%{cfg.buildcfg}" 4 | build_obj = build_root .. "/obj/%{cfg.platform}/%{cfg.buildcfg}" 5 | 6 | build_tools = "tools/build" 7 | build_scripts = build_tools .. "/scripts" 8 | build_tools_src = build_tools .. "/src" 9 | 10 | if os.istarget("android") then 11 | platform_suffix = "android" 12 | elseif os.istarget("windows") then 13 | platform_suffix = "win" 14 | else 15 | platform_suffix = "posix" 16 | end 17 | -------------------------------------------------------------------------------- /src/xenia/ui/vulkan/functions/instance_1_1_khr_get_physical_device_properties2.inc: -------------------------------------------------------------------------------- 1 | // VK_KHR_get_physical_device_properties2 functions used in Xenia. 2 | // Promoted to Vulkan 1.1 core. 3 | XE_UI_VULKAN_FUNCTION_PROMOTED(vkGetPhysicalDeviceFeatures2KHR, 4 | vkGetPhysicalDeviceFeatures2) 5 | XE_UI_VULKAN_FUNCTION_PROMOTED(vkGetPhysicalDeviceMemoryProperties2KHR, 6 | vkGetPhysicalDeviceMemoryProperties2) 7 | XE_UI_VULKAN_FUNCTION_PROMOTED(vkGetPhysicalDeviceProperties2KHR, 8 | vkGetPhysicalDeviceProperties2) 9 | -------------------------------------------------------------------------------- /src/xenia/debug/gdb/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-debug-gdb") 6 | uuid("9193a274-f4c2-4746-bd85-93fcfc5c3e39") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "imgui", 11 | "xenia-base", 12 | "xenia-cpu", 13 | "xenia-ui", 14 | }) 15 | filter({"configurations:Release", "platforms:Windows"}) 16 | buildoptions({ 17 | "/Os", 18 | "/O1" 19 | }) 20 | filter{} 21 | defines({ 22 | }) 23 | includedirs({ 24 | }) 25 | local_platform_files() 26 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/apply_gamma_pwl.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "apply_gamma_pwl.xesli" 11 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/apply_gamma_table.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "apply_gamma_table.xesli" 11 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_8bpb.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "texture_load_8bpb.xesli" 11 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_128bpb.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "texture_load_128bpb.xesli" 11 | -------------------------------------------------------------------------------- /src/xenia/hid/skylander/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-hid-skylander") 6 | uuid("ddc114da-a279-4868-8b20-53108599bd78") 7 | kind("StaticLib") 8 | language("C++") 9 | files({ 10 | "skylander_portal.h", 11 | "skylander_portal.cc", 12 | "skylander_emulated.h", 13 | "skylander_emulated.cc" 14 | }) 15 | 16 | filter({"platforms:Windows"}) 17 | links({ 18 | "libusb", 19 | }) 20 | files({ 21 | "skylander_hardware.h", 22 | "skylander_hardware.cc" 23 | }) 24 | -------------------------------------------------------------------------------- /src/xenia/ui/shaders/guest_output_bilinear.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "guest_output_bilinear.xesli" 11 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_lvl.s: -------------------------------------------------------------------------------- 1 | test_lvl_1: 2 | #_ MEMORY_IN 10001077 0a 0b 0c 0d 0e 0f 10 13 0c 0d 0e 10 11 12 13 14 ff ff ff ff ff ff 3 | #_ REGISTER_IN r4 0x10001077 4 | lvlx v3, r4, r0 5 | blr 6 | #_ REGISTER_OUT r4 0x10001077 7 | #_ REGISTER_OUT v3 [0A0B0C0D, 0E0F1013, 0C000000, 00000000] 8 | 9 | test_lvl_1_constant: 10 | #_ MEMORY_IN 10001077 0a 0b 0c 0d 0e 0f 10 13 0c 0d 0e 10 11 12 13 14 ff ff ff ff ff ff 11 | lis r4, 0x1000 12 | ori r4, r4, 0x1077 13 | lvlx v3, r4, r0 14 | blr 15 | #_ REGISTER_OUT r4 0x10001077 16 | #_ REGISTER_OUT v3 [0A0B0C0D, 0E0F1013, 0C000000, 00000000] 17 | -------------------------------------------------------------------------------- /src/xenia/ui/shaders/guest_output_ffx_fsr_rcas.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "guest_output_ffx_fsr_rcas.xesli" 11 | -------------------------------------------------------------------------------- /src/xenia/ui/shaders/guest_output_ffx_cas_sharpen.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "guest_output_ffx_cas_sharpen.xesli" 11 | -------------------------------------------------------------------------------- /xb.ps1: -------------------------------------------------------------------------------- 1 | $pythonExecutables = "python", "python3", "py" 2 | foreach ($pythonExecutable in $pythonExecutables) { 3 | if (!$pythonPath) { 4 | $pythonPath = powershell -NoLogo -NonInteractive "(Get-Command -ErrorAction SilentlyContinue $pythonexecutable).Definition" # Hack to not give command suggestion 5 | if ($pythonPath) { 6 | break 7 | } 8 | } 9 | } 10 | # Neither found, error and exit 11 | if (!$pythonPath) { 12 | Throw "ERROR: Python 3.9+ 64-bit must be installed and on PATH:`nhttps://www.python.org/" 13 | } 14 | 15 | & $pythonPath "$($PSScriptRoot)/xenia-build.py" $args 16 | -------------------------------------------------------------------------------- /src/xenia/ui/shaders/guest_output_ffx_cas_resample.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "guest_output_ffx_cas_resample.xesli" 11 | -------------------------------------------------------------------------------- /third_party/zarchive.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("zarchive") 3 | uuid("d32f03aa-f0c9-11ed-a05b-0242ac120003") 4 | kind("StaticLib") 5 | language("C++") 6 | links({ 7 | "zstd", 8 | }) 9 | includedirs({ 10 | "zarchive/include", 11 | "zstd/lib", 12 | }) 13 | files({ 14 | "zarchive/include/zarchive/zarchivecommon.h", 15 | "zarchive/include/zarchive/zarchivereader.h", 16 | "zarchive/include/zarchive/zarchivewriter.h", 17 | "zarchive/src/zarchivereader.cpp", 18 | "zarchive/src/zarchivewriter.cpp", 19 | "zarchive/src/sha_256.c", 20 | "zarchive/src/sha_256.h", 21 | }) 22 | -------------------------------------------------------------------------------- /tools/shader-playground/README.md: -------------------------------------------------------------------------------- 1 | This requires XNA Game Studio 3.1 to be installed (not just the redist): 2 | https://www.microsoft.com/en-us/download/details.aspx?id=39 3 | 4 | It's not really compatible with modern VS', but you can open the downloaded 5 | `XNAGS31_setup.exe` with 7zip and run the included `redists.msi` directly. 6 | 7 | If installed correctly you should have this file: 8 | `C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v3.1\References\Windows\x86\Microsoft.Xna.Framework.dll` 9 | 10 | XNA is only compatible with 32-bit x86 .NET, so ensure Visual Studio is set to 11 | target that (not `Any CPU`). 12 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vupkhsb.s: -------------------------------------------------------------------------------- 1 | test_vupkhsb_1: 2 | # {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7} 3 | #_ REGISTER_IN v3 [F8F9FAFB, FCFDFEFF, 00010203, 04050607] 4 | vupkhsb v3, v3 5 | blr 6 | # {-8, -7, -6, -5, -4, -3, -2, -1} 7 | #_ REGISTER_OUT v3 [FFF8FFF9, FFFAFFFB, FFFCFFFD, FFFEFFFF] 8 | 9 | test_vupkhsb_2: 10 | # {0, 255, 255, 0, 0, 0, 255, 0, 255, 0, 0, 255, 255, 255, 0, 255} 11 | #_ REGISTER_IN v3 [00FFFF00, 0000FF00, FF0000FF, FFFF00FF] 12 | vupkhsb v3, v3 13 | blr 14 | # {0, 65535, 65535, 0, 0, 0, 65535, 0} 15 | #_ REGISTER_OUT v3 [0000FFFF, FFFF0000, 00000000, FFFF0000] 16 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vupklsb.s: -------------------------------------------------------------------------------- 1 | test_vupklsb_1: 2 | # {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7} 3 | #_ REGISTER_IN v3 [F8F9FAFB, FCFDFEFF, 00010203, 04050607] 4 | vupklsb v3, v3 5 | blr 6 | # {0, 1, 2, 3, 4, 5, 6, 7} 7 | #_ REGISTER_OUT v3 [00000001, 00020003, 00040005, 00060007] 8 | 9 | test_vupklsb_2: 10 | # {0, 255, 255, 0, 0, 0, 255, 0, 255, 0, 0, 255, 255, 255, 0, 255} 11 | #_ REGISTER_IN v3 [00FFFF00, 0000FF00, FF0000FF, FFFF00FF] 12 | vupklsb v3, v3 13 | blr 14 | # {65535, 0, 0, 65535, 65535, 65535, 0, 65535} 15 | #_ REGISTER_OUT v3 [FFFF0000, 0000FFFF, FFFFFFFF, 0000FFFF] 16 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/apply_gamma_pwl.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_APPLY_GAMMA_COMPUTE 11 | #include "apply_gamma_pwl.xesli" 12 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/apply_gamma_table.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_APPLY_GAMMA_COMPUTE 11 | #include "apply_gamma_table.xesli" 12 | -------------------------------------------------------------------------------- /src/xenia/kernel/util/ordinal_table_post.inc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2021 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | // Post-include file for an ordinal table. 11 | 12 | #undef XE_EXPORT 13 | -------------------------------------------------------------------------------- /src/xenia/ui/windowed_app_main_android.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2021 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | // Not needed - no single entry point, the event loop is polled by the OS. 11 | -------------------------------------------------------------------------------- /tools/build/scripts/single_library.lua: -------------------------------------------------------------------------------- 1 | SINGLE_LIBRARY_PLATFORM_PATTERNS = { 2 | "Android-*", 3 | }; 4 | 5 | SINGLE_LIBRARY_FILTER = 6 | "platforms:" .. table.concat(SINGLE_LIBRARY_PLATFORM_PATTERNS, " or "); 7 | NOT_SINGLE_LIBRARY_FILTER = table.translate( 8 | SINGLE_LIBRARY_PLATFORM_PATTERNS, 9 | function(pattern) 10 | return "platforms:not " .. pattern; 11 | end); 12 | 13 | function single_library_windowed_app_kind() 14 | filter(SINGLE_LIBRARY_FILTER); 15 | kind("StaticLib"); 16 | wholelib("On"); 17 | filter(NOT_SINGLE_LIBRARY_FILTER); 18 | kind("WindowedApp"); 19 | filter({}); 20 | end 21 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vupkhsb128.s: -------------------------------------------------------------------------------- 1 | test_vupkhsb128_1: 2 | # {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7} 3 | #_ REGISTER_IN v3 [F8F9FAFB, FCFDFEFF, 00010203, 04050607] 4 | vupkhsb128 v3, v3 5 | blr 6 | # {-8, -7, -6, -5, -4, -3, -2, -1} 7 | #_ REGISTER_OUT v3 [FFF8FFF9, FFFAFFFB, FFFCFFFD, FFFEFFFF] 8 | 9 | test_vupkhsb128_2: 10 | # {0, 255, 255, 0, 0, 0, 255, 0, 255, 0, 0, 255, 255, 255, 0, 255} 11 | #_ REGISTER_IN v3 [00FFFF00, 0000FF00, FF0000FF, FFFF00FF] 12 | vupkhsb128 v3, v3 13 | blr 14 | # {0, 65535, 65535, 0, 0, 0, 65535, 0} 15 | #_ REGISTER_OUT v3 [0000FFFF, FFFF0000, 00000000, FFFF0000] 16 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vupklsb128.s: -------------------------------------------------------------------------------- 1 | test_vupklsb128_1: 2 | # {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7} 3 | #_ REGISTER_IN v3 [F8F9FAFB, FCFDFEFF, 00010203, 04050607] 4 | vupklsb128 v3, v3 5 | blr 6 | # {0, 1, 2, 3, 4, 5, 6, 7} 7 | #_ REGISTER_OUT v3 [00000001, 00020003, 00040005, 00060007] 8 | 9 | test_vupklsb128_2: 10 | # {0, 255, 255, 0, 0, 0, 255, 0, 255, 0, 0, 255, 255, 255, 0, 255} 11 | #_ REGISTER_IN v3 [00FFFF00, 0000FF00, FF0000FF, FFFF00FF] 12 | vupklsb128 v3, v3 13 | blr 14 | # {65535, 0, 0, 65535, 65535, 65535, 0, 65535} 15 | #_ REGISTER_OUT v3 [FFFF0000, 0000FFFF, FFFFFFFF, 0000FFFF] 16 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/apply_gamma_pwl_fxaa_luma.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_APPLY_GAMMA_FXAA_LUMA 11 | #include "apply_gamma_pwl.xesli" 12 | -------------------------------------------------------------------------------- /src/xenia/apu/apu_flags.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/apu/apu_flags.h" 11 | 12 | DEFINE_bool(mute, false, "Mutes all audio output.", "APU") 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/apply_gamma_table_fxaa_luma.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_APPLY_GAMMA_FXAA_LUMA 11 | #include "apply_gamma_table.xesli" 12 | -------------------------------------------------------------------------------- /src/xenia/kernel/util/export_table_post.inc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2021 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | // Post-include file for an export table. 11 | 12 | #undef FLAG 13 | #undef XE_EXPORT 14 | -------------------------------------------------------------------------------- /src/xenia/ui/vulkan/functions/instance_1_0.inc: -------------------------------------------------------------------------------- 1 | // Vulkan 1.0 core instance functions used in Xenia. 2 | XE_UI_VULKAN_FUNCTION(vkCreateDevice) 3 | XE_UI_VULKAN_FUNCTION(vkDestroyDevice) 4 | XE_UI_VULKAN_FUNCTION(vkEnumerateDeviceExtensionProperties) 5 | XE_UI_VULKAN_FUNCTION(vkEnumeratePhysicalDevices) 6 | XE_UI_VULKAN_FUNCTION(vkGetDeviceProcAddr) 7 | XE_UI_VULKAN_FUNCTION(vkGetPhysicalDeviceFeatures) 8 | XE_UI_VULKAN_FUNCTION(vkGetPhysicalDeviceFormatProperties) 9 | XE_UI_VULKAN_FUNCTION(vkGetPhysicalDeviceMemoryProperties) 10 | XE_UI_VULKAN_FUNCTION(vkGetPhysicalDeviceProperties) 11 | XE_UI_VULKAN_FUNCTION(vkGetPhysicalDeviceQueueFamilyProperties) 12 | -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/java/jp/xenia/emulator/WindowDemoActivity.java: -------------------------------------------------------------------------------- 1 | package jp.xenia.emulator; 2 | 3 | import android.os.Bundle; 4 | 5 | public class WindowDemoActivity extends WindowedAppActivity { 6 | @Override 7 | protected String getWindowedAppIdentifier() { 8 | return "xenia_ui_window_vulkan_demo"; 9 | } 10 | 11 | @Override 12 | protected void onCreate(final Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | 15 | setContentView(R.layout.activity_window_demo); 16 | setWindowSurfaceView(findViewById(R.id.window_demo_surface_view)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_8bpb_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "texture_load_8bpb.xesli" 12 | -------------------------------------------------------------------------------- /src/xenia/ui/shaders/guest_output_bilinear_dither.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_GUEST_OUTPUT_DITHER 1 11 | #include "guest_output_bilinear.xesli" 12 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_128bpb_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "texture_load_128bpb.xesli" 12 | -------------------------------------------------------------------------------- /src/xenia/ui/shaders/guest_output_ffx_fsr_rcas_dither.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_GUEST_OUTPUT_DITHER 1 11 | #include "guest_output_ffx_fsr_rcas.xesli" 12 | -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/java/jp/xenia/XeniaRuntimeException.java: -------------------------------------------------------------------------------- 1 | package jp.xenia; 2 | 3 | /** 4 | * Base class for all unchecked exceptions thrown by the Xenia project components. 5 | */ 6 | public class XeniaRuntimeException extends RuntimeException { 7 | public XeniaRuntimeException() { 8 | } 9 | 10 | public XeniaRuntimeException(final String name) { 11 | super(name); 12 | } 13 | 14 | public XeniaRuntimeException(final String name, final Throwable cause) { 15 | super(name, cause); 16 | } 17 | 18 | public XeniaRuntimeException(final Exception cause) { 19 | super(cause); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_16bpb.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM(blocks) (blocks) 11 | #include "texture_load_16bpb.xesli" 12 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_32bpb.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM(blocks) (blocks) 11 | #include "texture_load_32bpb.xesli" 12 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_64bpb.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_64BPB_TRANSFORM(blocks) (blocks) 11 | #include "texture_load_64bpb.xesli" 12 | -------------------------------------------------------------------------------- /src/xenia/ui/shaders/guest_output_ffx_cas_sharpen_dither.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_GUEST_OUTPUT_DITHER 1 11 | #include "guest_output_ffx_cas_sharpen.xesli" 12 | -------------------------------------------------------------------------------- /src/xenia/tools/api-scanner/README.md: -------------------------------------------------------------------------------- 1 | ## api-scanner 2 | 3 | api-scanner will dump out the API imports from a packaged 360 game 4 | 5 | ### Usage 6 | 7 | Run from the command line 8 | 9 | `api-scanner ` 10 | 11 | or: 12 | 13 | `api-scanner --target ` 14 | 15 | Output is printed to the console window, so it self-managed. 16 | 17 | The suggested usage is to append the output to a local file: 18 | 19 | `api-scanner >> title_log.txt` 20 | 21 | ### Issues 22 | 23 | - Duplicate code for loading containers 24 | - Several issues with gflags library - incorrectly prints usage from other files (due to linkage with libxenia) 25 | -------------------------------------------------------------------------------- /src/xenia/ui/shaders/guest_output_ffx_cas_resample_dither.ps.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_GUEST_OUTPUT_DITHER 1 11 | #include "guest_output_ffx_cas_resample.xesli" 12 | -------------------------------------------------------------------------------- /android/android_studio_project/app/src/main/java/jp/xenia/emulator/GpuTraceViewerActivity.java: -------------------------------------------------------------------------------- 1 | package jp.xenia.emulator; 2 | 3 | import android.os.Bundle; 4 | 5 | public class GpuTraceViewerActivity extends WindowedAppActivity { 6 | @Override 7 | protected String getWindowedAppIdentifier() { 8 | return "xenia_gpu_vulkan_trace_viewer"; 9 | } 10 | 11 | @Override 12 | protected void onCreate(final Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | 15 | setContentView(R.layout.activity_gpu_trace_viewer); 16 | setWindowSurfaceView(findViewById(R.id.gpu_trace_viewer_surface_view)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vcfsx.s: -------------------------------------------------------------------------------- 1 | test_vcfsx_1: 2 | #_ REGISTER_IN v3 [3f800000, 3fc00000, 3f8ccccd, 3ff33333] 3 | # 1.0, 1.5, 1.1, 1.9 4 | vcfsx v3, v3, 0 5 | blr 6 | #_ REGISTER_OUT v3 [4e7e0000, 4e7f0000, 4e7e3333, 4e7fcccd] 7 | 8 | test_vcfsx_2: 9 | #_ REGISTER_IN v3 [3f800000, 3fc00000, 3f8ccccd, 3ff33333] 10 | # 1.0, 1.5, 1.1, 1.9 11 | vcfsx v3, v3, 1 12 | blr 13 | #_ REGISTER_OUT v3 [4dfe0000, 4dff0000, 4dfe3333, 4dffcccd] 14 | 15 | test_vcfsx_3: 16 | #_ REGISTER_IN v3 [3f800000, 3fc00000, 3f8ccccd, 3ff33333] 17 | # 1.0, 1.5, 1.1, 1.9 18 | vcfsx v3, v3, 10 19 | blr 20 | #_ REGISTER_OUT v3 [497e0000, 497f0000, 497e3333, 497fcccd] 21 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vsubshs.s: -------------------------------------------------------------------------------- 1 | test_vsubshs_1: 2 | #_ REGISTER_IN v3 [7FFF8001, 7FFF8003, 7FFF8005, 80068007] 3 | #_ REGISTER_IN v4 [00018001, 10000000, 42568124, 00000000] 4 | vsubshs v3, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [7ffe0000, 6fff8003, 3da9fee1, 80068007] 7 | #_ REGISTER_OUT v4 [00018001, 10000000, 42568124, 00000000] 8 | 9 | test_vsubshs_2: 10 | #_ REGISTER_IN v3 [7FFF8002, 7FFF8003, 7FFF8005, 80068007] 11 | #_ REGISTER_IN v4 [FFFF0005, 10000000, 42568124, 00000000] 12 | vsubshs v3, v3, v4 13 | blr 14 | #_ REGISTER_OUT v3 [7FFF8000, 6FFF8003, 3DA9FEE1, 80068007] 15 | #_ REGISTER_OUT v4 [FFFF0005, 10000000, 42568124, 00000000] 16 | -------------------------------------------------------------------------------- /android/android_studio_project/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:7.2.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | task clean(type: Delete) { 23 | delete rootProject.buildDir 24 | } -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/apply_gamma_pwl_fxaa_luma.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_APPLY_GAMMA_FXAA_LUMA 11 | #define XE_APPLY_GAMMA_COMPUTE 12 | #include "apply_gamma_pwl.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/apply_gamma_table_fxaa_luma.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_APPLY_GAMMA_FXAA_LUMA 11 | #define XE_APPLY_GAMMA_COMPUTE 12 | #include "apply_gamma_table.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/hid/hid_flags.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/hid/hid_flags.h" 11 | 12 | DEFINE_bool(guide_button, true, "Forward guide button presses to guest.", 13 | "HID"); 14 | -------------------------------------------------------------------------------- /src/xenia/cpu/testing/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | test_suite("xenia-cpu-tests", project_root, ".", { 5 | links = { 6 | "capstone", 7 | "fmt", 8 | "imgui", 9 | "xenia-base", 10 | "xenia-core", 11 | "xenia-cpu", 12 | "xenia-gpu", 13 | "xenia-hid-skylander", 14 | 15 | -- TODO(benvanik): cut these dependencies? 16 | "xenia-kernel", 17 | "xenia-ui", -- needed by xenia-base 18 | "xenia-patcher", 19 | }, 20 | filtered_links = { 21 | { 22 | filter = 'architecture:x86_64', 23 | links = { 24 | "xenia-cpu-backend-x64", 25 | }, 26 | } 27 | }, 28 | }) 29 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_bgrg8_rgbg8.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM XeBGRG8ToRGBG8 12 | #include "texture_load_32bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_gbgr8_grgb8.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM XeGBGR8ToGRGB8 12 | #include "texture_load_32bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/cpu/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-cpu") 6 | uuid("0109c91e-5a04-41ab-9168-0d5187d11298") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | "mspack", 12 | }) 13 | 14 | includedirs({ 15 | project_root.."/third_party/llvm/include", 16 | }) 17 | local_platform_files() 18 | local_platform_files("backend") 19 | local_platform_files("compiler") 20 | local_platform_files("compiler/passes") 21 | local_platform_files("hir") 22 | local_platform_files("ppc") 23 | 24 | if enableTests then 25 | include("testing") 26 | include("ppc/testing") 27 | end 28 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r5g6b5_b5g6r5.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeR5G6B5ToB5G6R5 12 | #include "texture_load_16bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/tessellation_indexed.vs.hlsl: -------------------------------------------------------------------------------- 1 | #include "endian.xesli" 2 | #include "xenos_draw.hlsli" 3 | 4 | XeHSControlPointInputIndexed main(uint xe_vertex_id : SV_VertexID) { 5 | XeHSControlPointInputIndexed output; 6 | // Only the lower 24 bits of the vertex index are used (tested on an Adreno 7 | // 200 phone). `((index & 0xFFFFFF) + offset) & 0xFFFFFF` is the same as 8 | // `(index + offset) & 0xFFFFFF`. 9 | output.index = 10 | float(clamp((XeEndianSwap32(xe_vertex_id, xe_vertex_index_endian) + 11 | xe_vertex_index_offset) & 12 | 0xFFFFFFu, 13 | xe_vertex_index_min_max.x, xe_vertex_index_min_max.y)); 14 | return output; 15 | } 16 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r16_snorm_float.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeRG16SNormToRG16Float 12 | #include "texture_load_16bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r16_unorm_float.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeRG16UNormToRG16Float 12 | #include "texture_load_16bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r4g4b4a4_a4r4g4b4.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeR4G4B4A4ToA4R4G4B4 12 | #include "texture_load_16bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r4g4b4a4_b4g4r4a4.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeR4G4B4A4ToB4G4R4A4 12 | #include "texture_load_16bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r5g5b5a1_b5g5r5a1.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeR5G5B5A1ToB5G5R5A1 12 | #include "texture_load_16bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/apu/apu_flags.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_APU_APU_FLAGS_H_ 11 | #define XENIA_APU_APU_FLAGS_H_ 12 | 13 | #include "xenia/base/cvar.h" 14 | DECLARE_bool(mute) 15 | 16 | #endif // XENIA_APU_APU_FLAGS_H_ 17 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_16bpb_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM(blocks) (blocks) 12 | #include "texture_load_16bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_32bpb_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM(blocks) (blocks) 12 | #include "texture_load_32bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_64bpb_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #define XE_TEXTURE_LOAD_64BPB_TRANSFORM(blocks) (blocks) 12 | #include "texture_load_64bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_rg16_snorm_float.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM XeRG16SNormToRG16Float 12 | #include "texture_load_32bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_rg16_unorm_float.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM XeRG16UNormToRG16Float 12 | #include "texture_load_32bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_rgba16_snorm_float.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_64BPB_TRANSFORM XeRG16SNormToRG16Float 12 | #include "texture_load_64bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_rgba16_unorm_float.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_64BPB_TRANSFORM XeRG16UNormToRG16Float 12 | #include "texture_load_64bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_bgrg8_rgb8.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TO_64BPB XeBGRG8ToRGB8WithRGBBSwizzle 12 | #include "texture_load_32bpb_64bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_gbgr8_rgb8.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TO_64BPB XeGBGR8ToRGB8WithRGBBSwizzle 12 | #include "texture_load_32bpb_64bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r10g11b11_rgba16.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TO_64BPB XeR10G11B11UNormToRGBA16 12 | #include "texture_load_32bpb_64bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r11g11b10_rgba16.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TO_64BPB XeR11G11B10UNormToRGBA16 12 | #include "texture_load_32bpb_64bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/kernel/xbdm/xbdm_module_export_groups.inc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | // This is a partial file designed to be included by other files when 11 | // constructing various tables. 12 | 13 | XE_MODULE_EXPORT_GROUP(xbdm, Misc) 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/float24_round.ps.hlsl: -------------------------------------------------------------------------------- 1 | #include "pixel_formats.xesli" 2 | #include "xenos_draw.hlsli" 3 | 4 | struct XePSInput { 5 | XeVertexPrePS pre_ps; 6 | sample float4 position : SV_Position; 7 | }; 8 | 9 | precise float main(XePSInput xe_input) : SV_Depth { 10 | // Input Z may be outside the viewport range (it's clamped after the shader). 11 | // Assuming that 0...0.5 on the host corresponds to 0...1 on the guest, to 12 | // allow for safe reinterpretation of any 24-bit value to and from float24 13 | // depth using depth output without unrestricted depth range. 14 | return asfloat(XeFloat20e4To32( 15 | XeFloat32To20e4(asuint(saturate(xe_input.position.z * 2.0f)), true), 16 | true)); 17 | } 18 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r10g11b11_rgba16_snorm.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TO_64BPB XeR10G11B11SNormToRGBA16 12 | #include "texture_load_32bpb_64bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r11g11b10_rgba16_snorm.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TO_64BPB XeR11G11B10SNormToRGBA16 12 | #include "texture_load_32bpb_64bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/kernel/util/kernel_fwd.h: -------------------------------------------------------------------------------- 1 | #ifndef XENIA_KERNEL_UTIL_KERNEL_FWD_H_ 2 | #define XENIA_KERNEL_UTIL_KERNEL_FWD_H_ 3 | 4 | namespace xe::kernel { 5 | class Dispatcher; 6 | class XHostThread; 7 | class KernelModule; 8 | class XModule; 9 | class XNotifyListener; 10 | class XThread; 11 | class UserModule; 12 | struct X_KPROCESS; 13 | struct TerminateNotification; 14 | struct X_TIME_STAMP_BUNDLE; 15 | class KernelState; 16 | struct XAPC; 17 | 18 | struct X_KPCR; 19 | struct X_KTHREAD; 20 | struct X_OBJECT_HEADER; 21 | struct X_OBJECT_CREATE_INFORMATION; 22 | 23 | } // namespace xe::kernel 24 | 25 | namespace xe::kernel::util { 26 | class NativeList; 27 | class ObjectTable; 28 | } // namespace xe::kernel::util 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xenia/apu/audio_driver.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/apu/audio_driver.h" 11 | 12 | namespace xe { 13 | namespace apu { 14 | 15 | AudioDriver::~AudioDriver() = default; 16 | 17 | } // namespace apu 18 | } // namespace xe 19 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r5g5b6_b5g6r5_swizzle_rbga.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeR5G5B6ToB5G6R5WithRBGASwizzle 12 | #include "texture_load_16bpb.xesli" 13 | -------------------------------------------------------------------------------- /src/xenia/hid/hid_flags.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_HID_HID_FLAGS_H_ 11 | #define XENIA_HID_HID_FLAGS_H_ 12 | 13 | #include "xenia/base/cvar.h" 14 | 15 | DECLARE_bool(guide_button); 16 | 17 | #endif // XENIA_HID_HID_FLAGS_H_ 18 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_depth_float.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM(blocks) \ 12 | (XeFloat20e4To32((blocks) >> 8u)) 13 | #include "texture_load_32bpb.xesli" 14 | -------------------------------------------------------------------------------- /third_party/crypto/des/descbc.h: -------------------------------------------------------------------------------- 1 | #ifndef DESCBC_H 2 | #define DESCBC_H 3 | 4 | #include "des.h" 5 | 6 | class DESCBC 7 | { 8 | public: 9 | DESCBC(ui64 key, ui64 iv) : des(key), iv(iv), last_block(iv) {} 10 | inline ui64 encrypt(ui64 block) 11 | { 12 | last_block = des.encrypt(block ^ last_block); 13 | return last_block; 14 | } 15 | 16 | inline ui64 decrypt(ui64 block) 17 | { 18 | ui64 result = des.decrypt(block) ^ last_block; 19 | last_block = block; 20 | return result; 21 | } 22 | 23 | inline void reset() 24 | { 25 | last_block = iv; 26 | } 27 | 28 | private: 29 | DES des; 30 | ui64 iv; 31 | ui64 last_block; 32 | }; 33 | 34 | #endif // DESCBC_H 35 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_dxt3aas1111_argb4.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_DXT3A_AS_1_1_1_1_TO_16BPP \ 12 | XeDXT3AAs1111TwoBlocksRowToARGB4 13 | #include "texture_load_dxt3aas1111.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_dxt3aas1111_bgra4.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_DXT3A_AS_1_1_1_1_TO_16BPP \ 12 | XeDXT3AAs1111TwoBlocksRowToBGRA4 13 | #include "texture_load_dxt3aas1111.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_depth_unorm.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "pixel_formats.xesli" 11 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM(blocks) \ 12 | (xesl_floatBitsToUint(XeUNorm24To32((blocks) >> 8u))) 13 | #include "texture_load_32bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r5g6b5_b5g6r5_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeR5G6B5ToB5G6R5 13 | #include "texture_load_16bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r16_snorm_float_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeRG16SNormToRG16Float 13 | #include "texture_load_16bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r16_unorm_float_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeRG16UNormToRG16Float 13 | #include "texture_load_16bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r4g4b4a4_a4r4g4b4_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeR4G4B4A4ToA4R4G4B4 13 | #include "texture_load_16bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r4g4b4a4_b4g4r4a4_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeR4G4B4A4ToB4G4R4A4 13 | #include "texture_load_16bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r5g5b5a1_b5g5r5a1_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeR5G5B5A1ToB5G5R5A1 13 | #include "texture_load_16bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_rg16_snorm_float_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM XeRG16SNormToRG16Float 13 | #include "texture_load_32bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_rg16_unorm_float_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM XeRG16UNormToRG16Float 13 | #include "texture_load_32bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_rgba16_snorm_float_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_64BPB_TRANSFORM XeRG16SNormToRG16Float 13 | #include "texture_load_64bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_rgba16_unorm_float_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_64BPB_TRANSFORM XeRG16UNormToRG16Float 13 | #include "texture_load_64bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r10g11b11_rgba16_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_32BPB_TO_64BPB XeR10G11B11UNormToRGBA16 13 | #include "texture_load_32bpb_64bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r11g11b10_rgba16_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_32BPB_TO_64BPB XeR11G11B10UNormToRGBA16 13 | #include "texture_load_32bpb_64bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r10g11b11_rgba16_snorm_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_32BPB_TO_64BPB XeR10G11B11SNormToRGBA16 13 | #include "texture_load_32bpb_64bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r11g11b10_rgba16_snorm_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_32BPB_TO_64BPB XeR11G11B10SNormToRGBA16 13 | #include "texture_load_32bpb_64bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_r5g5b6_b5g6r5_swizzle_rbga_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_16BPB_TRANSFORM XeR5G5B6ToB5G6R5WithRBGASwizzle 13 | #include "texture_load_16bpb.xesli" 14 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vsplth.s: -------------------------------------------------------------------------------- 1 | test_vsplth_1: 2 | #_ REGISTER_IN v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 3 | vsplth v3, v4, 0 4 | blr 5 | #_ REGISTER_OUT v3 [00010001, 00010001, 00010001, 00010001] 6 | #_ REGISTER_OUT v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 7 | 8 | test_vsplth_2: 9 | #_ REGISTER_IN v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 10 | vsplth v3, v4, 1 11 | blr 12 | #_ REGISTER_OUT v3 [02030203, 02030203, 02030203, 02030203] 13 | #_ REGISTER_OUT v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 14 | 15 | test_vsplth_3: 16 | #_ REGISTER_IN v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 17 | vsplth v3, v4, 7 18 | blr 19 | #_ REGISTER_OUT v3 [0E0F0E0F, 0E0F0E0F, 0E0F0E0F, 0E0F0E0F] 20 | #_ REGISTER_OUT v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 21 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vspltw.s: -------------------------------------------------------------------------------- 1 | test_vspltw_1: 2 | #_ REGISTER_IN v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 3 | vspltw v3, v4, 0 4 | blr 5 | #_ REGISTER_OUT v3 [00010203, 00010203, 00010203, 00010203] 6 | #_ REGISTER_OUT v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 7 | 8 | test_vspltw_2: 9 | #_ REGISTER_IN v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 10 | vspltw v3, v4, 1 11 | blr 12 | #_ REGISTER_OUT v3 [04050607, 04050607, 04050607, 04050607] 13 | #_ REGISTER_OUT v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 14 | 15 | test_vspltw_3: 16 | #_ REGISTER_IN v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 17 | vspltw v3, v4, 3 18 | blr 19 | #_ REGISTER_OUT v3 [0C0D0E0F, 0C0D0E0F, 0C0D0E0F, 0C0D0E0F] 20 | #_ REGISTER_OUT v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 21 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_depth_float_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM(blocks) \ 13 | (XeFloat20e4To32((blocks) >> 8u)) 14 | #include "texture_load_32bpb.xesli" 15 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_rlwimi.s: -------------------------------------------------------------------------------- 1 | .macro make_full_test_constant dest, a, b, c, d 2 | lis \dest, \a 3 | ori \dest, \dest, \b 4 | sldi \dest, \dest, 32 5 | lis r3, \c 6 | ori r3, r3, \d 7 | clrldi r3, r3, 32 8 | or \dest, \dest, r3 9 | .endm 10 | 11 | test_rlwimi: 12 | #_ REGISTER_IN r4 0xCAFEBABE90003000 13 | #_ REGISTER_IN r6 0xDEADBEEF00000003 14 | rlwimi r6, r4, 2, 0, 0x1D 15 | blr 16 | #_ REGISTER_OUT r4 0xCAFEBABE90003000 17 | #_ REGISTER_OUT r6 0xDEADBEEF4000C003 18 | 19 | test_rlwimi_constant: 20 | make_full_test_constant r4, 0xCAFE, 0xBABE, 0x9000, 0x3000 21 | make_full_test_constant r6, 0xDEAD, 0xBEEF, 0x0000, 0x0003 22 | rlwimi r6, r4, 2, 0, 0x1D 23 | blr 24 | #_ REGISTER_OUT r4 0xCAFEBABE90003000 25 | #_ REGISTER_OUT r6 0xDEADBEEF4000C003 26 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vspltb.s: -------------------------------------------------------------------------------- 1 | test_vspltb_1: 2 | #_ REGISTER_IN v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 3 | vspltb v3, v4, 0 4 | blr 5 | #_ REGISTER_OUT v3 [00000000, 00000000, 00000000, 00000000] 6 | #_ REGISTER_OUT v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 7 | 8 | test_vspltb_2: 9 | #_ REGISTER_IN v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 10 | vspltb v3, v4, 1 11 | blr 12 | #_ REGISTER_OUT v3 [01010101, 01010101, 01010101, 01010101] 13 | #_ REGISTER_OUT v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 14 | 15 | test_vspltb_3: 16 | #_ REGISTER_IN v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 17 | vspltb v3, v4, 0xF 18 | blr 19 | #_ REGISTER_OUT v3 [0F0F0F0F, 0F0F0F0F, 0F0F0F0F, 0F0F0F0F] 20 | #_ REGISTER_OUT v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 21 | -------------------------------------------------------------------------------- /src/xenia/kernel/kernel_flags.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_KERNEL_KERNEL_FLAGS_H_ 11 | #define XENIA_KERNEL_KERNEL_FLAGS_H_ 12 | #include "xenia/base/cvar.h" 13 | 14 | DECLARE_bool(headless); 15 | DECLARE_bool(log_high_frequency_kernel_calls); 16 | 17 | #endif // XENIA_KERNEL_KERNEL_FLAGS_H_ 18 | -------------------------------------------------------------------------------- /src/xenia/ui/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-ui") 6 | uuid("d0407c25-b0ea-40dc-846c-82c46fbd9fa2") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | }) 12 | local_platform_files() 13 | removefiles({ 14 | "*_demo.cc", 15 | "windowed_app_main_*.cc", 16 | }) 17 | if os.istarget("android") then 18 | filter("platforms:Android-*") 19 | -- Exports JNI functions. 20 | wholelib("On") 21 | end 22 | 23 | filter("platforms:Windows") 24 | links({ 25 | "dwmapi", 26 | "dxgi", 27 | "winmm", 28 | }) 29 | 30 | filter("platforms:Linux") 31 | links({ 32 | "xcb", 33 | "X11", 34 | "X11-xcb" 35 | }) 36 | -------------------------------------------------------------------------------- /third_party/snappy.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("snappy") 3 | uuid("bb143d61-3fd4-44c2-8b7e-04cc538ba2c7") 4 | kind("StaticLib") 5 | language("C++") 6 | 7 | files({ 8 | "snappy/snappy-internal.h", 9 | "snappy/snappy-sinksource.cc", 10 | "snappy/snappy-sinksource.h", 11 | "snappy/snappy-stubs-internal.cc", 12 | "snappy/snappy-stubs-internal.h", 13 | "snappy/snappy-stubs-public.h", 14 | "snappy/snappy.cc", 15 | "snappy/snappy.h", 16 | }) 17 | 18 | local snappy_dir = path.getabsolute("snappy") 19 | if not os.isfile(path.join(snappy_dir, "snappy-stubs-public.h")) then 20 | prebuildcommands({ 21 | "cmake -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF -DSNAPPY_REQUIRE_AVX=ON "..snappy_dir.." -B"..snappy_dir 22 | }) 23 | end 24 | -------------------------------------------------------------------------------- /src/xenia/base/console_posix.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2021 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | #include "xenia/base/console.h" 14 | 15 | namespace xe { 16 | 17 | bool has_console_attached() { return isatty(fileno(stdin)) == 1; } 18 | 19 | void AttachConsole() {} 20 | 21 | } // namespace xe 22 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vmaxsh.s: -------------------------------------------------------------------------------- 1 | test_vmaxsh_1: 2 | #_ REGISTER_IN v3 [00000001, 00020003, 00040005, 80060007] 3 | #_ REGISTER_IN v4 [00080009, 000A000B, 000C000D, 000E000F] 4 | vmaxsh v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [00000001, 00020003, 00040005, 80060007] 7 | #_ REGISTER_OUT v4 [00080009, 000A000B, 000C000D, 000E000F] 8 | #_ REGISTER_OUT v5 [00080009, 000A000B, 000C000D, 000E000F] 9 | 10 | test_vmaxsh_2: 11 | #_ REGISTER_IN v3 [00000009, 0002000B, 0004000D, 0006000F] 12 | #_ REGISTER_IN v4 [00080001, 000A0003, 000C0005, 000E0007] 13 | vmaxsh v5, v3, v4 14 | blr 15 | #_ REGISTER_OUT v3 [00000009, 0002000B, 0004000D, 0006000F] 16 | #_ REGISTER_OUT v4 [00080001, 000A0003, 000C0005, 000E0007] 17 | #_ REGISTER_OUT v5 [00080009, 000A000B, 000C000D, 000E000F] 18 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vmaxuh.s: -------------------------------------------------------------------------------- 1 | test_vmaxuh_1: 2 | #_ REGISTER_IN v3 [00000001, 00020003, 00040005, 00060007] 3 | #_ REGISTER_IN v4 [00080009, 000A000B, 000C000D, 800E000F] 4 | vmaxuh v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [00000001, 00020003, 00040005, 00060007] 7 | #_ REGISTER_OUT v4 [00080009, 000A000B, 000C000D, 800E000F] 8 | #_ REGISTER_OUT v5 [00080009, 000A000B, 000C000D, 800E000F] 9 | 10 | test_vmaxuh_2: 11 | #_ REGISTER_IN v3 [00000009, 0002000B, 0004000D, 0006000F] 12 | #_ REGISTER_IN v4 [00080001, 000A0003, 000C0005, 000E0007] 13 | vmaxuh v5, v3, v4 14 | blr 15 | #_ REGISTER_OUT v3 [00000009, 0002000B, 0004000D, 0006000F] 16 | #_ REGISTER_OUT v4 [00080001, 000A0003, 000C0005, 000E0007] 17 | #_ REGISTER_OUT v5 [00080009, 000A000B, 000C000D, 000E000F] 18 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vminsh.s: -------------------------------------------------------------------------------- 1 | test_vminsh_1: 2 | #_ REGISTER_IN v3 [00000001, 00020003, 00040005, 00060007] 3 | #_ REGISTER_IN v4 [00080009, 000A000B, 000C000D, 000E000F] 4 | vminsh v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [00000001, 00020003, 00040005, 00060007] 7 | #_ REGISTER_OUT v4 [00080009, 000A000B, 000C000D, 000E000F] 8 | #_ REGISTER_OUT v5 [00000001, 00020003, 00040005, 00060007] 9 | 10 | test_vminsh_2: 11 | #_ REGISTER_IN v3 [00000009, 0002000B, 0004000D, 0006000F] 12 | #_ REGISTER_IN v4 [00080001, 000A0003, 000C0005, 000E0007] 13 | vminsh v5, v3, v4 14 | blr 15 | #_ REGISTER_OUT v3 [00000009, 0002000B, 0004000D, 0006000F] 16 | #_ REGISTER_OUT v4 [00080001, 000A0003, 000C0005, 000E0007] 17 | #_ REGISTER_OUT v5 [00000001, 00020003, 00040005, 00060007] 18 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vminuh.s: -------------------------------------------------------------------------------- 1 | test_vminuh_1: 2 | #_ REGISTER_IN v3 [00000001, 00020003, 00040005, 00060007] 3 | #_ REGISTER_IN v4 [00080009, 000A000B, 000C000D, 000E000F] 4 | vminuh v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [00000001, 00020003, 00040005, 00060007] 7 | #_ REGISTER_OUT v4 [00080009, 000A000B, 000C000D, 000E000F] 8 | #_ REGISTER_OUT v5 [00000001, 00020003, 00040005, 00060007] 9 | 10 | test_vminuh_2: 11 | #_ REGISTER_IN v3 [00000009, 0002000B, 0004000D, 0006000F] 12 | #_ REGISTER_IN v4 [00080001, 000A0003, 000C0005, 000E0007] 13 | vminuh v5, v3, v4 14 | blr 15 | #_ REGISTER_OUT v3 [00000009, 0002000B, 0004000D, 0006000F] 16 | #_ REGISTER_OUT v4 [00080001, 000A0003, 000C0005, 000E0007] 17 | #_ REGISTER_OUT v5 [00000001, 00020003, 00040005, 00060007] 18 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vmrghb.s: -------------------------------------------------------------------------------- 1 | test_vmrghb_1: 2 | #_ REGISTER_IN v3 [00010203, 04050607, 08090A0B, 0C0D0E0F] 3 | #_ REGISTER_IN v4 [10111213, 14151617, 18191A1B, 1C1D1E1F] 4 | vmrghb v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [00010203, 04050607, 08090A0B, 0C0D0E0F] 7 | #_ REGISTER_OUT v4 [10111213, 14151617, 18191A1B, 1C1D1E1F] 8 | #_ REGISTER_OUT v5 [00100111, 02120313, 04140515, 06160717] 9 | 10 | test_vmrghb_2: 11 | #_ REGISTER_IN v3 [F0F1F2F3, F4F5F6F7, F8F9FAFB, FCFDFEFF] 12 | #_ REGISTER_IN v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 13 | vmrghb v5, v3, v4 14 | blr 15 | #_ REGISTER_OUT v3 [F0F1F2F3, F4F5F6F7, F8F9FAFB, FCFDFEFF] 16 | #_ REGISTER_OUT v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 17 | #_ REGISTER_OUT v5 [F000F101, F202F303, F404F505, F606F707] 18 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vmrglb.s: -------------------------------------------------------------------------------- 1 | test_vmrglb_1: 2 | #_ REGISTER_IN v3 [00010203, 04050607, 08090A0B, 0C0D0E0F] 3 | #_ REGISTER_IN v4 [10111213, 14151617, 18191A1B, 1C1D1E1F] 4 | vmrglb v5, v3, v4 5 | blr 6 | #_ REGISTER_OUT v3 [00010203, 04050607, 08090A0B, 0C0D0E0F] 7 | #_ REGISTER_OUT v4 [10111213, 14151617, 18191A1B, 1C1D1E1F] 8 | #_ REGISTER_OUT v5 [08180919, 0a1a0b1b, 0c1c0d1d, 0e1e0f1f] 9 | 10 | test_vmrglb_2: 11 | #_ REGISTER_IN v3 [F0F1F2F3, F4F5F6F7, F8F9FAFB, FCFDFEFF] 12 | #_ REGISTER_IN v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 13 | vmrglb v5, v3, v4 14 | blr 15 | #_ REGISTER_OUT v3 [F0F1F2F3, F4F5F6F7, F8F9FAFB, FCFDFEFF] 16 | #_ REGISTER_OUT v4 [00010203, 04050607, 08090A0B, 0C0D0E0F] 17 | #_ REGISTER_OUT v5 [F808F909, FA0AFB0B, FC0CFD0D, FE0EFF0F] 18 | -------------------------------------------------------------------------------- /src/xenia/hid/skylander/skylander_portal.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2025 Xenia Canary. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/hid/skylander/skylander_portal.h" 11 | 12 | namespace xe { 13 | namespace hid { 14 | 15 | SkylanderPortal::SkylanderPortal() {} 16 | SkylanderPortal::~SkylanderPortal() {} 17 | 18 | } // namespace hid 19 | } // namespace xe 20 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/texture_load_depth_unorm_scaled.cs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #define XE_TEXTURE_LOAD_RESOLUTION_SCALED 11 | #include "pixel_formats.xesli" 12 | #define XE_TEXTURE_LOAD_32BPB_TRANSFORM(blocks) \ 13 | (xesl_floatBitsToUint(XeUNorm24To32((blocks) >> 8u))) 14 | #include "texture_load_32bpb.xesli" 15 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_fsel.s: -------------------------------------------------------------------------------- 1 | test_fsel_1: 2 | #_ REGISTER_IN f2 2.0 3 | #_ REGISTER_IN f3 3.0 4 | #_ REGISTER_IN f4 4.0 5 | fsel f1, f2, f3, f4 6 | blr 7 | #_ REGISTER_OUT f1 3.0 8 | #_ REGISTER_OUT f2 2.0 9 | #_ REGISTER_OUT f3 3.0 10 | #_ REGISTER_OUT f4 4.0 11 | 12 | test_fsel_2: 13 | #_ REGISTER_IN f2 -2.0 14 | #_ REGISTER_IN f3 3.0 15 | #_ REGISTER_IN f4 4.0 16 | fsel f1, f2, f3, f4 17 | blr 18 | #_ REGISTER_OUT f1 4.0 19 | #_ REGISTER_OUT f2 -2.0 20 | #_ REGISTER_OUT f3 3.0 21 | #_ REGISTER_OUT f4 4.0 22 | 23 | test_fsel_3: 24 | #_ REGISTER_IN f2 0.0 25 | #_ REGISTER_IN f3 3.0 26 | #_ REGISTER_IN f4 4.0 27 | fsel f1, f2, f3, f4 28 | blr 29 | #_ REGISTER_OUT f1 3.0 30 | #_ REGISTER_OUT f2 0.0 31 | #_ REGISTER_OUT f3 3.0 32 | #_ REGISTER_OUT f4 4.0 33 | -------------------------------------------------------------------------------- /src/xenia/cpp.hint: -------------------------------------------------------------------------------- 1 | // Hint files help the Visual Studio IDE interpret Visual C++ identifiers 2 | // such as names of functions and macros. 3 | // For more information see https://go.microsoft.com/fwlink/?linkid=865984 4 | 5 | #define DECLARE_XAM_EXPORT_(name, category, tags) 6 | #define DECLARE_XAM_EXPORT1(name, category, tag) 7 | #define DECLARE_XAM_EXPORT2(name, category, tag1, tag2) 8 | 9 | #define DECLARE_XBDM_EXPORT_(name, category, tags) 10 | #define DECLARE_XBDM_EXPORT1(name, category, tag) 11 | 12 | #define DECLARE_XBOXKRNL_EXPORT_(name, category, tags) 13 | #define DECLARE_XBOXKRNL_EXPORT1(name, category, tag) 14 | #define DECLARE_XBOXKRNL_EXPORT2(name, category, tag1, tag2) 15 | #define DECLARE_XBOXKRNL_EXPORT3(name, category, tag1, tag2, tag3) 16 | #define DECLARE_XBOXKRNL_EXPORT4(name, category, tag1, tag2, tag3, tag4) 17 | -------------------------------------------------------------------------------- /src/xenia/vfs/device.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2020 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/vfs/device.h" 11 | 12 | #include "xenia/base/logging.h" 13 | 14 | namespace xe { 15 | namespace vfs { 16 | 17 | Device::Device(const std::string_view mount_path) : mount_path_(mount_path) {} 18 | Device::~Device() = default; 19 | 20 | } // namespace vfs 21 | } // namespace xe 22 | -------------------------------------------------------------------------------- /src/xenia/cpu/backend/x64/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-cpu-backend-x64") 6 | uuid("7d8d5dce-4696-4197-952a-09506f725afe") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "capstone", 11 | "fmt", 12 | "xenia-base", 13 | "xenia-cpu", 14 | }) 15 | defines({ 16 | "CAPSTONE_X86_ATT_DISABLE", 17 | "CAPSTONE_HAS_X86", 18 | "CAPSTONE_USE_SYS_DYN_MEM", 19 | "XBYAK_NO_OP_NAMES", 20 | "XBYAK_ENABLE_OMITTED_OPERAND", 21 | }) 22 | -- Enable VTune, if it's installed. 23 | if os.isdir(project_root.."/third_party/vtune") then 24 | defines { "ENABLE_VTUNE=1" } 25 | end 26 | 27 | includedirs({ 28 | project_root.."/third_party/capstone/include", 29 | }) 30 | local_platform_files() 31 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_neg.s: -------------------------------------------------------------------------------- 1 | test_neg_1: 2 | #_ REGISTER_IN r3 0x0000000080000000 3 | neg r3, r3 4 | blr 5 | #_ REGISTER_OUT r3 0xFFFFFFFF80000000 6 | 7 | test_neg_1_constant: 8 | li r3, 1 9 | sldi r3, r3, 31 10 | neg r3, r3 11 | blr 12 | #_ REGISTER_OUT r3 0xFFFFFFFF80000000 13 | 14 | test_neg_2: 15 | #_ REGISTER_IN r3 0x8000000000000000 16 | neg r3, r3 17 | blr 18 | #_ REGISTER_OUT r3 0x8000000000000000 19 | 20 | test_neg_2_constant: 21 | li r3, 1 22 | sldi r3, r3, 63 23 | neg r3, r3 24 | blr 25 | #_ REGISTER_OUT r3 0x8000000000000000 26 | 27 | test_neg_3: 28 | #_ REGISTER_IN r3 0x0000000000000005 29 | neg r3, r3 30 | blr 31 | #_ REGISTER_OUT r3 0xFFFFFFFFFFFFFFFB 32 | 33 | test_neg_3_constant: 34 | li r3, 5 35 | neg r3, r3 36 | blr 37 | #_ REGISTER_OUT r3 0xFFFFFFFFFFFFFFFB 38 | -------------------------------------------------------------------------------- /src/xenia/base/console.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2021 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_BASE_CONSOLE_H_ 11 | #define XENIA_BASE_CONSOLE_H_ 12 | 13 | namespace xe { 14 | 15 | // Returns true if there is a user-visible console attached to receive stdout. 16 | bool has_console_attached(); 17 | 18 | void AttachConsole(); 19 | 20 | } // namespace xe 21 | 22 | #endif // XENIA_BASE_CONSOLE_H_ 23 | -------------------------------------------------------------------------------- /src/xenia/kernel/kernel_flags.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/kernel/kernel_flags.h" 11 | 12 | DEFINE_bool(headless, false, 13 | "Don't display any UI, using defaults for prompts as needed.", 14 | "UI"); 15 | DEFINE_bool(log_high_frequency_kernel_calls, false, 16 | "Log kernel calls with the kHighFrequency tag.", "Kernel"); 17 | -------------------------------------------------------------------------------- /docs/instruction_tracing.md: -------------------------------------------------------------------------------- 1 | In x64_tracers.cc: 2 | 3 | Enable tracing: 4 | ``` 5 | #define ITRACE 1 <--- for only ppc instructions 6 | #define DTRACE 1 <--- add HIR data 7 | ``` 8 | 9 | If tracing data, run with the following flags: 10 | ``` 11 | --store_all_context_values 12 | ``` 13 | 14 | By default, tracing will start at the beginning and only for the specified 15 | thread. 16 | 17 | Change traced thread by thread creation ID: 18 | ``` 19 | #define TARGET_THREAD 4 20 | ``` 21 | 22 | To only trace at a certain point, change default trace flag to false: 23 | ``` 24 | bool trace_enabled = true; 25 | ``` 26 | Add a breakpoint: 27 | ``` 28 | --break_on_instruction=0x821009A4 29 | ``` 30 | On break, add the following to the Watch window and set it to true: 31 | ``` 32 | xe::cpu::backend::x64::trace_enabled 33 | ``` 34 | Continue, and watch stuff appear in the log. 35 | -------------------------------------------------------------------------------- /android/android_studio_project/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_fabs.s: -------------------------------------------------------------------------------- 1 | test_fabs_1: 2 | #_ REGISTER_IN f1 1.0 3 | fabs f1, f1 4 | blr 5 | #_ REGISTER_OUT f1 1.0 6 | 7 | test_fabs_2: 8 | #_ REGISTER_IN f1 -1.0 9 | fabs f1, f1 10 | blr 11 | #_ REGISTER_OUT f1 1.0 12 | 13 | test_fabs_3: 14 | #_ REGISTER_IN f1 -1234.0 15 | fabs f1, f1 16 | blr 17 | #_ REGISTER_OUT f1 1234.0 18 | 19 | #test_fabs_cr_1: 20 | # #_ REGISTER_IN f1 1.0 21 | # fabs. f1, f1 22 | # mfcr r12 23 | # blr 24 | # #_ REGISTER_OUT f1 1.0 25 | # #_ REGISTER_OUT r12 0x04000000 26 | 27 | #test_fabs_cr_2: 28 | # #_ REGISTER_IN f1 -1.0 29 | # fabs. f1, f1 30 | # mfcr r12 31 | # blr 32 | # #_ REGISTER_OUT f1 1.0 33 | # #_ REGISTER_OUT r12 0x08000000 34 | 35 | #test_fabs_cr_3: 36 | # #_ REGISTER_IN f1 -1234.0 37 | # fabs. f1, f1 38 | # mfcr r12 39 | # blr 40 | # #_ REGISTER_OUT f1 1234.0 41 | # #_ REGISTER_OUT r12 0x08000000 42 | -------------------------------------------------------------------------------- /src/xenia/ui/shaders/amd_language.xesli: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_UI_SHADERS_AMD_LANGUAGE_XESLI_ 11 | #define XENIA_UI_SHADERS_AMD_LANGUAGE_XESLI_ 12 | 13 | #if XESL_LANGUAGE_GLSL 14 | #define A_GLSL 1 15 | #elif XESL_LANGUAGE_HLSL 16 | #define A_HLSL 1 17 | #else 18 | #error Unknown shading language for AMD shaders. 19 | #endif 20 | 21 | #endif // XENIA_UI_SHADERS_AMD_LANGUAGE_XESLI_ 22 | -------------------------------------------------------------------------------- /src/xenia/cpu/stack_walker_posix.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2017 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/cpu/stack_walker.h" 11 | 12 | #include "xenia/base/logging.h" 13 | 14 | namespace xe { 15 | namespace cpu { 16 | 17 | std::unique_ptr StackWalker::Create( 18 | backend::CodeCache* code_cache) { 19 | XELOGD("Stack walker unimplemented on posix"); 20 | return nullptr; 21 | } 22 | 23 | } // namespace cpu 24 | } // namespace xe 25 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/tessellation_adaptive.vs.hlsl: -------------------------------------------------------------------------------- 1 | #include "endian.xesli" 2 | #include "xenos_draw.hlsli" 3 | 4 | XeHSControlPointInputAdaptive main(uint xe_edge_factor : SV_VertexID) { 5 | XeHSControlPointInputAdaptive output; 6 | // The Xbox 360's GPU accepts the float32 tessellation factors for edges 7 | // through a special kind of an index buffer. 8 | // While 4D5307F2 sets the factors to 0 for frustum-culled (quad) patches, in 9 | // 4D5307E6 only allowing patches with factors above 0 makes distant 10 | // (triangle) patches disappear - it appears that there are no special values 11 | // for culled patches on the Xbox 360 (unlike zero, negative and NaN on 12 | // Direct3D 11). 13 | output.edge_factor = clamp( 14 | asfloat(XeEndianSwap32(xe_edge_factor, xe_vertex_index_endian)) + 1.0f, 15 | xe_tessellation_factor_range.x, xe_tessellation_factor_range.y); 16 | return output; 17 | } 18 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vupklsh.s: -------------------------------------------------------------------------------- 1 | test_vupklsh_1: 2 | #_ REGISTER_IN v3 [00010203, 04050607, 08090A0B, 0C0D0E0F] 3 | vupklsh v3, v3 4 | blr 5 | #_ REGISTER_OUT v3 [00000809, 00000a0b, 00000c0d, 00000e0f] 6 | 7 | test_vupklsh_2: 8 | #_ REGISTER_IN v3 [7F800203, 04050607, 7F800A0B, 0C0D0E0F] 9 | vupklsh v3, v3 10 | blr 11 | #_ REGISTER_OUT v3 [00007f80, 00000a0b, 00000c0d, 00000e0f] 12 | 13 | test_vupklsh_3: 14 | # {-4, -3, -2, -1, 0, 1, 2, 3} 15 | #_ REGISTER_IN v3 [FFFCFFFD, FFFEFFFF, 00000001, 00020003] 16 | vupklsh v3, v3 17 | blr 18 | # {-4, -3, -2, -1} 19 | #_ REGISTER_OUT v3 [00000000, 00000001, 00000002, 00000003] 20 | 21 | test_vupklsh_4: 22 | # {0, 65535, 65535, 0, 0, 0, 65535, 0} 23 | #_ REGISTER_IN v3 [0000FFFF, FFFF0000, 00000000, FFFF0000] 24 | vupklsh v3, v3 25 | blr 26 | # {0, 0, 4294967295, 0} 27 | #_ REGISTER_OUT v3 [00000000, 00000000, FFFFFFFF, 00000000] 28 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vupkhsh.s: -------------------------------------------------------------------------------- 1 | test_vupkhsh_1: 2 | #_ REGISTER_IN v3 [00010203, 04050607, 08090A0B, 0C0D0E0F] 3 | vupkhsh v3, v3 4 | blr 5 | #_ REGISTER_OUT v3 [00000001, 00000203, 00000405, 00000607] 6 | 7 | test_vupkhsh_2: 8 | #_ REGISTER_IN v3 [7F800203, 04050607, 7F800A0B, 0C0D0E0F] 9 | vupkhsh v3, v3 10 | blr 11 | #_ REGISTER_OUT v3 [00007f80, 00000203, 00000405, 00000607] 12 | 13 | test_vupkhsh_3: 14 | # {0, 65535, 65535, 0, 0, 0, 65535, 0} 15 | #_ REGISTER_IN v3 [0000FFFF, FFFF0000, 00000000, FFFF0000] 16 | vupkhsh v3, v3 17 | blr 18 | # {0, 4294967295, 4294967295, 0} 19 | #_ REGISTER_OUT v3 [00000000, FFFFFFFF, FFFFFFFF, 00000000] 20 | 21 | test_vupkhsh_4: 22 | # {-4, -3, -2, -1, 0, 1, 2, 3} 23 | #_ REGISTER_IN v3 [FFFCFFFD, FFFEFFFF, 00000001, 00020003] 24 | vupkhsh v3, v3 25 | blr 26 | # {-4, -3, -2, -1} 27 | #_ REGISTER_OUT v3 [FFFFFFFC, FFFFFFFD, FFFFFFFE, FFFFFFFF] 28 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/seq_jumptable_constants.s: -------------------------------------------------------------------------------- 1 | the_function: 2 | cmpwi cr6, r3, 3 3 | bgt .case_3 4 | lis r11, .the_table@h 5 | addi r11, r11, .the_table@l 6 | slwi r3, r3, 2 7 | lwzx r3, r11, r3 8 | mtspr ctr, r3 9 | bctr 10 | .the_table: 11 | .long .case_0 12 | .long .case_1 13 | .long .case_2 14 | .long .case_3 15 | .case_0: 16 | li r11, 8 17 | b .the_divide 18 | .case_1: 19 | li r11, 16 20 | b .the_divide 21 | .case_2: 22 | li r11, 24 23 | b .the_divide 24 | .case_3: 25 | li r11, 32 26 | .the_divide: 27 | extsw r11, r11 28 | tdllei r11, 0 29 | divdu r4, r4, r11 30 | blr 31 | 32 | test_jumptable_constants: 33 | mfspr r12, lr 34 | li r3, 0 35 | li r4, 1024 36 | bl the_function 37 | li r3, 1 38 | li r4, 1024 39 | bl the_function 40 | li r3, 2 41 | li r4, 1024 42 | bl the_function 43 | li r3, 3 44 | li r4, 1024 45 | bl the_function 46 | mtspr lr, r12 47 | blr 48 | -------------------------------------------------------------------------------- /src/xenia/kernel/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-kernel") 6 | uuid("ae185c4a-1c4f-4503-9892-328e549e871a") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "aes_128", 11 | "fmt", 12 | "zlib-ng", 13 | "pugixml", 14 | "xenia-apu", 15 | "xenia-base", 16 | "xenia-cpu", 17 | "xenia-hid", 18 | "xenia-vfs", 19 | }) 20 | defines({ 21 | "X86_FEATURES", 22 | "X86_HAVE_XSAVE_INTRIN", 23 | "X86_SSSE3", 24 | "X86_SSE42", 25 | "WITH_GZFILEOP", 26 | }) 27 | if os.istarget("windows") then 28 | defines({ 29 | "X86_SSE2", 30 | "X86_AVX2", 31 | "X86_AVX512", 32 | "X86_AVX512VNNI", 33 | "X86_PCLMULQDQ_CRC", 34 | "X86_VPCLMULQDQ_CRC", 35 | }) 36 | end 37 | recursive_platform_files() 38 | files({ 39 | "debug_visualizers.natvis", 40 | }) 41 | -------------------------------------------------------------------------------- /third_party/capstone.lua: -------------------------------------------------------------------------------- 1 | group("third_party") 2 | project("capstone") 3 | uuid("b3a89f7e-bb02-4945-ae75-219caed6afa2") 4 | kind("StaticLib") 5 | language("C") 6 | defines({ 7 | "CAPSTONE_X86_ATT_DISABLE", 8 | "CAPSTONE_HAS_X86", 9 | "CAPSTONE_USE_SYS_DYN_MEM", 10 | }) 11 | 12 | includedirs({ 13 | "capstone", 14 | "capstone/include", 15 | }) 16 | files({ 17 | "capstone/cs.c", 18 | "capstone/MCInst.c", 19 | "capstone/MCInstrDesc.c", 20 | "capstone/MCRegisterInfo.c", 21 | "capstone/SStream.c", 22 | "capstone/utils.c", 23 | "capstone/Mapping.c", 24 | 25 | "capstone/arch/X86/*.c", 26 | "capstone/arch/X86/*.h", 27 | "capstone/arch/X86/*.inc", 28 | }) 29 | force_compile_as_c({ 30 | "capstone/**.c", 31 | "capstone/arch/X86/**.c", 32 | }) 33 | removefiles({ 34 | "capstone/arch/X86/X86ATTInstPrinter.c", 35 | "capstone/arch/X86/*reduce.inc", 36 | }) 37 | -------------------------------------------------------------------------------- /third_party/crypto/des/des3.h: -------------------------------------------------------------------------------- 1 | #ifndef DES3_H 2 | #define DES3_H 3 | 4 | #include "des.h" 5 | 6 | class DES3 7 | { 8 | public: 9 | DES3(ui64 k1, ui64 k2, ui64 k3) : des{ DES(k1), DES(k2), DES(k3) } {} 10 | DES3(ui64* sk1, ui64* sk2, ui64* sk3) : des{ DES(sk1), DES(sk2), DES(sk3) } {} 11 | 12 | inline ui64 encrypt(ui64 block) 13 | { 14 | return des[2].encrypt(des[1].decrypt(des[0].encrypt(block))); 15 | } 16 | 17 | inline ui64 decrypt(ui64 block) 18 | { 19 | return des[0].decrypt(des[1].encrypt(des[2].decrypt(block))); 20 | } 21 | 22 | inline ui64 crypt(ui64 block, bool bEncrypt) 23 | { 24 | if (bEncrypt) 25 | { 26 | return encrypt(block); 27 | } 28 | else 29 | { 30 | return decrypt(block); 31 | } 32 | } 33 | 34 | inline DES* getDES() { return des; } 35 | 36 | private: 37 | DES des[3]; 38 | }; 39 | 40 | #endif // DES3_H 41 | -------------------------------------------------------------------------------- /src/xenia/base/xxhash.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2020 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_BASE_XXHASH_H_ 11 | #define XENIA_BASE_XXHASH_H_ 12 | 13 | #define XXH_INLINE_ALL 14 | 15 | // Can't use XXH_X86DISPATCH because XXH is calculated on multiple threads, 16 | // while the dispatch writes the result (multiple pointers without any 17 | // synchronization) to XXH_g_dispatch at the first call. 18 | 19 | #include "third_party/xxhash/xxhash.h" 20 | 21 | #endif // XENIA_BASE_XXHASH_H_ 22 | -------------------------------------------------------------------------------- /src/xenia/base/platform_linux.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2020 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_BASE_PLATFORM_LINUX_H_ 11 | #define XENIA_BASE_PLATFORM_LINUX_H_ 12 | 13 | // NOTE: if you're including this file it means you are explicitly depending 14 | // on Linux headers. Including this file outside of linux platform specific 15 | // source code will break portability 16 | #include 17 | 18 | #include "xenia/base/platform.h" 19 | 20 | #endif // XENIA_BASE_PLATFORM_LINUX_H_ 21 | -------------------------------------------------------------------------------- /src/xenia/cpu/backend/assembler.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/cpu/backend/assembler.h" 11 | 12 | namespace xe { 13 | namespace cpu { 14 | namespace backend { 15 | 16 | Assembler::Assembler(Backend* backend) : backend_(backend) {} 17 | 18 | Assembler::~Assembler() { Reset(); } 19 | 20 | bool Assembler::Initialize() { return true; } 21 | 22 | void Assembler::Reset() {} 23 | 24 | } // namespace backend 25 | } // namespace cpu 26 | } // namespace xe 27 | -------------------------------------------------------------------------------- /src/xenia/vfs/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-vfs") 6 | uuid("395c8abd-4dc9-46ed-af7a-c2b9b68a3a98") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | "zstd", 12 | "zarchive" 13 | }) 14 | 15 | recursive_platform_files() 16 | removefiles({ 17 | "vfs_dump.cc", 18 | }) 19 | 20 | if enableMiscSubprojects then 21 | project("xenia-vfs-dump") 22 | uuid("2EF270C7-41A8-4D0E-ACC5-59693A9CCE32") 23 | kind("ConsoleApp") 24 | language("C++") 25 | links({ 26 | "fmt", 27 | "xenia-base", 28 | "xenia-vfs", 29 | }) 30 | 31 | files({ 32 | "vfs_dump.cc", 33 | project_root.."/src/xenia/base/console_app_main_"..platform_suffix..".cc", 34 | }) 35 | resincludedirs({ 36 | project_root, 37 | }) 38 | end 39 | 40 | if enableTests then 41 | include("testing") 42 | end 43 | -------------------------------------------------------------------------------- /src/xenia/kernel/xboxkrnl/xboxkrnl_error.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2015 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_KERNEL_XBOXKRNL_XBOXKRNL_ERROR_H_ 11 | #define XENIA_KERNEL_XBOXKRNL_XBOXKRNL_ERROR_H_ 12 | 13 | #include 14 | 15 | namespace xe { 16 | namespace kernel { 17 | namespace xboxkrnl { 18 | 19 | uint32_t xeRtlNtStatusToDosError(uint32_t source_status); 20 | 21 | } // namespace xboxkrnl 22 | } // namespace kernel 23 | } // namespace xe 24 | 25 | #endif // XENIA_KERNEL_XBOXKRNL_XBOXKRNL_ERROR_H_ 26 | -------------------------------------------------------------------------------- /src/xenia/kernel/xboxkrnl/xboxkrnl_video.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_KERNEL_XBOXKRNL_XBOXKRNL_VIDEO_H_ 11 | #define XENIA_KERNEL_XBOXKRNL_XBOXKRNL_VIDEO_H_ 12 | 13 | #include "xenia/kernel/kernel.h" 14 | 15 | namespace xe { 16 | namespace kernel { 17 | namespace xboxkrnl { 18 | 19 | void VdQueryVideoMode(X_VIDEO_MODE* video_mode); 20 | 21 | } // namespace xboxkrnl 22 | } // namespace kernel 23 | } // namespace xe 24 | 25 | #endif // XENIA_KERNEL_XBOXKRNL_XBOXKRNL_VIDEO_H_ 26 | -------------------------------------------------------------------------------- /src/xenia/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2020 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_CONFIG_H_ 11 | #define XENIA_CONFIG_H_ 12 | 13 | #include 14 | #include "third_party/tomlplusplus/toml.hpp" 15 | 16 | toml::parse_result ParseFile(const std::filesystem::path& filename); 17 | 18 | namespace config { 19 | void SetupConfig(const std::filesystem::path& config_folder); 20 | void LoadGameConfig(const std::string_view title_id); 21 | void SaveConfig(); 22 | } // namespace config 23 | 24 | #endif // XENIA_CONFIG_H_ 25 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_ori.s: -------------------------------------------------------------------------------- 1 | .macro make_test_constant dest 2 | lis \dest, 0xDEAD 3 | ori \dest, \dest, 0xBEEF 4 | sldi \dest, \dest, 32 5 | .endm 6 | 7 | test_ori_1: 8 | #_ REGISTER_IN r4 0xDEADBEEF00000000 9 | 10 | ori r3, r4, 0xFEDC 11 | 12 | blr 13 | #_ REGISTER_OUT r3 0xDEADBEEF0000FEDC 14 | #_ REGISTER_OUT r4 0xDEADBEEF00000000 15 | 16 | test_ori_1_constant: 17 | make_test_constant r4 18 | ori r3, r4, 0xFEDC 19 | 20 | blr 21 | #_ REGISTER_OUT r3 0xDEADBEEF0000FEDC 22 | #_ REGISTER_OUT r4 0xDEADBEEF00000000 23 | 24 | test_ori_2: 25 | #_ REGISTER_IN r4 0xDEADBEEF10000000 26 | 27 | ori r3, r4, 0xFEDC 28 | 29 | blr 30 | #_ REGISTER_OUT r3 0xDEADBEEF1000FEDC 31 | #_ REGISTER_OUT r4 0xDEADBEEF10000000 32 | 33 | test_ori_2_constant: 34 | make_test_constant r4 35 | lis r3, 0x1000 36 | or r4, r4, r3 37 | 38 | ori r3, r4, 0xFEDC 39 | 40 | blr 41 | #_ REGISTER_OUT r3 0xDEADBEEF1000FEDC 42 | #_ REGISTER_OUT r4 0xDEADBEEF10000000 43 | -------------------------------------------------------------------------------- /src/xenia/hid/nop/nop_hid.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/hid/nop/nop_hid.h" 11 | 12 | #include "xenia/hid/nop/nop_input_driver.h" 13 | 14 | namespace xe { 15 | namespace hid { 16 | namespace nop { 17 | 18 | std::unique_ptr Create(xe::ui::Window* window, 19 | size_t window_z_order) { 20 | return std::make_unique(window, window_z_order); 21 | } 22 | 23 | } // namespace nop 24 | } // namespace hid 25 | } // namespace xe 26 | -------------------------------------------------------------------------------- /src/xenia/hid/sdl/sdl_hid.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2020 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/hid/sdl/sdl_hid.h" 11 | 12 | #include "xenia/hid/sdl/sdl_input_driver.h" 13 | 14 | namespace xe { 15 | namespace hid { 16 | namespace sdl { 17 | 18 | std::unique_ptr Create(xe::ui::Window* window, 19 | size_t window_z_order) { 20 | return std::make_unique(window, window_z_order); 21 | } 22 | 23 | } // namespace sdl 24 | } // namespace hid 25 | } // namespace xe 26 | -------------------------------------------------------------------------------- /src/xenia/ui/windowed_app.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2021 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/ui/windowed_app.h" 11 | 12 | namespace xe { 13 | namespace ui { 14 | 15 | #if XE_UI_WINDOWED_APPS_IN_LIBRARY 16 | // A zero-initialized pointer to remove dependence on the initialization order 17 | // of the map relatively to the app creator proxies. 18 | std::unordered_map* WindowedApp::creators_; 19 | #endif // XE_UI_WINDOWED_APPS_IN_LIBRARY 20 | 21 | } // namespace ui 22 | } // namespace xe 23 | -------------------------------------------------------------------------------- /src/xenia/base/README.md: -------------------------------------------------------------------------------- 1 | A lightweight cross-platform/compiler compatibility library. 2 | 3 | This library presupposes C++11/14 support. As more compilers get C++14 it will 4 | assume that. 5 | 6 | Other parts of the project use this to avoid creating spaghetti linkage. Code 7 | specific to the emulator should be kept out, as not all of the projects that 8 | depend on this need it. 9 | 10 | Where possible, C++11/14 STL should be used instead of adding any code in here, 11 | and the code should be kept as small as possible (by reusing STL/etc). Third 12 | party dependencies should be kept to a minimum. 13 | 14 | Target compilers: 15 | * MSVC++ 2013+ 16 | * Clang 3.4+ 17 | * GCC 4.8+. 18 | 19 | Target platforms: 20 | * Windows 8+ (`_win.cc` suffix) 21 | * Mac OSX 10.9+ (`_mac.cc` suffix, falling back to `_posix.cc`) 22 | * Linux ? (`_posix.cc` suffix) 23 | 24 | Avoid the use of platform-specific #ifdefs and instead try to put all 25 | platform-specific code in the appropriately suffixed cc files. 26 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/ppc_emit.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_CPU_PPC_PPC_EMIT_H_ 11 | #define XENIA_CPU_PPC_PPC_EMIT_H_ 12 | 13 | namespace xe { 14 | namespace cpu { 15 | namespace ppc { 16 | 17 | void RegisterEmitCategoryAltivec(); 18 | void RegisterEmitCategoryALU(); 19 | void RegisterEmitCategoryControl(); 20 | void RegisterEmitCategoryFPU(); 21 | void RegisterEmitCategoryMemory(); 22 | 23 | } // namespace ppc 24 | } // namespace cpu 25 | } // namespace xe 26 | 27 | #endif // XENIA_CPU_PPC_PPC_EMIT_H_ 28 | -------------------------------------------------------------------------------- /src/xenia/hid/nop/nop_hid.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_HID_NOP_NOP_HID_H_ 11 | #define XENIA_HID_NOP_NOP_HID_H_ 12 | 13 | #include 14 | 15 | #include "xenia/hid/input_system.h" 16 | 17 | namespace xe { 18 | namespace hid { 19 | namespace nop { 20 | 21 | std::unique_ptr Create(xe::ui::Window* window, 22 | size_t window_z_order); 23 | 24 | } // namespace nop 25 | } // namespace hid 26 | } // namespace xe 27 | 28 | #endif // XENIA_HID_NOP_NOP_HID_H_ 29 | -------------------------------------------------------------------------------- /src/xenia/hid/sdl/sdl_hid.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2020 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_HID_SDL_SDL_HID_H_ 11 | #define XENIA_HID_SDL_SDL_HID_H_ 12 | 13 | #include 14 | 15 | #include "xenia/hid/input_system.h" 16 | 17 | namespace xe { 18 | namespace hid { 19 | namespace sdl { 20 | 21 | std::unique_ptr Create(xe::ui::Window* window, 22 | size_t window_z_order); 23 | 24 | } // namespace sdl 25 | } // namespace hid 26 | } // namespace xe 27 | 28 | #endif // XENIA_HID_SDL_SDL_HID_H_ 29 | -------------------------------------------------------------------------------- /src/xenia/hid/winkey/winkey_hid.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2014 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/hid/winkey/winkey_hid.h" 11 | 12 | #include "xenia/hid/winkey/winkey_input_driver.h" 13 | 14 | namespace xe { 15 | namespace hid { 16 | namespace winkey { 17 | 18 | std::unique_ptr Create(xe::ui::Window* window, 19 | size_t window_z_order) { 20 | return std::make_unique(window, window_z_order); 21 | } 22 | 23 | } // namespace winkey 24 | } // namespace hid 25 | } // namespace xe 26 | -------------------------------------------------------------------------------- /src/xenia/hid/xinput/xinput_hid.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/hid/xinput/xinput_hid.h" 11 | 12 | #include "xenia/hid/xinput/xinput_input_driver.h" 13 | 14 | namespace xe { 15 | namespace hid { 16 | namespace xinput { 17 | 18 | std::unique_ptr Create(xe::ui::Window* window, 19 | size_t window_z_order) { 20 | return std::make_unique(window, window_z_order); 21 | } 22 | 23 | } // namespace xinput 24 | } // namespace hid 25 | } // namespace xe 26 | -------------------------------------------------------------------------------- /src/xenia/kernel/util/shim_utils.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2015 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/kernel/util/shim_utils.h" 11 | #include "xenia/kernel/xthread.h" 12 | namespace xe { 13 | namespace kernel { 14 | namespace shim { 15 | 16 | thread_local StringBuffer string_buffer_; 17 | 18 | StringBuffer* thread_local_string_buffer() { return &string_buffer_; } 19 | 20 | XThread* ContextParam::CurrentXThread() const { 21 | return XThread::GetCurrentThread(); 22 | } 23 | 24 | } // namespace shim 25 | } // namespace kernel 26 | } // namespace xe 27 | -------------------------------------------------------------------------------- /src/xenia/ui/d3d12/premake5.lua: -------------------------------------------------------------------------------- 1 | project_root = "../../../.." 2 | include(project_root.."/tools/build") 3 | 4 | group("src") 5 | project("xenia-ui-d3d12") 6 | uuid("f93dc1a8-600f-43e7-b0fc-ae3eefbe836b") 7 | kind("StaticLib") 8 | language("C++") 9 | links({ 10 | "xenia-base", 11 | "xenia-ui", 12 | }) 13 | local_platform_files() 14 | files({ 15 | "../shaders/bytecode/d3d12_5_1/*.h", 16 | }) 17 | 18 | if enableMiscSubprojects then 19 | group("demos") 20 | project("xenia-ui-window-d3d12-demo") 21 | uuid("3b9686a7-0f04-4e17-8b00-aeb78ae1107c") 22 | single_library_windowed_app_kind() 23 | language("C++") 24 | links({ 25 | "fmt", 26 | "imgui", 27 | "xenia-base", 28 | "xenia-ui", 29 | "xenia-ui-d3d12", 30 | }) 31 | files({ 32 | "../window_demo.cc", 33 | "d3d12_window_demo.cc", 34 | project_root.."/src/xenia/ui/windowed_app_main_"..platform_suffix..".cc", 35 | }) 36 | resincludedirs({ 37 | project_root, 38 | }) 39 | end -------------------------------------------------------------------------------- /src/xenia/hid/winkey/winkey_hid.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2014 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_HID_WINKEY_WINKEY_HID_H_ 11 | #define XENIA_HID_WINKEY_WINKEY_HID_H_ 12 | 13 | #include 14 | 15 | #include "xenia/hid/input_system.h" 16 | 17 | namespace xe { 18 | namespace hid { 19 | namespace winkey { 20 | 21 | std::unique_ptr Create(xe::ui::Window* window, 22 | size_t window_z_order); 23 | 24 | } // namespace winkey 25 | } // namespace hid 26 | } // namespace xe 27 | 28 | #endif // XENIA_HID_WINKEY_WINKEY_HID_H_ 29 | -------------------------------------------------------------------------------- /src/xenia/hid/xinput/xinput_hid.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_HID_XINPUT_XINPUT_HID_H_ 11 | #define XENIA_HID_XINPUT_XINPUT_HID_H_ 12 | 13 | #include 14 | 15 | #include "xenia/hid/input_system.h" 16 | 17 | namespace xe { 18 | namespace hid { 19 | namespace xinput { 20 | 21 | std::unique_ptr Create(xe::ui::Window* window, 22 | size_t window_z_order); 23 | 24 | } // namespace xinput 25 | } // namespace hid 26 | } // namespace xe 27 | 28 | #endif // XENIA_HID_XINPUT_XINPUT_HID_H_ 29 | -------------------------------------------------------------------------------- /src/xenia/kernel/xam/xam_ordinals.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_KERNEL_XAM_XAM_ORDINALS_H_ 11 | #define XENIA_KERNEL_XAM_XAM_ORDINALS_H_ 12 | 13 | #include "xenia/cpu/export_resolver.h" 14 | 15 | // Build an ordinal enum to make it easy to lookup ordinals. 16 | #include "xenia/kernel/util/ordinal_table_pre.inc" 17 | namespace ordinals { 18 | enum { 19 | #include "xenia/kernel/xam/xam_table.inc" 20 | }; 21 | } // namespace ordinals 22 | #include "xenia/kernel/util/ordinal_table_post.inc" 23 | 24 | #endif // XENIA_KERNEL_XAM_XAM_ORDINALS_H_ 25 | -------------------------------------------------------------------------------- /src/xenia/app/discord/discord_presence.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2020 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_DISCORD_DISCORD_PRESENCE_H_ 11 | #define XENIA_DISCORD_DISCORD_PRESENCE_H_ 12 | 13 | #include 14 | 15 | namespace xe { 16 | namespace discord { 17 | 18 | class DiscordPresence { 19 | public: 20 | static void Initialize(); 21 | static void NotPlaying(); 22 | static void PlayingTitle(const std::string_view game_title); 23 | static void Shutdown(); 24 | }; 25 | 26 | } // namespace discord 27 | } // namespace xe 28 | 29 | #endif // XENIA_DISCORD_DISCORD_PRESENCE_H_ 30 | -------------------------------------------------------------------------------- /src/xenia/base/png_utils.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2025 Xenia Canary. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_BASE_PNG_UTILS_H_ 11 | #define XENIA_BASE_PNG_UTILS_H_ 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | namespace xe { 18 | 19 | bool IsFilePngImage(const std::filesystem::path& file_path); 20 | std::pair GetImageResolution( 21 | const std::filesystem::path& file_path); 22 | 23 | std::vector ReadPngFromFile(const std::filesystem::path& file_path); 24 | 25 | } // namespace xe 26 | 27 | #endif // XENIA_BASE_PNG_UTILS_H_ 28 | -------------------------------------------------------------------------------- /src/xenia/cpu/compiler/passes/conditional_group_subpass.cc: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "xenia/cpu/compiler/passes/conditional_group_subpass.h" 11 | 12 | #include "xenia/cpu/compiler/compiler.h" 13 | 14 | namespace xe { 15 | namespace cpu { 16 | namespace compiler { 17 | namespace passes { 18 | 19 | ConditionalGroupSubpass::ConditionalGroupSubpass() : CompilerPass() {} 20 | 21 | ConditionalGroupSubpass::~ConditionalGroupSubpass() = default; 22 | 23 | } // namespace passes 24 | } // namespace compiler 25 | } // namespace cpu 26 | } // namespace xe 27 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vpkuwus.s: -------------------------------------------------------------------------------- 1 | test_vpkuwus_1: 2 | # {0, 65536, 1, 65537} 3 | #_ REGISTER_IN v3 [00000000, 00010000, 00000001, 00010001] 4 | # {2, 65538, 3, 65539} 5 | #_ REGISTER_IN v4 [00000002, 00010002, 00000003, 00010003] 6 | vpkuwus v5, v3, v4 7 | blr 8 | #_ REGISTER_OUT v3 [00000000, 00010000, 00000001, 00010001] 9 | #_ REGISTER_OUT v4 [00000002, 00010002, 00000003, 00010003] 10 | # {0, 65535, 1, 65535, 2, 65535, 3, 65535} 11 | #_ REGISTER_OUT v5 [0000FFFF, 0001FFFF, 0002FFFF, 0003FFFF] 12 | 13 | test_vpkuwus_2: 14 | # {2147483648, 2147483647, 2, 3} 15 | #_ REGISTER_IN v3 [80000000, 7FFFFFFF, 00000002, 00000003] 16 | # {4294967295, 65538, 4294967294, 16} 17 | #_ REGISTER_IN v4 [FFFFFFFF, 00010002, FFFFFFFE, 00000010] 18 | vpkuwus v5, v3, v4 19 | blr 20 | #_ REGISTER_OUT v3 [80000000, 7FFFFFFF, 00000002, 00000003] 21 | #_ REGISTER_OUT v4 [FFFFFFFF, 00010002, FFFFFFFE, 00000010] 22 | # {65535, 65535, 2, 3, 65535, 65535, 65535, 16} 23 | #_ REGISTER_OUT v5 [FFFFFFFF, 00020003, FFFFFFFF, FFFF0010] 24 | -------------------------------------------------------------------------------- /src/xenia/kernel/xbdm/xbdm_ordinals.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2013 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_KERNEL_XBDM_XBDM_ORDINALS_H_ 11 | #define XENIA_KERNEL_XBDM_XBDM_ORDINALS_H_ 12 | 13 | #include "xenia/cpu/export_resolver.h" 14 | 15 | // Build an ordinal enum to make it easy to lookup ordinals. 16 | #include "xenia/kernel/util/ordinal_table_pre.inc" 17 | namespace ordinals { 18 | enum { 19 | #include "xenia/kernel/xbdm/xbdm_table.inc" 20 | }; 21 | } // namespace ordinals 22 | #include "xenia/kernel/util/ordinal_table_post.inc" 23 | 24 | #endif // XENIA_KERNEL_XBDM_XBDM_ORDINALS_H_ 25 | -------------------------------------------------------------------------------- /third_party/crypto/des/des_key.h: -------------------------------------------------------------------------------- 1 | #ifndef DES_KEY_H 2 | #define DES_KEY_H 3 | 4 | // Permuted Choice 1 Table [7*8] 5 | static const char PC1[] = 6 | { 7 | 57, 49, 41, 33, 25, 17, 9, 8 | 1, 58, 50, 42, 34, 26, 18, 9 | 10, 2, 59, 51, 43, 35, 27, 10 | 19, 11, 3, 60, 52, 44, 36, 11 | 12 | 63, 55, 47, 39, 31, 23, 15, 13 | 7, 62, 54, 46, 38, 30, 22, 14 | 14, 6, 61, 53, 45, 37, 29, 15 | 21, 13, 5, 28, 20, 12, 4 16 | }; 17 | 18 | // Permuted Choice 2 Table [6*8] 19 | static const char PC2[] = 20 | { 21 | 14, 17, 11, 24, 1, 5, 22 | 3, 28, 15, 6, 21, 10, 23 | 23, 19, 12, 4, 26, 8, 24 | 16, 7, 27, 20, 13, 2, 25 | 41, 52, 31, 37, 47, 55, 26 | 30, 40, 51, 45, 33, 48, 27 | 44, 49, 39, 56, 34, 53, 28 | 46, 42, 50, 36, 29, 32 29 | }; 30 | 31 | // Iteration Shift Array 32 | static const char ITERATION_SHIFT[] = 33 | { 34 | // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 35 | 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 36 | }; 37 | 38 | #endif // DES_KEY_H 39 | -------------------------------------------------------------------------------- /src/xenia/cpu/ppc/testing/instr_vpkuwus128.s: -------------------------------------------------------------------------------- 1 | test_vpkuwus128_1: 2 | # {0, 65536, 1, 65537} 3 | #_ REGISTER_IN v3 [00000000, 00010000, 00000001, 00010001] 4 | # {2, 65538, 3, 65539} 5 | #_ REGISTER_IN v4 [00000002, 00010002, 00000003, 00010003] 6 | vpkuwus128 v5, v3, v4 7 | blr 8 | #_ REGISTER_OUT v3 [00000000, 00010000, 00000001, 00010001] 9 | #_ REGISTER_OUT v4 [00000002, 00010002, 00000003, 00010003] 10 | # {0, 65535, 1, 65535, 2, 65535, 3, 65535} 11 | #_ REGISTER_OUT v5 [0000FFFF, 0001FFFF, 0002FFFF, 0003FFFF] 12 | 13 | test_vpkuwus128_2: 14 | # {2147483648, 2147483647, 2, 3} 15 | #_ REGISTER_IN v3 [80000000, 7FFFFFFF, 00000002, 00000003] 16 | # {4294967295, 65538, 4294967294, 16} 17 | #_ REGISTER_IN v4 [FFFFFFFF, 00010002, FFFFFFFE, 00000010] 18 | vpkuwus128 v5, v3, v4 19 | blr 20 | #_ REGISTER_OUT v3 [80000000, 7FFFFFFF, 00000002, 00000003] 21 | #_ REGISTER_OUT v4 [FFFFFFFF, 00010002, FFFFFFFE, 00000010] 22 | # {65535, 65535, 2, 3, 65535, 65535, 65535, 16} 23 | #_ REGISTER_OUT v5 [FFFFFFFF, 00020003, FFFFFFFF, FFFF0010] 24 | -------------------------------------------------------------------------------- /src/xenia/gpu/shaders/passthrough_position_xy.vs.xesl: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2022 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #include "../../ui/shaders/xesl.xesli" 11 | 12 | xesl_entry_outputs_begin 13 | xesl_entry_output_position 14 | xesl_entry_outputs_end_stageInputs_begin 15 | xesl_entry_stageInput_vertex(xesl_float2, xe_in_position, 0, POSITION) 16 | xesl_entry_stageInputs_end_bindings_begin_vertex 17 | xesl_entry_bindings_empty_end_inputs_begin 18 | xesl_entry_input_stageInputs 19 | xesl_entry_inputs_end_code_begin 20 | xesl_Position = xesl_float4(xesl_StageInput(xe_in_position), 0.0, 1.0); 21 | xesl_entry_code_end 22 | -------------------------------------------------------------------------------- /tools/shader-playground/shader-playground.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "shader-playground", "shader-playground.csproj", "{05D27AD4-EF23-4FA1-AD5A-7CFD587FD093}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {05D27AD4-EF23-4FA1-AD5A-7CFD587FD093}.Debug|x86.ActiveCfg = Debug|x86 15 | {05D27AD4-EF23-4FA1-AD5A-7CFD587FD093}.Debug|x86.Build.0 = Debug|x86 16 | {05D27AD4-EF23-4FA1-AD5A-7CFD587FD093}.Release|x86.ActiveCfg = Release|x86 17 | {05D27AD4-EF23-4FA1-AD5A-7CFD587FD093}.Release|x86.Build.0 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /src/xenia/kernel/xboxkrnl/xboxkrnl_modules.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * Xenia : Xbox 360 Emulator Research Project * 4 | ****************************************************************************** 5 | * Copyright 2023 Ben Vanik. All rights reserved. * 6 | * Released under the BSD license - see LICENSE in the root for more details. * 7 | ****************************************************************************** 8 | */ 9 | 10 | #ifndef XENIA_KERNEL_XBOXKRNL_XBOXKRNL_MODULES_H_ 11 | #define XENIA_KERNEL_XBOXKRNL_XBOXKRNL_MODULES_H_ 12 | 13 | #include "xenia/kernel/util/shim_utils.h" 14 | 15 | namespace xe { 16 | namespace kernel { 17 | namespace xboxkrnl { 18 | 19 | dword_result_t XexGetModuleHandle(std::string module_name, 20 | xe::be* hmodule_ptr); 21 | 22 | } // namespace xboxkrnl 23 | } // namespace kernel 24 | } // namespace xe 25 | 26 | #endif // XENIA_KERNEL_XBOXKRNL_XBOXKRNL_MODULES_H_ 27 | --------------------------------------------------------------------------------