mirror of
https://github.com/ARMSX2/ARMSX1.git
synced 2026-08-24 16:53:35 -07:00
Update argument array in Program.cs to reflect project name change to ARMSX
This commit is contained in:
@@ -18,6 +18,7 @@ snap/
|
||||
*.exe
|
||||
*.out
|
||||
*.toml
|
||||
!Cargo.toml
|
||||
*.zip
|
||||
*.cue
|
||||
*.iso
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/target
|
||||
Generated
+63
@@ -0,0 +1,63 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "ARMSX_vita"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"sdl2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.171"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
|
||||
|
||||
[[package]]
|
||||
name = "sdl2"
|
||||
version = "0.34.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "deecbc3fa9460acff5a1e563e05cb5f31bba0aa0c214bb49a43db8159176d54b"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"sdl2-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sdl2-sys"
|
||||
version = "0.34.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41a29aa21f175b5a41a6e26da572d5e5d1ee5660d35f9f9d0913e8a802098f74"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"version-compare",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "version-compare"
|
||||
version = "0.0.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1"
|
||||
@@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "ARMSX_vita"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
sdl2 = "0.34"
|
||||
|
||||
[package.metadata.vita]
|
||||
title_id = "ARMSX001"
|
||||
title_name = "ARMSX PSVita"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
fn main() {
|
||||
let target = std::env::var("TARGET").unwrap();
|
||||
if target.contains("vita") {
|
||||
let vitasdk = std::env::var("VITASDK").expect("VITASDK environment variable must be set");
|
||||
println!("cargo:rustc-link-search=native={}/arm-vita-eabi/lib", vitasdk);
|
||||
println!("cargo:rustc-link-lib=SDL2");
|
||||
println!("cargo:rustc-link-lib=SceGxm_stub");
|
||||
println!("cargo:rustc-link-lib=SceDisplay_stub");
|
||||
println!("cargo:rustc-link-lib=SceAudio_stub");
|
||||
println!("cargo:rustc-link-lib=SceAudioIn_stub");
|
||||
println!("cargo:rustc-link-lib=SceCtrl_stub");
|
||||
println!("cargo:rustc-link-lib=SceHid_stub");
|
||||
println!("cargo:rustc-link-lib=SceMotion_stub");
|
||||
println!("cargo:rustc-link-lib=SceIme_stub");
|
||||
println!("cargo:rustc-link-lib=SceCommonDialog_stub");
|
||||
println!("cargo:rustc-link-lib=SceTouch_stub");
|
||||
println!("cargo:rustc-link-lib=SceLibKernel_stub");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
if [ -z "$VITASDK" ]; then
|
||||
echo "VITASDK environment variable is not set. Please set it before running this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LIB_DIR="$VITASDK/arm-vita-eabi/lib"
|
||||
|
||||
if [ ! -d "$LIB_DIR" ]; then
|
||||
echo "Directory $LIB_DIR does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ls -l "$LIB_DIR" > available_libs.txt
|
||||
echo "Library list saved to available_libs.txt"
|
||||
@@ -0,0 +1,44 @@
|
||||
extern crate sdl2;
|
||||
|
||||
use std::ffi::CString;
|
||||
use std::os::raw::{c_char, c_int, c_void};
|
||||
|
||||
unsafe extern "C" {
|
||||
fn external_main(argc: c_int, argv: *const *const c_char, external_window: *mut c_void, external_renderer: *mut c_void) -> c_int;
|
||||
}
|
||||
|
||||
fn main() -> Result<(), String> {
|
||||
let sdl_context = sdl2::init()?;
|
||||
let video_subsystem = sdl_context.video()?;
|
||||
|
||||
let width = 960;
|
||||
let height = 544;
|
||||
let window = video_subsystem
|
||||
.window("ARMSX PSVita Host", width, height)
|
||||
.position_centered()
|
||||
.build()
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
let mut canvas = window
|
||||
.into_canvas()
|
||||
.present_vsync()
|
||||
.accelerated()
|
||||
.build()
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
let args = vec!["psvita", "", ""];
|
||||
let cstrings: Vec<CString> = args.iter().map(|s| CString::new(*s).unwrap()).collect();
|
||||
let mut ptrs: Vec<*const c_char> = cstrings.iter().map(|s| s.as_ptr()).collect();
|
||||
ptrs.push(std::ptr::null());
|
||||
|
||||
let raw_window = canvas.window().raw() as *mut c_void;
|
||||
let raw_renderer = canvas.raw() as *mut c_void;
|
||||
|
||||
let ret = unsafe { external_main((ptrs.len() - 1) as c_int, ptrs.as_ptr(), raw_window, raw_renderer) };
|
||||
|
||||
if ret != 0 {
|
||||
return Err(format!("external_main returned non-zero: {}", ret));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -60,7 +60,7 @@ namespace WindowsHostSDL2
|
||||
return -1;
|
||||
}
|
||||
|
||||
string[] arguments = { "ChonkyStation3UWP", "", localFolder.Path };
|
||||
string[] arguments = { "ARMSX", "", "" };
|
||||
int newArgc = arguments.Length;
|
||||
IntPtr[] argvPtrs = new IntPtr[newArgc];
|
||||
for (int i = 0; i < newArgc; i++)
|
||||
|
||||
Reference in New Issue
Block a user