Mercurial > repos > blastem
annotate bindings.h @ 2688:b42f00a3a937 default tip
Fix default target. Ensure m68k.h and z80.h are built before anything else when no dep info is available
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 31 Mar 2025 21:06:18 -0700 |
parents | 99297d5f4c5d |
children |
rev | line source |
---|---|
1583
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #ifndef BINDINGS_H_ |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #define BINDINGS_H_ |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 #include <stdint.h> |
2317
e836cf11783b
Make deadzones configurable and bump up the default value
Michael Pavone <pavone@retrodev.com>
parents:
2314
diff
changeset
|
4 #include "controller_info.h" |
1583
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 typedef enum { |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 MOUSE_NONE, //mouse is ignored |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 MOUSE_ABSOLUTE, //really only useful for menu ROM |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 MOUSE_RELATIVE, //for full screen |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 MOUSE_CAPTURE //for windowed mode |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 } mouse_modes; |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 void set_bindings(void); |
2314
59fd8aa352e2
Apply binding changes after a config change in UI
Michael Pavone <pavone@retrodev.com>
parents:
2181
diff
changeset
|
14 void update_pad_bindings(void); |
1583
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 void bindings_set_mouse_mode(uint8_t mode); |
2317
e836cf11783b
Make deadzones configurable and bump up the default value
Michael Pavone <pavone@retrodev.com>
parents:
2314
diff
changeset
|
16 tern_node *get_binding_node_for_pad(int padnum, controller_info *info); |
1583
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 void handle_keydown(int keycode, uint8_t scancode); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 void handle_keyup(int keycode, uint8_t scancode); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 void handle_joydown(int joystick, int button); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 void handle_joyup(int joystick, int button); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 void handle_joy_dpad(int joystick, int dpad, uint8_t state); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 void handle_joy_axis(int joystick, int axis, int16_t value); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 void handle_joy_added(int joystick); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 void handle_mouse_moved(int mouse, uint16_t x, uint16_t y, int16_t deltax, int16_t deltay); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 void handle_mousedown(int mouse, int button); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 void handle_mouseup(int mouse, int button); |
2181
0c723b8b637c
Add bindup and binddown debugger commands
Michael Pavone <pavone@retrodev.com>
parents:
1672
diff
changeset
|
27 uint8_t bind_up(const char *target); |
0c723b8b637c
Add bindup and binddown debugger commands
Michael Pavone <pavone@retrodev.com>
parents:
1672
diff
changeset
|
28 uint8_t bind_down(const char *target); |
1583
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 void bindings_release_capture(void); |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
31 void bindings_reacquire_capture(void); |
1672
12d0c7c4ad80
Disable most bindings when UI is active
Michael Pavone <pavone@retrodev.com>
parents:
1623
diff
changeset
|
32 void set_content_binding_state(uint8_t enabled); |
2658
99297d5f4c5d
Persist save states and config in emscripten build via IDBFS module
Michael Pavone <pavone@retrodev.com>
parents:
2627
diff
changeset
|
33 uint8_t get_content_binding_state(void); |
2627
df6dbf229e2f
Prevent gamepad binds from firing while remapping a gamepad
Michael Pavone <pavone@retrodev.com>
parents:
2317
diff
changeset
|
34 void bindings_set_joy_state(int joystick, uint8_t enabled); |
1583
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 |
430dd12e4010
Refactor to split device bindings from IO emulation code
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 #endif //BINDINGS_H_ |