Skip to content

Commit

Permalink
Clean cx16.h header (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlund authored Sep 16, 2024
1 parent 7769893 commit 046d4b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions mos-platform/cx16/cx16.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ enum : unsigned char {
#define JOY_SNES_PORT4 4

/// Status of SNES joystick populated by cx16_k_joystick_get();
struct JoyState {
typedef struct {
union {
struct {
unsigned char data0; //!< Bits: B Y Select Start Up Down Left Right
Expand Down Expand Up @@ -176,7 +176,7 @@ struct JoyState {
}
bool south_west() const { return !(data0 & (JOY_DOWN_MASK | JOY_LEFT_MASK)); }
#endif
};
} JoyState;

/* Additional mouse button mask */
#define MOUSE_BTN_MIDDLE 0x02
Expand All @@ -185,7 +185,7 @@ struct JoyState {
** set_tv() argument codes
** NOTE: llvm-mos-sdk added newer 240P modes
*/
enum {
enum : unsigned char {
TV_NONE = 0x00,
TV_VGA,
TV_NTSC_COLOR,
Expand Down Expand Up @@ -218,7 +218,7 @@ enum {
#define VIDEOMODE_SWAP (-1)

/* VERA's address increment/decrement numbers */
enum {
enum : unsigned char {
VERA_DEC_0 = ((0 << 1) | 1) << 3,
VERA_DEC_1 = ((1 << 1) | 1) << 3,
VERA_DEC_2 = ((2 << 1) | 1) << 3,
Expand Down Expand Up @@ -479,7 +479,7 @@ int cx16_k_i2c_write_byte(unsigned char device, unsigned char offset, unsigned c
* @param joystick_num Keyboard joystick (0) or SNES controllers (1-4).
* @returns Struct with current status.
*/
struct JoyState cx16_k_joystick_get(unsigned char joystick_num);
JoyState cx16_k_joystick_get(unsigned char joystick_num);

void cx16_k_joystick_scan(void) __attribute__((leaf));
unsigned char cx16_k_kbdbuf_get_modifiers(void) __attribute__((leaf));
Expand Down
4 changes: 2 additions & 2 deletions mos-platform/cx16/cx16_k_joystick_get.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <cx16.h>

struct JoyState cx16_k_joystick_get(const unsigned char joystick_num) {
struct JoyState s;
JoyState cx16_k_joystick_get(const unsigned char joystick_num) {
JoyState s;
__attribute__((leaf)) asm volatile(
"jsr __JOYSTICK_GET\n"
: /* output */ "=a"(s.data0), "=x"(s.data1), "=y"(s.detached)
Expand Down

0 comments on commit 046d4b0

Please sign in to comment.