llvm-mos-sdk
|
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Classes | |
struct | vdc_sprite_t |
Macros | |
#define | VDC_SPRITE_COLOR(n) ((n)) |
#define | VDC_SPRITE_COLOR_MASK (0xF) |
#define | VDC_SPRITE_BG 0 |
#define | VDC_SPRITE_FG (0x1 << 7) |
#define | VDC_SPRITE_WIDTH_16 0 |
#define | VDC_SPRITE_WIDTH_32 (0x1 << 8) |
#define | VDC_SPRITE_WIDTH_MASK (0x1 << 8) |
#define | VDC_SPRITE_HEIGHT_16 0 |
#define | VDC_SPRITE_HEIGHT_32 (0x1 << 12) |
#define | VDC_SPRITE_HEIGHT_64 (0x3 << 12) |
#define | VDC_SPRITE_HEIGHT_MASK (0x3 << 12) |
#define | VDC_SPRITE_FLIP_X (0x1 << 11) |
#define | VDC_SPRITE_FLIP_Y (0x1 << 15) |
Functions | |
uint16_t | pce_vdc_peek (uint8_t index) |
Read a value from the VDC port. More... | |
void | pce_vdc_poke (uint8_t index, uint16_t data) |
Write a value to the VDC port. More... | |
void | pce_vdc_set_copy_word (void) |
Set the VDC's copy method to copy every word. More... | |
void | pce_vdc_set_copy_row (void) |
Set the VDC's copy method to copy every row. Alias for pce_vdc_set_copy_word . More... | |
void | pce_vdc_set_copy_32_words (void) |
Set the VDC's copy method to copy every 32nd word. More... | |
void | pce_vdc_set_copy_column_32 (void) |
Set the VDC's copy method to copy every column for a 32-wide display. Alias for pce_vdc_set_copy_32_words . More... | |
void | pce_vdc_set_copy_64_words (void) |
Set the VDC's copy method to copy every 64th word. More... | |
void | pce_vdc_set_copy_column_64 (void) |
Set the VDC's copy method to copy every column for a 64-wide display. Alias for pce_vdc_set_copy_64_words . More... | |
void | pce_vdc_set_copy_128_words (void) |
Set the VDC's copy method to copy every 128th word. More... | |
void | pce_vdc_set_copy_column_128 (void) |
Set the VDC's copy method to copy every column for a 128-wide display. Alias for pce_vdc_set_copy_128_words . More... | |
void | pce_vdc_copy_to_vram (uint16_t dest, const void *source, uint16_t length) |
Copy data from RAM to VRAM. More... | |
void | pce_vdc_copy_from_vram (void *dest, uint16_t source, uint16_t length) |
Copy data from VRAM to RAM. More... | |
void | pce_vdc_dma_start (uint8_t mode, uint16_t source, uint16_t dest, uint16_t length) |
Start a DMA operation on the VDC. More... | |
bool | pce_vdc_dma_finished (void) |
Check if the DMA operation has finished. More... | |
void | pce_vdc_set_width_tiles (uint8_t tiles, uint8_t vce_flags) |
Set the VDC width, in tiles. More... | |
void | pce_vdc_set_width (uint16_t pixels, uint8_t vce_flags) |
void | pce_vdc_set_height (uint8_t lines) |
Set the VDC height, in raster lines. More... | |
void | pce_vdc_set_resolution (uint16_t width_pixels, uint8_t height_pixels, uint8_t vce_flags) |
void | pce_vdc_bg_set_size (uint8_t value) |
Set the VDC background size. More... | |
void | pce_vdc_sprite_set_table_start (uint16_t loc) |
Set the sprite attribute table location. More... | |
void | pce_vdc_enable (uint8_t value) |
Enable VDC control flags. More... | |
void | pce_vdc_disable (uint8_t value) |
Disable VDC control flags. More... | |
void | pce_vdc_bg_enable (void) |
Enable the background layer. More... | |
void | pce_vdc_bg_disable (void) |
Disable the background layer. More... | |
void | pce_vdc_sprite_enable (void) |
Enable the sprite layer. More... | |
void | pce_vdc_sprite_disable (void) |
Disable the sprite layer. More... | |
void | pce_vdc_irq_scanline_enable (void) |
Enable the scanline IRQ. More... | |
void | pce_vdc_irq_scanline_disable (void) |
Disable the scanline IRQ. More... | |
void | pce_vdc_irq_sprite_collide_enable (void) |
Enable the sprite collision IRQ. More... | |
void | pce_vdc_irq_sprite_collide_disable (void) |
Disable the sprite collision IRQ. More... | |
void | pce_vdc_irq_sprite_overflow_enable (void) |
Enable the sprite overflow IRQ. More... | |
void | pce_vdc_irq_sprite_overflow_disable (void) |
Disable the sprite overflow IRQ. More... | |
void | pce_vdc_irq_vblank_enable (void) |
Enable the veritcal blank IRQ. More... | |
void | pce_vdc_irq_vblank_disable (void) |
Disable the veritcal blank IRQ. More... | |
bool | pce_sgx_detect (void) |
SuperGrafx: Check for presence. More... | |
void | pce_sgx_vdc_init (void) |
SuperGrafx: Initialize the second VDC. More... | |
void | pce_sgx_vdc1_set (void) |
SuperGrafx: Set the VDC1 as the current VDC for pce_vdc functions. More... | |
void | pce_sgx_vdc2_set (void) |
SuperGrafx: Set the VDC2 as the current VDC for pce_vdc functions. More... | |
void | pce_sgx_vdc_set (uint8_t id) |
SuperGrafx: Set the specified VDC as the current VDC for pce_vdc functions. More... | |
volatile uint8_t * | pce_sgx_vdc_get_index (void) |
SuperGrafx: Get the current VDC's index port location. More... | |
volatile uint16_t * | pce_sgx_vdc_get_data (void) |
SuperGrafx: Get the current VDC's data port location. More... | |
Functionality related to the VDC.
#define VDC_SPRITE_BG 0 |
#define VDC_SPRITE_COLOR | ( | n | ) | ((n)) |
#define VDC_SPRITE_COLOR_MASK (0xF) |
#define VDC_SPRITE_FG (0x1 << 7) |
#define VDC_SPRITE_FLIP_X (0x1 << 11) |
#define VDC_SPRITE_FLIP_Y (0x1 << 15) |
#define VDC_SPRITE_HEIGHT_16 0 |
#define VDC_SPRITE_HEIGHT_32 (0x1 << 12) |
#define VDC_SPRITE_HEIGHT_64 (0x3 << 12) |
#define VDC_SPRITE_HEIGHT_MASK (0x3 << 12) |
#define VDC_SPRITE_WIDTH_16 0 |
#define VDC_SPRITE_WIDTH_32 (0x1 << 8) |
#define VDC_SPRITE_WIDTH_MASK (0x1 << 8) |
bool pce_sgx_detect | ( | void | ) |
SuperGrafx: Check for presence.
May cause minor graphical glitches if not called during VBlank. xz *
void pce_sgx_vdc1_set | ( | void | ) |
SuperGrafx: Set the VDC1 as the current VDC for pce_vdc functions.
void pce_sgx_vdc2_set | ( | void | ) |
SuperGrafx: Set the VDC2 as the current VDC for pce_vdc functions.
volatile uint16_t* pce_sgx_vdc_get_data | ( | void | ) |
SuperGrafx: Get the current VDC's data port location.
volatile uint8_t* pce_sgx_vdc_get_index | ( | void | ) |
SuperGrafx: Get the current VDC's index port location.
void pce_sgx_vdc_init | ( | void | ) |
SuperGrafx: Initialize the second VDC.
This function must be called if you plan on using pce_sgx_vdc* methods.
void pce_sgx_vdc_set | ( | uint8_t | id | ) |
SuperGrafx: Set the specified VDC as the current VDC for pce_vdc functions.
void pce_vdc_bg_disable | ( | void | ) |
Disable the background layer.
void pce_vdc_bg_enable | ( | void | ) |
Enable the background layer.
void pce_vdc_bg_set_size | ( | uint8_t | value | ) |
Set the VDC background size.
value | VDC_BG_SIZE_* |
void pce_vdc_copy_from_vram | ( | void * | dest, |
uint16_t | source, | ||
uint16_t | length | ||
) |
Copy data from VRAM to RAM.
dest | Destination memory address. |
source | Source memory address, in words. |
length | The length, in bytes. |
void pce_vdc_copy_to_vram | ( | uint16_t | dest, |
const void * | source, | ||
uint16_t | length | ||
) |
Copy data from RAM to VRAM.
dest | Destination memory address, in words. |
source | Source memory address. |
length | The length, in bytes. |
void pce_vdc_disable | ( | uint8_t | value | ) |
Disable VDC control flags.
value | Control flags. |
bool pce_vdc_dma_finished | ( | void | ) |
Check if the DMA operation has finished.
void pce_vdc_dma_start | ( | uint8_t | mode, |
uint16_t | source, | ||
uint16_t | dest, | ||
uint16_t | length | ||
) |
Start a DMA operation on the VDC.
mode | The DMA mode.
|
source | Source address in VRAM. |
dest | Destination address in VRAM. |
length | Length, in bytes. |
void pce_vdc_enable | ( | uint8_t | value | ) |
Enable VDC control flags.
value | Control flags. |
void pce_vdc_irq_scanline_disable | ( | void | ) |
Disable the scanline IRQ.
void pce_vdc_irq_scanline_enable | ( | void | ) |
Enable the scanline IRQ.
void pce_vdc_irq_sprite_collide_disable | ( | void | ) |
Disable the sprite collision IRQ.
void pce_vdc_irq_sprite_collide_enable | ( | void | ) |
Enable the sprite collision IRQ.
void pce_vdc_irq_sprite_overflow_disable | ( | void | ) |
Disable the sprite overflow IRQ.
void pce_vdc_irq_sprite_overflow_enable | ( | void | ) |
Enable the sprite overflow IRQ.
void pce_vdc_irq_vblank_disable | ( | void | ) |
Disable the veritcal blank IRQ.
void pce_vdc_irq_vblank_enable | ( | void | ) |
Enable the veritcal blank IRQ.
uint16_t pce_vdc_peek | ( | uint8_t | index | ) |
Read a value from the VDC port.
index | Register to read. |
void pce_vdc_poke | ( | uint8_t | index, |
uint16_t | data | ||
) |
Write a value to the VDC port.
index | Register to write. |
data | Value to write. |
void pce_vdc_set_copy_128_words | ( | void | ) |
Set the VDC's copy method to copy every 128th word.
void pce_vdc_set_copy_32_words | ( | void | ) |
Set the VDC's copy method to copy every 32nd word.
void pce_vdc_set_copy_64_words | ( | void | ) |
Set the VDC's copy method to copy every 64th word.
void pce_vdc_set_copy_column_128 | ( | void | ) |
Set the VDC's copy method to copy every column for a 128-wide display. Alias for pce_vdc_set_copy_128_words .
void pce_vdc_set_copy_column_32 | ( | void | ) |
Set the VDC's copy method to copy every column for a 32-wide display. Alias for pce_vdc_set_copy_32_words .
void pce_vdc_set_copy_column_64 | ( | void | ) |
Set the VDC's copy method to copy every column for a 64-wide display. Alias for pce_vdc_set_copy_64_words .
void pce_vdc_set_copy_row | ( | void | ) |
Set the VDC's copy method to copy every row. Alias for pce_vdc_set_copy_word .
void pce_vdc_set_copy_word | ( | void | ) |
Set the VDC's copy method to copy every word.
void pce_vdc_set_height | ( | uint8_t | lines | ) |
Set the VDC height, in raster lines.
lines | The number of raster lines. |
void pce_vdc_set_resolution | ( | uint16_t | width_pixels, |
uint8_t | height_pixels, | ||
uint8_t | vce_flags | ||
) |
void pce_vdc_set_width | ( | uint16_t | pixels, |
uint8_t | vce_flags | ||
) |
void pce_vdc_set_width_tiles | ( | uint8_t | tiles, |
uint8_t | vce_flags | ||
) |
Set the VDC width, in tiles.
tiles | The number of tiles. |
vce_flags | VCE control register configuration:
|
void pce_vdc_sprite_disable | ( | void | ) |
Disable the sprite layer.
void pce_vdc_sprite_enable | ( | void | ) |
Enable the sprite layer.
void pce_vdc_sprite_set_table_start | ( | uint16_t | loc | ) |
Set the sprite attribute table location.
loc | Location. |