libws libws
WSwan hardware library for the Wonderful toolchain
|
#include <stdbool.h>
#include <stdint.h>
#include <wonderful.h>
#include "memory.h"
#include "ports.h"
Go to the source code of this file.
Data Structures | |
struct | ws_display_tile_t |
struct | ws_display_tile_4bpp_t |
struct | ws_sprite_t |
Macros | |
#define | WS_DISPLAY_WIDTH_TILES 28 |
#define | WS_DISPLAY_HEIGHT_TILES 18 |
#define | WS_DISPLAY_WIDTH_PIXELS (WS_DISPLAY_WIDTH_TILES * WS_DISPLAY_TILE_WIDTH) |
#define | WS_DISPLAY_HEIGHT_PIXELS (WS_DISPLAY_HEIGHT_TILES * WS_DISPLAY_TILE_HEIGHT) |
#define | WS_DISPLAY_TILE_WIDTH 8 |
#define | WS_DISPLAY_TILE_HEIGHT 8 |
#define | WS_DISPLAY_TILE_SIZE 16 |
Tile 2-bit-per-pixel graphic data size, in bytes. | |
#define | WS_DISPLAY_TILE_SIZE_4BPP 32 |
Tile 4-bit-per-pixel graphic data size, in bytes. | |
#define | WS_DISPLAY_VTOTAL 159 |
Number of vertical lines in a frame. | |
#define | WS_SCREEN_ATTR_TILE(x) |
Attribute: tile index (0-511). | |
#define | WS_SCREEN_ATTR_TILE_MASK (0x1FF) |
#define | WS_SCREEN_ATTR_PALETTE(x) |
Attribute: palette (0-15). | |
#define | WS_SCREEN_ATTR_PALETTE_MASK (0xF << 9) |
#define | WS_SCREEN_ATTR_BANK(x) |
Attribute: tile bank (0-1). | |
#define | WS_SCREEN_ATTR_BANK_MASK (0x2000) |
#define | WS_SCREEN_ATTR_TILE_EX(x) |
Attribute: tile index (0-1023). Calculates both bank and index. | |
#define | WS_SCREEN_ATTR_TILE_EX_MASK (0x21FF) |
#define | WS_SCREEN_ATTR_FLIP_H 0x4000 |
Attribute: flip tile graphic horizontally. | |
#define | WS_SCREEN_ATTR_FLIP_V 0x8000 |
Attribute: flip tile graphic vertically. | |
#define | WS_SCREEN_ATTR_FLIP 0xC000 |
Attribute: flip tile graphic in both axes (180-degree rotation). | |
#define | WS_SCREEN_ATTR_FLIP_MASK 0xC000 |
#define | WS_SCREEN_WIDTH_TILES 32 |
#define | WS_SCREEN_HEIGHT_TILES 32 |
#define | WS_SCREEN_WIDTH_PIXELS (WS_SCREEN_WIDTH_TILES * WS_DISPLAY_TILE_WIDTH) |
#define | WS_SCREEN_HEIGHT_PIXELS (WS_SCREEN_HEIGHT_TILES * WS_DISPLAY_TILE_HEIGHT) |
#define | WS_SPRITE_ATTR_PALETTE(x) |
Attribute: palette (0-7; corresponds to screen palettes 8-15). | |
#define | WS_SPRITE_ATTR_PALETTE_MASK (0x7 << 9) |
#define | WS_SPRITE_ATTR_OUTSIDE 0x1000 |
Attribute: draw sprite outside instead of inside window, if window enabled. | |
#define | WS_SPRITE_ATTR_PRIORITY 0x2000 |
Attribute: draw sprite in front of instead of behind Screen 2. | |
#define | WS_SPRITE_ATTR_FLIP_H 0x4000 |
Attribute: flip tile graphic horizontally. | |
#define | WS_SPRITE_ATTR_FLIP_V 0x8000 |
Attribute: flip tile graphic vertically. | |
#define | WS_SPRITE_ATTR_FLIP 0xC000 |
Attribute: flip tile graphic in both axes (180-degree rotation). | |
#define | WS_SPRITE_ATTR_FLIP_MASK 0xC000 |
#define | WS_SPRITE_MAX_COUNT 128 |
#define | WS_RGB(r, g, b) |
Create an RGB color. | |
#define | WS_DISPLAY_MONO_PALETTE(c0, c1, c2, c3) |
Define a mono mode palette of four shades (0-7). | |
#define | WS_TILE_MEM(i) |
Pointer to tile. | |
#define | WS_TILE_4BPP_MEM(i) |
Pointer to 4bpp tile. | |
#define | WS_TILE_BANKED_MEM(b, i) |
Pointer to tile, with bank specified separately. | |
#define | WS_TILE_4BPP_BANKED_MEM(b, i) |
Pointer to 4bpp, tile, with bank specified separately. | |
#define | WS_DISPLAY_COLOR_MEM(i) |
Pointer to color palette. | |
#define | WS_SCREEN_COLOR_MEM WS_DISPLAY_COLOR_MEM |
Pointer to screen color palette. | |
#define | WS_SPRITE_COLOR_MEM(i) |
Pointer to sprite color palette. | |
#define | WS_DISPLAY_SHADE_LUT(c0, c1, c2, c3, c4, c5, c6, c7) |
#define | WS_DISPLAY_SHADE_LUT_DEFAULT WS_DISPLAY_SHADE_LUT(0, 2, 4, 6, 9, 11, 13, 15) |
#define | ws_display_set_screen1_address(address) |
Set the base addresses of screen 1. | |
#define | ws_display_set_screen2_address(address) |
Set the base addresses of screen 2. | |
#define | ws_display_scroll_screen1_to(x, y) |
Scroll screen 1 to a specified location. | |
#define | ws_display_scroll_screen2_to(x, y) |
Scroll screen 2 to a specified location. |
Functions | |
static void | ws_display_set_screen_addresses (const void __wf_iram *scr1_addr, const void __wf_iram *scr2_addr) |
Set the base addresses of screens 1 and 2. | |
static void | ws_display_set_screen_address (uint8_t screen, const void __wf_iram *address) |
Set the base addresses of the specified screen. | |
static void | ws_display_set_sprite_address (const void __wf_iram *address) |
Set the base addresses of the sprite table. | |
static void | ws_display_set_screen2_window (uint8_t x, uint8_t y, uint8_t width, uint8_t height) |
Set the position and size of the screen 2 window. | |
static void | ws_display_set_screen2_window_corners (uint8_t left, uint8_t top, uint8_t right, uint8_t bottom) |
Set the corners of the screen 2 window. | |
static void | ws_display_set_sprite_window (uint8_t x, uint8_t y, uint8_t width, uint8_t height) |
Set the position and size of the sprite window. | |
static void | ws_display_set_sprite_window_corners (uint8_t left, uint8_t top, uint8_t right, uint8_t bottom) |
Set the corners of the sprite window. | |
static void | ws_display_scroll_screen_to (uint8_t screen, uint8_t x, uint8_t y) |
Scroll the specified screen to a specified location. | |
void | ws_display_scroll_screen_by (uint8_t screen, int16_t x, int16_t y) |
Scroll the specified screen by a specified number of pixels. | |
static uint8_t | ws_display_get_current_line (void) |
Get the line currently being drawn to the line buffer. | |
static void | ws_display_scroll_screen1_by (uint8_t x, uint8_t y) |
Scroll screen 1 by a specified number of pixels. | |
static void | ws_display_scroll_screen2_by (uint8_t x, uint8_t y) |
Scroll screen 2 by a specified number of pixels. | |
static void | ws_display_set_icons (uint8_t mask) |
Set the list of displayed LCD icons, clearing any unspecified icons. | |
static void | ws_display_show_icons (uint8_t mask) |
Show specified LCD icons. | |
static void | ws_display_hide_icons (uint8_t mask) |
Hide specified LCD icons. | |
static void | ws_display_toggle_icons (uint8_t mask) |
Toggle specified LCD icons. | |
void | ws_display_set_shade_lut (uint32_t lut) |
Configure the shade LUT. | |
static void | ws_screen_put_tiles (void ws_iram *dest, const void __far *src, uint16_t x, uint16_t y, uint16_t width, uint16_t height) |
Place a map of tiles on the screen. | |
static void | ws_screen_put_tiles_ex (void ws_iram *dest, const void __far *src, uint16_t sx, uint16_t sy, uint16_t pitch, uint16_t dx, uint16_t dy, uint16_t width, uint16_t height) |
Place a map of tiles on the screen. This varianta llows specifying the source X position, Y position and width. | |
void | ws_screen_get_tiles (void __far *dest, const void ws_iram *src, uint16_t x, uint16_t y, uint16_t width, uint16_t height) |
Copy a map of tiles from the screen. | |
void | ws_screen_fill_tiles (void ws_iram *dest, uint16_t src, uint16_t x, uint16_t y, uint16_t width, uint16_t height) |
Fill an area on the screen with a given tile. | |
void | ws_screen_modify_tiles (void ws_iram *dest, uint16_t mask, uint16_t value, uint16_t x, uint16_t y, uint16_t width, uint16_t height) |
Modify an area on the screen with given data. | |
static void | ws_screen_put_tile (void ws_iram *dest, uint16_t src, uint16_t x, uint16_t y) |
Put a tile on the screen. | |
static uint16_t | ws_screen_get_tile (void ws_iram *src, uint16_t x, uint16_t y) |
Get a tile on the screen. |
Functionality related to the display.
Definition in file display.h.