Mercurial > repos > blastem
comparison io.c @ 499:27345a67225d
Merge
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 29 Oct 2013 00:03:11 -0700 |
parents | 36c080ece4ed |
children | 7b0df1aaf384 |
comparison
equal
deleted
inserted
replaced
498:51bf87f76d15 | 499:27345a67225d |
---|---|
143 } | 143 } |
144 | 144 |
145 void bind_ui(int keycode, ui_action action, uint8_t param) | 145 void bind_ui(int keycode, ui_action action, uint8_t param) |
146 { | 146 { |
147 bind_key(keycode, BIND_UI, action, 0, param); | 147 bind_key(keycode, BIND_UI, action, 0, param); |
148 } | |
149 | |
150 void bind_button_ui(int joystick, int joybutton, ui_action action, uint8_t param) | |
151 { | |
152 bind_button(joystick, joybutton, BIND_UI, action, 0, param); | |
153 } | |
154 | |
155 void bind_dpad_ui(int joystick, int dpad, uint8_t direction, ui_action action, uint8_t param) | |
156 { | |
157 bind_dpad(joystick, dpad, direction, BIND_UI, action, 0, param); | |
148 } | 158 } |
149 | 159 |
150 void handle_binding_down(keybinding * binding) | 160 void handle_binding_down(keybinding * binding) |
151 { | 161 { |
152 switch(binding->bind_type) | 162 switch(binding->bind_type) |
485 if (target) { | 495 if (target) { |
486 int ui_func, padnum, button; | 496 int ui_func, padnum, button; |
487 int bindtype = parse_binding_target(target, padbuttons, &ui_func, &padnum, &button); | 497 int bindtype = parse_binding_target(target, padbuttons, &ui_func, &padnum, &button); |
488 if (bindtype == 1) { | 498 if (bindtype == 1) { |
489 bind_dpad_gamepad(i, dpad, dirnums[dir], padnum, button); | 499 bind_dpad_gamepad(i, dpad, dirnums[dir], padnum, button); |
500 } else if (bindtype == 2) { | |
501 bind_dpad_ui(i, dpad, dirnums[dir], ui_func, button); | |
490 } | 502 } |
491 //TODO: Handle UI bindings | |
492 } | 503 } |
493 } | 504 } |
494 } | 505 } |
495 char bprefix[] = "buttons00"; | 506 char bprefix[] = "buttons00"; |
496 for (int but = 0; but < 100 && but < render_joystick_num_buttons(i); but++) | 507 for (int but = 0; but < 100 && but < render_joystick_num_buttons(i); but++) |
506 if (target) { | 517 if (target) { |
507 int ui_func, padnum, button; | 518 int ui_func, padnum, button; |
508 int bindtype = parse_binding_target(target, padbuttons, &ui_func, &padnum, &button); | 519 int bindtype = parse_binding_target(target, padbuttons, &ui_func, &padnum, &button); |
509 if (bindtype == 1) { | 520 if (bindtype == 1) { |
510 bind_button_gamepad(i, but, padnum, button); | 521 bind_button_gamepad(i, but, padnum, button); |
522 } else if (bindtype == 2) { | |
523 bind_button_ui(i, but, ui_func, button); | |
511 } | 524 } |
512 //TODO: Handle UI bindings | |
513 } | 525 } |
514 } | 526 } |
515 } | 527 } |
516 } | 528 } |
517 tern_node * speed_nodes = tern_find_prefix(config, "clocksspeeds"); | 529 tern_node * speed_nodes = tern_find_prefix(config, "clocksspeeds"); |