|
61 | 61 | #define NETRETROPAD_SCREEN_KEYBOARD 1 |
62 | 62 | #define NETRETROPAD_SCREEN_SENSORS 2 |
63 | 63 | #define EVENT_RATE 60 |
| 64 | +#define POINTER_IDLE_MAX EVENT_RATE*2 |
64 | 65 | #define NETRETROPAD_MOUSE 3 |
65 | 66 | #define NETRETROPAD_POINTER 4 |
66 | 67 | #define NETRETROPAD_LIGHTGUN 5 |
@@ -101,6 +102,7 @@ static int pointer_y = 0; |
101 | 102 | static unsigned pointer_prev_x = 0; |
102 | 103 | static unsigned pointer_prev_y = 0; |
103 | 104 | static unsigned pointer_prev_color = 0; |
| 105 | +static unsigned pointer_idle = 0; |
104 | 106 |
|
105 | 107 | static int s; |
106 | 108 | static int port; |
@@ -536,7 +538,6 @@ void NETRETROPAD_CORE_PREFIX(retro_init)(void) |
536 | 538 |
|
537 | 539 | NETRETROPAD_CORE_PREFIX(log_cb)(RETRO_LOG_INFO, "Initialising sockets...\n"); |
538 | 540 | network_init(); |
539 | | - |
540 | 541 | } |
541 | 542 |
|
542 | 543 | void NETRETROPAD_CORE_PREFIX(retro_deinit)(void) |
@@ -833,6 +834,7 @@ static void netretropad_check_variables(void) |
833 | 834 | || (current_screen == NETRETROPAD_SCREEN_KEYBOARD && strstr(screen_var.value,"Keyboard")) |
834 | 835 | || (current_screen == NETRETROPAD_SCREEN_SENSORS && strstr(screen_var.value,"Sensor")))) |
835 | 836 | flip_screen(); |
| 837 | + |
836 | 838 | if (hide_a_var.value && strstr(hide_a_var.value,"True")) |
837 | 839 | hide_analog_mismatch = true; |
838 | 840 | else |
@@ -1350,8 +1352,6 @@ void NETRETROPAD_CORE_PREFIX(retro_run)(void) |
1350 | 1352 | } |
1351 | 1353 | else if (current_screen == NETRETROPAD_SCREEN_SENSORS) |
1352 | 1354 | { |
1353 | | - unsigned pointer_x_coord = get_pixel_coordinate(pointer_x, 320); |
1354 | | - unsigned pointer_y_coord = get_pixel_coordinate(pointer_y, 240); |
1355 | 1355 |
|
1356 | 1356 | for (rle = 0; rle < ARRAY_SIZE(sensor_buttons); ) |
1357 | 1357 | { |
@@ -1381,18 +1381,30 @@ void NETRETROPAD_CORE_PREFIX(retro_run)(void) |
1381 | 1381 |
|
1382 | 1382 | pixel += 65; |
1383 | 1383 | } |
| 1384 | + } |
| 1385 | + |
| 1386 | + if (mouse_type) |
| 1387 | + { |
| 1388 | + unsigned pointer_x_coord = get_pixel_coordinate(pointer_x, 320); |
| 1389 | + unsigned pointer_y_coord = get_pixel_coordinate(pointer_y, 240); |
1384 | 1390 |
|
1385 | | - if(pointer_x_coord != pointer_prev_x || pointer_y_coord != pointer_prev_y) |
| 1391 | + set_pixel(pointer_prev_x, pointer_prev_y, pointer_prev_color); |
| 1392 | + |
| 1393 | + if (pointer_x_coord != pointer_prev_x || pointer_y_coord != pointer_prev_y) |
1386 | 1394 | { |
1387 | | - set_pixel(pointer_prev_x, pointer_prev_y, pointer_prev_color); |
1388 | | - pointer_prev_color = set_pixel(pointer_x_coord, pointer_y_coord, 0xffff); |
| 1395 | + pointer_prev_color = set_pixel(pointer_x_coord, pointer_y_coord, 0xbff7); |
1389 | 1396 | pointer_prev_x = pointer_x_coord; |
1390 | 1397 | pointer_prev_y = pointer_y_coord; |
| 1398 | + pointer_idle = 0; |
| 1399 | + } |
| 1400 | + else if (pointer_idle <= POINTER_IDLE_MAX) |
| 1401 | + { |
| 1402 | + pointer_prev_color = set_pixel(pointer_x_coord, pointer_y_coord, (pointer_idle > POINTER_IDLE_MAX / 2) ? 0xA000 : 0xbff7); |
| 1403 | + pointer_idle++; |
1391 | 1404 | } |
1392 | 1405 | } |
1393 | 1406 |
|
1394 | 1407 | NETRETROPAD_CORE_PREFIX(video_cb)(frame_buf, 320, 240, 640); |
1395 | | - retro_sleep(4); |
1396 | 1408 | } |
1397 | 1409 |
|
1398 | 1410 | bool NETRETROPAD_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info) |
|
0 commit comments