Crate gsa

Source
Expand description

§Game Skunk Advance

Game development library modelled after an imaginary console

Changelog

§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

Macros§

run
Creates main function, includes gfx.gif, and calls run

Structs§

Background
Tilemap which will be rendered on screen
Gsa
Complete state of GSA
Rgb
RGB Color
Sprite
Sprite which will be displayed on screen, unless tile=0

Constants§

BACKGROUND_MAX_SIZE
X and y dimensions of maps in Gsa::bgs
DPAD_DOWN
DOWN on dpad
DPAD_LEFT
LEFT on dpad
DPAD_RIGHT
RIGHT on dpad
DPAD_UP
UP on dpad
EMPTY_TILE
Tile considered empty (never drawn even if has contents)
FACE_DOWN
B on nintendo, A on microsoft, CROSS on sony
FACE_LEFT
Y on nintendo, X on microsoft, SQUARE on sony
FACE_RIGHT
A on nintendo, B on microsoft, CIRCLE on sony
FACE_UP
X on nintendo, Y on microsoft, TRIANGLE on sony
FONT_BOLD
Tile id of bold default font
FONT_THIN
Tile id of thin default font
HALF_TILE_SIZE
Width and height of a tile in half-tile mode
L
left shoulder button
MAX_BACKGROUNDS
Amount of tile maps in Gsa::bgs
MAX_SPRITES
Amount of sprites in Gsa::sprites
R
right shoulder button
SCREEN_HEIGHT
Screen Height in pixels
SCREEN_WIDTH
Screen Width in pixels
SELECT
select button
START
start button
TILESET_SIZE
Width and height (in tiles) of tileset
TILE_SIZE
Width and height of a tile
TRANSPARENT
Palette index which is treated as transparent

Functions§

run
This is called by run!

Type Aliases§

Buttons
Bitmask of button states