ARCADE FOREVER

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

« Older   Newer »
  Share  
VeS
view post Posted on 26/7/2012, 14:57 by: VeS     +1   -1
Avatar

V.I.P.

Group:
Usuarios AFFA
Posts:
526
Reputation:
+10

Status:


QUOTE (daesdae @ 26/7/2012, 12:26) 
Me imagino el subidon cuando por fin lo viste funcionar ¿no?, almeno de alivio

¿Y has conseguido que aparezca como opcion en el menu? si es así, ya estas preparado para todo. Solo necesitas, como todos, tiempo.

...pero,..., pero ¿donde esta el codigo? :woot:

Pues si subidon subidon , pero no se muy bien como lo he hecho , ya que si te fijas en el diff al final las funciones etc.. que apunta en el apartado Mechanical he tenido que decirle que lo haga con el playchoice, y mira que he creado todas las rutinas etc... pero no habia forma.

Jejeje esperando el codigo eeee jajaja pues a esperar jajajaja , no no lo coloco ya, esta limpito pero voy a seguir probando a quitarle cosicas que no sean necesarias, en el diff esta todo Clasificacion de Juegos Vectoriales Verticales Cassette Neogeo Playchoice Mechanical.


CODE
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-07-26 15:47:55.927790397 +0200
@@ -492,6 +492,7 @@
        exclude_bad_orig = exclude;
        exclude_vector_orig = include;
        exclude_vertical_orig = include;
+        exclude_ismechanical_orig = include;//ves
}

void mame_info::attrib_load()
@@ -501,6 +502,7 @@
        exclude_bad_effective = exclude_bad_orig;
        exclude_vector_effective = exclude_vector_orig;
        exclude_vertical_effective = exclude_vertical_orig;
+        exclude_ismechanical_effective = exclude_ismechanical_orig;//ves
}

void mame_info::attrib_save()
@@ -510,6 +512,7 @@
        exclude_bad_orig = exclude_bad_effective;
        exclude_vector_orig = exclude_vector_effective;
        exclude_vertical_orig = exclude_vertical_effective;
+        exclude_ismechanical_orig = exclude_ismechanical_effective;//ves
}

bool mame_info::attrib_set(const std::string& value0, const std::string& value1)
@@ -529,6 +532,9 @@
        } else if (value0 == "vertical") {
                if (!tristate(exclude_vertical_orig, value1))
                        return false;
+        } else if (value0 == "mechanical") {//ves
+                if (!tristate(exclude_ismechanical_orig, value1))//ves
+                        return false;//ves
        } else {
                return false;
        }
@@ -542,6 +548,7 @@
        conf_string_set(config_context, section, tag, attrib_compile("bad", tristate(exclude_bad_orig)).c_str());
        conf_string_set(config_context, section, tag, attrib_compile("vector", tristate(exclude_vector_orig)).c_str());
        conf_string_set(config_context, section, tag, attrib_compile("vertical", tristate(exclude_vertical_orig)).c_str());
+        conf_string_set(config_context, section, tag, attrib_compile("mechanical", tristate(exclude_ismechanical_orig)).c_str());//ves
}

bool mame_info::filter(const game& g) const
@@ -579,6 +586,10 @@
                return false;
        if (exclude_vertical_effective == exclude_not && !bios.flag_get(flag_derived_vertical))
                return false;
+        if (exclude_ismechanical_effective == exclude && bios.flag_get(flag_derived_ismechanical))//ves
+                return false;//ves
+        if (exclude_ismechanical_effective == exclude_not && !bios.flag_get(flag_derived_ismechanical))//ves
+                return false;//ves

        // is a resource, not a game
        if (g.flag_get(flag_derived_resource))
@@ -631,6 +642,9 @@
                                } else if (strcmp(info_text_get(), "romof")==0) {
                                        if (info_token_get() != info_symbol) return false;
                                        g.romof_set(user_name_get() + "/" + info_text_get());
+                                } else if (strcmp(info_text_get(), "ismechanical")==0) {//ves seguro???
+                                        if (info_token_get() != info_symbol) return false;
+                                        g.romof_set(user_name_get() + "/" + info_text_get());
                                } else if (strcmp(info_text_get(), "driver")==0) {
                                        if (info_token_get() != info_open)  return false;
                                        token = info_token_get();
@@ -988,7 +1002,8 @@
        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_ismechanical_effective, 0));//ves
+        
        choice_bag::iterator i = ch.begin();

        int key = ch.run(" " + user_name_get() + " Filters", x, y, ATTRIB_CHOICE_DX, i);
@@ -1002,6 +1017,7 @@
                exclude_neogeo_effective = ch[5].tristate_get();
                exclude_deco_effective = ch[6].tristate_get();
                exclude_playchoice_effective = ch[7].tristate_get();
+                exclude_ismechanical_effective = ch[8].tristate_get();//ves
        }

        return key;
@@ -1014,6 +1030,7 @@
        exclude_neogeo_effective = exclude_neogeo_orig;
        exclude_deco_effective = exclude_deco_orig;
        exclude_playchoice_effective = exclude_playchoice_orig;
+
}

void mame_mame::attrib_save()
@@ -1052,6 +1069,7 @@
        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());
+
}

bool mame_mame::filter(const game& g) const
@@ -1071,7 +1089,7 @@
                return false;
        if (exclude_playchoice_effective == exclude_not && !g.flag_get(flag_derived_playchoice))
                return false;
-
+        
        return true;
}

@@ -1083,6 +1101,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);
+        g.flag_set(gar.is_game_tag(bios.name_get(), "yes"), flag_derived_playchoice);//ves he quitado el playch
}

bool mame_mame::load_data(const game_set& gar)
@@ -2649,6 +2668,9 @@
                                } else if (strcmp(info_text_get(), "cloneof")==0) {
                                        if (info_token_get() != info_symbol) return false;
                                        g.cloneof_set(user_name_get() + "/" + info_text_get());
+                                } else if (strcmp(info_text_get(), "ismechanical")==0) {//ves seguro??
+                                        if (info_token_get() != info_symbol) return false;
+                                        g.cloneof_set(user_name_get() + "/" + info_text_get());
                                } else if (strcmp(info_text_get(), "romof")==0) {
                                        if (info_token_get() != info_symbol) return false;
                                        g.romof_set(user_name_get() + "/" + info_text_get());
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-07-26 15:20:26.563719412 +0200
@@ -164,6 +164,7 @@
        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_ismechanical = game::flag_user << 7;//ves

        virtual int attrib_run(int x, int y) = 0;
        virtual void attrib_load();
@@ -347,6 +348,8 @@
        tristate_t exclude_vector_orig;
        tristate_t exclude_vertical_effective;
        tristate_t exclude_vertical_orig;
+        tristate_t exclude_ismechanical_effective;//ves
+        tristate_t exclude_ismechanical_orig;//ves

        bool load_info(game_set& gar);
        bool load_xml(std::istream& is, game_set& gar);
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-07-26 15:21:57.875723342 +0200
@@ -297,7 +297,7 @@
                        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
        }
}

@@ -349,6 +349,19 @@
        }
}

+static void process_ismechanical(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 == "yes", emulator::flag_derived_ismechanical);//ves
+
+        }
+}//ves
+
static const char* match_mamemessraine = "mame|mess|raine";
static const char* match_gamemachine = "game|machine";

@@ -376,6 +389,7 @@
        { 2, { match_mamemessraine, match_gamemachine, "year", 0, 0 }, process_year },
        { 2, { match_mamemessraine, match_gamemachine, "cloneof", 0, 0 }, process_cloneof },
        { 2, { match_mamemessraine, match_gamemachine, "romof", 0, 0 }, process_romof },
+        { 2, { match_mamemessraine, match_gamemachine, "ismechanical", 0, 0 }, process_ismechanical },//ves
        { 2, { match_mamemessraine, match_gamemachine, "rom", 0, 0 }, process_rom },
        { 2, { match_mamemessraine, match_gamemachine, "device", 0, 0 }, process_device },
        { 0, { 0, 0, 0, 0, 0 }, 0 }
@@ -386,12 +400,12 @@
        { 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 }
};


Los juegos Mechanical son los pinball tragaperras dianas etc... que no son videojuegos como tal.


Saludos.
 
Top
647 replies since 8/9/2009, 21:56   30305 views
  Share