From aadca7973d2a61ca670665c4dca36d6f67de407c Mon Sep 17 00:00:00 2001 From: "Tiago Pierezan Camargo (camargo)" Date: Mon, 22 Oct 2007 00:19:49 +0000 Subject: games-emulation/sdlmame: Removed version information from patches names. svn path=/sunrise/; revision=4834 --- games-emulation/sdlmame/ChangeLog | 6 + games-emulation/sdlmame/Manifest | 10 +- .../sdlmame/files/0.120a/dipports.patch | 38 ++ .../sdlmame/files/0.120a/dipports113.patch | 38 -- games-emulation/sdlmame/files/0.120a/inpview.patch | 398 +++++++++++++++++++++ .../sdlmame/files/0.120a/inpview12-120.patch | 398 --------------------- games-emulation/sdlmame/files/0.120a/wolf.patch | 238 ++++++++++++ games-emulation/sdlmame/files/0.120a/wolf120.patch | 238 ------------ games-emulation/sdlmame/sdlmame-0.120a.ebuild | 6 +- 9 files changed, 688 insertions(+), 682 deletions(-) create mode 100644 games-emulation/sdlmame/files/0.120a/dipports.patch delete mode 100644 games-emulation/sdlmame/files/0.120a/dipports113.patch create mode 100644 games-emulation/sdlmame/files/0.120a/inpview.patch delete mode 100644 games-emulation/sdlmame/files/0.120a/inpview12-120.patch create mode 100644 games-emulation/sdlmame/files/0.120a/wolf.patch delete mode 100644 games-emulation/sdlmame/files/0.120a/wolf120.patch (limited to 'games-emulation/sdlmame') diff --git a/games-emulation/sdlmame/ChangeLog b/games-emulation/sdlmame/ChangeLog index bbf913208..44f2437d2 100644 --- a/games-emulation/sdlmame/ChangeLog +++ b/games-emulation/sdlmame/ChangeLog @@ -2,6 +2,12 @@ # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 22 Oct 2007; Tiago Pierezan Camargo (camargo) + -files/0.120a/inpview12-120.patch, ++, ++, ++, + -files/0.120a/dipports113.patch, -files/0.120a/wolf120.patch, + sdlmame-0.120a.ebuild: + Removed version information from patches names. + 21 Oct 2007; Tiago Pierezan Camargo (camargo) +sdlmame-0.120a.ebuild: Version bump, Applying Wolfmame patches. diff --git a/games-emulation/sdlmame/Manifest b/games-emulation/sdlmame/Manifest index 3307b8fc8..ba6971e4d 100644 --- a/games-emulation/sdlmame/Manifest +++ b/games-emulation/sdlmame/Manifest @@ -1,9 +1,9 @@ -AUX 0.120a/dipports113.patch 1059 RMD160 1256a74977f5a07ce3e3a7fe07931bbc32c72ff5 SHA1 7e5fa5a71fa27298a12942c7beb3f8003fa3285e SHA256 140aa2107a048d5ff54c0a3e1a1572930ec4f78fa1b17aff52862d4190e419b8 -AUX 0.120a/inpview12-120.patch 13689 RMD160 6cfa9a0cf47d91408a71a450e37a0247c1ebe44c SHA1 85afdb48e2a5347dc30597ef379e41c00754c444 SHA256 5423f6870922549093a5df1293c938157ea0f278032f09ae898e202c9cde072c -AUX 0.120a/wolf120.patch 7577 RMD160 56abcf9e1070a945c5ba46020866d37eb86c2837 SHA1 fc65f762f1fbb28c826781e200b3c40507a806b5 SHA256 76b1ea8932037b7f4def5208c75e459d7c1f3828b0e5622838e187e3fa8ba07f +AUX 0.120a/dipports.patch 1059 RMD160 1256a74977f5a07ce3e3a7fe07931bbc32c72ff5 SHA1 7e5fa5a71fa27298a12942c7beb3f8003fa3285e SHA256 140aa2107a048d5ff54c0a3e1a1572930ec4f78fa1b17aff52862d4190e419b8 +AUX 0.120a/inpview.patch 13689 RMD160 6cfa9a0cf47d91408a71a450e37a0247c1ebe44c SHA1 85afdb48e2a5347dc30597ef379e41c00754c444 SHA256 5423f6870922549093a5df1293c938157ea0f278032f09ae898e202c9cde072c +AUX 0.120a/wolf.patch 7577 RMD160 56abcf9e1070a945c5ba46020866d37eb86c2837 SHA1 fc65f762f1fbb28c826781e200b3c40507a806b5 SHA256 76b1ea8932037b7f4def5208c75e459d7c1f3828b0e5622838e187e3fa8ba07f DIST sdlmame0119u4.zip 15894278 RMD160 b425374573d0f72d4fa4fe4b25f420cad39dbc54 SHA1 c9a17e9b61fea93e7156868975980da177567928 SHA256 55f8279f4c56aa8771267ccd89e4bd7c21e802b3085dff421b089c2771474b4a DIST sdlmame0120a.zip 15890590 RMD160 a995a0b5ed245148b7fb105944a8957e7a25b7b4 SHA1 9f0fb24f196e068ac8be2c3e81181f7707dac700 SHA256 024f053996f94755e3bcc99e0fdef54d10d846419ec42750ab2770d9f8c837b6 EBUILD sdlmame-0.119_p4.ebuild 2685 RMD160 f131ecec489b66e3637c3e1f3980a85175cb8695 SHA1 4a6112abe5add5b12a02403e7576082a468eb59d SHA256 fd8e751bd73c52225428751d1bc16f358d7be497c9f9e59e2409ce230fd65b65 -EBUILD sdlmame-0.120a.ebuild 2792 RMD160 5354711b159a4cbf4708e6ad6265b1cb469eb849 SHA1 e2d0cde85a524153c852729b163b2c8125e4cb0d SHA256 d41ff7c8bc103382722094958f54f645825526214ed840e07f64f01cb0b358cb -MISC ChangeLog 489 RMD160 00238b45a42e6cf1b6a45a4c3096335d5fa17bcb SHA1 5736930c5f73acbd40d886ed83d26b7ac6514006 SHA256 837cb6333686dd9cf813f89455674ae10993cf7752f59fead48f1a2f7b6e5422 +EBUILD sdlmame-0.120a.ebuild 2780 RMD160 b7ffca5bce928ce55137a23094f74e1ccefa3b41 SHA1 b7612188341c6609b5c553eeafbd9a87f8446c7d SHA256 426dac48be47ce23603a754daea37ca7a78a8f292e13b1f8d0c302b8b6932aa3 +MISC ChangeLog 747 RMD160 3931601845622ff2372f88b496ecffa827975efb SHA1 33a3359551eb5c455493110ea286b2a52430ed2c SHA256 68349cfbb982806284da5b8edb87235e13846a1b1a45b6b6bc46fb717ca277a3 MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42 diff --git a/games-emulation/sdlmame/files/0.120a/dipports.patch b/games-emulation/sdlmame/files/0.120a/dipports.patch new file mode 100644 index 000000000..c0c871380 --- /dev/null +++ b/games-emulation/sdlmame/files/0.120a/dipports.patch @@ -0,0 +1,38 @@ +diff -Nru base0113s/src/emu/info.c w0113/src/emu/info.c +--- base0113s/src/emu/info.c 2007-02-12 16:43:00.000000000 +1300 ++++ w0113/src/emu/info.c 2007-03-06 10:40:09.000000000 +1300 +@@ -36,6 +36,7 @@ + static void print_game_switch(FILE* out, const game_driver* game) + { + const input_port_entry* input; ++ int port = -1; + + begin_resource_tracking(); + +@@ -43,6 +44,9 @@ + + while (input->type != IPT_END) + { ++ if(input->start.tag != NULL) ++ port++; ++ + if (input->type==IPT_DIPSWITCH_NAME) + { + int def = input->default_value; +@@ -50,6 +54,8 @@ + fprintf(out, "\t\tname)); ++ fprintf(out, " mask=\"%i\"", input->mask); ++ fprintf(out, " port=\"%i\"", port); + ++input; + + fprintf(out, ">\n"); +@@ -58,6 +64,7 @@ + { + fprintf(out, "\t\t\tname)); ++ fprintf(out, " value=\"%i\"", input->default_value); + if (def == input->default_value) + fprintf(out, " default=\"yes\""); + diff --git a/games-emulation/sdlmame/files/0.120a/dipports113.patch b/games-emulation/sdlmame/files/0.120a/dipports113.patch deleted file mode 100644 index c0c871380..000000000 --- a/games-emulation/sdlmame/files/0.120a/dipports113.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -Nru base0113s/src/emu/info.c w0113/src/emu/info.c ---- base0113s/src/emu/info.c 2007-02-12 16:43:00.000000000 +1300 -+++ w0113/src/emu/info.c 2007-03-06 10:40:09.000000000 +1300 -@@ -36,6 +36,7 @@ - static void print_game_switch(FILE* out, const game_driver* game) - { - const input_port_entry* input; -+ int port = -1; - - begin_resource_tracking(); - -@@ -43,6 +44,9 @@ - - while (input->type != IPT_END) - { -+ if(input->start.tag != NULL) -+ port++; -+ - if (input->type==IPT_DIPSWITCH_NAME) - { - int def = input->default_value; -@@ -50,6 +54,8 @@ - fprintf(out, "\t\tname)); -+ fprintf(out, " mask=\"%i\"", input->mask); -+ fprintf(out, " port=\"%i\"", port); - ++input; - - fprintf(out, ">\n"); -@@ -58,6 +64,7 @@ - { - fprintf(out, "\t\t\tname)); -+ fprintf(out, " value=\"%i\"", input->default_value); - if (def == input->default_value) - fprintf(out, " default=\"yes\""); - diff --git a/games-emulation/sdlmame/files/0.120a/inpview.patch b/games-emulation/sdlmame/files/0.120a/inpview.patch new file mode 100644 index 000000000..f28d2b518 --- /dev/null +++ b/games-emulation/sdlmame/files/0.120a/inpview.patch @@ -0,0 +1,398 @@ +diff -Nru base0120/src/emu/emu.mak w0120/src/emu/emu.mak +--- base0120/src/emu/emu.mak 2007-10-15 19:58:53.000000000 +1300 ++++ w0120/src/emu/emu.mak 2007-10-16 01:00:34.000000000 +1300 +@@ -75,6 +75,7 @@ + $(EMUOBJ)/uitext.o \ + $(EMUOBJ)/validity.o \ + $(EMUOBJ)/video.o \ ++ $(EMUOBJ)/inpview.o \ + + ifdef PROFILER + EMUOBJS += \ +diff -Nru base0120/src/emu/emuopts.c w0120/src/emu/emuopts.c +--- base0120/src/emu/emuopts.c 2007-09-11 18:16:58.000000000 +1200 ++++ w0120/src/emu/emuopts.c 2007-10-16 00:58:01.000000000 +1300 +@@ -156,6 +156,8 @@ + { "bios", "default", 0, "select the system BIOS to use" }, + { "cheat;c", "0", OPTION_BOOLEAN, "enable cheat subsystem" }, + { "skip_gameinfo", "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" }, ++ { "inpview;iv", "0", 0, "enable input viewer" }, ++ { "inplayout;il", "standard", 0, "set input viewer layout type" }, + + { NULL } + }; +diff -Nru base0120/src/emu/inptport.c w0120/src/emu/inptport.c +--- base0120/src/emu/inptport.c 2007-09-29 15:57:09.000000000 +1200 ++++ w0120/src/emu/inptport.c 2007-10-16 00:58:01.000000000 +1300 +@@ -106,6 +106,7 @@ + #include "inputx.h" + #endif + ++#include "inpview.h" + + /*************************************************************************** + CONSTANTS +@@ -1140,6 +1141,9 @@ + /* register callbacks for when we load configurations */ + config_register("input", input_port_load, input_port_save); + ++ /* INPVIEW: initialise -inpview and -inplayout options */ ++ inpview_set_data(options_get_int(mame_options(),"inpview"),options_get_string(mame_options(),"inplayout")); ++ + /* open playback and record files if specified */ + setup_playback(machine); + setup_record(machine); +@@ -3599,3 +3603,30 @@ + break; + } + } ++ ++int input_port_used(int type,int player) ++{ ++ int portnum, bitnum; ++ ++ /* loop over all input ports */ ++ for (portnum = 0; portnum < MAX_INPUT_PORTS; portnum++) ++ { ++ input_port_info *portinfo = &port_info[portnum]; ++ input_bit_info *info; ++ unsigned long portvalue; ++ ++ for (bitnum = 0, info = &portinfo->bit[0]; bitnum < MAX_BITS_PER_PORT && info->port; bitnum++, info++) ++ { ++ portvalue = portinfo->playback; ++ ++ if(info->port->type == type && info->port->player == player) ++ { ++ if((info->port->type == type) && (portvalue & info->port->mask) != (info->port->default_value & info->port->mask)) ++ return 1; ++ else ++ return 0; ++ } ++ } ++ } ++ return 0; ++} +diff -Nru base0120/src/emu/inptport.h w0120/src/emu/inptport.h +--- base0120/src/emu/inptport.h 2007-09-29 15:57:09.000000000 +1200 ++++ w0120/src/emu/inptport.h 2007-10-16 00:58:01.000000000 +1300 +@@ -899,4 +899,6 @@ + UINT32 readinputportbytag(const char *tag); + UINT32 readinputportbytag_safe(const char *tag, UINT32 defvalue); + ++int input_port_used(int, int); ++ + #endif /* __INPTPORT_H__ */ +diff -Nru base0120/src/emu/inpview.c w0120/src/emu/inpview.c +--- base0120/src/emu/inpview.c 1970-01-01 13:00:00.000000000 +1300 ++++ w0120/src/emu/inpview.c 2007-10-16 00:58:01.000000000 +1300 +@@ -0,0 +1,258 @@ ++// Input viewer module for MAME ++// Complete re-write started Aug 23, 2006 ++ ++#include ++#include "ui.h" ++#include "uitext.h" ++#include "inptport.h" ++#include "render.h" ++#include "inpview.h" ++ ++#define CHAR_WIDTH (1.0f / 80.0f) ++#define INPUT_TYPES 5 ++ ++#define COL_RED MAKE_ARGB(0xff, 0xff, 0x00, 0x00) ++#define COL_BLUE MAKE_ARGB(0xff, 0x00, 0x00, 0xff) ++#define COL_GREEN MAKE_ARGB(0xff, 0x00, 0xff, 0x00) ++#define COL_YELLOW MAKE_ARGB(0xff, 0xff, 0xff, 0x00) ++#define COL_ORANGE MAKE_ARGB(0xff, 0xff, 0x80, 0x00) ++#define COL_BLACK MAKE_ARGB(0xff, 0x00, 0x00, 0x00) ++#define COL_GRAY MAKE_ARGB(0xff, 0x80, 0x80, 0x80) ++#define COL_WHITE MAKE_ARGB(0xff, 0xff, 0xff, 0xff) ++ ++#define BGCOL MAKE_ARGB(0x80, 0x80, 0x00, 0x00) ++ ++// uncomment if you plan to use MAME's built-in font ++//#define OLD_UI_FONT 1 ++ ++#ifndef OLD_UI_FONT ++#define DIR_LEFT 0x2190 ++#define DIR_UP 0x2191 ++#define DIR_RIGHT 0x2192 ++#define DIR_DOWN 0x2193 ++#else ++#define DIR_LEFT 'L' ++#define DIR_UP 'U' ++#define DIR_RIGHT 'R' ++#define DIR_DOWN 'D' ++#endif ++ ++struct input_type_definition inptype[INPUT_TYPES] = ++{ ++ { ++ "standard", ++ 1, ++ { ++ {"1P", IPT_START1, 1, 50, 0, 0, COL_WHITE}, ++ {"2P", IPT_START2, 1, 53, 0, 0, COL_WHITE}, ++ {"3P", IPT_START3, 1, 56, 0, 0, COL_WHITE}, ++ {"4P", IPT_START4, 1, 59, 0, 0, COL_WHITE}, ++ {"5P", IPT_START5, 1, 62, 0, 0, COL_WHITE}, ++ {"6P", IPT_START6, 1, 65, 0, 0, COL_WHITE}, ++ {"7P", IPT_START7, 1, 68, 0, 0, COL_WHITE}, ++ {"8P", IPT_START8, 1, 71, 0, 0, COL_WHITE}, ++ {"1", IPT_BUTTON1, 1, 20, 0, 1, COL_WHITE}, ++ {"2", IPT_BUTTON2, 1, 22, 0, 1, COL_WHITE}, ++ {"3", IPT_BUTTON3, 1, 24, 0, 1, COL_WHITE}, ++ {"4", IPT_BUTTON4, 1, 26, 0, 1, COL_WHITE}, ++ {"5", IPT_BUTTON5, 1, 28, 0, 1, COL_WHITE}, ++ {"6", IPT_BUTTON6, 1, 30, 0, 1, COL_WHITE}, ++ {"7", IPT_BUTTON7, 1, 32, 0, 1, COL_WHITE}, ++ {"8", IPT_BUTTON8, 1, 34, 0, 1, COL_WHITE}, ++ {"9", IPT_BUTTON9, 1, 36, 0, 1, COL_WHITE}, ++ {"0", IPT_BUTTON10, 1, 38, 0, 1, COL_WHITE}, ++ {"_L", IPT_JOYSTICK_LEFT, 1, 10, 0, 1, COL_WHITE}, ++ {"_R", IPT_JOYSTICK_RIGHT, 1, 12, 0, 1, COL_WHITE}, ++ {"_U", IPT_JOYSTICK_UP, 1, 14, 0, 1, COL_WHITE}, ++ {"_D", IPT_JOYSTICK_DOWN, 1, 16, 0, 1, COL_WHITE}, ++ {"NULL", -1, 0,0,0,0,0} ++ } ++ }, ++ { ++ "mahjong", ++ 2, ++ { ++ {"1P", IPT_START1, 1, 50, 0, 0, COL_WHITE}, ++ {"2P", IPT_START2, 1, 53, 0, 0, COL_WHITE}, ++ {"3P", IPT_START3, 1, 56, 0, 0, COL_WHITE}, ++ {"4P", IPT_START4, 1, 59, 0, 0, COL_WHITE}, ++ {"5P", IPT_START5, 1, 62, 0, 0, COL_WHITE}, ++ {"6P", IPT_START6, 1, 65, 0, 0, COL_WHITE}, ++ {"7P", IPT_START7, 1, 68, 0, 0, COL_WHITE}, ++ {"8P", IPT_START8, 1, 71, 0, 0, COL_WHITE}, ++ {"A", IPT_MAHJONG_A, 1, 10, 0, 1, COL_WHITE}, ++ {"B", IPT_MAHJONG_B, 1, 12, 0, 1, COL_WHITE}, ++ {"C", IPT_MAHJONG_C, 1, 14, 0, 1, COL_WHITE}, ++ {"D", IPT_MAHJONG_D, 1, 16, 0, 1, COL_WHITE}, ++ {"E", IPT_MAHJONG_E, 1, 18, 0, 1, COL_WHITE}, ++ {"F", IPT_MAHJONG_F, 1, 20, 0, 1, COL_WHITE}, ++ {"G", IPT_MAHJONG_G, 1, 22, 0, 1, COL_WHITE}, ++ {"H", IPT_MAHJONG_H, 1, 24, 0, 1, COL_WHITE}, ++ {"I", IPT_MAHJONG_I, 1, 26, 0, 1, COL_WHITE}, ++ {"J", IPT_MAHJONG_J, 1, 28, 0, 1, COL_WHITE}, ++ {"K", IPT_MAHJONG_K, 1, 30, 0, 1, COL_WHITE}, ++ {"L", IPT_MAHJONG_L, 1, 32, 0, 1, COL_WHITE}, ++ {"M", IPT_MAHJONG_M, 1, 34, 0, 1, COL_WHITE}, ++ {"N", IPT_MAHJONG_N, 1, 36, 0, 1, COL_WHITE}, ++ {"O", IPT_MAHJONG_O, 1, 38, 0, 1, COL_WHITE}, ++ {"P", IPT_MAHJONG_P, 1, 40, 0, 1, COL_WHITE}, ++ {"Q", IPT_MAHJONG_Q, 1, 42, 0, 1, COL_WHITE}, ++ {"REACH", IPT_MAHJONG_REACH, 2, 14, 0, 1, COL_WHITE}, ++ {"CHI", IPT_MAHJONG_CHI, 2, 26, 0, 1, COL_WHITE}, ++ {"PON", IPT_MAHJONG_PON, 2, 34, 0, 1, COL_WHITE}, ++ {"KAN", IPT_MAHJONG_KAN, 2, 42, 0, 1, COL_WHITE}, ++ {"RON", IPT_MAHJONG_RON, 2, 50, 0, 1, COL_WHITE}, ++ {"BET", IPT_MAHJONG_BET, 2, 58, 0, 1, COL_WHITE}, ++ {"NULL", -1, 0,0,0,0,0} ++ } ++ }, ++ { ++ "dualstick", ++ 1, ++ { ++ {"1P", IPT_START1, 1, 50, 0, 0, COL_WHITE}, ++ {"2P", IPT_START2, 1, 53, 0, 0, COL_WHITE}, ++ {"3P", IPT_START3, 1, 56, 0, 0, COL_WHITE}, ++ {"4P", IPT_START4, 1, 59, 0, 0, COL_WHITE}, ++ {"5P", IPT_START5, 1, 62, 0, 0, COL_WHITE}, ++ {"6P", IPT_START6, 1, 65, 0, 0, COL_WHITE}, ++ {"7P", IPT_START7, 1, 68, 0, 0, COL_WHITE}, ++ {"8P", IPT_START8, 1, 71, 0, 0, COL_WHITE}, ++ {"1", IPT_BUTTON1, 1, 30, 0, 1, COL_WHITE}, ++ {"2", IPT_BUTTON2, 1, 32, 0, 1, COL_WHITE}, ++ {"3", IPT_BUTTON3, 1, 34, 0, 1, COL_WHITE}, ++ {"4", IPT_BUTTON4, 1, 36, 0, 1, COL_WHITE}, ++ {"5", IPT_BUTTON5, 1, 38, 0, 1, COL_WHITE}, ++ {"6", IPT_BUTTON6, 1, 40, 0, 1, COL_WHITE}, ++ {"7", IPT_BUTTON7, 1, 42, 0, 1, COL_WHITE}, ++ {"8", IPT_BUTTON8, 1, 44, 0, 1, COL_WHITE}, ++ {"9", IPT_BUTTON9, 1, 46, 0, 1, COL_WHITE}, ++ {"0", IPT_BUTTON10, 1, 48, 0, 1, COL_WHITE}, ++ {"_L", IPT_JOYSTICKLEFT_LEFT, 1, 6, 0, 1, COL_WHITE}, ++ {"_R", IPT_JOYSTICKLEFT_RIGHT, 1, 8, 0, 1, COL_WHITE}, ++ {"_U", IPT_JOYSTICKLEFT_UP, 1, 10, 0, 1, COL_WHITE}, ++ {"_D", IPT_JOYSTICKLEFT_DOWN, 1, 12, 0, 1, COL_WHITE}, ++ {"_L", IPT_JOYSTICKRIGHT_LEFT, 1, 18, 0, 1, COL_WHITE}, ++ {"_R", IPT_JOYSTICKRIGHT_RIGHT, 1, 20, 0, 1, COL_WHITE}, ++ {"_U", IPT_JOYSTICKRIGHT_UP, 1, 22, 0, 1, COL_WHITE}, ++ {"_D", IPT_JOYSTICKRIGHT_DOWN, 1, 24, 0, 1, COL_WHITE}, ++ {"NULL", -1, 0,0,0,0,0} ++ } ++ }, ++ { ++ "neogeo", ++ 2, ++ { ++ {"1P", IPT_START1, 2, 53, 0, 0, COL_YELLOW}, ++ {"2P", IPT_START2, 1, 53, 0, 0, COL_YELLOW}, ++ {"A", IPT_BUTTON1, 1, 26, 0, 1, COL_RED}, ++ {"B", IPT_BUTTON2, 2, 29, 0, 1, COL_YELLOW}, ++ {"C", IPT_BUTTON3, 2, 32, 0, 1, COL_GREEN}, ++ {"D", IPT_BUTTON4, 1, 35, 0, 1, COL_BLUE}, ++ {"_L", IPT_JOYSTICK_LEFT, 1, 15, 0, 1, COL_WHITE}, ++ {"_R", IPT_JOYSTICK_RIGHT, 1, 19, 0, 1, COL_WHITE}, ++ {"_U", IPT_JOYSTICK_UP, 2, 17, 0, 1, COL_WHITE}, ++ {"_D", IPT_JOYSTICK_DOWN, 1, 17, 0, 1, COL_WHITE}, ++ {"NULL", -1, 0,0,0,0,0} ++ } ++ }, ++ { ++ "6button", ++ 2, ++ { ++ {"1P", IPT_START1, 2, 53, 0, 0, COL_YELLOW}, ++ {"2P", IPT_START2, 1, 53, 0, 0, COL_YELLOW}, ++ {"1", IPT_BUTTON1, 2, 30, 0, 1, COL_WHITE}, ++ {"2", IPT_BUTTON2, 2, 33, 0, 1, COL_WHITE}, ++ {"3", IPT_BUTTON3, 2, 36, 0, 1, COL_WHITE}, ++ {"4", IPT_BUTTON4, 1, 30, 0, 1, COL_WHITE}, ++ {"5", IPT_BUTTON5, 1, 33, 0, 1, COL_WHITE}, ++ {"6", IPT_BUTTON6, 1, 36, 0, 1, COL_WHITE}, ++ {"_L", IPT_JOYSTICK_LEFT, 1, 15, 0, 1, COL_WHITE}, ++ {"_R", IPT_JOYSTICK_RIGHT, 1, 19, 0, 1, COL_WHITE}, ++ {"_U", IPT_JOYSTICK_UP, 2, 17, 0, 1, COL_WHITE}, ++ {"_D", IPT_JOYSTICK_DOWN, 1, 17, 0, 1, COL_WHITE}, ++ {"NULL", -1, 0,0,0,0,0} ++ } ++ } ++}; ++ ++int player; ++int layout; ++ ++void render_input() ++{ ++ int port = 0; ++ char txt[6]; ++ float height = ui_get_line_height(); ++ ++ if(player < 1 || player > 8) ++ return; // invalid player ++ ++ render_ui_add_rect(0.0f,1.0f-(float)(inptype[layout].lines*height),1.0f,1.0f,BGCOL,PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); ++ while(inptype[layout].inp[port].port != -1) ++ { ++ strcpy(txt,inptype[layout].inp[port].text); ++ ++ if(inptype[layout].inp[port].playerspecific == 0) ++ { ++ if(input_port_used(inptype[layout].inp[port].port,0) != 0) ++ { ++ int ch = convert_txt(txt); ++ int col = inptype[layout].inp[port].colour; ++ if(ch == 0) ++ ui_draw_text_full(txt,(float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),1.0f,JUSTIFY_LEFT,WRAP_NEVER,DRAW_OPAQUE,col,0,NULL,NULL); ++ else ++ render_ui_add_char((float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),height,render_get_ui_aspect(),col,ui_get_font(),ch); ++ } ++ } ++ else ++ { ++ if(input_port_used(inptype[layout].inp[port].port,player-1) != 0) ++ { ++ int ch = convert_txt(txt); ++ int col = inptype[layout].inp[port].colour; ++ if(ch == 0) ++ ui_draw_text_full(txt,(float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),1.0f,JUSTIFY_LEFT,WRAP_NEVER,DRAW_OPAQUE,col,0,NULL,NULL); ++ else ++ render_ui_add_char((float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),height,render_get_ui_aspect(),col,ui_get_font(),ch); ++ } ++ } ++ port++; ++ } ++} ++ ++void inpview_set_data(int ply, const char* lay) ++{ ++ player = ply; ++ layout = 0; ++ while(layout < INPUT_TYPES) ++ { ++ if(strcmp(inptype[layout].name,lay) == 0) ++ { ++ printf("INPVIEW: using layout type '%s'\n",lay); ++ return; ++ } ++ layout++; ++ } ++ printf("INPVIEW: invalid type specified, standard layout in use\n"); ++ layout = 0; ++} ++ ++int inpview_get_player() ++{ ++ return player; ++} ++ ++unsigned int convert_txt(char* txt) ++{ ++ if(strcmp(txt,"_L") == 0) ++ return DIR_LEFT; ++ if(strcmp(txt,"_R") == 0) ++ return DIR_RIGHT; ++ if(strcmp(txt,"_U") == 0) ++ return DIR_UP; ++ if(strcmp(txt,"_D") == 0) ++ return DIR_DOWN; ++ return 0; ++} +diff -Nru base0120/src/emu/inpview.h w0120/src/emu/inpview.h +--- base0120/src/emu/inpview.h 1970-01-01 13:00:00.000000000 +1300 ++++ w0120/src/emu/inpview.h 2007-10-16 00:58:01.000000000 +1300 +@@ -0,0 +1,24 @@ ++// Input viewer header ++ ++struct inputs ++{ ++ char text[6]; // character(s) to display ++ int port; // port to check ++ int line; // line to display on ++ int x; // location on line to display at ++ char isanalogue; // non-zero if the input is analogue ++ char playerspecific; // is a player specific port (if 0, then player should be 0 too) ++ unsigned long colour; ++}; ++ ++struct input_type_definition ++{ ++ char name[13]; // NULL-terminated string to identify different type using a possible -inplayout option ++ int lines; // number of lines to use for this type ++ struct inputs inp[64]; // list of displayed buttons, and the inputs they correspond to (64 max) ++}; ++ ++void render_input(void); ++void inpview_set_data(int,const char*); ++int inpview_get_player(void); ++unsigned int convert_txt(char*); +diff -Nru base0120/src/emu/ui.c w0120/src/emu/ui.c +--- base0120/src/emu/ui.c 2007-09-07 04:42:07.000000000 +1200 ++++ w0120/src/emu/ui.c 2007-10-16 00:58:01.000000000 +1300 +@@ -31,7 +31,7 @@ + #include + #include + +- ++#include "inpview.h" + + /*************************************************************************** + CONSTANTS +@@ -452,6 +452,10 @@ + /* let MESS display its stuff */ + mess_ui_update(); + #endif ++ ++ // Input viewer ++ if(Machine->playback_file && inpview_get_player() != 0) ++ render_input(); + } + + diff --git a/games-emulation/sdlmame/files/0.120a/inpview12-120.patch b/games-emulation/sdlmame/files/0.120a/inpview12-120.patch deleted file mode 100644 index f28d2b518..000000000 --- a/games-emulation/sdlmame/files/0.120a/inpview12-120.patch +++ /dev/null @@ -1,398 +0,0 @@ -diff -Nru base0120/src/emu/emu.mak w0120/src/emu/emu.mak ---- base0120/src/emu/emu.mak 2007-10-15 19:58:53.000000000 +1300 -+++ w0120/src/emu/emu.mak 2007-10-16 01:00:34.000000000 +1300 -@@ -75,6 +75,7 @@ - $(EMUOBJ)/uitext.o \ - $(EMUOBJ)/validity.o \ - $(EMUOBJ)/video.o \ -+ $(EMUOBJ)/inpview.o \ - - ifdef PROFILER - EMUOBJS += \ -diff -Nru base0120/src/emu/emuopts.c w0120/src/emu/emuopts.c ---- base0120/src/emu/emuopts.c 2007-09-11 18:16:58.000000000 +1200 -+++ w0120/src/emu/emuopts.c 2007-10-16 00:58:01.000000000 +1300 -@@ -156,6 +156,8 @@ - { "bios", "default", 0, "select the system BIOS to use" }, - { "cheat;c", "0", OPTION_BOOLEAN, "enable cheat subsystem" }, - { "skip_gameinfo", "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" }, -+ { "inpview;iv", "0", 0, "enable input viewer" }, -+ { "inplayout;il", "standard", 0, "set input viewer layout type" }, - - { NULL } - }; -diff -Nru base0120/src/emu/inptport.c w0120/src/emu/inptport.c ---- base0120/src/emu/inptport.c 2007-09-29 15:57:09.000000000 +1200 -+++ w0120/src/emu/inptport.c 2007-10-16 00:58:01.000000000 +1300 -@@ -106,6 +106,7 @@ - #include "inputx.h" - #endif - -+#include "inpview.h" - - /*************************************************************************** - CONSTANTS -@@ -1140,6 +1141,9 @@ - /* register callbacks for when we load configurations */ - config_register("input", input_port_load, input_port_save); - -+ /* INPVIEW: initialise -inpview and -inplayout options */ -+ inpview_set_data(options_get_int(mame_options(),"inpview"),options_get_string(mame_options(),"inplayout")); -+ - /* open playback and record files if specified */ - setup_playback(machine); - setup_record(machine); -@@ -3599,3 +3603,30 @@ - break; - } - } -+ -+int input_port_used(int type,int player) -+{ -+ int portnum, bitnum; -+ -+ /* loop over all input ports */ -+ for (portnum = 0; portnum < MAX_INPUT_PORTS; portnum++) -+ { -+ input_port_info *portinfo = &port_info[portnum]; -+ input_bit_info *info; -+ unsigned long portvalue; -+ -+ for (bitnum = 0, info = &portinfo->bit[0]; bitnum < MAX_BITS_PER_PORT && info->port; bitnum++, info++) -+ { -+ portvalue = portinfo->playback; -+ -+ if(info->port->type == type && info->port->player == player) -+ { -+ if((info->port->type == type) && (portvalue & info->port->mask) != (info->port->default_value & info->port->mask)) -+ return 1; -+ else -+ return 0; -+ } -+ } -+ } -+ return 0; -+} -diff -Nru base0120/src/emu/inptport.h w0120/src/emu/inptport.h ---- base0120/src/emu/inptport.h 2007-09-29 15:57:09.000000000 +1200 -+++ w0120/src/emu/inptport.h 2007-10-16 00:58:01.000000000 +1300 -@@ -899,4 +899,6 @@ - UINT32 readinputportbytag(const char *tag); - UINT32 readinputportbytag_safe(const char *tag, UINT32 defvalue); - -+int input_port_used(int, int); -+ - #endif /* __INPTPORT_H__ */ -diff -Nru base0120/src/emu/inpview.c w0120/src/emu/inpview.c ---- base0120/src/emu/inpview.c 1970-01-01 13:00:00.000000000 +1300 -+++ w0120/src/emu/inpview.c 2007-10-16 00:58:01.000000000 +1300 -@@ -0,0 +1,258 @@ -+// Input viewer module for MAME -+// Complete re-write started Aug 23, 2006 -+ -+#include -+#include "ui.h" -+#include "uitext.h" -+#include "inptport.h" -+#include "render.h" -+#include "inpview.h" -+ -+#define CHAR_WIDTH (1.0f / 80.0f) -+#define INPUT_TYPES 5 -+ -+#define COL_RED MAKE_ARGB(0xff, 0xff, 0x00, 0x00) -+#define COL_BLUE MAKE_ARGB(0xff, 0x00, 0x00, 0xff) -+#define COL_GREEN MAKE_ARGB(0xff, 0x00, 0xff, 0x00) -+#define COL_YELLOW MAKE_ARGB(0xff, 0xff, 0xff, 0x00) -+#define COL_ORANGE MAKE_ARGB(0xff, 0xff, 0x80, 0x00) -+#define COL_BLACK MAKE_ARGB(0xff, 0x00, 0x00, 0x00) -+#define COL_GRAY MAKE_ARGB(0xff, 0x80, 0x80, 0x80) -+#define COL_WHITE MAKE_ARGB(0xff, 0xff, 0xff, 0xff) -+ -+#define BGCOL MAKE_ARGB(0x80, 0x80, 0x00, 0x00) -+ -+// uncomment if you plan to use MAME's built-in font -+//#define OLD_UI_FONT 1 -+ -+#ifndef OLD_UI_FONT -+#define DIR_LEFT 0x2190 -+#define DIR_UP 0x2191 -+#define DIR_RIGHT 0x2192 -+#define DIR_DOWN 0x2193 -+#else -+#define DIR_LEFT 'L' -+#define DIR_UP 'U' -+#define DIR_RIGHT 'R' -+#define DIR_DOWN 'D' -+#endif -+ -+struct input_type_definition inptype[INPUT_TYPES] = -+{ -+ { -+ "standard", -+ 1, -+ { -+ {"1P", IPT_START1, 1, 50, 0, 0, COL_WHITE}, -+ {"2P", IPT_START2, 1, 53, 0, 0, COL_WHITE}, -+ {"3P", IPT_START3, 1, 56, 0, 0, COL_WHITE}, -+ {"4P", IPT_START4, 1, 59, 0, 0, COL_WHITE}, -+ {"5P", IPT_START5, 1, 62, 0, 0, COL_WHITE}, -+ {"6P", IPT_START6, 1, 65, 0, 0, COL_WHITE}, -+ {"7P", IPT_START7, 1, 68, 0, 0, COL_WHITE}, -+ {"8P", IPT_START8, 1, 71, 0, 0, COL_WHITE}, -+ {"1", IPT_BUTTON1, 1, 20, 0, 1, COL_WHITE}, -+ {"2", IPT_BUTTON2, 1, 22, 0, 1, COL_WHITE}, -+ {"3", IPT_BUTTON3, 1, 24, 0, 1, COL_WHITE}, -+ {"4", IPT_BUTTON4, 1, 26, 0, 1, COL_WHITE}, -+ {"5", IPT_BUTTON5, 1, 28, 0, 1, COL_WHITE}, -+ {"6", IPT_BUTTON6, 1, 30, 0, 1, COL_WHITE}, -+ {"7", IPT_BUTTON7, 1, 32, 0, 1, COL_WHITE}, -+ {"8", IPT_BUTTON8, 1, 34, 0, 1, COL_WHITE}, -+ {"9", IPT_BUTTON9, 1, 36, 0, 1, COL_WHITE}, -+ {"0", IPT_BUTTON10, 1, 38, 0, 1, COL_WHITE}, -+ {"_L", IPT_JOYSTICK_LEFT, 1, 10, 0, 1, COL_WHITE}, -+ {"_R", IPT_JOYSTICK_RIGHT, 1, 12, 0, 1, COL_WHITE}, -+ {"_U", IPT_JOYSTICK_UP, 1, 14, 0, 1, COL_WHITE}, -+ {"_D", IPT_JOYSTICK_DOWN, 1, 16, 0, 1, COL_WHITE}, -+ {"NULL", -1, 0,0,0,0,0} -+ } -+ }, -+ { -+ "mahjong", -+ 2, -+ { -+ {"1P", IPT_START1, 1, 50, 0, 0, COL_WHITE}, -+ {"2P", IPT_START2, 1, 53, 0, 0, COL_WHITE}, -+ {"3P", IPT_START3, 1, 56, 0, 0, COL_WHITE}, -+ {"4P", IPT_START4, 1, 59, 0, 0, COL_WHITE}, -+ {"5P", IPT_START5, 1, 62, 0, 0, COL_WHITE}, -+ {"6P", IPT_START6, 1, 65, 0, 0, COL_WHITE}, -+ {"7P", IPT_START7, 1, 68, 0, 0, COL_WHITE}, -+ {"8P", IPT_START8, 1, 71, 0, 0, COL_WHITE}, -+ {"A", IPT_MAHJONG_A, 1, 10, 0, 1, COL_WHITE}, -+ {"B", IPT_MAHJONG_B, 1, 12, 0, 1, COL_WHITE}, -+ {"C", IPT_MAHJONG_C, 1, 14, 0, 1, COL_WHITE}, -+ {"D", IPT_MAHJONG_D, 1, 16, 0, 1, COL_WHITE}, -+ {"E", IPT_MAHJONG_E, 1, 18, 0, 1, COL_WHITE}, -+ {"F", IPT_MAHJONG_F, 1, 20, 0, 1, COL_WHITE}, -+ {"G", IPT_MAHJONG_G, 1, 22, 0, 1, COL_WHITE}, -+ {"H", IPT_MAHJONG_H, 1, 24, 0, 1, COL_WHITE}, -+ {"I", IPT_MAHJONG_I, 1, 26, 0, 1, COL_WHITE}, -+ {"J", IPT_MAHJONG_J, 1, 28, 0, 1, COL_WHITE}, -+ {"K", IPT_MAHJONG_K, 1, 30, 0, 1, COL_WHITE}, -+ {"L", IPT_MAHJONG_L, 1, 32, 0, 1, COL_WHITE}, -+ {"M", IPT_MAHJONG_M, 1, 34, 0, 1, COL_WHITE}, -+ {"N", IPT_MAHJONG_N, 1, 36, 0, 1, COL_WHITE}, -+ {"O", IPT_MAHJONG_O, 1, 38, 0, 1, COL_WHITE}, -+ {"P", IPT_MAHJONG_P, 1, 40, 0, 1, COL_WHITE}, -+ {"Q", IPT_MAHJONG_Q, 1, 42, 0, 1, COL_WHITE}, -+ {"REACH", IPT_MAHJONG_REACH, 2, 14, 0, 1, COL_WHITE}, -+ {"CHI", IPT_MAHJONG_CHI, 2, 26, 0, 1, COL_WHITE}, -+ {"PON", IPT_MAHJONG_PON, 2, 34, 0, 1, COL_WHITE}, -+ {"KAN", IPT_MAHJONG_KAN, 2, 42, 0, 1, COL_WHITE}, -+ {"RON", IPT_MAHJONG_RON, 2, 50, 0, 1, COL_WHITE}, -+ {"BET", IPT_MAHJONG_BET, 2, 58, 0, 1, COL_WHITE}, -+ {"NULL", -1, 0,0,0,0,0} -+ } -+ }, -+ { -+ "dualstick", -+ 1, -+ { -+ {"1P", IPT_START1, 1, 50, 0, 0, COL_WHITE}, -+ {"2P", IPT_START2, 1, 53, 0, 0, COL_WHITE}, -+ {"3P", IPT_START3, 1, 56, 0, 0, COL_WHITE}, -+ {"4P", IPT_START4, 1, 59, 0, 0, COL_WHITE}, -+ {"5P", IPT_START5, 1, 62, 0, 0, COL_WHITE}, -+ {"6P", IPT_START6, 1, 65, 0, 0, COL_WHITE}, -+ {"7P", IPT_START7, 1, 68, 0, 0, COL_WHITE}, -+ {"8P", IPT_START8, 1, 71, 0, 0, COL_WHITE}, -+ {"1", IPT_BUTTON1, 1, 30, 0, 1, COL_WHITE}, -+ {"2", IPT_BUTTON2, 1, 32, 0, 1, COL_WHITE}, -+ {"3", IPT_BUTTON3, 1, 34, 0, 1, COL_WHITE}, -+ {"4", IPT_BUTTON4, 1, 36, 0, 1, COL_WHITE}, -+ {"5", IPT_BUTTON5, 1, 38, 0, 1, COL_WHITE}, -+ {"6", IPT_BUTTON6, 1, 40, 0, 1, COL_WHITE}, -+ {"7", IPT_BUTTON7, 1, 42, 0, 1, COL_WHITE}, -+ {"8", IPT_BUTTON8, 1, 44, 0, 1, COL_WHITE}, -+ {"9", IPT_BUTTON9, 1, 46, 0, 1, COL_WHITE}, -+ {"0", IPT_BUTTON10, 1, 48, 0, 1, COL_WHITE}, -+ {"_L", IPT_JOYSTICKLEFT_LEFT, 1, 6, 0, 1, COL_WHITE}, -+ {"_R", IPT_JOYSTICKLEFT_RIGHT, 1, 8, 0, 1, COL_WHITE}, -+ {"_U", IPT_JOYSTICKLEFT_UP, 1, 10, 0, 1, COL_WHITE}, -+ {"_D", IPT_JOYSTICKLEFT_DOWN, 1, 12, 0, 1, COL_WHITE}, -+ {"_L", IPT_JOYSTICKRIGHT_LEFT, 1, 18, 0, 1, COL_WHITE}, -+ {"_R", IPT_JOYSTICKRIGHT_RIGHT, 1, 20, 0, 1, COL_WHITE}, -+ {"_U", IPT_JOYSTICKRIGHT_UP, 1, 22, 0, 1, COL_WHITE}, -+ {"_D", IPT_JOYSTICKRIGHT_DOWN, 1, 24, 0, 1, COL_WHITE}, -+ {"NULL", -1, 0,0,0,0,0} -+ } -+ }, -+ { -+ "neogeo", -+ 2, -+ { -+ {"1P", IPT_START1, 2, 53, 0, 0, COL_YELLOW}, -+ {"2P", IPT_START2, 1, 53, 0, 0, COL_YELLOW}, -+ {"A", IPT_BUTTON1, 1, 26, 0, 1, COL_RED}, -+ {"B", IPT_BUTTON2, 2, 29, 0, 1, COL_YELLOW}, -+ {"C", IPT_BUTTON3, 2, 32, 0, 1, COL_GREEN}, -+ {"D", IPT_BUTTON4, 1, 35, 0, 1, COL_BLUE}, -+ {"_L", IPT_JOYSTICK_LEFT, 1, 15, 0, 1, COL_WHITE}, -+ {"_R", IPT_JOYSTICK_RIGHT, 1, 19, 0, 1, COL_WHITE}, -+ {"_U", IPT_JOYSTICK_UP, 2, 17, 0, 1, COL_WHITE}, -+ {"_D", IPT_JOYSTICK_DOWN, 1, 17, 0, 1, COL_WHITE}, -+ {"NULL", -1, 0,0,0,0,0} -+ } -+ }, -+ { -+ "6button", -+ 2, -+ { -+ {"1P", IPT_START1, 2, 53, 0, 0, COL_YELLOW}, -+ {"2P", IPT_START2, 1, 53, 0, 0, COL_YELLOW}, -+ {"1", IPT_BUTTON1, 2, 30, 0, 1, COL_WHITE}, -+ {"2", IPT_BUTTON2, 2, 33, 0, 1, COL_WHITE}, -+ {"3", IPT_BUTTON3, 2, 36, 0, 1, COL_WHITE}, -+ {"4", IPT_BUTTON4, 1, 30, 0, 1, COL_WHITE}, -+ {"5", IPT_BUTTON5, 1, 33, 0, 1, COL_WHITE}, -+ {"6", IPT_BUTTON6, 1, 36, 0, 1, COL_WHITE}, -+ {"_L", IPT_JOYSTICK_LEFT, 1, 15, 0, 1, COL_WHITE}, -+ {"_R", IPT_JOYSTICK_RIGHT, 1, 19, 0, 1, COL_WHITE}, -+ {"_U", IPT_JOYSTICK_UP, 2, 17, 0, 1, COL_WHITE}, -+ {"_D", IPT_JOYSTICK_DOWN, 1, 17, 0, 1, COL_WHITE}, -+ {"NULL", -1, 0,0,0,0,0} -+ } -+ } -+}; -+ -+int player; -+int layout; -+ -+void render_input() -+{ -+ int port = 0; -+ char txt[6]; -+ float height = ui_get_line_height(); -+ -+ if(player < 1 || player > 8) -+ return; // invalid player -+ -+ render_ui_add_rect(0.0f,1.0f-(float)(inptype[layout].lines*height),1.0f,1.0f,BGCOL,PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); -+ while(inptype[layout].inp[port].port != -1) -+ { -+ strcpy(txt,inptype[layout].inp[port].text); -+ -+ if(inptype[layout].inp[port].playerspecific == 0) -+ { -+ if(input_port_used(inptype[layout].inp[port].port,0) != 0) -+ { -+ int ch = convert_txt(txt); -+ int col = inptype[layout].inp[port].colour; -+ if(ch == 0) -+ ui_draw_text_full(txt,(float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),1.0f,JUSTIFY_LEFT,WRAP_NEVER,DRAW_OPAQUE,col,0,NULL,NULL); -+ else -+ render_ui_add_char((float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),height,render_get_ui_aspect(),col,ui_get_font(),ch); -+ } -+ } -+ else -+ { -+ if(input_port_used(inptype[layout].inp[port].port,player-1) != 0) -+ { -+ int ch = convert_txt(txt); -+ int col = inptype[layout].inp[port].colour; -+ if(ch == 0) -+ ui_draw_text_full(txt,(float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),1.0f,JUSTIFY_LEFT,WRAP_NEVER,DRAW_OPAQUE,col,0,NULL,NULL); -+ else -+ render_ui_add_char((float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),height,render_get_ui_aspect(),col,ui_get_font(),ch); -+ } -+ } -+ port++; -+ } -+} -+ -+void inpview_set_data(int ply, const char* lay) -+{ -+ player = ply; -+ layout = 0; -+ while(layout < INPUT_TYPES) -+ { -+ if(strcmp(inptype[layout].name,lay) == 0) -+ { -+ printf("INPVIEW: using layout type '%s'\n",lay); -+ return; -+ } -+ layout++; -+ } -+ printf("INPVIEW: invalid type specified, standard layout in use\n"); -+ layout = 0; -+} -+ -+int inpview_get_player() -+{ -+ return player; -+} -+ -+unsigned int convert_txt(char* txt) -+{ -+ if(strcmp(txt,"_L") == 0) -+ return DIR_LEFT; -+ if(strcmp(txt,"_R") == 0) -+ return DIR_RIGHT; -+ if(strcmp(txt,"_U") == 0) -+ return DIR_UP; -+ if(strcmp(txt,"_D") == 0) -+ return DIR_DOWN; -+ return 0; -+} -diff -Nru base0120/src/emu/inpview.h w0120/src/emu/inpview.h ---- base0120/src/emu/inpview.h 1970-01-01 13:00:00.000000000 +1300 -+++ w0120/src/emu/inpview.h 2007-10-16 00:58:01.000000000 +1300 -@@ -0,0 +1,24 @@ -+// Input viewer header -+ -+struct inputs -+{ -+ char text[6]; // character(s) to display -+ int port; // port to check -+ int line; // line to display on -+ int x; // location on line to display at -+ char isanalogue; // non-zero if the input is analogue -+ char playerspecific; // is a player specific port (if 0, then player should be 0 too) -+ unsigned long colour; -+}; -+ -+struct input_type_definition -+{ -+ char name[13]; // NULL-terminated string to identify different type using a possible -inplayout option -+ int lines; // number of lines to use for this type -+ struct inputs inp[64]; // list of displayed buttons, and the inputs they correspond to (64 max) -+}; -+ -+void render_input(void); -+void inpview_set_data(int,const char*); -+int inpview_get_player(void); -+unsigned int convert_txt(char*); -diff -Nru base0120/src/emu/ui.c w0120/src/emu/ui.c ---- base0120/src/emu/ui.c 2007-09-07 04:42:07.000000000 +1200 -+++ w0120/src/emu/ui.c 2007-10-16 00:58:01.000000000 +1300 -@@ -31,7 +31,7 @@ - #include - #include - -- -+#include "inpview.h" - - /*************************************************************************** - CONSTANTS -@@ -452,6 +452,10 @@ - /* let MESS display its stuff */ - mess_ui_update(); - #endif -+ -+ // Input viewer -+ if(Machine->playback_file && inpview_get_player() != 0) -+ render_input(); - } - - diff --git a/games-emulation/sdlmame/files/0.120a/wolf.patch b/games-emulation/sdlmame/files/0.120a/wolf.patch new file mode 100644 index 000000000..555b624b1 --- /dev/null +++ b/games-emulation/sdlmame/files/0.120a/wolf.patch @@ -0,0 +1,238 @@ +diff -Nru base0120/src/emu/inptport.c w0120/src/emu/inptport.c +--- base0120/src/emu/inptport.c 2007-09-29 15:57:09.000000000 +1200 ++++ w0120/src/emu/inptport.c 2007-10-16 00:36:35.000000000 +1300 +@@ -90,6 +90,7 @@ + except that the accumulated deltas are not bounded, but rather wrap. + + ***************************************************************************/ ++#define _USE_32BIT_TIME_T // VC2005 uses a 64-bit time_t structure by default + + #include "osdepend.h" + #include "driver.h" +@@ -270,7 +271,7 @@ + static input_port_entry *input_ports_default; + + /* recorded speed read from an INP file */ +-static double rec_speed; ++double rec_speed; + + /* set to 1 if INP file being played is a standard MAME INP file */ + static int no_extended_inp; +@@ -322,8 +323,6 @@ + input_port_28_dword_r, input_port_29_dword_r, input_port_30_dword_r, input_port_31_dword_r + }; + +- +- + /*************************************************************************** + COMMON SHARED STRINGS + ***************************************************************************/ +@@ -444,6 +443,8 @@ + { INPUT_STRING_None, "None" } + }; + ++/* set to 1 if INP file being played is a standard MAME INP file */ ++int isnotext; + + + /*************************************************************************** +@@ -1225,8 +1226,9 @@ + static void setup_record(running_machine *machine) + { + const char *filename = options_get_string(mame_options(), OPTION_RECORD); +- inp_header inpheader; ++ //inp_header inpheader; + file_error filerr; ++ struct ext_header xheader; + + /* if no file, nothing to do */ + if (filename[0] == 0) +@@ -1236,10 +1238,16 @@ + filerr = mame_fopen(SEARCHPATH_INPUTLOG, filename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &machine->record_file); + assert_always(filerr == FILERR_NONE, "Failed to open file for recording"); + ++ /* disable cheats */ ++ options_set_bool(mame_options(),OPTION_CHEAT,0,OPTION_PRIORITY_MAXIMUM); ++ + /* create a header */ +- memset(&inpheader, 0, sizeof(inpheader)); +- strcpy(inpheader.name, machine->gamedrv->name); +- mame_fwrite(machine->record_file, &inpheader, sizeof(inpheader)); ++ memset(&xheader, '\0', sizeof(struct ext_header)); ++ strcpy(xheader.header, "XINP\0\0\0"); ++ strcpy(xheader.shortname, machine->gamedrv->name); ++ strcpy(xheader.version, build_version); ++ xheader.starttime = (long)time(NULL); ++ mame_fwrite(Machine->record_file, &xheader, sizeof(struct ext_header)); + } + + +@@ -1255,8 +1263,13 @@ + /* close any playback or recording files */ + if (machine->playback_file != NULL) + mame_fclose(machine->playback_file); +- if (machine->record_file != NULL) +- mame_fclose(machine->record_file); ++ if (machine->record_file != NULL) ++ { ++ long val = (long)time(NULL); ++ mame_fseek(machine->record_file,52,SEEK_SET); ++ mame_fwrite(machine->record_file,&val,sizeof(long)); ++ mame_fclose(machine->record_file); ++ } + } + + +@@ -2789,7 +2802,7 @@ + } + } + } +- ++ else // because re-recording is cheating + /* handle recording */ + if (Machine->record_file != NULL) + { +@@ -2962,7 +2975,7 @@ + /* note that analog ports are handled instantaneously at port read time */ + } + } +- ++ + #ifdef MESS + /* less MESS to MESSy things */ + inputx_update(); +@@ -2997,6 +3010,15 @@ + update_playback_record(portnum, readinputport(portnum)); + } + ++ /* record speed */ ++ if(Machine->record_file != NULL) ++ { ++ double speed = video_get_speed_percent(); ++ long marker = 0x00ABCDEF; // end of frame marker ++ mame_fwrite(Machine->record_file,&speed,sizeof(double)); ++ mame_fwrite(Machine->record_file,&marker,sizeof(long)); ++ } ++ + /* store speed read from INP file, if extended INP */ + if (Machine->playback_file != NULL && !no_extended_inp) + { +diff -Nru base0120/src/emu/ui.c w0120/src/emu/ui.c +--- base0120/src/emu/ui.c 2007-09-07 04:42:07.000000000 +1200 ++++ w0120/src/emu/ui.c 2007-10-16 00:30:13.000000000 +1300 +@@ -321,7 +321,7 @@ + int state; + + /* disable everything if we are using -str */ +- if (!first_time || (str > 0 && str < 60*5) || Machine->gamedrv == &driver_empty) ++ if (!first_time || (str > 0 && str < 60*5) || Machine->gamedrv == &driver_empty || Machine->record_file) + show_gameinfo = show_warnings = show_disclaimer = FALSE; + + /* initialize the on-screen display system */ +@@ -1283,7 +1283,7 @@ + mame_schedule_soft_reset(Machine); + + /* handle a request to display graphics/palette */ +- if (input_ui_pressed(IPT_UI_SHOW_GFX)) ++ if (input_ui_pressed(IPT_UI_SHOW_GFX) && !Machine->record_file) + { + if (!is_paused) + mame_pause(Machine, TRUE); +@@ -1291,14 +1291,14 @@ + } + + /* handle a save state request */ +- if (input_ui_pressed(IPT_UI_SAVE_STATE)) ++ if (input_ui_pressed(IPT_UI_SAVE_STATE) && !Machine->record_file) + { + mame_pause(Machine, TRUE); + return ui_set_handler(handler_load_save, LOADSAVE_SAVE); + } + + /* handle a load state request */ +- if (input_ui_pressed(IPT_UI_LOAD_STATE)) ++ if (input_ui_pressed(IPT_UI_LOAD_STATE) && !Machine->record_file) + { + mame_pause(Machine, TRUE); + return ui_set_handler(handler_load_save, LOADSAVE_LOAD); +@@ -1309,7 +1309,7 @@ + video_save_active_screen_snapshots(Machine); + + /* toggle pause */ +- if (input_ui_pressed(IPT_UI_PAUSE)) ++ if (input_ui_pressed(IPT_UI_PAUSE) && !Machine->record_file) + { + /* with a shift key, it is single step */ + if (is_paused && (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT))) +@@ -1375,11 +1375,11 @@ + } + + /* toggle throttle? */ +- if (input_ui_pressed(IPT_UI_THROTTLE)) ++ if (input_ui_pressed(IPT_UI_THROTTLE) && !Machine->record_file) + video_set_throttle(!video_get_throttle()); + + /* check for fast forward */ +- if (input_port_type_pressed(IPT_UI_FAST_FORWARD, 0)) ++ if (input_port_type_pressed(IPT_UI_FAST_FORWARD, 0) && !Machine->record_file) + { + video_set_fastforward(TRUE); + ui_show_fps_temp(0.5); +diff -Nru base0120/src/emu/uimenu.c w0120/src/emu/uimenu.c +--- base0120/src/emu/uimenu.c 2007-09-23 09:27:43.000000000 +1200 ++++ w0120/src/emu/uimenu.c 2007-10-16 00:32:08.000000000 +1300 +@@ -631,7 +631,7 @@ + *selected = num_items - 1; + + /* pause enables/disables pause */ +- if (input_ui_pressed(IPT_UI_PAUSE)) ++ if (input_ui_pressed(IPT_UI_PAUSE) && !Machine->record_file) + mame_pause(Machine, !mame_is_paused(Machine)); + + return 0; +diff -Nru base0120/src/emu/video.c w0120/src/emu/video.c +--- base0120/src/emu/video.c 2007-09-29 03:06:28.000000000 +1200 ++++ w0120/src/emu/video.c 2007-10-16 00:30:13.000000000 +1300 +@@ -157,7 +157,9 @@ + { 0,1,1,1,1,1,1,1,1,1,1,1 } + }; + +- ++// speed recorded in INP file ++extern double rec_speed; ++extern int isnotext; + + /*************************************************************************** + FUNCTION PROTOTYPES +@@ -1216,6 +1218,10 @@ + if (global.partial_updates_this_frame > 1) + dest += sprintf(dest, "\n%d partial updates", global.partial_updates_this_frame); + ++ /* display recorded speed on playback */ ++ if(Machine->playback_file != NULL && !isnotext) ++ dest += sprintf(dest,"\n Recorded speed %f%%", rec_speed); ++ + /* return a pointer to the static buffer */ + return buffer; + } +@@ -2193,6 +2199,10 @@ + } + } + ++double video_get_speed_percent(void) ++{ ++ return global.speed_percent; ++} + + + /*************************************************************************** +diff -Nru base0120/src/emu/video.h w0120/src/emu/video.h +--- base0120/src/emu/video.h 2007-08-31 04:45:52.000000000 +1200 ++++ w0120/src/emu/video.h 2007-10-16 00:30:13.000000000 +1300 +@@ -166,4 +166,6 @@ + + void video_crosshair_toggle(void); + ++double video_get_speed_percent(void); ++ + #endif /* __VIDEO_H__ */ diff --git a/games-emulation/sdlmame/files/0.120a/wolf120.patch b/games-emulation/sdlmame/files/0.120a/wolf120.patch deleted file mode 100644 index 555b624b1..000000000 --- a/games-emulation/sdlmame/files/0.120a/wolf120.patch +++ /dev/null @@ -1,238 +0,0 @@ -diff -Nru base0120/src/emu/inptport.c w0120/src/emu/inptport.c ---- base0120/src/emu/inptport.c 2007-09-29 15:57:09.000000000 +1200 -+++ w0120/src/emu/inptport.c 2007-10-16 00:36:35.000000000 +1300 -@@ -90,6 +90,7 @@ - except that the accumulated deltas are not bounded, but rather wrap. - - ***************************************************************************/ -+#define _USE_32BIT_TIME_T // VC2005 uses a 64-bit time_t structure by default - - #include "osdepend.h" - #include "driver.h" -@@ -270,7 +271,7 @@ - static input_port_entry *input_ports_default; - - /* recorded speed read from an INP file */ --static double rec_speed; -+double rec_speed; - - /* set to 1 if INP file being played is a standard MAME INP file */ - static int no_extended_inp; -@@ -322,8 +323,6 @@ - input_port_28_dword_r, input_port_29_dword_r, input_port_30_dword_r, input_port_31_dword_r - }; - -- -- - /*************************************************************************** - COMMON SHARED STRINGS - ***************************************************************************/ -@@ -444,6 +443,8 @@ - { INPUT_STRING_None, "None" } - }; - -+/* set to 1 if INP file being played is a standard MAME INP file */ -+int isnotext; - - - /*************************************************************************** -@@ -1225,8 +1226,9 @@ - static void setup_record(running_machine *machine) - { - const char *filename = options_get_string(mame_options(), OPTION_RECORD); -- inp_header inpheader; -+ //inp_header inpheader; - file_error filerr; -+ struct ext_header xheader; - - /* if no file, nothing to do */ - if (filename[0] == 0) -@@ -1236,10 +1238,16 @@ - filerr = mame_fopen(SEARCHPATH_INPUTLOG, filename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &machine->record_file); - assert_always(filerr == FILERR_NONE, "Failed to open file for recording"); - -+ /* disable cheats */ -+ options_set_bool(mame_options(),OPTION_CHEAT,0,OPTION_PRIORITY_MAXIMUM); -+ - /* create a header */ -- memset(&inpheader, 0, sizeof(inpheader)); -- strcpy(inpheader.name, machine->gamedrv->name); -- mame_fwrite(machine->record_file, &inpheader, sizeof(inpheader)); -+ memset(&xheader, '\0', sizeof(struct ext_header)); -+ strcpy(xheader.header, "XINP\0\0\0"); -+ strcpy(xheader.shortname, machine->gamedrv->name); -+ strcpy(xheader.version, build_version); -+ xheader.starttime = (long)time(NULL); -+ mame_fwrite(Machine->record_file, &xheader, sizeof(struct ext_header)); - } - - -@@ -1255,8 +1263,13 @@ - /* close any playback or recording files */ - if (machine->playback_file != NULL) - mame_fclose(machine->playback_file); -- if (machine->record_file != NULL) -- mame_fclose(machine->record_file); -+ if (machine->record_file != NULL) -+ { -+ long val = (long)time(NULL); -+ mame_fseek(machine->record_file,52,SEEK_SET); -+ mame_fwrite(machine->record_file,&val,sizeof(long)); -+ mame_fclose(machine->record_file); -+ } - } - - -@@ -2789,7 +2802,7 @@ - } - } - } -- -+ else // because re-recording is cheating - /* handle recording */ - if (Machine->record_file != NULL) - { -@@ -2962,7 +2975,7 @@ - /* note that analog ports are handled instantaneously at port read time */ - } - } -- -+ - #ifdef MESS - /* less MESS to MESSy things */ - inputx_update(); -@@ -2997,6 +3010,15 @@ - update_playback_record(portnum, readinputport(portnum)); - } - -+ /* record speed */ -+ if(Machine->record_file != NULL) -+ { -+ double speed = video_get_speed_percent(); -+ long marker = 0x00ABCDEF; // end of frame marker -+ mame_fwrite(Machine->record_file,&speed,sizeof(double)); -+ mame_fwrite(Machine->record_file,&marker,sizeof(long)); -+ } -+ - /* store speed read from INP file, if extended INP */ - if (Machine->playback_file != NULL && !no_extended_inp) - { -diff -Nru base0120/src/emu/ui.c w0120/src/emu/ui.c ---- base0120/src/emu/ui.c 2007-09-07 04:42:07.000000000 +1200 -+++ w0120/src/emu/ui.c 2007-10-16 00:30:13.000000000 +1300 -@@ -321,7 +321,7 @@ - int state; - - /* disable everything if we are using -str */ -- if (!first_time || (str > 0 && str < 60*5) || Machine->gamedrv == &driver_empty) -+ if (!first_time || (str > 0 && str < 60*5) || Machine->gamedrv == &driver_empty || Machine->record_file) - show_gameinfo = show_warnings = show_disclaimer = FALSE; - - /* initialize the on-screen display system */ -@@ -1283,7 +1283,7 @@ - mame_schedule_soft_reset(Machine); - - /* handle a request to display graphics/palette */ -- if (input_ui_pressed(IPT_UI_SHOW_GFX)) -+ if (input_ui_pressed(IPT_UI_SHOW_GFX) && !Machine->record_file) - { - if (!is_paused) - mame_pause(Machine, TRUE); -@@ -1291,14 +1291,14 @@ - } - - /* handle a save state request */ -- if (input_ui_pressed(IPT_UI_SAVE_STATE)) -+ if (input_ui_pressed(IPT_UI_SAVE_STATE) && !Machine->record_file) - { - mame_pause(Machine, TRUE); - return ui_set_handler(handler_load_save, LOADSAVE_SAVE); - } - - /* handle a load state request */ -- if (input_ui_pressed(IPT_UI_LOAD_STATE)) -+ if (input_ui_pressed(IPT_UI_LOAD_STATE) && !Machine->record_file) - { - mame_pause(Machine, TRUE); - return ui_set_handler(handler_load_save, LOADSAVE_LOAD); -@@ -1309,7 +1309,7 @@ - video_save_active_screen_snapshots(Machine); - - /* toggle pause */ -- if (input_ui_pressed(IPT_UI_PAUSE)) -+ if (input_ui_pressed(IPT_UI_PAUSE) && !Machine->record_file) - { - /* with a shift key, it is single step */ - if (is_paused && (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT))) -@@ -1375,11 +1375,11 @@ - } - - /* toggle throttle? */ -- if (input_ui_pressed(IPT_UI_THROTTLE)) -+ if (input_ui_pressed(IPT_UI_THROTTLE) && !Machine->record_file) - video_set_throttle(!video_get_throttle()); - - /* check for fast forward */ -- if (input_port_type_pressed(IPT_UI_FAST_FORWARD, 0)) -+ if (input_port_type_pressed(IPT_UI_FAST_FORWARD, 0) && !Machine->record_file) - { - video_set_fastforward(TRUE); - ui_show_fps_temp(0.5); -diff -Nru base0120/src/emu/uimenu.c w0120/src/emu/uimenu.c ---- base0120/src/emu/uimenu.c 2007-09-23 09:27:43.000000000 +1200 -+++ w0120/src/emu/uimenu.c 2007-10-16 00:32:08.000000000 +1300 -@@ -631,7 +631,7 @@ - *selected = num_items - 1; - - /* pause enables/disables pause */ -- if (input_ui_pressed(IPT_UI_PAUSE)) -+ if (input_ui_pressed(IPT_UI_PAUSE) && !Machine->record_file) - mame_pause(Machine, !mame_is_paused(Machine)); - - return 0; -diff -Nru base0120/src/emu/video.c w0120/src/emu/video.c ---- base0120/src/emu/video.c 2007-09-29 03:06:28.000000000 +1200 -+++ w0120/src/emu/video.c 2007-10-16 00:30:13.000000000 +1300 -@@ -157,7 +157,9 @@ - { 0,1,1,1,1,1,1,1,1,1,1,1 } - }; - -- -+// speed recorded in INP file -+extern double rec_speed; -+extern int isnotext; - - /*************************************************************************** - FUNCTION PROTOTYPES -@@ -1216,6 +1218,10 @@ - if (global.partial_updates_this_frame > 1) - dest += sprintf(dest, "\n%d partial updates", global.partial_updates_this_frame); - -+ /* display recorded speed on playback */ -+ if(Machine->playback_file != NULL && !isnotext) -+ dest += sprintf(dest,"\n Recorded speed %f%%", rec_speed); -+ - /* return a pointer to the static buffer */ - return buffer; - } -@@ -2193,6 +2199,10 @@ - } - } - -+double video_get_speed_percent(void) -+{ -+ return global.speed_percent; -+} - - - /*************************************************************************** -diff -Nru base0120/src/emu/video.h w0120/src/emu/video.h ---- base0120/src/emu/video.h 2007-08-31 04:45:52.000000000 +1200 -+++ w0120/src/emu/video.h 2007-10-16 00:30:13.000000000 +1300 -@@ -166,4 +166,6 @@ - - void video_crosshair_toggle(void); - -+double video_get_speed_percent(void); -+ - #endif /* __VIDEO_H__ */ diff --git a/games-emulation/sdlmame/sdlmame-0.120a.ebuild b/games-emulation/sdlmame/sdlmame-0.120a.ebuild index c3ecc2c8e..36c21676b 100644 --- a/games-emulation/sdlmame/sdlmame-0.120a.ebuild +++ b/games-emulation/sdlmame/sdlmame-0.120a.ebuild @@ -93,9 +93,9 @@ src_unpack() { einfo "Applying WolfMAME patches" cd "${S}" - epatch "${FILESDIR}/${MY_V}"/dipports113.patch - epatch "${FILESDIR}/${MY_V}"/inpview12-120.patch - epatch "${FILESDIR}/${MY_V}"/wolf120.patch + epatch "${FILESDIR}/${MY_V}"/dipports.patch + epatch "${FILESDIR}/${MY_V}"/inpview.patch + epatch "${FILESDIR}/${MY_V}"/wolf.patch } src_compile() { -- cgit v1.2.3-65-gdbad