KallistiOS
##version##
|
Functions related to video output. More...
Go to the source code of this file.
Data Structures | |
struct | vid_mode |
Video mode structure. More... | |
Macros | |
#define | CT_ANY -1 |
Any cable type. Used only internally. More... | |
#define | CT_VGA 0 |
VGA Box. More... | |
#define | CT_NONE 1 |
Nothing connected. More... | |
#define | CT_RGB 2 |
RGB/SCART cable. More... | |
#define | CT_COMPOSITE 3 |
Composite cable or RF switch. More... | |
#define | PM_RGB555 0 |
RGB555 pixel mode (15-bit) More... | |
#define | PM_RGB565 1 |
RGB565 pixel mode (16-bit) More... | |
#define | PM_RGB888 3 |
RGB888 pixel mode (24-bit) More... | |
#define | DM_MULTIBUFFER 0x2000 |
Multi-buffered mode setting. More... | |
#define | VID_MAX_FB 4 |
The maximum number of framebuffers available. More... | |
#define | VID_INTERLACE 0x00000001 |
Interlaced display. More... | |
#define | VID_LINEDOUBLE 0x00000002 |
Display each scanline twice. More... | |
#define | VID_PIXELDOUBLE 0x00000004 |
Display each pixel twice. More... | |
#define | VID_PAL 0x00000008 |
50Hz refresh rate, if not VGA More... | |
Typedefs | |
typedef struct vid_mode | vid_mode_t |
Video mode structure. More... | |
Enumerations | |
enum | { DM_GENERIC_FIRST = 0x1000, DM_320x240 = 0x1000, DM_640x480, DM_800x608, DM_256x256, DM_768x480, DM_768x576, DM_GENERIC_LAST = DM_768x576 } |
Generic display modes. More... | |
enum | { DM_INVALID = 0, DM_320x240_VGA = 1, DM_320x240_NTSC, DM_640x480_VGA, DM_640x480_NTSC_IL, DM_800x608_VGA, DM_640x480_PAL_IL, DM_256x256_PAL_IL, DM_768x480_NTSC_IL, DM_768x576_PAL_IL, DM_768x480_PAL_IL, DM_320x240_PAL, DM_320x240_VGA_MB, DM_320x240_NTSC_MB, DM_640x480_VGA_MB, DM_640x480_NTSC_IL_MB, DM_800x608_VGA_MB, DM_640x480_PAL_IL_MB, DM_256x256_PAL_IL_MB, DM_768x480_NTSC_IL_MB, DM_768x576_PAL_IL_MB, DM_768x480_PAL_IL_MB, DM_320x240_PAL_MB, DM_SENTINEL, DM_MODE_COUNT } |
Specific display modes. More... | |
Functions | |
int | vid_check_cable () |
Retrieve the connected video cable type. More... | |
void | vid_set_start (uint32 base) |
Set the VRAM base of the framebuffer. More... | |
void | vid_flip (int fb) |
Set the current framebuffer in a multibuffered setup. More... | |
uint32 | vid_border_color (int r, int g, int b) |
Set the border color of the display. More... | |
void | vid_clear (int r, int g, int b) |
Clear the display. More... | |
void | vid_empty () |
Clear VRAM. More... | |
void | vid_waitvbl () |
Wait for VBlank. More... | |
void | vid_set_mode (int dm, int pm) |
Set the video mode. More... | |
void | vid_set_mode_ex (vid_mode_t *mode) |
Set the video mode. More... | |
void | vid_init (int disp_mode, int pixel_mode) |
Initialize the video system. More... | |
void | vid_shutdown () |
Shut down the video system. More... | |
int | vid_screen_shot (const char *destfn) |
Take a screenshot. More... | |
Variables | |
vid_mode_t | vid_builtin [DM_MODE_COUNT] |
The list of builtin video modes. Do not modify these! More... | |
vid_mode_t * | vid_mode |
The current video mode. Do not modify directly! More... | |
uint16 * | vram_s |
16-bit size pointer to the current drawing area. More... | |
uint32 * | vram_l |
32-bit size pointer to the current drawing area. More... | |
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.
#define DM_MULTIBUFFER 0x2000 |
Multi-buffered mode setting.
OR this with the generic mode to get four framebuffers instead of one.
#define VID_MAX_FB 4 |
The maximum number of framebuffers available.
typedef struct vid_mode vid_mode_t |
Video mode structure.
KOS maintains a list of valid video modes internally that correspond to the specific display modes enumeration. Each of them is built of one of these.
anonymous enum |
anonymous enum |
Specific display modes.
uint32 vid_border_color | ( | int | r, |
int | g, | ||
int | b | ||
) |
Set the border color of the display.
This sets the color of the border area of the display. On some screens, the border area may not be shown at all, whereas on some displays you may see the whole thing.
r | The red value of the color (0-255). |
g | The green value of the color (0-255). |
b | The blue value of the color (0-255). |
int vid_check_cable | ( | ) |
Retrieve the connected video cable type.
This function checks the video cable and reports what it finds.
CT_VGA | If a VGA Box or cable is connected. |
CT_NONE | If nothing is connected. |
CT_RGB | If a RGB/SCART cable is connected. |
CT_COMPOSITE | If a composite cable or RF switch is connected. |
void vid_clear | ( | int | r, |
int | g, | ||
int | b | ||
) |
Clear the display.
This function sets the whole display to the specified color. Internally, this uses the store queues to actually clear the display entirely.
r | The red value of the color (0-255). |
g | The green value of the color (0-255). |
b | The blue value of the color (0-255). |
void vid_empty | ( | ) |
Clear VRAM.
This function is essentially a memset() for the whole of VRAM that will clear it all to 0 bytes.
void vid_flip | ( | int | fb | ) |
Set the current framebuffer in a multibuffered setup.
This function sets the displayed framebuffer to the specified buffer and sets the vram_s and vram_l pointers to point at the next framebuffer, to allow for tearing-free framebuffer-direct drawing.
fb | The framebuffer to display (or -1 for the next one). |
void vid_init | ( | int | disp_mode, |
int | pixel_mode | ||
) |
Initialize the video system.
This function initializes the video display, setting the mode to the specified parameters, clearing vram, and setting the first framebuffer as active.
disp_mode | The display mode to use. One of the DM_* values. |
pixel_mode | The pixel mode to use. One of the PM_* values. |
int vid_screen_shot | ( | const char * | destfn | ) |
Take a screenshot.
This function takes the current framebuffer (vram_s/vram_l) and dumps it out to a PPM file.
destfn | The filename to save to. |
void vid_set_mode | ( | int | dm, |
int | pm | ||
) |
Set the video mode.
This function sets the current video mode to the one specified by the parameters.
dm | The display mode to use. One of the DM_* values. |
pm | The pixel mode to use. One of the PM_* values. |
void vid_set_mode_ex | ( | vid_mode_t * | mode | ) |
Set the video mode.
This function sets the current video mode to the mode structure passed in. You can use this to add support to your program for modes that KOS doesn't have support for built-in (of course, you should tell us the settings so we can add them into KOS if you do this).
mode | A filled in vid_mode_t for the mode wanted. |
void vid_set_start | ( | uint32 | base | ) |
Set the VRAM base of the framebuffer.
This function sets the vram_s and vram_l pointsers to specified offset within VRAM and sets the start position of the framebuffer to the same offset.
base | The offset within VRAM to set the base to. |
void vid_shutdown | ( | ) |
Shut down the video system.
This function reinitializes the video system to what dcload and friends expect it to be.
void vid_waitvbl | ( | ) |
Wait for VBlank.
This function busy loops until the vertical blanking period starts.
vid_mode_t vid_builtin[DM_MODE_COUNT] |
The list of builtin video modes. Do not modify these!
The current video mode. Do not modify directly!
uint32* vram_l |
32-bit size pointer to the current drawing area.
uint16* vram_s |
16-bit size pointer to the current drawing area.