Skip to content

Commit

Permalink
version: 0.10.10
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Aug 30, 2024
1 parent 0d99ae7 commit 5a783b8
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 27 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

*

## [0.10.10] - 2024-08-30

### Fixed

* Warning message in wasm-bindgen loading

## [0.10.9] - 2024-08-30
Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "boytacean"
description = "A Game Boy emulator that is written in Rust."
version = "0.10.9"
version = "0.10.10"
authors = ["João Magalhães <[email protected]>"]
license = "Apache-2.0"
repository = "https://github.com/joamag/boytacean"
Expand All @@ -25,9 +25,9 @@ cpulog = []
gen-mock = []

[dependencies]
boytacean-common = { path = "crates/common", version = "0.10.9" }
boytacean-encoding = { path = "crates/encoding", version = "0.10.9" }
boytacean-hashing = { path = "crates/hashing", version = "0.10.9" }
boytacean-common = { path = "crates/common", version = "0.10.10" }
boytacean-encoding = { path = "crates/encoding", version = "0.10.10" }
boytacean-hashing = { path = "crates/hashing", version = "0.10.10" }
wasm-bindgen = { version = "0.2", optional = true }
js-sys = { version = "0.3", optional = true }
pyo3 = { version = "0.20", optional = true }
Expand Down Expand Up @@ -67,7 +67,7 @@ members = [
"crates/encoding",
"crates/hashing"
]
package = { version = "0.10.9", authors = ["João Magalhães <[email protected]>"], edition = "2021" }
package = { version = "0.10.10", authors = ["João Magalhães <[email protected]>"], edition = "2021" }

