Feat: add AniMe support for G835LW

This commit is contained in:
Denis Benato
2025-12-13 13:35:56 +01:00
parent e565ce748a
commit ee0e612c04
4 changed files with 42 additions and 22 deletions

View File

@@ -64,6 +64,7 @@ pub enum AnimeType {
GA402,
GU604,
G635L,
G835LW,
#[default]
Unsupported,
}
@@ -72,11 +73,12 @@ impl FromStr for AnimeType {
type Err = AnimeError;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(match s {
"ga401" | "GA401" => Self::GA401,
"ga402" | "GA402" => Self::GA402,
"gu604" | "GU604" => Self::GU604,
"g635L" | "G635L" => Self::G635L,
Ok(match s.to_uppercase().as_str() {
"GA401" => Self::GA401,
"GA402" => Self::GA402,
"GU604" => Self::GU604,
"G635L" => Self::G635L,
"G835LW" => Self::G835LW,
_ => Self::Unsupported,
})
}
@@ -102,6 +104,7 @@ impl AnimeType {
pub fn width(&self) -> usize {
match self {
AnimeType::GU604 => 70,
AnimeType::G835LW => 74,
_ => 74,
}
}
@@ -111,6 +114,7 @@ impl AnimeType {
match self {
AnimeType::GA401 => 36,
AnimeType::GU604 => 43,
AnimeType::G835LW => 39,
_ => 39,
}
}
@@ -120,6 +124,7 @@ impl AnimeType {
match self {
AnimeType::GA401 => PANE_LEN * 2,
AnimeType::GU604 => PANE_LEN * 3,
AnimeType::G835LW => PANE_LEN * 3,
_ => PANE_LEN * 3,
}
}
@@ -184,7 +189,11 @@ impl TryFrom<AnimeDataBuffer> for AnimePacketType {
let mut buffers = match anime.anime {
AnimeType::GA401 => vec![[0; 640]; 2],
AnimeType::GA402 | AnimeType::GU604 | AnimeType::G635L | AnimeType::Unsupported => {
AnimeType::GA402
| AnimeType::GU604
| AnimeType::G635L
| AnimeType::G835LW
| AnimeType::Unsupported => {
vec![[0; 640]; 3]
}
};
@@ -197,7 +206,11 @@ impl TryFrom<AnimeDataBuffer> for AnimePacketType {
if matches!(
anime.anime,
AnimeType::GA402 | AnimeType::GU604 | AnimeType::Unsupported
AnimeType::GA402
| AnimeType::GU604
| AnimeType::G635L
| AnimeType::G835LW
| AnimeType::Unsupported
) {
buffers[2][..7].copy_from_slice(&USB_PREFIX3);
}