ARCADE FOREVER

[Proyecto] AdvMenu+, Modificando el codigo fuente del Advmenu

« Older   Newer »
  Share  
VeS
view post Posted on 4/8/2012, 11:50 by: VeS     +1   -1
Avatar

V.I.P.

Group:
Usuarios AFFA
Posts:
526
Reputation:
+10

Status:


Hola de nuevo, esta es la porcion de codigo que uso para filtra los juegos por su nombre, aun estoy dando le vueltas si filtrar la ultima opcion que son los juegos Golf Dardos Bolos y Pesca , que opinais vosotros?

Lo he probado mil veces y todo funciona bien, no hay juegos que se mezclen de apartados, de todas formas por favor revisarlo vosotros y decirme que juegos podriamos incluir en las distintas clasificaciones.

Aaa y gracias al Rubio por responder a mi pregunta, que funcion hay para buscar en una cadena???
Su respuesta rapida y concisa como un crack que es, pues find, GRACIAS a el pude hacer las clasificaciones de los juegos
tragaperras cartas etc.. mirad a bajo.

QUOTE
//clasificacion por medio de los nombres, para casino poker etc...

string v = string(s, len);


if(v.find("Casino")!= string::npos || v.find("casino")!= string::npos || v.find("Poker")!= string::npos
|| v.find("poker")!= string::npos || v.find("Card")!= string::npos || v.find("Fruit Bonus")!= string::npos
|| v.find("Fruit Cocktail")!= string::npos || v.find("Brasil 8")!= string::npos || v.find("Bra$il")!= string::npos
|| v.find("Brasil 9")!= string::npos || v.find("Ruleta")!= string::npos || v.find("Jockey")!= string::npos
|| v.find("Lucky 2")!= string::npos || v.find("Lucky 7")!= string::npos || v.find("Lucky Roulette")!= string::npos
|| v.find("Cherry Bonu")!= string::npos || v.find("Cherry Gold")!= string::npos || v.find("Cherry Master")!= string::npos
|| v.find("Ruleta")!= string::npos || v.find("Buena Suerte")!= string::npos || v.find("Player's Edge")!= string::npos
|| v.find("Touchmaster")!= string::npos)//ves
{
string a = v;
state->g->flag_set(v == a, emulator::flag_derived_pokercasino);//ves
}

if(v.find("Beatmania")!= string::npos || v.find("beatmania")!= string::npos || v.find("Dance Dance Revo")!= string::npos
|| v.find("Dance Maniax")!= string::npos || v.find("Dance Freaks")!= string::npos || v.find("Dancing S")!= string::npos)
{
string b = v;
state->g->flag_set(v == b, emulator::flag_derived_beatmania);//ves
}

if(v.find("Quiz")!= string::npos || v.find("Trivia")!= string::npos || v.find("Funcube")!= string::npos)
{
string b = v;
state->g->flag_set(v == b, emulator::flag_derived_quiztrivial);//ves
}

if(v.find("Golf")!= string::npos || v.find("Bowling")!= string::npos || v.find("Darts")!= string::npos || v.find("Fisherman")!= string::npos)
{
string b = v;
state->g->flag_set(v == b, emulator::flag_derived_golfdarfish);//ves
}

// Bowling , Darts , Golf , Fisherman ?¿?¿?¿

Y aqui el diff, daesdae mira si puedes aplicarlo , y dime como lo ves, por cierto los favoritos ya estan incluidos en advmenu de serie, si pulsas F8 veras que sale unknow bad good berygood , esos son los favoritos puedes cambiar los nombres menos el unknow, es nombre no me mola , voy a ver si lo puedo cambiar a todos/all , y tambien hacer una opcion mas para que tengamos que responder Si/NO a quitarlos de las listas, porque conforme esta ahora, sin darme cuenta quito/pongo juegos en las listas.


QUOTE
diff -Nru advmenuplusDaesdae/advance/menu/emulator.cc advmenuplus/advance/menu/emulator.cc
--- advmenuplusDaesdae/advance/menu/emulator.cc 2009-01-10 13:04:07.000000000 +0100
+++ advmenuplus/advance/menu/emulator.cc 2012-08-04 12:29:01.433704237 +0200
@@ -974,6 +974,13 @@
exclude_neogeo_orig = include;
exclude_deco_orig = exclude;
exclude_playchoice_orig = exclude;
+ exclude_mechanical_orig = exclude;//ves
+ exclude_mahjong_orig = exclude;//ves
+ exclude_beatmania_orig = exclude;//ves
+ exclude_pokercasino_orig = exclude;//ves
+ exclude_quiztrivial_orig = exclude;//ves
+ exclude_golfdarfish_orig = exclude;//ves
+
}

