gsa 0.2.1

Game development library modelled after an imaginary console
Documentation
#![deny(missing_docs)]

//! # Game Skunk Advance
//! Game development library modelled after an imaginary console
//!
//! [Changelog](https://git.danitheskunk.com/DaniTheSkunk/gsa/src/branch/master/CHANGLOG.md)
//!
//! ## Specs
//! - Resolution: 304x176 (19x11 tiles)
//! - Colors: 256 (indexed out of a possible 24-bit)
//! - Tilesize: 16x16 (or 8x8 for half-tiles)
//! - Tileset: 65536 tiles, indexed via 0xYYXX
//!   - rectangle(not id range) of 0x7000 to 0x7F7F semi-reserved
//! - Sprites: 256 of size 16x16 (pondering allowing larger sprites)
//! - Backgrounds: 4 of size 1024x1024, scrollable
//!
//! ## Getting started
//! `cargo install gsa`
//!
//! `gsa new my_project`
//!
//! `cd my_project`
//!
//! `cargo run`
//!
//! ## Features not yet implemented
//! - Background effects
//!   - Rotation? Scaling?
//!   - Mosaic?
//!   - Mode7?
//! - Sprite Effects
//!   - Rotation? Scaling?
//!   - Mosaic?
//! - Sound (no samples)
//!   - Synth
//!   - Speech
//! - Savegames
//! - Helpers
//!   - Gamepad text keyboard input
//!   - Menus

mod background;
mod buttons;
mod gsa;
mod gsa_render_to_screen;
mod rgb;
mod run;
mod sprite;
mod tileset;

pub use crate::background::*;
pub use crate::buttons::*;
pub use crate::gsa::*;
pub use crate::rgb::*;
pub use crate::run::run;
pub use crate::sprite::*;

/// Amount of sprites in [Gsa::sprites]
pub const MAX_SPRITES: usize = 0xff;

/// Screen Width in pixels
pub const SCREEN_WIDTH: usize = 304;

/// Screen Height in pixels
pub const SCREEN_HEIGHT: usize = 176;

/// X and y dimensions of maps in [Gsa::bgs]
pub const BACKGROUND_MAX_SIZE: usize = 1024;

/// Tile considered empty (never drawn even if has contents)
pub const EMPTY_TILE: u16 = 0xffff;

/// Tile id of bold default font
pub const FONT_BOLD: u16 = 0xf000;

/// Tile id of thin default font
pub const FONT_THIN: u16 = 0xe000;

/// Width and height (in tiles) of tileset
pub const TILESET_SIZE: usize = 0x100;

/// Width and height of a tile
pub const TILE_SIZE: usize = 16;

/// Palette index which is treated as transparent
pub const TRANSPARENT: u8 = 0xff;

/// Width and height of a tile in half-tile mode
pub const HALF_TILE_SIZE: usize = 8;

/// Amount of tile maps in [Gsa::bgs]
pub const MAX_BACKGROUNDS: usize = 4;