Previous 199869 Revisions Next

r37089 Friday 10th April, 2015 at 14:51:25 UTC by Robbbert
(MESS) pegasus : modernised code (nw)
[/trunk]makefile
[3rdparty/bgfx/src]bgfx.cpp bgfx_p.h renderer_gl.h
[3rdparty/genie]makefile
[3rdparty/genie/build/gmake.bsd]Makefile genie.make
[3rdparty/genie/build/gmake.solaris]Makefile genie.make
[3rdparty/genie/scripts]genie.lua
[3rdparty/genie/src/base]cmdline.lua
[3rdparty/genie/src/host]premake.h scripts.c
[3rdparty/mongoose]mongoose.c
[scripts]genie.lua toolchain.lua
[scripts/src]3rdparty.lua main.lua
[src/mess/drivers]pegasus.c
[src/osd]osdcomm.h

trunk/3rdparty/bgfx/src/bgfx.cpp
r245600r245601
3333   {
3434      g_bgfxEaglLayer = _layer;
3535   }
36#elif BX_PLATFORM_LINUX || BX_PLATFORM_FREEBSD
36#elif BX_PLATFORM_LINUX
3737   void*    g_bgfxX11Display;
3838   uint32_t g_bgfxX11Window;
3939   void*    g_bgfxGLX;
trunk/3rdparty/bgfx/src/bgfx_p.h
r245600r245601
221221   extern ::ANativeWindow* g_bgfxAndroidWindow;
222222#elif BX_PLATFORM_IOS
223223   extern void* g_bgfxEaglLayer;
224#elif BX_PLATFORM_LINUX || BX_PLATFORM_FREEBSD
224#elif BX_PLATFORM_LINUX
225225   extern void*    g_bgfxX11Display;
226226   extern uint32_t g_bgfxX11Window;
227227   extern void*    g_bgfxGLX;
trunk/3rdparty/bgfx/src/renderer_gl.h
r245600r245601
1010         || BX_PLATFORM_ANDROID \
1111         || BX_PLATFORM_EMSCRIPTEN \
1212         || BX_PLATFORM_LINUX \
13         || BX_PLATFORM_FREEBSD \
1413         || BX_PLATFORM_QNX \
1514         || BX_PLATFORM_RPI \
1615         || BX_PLATFORM_WINDOWS \
r245600r245601
2423
2524#define BGFX_USE_GL_DYNAMIC_LIB (0 \
2625         || BX_PLATFORM_LINUX \
27         || BX_PLATFORM_FREEBSD \
2826         || BX_PLATFORM_OSX \
2927         || BX_PLATFORM_WINDOWS \
3028         )
r245600r245601
3634#         define GL_ARB_shader_objects // OSX collsion with GLhandleARB in gltypes.h
3735#      endif // BX_PLATFORM_OSX
3836#   else
39#      if BX_PLATFORM_LINUX || BX_PLATFORM_FREEBSD
37#      if BX_PLATFORM_LINUX
4038#         define GL_PROTOTYPES
4139#         define GL_GLEXT_LEGACY
4240#         include <GL/gl.h>
r245600r245601
586584#   include "glcontext_ppapi.h"
587585#elif BX_PLATFORM_WINDOWS
588586#   include <windows.h>
589#elif BX_PLATFORM_LINUX || BX_PLATFORM_FREEBSD
587#elif BX_PLATFORM_LINUX
590588#   include "glcontext_glx.h"
591589#elif BX_PLATFORM_OSX
592590#   include "glcontext_nsgl.h"
trunk/3rdparty/genie/makefile
r245600r245601
44#
55
66UNAME := $(shell uname)
7ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin SunOS FreeBSD GNU/kFreeBSD NetBSD OpenBSD))
7ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin))
88ifeq ($(UNAME),$(filter $(UNAME),Darwin))
99OS=darwin
1010else
11ifeq ($(UNAME),$(filter $(UNAME),SunOS))
12OS=solaris
13else
14ifeq ($(UNAME),$(filter $(UNAME),FreeBSD GNU/kFreeBSD NetBSD OpenBSD))
15OS=bsd
16else
1711OS=linux
1812endif
19endif
20endif
2113else
2214OS=windows
2315endif
r245600r245601
2921SILENT?=@
3022
3123$(GENIE):
32   $(SILENT) $(MAKE) -C build/gmake.$(OS)
24   $(SILENT) make -C build/gmake.$(OS)
3325
3426all: $(GENIE)
3527
3628clean:
37   $(SILENT) $(MAKE) -C build/gmake.$(OS) clean
29   $(SILENT) make -C build/gmake.$(OS) clean
3830   $(SILENT) -rm -rf bin
3931
4032rebuild:
41   $(SILENT) $(MAKE) -C build/gmake.$(OS) clean all
33   $(SILENT) make -C build/gmake.$(OS) clean all
4234
4335release-windows release-darwin: $(GENIE)
4436   $(GENIE) release
45   $(SILENT) $(MAKE) -C build/gmake.$(OS) clean all
37   $(SILENT) make -C build/gmake.$(OS) clean all
4638   $(SILENT) git checkout src/host/version.h
4739
4840release-linux: $(GENIE)
4941   $(SILENT) $(GENIE) release
50   $(SILENT) $(MAKE) -C build/gmake.darwin  clean all CC=x86_64-apple-darwin13-clang++
51   $(SILENT) $(MAKE) -C build/gmake.linux   clean all
52   $(SILENT) $(MAKE) -C build/gmake.windows clean all CC=i686-w64-mingw32-gcc
42   $(SILENT) make -C build/gmake.darwin  clean all CC=x86_64-apple-darwin13-clang++
43   $(SILENT) make -C build/gmake.linux   clean all
44   $(SILENT) make -C build/gmake.windows clean all CC=i686-w64-mingw32-gcc
5345   $(SILENT) git checkout src/host/version.h
5446
5547release: release-$(OS)
trunk/3rdparty/genie/scripts/genie.lua
r245600r245601
6666      configuration "bsd"
6767         targetdir   "../bin/bsd"
6868
69      configuration "solaris"
70         targetdir   "../bin/solaris"
71         defines     { "_REENTRANT" }
72         buildoptions { "-std=gnu99" }
73         links       { "dl" }
74
75      configuration "linux or bsd or solaris"
69      configuration "linux or bsd"
7670         defines     { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
7771         links       { "m" }
7872         linkoptions { "-rdynamic" }
trunk/3rdparty/genie/src/base/cmdline.lua
r245600r245601
5454         { "bsd",      "OpenBSD, NetBSD, or FreeBSD" },
5555         { "linux",    "Linux" },
5656         { "macosx",   "Apple Mac OS X" },
57         { "solaris",  "Solaris" },
5857         { "windows",  "Microsoft Windows" },
5958      }
6059   }
trunk/3rdparty/genie/src/host/premake.h
r245600r245601
1818#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
1919#define PLATFORM_BSD      (1)
2020#define PLATFORM_STRING   "bsd"
21#elif defined(__sun__) || defined(__svr4__)
22#define PLATFORM_SOLARIS  (1)
23#define PLATFORM_STRING   "solaris"
2421#elif defined(__APPLE__) && defined(__MACH__)
2522#define PLATFORM_MACOSX   (1)
2623#define PLATFORM_STRING   "macosx"
trunk/3rdparty/genie/src/host/scripts.c
r245600r245601
9898   "\nif not name then\nif type(premake.CurrentContainer) == \"project\" then\nreturn premake.CurrentContainer.solution\nelse\nreturn premake.CurrentContainer\nend\nend\npremake.CurrentContainer = premake.solution.get(name)\nif (not premake.CurrentContainer) then\npremake.CurrentContainer = premake.solution.new(name)\nend\nconfiguration { }\nreturn premake.CurrentContainer\nend\nfunction group(name)\nif not name then\nreturn premake.CurrentGroup\nend\npremake.CurrentGroup = name\nreturn premake.CurrentGroup\nend\nfunction newaction(a)\npremake.action.add(a)\nend\nfunction newoption(opt)\npremake.option.add(opt)\nend\n",
9999
100100   /* base/cmdline.lua */
101   "newoption \n{\ntrigger     = \"cc\",\nvalue       = \"VALUE\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC (gcc/g++)\" },\n{ \"ow\",  \"OpenWatcom\"        },\n}\n}\nnewoption\n{\ntrigger     = \"dotnet\",\nvalue       = \"VALUE\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"msnet\",   \"Microsoft .NET (csc)\" },\n{ \"mono\",    \"Novell Mono (mcs)\"    },\n{ \"pnet\",    \"Portable.NET (cscc)\"  },\n}\n}\nnewoption\n{\ntrigger     = \"file\",\nvalue       = \"FILE\",\ndescription = \"Read FILE as a Premake script; default is 'premake4.lua'\"\n}\nnewoption\n{\ntrigger     = \"help\",\ndescription = \"Display this information\"\n}\nnewoption\n{\ntrigger     = \"os\",\nvalue       = \"VALUE\",\ndescription = \"Generate files for a different operating system\",\nallowed = {\n{ \"bsd\",      \"OpenBSD, NetBSD, or FreeBSD\" },\n{ \"linux\",    \"Linux\" },\n{ \"macosx\",   \"Apple Mac OS X\" },\n{ \"solaris\",  \"Solaris\" },\n{ \"windows\",  \"Microsoft W"
102   "indows\" },\n}\n}\nnewoption\n{\ntrigger     = \"platform\",\nvalue       = \"VALUE\",\ndescription = \"Add target architecture (if supported by action)\",\nallowed = {\n{ \"x32\",         \"32-bit\" },\n{ \"x64\",         \"64-bit\" },\n{ \"universal\",   \"Mac OS X Universal, 32- and 64-bit\" },\n{ \"universal32\", \"Mac OS X Universal, 32-bit only\" },\n{ \"universal64\", \"Mac OS X Universal, 64-bit only\" },\n{ \"ps3\",         \"Playstation 3 (experimental)\" },\n{ \"xbox360\",     \"Xbox 360 (experimental)\" },\n{ \"ARM\",         \"ARM (Microsoft)\" },\n}\n}\nnewoption\n{\ntrigger     = \"scripts\",\nvalue       = \"path\",\ndescription = \"Search for additional scripts on the given path\"\n}\nnewoption\n{\ntrigger     = \"version\",\ndescription = \"Display version information\"\n}\n",
101   "newoption \n{\ntrigger     = \"cc\",\nvalue       = \"VALUE\",\ndescription = \"Choose a C/C++ compiler set\",\nallowed = {\n{ \"gcc\", \"GNU GCC (gcc/g++)\" },\n{ \"ow\",  \"OpenWatcom\"        },\n}\n}\nnewoption\n{\ntrigger     = \"dotnet\",\nvalue       = \"VALUE\",\ndescription = \"Choose a .NET compiler set\",\nallowed = {\n{ \"msnet\",   \"Microsoft .NET (csc)\" },\n{ \"mono\",    \"Novell Mono (mcs)\"    },\n{ \"pnet\",    \"Portable.NET (cscc)\"  },\n}\n}\nnewoption\n{\ntrigger     = \"file\",\nvalue       = \"FILE\",\ndescription = \"Read FILE as a Premake script; default is 'premake4.lua'\"\n}\nnewoption\n{\ntrigger     = \"help\",\ndescription = \"Display this information\"\n}\nnewoption\n{\ntrigger     = \"os\",\nvalue       = \"VALUE\",\ndescription = \"Generate files for a different operating system\",\nallowed = {\n{ \"bsd\",      \"OpenBSD, NetBSD, or FreeBSD\" },\n{ \"linux\",    \"Linux\" },\n{ \"macosx\",   \"Apple Mac OS X\" },\n{ \"windows\",  \"Microsoft Windows\" },\n}\n}\nnewoption\n{"
102   "\ntrigger     = \"platform\",\nvalue       = \"VALUE\",\ndescription = \"Add target architecture (if supported by action)\",\nallowed = {\n{ \"x32\",         \"32-bit\" },\n{ \"x64\",         \"64-bit\" },\n{ \"universal\",   \"Mac OS X Universal, 32- and 64-bit\" },\n{ \"universal32\", \"Mac OS X Universal, 32-bit only\" },\n{ \"universal64\", \"Mac OS X Universal, 64-bit only\" },\n{ \"ps3\",         \"Playstation 3 (experimental)\" },\n{ \"xbox360\",     \"Xbox 360 (experimental)\" },\n{ \"ARM\",         \"ARM (Microsoft)\" },\n}\n}\nnewoption\n{\ntrigger     = \"scripts\",\nvalue       = \"path\",\ndescription = \"Search for additional scripts on the given path\"\n}\nnewoption\n{\ntrigger     = \"version\",\ndescription = \"Display version information\"\n}\n",
103103
104104   /* base/inspect.lua */
105105   "-- Copyright (c) 2013 Enrique GarcĂ­a Cota\nlocal function smartQuote(str)\n  if str:match('\"') and not str:match(\"'\") then\n    return \"'\" .. str .. \"'\"\n  end\n  return '\"' .. str:gsub('\"', '\\\\\"') .. '\"'\nend\nlocal controlCharsTranslation = {\n  [\"\\a\"] = \"\\\\a\",  [\"\\b\"] = \"\\\\b\", [\"\\f\"] = \"\\\\f\",  [\"\\n\"] = \"\\\\n\",\n  [\"\\r\"] = \"\\\\r\",  [\"\\t\"] = \"\\\\t\", [\"\\v\"] = \"\\\\v\"\n}\nlocal function escapeChar(c) return controlCharsTranslation[c] end\nlocal function escape(str)\n  local result = str:gsub(\"\\\\\", \"\\\\\\\\\"):gsub(\"(%c)\", escapeChar)\n  return result\nend\nlocal function isIdentifier(str)\n  return type(str) == 'string' and str:match( \"^[_%a][_%a%d]*$\" )\nend\nlocal function isArrayKey(k, length)\n  return type(k) == 'number' and 1 <= k and k <= length\nend\nlocal function isDictionaryKey(k, length)\n  return not isArrayKey(k, length)\nend\nlocal defaultTypeOrders = {\n  ['number']   = 1, ['boolean']  = 2, ['string'] = 3, ['table'] = 4,\n  ['fu"
trunk/3rdparty/mongoose/mongoose.c
r245600r245601
28112811// Copyright(c) By Steve Reid <steve@edmweb.com>
28122812#define SHA1HANDSOFF
28132813#if defined(__sun)
2814//#include "solarisfixes.h"
2814#include "solarisfixes.h"
28152815#endif
28162816
28172817union char64long16 { unsigned char c[64]; uint32_t l[16]; };
trunk/makefile
r245600r245601
100100endif
101101ifeq ($(firstword $(filter Solaris,$(UNAME))),Solaris)
102102OS := solaris
103GENIEOS := solaris
104103endif
105ifeq ($(firstword $(filter SunOS,$(UNAME))),SunOS)
106OS := solaris
107GENIEOS := solaris
108endif
109104ifeq ($(firstword $(filter FreeBSD,$(UNAME))),FreeBSD)
110105OS := freebsd
111GENIEOS := bsd
112106endif
113107ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD)
114108OS := freebsd
115GENIEOS := bsd
116109endif
117110ifeq ($(firstword $(filter NetBSD,$(UNAME))),NetBSD)
118111OS := netbsd
119GENIEOS := bsd
120112endif
121113ifeq ($(firstword $(filter OpenBSD,$(UNAME))),OpenBSD)
122114OS := openbsd
123GENIEOS := bsd
124115endif
125116ifeq ($(firstword $(filter Darwin,$(UNAME))),Darwin)
126117OS := macosx
r245600r245601
257248OSD := sdl
258249endif
259250
260ifeq ($(TARGETOS),freebsd)
261OSD := sdl
262endif
263
264ifeq ($(TARGETOS),solaris)
265OSD := sdl
266endif
267
268251ifeq ($(TARGETOS),macosx)
269252OSD := sdl
270253endif
r245600r245601
593576CHECK_CLANG      :=
594577else
595578GCC_VERSION      := $(shell $(subst @,,$(CC)) -dumpversion 2> /dev/null)
596ifneq ($(OS),solaris)
597579CLANG_VERSION    := $(shell clang --version  2> /dev/null | grep 'LLVM [0-9]\.[0-9]' -o | grep '[0-9]\.[0-9]' -o | head -n 1)
598endif
599580PYTHON_AVAILABLE := $(shell $(PYTHON) --version > /dev/null 2>&1 && echo python)
600581CHECK_CLANG      := $(shell gcc --version  2> /dev/null | grep 'clang' | head -n 1)
601582endif
r245600r245601
859840xcode4-ios: generate
860841   $(SILENT) $(GENIE) $(PARAMS) --targetos=macosx --xcode=ios xcode4
861842
862#-------------------------------------------------
863# gmake-solaris
864#-------------------------------------------------
865843
866
867$(PROJECTDIR)/gmake-solaris/Makefile: makefile $(SCRIPTS) $(GENIE)
868   $(SILENT) $(GENIE) $(PARAMS) --gcc=solaris --gcc_version=$(GCC_VERSION) gmake
869
870.PHONY: solaris_x64
871solaris_x64: generate $(PROJECTDIR)/gmake-solaris/Makefile
872   $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-solaris config=$(CONFIG)64
873
874.PHONY: solaris
875solaris: solaris_x86
876
877.PHONY: solaris_x86
878solaris_x86: generate $(PROJECTDIR)/gmake-solaris/Makefile
879   $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-solaris config=$(CONFIG)32
880
881
882844#-------------------------------------------------
883# gmake-freebsd
884#-------------------------------------------------
885
886
887$(PROJECTDIR)/gmake-freebsd/Makefile: makefile $(SCRIPTS) $(GENIE)
888   $(SILENT) $(GENIE) $(PARAMS) --gcc=freebsd --gcc_version=$(GCC_VERSION) gmake
889
890.PHONY: freebsd_x64
891freebsd_x64: generate $(PROJECTDIR)/gmake-freebsd/Makefile
892   $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-freebsd config=$(CONFIG)64
893
894.PHONY: freebsd
895freebsd: freebsd_x86
896
897.PHONY: freebsd_x86
898freebsd_x86: generate $(PROJECTDIR)/gmake-freebsd/Makefile
899   $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-freebsd config=$(CONFIG)32
900
901
902#-------------------------------------------------
903845# Clean/bootstrap
904846#-------------------------------------------------
905847
trunk/scripts/genie.lua
r245600r245601
4141end
4242
4343function layoutbuildtask(_folder, _name)
44   return { MAME_DIR .. "src/".._folder.."/".. _name ..".lay" ,    GEN_DIR .. _folder .. "/".._name..".lh",   
45      {  MAME_DIR .. "src/build/file2str.py" }, {"@echo Converting src/".._folder.."/".._name..".lay...",    PYTHON .. " $(1) $(<) $(@) layout_".._name }};
44   return { MAME_DIR .. "src/".._folder.."/".. _name ..".lay" ,    GEN_DIR .. _folder .. "/".._name..".lh",    {  MAME_DIR .. "src/build/file2str.py" }, {"@echo Converting src/".._folder.."/".._name..".lay...",    PYTHON .. " $(1) $(<) $(@) layout_".._name }};
4645end
4746
4847CPUS = {}
r245600r245601
8180      { "windows",       "Windows"                },
8281      { "os2",           "OS/2 eComStation"       },
8382      { "haiku",         "Haiku"                  },
84      { "solaris",       "Solaris SunOS"          },
8583   },
8684}
8785
r245600r245601
613611   if _ACTION == "gmake" then
614612
615613   --we compile C-only to C89 standard with GNU extensions
616if (_OPTIONS["targetos"]=="solaris") then
617614   buildoptions_c {
618      "-std=gnu99",
619   }
620else
621   buildoptions_c {
622615      "-std=gnu89",
623616
624617   }
625end   
626
627618   
628619if _OPTIONS["CPP11"]=="1" then
629620   buildoptions_cpp {
r245600r245601
776767-- warnings only applicable to C compiles
777768   buildoptions_c {
778769      "-Wpointer-arith",
770      "-Wbad-function-cast",
779771      "-Wstrict-prototypes",
780772   }
781   
782if _OPTIONS["targetos"]~="freebsd" then
783   buildoptions_c {
784      "-Wbad-function-cast",
785   }
786end
787773
788774-- warnings only applicable to OBJ-C compiles
789775   buildoptions_objc {
r245600r245601
10611047      includedirs {
10621048         MAME_DIR .. "3rdparty/dxsdk/Include"
10631049      }
1064configuration { "vs2015" }
1065      buildoptions {
1066         "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration
1067         "/wd4457", -- warning C4457: declaration of 'xxx' hides function parameter
1068         "/wd4458", -- warning C4458: declaration of 'xxx' hides class member
1069         "/wd4459", -- warning C4459: declaration of 'xxx' hides global declaration
1070         "/wd4838", -- warning C4838: conversion from 'xxx' to 'yyy' requires a narrowing conversion
1071         "/wd4091", -- warning C4091: 'typedef ': ignored on left of '' when no variable is declared
1072         "/wd4463", -- warning C4463: overflow; assigning 1 to bit-field that can only hold values from -1 to 0
1073         "/wd4297", -- warning C4297: 'xxx::~xxx': function assumed not to throw an exception but does
1074      }
1075     
1050
10761051configuration { "x32", "vs*" }
10771052      libdirs {
10781053         MAME_DIR .. "3rdparty/dxsdk/lib/x86",
trunk/scripts/src/3rdparty.lua
r245600r245601
383383--------------------------------------------------
384384-- portmidi library objects
385385--------------------------------------------------
386if _OPTIONS["NO_USE_MIDI"]=="0" then
386
387387project "portmidi"
388388   uuid "587f2da6-3274-4a65-86a2-f13ea315bb98"
389389   kind "StaticLib"
r245600r245601
433433         MAME_DIR .. "3rdparty/portmidi/porttime/ptmacosx_mach.c",
434434      }
435435   end
436end   
436   
437437--------------------------------------------------
438438-- BGFX library objects
439439--------------------------------------------------
r245600r245601
464464      includedirs {
465465         MAME_DIR .. "3rdparty/bx/include/compat/osx",
466466      }
467     
468   configuration { "freebsd" }
469      includedirs {
470         MAME_DIR .. "3rdparty/bx/include/compat/freebsd",
471      }
472
467   
473468   configuration { "gmake" }
474469      buildoptions {     
475470         "-Wno-uninitialized",
trunk/scripts/src/main.lua
r245600r245601
5959      "zlib",
6060      "jsoncpp",
6161      "mongoose",
62      "portmidi",
6263   }
63   if _OPTIONS["NO_USE_MIDI"]=="0" then
64      links {
65         "portmidi",
66      }
67   end
6864   if (USE_BGFX == 1) then
6965      links {
7066         "bgfx"
trunk/scripts/toolchain.lua
r245600r245601
2929      { "pnacl",         "Native Client - PNaCl"  },
3030      { "qnx-arm",       "QNX/Blackberry - ARM"   },
3131      { "rpi",           "RaspberryPi"            },
32      { "solaris",       "Solaris"                },
3332   },
3433}
3534
r245600r245601
169168         location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-linux")
170169      end
171170
172      if "solaris" == _OPTIONS["gcc"] then
173         location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-solaris")
174      end
175
176
177171      if "linux-clang" == _OPTIONS["gcc"] then
178172         premake.gcc.cc  = "clang"
179173         premake.gcc.cxx = "clang++"
r245600r245601
455449         "-m64",
456450      }
457451     
458   configuration { "solaris", "x32" }
459      targetdir (_buildDir .. "solaris" .. "/bin/x32")
460      objdir (_buildDir .. "solaris" .. "/obj")
461      buildoptions {
462         "-m32",
463      }
464
465   configuration { "solaris", "x64" }
466      targetdir (_buildDir .. "solaris" .. "/bin/x64")
467      objdir (_buildDir .. "solaris" .. "/obj")
468      buildoptions {
469         "-m64",
470      }
471
472   configuration { "freebsd", "x32" }
473      targetdir (_buildDir .. "freebsd" .. "/bin/x32")
474      objdir (_buildDir .. "freebsd" .. "/obj")
475      buildoptions {
476         "-m32",
477      }
478
479   configuration { "freebsd", "x64" }
480      targetdir (_buildDir .. "freebsd" .. "/bin/x64")
481      objdir (_buildDir .. "freebsd" .. "/obj")
482      buildoptions {
483         "-m64",
484      }
485     
486452   configuration { "android-*" }
487453      includedirs {
488454         "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include",
r245600r245601
614580         "-Wno-extern-c-compat",
615581      }
616582
583   configuration { "freebsd" }
584      targetdir (_buildDir .. "freebsd" .. "/bin")
585      objdir (_buildDir .. "freebsd" .. "/obj")
586
617587   configuration { "nacl or nacl-arm or pnacl" }
618588      buildoptions {
619589         "-U__STRICT_ANSI__", -- strcasecmp, setenv, unsetenv,...
trunk/src/mess/drivers/pegasus.c
r245600r245601
5151{
5252public:
5353   pegasus_state(const machine_config &mconfig, device_type type, const char *tag)
54      : driver_device(mconfig, type, tag),
55   m_maincpu(*this, "maincpu"),
56   m_cass(*this, "cassette"),
57   m_pia_s(*this, "pia_s"),
58   m_pia_u(*this, "pia_u"),
59   m_exp_00(*this, "exp00"),
60   m_exp_01(*this, "exp01"),
61   m_exp_02(*this, "exp02"),
62   m_exp_0c(*this, "exp0c"),
63   m_exp_0d(*this, "exp0d"),
64   m_p_videoram(*this, "p_videoram"){ }
54      : driver_device(mconfig, type, tag)
55      , m_maincpu(*this, "maincpu")
56      , m_cass(*this, "cassette")
57      , m_pia_s(*this, "pia_s")
58      , m_pia_u(*this, "pia_u")
59      , m_exp_00(*this, "exp00")
60      , m_exp_01(*this, "exp01")
61      , m_exp_02(*this, "exp02")
62      , m_exp_0c(*this, "exp0c")
63      , m_exp_0d(*this, "exp0d")
64      , m_p_videoram(*this, "videoram")
65      , m_io_keyboard(*this, "KEY")
66   { }
6567
66   required_device<cpu_device> m_maincpu;
67   required_device<cassette_image_device> m_cass;
68   required_device<pia6821_device> m_pia_s;
69   required_device<pia6821_device> m_pia_u;
70   required_device<generic_slot_device> m_exp_00;
71   required_device<generic_slot_device> m_exp_01;
72   required_device<generic_slot_device> m_exp_02;
73   required_device<generic_slot_device> m_exp_0c;
74   required_device<generic_slot_device> m_exp_0d;
7568   DECLARE_READ8_MEMBER( pegasus_keyboard_r );
7669   DECLARE_READ8_MEMBER( pegasus_protection_r );
7770   DECLARE_READ8_MEMBER( pegasus_pcg_r );
r245600r245601
8275   DECLARE_READ_LINE_MEMBER( pegasus_cassette_r );
8376   DECLARE_WRITE_LINE_MEMBER( pegasus_cassette_w );
8477   DECLARE_WRITE_LINE_MEMBER( pegasus_firq_clr );
85   UINT8 m_kbd_row;
86   bool m_kbd_irq;
87   UINT8 *m_p_pcgram;
88   required_shared_ptr<UINT8> m_p_videoram;
89   const UINT8 *m_p_chargen;
90   UINT8 m_control_bits;
91   virtual void machine_reset();
92   virtual void machine_start();
93   virtual void video_start();
9478   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9579   DECLARE_DRIVER_INIT(pegasus);
9680   TIMER_DEVICE_CALLBACK_MEMBER(pegasus_firq);
97   void pegasus_decrypt_rom(UINT8 *ROM, bool force_decrypt);
98
9981   int load_cart(device_image_interface &image, generic_slot_device *slot, const char *reg_tag);
10082   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp00_load) { return load_cart(image, m_exp_00, "0000"); }
10183   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp01_load) { return load_cart(image, m_exp_01, "1000"); }
10284   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp02_load) { return load_cart(image, m_exp_02, "2000"); }
10385   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp0c_load) { return load_cart(image, m_exp_0c, "c000"); }
10486   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp0d_load) { return load_cart(image, m_exp_0d, "d000"); }
87private:
88   UINT8 m_kbd_row;
89   bool m_kbd_irq;
90   UINT8 *m_p_pcgram;
91   const UINT8 *m_p_chargen;
92   UINT8 m_control_bits;
93   virtual void machine_reset();
94   virtual void machine_start();
95   virtual void video_start();
96   void pegasus_decrypt_rom(UINT8 *ROM, bool force_decrypt);
97   required_device<cpu_device> m_maincpu;
98   required_device<cassette_image_device> m_cass;
99   required_device<pia6821_device> m_pia_s;
100   required_device<pia6821_device> m_pia_u;
101   required_device<generic_slot_device> m_exp_00;
102   required_device<generic_slot_device> m_exp_01;
103   required_device<generic_slot_device> m_exp_02;
104   required_device<generic_slot_device> m_exp_0c;
105   required_device<generic_slot_device> m_exp_0d;
106   required_shared_ptr<UINT8> m_p_videoram;
107   required_ioport_array<8> m_io_keyboard;
105108};
106109
107110TIMER_DEVICE_CALLBACK_MEMBER(pegasus_state::pegasus_firq)
r245600r245601
116119
117120READ8_MEMBER( pegasus_state::pegasus_keyboard_r )
118121{
119   static const char *const keynames[] = { "X0", "X1", "X2", "X3", "X4", "X5", "X6", "X7" };
120   UINT8 bit,data = 0xff;
121   for (bit = 0; bit < 8; bit++)
122      if (!BIT(m_kbd_row, bit)) data &= ioport(keynames[bit])->read();
122   UINT8 i,data = 0xff;
123   for (i = 0; i < 8; i++)
124      if (!BIT(m_kbd_row, i)) data &= m_io_keyboard[i]->read();
123125
124126   m_kbd_irq = (data == 0xff) ? 1 : 0;
125   if (m_control_bits & 8) data<<=4;
127   if BIT(m_control_bits, 3)
128      data<<=4;
126129   return data;
127130}
128131
r245600r245601
166169
167170WRITE8_MEMBER( pegasus_state::pegasus_pcg_w )
168171{
169//  if (m_control_bits & 2)
172//  if BIT(m_control_bits, 1)
170173   {
171174      UINT8 code = m_p_videoram[offset] & 0x7f;
172175      m_p_pcgram[(code << 4) | (~m_kbd_row & 15)] = data;
r245600r245601
185188   ADDRESS_MAP_UNMAP_HIGH
186189   //AM_RANGE(0x0000, 0x2fff)      // mapped by the cartslots 1-3
187190   AM_RANGE(0xb000, 0xbdff) AM_RAM
188   AM_RANGE(0xbe00, 0xbfff) AM_RAM AM_SHARE("p_videoram")
191   AM_RANGE(0xbe00, 0xbfff) AM_RAM AM_SHARE("videoram")
189192   //AM_RANGE(0xc000, 0xdfff)      // mapped by the cartslots 4-5
190193   AM_RANGE(0xe000, 0xe1ff) AM_READ(pegasus_protection_r)
191194   AM_RANGE(0xe200, 0xe3ff) AM_READWRITE(pegasus_pcg_r,pegasus_pcg_w)
r245600r245601
196199
197200static ADDRESS_MAP_START(pegasusm_mem, AS_PROGRAM, 8, pegasus_state)
198201   ADDRESS_MAP_UNMAP_HIGH
199   AM_RANGE(0x0000, 0x2fff) AM_ROM
200   AM_RANGE(0x5000, 0xbdff) AM_RAM
201   AM_RANGE(0xbe00, 0xbfff) AM_RAM AM_SHARE("p_videoram")
202   AM_RANGE(0xc000, 0xdfff) AM_ROM AM_WRITENOP
203   AM_RANGE(0xe000, 0xe1ff) AM_READ(pegasus_protection_r)
204   AM_RANGE(0xe200, 0xe3ff) AM_READWRITE(pegasus_pcg_r,pegasus_pcg_w)
205   AM_RANGE(0xe400, 0xe403) AM_MIRROR(0x1fc) AM_DEVREADWRITE("pia_u", pia6821_device, read, write)
206   AM_RANGE(0xe600, 0xe603) AM_MIRROR(0x1fc) AM_DEVREADWRITE("pia_s", pia6821_device, read, write)
207   AM_RANGE(0xf000, 0xffff) AM_ROM
202   AM_IMPORT_FROM(pegasus_mem)
203   AM_RANGE(0x5000, 0xafff) AM_RAM
208204ADDRESS_MAP_END
209205
210206/* Input ports */
211207static INPUT_PORTS_START( pegasus )
212   PORT_START("X0")
208   PORT_START("KEY.0")
213209   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("= +") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+')
214210   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("0 )") PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
215211   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BackSpace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_CHAR(8)
r245600r245601
219215   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l') PORT_CHAR(13)
220216   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p') PORT_CHAR(16)
221217
222   PORT_START("X1")
218   PORT_START("KEY.1")
223219   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("- _") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_')
224220   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Tab") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(')
225221   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("[ ]") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR(']')
r245600r245601
229225   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k') PORT_CHAR(11)
230226   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o') PORT_CHAR(15)
231227
232   PORT_START("X2")
228   PORT_START("KEY.2")
233229   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
234230   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("8 *") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*')
235231   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("6 ^") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^')
r245600r245601
239235   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u') PORT_CHAR(21)
240236   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g') PORT_CHAR(7)
241237
242   PORT_START("X3")
238   PORT_START("KEY.3")
243239   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t') PORT_CHAR(20)
244240   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("7 &") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&')
245241   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
r245600r245601
249245   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h') PORT_CHAR(8)
250246   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') PORT_CHAR(25)
251247
252   PORT_START("X4")
248   PORT_START("KEY.4")
253249   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r') PORT_CHAR(18)
254250   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w') PORT_CHAR(23)
255251   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@')
r245600r245601
259255   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c') PORT_CHAR(3)
260256   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f') PORT_CHAR(6)
261257
262   PORT_START("X5")
258   PORT_START("KEY.5")
263259   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e') PORT_CHAR(5)
264260   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q') PORT_CHAR(17)
265261   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) // REPEAT key which is disconnected - outputs a space
r245600r245601
269265   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d') PORT_CHAR(4)
270266   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n') PORT_CHAR(14)
271267
272   PORT_START("X6")
268   PORT_START("KEY.6")
273269   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v') PORT_CHAR(22)
274270   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a') PORT_CHAR(1)
275271   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9)
r245600r245601
279275   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x') PORT_CHAR(24)
280276   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BlankL") PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(16)
281277
282   PORT_START("X7")
278   PORT_START("KEY.7")
283279   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b') PORT_CHAR(2)
284280   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s') PORT_CHAR(19)
285281   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CapsLock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(19)
r245600r245601
312308{
313309   UINT8 y,ra,chr,gfx,inv;
314310   UINT16 sy=0,ma=0,x;
315   UINT8 pcg_mode = m_control_bits & 2;
311   bool pcg_mode = BIT(m_control_bits, 1);
316312
317313   for(y = 0; y < 16; y++ )
318314   {
r245600r245601
573569/* Driver */
574570
575571/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY   FULLNAME       FLAGS */
576COMP( 1981, pegasus,  0,     0,      pegasus,   pegasus, pegasus_state, pegasus, "Technosys",   "Aamber Pegasus", GAME_NO_SOUND_HW )
572COMP( 1981, pegasus,  0,       0,    pegasus,   pegasus, pegasus_state, pegasus, "Technosys",   "Aamber Pegasus", GAME_NO_SOUND_HW )
577573COMP( 1981, pegasusm, pegasus, 0,    pegasusm,  pegasus, pegasus_state, pegasus, "Technosys",   "Aamber Pegasus with RAM expansion unit", GAME_NO_SOUND_HW )
trunk/src/osd/osdcomm.h
r245600r245601
225225
226226#ifdef _MSC_VER
227227#include <malloc.h>
228#if _MSC_VER == 1900 // < VS2015
229#define __LINE__Var 0
230#endif
231228#if _MSC_VER < 1900 // < VS2015
232229#define snprintf _snprintf
233230#if _MSC_VER < 1800 // VS2013 or earlier


Previous 199869 Revisions Next


© 1997-2024 The MAME Team