From 017418ab920a1e5cb50a2fc299928e40c8f4c636 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 20 Feb 2024 22:47:08 +0100 Subject: [PATCH 01/46] No Insert Coin menu entry for MESS --- advance/osd/glue.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/advance/osd/glue.c b/advance/osd/glue.c index 0a6e6303..58f18cfe 100644 --- a/advance/osd/glue.c +++ b/advance/osd/glue.c @@ -2660,7 +2660,11 @@ static int on_exit_menu(int selected) total = 0; +#ifdef MESS + exit_menu[total].text = "Continue"; +#else exit_menu[total].text = "Insert Coin"; +#endif exit_menu[total].subtext = 0; exit_menu[total].flags = 0; ++total; @@ -2706,7 +2710,9 @@ static int on_exit_menu(int selected) } if (key0 != 0) { sel = -1; +#ifndef MESS advance_input_simulate_key(context, key0, 0, 10); +#endif } } From 27572e04c335267ea254186c5c0c116960360689 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 26 Feb 2024 22:33:44 +0100 Subject: [PATCH 02/46] Minor changes to blue daemon --- advance/blue/blue.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/advance/blue/blue.c b/advance/blue/blue.c index 115f5abd..e4eb969c 100644 --- a/advance/blue/blue.c +++ b/advance/blue/blue.c @@ -42,7 +42,7 @@ int opt_verbose; /** Verbose output */ /** * Backlog */ -#define BACKLOG_LINES 16 +#define BACKLOG_LINES 256 #define BACKLOG_MAX 128 char backlog[BACKLOG_LINES][BACKLOG_MAX]; @@ -68,6 +68,10 @@ void backlog_print(void) for (i = backlog_begin; i != backlog_end; i = (i + 1) % BACKLOG_LINES) { printf(": %s\n", backlog[i]); } + + /* clear backlog */ + backlog_begin = 0; + backlog_end = 0; } /** @@ -175,7 +179,7 @@ void blue_send(int f, const char* command) printf("# %s", command); /* give some time to process the command */ - usleep(500); + usleep(100000); } struct blue_device { @@ -350,20 +354,27 @@ void process_connect(int in_f, int out_f) struct blue_device* i = devs; char processing[4096]; char connected[4096]; + char ignored[128]; unsigned count_processing; unsigned count_connected; + unsigned count_ignored; count_processing = 0; count_connected = 0; + count_ignored = 0; processing[0] = 0; connected[0] = 0; + ignored[0] = 0; for (i = devs; i != 0; i = i->next) { char cmd[128]; const char* name = i->name[0] ? i->name : i->id; - if (!i->is_game) + if (!i->is_game) { + snprintf(ignored, sizeof(ignored) - 1, "%s", name); + ++count_ignored; continue; + } if (!i->is_trusted) { snprintf(cmd, sizeof(cmd), "trust %s\n", i->id); @@ -415,9 +426,15 @@ void process_connect(int in_f, int out_f) else if (count_connected > 1) snprintfcat(processing, sizeof(processing), "Connected %u devices", count_connected); } else { - if (count_connected == 0) - strcpy(processing, "Press START for one second to power on"); - else if (count_connected > 1) + if (count_connected == 0) { + if (count_ignored == 0) { + strcpy(processing, "Scanning for devices..."); + } else if (count_ignored == 1) { + snprintf(processing, sizeof(processing), "Scanning... (%s ignored)", ignored); + } else { + snprintf(processing, sizeof(processing), "Scanning... (%u ignored)", count_ignored); + } + } else if (count_connected > 1) snprintf(processing, sizeof(processing), "Connected %u devices", count_connected); else strcpy(processing, connected); From 24d54a52f43c27aefbc431532b6aa54e45bfe793 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 28 Feb 2024 18:29:46 +0100 Subject: [PATCH 03/46] Update joystick definition from libretro --- advance/linux/joverride.dat | 1956 ++++++++++++++++++++++++++++++----- advance/linux/joverride.py | 26 +- 2 files changed, 1719 insertions(+), 263 deletions(-) diff --git a/advance/linux/joverride.dat b/advance/linux/joverride.dat index 98b4d72d..39c4d07e 100644 --- a/advance/linux/joverride.dat +++ b/advance/linux/joverride.dat @@ -1,3 +1,198 @@ + /* 3H Dual Arcade 3H Dual Arcade */ + { 0x16c0, 0x75e1, "3H Dual Arcade 3H Dual Arcade", 0, "a", JOYB_A }, + { 0x16c0, 0x75e1, "3H Dual Arcade 3H Dual Arcade", 1, "b", JOYB_B }, + { 0x16c0, 0x75e1, "3H Dual Arcade 3H Dual Arcade", 2, "x", JOYB_X }, + { 0x16c0, 0x75e1, "3H Dual Arcade 3H Dual Arcade", 3, "y", JOYB_Y }, + { 0x16c0, 0x75e1, "3H Dual Arcade 3H Dual Arcade", 8, "tl", JOYB_TL }, + { 0x16c0, 0x75e1, "3H Dual Arcade 3H Dual Arcade", 9, "tr", JOYB_TR }, + { 0x16c0, 0x75e1, "3H Dual Arcade 3H Dual Arcade", 5, "tl2", JOYB_TL2 }, + { 0x16c0, 0x75e1, "3H Dual Arcade 3H Dual Arcade", 6, "tr2", JOYB_TR2 }, + { 0x16c0, 0x75e1, "3H Dual Arcade 3H Dual Arcade", 4, "select", JOYB_SELECT }, + { 0x16c0, 0x75e1, "3H Dual Arcade 3H Dual Arcade", 7, "start", JOYB_START }, + /* 8BitDo M30 gamepad */ + { 0x2dc8, 0x5006, "8BitDo M30 gamepad", 1, "a", JOYB_A }, + { 0x2dc8, 0x5006, "8BitDo M30 gamepad", 0, "b", JOYB_B }, + { 0x2dc8, 0x5006, "8BitDo M30 gamepad", 4, "x", JOYB_X }, + { 0x2dc8, 0x5006, "8BitDo M30 gamepad", 3, "y", JOYB_Y }, + { 0x2dc8, 0x5006, "8BitDo M30 gamepad", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x5006, "8BitDo M30 gamepad", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x5006, "8BitDo M30 gamepad", 8, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x5006, "8BitDo M30 gamepad", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x5006, "8BitDo M30 gamepad", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x5006, "8BitDo M30 gamepad", 11, "start", JOYB_START }, + { 0x2dc8, 0x5006, "8BitDo M30 gamepad", 2, "mode", JOYB_MODE }, + /* 8BitDo M30 gamepad */ + { 0x2dc8, 0x0651, "8BitDo M30 gamepad", 1, "a", JOYB_A }, + { 0x2dc8, 0x0651, "8BitDo M30 gamepad", 0, "b", JOYB_B }, + { 0x2dc8, 0x0651, "8BitDo M30 gamepad", 4, "x", JOYB_X }, + { 0x2dc8, 0x0651, "8BitDo M30 gamepad", 3, "y", JOYB_Y }, + { 0x2dc8, 0x0651, "8BitDo M30 gamepad", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x0651, "8BitDo M30 gamepad", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x0651, "8BitDo M30 gamepad", 8, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x0651, "8BitDo M30 gamepad", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x0651, "8BitDo M30 gamepad", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x0651, "8BitDo M30 gamepad", 11, "start", JOYB_START }, + { 0x2dc8, 0x0651, "8BitDo M30 gamepad", 2, "mode", JOYB_MODE }, + /* 8BitDo M30 gamepad */ + { 0x045e, 0x02e0, "8BitDo M30 gamepad", 1, "a", JOYB_A }, + { 0x045e, 0x02e0, "8BitDo M30 gamepad", 0, "b", JOYB_B }, + { 0x045e, 0x02e0, "8BitDo M30 gamepad", 3, "x", JOYB_X }, + { 0x045e, 0x02e0, "8BitDo M30 gamepad", 2, "y", JOYB_Y }, + { 0x045e, 0x02e0, "8BitDo M30 gamepad", 5, "tl", JOYB_TL }, + { 0x045e, 0x02e0, "8BitDo M30 gamepad", 4, "tl2", JOYB_TL2 }, + { 0x045e, 0x02e0, "8BitDo M30 gamepad", 6, "select", JOYB_SELECT }, + { 0x045e, 0x02e0, "8BitDo M30 gamepad", 7, "start", JOYB_START }, + { 0x045e, 0x02e0, "8BitDo M30 gamepad", 10, "mode", JOYB_MODE }, + /* JJ */ + { 0x2dc8, 0x9026, "JJ", 1, "a", JOYB_A }, + { 0x2dc8, 0x9026, "JJ", 0, "b", JOYB_B }, + { 0x2dc8, 0x9026, "JJ", 4, "x", JOYB_X }, + { 0x2dc8, 0x9026, "JJ", 3, "y", JOYB_Y }, + { 0x2dc8, 0x9026, "JJ", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x9026, "JJ", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x9026, "JJ", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x9026, "JJ", 11, "start", JOYB_START }, + /* 8BitDo NEOGEO GP */ + { 0x2dc8, 0x9025, "8BitDo NEOGEO GP", 1, "a", JOYB_A }, + { 0x2dc8, 0x9025, "8BitDo NEOGEO GP", 0, "b", JOYB_B }, + { 0x2dc8, 0x9025, "8BitDo NEOGEO GP", 4, "x", JOYB_X }, + { 0x2dc8, 0x9025, "8BitDo NEOGEO GP", 3, "y", JOYB_Y }, + { 0x2dc8, 0x9025, "8BitDo NEOGEO GP", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x9025, "8BitDo NEOGEO GP", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x9025, "8BitDo NEOGEO GP", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x9025, "8BitDo NEOGEO GP", 11, "start", JOYB_START }, + /* 8BitDo Pro 2 */ + { 0x045e, 0x02e0, "8BitDo Pro 2", 1, "a", JOYB_A }, + { 0x045e, 0x02e0, "8BitDo Pro 2", 0, "b", JOYB_B }, + { 0x045e, 0x02e0, "8BitDo Pro 2", 3, "x", JOYB_X }, + { 0x045e, 0x02e0, "8BitDo Pro 2", 2, "y", JOYB_Y }, + { 0x045e, 0x02e0, "8BitDo Pro 2", 4, "tl", JOYB_TL }, + { 0x045e, 0x02e0, "8BitDo Pro 2", 5, "tr", JOYB_TR }, + { 0x045e, 0x02e0, "8BitDo Pro 2", 6, "select", JOYB_SELECT }, + { 0x045e, 0x02e0, "8BitDo Pro 2", 7, "start", JOYB_START }, + { 0x045e, 0x02e0, "8BitDo Pro 2", 10, "mode", JOYB_MODE }, + /* 8BitDo N30 Pro 2 */ + { 0x2dc8, 0x2865, "8BitDo N30 Pro 2", 0, "a", JOYB_A }, + { 0x2dc8, 0x2865, "8BitDo N30 Pro 2", 1, "b", JOYB_B }, + { 0x2dc8, 0x2865, "8BitDo N30 Pro 2", 3, "x", JOYB_X }, + { 0x2dc8, 0x2865, "8BitDo N30 Pro 2", 4, "y", JOYB_Y }, + { 0x2dc8, 0x2865, "8BitDo N30 Pro 2", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x2865, "8BitDo N30 Pro 2", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x2865, "8BitDo N30 Pro 2", 8, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x2865, "8BitDo N30 Pro 2", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x2865, "8BitDo N30 Pro 2", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x2865, "8BitDo N30 Pro 2", 11, "start", JOYB_START }, + /* 8Bitdo N30 Pro 2 */ + { 0x2dc8, 0x9015, "8Bitdo N30 Pro 2", 0, "a", JOYB_A }, + { 0x2dc8, 0x9015, "8Bitdo N30 Pro 2", 1, "b", JOYB_B }, + { 0x2dc8, 0x9015, "8Bitdo N30 Pro 2", 3, "x", JOYB_X }, + { 0x2dc8, 0x9015, "8Bitdo N30 Pro 2", 4, "y", JOYB_Y }, + { 0x2dc8, 0x9015, "8Bitdo N30 Pro 2", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x9015, "8Bitdo N30 Pro 2", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x9015, "8Bitdo N30 Pro 2", 8, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x9015, "8Bitdo N30 Pro 2", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x9015, "8Bitdo N30 Pro 2", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x9015, "8Bitdo N30 Pro 2", 11, "start", JOYB_START }, + /* 8Bitdo NES30 Pro 8Bitdo NES30 Pro */ + { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 0, "a", JOYB_A }, + { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 1, "b", JOYB_B }, + { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 3, "x", JOYB_X }, + { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 4, "y", JOYB_Y }, + { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 8, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 11, "start", JOYB_START }, + /* 8BitDo SN30 Pro+ */ + { 0x2dc8, 0x6102, "8BitDo SN30 Pro+", 0, "a", JOYB_A }, + { 0x2dc8, 0x6102, "8BitDo SN30 Pro+", 1, "b", JOYB_B }, + { 0x2dc8, 0x6102, "8BitDo SN30 Pro+", 3, "x", JOYB_X }, + { 0x2dc8, 0x6102, "8BitDo SN30 Pro+", 4, "y", JOYB_Y }, + { 0x2dc8, 0x6102, "8BitDo SN30 Pro+", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x6102, "8BitDo SN30 Pro+", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x6102, "8BitDo SN30 Pro+", 8, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x6102, "8BitDo SN30 Pro+", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x6102, "8BitDo SN30 Pro+", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x6102, "8BitDo SN30 Pro+", 11, "start", JOYB_START }, + { 0x2dc8, 0x6102, "8BitDo SN30 Pro+", 2, "mode", JOYB_MODE }, + /* 8BitDo SN30 Pro+ */ + { 0x045e, 0x02e0, "8BitDo SN30 Pro+", 1, "a", JOYB_A }, + { 0x045e, 0x02e0, "8BitDo SN30 Pro+", 0, "b", JOYB_B }, + { 0x045e, 0x02e0, "8BitDo SN30 Pro+", 3, "x", JOYB_X }, + { 0x045e, 0x02e0, "8BitDo SN30 Pro+", 2, "y", JOYB_Y }, + { 0x045e, 0x02e0, "8BitDo SN30 Pro+", 4, "tl", JOYB_TL }, + { 0x045e, 0x02e0, "8BitDo SN30 Pro+", 5, "tr", JOYB_TR }, + { 0x045e, 0x02e0, "8BitDo SN30 Pro+", 6, "select", JOYB_SELECT }, + { 0x045e, 0x02e0, "8BitDo SN30 Pro+", 7, "start", JOYB_START }, + { 0x045e, 0x02e0, "8BitDo SN30 Pro+", 10, "mode", JOYB_MODE }, + /* 8BitDo SN30 Pro+ */ + { 0x2dc8, 0x6002, "8BitDo SN30 Pro+", 0, "a", JOYB_A }, + { 0x2dc8, 0x6002, "8BitDo SN30 Pro+", 1, "b", JOYB_B }, + { 0x2dc8, 0x6002, "8BitDo SN30 Pro+", 3, "x", JOYB_X }, + { 0x2dc8, 0x6002, "8BitDo SN30 Pro+", 4, "y", JOYB_Y }, + { 0x2dc8, 0x6002, "8BitDo SN30 Pro+", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x6002, "8BitDo SN30 Pro+", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x6002, "8BitDo SN30 Pro+", 8, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x6002, "8BitDo SN30 Pro+", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x6002, "8BitDo SN30 Pro+", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x6002, "8BitDo SN30 Pro+", 11, "start", JOYB_START }, + { 0x2dc8, 0x6002, "8BitDo SN30 Pro+", 2, "mode", JOYB_MODE }, + /* 8BitDo Ultimate C Wired Controller */ + { 0x2dc8, 0x3106, "8BitDo Ultimate C Wired Controller ", 1, "a", JOYB_A }, + { 0x2dc8, 0x3106, "8BitDo Ultimate C Wired Controller ", 0, "b", JOYB_B }, + { 0x2dc8, 0x3106, "8BitDo Ultimate C Wired Controller ", 3, "x", JOYB_X }, + { 0x2dc8, 0x3106, "8BitDo Ultimate C Wired Controller ", 2, "y", JOYB_Y }, + { 0x2dc8, 0x3106, "8BitDo Ultimate C Wired Controller ", 4, "tl", JOYB_TL }, + { 0x2dc8, 0x3106, "8BitDo Ultimate C Wired Controller ", 5, "tr", JOYB_TR }, + { 0x2dc8, 0x3106, "8BitDo Ultimate C Wired Controller ", 6, "select", JOYB_SELECT }, + { 0x2dc8, 0x3106, "8BitDo Ultimate C Wired Controller ", 7, "start", JOYB_START }, + { 0x2dc8, 0x3106, "8BitDo Ultimate C Wired Controller ", 8, "mode", JOYB_MODE }, + /* 8BitDo Ultimate C Wired Controller */ + { 0x2dc8, 0x3017, "8BitDo Ultimate C Wired Controller ", 1, "a", JOYB_A }, + { 0x2dc8, 0x3017, "8BitDo Ultimate C Wired Controller ", 0, "b", JOYB_B }, + { 0x2dc8, 0x3017, "8BitDo Ultimate C Wired Controller ", 4, "x", JOYB_X }, + { 0x2dc8, 0x3017, "8BitDo Ultimate C Wired Controller ", 3, "y", JOYB_Y }, + { 0x2dc8, 0x3017, "8BitDo Ultimate C Wired Controller ", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x3017, "8BitDo Ultimate C Wired Controller ", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x3017, "8BitDo Ultimate C Wired Controller ", 10, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x3017, "8BitDo Ultimate C Wired Controller ", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x3017, "8BitDo Ultimate C Wired Controller ", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x3017, "8BitDo Ultimate C Wired Controller ", 11, "start", JOYB_START }, + { 0x2dc8, 0x3017, "8BitDo Ultimate C Wired Controller ", 12, "mode", JOYB_MODE }, + /* 8BitDo 8BitDo Ultimate Wired Controller */ + { 0x2dc8, 0x3011, "8BitDo 8BitDo Ultimate Wired Controller", 1, "a", JOYB_A }, + { 0x2dc8, 0x3011, "8BitDo 8BitDo Ultimate Wired Controller", 0, "b", JOYB_B }, + { 0x2dc8, 0x3011, "8BitDo 8BitDo Ultimate Wired Controller", 4, "x", JOYB_X }, + { 0x2dc8, 0x3011, "8BitDo 8BitDo Ultimate Wired Controller", 3, "y", JOYB_Y }, + { 0x2dc8, 0x3011, "8BitDo 8BitDo Ultimate Wired Controller", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x3011, "8BitDo 8BitDo Ultimate Wired Controller", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x3011, "8BitDo 8BitDo Ultimate Wired Controller", 8, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x3011, "8BitDo 8BitDo Ultimate Wired Controller", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x3011, "8BitDo 8BitDo Ultimate Wired Controller", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x3011, "8BitDo 8BitDo Ultimate Wired Controller", 11, "start", JOYB_START }, + { 0x2dc8, 0x3011, "8BitDo 8BitDo Ultimate Wired Controller", 12, "mode", JOYB_MODE }, + /* 8BitDoUltimate wireless Controller for PC */ + { 0x2dc8, 0x3013, "8BitDoUltimate wireless Controller for PC", 1, "a", JOYB_A }, + { 0x2dc8, 0x3013, "8BitDoUltimate wireless Controller for PC", 0, "b", JOYB_B }, + { 0x2dc8, 0x3013, "8BitDoUltimate wireless Controller for PC", 4, "x", JOYB_X }, + { 0x2dc8, 0x3013, "8BitDoUltimate wireless Controller for PC", 3, "y", JOYB_Y }, + { 0x2dc8, 0x3013, "8BitDoUltimate wireless Controller for PC", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x3013, "8BitDoUltimate wireless Controller for PC", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x3013, "8BitDoUltimate wireless Controller for PC", 8, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x3013, "8BitDoUltimate wireless Controller for PC", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x3013, "8BitDoUltimate wireless Controller for PC", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x3013, "8BitDoUltimate wireless Controller for PC", 11, "start", JOYB_START }, + { 0x2dc8, 0x3013, "8BitDoUltimate wireless Controller for PC", 12, "mode", JOYB_MODE }, + /* 8BitDo Zero 2 gamepad */ + { 0x2dc8, 0x3230, "8BitDo Zero 2 gamepad", 0, "a", JOYB_A }, + { 0x2dc8, 0x3230, "8BitDo Zero 2 gamepad", 1, "b", JOYB_B }, + { 0x2dc8, 0x3230, "8BitDo Zero 2 gamepad", 3, "x", JOYB_X }, + { 0x2dc8, 0x3230, "8BitDo Zero 2 gamepad", 4, "y", JOYB_Y }, + { 0x2dc8, 0x3230, "8BitDo Zero 2 gamepad", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x3230, "8BitDo Zero 2 gamepad", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x3230, "8BitDo Zero 2 gamepad", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x3230, "8BitDo Zero 2 gamepad", 11, "start", JOYB_START }, /* 8Bitdo 8Bitdo SF30 Wireless Controller */ { 0x2dc8, 0x3001, "8Bitdo 8Bitdo SF30 Wireless Controller", 0, "a", JOYB_A }, { 0x2dc8, 0x3001, "8Bitdo 8Bitdo SF30 Wireless Controller", 1, "b", JOYB_B }, @@ -105,6 +300,17 @@ { 0x2dc8, 0xab12, "NES30 NES30 Joystick", 7, "tr", JOYB_TR }, { 0x2dc8, 0xab12, "NES30 NES30 Joystick", 10, "select", JOYB_SELECT }, { 0x2dc8, 0xab12, "NES30 NES30 Joystick", 11, "start", JOYB_START }, + /* 8Bitdo P30 Modkit */ + { 0x2dc8, 0x5107, "8Bitdo P30 Modkit", 1, "a", JOYB_A }, + { 0x2dc8, 0x5107, "8Bitdo P30 Modkit", 0, "b", JOYB_B }, + { 0x2dc8, 0x5107, "8Bitdo P30 Modkit", 4, "x", JOYB_X }, + { 0x2dc8, 0x5107, "8Bitdo P30 Modkit", 3, "y", JOYB_Y }, + { 0x2dc8, 0x5107, "8Bitdo P30 Modkit", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x5107, "8Bitdo P30 Modkit", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x5107, "8Bitdo P30 Modkit", 8, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x5107, "8Bitdo P30 Modkit", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x5107, "8Bitdo P30 Modkit", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x5107, "8Bitdo P30 Modkit", 11, "start", JOYB_START }, /* 8Bitdo FC30 Pro */ { 0x2dc8, 0x3810, "8Bitdo FC30 Pro", 0, "a", JOYB_A }, { 0x2dc8, 0x3810, "8Bitdo FC30 Pro", 1, "b", JOYB_B }, @@ -138,17 +344,6 @@ { 0x2dc8, 0x3820, "8Bitdo NES30 Pro", 9, "tr2", JOYB_TR2 }, { 0x2dc8, 0x3820, "8Bitdo NES30 Pro", 10, "select", JOYB_SELECT }, { 0x2dc8, 0x3820, "8Bitdo NES30 Pro", 11, "start", JOYB_START }, - /* 8Bitdo NES30 Pro 8Bitdo NES30 Pro */ - { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 0, "a", JOYB_A }, - { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 1, "b", JOYB_B }, - { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 3, "x", JOYB_X }, - { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 4, "y", JOYB_Y }, - { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 6, "tl", JOYB_TL }, - { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 7, "tr", JOYB_TR }, - { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 8, "tl2", JOYB_TL2 }, - { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 9, "tr2", JOYB_TR2 }, - { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 10, "select", JOYB_SELECT }, - { 0x2dc8, 0x9001, "8Bitdo NES30 Pro 8Bitdo NES30 Pro", 11, "start", JOYB_START }, /* 8Bitdo SF30 Pro */ { 0x2dc8, 0x6100, "8Bitdo SF30 Pro", 0, "a", JOYB_A }, { 0x2dc8, 0x6100, "8Bitdo SF30 Pro", 1, "b", JOYB_B }, @@ -194,7 +389,17 @@ { 0x2dc8, 0x6101, "8Bitdo SN30 Pro", 9, "tr2", JOYB_TR2 }, { 0x2dc8, 0x6101, "8Bitdo SN30 Pro", 10, "select", JOYB_SELECT }, { 0x2dc8, 0x6101, "8Bitdo SN30 Pro", 11, "start", JOYB_START }, - { 0x2dc8, 0x6101, "8Bitdo SN30 Pro", 2, "mode", JOYB_MODE }, + { 0x2dc8, 0x6101, "8Bitdo SN30 Pro", 12, "mode", JOYB_MODE }, + /* 8Bitdo SN30 Pro */ + { 0x045e, 0x02e0, "8Bitdo SN30 Pro", 1, "a", JOYB_A }, + { 0x045e, 0x02e0, "8Bitdo SN30 Pro", 0, "b", JOYB_B }, + { 0x045e, 0x02e0, "8Bitdo SN30 Pro", 3, "x", JOYB_X }, + { 0x045e, 0x02e0, "8Bitdo SN30 Pro", 2, "y", JOYB_Y }, + { 0x045e, 0x02e0, "8Bitdo SN30 Pro", 4, "tl", JOYB_TL }, + { 0x045e, 0x02e0, "8Bitdo SN30 Pro", 5, "tr", JOYB_TR }, + { 0x045e, 0x02e0, "8Bitdo SN30 Pro", 6, "select", JOYB_SELECT }, + { 0x045e, 0x02e0, "8Bitdo SN30 Pro", 7, "start", JOYB_START }, + { 0x045e, 0x02e0, "8Bitdo SN30 Pro", 10, "mode", JOYB_MODE }, /* 8Bitdo SN30 Pro 8Bitdo SN30 Pro */ { 0x2dc8, 0x6001, "8Bitdo SN30 Pro 8Bitdo SN30 Pro", 0, "a", JOYB_A }, { 0x2dc8, 0x6001, "8Bitdo SN30 Pro 8Bitdo SN30 Pro", 1, "b", JOYB_B }, @@ -206,7 +411,18 @@ { 0x2dc8, 0x6001, "8Bitdo SN30 Pro 8Bitdo SN30 Pro", 9, "tr2", JOYB_TR2 }, { 0x2dc8, 0x6001, "8Bitdo SN30 Pro 8Bitdo SN30 Pro", 10, "select", JOYB_SELECT }, { 0x2dc8, 0x6001, "8Bitdo SN30 Pro 8Bitdo SN30 Pro", 11, "start", JOYB_START }, - { 0x2dc8, 0x6001, "8Bitdo SN30 Pro 8Bitdo SN30 Pro", 2, "mode", JOYB_MODE }, + { 0x2dc8, 0x6001, "8Bitdo SN30 Pro 8Bitdo SN30 Pro", 12, "mode", JOYB_MODE }, + /* 8BitDo S30 Modkit */ + { 0x2dc8, 0x6728, "8BitDo S30 Modkit", 1, "a", JOYB_A }, + { 0x2dc8, 0x6728, "8BitDo S30 Modkit", 0, "b", JOYB_B }, + { 0x2dc8, 0x6728, "8BitDo S30 Modkit", 4, "x", JOYB_X }, + { 0x2dc8, 0x6728, "8BitDo S30 Modkit", 3, "y", JOYB_Y }, + { 0x2dc8, 0x6728, "8BitDo S30 Modkit", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x6728, "8BitDo S30 Modkit", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x6728, "8BitDo S30 Modkit", 8, "tl2", JOYB_TL2 }, + { 0x2dc8, 0x6728, "8BitDo S30 Modkit", 9, "tr2", JOYB_TR2 }, + { 0x2dc8, 0x6728, "8BitDo S30 Modkit", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x6728, "8BitDo S30 Modkit", 11, "start", JOYB_START }, /* 8Bitdo SFC30 GamePad */ { 0x2dc8, 0x2830, "8Bitdo SFC30 GamePad", 0, "a", JOYB_A }, { 0x2dc8, 0x2830, "8Bitdo SFC30 GamePad", 1, "b", JOYB_B }, @@ -234,6 +450,24 @@ { 0x2dc8, 0x2840, "8Bitdo SNES30 GamePad", 7, "tr", JOYB_TR }, { 0x2dc8, 0x2840, "8Bitdo SNES30 GamePad", 10, "select", JOYB_SELECT }, { 0x2dc8, 0x2840, "8Bitdo SNES30 GamePad", 11, "start", JOYB_START }, + /* Bluetooth Wireless Controller */ + { 0x2dc8, 0x2862, "Bluetooth Wireless Controller ", 0, "a", JOYB_A }, + { 0x2dc8, 0x2862, "Bluetooth Wireless Controller ", 1, "b", JOYB_B }, + { 0x2dc8, 0x2862, "Bluetooth Wireless Controller ", 3, "x", JOYB_X }, + { 0x2dc8, 0x2862, "Bluetooth Wireless Controller ", 4, "y", JOYB_Y }, + { 0x2dc8, 0x2862, "Bluetooth Wireless Controller ", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x2862, "Bluetooth Wireless Controller ", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x2862, "Bluetooth Wireless Controller ", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x2862, "Bluetooth Wireless Controller ", 11, "start", JOYB_START }, + /* 8BitDo SN30 gamepad */ + { 0x2dc8, 0x9012, "8BitDo SN30 gamepad", 0, "a", JOYB_A }, + { 0x2dc8, 0x9012, "8BitDo SN30 gamepad", 1, "b", JOYB_B }, + { 0x2dc8, 0x9012, "8BitDo SN30 gamepad", 3, "x", JOYB_X }, + { 0x2dc8, 0x9012, "8BitDo SN30 gamepad", 4, "y", JOYB_Y }, + { 0x2dc8, 0x9012, "8BitDo SN30 gamepad", 6, "tl", JOYB_TL }, + { 0x2dc8, 0x9012, "8BitDo SN30 gamepad", 7, "tr", JOYB_TR }, + { 0x2dc8, 0x9012, "8BitDo SN30 gamepad", 10, "select", JOYB_SELECT }, + { 0x2dc8, 0x9012, "8BitDo SN30 gamepad", 11, "start", JOYB_START }, /* SNES30 SNES30 Joy */ { 0x2dc8, 0xab20, "SNES30 SNES30 Joy ", 0, "a", JOYB_A }, { 0x2dc8, 0xab20, "SNES30 SNES30 Joy ", 1, "b", JOYB_B }, @@ -252,16 +486,35 @@ { 0x05a0, 0x3232, "8Bitdo Zero GamePad", 7, "tr", JOYB_TR }, { 0x05a0, 0x3232, "8Bitdo Zero GamePad", 10, "select", JOYB_SELECT }, { 0x05a0, 0x3232, "8Bitdo Zero GamePad", 11, "start", JOYB_START }, + /* ACRUX QuanBa Arcade JoyStick 1008 */ + { 0x0f30, 0x1100, "ACRUX QuanBa Arcade JoyStick 1008", 0, "a", JOYB_A }, + { 0x0f30, 0x1100, "ACRUX QuanBa Arcade JoyStick 1008", 1, "b", JOYB_B }, + { 0x0f30, 0x1100, "ACRUX QuanBa Arcade JoyStick 1008", 3, "x", JOYB_X }, + { 0x0f30, 0x1100, "ACRUX QuanBa Arcade JoyStick 1008", 2, "y", JOYB_Y }, + { 0x0f30, 0x1100, "ACRUX QuanBa Arcade JoyStick 1008", 5, "tl", JOYB_TL }, + { 0x0f30, 0x1100, "ACRUX QuanBa Arcade JoyStick 1008", 4, "tr", JOYB_TR }, + { 0x0f30, 0x1100, "ACRUX QuanBa Arcade JoyStick 1008", 7, "tl2", JOYB_TL2 }, + { 0x0f30, 0x1100, "ACRUX QuanBa Arcade JoyStick 1008", 6, "tr2", JOYB_TR2 }, + { 0x0f30, 0x1100, "ACRUX QuanBa Arcade JoyStick 1008", 8, "select", JOYB_SELECT }, + { 0x0f30, 0x1100, "ACRUX QuanBa Arcade JoyStick 1008", 9, "start", JOYB_START }, + /* Afterglow AX.1 Gamepad for Xbox 360 */ + { 0x0e6f, 0x0413, "Afterglow AX.1 Gamepad for Xbox 360", 1, "a", JOYB_A }, + { 0x0e6f, 0x0413, "Afterglow AX.1 Gamepad for Xbox 360", 0, "b", JOYB_B }, + { 0x0e6f, 0x0413, "Afterglow AX.1 Gamepad for Xbox 360", 3, "x", JOYB_X }, + { 0x0e6f, 0x0413, "Afterglow AX.1 Gamepad for Xbox 360", 2, "y", JOYB_Y }, + { 0x0e6f, 0x0413, "Afterglow AX.1 Gamepad for Xbox 360", 4, "tl", JOYB_TL }, + { 0x0e6f, 0x0413, "Afterglow AX.1 Gamepad for Xbox 360", 5, "tr", JOYB_TR }, + { 0x0e6f, 0x0413, "Afterglow AX.1 Gamepad for Xbox 360", 6, "select", JOYB_SELECT }, + { 0x0e6f, 0x0413, "Afterglow AX.1 Gamepad for Xbox 360", 7, "start", JOYB_START }, /* Afterglow Gamepad for Xbox 360 */ - { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, "a", JOYB_A }, - { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 1, "b", JOYB_B }, - { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 2, "x", JOYB_X }, - { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 3, "y", JOYB_Y }, + { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 1, "a", JOYB_A }, + { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 0, "b", JOYB_B }, + { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 3, "x", JOYB_X }, + { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 2, "y", JOYB_Y }, { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 4, "tl", JOYB_TL }, { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 5, "tr", JOYB_TR }, { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 6, "select", JOYB_SELECT }, { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 7, "start", JOYB_START }, - { 0x0e6f, 0x0213, "Afterglow Gamepad for Xbox 360", 8, "mode", JOYB_MODE }, /* Afterglow controller for PS3 */ { 0x0e6f, 0x6302, "Afterglow controller for PS3", 2, "a", JOYB_A }, { 0x0e6f, 0x6302, "Afterglow controller for PS3", 1, "b", JOYB_B }, @@ -273,6 +526,95 @@ { 0x0e6f, 0x6302, "Afterglow controller for PS3", 7, "tr2", JOYB_TR2 }, { 0x0e6f, 0x6302, "Afterglow controller for PS3", 8, "select", JOYB_SELECT }, { 0x0e6f, 0x6302, "Afterglow controller for PS3", 9, "start", JOYB_START }, + /* Akishop Customs PS360+ v1.66 */ + { 0x0010, 0x0082, "Akishop Customs PS360+ v1.66", 2, "a", JOYB_A }, + { 0x0010, 0x0082, "Akishop Customs PS360+ v1.66", 1, "b", JOYB_B }, + { 0x0010, 0x0082, "Akishop Customs PS360+ v1.66", 3, "x", JOYB_X }, + { 0x0010, 0x0082, "Akishop Customs PS360+ v1.66", 0, "y", JOYB_Y }, + { 0x0010, 0x0082, "Akishop Customs PS360+ v1.66", 4, "tl", JOYB_TL }, + { 0x0010, 0x0082, "Akishop Customs PS360+ v1.66", 5, "tr", JOYB_TR }, + { 0x0010, 0x0082, "Akishop Customs PS360+ v1.66", 6, "tl2", JOYB_TL2 }, + { 0x0010, 0x0082, "Akishop Customs PS360+ v1.66", 7, "tr2", JOYB_TR2 }, + { 0x0010, 0x0082, "Akishop Customs PS360+ v1.66", 8, "select", JOYB_SELECT }, + { 0x0010, 0x0082, "Akishop Customs PS360+ v1.66", 9, "start", JOYB_START }, + /* Generic X-Box pad */ + { 0x1bad, 0xf02a, "Generic X-Box pad", 1, "a", JOYB_A }, + { 0x1bad, 0xf02a, "Generic X-Box pad", 0, "b", JOYB_B }, + { 0x1bad, 0xf02a, "Generic X-Box pad", 3, "x", JOYB_X }, + { 0x1bad, 0xf02a, "Generic X-Box pad", 2, "y", JOYB_Y }, + { 0x1bad, 0xf02a, "Generic X-Box pad", 4, "tl", JOYB_TL }, + { 0x1bad, 0xf02a, "Generic X-Box pad", 5, "tr", JOYB_TR }, + { 0x1bad, 0xf02a, "Generic X-Box pad", 6, "select", JOYB_SELECT }, + { 0x1bad, 0xf02a, "Generic X-Box pad", 7, "start", JOYB_START }, + /* Generic X-Box pad */ + { 0x1bad, 0xf019, "Generic X-Box pad", 1, "a", JOYB_A }, + { 0x1bad, 0xf019, "Generic X-Box pad", 0, "b", JOYB_B }, + { 0x1bad, 0xf019, "Generic X-Box pad", 3, "x", JOYB_X }, + { 0x1bad, 0xf019, "Generic X-Box pad", 2, "y", JOYB_Y }, + { 0x1bad, 0xf019, "Generic X-Box pad", 4, "tl", JOYB_TL }, + { 0x1bad, 0xf019, "Generic X-Box pad", 5, "tr", JOYB_TR }, + { 0x1bad, 0xf019, "Generic X-Box pad", 6, "select", JOYB_SELECT }, + { 0x1bad, 0xf019, "Generic X-Box pad", 7, "start", JOYB_START }, + /* Generic X-Box pad */ + { 0x1bad, 0xf039, "Generic X-Box pad", 1, "a", JOYB_A }, + { 0x1bad, 0xf039, "Generic X-Box pad", 0, "b", JOYB_B }, + { 0x1bad, 0xf039, "Generic X-Box pad", 3, "x", JOYB_X }, + { 0x1bad, 0xf039, "Generic X-Box pad", 2, "y", JOYB_Y }, + { 0x1bad, 0xf039, "Generic X-Box pad", 4, "tl", JOYB_TL }, + { 0x1bad, 0xf039, "Generic X-Box pad", 5, "tr", JOYB_TR }, + { 0x1bad, 0xf039, "Generic X-Box pad", 6, "select", JOYB_SELECT }, + { 0x1bad, 0xf039, "Generic X-Box pad", 7, "start", JOYB_START }, + /* Arduino LLC Arduino Leonardo */ + { 0x2341, 0x8036, "Arduino LLC Arduino Leonardo", 1, "a", JOYB_A }, + { 0x2341, 0x8036, "Arduino LLC Arduino Leonardo", 0, "b", JOYB_B }, + { 0x2341, 0x8036, "Arduino LLC Arduino Leonardo", 3, "x", JOYB_X }, + { 0x2341, 0x8036, "Arduino LLC Arduino Leonardo", 2, "y", JOYB_Y }, + { 0x2341, 0x8036, "Arduino LLC Arduino Leonardo", 4, "tl", JOYB_TL }, + { 0x2341, 0x8036, "Arduino LLC Arduino Leonardo", 5, "tr", JOYB_TR }, + { 0x2341, 0x8036, "Arduino LLC Arduino Leonardo", 11, "tl2", JOYB_TL2 }, + { 0x2341, 0x8036, "Arduino LLC Arduino Leonardo", 9, "tr2", JOYB_TR2 }, + { 0x2341, 0x8036, "Arduino LLC Arduino Leonardo", 6, "select", JOYB_SELECT }, + { 0x2341, 0x8036, "Arduino LLC Arduino Leonardo", 7, "start", JOYB_START }, + /* Astro city mini Arcade stick */ + { 0x0ca3, 0x0028, "Astro city mini Arcade stick", 1, "a", JOYB_A }, + { 0x0ca3, 0x0028, "Astro city mini Arcade stick", 2, "b", JOYB_B }, + { 0x0ca3, 0x0028, "Astro city mini Arcade stick", 0, "x", JOYB_X }, + { 0x0ca3, 0x0028, "Astro city mini Arcade stick", 3, "y", JOYB_Y }, + { 0x0ca3, 0x0028, "Astro city mini Arcade stick", 4, "tl", JOYB_TL }, + { 0x0ca3, 0x0028, "Astro city mini Arcade stick", 5, "tr", JOYB_TR }, + { 0x0ca3, 0x0028, "Astro city mini Arcade stick", 8, "select", JOYB_SELECT }, + { 0x0ca3, 0x0028, "Astro city mini Arcade stick", 9, "start", JOYB_START }, + /* Game Controller */ + { 0x3250, 0x1002, "Game Controller", 2, "a", JOYB_A }, + { 0x3250, 0x1002, "Game Controller", 1, "b", JOYB_B }, + { 0x3250, 0x1002, "Game Controller", 4, "x", JOYB_X }, + { 0x3250, 0x1002, "Game Controller", 3, "y", JOYB_Y }, + { 0x3250, 0x1002, "Game Controller", 5, "tl", JOYB_TL }, + { 0x3250, 0x1002, "Game Controller", 6, "tr", JOYB_TR }, + { 0x3250, 0x1002, "Game Controller", 10, "select", JOYB_SELECT }, + { 0x3250, 0x1002, "Game Controller", 9, "start", JOYB_START }, + /* Austgame PS to USB convert cable */ + { 0x05e3, 0x0596, "Austgame PS to USB convert cable", 1, "a", JOYB_A }, + { 0x05e3, 0x0596, "Austgame PS to USB convert cable", 2, "b", JOYB_B }, + { 0x05e3, 0x0596, "Austgame PS to USB convert cable", 0, "x", JOYB_X }, + { 0x05e3, 0x0596, "Austgame PS to USB convert cable", 3, "y", JOYB_Y }, + { 0x05e3, 0x0596, "Austgame PS to USB convert cable", 6, "tl", JOYB_TL }, + { 0x05e3, 0x0596, "Austgame PS to USB convert cable", 7, "tr", JOYB_TR }, + { 0x05e3, 0x0596, "Austgame PS to USB convert cable", 4, "tl2", JOYB_TL2 }, + { 0x05e3, 0x0596, "Austgame PS to USB convert cable", 5, "tr2", JOYB_TR2 }, + { 0x05e3, 0x0596, "Austgame PS to USB convert cable", 9, "select", JOYB_SELECT }, + { 0x05e3, 0x0596, "Austgame PS to USB convert cable", 8, "start", JOYB_START }, + /* BDA Pro Ex */ + { 0x20d6, 0xca6d, "BDA Pro Ex", 1, "a", JOYB_A }, + { 0x20d6, 0xca6d, "BDA Pro Ex", 2, "b", JOYB_B }, + { 0x20d6, 0xca6d, "BDA Pro Ex", 0, "x", JOYB_X }, + { 0x20d6, 0xca6d, "BDA Pro Ex", 3, "y", JOYB_Y }, + { 0x20d6, 0xca6d, "BDA Pro Ex", 4, "tl", JOYB_TL }, + { 0x20d6, 0xca6d, "BDA Pro Ex", 5, "tr", JOYB_TR }, + { 0x20d6, 0xca6d, "BDA Pro Ex", 6, "tl2", JOYB_TL2 }, + { 0x20d6, 0xca6d, "BDA Pro Ex", 7, "tr2", JOYB_TR2 }, + { 0x20d6, 0xca6d, "BDA Pro Ex", 8, "select", JOYB_SELECT }, + { 0x20d6, 0xca6d, "BDA Pro Ex", 9, "start", JOYB_START }, /* BETOP AX1 BFM */ { 0x20bc, 0x5500, "BETOP AX1 BFM", 10, "a", JOYB_A }, { 0x20bc, 0x5500, "BETOP AX1 BFM", 9, "b", JOYB_B }, @@ -293,6 +635,336 @@ { 0x0411, 0x00c6, "BUFFALO INC. BUFFALO BGC-FC801 USB Gamepad", 5, "tr", JOYB_TR }, { 0x0411, 0x00c6, "BUFFALO INC. BUFFALO BGC-FC801 USB Gamepad", 6, "select", JOYB_SELECT }, { 0x0411, 0x00c6, "BUFFALO INC. BUFFALO BGC-FC801 USB Gamepad", 7, "start", JOYB_START }, + /* Bigben Revolution Pro */ + { 0x146b, 0x0d01, "Bigben Revolution Pro", 1, "a", JOYB_A }, + { 0x146b, 0x0d01, "Bigben Revolution Pro", 0, "b", JOYB_B }, + { 0x146b, 0x0d01, "Bigben Revolution Pro", 2, "x", JOYB_X }, + { 0x146b, 0x0d01, "Bigben Revolution Pro", 3, "y", JOYB_Y }, + { 0x146b, 0x0d01, "Bigben Revolution Pro", 4, "tl", JOYB_TL }, + { 0x146b, 0x0d01, "Bigben Revolution Pro", 5, "tr", JOYB_TR }, + { 0x146b, 0x0d01, "Bigben Revolution Pro", 8, "select", JOYB_SELECT }, + { 0x146b, 0x0d01, "Bigben Revolution Pro", 9, "start", JOYB_START }, + { 0x146b, 0x0d01, "Bigben Revolution Pro", 10, "mode", JOYB_MODE }, + /* Bliss-Box 4-Play ATARI */ + { 0x16d0, 0x0d04, "Bliss-Box 4-Play ATARI", 1, "b", JOYB_B }, + /* Bliss-Box 4-Play ATARI */ + { 0x16d0, 0x0d05, "Bliss-Box 4-Play ATARI", 1, "b", JOYB_B }, + /* Bliss-Box 4-Play ATARI */ + { 0x16d0, 0x0d06, "Bliss-Box 4-Play ATARI", 1, "b", JOYB_B }, + /* Bliss-Box 4-Play ATARI */ + { 0x16d0, 0x0d07, "Bliss-Box 4-Play ATARI", 1, "b", JOYB_B }, + /* Bliss-Box 4-Play GC */ + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GC", 2, "a", JOYB_A }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GC", 1, "b", JOYB_B }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GC", 4, "x", JOYB_X }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GC", 3, "y", JOYB_Y }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GC", 5, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GC", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play GC */ + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GC", 2, "a", JOYB_A }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GC", 1, "b", JOYB_B }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GC", 4, "x", JOYB_X }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GC", 3, "y", JOYB_Y }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GC", 5, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GC", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play GC */ + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GC", 2, "a", JOYB_A }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GC", 1, "b", JOYB_B }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GC", 4, "x", JOYB_X }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GC", 3, "y", JOYB_Y }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GC", 5, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GC", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play GC */ + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GC", 2, "a", JOYB_A }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GC", 1, "b", JOYB_B }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GC", 4, "x", JOYB_X }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GC", 3, "y", JOYB_Y }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GC", 5, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GC", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play GEN_3 */ + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_3", 10, "a", JOYB_A }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_3", 2, "b", JOYB_B }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_3", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_3", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play GEN_3 */ + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_3", 10, "a", JOYB_A }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_3", 2, "b", JOYB_B }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_3", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_3", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play GEN_3 */ + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_3", 10, "a", JOYB_A }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_3", 2, "b", JOYB_B }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_3", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_3", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play GEN_3 */ + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_3", 10, "a", JOYB_A }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_3", 2, "b", JOYB_B }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_3", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_3", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play GEN_6 */ + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_6", 10, "a", JOYB_A }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_6", 2, "b", JOYB_B }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_6", 4, "x", JOYB_X }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_6", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_6", 3, "tl", JOYB_TL }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_6", 9, "tr", JOYB_TR }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_6", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play GEN_6", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play GEN_6 */ + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_6", 10, "a", JOYB_A }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_6", 2, "b", JOYB_B }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_6", 4, "x", JOYB_X }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_6", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_6", 3, "tl", JOYB_TL }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_6", 9, "tr", JOYB_TR }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_6", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play GEN_6", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play GEN_6 */ + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_6", 10, "a", JOYB_A }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_6", 2, "b", JOYB_B }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_6", 4, "x", JOYB_X }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_6", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_6", 3, "tl", JOYB_TL }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_6", 9, "tr", JOYB_TR }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_6", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play GEN_6", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play GEN_6 */ + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_6", 10, "a", JOYB_A }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_6", 2, "b", JOYB_B }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_6", 4, "x", JOYB_X }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_6", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_6", 3, "tl", JOYB_TL }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_6", 9, "tr", JOYB_TR }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_6", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play GEN_6", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play N64 */ + { 0x16d0, 0x0d04, "Bliss-Box 4-Play N64", 4, "a", JOYB_A }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play N64", 2, "b", JOYB_B }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play N64", 9, "x", JOYB_X }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play N64", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play N64", 3, "tl", JOYB_TL }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play N64", 10, "tr", JOYB_TR }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play N64", 5, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play N64", 8, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play N64", 7, "select", JOYB_SELECT }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play N64", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play N64 */ + { 0x16d0, 0x0d05, "Bliss-Box 4-Play N64", 4, "a", JOYB_A }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play N64", 2, "b", JOYB_B }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play N64", 9, "x", JOYB_X }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play N64", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play N64", 3, "tl", JOYB_TL }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play N64", 10, "tr", JOYB_TR }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play N64", 5, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play N64", 8, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play N64", 7, "select", JOYB_SELECT }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play N64", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play N64 */ + { 0x16d0, 0x0d06, "Bliss-Box 4-Play N64", 4, "a", JOYB_A }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play N64", 2, "b", JOYB_B }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play N64", 9, "x", JOYB_X }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play N64", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play N64", 3, "tl", JOYB_TL }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play N64", 10, "tr", JOYB_TR }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play N64", 5, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play N64", 8, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play N64", 7, "select", JOYB_SELECT }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play N64", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play N64 */ + { 0x16d0, 0x0d07, "Bliss-Box 4-Play N64", 4, "a", JOYB_A }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play N64", 2, "b", JOYB_B }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play N64", 9, "x", JOYB_X }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play N64", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play N64", 3, "tl", JOYB_TL }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play N64", 10, "tr", JOYB_TR }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play N64", 5, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play N64", 8, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play N64", 7, "select", JOYB_SELECT }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play N64", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play NES */ + { 0x16d0, 0x0d04, "Bliss-Box 4-Play NES", 2, "a", JOYB_A }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play NES", 1, "b", JOYB_B }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play NES", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play NES", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play NES */ + { 0x16d0, 0x0d05, "Bliss-Box 4-Play NES", 2, "a", JOYB_A }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play NES", 1, "b", JOYB_B }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play NES", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play NES", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play NES */ + { 0x16d0, 0x0d06, "Bliss-Box 4-Play NES", 2, "a", JOYB_A }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play NES", 1, "b", JOYB_B }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play NES", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play NES", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play NES */ + { 0x16d0, 0x0d07, "Bliss-Box 4-Play NES", 2, "a", JOYB_A }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play NES", 1, "b", JOYB_B }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play NES", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play NES", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play PSX_DS2 */ + { 0x16d0, 0x0d04, "Bliss-Box 4-Play PSX_DS2", 4, "a", JOYB_A }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play PSX_DS2", 2, "b", JOYB_B }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play PSX_DS2", 3, "x", JOYB_X }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play PSX_DS2", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play PSX_DS2", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play PSX_DS2", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play PSX_DS2", 9, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play PSX_DS2", 10, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play PSX_DS2", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play PSX_DS2", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play PSX_DS2 */ + { 0x16d0, 0x0d05, "Bliss-Box 4-Play PSX_DS2", 4, "a", JOYB_A }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play PSX_DS2", 2, "b", JOYB_B }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play PSX_DS2", 3, "x", JOYB_X }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play PSX_DS2", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play PSX_DS2", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play PSX_DS2", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play PSX_DS2", 9, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play PSX_DS2", 10, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play PSX_DS2", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play PSX_DS2", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play PSX_DS2 */ + { 0x16d0, 0x0d06, "Bliss-Box 4-Play PSX_DS2", 4, "a", JOYB_A }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play PSX_DS2", 2, "b", JOYB_B }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play PSX_DS2", 3, "x", JOYB_X }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play PSX_DS2", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play PSX_DS2", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play PSX_DS2", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play PSX_DS2", 9, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play PSX_DS2", 10, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play PSX_DS2", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play PSX_DS2", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play PSX_DS2 */ + { 0x16d0, 0x0d07, "Bliss-Box 4-Play PSX_DS2", 4, "a", JOYB_A }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play PSX_DS2", 2, "b", JOYB_B }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play PSX_DS2", 3, "x", JOYB_X }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play PSX_DS2", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play PSX_DS2", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play PSX_DS2", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play PSX_DS2", 9, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play PSX_DS2", 10, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play PSX_DS2", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play PSX_DS2", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play SATURN_DIGITAL */ + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SATURN_DIGITAL", 2, "a", JOYB_A }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SATURN_DIGITAL", 1, "b", JOYB_B }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SATURN_DIGITAL", 4, "x", JOYB_X }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SATURN_DIGITAL", 3, "y", JOYB_Y }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SATURN_DIGITAL", 9, "tl", JOYB_TL }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SATURN_DIGITAL", 10, "tr", JOYB_TR }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SATURN_DIGITAL", 7, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SATURN_DIGITAL", 8, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SATURN_DIGITAL", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play SATURN_DIGITAL */ + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SATURN_DIGITAL", 2, "a", JOYB_A }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SATURN_DIGITAL", 1, "b", JOYB_B }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SATURN_DIGITAL", 4, "x", JOYB_X }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SATURN_DIGITAL", 3, "y", JOYB_Y }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SATURN_DIGITAL", 9, "tl", JOYB_TL }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SATURN_DIGITAL", 10, "tr", JOYB_TR }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SATURN_DIGITAL", 7, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SATURN_DIGITAL", 8, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SATURN_DIGITAL", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play SATURN_DIGITAL */ + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SATURN_DIGITAL", 2, "a", JOYB_A }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SATURN_DIGITAL", 1, "b", JOYB_B }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SATURN_DIGITAL", 4, "x", JOYB_X }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SATURN_DIGITAL", 3, "y", JOYB_Y }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SATURN_DIGITAL", 9, "tl", JOYB_TL }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SATURN_DIGITAL", 10, "tr", JOYB_TR }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SATURN_DIGITAL", 7, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SATURN_DIGITAL", 8, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SATURN_DIGITAL", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play SATURN_DIGITAL */ + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SATURN_DIGITAL", 2, "a", JOYB_A }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SATURN_DIGITAL", 1, "b", JOYB_B }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SATURN_DIGITAL", 4, "x", JOYB_X }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SATURN_DIGITAL", 3, "y", JOYB_Y }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SATURN_DIGITAL", 9, "tl", JOYB_TL }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SATURN_DIGITAL", 10, "tr", JOYB_TR }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SATURN_DIGITAL", 7, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SATURN_DIGITAL", 8, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SATURN_DIGITAL", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play SNES */ + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SNES", 4, "a", JOYB_A }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SNES", 2, "b", JOYB_B }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SNES", 3, "x", JOYB_X }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SNES", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SNES", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SNES", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SNES", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play SNES", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play SNES */ + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SNES", 4, "a", JOYB_A }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SNES", 2, "b", JOYB_B }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SNES", 3, "x", JOYB_X }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SNES", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SNES", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SNES", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SNES", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play SNES", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play SNES */ + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SNES", 4, "a", JOYB_A }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SNES", 2, "b", JOYB_B }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SNES", 3, "x", JOYB_X }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SNES", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SNES", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SNES", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SNES", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play SNES", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play SNES */ + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SNES", 4, "a", JOYB_A }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SNES", 2, "b", JOYB_B }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SNES", 3, "x", JOYB_X }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SNES", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SNES", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SNES", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SNES", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play SNES", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play WII_CLASSIC */ + { 0x16d0, 0x0d04, "Bliss-Box 4-Play WII_CLASSIC", 4, "a", JOYB_A }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play WII_CLASSIC", 2, "b", JOYB_B }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play WII_CLASSIC", 3, "x", JOYB_X }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play WII_CLASSIC", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play WII_CLASSIC", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play WII_CLASSIC", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play WII_CLASSIC", 9, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play WII_CLASSIC", 10, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play WII_CLASSIC", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d04, "Bliss-Box 4-Play WII_CLASSIC", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play WII_CLASSIC */ + { 0x16d0, 0x0d05, "Bliss-Box 4-Play WII_CLASSIC", 4, "a", JOYB_A }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play WII_CLASSIC", 2, "b", JOYB_B }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play WII_CLASSIC", 3, "x", JOYB_X }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play WII_CLASSIC", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play WII_CLASSIC", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play WII_CLASSIC", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play WII_CLASSIC", 9, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play WII_CLASSIC", 10, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play WII_CLASSIC", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d05, "Bliss-Box 4-Play WII_CLASSIC", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play WII_CLASSIC */ + { 0x16d0, 0x0d06, "Bliss-Box 4-Play WII_CLASSIC", 4, "a", JOYB_A }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play WII_CLASSIC", 2, "b", JOYB_B }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play WII_CLASSIC", 3, "x", JOYB_X }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play WII_CLASSIC", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play WII_CLASSIC", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play WII_CLASSIC", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play WII_CLASSIC", 9, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play WII_CLASSIC", 10, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play WII_CLASSIC", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d06, "Bliss-Box 4-Play WII_CLASSIC", 6, "start", JOYB_START }, + /* Bliss-Box 4-Play WII_CLASSIC */ + { 0x16d0, 0x0d07, "Bliss-Box 4-Play WII_CLASSIC", 4, "a", JOYB_A }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play WII_CLASSIC", 2, "b", JOYB_B }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play WII_CLASSIC", 3, "x", JOYB_X }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play WII_CLASSIC", 1, "y", JOYB_Y }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play WII_CLASSIC", 7, "tl", JOYB_TL }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play WII_CLASSIC", 8, "tr", JOYB_TR }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play WII_CLASSIC", 9, "tl2", JOYB_TL2 }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play WII_CLASSIC", 10, "tr2", JOYB_TR2 }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play WII_CLASSIC", 5, "select", JOYB_SELECT }, + { 0x16d0, 0x0d07, "Bliss-Box 4-Play WII_CLASSIC", 6, "start", JOYB_START }, /* BLISS-BOX 4PLAY PORT */ { 0x16d0, 0x0a60, "BLISS-BOX 4PLAY PORT", 7, "a", JOYB_A }, { 0x16d0, 0x0a60, "BLISS-BOX 4PLAY PORT", 5, "b", JOYB_B }, @@ -304,17 +976,24 @@ { 0x16d0, 0x0a60, "BLISS-BOX 4PLAY PORT", 13, "tr2", JOYB_TR2 }, { 0x16d0, 0x0a60, "BLISS-BOX 4PLAY PORT", 8, "select", JOYB_SELECT }, { 0x16d0, 0x0a60, "BLISS-BOX 4PLAY PORT", 9, "start", JOYB_START }, - /* DragonRise Inc. Generic USB Joystick */ - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 2, "a", JOYB_A }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 1, "b", JOYB_B }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 3, "x", JOYB_X }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 0, "y", JOYB_Y }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 4, "tl", JOYB_TL }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 5, "tr", JOYB_TR }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 6, "tl2", JOYB_TL2 }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 7, "tr2", JOYB_TR2 }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 8, "select", JOYB_SELECT }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 9, "start", JOYB_START }, + /* CHA1 CHA1 */ + { 0x1c5b, 0x0024, " CHA1 CHA1 ", 4, "a", JOYB_A }, + { 0x1c5b, 0x0024, " CHA1 CHA1 ", 3, "b", JOYB_B }, + { 0x1c5b, 0x0024, " CHA1 CHA1 ", 1, "x", JOYB_X }, + { 0x1c5b, 0x0024, " CHA1 CHA1 ", 0, "y", JOYB_Y }, + { 0x1c5b, 0x0024, " CHA1 CHA1 ", 2, "tl", JOYB_TL }, + { 0x1c5b, 0x0024, " CHA1 CHA1 ", 5, "tr", JOYB_TR }, + { 0x1c5b, 0x0024, " CHA1 CHA1 ", 7, "select", JOYB_SELECT }, + { 0x1c5b, 0x0024, " CHA1 CHA1 ", 6, "start", JOYB_START }, + /* CHA2 CHA2 */ + { 0x1c5b, 0x0025, " CHA2 CHA2 ", 4, "a", JOYB_A }, + { 0x1c5b, 0x0025, " CHA2 CHA2 ", 3, "b", JOYB_B }, + { 0x1c5b, 0x0025, " CHA2 CHA2 ", 1, "x", JOYB_X }, + { 0x1c5b, 0x0025, " CHA2 CHA2 ", 0, "y", JOYB_Y }, + { 0x1c5b, 0x0025, " CHA2 CHA2 ", 2, "tl", JOYB_TL }, + { 0x1c5b, 0x0025, " CHA2 CHA2 ", 5, "tr", JOYB_TR }, + { 0x1c5b, 0x0025, " CHA2 CHA2 ", 7, "select", JOYB_SELECT }, + { 0x1c5b, 0x0025, " CHA2 CHA2 ", 6, "start", JOYB_START }, /* ShanWan USB WirelessGamepad */ { 0x2563, 0x0547, "ShanWan USB WirelessGamepad ", 1, "a", JOYB_A }, { 0x2563, 0x0547, "ShanWan USB WirelessGamepad ", 2, "b", JOYB_B }, @@ -326,17 +1005,6 @@ { 0x2563, 0x0547, "ShanWan USB WirelessGamepad ", 7, "tr2", JOYB_TR2 }, { 0x2563, 0x0547, "ShanWan USB WirelessGamepad ", 8, "select", JOYB_SELECT }, { 0x2563, 0x0547, "ShanWan USB WirelessGamepad ", 9, "start", JOYB_START }, - /* USB Gamepad */ - { 0x0079, 0x0011, "USB Gamepad ", 1, "a", JOYB_A }, - { 0x0079, 0x0011, "USB Gamepad ", 2, "b", JOYB_B }, - { 0x0079, 0x0011, "USB Gamepad ", 0, "x", JOYB_X }, - { 0x0079, 0x0011, "USB Gamepad ", 3, "y", JOYB_Y }, - { 0x0079, 0x0011, "USB Gamepad ", 4, "tl", JOYB_TL }, - { 0x0079, 0x0011, "USB Gamepad ", 5, "tr", JOYB_TR }, - { 0x0079, 0x0011, "USB Gamepad ", 6, "tl2", JOYB_TL2 }, - { 0x0079, 0x0011, "USB Gamepad ", 7, "tr2", JOYB_TR2 }, - { 0x0079, 0x0011, "USB Gamepad ", 8, "select", JOYB_SELECT }, - { 0x0079, 0x0011, "USB Gamepad ", 9, "start", JOYB_START }, /* DragonRise Inc. PC TWIN SHOCK Gamepad */ { 0x0079, 0x0006, "DragonRise Inc. PC TWIN SHOCK Gamepad", 1, "a", JOYB_A }, { 0x0079, 0x0006, "DragonRise Inc. PC TWIN SHOCK Gamepad", 2, "b", JOYB_B }, @@ -349,34 +1017,12 @@ { 0x0079, 0x0006, "DragonRise Inc. PC TWIN SHOCK Gamepad", 8, "select", JOYB_SELECT }, { 0x0079, 0x0006, "DragonRise Inc. PC TWIN SHOCK Gamepad", 9, "start", JOYB_START }, /* DragonRise Inc. Generic USB Joystick */ - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 1, "a", JOYB_A }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 2, "b", JOYB_B }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 0, "x", JOYB_X }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 3, "y", JOYB_Y }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 4, "tl", JOYB_TL }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 5, "tr", JOYB_TR }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 6, "tl2", JOYB_TL2 }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 7, "tr2", JOYB_TR2 }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 8, "select", JOYB_SELECT }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 9, "start", JOYB_START }, - /* DragonRise Inc. Generic USB Joystick */ - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 5, "a", JOYB_A }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 4, "b", JOYB_B }, + { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 5, "b", JOYB_B }, + { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 4, "y", JOYB_Y }, { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 6, "tl", JOYB_TL }, { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 7, "tr", JOYB_TR }, { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 8, "tl2", JOYB_TL2 }, { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 9, "start", JOYB_START }, - /* DragonRise Inc. Generic USB Joystick */ - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 1, "a", JOYB_A }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 2, "b", JOYB_B }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 0, "x", JOYB_X }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 3, "y", JOYB_Y }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 4, "tl", JOYB_TL }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 5, "tr", JOYB_TR }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 6, "tl2", JOYB_TL2 }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 7, "tr2", JOYB_TR2 }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 8, "select", JOYB_SELECT }, - { 0x0079, 0x0006, "DragonRise Inc. Generic USB Joystick ", 9, "start", JOYB_START }, /* Performance Designed Products EA SPORTS Controller for PS3 */ { 0x0e6f, 0x0130, "Performance Designed Products EA SPORTS Controller for PS3", 2, "a", JOYB_A }, { 0x0e6f, 0x0130, "Performance Designed Products EA SPORTS Controller for PS3", 1, "b", JOYB_B }, @@ -389,6 +1035,28 @@ { 0x0e6f, 0x0130, "Performance Designed Products EA SPORTS Controller for PS3", 8, "select", JOYB_SELECT }, { 0x0e6f, 0x0130, "Performance Designed Products EA SPORTS Controller for PS3", 9, "start", JOYB_START }, { 0x0e6f, 0x0130, "Performance Designed Products EA SPORTS Controller for PS3", 12, "mode", JOYB_MODE }, + /* ELECOM JC-U4113S DirectInput Mode */ + { 0x056e, 0x2010, "ELECOM JC-U4113S DirectInput Mode", 3, "a", JOYB_A }, + { 0x056e, 0x2010, "ELECOM JC-U4113S DirectInput Mode", 2, "b", JOYB_B }, + { 0x056e, 0x2010, "ELECOM JC-U4113S DirectInput Mode", 1, "x", JOYB_X }, + { 0x056e, 0x2010, "ELECOM JC-U4113S DirectInput Mode", 0, "y", JOYB_Y }, + { 0x056e, 0x2010, "ELECOM JC-U4113S DirectInput Mode", 4, "tl", JOYB_TL }, + { 0x056e, 0x2010, "ELECOM JC-U4113S DirectInput Mode", 5, "tr", JOYB_TR }, + { 0x056e, 0x2010, "ELECOM JC-U4113S DirectInput Mode", 6, "tl2", JOYB_TL2 }, + { 0x056e, 0x2010, "ELECOM JC-U4113S DirectInput Mode", 7, "tr2", JOYB_TR2 }, + { 0x056e, 0x2010, "ELECOM JC-U4113S DirectInput Mode", 10, "select", JOYB_SELECT }, + { 0x056e, 0x2010, "ELECOM JC-U4113S DirectInput Mode", 11, "start", JOYB_START }, + { 0x056e, 0x2010, "ELECOM JC-U4113S DirectInput Mode", 12, "mode", JOYB_MODE }, + /* ELECOM JC-U4113S XInput Mode */ + { 0x056e, 0x2013, "ELECOM JC-U4113S XInput Mode", 1, "a", JOYB_A }, + { 0x056e, 0x2013, "ELECOM JC-U4113S XInput Mode", 0, "b", JOYB_B }, + { 0x056e, 0x2013, "ELECOM JC-U4113S XInput Mode", 3, "x", JOYB_X }, + { 0x056e, 0x2013, "ELECOM JC-U4113S XInput Mode", 2, "y", JOYB_Y }, + { 0x056e, 0x2013, "ELECOM JC-U4113S XInput Mode", 4, "tl", JOYB_TL }, + { 0x056e, 0x2013, "ELECOM JC-U4113S XInput Mode", 5, "tr", JOYB_TR }, + { 0x056e, 0x2013, "ELECOM JC-U4113S XInput Mode", 6, "select", JOYB_SELECT }, + { 0x056e, 0x2013, "ELECOM JC-U4113S XInput Mode", 7, "start", JOYB_START }, + { 0x056e, 0x2013, "ELECOM JC-U4113S XInput Mode", 8, "mode", JOYB_MODE }, /* USB GAMEPAD 8116 */ { 0x1a34, 0x0802, "USB GAMEPAD 8116", 0, "a", JOYB_A }, { 0x1a34, 0x0802, "USB GAMEPAD 8116", 1, "b", JOYB_B }, @@ -398,15 +1066,58 @@ { 0x1a34, 0x0802, "USB GAMEPAD 8116", 5, "tr", JOYB_TR }, { 0x1a34, 0x0802, "USB GAMEPAD 8116", 8, "select", JOYB_SELECT }, { 0x1a34, 0x0802, "USB GAMEPAD 8116", 9, "start", JOYB_START }, - /* G27 Racing Wheel */ - { 0x046d, 0xc29b, "G27 Racing Wheel", 2, "a", JOYB_A }, - { 0x046d, 0xc29b, "G27 Racing Wheel", 3, "x", JOYB_X }, - { 0x046d, 0xc29b, "G27 Racing Wheel", 7, "tl", JOYB_TL }, - { 0x046d, 0xc29b, "G27 Racing Wheel", 6, "tr", JOYB_TR }, - { 0x046d, 0xc29b, "G27 Racing Wheel", 20, "tl2", JOYB_TL2 }, - { 0x046d, 0xc29b, "G27 Racing Wheel", 18, "tr2", JOYB_TR2 }, - { 0x046d, 0xc29b, "G27 Racing Wheel", 11, "select", JOYB_SELECT }, - { 0x046d, 0xc29b, "G27 Racing Wheel", 8, "start", JOYB_START }, + /* Flydigi VADER2P */ + { 0x07d7, 0x0040, "Flydigi VADER2P", 2, "a", JOYB_A }, + { 0x07d7, 0x0040, "Flydigi VADER2P", 1, "b", JOYB_B }, + { 0x07d7, 0x0040, "Flydigi VADER2P", 4, "x", JOYB_X }, + { 0x07d7, 0x0040, "Flydigi VADER2P", 3, "y", JOYB_Y }, + { 0x07d7, 0x0040, "Flydigi VADER2P", 5, "tl", JOYB_TL }, + { 0x07d7, 0x0040, "Flydigi VADER2P", 6, "tr", JOYB_TR }, + { 0x07d7, 0x0040, "Flydigi VADER2P", 7, "tl2", JOYB_TL2 }, + { 0x07d7, 0x0040, "Flydigi VADER2P", 8, "tr2", JOYB_TR2 }, + { 0x07d7, 0x0040, "Flydigi VADER2P", 9, "select", JOYB_SELECT }, + { 0x07d7, 0x0040, "Flydigi VADER2P", 10, "start", JOYB_START }, + { 0x07d7, 0x0040, "Flydigi VADER2P", 4, "mode", JOYB_MODE }, + /* Flydigi VADER2 */ + { 0x07d7, 0x0040, "Flydigi VADER2", 2, "a", JOYB_A }, + { 0x07d7, 0x0040, "Flydigi VADER2", 1, "b", JOYB_B }, + { 0x07d7, 0x0040, "Flydigi VADER2", 4, "x", JOYB_X }, + { 0x07d7, 0x0040, "Flydigi VADER2", 3, "y", JOYB_Y }, + { 0x07d7, 0x0040, "Flydigi VADER2", 5, "tl", JOYB_TL }, + { 0x07d7, 0x0040, "Flydigi VADER2", 6, "tr", JOYB_TR }, + { 0x07d7, 0x0040, "Flydigi VADER2", 7, "tl2", JOYB_TL2 }, + { 0x07d7, 0x0040, "Flydigi VADER2", 8, "tr2", JOYB_TR2 }, + { 0x07d7, 0x0040, "Flydigi VADER2", 9, "select", JOYB_SELECT }, + { 0x07d7, 0x0040, "Flydigi VADER2", 10, "start", JOYB_START }, + { 0x07d7, 0x0040, "Flydigi VADER2", 4, "mode", JOYB_MODE }, + /* GAMESAIKE USB GAME Controller */ + { 0x04d9, 0x0f16, "GAMESAIKE USB GAME Controller ", 1, "a", JOYB_A }, + { 0x04d9, 0x0f16, "GAMESAIKE USB GAME Controller ", 2, "b", JOYB_B }, + { 0x04d9, 0x0f16, "GAMESAIKE USB GAME Controller ", 0, "x", JOYB_X }, + { 0x04d9, 0x0f16, "GAMESAIKE USB GAME Controller ", 3, "y", JOYB_Y }, + { 0x04d9, 0x0f16, "GAMESAIKE USB GAME Controller ", 6, "tl", JOYB_TL }, + { 0x04d9, 0x0f16, "GAMESAIKE USB GAME Controller ", 7, "tr", JOYB_TR }, + { 0x04d9, 0x0f16, "GAMESAIKE USB GAME Controller ", 4, "tl2", JOYB_TL2 }, + { 0x04d9, 0x0f16, "GAMESAIKE USB GAME Controller ", 5, "tr2", JOYB_TR2 }, + { 0x04d9, 0x0f16, "GAMESAIKE USB GAME Controller ", 8, "select", JOYB_SELECT }, + { 0x04d9, 0x0f16, "GAMESAIKE USB GAME Controller ", 9, "start", JOYB_START }, + /* GPD Win 2 X-Box Controller */ + { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 1, "a", JOYB_A }, + { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, "b", JOYB_B }, + { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 3, "x", JOYB_X }, + { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 2, "y", JOYB_Y }, + { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 9, "tl", JOYB_TL }, + { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 10, "tr", JOYB_TR }, + { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 4, "tl2", JOYB_TL2 }, + { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 5, "tr2", JOYB_TR2 }, + /* GameStick Controller */ + { 0x0f0d, 0x1011, "GameStick Controller", 12, "a", JOYB_A }, + { 0x0f0d, 0x1011, "GameStick Controller", 11, "b", JOYB_B }, + { 0x0f0d, 0x1011, "GameStick Controller", 15, "x", JOYB_X }, + { 0x0f0d, 0x1011, "GameStick Controller", 14, "y", JOYB_Y }, + { 0x0f0d, 0x1011, "GameStick Controller", 17, "tl", JOYB_TL }, + { 0x0f0d, 0x1011, "GameStick Controller", 18, "tr", JOYB_TR }, + { 0x0f0d, 0x1011, "GameStick Controller", 22, "start", JOYB_START }, /* Generic X-Box pad */ { 0x0e4c, 0x1103, "Generic X-Box pad", 1, "a", JOYB_A }, { 0x0e4c, 0x1103, "Generic X-Box pad", 0, "b", JOYB_B }, @@ -416,6 +1127,15 @@ { 0x0e4c, 0x1103, "Generic X-Box pad", 2, "tr", JOYB_TR }, { 0x0e4c, 0x1103, "Generic X-Box pad", 6, "select", JOYB_SELECT }, { 0x0e4c, 0x1103, "Generic X-Box pad", 7, "start", JOYB_START }, + /* Gametel */ + { 0x25b6, 0x0001, "Gametel", 4, "a", JOYB_A }, + { 0x25b6, 0x0001, "Gametel", 7, "b", JOYB_B }, + { 0x25b6, 0x0001, "Gametel", 6, "x", JOYB_X }, + { 0x25b6, 0x0001, "Gametel", 5, "y", JOYB_Y }, + { 0x25b6, 0x0001, "Gametel", 8, "tl", JOYB_TL }, + { 0x25b6, 0x0001, "Gametel", 9, "tr", JOYB_TR }, + { 0x25b6, 0x0001, "Gametel", 10, "select", JOYB_SELECT }, + { 0x25b6, 0x0001, "Gametel", 11, "start", JOYB_START }, /* Gamtec.,Ltd SmartJoy PLUS Adapter */ { 0x0925, 0x0005, "Gamtec.,Ltd SmartJoy PLUS Adapter", 1, "a", JOYB_A }, { 0x0925, 0x0005, "Gamtec.,Ltd SmartJoy PLUS Adapter", 2, "b", JOYB_B }, @@ -439,18 +1159,26 @@ { 0x0e8f, 0x0008, "Gasia Co.,Ltd PS(R) Gamepad", 8, "select", JOYB_SELECT }, { 0x0e8f, 0x0008, "Gasia Co.,Ltd PS(R) Gamepad", 9, "start", JOYB_START }, { 0x0e8f, 0x0008, "Gasia Co.,Ltd PS(R) Gamepad", 12, "mode", JOYB_MODE }, - /* Gasia Co.,Ltd PS(R) Gamepad */ - { 0x054c, 0x0268, "Gasia Co.,Ltd PS(R) Gamepad", 13, "a", JOYB_A }, - { 0x054c, 0x0268, "Gasia Co.,Ltd PS(R) Gamepad", 14, "b", JOYB_B }, - { 0x054c, 0x0268, "Gasia Co.,Ltd PS(R) Gamepad", 12, "x", JOYB_X }, - { 0x054c, 0x0268, "Gasia Co.,Ltd PS(R) Gamepad", 15, "y", JOYB_Y }, - { 0x054c, 0x0268, "Gasia Co.,Ltd PS(R) Gamepad", 10, "tl", JOYB_TL }, - { 0x054c, 0x0268, "Gasia Co.,Ltd PS(R) Gamepad", 11, "tr", JOYB_TR }, - { 0x054c, 0x0268, "Gasia Co.,Ltd PS(R) Gamepad", 8, "tl2", JOYB_TL2 }, - { 0x054c, 0x0268, "Gasia Co.,Ltd PS(R) Gamepad", 9, "tr2", JOYB_TR2 }, - { 0x054c, 0x0268, "Gasia Co.,Ltd PS(R) Gamepad", 0, "select", JOYB_SELECT }, - { 0x054c, 0x0268, "Gasia Co.,Ltd PS(R) Gamepad", 3, "start", JOYB_START }, - { 0x054c, 0x0268, "Gasia Co.,Ltd PS(R) Gamepad", 16, "mode", JOYB_MODE }, + /* SWITCH CO.,LTD. Controller (Dinput) */ + { 0x0079, 0x0006, "SWITCH CO.,LTD. Controller (Dinput)", 8, "a", JOYB_A }, + { 0x0079, 0x0006, "SWITCH CO.,LTD. Controller (Dinput)", 6, "b", JOYB_B }, + { 0x0079, 0x0006, "SWITCH CO.,LTD. Controller (Dinput)", 8, "y", JOYB_Y }, + { 0x0079, 0x0006, "SWITCH CO.,LTD. Controller (Dinput)", 4, "tl", JOYB_TL }, + { 0x0079, 0x0006, "SWITCH CO.,LTD. Controller (Dinput)", 5, "tr", JOYB_TR }, + { 0x0079, 0x0006, "SWITCH CO.,LTD. Controller (Dinput)", 7, "tl2", JOYB_TL2 }, + { 0x0079, 0x0006, "SWITCH CO.,LTD. Controller (Dinput)", 9, "start", JOYB_START }, + /* Google LLC Stadia Controller rev. A */ + { 0x18d1, 0x9400, "Google LLC Stadia Controller rev. A", 1, "a", JOYB_A }, + { 0x18d1, 0x9400, "Google LLC Stadia Controller rev. A", 0, "b", JOYB_B }, + { 0x18d1, 0x9400, "Google LLC Stadia Controller rev. A", 3, "x", JOYB_X }, + { 0x18d1, 0x9400, "Google LLC Stadia Controller rev. A", 2, "y", JOYB_Y }, + { 0x18d1, 0x9400, "Google LLC Stadia Controller rev. A", 4, "tl", JOYB_TL }, + { 0x18d1, 0x9400, "Google LLC Stadia Controller rev. A", 5, "tr", JOYB_TR }, + { 0x18d1, 0x9400, "Google LLC Stadia Controller rev. A", 14, "tl2", JOYB_TL2 }, + { 0x18d1, 0x9400, "Google LLC Stadia Controller rev. A", 13, "tr2", JOYB_TR2 }, + { 0x18d1, 0x9400, "Google LLC Stadia Controller rev. A", 6, "select", JOYB_SELECT }, + { 0x18d1, 0x9400, "Google LLC Stadia Controller rev. A", 7, "start", JOYB_START }, + { 0x18d1, 0x9400, "Google LLC Stadia Controller rev. A", 8, "mode", JOYB_MODE }, /* Gravis Destroyer Tiltpad */ { 0x047d, 0x4008, "Gravis Destroyer Tiltpad", 2, "a", JOYB_A }, { 0x047d, 0x4008, "Gravis Destroyer Tiltpad", 1, "b", JOYB_B }, @@ -495,6 +1223,28 @@ { 0x0079, 0x1800, "HJZ Mayflash WiiU Pro Game Controller Adapter", 7, "tr2", JOYB_TR2 }, { 0x0079, 0x1800, "HJZ Mayflash WiiU Pro Game Controller Adapter", 8, "select", JOYB_SELECT }, { 0x0079, 0x1800, "HJZ Mayflash WiiU Pro Game Controller Adapter", 9, "start", JOYB_START }, + /* HOLTEK Twin Shock */ + { 0x04d9, 0x138c, "HOLTEK Twin Shock", 0, "a", JOYB_A }, + { 0x04d9, 0x138c, "HOLTEK Twin Shock", 2, "b", JOYB_B }, + { 0x04d9, 0x138c, "HOLTEK Twin Shock", 1, "x", JOYB_X }, + { 0x04d9, 0x138c, "HOLTEK Twin Shock", 3, "y", JOYB_Y }, + { 0x04d9, 0x138c, "HOLTEK Twin Shock", 6, "tl", JOYB_TL }, + { 0x04d9, 0x138c, "HOLTEK Twin Shock", 7, "tr", JOYB_TR }, + { 0x04d9, 0x138c, "HOLTEK Twin Shock", 8, "select", JOYB_SELECT }, + { 0x04d9, 0x138c, "HOLTEK Twin Shock", 1, "start", JOYB_START }, + { 0x04d9, 0x138c, "HOLTEK Twin Shock", 8, "mode", JOYB_MODE }, + /* HORI CO.,LTD. HORIPAD S */ + { 0x0f0d, 0x00c1, "HORI CO.,LTD. HORIPAD S", 2, "a", JOYB_A }, + { 0x0f0d, 0x00c1, "HORI CO.,LTD. HORIPAD S", 1, "b", JOYB_B }, + { 0x0f0d, 0x00c1, "HORI CO.,LTD. HORIPAD S", 3, "x", JOYB_X }, + { 0x0f0d, 0x00c1, "HORI CO.,LTD. HORIPAD S", 0, "y", JOYB_Y }, + { 0x0f0d, 0x00c1, "HORI CO.,LTD. HORIPAD S", 4, "tl", JOYB_TL }, + { 0x0f0d, 0x00c1, "HORI CO.,LTD. HORIPAD S", 5, "tr", JOYB_TR }, + { 0x0f0d, 0x00c1, "HORI CO.,LTD. HORIPAD S", 6, "tl2", JOYB_TL2 }, + { 0x0f0d, 0x00c1, "HORI CO.,LTD. HORIPAD S", 7, "tr2", JOYB_TR2 }, + { 0x0f0d, 0x00c1, "HORI CO.,LTD. HORIPAD S", 8, "select", JOYB_SELECT }, + { 0x0f0d, 0x00c1, "HORI CO.,LTD. HORIPAD S", 9, "start", JOYB_START }, + { 0x0f0d, 0x00c1, "HORI CO.,LTD. HORIPAD S", 12, "mode", JOYB_MODE }, /* HORI CO.,LTD. Fighting Commander 4 */ { 0x0f0d, 0x005e, "HORI CO.,LTD. Fighting Commander 4", 2, "a", JOYB_A }, { 0x0f0d, 0x005e, "HORI CO.,LTD. Fighting Commander 4", 1, "b", JOYB_B }, @@ -541,6 +1291,27 @@ { 0x0f0d, 0x0086, "Generic X-Box pad", 6, "select", JOYB_SELECT }, { 0x0f0d, 0x0086, "Generic X-Box pad", 7, "start", JOYB_START }, { 0x0f0d, 0x0086, "Generic X-Box pad", 8, "mode", JOYB_MODE }, + /* HORI Fighting Commander */ + { 0x0f0d, 0x00dc, "HORI Fighting Commander", 0, "a", JOYB_A }, + { 0x0f0d, 0x00dc, "HORI Fighting Commander", 1, "b", JOYB_B }, + { 0x0f0d, 0x00dc, "HORI Fighting Commander", 2, "x", JOYB_X }, + { 0x0f0d, 0x00dc, "HORI Fighting Commander", 3, "y", JOYB_Y }, + { 0x0f0d, 0x00dc, "HORI Fighting Commander", 4, "tl", JOYB_TL }, + { 0x0f0d, 0x00dc, "HORI Fighting Commander", 5, "tr", JOYB_TR }, + { 0x0f0d, 0x00dc, "HORI Fighting Commander", 6, "select", JOYB_SELECT }, + { 0x0f0d, 0x00dc, "HORI Fighting Commander", 7, "start", JOYB_START }, + { 0x0f0d, 0x00dc, "HORI Fighting Commander", 8, "mode", JOYB_MODE }, + /* HORIPAD S */ + { 0x1a34, 0x0203, "HORIPAD S", 2, "a", JOYB_A }, + { 0x1a34, 0x0203, "HORIPAD S", 1, "b", JOYB_B }, + { 0x1a34, 0x0203, "HORIPAD S", 3, "x", JOYB_X }, + { 0x1a34, 0x0203, "HORIPAD S", 0, "y", JOYB_Y }, + { 0x1a34, 0x0203, "HORIPAD S", 4, "tl", JOYB_TL }, + { 0x1a34, 0x0203, "HORIPAD S", 5, "tr", JOYB_TR }, + { 0x1a34, 0x0203, "HORIPAD S", 6, "tl2", JOYB_TL2 }, + { 0x1a34, 0x0203, "HORIPAD S", 7, "tr2", JOYB_TR2 }, + { 0x1a34, 0x0203, "HORIPAD S", 8, "select", JOYB_SELECT }, + { 0x1a34, 0x0203, "HORIPAD S", 9, "start", JOYB_START }, /* Hori Fighting Stick EX2 */ { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", 0, "a", JOYB_A }, { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", 1, "b", JOYB_B }, @@ -562,6 +1333,16 @@ { 0x0f0d, 0x0087, "HORI CO.,LTD. Fighting Stick mini 4", 8, "select", JOYB_SELECT }, { 0x0f0d, 0x0087, "HORI CO.,LTD. Fighting Stick mini 4", 9, "start", JOYB_START }, { 0x0f0d, 0x0087, "HORI CO.,LTD. Fighting Stick mini 4", 12, "mode", JOYB_MODE }, + /* Generic X-Box pad */ + { 0x0f0d, 0x0137, "Generic X-Box pad", 0, "a", JOYB_A }, + { 0x0f0d, 0x0137, "Generic X-Box pad", 1, "b", JOYB_B }, + { 0x0f0d, 0x0137, "Generic X-Box pad", 2, "x", JOYB_X }, + { 0x0f0d, 0x0137, "Generic X-Box pad", 3, "y", JOYB_Y }, + { 0x0f0d, 0x0137, "Generic X-Box pad", 5, "tl", JOYB_TL }, + { 0x0f0d, 0x0137, "Generic X-Box pad", 4, "tl2", JOYB_TL2 }, + { 0x0f0d, 0x0137, "Generic X-Box pad", 6, "select", JOYB_SELECT }, + { 0x0f0d, 0x0137, "Generic X-Box pad", 7, "start", JOYB_START }, + { 0x0f0d, 0x0137, "Generic X-Box pad", 8, "mode", JOYB_MODE }, /* HORIPAD ONE */ { 0x0f0d, 0x0067, "HORIPAD ONE", 1, "a", JOYB_A }, { 0x0f0d, 0x0067, "HORIPAD ONE", 0, "b", JOYB_B }, @@ -572,6 +1353,18 @@ { 0x0f0d, 0x0067, "HORIPAD ONE", 6, "select", JOYB_SELECT }, { 0x0f0d, 0x0067, "HORIPAD ONE", 7, "start", JOYB_START }, { 0x0f0d, 0x0067, "HORIPAD ONE", 8, "mode", JOYB_MODE }, + /* HORI CO.,LTD. HORIPAD mini4 */ + { 0x0f0d, 0x00ee, "HORI CO.,LTD. HORIPAD mini4", 2, "a", JOYB_A }, + { 0x0f0d, 0x00ee, "HORI CO.,LTD. HORIPAD mini4", 1, "b", JOYB_B }, + { 0x0f0d, 0x00ee, "HORI CO.,LTD. HORIPAD mini4", 3, "x", JOYB_X }, + { 0x0f0d, 0x00ee, "HORI CO.,LTD. HORIPAD mini4", 0, "y", JOYB_Y }, + { 0x0f0d, 0x00ee, "HORI CO.,LTD. HORIPAD mini4", 4, "tl", JOYB_TL }, + { 0x0f0d, 0x00ee, "HORI CO.,LTD. HORIPAD mini4", 5, "tr", JOYB_TR }, + { 0x0f0d, 0x00ee, "HORI CO.,LTD. HORIPAD mini4", 6, "tl2", JOYB_TL2 }, + { 0x0f0d, 0x00ee, "HORI CO.,LTD. HORIPAD mini4", 7, "tr2", JOYB_TR2 }, + { 0x0f0d, 0x00ee, "HORI CO.,LTD. HORIPAD mini4", 8, "select", JOYB_SELECT }, + { 0x0f0d, 0x00ee, "HORI CO.,LTD. HORIPAD mini4", 9, "start", JOYB_START }, + { 0x0f0d, 0x00ee, "HORI CO.,LTD. HORIPAD mini4", 12, "mode", JOYB_MODE }, /* HORI CO.,LTD PAD A */ { 0x0f0d, 0x004d, "HORI CO.,LTD PAD A", 1, "a", JOYB_A }, { 0x0f0d, 0x004d, "HORI CO.,LTD PAD A", 2, "b", JOYB_B }, @@ -607,15 +1400,68 @@ { 0x0f0d, 0x006a, "HORI CO.,LTD. Real Arcade Pro.4", 8, "select", JOYB_SELECT }, { 0x0f0d, 0x006a, "HORI CO.,LTD. Real Arcade Pro.4", 9, "start", JOYB_START }, { 0x0f0d, 0x006a, "HORI CO.,LTD. Real Arcade Pro.4", 12, "mode", JOYB_MODE }, - /* HuiJia USB GamePad */ - { 0x0e8f, 0x3013, "HuiJia USB GamePad", 1, "a", JOYB_A }, - { 0x0e8f, 0x3013, "HuiJia USB GamePad", 2, "b", JOYB_B }, - { 0x0e8f, 0x3013, "HuiJia USB GamePad", 0, "x", JOYB_X }, - { 0x0e8f, 0x3013, "HuiJia USB GamePad", 3, "y", JOYB_Y }, - { 0x0e8f, 0x3013, "HuiJia USB GamePad", 6, "tl", JOYB_TL }, - { 0x0e8f, 0x3013, "HuiJia USB GamePad", 7, "tr", JOYB_TR }, - { 0x0e8f, 0x3013, "HuiJia USB GamePad", 8, "select", JOYB_SELECT }, - { 0x0e8f, 0x3013, "HuiJia USB GamePad", 9, "start", JOYB_START }, + /* HORI CO.,LTD. Real Arcade Pro V */ + { 0x0f0d, 0x00aa, "HORI CO.,LTD. Real Arcade Pro V", 2, "a", JOYB_A }, + { 0x0f0d, 0x00aa, "HORI CO.,LTD. Real Arcade Pro V", 1, "b", JOYB_B }, + { 0x0f0d, 0x00aa, "HORI CO.,LTD. Real Arcade Pro V", 3, "x", JOYB_X }, + { 0x0f0d, 0x00aa, "HORI CO.,LTD. Real Arcade Pro V", 0, "y", JOYB_Y }, + { 0x0f0d, 0x00aa, "HORI CO.,LTD. Real Arcade Pro V", 5, "tl", JOYB_TL }, + { 0x0f0d, 0x00aa, "HORI CO.,LTD. Real Arcade Pro V", 7, "tr", JOYB_TR }, + { 0x0f0d, 0x00aa, "HORI CO.,LTD. Real Arcade Pro V", 4, "tl2", JOYB_TL2 }, + { 0x0f0d, 0x00aa, "HORI CO.,LTD. Real Arcade Pro V", 6, "tr2", JOYB_TR2 }, + { 0x0f0d, 0x00aa, "HORI CO.,LTD. Real Arcade Pro V", 8, "select", JOYB_SELECT }, + { 0x0f0d, 0x00aa, "HORI CO.,LTD. Real Arcade Pro V", 9, "start", JOYB_START }, + { 0x0f0d, 0x00aa, "HORI CO.,LTD. Real Arcade Pro V", 12, "mode", JOYB_MODE }, + /* Handheld Daemon Controller */ + { 0x5335, 0x0001, "Handheld Daemon Controller", 1, "a", JOYB_A }, + { 0x5335, 0x0001, "Handheld Daemon Controller", 0, "b", JOYB_B }, + { 0x5335, 0x0001, "Handheld Daemon Controller", 3, "x", JOYB_X }, + { 0x5335, 0x0001, "Handheld Daemon Controller", 2, "y", JOYB_Y }, + { 0x5335, 0x0001, "Handheld Daemon Controller", 4, "tl", JOYB_TL }, + { 0x5335, 0x0001, "Handheld Daemon Controller", 5, "tr", JOYB_TR }, + { 0x5335, 0x0001, "Handheld Daemon Controller", 6, "select", JOYB_SELECT }, + { 0x5335, 0x0001, "Handheld Daemon Controller", 7, "start", JOYB_START }, + /* Handheld Controller */ + { 0x045e, 0x028e, "Handheld Controller", 7, "a", JOYB_A }, + { 0x045e, 0x028e, "Handheld Controller", 6, "b", JOYB_B }, + { 0x045e, 0x028e, "Handheld Controller", 9, "x", JOYB_X }, + { 0x045e, 0x028e, "Handheld Controller", 8, "y", JOYB_Y }, + { 0x045e, 0x028e, "Handheld Controller", 10, "tl", JOYB_TL }, + { 0x045e, 0x028e, "Handheld Controller", 11, "tr", JOYB_TR }, + { 0x045e, 0x028e, "Handheld Controller", 12, "select", JOYB_SELECT }, + { 0x045e, 0x028e, "Handheld Controller", 13, "start", JOYB_START }, + /* Harmonix Xbox 360 Controller */ + { 0x1bad, 0xf900, "Harmonix Xbox 360 Controller", 1, "a", JOYB_A }, + { 0x1bad, 0xf900, "Harmonix Xbox 360 Controller", 0, "b", JOYB_B }, + { 0x1bad, 0xf900, "Harmonix Xbox 360 Controller", 3, "x", JOYB_X }, + { 0x1bad, 0xf900, "Harmonix Xbox 360 Controller", 2, "y", JOYB_Y }, + { 0x1bad, 0xf900, "Harmonix Xbox 360 Controller", 4, "tl", JOYB_TL }, + { 0x1bad, 0xf900, "Harmonix Xbox 360 Controller", 5, "tr", JOYB_TR }, + { 0x1bad, 0xf900, "Harmonix Xbox 360 Controller", 6, "select", JOYB_SELECT }, + { 0x1bad, 0xf900, "Harmonix Xbox 360 Controller", 7, "start", JOYB_START }, + /* Honey Bee QuasiCON */ + { 0x12ab, 0x0002, "Honey Bee QuasiCON", 1, "a", JOYB_A }, + { 0x12ab, 0x0002, "Honey Bee QuasiCON", 0, "b", JOYB_B }, + { 0x12ab, 0x0002, "Honey Bee QuasiCON", 3, "x", JOYB_X }, + { 0x12ab, 0x0002, "Honey Bee QuasiCON", 2, "y", JOYB_Y }, + { 0x12ab, 0x0002, "Honey Bee QuasiCON", 7, "tl", JOYB_TL }, + { 0x12ab, 0x0002, "Honey Bee QuasiCON", 6, "tr", JOYB_TR }, + { 0x12ab, 0x0002, "Honey Bee QuasiCON", 8, "tl2", JOYB_TL2 }, + { 0x12ab, 0x0002, "Honey Bee QuasiCON", 9, "tr2", JOYB_TR2 }, + { 0x12ab, 0x0002, "Honey Bee QuasiCON", 4, "select", JOYB_SELECT }, + { 0x12ab, 0x0002, "Honey Bee QuasiCON", 5, "start", JOYB_START }, + { 0x12ab, 0x0002, "Honey Bee QuasiCON", 8, "mode", JOYB_MODE }, + /* HuiJia JC-W01U */ + { 0x056e, 0x2007, "HuiJia JC-W01U", 3, "a", JOYB_A }, + { 0x056e, 0x2007, "HuiJia JC-W01U", 2, "b", JOYB_B }, + { 0x056e, 0x2007, "HuiJia JC-W01U", 1, "x", JOYB_X }, + { 0x056e, 0x2007, "HuiJia JC-W01U", 0, "y", JOYB_Y }, + { 0x056e, 0x2007, "HuiJia JC-W01U", 4, "tl", JOYB_TL }, + { 0x056e, 0x2007, "HuiJia JC-W01U", 5, "tr", JOYB_TR }, + { 0x056e, 0x2007, "HuiJia JC-W01U", 6, "tl2", JOYB_TL2 }, + { 0x056e, 0x2007, "HuiJia JC-W01U", 7, "tr2", JOYB_TR2 }, + { 0x056e, 0x2007, "HuiJia JC-W01U", 8, "select", JOYB_SELECT }, + { 0x056e, 0x2007, "HuiJia JC-W01U", 9, "start", JOYB_START }, /* USB Gamepad */ { 0x0079, 0x0011, "USB Gamepad", 2, "a", JOYB_A }, { 0x0079, 0x0011, "USB Gamepad", 1, "b", JOYB_B }, @@ -625,6 +1471,13 @@ { 0x0079, 0x0011, "USB Gamepad", 5, "tr", JOYB_TR }, { 0x0079, 0x0011, "USB Gamepad", 8, "select", JOYB_SELECT }, { 0x0079, 0x0011, "USB Gamepad", 9, "start", JOYB_START }, + /* Hyperkin Trooper V2 */ + { 0x2e24, 0x386a, "Hyperkin Trooper V2", 1, "a", JOYB_A }, + { 0x2e24, 0x386a, "Hyperkin Trooper V2", 0, "b", JOYB_B }, + { 0x2e24, 0x386a, "Hyperkin Trooper V2", 2, "tl", JOYB_TL }, + { 0x2e24, 0x386a, "Hyperkin Trooper V2", 3, "tr", JOYB_TR }, + { 0x2e24, 0x386a, "Hyperkin Trooper V2", 4, "select", JOYB_SELECT }, + { 0x2e24, 0x386a, "Hyperkin Trooper V2", 5, "start", JOYB_START }, /* Jess Tech Colour Rumble Pad */ { 0x0f30, 0x0111, "Jess Tech Colour Rumble Pad", 3, "a", JOYB_A }, { 0x0f30, 0x0111, "Jess Tech Colour Rumble Pad", 2, "b", JOYB_B }, @@ -636,7 +1489,6 @@ { 0x0f30, 0x0111, "Jess Tech Colour Rumble Pad", 7, "tr2", JOYB_TR2 }, { 0x0f30, 0x0111, "Jess Tech Colour Rumble Pad", 8, "select", JOYB_SELECT }, { 0x0f30, 0x0111, "Jess Tech Colour Rumble Pad", 9, "start", JOYB_START }, - { 0x0f30, 0x0111, "Jess Tech Colour Rumble Pad", 1, "mode", JOYB_MODE }, /* Jess Tech Dual Analog Rumble Pad */ { 0x0f30, 0x0110, "Jess Tech Dual Analog Rumble Pad", 3, "a", JOYB_A }, { 0x0f30, 0x0110, "Jess Tech Dual Analog Rumble Pad", 2, "b", JOYB_B }, @@ -669,6 +1521,15 @@ { 0x046d, 0xcad1, "Logitech ChillStream PS3/USB Corded Gamepad", 7, "tr2", JOYB_TR2 }, { 0x046d, 0xcad1, "Logitech ChillStream PS3/USB Corded Gamepad", 8, "select", JOYB_SELECT }, { 0x046d, 0xcad1, "Logitech ChillStream PS3/USB Corded Gamepad", 9, "start", JOYB_START }, + /* Logitech Chillstream Controller */ + { 0x046d, 0xc242, "Logitech Chillstream Controller", 1, "a", JOYB_A }, + { 0x046d, 0xc242, "Logitech Chillstream Controller", 0, "b", JOYB_B }, + { 0x046d, 0xc242, "Logitech Chillstream Controller", 3, "x", JOYB_X }, + { 0x046d, 0xc242, "Logitech Chillstream Controller", 2, "y", JOYB_Y }, + { 0x046d, 0xc242, "Logitech Chillstream Controller", 4, "tl", JOYB_TL }, + { 0x046d, 0xc242, "Logitech Chillstream Controller", 5, "tr", JOYB_TR }, + { 0x046d, 0xc242, "Logitech Chillstream Controller", 6, "select", JOYB_SELECT }, + { 0x046d, 0xc242, "Logitech Chillstream Controller", 7, "start", JOYB_START }, /* Logitech Logitech Cordless RumblePad 2 */ { 0x046d, 0xc219, "Logitech Logitech Cordless RumblePad 2", 2, "a", JOYB_A }, { 0x046d, 0xc219, "Logitech Logitech Cordless RumblePad 2", 1, "b", JOYB_B }, @@ -680,6 +1541,18 @@ { 0x046d, 0xc219, "Logitech Logitech Cordless RumblePad 2", 7, "tr2", JOYB_TR2 }, { 0x046d, 0xc219, "Logitech Logitech Cordless RumblePad 2", 8, "select", JOYB_SELECT }, { 0x046d, 0xc219, "Logitech Logitech Cordless RumblePad 2", 9, "start", JOYB_START }, + /* Driving Force GT */ + { 0x046d, 0xc29a, "Driving Force GT", 2, "a", JOYB_A }, + { 0x046d, 0xc29a, "Driving Force GT", 0, "b", JOYB_B }, + { 0x046d, 0xc29a, "Driving Force GT", 3, "x", JOYB_X }, + { 0x046d, 0xc29a, "Driving Force GT", 1, "y", JOYB_Y }, + { 0x046d, 0xc29a, "Driving Force GT", 5, "tl", JOYB_TL }, + { 0x046d, 0xc29a, "Driving Force GT", 4, "tr", JOYB_TR }, + { 0x046d, 0xc29a, "Driving Force GT", 7, "tl2", JOYB_TL2 }, + { 0x046d, 0xc29a, "Driving Force GT", 6, "tr2", JOYB_TR2 }, + { 0x046d, 0xc29a, "Driving Force GT", 8, "select", JOYB_SELECT }, + { 0x046d, 0xc29a, "Driving Force GT", 9, "start", JOYB_START }, + { 0x046d, 0xc29a, "Driving Force GT", 20, "mode", JOYB_MODE }, /* Logitech Logitech Dual Action */ { 0x046d, 0xc216, "Logitech Logitech Dual Action", 2, "a", JOYB_A }, { 0x046d, 0xc216, "Logitech Logitech Dual Action", 1, "b", JOYB_B }, @@ -691,6 +1564,15 @@ { 0x046d, 0xc216, "Logitech Logitech Dual Action", 7, "tr2", JOYB_TR2 }, { 0x046d, 0xc216, "Logitech Logitech Dual Action", 8, "select", JOYB_SELECT }, { 0x046d, 0xc216, "Logitech Logitech Dual Action", 9, "start", JOYB_START }, + /* G27 Racing Wheel */ + { 0x046d, 0xc29b, "G27 Racing Wheel", 2, "a", JOYB_A }, + { 0x046d, 0xc29b, "G27 Racing Wheel", 3, "x", JOYB_X }, + { 0x046d, 0xc29b, "G27 Racing Wheel", 7, "tl", JOYB_TL }, + { 0x046d, 0xc29b, "G27 Racing Wheel", 6, "tr", JOYB_TR }, + { 0x046d, 0xc29b, "G27 Racing Wheel", 20, "tl2", JOYB_TL2 }, + { 0x046d, 0xc29b, "G27 Racing Wheel", 18, "tr2", JOYB_TR2 }, + { 0x046d, 0xc29b, "G27 Racing Wheel", 11, "select", JOYB_SELECT }, + { 0x046d, 0xc29b, "G27 Racing Wheel", 8, "start", JOYB_START }, /* Logitech Gamepad F310 */ { 0x046d, 0xc21d, "Logitech Gamepad F310", 1, "a", JOYB_A }, { 0x046d, 0xc21d, "Logitech Gamepad F310", 0, "b", JOYB_B }, @@ -700,6 +1582,7 @@ { 0x046d, 0xc21d, "Logitech Gamepad F310", 5, "tr", JOYB_TR }, { 0x046d, 0xc21d, "Logitech Gamepad F310", 6, "select", JOYB_SELECT }, { 0x046d, 0xc21d, "Logitech Gamepad F310", 7, "start", JOYB_START }, + { 0x046d, 0xc21d, "Logitech Gamepad F310", 8, "mode", JOYB_MODE }, /* Logitech Gamepad F510 */ { 0x046d, 0xc21e, "Logitech Gamepad F510", 1, "a", JOYB_A }, { 0x046d, 0xc21e, "Logitech Gamepad F510", 0, "b", JOYB_B }, @@ -752,6 +1635,16 @@ { 0x046d, 0xc20b, "Logitech WingMan Action Pad", 0, "tl2", JOYB_TL2 }, { 0x046d, 0xc20b, "Logitech WingMan Action Pad", 2, "tr2", JOYB_TR2 }, { 0x046d, 0xc20b, "Logitech WingMan Action Pad", 8, "start", JOYB_START }, + /* Logitech Inc. WingMan RumblePad */ + { 0x046d, 0xc20a, "Logitech Inc. WingMan RumblePad", 0, "a", JOYB_A }, + { 0x046d, 0xc20a, "Logitech Inc. WingMan RumblePad", 1, "b", JOYB_B }, + { 0x046d, 0xc20a, "Logitech Inc. WingMan RumblePad", 3, "x", JOYB_X }, + { 0x046d, 0xc20a, "Logitech Inc. WingMan RumblePad", 4, "y", JOYB_Y }, + { 0x046d, 0xc20a, "Logitech Inc. WingMan RumblePad", 6, "tl", JOYB_TL }, + { 0x046d, 0xc20a, "Logitech Inc. WingMan RumblePad", 7, "tr", JOYB_TR }, + { 0x046d, 0xc20a, "Logitech Inc. WingMan RumblePad", 2, "tl2", JOYB_TL2 }, + { 0x046d, 0xc20a, "Logitech Inc. WingMan RumblePad", 8, "select", JOYB_SELECT }, + { 0x046d, 0xc20a, "Logitech Inc. WingMan RumblePad", 5, "start", JOYB_START }, /* MAD CATZ ,Ltd. Mad Catz Game Controller */ { 0x0738, 0x4426, "MAD CATZ ,Ltd. Mad Catz Game Controller", 1, "a", JOYB_A }, { 0x0738, 0x4426, "MAD CATZ ,Ltd. Mad Catz Game Controller", 0, "b", JOYB_B }, @@ -775,6 +1668,14 @@ { 0x0079, 0x18d2, "MAGIC-NS", 8, "select", JOYB_SELECT }, { 0x0079, 0x18d2, "MAGIC-NS", 9, "start", JOYB_START }, { 0x0079, 0x18d2, "MAGIC-NS", 12, "mode", JOYB_MODE }, + /* mayflash limited MAYFLASH GameCube Controller Adapter */ + { 0x0079, 0x1843, "mayflash limited MAYFLASH GameCube Controller Adapter", 2, "a", JOYB_A }, + { 0x0079, 0x1843, "mayflash limited MAYFLASH GameCube Controller Adapter", 1, "b", JOYB_B }, + { 0x0079, 0x1843, "mayflash limited MAYFLASH GameCube Controller Adapter", 3, "x", JOYB_X }, + { 0x0079, 0x1843, "mayflash limited MAYFLASH GameCube Controller Adapter", 0, "y", JOYB_Y }, + { 0x0079, 0x1843, "mayflash limited MAYFLASH GameCube Controller Adapter", 4, "tl", JOYB_TL }, + { 0x0079, 0x1843, "mayflash limited MAYFLASH GameCube Controller Adapter", 5, "tr", JOYB_TR }, + { 0x0079, 0x1843, "mayflash limited MAYFLASH GameCube Controller Adapter", 9, "start", JOYB_START }, /* MOSIC SPEED-LINK Competition Pro */ { 0x040b, 0x6533, "MOSIC SPEED-LINK Competition Pro ", 0, "a", JOYB_A }, { 0x040b, 0x6533, "MOSIC SPEED-LINK Competition Pro ", 2, "b", JOYB_B }, @@ -870,17 +1771,58 @@ { 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller", 6, "select", JOYB_SELECT }, { 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller", 7, "start", JOYB_START }, { 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller", 8, "mode", JOYB_MODE }, - /* MAYFLASH Arcade Fightstick F300 */ - { 0x0079, 0x181c, " MAYFLASH Arcade Fightstick F300", 0, "a", JOYB_A }, - { 0x0079, 0x181c, " MAYFLASH Arcade Fightstick F300", 1, "b", JOYB_B }, - { 0x0079, 0x181c, " MAYFLASH Arcade Fightstick F300", 3, "x", JOYB_X }, - { 0x0079, 0x181c, " MAYFLASH Arcade Fightstick F300", 4, "y", JOYB_Y }, - { 0x0079, 0x181c, " MAYFLASH Arcade Fightstick F300", 6, "tl", JOYB_TL }, - { 0x0079, 0x181c, " MAYFLASH Arcade Fightstick F300", 7, "tr", JOYB_TR }, - { 0x0079, 0x181c, " MAYFLASH Arcade Fightstick F300", 8, "tl2", JOYB_TL2 }, - { 0x0079, 0x181c, " MAYFLASH Arcade Fightstick F300", 9, "tr2", JOYB_TR2 }, - { 0x0079, 0x181c, " MAYFLASH Arcade Fightstick F300", 10, "select", JOYB_SELECT }, - { 0x0079, 0x181c, " MAYFLASH Arcade Fightstick F300", 11, "start", JOYB_START }, + /* Magicsee R1 */ + { 0x248a, 0x8266, "Magicsee R1 ", 1, "a", JOYB_A }, + { 0x248a, 0x8266, "Magicsee R1 ", 3, "b", JOYB_B }, + { 0x248a, 0x8266, "Magicsee R1 ", 0, "x", JOYB_X }, + { 0x248a, 0x8266, "Magicsee R1 ", 4, "y", JOYB_Y }, + { 0x248a, 0x8266, "Magicsee R1 ", 7, "select", JOYB_SELECT }, + { 0x248a, 0x8266, "Magicsee R1 ", 6, "start", JOYB_START }, + /* Mayflash Ltd Mayflash MD USB Adapter */ + { 0x0079, 0x1824, "Mayflash Ltd Mayflash MD USB Adapter", 2, "a", JOYB_A }, + { 0x0079, 0x1824, "Mayflash Ltd Mayflash MD USB Adapter", 1, "b", JOYB_B }, + { 0x0079, 0x1824, "Mayflash Ltd Mayflash MD USB Adapter", 4, "x", JOYB_X }, + { 0x0079, 0x1824, "Mayflash Ltd Mayflash MD USB Adapter", 0, "y", JOYB_Y }, + { 0x0079, 0x1824, "Mayflash Ltd Mayflash MD USB Adapter", 3, "tl", JOYB_TL }, + { 0x0079, 0x1824, "Mayflash Ltd Mayflash MD USB Adapter", 6, "tr", JOYB_TR }, + { 0x0079, 0x1824, "Mayflash Ltd Mayflash MD USB Adapter", 7, "select", JOYB_SELECT }, + { 0x0079, 0x1824, "Mayflash Ltd Mayflash MD USB Adapter", 9, "start", JOYB_START }, + /* MAYFLASH Arcade Fightstick F101 */ + { 0x2f24, 0x0037, "MAYFLASH Arcade Fightstick F101", 1, "a", JOYB_A }, + { 0x2f24, 0x0037, "MAYFLASH Arcade Fightstick F101", 2, "b", JOYB_B }, + { 0x2f24, 0x0037, "MAYFLASH Arcade Fightstick F101", 0, "x", JOYB_X }, + { 0x2f24, 0x0037, "MAYFLASH Arcade Fightstick F101", 3, "y", JOYB_Y }, + { 0x2f24, 0x0037, "MAYFLASH Arcade Fightstick F101", 4, "tl", JOYB_TL }, + { 0x2f24, 0x0037, "MAYFLASH Arcade Fightstick F101", 5, "tr", JOYB_TR }, + { 0x2f24, 0x0037, "MAYFLASH Arcade Fightstick F101", 6, "tl2", JOYB_TL2 }, + { 0x2f24, 0x0037, "MAYFLASH Arcade Fightstick F101", 7, "tr2", JOYB_TR2 }, + { 0x2f24, 0x0037, "MAYFLASH Arcade Fightstick F101", 8, "select", JOYB_SELECT }, + { 0x2f24, 0x0037, "MAYFLASH Arcade Fightstick F101", 9, "start", JOYB_START }, + { 0x2f24, 0x0037, "MAYFLASH Arcade Fightstick F101", 12, "mode", JOYB_MODE }, + /* MAYFLASH Arcade Fightstick F101 */ + { 0x2f24, 0x006e, "MAYFLASH Arcade Fightstick F101", 1, "a", JOYB_A }, + { 0x2f24, 0x006e, "MAYFLASH Arcade Fightstick F101", 4, "b", JOYB_B }, + { 0x2f24, 0x006e, "MAYFLASH Arcade Fightstick F101", 0, "x", JOYB_X }, + { 0x2f24, 0x006e, "MAYFLASH Arcade Fightstick F101", 3, "y", JOYB_Y }, + { 0x2f24, 0x006e, "MAYFLASH Arcade Fightstick F101", 6, "tl", JOYB_TL }, + { 0x2f24, 0x006e, "MAYFLASH Arcade Fightstick F101", 7, "tr", JOYB_TR }, + { 0x2f24, 0x006e, "MAYFLASH Arcade Fightstick F101", 8, "tl2", JOYB_TL2 }, + { 0x2f24, 0x006e, "MAYFLASH Arcade Fightstick F101", 9, "tr2", JOYB_TR2 }, + { 0x2f24, 0x006e, "MAYFLASH Arcade Fightstick F101", 10, "select", JOYB_SELECT }, + { 0x2f24, 0x006e, "MAYFLASH Arcade Fightstick F101", 11, "start", JOYB_START }, + { 0x2f24, 0x006e, "MAYFLASH Arcade Fightstick F101", 12, "mode", JOYB_MODE }, + /* MAYFLASH Arcade Fightstick F300/F500 V2 */ + { 0x0079, 0x181c, "MAYFLASH Arcade Fightstick F300/F500 V2", 1, "a", JOYB_A }, + { 0x0079, 0x181c, "MAYFLASH Arcade Fightstick F300/F500 V2", 0, "b", JOYB_B }, + { 0x0079, 0x181c, "MAYFLASH Arcade Fightstick F300/F500 V2", 4, "x", JOYB_X }, + { 0x0079, 0x181c, "MAYFLASH Arcade Fightstick F300/F500 V2", 3, "y", JOYB_Y }, + { 0x0079, 0x181c, "MAYFLASH Arcade Fightstick F300/F500 V2", 6, "tl", JOYB_TL }, + { 0x0079, 0x181c, "MAYFLASH Arcade Fightstick F300/F500 V2", 7, "tr", JOYB_TR }, + { 0x0079, 0x181c, "MAYFLASH Arcade Fightstick F300/F500 V2", 8, "tl2", JOYB_TL2 }, + { 0x0079, 0x181c, "MAYFLASH Arcade Fightstick F300/F500 V2", 9, "tr2", JOYB_TR2 }, + { 0x0079, 0x181c, "MAYFLASH Arcade Fightstick F300/F500 V2", 10, "select", JOYB_SELECT }, + { 0x0079, 0x181c, "MAYFLASH Arcade Fightstick F300/F500 V2", 11, "start", JOYB_START }, + { 0x0079, 0x181c, "MAYFLASH Arcade Fightstick F300/F500 V2", 12, "mode", JOYB_MODE }, /* MAYFLASH Arcade Fightstick F300 */ { 0x0079, 0x1830, "MAYFLASH Arcade Fightstick F300", 1, "a", JOYB_A }, { 0x0079, 0x1830, "MAYFLASH Arcade Fightstick F300", 2, "b", JOYB_B }, @@ -908,15 +1850,15 @@ { 0x0e8f, 0x3013, "HuiJia USB GamePad", 8, "tl2", JOYB_TL2 }, { 0x0e8f, 0x3013, "HuiJia USB GamePad", 9, "start", JOYB_START }, /* HuiJia USB GamePad */ - { 0x0e8f, 0x3010, "HuiJia USB GamePad", 18, "a", JOYB_A }, - { 0x0e8f, 0x3010, "HuiJia USB GamePad", 17, "b", JOYB_B }, - { 0x0e8f, 0x3010, "HuiJia USB GamePad", 19, "x", JOYB_X }, - { 0x0e8f, 0x3010, "HuiJia USB GamePad", 16, "y", JOYB_Y }, - { 0x0e8f, 0x3010, "HuiJia USB GamePad", 21, "tl", JOYB_TL }, - { 0x0e8f, 0x3010, "HuiJia USB GamePad", 23, "tr", JOYB_TR }, - { 0x0e8f, 0x3010, "HuiJia USB GamePad", 20, "tl2", JOYB_TL2 }, - { 0x0e8f, 0x3010, "HuiJia USB GamePad", 22, "tr2", JOYB_TR2 }, - { 0x0e8f, 0x3010, "HuiJia USB GamePad", 25, "start", JOYB_START }, + { 0x0e8f, 0x3010, "HuiJia USB GamePad", 1, "a", JOYB_A }, + { 0x0e8f, 0x3010, "HuiJia USB GamePad", 0, "b", JOYB_B }, + { 0x0e8f, 0x3010, "HuiJia USB GamePad", 4, "x", JOYB_X }, + { 0x0e8f, 0x3010, "HuiJia USB GamePad", 3, "y", JOYB_Y }, + { 0x0e8f, 0x3010, "HuiJia USB GamePad", 6, "tl", JOYB_TL }, + { 0x0e8f, 0x3010, "HuiJia USB GamePad", 2, "tr", JOYB_TR }, + { 0x0e8f, 0x3010, "HuiJia USB GamePad", 5, "tl2", JOYB_TL2 }, + { 0x0e8f, 0x3010, "HuiJia USB GamePad", 7, "tr2", JOYB_TR2 }, + { 0x0e8f, 0x3010, "HuiJia USB GamePad", 9, "start", JOYB_START }, /* Mega World Thrustmaster dual analog 3.2 */ { 0x044f, 0xb315, "Mega World Thrustmaster dual analog 3.2", 2, "a", JOYB_A }, { 0x044f, 0xb315, "Mega World Thrustmaster dual analog 3.2", 0, "b", JOYB_B }, @@ -937,6 +1879,17 @@ { 0x07b5, 0x0213, "Mega World USB 2-Axis 8-Button Gamepad", 6, "tr", JOYB_TR }, { 0x07b5, 0x0213, "Mega World USB 2-Axis 8-Button Gamepad", 5, "select", JOYB_SELECT }, { 0x07b5, 0x0213, "Mega World USB 2-Axis 8-Button Gamepad", 7, "start", JOYB_START }, + /* Mega World USB Game Controllers */ + { 0x07b5, 0x0314, "Mega World USB Game Controllers", 3, "a", JOYB_A }, + { 0x07b5, 0x0314, "Mega World USB Game Controllers", 2, "b", JOYB_B }, + { 0x07b5, 0x0314, "Mega World USB Game Controllers", 1, "x", JOYB_X }, + { 0x07b5, 0x0314, "Mega World USB Game Controllers", 0, "y", JOYB_Y }, + { 0x07b5, 0x0314, "Mega World USB Game Controllers", 4, "tl", JOYB_TL }, + { 0x07b5, 0x0314, "Mega World USB Game Controllers", 6, "tr", JOYB_TR }, + { 0x07b5, 0x0314, "Mega World USB Game Controllers", 5, "tl2", JOYB_TL2 }, + { 0x07b5, 0x0314, "Mega World USB Game Controllers", 7, "tr2", JOYB_TR2 }, + { 0x07b5, 0x0314, "Mega World USB Game Controllers", 8, "select", JOYB_SELECT }, + { 0x07b5, 0x0314, "Mega World USB Game Controllers", 9, "start", JOYB_START }, /* Microntek USB Joystick */ { 0x0079, 0x0006, "Microntek USB Joystick ", 1, "a", JOYB_A }, { 0x0079, 0x0006, "Microntek USB Joystick ", 2, "b", JOYB_B }, @@ -948,6 +1901,16 @@ { 0x0079, 0x0006, "Microntek USB Joystick ", 7, "tr2", JOYB_TR2 }, { 0x0079, 0x0006, "Microntek USB Joystick ", 8, "select", JOYB_SELECT }, { 0x0079, 0x0006, "Microntek USB Joystick ", 9, "start", JOYB_START }, + /* Microsoft X-Box 360 pad */ + { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 1, "a", JOYB_A }, + { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, "b", JOYB_B }, + { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 3, "x", JOYB_X }, + { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 2, "y", JOYB_Y }, + { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 4, "tl", JOYB_TL }, + { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 5, "tr", JOYB_TR }, + { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 6, "select", JOYB_SELECT }, + { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 7, "start", JOYB_START }, + { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 8, "mode", JOYB_MODE }, /* Microsoft® Microsoft® SideWinder® Game Pad USB */ { 0x045e, 0x0007, "Microsoft® Microsoft® SideWinder® Game Pad USB", 1, "a", JOYB_A }, { 0x045e, 0x0007, "Microsoft® Microsoft® SideWinder® Game Pad USB", 0, "b", JOYB_B }, @@ -976,16 +1939,15 @@ { 0x045e, 0x0028, "Microsoft SideWinder Dual Strike USB version 1.0", 5, "select", JOYB_SELECT }, { 0x045e, 0x0028, "Microsoft SideWinder Dual Strike USB version 1.0", 4, "start", JOYB_START }, { 0x045e, 0x0028, "Microsoft SideWinder Dual Strike USB version 1.0", 8, "mode", JOYB_MODE }, - /* Microsoft X-Box 360 pad */ - { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 1, "a", JOYB_A }, - { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, "b", JOYB_B }, - { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 3, "x", JOYB_X }, - { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 2, "y", JOYB_Y }, - { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 4, "tl", JOYB_TL }, - { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 5, "tr", JOYB_TR }, - { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 6, "select", JOYB_SELECT }, - { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 7, "start", JOYB_START }, - { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 8, "mode", JOYB_MODE }, + /* Generic X-Box pad */ + { 0x045e, 0x0b00, "Generic X-Box pad", 1, "a", JOYB_A }, + { 0x045e, 0x0b00, "Generic X-Box pad", 0, "b", JOYB_B }, + { 0x045e, 0x0b00, "Generic X-Box pad", 3, "x", JOYB_X }, + { 0x045e, 0x0b00, "Generic X-Box pad", 2, "y", JOYB_Y }, + { 0x045e, 0x0b00, "Generic X-Box pad", 4, "tl", JOYB_TL }, + { 0x045e, 0x0b00, "Generic X-Box pad", 5, "tr", JOYB_TR }, + { 0x045e, 0x0b00, "Generic X-Box pad", 6, "select", JOYB_SELECT }, + { 0x045e, 0x0b00, "Generic X-Box pad", 7, "start", JOYB_START }, /* Microsoft X-Box One Elite pad */ { 0x045e, 0x02e3, "Microsoft X-Box One Elite pad", 1, "a", JOYB_A }, { 0x045e, 0x02e3, "Microsoft X-Box One Elite pad", 0, "b", JOYB_B }, @@ -1034,6 +1996,17 @@ { 0x045e, 0x02dd, "Microsoft X-Box One pad (Firmware 2015)", 5, "tr", JOYB_TR }, { 0x045e, 0x02dd, "Microsoft X-Box One pad (Firmware 2015)", 6, "select", JOYB_SELECT }, { 0x045e, 0x02dd, "Microsoft X-Box One pad (Firmware 2015)", 7, "start", JOYB_START }, + { 0x045e, 0x02dd, "Microsoft X-Box One pad (Firmware 2015)", 8, "mode", JOYB_MODE }, + /* Microsoft X-Box Series X|S pad */ + { 0x045e, 0x0b12, "Microsoft X-Box Series X|S pad", 1, "a", JOYB_A }, + { 0x045e, 0x0b12, "Microsoft X-Box Series X|S pad", 0, "b", JOYB_B }, + { 0x045e, 0x0b12, "Microsoft X-Box Series X|S pad", 3, "x", JOYB_X }, + { 0x045e, 0x0b12, "Microsoft X-Box Series X|S pad", 2, "y", JOYB_Y }, + { 0x045e, 0x0b12, "Microsoft X-Box Series X|S pad", 4, "tl", JOYB_TL }, + { 0x045e, 0x0b12, "Microsoft X-Box Series X|S pad", 5, "tr", JOYB_TR }, + { 0x045e, 0x0b12, "Microsoft X-Box Series X|S pad", 6, "select", JOYB_SELECT }, + { 0x045e, 0x0b12, "Microsoft X-Box Series X|S pad", 7, "start", JOYB_START }, + { 0x045e, 0x0b12, "Microsoft X-Box Series X|S pad", 8, "mode", JOYB_MODE }, /* Microsoft X-Box pad (Japan) */ { 0x045e, 0x0285, "Microsoft X-Box pad (Japan)", 1, "a", JOYB_A }, { 0x045e, 0x0285, "Microsoft X-Box pad (Japan)", 0, "b", JOYB_B }, @@ -1061,6 +2034,25 @@ { 0x045e, 0x0289, "Microsoft X-Box pad v2 (US)", 2, "tr", JOYB_TR }, { 0x045e, 0x0289, "Microsoft X-Box pad v2 (US)", 6, "select", JOYB_SELECT }, { 0x045e, 0x0289, "Microsoft X-Box pad v2 (US)", 7, "start", JOYB_START }, + /* MOCUTE-032_B43-0F1E */ + { 0x0005, 0x05ac, "MOCUTE-032_B43-0F1E", 12, "a", JOYB_A }, + { 0x0005, 0x05ac, "MOCUTE-032_B43-0F1E", 13, "b", JOYB_B }, + { 0x0005, 0x05ac, "MOCUTE-032_B43-0F1E", 14, "x", JOYB_X }, + { 0x0005, 0x05ac, "MOCUTE-032_B43-0F1E", 15, "y", JOYB_Y }, + { 0x0005, 0x05ac, "MOCUTE-032_B43-0F1E", 19, "tl", JOYB_TL }, + { 0x0005, 0x05ac, "MOCUTE-032_B43-0F1E", 17, "tr", JOYB_TR }, + { 0x0005, 0x05ac, "MOCUTE-032_B43-0F1E", 16, "tl2", JOYB_TL2 }, + { 0x0005, 0x05ac, "MOCUTE-032_B43-0F1E", 20, "tr2", JOYB_TR2 }, + { 0x0005, 0x05ac, "MOCUTE-032_B43-0F1E", 21, "start", JOYB_START }, + /* Moga Pro HID */ + { 0x20d6, 0x0dad, "Moga Pro HID", 1, "a", JOYB_A }, + { 0x20d6, 0x0dad, "Moga Pro HID", 0, "b", JOYB_B }, + { 0x20d6, 0x0dad, "Moga Pro HID", 3, "x", JOYB_X }, + { 0x20d6, 0x0dad, "Moga Pro HID", 2, "y", JOYB_Y }, + { 0x20d6, 0x0dad, "Moga Pro HID", 4, "tl", JOYB_TL }, + { 0x20d6, 0x0dad, "Moga Pro HID", 5, "tr", JOYB_TR }, + { 0x20d6, 0x0dad, "Moga Pro HID", 9, "select", JOYB_SELECT }, + { 0x20d6, 0x0dad, "Moga Pro HID", 6, "start", JOYB_START }, /* NVIDIA Corporation NVIDIA Controller v01.04 */ { 0x0955, 0x7214, "NVIDIA Corporation NVIDIA Controller v01.04", 1, "a", JOYB_A }, { 0x0955, 0x7214, "NVIDIA Corporation NVIDIA Controller v01.04", 0, "b", JOYB_B }, @@ -1078,6 +2070,42 @@ { 0x0955, 0x7210, "NVIDIA Corporation NVIDIA Controller v01.03", 9, "tr", JOYB_TR }, { 0x0955, 0x7210, "NVIDIA Corporation NVIDIA Controller v01.03", 3, "select", JOYB_SELECT }, { 0x0955, 0x7210, "NVIDIA Corporation NVIDIA Controller v01.03", 11, "start", JOYB_START }, + /* Nintendo Co., Ltd. Pro Controller */ + { 0x057e, 0x2009, "Nintendo Co., Ltd. Pro Controller", 1, "a", JOYB_A }, + { 0x057e, 0x2009, "Nintendo Co., Ltd. Pro Controller", 0, "b", JOYB_B }, + { 0x057e, 0x2009, "Nintendo Co., Ltd. Pro Controller", 2, "x", JOYB_X }, + { 0x057e, 0x2009, "Nintendo Co., Ltd. Pro Controller", 3, "y", JOYB_Y }, + { 0x057e, 0x2009, "Nintendo Co., Ltd. Pro Controller", 5, "tl", JOYB_TL }, + { 0x057e, 0x2009, "Nintendo Co., Ltd. Pro Controller", 6, "tr", JOYB_TR }, + { 0x057e, 0x2009, "Nintendo Co., Ltd. Pro Controller", 7, "tl2", JOYB_TL2 }, + { 0x057e, 0x2009, "Nintendo Co., Ltd. Pro Controller", 8, "tr2", JOYB_TR2 }, + { 0x057e, 0x2009, "Nintendo Co., Ltd. Pro Controller", 9, "select", JOYB_SELECT }, + { 0x057e, 0x2009, "Nintendo Co., Ltd. Pro Controller", 10, "start", JOYB_START }, + { 0x057e, 0x2009, "Nintendo Co., Ltd. Pro Controller", 11, "mode", JOYB_MODE }, + /* N64 Controller */ + { 0x057e, 0x2019, "N64 Controller", 1, "a", JOYB_A }, + { 0x057e, 0x2019, "N64 Controller", 0, "b", JOYB_B }, + { 0x057e, 0x2019, "N64 Controller", 4, "tl", JOYB_TL }, + { 0x057e, 0x2019, "N64 Controller", 5, "tr", JOYB_TR }, + { 0x057e, 0x2019, "N64 Controller", 6, "tl2", JOYB_TL2 }, + { 0x057e, 0x2019, "N64 Controller", 10, "tr2", JOYB_TR2 }, + { 0x057e, 0x2019, "N64 Controller", 13, "select", JOYB_SELECT }, + { 0x057e, 0x2019, "N64 Controller", 9, "start", JOYB_START }, + { 0x057e, 0x2019, "N64 Controller", 12, "mode", JOYB_MODE }, + /* Nintendo Switch Online NES Controller (L) */ + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (L)", 1, "a", JOYB_A }, + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (L)", 0, "b", JOYB_B }, + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (L)", 4, "tl", JOYB_TL }, + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (L)", 5, "tr", JOYB_TR }, + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (L)", 8, "select", JOYB_SELECT }, + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (L)", 9, "start", JOYB_START }, + /* Nintendo Switch Online NES Controller (R) */ + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (R)", 1, "a", JOYB_A }, + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (R)", 0, "b", JOYB_B }, + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (R)", 4, "tl", JOYB_TL }, + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (R)", 5, "tr", JOYB_TR }, + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (R)", 8, "select", JOYB_SELECT }, + { 0x057e, 0x2007, "Nintendo Switch Online NES Controller (R)", 9, "start", JOYB_START }, /* Nintendo Wii Remote Pro Controller */ { 0x057e, 0x0330, "Nintendo Wii Remote Pro Controller", 1, "a", JOYB_A }, { 0x057e, 0x0330, "Nintendo Wii Remote Pro Controller", 0, "b", JOYB_B }, @@ -1090,6 +2118,38 @@ { 0x057e, 0x0330, "Nintendo Wii Remote Pro Controller", 8, "select", JOYB_SELECT }, { 0x057e, 0x0330, "Nintendo Wii Remote Pro Controller", 9, "start", JOYB_START }, { 0x057e, 0x0330, "Nintendo Wii Remote Pro Controller", 10, "mode", JOYB_MODE }, + /* Performance Designed Products Wired Fight Pad Pro for Nintendo */ + { 0x0e6f, 0x0185, "Performance Designed Products Wired Fight Pad Pro for Nintendo ", 2, "a", JOYB_A }, + { 0x0e6f, 0x0185, "Performance Designed Products Wired Fight Pad Pro for Nintendo ", 1, "b", JOYB_B }, + { 0x0e6f, 0x0185, "Performance Designed Products Wired Fight Pad Pro for Nintendo ", 3, "x", JOYB_X }, + { 0x0e6f, 0x0185, "Performance Designed Products Wired Fight Pad Pro for Nintendo ", 0, "y", JOYB_Y }, + { 0x0e6f, 0x0185, "Performance Designed Products Wired Fight Pad Pro for Nintendo ", 4, "tl", JOYB_TL }, + { 0x0e6f, 0x0185, "Performance Designed Products Wired Fight Pad Pro for Nintendo ", 5, "tr", JOYB_TR }, + { 0x0e6f, 0x0185, "Performance Designed Products Wired Fight Pad Pro for Nintendo ", 6, "tl2", JOYB_TL2 }, + { 0x0e6f, 0x0185, "Performance Designed Products Wired Fight Pad Pro for Nintendo ", 7, "tr2", JOYB_TR2 }, + { 0x0e6f, 0x0185, "Performance Designed Products Wired Fight Pad Pro for Nintendo ", 8, "select", JOYB_SELECT }, + { 0x0e6f, 0x0185, "Performance Designed Products Wired Fight Pad Pro for Nintendo ", 9, "start", JOYB_START }, + { 0x0e6f, 0x0185, "Performance Designed Products Wired Fight Pad Pro for Nintendo ", 12, "mode", JOYB_MODE }, + /* PDP Wired Controller for Xbox One - Camo Series */ + { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 1, "a", JOYB_A }, + { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 0, "b", JOYB_B }, + { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 3, "x", JOYB_X }, + { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 2, "y", JOYB_Y }, + { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 4, "tl", JOYB_TL }, + { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 5, "tr", JOYB_TR }, + { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 6, "select", JOYB_SELECT }, + { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 7, "start", JOYB_START }, + { 0x0e6f, 0x02a6, "PDP Wired Controller for Xbox One - Camo Series", 8, "mode", JOYB_MODE }, + /* PDP Wired Controller for Xbox One - Stealth Series */ + { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 1, "a", JOYB_A }, + { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 0, "b", JOYB_B }, + { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 3, "x", JOYB_X }, + { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 2, "y", JOYB_Y }, + { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 4, "tl", JOYB_TL }, + { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 5, "tr", JOYB_TR }, + { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 6, "select", JOYB_SELECT }, + { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 7, "start", JOYB_START }, + { 0x0e6f, 0x02a4, "PDP Wired Controller for Xbox One - Stealth Series", 8, "mode", JOYB_MODE }, /* USB,4-Axis,12-Button with POV */ { 0x0583, 0xb031, "USB,4-Axis,12-Button with POV", 2, "a", JOYB_A }, { 0x0583, 0xb031, "USB,4-Axis,12-Button with POV", 1, "b", JOYB_B }, @@ -1101,6 +2161,17 @@ { 0x0583, 0xb031, "USB,4-Axis,12-Button with POV", 7, "tr2", JOYB_TR2 }, { 0x0583, 0xb031, "USB,4-Axis,12-Button with POV", 8, "select", JOYB_SELECT }, { 0x0583, 0xb031, "USB,4-Axis,12-Button with POV", 9, "start", JOYB_START }, + /* Sony Interactive Entertainment Controller */ + { 0x054c, 0x0cda, "Sony Interactive Entertainment Controller", 1, "a", JOYB_A }, + { 0x054c, 0x0cda, "Sony Interactive Entertainment Controller", 2, "b", JOYB_B }, + { 0x054c, 0x0cda, "Sony Interactive Entertainment Controller", 0, "x", JOYB_X }, + { 0x054c, 0x0cda, "Sony Interactive Entertainment Controller", 3, "y", JOYB_Y }, + { 0x054c, 0x0cda, "Sony Interactive Entertainment Controller", 6, "tl", JOYB_TL }, + { 0x054c, 0x0cda, "Sony Interactive Entertainment Controller", 7, "tr", JOYB_TR }, + { 0x054c, 0x0cda, "Sony Interactive Entertainment Controller", 4, "tl2", JOYB_TL2 }, + { 0x054c, 0x0cda, "Sony Interactive Entertainment Controller", 5, "tr2", JOYB_TR2 }, + { 0x054c, 0x0cda, "Sony Interactive Entertainment Controller", 8, "select", JOYB_SELECT }, + { 0x054c, 0x0cda, "Sony Interactive Entertainment Controller", 9, "start", JOYB_START }, /* playsega controller */ { 0x0e8f, 0x0041, "playsega controller", 2, "a", JOYB_A }, { 0x0e8f, 0x0041, "playsega controller", 1, "b", JOYB_B }, @@ -1111,18 +2182,78 @@ { 0x0e8f, 0x0041, "playsega controller", 6, "tl2", JOYB_TL2 }, { 0x0e8f, 0x0041, "playsega controller", 7, "tr2", JOYB_TR2 }, { 0x0e8f, 0x0041, "playsega controller", 8, "start", JOYB_START }, - /* Pro Controller */ - { 0x057e, 0x2009, "Pro Controller", 1, "a", JOYB_A }, - { 0x057e, 0x2009, "Pro Controller", 0, "b", JOYB_B }, - { 0x057e, 0x2009, "Pro Controller", 3, "x", JOYB_X }, - { 0x057e, 0x2009, "Pro Controller", 2, "y", JOYB_Y }, - { 0x057e, 0x2009, "Pro Controller", 4, "tl", JOYB_TL }, - { 0x057e, 0x2009, "Pro Controller", 5, "tr", JOYB_TR }, - { 0x057e, 0x2009, "Pro Controller", 6, "tl2", JOYB_TL2 }, - { 0x057e, 0x2009, "Pro Controller", 7, "tr2", JOYB_TR2 }, - { 0x057e, 0x2009, "Pro Controller", 8, "select", JOYB_SELECT }, - { 0x057e, 0x2009, "Pro Controller", 9, "start", JOYB_START }, - { 0x057e, 0x2009, "Pro Controller", 12, "mode", JOYB_MODE }, + /* HORI CO.,LTD. POKKEN CONTROLLER */ + { 0x0f0d, 0x0092, "HORI CO.,LTD. POKKEN CONTROLLER", 2, "a", JOYB_A }, + { 0x0f0d, 0x0092, "HORI CO.,LTD. POKKEN CONTROLLER", 1, "b", JOYB_B }, + { 0x0f0d, 0x0092, "HORI CO.,LTD. POKKEN CONTROLLER", 3, "x", JOYB_X }, + { 0x0f0d, 0x0092, "HORI CO.,LTD. POKKEN CONTROLLER", 0, "y", JOYB_Y }, + { 0x0f0d, 0x0092, "HORI CO.,LTD. POKKEN CONTROLLER", 4, "tl", JOYB_TL }, + { 0x0f0d, 0x0092, "HORI CO.,LTD. POKKEN CONTROLLER", 5, "tr", JOYB_TR }, + { 0x0f0d, 0x0092, "HORI CO.,LTD. POKKEN CONTROLLER", 6, "tl2", JOYB_TL2 }, + { 0x0f0d, 0x0092, "HORI CO.,LTD. POKKEN CONTROLLER", 7, "tr2", JOYB_TR2 }, + { 0x0f0d, 0x0092, "HORI CO.,LTD. POKKEN CONTROLLER", 8, "select", JOYB_SELECT }, + { 0x0f0d, 0x0092, "HORI CO.,LTD. POKKEN CONTROLLER", 9, "start", JOYB_START }, + { 0x0f0d, 0x0092, "HORI CO.,LTD. POKKEN CONTROLLER", 12, "mode", JOYB_MODE }, + /* PowerA NSW wired controller */ + { 0x20d6, 0xa713, "PowerA NSW wired controller", 2, "a", JOYB_A }, + { 0x20d6, 0xa713, "PowerA NSW wired controller", 1, "b", JOYB_B }, + { 0x20d6, 0xa713, "PowerA NSW wired controller", 3, "x", JOYB_X }, + { 0x20d6, 0xa713, "PowerA NSW wired controller", 0, "y", JOYB_Y }, + { 0x20d6, 0xa713, "PowerA NSW wired controller", 4, "tl", JOYB_TL }, + { 0x20d6, 0xa713, "PowerA NSW wired controller", 5, "tr", JOYB_TR }, + { 0x20d6, 0xa713, "PowerA NSW wired controller", 6, "tl2", JOYB_TL2 }, + { 0x20d6, 0xa713, "PowerA NSW wired controller", 7, "tr2", JOYB_TR2 }, + { 0x20d6, 0xa713, "PowerA NSW wired controller", 8, "select", JOYB_SELECT }, + { 0x20d6, 0xa713, "PowerA NSW wired controller", 9, "start", JOYB_START }, + { 0x20d6, 0xa713, "PowerA NSW wired controller", 12, "mode", JOYB_MODE }, + /* PowerA Wired Switch Controller - Zelda: Breath of the Wild Edition */ + { 0x20d6, 0xa711, "PowerA Wired Switch Controller - Zelda: Breath of the Wild Edition", 2, "a", JOYB_A }, + { 0x20d6, 0xa711, "PowerA Wired Switch Controller - Zelda: Breath of the Wild Edition", 1, "b", JOYB_B }, + { 0x20d6, 0xa711, "PowerA Wired Switch Controller - Zelda: Breath of the Wild Edition", 3, "x", JOYB_X }, + { 0x20d6, 0xa711, "PowerA Wired Switch Controller - Zelda: Breath of the Wild Edition", 0, "y", JOYB_Y }, + { 0x20d6, 0xa711, "PowerA Wired Switch Controller - Zelda: Breath of the Wild Edition", 4, "tl", JOYB_TL }, + { 0x20d6, 0xa711, "PowerA Wired Switch Controller - Zelda: Breath of the Wild Edition", 5, "tr", JOYB_TR }, + { 0x20d6, 0xa711, "PowerA Wired Switch Controller - Zelda: Breath of the Wild Edition", 6, "tl2", JOYB_TL2 }, + { 0x20d6, 0xa711, "PowerA Wired Switch Controller - Zelda: Breath of the Wild Edition", 7, "tr2", JOYB_TR2 }, + { 0x20d6, 0xa711, "PowerA Wired Switch Controller - Zelda: Breath of the Wild Edition", 8, "select", JOYB_SELECT }, + { 0x20d6, 0xa711, "PowerA Wired Switch Controller - Zelda: Breath of the Wild Edition", 9, "start", JOYB_START }, + /* Jess Technology Co., Ltd. QanBa Joystick Plus */ + { 0x0f30, 0x1012, "Jess Technology Co., Ltd. QanBa Joystick Plus", 1, "a", JOYB_A }, + { 0x0f30, 0x1012, "Jess Technology Co., Ltd. QanBa Joystick Plus", 0, "b", JOYB_B }, + { 0x0f30, 0x1012, "Jess Technology Co., Ltd. QanBa Joystick Plus", 3, "x", JOYB_X }, + { 0x0f30, 0x1012, "Jess Technology Co., Ltd. QanBa Joystick Plus", 2, "y", JOYB_Y }, + { 0x0f30, 0x1012, "Jess Technology Co., Ltd. QanBa Joystick Plus", 4, "tl", JOYB_TL }, + { 0x0f30, 0x1012, "Jess Technology Co., Ltd. QanBa Joystick Plus", 6, "tr", JOYB_TR }, + { 0x0f30, 0x1012, "Jess Technology Co., Ltd. QanBa Joystick Plus", 5, "tl2", JOYB_TL2 }, + { 0x0f30, 0x1012, "Jess Technology Co., Ltd. QanBa Joystick Plus", 7, "tr2", JOYB_TR2 }, + { 0x0f30, 0x1012, "Jess Technology Co., Ltd. QanBa Joystick Plus", 8, "select", JOYB_SELECT }, + { 0x0f30, 0x1012, "Jess Technology Co., Ltd. QanBa Joystick Plus", 9, "start", JOYB_START }, + /* Qnyx Snes Replica */ + { 0x081f, 0xe401, "Qnyx Snes Replica", 1, "a", JOYB_A }, + { 0x081f, 0xe401, "Qnyx Snes Replica", 2, "b", JOYB_B }, + { 0x081f, 0xe401, "Qnyx Snes Replica", 0, "x", JOYB_X }, + { 0x081f, 0xe401, "Qnyx Snes Replica", 3, "y", JOYB_Y }, + { 0x081f, 0xe401, "Qnyx Snes Replica", 4, "tl", JOYB_TL }, + { 0x081f, 0xe401, "Qnyx Snes Replica", 5, "tr", JOYB_TR }, + { 0x081f, 0xe401, "Qnyx Snes Replica", 8, "select", JOYB_SELECT }, + { 0x081f, 0xe401, "Qnyx Snes Replica", 9, "start", JOYB_START }, + /* Licensed by Sony Computer Entertainment Guitar Hero4 for PlayStation (R) 3 */ + { 0x12ba, 0x0100, "Licensed by Sony Computer Entertainment Guitar Hero4 for PlayStation (R) 3", 2, "a", JOYB_A }, + { 0x12ba, 0x0100, "Licensed by Sony Computer Entertainment Guitar Hero4 for PlayStation (R) 3", 1, "b", JOYB_B }, + { 0x12ba, 0x0100, "Licensed by Sony Computer Entertainment Guitar Hero4 for PlayStation (R) 3", 3, "x", JOYB_X }, + { 0x12ba, 0x0100, "Licensed by Sony Computer Entertainment Guitar Hero4 for PlayStation (R) 3", 0, "y", JOYB_Y }, + { 0x12ba, 0x0100, "Licensed by Sony Computer Entertainment Guitar Hero4 for PlayStation (R) 3", 4, "tl", JOYB_TL }, + { 0x12ba, 0x0100, "Licensed by Sony Computer Entertainment Guitar Hero4 for PlayStation (R) 3", 8, "select", JOYB_SELECT }, + { 0x12ba, 0x0100, "Licensed by Sony Computer Entertainment Guitar Hero4 for PlayStation (R) 3", 9, "start", JOYB_START }, + { 0x12ba, 0x0100, "Licensed by Sony Computer Entertainment Guitar Hero4 for PlayStation (R) 3", 12, "mode", JOYB_MODE }, + /* RedOctane MIDI Drum GuitarHero for Playstation (R) 3 */ + { 0x12ba, 0x0120, "RedOctane MIDI Drum GuitarHero for Playstation (R) 3", 2, "a", JOYB_A }, + { 0x12ba, 0x0120, "RedOctane MIDI Drum GuitarHero for Playstation (R) 3", 1, "b", JOYB_B }, + { 0x12ba, 0x0120, "RedOctane MIDI Drum GuitarHero for Playstation (R) 3", 3, "x", JOYB_X }, + { 0x12ba, 0x0120, "RedOctane MIDI Drum GuitarHero for Playstation (R) 3", 0, "y", JOYB_Y }, + { 0x12ba, 0x0120, "RedOctane MIDI Drum GuitarHero for Playstation (R) 3", 8, "select", JOYB_SELECT }, + { 0x12ba, 0x0120, "RedOctane MIDI Drum GuitarHero for Playstation (R) 3", 9, "start", JOYB_START }, + { 0x12ba, 0x0120, "RedOctane MIDI Drum GuitarHero for Playstation (R) 3", 12, "mode", JOYB_MODE }, /* 8Bitdo N64 GamePad */ { 0x2dc8, 0x3830, "8Bitdo N64 GamePad", 0, "a", JOYB_A }, { 0x2dc8, 0x3830, "8Bitdo N64 GamePad", 1, "b", JOYB_B }, @@ -1137,11 +2268,43 @@ { 0x2dc8, 0x9002, "8Bitdo N64 8Bitdo N64 ", 7, "tr", JOYB_TR }, { 0x2dc8, 0x9002, "8Bitdo N64 8Bitdo N64 ", 10, "tl2", JOYB_TL2 }, { 0x2dc8, 0x9002, "8Bitdo N64 8Bitdo N64 ", 11, "start", JOYB_START }, + /* SWITCH CO.,LTD. USB Gamepad */ + { 0x0079, 0x0011, "SWITCH CO.,LTD. USB Gamepad ", 2, "a", JOYB_A }, + { 0x0079, 0x0011, "SWITCH CO.,LTD. USB Gamepad ", 1, "b", JOYB_B }, + { 0x0079, 0x0011, "SWITCH CO.,LTD. USB Gamepad ", 3, "x", JOYB_X }, + { 0x0079, 0x0011, "SWITCH CO.,LTD. USB Gamepad ", 0, "y", JOYB_Y }, + { 0x0079, 0x0011, "SWITCH CO.,LTD. USB Gamepad ", 5, "tl", JOYB_TL }, + { 0x0079, 0x0011, "SWITCH CO.,LTD. USB Gamepad ", 4, "tr", JOYB_TR }, + { 0x0079, 0x0011, "SWITCH CO.,LTD. USB Gamepad ", 6, "tl2", JOYB_TL2 }, + { 0x0079, 0x0011, "SWITCH CO.,LTD. USB Gamepad ", 7, "tr2", JOYB_TR2 }, + { 0x0079, 0x0011, "SWITCH CO.,LTD. USB Gamepad ", 8, "select", JOYB_SELECT }, + { 0x0079, 0x0011, "SWITCH CO.,LTD. USB Gamepad ", 9, "start", JOYB_START }, + /* RetroFlag Wired Controller */ + { 0x0583, 0x2060, "RetroFlag Wired Controller", 0, "a", JOYB_A }, + { 0x0583, 0x2060, "RetroFlag Wired Controller", 1, "b", JOYB_B }, + { 0x0583, 0x2060, "RetroFlag Wired Controller", 2, "x", JOYB_X }, + { 0x0583, 0x2060, "RetroFlag Wired Controller", 3, "y", JOYB_Y }, + { 0x0583, 0x2060, "RetroFlag Wired Controller", 4, "tl", JOYB_TL }, + { 0x0583, 0x2060, "RetroFlag Wired Controller", 5, "tr", JOYB_TR }, + { 0x0583, 0x2060, "RetroFlag Wired Controller", 8, "tl2", JOYB_TL2 }, + { 0x0583, 0x2060, "RetroFlag Wired Controller", 9, "tr2", JOYB_TR2 }, + { 0x0583, 0x2060, "RetroFlag Wired Controller", 6, "select", JOYB_SELECT }, + { 0x0583, 0x2060, "RetroFlag Wired Controller", 7, "start", JOYB_START }, + /* retroUSB NES RetroPort */ + { 0x04d8, 0xf064, "retroUSB NES RetroPort", 0, "a", JOYB_A }, + { 0x04d8, 0xf064, "retroUSB NES RetroPort", 1, "b", JOYB_B }, + { 0x04d8, 0xf064, "retroUSB NES RetroPort", 2, "select", JOYB_SELECT }, + { 0x04d8, 0xf064, "retroUSB NES RetroPort", 3, "start", JOYB_START }, /* RetroUSB.com RetroPad */ { 0xf000, 0x0003, "RetroUSB.com RetroPad", 1, "a", JOYB_A }, { 0xf000, 0x0003, "RetroUSB.com RetroPad", 0, "b", JOYB_B }, { 0xf000, 0x0003, "RetroUSB.com RetroPad", 2, "select", JOYB_SELECT }, { 0xf000, 0x0003, "RetroUSB.com RetroPad", 3, "start", JOYB_START }, + /* NES RetroPort */ + { 0x04d8, 0xf064, "NES RetroPort", 0, "a", JOYB_A }, + { 0x04d8, 0xf064, "NES RetroPort", 1, "b", JOYB_B }, + { 0x04d8, 0xf064, "NES RetroPort", 2, "select", JOYB_SELECT }, + { 0x04d8, 0xf064, "NES RetroPort", 3, "start", JOYB_START }, /* RetroUSB.com SNES RetroPort */ { 0xf000, 0x00f1, "RetroUSB.com SNES RetroPort", 5, "a", JOYB_A }, { 0xf000, 0x00f1, "RetroUSB.com SNES RetroPort", 1, "b", JOYB_B }, @@ -1151,6 +2314,42 @@ { 0xf000, 0x00f1, "RetroUSB.com SNES RetroPort", 7, "tr", JOYB_TR }, { 0xf000, 0x00f1, "RetroUSB.com SNES RetroPort", 2, "select", JOYB_SELECT }, { 0xf000, 0x00f1, "RetroUSB.com SNES RetroPort", 3, "start", JOYB_START }, + /* Retrode Mega Drive */ + { 0x0403, 0x97c1, "Retrode Mega Drive", 4, "a", JOYB_A }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 0, "b", JOYB_B }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 5, "x", JOYB_X }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 1, "y", JOYB_Y }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 6, "tl", JOYB_TL }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 7, "tr", JOYB_TR }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 2, "select", JOYB_SELECT }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 3, "start", JOYB_START }, + /* Retrode Mega Drive */ + { 0x0403, 0x97c1, "Retrode Mega Drive", 4, "a", JOYB_A }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 0, "b", JOYB_B }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 5, "x", JOYB_X }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 1, "y", JOYB_Y }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 6, "tl", JOYB_TL }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 7, "tr", JOYB_TR }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 2, "select", JOYB_SELECT }, + { 0x0403, 0x97c1, "Retrode Mega Drive", 3, "start", JOYB_START }, + /* Retrode SNES / N64 */ + { 0x0403, 0x97c1, "Retrode SNES / N64", 4, "a", JOYB_A }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 0, "b", JOYB_B }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 5, "x", JOYB_X }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 1, "y", JOYB_Y }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 6, "tl", JOYB_TL }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 7, "tr", JOYB_TR }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 2, "select", JOYB_SELECT }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 3, "start", JOYB_START }, + /* Retrode SNES / N64 */ + { 0x0403, 0x97c1, "Retrode SNES / N64", 4, "a", JOYB_A }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 0, "b", JOYB_B }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 5, "x", JOYB_X }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 1, "y", JOYB_Y }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 6, "tl", JOYB_TL }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 7, "tr", JOYB_TR }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 2, "select", JOYB_SELECT }, + { 0x0403, 0x97c1, "Retrode SNES / N64", 3, "start", JOYB_START }, /* Retrolink Nintento 64 Classic USB */ { 0x0079, 0x0006, "Retrolink Nintento 64 Classic USB", 6, "a", JOYB_A }, { 0x0079, 0x0006, "Retrolink Nintento 64 Classic USB", 8, "b", JOYB_B }, @@ -1179,29 +2378,31 @@ { 0x0e6f, 0x011e, "Rock Candy Gamepad for PS3", 7, "tr2", JOYB_TR2 }, { 0x0e6f, 0x011e, "Rock Candy Gamepad for PS3", 8, "select", JOYB_SELECT }, { 0x0e6f, 0x011e, "Rock Candy Gamepad for PS3", 9, "start", JOYB_START }, - /* SHANWAN PS3 GamePad */ - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 1, "a", JOYB_A }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 0, "b", JOYB_B }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 2, "x", JOYB_X }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 3, "y", JOYB_Y }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 4, "tl", JOYB_TL }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 5, "tr", JOYB_TR }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 6, "tl2", JOYB_TL2 }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 7, "tr2", JOYB_TR2 }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 8, "select", JOYB_SELECT }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 9, "start", JOYB_START }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 10, "mode", JOYB_MODE }, - /* SHANWAN PS3 GamePad */ - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 1, "a", JOYB_A }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 0, "b", JOYB_B }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 2, "x", JOYB_X }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 3, "y", JOYB_Y }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 4, "tl", JOYB_TL }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 5, "tr", JOYB_TR }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 6, "tl2", JOYB_TL2 }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 7, "tr2", JOYB_TR2 }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 8, "select", JOYB_SELECT }, - { 0x054c, 0x0268, "SHANWAN PS3 GamePad", 9, "start", JOYB_START }, + /* 3B controller */ + { 0x0ca3, 0x0025, "3B controller", 5, "a", JOYB_A }, + { 0x0ca3, 0x0025, "3B controller", 1, "b", JOYB_B }, + { 0x0ca3, 0x0025, "3B controller", 2, "y", JOYB_Y }, + { 0x0ca3, 0x0025, "3B controller", 9, "start", JOYB_START }, + /* 6B controller */ + { 0x0ca3, 0x0024, "6B controller", 5, "a", JOYB_A }, + { 0x0ca3, 0x0024, "6B controller", 1, "b", JOYB_B }, + { 0x0ca3, 0x0024, "6B controller", 0, "x", JOYB_X }, + { 0x0ca3, 0x0024, "6B controller", 2, "y", JOYB_Y }, + { 0x0ca3, 0x0024, "6B controller", 3, "tl", JOYB_TL }, + { 0x0ca3, 0x0024, "6B controller", 4, "tr", JOYB_TR }, + { 0x0ca3, 0x0024, "6B controller", 8, "select", JOYB_SELECT }, + { 0x0ca3, 0x0024, "6B controller", 9, "start", JOYB_START }, + /* ShanWan PC/PS3/Android Gamepad */ + { 0x2563, 0x0575, "ShanWan PC/PS3/Android Gamepad", 1, "a", JOYB_A }, + { 0x2563, 0x0575, "ShanWan PC/PS3/Android Gamepad", 2, "b", JOYB_B }, + { 0x2563, 0x0575, "ShanWan PC/PS3/Android Gamepad", 0, "x", JOYB_X }, + { 0x2563, 0x0575, "ShanWan PC/PS3/Android Gamepad", 3, "y", JOYB_Y }, + { 0x2563, 0x0575, "ShanWan PC/PS3/Android Gamepad", 4, "tl", JOYB_TL }, + { 0x2563, 0x0575, "ShanWan PC/PS3/Android Gamepad", 5, "tr", JOYB_TR }, + { 0x2563, 0x0575, "ShanWan PC/PS3/Android Gamepad", 6, "tl2", JOYB_TL2 }, + { 0x2563, 0x0575, "ShanWan PC/PS3/Android Gamepad", 7, "tr2", JOYB_TR2 }, + { 0x2563, 0x0575, "ShanWan PC/PS3/Android Gamepad", 8, "select", JOYB_SELECT }, + { 0x2563, 0x0575, "ShanWan PC/PS3/Android Gamepad", 9, "start", JOYB_START }, /* CYPRESS USB Gamepad */ { 0x04b4, 0x010a, "CYPRESS USB Gamepad", 2, "a", JOYB_A }, { 0x04b4, 0x010a, "CYPRESS USB Gamepad", 1, "b", JOYB_B }, @@ -1212,6 +2413,45 @@ { 0x04b4, 0x010a, "CYPRESS USB Gamepad", 4, "tl2", JOYB_TL2 }, { 0x04b4, 0x010a, "CYPRESS USB Gamepad", 5, "tr2", JOYB_TR2 }, { 0x04b4, 0x010a, "CYPRESS USB Gamepad", 8, "start", JOYB_START }, + /* SNES PC Game Pad SNES PC Game Pad */ + { 0x1d57, 0x0020, "SNES PC Game Pad SNES PC Game Pad ", 1, "a", JOYB_A }, + { 0x1d57, 0x0020, "SNES PC Game Pad SNES PC Game Pad ", 0, "b", JOYB_B }, + { 0x1d57, 0x0020, "SNES PC Game Pad SNES PC Game Pad ", 3, "x", JOYB_X }, + { 0x1d57, 0x0020, "SNES PC Game Pad SNES PC Game Pad ", 2, "y", JOYB_Y }, + { 0x1d57, 0x0020, "SNES PC Game Pad SNES PC Game Pad ", 4, "tl", JOYB_TL }, + { 0x1d57, 0x0020, "SNES PC Game Pad SNES PC Game Pad ", 5, "tr", JOYB_TR }, + { 0x1d57, 0x0020, "SNES PC Game Pad SNES PC Game Pad ", 6, "select", JOYB_SELECT }, + { 0x1d57, 0x0020, "SNES PC Game Pad SNES PC Game Pad ", 7, "start", JOYB_START }, + /* SPEEDLINK TORID */ + { 0x11c0, 0x9105, "SPEEDLINK TORID", 1, "a", JOYB_A }, + { 0x11c0, 0x9105, "SPEEDLINK TORID", 2, "b", JOYB_B }, + { 0x11c0, 0x9105, "SPEEDLINK TORID", 0, "x", JOYB_X }, + { 0x11c0, 0x9105, "SPEEDLINK TORID", 3, "y", JOYB_Y }, + { 0x11c0, 0x9105, "SPEEDLINK TORID", 4, "tl", JOYB_TL }, + { 0x11c0, 0x9105, "SPEEDLINK TORID", 5, "tr", JOYB_TR }, + { 0x11c0, 0x9105, "SPEEDLINK TORID", 6, "tl2", JOYB_TL2 }, + { 0x11c0, 0x9105, "SPEEDLINK TORID", 7, "tr2", JOYB_TR2 }, + { 0x11c0, 0x9105, "SPEEDLINK TORID", 8, "select", JOYB_SELECT }, + { 0x11c0, 0x9105, "SPEEDLINK TORID", 9, "start", JOYB_START }, + /* STD AxisPad */ + { 0x05fd, 0x3002, "STD AxisPad", 3, "a", JOYB_A }, + { 0x05fd, 0x3002, "STD AxisPad", 2, "b", JOYB_B }, + { 0x05fd, 0x3002, "STD AxisPad", 1, "x", JOYB_X }, + { 0x05fd, 0x3002, "STD AxisPad", 0, "y", JOYB_Y }, + { 0x05fd, 0x3002, "STD AxisPad", 6, "tl", JOYB_TL }, + { 0x05fd, 0x3002, "STD AxisPad", 7, "tr", JOYB_TR }, + { 0x05fd, 0x3002, "STD AxisPad", 4, "tl2", JOYB_TL2 }, + { 0x05fd, 0x3002, "STD AxisPad", 5, "tr2", JOYB_TR2 }, + { 0x05fd, 0x3002, "STD AxisPad", 10, "select", JOYB_SELECT }, + { 0x05fd, 0x3002, "STD AxisPad", 11, "start", JOYB_START }, + /* SWITCH CO.,LTD. Controller (Dinput) */ + { 0x2563, 0x0575, "SWITCH CO.,LTD. Controller (Dinput)", 2, "a", JOYB_A }, + { 0x2563, 0x0575, "SWITCH CO.,LTD. Controller (Dinput)", 1, "b", JOYB_B }, + { 0x2563, 0x0575, "SWITCH CO.,LTD. Controller (Dinput)", 2, "y", JOYB_Y }, + { 0x2563, 0x0575, "SWITCH CO.,LTD. Controller (Dinput)", 4, "tl", JOYB_TL }, + { 0x2563, 0x0575, "SWITCH CO.,LTD. Controller (Dinput)", 5, "tr", JOYB_TR }, + { 0x2563, 0x0575, "SWITCH CO.,LTD. Controller (Dinput)", 6, "tl2", JOYB_TL2 }, + { 0x2563, 0x0575, "SWITCH CO.,LTD. Controller (Dinput)", 12, "start", JOYB_START }, /* Saitek Cyborg Rumble Pad */ { 0x045e, 0x0719, "Saitek Cyborg Rumble Pad", 1, "a", JOYB_A }, { 0x045e, 0x0719, "Saitek Cyborg Rumble Pad", 0, "b", JOYB_B }, @@ -1275,6 +2515,29 @@ { 0x04e8, 0xa000, "Samsung Game Pad EI-GP20", 21, "select", JOYB_SELECT }, { 0x04e8, 0xa000, "Samsung Game Pad EI-GP20", 22, "start", JOYB_START }, { 0x04e8, 0xa000, "Samsung Game Pad EI-GP20", 26, "mode", JOYB_MODE }, + /* Sanmos JY-P62U Series ONLINE GRIP */ + { 0x11c0, 0x5044, "Sanmos JY-P62U Series ONLINE GRIP", 1, "a", JOYB_A }, + { 0x11c0, 0x5044, "Sanmos JY-P62U Series ONLINE GRIP", 0, "b", JOYB_B }, + { 0x11c0, 0x5044, "Sanmos JY-P62U Series ONLINE GRIP", 4, "x", JOYB_X }, + { 0x11c0, 0x5044, "Sanmos JY-P62U Series ONLINE GRIP", 3, "y", JOYB_Y }, + { 0x11c0, 0x5044, "Sanmos JY-P62U Series ONLINE GRIP", 6, "tl", JOYB_TL }, + { 0x11c0, 0x5044, "Sanmos JY-P62U Series ONLINE GRIP", 8, "tr", JOYB_TR }, + { 0x11c0, 0x5044, "Sanmos JY-P62U Series ONLINE GRIP", 7, "tl2", JOYB_TL2 }, + { 0x11c0, 0x5044, "Sanmos JY-P62U Series ONLINE GRIP", 9, "tr2", JOYB_TR2 }, + { 0x11c0, 0x5044, "Sanmos JY-P62U Series ONLINE GRIP", 12, "select", JOYB_SELECT }, + { 0x11c0, 0x5044, "Sanmos JY-P62U Series ONLINE GRIP", 14, "start", JOYB_START }, + { 0x11c0, 0x5044, "Sanmos JY-P62U Series ONLINE GRIP", 15, "mode", JOYB_MODE }, + /* ShanWan PC/PS3/Android */ + { 0x2563, 0x0526, "ShanWan PC/PS3/Android", 1, "a", JOYB_A }, + { 0x2563, 0x0526, "ShanWan PC/PS3/Android", 0, "b", JOYB_B }, + { 0x2563, 0x0526, "ShanWan PC/PS3/Android", 4, "x", JOYB_X }, + { 0x2563, 0x0526, "ShanWan PC/PS3/Android", 3, "y", JOYB_Y }, + { 0x2563, 0x0526, "ShanWan PC/PS3/Android", 6, "tl", JOYB_TL }, + { 0x2563, 0x0526, "ShanWan PC/PS3/Android", 7, "tr", JOYB_TR }, + { 0x2563, 0x0526, "ShanWan PC/PS3/Android", 8, "tl2", JOYB_TL2 }, + { 0x2563, 0x0526, "ShanWan PC/PS3/Android", 9, "tr2", JOYB_TR2 }, + { 0x2563, 0x0526, "ShanWan PC/PS3/Android", 10, "select", JOYB_SELECT }, + { 0x2563, 0x0526, "ShanWan PC/PS3/Android", 11, "start", JOYB_START }, /* Smartjoy Family Super Smartjoy 2 */ { 0x6666, 0x0667, "Smartjoy Family Super Smartjoy 2", 1, "a", JOYB_A }, { 0x6666, 0x0667, "Smartjoy Family Super Smartjoy 2", 2, "b", JOYB_B }, @@ -1284,30 +2547,40 @@ { 0x6666, 0x0667, "Smartjoy Family Super Smartjoy 2", 7, "tr", JOYB_TR }, { 0x6666, 0x0667, "Smartjoy Family Super Smartjoy 2", 4, "select", JOYB_SELECT }, { 0x6666, 0x0667, "Smartjoy Family Super Smartjoy 2", 5, "start", JOYB_START }, - /* PLAYSTATION(R)3 Controller */ - { 0x054c, 0x0268, "PLAYSTATION(R)3 Controller", 13, "a", JOYB_A }, - { 0x054c, 0x0268, "PLAYSTATION(R)3 Controller", 14, "b", JOYB_B }, - { 0x054c, 0x0268, "PLAYSTATION(R)3 Controller", 12, "x", JOYB_X }, - { 0x054c, 0x0268, "PLAYSTATION(R)3 Controller", 15, "y", JOYB_Y }, - { 0x054c, 0x0268, "PLAYSTATION(R)3 Controller", 10, "tl", JOYB_TL }, - { 0x054c, 0x0268, "PLAYSTATION(R)3 Controller", 11, "tr", JOYB_TR }, - { 0x054c, 0x0268, "PLAYSTATION(R)3 Controller", 8, "tl2", JOYB_TL2 }, - { 0x054c, 0x0268, "PLAYSTATION(R)3 Controller", 9, "tr2", JOYB_TR2 }, - { 0x054c, 0x0268, "PLAYSTATION(R)3 Controller", 0, "select", JOYB_SELECT }, - { 0x054c, 0x0268, "PLAYSTATION(R)3 Controller", 3, "start", JOYB_START }, - { 0x054c, 0x0268, "PLAYSTATION(R)3 Controller", 16, "mode", JOYB_MODE }, - /* Sony Computer Entertainment Wireless Controller */ - { 0x054c, 0x0268, "Sony Computer Entertainment Wireless Controller", 13, "a", JOYB_A }, - { 0x054c, 0x0268, "Sony Computer Entertainment Wireless Controller", 14, "b", JOYB_B }, - { 0x054c, 0x0268, "Sony Computer Entertainment Wireless Controller", 12, "x", JOYB_X }, - { 0x054c, 0x0268, "Sony Computer Entertainment Wireless Controller", 15, "y", JOYB_Y }, - { 0x054c, 0x0268, "Sony Computer Entertainment Wireless Controller", 10, "tl", JOYB_TL }, - { 0x054c, 0x0268, "Sony Computer Entertainment Wireless Controller", 11, "tr", JOYB_TR }, - { 0x054c, 0x0268, "Sony Computer Entertainment Wireless Controller", 8, "tl2", JOYB_TL2 }, - { 0x054c, 0x0268, "Sony Computer Entertainment Wireless Controller", 9, "tr2", JOYB_TR2 }, - { 0x054c, 0x0268, "Sony Computer Entertainment Wireless Controller", 0, "select", JOYB_SELECT }, - { 0x054c, 0x0268, "Sony Computer Entertainment Wireless Controller", 3, "start", JOYB_START }, - { 0x054c, 0x0268, "Sony Computer Entertainment Wireless Controller", 16, "mode", JOYB_MODE }, + /* Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor */ + { 0x054c, 0x0ba0, "Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor", 1, "a", JOYB_A }, + { 0x054c, 0x0ba0, "Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor", 0, "b", JOYB_B }, + { 0x054c, 0x0ba0, "Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor", 2, "x", JOYB_X }, + { 0x054c, 0x0ba0, "Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor", 3, "y", JOYB_Y }, + { 0x054c, 0x0ba0, "Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor", 4, "tl", JOYB_TL }, + { 0x054c, 0x0ba0, "Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor", 5, "tr", JOYB_TR }, + { 0x054c, 0x0ba0, "Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor", 6, "tl2", JOYB_TL2 }, + { 0x054c, 0x0ba0, "Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor", 7, "tr2", JOYB_TR2 }, + { 0x054c, 0x0ba0, "Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor", 8, "select", JOYB_SELECT }, + { 0x054c, 0x0ba0, "Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor", 9, "start", JOYB_START }, + { 0x054c, 0x0ba0, "Sony Interactive Entertainment DUALSHOCK®4 USB Wireless Adaptor", 10, "mode", JOYB_MODE }, + /* Sony Interactive Entertainment DualSense Edge Wireless Controller */ + { 0x054c, 0x0df2, "Sony Interactive Entertainment DualSense Edge Wireless Controller", 1, "a", JOYB_A }, + { 0x054c, 0x0df2, "Sony Interactive Entertainment DualSense Edge Wireless Controller", 0, "b", JOYB_B }, + { 0x054c, 0x0df2, "Sony Interactive Entertainment DualSense Edge Wireless Controller", 2, "x", JOYB_X }, + { 0x054c, 0x0df2, "Sony Interactive Entertainment DualSense Edge Wireless Controller", 3, "y", JOYB_Y }, + { 0x054c, 0x0df2, "Sony Interactive Entertainment DualSense Edge Wireless Controller", 4, "tl", JOYB_TL }, + { 0x054c, 0x0df2, "Sony Interactive Entertainment DualSense Edge Wireless Controller", 5, "tr", JOYB_TR }, + { 0x054c, 0x0df2, "Sony Interactive Entertainment DualSense Edge Wireless Controller", 6, "tl2", JOYB_TL2 }, + { 0x054c, 0x0df2, "Sony Interactive Entertainment DualSense Edge Wireless Controller", 7, "tr2", JOYB_TR2 }, + { 0x054c, 0x0df2, "Sony Interactive Entertainment DualSense Edge Wireless Controller", 8, "select", JOYB_SELECT }, + { 0x054c, 0x0df2, "Sony Interactive Entertainment DualSense Edge Wireless Controller", 9, "start", JOYB_START }, + { 0x054c, 0x0df2, "Sony Interactive Entertainment DualSense Edge Wireless Controller", 10, "mode", JOYB_MODE }, + /* Sony Interactive Entertainment DualSense Wireless Controller */ + { 0x054c, 0x0ce6, "Sony Interactive Entertainment DualSense Wireless Controller", 1, "a", JOYB_A }, + { 0x054c, 0x0ce6, "Sony Interactive Entertainment DualSense Wireless Controller", 0, "b", JOYB_B }, + { 0x054c, 0x0ce6, "Sony Interactive Entertainment DualSense Wireless Controller", 2, "x", JOYB_X }, + { 0x054c, 0x0ce6, "Sony Interactive Entertainment DualSense Wireless Controller", 3, "y", JOYB_Y }, + { 0x054c, 0x0ce6, "Sony Interactive Entertainment DualSense Wireless Controller", 4, "tl", JOYB_TL }, + { 0x054c, 0x0ce6, "Sony Interactive Entertainment DualSense Wireless Controller", 5, "tr", JOYB_TR }, + { 0x054c, 0x0ce6, "Sony Interactive Entertainment DualSense Wireless Controller", 8, "select", JOYB_SELECT }, + { 0x054c, 0x0ce6, "Sony Interactive Entertainment DualSense Wireless Controller", 9, "start", JOYB_START }, + { 0x054c, 0x0ce6, "Sony Interactive Entertainment DualSense Wireless Controller", 10, "mode", JOYB_MODE }, /* Sony PLAYSTATION(R)3 Controller */ { 0x054c, 0x0268, "Sony PLAYSTATION(R)3 Controller", 1, "a", JOYB_A }, { 0x054c, 0x0268, "Sony PLAYSTATION(R)3 Controller", 0, "b", JOYB_B }, @@ -1339,35 +2612,65 @@ { 0x054c, 0x05c4, "Sony Computer Entertainment Wireless Controller", 3, "y", JOYB_Y }, { 0x054c, 0x05c4, "Sony Computer Entertainment Wireless Controller", 4, "tl", JOYB_TL }, { 0x054c, 0x05c4, "Sony Computer Entertainment Wireless Controller", 5, "tr", JOYB_TR }, - { 0x054c, 0x05c4, "Sony Computer Entertainment Wireless Controller", 6, "tl2", JOYB_TL2 }, - { 0x054c, 0x05c4, "Sony Computer Entertainment Wireless Controller", 7, "tr2", JOYB_TR2 }, { 0x054c, 0x05c4, "Sony Computer Entertainment Wireless Controller", 8, "select", JOYB_SELECT }, { 0x054c, 0x05c4, "Sony Computer Entertainment Wireless Controller", 9, "start", JOYB_START }, { 0x054c, 0x05c4, "Sony Computer Entertainment Wireless Controller", 10, "mode", JOYB_MODE }, /* Sony Interactive Entertainment Wireless Controller */ - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 2, "a", JOYB_A }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 1, "b", JOYB_B }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 3, "x", JOYB_X }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 0, "y", JOYB_Y }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 4, "tl", JOYB_TL }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 5, "tr", JOYB_TR }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 6, "tl2", JOYB_TL2 }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 7, "tr2", JOYB_TR2 }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 8, "select", JOYB_SELECT }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 9, "start", JOYB_START }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 12, "mode", JOYB_MODE }, - /* Sony Interactive Entertainment Wireless Controller */ { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 1, "a", JOYB_A }, { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 0, "b", JOYB_B }, { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 2, "x", JOYB_X }, { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 3, "y", JOYB_Y }, { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 4, "tl", JOYB_TL }, { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 5, "tr", JOYB_TR }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 6, "tl2", JOYB_TL2 }, - { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 7, "tr2", JOYB_TR2 }, { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 8, "select", JOYB_SELECT }, { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 9, "start", JOYB_START }, { 0x054c, 0x09cc, "Sony Interactive Entertainment Wireless Controller", 10, "mode", JOYB_MODE }, + /* Wireless Controller */ + { 0x8087, 0x0a2a, "Wireless Controller", 1, "a", JOYB_A }, + { 0x8087, 0x0a2a, "Wireless Controller", 0, "b", JOYB_B }, + { 0x8087, 0x0a2a, "Wireless Controller", 2, "x", JOYB_X }, + { 0x8087, 0x0a2a, "Wireless Controller", 3, "y", JOYB_Y }, + { 0x8087, 0x0a2a, "Wireless Controller", 4, "tl", JOYB_TL }, + { 0x8087, 0x0a2a, "Wireless Controller", 5, "tr", JOYB_TR }, + { 0x8087, 0x0a2a, "Wireless Controller", 6, "tl2", JOYB_TL2 }, + { 0x8087, 0x0a2a, "Wireless Controller", 7, "tr2", JOYB_TR2 }, + { 0x8087, 0x0a2a, "Wireless Controller", 8, "select", JOYB_SELECT }, + { 0x8087, 0x0a2a, "Wireless Controller", 9, "start", JOYB_START }, + { 0x8087, 0x0a2a, "Wireless Controller", 10, "mode", JOYB_MODE }, + /* Sony Dualshock 4 Wireless - 500 Million Limited Edition */ + { 0x054c, 0x09cc, "Sony Dualshock 4 Wireless - 500 Million Limited Edition", 2, "a", JOYB_A }, + { 0x054c, 0x09cc, "Sony Dualshock 4 Wireless - 500 Million Limited Edition", 1, "b", JOYB_B }, + { 0x054c, 0x09cc, "Sony Dualshock 4 Wireless - 500 Million Limited Edition", 3, "x", JOYB_X }, + { 0x054c, 0x09cc, "Sony Dualshock 4 Wireless - 500 Million Limited Edition", 0, "y", JOYB_Y }, + { 0x054c, 0x09cc, "Sony Dualshock 4 Wireless - 500 Million Limited Edition", 4, "tl", JOYB_TL }, + { 0x054c, 0x09cc, "Sony Dualshock 4 Wireless - 500 Million Limited Edition", 5, "tr", JOYB_TR }, + { 0x054c, 0x09cc, "Sony Dualshock 4 Wireless - 500 Million Limited Edition", 6, "tl2", JOYB_TL2 }, + { 0x054c, 0x09cc, "Sony Dualshock 4 Wireless - 500 Million Limited Edition", 7, "tr2", JOYB_TR2 }, + { 0x054c, 0x09cc, "Sony Dualshock 4 Wireless - 500 Million Limited Edition", 8, "select", JOYB_SELECT }, + { 0x054c, 0x09cc, "Sony Dualshock 4 Wireless - 500 Million Limited Edition", 9, "start", JOYB_START }, + { 0x054c, 0x09cc, "Sony Dualshock 4 Wireless - 500 Million Limited Edition", 12, "mode", JOYB_MODE }, + /* ShanWan PS3/PC Wired GamePad */ + { 0x2563, 0x0523, "ShanWan PS3/PC Wired GamePad", 1, "a", JOYB_A }, + { 0x2563, 0x0523, "ShanWan PS3/PC Wired GamePad", 2, "b", JOYB_B }, + { 0x2563, 0x0523, "ShanWan PS3/PC Wired GamePad", 0, "x", JOYB_X }, + { 0x2563, 0x0523, "ShanWan PS3/PC Wired GamePad", 3, "y", JOYB_Y }, + { 0x2563, 0x0523, "ShanWan PS3/PC Wired GamePad", 4, "tl", JOYB_TL }, + { 0x2563, 0x0523, "ShanWan PS3/PC Wired GamePad", 5, "tr", JOYB_TR }, + { 0x2563, 0x0523, "ShanWan PS3/PC Wired GamePad", 6, "tl2", JOYB_TL2 }, + { 0x2563, 0x0523, "ShanWan PS3/PC Wired GamePad", 7, "tr2", JOYB_TR2 }, + { 0x2563, 0x0523, "ShanWan PS3/PC Wired GamePad", 8, "select", JOYB_SELECT }, + { 0x2563, 0x0523, "ShanWan PS3/PC Wired GamePad", 9, "start", JOYB_START }, + /* ShanWan PS3/PC Wired GamePad */ + { 0x20bc, 0x5500, "ShanWan PS3/PC Wired GamePad", 1, "a", JOYB_A }, + { 0x20bc, 0x5500, "ShanWan PS3/PC Wired GamePad", 0, "b", JOYB_B }, + { 0x20bc, 0x5500, "ShanWan PS3/PC Wired GamePad", 4, "x", JOYB_X }, + { 0x20bc, 0x5500, "ShanWan PS3/PC Wired GamePad", 3, "y", JOYB_Y }, + { 0x20bc, 0x5500, "ShanWan PS3/PC Wired GamePad", 6, "tl", JOYB_TL }, + { 0x20bc, 0x5500, "ShanWan PS3/PC Wired GamePad", 7, "tr", JOYB_TR }, + { 0x20bc, 0x5500, "ShanWan PS3/PC Wired GamePad", 8, "tl2", JOYB_TL2 }, + { 0x20bc, 0x5500, "ShanWan PS3/PC Wired GamePad", 9, "tr2", JOYB_TR2 }, + { 0x20bc, 0x5500, "ShanWan PS3/PC Wired GamePad", 10, "select", JOYB_SELECT }, + { 0x20bc, 0x5500, "ShanWan PS3/PC Wired GamePad", 11, "start", JOYB_START }, /* Steam Controller */ { 0x28de, 0x0476, "Steam Controller", 1, "a", JOYB_A }, { 0x28de, 0x0476, "Steam Controller", 0, "b", JOYB_B }, @@ -1393,6 +2696,42 @@ { 0x1292, 0x4e47, "TOMMO NEOGEOX Arcade Stick", 3, "y", JOYB_Y }, { 0x1292, 0x4e47, "TOMMO NEOGEOX Arcade Stick", 8, "select", JOYB_SELECT }, { 0x1292, 0x4e47, "TOMMO NEOGEOX Arcade Stick", 9, "start", JOYB_START }, + /* TRBot Joypad 0 */ + { 0x0378, 0x0003, "TRBot Joypad 0", 21, "a", JOYB_A }, + { 0x0378, 0x0003, "TRBot Joypad 0", 22, "b", JOYB_B }, + { 0x0378, 0x0003, "TRBot Joypad 0", 23, "x", JOYB_X }, + { 0x0378, 0x0003, "TRBot Joypad 0", 24, "y", JOYB_Y }, + { 0x0378, 0x0003, "TRBot Joypad 0", 27, "tl", JOYB_TL }, + { 0x0378, 0x0003, "TRBot Joypad 0", 28, "tr", JOYB_TR }, + { 0x0378, 0x0003, "TRBot Joypad 0", 25, "select", JOYB_SELECT }, + { 0x0378, 0x0003, "TRBot Joypad 0", 26, "start", JOYB_START }, + /* TRBot Joypad 1 */ + { 0x06f0, 0x0003, "TRBot Joypad 1", 21, "a", JOYB_A }, + { 0x06f0, 0x0003, "TRBot Joypad 1", 22, "b", JOYB_B }, + { 0x06f0, 0x0003, "TRBot Joypad 1", 23, "x", JOYB_X }, + { 0x06f0, 0x0003, "TRBot Joypad 1", 24, "y", JOYB_Y }, + { 0x06f0, 0x0003, "TRBot Joypad 1", 27, "tl", JOYB_TL }, + { 0x06f0, 0x0003, "TRBot Joypad 1", 28, "tr", JOYB_TR }, + { 0x06f0, 0x0003, "TRBot Joypad 1", 25, "select", JOYB_SELECT }, + { 0x06f0, 0x0003, "TRBot Joypad 1", 26, "start", JOYB_START }, + /* TRBot Joypad 2 */ + { 0x0a68, 0x0003, "TRBot Joypad 2", 21, "a", JOYB_A }, + { 0x0a68, 0x0003, "TRBot Joypad 2", 22, "b", JOYB_B }, + { 0x0a68, 0x0003, "TRBot Joypad 2", 23, "x", JOYB_X }, + { 0x0a68, 0x0003, "TRBot Joypad 2", 24, "y", JOYB_Y }, + { 0x0a68, 0x0003, "TRBot Joypad 2", 27, "tl", JOYB_TL }, + { 0x0a68, 0x0003, "TRBot Joypad 2", 28, "tr", JOYB_TR }, + { 0x0a68, 0x0003, "TRBot Joypad 2", 25, "select", JOYB_SELECT }, + { 0x0a68, 0x0003, "TRBot Joypad 2", 26, "start", JOYB_START }, + /* TRBot Joypad 3 */ + { 0x0de0, 0x0003, "TRBot Joypad 3", 21, "a", JOYB_A }, + { 0x0de0, 0x0003, "TRBot Joypad 3", 22, "b", JOYB_B }, + { 0x0de0, 0x0003, "TRBot Joypad 3", 23, "x", JOYB_X }, + { 0x0de0, 0x0003, "TRBot Joypad 3", 24, "y", JOYB_Y }, + { 0x0de0, 0x0003, "TRBot Joypad 3", 27, "tl", JOYB_TL }, + { 0x0de0, 0x0003, "TRBot Joypad 3", 28, "tr", JOYB_TR }, + { 0x0de0, 0x0003, "TRBot Joypad 3", 25, "select", JOYB_SELECT }, + { 0x0de0, 0x0003, "TRBot Joypad 3", 26, "start", JOYB_START }, /* Thrustmaster Dual Trigger 3-in-1 */ { 0x044f, 0xb323, "Thrustmaster Dual Trigger 3-in-1", 2, "a", JOYB_A }, { 0x044f, 0xb323, "Thrustmaster Dual Trigger 3-in-1", 1, "b", JOYB_B }, @@ -1440,6 +2779,10 @@ { 0x11ff, 0x3331, "PC Game Controller ", 7, "tr", JOYB_TR }, { 0x11ff, 0x3331, "PC Game Controller ", 8, "tl2", JOYB_TL2 }, { 0x11ff, 0x3331, "PC Game Controller ", 9, "start", JOYB_START }, + /* NES PC Game Pad NES PC Game Pad */ + { 0x1d57, 0x0021, " NES PC Game Pad NES PC Game Pad ", 0, "a", JOYB_A }, + { 0x1d57, 0x0021, " NES PC Game Pad NES PC Game Pad ", 1, "b", JOYB_B }, + { 0x1d57, 0x0021, " NES PC Game Pad NES PC Game Pad ", 3, "start", JOYB_START }, /* Toodles 2008 ChImp PC/PS3 Controller */ { 0x14d8, 0xcd07, "Toodles 2008 ChImp PC/PS3 Controller", 2, "a", JOYB_A }, { 0x14d8, 0xcd07, "Toodles 2008 ChImp PC/PS3 Controller", 1, "b", JOYB_B }, @@ -1451,6 +2794,28 @@ { 0x14d8, 0xcd07, "Toodles 2008 ChImp PC/PS3 Controller", 6, "tr2", JOYB_TR2 }, { 0x14d8, 0xcd07, "Toodles 2008 ChImp PC/PS3 Controller", 8, "select", JOYB_SELECT }, { 0x14d8, 0xcd07, "Toodles 2008 ChImp PC/PS3 Controller", 9, "start", JOYB_START }, + /* Toodles 2008 Cthulhu Mult */ + { 0x14d8, 0xface, "Toodles 2008 Cthulhu Mult", 2, "a", JOYB_A }, + { 0x14d8, 0xface, "Toodles 2008 Cthulhu Mult", 1, "b", JOYB_B }, + { 0x14d8, 0xface, "Toodles 2008 Cthulhu Mult", 3, "x", JOYB_X }, + { 0x14d8, 0xface, "Toodles 2008 Cthulhu Mult", 0, "y", JOYB_Y }, + { 0x14d8, 0xface, "Toodles 2008 Cthulhu Mult", 4, "tl", JOYB_TL }, + { 0x14d8, 0xface, "Toodles 2008 Cthulhu Mult", 5, "tr", JOYB_TR }, + { 0x14d8, 0xface, "Toodles 2008 Cthulhu Mult", 6, "tl2", JOYB_TL2 }, + { 0x14d8, 0xface, "Toodles 2008 Cthulhu Mult", 7, "tr2", JOYB_TR2 }, + { 0x14d8, 0xface, "Toodles 2008 Cthulhu Mult", 8, "select", JOYB_SELECT }, + { 0x14d8, 0xface, "Toodles 2008 Cthulhu Mult", 9, "start", JOYB_START }, + /* Trooper V2 Trooper V2 */ + { 0x2e24, 0x386a, " Trooper V2 Trooper V2 ", 1, "a", JOYB_A }, + { 0x2e24, 0x386a, " Trooper V2 Trooper V2 ", 1, "b", JOYB_B }, + { 0x2e24, 0x386a, " Trooper V2 Trooper V2 ", 1, "x", JOYB_X }, + { 0x2e24, 0x386a, " Trooper V2 Trooper V2 ", 1, "y", JOYB_Y }, + { 0x2e24, 0x386a, " Trooper V2 Trooper V2 ", 2, "tl", JOYB_TL }, + { 0x2e24, 0x386a, " Trooper V2 Trooper V2 ", 3, "tr", JOYB_TR }, + { 0x2e24, 0x386a, " Trooper V2 Trooper V2 ", 1, "tl2", JOYB_TL2 }, + { 0x2e24, 0x386a, " Trooper V2 Trooper V2 ", 1, "tr2", JOYB_TR2 }, + { 0x2e24, 0x386a, " Trooper V2 Trooper V2 ", 4, "select", JOYB_SELECT }, + { 0x2e24, 0x386a, " Trooper V2 Trooper V2 ", 5, "start", JOYB_START }, /* Twin USB Joystick */ { 0x0810, 0x0001, "Twin USB Joystick", 1, "a", JOYB_A }, { 0x0810, 0x0001, "Twin USB Joystick", 2, "b", JOYB_B }, @@ -1462,17 +2827,6 @@ { 0x0810, 0x0001, "Twin USB Joystick", 5, "tr2", JOYB_TR2 }, { 0x0810, 0x0001, "Twin USB Joystick", 8, "select", JOYB_SELECT }, { 0x0810, 0x0001, "Twin USB Joystick", 9, "start", JOYB_START }, - /* USB Gamepad */ - { 0x0079, 0x0011, "USB Gamepad ", 1, "a", JOYB_A }, - { 0x0079, 0x0011, "USB Gamepad ", 2, "b", JOYB_B }, - { 0x0079, 0x0011, "USB Gamepad ", 0, "x", JOYB_X }, - { 0x0079, 0x0011, "USB Gamepad ", 3, "y", JOYB_Y }, - { 0x0079, 0x0011, "USB Gamepad ", 6, "tl", JOYB_TL }, - { 0x0079, 0x0011, "USB Gamepad ", 7, "tr", JOYB_TR }, - { 0x0079, 0x0011, "USB Gamepad ", 4, "tl2", JOYB_TL2 }, - { 0x0079, 0x0011, "USB Gamepad ", 5, "tr2", JOYB_TR2 }, - { 0x0079, 0x0011, "USB Gamepad ", 8, "select", JOYB_SELECT }, - { 0x0079, 0x0011, "USB Gamepad ", 9, "start", JOYB_START }, /* USB Joystick */ { 0x12bd, 0xc001, "USB Joystick ", 1, "a", JOYB_A }, { 0x12bd, 0xc001, "USB Joystick ", 2, "b", JOYB_B }, @@ -1504,7 +2858,6 @@ { 0x081f, 0xe401, "USB gamepad ", 5, "tr", JOYB_TR }, { 0x081f, 0xe401, "USB gamepad ", 8, "select", JOYB_SELECT }, { 0x081f, 0xe401, "USB gamepad ", 9, "start", JOYB_START }, - { 0x081f, 0xe401, "USB gamepad ", 0, "mode", JOYB_MODE }, /* Ultimarc J-PAC */ /* Venom Limited PS3/PS4 Arcade Joystick */ { 0x0079, 0x181a, "Venom Limited PS3/PS4 Arcade Joystick", 2, "a", JOYB_A }, @@ -1517,7 +2870,6 @@ { 0x0079, 0x181a, "Venom Limited PS3/PS4 Arcade Joystick", 7, "tr2", JOYB_TR2 }, { 0x0079, 0x181a, "Venom Limited PS3/PS4 Arcade Joystick", 8, "select", JOYB_SELECT }, { 0x0079, 0x181a, "Venom Limited PS3/PS4 Arcade Joystick", 9, "start", JOYB_START }, - { 0x0079, 0x181a, "Venom Limited PS3/PS4 Arcade Joystick", 3, "mode", JOYB_MODE }, /* Gamepad */ { 0x05ac, 0x022d, "Gamepad", 0, "a", JOYB_A }, { 0x05ac, 0x022d, "Gamepad", 1, "b", JOYB_B }, @@ -1529,6 +2881,16 @@ { 0x05ac, 0x022d, "Gamepad", 9, "tr2", JOYB_TR2 }, { 0x05ac, 0x022d, "Gamepad", 10, "select", JOYB_SELECT }, { 0x05ac, 0x022d, "Gamepad", 11, "start", JOYB_START }, + /* Wireless Steam Controller */ + { 0x28de, 0x1142, "Wireless Steam Controller", 3, "a", JOYB_A }, + { 0x28de, 0x1142, "Wireless Steam Controller", 2, "b", JOYB_B }, + { 0x28de, 0x1142, "Wireless Steam Controller", 5, "x", JOYB_X }, + { 0x28de, 0x1142, "Wireless Steam Controller", 4, "y", JOYB_Y }, + { 0x28de, 0x1142, "Wireless Steam Controller", 6, "tl", JOYB_TL }, + { 0x28de, 0x1142, "Wireless Steam Controller", 7, "tr", JOYB_TR }, + { 0x28de, 0x1142, "Wireless Steam Controller", 10, "select", JOYB_SELECT }, + { 0x28de, 0x1142, "Wireless Steam Controller", 11, "start", JOYB_START }, + { 0x28de, 0x1142, "Wireless Steam Controller", 12, "mode", JOYB_MODE }, /* SL-6566 */ { 0x1a34, 0x0809, "SL-6566", 0, "a", JOYB_A }, { 0x1a34, 0x0809, "SL-6566", 1, "b", JOYB_B }, @@ -1553,6 +2915,26 @@ { 0xaa55, 0x0101, "Xarcade-to-Gamepad Device", 8, "select", JOYB_SELECT }, { 0xaa55, 0x0101, "Xarcade-to-Gamepad Device", 9, "start", JOYB_START }, /* Xbox 360 Wireless Receiver */ + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver", 1, "a", JOYB_A }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver", 0, "b", JOYB_B }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver", 3, "x", JOYB_X }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver", 2, "y", JOYB_Y }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver", 4, "tl", JOYB_TL }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver", 5, "tr", JOYB_TR }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver", 6, "select", JOYB_SELECT }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver", 7, "start", JOYB_START }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver", 8, "mode", JOYB_MODE }, + /* Xbox 360 Wireless Receiver (XBOX) */ + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver (XBOX)", 1, "a", JOYB_A }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver (XBOX)", 0, "b", JOYB_B }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver (XBOX)", 3, "x", JOYB_X }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver (XBOX)", 2, "y", JOYB_Y }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver (XBOX)", 4, "tl", JOYB_TL }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver (XBOX)", 5, "tr", JOYB_TR }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver (XBOX)", 6, "select", JOYB_SELECT }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver (XBOX)", 7, "start", JOYB_START }, + { 0x045e, 0x02a1, "Xbox 360 Wireless Receiver (XBOX)", 8, "mode", JOYB_MODE }, + /* Xbox 360 Wireless Receiver */ { 0x045e, 0x0719, "Xbox 360 Wireless Receiver", 1, "a", JOYB_A }, { 0x045e, 0x0719, "Xbox 360 Wireless Receiver", 0, "b", JOYB_B }, { 0x045e, 0x0719, "Xbox 360 Wireless Receiver", 3, "x", JOYB_X }, @@ -1572,17 +2954,26 @@ { 0x045e, 0x0291, "Xbox 360 Wireless Receiver", 6, "select", JOYB_SELECT }, { 0x045e, 0x0291, "Xbox 360 Wireless Receiver", 7, "start", JOYB_START }, { 0x045e, 0x0291, "Xbox 360 Wireless Receiver", 8, "mode", JOYB_MODE }, - /* 小米蓝牙手柄 */ - { 0x2717, 0x3144, "小米蓝牙手柄", 5, "a", JOYB_A }, - { 0x2717, 0x3144, "小米蓝牙手柄", 4, "b", JOYB_B }, - { 0x2717, 0x3144, "小米蓝牙手柄", 8, "x", JOYB_X }, - { 0x2717, 0x3144, "小米蓝牙手柄", 7, "y", JOYB_Y }, - { 0x2717, 0x3144, "小米蓝牙手柄", 10, "tl", JOYB_TL }, - { 0x2717, 0x3144, "小米蓝牙手柄", 11, "tr", JOYB_TR }, - { 0x2717, 0x3144, "小米蓝牙手柄", 12, "tl2", JOYB_TL2 }, - { 0x2717, 0x3144, "小米蓝牙手柄", 13, "tr2", JOYB_TR2 }, - { 0x2717, 0x3144, "小米蓝牙手柄", 14, "select", JOYB_SELECT }, - { 0x2717, 0x3144, "小米蓝牙手柄", 15, "start", JOYB_START }, + /* Xiaomi Mi Bluetooth Gamepad */ + { 0x2717, 0x3144, "Xiaomi Mi Bluetooth Gamepad", 5, "a", JOYB_A }, + { 0x2717, 0x3144, "Xiaomi Mi Bluetooth Gamepad", 4, "b", JOYB_B }, + { 0x2717, 0x3144, "Xiaomi Mi Bluetooth Gamepad", 8, "x", JOYB_X }, + { 0x2717, 0x3144, "Xiaomi Mi Bluetooth Gamepad", 7, "y", JOYB_Y }, + { 0x2717, 0x3144, "Xiaomi Mi Bluetooth Gamepad", 10, "tl", JOYB_TL }, + { 0x2717, 0x3144, "Xiaomi Mi Bluetooth Gamepad", 11, "tr", JOYB_TR }, + { 0x2717, 0x3144, "Xiaomi Mi Bluetooth Gamepad", 14, "select", JOYB_SELECT }, + { 0x2717, 0x3144, "Xiaomi Mi Bluetooth Gamepad", 15, "start", JOYB_START }, + /* Xin-Mo Xin-Mo Dual Arcade */ + { 0x16c0, 0x05e1, "Xin-Mo Xin-Mo Dual Arcade", 1, "a", JOYB_A }, + { 0x16c0, 0x05e1, "Xin-Mo Xin-Mo Dual Arcade", 0, "b", JOYB_B }, + { 0x16c0, 0x05e1, "Xin-Mo Xin-Mo Dual Arcade", 4, "x", JOYB_X }, + { 0x16c0, 0x05e1, "Xin-Mo Xin-Mo Dual Arcade", 3, "y", JOYB_Y }, + { 0x16c0, 0x05e1, "Xin-Mo Xin-Mo Dual Arcade", 8, "tl", JOYB_TL }, + { 0x16c0, 0x05e1, "Xin-Mo Xin-Mo Dual Arcade", 5, "tr", JOYB_TR }, + { 0x16c0, 0x05e1, "Xin-Mo Xin-Mo Dual Arcade", 9, "tl2", JOYB_TL2 }, + { 0x16c0, 0x05e1, "Xin-Mo Xin-Mo Dual Arcade", 2, "tr2", JOYB_TR2 }, + { 0x16c0, 0x05e1, "Xin-Mo Xin-Mo Dual Arcade", 7, "select", JOYB_SELECT }, + { 0x16c0, 0x05e1, "Xin-Mo Xin-Mo Dual Arcade", 6, "start", JOYB_START }, /* USB Game Device */ { 0x04b4, 0xc681, "USB Game Device", 1, "a", JOYB_A }, { 0x04b4, 0xc681, "USB Game Device", 2, "b", JOYB_B }, @@ -1623,6 +3014,17 @@ { 0x1781, 0x0a96, "raphnet.net (S)NES Atari USB", 2, "tr", JOYB_TR }, { 0x1781, 0x0a96, "raphnet.net (S)NES Atari USB", 5, "select", JOYB_SELECT }, { 0x1781, 0x0a96, "raphnet.net (S)NES Atari USB", 9, "start", JOYB_START }, + /* Goodbetterbest Ltd Gioteck VX2 2.4G Wireless Controller */ + { 0x25f0, 0x83c2, "Goodbetterbest Ltd Gioteck VX2 2.4G Wireless Controller", 1, "a", JOYB_A }, + { 0x25f0, 0x83c2, "Goodbetterbest Ltd Gioteck VX2 2.4G Wireless Controller", 2, "b", JOYB_B }, + { 0x25f0, 0x83c2, "Goodbetterbest Ltd Gioteck VX2 2.4G Wireless Controller", 0, "x", JOYB_X }, + { 0x25f0, 0x83c2, "Goodbetterbest Ltd Gioteck VX2 2.4G Wireless Controller", 3, "y", JOYB_Y }, + { 0x25f0, 0x83c2, "Goodbetterbest Ltd Gioteck VX2 2.4G Wireless Controller", 4, "tl", JOYB_TL }, + { 0x25f0, 0x83c2, "Goodbetterbest Ltd Gioteck VX2 2.4G Wireless Controller", 5, "tr", JOYB_TR }, + { 0x25f0, 0x83c2, "Goodbetterbest Ltd Gioteck VX2 2.4G Wireless Controller", 6, "tl2", JOYB_TL2 }, + { 0x25f0, 0x83c2, "Goodbetterbest Ltd Gioteck VX2 2.4G Wireless Controller", 7, "tr2", JOYB_TR2 }, + { 0x25f0, 0x83c2, "Goodbetterbest Ltd Gioteck VX2 2.4G Wireless Controller", 8, "select", JOYB_SELECT }, + { 0x25f0, 0x83c2, "Goodbetterbest Ltd Gioteck VX2 2.4G Wireless Controller", 9, "start", JOYB_START }, /* ShanWan Gioteck PS3 Wired Controller */ { 0x25f0, 0xc121, "ShanWan Gioteck PS3 Wired Controller", 1, "a", JOYB_A }, { 0x25f0, 0xc121, "ShanWan Gioteck PS3 Wired Controller", 2, "b", JOYB_B }, @@ -1655,15 +3057,24 @@ { 0x1dd8, 0x000b, "BUFFALO BSGP1601 Series ", 14, "select", JOYB_SELECT }, { 0x1dd8, 0x000b, "BUFFALO BSGP1601 Series ", 15, "start", JOYB_START }, { 0x1dd8, 0x000b, "BUFFALO BSGP1601 Series ", 12, "mode", JOYB_MODE }, - /* USB,2-axis 8-button gamepad */ - { 0x0583, 0x2060, "USB,2-axis 8-button gamepad", 0, "a", JOYB_A }, - { 0x0583, 0x2060, "USB,2-axis 8-button gamepad", 1, "b", JOYB_B }, - { 0x0583, 0x2060, "USB,2-axis 8-button gamepad", 2, "x", JOYB_X }, - { 0x0583, 0x2060, "USB,2-axis 8-button gamepad", 3, "y", JOYB_Y }, - { 0x0583, 0x2060, "USB,2-axis 8-button gamepad", 4, "tl", JOYB_TL }, - { 0x0583, 0x2060, "USB,2-axis 8-button gamepad", 5, "tr", JOYB_TR }, - { 0x0583, 0x2060, "USB,2-axis 8-button gamepad", 6, "select", JOYB_SELECT }, - { 0x0583, 0x2060, "USB,2-axis 8-button gamepad", 7, "start", JOYB_START }, + /* USB,2-axis 8-button gamepad */ + { 0x0583, 0x2060, "USB,2-axis 8-button gamepad ", 0, "a", JOYB_A }, + { 0x0583, 0x2060, "USB,2-axis 8-button gamepad ", 1, "b", JOYB_B }, + { 0x0583, 0x2060, "USB,2-axis 8-button gamepad ", 2, "x", JOYB_X }, + { 0x0583, 0x2060, "USB,2-axis 8-button gamepad ", 3, "y", JOYB_Y }, + { 0x0583, 0x2060, "USB,2-axis 8-button gamepad ", 4, "tl", JOYB_TL }, + { 0x0583, 0x2060, "USB,2-axis 8-button gamepad ", 5, "tr", JOYB_TR }, + { 0x0583, 0x2060, "USB,2-axis 8-button gamepad ", 6, "select", JOYB_SELECT }, + { 0x0583, 0x2060, "USB,2-axis 8-button gamepad ", 7, "start", JOYB_START }, + /* iNNEXT SNES Gamepad */ + { 0x0079, 0x0126, "iNNEXT SNES Gamepad", 1, "a", JOYB_A }, + { 0x0079, 0x0126, "iNNEXT SNES Gamepad", 2, "b", JOYB_B }, + { 0x0079, 0x0126, "iNNEXT SNES Gamepad", 0, "x", JOYB_X }, + { 0x0079, 0x0126, "iNNEXT SNES Gamepad", 3, "y", JOYB_Y }, + { 0x0079, 0x0126, "iNNEXT SNES Gamepad", 4, "tl", JOYB_TL }, + { 0x0079, 0x0126, "iNNEXT SNES Gamepad", 5, "tr", JOYB_TR }, + { 0x0079, 0x0126, "iNNEXT SNES Gamepad", 8, "select", JOYB_SELECT }, + { 0x0079, 0x0126, "iNNEXT SNES Gamepad", 9, "start", JOYB_START }, /* ipega classic gamepad */ { 0x1949, 0x0402, "ipega classic gamepad", 10, "a", JOYB_A }, { 0x1949, 0x0402, "ipega classic gamepad", 9, "b", JOYB_B }, @@ -1673,6 +3084,28 @@ { 0x1949, 0x0402, "ipega classic gamepad", 16, "tr", JOYB_TR }, { 0x1949, 0x0402, "ipega classic gamepad", 19, "select", JOYB_SELECT }, { 0x1949, 0x0402, "ipega classic gamepad", 20, "start", JOYB_START }, + /* Ipega_PG_9068_BT */ + { 0x2563, 0x0623, "Ipega_PG_9068_BT", 0, "a", JOYB_A }, + { 0x2563, 0x0623, "Ipega_PG_9068_BT", 1, "b", JOYB_B }, + { 0x2563, 0x0623, "Ipega_PG_9068_BT", 3, "x", JOYB_X }, + { 0x2563, 0x0623, "Ipega_PG_9068_BT", 4, "y", JOYB_Y }, + { 0x2563, 0x0623, "Ipega_PG_9068_BT", 6, "tl", JOYB_TL }, + { 0x2563, 0x0623, "Ipega_PG_9068_BT", 7, "tr", JOYB_TR }, + { 0x2563, 0x0623, "Ipega_PG_9068_BT", 8, "tl2", JOYB_TL2 }, + { 0x2563, 0x0623, "Ipega_PG_9068_BT", 9, "tr2", JOYB_TR2 }, + { 0x2563, 0x0623, "Ipega_PG_9068_BT", 10, "select", JOYB_SELECT }, + { 0x2563, 0x0623, "Ipega_PG_9068_BT", 10, "start", JOYB_START }, + /* PG-9087 */ + { 0x8087, 0x0a2a, "PG-9087", 11, "a", JOYB_A }, + { 0x8087, 0x0a2a, "PG-9087", 10, "b", JOYB_B }, + { 0x8087, 0x0a2a, "PG-9087", 14, "x", JOYB_X }, + { 0x8087, 0x0a2a, "PG-9087", 13, "y", JOYB_Y }, + { 0x8087, 0x0a2a, "PG-9087", 16, "tl", JOYB_TL }, + { 0x8087, 0x0a2a, "PG-9087", 17, "tr", JOYB_TR }, + { 0x8087, 0x0a2a, "PG-9087", 18, "tl2", JOYB_TL2 }, + { 0x8087, 0x0a2a, "PG-9087", 19, "tr2", JOYB_TR2 }, + { 0x8087, 0x0a2a, "PG-9087", 20, "select", JOYB_SELECT }, + { 0x8087, 0x0a2a, "PG-9087", 21, "start", JOYB_START }, /* kadevice.com KADE - Kick Ass Dynamic Encoder */ { 0x10c4, 0x82c0, "kadevice.com KADE - Kick Ass Dynamic Encoder", 2, "a", JOYB_A }, { 0x10c4, 0x82c0, "kadevice.com KADE - Kick Ass Dynamic Encoder", 1, "b", JOYB_B }, @@ -1685,14 +3118,13 @@ { 0x10c4, 0x82c0, "kadevice.com KADE - Kick Ass Dynamic Encoder", 8, "select", JOYB_SELECT }, { 0x10c4, 0x82c0, "kadevice.com KADE - Kick Ass Dynamic Encoder", 9, "start", JOYB_START }, { 0x10c4, 0x82c0, "kadevice.com KADE - Kick Ass Dynamic Encoder", 12, "mode", JOYB_MODE }, - /* raphnet technologies Dual SNES to USB v2.1 */ - { 0x289b, 0x002f, "raphnet technologies Dual SNES to USB v2.1", 4, "a", JOYB_A }, - { 0x289b, 0x002f, "raphnet technologies Dual SNES to USB v2.1", 1, "b", JOYB_B }, - { 0x289b, 0x002f, "raphnet technologies Dual SNES to USB v2.1", 5, "x", JOYB_X }, - { 0x289b, 0x002f, "raphnet technologies Dual SNES to USB v2.1", 0, "y", JOYB_Y }, - { 0x289b, 0x002f, "raphnet technologies Dual SNES to USB v2.1", 6, "tl", JOYB_TL }, - { 0x289b, 0x002f, "raphnet technologies Dual SNES to USB v2.1", 7, "tr", JOYB_TR }, - { 0x289b, 0x002f, "raphnet technologies Dual SNES to USB v2.1", 3, "start", JOYB_START }, + /* raphnet technologies Dual GC/N64 to USB v3.6 */ + { 0x289b, 0x0063, "raphnet technologies Dual GC/N64 to USB v3.6", 0, "a", JOYB_A }, + { 0x289b, 0x0063, "raphnet technologies Dual GC/N64 to USB v3.6", 1, "b", JOYB_B }, + { 0x289b, 0x0063, "raphnet technologies Dual GC/N64 to USB v3.6", 4, "tl", JOYB_TL }, + { 0x289b, 0x0063, "raphnet technologies Dual GC/N64 to USB v3.6", 5, "tr", JOYB_TR }, + { 0x289b, 0x0063, "raphnet technologies Dual GC/N64 to USB v3.6", 2, "tl2", JOYB_TL2 }, + { 0x289b, 0x0063, "raphnet technologies Dual GC/N64 to USB v3.6", 3, "start", JOYB_START }, /* raphnet technologies Dual SNES to USB v2.1 */ { 0x289b, 0x002f, "raphnet technologies Dual SNES to USB v2.1", 4, "a", JOYB_A }, { 0x289b, 0x002f, "raphnet technologies Dual SNES to USB v2.1", 1, "b", JOYB_B }, @@ -1717,11 +3149,6 @@ { 0x289b, 0x002e, "raphnet technologies SNES to USB v2.1", 6, "tl", JOYB_TL }, { 0x289b, 0x002e, "raphnet technologies SNES to USB v2.1", 7, "tr", JOYB_TR }, { 0x289b, 0x002e, "raphnet technologies SNES to USB v2.1", 3, "start", JOYB_START }, - /* raphnet.net 4nes4snes */ - { 0x1781, 0x0a9d, "raphnet.net 4nes4snes", 7, "a", JOYB_A }, - { 0x1781, 0x0a9d, "raphnet.net 4nes4snes", 6, "b", JOYB_B }, - { 0x1781, 0x0a9d, "raphnet.net 4nes4snes", 5, "select", JOYB_SELECT }, - { 0x1781, 0x0a9d, "raphnet.net 4nes4snes", 4, "start", JOYB_START }, /* raphnet.net Saturn_Adapter_2.0 */ { 0x289b, 0x0005, "raphnet.net Saturn_Adapter_2.0", 5, "a", JOYB_A }, { 0x289b, 0x0005, "raphnet.net Saturn_Adapter_2.0", 2, "b", JOYB_B }, @@ -1732,6 +3159,24 @@ { 0x289b, 0x0005, "raphnet.net Saturn_Adapter_2.0", 3, "tl2", JOYB_TL2 }, { 0x289b, 0x0005, "raphnet.net Saturn_Adapter_2.0", 4, "tr2", JOYB_TR2 }, { 0x289b, 0x0005, "raphnet.net Saturn_Adapter_2.0", 9, "start", JOYB_START }, + /* raphnet.net 4nes4snes */ + { 0x1781, 0x0a96, "raphnet.net 4nes4snes", 4, "a", JOYB_A }, + { 0x1781, 0x0a96, "raphnet.net 4nes4snes", 0, "b", JOYB_B }, + { 0x1781, 0x0a96, "raphnet.net 4nes4snes", 5, "x", JOYB_X }, + { 0x1781, 0x0a96, "raphnet.net 4nes4snes", 1, "y", JOYB_Y }, + { 0x1781, 0x0a96, "raphnet.net 4nes4snes", 6, "tl", JOYB_TL }, + { 0x1781, 0x0a96, "raphnet.net 4nes4snes", 7, "tr", JOYB_TR }, + { 0x1781, 0x0a96, "raphnet.net 4nes4snes", 2, "select", JOYB_SELECT }, + { 0x1781, 0x0a96, "raphnet.net 4nes4snes", 3, "start", JOYB_START }, + /* raphnet.net GC/N64 to USB, v2.3 */ + { 0x289b, 0x0004, "raphnet.net GC/N64 to USB, v2.3", 5, "a", JOYB_A }, + { 0x289b, 0x0004, "raphnet.net GC/N64 to USB, v2.3", 4, "b", JOYB_B }, + { 0x289b, 0x0004, "raphnet.net GC/N64 to USB, v2.3", 3, "x", JOYB_X }, + { 0x289b, 0x0004, "raphnet.net GC/N64 to USB, v2.3", 2, "y", JOYB_Y }, + { 0x289b, 0x0004, "raphnet.net GC/N64 to USB, v2.3", 6, "tl", JOYB_TL }, + { 0x289b, 0x0004, "raphnet.net GC/N64 to USB, v2.3", 7, "tr", JOYB_TR }, + { 0x289b, 0x0004, "raphnet.net GC/N64 to USB, v2.3", 8, "select", JOYB_SELECT }, + { 0x289b, 0x0004, "raphnet.net GC/N64 to USB, v2.3", 1, "start", JOYB_START }, /* retronicdesign.com Sega Joypad Adapter v3.0 */ { 0x16c0, 0x0a99, "retronicdesign.com Sega Joypad Adapter v3.0", 2, "a", JOYB_A }, { 0x16c0, 0x0a99, "retronicdesign.com Sega Joypad Adapter v3.0", 1, "b", JOYB_B }, @@ -1739,24 +3184,13 @@ { 0x16c0, 0x0a99, "retronicdesign.com Sega Joypad Adapter v3.0", 3, "start", JOYB_START }, /* usb gamepad */ { 0x0810, 0xe501, "usb gamepad ", 1, "a", JOYB_A }, - { 0x0810, 0xe501, "usb gamepad ", 0, "b", JOYB_B }, - { 0x0810, 0xe501, "usb gamepad ", 8, "select", JOYB_SELECT }, - { 0x0810, 0xe501, "usb gamepad ", 9, "start", JOYB_START }, - /* usb gamepad */ - { 0x0810, 0xe501, "usb gamepad ", 5, "a", JOYB_A }, - { 0x0810, 0xe501, "usb gamepad ", 1, "b", JOYB_B }, - { 0x0810, 0xe501, "usb gamepad ", 0, "x", JOYB_X }, - { 0x0810, 0xe501, "usb gamepad ", 2, "y", JOYB_Y }, - { 0x0810, 0xe501, "usb gamepad ", 3, "tl", JOYB_TL }, - { 0x0810, 0xe501, "usb gamepad ", 4, "tr", JOYB_TR }, - { 0x0810, 0xe501, "usb gamepad ", 9, "start", JOYB_START }, - /* usb gamepad */ - { 0x0810, 0xe501, "usb gamepad ", 1, "a", JOYB_A }, { 0x0810, 0xe501, "usb gamepad ", 2, "b", JOYB_B }, { 0x0810, 0xe501, "usb gamepad ", 0, "x", JOYB_X }, { 0x0810, 0xe501, "usb gamepad ", 3, "y", JOYB_Y }, { 0x0810, 0xe501, "usb gamepad ", 4, "tl", JOYB_TL }, - { 0x0810, 0xe501, "usb gamepad ", 6, "tr", JOYB_TR }, + { 0x0810, 0xe501, "usb gamepad ", 5, "tr", JOYB_TR }, + { 0x0810, 0xe501, "usb gamepad ", 6, "tl2", JOYB_TL2 }, + { 0x0810, 0xe501, "usb gamepad ", 7, "tr2", JOYB_TR2 }, { 0x0810, 0xe501, "usb gamepad ", 8, "select", JOYB_SELECT }, { 0x0810, 0xe501, "usb gamepad ", 9, "start", JOYB_START }, /* WiseGroup.,Ltd SmartJoy Dual PLUS Adapter */ @@ -1770,7 +3204,6 @@ { 0x1a15, 0x2262, "WiseGroup.,Ltd SmartJoy Dual PLUS Adapter", 5, "tr2", JOYB_TR2 }, { 0x1a15, 0x2262, "WiseGroup.,Ltd SmartJoy Dual PLUS Adapter", 9, "select", JOYB_SELECT }, { 0x1a15, 0x2262, "WiseGroup.,Ltd SmartJoy Dual PLUS Adapter", 8, "start", JOYB_START }, - { 0x1a15, 0x2262, "WiseGroup.,Ltd SmartJoy Dual PLUS Adapter", 0, "mode", JOYB_MODE }, /* Gamesir-G3s */ { 0x05ac, 0x022d, "Gamesir-G3s", 1, "a", JOYB_A }, { 0x05ac, 0x022d, "Gamesir-G3s", 0, "b", JOYB_B }, @@ -1815,4 +3248,3 @@ { 0x05ac, 0x033d, "xiaoji Gamesir-G3v 1.00", 9, "tr2", JOYB_TR2 }, { 0x05ac, 0x033d, "xiaoji Gamesir-G3v 1.00", 10, "select", JOYB_SELECT }, { 0x05ac, 0x033d, "xiaoji Gamesir-G3v 1.00", 11, "start", JOYB_START }, - diff --git a/advance/linux/joverride.py b/advance/linux/joverride.py index cfc701dc..725210fc 100644 --- a/advance/linux/joverride.py +++ b/advance/linux/joverride.py @@ -39,7 +39,17 @@ def entry(amap, desc, vendor, product, key, v0, v1): if not amap.has_key(key): return + value = amap[key] + + # remove dummy + + if value[0] == '+': + value = value[1:] + + if not value.isdigit(): + sys.stderr.write("Skip not numeric value " + key + "=" + value + " for " + desc + "\n") + return + print "\t\t{ 0x" + format(vendor, '04x') + ", 0x" + format(product, '04x') + ", \"" + desc + "\", " + str(value) + ", \"" + v0 + "\", " + v1 + " }," def process(file): @@ -49,13 +59,27 @@ def process(file): amap = dict() for s in lines: - if len(s) == 0 or s[0] == '#': + # cut '#' comments + t = s.split('#') + s = t[0].strip() + + # ignore empty lines + if len(s) == 0: continue + t = s.split("=") if len(t) != 2: + sys.stderr.write("Skip multiple = in " + t[0] + " in " + file + "\n") continue + t0 = t[0].strip() t1 = t[1].strip().strip("\"") + + # skip empty assignments + if len(t1) == 0: + sys.stderr.write("Skip empty assignment of " + t0 + " in " + file + "\n") + continue + amap[t0] = t1 if not amap.has_key("input_vendor_id"): From ef3a6e5c33564b2dcb56df0ea507d9ad8ff6f20c Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 28 Feb 2024 19:52:24 +0100 Subject: [PATCH 04/46] Uses exit instead return in main In menu it makes difference in Raspbin. Not clear why. --- advance/menu/mm.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advance/menu/mm.cc b/advance/menu/mm.cc index 402c7274..1649e93c 100644 --- a/advance/menu/mm.cc +++ b/advance/menu/mm.cc @@ -892,7 +892,7 @@ int os_main(int argc, char* argv[]) conf_done(config_context); - return EXIT_SUCCESS; + exit(EXIT_SUCCESS); err_inner_init: os_inner_done(); @@ -903,6 +903,6 @@ int os_main(int argc, char* argv[]) err_conf: conf_done(config_context); - return EXIT_FAILURE; + exit(EXIT_FAILURE); } From b4e58645bd6ff818ca63ad6ced7c29db0942f298 Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Fri, 1 Mar 2024 09:06:06 +0000 Subject: [PATCH 05/46] Hookup the HD647180 sound mcu for Ghox, TekiPaki and Whoopee! (#121) With thanks to dink for advice as per how to hookup the mcu inputs for TekiPaki using the older codebase. --- src/drivers/toaplan2.c | 353 ++++++++++------------------------------- 1 file changed, 86 insertions(+), 267 deletions(-) diff --git a/src/drivers/toaplan2.c b/src/drivers/toaplan2.c index a2233ba3..a9595d52 100644 --- a/src/drivers/toaplan2.c +++ b/src/drivers/toaplan2.c @@ -216,14 +216,14 @@ PCB Layout Game status: -Teki Paki Working, but no sound. Missing sound MCU dump. Chip is protected. It's a QFP80 Hitachi HD647180. -Ghox Working, but no sound. Missing sound MCU dump. It's a QFP80 Hitachi HD647180. +Teki Paki Working. +Ghox Working. Dogyuun Working, but no sound. MCU type is likely a NEC V25+. Chip is a PLCC94 stamped 'TS-002-MACH'. Dogyuun (location test) Working. Knuckle Bash Working, but sound FX only (missing music). MCU type is a NEC V25+. Chip is a PLCC94 stamped 'TS-004-DASH'. Some PCBs use another version stamped 'NITRO' which is the same chip type. Truxton 2 Working. Pipi & Bibis Working. -Whoopee Working. Missing sound MCU dump. It's a Hitachi HD647180. Using bootleg sound CPU dump for now. +Whoopee Working. Pipi & Bibis (Ryouta Kikaku) Working. FixEight Not working properly. Missing background GFX, and sound FX only (missing music). Both controlled by MCU. MCU type is a NEC V25+. Chip is a PLCC94 stamped 'TS-001-TURBO' FixEight bootleg Working. One unknown ROM (same as pipibibi one). Region hardcoded to Korea (@ $4d8) @@ -270,6 +270,7 @@ To Do / Unknowns: #include "driver.h" #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" +#include "cpu/z180/z180.h" #include "machine/eeprom.h" #include "machine/nmk112.h" #include "sound/2151intf.h" @@ -381,6 +382,11 @@ void kbash_okisnd_w(int data); void fixeight_okisnd_w(int data); void batsugun_okisnd_w(int data); +UINT8 m_cmdavailable; + +READ8_HANDLER(tekipaki_soundlatch_r); +READ8_HANDLER(tekipaki_cmdavailable_r); + int fadeout_ready = 0; int fadeout_stop = 0; int counter1 = 0; @@ -752,92 +758,20 @@ static WRITE16_HANDLER( toaplan2_shared_w ) static WRITE16_HANDLER( toaplan2_hd647180_cpu_w ) { - /* Command sent to secondary CPU. Support for HD647180 will be - required when a ROM dump becomes available for this hardware */ - - if (ACCESSING_LSB) - { - if (toaplan2_sub_cpu == CPU_2_Z80) /* Whoopee */ - { - toaplan2_shared_ram[0] = data & 0xff; - } - else /* Teki Paki */ - { - mcu_data = data & 0xff; - logerror("PC:%08x Writing command (%04x) to secondary CPU shared port\n",activecpu_get_previouspc(),mcu_data); - } - } -} - -static WRITE16_HANDLER( tekipaki_hd647180_w ) -{ - if (data == 0xfe) - { - sample_stop(0);sample_stop(1);sample_stop(2);sample_stop(3); - sample_stop(4);sample_stop(5);sample_stop(6);sample_stop(7); - } - - if (data >= 0x01 && data <= 0x03) - sample_start (0, data, 1); - - if (data >= 0x04 && data <= 0x05) - sample_start (0, data, 0); - - if (data == 0x06) - sample_start (1, data ,0); - - if (data == 0x07) - sample_start (1, data ,0); - - if (data >= 0x08 && data <= 0x09) - sample_start (2, data, 0); - - if (data >= 0x0a && data <= 0x0d) - sample_start (3, data, 0); - - if (data >= 0x0e && data <= 0x12) - sample_start (4, data, 0); - - if (data >= 0x13 && data <= 0x14) - sample_start (5, data, 0); - - if (data == 0x15) - sample_start (6, data, 0); - if (ACCESSING_LSB) { mcu_data = data & 0xff; - /* logerror("PC:%08x Writing command (%04x) to secondary CPU shared port\n",activecpu_get_previouspc(),mcu_data); */ + m_cmdavailable = 1; } } -static const char *tekipaki_sample_names[] = -{ - "*tekipaki", - "dm.wav","01.wav","02.wav","03.wav","04.wav","05.wav","06.wav","07.wav", - "08.wav","09.wav","0a.wav","0b.wav","0c.wav","0d.wav","0e.wav","0f.wav", - "10.wav","11.wav","12.wav","13.wav","14.wav","15.wav",0 -}; - -struct Samplesinterface tekipaki_samples_interface = -{ - 8,tekipaki_sample_names -}; - static READ16_HANDLER( c2map_port_6_r ) { /* For Teki Paki hardware */ /* bit 4 high signifies secondary CPU is ready */ /* bit 5 is tested low before V-Blank bit ??? */ - switch (toaplan2_sub_cpu) - { - case CPU_2_Z80: mcu_data = toaplan2_shared_ram[0]; break; /* Whoopee */ - case CPU_2_HD647180: mcu_data = 0xff; break; /* Teki Paki */ - default: mcu_data = 0x00; break; - } - if (mcu_data == 0xff) mcu_data = 0x10; - else mcu_data = 0x00; - return ( mcu_data | input_port_6_r(0) ); + return (((m_cmdavailable) ? 0x00 : 0x10) | (input_port_6_r(0) & 0x0f)); /* dink */ + } static READ16_HANDLER( pipibibi_z80_status_r ) @@ -875,142 +809,6 @@ static READ16_HANDLER( ghox_p2_h_analog_r ) return value; } -static READ16_HANDLER( ghox_mcu_r ) -{ - return 0xff; -} - -static WRITE16_HANDLER( ghox_mcu_w ) -{ -// ui_popup("%x",data); -// fprintf(stderr, "cmd %x ",data); - - if (data == 0xfe) - sample_stop (0); - - if (data == 0x42 || data == 0x44 || data == 0x45 || data == 0x47 || data == 0x48 || data == 0x4c || data == 0x4d || data == 0x4e) - sample_start (0, data , 1); - - if (data == 0xd0) - sample_start (0, 0, 1); - - if (data == 0x49) - sample_start (0, data , 0); - - if (data >= 0x02 && data <= 0x0f) - sample_start (1, data , 0); - - if (data >= 0x10 && data <= 0x17) - sample_start (2, data , 0); - - if (data >= 0x18 && data <= 0x1f) - sample_start (3, data , 0); - - if (data >= 0x20 && data <= 0x27) - sample_start (4, data , 0); - - if (data >= 0x28 && data <= 0x2f) - sample_start (5, data , 0); - - if (data >= 0x30 && data <= 0x38) - sample_start (6, data , 0); - - if (data == 0x39) - sample_start (8, data , 0); - - if (data >= 0x3a && data <= 0x3f) - sample_start (7, data , 0); - - if (data == 0x01) - sample_start (8, data , 0); - - if (data == 0x4b) - sample_start (0, 0x4f , 0); - - if (ACCESSING_LSB) - { - mcu_data = data; - if ((data >= 0xd0) && (data < 0xe0)) - { - offset = ((data & 0x0f) * 2) + (0x38 / 2); - toaplan2_shared_ram16[offset ] = 0x0005; /* Return address for */ - toaplan2_shared_ram16[offset-1] = 0x0056; /* RTS instruction */ - } - else - { - logerror("PC:%08x Writing %08x to HD647180 cpu shared ram status port\n",activecpu_get_previouspc(),mcu_data); - } - toaplan2_shared_ram16[0x56 / 2] = 0x004e; /* Return a RTS instruction */ - toaplan2_shared_ram16[0x58 / 2] = 0x0075; - - if (data == 0xd3) - { - toaplan2_shared_ram16[0x56 / 2] = 0x003a; // move.w d1,d5 - toaplan2_shared_ram16[0x58 / 2] = 0x0001; - toaplan2_shared_ram16[0x5a / 2] = 0x0008; // bclr.b #0,d5 - toaplan2_shared_ram16[0x5c / 2] = 0x0085; - toaplan2_shared_ram16[0x5e / 2] = 0x0000; - toaplan2_shared_ram16[0x60 / 2] = 0x0000; - toaplan2_shared_ram16[0x62 / 2] = 0x00cb; // muls.w #3,d5 - toaplan2_shared_ram16[0x64 / 2] = 0x00fc; - toaplan2_shared_ram16[0x66 / 2] = 0x0000; - toaplan2_shared_ram16[0x68 / 2] = 0x0003; - toaplan2_shared_ram16[0x6a / 2] = 0x0090; // sub.w d5,d0 - toaplan2_shared_ram16[0x6c / 2] = 0x0045; - toaplan2_shared_ram16[0x6e / 2] = 0x00e5; // lsl.b #2,d1 - toaplan2_shared_ram16[0x70 / 2] = 0x0009; - toaplan2_shared_ram16[0x72 / 2] = 0x004e; // rts - toaplan2_shared_ram16[0x74 / 2] = 0x0075; - } - } -} - - -static const char *ghox_sample_names[] = -{ - "*ghox", - "d0.wav","01.wav","02.wav","dm.wav","04.wav","05.wav","06.wav","dm.wav", - "08.wav","09.wav","dm.wav","0b.wav","0c.wav","dm.wav","dm.wav","0f.wav", - "dm.wav","11.wav","12.wav","12.wav","14.wav","15.wav","16.wav","17.wav", - "18.wav","19.wav","1a.wav","1b.wav","1c.wav","1c.wav","1c.wav","1f.wav", - "20.wav","21.wav","22.wav","23.wav","24.wav","dm.wav","dm.wav","27.wav", - "dm.wav","dm.wav","2a.wav","2b.wav","dm.wav","2d.wav","2e.wav","2f.wav", - "dm.wav","dm.wav","dm.wav","33.wav","34.wav","35.wav","36.wav","37.wav", - "38.wav","39.wav","dm.wav","dm.wav","3c.wav","dm.wav","3e.wav","dm.wav", - "dm.wav","dm.wav","42.wav","43.wav","44.wav","45.wav","43.wav","47.wav", - "48.wav","49.wav","43.wav","dm.wav","4c.wav","4d.wav","4e.wav","d1.wav",0 -}; - -struct Samplesinterface ghox_samples_interface = -{ - 9,ghox_sample_names -}; - -static READ16_HANDLER( ghox_shared_ram_r ) -{ - /* Ghox 68K reads data from MCU shared RAM and writes it to main RAM. - It then subroutine jumps to main RAM and executes this code. - Here, we're just returning a RTS instruction for now. - See above ghox_mcu_w routine. - - Offset $56 and $58 are accessed from around PC:0F814 - - Offset $38 and $36 are accessed from around PC:0DA7C - Offset $3c and $3a are accessed from around PC:02E3C - Offset $40 and $3E are accessed from around PC:103EE - Offset $44 and $42 are accessed from around PC:0FB52 - Offset $48 and $46 are accessed from around PC:06776 - */ - - return toaplan2_shared_ram16[offset] & 0xff; -} -static WRITE16_HANDLER( ghox_shared_ram_w ) -{ - if (ACCESSING_LSB) - { - toaplan2_shared_ram16[offset] = data & 0xff; - } -} static READ16_HANDLER( shared_ram_r ) { @@ -1942,10 +1740,10 @@ static ADDRESS_MAP_START( tekipaki_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x180040, 0x180041) AM_WRITE(toaplan2_coin_word_w) /* Coin count/lock */ AM_RANGE(0x180050, 0x180051) AM_READ(port_tag_to_handler16("IN1")) AM_RANGE(0x180060, 0x180061) AM_READ(port_tag_to_handler16("IN2")) - AM_RANGE(0x180070, 0x180071) AM_WRITE(tekipaki_hd647180_w) + AM_RANGE(0x180070, 0x180071) AM_WRITE(toaplan2_hd647180_cpu_w) /* MCU commands */ ADDRESS_MAP_END - +/* Most inputs are now read via the mcu */ static ADDRESS_MAP_START( ghox_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_RANGE(0x040000, 0x040001) AM_READ(ghox_p2_h_analog_r) /* Paddle 2 */ @@ -1956,13 +1754,7 @@ static ADDRESS_MAP_START( ghox_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x140004, 0x140007) AM_READWRITE(toaplan2_0_videoram16_r, toaplan2_0_videoram16_w) /* Tile/Sprite VideoRAM */ AM_RANGE(0x140008, 0x140009) AM_WRITE(toaplan2_0_scroll_reg_select_w) AM_RANGE(0x14000c, 0x14000d) AM_READWRITE(toaplan2_inputport_0_word_r, toaplan2_0_scroll_reg_data_w) - AM_RANGE(0x180000, 0x180001) AM_READWRITE(ghox_mcu_r, ghox_mcu_w) /* really part of shared RAM */ - AM_RANGE(0x180006, 0x180007) AM_READ(port_tag_to_handler16("DSWA")) - AM_RANGE(0x180008, 0x180009) AM_READ(port_tag_to_handler16("DSWB")) - AM_RANGE(0x180010, 0x180011) AM_READ(port_tag_to_handler16("SYS")) - AM_RANGE(0x18000c, 0x18000d) AM_READ(port_tag_to_handler16("IN1")) - AM_RANGE(0x18000e, 0x18000f) AM_READ(port_tag_to_handler16("IN2")) - AM_RANGE(0x180500, 0x180fff) AM_READWRITE(ghox_shared_ram_r, ghox_shared_ram_w) AM_BASE(&toaplan2_shared_ram16) + AM_RANGE(0x180000, 0x180fff) AM_READWRITE(toaplan2_shared_r, toaplan2_shared_w) AM_RANGE(0x181000, 0x181001) AM_WRITE(toaplan2_coin_word_w) AM_RANGE(0x18100c, 0x18100d) AM_READ(port_tag_to_handler16("JMPR")) ADDRESS_MAP_END @@ -2508,15 +2300,64 @@ static ADDRESS_MAP_START( bbakraid_sound_z80_port, ADDRESS_SPACE_IO, 8 ) AM_RANGE(0x81, 0x81) AM_READWRITE(YMZ280B_status_0_r, YMZ280B_data_0_w) ADDRESS_MAP_END +static ADDRESS_MAP_START( ghox_hd647180_readmem, ADDRESS_SPACE_PROGRAM, 8 ) + AM_RANGE(0x00000, 0x03fff) AM_READ(MRA8_ROM) /* Internal 16k byte ROM */ + AM_RANGE(0x0fe00, 0x0ffff) AM_READ(MRA8_RAM) /* Internal 512 byte RAM */ + AM_RANGE(0x3fe00, 0x3ffff) AM_READ(MRA8_RAM) /* RAM (is this actually just internal RAM getting mapped badly?) */ + AM_RANGE(0x40000, 0x4f7ff) AM_READ(MRA8_RAM) + AM_RANGE(0x80002, 0x80002) AM_READ(port_tag_to_handler8("DSWA")) + AM_RANGE(0x80004, 0x80004) AM_READ(port_tag_to_handler8("DSWB")) + AM_RANGE(0x80006, 0x80006) AM_READNOP // nothing? + AM_RANGE(0x80008, 0x80008) AM_READ(port_tag_to_handler8("IN1")) + AM_RANGE(0x8000a, 0x8000a) AM_READ(port_tag_to_handler8("IN2")) + AM_RANGE(0x8000c, 0x8000e) AM_READ(port_tag_to_handler8("SYS")) + AM_RANGE(0x8000e, 0x8000f) AM_READ(YM2151_status_port_0_r) +ADDRESS_MAP_END +static ADDRESS_MAP_START( ghox_hd647180_writemem, ADDRESS_SPACE_PROGRAM, 8 ) + AM_RANGE(0x00000, 0x03fff) AM_WRITE(MWA8_ROM) /* Internal 16k byte ROM */ + AM_RANGE(0x0fe00, 0x0ffff) AM_WRITE(MWA8_RAM) /* Internal 512 byte RAM */ + AM_RANGE(0x3fe00, 0x3ffff) AM_WRITE(MWA8_RAM) /* RAM (is this actually just internal RAM getting mapped badly?) */ + AM_RANGE(0x40000, 0x4f7ff) AM_WRITE(MWA8_RAM) AM_BASE(&toaplan2_shared_ram) + AM_RANGE(0x8000e, 0x8000f) AM_WRITE(YM2151_word_0_w) +ADDRESS_MAP_END -#if HD64x180 -static ADDRESS_MAP_START( hd647180_mem, ADDRESS_SPACE_PROGRAM, 8 ) - AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0xfe00, 0xffff) AM_RAM /* Internal 512 bytes of RAM */ +READ8_HANDLER(tekipaki_soundlatch_r) +{ + m_cmdavailable = 0; + return mcu_data; +}; + +READ8_HANDLER(tekipaki_cmdavailable_r) +{ + if (m_cmdavailable) return 0xff; + else return 0x00; +}; + + +static ADDRESS_MAP_START( hd647180_readmem, ADDRESS_SPACE_PROGRAM, 8 ) + AM_RANGE(0x00000, 0x03fff) AM_READ(MRA8_ROM) + AM_RANGE(0x0fe00, 0x0ffff) AM_READ(MRA8_RAM) /* Internal 512 bytes of RAM */ +ADDRESS_MAP_END + +static ADDRESS_MAP_START( hd647180_writemem, ADDRESS_SPACE_PROGRAM, 8 ) + AM_RANGE(0x00000, 0x03fff) AM_WRITE(MWA8_ROM) + AM_RANGE(0x0fe00, 0x0ffff) AM_WRITE(MWA8_RAM) /* Internal 512 bytes of RAM */ +ADDRESS_MAP_END + + +static ADDRESS_MAP_START( hd647180_port_readmem, ADDRESS_SPACE_IO, 8 ) + AM_RANGE(0x60, 0x60) AM_READ(tekipaki_cmdavailable_r) + AM_RANGE(0x82, 0x82) AM_READ(YM3812_status_port_0_r) + AM_RANGE(0x83, 0x83) AM_READ(YM3812_status_port_0_r) + AM_RANGE(0x84, 0x84) AM_READ(tekipaki_soundlatch_r) +ADDRESS_MAP_END + +static ADDRESS_MAP_START( hd647180_port_writemem, ADDRESS_SPACE_IO, 8 ) + AM_RANGE(0x82, 0x82) AM_WRITE(YM3812_control_port_0_w) + AM_RANGE(0x83, 0x83) AM_WRITE(YM3812_write_port_0_w) ADDRESS_MAP_END -#endif #if V25 @@ -4061,13 +3902,13 @@ static MACHINE_DRIVER_START( tekipaki ) MDRV_CPU_PROGRAM_MAP(tekipaki_68k_mem, 0) MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4,262) -#if HD64x180 MDRV_CPU_ADD(Z180, 10000000) /* HD647180 CPU actually */ - MDRV_CPU_PROGRAM_MAP(hd647180_mem, 0) -#endif - + MDRV_CPU_PROGRAM_MAP(hd647180_readmem,hd647180_writemem) + MDRV_CPU_IO_MAP(hd647180_port_readmem,hd647180_port_writemem) + MDRV_FRAMES_PER_SECOND(60) MDRV_VBLANK_DURATION(DEFAULT_REAL_60HZ_VBLANK_DURATION) + MDRV_INTERLEAVE(10) MDRV_MACHINE_RESET(toaplan2) @@ -4084,14 +3925,10 @@ static MACHINE_DRIVER_START( tekipaki ) /* sound hardware */ MDRV_SPEAKER_STANDARD_MONO("mono") -/* + MDRV_SOUND_ADD(YM3812, 27000000/8) MDRV_SOUND_CONFIG(ym3812_interface) MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) -*/ - MDRV_SOUND_ADD(SAMPLES, 0) - MDRV_SOUND_CONFIG(tekipaki_samples_interface) - MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_DRIVER_END @@ -4102,14 +3939,13 @@ static MACHINE_DRIVER_START( ghox ) MDRV_CPU_PROGRAM_MAP(ghox_68k_mem, 0) MDRV_CPU_VBLANK_INT(toaplan2_vblank_irq4,262) -#if HD64x180 MDRV_CPU_ADD(Z180, 10000000) /* HD647180 CPU actually */ - MDRV_CPU_PROGRAM_MAP(hd647180_mem, 0) -#endif + MDRV_CPU_PROGRAM_MAP(ghox_hd647180_readmem,ghox_hd647180_writemem) MDRV_FRAMES_PER_SECOND(60) MDRV_VBLANK_DURATION(DEFAULT_REAL_60HZ_VBLANK_DURATION) - + MDRV_INTERLEAVE(10) + MDRV_MACHINE_RESET(ghox) /* video hardware */ @@ -4124,18 +3960,11 @@ static MACHINE_DRIVER_START( ghox ) MDRV_VIDEO_UPDATE(toaplan2_0) /* sound hardware */ -/* MDRV_SPEAKER_STANDARD_STEREO("left", "right") MDRV_SOUND_ADD(YM2151, 27000000/8) MDRV_SOUND_ROUTE(0, "left", 0.25) MDRV_SOUND_ROUTE(1, "right", 0.25) -*/ - MDRV_SPEAKER_STANDARD_MONO("mono") - - MDRV_SOUND_ADD(SAMPLES, 0) - MDRV_SOUND_CONFIG(ghox_samples_interface) - MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_DRIVER_END @@ -4880,11 +4709,9 @@ ROM_START( tekipaki ) ROM_LOAD16_BYTE( "tp020-1.bin", 0x000000, 0x010000, CRC(d8420bd5) SHA1(30c1ad9e053cd7e79adb42aa428ebee28e144755) ) ROM_LOAD16_BYTE( "tp020-2.bin", 0x000001, 0x010000, CRC(7222de8e) SHA1(8352ae23efc24a2e20cc24b6d37cb8fc6b1a730c) ) -#if HD64x180 - ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound HD647180 code */ - /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */ - ROM_LOAD( "hd647180.020", 0x00000, 0x08000, NO_DUMP ) -#endif + ROM_REGION( 0x8000, REGION_CPU2, 0 ) /* Sound HD647180 code */ + ROM_LOAD( "hd647180.020", 0x00000, 0x08000, CRC(d5157c12) SHA1(b2c6c087bb539456a9e562d0b40f05dde26cacd3) ) + ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) ROM_LOAD( "tp020-4.bin", 0x000000, 0x080000, CRC(3ebbe41e) SHA1(cea196c5f83e1a23d5b538a0db9bbbffa7af5118) ) @@ -4897,11 +4724,8 @@ ROM_START( ghox ) ROM_LOAD16_BYTE( "tp021-01.u10", 0x000000, 0x020000, CRC(9e56ac67) SHA1(daf241d9e55a6e60fc004ed61f787641595b1e62) ) ROM_LOAD16_BYTE( "tp021-02.u11", 0x000001, 0x020000, CRC(15cac60f) SHA1(6efa3a50a5dfe6ef4072738d6a7d0d95dca8a675) ) -#if HD64x180 ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound HD647180 code */ - /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */ - ROM_LOAD( "hd647180.021", 0x00000, 0x08000, NO_DUMP ) -#endif + ROM_LOAD( "hd647180.021", 0x00000, 0x08000, CRC(6ab59e5b) SHA1(d814dd3a8f1ee638794e2bd422eed4247ba4a15e) ) ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) ROM_LOAD( "tp021-03.u36", 0x000000, 0x080000, CRC(a15d8e9d) SHA1(640a33997bdce8e84bea6a944139716379839037) ) @@ -4914,11 +4738,8 @@ ROM_START( ghoxj ) ROM_LOAD16_BYTE( "tp021-01a.u10", 0x000000, 0x020000, CRC(c11b13c8) SHA1(da7defc1d3b6ddded910ba56c31fbbdb5ed57b09) ) ROM_LOAD16_BYTE( "tp021-02a.u11", 0x000001, 0x020000, CRC(8d426767) SHA1(1ed4a8bcbf4352257e7d58cb5c2c91eb48c2f047) ) -#if HD64x180 ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound HD647180 code */ - /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */ - ROM_LOAD( "hd647180.021", 0x00000, 0x08000, NO_DUMP ) -#endif + ROM_LOAD( "hd647180.021", 0x00000, 0x08000, CRC(6ab59e5b) SHA1(d814dd3a8f1ee638794e2bd422eed4247ba4a15e) ) ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) ROM_LOAD( "tp021-03.u36", 0x000000, 0x080000, CRC(a15d8e9d) SHA1(640a33997bdce8e84bea6a944139716379839037) ) @@ -5045,11 +4866,9 @@ ROM_START( whoopee ) ROM_LOAD16_BYTE( "whoopee.1", 0x000000, 0x020000, CRC(28882e7e) SHA1(8fcd278a7d005eb81cd9e461139c0c0f756a4fa4) ) ROM_LOAD16_BYTE( "whoopee.2", 0x000001, 0x020000, CRC(6796f133) SHA1(d4e657be260ba3fd3f0556ade617882513b52685) ) - ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound Z80 code */ - /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */ - /* use the Z80 version from the bootleg Pipi & Bibis set for now */ - ROM_LOAD( "hd647180.025", 0x00000, 0x08000, BAD_DUMP CRC(101c0358) SHA1(162e02d00b7bdcdd3b48a0cd0527b7428435ec50) ) - + ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound HD647180 code */ + ROM_LOAD( "hd647180.025", 0x00000, 0x08000, CRC(c02436f6) SHA1(385343f88991646ec23b385eaea82718f1251ea6) ) + ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_DISPOSE ) ROM_LOAD( "tp025-4.bin", 0x000000, 0x100000, CRC(ab97f744) SHA1(c1620e614345dbd5c6567e4cb6f55c61b900d0ee) ) ROM_LOAD( "tp025-3.bin", 0x100000, 0x100000, CRC(7b16101e) SHA1(ae0119bbfa0937d18c4fbb0a3ef7cdc3b9fa6b56) ) @@ -5756,7 +5575,7 @@ GAME( 1993, kbash, 0, kbash, kbash, T2_V25, ROT0, "Toaplan", GAME( 1999, kbash2, 0, kbash2, kbash2, T2_noZ80, ROT0, "bootleg", "Knuckle Bash 2 (bootleg)", 0 ) GAME( 1992, truxton2, 0, truxton2, truxton2, T2_noZ80, ROT270, "Toaplan", "Truxton II / Tatsujin II / Tatsujin Oh (Japan)", 0 ) GAME( 1991, pipibibs, 0, pipibibs, pipibibs, T2_Z80, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!!", 0 ) -GAME( 1991, whoopee, pipibibs, whoopee, whoopee, T2_Z80, ROT0, "Toaplan", "Whoopee!! / Pipi & Bibis", 0 ) +GAME( 1991, whoopee, pipibibs, tekipaki, whoopee, T2_Z180, ROT0, "Toaplan", "Whoopee!! / Pipi & Bibis", 0 ) GAME( 1991, pipibibi, pipibibs, pipibibi, pipibibi, pipibibi, ROT0, "[Toaplan] Ryouta Kikaku", "Pipi & Bibis / Whoopee!! (bootleg ?)", 0 ) GAME( 1992, fixeight, 0, fixeight, fixeight, fixeight, ROT270, "Toaplan", "FixEight", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING ) GAME( 1992, fixeighb, fixeight, fixeighb, fixeighb, fixeighb, ROT270, "bootleg", "FixEight (bootleg)", 0 ) From 5ba03e1ff53bcb5080b9dda5af3acd54a06bff15 Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Fri, 1 Mar 2024 09:06:25 +0000 Subject: [PATCH 06/46] New Working Danger Express Atari Prototype (#122) --- src/drivers/atarig42.c | 143 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/src/drivers/atarig42.c b/src/drivers/atarig42.c index 1406e013..e40ab378 100644 --- a/src/drivers/atarig42.c +++ b/src/drivers/atarig42.c @@ -7,6 +7,7 @@ Games supported: * Road Riot 4WD (1991) * Guardians of the 'Hood (1992) + * Danger Express (1992) Known bugs: * ASIC65 for Road Riot not quite perfect @@ -446,6 +447,51 @@ INPUT_PORTS_START( guardian ) PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END +INPUT_PORTS_START( dangerex ) + PORT_START /* e00000 */ + PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) // Toggle 0 - D4 + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) // Toggle 1 - D5 + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) // Step SW - D6 + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) // Freeze - D7 + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + + PORT_START /* e00002 */ + PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED ) // Test Yellow - D4 + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) // Test Blue - D5 + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) // Test Blue - D6 + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) // Test Blue - D7 + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + + PORT_START /* e00010 */ + PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_SERVICE( 0x0040, IP_ACTIVE_LOW ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK ) + PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) + + JSA_III_PORT /* audio board port */ + + PORT_START /* analog 0 */ + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START /* analog 1 */ + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) +INPUT_PORTS_END /************************************* @@ -634,6 +680,57 @@ ROM_START( guardian ) ROM_LOAD( "136092-1003.bin", 0x0400, 0x0200, CRC(344b406a) SHA1(f4422f8c0d7004d0277a4fc77718d555f80fcf69) ) ROM_END +ROM_START( dangerex ) + ROM_REGION( 0x80004, REGION_CPU1, 0 ) /* 68000 code */ + ROM_LOAD16_BYTE( "dx8d-0h.8d", 0x00000, 0x20000, CRC(4957b65d) SHA1(de9f187b6496cf96d29c4b1b29887abc2bdf9bf0) ) + ROM_LOAD16_BYTE( "dx8c-0l.8c", 0x00001, 0x20000, CRC(aedcb497) SHA1(7e201b7db5c0ff661f782566a6b17299d514c77a) ) + ROM_LOAD16_BYTE( "dx9d-1h.9d", 0x40000, 0x20000, CRC(2eb943e2) SHA1(87dbf11720e2938bf5755b13231fc668ab3e0e05) ) + ROM_LOAD16_BYTE( "dx9c-1l.9c", 0x40001, 0x20000, CRC(79de4c91) SHA1(31de5e927aff4efcf4217da3c704ece2d393faf9) ) + + ROM_REGION( 0x14000, REGION_CPU2, 0 ) /* 6502 code */ + ROM_LOAD( "dx12c-5.12c", 0x10000, 0x4000, CRC(d72621f7) SHA1(4bf5c98dd2434cc6ed1bddb6baf42f41cf138e1a) ) + ROM_CONTINUE( 0x04000, 0xc000 ) + + ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) + ROM_LOAD( "dxc117-22d.22d", 0x000000, 0x20000, CRC(5532995a) SHA1(21e001c911adb91dbe43e895ae8582df65f2995d) ) /* playfield, planes 0-1 */ + ROM_LOAD( "dx82-22c.22c", 0x020000, 0x20000, CRC(9548599b) SHA1(d08bae8dabce0175f956631ddfbf091653af035e) ) + ROM_LOAD( "dxc116-20-21d.21d", 0x040000, 0x20000, CRC(ebbf0fd8) SHA1(4ceb026c4231b675215110c16c8f75551cdfa461) ) /* playfield, planes 2-3 */ + ROM_LOAD( "dxc81-22-21c.21c", 0x060000, 0x20000, CRC(24cb1d34) SHA1(4fc558c8dee3654abd164e5e4adddf9bfcbca3ae) ) + ROM_LOAD( "dxc115-20d.20d", 0x080000, 0x20000, CRC(2819ce54) SHA1(9a3c041d9046af41997dc1d9f41bf0e1be9489f9) ) /* playfield, planes 4-5 */ + ROM_LOAD( "dxc80-20c.20c", 0x0a0000, 0x20000, CRC(a8ffe459) SHA1(92a10694c38a4fbe3022662f4e8e4e214aab31c9) ) + + ROM_REGION( 0x020000, REGION_GFX2, ROMREGION_DISPOSE ) + ROM_LOAD( "dxc187-22j.22j", 0x000000, 0x20000, CRC(7231ecc2) SHA1(8b1b0aed3a0d907630e120395b0a97fd9a1ef8cc) ) /* alphanumerics */ + + ROM_REGION16_BE( 0x800000, REGION_GFX3, 0 ) + ROM_LOAD16_BYTE( "dx2s-0h.2s", 0x000000, 0x80000, CRC(89902ce2) SHA1(f910ad65f3780e28c9920c4185c1ea807ec478aa) ) + ROM_LOAD16_BYTE( "dx2p-0l.2p", 0x000001, 0x80000, CRC(dabe7e1c) SHA1(1f77bba57b7025333c27ee3d548d08ee960d63d6) ) + ROM_LOAD16_BYTE( "dx3s-1h.3s", 0x100000, 0x80000, CRC(ffeec3d1) SHA1(de40083ce3862f2b5d37f5f255f93b2b2487ed96) ) + ROM_LOAD16_BYTE( "dx3p-1l.3p", 0x100001, 0x80000, CRC(40b0a300) SHA1(3ec055bdc30e62c5e95541b15c53f1d439ccb5b4) ) + ROM_LOAD16_BYTE( "dx4s-2h.4s", 0x200000, 0x80000, CRC(1e4d0c50) SHA1(fbb5422f43e1c4f8787073c1cdaeb75121a67a35) ) + ROM_LOAD16_BYTE( "dx4p-2l.4p", 0x200001, 0x80000, CRC(00d586e1) SHA1(7e8419a5972a5e0fc372c72b5c5f8f3ff4294a2b) ) + ROM_LOAD16_BYTE( "dx5s-3h.5s", 0x300000, 0x80000, CRC(98e26315) SHA1(dbc567c3b9d00f827acb8ba2d5a79a7d2acc7ddd) ) + ROM_LOAD16_BYTE( "dx5p-3l.5p", 0x300001, 0x80000, CRC(e37b1413) SHA1(490911006f0e10319117dae3a87623d8244ea182) ) + ROM_LOAD16_BYTE( "dx6s-4h.6s", 0x400000, 0x80000, CRC(b2bc538c) SHA1(1bda4a6c40c9389573857879263c0f01b5f029d3) ) + ROM_LOAD16_BYTE( "dx6p-4l.6p", 0x400001, 0x80000, CRC(5e3aefb8) SHA1(492eb7f42bbeefbc377d3a491fe07b64c1c8a11c) ) + ROM_LOAD16_BYTE( "dx7s-5h.7s", 0x500000, 0x80000, CRC(396d706e) SHA1(7682287df2ad2283b5999c3df272baa9559b7bd5) ) + ROM_LOAD16_BYTE( "dx7p-5l.7p", 0x500001, 0x80000, CRC(102c827d) SHA1(6ae405032a07081841a5a3fb48422bd67d37372c) ) + ROM_LOAD16_BYTE( "dx8s-6h.8s", 0x600000, 0x80000, CRC(af3b1f90) SHA1(d514a7b5e9bb263bbb1164a5174fa6943c4e5fb4) ) + ROM_LOAD16_BYTE( "dx8p-6l.8p", 0x600001, 0x80000, CRC(a0e7311b) SHA1(9c4d443c727c3bd59f035bf27c4f7e74046d4c45) ) + ROM_LOAD16_BYTE( "dx9s-7h.7h", 0x700000, 0x80000, CRC(5bf0ce01) SHA1(22f971842371eb36b2dc6ae303ef3955dd9884c2) ) + ROM_LOAD16_BYTE( "dx9p-7l.7l", 0x700001, 0x80000, CRC(e6f1d9fa) SHA1(160b4c9a90bdc48c990e5d4a24b17a284c9b4da8) ) + + ROM_REGION( 0x100000, REGION_SOUND1, 0 ) + ROM_LOAD( "dx19e-0.19e", 0x80000, 0x20000, CRC(e7d9d5fb) SHA1(756b1d59168855a707181dd6c437a59313da5a7c) ) + ROM_LOAD( "dx17e-1.17e", 0xa0000, 0x20000, CRC(ccb73a18) SHA1(3e853f7c7ab32b18fdb6529d37d28eb96c5365dc) ) + ROM_LOAD( "dx15e-2.15e", 0xc0000, 0x20000, CRC(11596234) SHA1(77eab7cb4ad83a50c23127b4fb1bbfd4aa2c6f8d) ) + ROM_LOAD( "dx12e-3.12e", 0xe0000, 0x20000, CRC(c0ffd43c) SHA1(dcd7e3cc5d46db0d0a7fe3806bddbca235492d35) ) + + ROM_REGION( 0x0600, REGION_PROMS, ROMREGION_DISPOSE ) /* microcode for growth renderer */ +// ROM_LOAD( "092-1001.20p", 0x0000, 0x0200, NO_DUMP CRC(b3251eeb) SHA1(5e83baa70aaa28f07f32657bf974fd87719972d3) ) +// ROM_LOAD( "092-1002.22p", 0x0200, 0x0200, NO_DUMP CRC(0c5314da) SHA1(a9c7ee3ab015c7f3ada4200acd2854eb9a5c74b0) ) +// ROM_LOAD( "092-1003.21p", 0x0400, 0x0200, NO_DUMP CRC(344b406a) SHA1(f4422f8c0d7004d0277a4fc77718d555f80fcf69) ) +ROM_END /************************************* @@ -744,6 +841,51 @@ static DRIVER_INIT( guardian ) */ } +static DRIVER_INIT( dangerex ) +{ + static const UINT16 default_eeprom[] = + { + 0x0001,0x01FD,0x01FF,0x01EF,0x0100,0x01CD,0x0300,0x0104, + 0x0700,0x0117,0x0F00,0x0133,0x1F00,0x0133,0x2400,0x0120, + 0x0600,0x0104,0x0300,0x010C,0x01A0,0x0100,0x0152,0x0179, + 0x012D,0x01BD,0x01FD,0x01FF,0x01EF,0x0100,0x01CD,0x0300, + 0x0104,0x0700,0x0117,0x0F00,0x0133,0x1F00,0x0133,0x2400, + 0x0120,0x0600,0x0104,0x0300,0x010C,0x01A0,0x0100,0x0152, + 0x0179,0x012D,0x01BD,0x8C00,0x0118,0x01AB,0x015A,0x0100, + 0x01D0,0x010B,0x01B8,0x01C7,0x01E2,0x0134,0x0100,0x010A, + 0x01BE,0x016D,0x0142,0x0100,0x0120,0x0109,0x0110,0x0141, + 0x0109,0x0100,0x0108,0x0134,0x0105,0x0148,0x1400,0x0000 + }; + atarigen_eeprom_default = default_eeprom; + atarijsa_init(1, 3, 2, 0x0040); + atarijsa3_init_adpcm(REGION_SOUND1); + + atarig42_playfield_base = 0x000; + atarig42_motion_object_base = 0x400; + atarig42_motion_object_mask = 0x3ff; + + asic65_config(ASIC65_GUARDIANS); +/* + Danger Express color MUX + + CRA10=MGEP*!AN.VID7*AN.0*!MO.0 -- if (mopri >= pfpri) && (!alpha) && (mopix != 0) + + CRA9=MGEP*!AN.VID7*AN.0*!MO.0*MVID9 -- if (mopri >= pfpri) && (!alpha) && (mopix != 0) && (mopix & 0x200) + +!MGEP*!AN.VID7*AN.0*PF.VID9 or if (mopri < pfpri) && (!alpha) && (pfpix & 0x200) + +!AN.VID7*AN.0*MO.0*PF.VID9 or if (mopix == 0) && (!alpha) && (pfpix & 0x200) + + CRA8=MGEP*!AN.VID7*AN.0*!MO.0*MVID8 -- if (mopri >= pfpri) && (!alpha) && (mopix != 0) && (mopix & 0x100) + +!MGEP*!AN.VID7*AN.0*PF.VID8 or if (mopri < pfpri) && (!alpha) && (pfpix & 0x100) + +!AN.VID7*AN.0*MO.0*PF.VID8 or if (mopix == 0) && (!alpha) && (pfpix & 0x100) + + CRMUXB=!AN.VID7*AN.0 -- if (!alpha) + + CRMUXA=!MGEP -- if (mopri < pfpri) + +MO.0 or (mopix == 0) + +AN.VID7 or (alpha) + +!AN.0 +*/ +} /************************************* @@ -754,3 +896,4 @@ static DRIVER_INIT( guardian ) GAME( 1991, roadriot, 0, atarig42, roadriot, roadriot, ROT0, "Atari Games", "Road Riot 4WD", GAME_UNEMULATED_PROTECTION ) GAME( 1992, guardian, 0, atarig42, guardian, guardian, ROT0, "Atari Games", "Guardians of the 'Hood", 0 ) +GAME( 1992, dangerex, 0, atarig42, dangerex, dangerex, ROT0, "Atari Games", "Danger Express (prototype)", 0 ) From b98a2292f79f2c671f56f37dfe896b758bdba986 Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Fri, 1 Mar 2024 09:06:39 +0000 Subject: [PATCH 07/46] dangerex (#123) --- src/mamedriv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mamedriv.c b/src/mamedriv.c index 8c3eee79..4861ce89 100644 --- a/src/mamedriv.c +++ b/src/mamedriv.c @@ -4907,6 +4907,7 @@ BOMULEUL CHAJARA SEGA ST-V 1997/04/11 DRIVER( offtwall ) /* 136090 (c) 1991 */ DRIVER( offtwalc ) /* 136090 (c) 1991 */ DRIVER( guardian ) /* 136092 (c) 1992 */ + DRIVER( dangerex ) /* (proto) (c) 1992 */ DRIVER( relief ) /* 136093 (c) 1992 */ DRIVER( relief2 ) /* 136093 (c) 1992 */ DRIVER( arcadecl ) /* (proto) (c) 1992 */ From 5dc3575dcd7812a28693713dd057bece2a09b9dd Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 2 Mar 2024 19:51:55 +0100 Subject: [PATCH 08/46] Fix crashes in some games like p47aces --- src/video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video.c b/src/video.c index 8c8f08a5..7b11f124 100644 --- a/src/video.c +++ b/src/video.c @@ -343,7 +343,7 @@ static int allocate_graphics(const gfx_decode *gfxdecodeinfo) for (j = 0; j < glcopy.planes; j++) { UINT32 value = glcopy.planeoffset[j]; - if (IS_FRAC(value)) + if (IS_FRAC(value) && FRAC_DEN(value)) glcopy.planeoffset[j] = FRAC_OFFSET(value) + region_length * FRAC_NUM(value) / FRAC_DEN(value); } @@ -352,7 +352,7 @@ static int allocate_graphics(const gfx_decode *gfxdecodeinfo) for (j = 0; j < glcopy.width; j++) { UINT32 value = xoffset[j]; - if (IS_FRAC(value)) + if (IS_FRAC(value) && FRAC_DEN(value)) xoffset[j] = FRAC_OFFSET(value) + region_length * FRAC_NUM(value) / FRAC_DEN(value); } @@ -360,7 +360,7 @@ static int allocate_graphics(const gfx_decode *gfxdecodeinfo) for (j = 0; j < glcopy.height; j++) { UINT32 value = yoffset[j]; - if (IS_FRAC(value)) + if (IS_FRAC(value) && FRAC_DEN(value)) yoffset[j] = FRAC_OFFSET(value) + region_length * FRAC_NUM(value) / FRAC_DEN(value); } From 10fe88cb7d1391d998e16676c0eb93419c456e92 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 2 Mar 2024 20:30:40 +0100 Subject: [PATCH 09/46] Add more startup time --- advance/osd/startup.h | 51 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/advance/osd/startup.h b/advance/osd/startup.h index 9859d055..75320206 100644 --- a/advance/osd/startup.h +++ b/advance/osd/startup.h @@ -30,6 +30,55 @@ /* the first match is used */ +{ "cosmogng", 4 }, /* 3.11 */ +{ "batsugun", 11 }, /* 3.11 */ +{ "fghtatck", 9 }, /* 3.11 */ +{ "hyprduel", 13 }, /* 3.11 */ +{ "metalb", 7 }, /* 3.11 */ +{ "bjtwin", 2 }, /* 3.11 */ +{ "hyperath", 25 }, /* 3.11 */ +{ "mace", 16 }, /* 3.11 */ +{ "nagano98", 22 }, /* 3.11 */ +{ "weddingr", 20 }, /* 3.11 */ +{ "djboy", 5 }, /* 3.11 */ +{ "dcclubfd", 14 }, /* 3.11 */ +{ "headonch", 12 }, /* 3.11 */ +{ "mosaicf2", 20 }, /* 3.11 */ +{ "blitz99", 17 }, /* 3.11 */ +{ "offroadc", 20 }, /* 3.11 */ +{ "sss", 17 }, /* 3.11 */ +{ "teetert", 11 }, /* 3.11 */ +{ "tkdensho", 9 }, /* 3.11 */ +{ "firebarr", 13 }, /* 3.11 */ +{ "gprider1", 6 }, /* 3.11 */ +{ "zombraid", 5 }, /* 3.11 */ +{ "machbrkr", 3 }, /* 3.11 */ +{ "bkraidu", 22 }, /* 3.11 */ +{ "puyosun", 21 }, /* 3.11 */ +{ "maruchan", 21 }, /* 3.11 */ +{ "gametngk", 4 }, /* 3.11 */ +{ "47pie2", 6 }, /* 3.11 */ +{ "kirarast", 6 }, /* 3.11 */ +{ "cotton2", 20 }, /* 3.11 */ +{ "p47aces", 5 }, /* 3.11 */ +{ "progear", 23 }, /* 3.11 */ +{ "gratia", 5 }, /* 3.11 */ +{ "nebulray", 3 }, /* 3.11 */ +{ "twineag2", 14 }, /* 3.11 */ +{ "pzloop2j", 13 }, /* 3.11 */ +{ "grdforce", 19 }, /* 3.11 */ +{ "batrid", 20 }, /* 3.11 */ +{ "stmblade", 6 }, /* 3.11 */ +{ "skullfng", 12 }, /* 3.11 */ +{ "gekirido", 12 }, /* 3.11 */ +{ "tcobra2", 8 }, /* 3.11 */ +{ "boogwing", 7 }, /* 3.11 */ +{ "brvblade", 10 }, /* 3.11 */ +{ "bgaregga", 73 }, /* 3.11 */ +{ "shienryu", 19 }, /* 3.11 */ +{ "gseeker", 8 }, /* 3.11 */ +{ "mcatadv", 2 }, /* 3.11 */ +{ "1945kiii", 8 }, /* 3.11 */ { "uccops", 14 }, /* 3.6 */ { "samsho5", 4 }, /* 3.1 */ { "mslug5", 4 }, /* 3.1 */ @@ -261,7 +310,6 @@ { "zedblade", 14 }, /* 0.87 */ { "zunkyou", 12 }, /* 0.87 */ { "zupapa", 8 }, /* 0.87 */ - { "1941", 15 }, /* 0.81 */ { "1944", 13 }, /* 0.81 */ { "19xx", 8 }, /* 0.81 */ @@ -936,4 +984,3 @@ { "zingzip", 3 }, /* 0.81 */ { "zodiack", 3 }, /* 0.81 */ { "zwackery", 4 }, /* 0.81 */ - From 5f6b625366efd054d4a7797b79bea465c07126cf Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 3 Mar 2024 18:26:04 +0100 Subject: [PATCH 10/46] Auto disconnect unpaired devices --- advance/blue/blue.c | 168 +++++++++++++++++++++++++++++---------- advance/linux/target.c | 6 +- advance/menu/emulator.cc | 18 ++--- advance/menu/emulator.h | 3 +- advance/menu/mconfig.cc | 2 + advance/menu/mconfig.h | 1 + advance/menu/mm.cc | 2 +- advance/menu/submenu.cc | 56 ++++++++++--- advance/menu/text.cc | 22 ++--- 9 files changed, 201 insertions(+), 77 deletions(-) diff --git a/advance/blue/blue.c b/advance/blue/blue.c index e4eb969c..321d58dc 100644 --- a/advance/blue/blue.c +++ b/advance/blue/blue.c @@ -183,6 +183,7 @@ void blue_send(int f, const char* command) } struct blue_device { + unsigned cookie; char* id; char name[128]; int is_game; @@ -194,15 +195,17 @@ struct blue_device { struct blue_device* next; }; -struct blue_device* devs; +struct blue_device* DEVS; -struct blue_device* dev_find(const char* id) +struct blue_device* dev_insert(const char* id, unsigned cookie) { - struct blue_device* i = devs; + struct blue_device* i = DEVS; while (i != 0) { - if (strcmp(id, i->id) == 0) + if (strcmp(id, i->id) == 0) { + i->cookie = cookie; return i; + } i = i->next; } @@ -210,18 +213,39 @@ struct blue_device* dev_find(const char* id) i = calloc(1, sizeof(struct blue_device)); i->id = strdup(id); - i->next = devs; - devs = i; + i->cookie = cookie; + i->next = DEVS; + DEVS = i; return i; } +void dev_flush(unsigned cookie) +{ + + struct blue_device* i = DEVS; + + DEVS = 0; + while (i != 0) { + struct blue_device* i_next = i->next; + + if (i->cookie == cookie) { + i->next = DEVS; + DEVS = i; + } else { + free(i); + } + + i = i_next; + } +} + /** * Process a device line * * Like: 'Device E4:17:D8:B8:0B:7E 8Bitdo SFC30 GamePad' */ -void process_device_line(char* line) +void process_device_line(char* line, unsigned cookie) { char* id; int i; @@ -244,23 +268,29 @@ void process_device_line(char* line) *line = 0; /* allocate if missing */ - dev_find(id); + dev_insert(id, cookie); } +unsigned COOKIE = 0; + /** * List all devices */ -void process_list(int in_f, int out_f) +void process_devices(int in_f, int out_f) { char* line; blue_send(in_f, "devices\n"); + ++COOKIE; + line = blue_line(out_f); while (line) { - process_device_line(line); + process_device_line(line, COOKIE); line = blue_line(out_f); } + + dev_flush(COOKIE); } /** @@ -326,7 +356,7 @@ void process_info_line(struct blue_device* dev, const char* line) */ void process_info(int in_f, int out_f) { - struct blue_device* i = devs; + struct blue_device* i = DEVS; while (i != 0) { char cmd[128]; @@ -351,27 +381,35 @@ void process_info(int in_f, int out_f) */ void process_connect(int in_f, int out_f) { - struct blue_device* i = devs; + struct blue_device* i; char processing[4096]; char connected[4096]; + char msg[4096]; char ignored[128]; + char paired[128]; unsigned count_processing; unsigned count_connected; unsigned count_ignored; + unsigned count_paired; + int ret; + time_t now; + now = time(0); count_processing = 0; count_connected = 0; count_ignored = 0; + count_paired = 0; processing[0] = 0; connected[0] = 0; ignored[0] = 0; + paired[0] = 0; - for (i = devs; i != 0; i = i->next) { + for (i = DEVS; i != 0; i = i->next) { char cmd[128]; const char* name = i->name[0] ? i->name : i->id; if (!i->is_game) { - snprintf(ignored, sizeof(ignored) - 1, "%s", name); + snprintf(ignored, sizeof(ignored), "%s", name); ++count_ignored; continue; } @@ -380,7 +418,7 @@ void process_connect(int in_f, int out_f) snprintf(cmd, sizeof(cmd), "trust %s\n", i->id); blue_send(in_f, cmd); blue_discard(out_f); - snprintfcat(processing, sizeof(processing) - 1, "Trusting %s...\n", name); + snprintfcat(processing, sizeof(processing), "Trusting %s...\n", name); ++count_processing; continue; } @@ -396,9 +434,12 @@ void process_connect(int in_f, int out_f) snprintf(cmd, sizeof(cmd), "pair %s\n", i->id); blue_send(in_f, cmd); blue_discard(out_f); - snprintfcat(processing, sizeof(processing) - 1, "Pairing %s...\n", name); + snprintfcat(processing, sizeof(processing), "Pairing %s...\n", name); ++count_processing; continue; + } else { + snprintf(paired, sizeof(paired), "%s", name); + ++count_paired; } if (!i->is_connected && i->need_connect) { @@ -411,7 +452,7 @@ void process_connect(int in_f, int out_f) } if (i->is_connected) { - snprintfcat(connected, sizeof(connected), "Connected %s", name); + snprintf(connected, sizeof(connected), "%s", name); ++count_connected; } } @@ -419,31 +460,45 @@ void process_connect(int in_f, int out_f) /* ensure to have the final terminator */ processing[sizeof(processing) - 1] = 0; connected[sizeof(connected) - 1] = 0; + ignored[sizeof(ignored) - 1] = 0; + paired[sizeof(paired) - 1] = 0; - if (count_processing != 0) { - if (count_connected == 1) - snprintfcat(processing, sizeof(processing), "%s", connected); - else if (count_connected > 1) - snprintfcat(processing, sizeof(processing), "Connected %u devices", count_connected); - } else { - if (count_connected == 0) { - if (count_ignored == 0) { - strcpy(processing, "Scanning for devices..."); - } else if (count_ignored == 1) { - snprintf(processing, sizeof(processing), "Scanning... (%s ignored)", ignored); + if (count_connected == 0) { + if (count_processing != 0) { + /* processing is already set */ + } else { + if (count_paired != 0) { + snprintf(processing, sizeof(processing), "Turn on %s or pair another gamepad", paired); + } else if (count_ignored == 0) { + strcpy(processing, "Insert or pair a gamepad"); } else { - snprintf(processing, sizeof(processing), "Scanning... (%u ignored)", count_ignored); + snprintf(processing, sizeof(processing), "Insert or pair a gamepad (%u ignored)", count_ignored); } - } else if (count_connected > 1) - snprintf(processing, sizeof(processing), "Connected %u devices", count_connected); + } + } else { + if (count_connected == 1) { + snprintf(processing, sizeof(processing), "Connected %s", connected); + } else { + snprintf(processing, sizeof(processing), "Connected %u gamepads", count_connected); + } + } + + if (count_connected == 0 && count_processing == 0) { + if (count_paired != 0) + snprintf(msg, sizeof(msg), "WAITING\n"); else - strcpy(processing, connected); + snprintf(msg, sizeof(msg), "EMPTY\n"); + } else { + snprintf(msg, sizeof(msg), "WORKING\n"); } + snprintfcat(msg, sizeof(msg), processing); + msg[sizeof(msg) - 1] = 0; + if (opt_msg) { int f = open("/tmp/blue.msg", O_CREAT | O_TRUNC | O_WRONLY, 0644); if (f >= 0) { - write(f, processing, strlen(processing)); + write(f, msg, strlen(msg)); close(f); } if (opt_verbose) @@ -451,13 +506,41 @@ void process_connect(int in_f, int out_f) } } -void print_list(void) +void kill_devices(int in_f, int out_f) +{ + struct blue_device* i = DEVS; + + i = DEVS; + while (i != 0) { + char cmd[128]; + struct blue_device* i_next = i->next; + + if (!i->is_game) { + free(i); + i = i_next; + continue; + } + + snprintf(cmd, sizeof(cmd), "remove %s\n", i->id); + + blue_send(in_f, cmd); + blue_discard(out_f); + usleep(1000000); + + free(i); + i = i_next; + } + + DEVS = 0; +} + +void print_devices(void) { - struct blue_device* i = devs; + struct blue_device* i = DEVS; printf("\nDevices:\n"); - for (i = devs; i != 0; i = i->next) { + for (i = DEVS; i != 0; i = i->next) { printf("\t\"%s\" %s %s %s %s %s %s\n", i->name, i->id, i->is_game ? "game" : "", i->is_trusted ? "trusted" : "", @@ -484,14 +567,15 @@ void process(int in_f, int out_f) blue_discard(out_f); - blue_send(in_f, "scan on\n"); + while (1) { + usleep(500000); - blue_discard(out_f); + /* sometimes at startup the scan is lost, better to repeat it every time */ + blue_send(in_f, "scan on\n"); - while (1) { - sleep(1); + blue_discard(out_f); - process_list(in_f, out_f); + process_devices(in_f, out_f); process_info(in_f, out_f); @@ -499,7 +583,7 @@ void process(int in_f, int out_f) if (opt_stat) { backlog_print(); - print_list(); + print_devices(); } } } diff --git a/advance/linux/target.c b/advance/linux/target.c index 62aa5cf0..68391397 100644 --- a/advance/linux/target.c +++ b/advance/linux/target.c @@ -346,12 +346,12 @@ target_clock_t TARGET_CLOCKS_PER_SEC = 1000000LL; target_clock_t target_clock(void) { - struct timeval tv; + struct timespec ts; target_clock_t r; - gettimeofday(&tv, NULL); + clock_gettime(CLOCK_MONOTONIC, &ts); - r = tv.tv_sec * 1000000LL + tv.tv_usec; + r = ts.tv_sec * 1000000LL + ts.tv_nsec / 1000; return r; } diff --git a/advance/menu/emulator.cc b/advance/menu/emulator.cc index cb7cf555..3c21c9e8 100644 --- a/advance/menu/emulator.cc +++ b/advance/menu/emulator.cc @@ -297,9 +297,9 @@ void emulator::load_dirlist(game_set& gar, const string& dirlist, const string& } } -bool emulator::run_process(time_t& duration, const string& dir, int argc, const char** argv, bool ignore_error) const +bool emulator::run_process(target_clock_t& duration, const string& dir, int argc, const char** argv, bool ignore_error) const { - time_t start, stop; + target_clock_t start, stop; bool resume_error = false; @@ -334,11 +334,11 @@ bool emulator::run_process(time_t& duration, const string& dir, int argc, const log_std(("menu: run '%s'\n", cmdline.str().c_str())); - start = time(0); + start = target_clock() / 1000000; int r = target_spawn(argv[0], argv); - stop = time(0); + stop = target_clock() / 1000000; if (stop - start > 8) duration = stop - start; @@ -425,7 +425,7 @@ bool emulator::run(const game& g, const game* bios, unsigned orientation, bool s argc = compile(g, argv, argc, user_cmd_arg, orientation); argv[argc] = 0; - time_t duration; + target_clock_t duration; bool ret = run_process(duration, exe_dir_get(), argc, argv, ignore_error); for (int i = 0; i < argc; ++i) @@ -966,7 +966,7 @@ bool mame_mame::run(const game& g, const game* bios, unsigned orientation, bool argc = compile(g, argv, argc, user_cmd_arg, orientation); argv[argc] = 0; - time_t duration; + target_clock_t duration; bool ret = run_process(duration, exe_dir_get(), argc, argv, ignore_error); for (int i = 0; i < argc; ++i) @@ -1800,7 +1800,7 @@ bool dmess::run(const game& g, const game* bios, unsigned orientation, bool set_ argv[argc] = 0; - time_t duration; + target_clock_t duration; bool ret = run_process(duration, exe_dir_get(), argc, argv, ignore_error); for (int i = 0; i < argc; ++i) @@ -2235,7 +2235,7 @@ bool advmess::run(const game& g, const game* bios, unsigned orientation, bool se argv[argc] = 0; - time_t duration; + target_clock_t duration; bool ret = run_process(duration, exe_dir_get(), argc, argv, ignore_error); for (int i = 0; i < argc; ++i) @@ -2678,7 +2678,7 @@ bool draine::run(const game& g, const game* bios, unsigned orientation, bool set argc = compile(g, argv, argc, user_cmd_arg, orientation); argv[argc] = 0; - time_t duration; + target_clock_t duration; bool ret = run_process(duration, exe_dir_get(), argc, argv, ignore_error); for (int i = 0; i < argc; ++i) diff --git a/advance/menu/emulator.h b/advance/menu/emulator.h index 6d1feaec..19f6699a 100644 --- a/advance/menu/emulator.h +++ b/advance/menu/emulator.h @@ -25,6 +25,7 @@ #include "crc.h" #include "choice.h" #include "conf.h" +#include "target.h" #include @@ -92,7 +93,7 @@ class emulator { void load_dir(game_set& gar, const std::string& dir, const std::string& filterlist, bool quiet); void load_dirlist(game_set& gar, const std::string& dirlist, const std::string& filterlist, bool quiet); - bool run_process(time_t& duration, const std::string& dir, int argc, const char** argv, bool ignore_error) const; + bool run_process(target_clock_t& duration, const std::string& dir, int argc, const char** argv, bool ignore_error) const; unsigned compile(const game& g, const char** argv, unsigned argc, const std::string& list, unsigned orientation) const; bool validate_config_file(const std::string& file) const; diff --git a/advance/menu/mconfig.cc b/advance/menu/mconfig.cc index d799e66f..407c901a 100644 --- a/advance/menu/mconfig.cc +++ b/advance/menu/mconfig.cc @@ -336,6 +336,7 @@ void config_state::conf_register(adv_conf* config_context) conf_string_register_default(config_context, "ui_skiphorz", "auto"); conf_string_register_default(config_context, "ui_skipvert", "auto"); conf_bool_register_default(config_context, "ui_autocalib", 0); + conf_string_register_default(config_context, "ui_autocalib_reset", ""); conf_bool_register_default(config_context, "ui_outline", 1); conf_bool_register_default(config_context, "ui_topname", 0); conf_bool_register_default(config_context, "ui_topbar", 1); @@ -847,6 +848,7 @@ bool config_state::load(adv_conf* config_context, bool opt_verbose) ui_top = conf_int_get_default(config_context, "ui_skiptop"); ui_bottom = conf_int_get_default(config_context, "ui_skipbottom"); ui_autocalib = conf_bool_get_default(config_context, "ui_autocalib"); + ui_autocalib_reset = conf_string_get_default(config_context, "ui_autocalib_reset"); ui_outline = conf_bool_get_default(config_context, "ui_outline"); ui_top_name = conf_bool_get_default(config_context, "ui_topname"); ui_top_bar = conf_bool_get_default(config_context, "ui_topbar"); diff --git a/advance/menu/mconfig.h b/advance/menu/mconfig.h index 9a240814..6e7ac96c 100644 --- a/advance/menu/mconfig.h +++ b/advance/menu/mconfig.h @@ -437,6 +437,7 @@ class config_state { unsigned ui_top; ///< User interface top border unsigned ui_bottom; ///< User interface bottom border bool ui_autocalib; ///< Auto calibration + std::string ui_autocalib_reset; ///< Command for resetting autocalibration bool ui_outline; ///< User interface outline around backdrops bool ui_top_name; ///< Put the title over the backdrop bool ui_top_bar; ///< User interface need top bar diff --git a/advance/menu/mm.cc b/advance/menu/mm.cc index 1649e93c..5a31b0a6 100644 --- a/advance/menu/mm.cc +++ b/advance/menu/mm.cc @@ -699,7 +699,7 @@ int os_main(int argc, char* argv[]) const char* section_map[1]; char cfg_buffer[512]; - srand(time(0)); + srand(target_clock()); config_context = conf_init(); diff --git a/advance/menu/submenu.cc b/advance/menu/submenu.cc index 0295cc3f..5c7b038d 100644 --- a/advance/menu/submenu.cc +++ b/advance/menu/submenu.cc @@ -645,7 +645,7 @@ void run_clone(config_state& rs) // ------------------------------------------------------------------------ // Calib menu -#define CALIB_CHOICE_DX (40 * int_font_dx_get(menu)) +#define CALIB_CHOICE_DX (44 * int_font_dx_get(menu)) #define CALIB_CHOICE_DY (20 * int_font_dy_get(menu) + int_font_dy_get(bar)) #define CALIB_CHOICE_X (int_dx_get() - CALIB_CHOICE_DX) / 2 #define CALIB_CHOICE_Y (int_dy_get() - CALIB_CHOICE_DY) / 2 @@ -653,10 +653,14 @@ void run_clone(config_state& rs) void run_calib(config_state& rs) { int border = int_font_dx_get(bar) / 2; + target_clock_t start; + bool was_processing = false; + bool now_waiting = false; int_idle_2_enable(true, 1); event_unassigned(true); + start = target_clock(); bool done = false; while (!done) { int x = CALIB_CHOICE_X; @@ -672,7 +676,7 @@ void run_calib(config_state& rs) int_box(x - 2 * border, y - border, dx + 4 * border, dy + border * 2, 1, COLOR_CHOICE_NORMAL.foreground); int_clear(x - 2 * border + 1, y - border + 1, dx + 4 * border - 2, dy + border * 2 - 2, COLOR_CHOICE_NORMAL.background); - const char* d_title = "Joystick Configuration"; + const char* d_title = "Gamepad Configuration"; int w_title = int_font_dx_get(bar, d_title); int_put(bar, xc - w_title / 2, y, dx, d_title, COLOR_CHOICE_TITLE); @@ -684,6 +688,10 @@ void run_calib(config_state& rs) int f = open("/tmp/blue.msg", O_RDONLY); if (f >= 0) { char msg[4096]; + char c; + int p; + char* show; + const char* state; int ret = read(f, msg, sizeof(msg) - 1); if (ret > 0) { msg[ret] = 0; @@ -692,12 +700,22 @@ void run_calib(config_state& rs) } close(f); - char* token = strtok(msg, "\n"); - while (token) { + p = 0; + state = stoken(&c, &p, msg, "\n", ""); + sskip(&p, msg, "\n"); + show = &msg[p]; + + if (strcmp(state, "WORKING") == 0) + was_processing = true; + now_waiting = strcmp(state, "WAITING") == 0; + + p = 0; + const char* token = stoken(&c, &p, show, "\n", ""); + while (*token) { int_put_filled_center(menu, x, y, dx, token, COLOR_CHOICE_NORMAL); y += int_font_dy_get(menu); ++bt_line; - token = strtok(NULL, "\n"); + token = stoken(&c, &p, show, "\n", ""); } } @@ -761,7 +779,7 @@ void run_calib(config_state& rs) for (; j < 4; ++j) { ostringstream os; - os << "Joystick " << j + 1 << " - "; + os << "Player " << j + 1 << " - "; int_put(menu, x, y, dx, os.str().c_str(), COLOR_CHOICE_TITLE); y += int_font_dy_get(menu); @@ -783,14 +801,32 @@ void run_calib(config_state& rs) break; } + target_clock_t now = target_clock(); + if (joystickb_count_get() == 0) { - const char* d_exit = "Connect one joystick to continue"; - int w_exit = int_font_dx_get(menu, d_exit); + ostringstream os; - int_put(menu, xc - w_exit / 2, y, w_exit, d_exit, COLOR_CHOICE_NORMAL); + string command = rs.ui_autocalib_reset; + if (command.length() != 0 && now_waiting && !was_processing) { + target_clock_t elapsed = (now - start) / 1000000; + + if (elapsed < 60) { + os << "Connect a gamepad in " << 120 - elapsed << " seconds" ; + } else if (elapsed < 120) { + os << "Going to unpair all gamepads in " << 120 - elapsed << " seconds" ; + } else { + system(command.c_str()); + start = target_clock(); + } + } else { + os << "Connect a gamepad to continue" ; + } + + int w_exit = int_font_dx_get(menu, os.str().c_str()); + int_put(menu, xc - w_exit / 2, y, w_exit, os.str().c_str(), COLOR_CHOICE_NORMAL); y += int_font_dy_get(menu); } else { - const char* d_exit = "Press any button to continue"; + const char* d_exit = "Connect another gamepad or press any button to continue"; int w_exit = int_font_dx_get(menu, d_exit); int_put(menu, xc - w_exit / 2, y, w_exit, d_exit, COLOR_CHOICE_NORMAL); diff --git a/advance/menu/text.cc b/advance/menu/text.cc index 00d377bf..200c5100 100644 --- a/advance/menu/text.cc +++ b/advance/menu/text.cc @@ -449,7 +449,7 @@ static unsigned int_idle_0_rep; ///< Seconds before the second 0 event. static unsigned int_idle_1; ///< Seconds before the first 1 event. static unsigned int_idle_1_rep; ///< Seconds before the second 1 event. static unsigned int_idle_2; ///< Seconds before the first 2 event. -static time_t int_idle_time_current; ///< Last time check in idle. +static target_clock_t int_idle_time_current; ///< Last time check in idle. static bool int_idle_0_state; ///< Idle event 0 enabler. static bool int_idle_1_state; ///< Idle event 1 enabler. static bool int_idle_2_state; ///< Idle event 2 enabler. @@ -691,7 +691,7 @@ void int_done() bool int_set(double gamma, double brightness, unsigned idle_0, unsigned idle_0_rep, unsigned idle_1, unsigned idle_1_rep, bool backdrop_fast, unsigned translucency, bool disable_special, bool auto_calib) { - int_idle_time_current = time(0); + int_idle_time_current = target_clock() / 1000000; int_idle_0 = idle_0; int_idle_1 = idle_1; int_idle_0_rep = idle_0_rep; @@ -3089,7 +3089,7 @@ static void input_poll() void int_idle_time_reset() { - int_idle_time_current = time(0); + int_idle_time_current = target_clock() / 1000000; int_last = EVENT_NONE; } @@ -3111,18 +3111,18 @@ void int_idle_2_enable(bool state, unsigned delay) static void int_idle() { - time_t now = time(0); - time_t elapsed = now - int_idle_time_current; + target_clock_t now = target_clock() / 1000000; + target_clock_t elapsed = now - int_idle_time_current; if (int_idle_0_state) { if (int_idle_0_rep != 0 && int_last == EVENT_IDLE_0 - && elapsed > int_idle_0_rep + && elapsed >= int_idle_0_rep ) { log_std(("text: push IDLE_0 repeat\n")); event_push_repeat(EVENT_IDLE_0); } else if (int_idle_0 != 0 - && elapsed > int_idle_0 + && elapsed >= int_idle_0 ) { log_std(("text: push IDLE_0\n")); event_push_repeat(EVENT_IDLE_0); @@ -3132,12 +3132,12 @@ static void int_idle() if (int_idle_1_state) { if (int_idle_1_rep != 0 && int_last == EVENT_IDLE_1 - && elapsed > int_idle_1_rep + && elapsed >= int_idle_1_rep ) { log_std(("text: push IDLE_1 repeat\n")); event_push_repeat(EVENT_IDLE_1); } else if (int_idle_1 != 0 - && elapsed > int_idle_1 + && elapsed >= int_idle_1 ) { log_std(("text: push IDLE_1\n")); event_push_repeat(EVENT_IDLE_1); @@ -3146,7 +3146,7 @@ static void int_idle() if (int_idle_2_state) { if (int_idle_2 != 0 - && elapsed > int_idle_2 + && elapsed >= int_idle_2 ) { log_std(("text: push IDLE_2\n")); event_push_repeat(EVENT_IDLE_2); @@ -3228,7 +3228,7 @@ bool int_event_waiting() if (event_peek() != EVENT_NONE) { // something happened, restart the timers - int_idle_time_current = time(0); + int_idle_time_current = target_clock() / 1000000; joy_idle_time = now; return 1; } From a3daeab7d269965d05afb5376be7553284378651 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 8 Mar 2024 08:32:08 +0100 Subject: [PATCH 11/46] Increase a little the sound latency This makes it working with not so efficient audio system like pulse audio. --- advance/osd/sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advance/osd/sound.c b/advance/osd/sound.c index b536b97f..737987ac 100644 --- a/advance/osd/sound.c +++ b/advance/osd/sound.c @@ -700,7 +700,7 @@ adv_error advance_sound_init(struct advance_sound_context* context, adv_conf* cf conf_string_register_default(cfg_context, "sound_adjust", "auto"); conf_int_register_limit_default(cfg_context, "sound_samplerate", 5000, 96000, 44100); conf_bool_register_default(cfg_context, "sound_normalize", 1); - conf_float_register_limit_default(cfg_context, "sound_latency", 0.0, 2.0, 0.05); + conf_float_register_limit_default(cfg_context, "sound_latency", 0.0, 2.0, 0.1); soundb_reg(cfg_context, 1); soundb_reg_driver_all(cfg_context); From 99c958062d2707ece1814d85908f7434febb5c67 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 8 Mar 2024 15:59:08 +0100 Subject: [PATCH 12/46] More startup times --- advance/osd/startup.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/advance/osd/startup.h b/advance/osd/startup.h index 75320206..cb2a966a 100644 --- a/advance/osd/startup.h +++ b/advance/osd/startup.h @@ -79,6 +79,13 @@ { "gseeker", 8 }, /* 3.11 */ { "mcatadv", 2 }, /* 3.11 */ { "1945kiii", 8 }, /* 3.11 */ +{ "kbash", 17 }, /* 3.11 */ +{ "bosco", 17 }, /* 3.11 */ +{ "mp_gaxe2", 7 }, /* 3.11 */ +{ "bonkadv", 16 }, /* 3.11 */ +{ "utoukond", 15 }, /* 3.11 */ +{ "acrobatm", 15 }, /* 3.11 */ +{ "g13knd", 35 }, /* 3.11 */ { "uccops", 14 }, /* 3.6 */ { "samsho5", 4 }, /* 3.1 */ { "mslug5", 4 }, /* 3.1 */ From b3064524893dbccfad05128fd1fe620fb535a5f2 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 9 Mar 2024 08:58:54 +0100 Subject: [PATCH 13/46] Fix and extend the speedmark support --- advance/osd/emu.h | 2 + advance/osd/ui.c | 154 +++++++++++++++++++++++++++++++++++--------- advance/osd/video.c | 16 ++++- doc/advmame.d | 8 ++- 4 files changed, 143 insertions(+), 37 deletions(-) diff --git a/advance/osd/emu.h b/advance/osd/emu.h index df4f1fe0..cfe4cb23 100644 --- a/advance/osd/emu.h +++ b/advance/osd/emu.h @@ -350,6 +350,7 @@ struct advance_ui_state_context { adv_bool ui_direct_text_flag; /**< Direct text on screen flag. */ char ui_direct_buffer[256]; /**< Direct text on screen message. */ adv_bool ui_direct_slow_flag; /**< Direct slow tag on screen flag. */ + adv_bool ui_direct_frameskip_flag; /**< Direct frameskip tag on screen flag. */ adv_bool ui_direct_fast_flag; /**< Direct fast tag on screen flag. */ adv_bitmap* help_image; /**< Help image. */ @@ -370,6 +371,7 @@ void advance_ui_message_va(struct advance_ui_context* context, const char* text, void advance_ui_message(struct advance_ui_context* context, const char* text, ...) __attribute__((format(printf, 2, 3))); void advance_ui_direct_text(struct advance_ui_context* context, const char* text); void advance_ui_direct_slow(struct advance_ui_context* context, int flag); +void advance_ui_direct_frameskip(struct advance_ui_context* context, int flag); void advance_ui_direct_fast(struct advance_ui_context* context, int flag); void advance_ui_help(struct advance_ui_context* context); diff --git a/advance/osd/ui.c b/advance/osd/ui.c index 7e74cee5..a242c4d9 100644 --- a/advance/osd/ui.c +++ b/advance/osd/ui.c @@ -697,6 +697,12 @@ void advance_ui_direct_slow(struct advance_ui_context* context, int flag) context->state.ui_direct_slow_flag = flag; } +void advance_ui_direct_frameskip(struct advance_ui_context* context, int flag) +{ + if (context->config.ui_speedmark_flag) + context->state.ui_direct_frameskip_flag = flag; +} + void advance_ui_direct_fast(struct advance_ui_context* context, int flag) { if (context->config.ui_speedmark_flag) @@ -773,6 +779,7 @@ adv_bool advance_ui_direct_active(struct advance_ui_context* context) { return context->state.ui_direct_text_flag || context->state.ui_direct_slow_flag + || context->state.ui_direct_frameskip_flag || context->state.ui_direct_fast_flag; } @@ -987,47 +994,126 @@ static void ui_direct_text_update(struct advance_ui_context* context, adv_bitmap context->state.ui_direct_text_flag = 0; } -static void ui_direct_slow_update(struct advance_ui_context* context, adv_bitmap* dst, struct ui_color_set* color) +static void adv_bitmap_mark(adv_bitmap* dst, int x, int y, int d, unsigned color) { - int pos_x, pos_y; - int size_x, size_y; + unsigned h0, h1; + unsigned dp; + unsigned ds; + uint8* dst_ptr; + unsigned i; + unsigned w; - size_x = dst->size_x / 20; - size_y = dst->size_y * 4 / 3 / 20; + if (x < 0 || y < 0) + return; + if (x + d > dst->size_x || y + d > dst->size_y) + return; + if (d <= 0) + return; - pos_x = dst->size_x - 1 - size_x - size_x / 4; - pos_y = size_y / 4; + dp = dst->bytes_per_pixel; + ds = dst->bytes_per_scanline + dp; + + dst_ptr = adv_bitmap_pixel(dst, x, y); + + h0 = d / 2; + h1 = (d + 1) / 2; + w = h0; + + for (i = 0; i < h1; ++i) { + if (dp == 1) { + uint8* dst8 = (uint8*)dst_ptr; + unsigned count = w; + while (count) { + *dst8++ = color; + --count; + } + } else if (dp == 2) { + uint16* dst16 = (uint16*)dst_ptr; + unsigned count = w; + while (count) { + *dst16++ = color; + --count; + } + } else if (dp == 4) { + uint32* dst32 = (uint32*)dst_ptr; + unsigned count = w; + while (count) { + *dst32++ = color; + --count; + } + } else { + uint8* dst8 = (uint8*)dst_ptr; + unsigned count = w; + while (count) { + cpu_uint_write(dst8, dp, color); + dst8 += dp; + --count; + } + } + dst_ptr += ds; + } + + for (i = 0; i < h0; ++i) { + if (dp == 1) { + uint8* dst8 = (uint8*)dst_ptr; + unsigned count = w; + while (count) { + *dst8++ = color; + --count; + } + } else if (dp == 2) { + uint16* dst16 = (uint16*)dst_ptr; + unsigned count = w; + while (count) { + *dst16++ = color; + --count; + } + } else if (dp == 4) { + uint32* dst32 = (uint32*)dst_ptr; + unsigned count = w; + while (count) { + *dst32++ = color; + --count; + } + } else { + uint8* dst8 = (uint8*)dst_ptr; + unsigned count = w; + while (count) { + cpu_uint_write(dst8, dp, color); + dst8 += dp; + --count; + } + } + dst_ptr += ds; + --w; + } +} - adv_bitmap_clear(dst, pos_x, pos_y, size_x, size_y, color->help_p3.p); +static void ui_direct_slow_update(struct advance_ui_context* context, adv_bitmap* dst, struct ui_color_set* color) +{ + int step = dst->size_x / 20; + + adv_bitmap_mark(dst, dst->size_x - step, 0, step, color->help_p3.p); context->state.ui_direct_slow_flag = 0; } +static void ui_direct_frameskip_update(struct advance_ui_context* context, adv_bitmap* dst, struct ui_color_set* color) +{ + int step = dst->size_x / 20; + + adv_bitmap_mark(dst, dst->size_x - step, 0, step, color->help_p1.p); + + context->state.ui_direct_frameskip_flag = 0; +} + static void ui_direct_fast_update(struct advance_ui_context* context, adv_bitmap* dst, struct ui_color_set* color) { - int pos_x, pos_y; - int size_x, size_y; - int i; - unsigned m; - - size_x = dst->size_x / 20; - size_y = dst->size_y * 4 / 3 / 20; - if (size_y % 2 == 0) - ++size_y; /* make it odd */ - - pos_x = dst->size_x - 1 - size_x - size_x / 4; - pos_y = size_y / 4; - - m = size_y / 2; - if (!m) - m = 1; - for (i = 0; i <= m; ++i) { - unsigned l = (size_x * i + m - 1) / m + 1; - adv_bitmap_clear(dst, pos_x, pos_y + i, l, 1, color->help_p3.p); - adv_bitmap_clear(dst, pos_x, pos_y + size_y - 1 - i, l, 1, color->help_p3.p); - } + int step = dst->size_x / 20; - context->state.ui_direct_slow_flag = 0; + adv_bitmap_mark(dst, dst->size_x - step, 0, step, color->help_p2.p); + + context->state.ui_direct_fast_flag = 0; } static void ui_color_rgb_set(struct ui_color* color, const adv_color_rgb* c, adv_color_def color_def, adv_color_def buffer_def, unsigned translucency, adv_pixel* background) @@ -1128,6 +1214,7 @@ static void ui_color_alpha_set(adv_pixel* map, const adv_color_rgb* fore, const | rgb_nibble_insert(cb, blue_shift, blue_mask) | rgb_nibble_insert(ca, alpha_shift, alpha_mask); } + } static void ui_color_palette_set(struct ui_color* color, const adv_color_rgb* c, adv_color_rgb* palette_map, unsigned palette_max) @@ -1223,7 +1310,7 @@ void advance_ui_buffer_update(struct advance_ui_context* context, void* ptr, uns void advance_ui_direct_update(struct advance_ui_context* context, void* ptr, unsigned dx, unsigned dy, unsigned dw, adv_color_def color_def, adv_color_rgb* palette_map, unsigned palette_max) { adv_bitmap* dst; - struct ui_color_set color; + struct ui_color_set color = context->state.color_map; ui_setup_color(context, &color, color_def, palette_map, palette_max); @@ -1233,6 +1320,10 @@ void advance_ui_direct_update(struct advance_ui_context* context, void* ptr, uns ui_direct_slow_update(context, dst, &color); } + if (context->state.ui_direct_frameskip_flag) { + ui_direct_frameskip_update(context, dst, &color); + } + if (context->state.ui_direct_fast_flag) { ui_direct_fast_update(context, dst, &color); } @@ -1259,6 +1350,7 @@ adv_error advance_ui_init(struct advance_ui_context* context, adv_conf* cfg_cont context->state.ui_scroll_end = 0; context->state.ui_direct_text_flag = 0; context->state.ui_direct_slow_flag = 0; + context->state.ui_direct_frameskip_flag = 0; context->state.ui_direct_fast_flag = 0; context->state.ui_font = 0; context->state.ui_font_oriented = 0; diff --git a/advance/osd/video.c b/advance/osd/video.c index 8e5c7375..60a143fa 100644 --- a/advance/osd/video.c +++ b/advance/osd/video.c @@ -445,9 +445,19 @@ static void video_command(struct advance_video_context* context, struct advance_ } } - advance_ui_direct_fast(ui_context, context->state.fastest_flag || context->state.turbo_flag); - - advance_ui_direct_slow(ui_context, context->state.skip_level_disable_flag); + if (context->state.fastest_flag || context->state.turbo_flag) { + advance_ui_direct_slow(ui_context, 0); + advance_ui_direct_frameskip(ui_context, 0); + advance_ui_direct_fast(ui_context, 1); + } else if (context->state.skip_level_disable_flag) { + advance_ui_direct_slow(ui_context, 1); + advance_ui_direct_frameskip(ui_context, 0); + advance_ui_direct_fast(ui_context, 0); + } else { + advance_ui_direct_slow(ui_context, 0); + advance_ui_direct_frameskip(ui_context, context->state.skip_level_skip != 0); + advance_ui_direct_fast(ui_context, 0); + } if (context->state.info_flag) { char buffer[256]; diff --git a/doc/advmame.d b/doc/advmame.d index b4ed442d..f3aabcd8 100644 --- a/doc/advmame.d +++ b/doc/advmame.d @@ -2326,9 +2326,11 @@ Configuration yes - Sound output without any syncronization. debug_speedmark - Enables or disabled the on screen speed mark. If enabled a red square - is displayed if the game is too slow. A red triangle when you press - the `turbo' key or when the game is accelerated for other reasons. + Enables or disables the on-screen speed mark. If enabled, a red band + is displayed when the game is running at a low speed. A yellow band is + shown when frames are skipped to maintain speed. A green band appears + when you press the 'turbo' key or when the game is accelerated for + other reasons. :debug_speedmark yes | no From a0f1eec7b1aca419250da9c0d003984c75b8f44a Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 9 Mar 2024 17:00:22 +0100 Subject: [PATCH 14/46] Fix the orientation of the speed mark --- advance/lib/bitmap.c | 90 +++++++-------- advance/osd/ui.c | 266 ++++++++++++++++++++++++++++--------------- 2 files changed, 215 insertions(+), 141 deletions(-) diff --git a/advance/lib/bitmap.c b/advance/lib/bitmap.c index 4ab0ed7c..b780d7f2 100644 --- a/advance/lib/bitmap.c +++ b/advance/lib/bitmap.c @@ -1158,26 +1158,15 @@ adv_bitmap* adv_bitmap_cvt_palettergb(adv_color_def dst_def, adv_bitmap* src, ad return dst; } -static void bitmap_vclear(adv_bitmap* dst, int x, int y, int dy, unsigned color) +static void bitmap_v_set(uint8* dst_ptr, unsigned dp, unsigned ds, unsigned count, unsigned color) { - unsigned dp; - unsigned ds; - uint8* dst_ptr; - - dp = dst->bytes_per_pixel; - ds = dst->bytes_per_scanline; - - dst_ptr = adv_bitmap_pixel(dst, x, y); - if (dp == 1) { - unsigned count = dy; while (count) { *dst_ptr = color; dst_ptr += ds; --count; } } else if (dp == 2) { - unsigned count = dy; while (count) { uint16* dst16 = (uint16*)dst_ptr; *dst16 = color; @@ -1185,7 +1174,6 @@ static void bitmap_vclear(adv_bitmap* dst, int x, int y, int dy, unsigned color) --count; } } else if (dp == 4) { - unsigned count = dy; while (count) { uint32* dst32 = (uint32*)dst_ptr; *dst32 = color; @@ -1193,7 +1181,6 @@ static void bitmap_vclear(adv_bitmap* dst, int x, int y, int dy, unsigned color) --count; } } else { - unsigned count = dy; while (count) { cpu_uint_write(dst_ptr, dp, color); dst_ptr += ds; @@ -1202,13 +1189,42 @@ static void bitmap_vclear(adv_bitmap* dst, int x, int y, int dy, unsigned color) } } +static void bitmap_h_set(uint8* dst_ptr, unsigned dp, unsigned count, unsigned color) +{ + if (dp == 1) { + uint8* dst8 = (uint8*)dst_ptr; + while (count) { + *dst8++ = color; + --count; + } + } else if (dp == 2) { + uint16* dst16 = (uint16*)dst_ptr; + while (count) { + *dst16++ = color; + --count; + } + } else if (dp == 4) { + uint32* dst32 = (uint32*)dst_ptr; + while (count) { + *dst32++ = color; + --count; + } + } else { + uint8* dst8 = (uint8*)dst_ptr; + while (count) { + cpu_uint_write(dst8, dp, color); + dst8 += dp; + --count; + } + } +} + /** * Clear part of the bitmap. * The specified range is clipped if required. */ void adv_bitmap_clear(adv_bitmap* dst, int x, int y, int dx, int dy, unsigned color) { - unsigned cy; unsigned dp; unsigned ds; uint8* dst_ptr; @@ -1228,49 +1244,19 @@ void adv_bitmap_clear(adv_bitmap* dst, int x, int y, int dx, int dy, unsigned co if (dx <= 0 || dy <= 0) return; - if (dx == 1) { - bitmap_vclear(dst, x, y, dy, color); - return; - } - dp = dst->bytes_per_pixel; ds = dst->bytes_per_scanline; dst_ptr = adv_bitmap_pixel(dst, x, y); - for (cy = 0; cy < dy; ++cy) { - if (dp == 1) { - uint8* dst8 = (uint8*)dst_ptr; - unsigned count = dx; - while (count) { - *dst8++ = color; - --count; - } - } else if (dp == 2) { - uint16* dst16 = (uint16*)dst_ptr; - unsigned count = dx; - while (count) { - *dst16++ = color; - --count; - } - } else if (dp == 4) { - uint32* dst32 = (uint32*)dst_ptr; - unsigned count = dx; - while (count) { - *dst32++ = color; - --count; - } - } else { - uint8* dst8 = (uint8*)dst_ptr; - unsigned count = dx; - while (count) { - cpu_uint_write(dst8, dp, color); - dst8 += dp; - --count; - } + if (dx == 1) { + bitmap_v_set(dst_ptr, dp, ds, dy, color); + } else { + unsigned y; + for (y = 0; y < dy; ++y) { + bitmap_h_set(dst_ptr, dp, dx, color); + dst_ptr += ds; } - ++y; - dst_ptr += ds; } } diff --git a/advance/osd/ui.c b/advance/osd/ui.c index a242c4d9..5b291fae 100644 --- a/advance/osd/ui.c +++ b/advance/osd/ui.c @@ -994,126 +994,211 @@ static void ui_direct_text_update(struct advance_ui_context* context, adv_bitmap context->state.ui_direct_text_flag = 0; } -static void adv_bitmap_mark(adv_bitmap* dst, int x, int y, int d, unsigned color) +static void bitmap_h_set(uint8* dst_ptr, unsigned dp, unsigned count, unsigned color) +{ + if (dp == 1) { + uint8* dst8 = (uint8*)dst_ptr; + while (count) { + *dst8++ = color; + --count; + } + } else if (dp == 2) { + uint16* dst16 = (uint16*)dst_ptr; + while (count) { + *dst16++ = color; + --count; + } + } else if (dp == 4) { + uint32* dst32 = (uint32*)dst_ptr; + while (count) { + *dst32++ = color; + --count; + } + } else { + uint8* dst8 = (uint8*)dst_ptr; + while (count) { + cpu_uint_write(dst8, dp, color); + dst8 += dp; + --count; + } + } +} + +static void adv_bitmap_mark_ur(adv_bitmap* dst, int x, int y, int d, unsigned color) { - unsigned h0, h1; unsigned dp; unsigned ds; uint8* dst_ptr; unsigned i; - unsigned w; + unsigned c; + unsigned s; - if (x < 0 || y < 0) + if (x < 0 || y < 0) return; if (x + d > dst->size_x || y + d > dst->size_y) return; if (d <= 0) return; + c = d / 2; + s = (d + 1) / 2; + dp = dst->bytes_per_pixel; ds = dst->bytes_per_scanline + dp; dst_ptr = adv_bitmap_pixel(dst, x, y); - - h0 = d / 2; - h1 = (d + 1) / 2; - w = h0; - - for (i = 0; i < h1; ++i) { - if (dp == 1) { - uint8* dst8 = (uint8*)dst_ptr; - unsigned count = w; - while (count) { - *dst8++ = color; - --count; - } - } else if (dp == 2) { - uint16* dst16 = (uint16*)dst_ptr; - unsigned count = w; - while (count) { - *dst16++ = color; - --count; - } - } else if (dp == 4) { - uint32* dst32 = (uint32*)dst_ptr; - unsigned count = w; - while (count) { - *dst32++ = color; - --count; - } - } else { - uint8* dst8 = (uint8*)dst_ptr; - unsigned count = w; - while (count) { - cpu_uint_write(dst8, dp, color); - dst8 += dp; - --count; - } - } + + for (i = 0; i < d; ++i) { + bitmap_h_set(dst_ptr, dp, c, color); dst_ptr += ds; + if (i >= s) + --c; } - - for (i = 0; i < h0; ++i) { - if (dp == 1) { - uint8* dst8 = (uint8*)dst_ptr; - unsigned count = w; - while (count) { - *dst8++ = color; - --count; - } - } else if (dp == 2) { - uint16* dst16 = (uint16*)dst_ptr; - unsigned count = w; - while (count) { - *dst16++ = color; - --count; - } - } else if (dp == 4) { - uint32* dst32 = (uint32*)dst_ptr; - unsigned count = w; - while (count) { - *dst32++ = color; - --count; - } - } else { - uint8* dst8 = (uint8*)dst_ptr; - unsigned count = w; - while (count) { - cpu_uint_write(dst8, dp, color); - dst8 += dp; - --count; - } - } - dst_ptr += ds; - --w; +} + +static void adv_bitmap_mark_lr(adv_bitmap* dst, int x, int y, int d, unsigned color) +{ + unsigned dp; + unsigned ds; + uint8* dst_ptr; + unsigned i; + unsigned c; + unsigned s; + + if (x < 0 || y < 0) + return; + if (x + d > dst->size_x || y + d > dst->size_y) + return; + if (d <= 0) + return; + + c = d / 2; + s = (d + 1) / 2; + + dp = dst->bytes_per_pixel; + ds = dst->bytes_per_scanline - dp; + + dst_ptr = adv_bitmap_pixel(dst, x, y + d - 1); + + for (i = 0; i < d; ++i) { + bitmap_h_set(dst_ptr, dp, c, color); + dst_ptr -= ds; + if (i >= s) + --c; } } -static void ui_direct_slow_update(struct advance_ui_context* context, adv_bitmap* dst, struct ui_color_set* color) +static void adv_bitmap_mark_ul(adv_bitmap* dst, int x, int y, int d, unsigned color) { - int step = dst->size_x / 20; + unsigned dp; + unsigned ds; + uint8* dst_ptr; + unsigned i; + unsigned c; + unsigned s; + + if (x < 0 || y < 0) + return; + if (x + d > dst->size_x || y + d > dst->size_y) + return; + if (d <= 0) + return; - adv_bitmap_mark(dst, dst->size_x - step, 0, step, color->help_p3.p); + c = d / 2; + s = (d + 1) / 2; - context->state.ui_direct_slow_flag = 0; + dp = dst->bytes_per_pixel; + ds = dst->bytes_per_scanline - dp; + + dst_ptr = adv_bitmap_pixel(dst, x + c, y); + + for (i = 0; i < d; ++i) { + bitmap_h_set(dst_ptr, dp, c, color); + dst_ptr += ds; + if (i >= s) { + dst_ptr += dp; + --c; + } + } } -static void ui_direct_frameskip_update(struct advance_ui_context* context, adv_bitmap* dst, struct ui_color_set* color) +static void adv_bitmap_mark_ll(adv_bitmap* dst, int x, int y, int d, unsigned color) { - int step = dst->size_x / 20; + unsigned dp; + unsigned ds; + uint8* dst_ptr; + unsigned i; + unsigned c; + unsigned s; + + if (x < 0 || y < 0) + return; + if (x + d > dst->size_x || y + d > dst->size_y) + return; + if (d <= 0) + return; - adv_bitmap_mark(dst, dst->size_x - step, 0, step, color->help_p1.p); + c = d / 2; + s = (d + 1) / 2; - context->state.ui_direct_frameskip_flag = 0; + dp = dst->bytes_per_pixel; + ds = dst->bytes_per_scanline + dp; + + dst_ptr = adv_bitmap_pixel(dst, x + c, y + d - 1); + + for (i = 0; i < d; ++i) { + bitmap_h_set(dst_ptr, dp, c, color); + dst_ptr -= ds; + if (i >= s) { + dst_ptr += dp; + --c; + } + } } -static void ui_direct_fast_update(struct advance_ui_context* context, adv_bitmap* dst, struct ui_color_set* color) +static void ui_direct_mark_update(struct advance_ui_context* context, adv_bitmap* dst, adv_pixel color) { - int step = dst->size_x / 20; + int size; + int pos_x; + int pos_y; + unsigned orientation; - adv_bitmap_mark(dst, dst->size_x - step, 0, step, color->help_p2.p); + orientation = context->config.ui_font_orientation; - context->state.ui_direct_fast_flag = 0; + if ((orientation & OSD_ORIENTATION_SWAP_XY) != 0) { + size = dst->size_y / 20; + pos_x = 0; + pos_y = dst->size_y - size; + } else { + size = dst->size_x / 20; + pos_x = dst->size_x - size; + pos_y = 0; + } + + if ((orientation & OSD_ORIENTATION_FLIP_X) != 0) { + pos_x = dst->size_x - size - pos_x; + } + if ((orientation & OSD_ORIENTATION_FLIP_Y) != 0) { + pos_y = dst->size_y - size - pos_y; + } + + if ((orientation & OSD_ORIENTATION_SWAP_XY) != 0) { + orientation ^= OSD_ORIENTATION_FLIP_X | OSD_ORIENTATION_FLIP_Y; + } + + if ((orientation & OSD_ORIENTATION_FLIP_Y) != 0) { + if ((orientation & OSD_ORIENTATION_FLIP_X) != 0) { + adv_bitmap_mark_ll(dst, pos_x, pos_y, size, color); + } else { + adv_bitmap_mark_lr(dst, pos_x, pos_y, size, color); + } + } else { + if ((orientation & OSD_ORIENTATION_FLIP_X) != 0) { + adv_bitmap_mark_ul(dst, pos_x, pos_y, size, color); + } else { + adv_bitmap_mark_ur(dst, pos_x, pos_y, size, color); + } + } } static void ui_color_rgb_set(struct ui_color* color, const adv_color_rgb* c, adv_color_def color_def, adv_color_def buffer_def, unsigned translucency, adv_pixel* background) @@ -1317,15 +1402,18 @@ void advance_ui_direct_update(struct advance_ui_context* context, void* ptr, uns dst = adv_bitmap_import_rgb(dx, dy, color_def_bytes_per_pixel_get(color_def), 0, 0, ptr, dw); if (context->state.ui_direct_slow_flag) { - ui_direct_slow_update(context, dst, &color); + ui_direct_mark_update(context, dst, color.help_p3.p); + context->state.ui_direct_slow_flag = 0; } if (context->state.ui_direct_frameskip_flag) { - ui_direct_frameskip_update(context, dst, &color); + ui_direct_mark_update(context, dst, color.help_p1.p); + context->state.ui_direct_frameskip_flag = 0; } if (context->state.ui_direct_fast_flag) { - ui_direct_fast_update(context, dst, &color); + ui_direct_mark_update(context, dst, color.help_p2.p); + context->state.ui_direct_fast_flag = 0; } if (context->state.ui_direct_text_flag) { From 48105ae3c026c8f30002302f010048ef66de3364 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 9 Mar 2024 17:46:27 +0100 Subject: [PATCH 15/46] Use the modern autoreconf in autogen.sh --- autogen.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/autogen.sh b/autogen.sh index 9a67b5c4..8152272e 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,18 +1,10 @@ #!/bin/sh # -echo "Generating build information using autoconf" -echo "This may take a while ..." +echo "Generating build information using autoreconf" -# Touch the timestamps on all the files since CVS messes them up -touch configure.ac - -# Regenerate configuration files -# Note that we cannot use autoreconf because it won't call automake -# to add missing files, because we don't use automake -aclocal -automake --add-missing --force-missing 2>/dev/null -autoconf -autoheader && touch advance/lib/config.hin +# All is done by autoreconf +autoreconf -f -i # Run configure for this platform echo "Now you are ready to run ./configure" + From befd63f0eda3ca61cf7fde57891846da0546f2b7 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 10 Mar 2024 16:23:01 +0100 Subject: [PATCH 16/46] Fix the frameskipping with slow game This avoids the boucing up and down speed effect. --- advance/osd/sync.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/advance/osd/sync.c b/advance/osd/sync.c index ca97754c..8ed48da8 100644 --- a/advance/osd/sync.c +++ b/advance/osd/sync.c @@ -339,7 +339,7 @@ static void video_frame_sync(struct advance_video_context* context) /* the vsync is used only if all the frames are displayed */ if ((video_flags() & MODE_FLAGS_RETRACE_WAIT_SYNC) != 0 && context->state.vsync_flag - && context->state.skip_level_full == SYNC_MAX + && context->state.skip_level_full == SYNC_MAX /* only if we are not skipping */ ) { double limit; double error; @@ -378,7 +378,7 @@ static void video_frame_sync(struct advance_video_context* context) context->state.sync_pivot = 0; } else if ((video_flags() & (MODE_FLAGS_RETRACE_SCROLL_SYNC | MODE_FLAGS_RETRACE_WRITE_SYNC)) != 0 && context->state.vsync_flag - && context->state.skip_level_full == SYNC_MAX + && context->state.skip_level_full == SYNC_MAX /* only if we are not skipping */ ) { /* * We do nothing here, as we are going to vsync later when updating. @@ -407,7 +407,9 @@ static void video_frame_sync(struct advance_video_context* context) /* update the error state */ context->state.sync_pivot = expected - current; - if (context->state.sync_pivot < -context->state.skip_step * 16) { + if (context->config.frameskip_auto_flag + && context->state.skip_level_full == SYNC_MAX /* only if we are not skipping */ + && context->state.sync_pivot < -context->state.skip_step * 16) { /* if the error is too big (negative) the delay is unrecoverable */ /* generally it happen with a virtual terminal switch */ /* the best solution is to restart the sync computation */ From 3c9d0f521406c1ebf45b5c331807fe53db4f73dc Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 10 Mar 2024 17:58:36 +0100 Subject: [PATCH 17/46] Add a configuration script for AdvanceBERRY --- configure.berry | 1 + 1 file changed, 1 insertion(+) create mode 100755 configure.berry diff --git a/configure.berry b/configure.berry new file mode 100755 index 00000000..a86a1d8a --- /dev/null +++ b/configure.berry @@ -0,0 +1 @@ +CFLAGS="-O3 -march=armv8-a -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -funsafe-math-optimizations -fsigned-char" ./configure --prefix=/opt/advance --disable-sdl --disable-sdl2 From 5d8842d5498adc61af5e555d3e4b97bd845f53c5 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 11 Mar 2024 22:23:00 +0100 Subject: [PATCH 18/46] Update HISTORY --- doc/history.d | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/history.d b/doc/history.d index 33ecda16..c182527c 100644 --- a/doc/history.d +++ b/doc/history.d @@ -1,6 +1,23 @@ Name history - History For AdvanceMAME/MESS +AdvanceMAME/MESS Version 3.11 2024/04 + ) Fix the frameskipping with slow game + ) Fix and extend the speedmark support + ) Fix crashes in some games like p47aces + ) dangerex (#123) [arcadez2003] + ) New Working Danger Express Atari Prototype (#122) [arcadez2003] + ) Hookup the HD647180 sound mcu for Ghox, TekiPaki and Whoopee! (#121) [arcadez2003] + ) Update joystick definition from libretro + ) New Working Hammer Away (#120) [arcadez2003] + ) New Working Fantasy Zone II - The Tears Of Opa Opa (system16c) (#119) [arcadez2003] + ) dkongx (#118) [arcadez2003] + ) New Working Game Donkey Kong II Jumpman Returns (#117) [arcadez2003] + ) Fix handling of customization sectioned input maps + ) Add coin option in the exit menu [Andrea Mazzoleni] + ) Add advmame Xbuttons configuration category [Andrea Mazzoleni] + ) Fix crash when saving a rotated png due integer promotion to unsigned + AdvanceMAME/MESS Version 3.10 2024/02 ) Alcon / Slap Fight MCU hookup (#116) [arcadez2003] ) Add the protection MCU for the official Alcon / Slap Fight sets (#115) [arcadez2003] From 682ce40487f3c25012de12964b5915b6f49dbd73 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 11 Mar 2024 22:23:08 +0100 Subject: [PATCH 19/46] Minor advblue changes --- advance/blue/blue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advance/blue/blue.c b/advance/blue/blue.c index 321d58dc..920bb946 100644 --- a/advance/blue/blue.c +++ b/advance/blue/blue.c @@ -472,7 +472,7 @@ void process_connect(int in_f, int out_f) } else if (count_ignored == 0) { strcpy(processing, "Insert or pair a gamepad"); } else { - snprintf(processing, sizeof(processing), "Insert or pair a gamepad (%u ignored)", count_ignored); + snprintf(processing, sizeof(processing), "Insert or pair a gamepad (%u not gamepads)", count_ignored); } } } else { From ca98119c35feaf4455649963fc06306d46bfb14e Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 13 Mar 2024 18:31:36 +0100 Subject: [PATCH 20/46] Change to version 4 --- doc/history.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/history.d b/doc/history.d index c182527c..fbaaeab0 100644 --- a/doc/history.d +++ b/doc/history.d @@ -1,7 +1,7 @@ Name history - History For AdvanceMAME/MESS -AdvanceMAME/MESS Version 3.11 2024/04 +AdvanceMAME/MESS Version 4.0 2024/04 ) Fix the frameskipping with slow game ) Fix and extend the speedmark support ) Fix crashes in some games like p47aces From 7b3bc0eb980f9c3c72345c9297902f51fb9b866a Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 14 Mar 2024 21:52:40 +0100 Subject: [PATCH 21/46] Use single screen in psikyo4 games --- src/drivers/psikyo4.c | 2 +- src/vidhrdw/psikyo4.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/psikyo4.c b/src/drivers/psikyo4.c index 47d9e95f..acb18f34 100644 --- a/src/drivers/psikyo4.c +++ b/src/drivers/psikyo4.c @@ -64,7 +64,7 @@ NOTE: The version number (A/B) on Lode Runner: The Dig Fight is ONLY displayed w #include "machine/eeprom.h" #include "sound/ymf278b.h" -#define DUAL_SCREEN 1 /* Display both screens simultaneously if 1, change in vidhrdw too */ +#define DUAL_SCREEN 0 /* Display both screens simultaneously if 1, change in vidhrdw too */ #define ROMTEST 0 /* Does necessary stuff to perform rom test, uses RAM as it doesn't dispose of GFX after decoding */ UINT32 *psikyo4_vidregs; diff --git a/src/vidhrdw/psikyo4.c b/src/vidhrdw/psikyo4.c index 6678bbc0..44a7e7de 100644 --- a/src/vidhrdw/psikyo4.c +++ b/src/vidhrdw/psikyo4.c @@ -28,7 +28,7 @@ HgKairak: 86010000 1f201918 a0000000 Large Screen #include "driver.h" -#define DUAL_SCREEN 1 /* Display both screens simultaneously if 1, change in driver too */ +#define DUAL_SCREEN 0 /* Display both screens simultaneously if 1, change in driver too */ static UINT32 screen; /* for PS4 games when DUAL_SCREEN=0 */ From 3f00116f70cbe6bfd7e59ea190381224aaf5b8f7 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 15 Mar 2024 21:36:53 +0100 Subject: [PATCH 22/46] More startup times --- advance/osd/startup.h | 236 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 236 insertions(+) diff --git a/advance/osd/startup.h b/advance/osd/startup.h index cb2a966a..93bd2734 100644 --- a/advance/osd/startup.h +++ b/advance/osd/startup.h @@ -30,6 +30,242 @@ /* the first match is used */ +{ "tkmmpzdm", 22 }, /* 4.0 */ +{ "3in1semi", 4 }, /* 4.0 */ +{ "woodpek", 2 }, /* 4.0 */ +{ "wg3dh", 21 }, /* 4.0 */ +{ "welltris", 17 }, /* 4.0 */ +{ "wwallyj", 13 }, /* 4.0 */ +{ "goonies", 17 }, /* 4.0 */ +{ "vsgradus", 17 }, /* 4.0 */ +{ "viostorm", 32 }, /* 4.0 */ +{ "vimana", 9 }, /* 4.0 */ +{ "viewpoin", 8 }, /* 4.0 */ +{ "victroad", 6 }, /* 4.0 */ +{ "vendetta", 3 }, /* 4.0 */ +{ "varth", 11 }, /* 4.0 */ +{ "vandyke", 11 }, /* 4.0 */ +{ "vsav", 22 }, /* 4.0 */ +{ "vsav2", 19 }, /* 4.0 */ +{ "vhunt2r1", 23 }, /* 4.0 */ +{ "valkyrie", 4 }, /* 4.0 */ +{ "vfive", 12 }, /* 4.0 */ +{ "usclssic", 7 }, /* 4.0 */ +{ "twinhawk", 6 }, /* 4.0 */ +{ "tron", 3 }, /* 4.0 */ +{ "triplep", 3 }, /* 4.0 */ +{ "toypop", 3 }, /* 4.0 */ +{ "todruaga", 3 }, /* 4.0 */ +{ "turtles", 3 }, /* 4.0 */ +{ "truxton", 5 }, /* 4.0 */ +{ "tnexspce", 9 }, /* 4.0 */ +{ "kof97", 6 }, /* 4.0 */ +{ "karatour", 2 }, /* 4.0 */ +{ "theend", 3 }, /* 4.0 */ +{ "astyanax", 10 }, /* 4.0 */ +{ "mrflea", 4 }, /* 4.0 */ +{ "tetris", 6 }, /* 4.0 */ +{ "term2", 9 }, /* 4.0 */ +{ "tbowl", 4 }, /* 4.0 */ +{ "tangtang", 4 }, /* 4.0 */ +{ "cupfinal", 9 }, /* 4.0 */ +{ "tokkae", 5 }, /* 4.0 */ +{ "suzuk8h2", 2 }, /* 4.0 */ +{ "suzuka8h", 2 }, /* 4.0 */ +{ "susume", 34 }, /* 4.0 */ +{ "sws", 13 }, /* 4.0 */ +{ "sws97", 9 }, /* 4.0 */ +{ "sws96", 3 }, /* 4.0 */ +{ "sws95", 10 }, /* 4.0 */ +{ "swcourt", 7 }, /* 4.0 */ +{ "sstingry", 2 }, /* 4.0 */ +{ "macross2", 5 }, /* 4.0 */ +{ "sqix", 11 }, /* 4.0 */ +{ "spang", 10 }, /* 4.0 */ +{ "superpac", 6 }, /* 4.0 */ +{ "suplup", 3 }, /* 4.0 */ +{ "usg32", 3 }, /* 4.0 */ +{ "superchs", 4 }, /* 4.0 */ +{ "sbishi", 13 }, /* 4.0 */ +{ "ssriders", 5 }, /* 4.0 */ +{ "subroc3d", 3 }, /* 4.0 */ +{ "strkfgtr", 11 }, /* 4.0 */ +{ "strider2", 14 }, /* 4.0 */ +{ "strider", 3 }, /* 4.0 */ +{ "mp_sor2", 5 }, /* 4.0 */ +{ "sfiii3", 6 }, /* 4.0 */ +{ "sfiii2", 6 }, /* 4.0 */ +{ "sf2ce", 14 }, /* 4.0 */ +{ "sf2", 14 }, /* 4.0 */ +{ "sfex2p", 16 }, /* 4.0 */ +{ "sfa", 15 }, /* 4.0 */ +{ "sf", 11 }, /* 4.0 */ +{ "stmblade", 6 }, /* 4.0 */ +{ "stonebal", 20 }, /* 4.0 */ +{ "stinger", 4 }, /* 4.0 */ +{ "sgunner2", 3 }, /* 4.0 */ +{ "stargate", 11 }, /* 4.0 */ +{ "starblad", 23 }, /* 4.0 */ +{ "starswep", 7 }, /* 4.0 */ +{ "starglad", 14 }, /* 4.0 */ +{ "squash", 7 }, /* 4.0 */ +{ "splatter", 4 }, /* 4.0 */ +{ "speedspn", 2 }, /* 4.0 */ +{ "spdcoin", 2 }, /* 4.0 */ +{ "mp_soni2", 5 }, /* 4.0 */ +{ "mp_sonic", 5 }, /* 4.0 */ +{ "sonson", 13 }, /* 4.0 */ +{ "skyalert", 4 }, /* 4.0 */ +{ "shootbul", 3 }, /* 4.0 */ +{ "mp_shnb3", 6 }, /* 4.0 */ +{ "shadoww", 29 }, /* 4.0 */ +{ "schmeisr", 11 }, /* 4.0 */ +{ "sandor", 24 }, /* 4.0 */ +{ "roughrac", 18 }, /* 4.0 */ +{ "robotron", 11 }, /* 4.0 */ +{ "revx", 14 }, /* 4.0 */ +{ "rampart", 6 }, /* 4.0 */ +{ "raiders5", 3 }, /* 4.0 */ +{ "4in1boot", 9 }, /* 4.0 */ +{ "tantr", 12 }, /* 4.0 */ +{ "pushman", 3 }, /* 4.0 */ +{ "pururun", 3 }, /* 4.0 */ +{ "puchicar", 11 }, /* 4.0 */ +{ "prikura", 19 }, /* 4.0 */ +{ "prmrsocj", 10 }, /* 4.0 */ +{ "pbillian", 14 }, /* 4.0 */ +{ "plegends", 9 }, /* 4.0 */ +{ "groovef", 23 }, /* 4.0 */ +{ "polepos2", 6 }, /* 4.0 */ +{ "polepos", 5 }, /* 4.0 */ +{ "playball", 11 }, /* 4.0 */ +{ "peterpak", 3 }, /* 4.0 */ +{ "pblbeach", 19 }, /* 4.0 */ +{ "pangpoms", 4 }, /* 4.0 */ +{ "pow", 16 }, /* 4.0 */ +{ "othellos", 20 }, /* 4.0 */ +{ "orlegend", 4 }, /* 4.0 */ +{ "olds103t", 5 }, /* 4.0 */ +{ "opwolf", 3 }, /* 4.0 */ +{ "othunder", 2 }, /* 4.0 */ +{ "opaopan", 2 }, /* 4.0 */ +{ "numanath", 7 }, /* 4.0 */ +{ "nova2001", 10 }, /* 4.0 */ +{ "nitrobal", 4 }, /* 4.0 */ +{ "ninjakd2", 10 }, /* 4.0 */ +{ "nbbatman", 15 }, /* 4.0 */ +{ "nslasher", 5 }, /* 4.0 */ +{ "mvp", 5 }, /* 4.0 */ +{ "docastle", 2 }, /* 4.0 */ +{ "mtrap", 35 }, /* 4.0 */ +{ "mmaulers", 22 }, /* 4.0 */ +{ "gdfs", 9 }, /* 4.0 */ +{ "missile", 9 }, /* 4.0 */ +{ "mpangj", 9 }, /* 4.0 */ +{ "mwalk", 11 }, /* 4.0 */ +{ "kamenrid", 4 }, /* 4.0 */ +{ "martmast", 20 }, /* 4.0 */ +{ "mtlchamp", 24 }, /* 4.0 */ +{ "mgcrystl", 2 }, /* 4.0 */ +{ "magicbub", 6 }, /* 4.0 */ +{ "mplanets", 15 }, /* 4.0 */ +{ "locomotn", 2 }, /* 4.0 */ +{ "crshrace", 8 }, /* 4.0 */ +{ "lastmisn", 10 }, /* 4.0 */ +{ "kram", 6 }, /* 4.0 */ +{ "kov2", 8 }, /* 4.0 */ +{ "kov", 19 }, /* 4.0 */ +{ "horekid", 3 }, /* 4.0 */ +{ "jungler", 6 }, /* 4.0 */ +{ "vshoot", 5 }, /* 4.0 */ +{ "intcup94", 9 }, /* 4.0 */ +{ "hotrod", 18 }, /* 4.0 */ +{ "hook", 10 }, /* 4.0 */ +{ "hexion", 7 }, /* 4.0 */ +{ "hedpanic", 10 }, /* 4.0 */ +{ "harddriv", 13 }, /* 4.0 */ +{ "guwange", 15 }, /* 4.0 */ +{ "gunnail", 3 }, /* 4.0 */ +{ "gunforc2", 11 }, /* 4.0 */ +{ "gunforce", 10 }, /* 4.0 */ +{ "gunbird", 3 }, /* 4.0 */ +{ "gunmast", 4 }, /* 4.0 */ +{ "gundealr", 3 }, /* 4.0 */ +{ "grudge", 11 }, /* 4.0 */ +{ "groundfx", 13 }, /* 4.0 */ +{ "gsword", 6 }, /* 4.0 */ +{ "gtclassc", 4 }, /* 4.0 */ +{ "gt3d", 2 }, /* 4.0 */ +{ "gt2k", 2 }, /* 4.0 */ +{ "gt99", 2 }, /* 4.0 */ +{ "gt98", 2 }, /* 4.0 */ +{ "gt97", 2 }, /* 4.0 */ +{ "gaxeduel", 20 }, /* 4.0 */ +{ "ghouls", 25 }, /* 4.0 */ +{ "ghostlop", 5 }, /* 4.0 */ +{ "gangwars", 5 }, /* 4.0 */ +{ "galspnbl", 2 }, /* 4.0 */ +{ "gground", 20 }, /* 4.0 */ +{ "gaia", 8 }, /* 4.0 */ +{ "fpoint", 5 }, /* 4.0 */ +{ "f1gp2", 6 }, /* 4.0 */ +{ "f1gp", 9 }, /* 4.0 */ +{ "excelsr", 10 }, /* 4.0 */ +{ "espgal", 6 }, /* 4.0 */ +{ "emeralda", 10 }, /* 4.0 */ +{ "ejihon", 22 }, /* 4.0 */ +{ "eaglshot", 4 }, /* 4.0 */ +{ "edf", 2 }, /* 4.0 */ +{ "dynwar", 3 }, /* 4.0 */ +{ "dragoona", 21 }, /* 4.0 */ +{ "dbz2", 2 }, /* 4.0 */ +{ "dbz", 20 }, /* 4.0 */ +{ "dsaber", 3 }, /* 4.0 */ +{ "dbreed", 10 }, /* 4.0 */ +{ "dbzvrvs", 9 }, /* 4.0 */ +{ "ddragon", 13 }, /* 4.0 */ +{ "djboy", 5 }, /* 4.0 */ +{ "dietgo", 3 }, /* 4.0 */ +{ "dharma", 3 }, /* 4.0 */ +{ "desertbr", 3 }, /* 4.0 */ +{ "deroon", 11 }, /* 4.0 */ +{ "denjinmk", 3 }, /* 4.0 */ +{ "dstlk", 8 }, /* 4.0 */ +{ "dangar", 2 }, /* 4.0 */ +{ "danceyes", 11 }, /* 4.0 */ +{ "bronx", 3 }, /* 4.0 */ +{ "cuebrick", 13 }, /* 4.0 */ +{ "cryptklr", 59 }, /* 4.0 */ +{ "crzrally", 6 }, /* 4.0 */ +{ "cottonbm", 20 }, /* 4.0 */ +{ "coolmini", 4 }, /* 4.0 */ +{ "cltchitr", 2 }, /* 4.0 */ +{ "chplftb", 43 }, /* 4.0 */ +{ "csprint", 2 }, /* 4.0 */ +{ "captaven", 3 }, /* 4.0 */ +{ "cbasebal", 6 }, /* 4.0 */ +{ "cameltry", 13 }, /* 4.0 */ +{ "calibr50", 2 }, /* 4.0 */ +{ "cabal", 6 }, /* 4.0 */ +{ "bnzabros", 12 }, /* 4.0 */ +{ "bbmanwj", 11 }, /* 4.0 */ +{ "blazer", 13 }, /* 4.0 */ +{ "blaster", 15 }, /* 4.0 */ +{ "biomtoy", 18 }, /* 4.0 */ +{ "realbrk", 6 }, /* 4.0 */ +{ "beastrzr", 12 }, /* 4.0 */ +{ "btoads", 12 }, /* 4.0 */ +{ "batcir", 8 }, /* 4.0 */ +{ "bang", 15 }, /* 4.0 */ +{ "bangball", 4 }, /* 4.0 */ +{ "balcube", 13 }, /* 4.0 */ +{ "backfire", 14 }, /* 4.0 */ +{ "aurail", 3 }, /* 4.0 */ +{ "asurabld", 3 }, /* 4.0 */ +{ "assault", 4 }, /* 4.0 */ +{ "arkarea", 4 }, /* 4.0 */ +{ "ajax", 6 }, /* 4.0 */ +{ "9ballsht", 43 }, /* 4.0 */ { "cosmogng", 4 }, /* 3.11 */ { "batsugun", 11 }, /* 3.11 */ { "fghtatck", 9 }, /* 3.11 */ From b64769e46458050409cb1aab76595fde950a60c7 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 15 Mar 2024 21:43:11 +0100 Subject: [PATCH 23/46] Disable format truncation warnings --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 100ffb64..20a9cd5d 100644 --- a/configure.ac +++ b/configure.ac @@ -215,6 +215,7 @@ if test $ac_auto_cflags = yes; then AC_CHECK_CC_OPT([-Wall], [CFLAGS="$CFLAGS -Wall"], []) AC_CHECK_CC_OPT([-Wno-sign-compare], [CFLAGS="$CFLAGS -Wno-sign-compare"], []) AC_CHECK_CC_OPT([-Wno-unused], [CFLAGS="$CFLAGS -Wno-unused"], []) + AC_CHECK_CC_OPT([-Wno-format-truncation], [CFLAGS="$CFLAGS -Wno-format-truncation"], []) fi if test ! -z $ac_host_cflags; then CFLAGS="$ac_host_cflags $CFLAGS" From 333deb5ce04a52a201f7963283e6584e90a9a590 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 17 Mar 2024 18:49:04 +0100 Subject: [PATCH 24/46] Refactor the blit buffer allocation --- advance/blit/blit.c | 355 ++++++++++++-------------------------------- advance/blit/blit.h | 1 + advance/osd/video.c | 4 +- 3 files changed, 102 insertions(+), 258 deletions(-) diff --git a/advance/blit/blit.c b/advance/blit/blit.c index 00ba449f..32d28a64 100644 --- a/advance/blit/blit.c +++ b/advance/blit/blit.c @@ -217,84 +217,47 @@ static inline void internal_end(void) /* A very fast dynamic buffers allocations */ -/* Max number of allocable buffers */ -#define FAST_BUFFER_MAX 128 - /* Total size of the buffers */ -#define FAST_BUFFER_SIZE (256 * 1024) +#define FAST_BUFFER_SIZE (4 * 1024 * 1024) /* Align */ #define FAST_BUFFER_ALIGN 16 /* SSE2 requirement */ -void* fast_buffer; /* raw pointer */ -void* fast_buffer_aligned; /* aligned pointer */ -unsigned fast_buffer_map[FAST_BUFFER_MAX]; /* stack of incremental size used */ -unsigned fast_buffer_mac; /* top of the stack */ +uint8* fast_buffer; /* raw pointer */ +uint8* fast_buffer_aligned; /* aligned pointer */ +uint8* fast_buffer_ptr; /* top of the stack */ -static void* video_buffer_alloc(unsigned size) +static void* video_buffer_mark(void) { - unsigned size_aligned = ALIGN_UNSIGNED(size, FAST_BUFFER_ALIGN); - - assert(fast_buffer_mac < FAST_BUFFER_MAX); - - if (fast_buffer_map[fast_buffer_mac] + size_aligned > FAST_BUFFER_SIZE - FAST_BUFFER_ALIGN) { - log_std(("ERROR:blit: out of memory\n")); - return 0; - } - - ++fast_buffer_mac; - fast_buffer_map[fast_buffer_mac] = fast_buffer_map[fast_buffer_mac - 1] + size_aligned; - - return (uint8*)fast_buffer_aligned + fast_buffer_map[fast_buffer_mac - 1]; + return fast_buffer_ptr; } -/* Buffers must be allocated and freed in exact reverse order */ -static void video_buffer_free(void* buffer) +static void video_buffer_reset(void* ptr) { - (void)buffer; - assert(fast_buffer_mac != 0); - --fast_buffer_mac; + fast_buffer_ptr = ptr; } -/* Debug version of the alloc functions */ -#ifndef NDEBUG - -#define WRAP_SIZE 32 - -static void* video_buffer_alloc_wrap(unsigned size) +static void* video_buffer_alloc(unsigned size) { - uint8* buffer8 = (uint8*)video_buffer_alloc(size + WRAP_SIZE); - unsigned i; - for (i = 0; i < WRAP_SIZE; ++i) - buffer8[i] = i; - return buffer8 + WRAP_SIZE; -} + unsigned size_aligned = ALIGN_UNSIGNED(size, FAST_BUFFER_ALIGN); + void* ptr; -static void video_buffer_free_wrap(void* buffer) -{ - uint8* buffer8 = (uint8*)buffer - WRAP_SIZE; - unsigned i; - for (i = 0; i < WRAP_SIZE; ++i) - assert(buffer8[i] == i); - video_buffer_free(buffer8); -} + ptr = fast_buffer_ptr; -#define video_buffer_free video_buffer_free_wrap -#define video_buffer_alloc video_buffer_alloc_wrap + fast_buffer_ptr += size_aligned; -#endif + return ptr; +} static void video_buffer_init(void) { fast_buffer = malloc(FAST_BUFFER_SIZE + FAST_BUFFER_ALIGN); fast_buffer_aligned = ALIGN_PTR(fast_buffer, FAST_BUFFER_ALIGN); - fast_buffer_mac = 0; - fast_buffer_map[0] = 0; + fast_buffer_ptr = fast_buffer_aligned; } static void video_buffer_done(void) { - assert(fast_buffer_mac == 0); free(fast_buffer); } @@ -672,6 +635,7 @@ void video_pipeline_init(struct video_pipeline_struct* pipeline) unsigned i; pipeline->stage_mac = 0; + pipeline->mark = 0; pipeline->target.line = &video_line; pipeline->target.ptr = 0; pipeline->target.color_def = video_color_def(); @@ -690,21 +654,8 @@ void video_pipeline_target(struct video_pipeline_struct* pipeline, void* ptr, un void video_pipeline_done(struct video_pipeline_struct* pipeline) { - int i; - - if (pipeline->stage_mac) { - /* deallocate with the same allocation order */ - for (i = pipeline->stage_mac - 1; i >= 0; --i) { - struct video_stage_horz_struct* stage = &pipeline->stage_map[i]; - if (stage->buffer_extra) - video_buffer_free(stage->buffer_extra); - } - for (i = pipeline->stage_mac - 1; i >= 0; --i) { - struct video_stage_horz_struct* stage = &pipeline->stage_map[i]; - if (stage->buffer) - video_buffer_free(stage->buffer); - } - } + if (pipeline->mark) + video_buffer_reset(pipeline->mark); } static inline struct video_stage_horz_struct* video_pipeline_begin_mutable(struct video_pipeline_struct* pipeline) @@ -755,6 +706,9 @@ static void video_pipeline_realize(struct video_pipeline_struct* pipeline, unsig stage_vert->bpp = stage_vert->stage_pivot->sbpp; } + assert(pipeline->mark == 0); + pipeline->mark = video_buffer_mark(); + /* allocate buffers */ stage = stage_begin; while (stage != stage_end) { @@ -1076,6 +1030,7 @@ static void video_stage_stretchy_max_x1(const struct video_pipeline_target_struc const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; + void* mark = video_buffer_mark(); void* buffer = video_buffer_alloc(stage_vert->stage_begin->sdx * stage_vert->stage_begin->sbpp); unsigned whole = stage_vert->slice.whole; @@ -1122,7 +1077,7 @@ static void video_stage_stretchy_max_x1(const struct video_pipeline_target_struc --count; } - video_buffer_free(buffer); + video_buffer_reset(mark); } /* Compute the mean of every lines reduced to a single line */ @@ -1134,6 +1089,7 @@ static void video_stage_stretchy_mean_x1(const struct video_pipeline_target_stru const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; + void* mark = video_buffer_mark(); void* buffer = video_buffer_alloc(stage_pivot->sdx * stage_pivot->sbpp); unsigned whole = stage_vert->slice.whole; @@ -1177,7 +1133,7 @@ static void video_stage_stretchy_mean_x1(const struct video_pipeline_target_stru --count; } - video_buffer_free(buffer); + video_buffer_reset(mark); } /* Compute the mean of the previous line and the first of every iteration */ @@ -1190,6 +1146,7 @@ static void video_stage_stretchy_filter_x1(const struct video_pipeline_target_st const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; adv_bool buffer_full = 0; + void* mark = video_buffer_mark(); void* buffer = video_buffer_alloc(stage_pivot->sdx * stage_pivot->sbpp); unsigned whole = stage_vert->slice.whole; @@ -1233,7 +1190,7 @@ static void video_stage_stretchy_filter_x1(const struct video_pipeline_target_st --count; } - video_buffer_free(buffer); + video_buffer_reset(mark); } /***************************************************************************/ @@ -1305,6 +1262,7 @@ static void video_stage_stretchy_mean_1x(const struct video_pipeline_target_stru const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; + void* mark = video_buffer_mark(); void* buffer = video_buffer_alloc(stage_pivot->sdx * stage_pivot->sbpp); void* previous_buffer = 0; @@ -1362,7 +1320,7 @@ static void video_stage_stretchy_mean_1x(const struct video_pipeline_target_stru --count; } - video_buffer_free(buffer); + video_buffer_reset(mark); } static void video_stage_stretchy_min_1x(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) @@ -1373,6 +1331,7 @@ static void video_stage_stretchy_min_1x(const struct video_pipeline_target_struc const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; + void* mark = video_buffer_mark(); void* buffer = video_buffer_alloc(stage_pivot->sdx * stage_pivot->sbpp); adv_bool buffer_set = 0; @@ -1428,7 +1387,7 @@ static void video_stage_stretchy_min_1x(const struct video_pipeline_target_struc --count; } - video_buffer_free(buffer); + video_buffer_reset(mark); } @@ -1441,6 +1400,7 @@ static void video_stage_stretchy_filter_1x(const struct video_pipeline_target_st const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; + void* mark = video_buffer_mark(); void* buffer = video_buffer_alloc(stage_pivot->sdx * stage_pivot->sbpp); void* previous_buffer = 0; @@ -1494,7 +1454,7 @@ static void video_stage_stretchy_filter_1x(const struct video_pipeline_target_st --count; } - video_buffer_free(buffer); + video_buffer_reset(mark); } /***************************************************************************/ @@ -1515,10 +1475,11 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru void* final[2]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 2; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); @@ -1536,7 +1497,7 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -1641,15 +1602,7 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru line += 2; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 2; ++i) { - video_buffer_free(final[1 - i]); - } - } + video_buffer_reset(mark); } static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) @@ -1666,10 +1619,11 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str void* final[3]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); @@ -1687,7 +1641,7 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -1791,15 +1745,7 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str line += 3; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 3; ++i) { - video_buffer_free(final[2 - i]); - } - } + video_buffer_reset(mark); } static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) @@ -1816,10 +1762,11 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str void* final[4]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); @@ -1837,7 +1784,7 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -1941,15 +1888,7 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str line += 4; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 4; ++i) { - video_buffer_free(final[3 - i]); - } - } + video_buffer_reset(mark); } #endif @@ -1971,10 +1910,11 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru void* final[2]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 2; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); @@ -1992,7 +1932,7 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -2096,15 +2036,7 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru line += 2; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 2; ++i) { - video_buffer_free(final[1 - i]); - } - } + video_buffer_reset(mark); } #endif @@ -2127,10 +2059,11 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* void* final[2]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 2; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); @@ -2148,7 +2081,7 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -2252,15 +2185,7 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* line += 2; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 2; ++i) { - video_buffer_free(final[1 - i]); - } - } + video_buffer_reset(mark); } static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) @@ -2277,10 +2202,11 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct void* final[3]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); @@ -2298,7 +2224,7 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -2402,15 +2328,7 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct line += 3; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 3; ++i) { - video_buffer_free(final[2 - i]); - } - } + video_buffer_reset(mark); } static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) @@ -2427,10 +2345,11 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct void* final[4]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); @@ -2448,7 +2367,7 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -2552,15 +2471,7 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct line += 4; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 4; ++i) { - video_buffer_free(final[3 - i]); - } - } + video_buffer_reset(mark); } #endif #endif @@ -2584,10 +2495,11 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct void* final[2]; const void* input[5]; void* partial[5]; - void* partial_copy[5]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 2; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); @@ -2609,7 +2521,7 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct PADD(input[4], stage_vert->sdw * 4); for (i = 0; i < 5; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -2763,15 +2675,7 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct line += 2; } - for (i = 0; i < 5; ++i) { - video_buffer_free(partial_copy[4 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 2; ++i) { - video_buffer_free(final[1 - i]); - } - } + video_buffer_reset(mark); } #endif #endif @@ -2795,10 +2699,11 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru void* final[3]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(3 * stage_pivot->sdx * stage_pivot->sbpp); @@ -2816,7 +2721,7 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -2920,15 +2825,7 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru line += 3; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 3; ++i) { - video_buffer_free(final[2 - i]); - } - } + video_buffer_reset(mark); } #endif @@ -2950,10 +2847,11 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru void* final[3]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(3 * stage_pivot->sdx * stage_pivot->sbpp); @@ -2971,7 +2869,7 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -3075,15 +2973,7 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru line += 3; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 3; ++i) { - video_buffer_free(final[2 - i]); - } - } + video_buffer_reset(mark); } #endif @@ -3106,10 +2996,11 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* void* final[3]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(3 * stage_pivot->sdx * stage_pivot->sbpp); @@ -3127,7 +3018,7 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -3231,15 +3122,7 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* line += 3; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 3; ++i) { - video_buffer_free(final[2 - i]); - } - } + video_buffer_reset(mark); } #endif #endif @@ -3263,10 +3146,11 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct void* final[3]; const void* input[5]; void* partial[5]; - void* partial_copy[5]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(3 * stage_pivot->sdx * stage_pivot->sbpp); @@ -3288,7 +3172,7 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct PADD(input[4], stage_vert->sdw * 4); for (i = 0; i < 5; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -3442,15 +3326,7 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct line += 3; } - for (i = 0; i < 5; ++i) { - video_buffer_free(partial_copy[4 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 3; ++i) { - video_buffer_free(final[2 - i]); - } - } + video_buffer_reset(mark); } #endif #endif @@ -3473,12 +3349,12 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru void* final[4]; const void* input[5]; void* partial[5]; - void* partial_copy[5]; void* middle[6]; - void* middle_copy[6]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(4 * stage_pivot->sdx * stage_pivot->sbpp); @@ -3500,11 +3376,11 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru PADD(input[4], stage_vert->sdw * 4); for (i = 0; i < 5; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } for (i = 0; i < 6; ++i) { - middle_copy[i] = middle[i] = video_buffer_alloc(2 * stage_vert->sdx * stage_vert->bpp); + middle[i] = video_buffer_alloc(2 * stage_vert->sdx * stage_vert->bpp); } for (i = 0; i < 4; ++i) { @@ -3679,19 +3555,7 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru line += 4; } - for (i = 0; i < 6; ++i) { - video_buffer_free(middle_copy[5 - i]); - } - - for (i = 0; i < 5; ++i) { - video_buffer_free(partial_copy[4 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 4; ++i) { - video_buffer_free(final[3 - i]); - } - } + video_buffer_reset(mark); } #endif @@ -3713,10 +3577,11 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru void* final[4]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(4 * stage_pivot->sdx * stage_pivot->sbpp); @@ -3734,7 +3599,7 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -3838,15 +3703,7 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru line += 4; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 4; ++i) { - video_buffer_free(final[3 - i]); - } - } + video_buffer_reset(mark); } #endif @@ -3869,10 +3726,11 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* void* final[4]; const void* input[3]; void* partial[3]; - void* partial_copy[3]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(4 * stage_pivot->sdx * stage_pivot->sbpp); @@ -3890,7 +3748,7 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* PADD(input[2], stage_vert->sdw * 2); for (i = 0; i < 3; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -3994,15 +3852,7 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* line += 4; } - for (i = 0; i < 3; ++i) { - video_buffer_free(partial_copy[2 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 4; ++i) { - video_buffer_free(final[3 - i]); - } - } + video_buffer_reset(mark); } #endif #endif @@ -4026,10 +3876,11 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct void* final[4]; const void* input[5]; void* partial[5]; - void* partial_copy[5]; void* tmp; unsigned i; + void* mark = video_buffer_mark(); + if (stage_pivot != stage_end) { for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(4 * stage_pivot->sdx * stage_pivot->sbpp); @@ -4051,7 +3902,7 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct PADD(input[4], stage_vert->sdw * 4); for (i = 0; i < 5; ++i) { - partial_copy[i] = partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); + partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); @@ -4205,15 +4056,7 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct line += 4; } - for (i = 0; i < 5; ++i) { - video_buffer_free(partial_copy[4 - i]); - } - - if (stage_pivot != stage_end) { - for (i = 0; i < 4; ++i) { - video_buffer_free(final[3 - i]); - } - } + video_buffer_reset(mark); } #endif #endif diff --git a/advance/blit/blit.h b/advance/blit/blit.h index cff6967c..e1e44146 100644 --- a/advance/blit/blit.h +++ b/advance/blit/blit.h @@ -304,6 +304,7 @@ struct __attribute__((aligned(8))) video_pipeline_struct { struct video_stage_horz_struct stage_map[VIDEO_STAGE_MAX]; /**< Horizontal stages. */ struct video_stage_vert_struct stage_vert; /**< Vertical stage. */ unsigned stage_mac; /**< Number of horizontal stages. */ + void* mark; /**< Marker for buffer allocation */ struct video_pipeline_target_struct target; /**< Target of the pipeline. */ }; diff --git a/advance/osd/video.c b/advance/osd/video.c index 60a143fa..bafaadea 100644 --- a/advance/osd/video.c +++ b/advance/osd/video.c @@ -812,9 +812,9 @@ static void video_done_pipeline(struct advance_video_context* context) /* destroy the pipeline */ if (context->state.blit_pipeline_flag) { unsigned i; - for (i = 0; i < PIPELINE_BLIT_MAX; ++i) - video_pipeline_done(&context->state.blit_pipeline[i]); video_pipeline_done(&context->state.buffer_pipeline_video); + for (i = 0; i < PIPELINE_BLIT_MAX; ++i) + video_pipeline_done(&context->state.blit_pipeline[PIPELINE_BLIT_MAX - 1 - i]); context->state.blit_pipeline_flag = 0; } From 675400b45e6b5bcec653de9146b794cf6a795225 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 17 Mar 2024 17:53:20 +0100 Subject: [PATCH 25/46] Support OpenMP for XBR effect --- advance/blit/blit.c | 198 +++++++++++++++++++++++++++++++++++++++++ advance/lib/config.hin | 2 +- advance/osd/video.c | 9 ++ configure.ac | 12 ++- 4 files changed, 217 insertions(+), 4 deletions(-) diff --git a/advance/blit/blit.c b/advance/blit/blit.c index 32d28a64..6fb96056 100644 --- a/advance/blit/blit.c +++ b/advance/blit/blit.c @@ -35,6 +35,10 @@ #include "error.h" #include "endianrw.h" +#ifdef _OPENMP +#include +#endif + /***************************************************************************/ /* mmx */ @@ -2677,6 +2681,65 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct video_buffer_reset(mark); } + +#ifdef _OPENMP +static void video_stage_stretchy_xbr2x_openmp(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) +{ + const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; + const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; + const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; + + if (stage_pivot != stage_end) + video_stage_stretchy_xbr2x(target, stage_vert, x, y, src); + + unsigned x_off = x * target->bytes_per_pixel; + unsigned count = stage_vert->sdy; + unsigned pos = -1; + unsigned bdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); + unsigned sdw = stage_vert->sdw; + void* buffer; + void** partial; + void** dst; + + void* mark = video_buffer_mark(); + + buffer = video_buffer_alloc(bdw * count); + partial = video_buffer_alloc(sizeof(void*) * count); + dst = video_buffer_alloc(sizeof(void*) * count * 2); + + #pragma omp parallel for + for (unsigned i = 0; i < count; ++i) { + const uint8* prt = src + i * sdw; + uint8* buf = buffer + i * bdw; + partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt, -1); + dst[i * 2] = target->line(target, y + i * 2) + x_off; + dst[i * 2 + 1] = target->line(target, y + i * 2 + 1) + x_off; + } + + /* first row */ + stage_xbr2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[0], partial[1], partial[2], pos); + + /* second row */ + stage_xbr2x(stage_vert, dst[2], dst[3], partial[0], partial[0], partial[1], partial[2], partial[3], pos); + + /* central rows */ + count -= 2; + #pragma omp parallel for + for (unsigned i = 2; i < count; ++i) { + stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2], pos); + } + unsigned i = count; + + /* before last row */ + stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1], pos); + ++i; + + /* last row */ + stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i], pos); + + video_buffer_reset(mark); +} +#endif #endif #endif @@ -3328,6 +3391,68 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct video_buffer_reset(mark); } + +#ifdef _OPENMP +static void video_stage_stretchy_xbr3x_openmp(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) +{ + const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; + const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; + const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; + + if (stage_pivot != stage_end) + video_stage_stretchy_xbr3x(target, stage_vert, x, y, src); + + unsigned x_off = x * target->bytes_per_pixel; + unsigned count = stage_vert->sdy; + unsigned pos = -1; + unsigned bdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); + unsigned sdw = stage_vert->sdw; + void* buffer; + void** partial; + void** dst; + + void* mark = video_buffer_mark(); + + buffer = video_buffer_alloc(bdw * count); + partial = video_buffer_alloc(sizeof(void*) * count); + dst = video_buffer_alloc(sizeof(void*) * count * 3); + + #pragma omp parallel for + for (unsigned i = 0; i < count; ++i) { + const uint8* prt = src + i * sdw; + uint8* buf = buffer + i * bdw; + partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt, -1); + dst[i * 3] = target->line(target, y + i * 3) + x_off; + dst[i * 3 + 1] = target->line(target, y + i * 3 + 1) + x_off; + dst[i * 3 + 2] = target->line(target, y + i * 3 + 2) + x_off; + } + + + /* first row */ + stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[0], partial[1], partial[2], pos); + + /* second row */ + stage_xbr3x(stage_vert, dst[3], dst[4], dst[5],partial[0], partial[0], partial[1], partial[2], partial[3], pos); + + + /* central rows */ + count -= 2; + #pragma omp parallel for + for (unsigned i = 2; i < count; ++i) { + stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2], pos); + } + unsigned i = count; + + /* before last row */ + stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1], pos); + ++i; + + /* last row */ + stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i], pos); + + video_buffer_reset(mark); +} +#endif #endif #endif @@ -4058,6 +4183,67 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct video_buffer_reset(mark); } + +#ifdef _OPENMP +static void video_stage_stretchy_xbr4x_openmp(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) +{ + const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; + const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; + const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; + + if (stage_pivot != stage_end) + video_stage_stretchy_xbr4x(target, stage_vert, x, y, src); + + unsigned x_off = x * target->bytes_per_pixel; + unsigned count = stage_vert->sdy; + unsigned pos = -1; + unsigned bdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); + unsigned sdw = stage_vert->sdw; + void* buffer; + void** partial; + void** dst; + + void* mark = video_buffer_mark(); + + buffer = video_buffer_alloc(bdw * count); + partial = video_buffer_alloc(sizeof(void*) * count); + dst = video_buffer_alloc(sizeof(void*) * count * 4); + + #pragma omp parallel for + for (unsigned i = 0; i < count; ++i) { + const uint8* prt = src + i * sdw; + uint8* buf = buffer + i * bdw; + partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt, -1); + dst[i * 4] = target->line(target, y + i * 4) + x_off; + dst[i * 4 + 1] = target->line(target, y + i * 4 + 1) + x_off; + dst[i * 4 + 2] = target->line(target, y + i * 4 + 2) + x_off; + dst[i * 4 + 3] = target->line(target, y + i * 4 + 3) + x_off; + } + + /* first row */ + stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[0], partial[1], partial[2], pos); + + /* second row */ + stage_xbr4x(stage_vert, dst[4], dst[5], dst[6], dst[7], partial[0], partial[0], partial[1], partial[2], partial[3], pos); + + /* central rows */ + count -= 2; + #pragma omp parallel for + for (unsigned i = 2; i < count; ++i) { + stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2], pos); + } + unsigned i = count; + + /* before last row */ + stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1], pos); + ++i; + + /* last row */ + stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i], pos); + + video_buffer_reset(mark); +} +#endif #endif #endif @@ -4194,7 +4380,11 @@ static void video_stage_stretchy_set(const struct video_pipeline_target_struct* slice_set(&stage_vert->slice, sdy, ddy); video_stage_pivot_late_set(stage_vert, combine); +#ifdef _OPENMP + stage_vert->put = video_stage_stretchy_xbr2x_openmp; +#else stage_vert->put = video_stage_stretchy_xbr2x; +#endif stage_vert->type = pipe_y_xbr2x; #endif } else if (ddx == 3 * sdx && ddy == 3 * sdy && combine_y == VIDEO_COMBINE_Y_SCALEX) { @@ -4224,7 +4414,11 @@ static void video_stage_stretchy_set(const struct video_pipeline_target_struct* slice_set(&stage_vert->slice, sdy, ddy); video_stage_pivot_late_set(stage_vert, combine); +#ifdef _OPENMP + stage_vert->put = video_stage_stretchy_xbr3x_openmp; +#else stage_vert->put = video_stage_stretchy_xbr3x; +#endif stage_vert->type = pipe_y_xbr3x; #endif } else if (ddx == 4 * sdx && ddy == 4 * sdy && combine_y == VIDEO_COMBINE_Y_SCALEX) { @@ -4254,7 +4448,11 @@ static void video_stage_stretchy_set(const struct video_pipeline_target_struct* slice_set(&stage_vert->slice, sdy, ddy); video_stage_pivot_late_set(stage_vert, combine); +#ifdef _OPENMP + stage_vert->put = video_stage_stretchy_xbr4x_openmp; +#else stage_vert->put = video_stage_stretchy_xbr4x; +#endif stage_vert->type = pipe_y_xbr4x; #endif } else diff --git a/advance/lib/config.hin b/advance/lib/config.hin index 9e02f137..bb27ac67 100644 --- a/advance/lib/config.hin +++ b/advance/lib/config.hin @@ -70,7 +70,7 @@ /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE -/* Define to 1 if you have the `inb' and `outb' functions. */ +/* Define to 1 if you have the inb and outb functions. */ #undef HAVE_INOUT /* Define to 1 if you have the header file. */ diff --git a/advance/osd/video.c b/advance/osd/video.c index bafaadea..3d39d8ff 100644 --- a/advance/osd/video.c +++ b/advance/osd/video.c @@ -48,6 +48,10 @@ #include "dvg.h" #endif +#ifdef _OPENMP +#include +#endif + /***************************************************************************/ /* Commands */ @@ -939,6 +943,11 @@ static void* video_thread(void* void_context) log_std(("advance:thread: thread start\n")); +#ifdef _OPENMP + /* reserve one thread to MAME */ + omp_set_num_threads(omp_get_max_threads() - 1); +#endif + pthread_mutex_lock(&context->state.thread_video_mutex); while (1) { diff --git a/configure.ac b/configure.ac index 20a9cd5d..5a9c92a1 100644 --- a/configure.ac +++ b/configure.ac @@ -180,7 +180,6 @@ if test $ac_auto_cflags = yes; then AC_CHECK_CC_OPT([-march=armv8-a+crc], [CFLAGS="$CFLAGS -march=armv8-a+crc"], []) AC_CHECK_CC_OPT([-mtune=cortex-a72], [CFLAGS="$CFLAGS -mtune=cortex-a72"], []) AC_CHECK_CC_OPT([-fomit-frame-pointer], [CFLAGS="$CFLAGS -fomit-frame-pointer"], []) - AC_CHECK_CC_OPT([-funsafe-math-optimizations], [CFLAGS="$CFLAGS -funsafe-math-optimizations"], []) elif $GREP a02082\\\|a22082 /proc/cpuinfo >/dev/null 2>&1; then dnl Raspberry Pi 3 dnl GCC 4 has problems with -march=native in Raspbian, @@ -190,7 +189,6 @@ if test $ac_auto_cflags = yes; then AC_CHECK_CC_OPT([-mtune=cortex-a53], [CFLAGS="$CFLAGS -mtune=cortex-a53"], []) AC_CHECK_CC_OPT([-mfloat-abi=hard], [CFLAGS="$CFLAGS -mfloat-abi=hard"], []) AC_CHECK_CC_OPT([-mfpu=crypto-neon-fp-armv8], [CFLAGS="$CFLAGS -mfpu=crypto-neon-fp-armv8"], []) - AC_CHECK_CC_OPT([-funsafe-math-optimizations], [CFLAGS="$CFLAGS -funsafe-math-optimizations"], []) elif $GREP a01040\\\|a01041\\\|a21041\\\|a22042 /proc/cpuinfo >/dev/null 2>&1; then dnl Raspberry Pi 2 AC_CHECK_CC_OPT([-march=armv7-a], [CFLAGS="$CFLAGS -march=armv7-a"], []) @@ -211,6 +209,9 @@ if test $ac_auto_cflags = yes; then AC_CHECK_CC_OPT([-fsigned-char], [CFLAGS="$CFLAGS -fsigned-char"], []) dnl We are not interested in stack protection AC_CHECK_CC_OPT([-fno-stack-protector], [CFLAGS="$CFLAGS -fno-stack-protector"], []) + dnl Generic better performance + AC_CHECK_CC_OPT([-funsafe-math-optimizations], [CFLAGS="$CFLAGS -funsafe-math-optimizations"], []) + dnl Some useful warnings AC_CHECK_CC_OPT([-Wall], [CFLAGS="$CFLAGS -Wall"], []) AC_CHECK_CC_OPT([-Wno-sign-compare], [CFLAGS="$CFLAGS -Wno-sign-compare"], []) @@ -242,6 +243,11 @@ if test $ac_auto_ldflags = yes ; then fi fi +dnl Enable OpenMP support +AC_OPENMP +CFLAGS="$CFLAGS $OPENMP_CFLAGS" +LDFLAGS="$LDFLAGS $OPENMP_CFLAGS" + AC_SUBST([CONF_CFLAGS_OPT],[$CFLAGS]) AC_SUBST([CONF_LDFLAGS],[$LDFLAGS]) @@ -361,7 +367,7 @@ if test $ac_system = unix ; then ],[ac_func_inout=yes],[ac_func_inout=no]) AC_MSG_RESULT([$ac_func_inout]) if test $ac_func_inout = yes; then - AC_DEFINE([HAVE_INOUT],[1],[Define to 1 if you have the `inb' and `outb' functions.]) + AC_DEFINE([HAVE_INOUT],[1],[Define to 1 if you have the inb and outb functions.]) fi fi From ce63396c7c62b0f29e0feada5edb4e671f3c8081 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 18 Mar 2024 07:29:06 +0100 Subject: [PATCH 26/46] Use XBR in all platforms --- advance/osd/video.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/advance/osd/video.c b/advance/osd/video.c index 3d39d8ff..8c19b0e6 100644 --- a/advance/osd/video.c +++ b/advance/osd/video.c @@ -2033,12 +2033,7 @@ adv_error advance_video_config_load(struct advance_video_context* context, adv_c log_std(("emu:video: orientation ui %04x\n", option->ui_orientation)); context->config.combine = conf_int_get_default(cfg_context, "display_resizeeffect"); - /* on Intel assume a fast machine */ -#if defined(__i386__) || defined(__x86_64__) context->config.combine_max = COMBINE_XBR; -#else - context->config.combine_max = COMBINE_SCALEK; -#endif context->config.rgb_effect = conf_int_get_default(cfg_context, "display_rgbeffect"); context->config.interlace_effect = conf_int_get_default(cfg_context, "display_interlaceeffect"); context->config.turbo_speed_factor = conf_float_get_default(cfg_context, "sync_turbospeed"); From dde3b82db952dd09f81eebd13e90cf58b3b697d1 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 18 Mar 2024 07:42:01 +0100 Subject: [PATCH 27/46] Remove unnecessary blit code --- advance/blit/blit.c | 711 +++++++++++++++++++------------------------- 1 file changed, 313 insertions(+), 398 deletions(-) diff --git a/advance/blit/blit.c b/advance/blit/blit.c index 6fb96056..e9f5d520 100644 --- a/advance/blit/blit.c +++ b/advance/blit/blit.c @@ -528,93 +528,93 @@ static inline void xbr4x(void* dst0, void* dst1, void* dst2, void* dst3, void* s } #endif -static inline void stage_scale2x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_scale2x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* src0, void* src1, void* src2) { scale2x(dst0, dst1, src0, src1, src2, stage->bpp, stage->sdx); } -static inline void stage_scale2x3(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_scale2x3(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2) { scale2x3(dst0, dst1, dst2, src0, src1, src2, stage->bpp, stage->sdx); } -static inline void stage_scale2x4(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_scale2x4(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2) { scale2x4(dst0, dst1, dst2, dst3, src0, src1, src2, stage->bpp, stage->sdx); } -static inline void stage_scale2k(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_scale2k(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* src0, void* src1, void* src2) { scale2k(dst0, dst1, src0, src1, src2, stage->interp_pixel, stage->sdx); } #ifndef USE_BLIT_SMALL -static inline void stage_hq2x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_hq2x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* src0, void* src1, void* src2) { hq2x(dst0, dst1, src0, src1, src2, stage->interp_pixel, stage->sdx); } -static inline void stage_hq2x3(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_hq2x3(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2) { hq2x3(dst0, dst1, dst2, src0, src1, src2, stage->interp_pixel, stage->sdx); } -static inline void stage_hq2x4(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_hq2x4(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2) { hq2x4(dst0, dst1, dst2, dst3, src0, src1, src2, stage->interp_pixel, stage->sdx); } -static inline void stage_xbr2x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* src0, void* src1, void* src2, void* src3, void* src4, unsigned pos) +static inline void stage_xbr2x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* src0, void* src1, void* src2, void* src3, void* src4) { xbr2x(dst0, dst1, src0, src1, src2, src3, src4, stage->interp_pixel, stage->sdx); } #endif -static inline void stage_scale3x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_scale3x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2) { scale3x(dst0, dst1, dst2, src0, src1, src2, stage->bpp, stage->sdx); } -static inline void stage_scale3k(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_scale3k(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2) { scale3k(dst0, dst1, dst2, src0, src1, src2, stage->interp_pixel, stage->sdx); } #ifndef USE_BLIT_SMALL -static inline void stage_hq3x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_hq3x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2) { hq3x(dst0, dst1, dst2, src0, src1, src2, stage->interp_pixel, stage->sdx); } -static inline void stage_xbr3x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2, void* src3, void* src4, unsigned pos) +static inline void stage_xbr3x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* src0, void* src1, void* src2, void* src3, void* src4) { xbr3x(dst0, dst1, dst2, src0, src1, src2, src3, src4, stage->interp_pixel, stage->sdx); } #endif -static inline void stage_scale4m(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_scale4m(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* src0, void* src1, void* src2) { scale2x(dst0, dst1, src0, src1, src2, stage->bpp, stage->sdx); } -static inline void stage_scale4x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2, void* src3, unsigned pos) +static inline void stage_scale4x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2, void* src3) { scale2x(dst0, dst1, src0, src1, src2, stage->bpp, 2 * stage->sdx); scale2x(dst2, dst3, src1, src2, src3, stage->bpp, 2 * stage->sdx); } -static inline void stage_scale4k(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_scale4k(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2) { scale4k(dst0, dst1, dst2, dst3, src0, src1, src2, stage->interp_pixel, stage->sdx); } #ifndef USE_BLIT_SMALL -static inline void stage_hq4x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2, unsigned pos) +static inline void stage_hq4x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2) { hq4x(dst0, dst1, dst2, dst3, src0, src1, src2, stage->interp_pixel, stage->sdx); } -static inline void stage_xbr4x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2, void* src3, void* src4, unsigned pos) +static inline void stage_xbr4x(const struct video_stage_vert_struct* stage, void* dst0, void* dst1, void* dst2, void* dst3, void* src0, void* src1, void* src2, void* src3, void* src4) { xbr4x(dst0, dst1, dst2, dst3, src0, src1, src2, src3, src4, stage->interp_pixel, stage->sdx); } @@ -739,7 +739,7 @@ static void video_pipeline_realize(struct video_pipeline_struct* pipeline, unsig } /* Run a partial pipeline (all except the last stage) and store the result in the specified buffer */ -static void* video_pipeline_run_partial(void* dst_buffer, const struct video_stage_horz_struct* stage, const struct video_stage_horz_struct* stage_end, unsigned line, const void* src, unsigned pos) +static void* video_pipeline_run_partial(void* dst_buffer, const struct video_stage_horz_struct* stage, const struct video_stage_horz_struct* stage_end, unsigned line, const void* src) { if (stage == stage_end) { return (void*)src; @@ -771,7 +771,7 @@ static void* video_pipeline_run_partial(void* dst_buffer, const struct video_sta } } -static void video_pipeline_run(const struct video_stage_horz_struct* stage, const struct video_stage_horz_struct* stage_end, unsigned line, void* dst, const void* src, unsigned pos) +static void video_pipeline_run(const struct video_stage_horz_struct* stage, const struct video_stage_horz_struct* stage_end, unsigned line, void* dst, const void* src) { --stage_end; if (stage == stage_end) { @@ -789,7 +789,7 @@ static void video_pipeline_run(const struct video_stage_horz_struct* stage, cons } } -static void video_pipeline_run_plain(const struct video_stage_horz_struct* stage, const struct video_stage_horz_struct* stage_end, unsigned line, void* dst, void* src, unsigned pos) +static void video_pipeline_run_plain(const struct video_stage_horz_struct* stage, const struct video_stage_horz_struct* stage_end, unsigned line, void* dst, void* src) { --stage_end; if (stage == stage_end) { @@ -1018,7 +1018,7 @@ static void video_stage_stretchy_x1(const struct video_pipeline_target_struct* t } dst = target->line(target, y) + x_off; - video_pipeline_run(stage_vert->stage_begin, stage_vert->stage_end, line++, dst, src, -1); + video_pipeline_run(stage_vert->stage_begin, stage_vert->stage_end, line++, dst, src); ++y; PADD(src, stage_vert->sdw * run); @@ -1057,16 +1057,16 @@ static void video_stage_stretchy_max_x1(const struct video_pipeline_target_struc if (count == 1) run = 1; if (run == 1) { - video_pipeline_run(stage_begin, stage_end, line++, dst, src, -1); + video_pipeline_run(stage_begin, stage_end, line++, dst, src); PADD(src, stage_vert->sdw); } else { - void* src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src, -1); + void* src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src); stage_copy(stage_pivot, buffer, src_buffer); PADD(src, stage_vert->sdw); --run; while (run) { - src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src, -1); + src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src); if (color_def_type_get(target->color_def) == adv_color_type_rgb) stage_max_rgb_vert_self(stage_pivot, buffer, src_buffer); else @@ -1075,7 +1075,7 @@ static void video_stage_stretchy_max_x1(const struct video_pipeline_target_struc --run; } - video_pipeline_run_plain(stage_vert->stage_pivot, stage_end, line++, dst, buffer, -1); + video_pipeline_run_plain(stage_vert->stage_pivot, stage_end, line++, dst, buffer); } ++y; --count; @@ -1116,22 +1116,22 @@ static void video_stage_stretchy_mean_x1(const struct video_pipeline_target_stru if (count == 1) run = 1; if (run == 1) { - video_pipeline_run(stage_begin, stage_end, line++, dst, src, -1); + video_pipeline_run(stage_begin, stage_end, line++, dst, src); PADD(src, stage_vert->sdw); } else { - void* src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src, -1); + void* src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src); stage_copy(stage_pivot, buffer, src_buffer); PADD(src, stage_vert->sdw); --run; while (run) { - src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src, -1); + src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src); stage_mean_vert_self(stage_pivot, buffer, src_buffer); PADD(src, stage_vert->sdw); --run; } - video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer, -1); + video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer); } ++y; --count; @@ -1170,19 +1170,19 @@ static void video_stage_stretchy_filter_x1(const struct video_pipeline_target_st } dst = target->line(target, y) + x_off; - src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src, -1); + src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src); if (buffer_full) { stage_mean_vert_self(stage_pivot, buffer, src_buffer); - video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer, -1); + video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer); } else { - video_pipeline_run(stage_pivot, stage_end, line++, dst, src_buffer, -1); + video_pipeline_run(stage_pivot, stage_end, line++, dst, src_buffer); buffer_full = 1; } if (count > 1) { if (run > 1) { PADD(src, (run - 1) * stage_vert->sdw); - src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src, -1); + src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src); } stage_copy(stage_pivot, buffer, src_buffer); @@ -1225,7 +1225,6 @@ static void video_stage_stretchy_1x(const struct video_pipeline_target_struct* t int error = stage_vert->slice.error; unsigned count = stage_vert->slice.count; unsigned line = 0; - unsigned pos = -1; while (count) { void* buffer; @@ -1240,10 +1239,10 @@ static void video_stage_stretchy_1x(const struct video_pipeline_target_struct* t unsigned prun = run; unsigned py = y; - buffer = video_pipeline_run_partial(0, stage_vert->stage_begin, stage_vert->stage_pivot, 0, src, pos); + buffer = video_pipeline_run_partial(0, stage_vert->stage_begin, stage_vert->stage_pivot, 0, src); while (prun) { void* dst = target->line(target, py) + x_off; - video_pipeline_run(stage_vert->stage_pivot, stage_vert->stage_end, line++, dst, buffer, pos); + video_pipeline_run(stage_vert->stage_pivot, stage_vert->stage_end, line++, dst, buffer); ++py; --prun; } @@ -1290,16 +1289,16 @@ static void video_stage_stretchy_mean_1x(const struct video_pipeline_target_stru if (previous_buffer) stage_copy(stage_pivot, buffer, previous_buffer); - src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src, -1); + src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src); dst = target->line(target, y) + x_off; /* don't apply the effect if no duplication is required */ if (previous_buffer) { /* apply the mean effect only at the first line */ stage_mean_vert_self(stage_pivot, buffer, src_buffer); - video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer, -1); + video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer); } else { - video_pipeline_run(stage_pivot, stage_end, line++, dst, src_buffer, -1); + video_pipeline_run(stage_pivot, stage_end, line++, dst, src_buffer); } /* If some lines are duplicated save the current buffer */ @@ -1315,7 +1314,7 @@ static void video_stage_stretchy_mean_1x(const struct video_pipeline_target_stru /* do other lines without any effects */ while (run) { dst = target->line(target, y) + x_off; - video_pipeline_run(stage_pivot, stage_end, line++, dst, src_buffer, -1); + video_pipeline_run(stage_pivot, stage_end, line++, dst, src_buffer); ++y; --run; } @@ -1355,7 +1354,7 @@ static void video_stage_stretchy_min_1x(const struct video_pipeline_target_struc error -= down; } - src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src, -1); + src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src); if (buffer_set) { if (run != whole) { @@ -1364,14 +1363,14 @@ static void video_stage_stretchy_min_1x(const struct video_pipeline_target_struc else stage_min_vert_self(stage_pivot, buffer, src_buffer); dst = target->line(target, y) + x_off; - video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer, -1); + video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer); ++y; --run; } stage_copy(stage_pivot, buffer, src_buffer); while (run) { dst = target->line(target, y) + x_off; - video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer, -1); + video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer); ++y; --run; } @@ -1379,7 +1378,7 @@ static void video_stage_stretchy_min_1x(const struct video_pipeline_target_struc stage_copy(stage_pivot, buffer, src_buffer); while (run) { dst = target->line(target, y) + x_off; - video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer, -1); + video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer); ++y; --run; } @@ -1428,15 +1427,15 @@ static void video_stage_stretchy_filter_1x(const struct video_pipeline_target_st if (previous_buffer) stage_copy(stage_pivot, buffer, previous_buffer); - src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src, -1); + src_buffer = video_pipeline_run_partial(0, stage_begin, stage_pivot, 0, src); dst = target->line(target, y) + x_off; if (previous_buffer) { /* apply the mean effect only at the first line */ stage_mean_vert_self(stage_pivot, buffer, src_buffer); - video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer, -1); + video_pipeline_run_plain(stage_pivot, stage_end, line++, dst, buffer); } else { - video_pipeline_run(stage_pivot, stage_end, line++, dst, src_buffer, -1); + video_pipeline_run(stage_pivot, stage_end, line++, dst, src_buffer); } /* save always the current buffer (this is the difference from filter and mean) */ @@ -1449,7 +1448,7 @@ static void video_stage_stretchy_filter_1x(const struct video_pipeline_target_st /* do other lines without any effects */ while (run) { dst = target->line(target, y) + x_off; - video_pipeline_run(stage_pivot, stage_end, line++, dst, src_buffer, -1); + video_pipeline_run(stage_pivot, stage_end, line++, dst, src_buffer); ++y; --run; } @@ -1470,7 +1469,6 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -1488,10 +1486,6 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru for (i = 0; i < 2; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 2; ++i) { - final[i] = 0; - } } input[0] = src; @@ -1504,8 +1498,8 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[2]; @@ -1516,7 +1510,7 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru ++y; } - stage_scale2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[1], -1); + stage_scale2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -1526,9 +1520,9 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale2x(stage_vert, dst[0], dst[1], partial[0], partial[1], partial[2], pos); + stage_scale2x(stage_vert, dst[0], dst[1], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -1545,7 +1539,7 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru ++y; } - stage_scale2x(stage_vert, dst[0], dst[1], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_scale2x(stage_vert, dst[0], dst[1], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[2]; unsigned pline; @@ -1556,10 +1550,10 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru ++y; } - stage_scale2x(stage_vert, final[0], final[1], partial[0], partial[0], partial[1], pos); + stage_scale2x(stage_vert, final[0], final[1], partial[0], partial[0], partial[1]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -1572,12 +1566,12 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale2x(stage_vert, final[0], final[1], partial[0], partial[1], partial[2], pos); + stage_scale2x(stage_vert, final[0], final[1], partial[0], partial[1], partial[2]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -1597,10 +1591,10 @@ static void video_stage_stretchy_scale2x(const struct video_pipeline_target_stru ++y; } - stage_scale2x(stage_vert, final[0], final[1], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_scale2x(stage_vert, final[0], final[1], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -1614,7 +1608,6 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -1632,10 +1625,6 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 3; ++i) { - final[i] = 0; - } } input[0] = src; @@ -1648,8 +1637,8 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[3]; @@ -1660,7 +1649,7 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str ++y; } - stage_scale2x3(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1], -1); + stage_scale2x3(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -1670,9 +1659,9 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale2x3(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2], pos); + stage_scale2x3(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -1689,7 +1678,7 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str ++y; } - stage_scale2x3(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_scale2x3(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[3]; @@ -1699,10 +1688,10 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str ++y; } - stage_scale2x3(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1], pos); + stage_scale2x3(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -1715,12 +1704,12 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale2x3(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2], pos); + stage_scale2x3(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -1740,10 +1729,10 @@ static void video_stage_stretchy_scale2x3(const struct video_pipeline_target_str ++y; } - stage_scale2x3(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_scale2x3(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -1757,7 +1746,6 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -1775,10 +1763,6 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 4; ++i) { - final[i] = 0; - } } input[0] = src; @@ -1791,8 +1775,8 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[4]; @@ -1803,7 +1787,7 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str ++y; } - stage_scale2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[1], -1); + stage_scale2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -1813,9 +1797,9 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[1], partial[2], pos); + stage_scale2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -1832,7 +1816,7 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str ++y; } - stage_scale2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_scale2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[4]; @@ -1842,10 +1826,10 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str ++y; } - stage_scale2x4(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[1], pos); + stage_scale2x4(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[1]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -1858,12 +1842,12 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale2x4(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[1], partial[2], pos); + stage_scale2x4(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[1], partial[2]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -1883,10 +1867,10 @@ static void video_stage_stretchy_scale2x4(const struct video_pipeline_target_str ++y; } - stage_scale2x4(stage_vert, final[0], final[1], final[2], final[3], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_scale2x4(stage_vert, final[0], final[1], final[2], final[3], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -1905,7 +1889,6 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -1923,10 +1906,6 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru for (i = 0; i < 2; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 2; ++i) { - final[i] = 0; - } } input[0] = src; @@ -1939,8 +1918,8 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[2]; @@ -1951,7 +1930,7 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru ++y; } - stage_scale2k(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[1], -1); + stage_scale2k(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -1961,9 +1940,9 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale2k(stage_vert, dst[0], dst[1], partial[0], partial[1], partial[2], pos); + stage_scale2k(stage_vert, dst[0], dst[1], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -1980,7 +1959,7 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru ++y; } - stage_scale2k(stage_vert, dst[0], dst[1], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_scale2k(stage_vert, dst[0], dst[1], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[2]; @@ -1990,10 +1969,10 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru ++y; } - stage_scale2k(stage_vert, final[0], final[1], partial[0], partial[0], partial[1], pos); + stage_scale2k(stage_vert, final[0], final[1], partial[0], partial[0], partial[1]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -2006,12 +1985,12 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale2k(stage_vert, final[0], final[1], partial[0], partial[1], partial[2], pos); + stage_scale2k(stage_vert, final[0], final[1], partial[0], partial[1], partial[2]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -2031,10 +2010,10 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru ++y; } - stage_scale2k(stage_vert, final[0], final[1], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_scale2k(stage_vert, final[0], final[1], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -2054,7 +2033,6 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -2072,10 +2050,6 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* for (i = 0; i < 2; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 2; ++i) { - final[i] = 0; - } } input[0] = src; @@ -2088,8 +2062,8 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[2]; @@ -2100,7 +2074,7 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* ++y; } - stage_hq2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[1], -1); + stage_hq2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -2110,9 +2084,9 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_hq2x(stage_vert, dst[0], dst[1], partial[0], partial[1], partial[2], pos); + stage_hq2x(stage_vert, dst[0], dst[1], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -2129,7 +2103,7 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* ++y; } - stage_hq2x(stage_vert, dst[0], dst[1], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_hq2x(stage_vert, dst[0], dst[1], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[2]; @@ -2139,10 +2113,10 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* ++y; } - stage_hq2x(stage_vert, final[0], final[1], partial[0], partial[0], partial[1], pos); + stage_hq2x(stage_vert, final[0], final[1], partial[0], partial[0], partial[1]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -2155,12 +2129,12 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_hq2x(stage_vert, final[0], final[1], partial[0], partial[1], partial[2], pos); + stage_hq2x(stage_vert, final[0], final[1], partial[0], partial[1], partial[2]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -2180,10 +2154,10 @@ static void video_stage_stretchy_hq2x(const struct video_pipeline_target_struct* ++y; } - stage_hq2x(stage_vert, final[0], final[1], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_hq2x(stage_vert, final[0], final[1], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -2197,7 +2171,6 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -2215,10 +2188,6 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 3; ++i) { - final[i] = 0; - } } input[0] = src; @@ -2231,8 +2200,8 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[3]; @@ -2243,7 +2212,7 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct ++y; } - stage_hq2x3(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1], -1); + stage_hq2x3(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -2253,9 +2222,9 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_hq2x3(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2], pos); + stage_hq2x3(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -2272,7 +2241,7 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct ++y; } - stage_hq2x3(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_hq2x3(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[3]; @@ -2282,10 +2251,10 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct ++y; } - stage_hq2x3(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1], pos); + stage_hq2x3(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -2298,12 +2267,12 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_hq2x3(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2], pos); + stage_hq2x3(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -2323,10 +2292,10 @@ static void video_stage_stretchy_hq2x3(const struct video_pipeline_target_struct ++y; } - stage_hq2x3(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_hq2x3(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -2340,7 +2309,6 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -2358,10 +2326,6 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 4; ++i) { - final[i] = 0; - } } input[0] = src; @@ -2374,8 +2338,8 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[4]; @@ -2386,7 +2350,7 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct ++y; } - stage_hq2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[1], -1); + stage_hq2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -2396,9 +2360,9 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_hq2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[1], partial[2], pos); + stage_hq2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -2415,7 +2379,7 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct ++y; } - stage_hq2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_hq2x4(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[4]; @@ -2425,10 +2389,10 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct ++y; } - stage_hq2x4(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[1], pos); + stage_hq2x4(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[1]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -2441,12 +2405,12 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_hq2x4(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[1], partial[2], pos); + stage_hq2x4(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[1], partial[2]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -2466,10 +2430,10 @@ static void video_stage_stretchy_hq2x4(const struct video_pipeline_target_struct ++y; } - stage_hq2x4(stage_vert, final[0], final[1], final[2], final[3], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_hq2x4(stage_vert, final[0], final[1], final[2], final[3], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -2490,7 +2454,6 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -2508,10 +2471,6 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct for (i = 0; i < 2; ++i) { final[i] = video_buffer_alloc(2 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 2; ++i) { - final[i] = 0; - } } input[0] = src; @@ -2528,10 +2487,10 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], -1); - partial[3] = video_pipeline_run_partial(partial[3], stage_begin, stage_pivot, 0, input[3], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); + partial[3] = video_pipeline_run_partial(partial[3], stage_begin, stage_pivot, 0, input[3]); if (stage_pivot == stage_end) { void* dst[2]; @@ -2542,7 +2501,7 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct ++y; } - stage_xbr2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[0], partial[1], partial[2], -1); + stage_xbr2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[0], partial[1], partial[2]); /* second row */ for (i = 0; i < 2; ++i) { @@ -2550,7 +2509,7 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct ++y; } - stage_xbr2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[1], partial[2], partial[3], -1); + stage_xbr2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[1], partial[2], partial[3]); /* central rows */ count -= 4; @@ -2560,9 +2519,9 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct ++y; } - partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4], pos); + partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4]); - stage_xbr2x(stage_vert, dst[0], dst[1], partial[0], partial[1], partial[2], partial[3], partial[4], pos); + stage_xbr2x(stage_vert, dst[0], dst[1], partial[0], partial[1], partial[2], partial[3], partial[4]); tmp = partial[0]; partial[0] = partial[1]; @@ -2581,7 +2540,7 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct ++y; } - stage_xbr2x(stage_vert, dst[0], dst[1], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], -1); + stage_xbr2x(stage_vert, dst[0], dst[1], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1]); /* last row */ for (i = 0; i < 2; ++i) { @@ -2589,7 +2548,7 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct ++y; } - stage_xbr2x(stage_vert, dst[0], dst[1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1], -1); + stage_xbr2x(stage_vert, dst[0], dst[1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1]); } else { void* dst[2]; @@ -2599,10 +2558,10 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct ++y; } - stage_xbr2x(stage_vert, final[0], final[1], partial[0], partial[0], partial[0], partial[1], partial[2], pos); + stage_xbr2x(stage_vert, final[0], final[1], partial[0], partial[0], partial[0], partial[1], partial[2]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -2613,10 +2572,10 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct ++y; } - stage_xbr2x(stage_vert, final[0], final[1], partial[0], partial[0], partial[1], partial[2], partial[3], pos); + stage_xbr2x(stage_vert, final[0], final[1], partial[0], partial[0], partial[1], partial[2], partial[3]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -2629,12 +2588,12 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct ++y; } - partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4], pos); + partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4]); - stage_xbr2x(stage_vert, final[0], final[1], partial[0], partial[1], partial[2], partial[3], partial[4], pos); + stage_xbr2x(stage_vert, final[0], final[1], partial[0], partial[1], partial[2], partial[3], partial[4]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -2656,10 +2615,10 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct ++y; } - stage_xbr2x(stage_vert, final[0], final[1], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], pos); + stage_xbr2x(stage_vert, final[0], final[1], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -2670,10 +2629,10 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct ++y; } - stage_xbr2x(stage_vert, final[0], final[1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1], pos); + stage_xbr2x(stage_vert, final[0], final[1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1]); for (i = 0; i < 2; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 2; @@ -2694,7 +2653,6 @@ static void video_stage_stretchy_xbr2x_openmp(const struct video_pipeline_target unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; - unsigned pos = -1; unsigned bdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); unsigned sdw = stage_vert->sdw; void* buffer; @@ -2711,31 +2669,31 @@ static void video_stage_stretchy_xbr2x_openmp(const struct video_pipeline_target for (unsigned i = 0; i < count; ++i) { const uint8* prt = src + i * sdw; uint8* buf = buffer + i * bdw; - partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt, -1); + partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt); dst[i * 2] = target->line(target, y + i * 2) + x_off; dst[i * 2 + 1] = target->line(target, y + i * 2 + 1) + x_off; } /* first row */ - stage_xbr2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[0], partial[1], partial[2], pos); + stage_xbr2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[0], partial[1], partial[2]); /* second row */ - stage_xbr2x(stage_vert, dst[2], dst[3], partial[0], partial[0], partial[1], partial[2], partial[3], pos); + stage_xbr2x(stage_vert, dst[2], dst[3], partial[0], partial[0], partial[1], partial[2], partial[3]); /* central rows */ count -= 2; #pragma omp parallel for for (unsigned i = 2; i < count; ++i) { - stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2], pos); + stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2]); } unsigned i = count; /* before last row */ - stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1], pos); + stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1]); ++i; /* last row */ - stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i], pos); + stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i]); video_buffer_reset(mark); } @@ -2753,7 +2711,6 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -2771,10 +2728,6 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(3 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 3; ++i) { - final[i] = 0; - } } input[0] = src; @@ -2787,8 +2740,8 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[3]; @@ -2799,7 +2752,7 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru ++y; } - stage_scale3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1], -1); + stage_scale3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -2809,9 +2762,9 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2], pos); + stage_scale3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -2828,7 +2781,7 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru ++y; } - stage_scale3x(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_scale3x(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[3]; @@ -2838,10 +2791,10 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru } /* first row */ - stage_scale3x(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1], pos); + stage_scale3x(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -2854,12 +2807,12 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale3x(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2], pos); + stage_scale3x(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -2879,10 +2832,10 @@ static void video_stage_stretchy_scale3x(const struct video_pipeline_target_stru ++y; } - stage_scale3x(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_scale3x(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -2901,7 +2854,6 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -2919,10 +2871,6 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(3 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 3; ++i) { - final[i] = 0; - } } input[0] = src; @@ -2935,8 +2883,8 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[3]; @@ -2947,7 +2895,7 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru ++y; } - stage_scale3k(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1], -1); + stage_scale3k(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -2957,9 +2905,9 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale3k(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2], pos); + stage_scale3k(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -2976,7 +2924,7 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru ++y; } - stage_scale3k(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_scale3k(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[3]; @@ -2986,10 +2934,10 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru ++y; } - stage_scale3k(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1], pos); + stage_scale3k(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -3002,12 +2950,12 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale3k(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2], pos); + stage_scale3k(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -3027,10 +2975,10 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru ++y; } - stage_scale3k(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_scale3k(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -3050,7 +2998,6 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -3068,10 +3015,6 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(3 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 3; ++i) { - final[i] = 0; - } } input[0] = src; @@ -3084,8 +3027,8 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[3]; @@ -3096,7 +3039,7 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* ++y; } - stage_hq3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1], -1); + stage_hq3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -3106,9 +3049,9 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_hq3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2], pos); + stage_hq3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -3125,7 +3068,7 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* ++y; } - stage_hq3x(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_hq3x(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[3]; @@ -3135,10 +3078,10 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* ++y; } - stage_hq3x(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1], pos); + stage_hq3x(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -3151,12 +3094,12 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_hq3x(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2], pos); + stage_hq3x(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -3176,10 +3119,10 @@ static void video_stage_stretchy_hq3x(const struct video_pipeline_target_struct* ++y; } - stage_hq3x(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_hq3x(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -3200,7 +3143,6 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -3218,10 +3160,6 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct for (i = 0; i < 3; ++i) { final[i] = video_buffer_alloc(3 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 3; ++i) { - final[i] = 0; - } } input[0] = src; @@ -3238,10 +3176,10 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], -1); - partial[3] = video_pipeline_run_partial(partial[3], stage_begin, stage_pivot, 0, input[3], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); + partial[3] = video_pipeline_run_partial(partial[3], stage_begin, stage_pivot, 0, input[3]); if (stage_pivot == stage_end) { void* dst[3]; @@ -3252,7 +3190,7 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct ++y; } - stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[0], partial[1], partial[2], -1); + stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[0], partial[1], partial[2]); /* second row */ for (i = 0; i < 3; ++i) { @@ -3260,7 +3198,7 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct ++y; } - stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1], partial[2], partial[3], -1); + stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[1], partial[2], partial[3]); /* central rows */ count -= 4; @@ -3270,9 +3208,9 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct ++y; } - partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4], pos); + partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4]); - stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2], partial[3], partial[4], pos); + stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[1], partial[2], partial[3], partial[4]); tmp = partial[0]; partial[0] = partial[1]; @@ -3291,7 +3229,7 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct ++y; } - stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], -1); + stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1]); /* last row */ for (i = 0; i < 3; ++i) { @@ -3299,7 +3237,7 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct ++y; } - stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1], -1); + stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1]); } else { void* dst[3]; @@ -3309,10 +3247,10 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct ++y; } - stage_xbr3x(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[0], partial[1], partial[2], pos); + stage_xbr3x(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[0], partial[1], partial[2]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -3323,10 +3261,10 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct ++y; } - stage_xbr3x(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1], partial[2], partial[3], pos); + stage_xbr3x(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1], partial[2], partial[3]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -3339,12 +3277,12 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct ++y; } - partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4], pos); + partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4]); - stage_xbr3x(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2], partial[3], partial[4], pos); + stage_xbr3x(stage_vert, final[0], final[1], final[2], partial[0], partial[1], partial[2], partial[3], partial[4]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -3366,10 +3304,10 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct ++y; } - stage_xbr3x(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], pos); + stage_xbr3x(stage_vert, final[0], final[1], final[2], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -3380,10 +3318,10 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct ++y; } - stage_xbr3x(stage_vert, final[0], final[1], final[2], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1], pos); + stage_xbr3x(stage_vert, final[0], final[1], final[2], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1]); for (i = 0; i < 3; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 3; @@ -3404,7 +3342,6 @@ static void video_stage_stretchy_xbr3x_openmp(const struct video_pipeline_target unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; - unsigned pos = -1; unsigned bdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); unsigned sdw = stage_vert->sdw; void* buffer; @@ -3421,7 +3358,7 @@ static void video_stage_stretchy_xbr3x_openmp(const struct video_pipeline_target for (unsigned i = 0; i < count; ++i) { const uint8* prt = src + i * sdw; uint8* buf = buffer + i * bdw; - partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt, -1); + partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt); dst[i * 3] = target->line(target, y + i * 3) + x_off; dst[i * 3 + 1] = target->line(target, y + i * 3 + 1) + x_off; dst[i * 3 + 2] = target->line(target, y + i * 3 + 2) + x_off; @@ -3429,26 +3366,26 @@ static void video_stage_stretchy_xbr3x_openmp(const struct video_pipeline_target /* first row */ - stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[0], partial[1], partial[2], pos); + stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[0], partial[1], partial[2]); /* second row */ - stage_xbr3x(stage_vert, dst[3], dst[4], dst[5],partial[0], partial[0], partial[1], partial[2], partial[3], pos); + stage_xbr3x(stage_vert, dst[3], dst[4], dst[5],partial[0], partial[0], partial[1], partial[2], partial[3]); /* central rows */ count -= 2; #pragma omp parallel for for (unsigned i = 2; i < count; ++i) { - stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2], pos); + stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2]); } unsigned i = count; /* before last row */ - stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1], pos); + stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1]); ++i; /* last row */ - stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i], pos); + stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i]); video_buffer_reset(mark); } @@ -3465,7 +3402,6 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -3484,10 +3420,6 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(4 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 4; ++i) { - final[i] = 0; - } } input[0] = src; @@ -3509,7 +3441,7 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru } for (i = 0; i < 4; ++i) { - partial[i] = video_pipeline_run_partial(partial[i], stage_begin, stage_pivot, 0, input[i], -1); + partial[i] = video_pipeline_run_partial(partial[i], stage_begin, stage_pivot, 0, input[i]); } if (stage_pivot == stage_end) { @@ -3521,17 +3453,17 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru ++y; } - stage_scale4m(stage_vert, middle[-2 + 6], middle[-1 + 6], partial[0], partial[0], partial[1], pos); - stage_scale4m(stage_vert, middle[0], middle[1], partial[0], partial[1], partial[2], pos); - stage_scale4m(stage_vert, middle[2], middle[3], partial[1], partial[2], partial[3], pos); - stage_scale4x(stage_vert, dst[0], dst[1], dst[2], dst[3], middle[-2 + 6], middle[-2 + 6], middle[-1 + 6], middle[0], pos); + stage_scale4m(stage_vert, middle[-2 + 6], middle[-1 + 6], partial[0], partial[0], partial[1]); + stage_scale4m(stage_vert, middle[0], middle[1], partial[0], partial[1], partial[2]); + stage_scale4m(stage_vert, middle[2], middle[3], partial[1], partial[2], partial[3]); + stage_scale4x(stage_vert, dst[0], dst[1], dst[2], dst[3], middle[-2 + 6], middle[-2 + 6], middle[-1 + 6], middle[0]); for (i = 0; i < 4; ++i) { dst[i] = target->line(target, y) + x_off; ++y; } - stage_scale4x(stage_vert, dst[0], dst[1], dst[2], dst[3], middle[-1 + 6], middle[0], middle[1], middle[2], -1); + stage_scale4x(stage_vert, dst[0], dst[1], dst[2], dst[3], middle[-1 + 6], middle[0], middle[1], middle[2]); /* central rows */ count -= 4; @@ -3541,10 +3473,10 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru ++y; } - partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4], pos); + partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4]); - stage_scale4m(stage_vert, middle[4], middle[5], partial[2], partial[3], partial[4], pos); - stage_scale4x(stage_vert, dst[0], dst[1], dst[2], dst[3], middle[1], middle[2], middle[3], middle[4], pos); + stage_scale4m(stage_vert, middle[4], middle[5], partial[2], partial[3], partial[4]); + stage_scale4x(stage_vert, dst[0], dst[1], dst[2], dst[3], middle[1], middle[2], middle[3], middle[4]); tmp = partial[0]; partial[0] = partial[1]; @@ -3571,15 +3503,15 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru ++y; } - stage_scale4m(stage_vert, middle[4], middle[5], partial[2], partial[3], partial[3], pos); - stage_scale4x(stage_vert, dst[0], dst[1], dst[2], dst[3], middle[1], middle[2], middle[3], middle[4], pos); + stage_scale4m(stage_vert, middle[4], middle[5], partial[2], partial[3], partial[3]); + stage_scale4x(stage_vert, dst[0], dst[1], dst[2], dst[3], middle[1], middle[2], middle[3], middle[4]); for (i = 0; i < 4; ++i) { dst[i] = target->line(target, y) + x_off; ++y; } - stage_scale4x(stage_vert, dst[0], dst[1], dst[2], dst[3], middle[3], middle[4], middle[5], middle[5], -1); + stage_scale4x(stage_vert, dst[0], dst[1], dst[2], dst[3], middle[3], middle[4], middle[5], middle[5]); } else { void* dst[4]; @@ -3589,13 +3521,13 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru ++y; } - stage_scale4m(stage_vert, middle[-2 + 6], middle[-1 + 6], partial[0], partial[0], partial[1], pos); - stage_scale4m(stage_vert, middle[0], middle[1], partial[0], partial[1], partial[2], pos); - stage_scale4m(stage_vert, middle[2], middle[3], partial[1], partial[2], partial[3], pos); - stage_scale4x(stage_vert, final[0], final[1], final[2], final[3], middle[-2 + 6], middle[-2 + 6], middle[-1 + 6], middle[0], pos); + stage_scale4m(stage_vert, middle[-2 + 6], middle[-1 + 6], partial[0], partial[0], partial[1]); + stage_scale4m(stage_vert, middle[0], middle[1], partial[0], partial[1], partial[2]); + stage_scale4m(stage_vert, middle[2], middle[3], partial[1], partial[2], partial[3]); + stage_scale4x(stage_vert, final[0], final[1], final[2], final[3], middle[-2 + 6], middle[-2 + 6], middle[-1 + 6], middle[0]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -3605,10 +3537,10 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru ++y; } - stage_scale4x(stage_vert, final[0], final[1], final[2], final[3], middle[-1 + 6], middle[0], middle[1], middle[2], pos); + stage_scale4x(stage_vert, final[0], final[1], final[2], final[3], middle[-1 + 6], middle[0], middle[1], middle[2]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -3621,13 +3553,13 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru ++y; } - partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4], pos); + partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4]); - stage_scale4m(stage_vert, middle[4], middle[5], partial[2], partial[3], partial[4], pos); - stage_scale4x(stage_vert, final[0], final[1], final[2], final[3], middle[1], middle[2], middle[3], middle[4], pos); + stage_scale4m(stage_vert, middle[4], middle[5], partial[2], partial[3], partial[4]); + stage_scale4x(stage_vert, final[0], final[1], final[2], final[3], middle[1], middle[2], middle[3], middle[4]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -3657,11 +3589,11 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru ++y; } - stage_scale4m(stage_vert, middle[4], middle[5], partial[2], partial[3], partial[3], pos); - stage_scale4x(stage_vert, final[0], final[1], final[2], final[3], middle[1], middle[2], middle[3], middle[4], pos); + stage_scale4m(stage_vert, middle[4], middle[5], partial[2], partial[3], partial[3]); + stage_scale4x(stage_vert, final[0], final[1], final[2], final[3], middle[1], middle[2], middle[3], middle[4]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -3671,10 +3603,10 @@ static void video_stage_stretchy_scale4x(const struct video_pipeline_target_stru ++y; } - stage_scale4x(stage_vert, final[0], final[1], final[2], final[3], middle[3], middle[4], middle[5], middle[5], pos); + stage_scale4x(stage_vert, final[0], final[1], final[2], final[3], middle[3], middle[4], middle[5], middle[5]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -3693,7 +3625,6 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -3711,10 +3642,6 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(4 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 4; ++i) { - final[i] = 0; - } } input[0] = src; @@ -3727,8 +3654,8 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[4]; @@ -3739,7 +3666,7 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru ++y; } - stage_scale4k(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[1], -1); + stage_scale4k(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -3749,9 +3676,9 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale4k(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[1], partial[2], pos); + stage_scale4k(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -3768,7 +3695,7 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru ++y; } - stage_scale4k(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_scale4k(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[4]; @@ -3778,10 +3705,10 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru ++y; } - stage_scale4k(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[1], pos); + stage_scale4k(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[1]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -3794,12 +3721,12 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_scale4k(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[1], partial[2], pos); + stage_scale4k(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[1], partial[2]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -3819,10 +3746,10 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru ++y; } - stage_scale4k(stage_vert, final[0], final[1], final[2], final[3], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_scale4k(stage_vert, final[0], final[1], final[2], final[3], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -3842,7 +3769,6 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -3860,10 +3786,6 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(4 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 4; ++i) { - final[i] = 0; - } } input[0] = src; @@ -3876,8 +3798,8 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); if (stage_pivot == stage_end) { void* dst[4]; @@ -3888,7 +3810,7 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* ++y; } - stage_hq4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[1], -1); + stage_hq4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[1]); /* central rows */ count -= 2; @@ -3898,9 +3820,9 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_hq4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[1], partial[2], pos); + stage_hq4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[1], partial[2]); tmp = partial[0]; partial[0] = partial[1]; @@ -3917,7 +3839,7 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* ++y; } - stage_hq4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[1 - 1], partial[2 - 1], partial[2 - 1], -1); + stage_hq4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[1 - 1], partial[2 - 1], partial[2 - 1]); } else { void* dst[4]; @@ -3927,10 +3849,10 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* ++y; } - stage_hq4x(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[1], pos); + stage_hq4x(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[1]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -3943,12 +3865,12 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* ++y; } - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], pos); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); - stage_hq4x(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[1], partial[2], pos); + stage_hq4x(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[1], partial[2]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -3968,10 +3890,10 @@ static void video_stage_stretchy_hq4x(const struct video_pipeline_target_struct* ++y; } - stage_hq4x(stage_vert, final[0], final[1], final[2], final[3], partial[1 - 1], partial[2 - 1], partial[2 - 1], pos); + stage_hq4x(stage_vert, final[0], final[1], final[2], final[3], partial[1 - 1], partial[2 - 1], partial[2 - 1]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -3992,7 +3914,6 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; @@ -4010,10 +3931,6 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct for (i = 0; i < 4; ++i) { final[i] = video_buffer_alloc(4 * stage_pivot->sdx * stage_pivot->sbpp); } - } else { - for (i = 0; i < 4; ++i) { - final[i] = 0; - } } input[0] = src; @@ -4030,10 +3947,10 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct partial[i] = video_buffer_alloc(stage_vert->sdx * stage_vert->bpp); } - partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0], -1); - partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1], -1); - partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2], -1); - partial[3] = video_pipeline_run_partial(partial[3], stage_begin, stage_pivot, 0, input[3], -1); + partial[0] = video_pipeline_run_partial(partial[0], stage_begin, stage_pivot, 0, input[0]); + partial[1] = video_pipeline_run_partial(partial[1], stage_begin, stage_pivot, 0, input[1]); + partial[2] = video_pipeline_run_partial(partial[2], stage_begin, stage_pivot, 0, input[2]); + partial[3] = video_pipeline_run_partial(partial[3], stage_begin, stage_pivot, 0, input[3]); if (stage_pivot == stage_end) { void* dst[4]; @@ -4044,7 +3961,7 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct ++y; } - stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[0], partial[1], partial[2], -1); + stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[0], partial[1], partial[2]); /* second row */ for (i = 0; i < 4; ++i) { @@ -4052,7 +3969,7 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct ++y; } - stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[1], partial[2], partial[3], -1); + stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[1], partial[2], partial[3]); /* central rows */ count -= 4; @@ -4062,9 +3979,9 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct ++y; } - partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4], pos); + partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4]); - stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[1], partial[2], partial[3], partial[4], pos); + stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[1], partial[2], partial[3], partial[4]); tmp = partial[0]; partial[0] = partial[1]; @@ -4083,7 +4000,7 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct ++y; } - stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], -1); + stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1]); /* last row */ for (i = 0; i < 4; ++i) { @@ -4091,7 +4008,7 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct ++y; } - stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1], -1); + stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1]); } else { void* dst[4]; @@ -4101,10 +4018,10 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct ++y; } - stage_xbr4x(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[0], partial[1], partial[2], pos); + stage_xbr4x(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[0], partial[1], partial[2]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -4115,10 +4032,10 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct ++y; } - stage_xbr4x(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[1], partial[2], partial[3], pos); + stage_xbr4x(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[1], partial[2], partial[3]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -4131,12 +4048,12 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct ++y; } - partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4], pos); + partial[4] = video_pipeline_run_partial(partial[4], stage_begin, stage_pivot, 0, input[4]); - stage_xbr4x(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[1], partial[2], partial[3], partial[4], pos); + stage_xbr4x(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[1], partial[2], partial[3], partial[4]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -4158,10 +4075,10 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct ++y; } - stage_xbr4x(stage_vert, final[0], final[1], final[2], final[3], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], pos); + stage_xbr4x(stage_vert, final[0], final[1], final[2], final[3], partial[1 - 1], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -4172,10 +4089,10 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct ++y; } - stage_xbr4x(stage_vert, final[0], final[1], final[2], final[3], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1], pos); + stage_xbr4x(stage_vert, final[0], final[1], final[2], final[3], partial[2 - 1], partial[3 - 1], partial[4 - 1], partial[4 - 1], partial[4 - 1]); for (i = 0; i < 4; ++i) { - video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i], pos); + video_pipeline_run_plain(stage_pivot, stage_end, line + i, dst[i], final[i]); } line += 4; @@ -4196,7 +4113,6 @@ static void video_stage_stretchy_xbr4x_openmp(const struct video_pipeline_target unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; - unsigned pos = -1; unsigned bdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); unsigned sdw = stage_vert->sdw; void* buffer; @@ -4213,7 +4129,7 @@ static void video_stage_stretchy_xbr4x_openmp(const struct video_pipeline_target for (unsigned i = 0; i < count; ++i) { const uint8* prt = src + i * sdw; uint8* buf = buffer + i * bdw; - partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt, -1); + partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt); dst[i * 4] = target->line(target, y + i * 4) + x_off; dst[i * 4 + 1] = target->line(target, y + i * 4 + 1) + x_off; dst[i * 4 + 2] = target->line(target, y + i * 4 + 2) + x_off; @@ -4221,25 +4137,25 @@ static void video_stage_stretchy_xbr4x_openmp(const struct video_pipeline_target } /* first row */ - stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[0], partial[1], partial[2], pos); + stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[0], partial[1], partial[2]); /* second row */ - stage_xbr4x(stage_vert, dst[4], dst[5], dst[6], dst[7], partial[0], partial[0], partial[1], partial[2], partial[3], pos); + stage_xbr4x(stage_vert, dst[4], dst[5], dst[6], dst[7], partial[0], partial[0], partial[1], partial[2], partial[3]); /* central rows */ count -= 2; #pragma omp parallel for for (unsigned i = 2; i < count; ++i) { - stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2], pos); + stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2]); } unsigned i = count; /* before last row */ - stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1], pos); + stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1]); ++i; /* last row */ - stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i], pos); + stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i]); video_buffer_reset(mark); } @@ -4256,13 +4172,12 @@ static void video_stage_stretchy_11(const struct video_pipeline_target_struct* t unsigned x_off = x * target->bytes_per_pixel; unsigned count = stage_vert->sdy; unsigned line = 0; - unsigned pos = -1; while (count) { void* dst; dst = target->line(target, y) + x_off; - video_pipeline_run(stage_vert->stage_begin, stage_vert->stage_end, line++, dst, src, -1); + video_pipeline_run(stage_vert->stage_begin, stage_vert->stage_end, line++, dst, src); ++y; PADD(src, stage_vert->sdw); From e4aaea12e2fb45c0e0f06b37f23db64d0ba8200a Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 18 Mar 2024 21:35:38 +0100 Subject: [PATCH 28/46] Extend OpenMP support to ScaleK --- advance/blit/blit.c | 490 ++++++++++++++++++++++++++++++++++---------- configure.ac | 4 +- 2 files changed, 387 insertions(+), 107 deletions(-) diff --git a/advance/blit/blit.c b/advance/blit/blit.c index e9f5d520..539a48a5 100644 --- a/advance/blit/blit.c +++ b/advance/blit/blit.c @@ -222,7 +222,7 @@ static inline void internal_end(void) /* A very fast dynamic buffers allocations */ /* Total size of the buffers */ -#define FAST_BUFFER_SIZE (4 * 1024 * 1024) +#define FAST_BUFFER_SIZE (8 * 1024 * 1024) /* Align */ #define FAST_BUFFER_ALIGN 16 /* SSE2 requirement */ @@ -2021,6 +2021,75 @@ static void video_stage_stretchy_scale2k(const struct video_pipeline_target_stru video_buffer_reset(mark); } + +#ifdef _OPENMP +static void video_stage_stretchy_scale2k_openmp(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) +{ + const unsigned X = 2; + unsigned x_off = x * target->bytes_per_pixel; + int count = stage_vert->sdy; + const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; + const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; + const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; + unsigned pdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); + unsigned fdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp * X, FAST_BUFFER_ALIGN); + int sdw = stage_vert->sdw; + void* partial_buffer; + void** partial; + void* final_buffer; + void** final; + + void* mark = video_buffer_mark(); + + partial = video_buffer_alloc(sizeof(void*) * count); + final = video_buffer_alloc(sizeof(void*) * count * X); + partial_buffer = video_buffer_alloc(pdw * count); + if (stage_pivot != stage_end) + final_buffer = video_buffer_alloc(fdw * count * X); + else + final_buffer = 0; + + for (int i = 0; i < count; ++i) { + const uint8* src_ptr = src + i * sdw; + uint8* partial_ptr = partial_buffer + i * pdw; + partial[i] = video_pipeline_run_partial(partial_ptr, stage_begin, stage_pivot, 0, src_ptr); + if (stage_pivot == stage_end) { + final[i * X] = target->line(target, y + i * X) + x_off; + final[i * X + 1] = target->line(target, y + i * X + 1) + x_off; + } else { + final[i * X] = final_buffer + (i * X) * fdw; + final[i * X + 1] = final_buffer + (i * X + 1) * fdw; + } + } + + { + /* first row */ + stage_scale2k(stage_vert, final[0], final[1], partial[0], partial[0], partial[1]); + } + + /* central rows */ + #pragma omp parallel for + for (int i = 1; i < count - 1; ++i) { + stage_scale2k(stage_vert, final[i * X], final[i * X + 1], partial[i - 1], partial[i], partial[i + 1]); + } + + { + int i = count - 1; + + /* last row */ + stage_scale2k(stage_vert, final[i * X], final[i * X + 1], partial[i - 1], partial[i], partial[i]); + } + + if (stage_pivot != stage_end) { + for (int i = 0; i < count * X; ++i) { + uint8* dst = target->line(target, y + i) + x_off; + video_pipeline_run_plain(stage_pivot, stage_end, i, dst, final[i]); + } + } + + video_buffer_reset(mark); +} +#endif #endif /***************************************************************************/ @@ -2644,56 +2713,74 @@ static void video_stage_stretchy_xbr2x(const struct video_pipeline_target_struct #ifdef _OPENMP static void video_stage_stretchy_xbr2x_openmp(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) { + const unsigned X = 2; + unsigned x_off = x * target->bytes_per_pixel; + int count = stage_vert->sdy; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; - - if (stage_pivot != stage_end) - video_stage_stretchy_xbr2x(target, stage_vert, x, y, src); - - unsigned x_off = x * target->bytes_per_pixel; - unsigned count = stage_vert->sdy; - unsigned bdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); - unsigned sdw = stage_vert->sdw; - void* buffer; + unsigned pdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); + unsigned fdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp * X, FAST_BUFFER_ALIGN); + int sdw = stage_vert->sdw; + void* partial_buffer; void** partial; - void** dst; + void* final_buffer; + void** final; void* mark = video_buffer_mark(); - buffer = video_buffer_alloc(bdw * count); partial = video_buffer_alloc(sizeof(void*) * count); - dst = video_buffer_alloc(sizeof(void*) * count * 2); - - #pragma omp parallel for - for (unsigned i = 0; i < count; ++i) { - const uint8* prt = src + i * sdw; - uint8* buf = buffer + i * bdw; - partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt); - dst[i * 2] = target->line(target, y + i * 2) + x_off; - dst[i * 2 + 1] = target->line(target, y + i * 2 + 1) + x_off; + final = video_buffer_alloc(sizeof(void*) * count * X); + partial_buffer = video_buffer_alloc(pdw * count); + if (stage_pivot != stage_end) + final_buffer = video_buffer_alloc(fdw * count * X); + else + final_buffer = 0; + + for (int i = 0; i < count; ++i) { + const uint8* src_ptr = src + i * sdw; + uint8* partial_ptr = partial_buffer + i * pdw; + partial[i] = video_pipeline_run_partial(partial_ptr, stage_begin, stage_pivot, 0, src_ptr); + if (stage_pivot == stage_end) { + final[i * X] = target->line(target, y + i * X) + x_off; + final[i * X + 1] = target->line(target, y + i * X + 1) + x_off; + } else { + final[i * X] = final_buffer + (i * X) * fdw; + final[i * X + 1] = final_buffer + (i * X + 1) * fdw; + } } - /* first row */ - stage_xbr2x(stage_vert, dst[0], dst[1], partial[0], partial[0], partial[0], partial[1], partial[2]); + { + /* first row */ + stage_xbr2x(stage_vert, final[0], final[1], partial[0], partial[0], partial[0], partial[1], partial[2]); - /* second row */ - stage_xbr2x(stage_vert, dst[2], dst[3], partial[0], partial[0], partial[1], partial[2], partial[3]); + /* second row */ + stage_xbr2x(stage_vert, final[2], final[3], partial[0], partial[0], partial[1], partial[2], partial[3]); + } /* central rows */ - count -= 2; #pragma omp parallel for - for (unsigned i = 2; i < count; ++i) { - stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2]); + for (int i = 2; i < count - 2; ++i) { + stage_xbr2x(stage_vert, final[i * X], final[i * X + 1], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2]); } - unsigned i = count; - /* before last row */ - stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1]); - ++i; + { + int i = count - 2; + + /* before last row */ + stage_xbr2x(stage_vert, final[i * X], final[i * X + 1], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1]); + ++i; - /* last row */ - stage_xbr2x(stage_vert, dst[i * 2], dst[i * 2 + 1], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i]); + /* last row */ + stage_xbr2x(stage_vert, final[i * X], final[i * X + 1], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i]); + } + + if (stage_pivot != stage_end) { + for (int i = 0; i < count * X; ++i) { + uint8* dst = target->line(target, y + i) + x_off; + video_pipeline_run_plain(stage_pivot, stage_end, i, dst, final[i]); + } + } video_buffer_reset(mark); } @@ -2986,6 +3073,77 @@ static void video_stage_stretchy_scale3k(const struct video_pipeline_target_stru video_buffer_reset(mark); } + +#ifdef _OPENMP +static void video_stage_stretchy_scale3k_openmp(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) +{ + const unsigned X = 3; + unsigned x_off = x * target->bytes_per_pixel; + int count = stage_vert->sdy; + const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; + const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; + const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; + unsigned pdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); + unsigned fdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp * X, FAST_BUFFER_ALIGN); + int sdw = stage_vert->sdw; + void* partial_buffer; + void** partial; + void* final_buffer; + void** final; + + void* mark = video_buffer_mark(); + + partial = video_buffer_alloc(sizeof(void*) * count); + final = video_buffer_alloc(sizeof(void*) * count * X); + partial_buffer = video_buffer_alloc(pdw * count); + if (stage_pivot != stage_end) + final_buffer = video_buffer_alloc(fdw * count * X); + else + final_buffer = 0; + + for (int i = 0; i < count; ++i) { + const uint8* src_ptr = src + i * sdw; + uint8* partial_ptr = partial_buffer + i * pdw; + partial[i] = video_pipeline_run_partial(partial_ptr, stage_begin, stage_pivot, 0, src_ptr); + if (stage_pivot == stage_end) { + final[i * X] = target->line(target, y + i * X) + x_off; + final[i * X + 1] = target->line(target, y + i * X + 1) + x_off; + final[i * X + 2] = target->line(target, y + i * X + 2) + x_off; + } else { + final[i * X] = final_buffer + (i * X) * fdw; + final[i * X + 1] = final_buffer + (i * X + 1) * fdw; + final[i * X + 2] = final_buffer + (i * X + 2) * fdw; + } + } + + { + /* first row */ + stage_scale3k(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[1]); + } + + /* central rows */ + #pragma omp parallel for + for (int i = 1; i < count - 1; ++i) { + stage_scale3k(stage_vert, final[i * X], final[i * X + 1], final[i * X + 2], partial[i - 1], partial[i], partial[i + 1]); + } + + { + int i = count - 1; + + /* last row */ + stage_scale3k(stage_vert, final[i * X], final[i * X + 1], final[i * X + 2], partial[i - 1], partial[i], partial[i]); + } + + if (stage_pivot != stage_end) { + for (int i = 0; i < count * X; ++i) { + uint8* dst = target->line(target, y + i) + x_off; + video_pipeline_run_plain(stage_pivot, stage_end, i, dst, final[i]); + } + } + + video_buffer_reset(mark); +} +#endif #endif /***************************************************************************/ @@ -3333,59 +3491,76 @@ static void video_stage_stretchy_xbr3x(const struct video_pipeline_target_struct #ifdef _OPENMP static void video_stage_stretchy_xbr3x_openmp(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) { + const unsigned X = 3; + unsigned x_off = x * target->bytes_per_pixel; + int count = stage_vert->sdy; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; - - if (stage_pivot != stage_end) - video_stage_stretchy_xbr3x(target, stage_vert, x, y, src); - - unsigned x_off = x * target->bytes_per_pixel; - unsigned count = stage_vert->sdy; - unsigned bdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); - unsigned sdw = stage_vert->sdw; - void* buffer; + unsigned pdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); + unsigned fdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp * X, FAST_BUFFER_ALIGN); + int sdw = stage_vert->sdw; + void* partial_buffer; void** partial; - void** dst; + void* final_buffer; + void** final; void* mark = video_buffer_mark(); - buffer = video_buffer_alloc(bdw * count); partial = video_buffer_alloc(sizeof(void*) * count); - dst = video_buffer_alloc(sizeof(void*) * count * 3); - - #pragma omp parallel for - for (unsigned i = 0; i < count; ++i) { - const uint8* prt = src + i * sdw; - uint8* buf = buffer + i * bdw; - partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt); - dst[i * 3] = target->line(target, y + i * 3) + x_off; - dst[i * 3 + 1] = target->line(target, y + i * 3 + 1) + x_off; - dst[i * 3 + 2] = target->line(target, y + i * 3 + 2) + x_off; + final = video_buffer_alloc(sizeof(void*) * count * X); + partial_buffer = video_buffer_alloc(pdw * count); + if (stage_pivot != stage_end) + final_buffer = video_buffer_alloc(fdw * count * X); + else + final_buffer = 0; + + for (int i = 0; i < count; ++i) { + const uint8* src_ptr = src + i * sdw; + uint8* partial_ptr = partial_buffer + i * pdw; + partial[i] = video_pipeline_run_partial(partial_ptr, stage_begin, stage_pivot, 0, src_ptr); + if (stage_pivot == stage_end) { + final[i * X] = target->line(target, y + i * X) + x_off; + final[i * X + 1] = target->line(target, y + i * X + 1) + x_off; + final[i * X + 2] = target->line(target, y + i * X + 2) + x_off; + } else { + final[i * X] = final_buffer + (i * X) * fdw; + final[i * X + 1] = final_buffer + (i * X + 1) * fdw; + final[i * X + 2] = final_buffer + (i * X + 2) * fdw; + } } + { + /* first row */ + stage_xbr3x(stage_vert, final[0], final[1], final[2], partial[0], partial[0], partial[0], partial[1], partial[2]); - /* first row */ - stage_xbr3x(stage_vert, dst[0], dst[1], dst[2], partial[0], partial[0], partial[0], partial[1], partial[2]); - - /* second row */ - stage_xbr3x(stage_vert, dst[3], dst[4], dst[5],partial[0], partial[0], partial[1], partial[2], partial[3]); - + /* second row */ + stage_xbr3x(stage_vert, final[3], final[4], final[5], partial[0], partial[0], partial[1], partial[2], partial[3]); + } /* central rows */ - count -= 2; #pragma omp parallel for - for (unsigned i = 2; i < count; ++i) { - stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2]); + for (int i = 2; i < count - 2; ++i) { + stage_xbr3x(stage_vert, final[i * X], final[i * X + 1], final[i * X + 2], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2]); } - unsigned i = count; - /* before last row */ - stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1]); - ++i; + { + int i = count - 2; + + /* before last row */ + stage_xbr3x(stage_vert, final[i * X], final[i * X + 1], final[i * X + 2], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1]); + ++i; + + /* last row */ + stage_xbr3x(stage_vert, final[i * X], final[i * X + 1], final[i * X + 2], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i]); + } - /* last row */ - stage_xbr3x(stage_vert, dst[i * 3], dst[i * 3 + 1], dst[i * 3 + 2], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i]); + if (stage_pivot != stage_end) { + for (int i = 0; i < count * X; ++i) { + uint8* dst = target->line(target, y + i) + x_off; + video_pipeline_run_plain(stage_pivot, stage_end, i, dst, final[i]); + } + } video_buffer_reset(mark); } @@ -3757,6 +3932,79 @@ static void video_stage_stretchy_scale4k(const struct video_pipeline_target_stru video_buffer_reset(mark); } + +#ifdef _OPENMP +static void video_stage_stretchy_scale4k_openmp(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) +{ + const unsigned X = 4; + unsigned x_off = x * target->bytes_per_pixel; + int count = stage_vert->sdy; + const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; + const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; + const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; + unsigned pdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); + unsigned fdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp * X, FAST_BUFFER_ALIGN); + int sdw = stage_vert->sdw; + void* partial_buffer; + void** partial; + void* final_buffer; + void** final; + + void* mark = video_buffer_mark(); + + partial = video_buffer_alloc(sizeof(void*) * count); + final = video_buffer_alloc(sizeof(void*) * count * X); + partial_buffer = video_buffer_alloc(pdw * count); + if (stage_pivot != stage_end) + final_buffer = video_buffer_alloc(fdw * count * X); + else + final_buffer = 0; + + for (int i = 0; i < count; ++i) { + const uint8* src_ptr = src + i * sdw; + uint8* partial_ptr = partial_buffer + i * pdw; + partial[i] = video_pipeline_run_partial(partial_ptr, stage_begin, stage_pivot, 0, src_ptr); + if (stage_pivot == stage_end) { + final[i * X] = target->line(target, y + i * X) + x_off; + final[i * X + 1] = target->line(target, y + i * X + 1) + x_off; + final[i * X + 2] = target->line(target, y + i * X + 2) + x_off; + final[i * X + 3] = target->line(target, y + i * X + 3) + x_off; + } else { + final[i * X] = final_buffer + (i * X) * fdw; + final[i * X + 1] = final_buffer + (i * X + 1) * fdw; + final[i * X + 2] = final_buffer + (i * X + 2) * fdw; + final[i * X + 3] = final_buffer + (i * X + 3) * fdw; + } + } + + { + /* first row */ + stage_scale4k(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[1]); + } + + /* central rows */ + #pragma omp parallel for + for (int i = 1; i < count - 1; ++i) { + stage_scale4k(stage_vert, final[i * X], final[i * X + 1], final[i * X + 2], final[i * X + 3], partial[i - 1], partial[i], partial[i + 1]); + } + + { + int i = count - 1; + + /* last row */ + stage_scale4k(stage_vert, final[i * X], final[i * X + 1], final[i * X + 2], final[i * X + 3], partial[i - 1], partial[i], partial[i]); + } + + if (stage_pivot != stage_end) { + for (int i = 0; i < count * X; ++i) { + uint8* dst = target->line(target, y + i) + x_off; + video_pipeline_run_plain(stage_pivot, stage_end, i, dst, final[i]); + } + } + + video_buffer_reset(mark); +} +#endif #endif /***************************************************************************/ @@ -4104,58 +4352,78 @@ static void video_stage_stretchy_xbr4x(const struct video_pipeline_target_struct #ifdef _OPENMP static void video_stage_stretchy_xbr4x_openmp(const struct video_pipeline_target_struct* target, const struct video_stage_vert_struct* stage_vert, unsigned x, unsigned y, const void* src) { + const unsigned X = 4; + unsigned x_off = x * target->bytes_per_pixel; + int count = stage_vert->sdy; const struct video_stage_horz_struct* stage_begin = stage_vert->stage_begin; const struct video_stage_horz_struct* stage_end = stage_vert->stage_end; const struct video_stage_horz_struct* stage_pivot = stage_vert->stage_pivot; - - if (stage_pivot != stage_end) - video_stage_stretchy_xbr4x(target, stage_vert, x, y, src); - - unsigned x_off = x * target->bytes_per_pixel; - unsigned count = stage_vert->sdy; - unsigned bdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); - unsigned sdw = stage_vert->sdw; - void* buffer; + unsigned pdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp, FAST_BUFFER_ALIGN); + unsigned fdw = ALIGN_UNSIGNED(stage_vert->sdx * stage_vert->bpp * X, FAST_BUFFER_ALIGN); + int sdw = stage_vert->sdw; + void* partial_buffer; void** partial; - void** dst; + void* final_buffer; + void** final; void* mark = video_buffer_mark(); - buffer = video_buffer_alloc(bdw * count); partial = video_buffer_alloc(sizeof(void*) * count); - dst = video_buffer_alloc(sizeof(void*) * count * 4); - - #pragma omp parallel for - for (unsigned i = 0; i < count; ++i) { - const uint8* prt = src + i * sdw; - uint8* buf = buffer + i * bdw; - partial[i] = video_pipeline_run_partial(buf, stage_begin, stage_pivot, 0, prt); - dst[i * 4] = target->line(target, y + i * 4) + x_off; - dst[i * 4 + 1] = target->line(target, y + i * 4 + 1) + x_off; - dst[i * 4 + 2] = target->line(target, y + i * 4 + 2) + x_off; - dst[i * 4 + 3] = target->line(target, y + i * 4 + 3) + x_off; + final = video_buffer_alloc(sizeof(void*) * count * X); + partial_buffer = video_buffer_alloc(pdw * count); + if (stage_pivot != stage_end) + final_buffer = video_buffer_alloc(fdw * count * X); + else + final_buffer = 0; + + for (int i = 0; i < count; ++i) { + const uint8* src_ptr = src + i * sdw; + uint8* partial_ptr = partial_buffer + i * pdw; + partial[i] = video_pipeline_run_partial(partial_ptr, stage_begin, stage_pivot, 0, src_ptr); + if (stage_pivot == stage_end) { + final[i * X] = target->line(target, y + i * X) + x_off; + final[i * X + 1] = target->line(target, y + i * X + 1) + x_off; + final[i * X + 2] = target->line(target, y + i * X + 2) + x_off; + final[i * X + 3] = target->line(target, y + i * X + 3) + x_off; + } else { + final[i * X] = final_buffer + (i * X) * fdw; + final[i * X + 1] = final_buffer + (i * X + 1) * fdw; + final[i * X + 2] = final_buffer + (i * X + 2) * fdw; + final[i * X + 3] = final_buffer + (i * X + 3) * fdw; + } } - /* first row */ - stage_xbr4x(stage_vert, dst[0], dst[1], dst[2], dst[3], partial[0], partial[0], partial[0], partial[1], partial[2]); + { + /* first row */ + stage_xbr4x(stage_vert, final[0], final[1], final[2], final[3], partial[0], partial[0], partial[0], partial[1], partial[2]); - /* second row */ - stage_xbr4x(stage_vert, dst[4], dst[5], dst[6], dst[7], partial[0], partial[0], partial[1], partial[2], partial[3]); + /* second row */ + stage_xbr4x(stage_vert, final[4], final[5], final[6], final[7], partial[0], partial[0], partial[1], partial[2], partial[3]); + } /* central rows */ - count -= 2; #pragma omp parallel for - for (unsigned i = 2; i < count; ++i) { - stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2]); + for (int i = 2; i < count - 2; ++i) { + stage_xbr4x(stage_vert, final[i * X], final[i * X + 1], final[i * X + 2], final[i * X + 3], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 2]); } - unsigned i = count; - /* before last row */ - stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1]); - ++i; + { + int i = count - 2; + + /* before last row */ + stage_xbr4x(stage_vert, final[i * X], final[i * X + 1], final[i * X + 2], final[i * X + 3], partial[i - 2], partial[i - 1], partial[i], partial[i + 1], partial[i + 1]); + ++i; - /* last row */ - stage_xbr4x(stage_vert, dst[i * 4], dst[i * 4 + 1], dst[i * 4 + 2], dst[i * 4 + 3], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i]); + /* last row */ + stage_xbr4x(stage_vert, final[i * X], final[i * X + 1], final[i * X + 2], final[i * X + 3], partial[i - 2], partial[i - 1], partial[i], partial[i], partial[i]); + } + + if (stage_pivot != stage_end) { + for (int i = 0; i < count * X; ++i) { + uint8* dst = target->line(target, y + i) + x_off; + video_pipeline_run_plain(stage_pivot, stage_end, i, dst, final[i]); + } + } video_buffer_reset(mark); } @@ -4266,7 +4534,11 @@ static void video_stage_stretchy_set(const struct video_pipeline_target_struct* slice_set(&stage_vert->slice, sdy, ddy); video_stage_pivot_late_set(stage_vert, combine); +#ifdef _OPENMP + stage_vert->put = video_stage_stretchy_scale2k_openmp; +#else stage_vert->put = video_stage_stretchy_scale2k; +#endif stage_vert->type = pipe_y_scale2k; #ifndef USE_BLIT_SMALL } else if (ddx == 2 * sdx && ddy == 2 * sdy && combine_y == VIDEO_COMBINE_Y_HQ) { @@ -4314,7 +4586,11 @@ static void video_stage_stretchy_set(const struct video_pipeline_target_struct* slice_set(&stage_vert->slice, sdy, ddy); video_stage_pivot_late_set(stage_vert, combine); +#ifdef _OPENMP + stage_vert->put = video_stage_stretchy_scale3k_openmp; +#else stage_vert->put = video_stage_stretchy_scale3k; +#endif stage_vert->type = pipe_y_scale3k; #ifndef USE_BLIT_SMALL } else if (ddx == 3 * sdx && ddy == 3 * sdy && combine_y == VIDEO_COMBINE_Y_HQ) { @@ -4348,7 +4624,11 @@ static void video_stage_stretchy_set(const struct video_pipeline_target_struct* slice_set(&stage_vert->slice, sdy, ddy); video_stage_pivot_late_set(stage_vert, combine); +#ifdef _OPENMP + stage_vert->put = video_stage_stretchy_scale4k_openmp; +#else stage_vert->put = video_stage_stretchy_scale4k; +#endif stage_vert->type = pipe_y_scale4k; #ifndef USE_BLIT_SMALL } else if (ddx == 4 * sdx && ddy == 4 * sdy && combine_y == VIDEO_COMBINE_Y_HQ) { diff --git a/configure.ac b/configure.ac index 5a9c92a1..e2c4056d 100644 --- a/configure.ac +++ b/configure.ac @@ -163,9 +163,9 @@ AC_ARG_ENABLE( if test $ac_auto_cflags = yes; then if test $ac_enable_perf = yes ; then - CFLAGS="-O1 -pg -Wall -Wno-sign-compare -Wno-unused" + CFLAGS="-O1 -pg -Wall -Wno-sign-compare -Wno-unused -Wno-format-truncation" elif test $ac_enable_debug = yes ; then - CFLAGS="-O0 -g -Wall -Wno-sign-compare -Wno-unused" + CFLAGS="-O0 -g -Wall -Wno-sign-compare -Wno-unused -Wno-format-truncation" else CFLAGS="" dnl O3 generally gives better performance than O2 in both Intel and ARM From e1f60f2f480b86a9c96364eb7e6e82471df0051d Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 18 Mar 2024 21:56:30 +0100 Subject: [PATCH 29/46] Disable OpenMP for ScaleK on ARM --- advance/blit/blit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/advance/blit/blit.c b/advance/blit/blit.c index 539a48a5..1c561587 100644 --- a/advance/blit/blit.c +++ b/advance/blit/blit.c @@ -4534,7 +4534,7 @@ static void video_stage_stretchy_set(const struct video_pipeline_target_struct* slice_set(&stage_vert->slice, sdy, ddy); video_stage_pivot_late_set(stage_vert, combine); -#ifdef _OPENMP +#if defined(_OPENMP) && (defined(__i386__) || defined(__x86_64__)) /* on ARM OpenMP is slower */ stage_vert->put = video_stage_stretchy_scale2k_openmp; #else stage_vert->put = video_stage_stretchy_scale2k; @@ -4586,7 +4586,7 @@ static void video_stage_stretchy_set(const struct video_pipeline_target_struct* slice_set(&stage_vert->slice, sdy, ddy); video_stage_pivot_late_set(stage_vert, combine); -#ifdef _OPENMP +#if defined(_OPENMP) && (defined(__i386__) || defined(__x86_64__)) /* on ARM OpenMP is slower */ stage_vert->put = video_stage_stretchy_scale3k_openmp; #else stage_vert->put = video_stage_stretchy_scale3k; @@ -4624,7 +4624,7 @@ static void video_stage_stretchy_set(const struct video_pipeline_target_struct* slice_set(&stage_vert->slice, sdy, ddy); video_stage_pivot_late_set(stage_vert, combine); -#ifdef _OPENMP +#if defined(_OPENMP) && (defined(__i386__) || defined(__x86_64__)) /* on ARM OpenMP is slower */ stage_vert->put = video_stage_stretchy_scale4k_openmp; #else stage_vert->put = video_stage_stretchy_scale4k; From eccdfd8a459b5400e3b0e6472355aa77d681546b Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 19 Mar 2024 20:47:38 +0100 Subject: [PATCH 30/46] Remove the auto selection of buffered vs direct write The measure it's not always reliable and in modern video board the direct one is always the best option. No need to select at runtime. --- advance/osd/emu.h | 10 +---- advance/osd/frame.c | 100 ++++++++++---------------------------------- advance/osd/menu.c | 42 +++++-------------- advance/osd/video.c | 11 +++-- doc/advmame.d | 10 +++++ 5 files changed, 52 insertions(+), 121 deletions(-) diff --git a/advance/osd/emu.h b/advance/osd/emu.h index cfe4cb23..7d0446ef 100644 --- a/advance/osd/emu.h +++ b/advance/osd/emu.h @@ -679,6 +679,7 @@ struct advance_video_config_context { unsigned game_orientation; /**< Game orientation mask. Mask of ORIENTATION_*. */ int combine; /**< Combine effect. Mask of COMBINE_*. */ int combine_max; /**< Maximum combine effect. Always starting with COMBINE_XBR and then decreasing at runtime. */ + int combine_write; /**< Combine write effect */ int rgb_effect; /**< Special additional effect. Mask of EFFECT_*. */ int interlace_effect; /**< Special additional interlace effect. Mask of EFFECT_*. */ double turbo_speed_factor; /**< Speed of the turbo function. Multiplicative factor. */ @@ -720,7 +721,6 @@ struct advance_video_config_context { #define AUDIOVIDEO_MEASURE_MAX 17 #define PIPELINE_MEASURE_MAX 13 -#define PIPELINE_BLIT_MAX 2 /**< Number of pipelines to create. 0 for buffered, 1 for direct write. */ /** State for the video part. */ struct advance_video_state_context { @@ -847,7 +847,7 @@ struct advance_video_state_context { int blit_src_dw; /**< Source row step of the game bitmap. */ int blit_src_offset; /**< Pointer at the first pixel of the game bitmap. */ adv_bool blit_pipeline_flag; /**< !=0 if blit_pipeline is computed. */ - struct video_pipeline_struct blit_pipeline[PIPELINE_BLIT_MAX]; /**< Put pipeline to video. */ + struct video_pipeline_struct blit_pipeline; /**< Put pipeline to video. */ unsigned blit_pipeline_index; /**< Pipeline to use. */ /* Buffer info */ @@ -877,12 +877,6 @@ struct advance_video_state_context { /** Basic increment of number of pixel for mantaining the alignement. */ unsigned game_visible_pos_x_increment; - adv_bool pipeline_measure_flag; /**< !=0 if the time measure is active. */ - double pipeline_measure_map[PIPELINE_BLIT_MAX][PIPELINE_MEASURE_MAX]; /**< Single measure. */ - double pipeline_measure_result[PIPELINE_BLIT_MAX]; /**< Selected measure. */ - unsigned pipeline_measure_i; - unsigned pipeline_measure_j; - double pipeline_timing_map[PIPELINE_MEASURE_MAX]; /**< Continuous measure of pipeline timing. */ unsigned pipeline_timing_i; /**< Index of the measure. */ double pipeline_timing_max; /**< Maximum time used to pipeline. */ diff --git a/advance/osd/frame.c b/advance/osd/frame.c index 4ad4f9ef..feab71fa 100644 --- a/advance/osd/frame.c +++ b/advance/osd/frame.c @@ -1527,14 +1527,6 @@ static void video_buffer_clear(struct advance_video_context* context) } } -static unsigned pipeline_combine(unsigned p) -{ - if (p == 0) - return VIDEO_COMBINE_BUFFER; - else - return 0; -} - static void video_recompute_pipeline(struct advance_video_context* context, const struct osd_bitmap* bitmap) { unsigned combine; @@ -1709,12 +1701,11 @@ static void video_recompute_pipeline(struct advance_video_context* context, cons } combine_buffer = combine; - combine_video = combine; + combine_video = combine | context->config.combine_write; free(context->state.buffer_ptr_alloc); - for (p = 0; p < PIPELINE_BLIT_MAX; ++p) - video_pipeline_init(&context->state.blit_pipeline[p]); + video_pipeline_init(&context->state.blit_pipeline); video_pipeline_init(&context->state.buffer_pipeline_video); context->state.blit_pipeline_flag = 1; @@ -1733,20 +1724,17 @@ static void video_recompute_pipeline(struct advance_video_context* context, cons video_pipeline_target(&context->state.buffer_pipeline_video, context->state.buffer_ptr, context->state.buffer_bytes_per_scanline, context->state.buffer_def); if (context->state.game_rgb_flag) { - for (p = 0; p < PIPELINE_BLIT_MAX; ++p) - video_pipeline_direct(&context->state.blit_pipeline[p], context->state.mode_visible_size_x, context->state.mode_visible_size_y, context->state.game_visible_size_x, context->state.game_visible_size_y, context->state.blit_src_dw, context->state.blit_src_dp, context->state.game_color_def, combine_video | pipeline_combine(p)); + video_pipeline_direct(&context->state.blit_pipeline, context->state.mode_visible_size_x, context->state.mode_visible_size_y, context->state.game_visible_size_x, context->state.game_visible_size_y, context->state.blit_src_dw, context->state.blit_src_dp, context->state.game_color_def, combine_video); video_pipeline_direct(&context->state.buffer_pipeline_video, intermediate_mode_visible_size_x, intermediate_mode_visible_size_y, intermediate_game_visible_size_x, intermediate_game_visible_size_y, context->state.buffer_src_dw, context->state.buffer_src_dp, context->state.game_color_def, combine_buffer); } else { if (context->state.mode_index == MODE_FLAGS_INDEX_PALETTE8) { assert(context->state.game_bytes_per_pixel == 2); - for (p = 0; p < PIPELINE_BLIT_MAX; ++p) - video_pipeline_palette16hw(&context->state.blit_pipeline[p], context->state.mode_visible_size_x, context->state.mode_visible_size_y, context->state.game_visible_size_x, context->state.game_visible_size_y, context->state.blit_src_dw, context->state.blit_src_dp, combine_video | pipeline_combine(p)); + video_pipeline_palette16hw(&context->state.blit_pipeline, context->state.mode_visible_size_x, context->state.mode_visible_size_y, context->state.game_visible_size_x, context->state.game_visible_size_y, context->state.blit_src_dw, context->state.blit_src_dp, combine_video); video_pipeline_palette16hw(&context->state.buffer_pipeline_video, intermediate_mode_visible_size_x, intermediate_mode_visible_size_y, intermediate_game_visible_size_x, intermediate_game_visible_size_y, context->state.buffer_src_dw, context->state.buffer_src_dp, combine_buffer); } else { switch (context->state.game_bytes_per_pixel) { case 1: - for (p = 0; p < PIPELINE_BLIT_MAX; ++p) - video_pipeline_palette8(&context->state.blit_pipeline[p], context->state.mode_visible_size_x, context->state.mode_visible_size_y, context->state.game_visible_size_x, context->state.game_visible_size_y, context->state.blit_src_dw, context->state.blit_src_dp, context->state.palette_index8_map, context->state.palette_index16_map, context->state.palette_index32_map, combine_video | pipeline_combine(p)); + video_pipeline_palette8(&context->state.blit_pipeline, context->state.mode_visible_size_x, context->state.mode_visible_size_y, context->state.game_visible_size_x, context->state.game_visible_size_y, context->state.blit_src_dw, context->state.blit_src_dp, context->state.palette_index8_map, context->state.palette_index16_map, context->state.palette_index32_map, combine_video); /* use the alternate palette only if required */ if (context->state.buffer_def != video_color_def()) video_pipeline_palette8(&context->state.buffer_pipeline_video, intermediate_mode_visible_size_x, intermediate_mode_visible_size_y, intermediate_game_visible_size_x, intermediate_game_visible_size_y, context->state.buffer_src_dw, context->state.buffer_src_dp, context->state.buffer_index8_map, context->state.buffer_index16_map, context->state.buffer_index32_map, combine_buffer); @@ -1754,8 +1742,7 @@ static void video_recompute_pipeline(struct advance_video_context* context, cons video_pipeline_palette8(&context->state.buffer_pipeline_video, intermediate_mode_visible_size_x, intermediate_mode_visible_size_y, intermediate_game_visible_size_x, intermediate_game_visible_size_y, context->state.buffer_src_dw, context->state.buffer_src_dp, context->state.palette_index8_map, context->state.palette_index16_map, context->state.palette_index32_map, combine_buffer); break; case 2: - for (p = 0; p < PIPELINE_BLIT_MAX; ++p) - video_pipeline_palette16(&context->state.blit_pipeline[p], context->state.mode_visible_size_x, context->state.mode_visible_size_y, context->state.game_visible_size_x, context->state.game_visible_size_y, context->state.blit_src_dw, context->state.blit_src_dp, context->state.palette_index8_map, context->state.palette_index16_map, context->state.palette_index32_map, combine_video | pipeline_combine(p)); + video_pipeline_palette16(&context->state.blit_pipeline, context->state.mode_visible_size_x, context->state.mode_visible_size_y, context->state.game_visible_size_x, context->state.game_visible_size_y, context->state.blit_src_dw, context->state.blit_src_dp, context->state.palette_index8_map, context->state.palette_index16_map, context->state.palette_index32_map, combine_video); /* use the alternate palette only if required */ if (context->state.buffer_def != video_color_def()) video_pipeline_palette16(&context->state.buffer_pipeline_video, intermediate_mode_visible_size_x, intermediate_mode_visible_size_y, intermediate_game_visible_size_x, intermediate_game_visible_size_y, context->state.buffer_src_dw, context->state.buffer_src_dp, context->state.buffer_index8_map, context->state.buffer_index16_map, context->state.buffer_index32_map, combine_buffer); @@ -1777,25 +1764,23 @@ static void video_recompute_pipeline(struct advance_video_context* context, cons log_std(("emu:video: pipeline scale from %dx%d to %dx%d\n", context->state.game_visible_size_x, context->state.game_visible_size_y, context->state.mode_visible_size_x, context->state.mode_visible_size_y)); - for (p = 0; p < PIPELINE_BLIT_MAX; ++p) { - log_std(("emu:video: pipeline_video %d\n", p)); - for (i = 1, stage = video_pipeline_begin(&context->state.blit_pipeline[p]); stage != video_pipeline_end(&context->state.blit_pipeline[p]); ++stage, ++i) { - if (stage == video_pipeline_pivot(&context->state.blit_pipeline[p])) { - snprintf(buffer, sizeof(buffer), "(%d) %s", i, pipe_name(video_pipeline_vert(&context->state.blit_pipeline[p])->type)); - ++i; - log_std(("emu:video: %s\n", buffer)); - } - if (stage->sbpp != stage->sdp) - snprintf(buffer, sizeof(buffer), "(%d) %s, p %d, dp %d", i, pipe_name(stage->type), stage->sbpp, stage->sdp); - else - snprintf(buffer, sizeof(buffer), "(%d) %s, p %d", i, pipe_name(stage->type), stage->sbpp); - log_std(("emu:video: %s\n", buffer)); - } - if (stage == video_pipeline_pivot(&context->state.blit_pipeline[p])) { - snprintf(buffer, sizeof(buffer), "(%d) %s", i, pipe_name(video_pipeline_vert(&context->state.blit_pipeline[p])->type)); + log_std(("emu:video: pipeline_video\n")); + for (i = 1, stage = video_pipeline_begin(&context->state.blit_pipeline); stage != video_pipeline_end(&context->state.blit_pipeline); ++stage, ++i) { + if (stage == video_pipeline_pivot(&context->state.blit_pipeline)) { + snprintf(buffer, sizeof(buffer), "(%d) %s", i, pipe_name(video_pipeline_vert(&context->state.blit_pipeline)->type)); ++i; log_std(("emu:video: %s\n", buffer)); } + if (stage->sbpp != stage->sdp) + snprintf(buffer, sizeof(buffer), "(%d) %s, p %d, dp %d", i, pipe_name(stage->type), stage->sbpp, stage->sdp); + else + snprintf(buffer, sizeof(buffer), "(%d) %s, p %d", i, pipe_name(stage->type), stage->sbpp); + log_std(("emu:video: %s\n", buffer)); + } + if (stage == video_pipeline_pivot(&context->state.blit_pipeline)) { + snprintf(buffer, sizeof(buffer), "(%d) %s", i, pipe_name(video_pipeline_vert(&context->state.blit_pipeline)->type)); + ++i; + log_std(("emu:video: %s\n", buffer)); } log_std(("emu:video: pipeline_buffer\n")); @@ -1817,12 +1802,6 @@ static void video_recompute_pipeline(struct advance_video_context* context, cons log_std(("emu:video: %s\n", buffer)); } } - - /* initialize the pipepeline measure */ - context->state.pipeline_measure_flag = 1; - context->state.pipeline_measure_i = 0; - context->state.pipeline_measure_j = 0; - context->state.blit_pipeline_index = 0; } static void video_frame_put(struct advance_video_context* context, struct advance_ui_context* ui_context, const struct osd_bitmap* bitmap, unsigned x, unsigned y) @@ -1962,7 +1941,7 @@ static void video_frame_put(struct advance_video_context* context, struct advanc src_offset = context->state.blit_src_offset + context->state.game_visible_pos_y * context->state.blit_src_dw + context->state.game_visible_pos_x * context->state.blit_src_dp; /* blit directly on the video */ - video_pipeline_blit(&context->state.blit_pipeline[context->state.blit_pipeline_index], dst_x + x, dst_y + y, (unsigned char*)bitmap->ptr + src_offset); + video_pipeline_blit(&context->state.blit_pipeline, dst_x + x, dst_y + y, (unsigned char*)bitmap->ptr + src_offset); } /* no buffering is used */ @@ -1970,43 +1949,6 @@ static void video_frame_put(struct advance_video_context* context, struct advanc /* end measure */ stop = target_clock() - start; - /* if we are in estimation phase */ - if (context->state.pipeline_measure_flag) { - - context->state.pipeline_measure_map[context->state.pipeline_measure_i][context->state.pipeline_measure_j] = stop; - ++context->state.pipeline_measure_i; - - if (context->state.pipeline_measure_i == PIPELINE_BLIT_MAX) { - context->state.pipeline_measure_i = 0; - ++context->state.pipeline_measure_j; - - if (context->state.pipeline_measure_j == PIPELINE_MEASURE_MAX) { - unsigned i; - - for (i = 0; i < PIPELINE_BLIT_MAX; ++i) { - context->state.pipeline_measure_result[i] = adv_measure_median(0.00001, 0.5, context->state.pipeline_measure_map[i], PIPELINE_MEASURE_MAX); - log_std(("emu:video: pipeline %d -> time %g\n", i, context->state.pipeline_measure_result[i])); - } - - context->state.pipeline_measure_i = 0; - - /* The first one is selected, then next one is selected only if a 3% gain is measured */ - for (i = 1; i < PIPELINE_BLIT_MAX; ++i) { - if (context->state.pipeline_measure_result[i] < 0.97 * context->state.pipeline_measure_result[context->state.pipeline_measure_i]) { - context->state.pipeline_measure_i = i; - } - } - - log_std(("emu:video: best is %d\n", context->state.pipeline_measure_i)); - - /* end the measure process */ - context->state.pipeline_measure_flag = 0; - } - } - - context->state.blit_pipeline_index = context->state.pipeline_measure_i; - } - context->state.pipeline_timing_map[context->state.pipeline_timing_i] = stop; ++context->state.pipeline_timing_i; diff --git a/advance/osd/menu.c b/advance/osd/menu.c index e07d1fe4..1e51cd52 100644 --- a/advance/osd/menu.c +++ b/advance/osd/menu.c @@ -128,9 +128,9 @@ static int video_pipeline_menu(struct advance_video_context* context, struct adv snprintf(buffer, sizeof(buffer), "Video Pipeline (%d)", context->state.blit_pipeline_index); advance_ui_menu_title_insert(&menu, buffer); - for (i = 1, stage = video_pipeline_begin(&context->state.blit_pipeline[context->state.blit_pipeline_index]); stage != video_pipeline_end(&context->state.blit_pipeline[context->state.blit_pipeline_index]); ++stage, ++i) { - if (stage == video_pipeline_pivot(&context->state.blit_pipeline[context->state.blit_pipeline_index])) { - snprintf(buffer, sizeof(buffer), "(%d) %s", i, pipe_name(video_pipeline_vert(&context->state.blit_pipeline[context->state.blit_pipeline_index])->type)); + for (i = 1, stage = video_pipeline_begin(&context->state.blit_pipeline); stage != video_pipeline_end(&context->state.blit_pipeline); ++stage, ++i) { + if (stage == video_pipeline_pivot(&context->state.blit_pipeline)) { + snprintf(buffer, sizeof(buffer), "(%d) %s", i, pipe_name(video_pipeline_vert(&context->state.blit_pipeline)->type)); advance_ui_menu_text_insert(&menu, buffer); ++i; } @@ -140,41 +140,21 @@ static int video_pipeline_menu(struct advance_video_context* context, struct adv snprintf(buffer, sizeof(buffer), "(%d) %s, p %d", i, pipe_name(stage->type), stage->sbpp); advance_ui_menu_text_insert(&menu, buffer); } - if (stage == video_pipeline_pivot(&context->state.blit_pipeline[context->state.blit_pipeline_index])) { - snprintf(buffer, sizeof(buffer), "(%d) %s", i, pipe_name(video_pipeline_vert(&context->state.blit_pipeline[context->state.blit_pipeline_index])->type)); + if (stage == video_pipeline_pivot(&context->state.blit_pipeline)) { + snprintf(buffer, sizeof(buffer), "(%d) %s", i, pipe_name(video_pipeline_vert(&context->state.blit_pipeline)->type)); advance_ui_menu_text_insert(&menu, buffer); ++i; } advance_ui_menu_title_insert(&menu, "Pipeline Blit Time"); - if (context->state.pipeline_measure_flag) { - advance_ui_menu_text_insert(&menu, "Time measure not completed"); - } else { - double timing = adv_measure_median(0.00001, 0.5, context->state.update_timing_map, PIPELINE_MEASURE_MAX); - snprintf(buffer, sizeof(buffer), "Last render %.2f (ms)", timing * 1000); - advance_ui_menu_text_insert(&menu, buffer); - - timing = adv_measure_median(0.00001, 0.5, context->state.pipeline_timing_map, PIPELINE_MEASURE_MAX); - snprintf(buffer, sizeof(buffer), "Last write %.2f (ms)", timing * 1000); - advance_ui_menu_text_insert(&menu, buffer); + double timing = adv_measure_median(0.00001, 0.5, context->state.update_timing_map, PIPELINE_MEASURE_MAX); + snprintf(buffer, sizeof(buffer), "Last render %.2f (ms)", timing * 1000); + advance_ui_menu_text_insert(&menu, buffer); - for (i = 0; i < PIPELINE_BLIT_MAX; ++i) { - const char* desc; - const char* select; - if (context->state.blit_pipeline_index == i) - select = "-> "; - else - select = ""; - switch (i) { - case 0: desc = "Buffer"; break; - case 1: desc = "Direct"; break; - default: desc = "Unknown"; break; - } - snprintf(buffer, sizeof(buffer), "%s%s write %.2f (ms)", select, desc, context->state.pipeline_measure_result[i] * 1000); - advance_ui_menu_text_insert(&menu, buffer); - } - } + timing = adv_measure_median(0.00001, 0.5, context->state.pipeline_timing_map, PIPELINE_MEASURE_MAX); + snprintf(buffer, sizeof(buffer), "Last write %.2f (ms)", timing * 1000); + advance_ui_menu_text_insert(&menu, buffer); exit_index = advance_ui_menu_text_insert(&menu, "Return to Main Menu"); diff --git a/advance/osd/video.c b/advance/osd/video.c index 8c19b0e6..23ea59be 100644 --- a/advance/osd/video.c +++ b/advance/osd/video.c @@ -815,10 +815,8 @@ static void video_done_pipeline(struct advance_video_context* context) { /* destroy the pipeline */ if (context->state.blit_pipeline_flag) { - unsigned i; video_pipeline_done(&context->state.buffer_pipeline_video); - for (i = 0; i < PIPELINE_BLIT_MAX; ++i) - video_pipeline_done(&context->state.blit_pipeline[PIPELINE_BLIT_MAX - 1 - i]); + video_pipeline_done(&context->state.blit_pipeline); context->state.blit_pipeline_flag = 0; } @@ -1705,6 +1703,11 @@ static adv_conf_enum_int OPTION_INTERLACEEFFECT[] = { { "filter", EFFECT_INTERLACE_FILTER } }; +static adv_conf_enum_int OPTION_WRITEEFFECT[] = { + { "direct", 0 }, + { "buffer", VIDEO_COMBINE_BUFFER }, +}; + static adv_conf_enum_int OPTION_INDEX[] = { { "auto", MODE_FLAGS_INDEX_NONE }, { "palette8", MODE_FLAGS_INDEX_PALETTE8 }, @@ -1742,6 +1745,7 @@ adv_error advance_video_init(struct advance_video_context* context, adv_conf* cf conf_int_register_enum_default(cfg_context, "display_resizeeffect", conf_enum(OPTION_RESIZEEFFECT), COMBINE_AUTO); conf_int_register_enum_default(cfg_context, "display_rgbeffect", conf_enum(OPTION_RGBEFFECT), EFFECT_NONE); conf_int_register_enum_default(cfg_context, "display_interlaceeffect", conf_enum(OPTION_INTERLACEEFFECT), EFFECT_NONE); + conf_int_register_enum_default(cfg_context, "display_writeeffect", conf_enum(OPTION_WRITEEFFECT), COMBINE_NONE); conf_string_register_default(cfg_context, "sync_fps", "auto"); conf_float_register_limit_default(cfg_context, "sync_speed", 0.1, 10.0, 1.0); conf_float_register_limit_default(cfg_context, "sync_turbospeed", 0.1, 30.0, 3.0); @@ -2033,6 +2037,7 @@ adv_error advance_video_config_load(struct advance_video_context* context, adv_c log_std(("emu:video: orientation ui %04x\n", option->ui_orientation)); context->config.combine = conf_int_get_default(cfg_context, "display_resizeeffect"); + context->config.combine_write = conf_int_get_default(cfg_context, "display_writeeffect"); context->config.combine_max = COMBINE_XBR; context->config.rgb_effect = conf_int_get_default(cfg_context, "display_rgbeffect"); context->config.interlace_effect = conf_int_get_default(cfg_context, "display_interlaceeffect"); diff --git a/doc/advmame.d b/doc/advmame.d index f3aabcd8..feda9774 100644 --- a/doc/advmame.d +++ b/doc/advmame.d @@ -1148,6 +1148,16 @@ Configuration : G E G G+F : H H F H+G + display_writeeffect + Selects how to write the video memory. In some very old video board + you may gain speed selecting `buffer'. + + :display_writeeffect direct | buffer + + Options: + direct - Write directly the video memory (default). + even - Use a buffered write. + Display Color Configuration Options This section describes the options used to customize the display color adjustments. From db82f91cd2ad263727e47a1215616ea21235324e Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 20 Mar 2024 18:07:07 +0100 Subject: [PATCH 31/46] Detect the VideoCore also in /usr --- configure.ac | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e2c4056d..a2329dfc 100644 --- a/configure.ac +++ b/configure.ac @@ -549,11 +549,16 @@ fi AC_SUBST([CONF_LIB_FB],[$ac_lib_fb]) dnl Checks for Raspberry Pi VideoCore +if test -d /opt/vc; then + ac_lib_vc_prefix_default="/opt/vc" +else + ac_lib_vc_prefix_default="/usr" +fi AC_ARG_WITH( [vc-prefix], AC_HELP_STRING([--with-vc-prefix=DIR],[Prefix where the Raspberry Pi VideoCore is installed (optional)]), [ac_lib_vc_prefix="$withval"], - [ac_lib_vc_prefix="/opt/vc"] + [ac_lib_vc_prefix="$ac_lib_vc_prefix_default"] ) AC_ARG_ENABLE( [vc], From eceb7b316f2faf3731f9ddf38ed9dc5a02ac21f2 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 20 Mar 2024 18:07:33 +0100 Subject: [PATCH 32/46] Add build for AdvanceBERRY 64 bit --- configure.berry64 | 1 + 1 file changed, 1 insertion(+) create mode 100755 configure.berry64 diff --git a/configure.berry64 b/configure.berry64 new file mode 100755 index 00000000..4ebcb02c --- /dev/null +++ b/configure.berry64 @@ -0,0 +1 @@ +CFLAGS="-O3 -march=armv8-a -mtune=cortex-a53 -funsafe-math-optimizations -fsigned-char" ./configure --prefix=/opt/advance --disable-sdl --disable-sdl2 From fafb9540d8b4df1a71088b9c9664d76eeda1a522 Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Thu, 21 Mar 2024 19:57:01 +0000 Subject: [PATCH 33/46] Backport some improvements for armedf hardware (#124) * Backport some improvements for armedf hardware All the games look alot prettier as they're now using the sprite colour clut, both versions of Legion are now playable and i've added the workaround for the timer bug in Kozure Ookami which caused the game to hang this hack can be turned off or on via the dips MAME WIP 0.159: Angelo Salese added protection note about Kozure Ookami, for future reference. Patched timer over bug in Kozure Ookami. Remarked game as working state, see source notes for further info. Added 'Infinite Timer (Cheat)' dipswitch. 23rd April 2011: Angelo Salese - Discovered and implemented sprite color cycling effects in ArmedF driver. That's a RAM-based clut table that look-ups via a byte in the sprite defs. As you can see from the YT vids, it's used for doing neat effects such as explosions / bonus colors etc. in Terra Force. It's even more useful in Kodure Ookami, since it's used to differentiate the explosive red ninjas from the normal ones and in Armed Formation, that is used to make the sprites to be a lot less static. 0.141: Tomasz Slanina added preliminary simulation of text layer protection in Chouji Meikyuu Legion and fixed sfx. Changed user1 rom ($0) to audiocpu ($4000). 31st December 2010: Tomasz Slanina - I fixed a couple of video/sound issues in Chouji Meikyuu Legion emulation: Added SFX. Fixed video priorities (no more garbage gfx over the playfield). Simulated protection in "legion" set, so the functionality is now close to the other ("legiono" - possibly a bootleg) set. Legion was _almost_ playable before. It's still not perfect (broken test mode, missing various text strings here and there ) but imo more enjoyable. Game has really unique (as for 80s) feature - 'time warp' bombs. How it works? Try it yourself. 0.95u2: Sebastien Chevalier fixed video of clone Terra Force (US). 0.95u2: Sebastien Chevalier changed way in which MCU kludge/hack works in ArmedF driver. Adds the player progress graphics (building silhouette) to the left side of the screen. * remove duplicate --- src/drivers/armedf.c | 106 ++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 56 deletions(-) diff --git a/src/drivers/armedf.c b/src/drivers/armedf.c index 5e510c59..fcba1653 100644 --- a/src/drivers/armedf.c +++ b/src/drivers/armedf.c @@ -159,6 +159,7 @@ extern void armedf_setgfxtype( int type ); VIDEO_UPDATE( armedf ); VIDEO_EOF( armedf ); VIDEO_START( armedf ); +VIDEO_START( legion ); WRITE16_HANDLER( armedf_bg_videoram_w ); WRITE16_HANDLER( armedf_fg_videoram_w ); @@ -173,6 +174,7 @@ WRITE16_HANDLER( armedf_bg_scrolly_w ); WRITE16_HANDLER( armedf_mcu_cmd ); extern UINT16 armedf_vreg; +extern UINT16 *spr_pal_clut; extern UINT16 *armedf_bg_videoram; extern UINT16 *armedf_fg_videoram; extern UINT16 *terraf_text_videoram; @@ -187,42 +189,42 @@ static WRITE16_HANDLER( io_w ) flip_screen_set(armedf_vreg & 0x1000); } -static WRITE16_HANDLER( terraf_io_w ) +static WRITE16_HANDLER( kodure_io_w ) { COMBINE_DATA(&armedf_vreg); /* bits 0 and 1 of armedf_vreg are coin counters */ /* bit 12 seems to handle screen flipping */ flip_screen_set(armedf_vreg & 0x1000); - if ((armedf_vreg & 0x4000) && !(armedf_vreg & 0x0100)) + /* This is a temporary condition specification. */ + if (!(armedf_vreg & 0x0080)) { int i; - for (i = 0x10; i < 0x1000; i++) + for (i = 0; i < 0x1000; i++) { - terraf_text_videoram[i]=0x20; + armedf_text_videoram_w(i, ' ', 0); } - tilemap_mark_all_tiles_dirty( armedf_tx_tilemap ); - //logerror("vreg WIPE TX\n"); } - //logerror("VReg = %04x\n", armedf_vreg); } -static WRITE16_HANDLER( kodure_io_w ) +static WRITE16_HANDLER( terraf_io_w ) { COMBINE_DATA(&armedf_vreg); /* bits 0 and 1 of armedf_vreg are coin counters */ /* bit 12 seems to handle screen flipping */ flip_screen_set(armedf_vreg & 0x1000); - /* This is a temporary condition specification. */ - if (!(armedf_vreg & 0x0080)) + if ((armedf_vreg & 0x4000) && !(armedf_vreg & 0x0100)) { int i; - for (i = 0; i < 0x1000; i++) + for (i = 0x10; i < 0x1000; i++) { - armedf_text_videoram_w(i, ' ', 0); + terraf_text_videoram[i]=0x20; } + tilemap_mark_all_tiles_dirty( armedf_tx_tilemap ); + //logerror("vreg WIPE TX\n"); } + //logerror("VReg = %04x\n", armedf_vreg); } static WRITE16_HANDLER( sound_command_w ) @@ -231,13 +233,6 @@ static WRITE16_HANDLER( sound_command_w ) soundlatch_w(0,((data & 0x7f) << 1) | 1); } -static WRITE16_HANDLER( legion_command_c ) -{ - COMBINE_DATA(&legion_cmd[offset]); - //logerror("Legion CMD %04x=%04x", offset, data); -} - - static ADDRESS_MAP_START( terraf_readmem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x04ffff) AM_READ(MRA16_ROM) @@ -245,7 +240,7 @@ static ADDRESS_MAP_START( terraf_readmem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x064000, 0x064fff) AM_READ(MRA16_RAM) AM_RANGE(0x068000, 0x069fff) AM_READ(MRA16_RAM) AM_RANGE(0x06a000, 0x06a9ff) AM_READ(MRA16_RAM) - AM_RANGE(0x06C000, 0x06C9ff) AM_READ(MRA16_RAM) + AM_RANGE(0x06C000, 0x06Cfff) AM_READ(MRA16_RAM) AM_RANGE(0x070000, 0x070fff) AM_READ(MRA16_RAM) AM_RANGE(0x074000, 0x074fff) AM_READ(MRA16_RAM) AM_RANGE(0x078000, 0x078001) AM_READ(input_port_0_word_r) @@ -261,16 +256,16 @@ static ADDRESS_MAP_START( terraf_writemem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x064000, 0x064fff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) AM_RANGE(0x06a000, 0x06a9ff) AM_WRITE(MWA16_RAM) - AM_RANGE(0x06C000, 0x06C9ff) AM_WRITE(MWA16_RAM) + AM_RANGE(0x06C000, 0x06Cfff) AM_WRITE(MWA16_RAM) AM_BASE (&spr_pal_clut) AM_RANGE(0x070000, 0x070fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) AM_RANGE(0x074000, 0x074fff) AM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) AM_RANGE(0x07c000, 0x07c001) AM_WRITE(terraf_io_w) AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w) AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w) - AM_RANGE(0x07c006, 0x07c007) AM_WRITE(terraf_fg_scrollx_w) /* not use in terrafu, 0x07c008 neither */ + AM_RANGE(0x07c006, 0x07c007) AM_WRITE(terraf_fg_scrollx_w) AM_RANGE(0x07c008, 0x07c009) AM_WRITE(terraf_fg_scrolly_w) /* written twice, lsb and msb */ AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w) - AM_RANGE(0x07c00c, 0x07c00d) AM_WRITE(MWA16_NOP) /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */ + AM_RANGE(0x07c00c, 0x07c00d) AM_WRITE(MWA16_NOP) /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */ AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(armedf_mcu_cmd) /* MCU Command ? */ AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(terraf_fg_scroll_msb_arm_w) /* written between two consecutive writes to 7c008 */ ADDRESS_MAP_END @@ -281,7 +276,7 @@ static ADDRESS_MAP_START( kodure_readmem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x064000, 0x064fff) AM_READ(MRA16_RAM) AM_RANGE(0x068000, 0x069fff) AM_READ(MRA16_RAM) AM_RANGE(0x06a000, 0x06a9ff) AM_READ(MRA16_RAM) - AM_RANGE(0x06C000, 0x06C9ff) AM_READ(MRA16_RAM) + AM_RANGE(0x06C000, 0x06Cfff) AM_READ(MRA16_RAM) AM_RANGE(0x070000, 0x070fff) AM_READ(MRA16_RAM) AM_RANGE(0x074000, 0x074fff) AM_READ(MRA16_RAM) AM_RANGE(0x078000, 0x078001) AM_READ(input_port_0_word_r) @@ -297,7 +292,7 @@ static ADDRESS_MAP_START( kodure_writemem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x064000, 0x064fff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) AM_RANGE(0x06a000, 0x06a9ff) AM_WRITE(MWA16_RAM) - AM_RANGE(0x06C000, 0x06C9ff) AM_WRITE(MWA16_RAM) + AM_RANGE(0x06C000, 0x06Cfff) AM_WRITE(MWA16_RAM) AM_BASE (&spr_pal_clut) AM_RANGE(0x070000, 0x070fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) AM_RANGE(0x074000, 0x074fff) AM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) AM_RANGE(0x07c000, 0x07c001) AM_WRITE(kodure_io_w) @@ -314,7 +309,7 @@ static ADDRESS_MAP_START( cclimbr2_readmem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x064000, 0x064fff) AM_READ(MRA16_RAM) AM_RANGE(0x068000, 0x069fff) AM_READ(MRA16_RAM) AM_RANGE(0x06a000, 0x06a9ff) AM_READ(MRA16_RAM) - AM_RANGE(0x06c000, 0x06c9ff) AM_READ(MRA16_RAM) + AM_RANGE(0x06c000, 0x06cfff) AM_READ(MRA16_RAM) AM_RANGE(0x070000, 0x070fff) AM_READ(MRA16_RAM) AM_RANGE(0x074000, 0x074fff) AM_READ(MRA16_RAM) AM_RANGE(0x078000, 0x078001) AM_READ(input_port_0_word_r) @@ -330,16 +325,16 @@ static ADDRESS_MAP_START( cclimbr2_writemem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x064000, 0x064fff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) AM_RANGE(0x06a000, 0x06a9ff) AM_WRITE(MWA16_RAM) - AM_RANGE(0x06c000, 0x06c9ff) AM_WRITE(MWA16_RAM) AM_RANGE(0x06ca00, 0x06cbff) AM_WRITE(MWA16_RAM) + AM_RANGE(0x06c000, 0x06cfff) AM_WRITE(MWA16_RAM) AM_BASE(&spr_pal_clut) AM_RANGE(0x070000, 0x070fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) AM_RANGE(0x074000, 0x074fff) AM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) AM_RANGE(0x07c000, 0x07c001) AM_WRITE(io_w) AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w) AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w) AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w) - AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(MWA16_NOP) /* ? */ - AM_RANGE(0x07c00c, 0x07c00d) AM_WRITE(MWA16_NOP) /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */ + AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(MWA16_NOP) /* ? */ + AM_RANGE(0x07c00c, 0x07c00d) AM_WRITE(MWA16_NOP) /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */ ADDRESS_MAP_END static ADDRESS_MAP_START( legion_writemem, ADDRESS_SPACE_PROGRAM, 16 ) @@ -349,8 +344,8 @@ static ADDRESS_MAP_START( legion_writemem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x064000, 0x064fff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) AM_RANGE(0x06a000, 0x06a9ff) AM_WRITE(MWA16_RAM) - AM_RANGE(0x06c000, 0x06c9ff) AM_WRITE(MWA16_RAM) AM_RANGE(0x06ca00, 0x06cbff) AM_WRITE(MWA16_RAM) + AM_RANGE(0x06c000, 0x06cfff) AM_WRITE(MWA16_RAM) AM_BASE(&spr_pal_clut) AM_RANGE(0x070000, 0x070fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) AM_RANGE(0x074000, 0x074fff) AM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) AM_RANGE(0x07c000, 0x07c001) AM_WRITE(terraf_io_w) @@ -370,16 +365,14 @@ static ADDRESS_MAP_START( legiono_writemem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x064000, 0x064fff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) AM_RANGE(0x06a000, 0x06a9ff) AM_WRITE(MWA16_RAM) - AM_RANGE(0x06c000, 0x06c9ff) AM_WRITE(MWA16_RAM) AM_RANGE(0x06ca00, 0x06cbff) AM_WRITE(MWA16_RAM) + AM_RANGE(0x06c000, 0x06cfff) AM_WRITE(MWA16_RAM) AM_BASE(&spr_pal_clut) AM_RANGE(0x070000, 0x070fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) AM_RANGE(0x074000, 0x074fff) AM_WRITE(armedf_bg_videoram_w) AM_BASE(&armedf_bg_videoram) AM_RANGE(0x07c000, 0x07c001) AM_WRITE(terraf_io_w) AM_RANGE(0x07c002, 0x07c003) AM_WRITE(armedf_bg_scrollx_w) AM_RANGE(0x07c004, 0x07c005) AM_WRITE(armedf_bg_scrolly_w) AM_RANGE(0x07c00a, 0x07c00b) AM_WRITE(sound_command_w) - //AM_RANGE(0x07c00e, 0x07c00f) AM_WRITE(armedf_mcu_cmd) /* MCU Command ? */ - //AM_RANGE(0x07c00c, 0x07c00d) AM_WRITE(MWA16_NOP) /* Watchdog ? cycle 0000 -> 0100 -> 0200 back to 0000 */ ADDRESS_MAP_END static ADDRESS_MAP_START( armedf_readmem, ADDRESS_SPACE_PROGRAM, 16 ) @@ -405,7 +398,7 @@ static ADDRESS_MAP_START( armedf_writemem, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x067000, 0x067fff) AM_WRITE(armedf_fg_videoram_w) AM_BASE(&armedf_fg_videoram) AM_RANGE(0x068000, 0x069fff) AM_WRITE(armedf_text_videoram_w) AM_BASE(&terraf_text_videoram) AM_RANGE(0x06a000, 0x06afff) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) - AM_RANGE(0x06b000, 0x06bfff) AM_WRITE(MWA16_RAM) + AM_RANGE(0x06b000, 0x06bfff) AM_WRITE(MWA16_RAM) AM_BASE(&spr_pal_clut) AM_RANGE(0x06c000, 0x06c7ff) AM_WRITE(MWA16_RAM) AM_RANGE(0x06d000, 0x06d001) AM_WRITE(io_w) AM_RANGE(0x06d002, 0x06d003) AM_WRITE(armedf_bg_scrollx_w) @@ -673,9 +666,9 @@ INPUT_PORTS_START( kodure ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Infinite Timer (Cheat)" ) + PORT_DIPSETTING( 0x80, DEF_STR( No ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) INPUT_PORTS_END INPUT_PORTS_START( cclimbr2 ) @@ -1029,7 +1022,7 @@ static MACHINE_DRIVER_START( legion ) MDRV_PALETTE_LENGTH(2048) MDRV_VIDEO_EOF(armedf) - MDRV_VIDEO_START(armedf) + MDRV_VIDEO_START(legion) MDRV_VIDEO_UPDATE(armedf) /* sound hardware */ @@ -1069,7 +1062,7 @@ static MACHINE_DRIVER_START( legiono ) MDRV_PALETTE_LENGTH(2048) MDRV_VIDEO_EOF(armedf) - MDRV_VIDEO_START(armedf) + MDRV_VIDEO_START(legion) MDRV_VIDEO_UPDATE(armedf) /* sound hardware */ @@ -1095,7 +1088,8 @@ ROM_START( legion ) ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Z80 code (sound) */ ROM_LOAD( "legion.1h", 0x00000, 0x04000, CRC(2ca4f7f0) SHA1(7cf997af9dd74ced9d28c047069ccfb67d72e257) ) // lg9 - + ROM_LOAD( "legion.1i", 0x04000, 0x08000, CRC(79f4a827) SHA1(25e4c1b5b8466627244b7226310e67e4261333b6) ) /* lg10*/ + ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) ROM_LOAD( "lg8.bin", 0x00000, 0x08000, CRC(e0596570) SHA1(68ddc950efc55a16e6abc699e3bad18ea19d579f) ) @@ -1112,9 +1106,6 @@ ROM_START( legion ) ROM_REGION( 0x4000, REGION_GFX5, 0 ) /* data for mcu/blitter */ ROM_LOAD ( "lg7.bin", 0x0000, 0x4000, CRC(533e2b58) SHA1(a13ea4a530038760ffa87713903c59a932452717) ) - - ROM_REGION( 0x8000, REGION_USER1, 0 ) /* ? */ - ROM_LOAD( "legion.1i", 0x0000, 0x8000, CRC(79f4a827) SHA1(25e4c1b5b8466627244b7226310e67e4261333b6) ) // lg10 ROM_END ROM_START( legiono ) @@ -1126,7 +1117,8 @@ ROM_START( legiono ) ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Z80 code (sound) */ ROM_LOAD( "legion.1h", 0x00000, 0x04000, CRC(2ca4f7f0) SHA1(7cf997af9dd74ced9d28c047069ccfb67d72e257) ) - + ROM_LOAD( "legion.1i", 0x04000, 0x08000, CRC(79f4a827) SHA1(25e4c1b5b8466627244b7226310e67e4261333b6) ) /* lg10*/ + ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE ) ROM_LOAD( "legion.1g", 0x00000, 0x08000, CRC(c50b0125) SHA1(83b5e9707152d97777fb65fa8820ba34ec2fac8d) ) @@ -1140,11 +1132,6 @@ ROM_START( legiono ) ROM_REGION( 0x20000, REGION_GFX4, ROMREGION_DISPOSE ) ROM_LOAD( "legion.1k", 0x000000, 0x010000, CRC(ff5a0db9) SHA1(9308deb363d3b7686cc69485ec14201dd68f9a97) ) ROM_LOAD( "legion.1j", 0x010000, 0x010000, CRC(bae220c8) SHA1(392ae0fb0351dcad7b0e8e0ed4a1dc6e07f493df) ) - - /* should lg7.bin be loaded here too? The ROM wasn't included in this set */ - - ROM_REGION( 0x8000, REGION_USER1, 0 ) /* ? */ - ROM_LOAD( "legion.1i", 0x0000, 0x8000, CRC(79f4a827) SHA1(25e4c1b5b8466627244b7226310e67e4261333b6) ) ROM_END ROM_START( terraf ) @@ -1363,6 +1350,13 @@ DRIVER_INIT( armedf ) DRIVER_INIT( kodure ) { + UINT16 *ROM = (UINT16 *)memory_region(REGION_CPU1); + + /* patch "time over" bug. */ + ROM[0x1016c/2] = 0x4e71; + /* ROM check at POST. */ + ROM[0x04fc6/2] = 0x4e71; + armedf_setgfxtype(2); } @@ -1400,11 +1394,11 @@ DRIVER_INIT( cclimbr2 ) /* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS */ -GAME( 1987, legion, 0, legion, legion, legion, ROT270, "Nichibutsu", "Legion (ver 2.03)", GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) -GAME( 1987, legiono, legion, legiono, legion, legiono, ROT270, "Nichibutsu", "Legion (ver 1.05)", GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) -GAME( 1987, terraf, 0, terraf, terraf, terraf, ROT0, "Nichibutsu", "Terra Force", GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) +GAME( 1987, legion, 0, legion, legion, legion, ROT270, "Nichibutsu", "Legion - Spinner-87 (World ver 2.03)", GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) +GAME( 1987, legiono, legion, legiono, legion, legiono, ROT270, "Nichibutsu", "Chouji Meikyuu Legion (Japan bootleg ver 1.05)", GAME_IMPERFECT_GRAPHICS ) /* blitter protection removed */ +GAME( 1987, terraf, 0, terraf, terraf, terraf, ROT0, "Nichibutsu", "Terra Force", GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) GAME( 1987, terrafu, terraf, terraf, terraf, terrafu, ROT0, "Nichibutsu USA", "Terra Force (US)", GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) -GAME( 1987, kodure, 0, kodure, kodure, kodure, ROT0, "Nichibutsu", "Kodure Ookami (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) -GAME( 1988, cclimbr2, 0, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan)", 0) -GAME( 1988, cclmbr2a, cclimbr2, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan Harder)", 0) -GAME( 1988, armedf, 0, armedf, armedf, armedf, ROT270, "Nichibutsu", "Armed Formation", 0) +GAME( 1987, kodure, 0, kodure, kodure, kodure, ROT0, "Nichibutsu", "Kodure Ookami (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION ) +GAME( 1988, cclimbr2, 0, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan)", 0) +GAME( 1988, cclmbr2a, cclimbr2, cclimbr2, cclimbr2, cclimbr2, ROT0, "Nichibutsu", "Crazy Climber 2 (Japan Harder)", 0) +GAME( 1988, armedf, 0, armedf, armedf, armedf, ROT270, "Nichibutsu", "Armed Formation", 0) From 3f4a3dca4072b0ed1c18be2af88d0fd16bd365e5 Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Thu, 21 Mar 2024 19:57:17 +0000 Subject: [PATCH 34/46] armedf improvements cont (#125) --- src/vidhrdw/armedf.c | 224 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 211 insertions(+), 13 deletions(-) diff --git a/src/vidhrdw/armedf.c b/src/vidhrdw/armedf.c index 81375847..3ca48eba 100644 --- a/src/vidhrdw/armedf.c +++ b/src/vidhrdw/armedf.c @@ -4,6 +4,7 @@ UINT16 armedf_vreg; UINT16 *terraf_text_videoram; +UINT16 *spr_pal_clut; UINT16 *armedf_bg_videoram; UINT16 *armedf_fg_videoram; UINT16 *legion_cmd; @@ -65,6 +66,37 @@ static void get_tx_tile_info(int tile_index) 0) } +static void get_legion_tx_tile_info(int tile_index) +{ + int tile_number = terraf_text_videoram[tile_index]&0xff; + int attributes; + + if(tile_index<0x10) tile_number=0x20; + + if( scroll_type == 1 ) + { + attributes = terraf_text_videoram[tile_index+0x800]&0xff; + } + else + { + attributes = terraf_text_videoram[tile_index+0x400]&0xff; + } + + + tile_info.priority = 0; + + if((attributes & 0x3) == 3) + { + tile_info.priority = 1; + } + + SET_TILE_INFO( + 0, + tile_number + 256 * (attributes & 0x3), + attributes >> 4, + 0) +} + static void get_fg_tile_info( int tile_index ) { int data = armedf_fg_videoram[tile_index]; @@ -127,6 +159,39 @@ VIDEO_START( armedf ) return 0; } +VIDEO_START( legion ) +{ + if( scroll_type == 4 || /* cclimbr2 */ + scroll_type == 3 || /* legion */ + scroll_type == 6 ) /* legiono */ + { + sprite_offy = 0; + } + else + { + sprite_offy = 128; + } + + //bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_OPAQUE,16,16,64,32); + bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TRANSPARENT,16,16,64,32); + fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TRANSPARENT,16,16,64,32); + armedf_tx_tilemap = tilemap_create(get_legion_tx_tile_info,armedf_scan,TILEMAP_TRANSPARENT,8,8,64,32); + + if (!bg_tilemap || !fg_tilemap || !armedf_tx_tilemap) + return 1; + + tilemap_set_transparent_pen(fg_tilemap,0xf); + tilemap_set_transparent_pen(armedf_tx_tilemap,0xf); + tilemap_set_transparent_pen(bg_tilemap,0xf); + + if( scroll_type!=1 ) + { + tilemap_set_scrollx(armedf_tx_tilemap,0,-128); + } + + return 0; +} + /*************************************************************************** Memory handlers @@ -149,14 +214,6 @@ WRITE16_HANDLER( armedf_text_videoram_w ) } } -/* if (offset<0x10) - logerror("%04x %04x %04x %04x %04x %04x %04x %04x-%04x %04x %04x %04x %04x %04x %04x %04x (%04x)\n", - terraf_text_videoram[0], terraf_text_videoram[1], terraf_text_videoram[2], - terraf_text_videoram[3], terraf_text_videoram[4], terraf_text_videoram[5], - terraf_text_videoram[6], terraf_text_videoram[7], terraf_text_videoram[8], - terraf_text_videoram[9], terraf_text_videoram[10], terraf_text_videoram[11], - terraf_text_videoram[12], terraf_text_videoram[13], terraf_text_videoram[14], - terraf_text_videoram[15], offset);*/ } @@ -241,6 +298,81 @@ WRITE16_HANDLER( armedf_mcu_cmd ) ***************************************************************************/ +/* custom code to handle color cycling effect, handled by m_spr_pal_clut */ +static void armedf_drawgfx(mame_bitmap *dest_bmp, const rectangle *clip, const gfx_element *gfx, + UINT32 code,UINT32 color, UINT32 clut,int flipx,int flipy,int offsx,int offsy, + int transparent_color) +{ +// const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; + const pen_t *pal = &gfx->colortable[0 + gfx->color_granularity * (color % gfx->total_colors)]; +// const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); + const UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo; + int x_index_base, y_index, sx, sy, ex, ey; + int xinc, yinc; + + xinc = flipx ? -1 : 1; + yinc = flipy ? -1 : 1; + + x_index_base = flipx ? gfx->width-1 : 0; + y_index = flipy ? gfx->height-1 : 0; + + /* start coordinates */ + sx = offsx; + sy = offsy; + + /* end coordinates */ + ex = sx + gfx->width; + ey = sy + gfx->height; + + if (clip) + { + if (sx < clip->min_x) + { /* clip left */ + int pixels = clip->min_x-sx; + sx += pixels; + x_index_base += xinc*pixels; + } + if (sy < clip->min_y) + { /* clip top */ + int pixels = clip->min_y-sy; + sy += pixels; + y_index += yinc*pixels; + } + /* NS 980211 - fixed incorrect clipping */ + if (ex > clip->max_x+1) + { /* clip right */ + ex = clip->max_x+1; + } + if (ey > clip->max_y+1) + { /* clip bottom */ + ey = clip->max_y+1; + } + } + + if (ex > sx) + { /* skip if inner loop doesn't draw anything */ + int x, y; + { + for (y = sy; y < ey; y++) + { + const UINT8 *source = source_base + y_index*gfx->line_modulo; + //UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0); + UINT16 *dest = (UINT16*)dest_bmp->line[y]; + int x_index = x_index_base; + for (x = sx; x < ex; x++) + { + int c = (source[x_index] & ~0xf) | ((spr_pal_clut[clut*0x10+(source[x_index] & 0xf)]) & 0xf); + if (c != transparent_color) + dest[x] = pal[c]; + + x_index += xinc; + } + y_index += yinc; + } + } + } +} + static void draw_sprites( mame_bitmap *bitmap, const rectangle *cliprect, int priority ) { int offs; @@ -251,6 +383,7 @@ static void draw_sprites( mame_bitmap *bitmap, const rectangle *cliprect, int pr int flipx = code & 0x2000; int flipy = code & 0x1000; int color = (buffered_spriteram16[offs+2]>>8)&0x1f; + int clut = (buffered_spriteram16[offs+2]) & 0x7f; int sx = buffered_spriteram16[offs+3]; int sy = sprite_offy+240-(buffered_spriteram16[offs+0]&0x1ff); @@ -263,14 +396,52 @@ static void draw_sprites( mame_bitmap *bitmap, const rectangle *cliprect, int pr if (((buffered_spriteram16[offs+0] & 0x3000) >> 12) == priority) { - drawgfx(bitmap,Machine->gfx[3], + armedf_drawgfx(bitmap,cliprect,Machine->gfx[3], code & 0xfff, - color, + color, clut, flipx,flipy, - sx,sy, - cliprect,TRANSPARENCY_PEN,15); + sx,sy,15); + } + } +} + +static void copy_textmap(int index) +{ + /* + (not simulated) + 1st half of the MCU ROM contains various strings and + gfx elements (copied by MCU to textram) + + + (partially simulated) + 2nd half of the MCu external ROM contains text tilemaps: + 4 - title screen + 5 - ??? - should be (when comapred with legiono set) displayed(? inivisble? different prority?) during game + 6 - test mode screen + 7 - portraits (title) + */ + + UINT8 * data = (UINT8 *)memory_region(REGION_GFX5); + int bank; + int tile; + int i; + for(i=0;i<0x400;++i) + { + if(i<0x10) continue; + + tile=data[0x800*index+i]; + bank=data[0x800*index+i+0x400]&3; + + if( (tile|(bank<<8))!=0x20) + { + terraf_text_videoram[i]=tile; + terraf_text_videoram[i+0x400]=data[0x800*index+i+0x400]; } + } + + tilemap_mark_all_tiles_dirty(armedf_tx_tilemap); + } @@ -340,6 +511,13 @@ VIDEO_UPDATE( armedf ) fillbitmap( bitmap, 0xff, cliprect ); + + + if(scroll_type == 3 || scroll_type == 6) /* legion / legiono */ + { + tilemap_draw(bitmap, cliprect, armedf_tx_tilemap, 1, 0); + } + if (armedf_vreg & 0x0800) tilemap_draw( bitmap, cliprect, bg_tilemap, 0, 0); /*if( armedf_vreg & 0x0800 ) { @@ -358,7 +536,27 @@ VIDEO_UPDATE( armedf ) if( sprite_enable ) draw_sprites( bitmap, cliprect, 1 ); if ((mcu_mode&0x0030)==0x0000) tilemap_draw( bitmap, cliprect, armedf_tx_tilemap, 0, 0); if( sprite_enable ) draw_sprites( bitmap, cliprect, 0 ); - + + if(scroll_type == 3) /* legion */ + { + static int oldmode=-1; + + int mode=terraf_text_videoram[1]&0xff; + + if (mode != oldmode) + { + oldmode=mode; + switch(mode) + { + case 0x01: copy_textmap(4); break; /* title screen */ + case 0x06: copy_textmap(7); break; /* portraits on title screen */ + case 0x1c: copy_textmap(5); break; /* bottom, in-game layer */ + default: logerror("unknown mode %d\n", mode); break; + } + } + + } + } VIDEO_EOF( armedf ) From b87594fbf17b11dd3336b3fbbfd54a46a10ed09d Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Thu, 21 Mar 2024 22:52:40 +0000 Subject: [PATCH 35/46] Megasys1 gfx fixes and new working game (#91) Fixed gfx priorities 64th. Street - A Detective Story and Chimera Beast by hooking up the missing prios proms Hooked up sprite buffering to fix some shaky sprites which affected all games on this system Added new correct sound rom for Kick Goal Added support for In Your Face --- src/drivers/megasys1.c | 221 +++++++++++++++++++++++++++-------------- 1 file changed, 149 insertions(+), 72 deletions(-) diff --git a/src/drivers/megasys1.c b/src/drivers/megasys1.c index 7e011c8c..511b4460 100644 --- a/src/drivers/megasys1.c +++ b/src/drivers/megasys1.c @@ -1,94 +1,92 @@ /*************************************************************************** - -= Jaleco Mega System 1 =- + -= Jaleco Mega System 1 =- - driver by Luca Elia (l.elia@tin.it) + driver by Luca Elia (l.elia@tin.it) To enter service mode in some games press service1+F3. -Year + Game System Protection +Year + Game System Protection ---------------------------------------------------------------------------- -88 Legend of Makai (World) / Z - Makai Densetsu (Japan) Z - P-47 (World) / A - P-47 (Japan) A - Kick Off (Japan) A - Takeda Shingen (Japan) A Encryption (key 1) - Ninja Kazan (World) / A Yes + Encryption (key 1) - Iga Ninjyutsuden (Japan) A Yes + Encryption (key 1) -89 Astyanax (World) / A Yes + Encryption (key 2) - The Lord of King (Japan) A Yes + Encryption (key 2) - Hachoo! A Yes + Encryption (key 2) - Jitsuryoku!! Pro Yakyuu (Japan) A Yes + Encryption (key 2) - Plus Alpha A Yes + Encryption (key 2) - Saint Dragon A Yes + Encryption (key 1) -90 RodLand (World) / A Encryption (key 3) - RodLand (Japan) A Encryption (key 2) - Phantasm (Japan) / A Encryption (key 1) -91 Avenging Spirit (World) B Inputs - Earth Defense Force B Inputs - 64th Street (World) / C * Inputs - 64th Street (Japan) C * Inputs -92 Soldam (Japan) A Encryption (key 2) - Big Striker C Inputs -93 Chimera Beast C * Inputs - Cybattler C Inputs - Peek-a-Boo! D Inputs ---------------------------------------------^------------------------------- - | - The Priority Prom is missing for these games ! - - - -Hardware Main CPU Sound CPU Sound Chips +88 Legend of Makai (World) / Z + Makai Densetsu (Japan) Z + P-47 (World) / A + P-47 (Japan) A + Kick Off (Japan) A + Takeda Shingen (Japan) A Encryption (key 1) + Ninja Kazan (World) A Yes + Encryption (key 1) + Iga Ninjyutsuden (Japan) A Yes + Encryption (key 1) +89 Astyanax (World) / A Yes + Encryption (key 2) + The Lord of King (Japan) A Yes + Encryption (key 2) + Hachoo! A Yes + Encryption (key 2) + Jitsuryoku!! Pro Yakyuu (Japan) A Yes + Encryption (key 2) + Plus Alpha A Yes + Encryption (key 2) + Saint Dragon A Yes + Encryption (key 1) +90 RodLand (World) / A Encryption (key 3) + RodLand (Japan) A Encryption (key 2) + Phantasm (Japan) / A Encryption (key 1) +91 Avenging Spirit (World) B Inputs + Earth Defense Force B Inputs + 64th Street (World) / C Inputs + 64th Street (Japan) C Inputs +92 Soldam (Japan) A Encryption (key 2) + Big Striker C Inputs +93 Chimera Beast C Inputs + Cybattler C Inputs + Peek-a-Boo! D Inputs +---------------------------------------------------------------------------- +NOTE: Chimera Beast PROM has not been dumped, but looks like it should match 64street based on game analysis. + + +Hardware Main CPU Sound CPU Sound Chips ----------------------------------------------------------- -MS1 - Z 68000 Z80 YM2203c -MS1 - A 68000 68000 YM2151 2xOKI-M6295 -MS1 - B 68000 68000 YM2151 2xOKI-M6295 -MS1 - C 68000 68000 YM2151 2xOKI-M6295 -MS1 - D 68000 - - OKI-M6295 +MS1 - Z 68000 Z80 YM2203c +MS1 - A 68000 68000 YM2151 2xOKI-M6295 +MS1 - B 68000 68000 YM2151 2xOKI-M6295 +MS1 - C 68000 68000 YM2151 2xOKI-M6295 +MS1 - D 68000 - - OKI-M6295 ----------------------------------------------------------- -Main CPU RW MS1-A/Z MS1-B MS1-C MS1-D +Main CPU RW MS1-A/Z MS1-B MS1-C MS1-D ----------------------------------------------------------------------------------- -ROM R 000000-03ffff 000000-03ffff 000000-07ffff 000000-03ffff - 080000-0bffff -Video Regs W 084000-0843ff 044000-0443ff 0c0000-0cffff 0c0000-0cffff -Palette RW 088000-0887ff 048000-0487ff 0f8000-0f87ff 0d8000-0d87ff -Object RAM RW 08e000-08ffff 04e000-04ffff 0d2000-0d3fff 0ca000-0cbfff -Scroll 0 RW 090000-093fff 050000-053fff 0e0000-0e3fff 0d0000-0d3fff -Scroll 1 RW 094000-097fff 054000-057fff 0e8000-0ebfff 0e8000-0ebfff -Scroll 2 RW 098000-09bfff 058000-05bfff 0f0000-0f3fff - -Work RAM RW 0f0000-0fffff* 060000-07ffff* 1f0000-1fffff* 1f0000-1fffff -Input Ports R 080000-080009 0e0000-0e0001** 0d8000-d80001** 100000-100001** +ROM R 000000-03ffff 000000-03ffff 000000-07ffff 000000-03ffff + 080000-0bffff +Video Regs W 084000-0843ff 044000-0443ff 0c0000-0cffff 0c0000-0cffff +Palette RW 088000-0887ff 048000-0487ff 0f8000-0f87ff 0d8000-0d87ff +Object RAM RW 08e000-08ffff 04e000-04ffff 0d2000-0d3fff 0ca000-0cbfff +Scroll 0 RW 090000-093fff 050000-053fff 0e0000-0e3fff 0d0000-0d3fff +Scroll 1 RW 094000-097fff 054000-057fff 0e8000-0ebfff 0e8000-0ebfff +Scroll 2 RW 098000-09bfff 058000-05bfff 0f0000-0f3fff - +Work RAM RW 0f0000-0fffff* 060000-07ffff* 1f0000-1fffff* 1f0000-1fffff +Input Ports R 080000-080009 0e0000-0e0001** 0d8000-d80001** 100000-100001** ----------------------------------------------------------------------------------- * Some games use mirror addresses ** Through protection. -Sound CPU RW MS1-A MS1-B MS1-C MS1-D +Sound CPU RW MS1-A MS1-B MS1-C MS1-D ----------------------------------------------------------------------------------- -ROM R 000000-01ffff 000000-01ffff 000000-01ffff No Sound CPU -Latch #1 R 040000-040001 < 060000-060001 -Latch #2 W 060000-060001 < < -2151 reg W 080000-080001 < < -2151 data W 080002-080003 < < -2151 status R 080002-080003 < < -6295 #1 data W 0a0000-0a0003 < < -6295 #1 status R 0a0000-0a0001 < < -6295 #2 data W 0c0000-0c0003 < < -6295 #2 status R 0c0000-0c0001 < < -RAM RW 0f0000-0f3fff 0e0000-0effff? < +ROM R 000000-01ffff 000000-01ffff 000000-01ffff No Sound CPU +Latch #1 R 040000-040001 < 060000-060001 +Latch #2 W 060000-060001 < < +2151 reg W 080000-080001 < < +2151 data W 080002-080003 < < +2151 status R 080002-080003 < < +6295 #1 data W 0a0000-0a0003 < < +6295 #1 status R 0a0000-0a0001 < < +6295 #2 data W 0c0000-0c0003 < < +6295 #2 status R 0c0000-0c0001 < < +RAM RW 0f0000-0f3fff 0e0000-0effff? < ----------------------------------------------------------------------------------- - Issues / To Do - -------------- + Issues / To Do + -------------- - There's a 512 byte PROM in the video section (different for every game) that controls the priorities. It's been dumped for only a few games, so @@ -676,6 +674,7 @@ static MACHINE_DRIVER_START( system_A ) MDRV_PALETTE_INIT(megasys1) MDRV_VIDEO_START(megasys1) MDRV_VIDEO_UPDATE(megasys1) + MDRV_VIDEO_EOF(megasys1) /* sound hardware */ MDRV_SPEAKER_STANDARD_STEREO("left", "right") @@ -768,6 +767,7 @@ static MACHINE_DRIVER_START( system_D ) MDRV_PALETTE_INIT(megasys1) MDRV_VIDEO_START(megasys1) MDRV_VIDEO_UPDATE(megasys1) + MDRV_VIDEO_EOF(megasys1) /* sound hardware */ MDRV_SPEAKER_STANDARD_MONO("mono") @@ -915,7 +915,7 @@ ROM_START( 64street ) ROM_LOAD( "64th_10.rom", 0x000000, 0x040000, CRC(a3390561) SHA1(f86d5c61e3e80d30408535c2203940ca1e95ac18) ) ROM_REGION( 0x0200, REGION_PROMS, 0 ) /* Priority PROM */ - ROM_LOAD( "prom", 0x0000, 0x0200, NO_DUMP ) + ROM_LOAD( "pr91009.12", 0x0000, 0x0200, CRC(c69423d6) SHA1(ba9644a9899df2d73a5a16bf7ceef1954c2e25f3) ) /* same as pr-91044 on hayaosi1 */ ROM_END @@ -948,7 +948,7 @@ ROM_START( 64streej ) ROM_LOAD( "64th_10.rom", 0x000000, 0x040000, CRC(a3390561) SHA1(f86d5c61e3e80d30408535c2203940ca1e95ac18) ) ROM_REGION( 0x0200, REGION_PROMS, 0 ) /* Priority PROM */ - ROM_LOAD( "prom", 0x0000, 0x0200, NO_DUMP ) + ROM_LOAD( "pr91009.12", 0x0000, 0x0200, CRC(c69423d6) SHA1(ba9644a9899df2d73a5a16bf7ceef1954c2e25f3) ) /* same as pr-91044 on hayaosi1 */ ROM_END @@ -1448,7 +1448,8 @@ ROM_START( chimerab ) ROM_LOAD( "voi10.bin", 0x000000, 0x040000, CRC(67498914) SHA1(8d89fa90f38fd102b15f26f71491ea833ec32cb2) ) ROM_REGION( 0x0200, REGION_PROMS, 0 ) /* Priority PROM */ - ROM_LOAD( "prom", 0x0000, 0x0200, NO_DUMP ) + /*guess, but 99% sure it's meant to be the same as 64street/hayaosi1 based on analysis of game and previous handcrafted data */ + ROM_LOAD( "pr-91044", 0x0000, 0x0200, CRC(c69423d6) SHA1(ba9644a9899df2d73a5a16bf7ceef1954c2e25f3) ) ROM_END INPUT_PORTS_START( chimerab ) @@ -2151,9 +2152,7 @@ ROM_START( kickoff ) ROM_LOAD( "kioff21.rom", 0x020000, 0x020000, CRC(195940cf) SHA1(5b1880a576046dae32cf1fd48cd4e8830649b7f7) ) ROM_REGION( 0x040000, REGION_SOUND2, 0 ) /* Samples */ - // same rom for 2 oki chips ?? Unlikely - ROM_LOAD( "kioff20.rom", 0x000000, 0x020000, CRC(5c28bd2d) SHA1(95d70a30118dfd2649f8d1f726a89e61233b4ae1) ) - ROM_LOAD( "kioff21.rom", 0x020000, 0x020000, CRC(195940cf) SHA1(5b1880a576046dae32cf1fd48cd4e8830649b7f7) ) + ROM_LOAD( "kioff10.rom", 0x000000, 0x020000, CRC(fd739fec) SHA1(1442d5ef7b8fbaa0c9f71c12ce993626364d2e1a) ) ROM_REGION( 0x0200, REGION_PROMS, 0 ) /* Priority PROM */ ROM_LOAD( "kick.bin", 0x0000, 0x0200, CRC(85b30ac4) SHA1(b03f577ceb0f26b67453ffa52ef61fea76a93184) ) @@ -3320,8 +3319,85 @@ INPUT_PORTS_START( tshingen ) INPUT_PORTS_END +/*************************************************************************** + [ In Your Face (North America, Prototype) ] +***************************************************************************/ + +ROM_START( inyourfa ) + ROM_REGION( 0x60000, REGION_CPU1, 0 ) /* Main CPU Code */ + ROM_LOAD16_BYTE( "02.27C1001", 0x000000, 0x020000, CRC(ae77e5b7) SHA1(222e1f4c3d82cdedb88ec524ea11500145bc8c87) ) + ROM_LOAD16_BYTE( "01.27C1001", 0x000001, 0x020000, CRC(e5ea92ef) SHA1(0afcaa1451572aee7486b76c21bdd4617d2b25d2) ) + ROM_LOAD16_BYTE( "03.27C512", 0x040000, 0x010000, CRC(a1efe9be) SHA1(3f49c337f0cd8634d0049c80631e32ea887d8fef) ) + ROM_LOAD16_BYTE( "04.27C512", 0x040001, 0x010000, CRC(f786cf3e) SHA1(83de4e679e34bbd2bdad62f2c3b707cf032942b5) ) + + ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* Sound CPU Code */ + ROM_LOAD16_BYTE( "05.27C512", 0x000000, 0x010000, CRC(1737ed64) SHA1(20be59c43d7975fcc5048f1ee9ed5af893bdef85) ) + ROM_LOAD16_BYTE( "06.27C512", 0x000001, 0x010000, CRC(9f12bcb9) SHA1(7c5faf6a295b2124e16823f50e57b234b6127a38) ) + + ROM_REGION( 0x080000, REGION_GFX1, ROMREGION_DISPOSE ) + ROM_LOAD( "11.27C1001", 0x000000, 0x020000, CRC(451a1428) SHA1(c017ef4dd3dffd26a93f5b926d80fd5e7bd7dea1) ) + ROM_LOAD( "12.27C1001", 0x020000, 0x020000, CRC(9ead7432) SHA1(0690b640ebe9d1461f44040a33236705a303dc7e) ) + ROM_LOAD( "13.27C1001", 0x040000, 0x020000, CRC(7e39842a) SHA1(00a4c86e8ef6e8e20d8f01eccd7d37f46be5f904) ) + ROM_LOAD( "14.27C1001", 0x060000, 0x020000, CRC(a91a3569) SHA1(0e530cdc0cf5ff0db589fb644c2181d35701fb2e) ) + + ROM_REGION( 0x080000, REGION_GFX2, ROMREGION_DISPOSE ) + ROM_LOAD( "15.27C1001", 0x000000, 0x020000, CRC(420081b6) SHA1(02fedf7bc18a1b8f12b4e549a910801c0e315a32) ) + ROM_LOAD( "16.27C1001", 0x020000, 0x020000, CRC(87b1a582) SHA1(75a8762041cbd72fad821083ce9ea65474e4b2c8) ) + ROM_LOAD( "17.27C1001", 0x040000, 0x020000, CRC(00857146) SHA1(1a2e6ac6efbec4a825525933b92de933233ad3b2) ) + ROM_FILL( 0x60000, 0x20000, 0xff )// 18? not populated? + + ROM_REGION( 0x020000, REGION_GFX3, ROMREGION_DISPOSE ) + ROM_LOAD( "19.27C1001", 0x000000, 0x020000, CRC(b82c94ec) SHA1(cf83355fb8941cf4332b764bb7de01d4c2aead21) ) + + ROM_REGION( 0x080000, REGION_GFX4, ROMREGION_DISPOSE ) + ROM_LOAD( "20.27C1001", 0x000000, 0x020000, CRC(4a322d18) SHA1(17a514e50da13bbcbecfbe186bc99c5383eefd38) ) + ROM_LOAD( "21.27C1001", 0x020000, 0x020000, CRC(7bb4b35d) SHA1(001ef590a5245126182ab7af54bc1c56012ab218) ) + ROM_LOAD( "22.27C1001", 0x040000, 0x020000, CRC(1dc040d2) SHA1(bda3a441a20f253b67ca646d71d3703a8c59e210) ) + ROM_LOAD( "23.27C1001", 0x060000, 0x020000, CRC(50478530) SHA1(a17b8fdba4fbcbb2d0b715d5cfb2192edbf5a457) ) + + ROM_REGION( 0x040000, REGION_SOUND1, 0 ) /* Samples */ + ROM_LOAD( "09.27C1001", 0x000000, 0x020000, CRC(27f4bfb4) SHA1(36c8c8b73f26d812711403135a8210af520efb66) ) + ROM_LOAD( "10.27C1001", 0x020000, 0x020000, CRC(cf5430ff) SHA1(8d0b1ab9c25312a65fa534a758f7f3ab01b3b593) ) + + ROM_REGION( 0x040000, REGION_SOUND2, 0 ) /* Samples */ + ROM_LOAD( "07.27C1001", 0x000000, 0x020000, CRC(dc254c7c) SHA1(4daed57c5603bd021f9effb228a4d40b569f72d4) ) + ROM_LOAD( "08.27C1001", 0x020000, 0x020000, CRC(cadd4731) SHA1(1c4e7ea7064b9c6b2dfdf01fd64f37de6d50bdfa) ) // 11xxxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x0200, REGION_PROMS, 0 ) /* Priority PROM */ + ROM_LOAD( "prom.14m", 0x0000, 0x0200, CRC(21390e3a) SHA1(e641be8ee6ed2ac62a027bf47ec49acb30d65ced) ) /* was missing from PCB, this one has been handcrafted */ /* dink */ +ROM_END + +INPUT_PORTS_START( inyourfa ) + COINS /* IN0 0x80001.b */ +// pass shoot change player + PORT_START_TAG("IN1") + JOY_3BUTTONS(1) /* IN1 0x80003.b */ + PORT_START_TAG("IN2") + RESERVE /* IN2 0x80004.b */ + PORT_START_TAG("IN3") + JOY_3BUTTONS(2) /* IN3 0x80005.b */ + + PORT_START_TAG("DSW1") /* IN4 0x80006.b */ + COINAGE_6BITS + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPNAME( 0x80, 0x80, "Freeze Screen (Cheat)") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START_TAG("DSW2") /* IN5 - 0x80007.b */ + PORT_DIPNAME( 0x03, 0x03, "Game Time" ) + PORT_DIPSETTING( 0x02, "00:50" ) + PORT_DIPSETTING( 0x01, "01:00" ) + PORT_DIPSETTING( 0x03, "01:10" ) + PORT_DIPSETTING( 0x00, "01:20" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END /*************************************************************************** @@ -3705,3 +3781,4 @@ GAME( 1992, bigstrik, 0, system_C, bigstrik, bigstrik, ROT0, " GAME( 1993, chimerab, 0, system_C, chimerab, chimerab, ROT0, "Jaleco", "Chimera Beast (prototype)", 0 ) GAME( 1993, cybattlr, 0, system_C, cybattlr, cybattlr, ROT90, "Jaleco", "Cybattler", 0 ) GAME( 1993, peekaboo, 0, system_D, peekaboo, peekaboo, ROT0, "Jaleco", "Peek-a-Boo!", 0 ) +GAME( 1991, inyourfa, 0, system_A, inyourfa, iganinju, ROT0, "Jaleco", "In Your Face (North America, prototype)", 0 ) From f7c11ce5c7e5c7d08b465a3688c4722f62901d88 Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Thu, 21 Mar 2024 22:52:53 +0000 Subject: [PATCH 36/46] Megasys1 new EOF video call (#92) --- src/includes/megasys1.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/includes/megasys1.h b/src/includes/megasys1.h index 5a128026..708c945e 100644 --- a/src/includes/megasys1.h +++ b/src/includes/megasys1.h @@ -181,6 +181,7 @@ extern int megasys1_bits_per_color_code; /* Functions */ VIDEO_START( megasys1 ); +VIDEO_EOF( megasys1 ); WRITE16_HANDLER( megasys1_scrollram_0_w ); WRITE16_HANDLER( megasys1_scrollram_1_w ); From d56b233c84691be432c51fa7e608b9a7958daa8f Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Thu, 21 Mar 2024 22:54:05 +0000 Subject: [PATCH 37/46] Megasys1 video improvements (#93) Added sprite buffering and removed now obsolete fake prom hacks Co-authored-by: Andrea Mazzoleni --- src/vidhrdw/megasys1.c | 45 ++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/src/vidhrdw/megasys1.c b/src/vidhrdw/megasys1.c index 2c5c854a..ce26580c 100644 --- a/src/vidhrdw/megasys1.c +++ b/src/vidhrdw/megasys1.c @@ -213,6 +213,7 @@ static tilemap *megasys1_tilemap[3][2][4]; /* Variables defined in driver: */ static int hardware_type_z; +static UINT16 *megasys1_buffer_objectram,*megasys1_buffer2_objectram,*megasys1_buffer_spriteram16,*megasys1_buffer2_spriteram16; static void create_tilemaps(void); @@ -246,6 +247,10 @@ VIDEO_START( megasys1 ) int i; spriteram16 = &megasys1_ram[0x8000/2]; + megasys1_buffer_objectram = auto_malloc(0x2000); + megasys1_buffer_spriteram16 = auto_malloc(0x2000); + megasys1_buffer2_objectram = auto_malloc(0x2000); + megasys1_buffer2_spriteram16 = auto_malloc(0x2000); create_tilemaps(); megasys1_tmap[0] = megasys1_tilemap[0][0][0]; @@ -589,8 +594,8 @@ static void draw_sprites(mame_bitmap *bitmap,const rectangle *cliprect) { for (sprite = 0; sprite < 4 ; sprite ++) { - UINT16 *objectdata = &megasys1_objectram[offs + (0x800/2) * sprite]; - UINT16 *spritedata = &spriteram16[ (objectdata[ 0 ] & 0x7f) * 0x10/2]; + UINT16 *objectdata = &megasys1_buffer2_objectram[offs + (0x800/2) * sprite]; + UINT16 *spritedata = &megasys1_buffer2_spriteram16[ (objectdata[ 0 ] & 0x7f) * 0x10/2]; attr = spritedata[ 8/2 ]; if (((attr & 0xc0)>>6) != sprite) continue; // flipping @@ -715,7 +720,6 @@ static const struct priority priorities[] = { 0 } // end of list: use the prom's data }; - /* Convert the 512 bytes in the Priority Prom into 16 ints, encoding the layers order for 16 selectable priority schemes. @@ -764,27 +768,8 @@ PALETTE_INIT( megasys1 ) { int pri_code, offset, i, order; - /* First check if we have an hand-crafted priority scheme - available (this should happen only if no good dump - of the prom is known) */ - - i = 0; - while ( priorities[i].driver && - strcmp(priorities[i].driver, Machine->gamedrv->name) != 0 && - strcmp(priorities[i].driver, Machine->gamedrv->parent) != 0) - i++; - - if (priorities[i].driver) - { - memcpy (megasys1_layers_order, priorities[i].priorities, 16 * sizeof(int)); - - logerror("WARNING: using an hand-crafted priorities scheme\n"); - - return; - } - - /* Otherwise, perform the conversion from the prom itself */ - + /* convert PROM to something we can use */ + for (pri_code = 0; pri_code < 0x10 ; pri_code++) // 16 priority codes { int layers_order[2]; // 2 layers orders (split sprites on/off) @@ -1021,3 +1006,15 @@ VIDEO_UPDATE( megasys1 ) if (active_layers & 0x08) draw_sprites(bitmap,cliprect); } + +VIDEO_EOF( megasys1 ) +{ + /* Sprite are TWO frames ahead, like NMK16 HW. */ +/* megasys1_objectram */ + memcpy(megasys1_buffer2_objectram,megasys1_buffer_objectram, 0x2000); + memcpy(megasys1_buffer_objectram, megasys1_objectram, 0x2000); +/* spriteram16 */ + memcpy(megasys1_buffer2_spriteram16, megasys1_buffer_spriteram16, 0x2000); + memcpy(megasys1_buffer_spriteram16, spriteram16, 0x2000); + +} From d057fcb57017794ed0f7d0d40508a99b82b68f72 Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Thu, 21 Mar 2024 22:54:16 +0000 Subject: [PATCH 38/46] New Working In Your Face (North America, Prototype) (#94) --- src/mamedriv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mamedriv.c b/src/mamedriv.c index 4861ce89..19af7649 100644 --- a/src/mamedriv.c +++ b/src/mamedriv.c @@ -5878,6 +5878,7 @@ BOMULEUL CHAJARA SEGA ST-V 1997/04/11 DRIVER( chimerab ) /* (c) 1993 */ DRIVER( cybattlr ) /* (c) 1993 */ DRIVER( peekaboo ) /* (c) 1993 */ + DRIVER( inyourfa ) /* (c) 1991 (North America, Prototype) */ /* Jaleco Mega System 1 games */ DRIVER( hayaosi1 ) /* (c) 1994 */ From 921402688caee2aa0847f3b99745144797cb2635 Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Wed, 10 Apr 2024 08:14:13 +0100 Subject: [PATCH 39/46] Ms. Pacman Twin (#126) * Added support for rare, Ms. Pacman Twin (mspactwin) simultaneous 2 player play [arcadez, grant2258, mahoneyt944] --- src/drivers/pacman.c | 173 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) diff --git a/src/drivers/pacman.c b/src/drivers/pacman.c index 18b1c72d..067748d6 100644 --- a/src/drivers/pacman.c +++ b/src/drivers/pacman.c @@ -334,6 +334,7 @@ Easter eggs: #include "sound/ay8910.h" #include "sound/sn76496.h" +static UINT8 *decrypted_opcodes; /************************************* * @@ -353,7 +354,45 @@ MACHINE_RESET( mschamp ) memory_set_bank(2, whichbank); } +MACHINE_RESET( mspactwin ) +{ + static UINT8 firstrun = 0; + static UINT8 *decrypted_opcodes; + static UINT8 data_holder[0xc000]; + + if (!firstrun) + { + UINT8 *rom = memory_region(REGION_CPU1); + int A; + + decrypted_opcodes = data_holder; /* auto_malloc(0xc000); */ + for (A = 0x0000; A < 0x4000; A+=2) { + + /* decode opcode */ + decrypted_opcodes [A ] = BITSWAP8(rom[ A ] , 4, 5, 6, 7, 0, 1, 2, 3); + decrypted_opcodes [A+1] = BITSWAP8(rom[ A+1] ^ 0x9A, 6, 4, 5, 7, 2, 0, 3, 1); + decrypted_opcodes[0x8000+A ] = BITSWAP8(rom[0x8000+A ] , 4, 5, 6, 7, 0, 1, 2, 3); + decrypted_opcodes[0x8000+A+1] = BITSWAP8(rom[0x8000+A+1] ^ 0x9A, 6, 4, 5, 7, 2, 0, 3, 1); + + /* decode operand */ + rom[ A ] = BITSWAP8(rom[ A ] , 0, 1, 2, 3, 4, 5, 6, 7); + rom[ A+1] = BITSWAP8(rom[ A+1] ^ 0xA3, 2, 4, 6, 3, 7, 0, 5, 1); + rom[0x8000+A ] = BITSWAP8(rom[0x8000+A ] , 0, 1, 2, 3, 4, 5, 6, 7); + rom[0x8000+A+1] = BITSWAP8(rom[0x8000+A+1] ^ 0xA3, 2, 4, 6, 3, 7, 0, 5, 1); + } + + for (A = 0x0000; A < 0x2000; A++) { + decrypted_opcodes[0x6000+A] = decrypted_opcodes[A+0x2000]; + rom[0x6000+A ] = BITSWAP8(rom[0x6000+A ] , 0, 1, 2, 3, 4, 5, 6, 7); + rom[0x6000+A+1] = BITSWAP8(rom[0x6000+A+1] ^ 0xA3, 2, 4, 6, 3, 7, 0, 5, 1); + } + firstrun=1; + memory_set_opcode_base(0,decrypted_opcodes); + } + else + memory_set_opcode_base(0,decrypted_opcodes); +} /************************************* * @@ -388,6 +427,10 @@ static INTERRUPT_GEN( pacman_interrupt ) } } +static INTERRUPT_GEN( mspactwin_interrupt ) +{ + irq0_line_hold(); +} /* The piranha board has a sync bus controler card similar to Midway's pacman. It @@ -819,6 +862,48 @@ static ADDRESS_MAP_START( mspacman_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x8000, 0xbfff) AM_READWRITE(MRA8_BANK1,MWA8_ROM) ADDRESS_MAP_END +READ8_HANDLER(mspactwin_spriteram_r) +{ + return spriteram[offset]; +} + +static ADDRESS_MAP_START( mspactwin_readmem, ADDRESS_SPACE_PROGRAM, 8 ) + AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_ROM) + AM_RANGE(0x2000, 0x3fff) AM_READ(MRA8_ROM) + AM_RANGE(0x4000, 0x47ff) AM_READ(MRA8_RAM) /* video and color RAM */ + AM_RANGE(0x4c00, 0x4fef) AM_READ(MRA8_RAM) + AM_RANGE(0x4ff0, 0x4fff) AM_READ(mspactwin_spriteram_r) /*sprite codes at 4ff0-4fff */ + AM_RANGE(0x5000, 0x5000) AM_READ(input_port_0_r) /* IN0 */ + AM_RANGE(0x5040, 0x5040) AM_READ(input_port_1_r) /* IN1 */ + AM_RANGE(0x5080, 0x50bf) AM_READ(input_port_4_r) /* DSW1 */ + AM_RANGE(0x8000, 0xbffe) AM_READ(MRA8_ROM) + AM_RANGE(0x8000, 0xbfff) AM_READ(MRA8_ROM) +ADDRESS_MAP_END + + +static ADDRESS_MAP_START( mspactwin_writemem, ADDRESS_SPACE_PROGRAM, 8 ) + AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_ROM) + AM_RANGE(0x2000, 0x3fff) AM_WRITE(MWA8_ROM) + AM_RANGE(0x4000, 0x43ff) AM_WRITE(mspactwin_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) + AM_RANGE(0x4400, 0x47ff) AM_WRITE(pacman_colorram_w) AM_BASE(&colorram) + AM_RANGE(0x4c00, 0x4fef) AM_WRITE(MWA8_RAM) + AM_RANGE(0x4ff0, 0x4fff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) + AM_RANGE(0x5000, 0x5000) AM_WRITE(interrupt_enable_w) + AM_RANGE(0x5001, 0x5001) AM_WRITE(pacman_sound_enable_w) + AM_RANGE(0x5002, 0x5002) AM_WRITE(MWA8_NOP) + AM_RANGE(0x5003, 0x5003) AM_WRITE(pacman_flipscreen_w) + AM_RANGE(0x5004, 0x5005) AM_WRITE(pacman_leds_w) + AM_RANGE(0x5006, 0x5006) AM_WRITE(mspacman_activate_rom) /* Not actually, just handy */ + AM_RANGE(0x5007, 0x5007) AM_WRITE(pacman_coin_counter_w) + AM_RANGE(0x5040, 0x505f) AM_WRITE(pacman_sound_w) AM_BASE(&pacman_soundregs) + AM_RANGE(0x5060, 0x506f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram_2) + AM_RANGE(0x50c0, 0x50c0) AM_WRITE(watchdog_reset_w) + AM_RANGE(0x8000, 0xbffe) AM_WRITE(MWA8_ROM) + AM_RANGE(0x8000, 0xbfff) AM_WRITE(MWA8_BANK1) /* Ms. Pac-Man / Ponpoko only */ + AM_RANGE(0xc000, 0xc3ff) AM_WRITE(mspactwin_videoram_w) /* mirror address for video ram, */ + AM_RANGE(0xc400, 0xc7ef) AM_WRITE(pacman_colorram_w) /* used to display HIGH SCORE and CREDITS */ +ADDRESS_MAP_END + static ADDRESS_MAP_START( woodpek_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x3fff) AM_ROM @@ -1270,6 +1355,59 @@ INPUT_PORTS_START( mspacman ) PORT_DIPSETTING( 0x04, "Enabled with Button" ) INPUT_PORTS_END +INPUT_PORTS_START( mspactwin ) + PORT_START /* IN0 */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY + PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_SPECIAL ) + PORT_DIPNAME( 0x10, 0x10, "Speed" ) //Jama + PORT_DIPSETTING( 0x10, "Slow" ) + PORT_DIPSETTING( 0x00, "Fast" ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) + + PORT_START /* IN1 */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_SPECIAL ) + PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 ) + PORT_DIPNAME(0x80, 0x80, "Rack Test (Cheat)" ) PORT_CODE(KEYCODE_F1) + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + /* multiplexed player inputs */ + PORT_START /* P1 */ + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START /* P2 */ + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START /* DSW1 */ + PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x00, "Free Play (Invalid)" ) /* causes watchdog reset at title screen, see comments above */ + PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) + PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Lives ) ) + PORT_DIPSETTING( 0x00, "1" ) + PORT_DIPSETTING( 0x04, "2" ) + PORT_DIPSETTING( 0x08, "3" ) + PORT_DIPSETTING( 0x0c, "5" ) + PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) + PORT_DIPSETTING( 0x00, "10000" ) + PORT_DIPSETTING( 0x10, "15000" ) + PORT_DIPSETTING( 0x20, "20000" ) + PORT_DIPSETTING( 0x30, "None" ) + PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) +INPUT_PORTS_END /* Same as 'mspacman', but no fake input port */ INPUT_PORTS_START( mspacpls ) @@ -2935,6 +3073,18 @@ static MACHINE_DRIVER_START( mspacman ) MDRV_MACHINE_RESET(mspacman) MACHINE_DRIVER_END +static MACHINE_DRIVER_START( mspactwin ) + + /* basic machine hardware */ + MDRV_IMPORT_FROM(pacman) + + MDRV_CPU_MODIFY("main") + MDRV_CPU_PROGRAM_MAP(mspactwin_readmem,mspactwin_writemem) + MDRV_CPU_VBLANK_INT(mspactwin_interrupt,1) + + MDRV_MACHINE_RESET(mspactwin) +MACHINE_DRIVER_END + static MACHINE_DRIVER_START( woodpek ) @@ -4789,6 +4939,26 @@ ROM_START( rocktrv2 ) ROM_LOAD( "18.aux", 0x3c000, 0x4000, CRC(feb195fd) SHA1(5677d31e526cc7752254e9af0d694f05bc6bc907) ) ROM_END +ROM_START( mspactwin ) + ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for encrypted code */ + ROM_LOAD( "m27256.bin", 0x0000, 0x4000, CRC(77a99184) SHA1(9dcb1a1b78994aa401d653bec571cb3e6f9d900b) ) + ROM_CONTINUE(0x8000,0x4000) + + ROM_REGION( 0x2000, REGION_GFX1, 0 ) + ROM_LOAD( "4__2716.5d", 0x0000, 0x0800, CRC(483c1d1c) SHA1(d3b967c6a71cf02b825d800f56d5268f2e0e60eb) ) + ROM_LOAD( "2__2716.5g", 0x0800, 0x0800, CRC(c08d73a2) SHA1(072e57641ac5ae3c47b4f8d9c55e3da5b35489ea) ) + ROM_LOAD( "3__2516.5f", 0x1000, 0x0800, CRC(22b0188a) SHA1(a9ed9ca8b36a60081fd364abc9bc23963932cc0b) ) + ROM_LOAD( "1__2516.5j", 0x1800, 0x0800, CRC(0a8c46a0) SHA1(e38e9e3258ab26fcbc6fdf258844e364f4b165ab) ) + + ROM_REGION( 0x0120, REGION_PROMS, 0 ) + ROM_LOAD( "mb7051.8h", 0x0000, 0x0020, CRC(ff344446) SHA1(45eb37533da8912645a089b014f3b3384702114a) ) + ROM_LOAD( "82s129.4a", 0x0020, 0x0100, CRC(a8202d0d) SHA1(2a615211c33f3ef75af14e4bbedd2a700100be29) ) + + ROM_REGION( 0x0200, REGION_SOUND1, 0 ) /* Sound PROMs */ + ROM_LOAD( "82s126.1m", 0x0000, 0x0100, CRC(a9cc86bf) SHA1(bbcec0570aeceb582ff8238a4bc8546a23430081) ) + ROM_LOAD( "82s126.3m", 0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) ) +ROM_END + /************************************* * * Driver initialization @@ -5089,3 +5259,6 @@ GAME( 1985, porky, 0, porky, porky, porky, ROT90, "Shinkai I GAME( 1986, rocktrv2, 0, rocktrv2, rocktrv2, rocktrv2, ROT90, "Triumph Software Inc.", "MTV Rock-N-Roll Trivia (Part 2)", GAME_SUPPORTS_SAVE ) GAME( 1986, bigbucks, 0, bigbucks, bigbucks, 0, ROT90, "Dynasoft Inc.", "Big Bucks", GAME_SUPPORTS_SAVE ) GAME( 1995, mschamp, mspacman, mschamp, mschamp, 0, ROT90, "hack", "Ms. Pacman Champion Edition / Super Zola Pac Gal", GAME_SUPPORTS_SAVE ) + +/* Simultaneous 2 player hack of Ms Pac-Man */ +GAME( 1992, mspactwin, 0, mspactwin, mspactwin, 0, ROT90, "SUSILU", "Ms. Pac-Man Twin (Argentina)", GAME_SUPPORTS_SAVE ) From eceb3cbae1cbbef1f969eff5b545d3dd09817d68 Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Wed, 10 Apr 2024 08:14:25 +0100 Subject: [PATCH 40/46] Hookup the new video call for mspactwin (#127) --- src/includes/pacman.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/includes/pacman.h b/src/includes/pacman.h index 884ee1ae..a06b3b1c 100644 --- a/src/includes/pacman.h +++ b/src/includes/pacman.h @@ -11,6 +11,7 @@ VIDEO_START( pacman ); VIDEO_UPDATE( pacman ); WRITE8_HANDLER( pacman_videoram_w ); +WRITE8_HANDLER( mspactwin_videoram_w ); WRITE8_HANDLER( pacman_colorram_w ); WRITE8_HANDLER( pacman_flipscreen_w ); From 99ba88796eb34a50c163787f42ea6340afeffaf5 Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Wed, 10 Apr 2024 08:14:38 +0100 Subject: [PATCH 41/46] mspactwin_videoram_w (#128) --- src/vidhrdw/pacman.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vidhrdw/pacman.c b/src/vidhrdw/pacman.c index 0cc2d657..61bd2623 100644 --- a/src/vidhrdw/pacman.c +++ b/src/vidhrdw/pacman.c @@ -193,6 +193,13 @@ WRITE8_HANDLER( pacman_videoram_w ) tilemap_mark_tile_dirty( bg_tilemap, offset ); } +WRITE8_HANDLER( mspactwin_videoram_w ) +{ + videoram[offset] = data; + tilemap_mark_tile_dirty( bg_tilemap, offset ); + force_partial_update(cpu_getscanline() + 8); +} + WRITE8_HANDLER( pacman_colorram_w ) { colorram[offset] = data; From 406f402d2612f7d4579643681ee3838d290e771b Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Wed, 10 Apr 2024 08:14:48 +0100 Subject: [PATCH 42/46] mspactwin (#129) --- src/mamedriv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mamedriv.c b/src/mamedriv.c index 19af7649..643f7410 100644 --- a/src/mamedriv.c +++ b/src/mamedriv.c @@ -82,6 +82,7 @@ const game_driver * const drivers[] = DRIVER( mspacman ) /* (c) 1981 Midway */ /* made by Gencomp */ DRIVER( mspacmnf ) /* hack */ DRIVER( mspacmat ) /* hack */ + DRIVER( mspactwin ) /* hack */ DRIVER( woodpek ) DRIVER( woodpeka ) DRIVER( mspacmab ) /* bootleg */ From 1fcad1074e33eb00972a2125c8481e907d88da5d Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 21 Mar 2024 21:53:30 +0100 Subject: [PATCH 43/46] Assume imperfect games with incomplete protection emulation --- src/info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/info.c b/src/info.c index 957a3f2e..6d68380f 100644 --- a/src/info.c +++ b/src/info.c @@ -730,9 +730,9 @@ static void print_game_driver(FILE* out, const game_driver* game) /* some minor issues, games marked as status=preliminary */ /* don't work or have major emulation problems. */ - if (game->flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_WRONG_COLORS)) + if (game->flags & (GAME_NOT_WORKING | GAME_NO_SOUND | GAME_WRONG_COLORS)) fprintf(out, " status=\"preliminary\""); - else if (game->flags & (GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS)) + else if (game->flags & (GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION)) fprintf(out, " status=\"imperfect\""); else fprintf(out, " status=\"good\""); From 078df50cd6a84dc9e35653d4078d5e7dd2abe266 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 10 Apr 2024 09:34:29 +0200 Subject: [PATCH 44/46] Temporary build fix for mspactwin --- src/drivers/pacman.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/drivers/pacman.c b/src/drivers/pacman.c index 067748d6..7d424428 100644 --- a/src/drivers/pacman.c +++ b/src/drivers/pacman.c @@ -356,6 +356,7 @@ MACHINE_RESET( mschamp ) MACHINE_RESET( mspactwin ) { +#if 0 /* missing memory_set_opcode_base */ static UINT8 firstrun = 0; static UINT8 *decrypted_opcodes; static UINT8 data_holder[0xc000]; @@ -392,6 +393,7 @@ MACHINE_RESET( mspactwin ) } else memory_set_opcode_base(0,decrypted_opcodes); +#endif } /************************************* From ffc3984b3ae5786aa049a2984618466f8c02c60c Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Wed, 10 Apr 2024 17:01:31 +0100 Subject: [PATCH 45/46] Test A Possible Fix (#130) --- src/drivers/pacman.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/drivers/pacman.c b/src/drivers/pacman.c index 7d424428..d13b234e 100644 --- a/src/drivers/pacman.c +++ b/src/drivers/pacman.c @@ -356,7 +356,6 @@ MACHINE_RESET( mschamp ) MACHINE_RESET( mspactwin ) { -#if 0 /* missing memory_set_opcode_base */ static UINT8 firstrun = 0; static UINT8 *decrypted_opcodes; static UINT8 data_holder[0xc000]; @@ -389,11 +388,10 @@ MACHINE_RESET( mspactwin ) rom[0x6000+A+1] = BITSWAP8(rom[0x6000+A+1] ^ 0xA3, 2, 4, 6, 3, 7, 0, 5, 1); } firstrun=1; - memory_set_opcode_base(0,decrypted_opcodes); + memory_set_decrypted_region(0,0,0,decrypted_opcodes); } else - memory_set_opcode_base(0,decrypted_opcodes); -#endif + memory_set_decrypted_region(0,0,0,decrypted_opcodes); } /************************************* From ec652766e6c48483b30acff78876f696b8cf76a3 Mon Sep 17 00:00:00 2001 From: arcadez2003 <51386955+arcadez2003@users.noreply.github.com> Date: Thu, 11 Apr 2024 20:05:44 +0100 Subject: [PATCH 46/46] Try again (#131) * Try again * Fix the call --- src/drivers/pacman.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/pacman.c b/src/drivers/pacman.c index d13b234e..e853f742 100644 --- a/src/drivers/pacman.c +++ b/src/drivers/pacman.c @@ -388,10 +388,10 @@ MACHINE_RESET( mspactwin ) rom[0x6000+A+1] = BITSWAP8(rom[0x6000+A+1] ^ 0xA3, 2, 4, 6, 3, 7, 0, 5, 1); } firstrun=1; - memory_set_decrypted_region(0,0,0,decrypted_opcodes); + memory_set_decrypted_region(0, 0x0000, 0x1fff, decrypted_opcodes); } else - memory_set_decrypted_region(0,0,0,decrypted_opcodes); + memory_set_decrypted_region(0, 0x0000, 0x1fff, decrypted_opcodes); } /*************************************