llvm-mos-sdk
joypad.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 Adrian "asie" Siekierka
3  *
4  * Licensed under the Apache License, Version 2.0 with LLVM Exceptions,
5  * See https://github.com/llvm-mos/llvm-mos-sdk/blob/main/LICENSE for license
6  * information.
7  */
8 
9 #ifndef _PCE_JOYPAD_H_
10 #define _PCE_JOYPAD_H_
11 
12 #include <stdbool.h>
13 #include <stdint.h>
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
23 #define KEY_LEFT 0x80
24 #define KEY_DOWN 0x40
25 #define KEY_RIGHT 0x20
26 #define KEY_UP 0x10
27 #define KEY_RUN 0x08
28 #define KEY_SELECT 0x04
29 #define KEY_2 0x02
30 #define KEY_1 0x01
31 
39 
46 
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 #endif /* _PCE_JOYPAD_H_ */
std::uint8_t
::uint8_t uint8_t
Definition: cstdint:21
pce_joypad_read
uint8_t pce_joypad_read(void)
Read the first joypad controller's pressed buttons.
pce_joypad_next
uint8_t pce_joypad_next(void)
Read the next joypad controller's pressed buttons.
pce_joypad_wr
uint8_t pce_joypad_wr(uint8_t value)
Write a value to the joypad I/O port, then read the result.