int mame_mame::attrib_run(int x, int y)
@@ -988,6 +995,13 @@
ch.insert(ch.end(), choice("Neogeo", exclude_neogeo_effective, 0));
ch.insert(ch.end(), choice("Cassette", exclude_deco_effective, 0));
ch.insert(ch.end(), choice("PlayChoice-10", exclude_playchoice_effective, 0));
+ ch.insert(ch.end(), choice("Mechanical", exclude_mechanical_effective, 0));//ves
+ ch.insert(ch.end(), choice("Mahjongs", exclude_mahjong_effective, 0));//ves
+ ch.insert(ch.end(), choice("Beatmania", exclude_beatmania_effective, 0));//ves
+ ch.insert(ch.end(), choice("Bets&Poker&Casino&Card&Jocker", exclude_pokercasino_effective, 0));//ves
+ ch.insert(ch.end(), choice("Quiz&Trivial", exclude_quiztrivial_effective, 0));//ves
+ ch.insert(ch.end(), choice("Golf&Darts&fish", exclude_golfdarfish_effective, 0));//ves
+

choice_bag::iterator i = ch.begin();

@@ -1002,6 +1016,13 @@
exclude_neogeo_effective = ch[5].tristate_get();
exclude_deco_effective = ch[6].tristate_get();
exclude_playchoice_effective = ch[7].tristate_get();
+ exclude_mechanical_effective = ch[8].tristate_get();//ves
+ exclude_mahjong_effective = ch[9].tristate_get();//ves
+ exclude_beatmania_effective = ch[10].tristate_get();//ves
+ exclude_pokercasino_effective = ch[11].tristate_get();//ves
+ exclude_quiztrivial_effective = ch[12].tristate_get();//ves
+ exclude_golfdarfish_effective = ch[13].tristate_get();//ves
+
}

return key;
@@ -1014,6 +1035,13 @@
exclude_neogeo_effective = exclude_neogeo_orig;
exclude_deco_effective = exclude_deco_orig;
exclude_playchoice_effective = exclude_playchoice_orig;
+ exclude_mechanical_effective = exclude_mechanical_orig;//ves
+ exclude_mahjong_effective = exclude_mahjong_orig;//ves
+ exclude_beatmania_effective = exclude_beatmania_orig;//ves
+ exclude_pokercasino_effective = exclude_pokercasino_orig;//ves
+ exclude_quiztrivial_effective = exclude_quiztrivial_orig;//ves
+ exclude_golfdarfish_effective = exclude_golfdarfish_orig;//ves
+
}

void mame_mame::attrib_save()
@@ -1023,6 +1051,13 @@
exclude_neogeo_orig = exclude_neogeo_effective;
exclude_deco_orig = exclude_deco_effective;
exclude_playchoice_orig = exclude_playchoice_effective;
+ exclude_mechanical_orig = exclude_mechanical_effective;//ves
+ exclude_mahjong_orig = exclude_mahjong_effective;//ves
+ exclude_beatmania_orig = exclude_beatmania_effective;//ves
+ exclude_pokercasino_orig = exclude_pokercasino_effective;//ves
+ exclude_quiztrivial_orig = exclude_quiztrivial_effective;//ves
+ exclude_golfdarfish_orig = exclude_golfdarfish_effective;//ves
+
}

