KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
vmu.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 dc/maple/vmu.h
4 Copyright (C) 2000-2002 Jordan DeLong, Megan Potter
5 Copyright (C) 2008 Donald Haase
6 Copyright (C) 2023 Andy Barajas
7 Copyright (C) 2023, 2025 Falco Girgis
8
9*/
10
11/** \file dc/maple/vmu.h
12 \brief Definitions for using the VMU device.
13 \ingroup vmu
14
15 This file provides an API around the various Maple function
16 types (LCD, MEMCARD, CLOCK) provided by the Visual Memory Unit.
17 Each API can also be used independently for devices which aren't
18 VMUs, such as using MEMCARD functionality with a standard memory
19 card that lacks a screen or buzzer.
20
21 \author Jordan DeLong
22 \author Megan Potter
23 \author Donald Haase
24 \author Falco Girgis
25*/
26
27#ifndef __DC_MAPLE_VMU_H
28#define __DC_MAPLE_VMU_H
29
30#include <kos/cdefs.h>
31__BEGIN_DECLS
32
33#include <dc/maple.h>
34#include <kos/regfield.h>
35
36#include <stdbool.h>
37#include <stdint.h>
38#include <time.h>
39
40/** \defgroup vmu Visual Memory Unit
41 \brief VMU/VMS Maple Peripheral API
42 \ingroup peripherals
43
44 The Sega Dreamcast's Visual Memory Unit (VMU)
45 is an 8-Bit gaming device which, when plugged into
46 the controller, communicates with the Dreamcast
47 as a Maple peripheral.
48
49 Visual Memory Unit
50 _________________
51 / \
52 | @ Dreamcast |
53 | ___________ |
54 | | | |
55 | | | |
56 | | | |
57 | | | |
58 Sleep | |___________| | Mode
59 ------|---------\ /--|-------
60 | |¯| * * |
61 /--|-|¯ ¯| /¯\ /¯\_|____
62 / | ¯|_|¯ \_/ \_/ | \
63 | | | | B
64 D-pad \__________|______/
65 |
66 A
67
68 As a Maple peripheral, the VMU implements the
69 following functions:
70 - <b>MEMCARD</b>: Storage device used for saving and
71 loading game files.
72 - <b>LCD</b>: Secondary LCD display on which additional
73 information may be presented to the player.
74 - <b>CLOCK</b>: A device which maintains the current date
75 and time, provides at least one buzzer for
76 playing tones, and also has buttons used
77 for input.
78
79 Each Maple function has a corresponding set of C functions
80 providing a high-level API around its functionality.
81
82*/
83/** \defgroup vmu_settings Settings
84 \brief Customizable configuration data
85 \ingroup vmu
86
87 This module provides a high-level abstraction around various
88 features and settings which can be modified on the VMU. Many
89 of these operations are provided by the Dreamcast's BIOS when
90 a VMU has been formatted.
91*/
92
93/** \brief Get the status of a VMUs extra 41 blocks
94 \ingroup vmu_settings
95
96 This function checks if the extra 41 blocks of a VMU have been
97 enabled.
98
99 \param dev The device to check the status of.
100
101 \retval 1 On success: extra blocks are enabled
102 \retval 0 On success: extra blocks are disabled
103 \retval -1 On failure
104*/
106
107/** \brief Enable the extra 41 blocks of a VMU
108 \ingroup vmu_settings
109
110 This function enables/disables the extra 41 blocks of a specific VMU.
111
112 \warning Enabling the extra blocks of a VMU may render it unusable
113 for a very few commercial games.
114
115 \param dev The device to enable/disable 41 blocks.
116 \param enable True enables. false disables.
117
118 \retval 0 On success
119 \retval -1 On failure
120*/
122
123/** \brief Enable custom color of a VMU
124 \ingroup vmu_settings
125
126 This function enables/disables the custom color of a specific VMU.
127 This color is only displayed in the Dreamcast's file manager.
128
129 \param dev The device to enable/disable custom color.
130 \param enable True enables. false disables.
131
132 \retval 0 On success
133 \retval -1 On failure
134
135 \sa vmu_set_custom_color
136*/
138
139/** \brief Set custom color of a VMU
140 \ingroup vmu_settings
141
142 This function sets the custom color of a specific VMU. This color is only
143 displayed in the Dreamcast's file manager. This function also enables the
144 use of the custom color. Otherwise it wouldn't show up.
145
146 \param dev The device to change the color of.
147 \param red The red component. 0-255
148 \param green The green component. 0-255
149 \param blue The blue component. 0-255
150 \param alpha The alpha component. 0-255; 100-255 Recommended
151
152 \retval 0 On success
153 \retval -1 On failure
154
155 \sa vmu_get_custom_color, vmu_use_custom_color
156*/
157int vmu_set_custom_color(maple_device_t *dev, uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);
158
159/** \brief Get custom color of a VMU
160 \ingroup vmu_settings
161
162 This function gets the custom color of a specific VMU. This color is only
163 displayed in the Dreamcast's file manager. This function also returns whether
164 the custom color is currently enabled.
165
166 \param dev The device to change the color of.
167 \param red The red component. 0-255
168 \param green The green component. 0-255
169 \param blue The blue component. 0-255
170 \param alpha The alpha component. 0-255; 100-255 Recommended
171
172 \retval 1 On success: custom color is enabled
173 \retval 0 On success: custom color is disabled
174 \retval -1 On failure
175
176 \sa vmu_set_custom_color, vmu_use_custom_color
177*/
178int vmu_get_custom_color(maple_device_t *dev, uint8_t *red, uint8_t *green, uint8_t *blue, uint8_t *alpha);
179
180/** \brief Set icon shape of a VMU
181 \ingroup vmu_settings
182
183 This function sets the icon shape of a specific VMU. The icon shape is a
184 VMU icon that is displayed on the LCD screen while navigating the Dreamcast
185 BIOS menu and is the GUI representation of the VMU in the menu's file manager.
186 The Dreamcast BIOS provides a set of 124 icons to choose from.
187
188 \note
189 When a custom file named "ICONDATA_VMS" is present on a VMU, it overrides this
190 icon by providing custom icons for both the DC BIOS menu and the VMU's LCD screen.
191
192 \param dev The device to change the icon shape of.
193 \param icon_shape One of the values found in \ref bfont_vmu_icon_t.
194
195 \retval 0 On success
196 \retval -1 On failure
197
198 \sa bfont_vmu_icon_t, vmu_get_icon_shape
199*/
200int vmu_set_icon_shape(maple_device_t *dev, uint8_t icon_shape);
201
202/** \brief Get icon shape of a VMU
203 \ingroup vmu_settings
204
205 This function gets the icon shape of a specific VMU. The icon shape is a
206 VMU icon that is displayed on the LCD screen while navigating the Dreamcast
207 BIOS menu and is the GUI representation of the VMU in the menu's file manager.
208 The Dreamcast BIOS provides a set of 124 icons to choose from.
209
210 \note
211 When a custom file named "ICONDATA_VMS" is present on a VMU, it overrides this
212 icon by providing custom icons for both the DC BIOS menu and the VMU's LCD screen.
213
214 \param dev The device to change the icon shape of.
215 \param icon_shape One of the values found in \ref bfont_vmu_icon_t.
216
217 \retval 0 On success
218 \retval -1 On failure
219
220 \sa bfont_vmu_icon_t, vmu_set_icon_shape
221*/
222int vmu_get_icon_shape(maple_device_t *dev, uint8_t *icon_shape);
223
224/** \defgroup maple_lcd LCD Function
225 \brief API for features of the LCD Maple Function
226 \ingroup vmu
227
228 The LCD Maple function is for exposing a secondary LCD screen
229 that gets attached to a controller, which can be used to display
230 additional game information, or information you only want visible
231 to a single player.
232*/
233
234/**
235 \brief Pixel width of a standard VMU screen
236 \ingroup maple_lcd
237*/
238#define VMU_SCREEN_WIDTH 48
239
240/**
241 \brief Pixel height of a standard VMU screen
242 \ingroup maple_lcd
243*/
244#define VMU_SCREEN_HEIGHT 32
245
246/** \brief Display a 1bpp bitmap on a VMU screen.
247 \ingroup maple_lcd
248
249 This function sends a raw bitmap to a VMU to display on its screen. This
250 bitmap is 1bpp, and is 48x32 in size.
251
252 \param dev The device to draw to.
253 \param bitmap The bitmap to show.
254
255 \retval MAPLE_EOK On success.
256 \retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
257 \retval MAPLE_EINVALID The device does not support this functionality (VMS).
258
259 \sa vmu_draw_lcd_rotated, vmu_draw_lcd_xbm, vmu_set_icon
260*/
261int vmu_draw_lcd(maple_device_t *dev, const void *bitmap);
262
263/** \brief Display a 1bpp bitmap on a VMU screen.
264 \ingroup maple_lcd
265
266 This function sends a raw bitmap to a VMU to display on its screen. This
267 bitmap is 1bpp, and is 48x32 in size. This function is equivalent to
268 vmu_draw_lcd(), but the image is rotated 180° so that the first byte of the
269 bitmap corresponds to the top-left corner, instead of the bottom-right one.
270
271 \warning This function is optimized by an assembly routine which operates
272 on 32 bits at a time. As such, the given bitmap must be 4-byte
273 aligned.
274
275 \param dev The device to draw to.
276 \param bitmap The bitmap to show.
277 \retval MAPLE_EOK On success.
278 \retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
279 \retval MAPLE_EINVALID The device does not support this functionality (VMS).
280
281 \sa vmu_draw_lcd, vmu_draw_lcd_xbm, vmu_set_icon
282*/
283int vmu_draw_lcd_rotated(maple_device_t *dev, const void *bitmap);
284
285/** \brief Display a Xwindows XBM image on a VMU screen.
286 \ingroup maple_lcd
287
288 This function takes in a Xwindows XBM, converts it to a raw bitmap, and sends
289 it to a VMU to display on its screen. This XBM image is 48x32 in size.
290
291 \param dev The device to draw to.
292 \param vmu_icon The icon to set.
293
294 \retval MAPLE_EOK On success.
295 \retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
296 \retval MAPLE_EINVALID The device does not support this functionality (VMS).
297
298 \sa vmu_draw_lcd, vmu_set_icon
299*/
301
302/** \brief Display a Xwindows XBM on all VMUs.
303 \ingroup maple_lcd
304
305 This function takes in a Xwindows XBM and displays the image on all VMUs.
306
307 \note
308 This is a convenience function for vmu_draw_lcd() to broadcast across all VMUs.
309
310 \todo
311 Prevent this routine from broadcasting to rear VMUs.
312
313 \param vmu_icon The icon to set.
314
315 \sa vmu_draw_lcd_xbm
316*/
317void vmu_set_icon(const char *vmu_icon);
318
319/** \defgroup maple_memcard Memory Card Function
320 \brief API for features of the Memory Card Maple Function
321 \ingroup vmu
322
323 The Memory Card Maple function is for exposing a low-level,
324 block-based API that allows you to read from and write to
325 random blocks within the memory card's filesystem.
326
327 \note
328 A standard memory card has a block size of 512 bytes; however,
329 the block size is a configurable parameter in the "root" block,
330 which can be queried to cover supporting homebrew memory
331 cards with larger block sizes.
332
333 \warning
334 You should never use these functions directly, unless you
335 <i>really</i> know what you're doing, as you can easily corrupt
336 the filesystem by writing incorrect data. Instead, you should
337 favor the high-level filesystem API found in vmufs.h, or just
338 use the native C standard filesystem API within the virtual
339 `/vmu/` root directory to operate on VMU data.
340*/
341
342/** \brief Read a block from a memory card.
343 \ingroup maple_memcard
344
345 This function performs a low-level raw block read from a memory card.
346
347 \param dev The device to read from.
348 \param blocknum The block number to read.
349 \param buffer The buffer to read into (512 bytes).
350
351 \retval MAPLE_EOK On success.
352 \retval MAPLE_ETIMEOUT If the command timed out while blocking.
353 \retval MAPLE_EFAIL On errors other than timeout.
354
355 \sa vmu_block_write
356*/
357int vmu_block_read(maple_device_t *dev, uint16_t blocknum, uint8_t *buffer);
358
359/** \brief Write a block to a memory card.
360 \ingroup maple_memcard
361
362 This function performs a low-level raw block write to a memory card.
363
364 \param dev The device to write to.
365 \param blocknum The block number to write.
366 \param buffer The buffer to write from (512 bytes).
367
368 \retval MAPLE_EOK On success.
369 \retval MAPLE_ETIMEOUT If the command timed out while blocking.
370 \retval MAPLE_EFAIL On errors other than timeout.
371
372 \sa vmu_block_read
373*/
374int vmu_block_write(maple_device_t *dev, uint16_t blocknum, const uint8_t *buffer);
375
376/** \defgroup maple_clock Clock Function
377 \brief API for features of the Clock Maple Function
378 \ingroup vmu
379
380 The Clock Maple function provides a high-level API for the
381 following functionality:
382 - buzzer tone generation
383 - date/time management
384 - input/button status
385*/
386
387/** \name Buzzer
388 \brief Methods for tone generation.
389 @{
390*/
391
392/** \brief Make a VMU beep (low-level).
393 \ingroup maple_clock
394
395 This function sends a raw beep to a VMU, causing the speaker to emit a tone
396 noise.
397
398 \note
399 See http://dcemulation.org/phpBB/viewtopic.php?f=29&t=97048 for the
400 original information about beeping.
401
402 \warning
403 This function is submitting raw, encoded values to the VMU. For a more
404 user-friendly API built around generating simple tones, see vmu_beep_waveform().
405
406 \param dev The device to attempt to beep.
407 \param beep The tone to generate. Byte values are as follows:
408 1. period of square wave 1
409 2. duty cycle of square wave 1
410 3. period of square wave 2 (ignored by
411 standard mono VMUs)
412 4. duty cycle of square wave 2 (ignored by
413 standard mono VMUs)
414
415 \retval MAPLE_EOK On success.
416 \retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
417 \retval MAPLE_EINVALID The device does not support this functionality (VMS).
418
419 \sa vmu_beep_waveform
420*/
421int vmu_beep_raw(maple_device_t *dev, uint32_t beep);
422
423/** \brief Play VMU Buzzer tone.
424 \ingroup maple_clock
425
426 Sends two different square waves to generate tone(s) on the VMU. Each
427 waveform is configured as shown by the following diagram. On a standard
428 VMU, there is only one piezoelectric buzzer, so waveform 2 is ignored;
429 however, the parameters do support dual-channel stereo in case such a
430 VMU ever does come along.
431
432 Period
433 +---------------------+
434 | |
435 HIGH __________ __________
436 | | | |
437 | | | |
438 |__________| |__________|
439 LOW
440 | |
441 +----------+
442 Duty Cycle
443
444 WAVEFORM
445
446 To stop an active tone, one can simply generate a flat wave, such as by
447 submitting both values as 0s.
448
449 \warning
450 Any submitted waveform which has a duty cycle of greater than or equal to
451 its period will result in an invalid waveform being generated and is
452 going to mute or end the tone.
453
454 \note
455 Note that there are no units given for the waveform, so any 3rd party VMU
456 is free to use any base clock rate, potentially resulting in different
457 frequencies (or tones) being generated for the same parameters on different
458 devices.
459
460 \note
461 On the VMU-side, this tone is generated using the VMU's Timer1 peripheral
462 as a pulse generator, which is then fed into its piezoelectric buzzer. The
463 calculated range of the standard VMU, given its 6MHz CF clock running with a
464 divisor of 6 is driving the Timer1 counter, is approximately 3.9KHz-500Khz;
465 however, due to physical characteristics of the buzzer, not every frequency
466 can be produced at a decent volume, so it's recommended that you test your
467 values, using the KOS example found at `/examples/dreamcast/vmu/beep`.
468
469 \param dev The VMU device to play the tone on
470 \param period1 The period or total interval of the first waveform
471 \param duty_cycle1 The duty cycle or active interval of the first waveform
472 \param period2 The period or total interval of the second waveform
473 (ignored by standard first-party VMUs).
474 \param duty_cycle2 The duty cycle or active interval of the second waveform
475 (ignored by standard first-party VMUs).
476
477 \retval MAPLE_EOK On success.
478 \retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
479 \retval MAPLE_EINVALID The device does not support this functionality (VMS).
480*/
481int vmu_beep_waveform(maple_device_t *dev, uint8_t period1, uint8_t duty_cycle1, uint8_t period2, uint8_t duty_cycle2);
482
483/** @} */
484
485/** \name Date/Time
486 \brief Methods for managing date and time.
487 @{
488*/
489
490/** \brief Set the date and time on the VMU.
491 \ingroup maple_clock
492
493 This function sets the VMU's date and time values to
494 the given standard C Unix timestamp.
495
496 \param dev The device to write to.
497 \param unix Seconds since Unix epoch
498
499 \retval MAPLE_EOK On success.
500 \retval MAPLE_ETIMEOUT If the command timed out while blocking.
501 \retval MAPLE_EFAIL On errors other than timeout.
502 \retval MAPLE_EINVALID The device does not support this functionality (VMS).
503
504 \sa vmu_get_datetime
505*/
506int vmu_set_datetime(maple_device_t *dev, time_t unix);
507
508/** \brief Get the date and time on the VMU.
509 \ingroup maple_clock
510
511 This function gets the VMU's date and time values
512 as a single standard C Unix timestamp.
513
514 \note
515 This is the VMU equivalent of calling `time(unix)`.
516
517 \param dev The device to write to.
518 \param unix Seconds since Unix epoch (set to -1 upon failure)
519
520 \retval MAPLE_EOK On success.
521 \retval MAPLE_ETIMEOUT If the command timed out while blocking.
522 \retval MAPLE_EFAIL On errors other than timeout.
523 \retval MAPLE_EINVALID The device does not support this functionality (VMS).
524
525 \sa vmu_set_datetime
526*/
527int vmu_get_datetime(maple_device_t *dev, time_t *unix);
528
529/** @} */
530
531/** \defgroup vmu_buttons VMU Buttons
532 \brief VMU button masks
533 \ingroup maple_clock
534
535 VMU's button state/cond masks, same as capability masks
536
537 \note
538 The MODE and SLEEP button states are not pollable on
539 a standard VMU.
540
541 @{
542*/
543
544#define VMU_DPAD_UP BIT(0) /**< Up Dpad button on the VMU */
545#define VMU_DPAD_DOWN BIT(1) /**< Down Dpad button on the VMU */
546#define VMU_DPAD_LEFT BIT(2) /**< Left Dpad button on the VMU */
547#define VMU_DPAD_RIGHT BIT(3) /**< Right Dpad button on the VMU */
548#define VMU_A BIT(4) /**< 'A' button on the VMU */
549#define VMU_B BIT(5) /**< 'B' button on the VMU */
550#define VMU_MODE BIT(6) /**< Mode button on the VMU */
551#define VMU_SLEEP BIT(7) /**< Sleep button on the VMU */
552
553/** \brief Represents the combined state of all VMU buttons.
554
555 Button states values:
556 - `0`: Released
557 - `1`: Pressed
558
559 \note
560 The Dpad buttons are automatically reoriented for you depending on
561 which direction the VMU is facing in a particular type of controller.
562 */
563typedef union vmu_buttons {
564 uint8_t raw; /**< Combined button state mask */
565 struct {
566 uint8_t dpad_up: 1; /**< Dpad Up button state */
567 uint8_t dpad_down: 1; /**< Dpad Down button state */
568 uint8_t dpad_left: 1; /**< Dpad Left button state */
569 uint8_t dpad_right: 1; /**< Dpad Right button state */
570 uint8_t a: 1; /**< 'A' button state */
571 uint8_t b: 1; /**< 'B' button state */
572 uint8_t mode: 1; /**< Mode button state */
573 uint8_t sleep: 1; /**< Sleep button state */
574 };
576
577/** "Civilized" structure containing VMU's current state.
578
579 \note
580 Don't forget that if you want valid button state information, you must
581 enable polling for it in the driver with vmu_set_buttons_enabled()!
582*/
583typedef struct vmu_state {
584 struct {
585 vmu_buttons_t current; /**< Button states from the current frame */
586 vmu_buttons_t previous; /**< Button states from the previous frame */
587 } buttons; /**< Latest two frames of button state data */
589
590/** @} */
591
592/** \name Input
593 \brief Methods for polling button states.
594 @{
595*/
596
597/** \brief Enable/Disable polling for VMU input
598 \ingroup maple_clock
599
600 This function is used to either enable or disable polling the
601 VMU buttons' states for input each frame.
602
603 \note
604 These buttons are not usually accessible to the player; however,
605 several devices, such as the ASCII pad, the arcade pad, and
606 the Retro Fighters controller leave the VMU partially exposed,
607 so that these buttons remain accessible, allowing them to be used
608 as extended controller inputs.
609
610 \note
611 Polling for VMU input is disabled by default to reduce unnecessary
612 Maple BUS traffic.
613
614 \sa vmu_get_buttons_enabled
615*/
616void vmu_set_buttons_enabled(bool enable);
617
618/** \brief Check whether polling for VMU input has been enabled
619 \ingroup maple_clock
620
621 This function is used to check whether per-frame polling of
622 the VMU's button states has been enabled in the driver.
623
624 \note
625 Polling for VMU input is disabled by default to reduce unnecessary
626 Maple BUS traffic.
627
628 \sa vmu_set_buttons_enabled
629*/
631
632/** @} */
633
634/** \cond */
635/* Init / Shutdown -- Managed internally by KOS */
636void vmu_init(void);
637void vmu_shutdown(void);
638/** \endcond */
639
640__END_DECLS
641
642#endif /* __DC_MAPLE_VMU_H */
643
Various common macros used throughout the codebase.
const Color red
Definition colors.cpp:10
const Color blue
Definition colors.cpp:15
const Color green
Definition colors.cpp:9
int vmu_get_datetime(maple_device_t *dev, time_t *unix)
Get the date and time on the VMU.
int vmu_beep_raw(maple_device_t *dev, uint32_t beep)
Make a VMU beep (low-level).
void vmu_set_buttons_enabled(bool enable)
Enable/Disable polling for VMU input.
int vmu_set_datetime(maple_device_t *dev, time_t unix)
Set the date and time on the VMU.
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.
bool vmu_get_buttons_enabled(void)
Check whether polling for VMU input has been enabled.
int vmu_draw_lcd_rotated(maple_device_t *dev, const void *bitmap)
Display a 1bpp bitmap on a VMU screen.
int vmu_draw_lcd(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_write(maple_device_t *dev, uint16_t blocknum, const uint8_t *buffer)
Write a block to a memory card.
int vmu_block_read(maple_device_t *dev, uint16_t blocknum, uint8_t *buffer)
Read a block from a memory card.
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_toggle_241_blocks(maple_device_t *dev, bool enable)
Enable the extra 41 blocks of a VMU.
int vmu_use_custom_color(maple_device_t *dev, bool enable)
Enable 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_has_241_blocks(maple_device_t *dev)
Get the status of a VMUs extra 41 blocks.
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_get_icon_shape(maple_device_t *dev, uint8_t *icon_shape)
Get icon shape of a VMU.
Maple Bus driver interface.
static char buffer[256]
Definition porthelper.c:11
Macros to help dealing with register fields.
One maple device.
Definition maple.h:289
"Civilized" structure containing VMU's current state.
Definition vmu.h:583
vmu_buttons_t previous
Button states from the previous frame.
Definition vmu.h:586
vmu_buttons_t current
Button states from the current frame.
Definition vmu.h:585
KOS-implementation of select C11 and POSIX extensions.
Represents the combined state of all VMU buttons.
Definition vmu.h:563
uint8_t mode
Mode button state.
Definition vmu.h:572
uint8_t b
'B' button state
Definition vmu.h:571
uint8_t dpad_down
Dpad Down button state.
Definition vmu.h:567
uint8_t dpad_up
Dpad Up button state.
Definition vmu.h:566
uint8_t a
'A' button state
Definition vmu.h:570
uint8_t raw
Combined button state mask.
Definition vmu.h:564
uint8_t dpad_right
Dpad Right button state.
Definition vmu.h:569
uint8_t dpad_left
Dpad Left button state.
Definition vmu.h:568
uint8_t sleep
Sleep button state.
Definition vmu.h:573
static unsigned char vmu_icon[ICON_SIZE *NB_ICONS_MAX]
Definition vmu.c:111