[package.metadata.docs.rs]
features = ["wasm", "gen-mock"]
Expand Down
2 changes: 1 addition & 1 deletion crates/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "boytacean-common"
description = "Commons library for Boytacen."
version = "0.10.9"
version = "0.10.10"
authors = ["João Magalhães <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
Expand Down
6 changes: 3 additions & 3 deletions crates/encoding/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "boytacean-encoding"
description = "Codecs library for Boytacen."
version = "0.10.9"
version = "0.10.10"
authors = ["João Magalhães <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
Expand All @@ -10,8 +10,8 @@ edition = "2021"
simd = ["boytacean-hashing/simd"]

[dependencies]
boytacean-common = { path = "../common", version = "0.10.9" }
boytacean-hashing = { path = "../hashing", version = "0.10.9" }
boytacean-common = { path = "../common", version = "0.10.10" }
boytacean-hashing = { path = "../hashing", version = "0.10.10" }

[[bin]]
name = "zippy"
Expand Down
4 changes: 2 additions & 2 deletions crates/hashing/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "boytacean-hashing"
description = "Hashing library for Boytacen."
version = "0.10.9"
version = "0.10.10"
authors = ["João Magalhães <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
Expand All @@ -10,4 +10,4 @@ edition = "2021"
simd = []

[dependencies]
boytacean-common = { path = "../common", version = "0.10.9" }
boytacean-common = { path = "../common", version = "0.10.10" }
4 changes: 2 additions & 2 deletions frontends/libretro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "boytacean-libretro"
version = "0.10.9"
version = "0.10.10"
authors = ["João Magalhães <[email protected]>"]
description = "A Libretro frontend for Boytacen"
license = "Apache-2.0"
Expand All @@ -17,4 +17,4 @@ pedantic = ["boytacean/pedantic"]
cpulog = ["boytacean/cpulog"]

[dependencies]
boytacean = { path = "../..", version = "0.10.9" }
boytacean = { path = "../..", version = "0.10.10" }
2 changes: 1 addition & 1 deletion frontends/libretro/res/boytacean_libretro.info
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ corename = "Boytacean"
categories = "Emulator"
license = "Apache-2."
permissions = ""
display_version = "0.10.9"
display_version = "0.10.10"

# Hardware Information
manufacturer = "Nintendo"
Expand Down
6 changes: 3 additions & 3 deletions frontends/sdl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "boytacean-sdl"
version = "0.10.9"
version = "0.10.10"
authors = ["João Magalhães <[email protected]>"]
description = "An SDL frontend for Boytacen"
license = "Apache-2.0"
Expand All @@ -15,8 +15,8 @@ pedantic = ["boytacean/pedantic"]
cpulog = ["boytacean/cpulog"]

[dependencies]
boytacean = { path = "../..", version = "0.10.9" }
boytacean-common = { path = "../../crates/common", version = "0.10.9" }
boytacean = { path = "../..", version = "0.10.10" }
boytacean-common = { path = "../../crates/common", version = "0.10.10" }
clap = { version = "4", features = ["derive"] }
image = "0.24"
chrono = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boytacean-web",
"version": "0.10.9",
"version": "0.10.10",
"description": "The web version of Boytacean",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

setuptools.setup(
name="boytacean",
version="0.10.9",
version="0.10.10",
author="João Magalhães",
author_email="[email protected]",
description="A Game Boy emulator that is written in Rust",
Expand Down
44 changes: 36 additions & 8 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,28 @@ impl From<u8> for BosBlockKind {
#[cfg_attr(feature = "wasm", wasm_bindgen)]
pub struct FromGbOptions {
thumbnail: bool,
agent: Option<String>,
agent_version: Option<String>,
}

#[cfg_attr(feature = "wasm", wasm_bindgen)]
impl FromGbOptions {
pub fn new(thumbnail: bool) -> Self {
Self { thumbnail }
pub fn new(thumbnail: bool, agent: Option<String>, agent_version: Option<String>) -> Self {
Self {
thumbnail,
agent,
agent_version,
}
}
}

impl Default for FromGbOptions {
fn default() -> Self {
Self { thumbnail: true }
Self {
thumbnail: true,
agent: None,
agent_version: None,
}
}
}

Expand Down Expand Up @@ -446,11 +456,18 @@ impl Serialize for BosState {

impl StateBox for BosState {
fn from_gb(gb: &mut GameBoy, options: &FromGbOptions) -> Result<Box<Self>, Error> {
let mut bos_info = BosInfo::from_gb(gb)?;
if let Some(agent) = options.agent.clone() {
bos_info.agent = agent;
}
if let Some(agent_version) = options.agent_version.clone() {
bos_info.agent_version = agent_version;
}
Ok(Box::new(Self {
magic: BOS_MAGIC_UINT,
version: BOS_VERSION,
block_count: 2,
info: Some(BosInfo::from_gb(gb)?),
info: Some(bos_info),
image_buffer: if options.thumbnail {
Some(BosImageBuffer::from_gb(gb)?)
} else {
Expand Down Expand Up @@ -1973,7 +1990,10 @@ impl StateManager {
mod tests {
use boytacean_encoding::zippy::{decode_zippy, encode_zippy};

use crate::{gb::GameBoy, state::State};
use crate::{
gb::GameBoy,
state::{FromGbOptions, State},
};

use super::{BessCore, SaveStateFormat, StateManager};

Expand Down Expand Up @@ -2056,11 +2076,19 @@ mod tests {
gb.load_rom_file("res/roms/test/firstwhite.gb", None)
.unwrap();
gb.step_to(0x0100);
let data = StateManager::save(&mut gb, Some(SaveStateFormat::Bess), None).unwrap();
let data = StateManager::save(
&mut gb,
Some(SaveStateFormat::Bess),
Some(FromGbOptions {
agent_version: Some(String::from("0.0.0")),
..Default::default()
}),
)
.unwrap();
let encoded = encode_zippy(&data, None, None).unwrap();
let decoded = decode_zippy(&encoded, None).unwrap();
assert_eq!(data, decoded);
assert_eq!(encoded.len(), 850);
assert_eq!(decoded.len(), 25154);
assert_eq!(encoded.len(), 847);
assert_eq!(decoded.len(), 25155);
}
}

0 comments on commit 5a783b8

Please sign in to comment.