bool mame_mame::attrib_set(const std::string& value0, const std::string& value1)
@@ -1039,6 +1074,24 @@
} else if (value0 == "playchoice") {
if (!tristate(exclude_playchoice_orig, value1))
return false;
+ } else if (value0 == "mechanical") {//ves
+ if (!tristate(exclude_mechanical_orig, value1))
+ return false;//ves
+ } else if (value0 == "mahjong") {//ves
+ if (!tristate(exclude_mahjong_orig, value1))
+ return false;//ves
+ } else if (value0 == "beatmania") {//ves
+ if (!tristate(exclude_beatmania_orig, value1))
+ return false;//ves
+ } else if (value0 == "pokercasino") {//ves
+ if (!tristate(exclude_pokercasino_orig, value1))
+ return false;//ves
+ } else if (value0 == "quiztrivial") {//ves
+ if (!tristate(exclude_quiztrivial_orig, value1))
+ return false;//ves
+ } else if (value0 == "golfdarfish") {//ves
+ if (!tristate(exclude_golfdarfish_orig, value1))
+ return false;//ves
} else {
return false;
}
@@ -1052,6 +1105,13 @@
conf_string_set(config_context, section, tag, attrib_compile("neogeo", tristate(exclude_neogeo_orig)).c_str());
conf_string_set(config_context, section, tag, attrib_compile("deco", tristate(exclude_deco_orig)).c_str());
conf_string_set(config_context, section, tag, attrib_compile("playchoice", tristate(exclude_playchoice_orig)).c_str());
+ conf_string_set(config_context, section, tag, attrib_compile("mechanical", tristate(exclude_mechanical_orig)).c_str());//ves
+ conf_string_set(config_context, section, tag, attrib_compile("mahjong", tristate(exclude_mahjong_orig)).c_str());//ves
+ conf_string_set(config_context, section, tag, attrib_compile("beatmania", tristate(exclude_beatmania_orig)).c_str());//ves
+ conf_string_set(config_context, section, tag, attrib_compile("pokercasino", tristate(exclude_pokercasino_orig)).c_str());//ves
+ conf_string_set(config_context, section, tag, attrib_compile("quiztrivial", tristate(exclude_quiztrivial_orig)).c_str());//ves
+ conf_string_set(config_context, section, tag, attrib_compile("golfdarfish", tristate(exclude_golfdarfish_orig)).c_str());//ves
+
}

bool mame_mame::filter(const game& g) const
@@ -1071,6 +1131,30 @@
return false;
if (exclude_playchoice_effective == exclude_not && !g.flag_get(flag_derived_playchoice))
return false;
+ if (exclude_mechanical_effective == exclude && g.flag_get(flag_derived_mechanical))//ves
+ return false;
+ if (exclude_mechanical_effective == exclude_not && !g.flag_get(flag_derived_mechanical))
+ return false;//ves
+ if (exclude_mahjong_effective == exclude && g.flag_get(flag_derived_mahjong))//ves
+ return false;
+ if (exclude_mahjong_effective == exclude_not && !g.flag_get(flag_derived_mahjong))
+ return false;//ves
+ if (exclude_beatmania_effective == exclude && g.flag_get(flag_derived_beatmania))//ves
+ return false;
+ if (exclude_beatmania_effective == exclude_not && !g.flag_get(flag_derived_beatmania))
+ return false;//ves
+ if (exclude_pokercasino_effective == exclude && g.flag_get(flag_derived_pokercasino))//ves
+ return false;
+ if (exclude_pokercasino_effective == exclude_not && !g.flag_get(flag_derived_pokercasino))
+ return false;//ves
+ if (exclude_quiztrivial_effective == exclude && g.flag_get(flag_derived_quiztrivial))//ves
+ return false;
+ if (exclude_quiztrivial_effective == exclude_not && !g.flag_get(flag_derived_quiztrivial))
+ return false;//ves
+ if (exclude_golfdarfish_effective == exclude && g.flag_get(flag_derived_golfdarfish))//ves
+ return false;
+ if (exclude_golfdarfish_effective == exclude_not && !g.flag_get(flag_derived_golfdarfish))
+ return false;//ves

return true;
}
@@ -1083,6 +1167,7 @@
g.flag_set(gar.is_game_tag(bios.name_get(), "neogeo"), flag_derived_neogeo);
g.flag_set(gar.is_game_tag(bios.name_get(), "decocass"), flag_derived_deco);
g.flag_set(gar.is_game_tag(bios.name_get(), "playch10"), flag_derived_playchoice);
+
}

bool mame_mame::load_data(const game_set& gar)
diff -Nru advmenuplusDaesdae/advance/menu/emulator.h advmenuplus/advance/menu/emulator.h
--- advmenuplusDaesdae/advance/menu/emulator.h 2012-07-16 19:42:39.000000000 +0200
+++ advmenuplus/advance/menu/emulator.h 2012-08-04 11:56:07.417619280 +0200
@@ -164,6 +164,12 @@
static const unsigned flag_derived_neogeo = game::flag_user << 4;
static const unsigned flag_derived_deco = game::flag_user << 5;
static const unsigned flag_derived_playchoice = game::flag_user << 6;
+ static const unsigned flag_derived_mechanical = game::flag_user << 7;//ves
+ static const unsigned flag_derived_mahjong = game::flag_user << 8;//ves
+ static const unsigned flag_derived_beatmania = game::flag_user << 9;//ves
+ static const unsigned flag_derived_pokercasino = game::flag_user << 10;//ves
+ static const unsigned flag_derived_quiztrivial = game::flag_user << 11;//ves
+ static const unsigned flag_derived_golfdarfish = game::flag_user << 12;//ves

