Skip to main content

twbm_idmap/
lib.rs

1// SPDX-FileCopyrightText: 2026 Manuel Quarneti <mq1@ik.me>
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4#![warn(clippy::all, rust_2018_idioms)]
5
6mod core;
7
8pub fn get_title(game_id: impl AsRef<str>) -> Option<&'static str> {
9    let game_id = u32::from_str_radix(game_id.as_ref(), 36).ok()?;
10    core::get_title(game_id)
11}
12
13#[cfg(feature = "gamehacking")]
14pub fn get_ghid(game_id: impl AsRef<str>) -> Option<usize> {
15    let game_id = u32::from_str_radix(game_id.as_ref(), 36).ok()?;
16    core::get_ghid(game_id)
17}
18
19#[cfg(feature = "ascii-titles")]
20pub fn get_ascii_title(game_id: impl AsRef<str>) -> Option<&'static str> {
21    let game_id = u32::from_str_radix(game_id.as_ref(), 36).ok()?;
22    core::get_ascii_title(game_id).or_else(|| core::get_title(game_id))
23}