Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
Simon Gellis | 8e7ca9acb6 | |
Simon Gellis | f4438e32e0 | |
Simon Gellis | 953e10b42b |
|
@ -1770,7 +1770,7 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemur"
|
name = "lemur"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bitflags 2.6.0",
|
"bitflags 2.6.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@ description = "An emulator for the Virtual Boy."
|
||||||
repository = "https://git.virtual-boy.com/PVB/lemur"
|
repository = "https://git.virtual-boy.com/PVB/lemur"
|
||||||
publish = false
|
publish = false
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
@ -23,7 +23,25 @@ docker build -f build.Dockerfile -t lemur-build .
|
||||||
MSYS_NO_PATHCONV=1 docker run -it --rm -v .:/app -w /app --entrypoint bash lemur-build /app/scripts/do-bundle.sh
|
MSYS_NO_PATHCONV=1 docker run -it --rm -v .:/app -w /app --entrypoint bash lemur-build /app/scripts/do-bundle.sh
|
||||||
|
|
||||||
read -r -d EOF 'body' <<EOF
|
read -r -d EOF 'body' <<EOF
|
||||||
# v${version}
|
## How to install
|
||||||
|
|
||||||
|
The emulator can be found in the "Downloads" section of this release.
|
||||||
|
|
||||||
|
### Windows users
|
||||||
|
|
||||||
|
Download \`lemur.exe\`.
|
||||||
|
|
||||||
|
### MacOS users
|
||||||
|
|
||||||
|
If your Mac uses an Intel processor, download and install \`Lemur-Intel.dmg\`.
|
||||||
|
|
||||||
|
If it uses Apple Silicon, download and install \`Lemur-Apple-Silicon.dmg\`.
|
||||||
|
|
||||||
|
If you're not sure which to choose, use [this guide](https://support.apple.com/en-us/116943) to find out.
|
||||||
|
|
||||||
|
### Linux users
|
||||||
|
|
||||||
|
You can either download and run \`lemur-linux\`, or download and install the attached .deb file.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
read -r -d EOF 'payload' <<EOF
|
read -r -d EOF 'payload' <<EOF
|
||||||
|
|
41
src/main.rs
41
src/main.rs
|
@ -1,7 +1,7 @@
|
||||||
// hide console in release mode
|
// hide console in release mode
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
use std::{path::PathBuf, process};
|
use std::{path::PathBuf, process, time::SystemTime};
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use app::Application;
|
use app::Application;
|
||||||
|
@ -24,6 +24,43 @@ struct Args {
|
||||||
rom: Option<PathBuf>,
|
rom: Option<PathBuf>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_panic_handler() {
|
||||||
|
std::panic::set_hook(Box::new(|info| {
|
||||||
|
let mut message = String::new();
|
||||||
|
if let Some(msg) = info.payload().downcast_ref::<&str>() {
|
||||||
|
message += &format!("{}\n", msg);
|
||||||
|
} else if let Some(msg) = info.payload().downcast_ref::<String>() {
|
||||||
|
message += &format!("{}\n", msg);
|
||||||
|
}
|
||||||
|
if let Some(location) = info.location() {
|
||||||
|
message += &format!(
|
||||||
|
" in file '{}' at line {}\n",
|
||||||
|
location.file(),
|
||||||
|
location.line()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
let backtrace = std::backtrace::Backtrace::force_capture();
|
||||||
|
message += &format!("stack trace:\n{:#}\n", backtrace);
|
||||||
|
|
||||||
|
eprint!("{}", message);
|
||||||
|
|
||||||
|
let Some(project_dirs) = directories::ProjectDirs::from("com", "virtual-boy", "Lemur")
|
||||||
|
else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
let data_dir = project_dirs.data_dir();
|
||||||
|
if std::fs::create_dir_all(data_dir).is_err() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let timestamp = SystemTime::now()
|
||||||
|
.duration_since(SystemTime::UNIX_EPOCH)
|
||||||
|
.unwrap()
|
||||||
|
.as_millis();
|
||||||
|
let logfile_name = format!("crash-{}.txt", timestamp);
|
||||||
|
let _ = std::fs::write(data_dir.join(logfile_name), message);
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
fn set_process_priority_to_high() -> Result<()> {
|
fn set_process_priority_to_high() -> Result<()> {
|
||||||
use windows::Win32::{Foundation, System::Threading};
|
use windows::Win32::{Foundation, System::Threading};
|
||||||
|
@ -34,6 +71,8 @@ fn set_process_priority_to_high() -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
|
set_panic_handler();
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
set_process_priority_to_high()?;
|
set_process_priority_to_high()?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue