[gnome-games/wip/aplazas/type-registration: 1/5] pc-engine: Move cartridge types to simple types



commit 0441786679b4c089f8ea3b4c1c028da07a79f260
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu May 25 17:33:26 2017 +0200

    pc-engine: Move cartridge types to simple types

 plugins/pc-engine/src/pc-engine-plugin.vala |   30 ++------------------------
 src/retro/retro-simple-types.vala           |    1 +
 2 files changed, 4 insertions(+), 27 deletions(-)
---
diff --git a/plugins/pc-engine/src/pc-engine-plugin.vala b/plugins/pc-engine/src/pc-engine-plugin.vala
index a6370de..42f8a3e 100644
--- a/plugins/pc-engine/src/pc-engine-plugin.vala
+++ b/plugins/pc-engine/src/pc-engine-plugin.vala
@@ -2,48 +2,24 @@
 
 private class Games.PcEnginePlugin : Object, Plugin {
        private const string FINGERPRINT_PREFIX = "pc-engine";
-
        private const string MIME_TYPE = "application/x-pc-engine-rom";
-       private const string PLATFORM = "TurboGrafx16";
-
        private const string CUE_MIME_TYPE = "application/x-cue";
        private const string CD_MAGIC_VALUE = "PC Engine CD-ROM SYSTEM";
        private const string CD_PLATFORM = "TurboGrafxCD";
 
        public string[] get_mime_types () {
-               return {
-                       MIME_TYPE,
-                       CUE_MIME_TYPE,
-               };
+               return { CUE_MIME_TYPE };
        }
 
        public UriGameFactory[] get_uri_game_factories () {
                var game_uri_adapter = new GenericGameUriAdapter (game_for_uri);
                var factory = new GenericUriGameFactory (game_uri_adapter);
-               factory.add_mime_type (MIME_TYPE);
+               factory.add_mime_type (CUE_MIME_TYPE);
 
-               var cd_game_uri_adapter = new GenericGameUriAdapter (cd_game_for_uri);
-               var cd_factory = new GenericUriGameFactory (cd_game_uri_adapter);
-               cd_factory.add_mime_type (CUE_MIME_TYPE);
-
-               return { factory, cd_factory };
+               return { factory };
        }
 
        private static Game game_for_uri (Uri uri) throws Error {
-               var uid = new FingerprintUid (uri, FINGERPRINT_PREFIX);
-               var title = new FilenameTitle (uri);
-               var icon = new DummyIcon ();
-               var media = new GriloMedia (title, MIME_TYPE);
-               var cover = new CompositeCover ({
-                       new LocalCover (uri),
-                       new GriloCover (media, uid)});
-               var core_source = new RetroCoreSource (PLATFORM, { MIME_TYPE });
-               var runner = new RetroRunner (core_source, uri, uid, title);
-
-               return new GenericGame (title, icon, cover, runner);
-       }
-
-       private static Game cd_game_for_uri (Uri uri) throws Error {
                if (!is_valid_disc (uri))
                        throw new PcEngineError.INVALID_DISC ("“%s” isn’t a valid PC-Engine CD-ROM² disc.", 
uri.to_string ());
 
diff --git a/src/retro/retro-simple-types.vala b/src/retro/retro-simple-types.vala
index dd63a2c..33b25d0 100644
--- a/src/retro/retro-simple-types.vala
+++ b/src/retro/retro-simple-types.vala
@@ -18,6 +18,7 @@ namespace Games {
                { "application/x-n64-rom", true, "Nintendo64", "nintendo-64" },
                { "application/x-neo-geo-pocket-rom", true, "NeoGeoPocket", "neo-geo-pocket" },
                { "application/x-nes-rom", true, "NintendoEntertainmentSystem", "nes" },
+               { "application/x-pc-engine-rom", true, "TurboGrafx16", "pc-engine" },
                { "application/x-sega-pico-rom", true, "SegaPico", "sega-pico" },
                { "application/x-sg1000-rom", true, "SG1000", "sg-1000" },
                { "application/x-sms-rom", true, "MasterSystem", "master-system" },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]