KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
video.h File Reference

Functions related to video output. More...

#include <stdbool.h>
#include <stdint.h>
#include <sys/cdefs.h>

Go to the source code of this file.

Data Structures

struct  vid_mode_t
 Video mode structure. More...
 

Macros

#define CT_ANY   -1
 Any cable type.
 
#define CT_VGA   0
 VGA Box.
 
#define CT_NONE   1
 Nothing connected.
 
#define CT_RGB   2
 RGB/SCART cable.
 
#define CT_COMPOSITE   3
 Composite cable or RF switch.
 
#define DM_MULTIBUFFER   0x2000
 Multi-buffered mode setting.
 
#define VID_INTERLACE   0x00000001
 Interlaced display.
 
#define VID_LINEDOUBLE   0x00000002
 Display each scanline twice.
 
#define VID_PIXELDOUBLE   0x00000004
 Display each pixel twice.
 
#define VID_PAL   0x00000008
 50Hz refresh rate, if not VGA
 

Enumerations

enum  vid_pixel_mode_t {
  PM_RGB555 = 0 , PM_RGB565 = 1 , PM_RGB888P = 2 , PM_RGB0888 = 3 ,
  PM_RGB888 = 3
}
 Pixel mode values for the framebuffer. More...
 
enum  vid_display_mode_generic_t {
  DM_GENERIC_FIRST = 0x1000 , DM_320x240 = 0x1000 , DM_640x480 , DM_256x256 ,
  DM_768x480 , DM_768x576 , DM_GENERIC_LAST = DM_768x576
}
 Generic Display Modes. More...
 
enum  vid_display_mode_t {
  DM_INVALID = 0 , DM_320x240_VGA = 1 , DM_320x240_NTSC , DM_640x480_VGA ,
  DM_640x480_NTSC_IL , DM_640x480_PAL_IL , DM_256x256_PAL_IL , DM_768x480_NTSC_IL ,
  DM_768x576_PAL_IL , DM_768x480_PAL_IL , DM_320x240_PAL , DM_SENTINEL ,
  DM_MODE_COUNT
}
 Specific Display Modes. More...
 

Functions

int8_t vid_check_cable (void)
 Retrieve the connected video cable type.
 
void vid_set_vram (uint32_t base)
 Set the VRAM convenience pointers.
 
void vid_set_start (uint32_t base)
 Set the VRAM base of the framebuffer.
 
uint32_t vid_get_start (int32_t fb)
 Get the VRAM base of a framebuffer.
 
void vid_set_fb (int32_t fb)
 Set the current framebuffer in a multibuffered setup.
 
void vid_flip (int32_t fb)
 Flip to a framebuffer in a multibuffered setup.
 
uint32_t vid_border_color (uint8_t r, uint8_t g, uint8_t b)
 Set the border color of the display.
 
void vid_clear (uint8_t r, uint8_t g, uint8_t b)
 Clear the framebuffer.
 
void vid_empty (void)
 Clear VRAM.
 
bool vid_get_enabled (void)
 Get the state of video output.
 
void vid_set_enabled (bool val)
 Enable/disable the display.
 
void vid_waitvbl (void)
 Wait for VBlank.
 
void vid_set_mode (int dm, vid_pixel_mode_t pm)
 Set the video mode.
 
void vid_set_mode_ex (vid_mode_t *mode)
 Set the video mode.
 
void vid_init (int disp_mode, vid_pixel_mode_t pixel_mode)
 Initialize the video system.
 
void vid_shutdown (void)
 Shut down the video system.
 
int vid_screen_shot (const char *destfn)
 Take a screenshot.
 
size_t vid_screen_shot_data (uint8_t **buffer)
 Create image data from the current framebuffer.
 

Variables

static const uint8_t vid_pmode_bpp [4] = {2, 2, 3, 4}
 Video pixel mode depths.
 
vid_mode_t vid_builtin [DM_MODE_COUNT]
 The list of builtin video modes.
 
vid_mode_tvid_mode
 The current video mode.
 
uint16_t * vram_s
 16-bit size pointer to the current drawing area.
 
uint32_t * vram_l
 32-bit size pointer to the current drawing area.
 

Detailed Description

Functions related to video output.

This file deals with the video output hardware in the Dreamcast. There are functions defined herein that deal with setting up the video hardware, defining the resolution of the display, dealing with the framebuffer, etc.

Author
Anders Clerwall
Megan Potter

Enumeration Type Documentation

◆ vid_pixel_mode_t

Pixel mode values for the framebuffer.

This set of constants control the pixel mode that the framebuffer is set to. These are hardware-based values and get set in bits 2 and 3 of PVR_FB_CFG_1.

Enumerator
PM_RGB555 

RGB555 pixel mode (15-bit)

PM_RGB565 

RGB565 pixel mode (16-bit)

PM_RGB888P 

RBG888 packed pixel mode (24-bit)

PM_RGB0888 

RGB0888 pixel mode (32-bit)

PM_RGB888 

Backwards compatibility support.