virtual int attrib_run(int x, int y) = 0;
virtual void attrib_load();
@@ -397,6 +403,19 @@
tristate_t exclude_deco_orig;
tristate_t exclude_playchoice_effective;
tristate_t exclude_playchoice_orig;
+ tristate_t exclude_mechanical_effective;//ves
+ tristate_t exclude_mechanical_orig;//ves
+ tristate_t exclude_mahjong_effective;//ves
+ tristate_t exclude_mahjong_orig;//ves
+ tristate_t exclude_beatmania_effective;//ves
+ tristate_t exclude_beatmania_orig;//ves
+ tristate_t exclude_pokercasino_effective;//ves
+ tristate_t exclude_pokercasino_orig;//ves
+ tristate_t exclude_quiztrivial_effective;//ves
+ tristate_t exclude_quiztrivial_orig;//ves
+ tristate_t exclude_golfdarfish_effective;//ves
+ tristate_t exclude_golfdarfish_orig;//ves
+
bool support_difficulty;
bool support_attenuation;
public:
diff -Nru advmenuplusDaesdae/advance/menu/emuxml.cc advmenuplus/advance/menu/emuxml.cc
--- advmenuplusDaesdae/advance/menu/emuxml.cc 2009-01-10 13:04:07.000000000 +0100
+++ advmenuplus/advance/menu/emuxml.cc 2012-08-04 12:39:16.205730694 +0200
@@ -135,6 +135,7 @@
return;
}
state->g->name_set(state->e->user_name_get() + "/" + string(s, len));
+
}
}

@@ -146,6 +147,47 @@
return;
}
state->g->auto_description_set(string(s, len));
+
+
+ //clasificacion por medio de los nombres, para casino poker etc...
+
+ string v = string(s, len);
+
+
+ if(v.find("Casino")!= string::npos || v.find("casino")!= string::npos || v.find("Poker")!= string::npos
+ || v.find("poker")!= string::npos || v.find("Card")!= string::npos || v.find("Fruit Bonus")!= string::npos
+ || v.find("Fruit Cocktail")!= string::npos || v.find("Brasil 8")!= string::npos || v.find("Bra$il")!= string::npos
+ || v.find("Brasil 9")!= string::npos || v.find("Ruleta")!= string::npos || v.find("Jockey")!= string::npos
+ || v.find("Lucky 2")!= string::npos || v.find("Lucky 7")!= string::npos || v.find("Lucky Roulette")!= string::npos
+ || v.find("Cherry Bonu")!= string::npos || v.find("Cherry Gold")!= string::npos || v.find("Cherry Master")!= string::npos
+ || v.find("Ruleta")!= string::npos || v.find("Buena Suerte")!= string::npos || v.find("Player's Edge")!= string::npos
+ || v.find("Touchmaster")!= string::npos)//ves
+ {
+ string a = v;
+ state->g->flag_set(v == a, emulator::flag_derived_pokercasino);//ves
+ }
+
+ if(v.find("Beatmania")!= string::npos || v.find("beatmania")!= string::npos || v.find("Dance Dance Revo")!= string::npos
+ || v.find("Dance Maniax")!= string::npos || v.find("Dance Freaks")!= string::npos || v.find("Dancing S")!= string::npos)
+ {
+ string b = v;
+ state->g->flag_set(v == b, emulator::flag_derived_beatmania);//ves
+ }
+
+ if(v.find("Quiz")!= string::npos || v.find("Trivia")!= string::npos || v.find("Funcube")!= string::npos)
+ {
+ string b = v;
+ state->g->flag_set(v == b, emulator::flag_derived_quiztrivial);//ves
+ }
+
+ if(v.find("Golf")!= string::npos || v.find("Bowling")!= string::npos || v.find("Darts")!= string::npos || v.find("Fisherman")!= string::npos)
+ {
+ string b = v;
+ state->g->flag_set(v == b, emulator::flag_derived_golfdarfish);//ves
+ }
+
+ // Bowling , Darts , Golf , Fisherman ?¿?¿?¿
+
}
}

