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

Definitions for using the VMU device. More...

#include <sys/cdefs.h>
#include <arch/types.h>
#include <dc/maple.h>
#include <stdint.h>
#include <time.h>

Go to the source code of this file.

Data Structures

struct  vmu_cond_t
 VMU's raw condition data: 0 = PRESSED, 1 = RELEASED. More...
 
union  vmu_state_t
 VMU's "civilized" state data: 0 = RELEASED, 1 = PRESSED. More...
 

Macros

#define VMU_SCREEN_WIDTH   48
 Pixel width of a standard VMU screen.
 
#define VMU_SCREEN_HEIGHT   32
 Pixel height of a standard VMU screen.
 
#define VMU_DPAD_UP   (0<<1)
 Up Dpad button on the VMU.
 
#define VMU_DPAD_DOWN   (1<<1)
 Down Dpad button on the VMU.
 
#define VMU_DPAD_LEFT   (2<<1)
 Left Dpad button on the VMU.
 
#define VMU_DPAD_RIGHT   (3<<1)
 Right Dpad button on the VMU.
 
#define VMU_A   (4<<1)
 'A' button on the VMU
 
#define VMU_B   (5<<1)
 'B' button on the VMU
 
#define VMU_MODE   (6<<1)
 Mode button on the VMU.
 
#define VMU_SLEEP   (7<<1)
 Sleep button on the VMU.
 

Functions

int vmu_has_241_blocks (maple_device_t *dev)
 Get the status of a VMUs extra 41 blocks.
 
int vmu_toggle_241_blocks (maple_device_t *dev, int enable)
 Enable the extra 41 blocks of a VMU.
 
int vmu_use_custom_color (maple_device_t *dev, int enable)
 Enable custom color of a VMU.
 
int vmu_set_custom_color (maple_device_t *dev, uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
 Set custom color of a VMU.
 
int vmu_get_custom_color (maple_device_t *dev, uint8_t *red, uint8_t *green, uint8_t *blue, uint8_t *alpha)
 Get custom color of a VMU.
 
int vmu_set_icon_shape (maple_device_t *dev, uint8_t icon_shape)
 Set icon shape of a VMU.
 
int vmu_get_icon_shape (maple_device_t *dev, uint8_t *icon_shape)
 Get icon shape of a VMU.
 
int vmu_draw_lcd (maple_device_t *dev, const void *bitmap)
 Display a 1bpp bitmap on a VMU screen.
 
int vmu_draw_lcd_rotated (maple_device_t *dev, const void *bitmap)
 Display a 1bpp bitmap on a VMU screen.
 
int vmu_draw_lcd_xbm (maple_device_t *dev, const char *vmu_icon)
 Display a Xwindows XBM image on a VMU screen.
 
void vmu_set_icon (const char *vmu_icon)
 Display a Xwindows XBM on all VMUs.
 
int vmu_block_read (maple_device_t *dev, uint16_t blocknum, uint8_t *buffer)
 Read a block from a memory card.
 
int vmu_block_write (maple_device_t *dev, uint16_t blocknum, const uint8_t *buffer)
 Write a block to a memory card.
 
Buzzer

Methods for tone generation.

int vmu_beep_raw (maple_device_t *dev, uint32_t beep)
 Make a VMU beep (low-level).
 
int vmu_beep_waveform (maple_device_t *dev, uint8_t period1, uint8_t duty_cycle1, uint8_t period2, uint8_t duty_cycle2)
 Play VMU Buzzer tone.
 
Date/Time

Methods for managing date and time.

int vmu_set_datetime (maple_device_t *dev, time_t unix)
 Set the date and time on the VMU.
 
int vmu_get_datetime (maple_device_t *dev, time_t *unix)
 Get the date and time on the VMU.
 
Input

Methods for polling button states.

void vmu_set_buttons_enabled (int enable)
 Enable/Disable polling for VMU input.
 
int vmu_get_buttons_enabled (void)
 Check whether polling for VMU input has been enabled.
 

Detailed Description

Definitions for using the VMU device.

This file provides an API around the various Maple function types (LCD, MEMCARD, CLOCK) provided by the Visual Memory Unit. Each API can also be used independently for devices which aren't VMUs, such as using MEMCARD functionality with a standard memory card that lacks a screen or buzzer.

Author
Jordan DeLong
Megan Potter
Donald Haase
Falco Girgis