@@ -190,6 +232,7 @@
return;
}
state->g->romof_set(state->e->user_name_get() + "/" + string(s, len));
+
}
}

@@ -297,10 +340,39 @@
return;
}
string v = string(s, len);
- state->g->flag_set(v == "vertical", emulator::flag_derived_vertical);
+ state->g->flag_set(v == "90"|| v == "270", emulator::flag_derived_vertical);//ves
}
}

+static void process_mechanical(struct state_t* state, enum token_t t, const char* s, unsigned len, const char** attributes)//ves
+{
+ if (t == token_data) {
+ if (!state->g) {
+ process_error(state, 0, "invalid state");
+ return;
+ }
+ string v = string(s, len);
+
+ if (v == "yes"){
+ state->g->flag_set(v == "yes", emulator::flag_derived_mechanical);//ves
+ } else if (v == "mahjong") {
+ state->g->flag_set(v == "mahjong", emulator::flag_derived_mahjong);//ves
+ }
+ }
+}//ves
+
+static void process_mahjong(struct state_t* state, enum token_t t, const char* s, unsigned len, const char** attributes)//ves
+{
+ if (t == token_data) {
+ if (!state->g) {
+ process_error(state, 0, "invalid state");
+ return;
+ }
+ string v = string(s, len);
+ state->g->flag_set(v == "mahjong", emulator::flag_derived_mahjong);//ves
+ }
+}//ves
+
static void process_videowidth(struct state_t* state, enum token_t t, const char* s, unsigned len, const char** attributes)
{
if (t == token_data) {
@@ -378,6 +450,7 @@
{ 2, { match_mamemessraine, match_gamemachine, "romof", 0, 0 }, process_romof },
{ 2, { match_mamemessraine, match_gamemachine, "rom", 0, 0 }, process_rom },
{ 2, { match_mamemessraine, match_gamemachine, "device", 0, 0 }, process_device },
+ { 2, { match_mamemessraine, match_gamemachine, "ismechanical", 0, 0 }, process_mechanical },//ves
{ 0, { 0, 0, 0, 0, 0 }, 0 }
};

@@ -386,17 +459,18 @@
{ 3, { match_mamemessraine, match_gamemachine, "rom", "size", 0 }, process_romsize },
{ 3, { match_mamemessraine, match_gamemachine, "device", "name", 0 }, process_devicename },
{ 3, { match_mamemessraine, match_gamemachine, "driver", "status", 0 }, process_driverstatus },
- { 3, { match_mamemessraine, match_gamemachine, "video", "screen", 0 }, process_videoscreen },
- { 3, { match_mamemessraine, match_gamemachine, "video", "orientation", 0 }, process_videoorientation },
- { 3, { match_mamemessraine, match_gamemachine, "video", "width", 0 }, process_videowidth },
- { 3, { match_mamemessraine, match_gamemachine, "video", "height", 0 }, process_videoheight },
- { 3, { match_mamemessraine, match_gamemachine, "video", "aspectx", 0 }, process_videoaspectx },
- { 3, { match_mamemessraine, match_gamemachine, "video", "aspecty", 0 }, process_videoaspecty },
+ { 3, { match_mamemessraine, match_gamemachine, "display", "type", 0 }, process_videoscreen },//ves
+ { 3, { match_mamemessraine, match_gamemachine, "display", "rotate", 0 }, process_videoorientation },//ves
+ { 3, { match_mamemessraine, match_gamemachine, "display", "width", 0 }, process_videowidth },//ves
+ { 3, { match_mamemessraine, match_gamemachine, "display", "height", 0 }, process_videoheight },//ves
+ { 3, { match_mamemessraine, match_gamemachine, "display", "aspectx", 0 }, process_videoaspectx },//ves
+ { 3, { match_mamemessraine, match_gamemachine, "display", "aspecty", 0 }, process_videoaspecty },//ves
{ 0, { 0, 0, 0, 0, 0 }, 0 }
};

static struct conversion_t CONV4[] = {
{ 4, { match_mamemessraine, match_gamemachine, "device", "extension", "name" }, process_deviceextensionname },
+ { 4, { match_mamemessraine, match_gamemachine, "input", "control", "type" }, process_mechanical },//ves mahjongs
{ 0, { 0, 0, 0, 0, 0 }, 0 }
};

 
Top
647 replies since 8/9/2009, 21:56   30306 views
  Share