Previous 199869 Revisions Next

r40540 Monday 24th August, 2015 at 22:20:02 UTC by Felipe CorrĂȘa da Silva Sanches
initial skeleton driver for Canon S-80 typowriter
[/trunk].gitignore makefile
[3rdparty/genie/build/gmake.os2]Makefile genie.make
[3rdparty/genie/src/actions/make]make_cpp.lua make_csharp.lua
[3rdparty/genie/src/base]project.lua
[3rdparty/genie/src/host]os_getversion.c os_pathsearch.c os_uuid.c premake.h scripts.c
[3rdparty/unittest-cpp/UnitTest++]Config.h
[hash]a800_flop.xml gameking.xml megadriv.xml x1_cass.xml
[scripts]toolchain.lua
[scripts/src/osd]sdl_cfg.lua
[scripts/target/mame]arcade.lua mess.lua
[src]version.c
[src/emu]attotime.h emuopts.c screen.h
[src/emu/bus/c64]c128_partner.c c128_partner.h
[src/emu/bus/centronics]printer.c
[src/emu/bus/msx_cart]fs_sr022.c
[src/emu/bus/ti99_peb]hfdc.c hfdc.h
[src/emu/cpu/h6280]6280dasm.c
[src/emu/cpu/h8]h8_timer16.c
[src/emu/cpu/pdp8]pdp8.c
[src/emu/cpu/tms32082]mp_ops.c tms32082.c
[src/emu/cpu/ucom4]ucom4.c
[src/emu/drivers]emudummy.c
[src/emu/machine]68230pit.c 68230pit.h i8251.c i8251.h intelfsh.c tms6100.c
[src/emu/netlist]nl_base.c nl_base.h nl_setup.h
[src/emu/netlist/plib]pconfig.h pstream.c pstring.c pstring.h
[src/emu/netlist/prg]nltool.c nlwav.c
[src/emu/netlist/solver]nld_ms_direct.h nld_ms_direct_lu.h nld_solver.h
[src/emu/sound]c352.c c352.h rf5c400.c tms5110.c tms5110.h tms5220.c tms5220.h
[src/mame]arcade.lst mess.lst
[src/mame/audio]targ.c
[src/mame/drivers]ajax.c aliens.c blockhl.c chexx.c chqflag.c cobra.c crimfght.c deco32.c faceoffh.c* fcrash.c firebeat.c groundfx.c gunsmoke.c joystand.c kaneko16.c konendev.c lethalj.c megasys1.c midxunit.c minivadr.c namcofl.c namconb1.c namcond1.c namcos10.c namcos11.c namcos12.c namcos22.c namcos23.c naomi.c norautp.c pacman.c quantum.c rollext.c royalmah.c seattle.c simpsons.c spcforce.c thedealr.c toaplan2.c vegas.c xyonix.c zaccaria.c
[src/mame/includes]chihiro.h gaelco2.h hng64.h rocnrope.h xbox.h
[src/mame/layout]aquastge.lay chexx.lay
[src/mame/machine]dc-ctrl.c iteagle_fpga.c ns10crypt.c ns10crypt.h pgmcrypt.c xbox.c
[src/mame/video]bottom9.c chihiro.c k052109.h k057714.c macrossp.c midzeus.c
[src/mess/drivers]apple2.c attache.c canon_s80.c* force68k.c hh_hmcs40.c hh_tms1k.c hh_ucom4.c hp64k.c hp_ipc.c mc1000.c ngen.c tispeak.c x68k.c xbox.c
[src/mess/includes]aussiebyte.h thomson.h
[src/mess/layout]fccpu1.lay
[src/mess/machine]coco.c
[src/mess/video]aussiebyte.c
[src/osd/modules/debugger/win]debugviewinfo.c debugwininfo.c editwininfo.c
[src/osd/windows]input.c output.c window.c winmain.c winutil.c winutil.h

trunk/.gitignore
r249051r249052
11*~
22/*
3/*/
4!/3rdparty/
5!/artwork/
6!/docs/
7!/hash/
8!/hlsl/
9!/keymaps/
10!/nl_examples/
11!/samples/
12!/scripts/
13!/src/
14!/tests/
15!/web/
3!/*/
164!/.gitattributes
175!/.gitignore
186!/.travis.yml
197!/makefile
20!/mame.doxygen
8!/mame.doxygen
219!/*.md
10/cfg
11/diff
12/ini
13/inp
14/nvram
15/obj
16/roms
17/snap
2218src/regtests/chdman/temp
2319src/regtests/jedutil/output
24*.pyc
No newline at end of file
20/sta
21*.pyc
22/build
23/documentation
No newline at end of file
trunk/3rdparty/genie/src/actions/make/make_cpp.lua
r249051r249052
228228      _p('ifeq (/bin,$(findstring /bin,$(SHELL)))')
229229      _p('  SHELLTYPE := posix')
230230      _p('endif')
231      _p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')
232      _p('  SHELLTYPE := posix')
233      _p('endif')
234231      _p('')
235232
236233      _p('ifeq (posix,$(SHELLTYPE))')
trunk/3rdparty/genie/src/actions/make/make_csharp.lua
r249051r249052
104104      _p('ifeq (/bin,$(findstring /bin,$(SHELL)))')
105105      _p('  SHELLTYPE := posix')
106106      _p('endif')
107      _p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')
108      _p('  SHELLTYPE := posix')
109      _p('endif')
110107      _p('')
111108
112109      _p('ifeq (posix,$(SHELLTYPE))')
r249051r249052
176173      _p('ifeq (/bin,$(findstring /bin,$(SHELL)))')
177174      _p('  SHELLTYPE := posix')
178175      _p('endif')
179      _p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')
180      _p('  SHELLTYPE := posix')
181      _p('endif')
182176      _p('')
183177
184178      -- main build rule(s)
trunk/3rdparty/genie/src/base/project.lua
r249051r249052
507507            bundlename = name .. ".app"
508508            bundlepath = path.join(dir, bundlename)
509509            dir = path.join(bundlepath, "Contents/MacOS")
510         elseif (kind == "ConsoleApp" or kind == "WindowedApp") and system == "os2" then
511            ext = ".exe"
512510         elseif kind == "SharedLib" then
513511            prefix = "lib"
514512            ext = iif(system == "macosx", ".dylib", ".so")
trunk/3rdparty/genie/src/host/os_getversion.c
r249051r249052
232232
233233/*************************************************************/
234234
235#elif defined(PLATFORM_OS2)
236
237#define INCL_DOS
238#include <os2.h>
239
240void getversion(struct OsVersionInfo* info)
241{
242   ULONG ulMajor;
243   ULONG ulMinor;
244   ULONG ulRev;
245
246   DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_VERSION_MAJOR, &ulMajor, sizeof(ulMajor));
247   DosQuerySysInfo(QSV_VERSION_MINOR, QSV_VERSION_MINOR, &ulMinor, sizeof(ulMinor));
248   DosQuerySysInfo(QSV_VERSION_REVISION, QSV_VERSION_REVISION,
249               &ulRev, sizeof(ulRev));
250
251   info->majorversion = ulMajor;
252   info->minorversion = ulMinor;
253   info->revision = ulRev;
254   info->description = PLATFORM_STRING;
255}
256
257/*************************************************************/
258
259235#else
260236
261237void getversion(struct OsVersionInfo* info)
trunk/3rdparty/genie/src/host/os_pathsearch.c
r249051r249052
2929         /* look for the closest path separator ; or : */
3030         /* can't use : on windows because it breaks on C:\path */
3131         const char* semi = strchr(path, ';');
32#if !defined(PLATFORM_WINDOWS) && !defined(PLATFORM_OS2)
32#if !defined(PLATFORM_WINDOWS)
3333         const char* full = strchr(path, ':');
3434#else
3535         const char* full = NULL;
trunk/3rdparty/genie/src/host/os_uuid.c
r249051r249052
4949   {
5050#if PLATFORM_WINDOWS
5151      CoCreateGuid((GUID*)bytes);
52#elif PLATFORM_OS2
53      int i;
54      for (i = 0; i < 16; i++)
55         bytes[i] = (unsigned char)gethrtime();
5652#else
5753      int result;
5854
trunk/3rdparty/genie/src/host/premake.h
r249051r249052
2424#elif defined(__APPLE__) && defined(__MACH__)
2525#define PLATFORM_MACOSX   (1)
2626#define PLATFORM_STRING   "macosx"
27#elif defined(__OS2__)
28#define PLATFORM_OS2      (1)
29#define PLATFORM_STRING   "os2"
3027#else
3128#define PLATFORM_WINDOWS  (1)
3229#define PLATFORM_STRING   "windows"
trunk/3rdparty/genie/src/host/scripts.c
r249051r249052
5555   "roject.getbasename(prjname, pattern)\nreturn pattern:gsub(\"%%%%\", prjname)\nend\nfunction premake.project.getfilename(prj, pattern)\nlocal fname = premake.project.getbasename(prj.name, pattern)\nfname = path.join(prj.location, fname)\nreturn path.getrelative(os.getcwd(), fname)\nend\n function premake.getlinks(cfg, kind, part)\nlocal result = iif (part == \"directory\" and kind == \"all\", cfg.libdirs, {})\nlocal cfgname = iif(cfg.name == cfg.project.name, \"\", cfg.name)\nlocal pathstyle = premake.getpathstyle(cfg)\nlocal namestyle = premake.getnamestyle(cfg)\nlocal function canlink(source, target)\nif (target.kind ~= \"SharedLib\" and target.kind ~= \"StaticLib\") then\nreturn false\nend\nif premake.iscppproject(source) then\nreturn premake.iscppproject(target)\nelseif premake.isdotnetproject(source) then\nreturn premake.isdotnetproject(target)\nend\nend\nfor _, link in ipairs(cfg.links) do\nlocal item\nlocal prj = premake.findproject(link)\nif prj and kind ~= \"system\" then\nlocal prjcfg = premake.getcon"
5656   "fig(prj, cfgname, cfg.platform)\nif kind == \"dependencies\" or canlink(cfg, prjcfg) then\nif (part == \"directory\") then\nitem = path.rebase(prjcfg.linktarget.directory, prjcfg.location, cfg.location)\nelseif (part == \"basename\") then\nitem = prjcfg.linktarget.basename\nelseif (part == \"fullpath\") then\nitem = path.rebase(prjcfg.linktarget.fullpath, prjcfg.location, cfg.location)\nelseif (part == \"object\") then\nitem = prjcfg\nend\nend\nelseif not prj and (kind == \"system\" or kind == \"all\") then\nif (part == \"directory\") then\nitem = path.getdirectory(link)\nelseif (part == \"fullpath\") then\nitem = link\nif namestyle == \"windows\" then\nif premake.iscppproject(cfg) then\nitem = item .. \".lib\"\nelseif premake.isdotnetproject(cfg) then\nitem = item .. \".dll\"\nend\nend\nelseif part == \"name\" then\nitem = path.getname(link)\nelseif part == \"basename\" then\nitem = path.getbasename(link)\nelse\nitem = link\nend\nif item:find(\"/\", nil, true) then\nitem = path.getrelative(cfg.project.locatio"
5757   "n, item)\nend\nend\nif item then\nif pathstyle == \"windows\" and part ~= \"object\" then\nitem = path.translate(item, \"\\\\\")\nend\nif not table.contains(result, item) then\ntable.insert(result, item)\nend\nend\nend\nreturn result\nend\nfunction premake.getnamestyle(cfg)\nreturn premake.platforms[cfg.platform].namestyle or premake.gettool(cfg).namestyle or \"posix\"\nend\nfunction premake.getpathstyle(cfg)\nif premake.action.current().os == \"windows\" then\nreturn \"windows\"\nelse\nreturn \"posix\"\nend\nend\nfunction premake.gettarget(cfg, direction, pathstyle, namestyle, system)\nif system == \"bsd\" then\nsystem = \"linux\"\nend\nlocal kind = cfg.kind\nif premake.iscppproject(cfg) then\nif (namestyle == \"windows\" or system == \"windows\")\nand kind == \"SharedLib\" and direction == \"link\"\nand not cfg.flags.NoImportLib\nthen\nkind = \"StaticLib\"\nend\nif namestyle == \"posix\" and system == \"windows\" and kind ~= \"StaticLib\" then\nnamestyle = \"windows\"\nend\nend\nlocal field   = \"build\"\nif"
58   " direction == \"link\" and cfg.kind == \"SharedLib\" then\nfield = \"implib\"\nend\nlocal name    = cfg[field..\"name\"] or cfg.targetname or cfg.project.name\nlocal dir     = cfg[field..\"dir\"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)\nlocal subdir  = cfg[field..\"subdir\"] or cfg.targetsubdir or \".\"\nlocal prefix  = \"\"\nlocal suffix  = \"\"\nlocal ext     = \"\"\nlocal bundlepath, bundlename\ndir = path.join(dir, subdir)\nif namestyle == \"windows\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\next = \".dll\"\nelseif kind == \"StaticLib\" then\next = \".lib\"\nend\nelseif namestyle == \"posix\" then\nif kind == \"WindowedApp\" and system == \"macosx\" then\nbundlename = name .. \".app\"\nbundlepath = path.join(dir, bundlename)\ndir = path.join(bundlepath, \"Contents/MacOS\")\nelseif (kind == \"ConsoleApp\" or kind == \"WindowedApp\") and system == \"os2\" then ext = \".exe\"\nelseif kind == \"SharedLib\" then\np"
59   "refix = \"lib\"\next = iif(system == \"macosx\", \".dylib\", \".so\")\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"PS3\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"Orbis\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nend\nprefix = cfg[field..\"prefix\"] or cfg.targetprefix or prefix\nsuffix = cfg[field..\"suffix\"] or cfg.targetsuffix or suffix\next    = cfg[field..\"extension\"] or cfg.targetextension or ext\nlocal result = { }\nresult.basename     = name .. suffix\nresult.name         = prefix .. name .. suffix .. ext\nresult.directory    = dir\nresult.subdirectory = subdir\nresult.prefix       = prefix\nresult.suffix       = suffix\nresult.fullpath     = path.join(result.directory, result.name)\nresult.bundlepath   = bundl"
60   "epath or result.fullpath\nif pathstyle == \"windows\" then\nresult.directory    = path.translate(result.directory, \"\\\\\")\nresult.subdirectory = path.translate(result.subdirectory, \"\\\\\")\nresult.fullpath     = path.translate(result.fullpath,  \"\\\\\")\nend\nreturn result\nend\nfunction premake.gettool(cfg)\nif premake.iscppproject(cfg) then\nif _OPTIONS.cc then\nreturn premake[_OPTIONS.cc]\nend\nlocal action = premake.action.current()\nif action.valid_tools then\nreturn premake[action.valid_tools.cc[1]]\nend\nreturn premake.gcc\nelse\nreturn premake.dotnet\nend\nend\nfunction premake.project.getvpath(prj, abspath)\nlocal vpath = abspath\nlocal fname = path.getname(abspath)\nlocal max = abspath:len() - fname:len()\nfor replacement, patterns in pairs(prj.vpaths or {}) do\nfor _, pattern in ipairs(patterns) do\nlocal i = abspath:find(path.wildcards(pattern))\nif i == 1 then\ni = pattern:find(\"*\", 1, true) or (pattern:len() + 1)\nlocal leaf\nif i < max then\nleaf = abspath:sub(i)\nelse\nleaf = fname\nend"
61   "\nif leaf:startswith(\"/\") then\nleaf = leaf:sub(2)\nend\nlocal stem = \"\"\nif replacement:len() > 0 then\nstem, stars = replacement:gsub(\"%*\", \"\")\nif stars == 0 then\nleaf = path.getname(leaf)\nend\nelse\nleaf = path.getname(leaf)\nend\nvpath = path.join(stem, leaf)\nend\nend\nend\nreturn path.trimdots(vpath)\nend\nfunction premake.hascppproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.iscppproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.hasdotnetproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.isdotnetproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.project.iscproject(prj)\nreturn prj.language == \"C\"\nend\nfunction premake.iscppproject(prj)\nreturn (prj.language == \"C\" or prj.language == \"C++\")\nend\nfunction premake.isdotnetproject(prj)\nreturn (prj.language == \"C#\")\nend\n",
58   " direction == \"link\" and cfg.kind == \"SharedLib\" then\nfield = \"implib\"\nend\nlocal name    = cfg[field..\"name\"] or cfg.targetname or cfg.project.name\nlocal dir     = cfg[field..\"dir\"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)\nlocal subdir  = cfg[field..\"subdir\"] or cfg.targetsubdir or \".\"\nlocal prefix  = \"\"\nlocal suffix  = \"\"\nlocal ext     = \"\"\nlocal bundlepath, bundlename\ndir = path.join(dir, subdir)\nif namestyle == \"windows\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".exe\"\nelseif kind == \"SharedLib\" then\next = \".dll\"\nelseif kind == \"StaticLib\" then\next = \".lib\"\nend\nelseif namestyle == \"posix\" then\nif kind == \"WindowedApp\" and system == \"macosx\" then\nbundlename = name .. \".app\"\nbundlepath = path.join(dir, bundlename)\ndir = path.join(bundlepath, \"Contents/MacOS\")\nelseif kind == \"SharedLib\" then\nprefix = \"lib\"\next = iif(system == \"macosx\", \".dylib\", \".so\")\nelseif kind == \"StaticLib\" th"
59   "en\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"PS3\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nelseif namestyle == \"Orbis\" then\nif kind == \"ConsoleApp\" or kind == \"WindowedApp\" then\next = \".elf\"\nelseif kind == \"StaticLib\" then\nprefix = \"lib\"\next = \".a\"\nend\nend\nprefix = cfg[field..\"prefix\"] or cfg.targetprefix or prefix\nsuffix = cfg[field..\"suffix\"] or cfg.targetsuffix or suffix\next    = cfg[field..\"extension\"] or cfg.targetextension or ext\nlocal result = { }\nresult.basename     = name .. suffix\nresult.name         = prefix .. name .. suffix .. ext\nresult.directory    = dir\nresult.subdirectory = subdir\nresult.prefix       = prefix\nresult.suffix       = suffix\nresult.fullpath     = path.join(result.directory, result.name)\nresult.bundlepath   = bundlepath or result.fullpath\nif pathstyle == \"windows\" then\nresult.directory    = path.translate(resul"
60   "t.directory, \"\\\\\")\nresult.subdirectory = path.translate(result.subdirectory, \"\\\\\")\nresult.fullpath     = path.translate(result.fullpath,  \"\\\\\")\nend\nreturn result\nend\nfunction premake.gettool(cfg)\nif premake.iscppproject(cfg) then\nif _OPTIONS.cc then\nreturn premake[_OPTIONS.cc]\nend\nlocal action = premake.action.current()\nif action.valid_tools then\nreturn premake[action.valid_tools.cc[1]]\nend\nreturn premake.gcc\nelse\nreturn premake.dotnet\nend\nend\nfunction premake.project.getvpath(prj, abspath)\nlocal vpath = abspath\nlocal fname = path.getname(abspath)\nlocal max = abspath:len() - fname:len()\nfor replacement, patterns in pairs(prj.vpaths or {}) do\nfor _, pattern in ipairs(patterns) do\nlocal i = abspath:find(path.wildcards(pattern))\nif i == 1 then\ni = pattern:find(\"*\", 1, true) or (pattern:len() + 1)\nlocal leaf\nif i < max then\nleaf = abspath:sub(i)\nelse\nleaf = fname\nend\nif leaf:startswith(\"/\") then\nleaf = leaf:sub(2)\nend\nlocal stem = \"\"\nif replacement:len() > 0"
61   " then\nstem, stars = replacement:gsub(\"%*\", \"\")\nif stars == 0 then\nleaf = path.getname(leaf)\nend\nelse\nleaf = path.getname(leaf)\nend\nvpath = path.join(stem, leaf)\nend\nend\nend\nreturn path.trimdots(vpath)\nend\nfunction premake.hascppproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.iscppproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.hasdotnetproject(sln)\nfor prj in premake.solution.eachproject(sln) do\nif premake.isdotnetproject(prj) then\nreturn true\nend\nend\nend\nfunction premake.project.iscproject(prj)\nreturn prj.language == \"C\"\nend\nfunction premake.iscppproject(prj)\nreturn (prj.language == \"C\" or prj.language == \"C++\")\nend\nfunction premake.isdotnetproject(prj)\nreturn (prj.language == \"C#\")\nend\n",
6262
6363   /* base/config.lua */
6464   "premake.config = { }\nlocal config = premake.config\nfunction premake.config.isdebugbuild(cfg)\nif cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed then\nreturn false\nend\nif not cfg.flags.Symbols then\nreturn false\nend\nreturn true\nend\nfunction premake.config.isincrementallink(cfg)\nif cfg.kind == \"StaticLib\" \nor config.isoptimizedbuild(cfg.flags)\nor cfg.flags.NoIncrementalLink then\nreturn false\nend\nreturn true\nend\nfunction premake.config.isoptimizedbuild(flags)\nreturn flags.Optimize or flags.OptimizeSize or flags.OptimizeSpeed\nend\n",
r249051r249052
184184   "ving)\nelse\n_p('\\t@echo Archiving %s', prj.name)\nend\nif (not prj.archivesplit_size) then\nprj.archivesplit_size=200\nend\nif (not prj.options.ArchiveSplit) then\n_p('\\t$(SILENT) $(LINKCMD) $(OBJECTS)')\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))')\n_p('\\t$(SILENT) $(LINKCMD_NDX)')\nend\nelse\nif prj.msglinking then\n_p('\\t@echo ' .. prj.msglinking)\nelse\n_p('\\t@echo Linking %s', prj.name)\nend\n_p('\\t$(SILENT) $(LINKCMD)')\nend\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIRS):')\nif (not prj.solution.messageskip) or (not table.contains(prj.solution.messageskip, \"SkipCreatingMessage\")) then\n_p('\\t@echo Creating $(@)')\nend\n_p('\\t-$(call MKDIR,$@)')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('$(dir $(TARGETDIR))PkgInfo:')\n_p('$(dir $(TARGETDIR))Info.plist:')\n_p('')\nend\n_p('clean:')\nif (not prj.solution.messageskip) or (not table.c"
185185   "ontains(prj.solution.messageskip, \"SkipCleaningMessage\")) then\n_p('\\t@echo Cleaning %s', prj.name)\nend\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f  $(TARGET)')\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGET)) del $(subst /,\\\\\\\\,$(TARGET))')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\ncpp.pchrules(prj)\ncpp.fileRules(prj)\ncpp.dependencyRules(prj)\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nlocal deps =  string.format(\"%s \",path.getrelative(prj.location,buildtask[1]))\nfor _, depdata in ipairs(buildtask[3] or {}) do\ndeps = deps .. string.format(\"%s \",path.getrelative(prj.location,depdata))\nend\n_p('%s: %s'\n,path.getrelative(prj.location,buildtask[2])\n, deps\n)\nfor _, cmdline "
186186   "in ipairs(buildtask[4] or {}) do\nlocal cmd = cmdline\nlocal num = 1\nfor _, depdata in ipairs(buildtask[3] or {}) do\ncmd = string.gsub(cmd,\"%$%(\" .. num ..\"%)\", string.format(\"%s \",path.getrelative(prj.location,depdata)))\nnum = num + 1\nend\ncmd = string.gsub(cmd, \"%$%(<%)\", \"$<\")\ncmd = string.gsub(cmd, \"%$%(@%)\", \"$@\")\n \n_p('\\t$(SILENT) %s',cmd)\nend\n_p('')\nend\nend\n_p('-include $(OBJECTS:%%.o=%%.d)')\n_p('ifneq (,$(PCH))')\n_p('  -include $(OBJDIR)/$(notdir $(PCH)).d')\n_p('endif')\nend\nfunction premake.gmake_cpp_header(prj, cc, platforms)\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('ifndef config')\n_p('  config=%s', _MAKE.esc(premake.getconfigname(prj.solution.configurations[1], platforms[1], true)))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p('  SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p("
187   "'  SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('  MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p('  COPY  = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('  RM= $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p('  MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('  COPY  = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('  RM    = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('CC  = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR  = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p('  ifdef WINDRES')\n_p('    RESCOMP = $(WINDRES)')\n_p('  else')\n_p('    RESCOMP = windres')\n_p('  endif')\n_p('endif')\n_p('')\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\n_p('  ' .. (table.contains(premake.make.override,\"OBJDIR\") and "
188   "\"override \" or \"\") ..    'OBJDIR     = %s', _MAKE.esc(cfg.objectsdir))\n_p('  ' .. (table.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR  = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p('  ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") ..    'TARGET     = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p('  DEFINES   +=%s', make.list(cc.getdefines(cfg.defines)))\n_p('  INCLUDES  +=%s', make.list(cc.getincludedirs(cfg.includedirs)))\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(prj, cfg, cc)\n_p('  OBJECTS := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\nif not table.icontains(cfg.excludes, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p('  define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p(' "
189   " endef')\n_p('  define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\n_p('  define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p('  CC         = %s', platform.cc)\nend\nif platform.cxx then\n_p('  CXX        = %s', platform.cxx)\nend\nif platform.ar then\n_p('  AR         = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p('  FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p('  FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p('  AL"
190   "L_CPPFLAGS  += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" \"))\n_p('  ALL_CFLAGS    += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p('  ALL_CXXFLAGS  += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p('  ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p('  ALL_RESFLAGS  += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n        make.list(table.join(cc.getdefines(cfg.resdefines),\n                                cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(prj, cfg, cc)\n_p('  ALL_LDFLAGS   += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p('  LDDEPS    +=%s', make.list(_MAKE.esc(premake.ge"
191   "tlinks(cfg, \"siblings\", \"fullpath\"))))\n_p('  LIBS      += $(LDDEPS)%s', make.list(cc.getlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p('  LINKCMD    = libtool -o $(TARGET)')\nelse\nif (not prj.options.ArchiveSplit) then\nif cc.llvm then\n_p('  LINKCMD    = $(AR) rcs $(TARGET)')\nelse\n_p('  LINKCMD    = $(AR) -rcs $(TARGET)')\nend\nelse\nif cc.llvm then\n_p('  LINKCMD    = $(AR) qc $(TARGET)')\n_p('  LINKCMD_NDX= $(AR) cs $(TARGET)')\nelse\n_p('  LINKCMD    = $(AR) -qc $(TARGET)')\n_p('  LINKCMD_NDX= $(AR) -cs $(TARGET)')\nend\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p('  LINKCMD    = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal te"
192   "stname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.location, testname)\nbreak\nend\nend\n_p('  PCH        = %s', _MAKE.esc(pch))\n_p('  GCH        = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\n_p('\\t$(SILEN"
193   "T) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.o=%%.d) -c \"$<\"')\nelse\ncpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.dependencyRules(prj)\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nif (dep[3]==nil or dep[3]==false) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(path.getrelative(prj.location, dep[1]))))\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nelse\n_p('%s: %s'\n, _MAKE.esc(dep[1])\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))"
194   "\n)\nend\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = iif(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
187   "'  SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('  MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p('  COPY  = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('  RM= $(SILENT) rm -f \"$(1)\"')\n_p('else')\n_p('  MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('  COPY  = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('  RM    = $(SILENT) del /F \"$(subst /,\\\\\\\\,$(1))\" 2> nul || exit 0')\n_p('endif')\n_p('')\n_p('CC  = %s', cc.cc)\n_p('CXX = %s', cc.cxx)\n_p('AR  = %s', cc.ar)\n_p('')\n_p('ifndef RESCOMP')\n_p('  ifdef WINDRES')\n_p('    RESCOMP = $(WINDRES)')\n_p('  else')\n_p('    RESCOMP = windres')\n_p('  endif')\n_p('endif')\n_p('')\nend\nfunction premake.gmake_cpp_config(prj, cfg, cc)\n_p('ifeq ($(config),%s)', _MAKE.esc(cfg.shortname))\ncpp.platformtools(cfg, cc)\n_p('  ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"override \" or \"\") ..    'OBJDIR     = %s', _MAKE.esc(cfg.objectsdir))\n_p('  ' .. (tabl"
188   "e.contains(premake.make.override,\"TARGETDIR\") and \"override \" or \"\") .. 'TARGETDIR  = %s', _MAKE.esc(cfg.buildtarget.directory))\n_p('  ' .. (table.contains(premake.make.override,\"TARGET\") and \"override \" or \"\") ..    'TARGET     = $(TARGETDIR)/%s', _MAKE.esc(cfg.buildtarget.name))\n_p('  DEFINES   +=%s', make.list(cc.getdefines(cfg.defines)))\n_p('  INCLUDES  +=%s', make.list(cc.getincludedirs(cfg.includedirs)))\ncpp.pchconfig(cfg)\ncpp.flags(cfg, cc)\ncpp.linker(prj, cfg, cc)\n_p('  OBJECTS := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\nif not table.icontains(cfg.excludes, file) then\n_p('\\t$(OBJDIR)/%s.o \\\\'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n)\nend\nend\nend\n_p('')\n_p('  define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\n_p('  define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running"
189   " pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\n_p('  define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\nmake.settings(cfg, cc)\n_p('endif')\n_p('')\nend\nfunction cpp.platformtools(cfg, cc)\nlocal platform = cc.platforms[cfg.platform]\nif platform.cc then\n_p('  CC         = %s', platform.cc)\nend\nif platform.cxx then\n_p('  CXX        = %s', platform.cxx)\nend\nif platform.ar then\n_p('  AR         = %s', platform.ar)\nend\nend\nfunction cpp.flags(cfg, cc)\nif cfg.pchheader and not cfg.flags.NoPCH then\n_p('  FORCE_INCLUDE += -include $(OBJDIR)/$(notdir $(PCH))')\nend\nif #cfg.forcedincludes > 0 then\n_p('  FORCE_INCLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p('  ALL_CPPFLAGS  += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), \" "
190   "\"))\n_p('  ALL_CFLAGS    += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))\n_p('  ALL_CXXFLAGS  += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))\n_p('  ALL_OBJCFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))\n_p('  ALL_RESFLAGS  += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',\n        make.list(table.join(cc.getdefines(cfg.resdefines),\n                                cc.getincludedirs(cfg.resincludedirs), cfg.resoptions)))\nend\nfunction cpp.linker(prj, cfg, cc)\n_p('  ALL_LDFLAGS   += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))\n_p('  LDDEPS    +=%s', make.list(_MAKE.esc(premake.getlinks(cfg, \"siblings\", \"fullpath\"))))\n_p('  LIBS      += $(LDDEPS)%s', make.list(cc.ge"
191   "tlinkflags(cfg)))\nif cfg.kind == \"StaticLib\" then\nif cfg.platform:startswith(\"Universal\") then\n_p('  LINKCMD    = libtool -o $(TARGET)')\nelse\nif (not prj.options.ArchiveSplit) then\nif cc.llvm then\n_p('  LINKCMD    = $(AR) rcs $(TARGET)')\nelse\n_p('  LINKCMD    = $(AR) -rcs $(TARGET)')\nend\nelse\nif cc.llvm then\n_p('  LINKCMD    = $(AR) qc $(TARGET)')\n_p('  LINKCMD_NDX= $(AR) cs $(TARGET)')\nelse\n_p('  LINKCMD    = $(AR) -qc $(TARGET)')\n_p('  LINKCMD_NDX= $(AR) -cs $(TARGET)')\nend\nend\nend\nelse\nlocal tool = iif(cfg.language == \"C\", \"CC\", \"CXX\")\n_p('  LINKCMD    = $(%s) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)', tool)\nend\nend\nfunction cpp.pchconfig(cfg)\nif not cfg.pchheader or cfg.flags.NoPCH then\nreturn\nend\nlocal pch = cfg.pchheader\nfor _, incdir in ipairs(cfg.includedirs) do\nlocal abspath = path.getabsolute(path.join(cfg.project.location, incdir))\nlocal testname = path.join(abspath, pch)\nif os.isfile(testname) then\npch = path.getrelative(cfg.lo"
192   "cation, testname)\nbreak\nend\nend\n_p('  PCH        = %s', _MAKE.esc(pch))\n_p('  GCH        = $(OBJDIR)/$(notdir $(PCH)).gch')\nend\nfunction cpp.pchrules(prj)\n_p('ifneq (,$(PCH))')\n_p('$(GCH): $(PCH)')\n_p('\\t@echo $(notdir $<)')\nlocal cmd = iif(prj.language == \"C\", \"$(CC) -x c-header $(ALL_CFLAGS)\", \"$(CXX) -x c++-header $(ALL_CXXFLAGS)\")\n_p('\\t$(SILENT) %s -MMD -MP $(DEFINES) $(INCLUDES) -o \"$@\" -MF \"$(@:%%.gch=%%.d)\" -c \"$<\"', cmd)\n_p('endif')\n_p('')\nend\nfunction cpp.fileRules(prj)\nfor _, file in ipairs(prj.files or {}) do\nif path.iscppfile(file) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(file)))\n, _MAKE.esc(file)\n)\nif (path.isobjcfile(file) and prj.msgcompile_objc) then\n_p('\\t@echo ' .. prj.msgcompile_objc)\nelseif prj.msgcompile then\n_p('\\t@echo ' .. prj.msgcompile)\nelse\n_p('\\t@echo $(notdir $<)')\nend\nif (path.isobjcfile(file)) then\n_p('\\t$(SILENT) $(CXX) $(ALL_OBJCFLAGS) $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.o=%%.d) -c \"$<\"')\nelse\n"
193   "cpp.buildcommand(path.iscfile(file) and not prj.options.ForceCPP, \"o\")\nend\nfor _, task in ipairs(prj.postcompiletasks or {}) do\n_p('\\t$(SILENT) %s', task)\n_p('')\nend\n_p('')\nelseif (path.getextension(file) == \".rc\") then\n_p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file))\nif prj.msgresource then\n_p('\\t@echo ' .. prj.msgresource)\nelse\n_p('\\t@echo $(notdir $<)')\nend\n_p('\\t$(SILENT) $(RESCOMP) $< -O coff -o \"$@\" $(ALL_RESFLAGS)')\n_p('')\nend\nend\nend\nfunction cpp.dependencyRules(prj)\nfor _, dependency in ipairs(prj.dependency or {}) do\nfor _, dep in ipairs(dependency or {}) do\nif (dep[3]==nil or dep[3]==false) then\n_p('$(OBJDIR)/%s.o: %s'\n, _MAKE.esc(path.trimdots(path.removeext(path.getrelative(prj.location, dep[1]))))\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nelse\n_p('%s: %s'\n, _MAKE.esc(dep[1])\n, _MAKE.esc(path.getrelative(prj.location, dep[2]))\n)\nend\n_p('')\nend\nend\nend\nfunction cpp.buildcommand(iscfile, objext)\nlocal flags = i"
194   "if(iscfile, '$(CC) $(ALL_CFLAGS)', '$(CXX) $(ALL_CXXFLAGS)')\n_p('\\t$(SILENT) %s $(FORCE_INCLUDE) -o \"$@\" -MF $(@:%%.%s=%%.d) -c \"$<\"', flags, objext)\nend\n",
195195
196196   /* actions/make/make_csharp.lua */
197197   "local function getresourcefilename(cfg, fname)\nif path.getextension(fname) == \".resx\" then\n    local name = cfg.buildtarget.basename .. \".\"\n    local dir = path.getdirectory(fname)\n    if dir ~= \".\" then \nname = name .. path.translate(dir, \".\") .. \".\"\nend\nreturn \"$(OBJDIR)/\" .. _MAKE.esc(name .. path.getbasename(fname)) .. \".resources\"\nelse\nreturn fname\nend\nend\nfunction premake.make_csharp(prj)\nlocal csc = premake.dotnet\nlocal cfglibs = { }\nlocal cfgpairs = { }\nlocal anycfg\nfor cfg in premake.eachconfig(prj) do\nanycfg = cfg\ncfglibs[cfg] = premake.getlinks(cfg, \"siblings\", \"fullpath\")\ncfgpairs[cfg] = { }\nfor _, fname in ipairs(cfglibs[cfg]) do\nif path.getdirectory(fname) ~= cfg.buildtarget.directory then\ncfgpairs[cfg][\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fname))] = _MAKE.esc(fname)\nend\nend\nend\nlocal sources = {}\nlocal embedded = { }\nlocal copypairs = { }\nfor fcfg in premake.project.eachfile(prj) do\nlocal action = csc.getbuildaction(fcfg)\nif action == \"Co"
198198   "mpile\" then\ntable.insert(sources, fcfg.name)\nelseif action == \"EmbeddedResource\" then\ntable.insert(embedded, fcfg.name)\nelseif action == \"Content\" then\ncopypairs[\"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(fcfg.name))] = _MAKE.esc(fcfg.name)\nelseif path.getname(fcfg.name):lower() == \"app.config\" then\ncopypairs[\"$(TARGET).config\"] = _MAKE.esc(fcfg.name)\nend\nend\nlocal paths = table.translate(prj.libdirs, function(v) return path.join(prj.basedir, v) end)\npaths = table.join({prj.basedir}, paths)\nfor _, libname in ipairs(premake.getlinks(prj, \"system\", \"fullpath\")) do\nlocal libdir = os.pathsearch(libname..\".dll\", unpack(paths))\nif (libdir) then\nlocal target = \"$(TARGETDIR)/\" .. _MAKE.esc(path.getname(libname))\nlocal source = path.getrelative(prj.basedir, path.join(libdir, libname))..\".dll\"\ncopypairs[target] = _MAKE.esc(source)\nend\nend\n_p('# %s project makefile autogenerated by GENie', premake.action.current().shortname)\n_p('')\n_p('ifndef config')\n_p('  config=%s', _MAKE.esc"
199   "(prj.configurations[1]:lower()))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p('  SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('  MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p('  COPY  = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p('  MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul')\n_p('  COPY  = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('ifndef CSC')\n_p('  CSC=%s', csc.getcompilervar(prj))\n_p('endif')\n_p('')\n_p('ifndef RESGEN')\n_p('  RESGEN=resgen')\n_p('endif')\n_p('')\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms)\ntable.insert(platforms, 1, \"\")\nfor cfg in premake.each"
200   "config(prj) do\npremake.gmake_cs_config(cfg, csc, cfglibs)\nend\n_p('# To maintain compatibility with VS.NET, these values must be set at the project level')\n_p('TARGET     := $(TARGETDIR)/%s', _MAKE.esc(prj.buildtarget.name))\n_p('FLAGS      += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), \"/lib:\", \"\", \" \"))\n_p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, \"system\", \"basename\")), \"/r:\", \".dll\", \" \"))\n_p('')\n_p('SOURCES := \\\\')\nfor _, fname in ipairs(sources) do\n_p('\\t%s \\\\', _MAKE.esc(path.translate(fname)))\nend\n_p('')\n_p('EMBEDFILES := \\\\')\nfor _, fname in ipairs(embedded) do\n_p('\\t%s \\\\', getresourcefilename(prj, fname))\nend\n_p('')\n_p('COPYFILES += \\\\')\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t%s \\\\', target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t%s \\\\', target)\nend\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p"
201   "('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(MAKESHELL)))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')\n_p('')\n_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')\n_p('\\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIR):')\npremake.make_mkdirrule(\"$(OBJDIR)\")\n_p('clean:')\n_p('\\t@echo Cleaning %s', prj.name)\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGETDIR)/%s.* $(COPYFILES)', prj.buildtarget.basename)\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, prj.buildtarget.b"
202   "asename)\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\n_p('# Per-configuration copied file rules')\nfor cfg in premake.eachconfig(prj) do\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\nfor target, source in pairs(cfgpairs[cfg]) do\npremake.make_copyrule(source, target)\nend\n_p('endif')\n_p('')\nend\n_p('# Copied file rules')\nfor target, source in pairs(copypairs) do\npremake.make_copyrule(source, target)\nend\n_p('# Embedded file rules')\nfor _, fname in ipairs(embedded) do \nif path.getextension(fname) == \".resx\" then\n"
203   "_p('%s: %s', getresourcefilename(prj, fname), _MAKE.esc(fname))\n_p('\\t$(SILENT) $(RESGEN) $^ $@')\nend\n_p('')\nend\nend\nfunction premake.gmake_cs_config(cfg, csc, cfglibs)\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\n_p('  TARGETDIR  := %s', _MAKE.esc(cfg.buildtarget.directory))\n_p('  OBJDIR     := %s', _MAKE.esc(cfg.objectsdir))\n_p('  DEPENDS    := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, \"dependencies\", \"fullpath\")), \" \"))\n_p('  REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), \"/r:\", \"\", \" \"))\n_p('  FLAGS      += %s %s', table.implode(cfg.defines, \"/d:\", \"\", \" \"), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), \" \"))\n_p('  define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\n_p('  define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\"
204   "t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\n_p('  define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-build commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\n_p('endif')\n_p('')\nend\n",
199   "(prj.configurations[1]:lower()))\n_p('endif')\n_p('')\n_p('ifndef verbose')\n_p('  SILENT = @')\n_p('endif')\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('')\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('  MKDIR = $(SILENT) mkdir -p \"$(1)\"')\n_p('  COPY  = $(SILENT) cp -fR \"$(1)\" \"$(2)\"')\n_p('else')\n_p('  MKDIR = $(SILENT) mkdir \"$(subst /,\\\\\\\\,$(1))\" 2> nul')\n_p('  COPY  = $(SILENT) copy /Y \"$(subst /,\\\\\\\\,$(1))\" \"$(subst /,\\\\\\\\,$(2))\"')\n_p('endif')\n_p('')\n_p('ifndef CSC')\n_p('  CSC=%s', csc.getcompilervar(prj))\n_p('endif')\n_p('')\n_p('ifndef RESGEN')\n_p('  RESGEN=resgen')\n_p('endif')\n_p('')\nlocal platforms = premake.filterplatforms(prj.solution, premake[_OPTIONS.cc].platforms)\ntable.insert(platforms, 1, \"\")\nfor cfg in premake.eachconfig(prj) do\npremake.gmake_cs_config(cfg, csc, cfglibs)\nend\n_p('# To maintain compatibi"
200   "lity with VS.NET, these values must be set at the project level')\n_p('TARGET     := $(TARGETDIR)/%s', _MAKE.esc(prj.buildtarget.name))\n_p('FLAGS      += /t:%s %s', csc.getkind(prj):lower(), table.implode(_MAKE.esc(prj.libdirs), \"/lib:\", \"\", \" \"))\n_p('REFERENCES += %s', table.implode(_MAKE.esc(premake.getlinks(prj, \"system\", \"basename\")), \"/r:\", \".dll\", \" \"))\n_p('')\n_p('SOURCES := \\\\')\nfor _, fname in ipairs(sources) do\n_p('\\t%s \\\\', _MAKE.esc(path.translate(fname)))\nend\n_p('')\n_p('EMBEDFILES := \\\\')\nfor _, fname in ipairs(embedded) do\n_p('\\t%s \\\\', getresourcefilename(prj, fname))\nend\n_p('')\n_p('COPYFILES += \\\\')\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t%s \\\\', target)\nend\nfor target, source in pairs(copypairs) do\n_p('\\t%s \\\\', target)\nend\n_p('')\n_p('SHELLTYPE := msdos')\n_p('ifeq (,$(ComSpec)$(COMSPEC))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('ifeq (/bin,$(findstring /bin,$(SHELL)))')\n_p('  SHELLTYPE := posix')\n_p('endif')\n_p('')"
201   "\n_p('.PHONY: clean prebuild prelink')\n_p('')\n_p('all: $(TARGETDIR) $(OBJDIR) prebuild $(EMBEDFILES) $(COPYFILES) prelink $(TARGET)')\n_p('')\n_p('$(TARGET): $(SOURCES) $(EMBEDFILES) $(DEPENDS)')\n_p('\\t$(SILENT) $(CSC) /nologo /out:$@ $(FLAGS) $(REFERENCES) $(SOURCES) $(patsubst %%,/resource:%%,$(EMBEDFILES))')\n_p('\\t$(POSTBUILDCMDS)')\n_p('')\n_p('$(TARGETDIR):')\npremake.make_mkdirrule(\"$(TARGETDIR)\")\n_p('$(OBJDIR):')\npremake.make_mkdirrule(\"$(OBJDIR)\")\n_p('clean:')\n_p('\\t@echo Cleaning %s', prj.name)\n_p('ifeq (posix,$(SHELLTYPE))')\n_p('\\t$(SILENT) rm -f $(TARGETDIR)/%s.* $(COPYFILES)', prj.buildtarget.basename)\n_p('\\t$(SILENT) rm -rf $(OBJDIR)')\n_p('else')\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*) del $(subst /,\\\\\\\\,$(TARGETDIR)/%s.*)', prj.buildtarget.basename, prj.buildtarget.basename)\nfor target, source in pairs(cfgpairs[anycfg]) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\nfor target, source in pa"
202   "irs(copypairs) do\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,%s) del $(subst /,\\\\\\\\,%s)', target, target)\nend\n_p('\\t$(SILENT) if exist $(subst /,\\\\\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\\\\\,$(OBJDIR))')\n_p('endif')\n_p('')\n_p('prebuild:')\n_p('\\t$(PREBUILDCMDS)')\n_p('')\n_p('prelink:')\n_p('\\t$(PRELINKCMDS)')\n_p('')\n_p('# Per-configuration copied file rules')\nfor cfg in premake.eachconfig(prj) do\n_p('ifneq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\nfor target, source in pairs(cfgpairs[cfg]) do\npremake.make_copyrule(source, target)\nend\n_p('endif')\n_p('')\nend\n_p('# Copied file rules')\nfor target, source in pairs(copypairs) do\npremake.make_copyrule(source, target)\nend\n_p('# Embedded file rules')\nfor _, fname in ipairs(embedded) do \nif path.getextension(fname) == \".resx\" then\n_p('%s: %s', getresourcefilename(prj, fname), _MAKE.esc(fname))\n_p('\\t$(SILENT) $(RESGEN) $^ $@')\nend\n_p('')\nend\nend\nfunction premake.gmake_cs_config(cfg, csc, cfglibs)\n_p('if"
203   "neq (,$(findstring %s,$(config)))', _MAKE.esc(cfg.name:lower()))\n_p('  TARGETDIR  := %s', _MAKE.esc(cfg.buildtarget.directory))\n_p('  OBJDIR     := %s', _MAKE.esc(cfg.objectsdir))\n_p('  DEPENDS    := %s', table.concat(_MAKE.esc(premake.getlinks(cfg, \"dependencies\", \"fullpath\")), \" \"))\n_p('  REFERENCES := %s', table.implode(_MAKE.esc(cfglibs[cfg]), \"/r:\", \"\", \" \"))\n_p('  FLAGS      += %s %s', table.implode(cfg.defines, \"/d:\", \"\", \" \"), table.concat(table.join(csc.getflags(cfg), cfg.buildoptions), \" \"))\n_p('  define PREBUILDCMDS')\nif #cfg.prebuildcommands > 0 then\n_p('\\t@echo Running pre-build commands')\n_p('\\t%s', table.implode(cfg.prebuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\n_p('  define PRELINKCMDS')\nif #cfg.prelinkcommands > 0 then\n_p('\\t@echo Running pre-link commands')\n_p('\\t%s', table.implode(cfg.prelinkcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\n_p('  define POSTBUILDCMDS')\nif #cfg.postbuildcommands > 0 then\n_p('\\t@echo Running post-bu"
204   "ild commands')\n_p('\\t%s', table.implode(cfg.postbuildcommands, \"\", \"\", \"\\n\\t\"))\nend\n_p('  endef')\n_p('endif')\n_p('')\nend\n",
205205
206206   /* actions/vstudio/_vstudio.lua */
207207   "premake.vstudio = { }\nlocal toolsets = {\nvs2010 = \"v100\",\nvs2012 = \"v110\",\nvs2013 = \"v120\",\nvs2015 = \"v140\"\n}\npremake.vstudio.toolset = toolsets[_ACTION] or \"unknown?\"\npremake.vstudio.splashpath = ''\nlocal vstudio = premake.vstudio\nvstudio.platforms = {\nany     = \"Any CPU\",\nmixed   = \"Mixed Platforms\",\nNative  = \"Win32\",\nx86     = \"x86\",\nx32     = \"Win32\",\nx64     = \"x64\",\nPS3     = \"PS3\",\nXbox360 = \"Xbox 360\",\nARM     = \"ARM\",\nOrbis= \"Orbis\"\n}\nfunction vstudio.arch(prj)\nif (prj.language == \"C#\") then\nreturn \"Any CPU\"\nelse\nreturn \"Win32\"\nend\nend\nfunction vstudio.iswinrt()\nreturn vstudio.storeapp ~= nil and vstudio.storeapp ~= ''\nend\nfunction vstudio.buildconfigs(sln)\nlocal cfgs = { }\nlocal platforms = premake.filterplatforms(sln, vstudio.platforms, \"Native\")\nlocal hascpp    = premake.hascppproject(sln)\nlocal hasdotnet = premake.hasdotnetproject(sln)\nif hasdotnet and (_ACTION > \"vs2008\" or hascpp) then\ntable.insert(platforms, 1, \"mix"
trunk/3rdparty/unittest-cpp/UnitTest++/Config.h
r249051r249052
2020#endif
2121
2222#if defined(unix) || defined(__unix__) || defined(__unix) || defined(linux) || \
23    defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || \
24    defined(__OS2__)
23    defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)       
2524    #define UNITTEST_POSIX
2625#endif
2726
trunk/hash/a800_flop.xml
r249051r249052
2424      </part>
2525   </software>
2626
27   <software name="elktrgld">
28      <!-- Flippy disk, c64 version on side A -->
29      <description>Elektra Glide</description>
30      <year>1986</year>
31      <publisher>Mastertronic</publisher>
32      <info name="serial" value="64712" />
3327
34      <part name="flop1" interface="floppy_5_25">
35         <dataarea name="flop" size="92160">
36            <rom name="elektraglide.xfd" size="92160" crc="96185b1c" sha1="fb9825a432b83a2a7e623a2f617d0fa11de08158" offset="0" />
37         </dataarea>
38      </part>
39   </software>
40
41   <software name="koalapnt">
42      <!-- Flippy disk, c64 version on side A -->
43      <description>KoalaPainter (Light Pen)</description>
44      <year>1984</year>
45      <publisher>Koala Technologies</publisher>
46      <info name="serial" value="00626-001" />
47
48      <part name="flop1" interface="floppy_5_25">
49         <dataarea name="flop" size="92160">
50            <rom name="koalapainter.xfd" size="92160" crc="f1447be4" sha1="834d906748f9f4f089912289ab592cf091456d49" offset="0" />
51         </dataarea>
52      </part>
53   </software>
54
5528</softwarelist>
trunk/hash/gameking.xml
r249051r249052
227227   </software>
228228
229229<!-- Same hashes as trojanl, why is there a new entry?
230    <software name="trojanla" cloneof="trojanl" supported="no">
231        <description>Trojan Legend (Alt Revision)</description>
232        <year>200?</year>
233        <publisher>TimeTop</publisher>
234        <part name="cart" interface="gameking_cart">
235            <dataarea name="rom" size="131072">
236                <rom name="trojan legend (alt).bin" size="131072" crc="b832db4f" sha1="5a152bfb2ba2150cff9dc66729ceadc0b47d4f17" offset="0x00000" />
237            </dataarea>
238        </part>
239    </software>
230   <software name="trojanla" cloneof="trojanl" supported="no">
231      <description>Trojan Legend (Alt Revision)</description>
232      <year>200?</year>
233      <publisher>TimeTop</publisher>
234      <part name="cart" interface="gameking_cart">
235         <dataarea name="rom" size="131072">
236            <rom name="trojan legend (alt).bin" size="131072" crc="b832db4f" sha1="5a152bfb2ba2150cff9dc66729ceadc0b47d4f17" offset="0x00000" />
237         </dataarea>
238      </part>
239   </software>
240240-->
241241
242242
trunk/hash/megadriv.xml
r249051r249052
1620416204      <info name="release" value="19920710"/>
1620516205      <info name="alt_title" value="炎ぼ闘球慐 ăƒ‰ăƒƒă‚žćŒŸćčł"/>
1620616206      <part name="cart" interface="megadriv_cart">
16207         <feature name="slot" value="rom_eeprom"/>
1620816207         <dataarea name="rom" width="16" endianness="big" size="524288">
1620916208            <rom name="mpr-14856.bin" size="524288" crc="630f07c6" sha1="ebdf20fd8aaeb3c7ec97302089b3330265118cf0" offset="0x000000"/>
1621016209         </dataarea>
r249051r249052
1827118270      <info name="release" value="19941021"/>
1827218271      <info name="alt_title" value="ロックマン ăƒĄă‚ŹăƒŻăƒŒăƒ«ăƒ‰"/>
1827318272      <part name="cart" interface="megadriv_cart">
18274         <feature name="slot" value="rom_sram"/>
1827518273         <dataarea name="rom" width="16" endianness="big" size="2097152">
1827618274            <rom name="rockman mega world (jpn) (alt).bin" size="2097152" crc="85c956ef" sha1="a435ac53589a29dbb655662c942daab425d3f6bd" offset="0x000000"/>
1827718275         </dataarea>
18278         <dataarea name="sram" size="16384">
18279         </dataarea>
1828018276      </part>
1828118277   </software>
1828218278
r249051r249052
2036620362      <info name="release" value="19911205"/>
2036720363      <info name="alt_title" value="ćżè€…æ­Šé›·äŒèȘŹ"/>
2036820364      <part name="cart" interface="megadriv_cart">
20369         <feature name="slot" value="rom_eeprom"/>
2037020365         <dataarea name="rom" width="16" endianness="big" size="1048576">
2037120366            <rom name="ninja burai densetsu (jpn).bin" size="1048576" crc="a8d828a0" sha1="9cc3419ca7ecaf0d106aa896ffc0266c7145fff7" offset="0x000000"/>
2037220367         </dataarea>
trunk/hash/x1_cass.xml
r249051r249052
1212
1313<softwarelist name="x1_cass" description="Sharp X1 cassettes">
1414
15   <software name="alamein">
16      <description>El Alamein</description>
17      <year>1983</year>
18      <publisher>ăƒăƒ‹ă‚« (Pony Canyon)</publisher>
19      <info name="alt_title" value="ă‚šăƒ«ăƒ»ă‚ąăƒ©ăƒĄă‚€ăƒł"/>
20      <info name="usage" value="In BASIC, type LOAD and then RUN"/>
21      <sharedfeat name="requirement" value="x1_flop:tapbas"/>
22      <part name="cass" interface="x1_cass">
23         <dataarea name="side1" size="12742140">
24            <rom name="alamein.wav" size="12742140" crc="04e00f60" sha1="42f3ef356fdb67ddd0fbdb57e473c23d267f9bf4" offset="0" />
25         </dataarea>
26      </part>
27   </software>
28   
2915   <software name="blckonyx" supported="no">
3016      <description>The Black Onyx</description>
3117      <year>1985</year>
r249051r249052
9076         </dataarea>
9177      </part>
9278   </software>
93   
94   <software name="cball">
95      <description>Cannon Ball</description>
96      <year>1983</year>
97      <publisher>ăƒăƒ‰ă‚œăƒł (Hudson Soft)</publisher>
98      <info name="alt_title" value="ă‚­ăƒŁăƒŽăƒłăƒœăƒŒăƒ«"/>
99      <part name="cass" interface="x1_cass">
100         <dataarea name="side1" size="4857558">
101            <rom name="cball.wav" size="4857558" crc="4405cf21" sha1="769a43d97f69b5d72347ca8b72547e464b9d059b" offset="0" />
102         </dataarea>
103      </part>
104   </software>
10579
10680   <software name="cprowsp">
10781      <description>Champion ProWres Special</description>
r249051r249052
322296         </dataarea>
323297      </part>
324298   </software>
325   
326   <software name="machgjoe">
327      <description>Ginkou Goutou - Machinegun Joe vs. the Mafia</description>
328      <year>1983</year>
329      <publisher>ăƒăƒ‰ă‚œăƒł (Hudson Soft)</publisher>
330      <info name="alt_title" value="éŠ€èĄŒćŒ·ç›— ăƒžă‚·ăƒłă‚Źăƒłă‚žăƒ§ăƒŒ VS ă‚¶ăƒ»ăƒžăƒ•ă‚Łă‚ą"/>
331      <part name="cass" interface="x1_cass">
332         <dataarea name="side1" size="15591932">
333            <rom name="machgjoe.wav" size="15591932" crc="3769199a" sha1="81614c317f432055f2c5fdcce51438de9fbdad7f" offset="0" />
334         </dataarea>
335      </part>
336   </software>
337299
338300   <software name="mappy">
339301      <description>Mappy</description>
trunk/makefile
r249051r249052
144144ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku)
145145OS := haiku
146146endif
147ifeq ($(firstword $(filter OS/2,$(UNAME))),OS/2)
148OS := os2
149GENIEOS := os2
150endif
151147ifndef OS
152148$(error Unable to detect OS from uname -a: $(UNAME))
153149endif
r249051r249052
312308ifeq ($(TARGETOS),macosx)
313309OSD := sdl
314310endif
315
316ifeq ($(TARGETOS),os2)
317OSD := sdl
318311endif
319endif
320312
321313#-------------------------------------------------
322314# which 3rdparty library to build;
r249051r249052
684676ifeq (/bin,$(findstring /bin,$(SHELL)))
685677  SHELLTYPE := posix
686678endif
687ifeq (/bin,$(findstring /bin,$(MAKESHELL)))
688  SHELLTYPE := posix
689endif
690679
691680ifeq (posix,$(SHELLTYPE))
692681  MKDIR = $(SILENT) mkdir -p "$(1)"
r249051r249052
10421031
10431032
10441033#-------------------------------------------------
1045# gmake-os2
1046#-------------------------------------------------
1047
1048
1049$(PROJECTDIR)/gmake-os2/Makefile: makefile $(SCRIPTS) $(GENIE)
1050   $(SILENT) $(GENIE) $(PARAMS) --gcc=os2 --gcc_version=$(GCC_VERSION) gmake
1051
1052.PHONY: os2
1053os2: os2_x86
1054
1055.PHONY: os2_x86
1056os2_x86: generate $(PROJECTDIR)/gmake-os2/Makefile
1057   $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-os2 config=$(CONFIG)32
1058
1059
1060#-------------------------------------------------
10611034# Clean/bootstrap
10621035#-------------------------------------------------
10631036
trunk/scripts/src/osd/sdl_cfg.lua
r249051r249052
144144      "-isystem /usr/local/include",
145145   }
146146elseif _OPTIONS["targetos"]=="os2" then
147   defines {
148      "SDLMAME_OS2",
149   }
150147   buildoptions {
151148      backtick(sdlconfigcmd() .. " --cflags"),
152149   }
trunk/scripts/target/mame/arcade.lua
r249051r249052
33323332   MAME_DIR .. "src/mame/machine/cdicdic.c",
33333333   MAME_DIR .. "src/mame/drivers/cesclass.c",
33343334   MAME_DIR .. "src/mame/drivers/chance32.c",
3335   MAME_DIR .. "src/mame/drivers/chexx.c",
33363335   MAME_DIR .. "src/mame/drivers/chicago.c",
33373336   MAME_DIR .. "src/mame/drivers/chsuper.c",
33383337   MAME_DIR .. "src/mame/drivers/cidelsa.c",
r249051r249052
33793378   MAME_DIR .. "src/mame/video/esripsys.c",
33803379   MAME_DIR .. "src/mame/drivers/ettrivia.c",
33813380   MAME_DIR .. "src/mame/drivers/extrema.c",
3381   MAME_DIR .. "src/mame/drivers/faceoffh.c",
33823382   MAME_DIR .. "src/mame/drivers/fireball.c",
33833383   MAME_DIR .. "src/mame/drivers/flipjack.c",
33843384   MAME_DIR .. "src/mame/drivers/flower.c",
trunk/scripts/target/mame/mess.lua
r249051r249052
12321232}
12331233
12341234createMESSProjects(_target, _subtarget, "canon")
1235files {
1236   MAME_DIR .. "src/mess/drivers/cat.c",
1237   MAME_DIR .. "src/mess/drivers/x07.c",
1235files {             
1236   MAME_DIR .. "src/mess/drivers/cat.c",       
1237   MAME_DIR .. "src/mess/drivers/x07.c",       
1238   MAME_DIR .. "src/mess/drivers/canon_s80.c",
12381239}
12391240
12401241createMESSProjects(_target, _subtarget, "cantab")
trunk/scripts/toolchain.lua
r249051r249052
2525      { "nacl",          "Native Client"          },
2626      { "nacl-arm",      "Native Client - ARM"    },
2727      { "netbsd",        "NetBSD"                },
28      { "os2",           "OS/2"                   },
2928      { "osx",           "OSX (GCC compiler)"     },
3029      { "osx-clang",     "OSX (Clang compiler)"   },
3130      { "pnacl",         "Native Client - PNaCl"  },
r249051r249052
311310      if "rpi" == _OPTIONS["gcc"] then
312311         location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-rpi")
313312      end
314
315      if "os2" == _OPTIONS["gcc"] then
316         location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-os2")
317      end
318313   elseif _ACTION == "vs2012" or _ACTION == "vs2013" or _ACTION == "vs2015" then
319314
320315      if (_ACTION .. "-clang") == _OPTIONS["vs"] then
r249051r249052
862857      targetdir (_buildDir .. "rpi" .. "/bin")
863858      objdir (_buildDir .. "rpi" .. "/obj")
864859
865   configuration { "os2" }
866      objdir (_buildDir .. "os2" .. "/obj")
867
868   configuration { "os2", "Release" }
869      targetdir (_buildDir .. "os2" .. "/bin/Release")
870
871   configuration { "os2", "Debug" }
872      targetdir (_buildDir .. "os2" .. "/bin/Debug")
873
874860   configuration {} -- reset configuration
875861
876862   return true
r249051r249052
933919         -- ALLOW_MEMORY_GROWTH
934920      }
935921
936   configuration { "os2", "Release" }
937      postbuildcommands {
938         "$(SILENT) echo Stripping symbols.",
939         "$(SILENT) lxlite /B- /L- /CS \"$(TARGET)\""
940      }
941
942922   configuration {} -- reset configuration
943923end
944924
trunk/src/emu/attotime.h
r249051r249052
121121
122122   void normalize()
123123   {
124         while (m_attoseconds >= ATTOSECONDS_PER_SECOND)
125         {
126            m_seconds++;
127            m_attoseconds -= ATTOSECONDS_PER_SECOND;
128         }
124        while (m_attoseconds >= ATTOSECONDS_PER_SECOND)
125        {
126           m_seconds++;
127           m_attoseconds -= ATTOSECONDS_PER_SECOND;
128        }
129129   }
130130
131131   attoseconds_t attoseconds() const { return m_attoseconds; }
trunk/src/emu/bus/c64/c128_partner.c
r249051r249052
22// copyright-holders:Curt Coder
33/**********************************************************************
44
5    Timeworks PARTNER 128 cartridge emulation
5   Timeworks PARTNER 128 cartridge emulation
66
77**********************************************************************/
88
99/*
1010
11    PCB Layout
12    ----------
11   PCB Layout
12   ----------
1313
14    |---------------|
15    |LS74  SW     * |
16    |LS09      LS273|
17    |LS139   RAM    |
18    |LS133          |
19    |     LS240     |
20    |LS33    ROM    |
21    |LS09           |
22     |||||||||||||||
14   |---------------|
15   |LS74  SW     * |
16   |LS09      LS273|
17   |LS139   RAM    |
18   |LS133          |
19   |     LS240     |
20   |LS33    ROM    |
21   |LS09           |
22    |||||||||||||||
2323
24    ROM     - Toshiba TMM24128AP 16Kx8 EPROM (blank label)
25    RAM     - Sony CXK5864PN-15L 8Kx8 SRAM
26    SW      - push button switch
27    *       - solder point for joystick port dongle
24   ROM     - Toshiba TMM24128AP 16Kx8 EPROM (blank label)
25   RAM     - Sony CXK5864PN-15L 8Kx8 SRAM
26   SW      - push button switch
27   *       - solder point for joystick port dongle
2828
2929*/
3030
r249051r249052
193193      {
194194         /*
195195
196             bit     description
196            bit    description
197197
198             0       RAM A7
199             1       RAM A8
200             2       RAM A9
201             3       RAM A10
202             4       RAM A11
203             5       RAM A12
204             6       LS74 1Cd,2Cd
205             7       N/C
198            0      RAM A7
199            1      RAM A8
200            2      RAM A9
201            3      RAM A10
202            4      RAM A11
203            5      RAM A12
204            6      LS74 1Cd,2Cd
205            7      N/C
206206
207207         */
208208
trunk/src/emu/bus/c64/c128_partner.h
r249051r249052
2424// ======================> partner128_t
2525
2626class partner128_t : public device_t,
27                  public device_c64_expansion_card_interface
28                  //public device_vcs_control_port_interface
27                public device_c64_expansion_card_interface
28                //public device_vcs_control_port_interface
2929{
3030public:
3131   // construction/destruction
trunk/src/emu/bus/centronics/printer.c
r249051r249052
9999   output_busy(m_busy);
100100   output_fault(1);
101101   output_ack(1);
102   output_select(1);
103102}
104103
105104/*-------------------------------------------------
trunk/src/emu/bus/msx_cart/fs_sr022.c
r249051r249052
6969         break;
7070   }
7171}
72
trunk/src/emu/bus/ti99_peb/hfdc.c
r249051r249052
350350
351351       7     6     5     4     3     2     1     0
352352    +-----+-----+-----+-----+-----+-----+-----+-----+
353    |  0  |  0  |  0  |  0  | WAIT| MON*| DIP | IRQ |
353    |  0  |  0  |  0  |  0  | | MON | DIP | IRQ |
354354    +-----+-----+-----+-----+-----+-----+-----+-----+
355355
356    WAIT = Wait for WDS1 to become ready
357    MON* = Motor on
356    MON = Motor on
358357    DIP = DMA in progress
359358    IRQ = Interrupt request
360359    ---
r249051r249052
376375            reply = 0;
377376            if (m_irq == ASSERT_LINE)  reply |= 0x01;
378377            if (m_dip == ASSERT_LINE)  reply |= 0x02;
379            if (!m_motor_running) reply |= 0x04;
380            if (m_wait_for_hd1) reply |= 0x08;
378            if (m_motor_running) reply |= 0x04;
381379         }
382380         *value = reply;
383381      }
r249051r249052
890888   }
891889
892890   m_cru_base = ioport("CRUHFDC")->read();
893   m_wait_for_hd1 = ioport("WAITHD1")->read();
894891
895892   // Resetting values
896893   m_rom_page = 0;
r249051r249052
959956    the drives 1 to 4 are renamed to DSK5-DSK8 (see [1] p. 7).
960957*/
961958INPUT_PORTS_START( ti99_hfdc )
962   PORT_START( "WAITHD1" )
963   PORT_DIPNAME( 0x01, 0x00, "HFDC Wait for HD1" )
964      PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
965      PORT_DIPSETTING( 0x01, DEF_STR( On ) )
966
967959   PORT_START( "CRUHFDC" )
968960   PORT_DIPNAME( 0x1f00, 0x1100, "HFDC CRU base" )
969961      PORT_DIPSETTING( 0x1000, "1000" )
trunk/src/emu/bus/ti99_peb/hfdc.h
r249051r249052
142142   // DMA in progress
143143   bool m_dma_in_progress;
144144
145   // Wait for HD. This was an addition in later cards.
146   bool m_wait_for_hd1;
147
148145   // Device Service Routine ROM (firmware)
149146   UINT8*  m_dsrrom;
150147
trunk/src/emu/cpu/h6280/6280dasm.c
r249051r249052
1818
1919******************************************************************************/
2020
21#ifdef __OS2__
22/* To avoid name clash of _brk */
23#define __STRICT_ANSI__
24#endif
25
2621#include "emu.h"
2722
2823#define RDOP(addr)   (oprom[addr - pc])
trunk/src/emu/cpu/h8/h8_timer16.c
r249051r249052
164164{
165165   intc = owner()->siblingdevice<h8_intc_device>(intc_tag);
166166   channel_active = false;
167   device_reset();
167   clock_type = DIV_1;
168168
169169   save_item(NAME(tgr_clearing));
170170   save_item(NAME(tcr));
trunk/src/emu/cpu/pdp8/pdp8.c
r249051r249052
1212
1313CPU_DISASSEMBLE( pdp8 );
1414
15#define OP          ((op >> 011) & 07)
15#define OP         ((op >> 011) & 07)
1616
17#define MR_IND      ((op >> 010) & 01)
18#define MR_PAGE     ((op >> 07) & 01)
19#define MR_ADDR     (op & 0177)
17#define MR_IND      ((op >> 010) & 01)
18#define MR_PAGE      ((op >> 07) & 01)
19#define MR_ADDR      (op & 0177)
2020
21#define IOT_DEVICE  ((op >> 03) & 077)
22#define IOT_IOP1    (op & 01)
23#define IOT_IOP2    ((op >> 01) & 01)
24#define IOT_IOP4    ((op >> 02) & 01)
21#define IOT_DEVICE   ((op >> 03) & 077)
22#define IOT_IOP1   (op & 01)
23#define IOT_IOP2   ((op >> 01) & 01)
24#define IOT_IOP4   ((op >> 02) & 01)
2525
26#define OPR_GROUP   ((op >> 010) & 01)
27#define OPR_CLA     ((op >> 07) & 01)
28#define OPR_CLL     ((op >> 06) & 01)
29#define OPR_CMA     ((op >> 05) & 01)
30#define OPR_CML     ((op >> 04) & 01)
31#define OPR_ROR     ((op >> 03) & 01)
32#define OPR_ROL     ((op >> 02) & 01)
33#define OPR_ROT2    ((op >> 01) & 01)
34#define OPR_IAC     (op & 01)
26#define OPR_GROUP   ((op >> 010) & 01)
27#define OPR_CLA      ((op >> 07) & 01)
28#define OPR_CLL      ((op >> 06) & 01)
29#define OPR_CMA      ((op >> 05) & 01)
30#define OPR_CML      ((op >> 04) & 01)
31#define OPR_ROR      ((op >> 03) & 01)
32#define OPR_ROL      ((op >> 02) & 01)
33#define OPR_ROT2   ((op >> 01) & 01)
34#define OPR_IAC      (op & 01)
3535
36#define OPR_SMA     OPR_CLL
37#define OPR_SZA     OPR_CMA
38#define OPR_SNL     OPR_CML
39#define OPR_REVSKIP OPR_ROR
40#define OPR_OSR     OPR_ROL
41#define OPR_HLT     OPR_ROT2
36#define OPR_SMA      OPR_CLL
37#define OPR_SZA      OPR_CMA
38#define OPR_SNL      OPR_CML
39#define OPR_REVSKIP   OPR_ROR
40#define OPR_OSR      OPR_ROL
41#define OPR_HLT      OPR_ROT2
4242
43#define OPR_GROUP_MASK  0401
44#define OPR_GROUP1_VAL  0000
45#define OPR_GROUP2_VAL  0400
43#define OPR_GROUP_MASK   0401
44#define OPR_GROUP1_VAL   0000
45#define OPR_GROUP2_VAL   0400
4646
4747const device_type PDP8CPU = &device_creator<pdp8_device>;
4848
trunk/src/emu/cpu/tms32082/mp_ops.c
r249051r249052
465465         break;
466466      }
467467
468      case 0x12:          // and.tf
468      case 0x12:         // and.tf
469469      {
470470         int rd = OP_RD();
471471         int rs = OP_RS();
r249051r249052
692692         break;
693693      }
694694
695      case 0x45:          // jsr.a
695      case 0x45:         // jsr.a
696696      {
697697         int link = OP_LINK();
698698         int base = OP_BASE();
r249051r249052
929929         UINT32 compmask = endmask & shiftmask;
930930
931931         UINT32 res = 0;
932         if (r)      // right
932         if (r)      // right
933933         {
934934            res = ROTATE_R(source, rot) & compmask;
935935            res = SIGN_EXTEND(res, rot);
936936         }
937         else        // left
937         else      // left
938938         {
939939            res = ROTATE_L(source, rot) & compmask;
940940         }
r249051r249052
10221022      }
10231023
10241024      case 0x3a:
1025      case 0x3b:          // or.ft
1025      case 0x3b:         // or.ft
10261026      {
10271027         int rd = OP_RD();
10281028         int rs = OP_RS();
trunk/src/emu/cpu/tms32082/tms32082.c
r249051r249052
298298
299299         for (int i=0; i < num; i++)
300300         {
301             printf("Entry %d:\n", i);
302             for (int k=0; k < 6; k++)
303             {
304                 for (int l=0; l < 4; l++)
305                 {
306                     UINT32 dd = m_program->read_dword(ra);
307                     ra += 4;
301            printf("Entry %d:\n", i);
302            for (int k=0; k < 6; k++)
303            {
304               for (int l=0; l < 4; l++)
305               {
306                  UINT32 dd = m_program->read_dword(ra);
307                  ra += 4;
308308
309                     printf("%08X(%f) ", dd, u2f(dd));
310                 }
311                 printf("\n");
312             }
313             printf("\n");
309                  printf("%08X(%f) ", dd, u2f(dd));
310               }
311               printf("\n");
312            }
313            printf("\n");
314314         }
315315         */
316316
317317         UINT32 ra = 0x1000280;
318
318         
319319         int oldnum = m_program->read_dword(0x600ffffc);
320320         UINT32 rb = 0x60000000 + (oldnum * 0x60);
321321
r249051r249052
367367      case 0xa:           // PPERROR
368368         return 0xe0000;
369369
370      case 0xe:           // TCOUNT
370      case 0xe:         // TCOUNT
371371         return m_tcount;
372372
373373      case 0x4000:        // IN0P
r249051r249052
413413         printf("IE = %08X\n", data);
414414         break;
415415
416      case 0xe:           // TCOUNT
416      case 0xe:         // TCOUNT
417417         m_tcount = data;
418418         break;
419419
trunk/src/emu/cpu/ucom4/ucom4.c
r249051r249052
268268UINT8 upd557l_cpu_device::input_r(int index)
269269{
270270   index &= 0xf;
271
271   
272272   if (index == NEC_UCOM4_PORTB)
273273      logerror("%s read from unknown port %c at $%03X\n", tag(), 'A' + index, m_prev_pc);
274274   else
275275      return ucom4_cpu_device::input_r(index);
276
276   
277277   return 0;
278278}
279279
trunk/src/emu/drivers/emudummy.c
r249051r249052
3333ROM_END
3434
3535
36GAME( 1900, __dummy, 0, __dummy, 0, driver_device, 0, ROT0, "(none)", "Dummy", MACHINE_NO_SOUND )
36GAME( 1900, __dummy, 0, __dummy, 0, driver_device, 0, ROT0, "(none)", "Dummy", GAME_NO_SOUND )
trunk/src/emu/emuopts.c
r249051r249052
595595   m_sleep = bool_value(OPTION_SLEEP);
596596   m_refresh_speed = bool_value(OPTION_REFRESHSPEED);
597597}
598
trunk/src/emu/machine/68230pit.c
r249051r249052
11// license:BSD-3-Clause
22// copyright-holders:Joakim Larsson Edstr??m
33/**********************************************************************
4*
5*   Motorola MC68230 PI/T Parallell Interface and Timer
6*
7*  Revisions
8*  2015-07-15 JLE initial
9*
10*  Todo
11*  - Add clock and timers
12*  - Add all missing registers
13*  - Add configuration
14**********************************************************************/
154
16#include "68230pit.h"
5    Motorola MC68230 PI/T Parallell Interface and Timer
176
18#define LOG(x) /* x */
7Revisions
8 2015-07-15 JLE initial
199
20//**************************************************************************
21//  DEVICE TYPE DEFINITIONS
22//**************************************************************************
10Todo
11 - Add clock and timers
12 - Add all missing registers
13 - Add configuration
14**********************************************************************/
2315
24const device_type PIT68230 = &device_creator<pit68230_device>;
16/*
17Force CPU-1 init sequence
180801EA 0E0000 W 0000 PGCR  data_w: 0000 -> 0000 & 00ff
190801EA 0E0002 W 0000 PSRR  data_w: 0000 -> 0001 & 00ff
200801EA 0E0004 W FFFF PADDR data_w: 00ff -> 0002 & 00ff
210801EA 0E0006 W 0000 PBDDR data_w: 0000 -> 0003 & 00ff
220801F0 0E000C W 6060 PACR  data_w: 0060 -> 0006 & 00ff
230801F6 0E000E W A0A0 PBCR  data_w: 00a0 -> 0007 & 00ff
240801FC 0E0000 W 3030 PGCR  data_w: 0030 -> 0000 & 00ff
25080202 0E000E W A8A8 PBCR  data_w: 00a8 -> 0007 & 00ff
26080210 0E000E W A0A0 PBCR  data_w: 00a0 -> 0007 & 00ff
2527
26//-------------------------------------------------
27//  pit68230_device - constructors
28//-------------------------------------------------
29pit68230_device::pit68230_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source)
30        : device_t (mconfig, type, name, tag, owner, clock, shortname, source),
31        device_execute_interface (mconfig, *this)
32        , m_icount (0)
33        , m_write_pa (*this)
34        , m_write_h2 (*this)
35{
36}
28Force CPU-1 after one keypress in terminal
29081DC0 0E000C W 6868 PACR
30081DC8 0E000C W 6060 PACR
31*/
3732
3833
39pit68230_device::pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
40        : device_t (mconfig, PIT68230, "PIT68230", tag, owner, clock, "pit68230", __FILE__),
41        device_execute_interface (mconfig, *this)
42        , m_icount (0)
43        , m_write_pa (*this)
44        , m_write_h2 (*this)
45{
46}
34#include "emu.h"
35#include "68230pit.h"
4736
48//-------------------------------------------------
49//  device_start - device-specific startup
50//-------------------------------------------------
51void pit68230_device::device_start ()
52{
53        LOG (logerror ("PIT68230 device started\n"));
54        m_icountptr = &m_icount;
37/***************************************************************************
38    IMPLEMENTATION
39***************************************************************************/
5540
56        // resolve callbacks
57        m_write_pa.resolve_safe ();
58        m_write_h2.resolve_safe ();
59}
41// device type definition
42const device_type PIT68230 = &device_creator<pit68230_device>;
6043
6144//-------------------------------------------------
62//  device_reset - device-specific reset
45//  pit68230_device - constructor
6346//-------------------------------------------------
64void pit68230_device::device_reset ()
47
48pit68230_device::pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
49      : device_t(mconfig, PIT68230, "Motorola 68230 PI/T", tag, owner, clock, "pit68230", __FILE__)
6550{
66        LOG (logerror ("PIT68230 device reseted\n"));
67        m_pgcr = 0;
68        m_psrr = 0;
69        m_paddr = 0;
70        m_pbddr = 0;
71        m_pcddr = 0;
72        m_pacr = 0; m_write_h2 (m_pacr);
73        m_pbcr = 0;
74        m_padr = 0; m_write_pa ((offs_t)0, m_padr); // TODO: check PADDR
75        m_pbdr = 0;
76        m_psr = 0;
7751}
7852
79//-------------------------------------------------
80//  device_timer - handler timer events
81//-------------------------------------------------
82void pit68230_device::device_timer (emu_timer &timer, device_timer_id id, INT32 param, void *ptr)
53void pit68230_device::device_start()
8354{
55   printf("PIT68230 device started\n");
8456}
8557
86void pit68230_device::h1_set (UINT8 state)
58void pit68230_device::device_reset()
8759{
88        LOG (logerror ("h1_set %d @ m_psr %2x => ", state, m_psr));
89        if (state) m_psr |= 1; else m_psr &= ~1;
90        LOG (logerror ("%02x %lld\n", m_psr, machine ().firstcpu->total_cycles ()));
60   printf("PIT68230 device reseted\n");
61   m_pgcr = 0;
62   m_psrr = 0;
63   m_paddr = 0;
64   m_pbddr = 0;
65   m_pcddr = 0;
66   m_pacr = 0;
67   m_pbcr = 0;
68   m_padr = 0;
69   m_pbdr = 0;
70   m_psr = 0;
9171}
9272
93void pit68230_device::portb_setbit (UINT8 bit, UINT8 state)
73WRITE8_MEMBER( pit68230_device::data_w )
9474{
95        LOG (logerror ("portb_setbit %d/%d @ m_pbdr %2x => ", bit, state, m_pbdr));
96        if (state) m_pbdr |= (1 << bit); else m_pbdr &= ~(1 << bit);
97        LOG (logerror ("%02x %lld\n", m_pbdr, machine ().firstcpu->total_cycles ()));
75   printf("data_w: %04x -> ", data);
76   switch (offset)
77   {
78   case PIT_68230_PGCR:
79   printf("PGCR");
80   m_pgcr = data;
81   break;
82   case PIT_68230_PSRR:
83   printf("PSRR");
84   m_psrr = data;
85   break;
86   case PIT_68230_PADDR:
87   printf("PADDR");
88   m_paddr = data;
89   break;
90   case PIT_68230_PBDDR:
91   printf("PBDDR");
92   m_pbddr = data;
93   break;
94   case PIT_68230_PACR:
95   printf("PACR");
96   m_pacr = data;
97   break;
98   case PIT_68230_PBCR:
99   printf("PBCR");
100   m_pbcr = data;
101   break;
102   case PIT_68230_PADR:
103   printf("PADR");
104   m_padr = data;
105   break;
106   case PIT_68230_PSR:
107   printf("PSR");
108   m_padr = data;
109   break;
110   default:
111   printf("unhandled register %02x", offset);
112   }
113   printf("\n");
98114}
99115
100//-------------------------------------------------
101//  execute_run -
102//-------------------------------------------------
103void pit68230_device::execute_run ()
116READ8_MEMBER( pit68230_device::data_r )
104117{
105        do {
106                synchronize ();
118   UINT8 data = 0;
107119
108                m_icount--;
109        } while (m_icount > 0);
110}
120   printf("data_r: ");
121   switch (offset)
122   {
123   case PIT_68230_PGCR:
124   printf("PGCR");
125   data = m_pgcr;
126   break;
127   case PIT_68230_PSRR:
128   printf("PSRR");
129   data = m_psrr;
130   break;
131   case PIT_68230_PADDR:
132   printf("PADDR");
133   data = m_paddr;
134   break;
135   case PIT_68230_PBDDR:
136   printf("PBDDR");
137   data = m_pbddr;
138   break;
139   case PIT_68230_PACR:
140   printf("PACR");
141   data = m_pacr;
142   break;
143   case PIT_68230_PBCR:
144   printf("PBCR");
145   data = m_pbcr;
146   break;
147   case PIT_68230_PADR:
148   printf("PADR");
149   data = m_padr;
150   break;
151   case PIT_68230_PBDR:
152   /* 4.6.2. PORT B DATA REGISTER (PBDR). The port B data register is a holding register for moving data
153to and from port B pins. The port B data direction register determines whether each pin is an input (zero)
154or an output (one). This register is readable and writable at all times. Depending on the chosen mode/submode,
155reading or writing may affect the double-buffered handshake mechanism. The port B data register is not affected
156by the assertion of the RESET pin. PB0-PB7 sits on pins 17-24 on a 48 pin DIP package */
157   printf("PBDR");
158   data = m_pbdr;
159   //    data = (m_pbdr & 0xfc) | 1; // CPU-1 centronics interface expects to see 2 lowest bits equal 1 for printer
160   break;
161   case PIT_68230_PSR:
162   printf("PSR");
163   data = m_psr;
164   //    data = m_psr | 1; // CPU-1 centronics interface expects status to be non zero
165   break;
166   default:
167   printf("unhandled register %02x", offset);
168   data = 0;
169   }
170   printf("\n");
111171
112LOG (static INT32 ow_cnt = 0);
113LOG (static INT32 ow_data = 0);
114LOG (static INT32 ow_ofs = 0);
115
116WRITE8_MEMBER (pit68230_device::write){
117        switch (offset) {
118        case PIT_68230_PGCR:
119                m_pgcr = data;
120                break;
121
122        case PIT_68230_PSRR:
123                m_psrr = data;
124                break;
125
126        case PIT_68230_PADDR:
127                m_paddr = data;
128                break;
129
130        case PIT_68230_PBDDR:
131                m_pbddr = data;
132                break;
133
134        case PIT_68230_PACR:
135                m_pacr = data;
136                // callbacks
137                /*PACR in Mode 0
138                 * 5 43  H2 Control in Submode 00 && 01
139                 * ------------------------------------
140                 * 0 XX  Input pin  - edge-sensitive status input, H2S is set on an asserted edge.
141                 * 1 00  Output pin - negated, H2S is always clear.
142                 * 1 01  Output pin - asserted, H2S is always clear.
143                 * 1 10  Output pin - interlocked input handshake protocol, H2S is always clear.
144                 * 1 11  Output pin - pulsed input handshake protocol, H2S is always clear.
145                 *
146                 * 5 43  H2 Control in Submode 1x
147                 * ------------------------------------
148                 * 0 XX  Input pin  - edge-sensitive status input, H2S is set on an asserted edge.
149                 * 1 X0  Output pin - negated, H2S is always cleared.
150                 * 1 X1  Output pin - asserted, H2S is always cleared.
151                 */
152                m_write_h2 (m_pacr & 0x08 ? 1 : 0); // TODO: Check mode and submodes
153                break;
154
155        case PIT_68230_PBCR:
156                m_pbcr = data;
157                break;
158
159        case PIT_68230_PADR:
160                m_padr = data;
161                // callbacks
162                m_write_pa ((offs_t)0, m_padr); // TODO: check PADDR
163                break;
164
165        case PIT_68230_PSR:
166                m_psr = data;
167                break;
168
169        default:
170                LOG (logerror ("unhandled register %02x", offset));
171        }
172
173        LOG (if (offset != ow_ofs || data != ow_data || ow_cnt >= 1000) {
174                logerror ("\npit68230_device::write: previous identical operation performed %02x times\n", ow_cnt);
175                ow_cnt = 0;
176                ow_data = data;
177                ow_ofs = offset;
178                logerror ("pit68230_device::write: offset=%02x data=%02x %lld\n", ow_ofs, ow_data, machine ().firstcpu->total_cycles ());
179        }
180                else
181                        ow_cnt++; )
172   return data;
182173}
183
184LOG (static INT32 or_cnt = 0);
185LOG (static INT32 or_data = 0);
186LOG (static INT32 or_ofs = 0);
187
188READ8_MEMBER (pit68230_device::read){
189        UINT8 data = 0;
190
191        switch (offset) {
192        case PIT_68230_PGCR:
193                data = m_pgcr;
194                break;
195
196        case PIT_68230_PSRR:
197                data = m_psrr;
198                break;
199
200        case PIT_68230_PADDR:
201                data = m_paddr;
202                break;
203
204        case PIT_68230_PBDDR:
205                data = m_pbddr;
206                break;
207
208        case PIT_68230_PACR:
209                data = m_pacr;
210                break;
211
212        case PIT_68230_PBCR:
213                data = m_pbcr;
214                break;
215
216        case PIT_68230_PADR:
217                data = m_padr;
218                break;
219
220        case PIT_68230_PBDR:
221                /* 4.6.2. PORT B DATA REGISTER (PBDR). The port B data register is a holding
222                 * register for moving data to and from port B pins. The port B data direction
223                 * register determines whether each pin is an input (zero) or an output (one).
224                 * This register is readable and writable at all times. Depending on the chosen
225                 * mode/submode, reading or writing may affect the double-buffered handshake
226                 * mechanism. The port B data register is not affected by the assertion of the
227                 * RESET pin. PB0-PB7 sits on pins 17-24 on a 48 pin DIP package */
228                data = m_pbdr;
229                break;
230
231        case PIT_68230_PSR:
232                /* 4.8. PORT STATUS REGISTER (PSR) The port status register contains information about
233                 * handshake pin activity. Bits 7-4 show the instantaneous level of the respective handshake
234                 * pin, and are independent of the handshake pin sense bits in the port general control
235                 * register. Bits 3-0 are the respective status bits referred to throughout this document.
236                 * Their interpretation depends on the programmed mode/submode of the PI/T. For bits
237                 * 3-0 a one is the active or asserted state. */
238                data = m_psr;
239                break;
240
241        default:
242                LOG (logerror ("unhandled register %02x", offset));
243                data = 0;
244        }
245
246        LOG (if (offset != or_ofs || data != or_data || or_cnt >= 1000) {
247                logerror ("\npit68230_device::read: previous identical operation performed %02x times\n", or_cnt);
248                or_cnt = 0;
249                or_data = data;
250                or_ofs = offset;
251                logerror ("pit68230_device::read: offset=%02x data=%02x %lld\n", or_ofs, or_data, machine ().firstcpu->total_cycles ());
252        }
253                else
254                        or_cnt++; )
255
256        return data;
257}
trunk/src/emu/machine/68230pit.h
r249051r249052
11// license:BSD-3-Clause
22// copyright-holders:Joakim Larsson Edstr??m
33/**********************************************************************
4*
5*   Motorola MC68230 PI/T Parallell Interface and Timer
6*
7*                           _____   _____
8*                   D5   1 |*    \_/     | 48  D4
9*                   D6   2 |             | 47  D3
10*                   D7   3 |             | 46  D2
11*                  PA0   4 |             | 45  D1
12*                  PA1   5 |             | 44  D0
13*                  PA2   6 |             | 43  R/W*
14*                  PA3   7 |             | 42  DTACK*
15*                  PA4   8 |             | 41  CS*
16*                  PA5   9 |             | 40  CLK
17*                  PA6  10 |             | 39  RESET*
18*                  PA7  11 |             | 38  VSS
19*                  Vcc  12 |   TS68230   | 37  PC7/TIACK*
20*                   H1  13 |   SC87845   | 36  PC6/PIACK*
21*                   H2  14 |             | 35  PC5/PIRQ*
22*                   H3  15 |             | 34  PC4/DMAREQ*
23*                   H4  16 |             | 33  PC3/TOUT
24*                  PB0  17 |             | 32  PC2/TIN
25*                  PB1  18 |             | 31  PC1
26*                  PB2  19 |             | 30  PC0
27*                  PB3  20 |             | 29  RS1
28*                  PB4  21 |             | 28  RS2
29*                  PB5  22 |             | 27  RS3
30*                  PB6  23 |             | 26  RS4
31*                  PB7  24 |_____________| 25  RS5
32*
33**********************************************************************/
344
5    Motorola MC68230 PI/T Parallell Interface and Timer
6
7**********************************************************************/
358#pragma once
369
3710#ifndef __68230PIT_H__
r249051r249052
3912
4013#include "emu.h"
4114
42//**************************************************************************
43//  INTERFACE CONFIGURATION MACROS
44//**************************************************************************
45
46#define MCFG_PIT68230_PA_OUTPUT_CALLBACK(_write) \
47        devcb = &pit68230_device::set_pa_wr_callback (*device, DEVCB_ ## _write);
48
49#define MCFG_PIT68230_PB_OUTPUT_CALLBACK(_write) \
50        devcb = &pit68230_device::set_pb_wr_callback (*device, DEVCB_ ## _write);
51
52#define MCFG_PIT68230_H2_CALLBACK(_write) \
53        devcb = &pit68230_device::set_h2_wr_callback (*device, DEVCB_ ## _write);
54
5515/*-----------------------------------------------------------------------
56 * Registers                RS1-RS5   R/W Description
57 * -------------------------------------------------------------------------*/
16  Registers                RS1-RS5   R/W Description
17-------------------------------------------------------------------------*/
5818#define PIT_68230_PGCR        0x00 /* RW Port General Control register   */
5919#define PIT_68230_PSRR        0x01 /* RW Port Service Request register   */
6020#define PIT_68230_PADDR       0x02 /* RW Port A Data Direction register  */
r249051r249052
8242//**************************************************************************
8343//  TYPE DEFINITIONS
8444//**************************************************************************
85class pit68230_device :  public device_t, public device_execute_interface
45class pit68230_device :  public device_t
8646{
8747public:
88// construction/destruction
89pit68230_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source);
90pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
91template<class _Object> static devcb_base &set_pa_wr_callback (device_t &device, _Object object)
92{
93        return downcast<pit68230_device &>(device).m_write_pa.set_callback (object);
94}
95template<class _Object> static devcb_base &set_h2_wr_callback (device_t &device, _Object object)
96{
97        return downcast<pit68230_device &>(device).m_write_h2.set_callback (object);
98}
48   // construction/destruction
49   pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
50   DECLARE_WRITE8_MEMBER( data_w );
51   DECLARE_READ8_MEMBER( data_r );
9952
100DECLARE_WRITE8_MEMBER (write);
101DECLARE_READ8_MEMBER (read);
102
103void h1_set (UINT8 state);
104void portb_setbit (UINT8 bit, UINT8 state);
105
10653protected:
107// device-level overrides
108virtual void device_start ();
109virtual void device_reset ();
110virtual void device_timer (emu_timer &timer, device_timer_id id, int param, void *ptr);
111virtual void execute_run ();
112int m_icount;
113devcb_write8 m_write_pa;
114devcb_write_line m_write_h2;
54   // device-level overrides
55   virtual void device_start();
56   virtual void device_reset();
11557
116// peripheral ports
117UINT8 m_pgcr;           // Port General Control register
118UINT8 m_psrr;           // Port Service Request register
119UINT8 m_paddr;          // Port A Data Direction register
120UINT8 m_pbddr;          // Port B Data Direction register
121UINT8 m_pcddr;          // Port C Data Direction register
122UINT8 m_pacr;           // Port A Control register
123UINT8 m_pbcr;           // Port B Control register
124UINT8 m_padr;           // Port A Data register
125UINT8 m_pbdr;           // Port B Data register
126UINT8 m_psr;            // Port Status Register
58private:
59      UINT8  m_pgcr;  // Port General Control register
60   UINT8  m_psrr;  // Port Service Request register
61   UINT8  m_paddr; // Port A Data Direction register
62   UINT8  m_pbddr; // Port B Data Direction register
63   UINT8  m_pcddr; // Port C Data Direction register
64   UINT8  m_pacr;  // Port A Control register
65   UINT8  m_pbcr;  // Port B Control register
66   UINT8  m_padr;  // Port A Data register
67   UINT8  m_pbdr;  // Port B Data register
68   UINT8  m_psr;   // Port Status Register
12769};
12870
71
12972// device type definition
13073extern const device_type PIT68230;
131#endif /* __68230PIT_H__ */
74
75#endif // __68230PIT__
trunk/src/emu/machine/i8251.c
r249051r249052
692692{
693693   m_tx_data = data;
694694
695      LOG(("data_w %02x\n" , data));
695        LOG(("data_w %02x\n" , data));
696696//  printf("i8251 transmit char: %02x\n",data);
697697
698698   /* writing clears */
r249051r249052
714714
715715void i8251_device::receive_character(UINT8 ch)
716716{
717
717718   m_rx_data = ch;
718719
719720   /* char has not been read and another has arrived! */
r249051r249052
734735
735736READ8_MEMBER(i8251_device::data_r)
736737{
737   LOG(("read data: %02x, STATUS=%02x\n",m_rx_data,m_status));
738    LOG(("read data: %02x, STATUS=%02x\n",m_rx_data,m_status));
738739   /* reading clears */
739740   m_status &= ~I8251_STATUS_RX_READY;
740741
trunk/src/emu/machine/i8251.h
r249051r249052
133133
134134   /* data being received */
135135   UINT8 m_rx_data;
136      UINT8 m_tx_data;
136        UINT8 m_tx_data;
137137   bool m_tx_busy;
138138   bool m_disable_tx_pending;
139139};
trunk/src/emu/machine/intelfsh.c
r249051r249052
425425   : intelfsh8_device(mconfig, AMD_29F080, "AMD 29F080 Flash", tag, owner, clock, FLASH_AMD_29F080, "amd_29f080", __FILE__) { }
426426
427427amd_29f400t_device::amd_29f400t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
428   : intelfsh8_device(mconfig, AMD_29F400T, "AMD 29F400 Flash", tag, owner, clock, FLASH_AMD_29F400T, "amd_29f400t", __FILE__) { }
428   : intelfsh8_device(mconfig, AMD_29F080, "AMD 29F400 Flash", tag, owner, clock, FLASH_AMD_29F400T, "amd_29f400t", __FILE__) { }
429429
430430amd_29f800t_device::amd_29f800t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
431   : intelfsh8_device(mconfig, AMD_29F800T, "AMD 29F800 Flash", tag, owner, clock, FLASH_AMD_29F800T, "amd_29f800t", __FILE__) { }
431   : intelfsh8_device(mconfig, AMD_29F080, "AMD 29F800 Flash", tag, owner, clock, FLASH_AMD_29F080, "amd_29f800t", __FILE__) { }
432432
433433amd_29lv200t_device::amd_29lv200t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
434434   : intelfsh8_device(mconfig, AMD_29LV200T, "AMD 29LV200T Flash", tag, owner, clock, FLASH_AMD_29LV200T, "amd_29lv200t", __FILE__) { }
trunk/src/emu/machine/tms6100.c
r249051r249052
211211               /* read bit at address */
212212               if (m_variant == TMS6110_IS_M58819)
213213               {
214                  m_data = (m_rom[m_address >> 3] >> (7-(m_address & 0x07))) & 1;
214                   m_data = (m_rom[m_address >> 3] >> (7-(m_address & 0x07))) & 1;
215215               }
216216               else // m_variant == (TMS6110_IS_TMS6100 || TMS6110_IS_TMS6125)
217217               {
trunk/src/emu/netlist/nl_base.c
r249051r249052
1919
2020namespace netlist
2121{
22
2223// ----------------------------------------------------------------------------------------
2324// logic_family_ttl_t
2425// ----------------------------------------------------------------------------------------
trunk/src/emu/netlist/nl_base.h
r249051r249052
12331233      pnamedlist_t<core_device_t *> m_started_devices;
12341234   #endif
12351235
1236   ATTR_COLD plog_base<NL_DEBUG> &log() { return m_log; }
12371236   ATTR_COLD const plog_base<NL_DEBUG> &log() const { return m_log; }
12381237
12391238   protected:
12401239
12411240      // any derived netlist must override vlog inherited from plog_base
1242      // virtual void vlog(const plog_level &l, const pstring &ls) = 0;
1241      //    virtual void vlog(const plog_level &l, const pstring &ls) = 0;
12431242
12441243      /* from netlist_object */
12451244      virtual void reset();
r249051r249052
12571256
12581257      netlist_time                m_time;
12591258      bool                        m_use_deactivate;
1260      queue_t                     m_queue;
1259      queue_t                    m_queue;
12611260
12621261
12631262      devices::NETLIB_NAME(mainclock) *    m_mainclock;
trunk/src/emu/netlist/nl_setup.h
r249051r249052
198198
199199      void model_parse(const pstring &model, model_map_t &map);
200200
201      plog_base<NL_DEBUG> &log() { return netlist().log(); }
202201      const plog_base<NL_DEBUG> &log() const { return netlist().log(); }
203202
204203   protected:
trunk/src/emu/netlist/plib/pconfig.h
r249051r249052
101101#define ATTR_HOT               __attribute__((hot))
102102#define ATTR_COLD              __attribute__((cold))
103103
104#define RESTRICT                __restrict__
104#define RESTRICT            __restrict__
105105#define EXPECTED(x)     (x)
106106#define UNEXPECTED(x)   (x)
107107#define ATTR_PRINTF(x,y)        __attribute__((format(printf, x, y)))
trunk/src/emu/netlist/plib/pstream.c
r249051r249052
264264{
265265   return m_pos;
266266}
267
trunk/src/emu/netlist/plib/pstring.c
r249051r249052
1414
1515#include "pstring.h"
1616#include "palloc.h"
17#include "plists.h"
1817
1918template<>
2019pstr_t pstring_t<putf8_traits>::m_zero = pstr_t(0);
r249051r249052
306305// static stuff ...
307306// ----------------------------------------------------------------------------------------
308307
309/*
310 * Cached allocation of string memory
311 *
312 * This improves startup performance by 30%.
313 */
314
315#if 1
316
317static pstack_t<pstr_t *> *stk = NULL;
318
319static inline unsigned countleadbits(unsigned x)
320{
321#ifndef count_leading_zeros
322   unsigned msk;
323   unsigned ret;
324   if (x < 0x100)
325   {
326      msk = 0x80;
327      ret = 24;
328   }
329   else if (x < 0x10000)
330   {
331      msk = 0x8000;
332      ret = 16;
333   }
334   else if (x < 0x1000000)
335   {
336      msk = 0x800000;
337      ret = 8;
338   }
339   else
340   {
341      msk = 0x80000000;
342      ret = 0;
343   }
344   while ((msk & x) == 0 && ret < 31)
345   {
346      msk = msk >> 1;
347      ret++;
348   }
349   return ret;
350#else
351   return count_leading_zeros(x);
352#endif
353}
354
355308template<typename F>
356309void pstring_t<F>::sfree(pstr_t *s)
357310{
358311   s->m_ref_count--;
359312   if (s->m_ref_count == 0 && s != &m_zero)
360313   {
361      if (stk != NULL)
362      {
363         unsigned sn= ((32 - countleadbits(s->len())) + 1) / 2;
364         stk[sn].push(s);
365      }
366      else
367         pfree_array(((char *)s));
368      //_mm_free(((char *)s));
369   }
370}
371
372template<typename F>
373pstr_t *pstring_t<F>::salloc(int n)
374{
375   if (stk == NULL)
376      stk = palloc_array(pstack_t<pstr_t *>, 17);
377   pstr_t *p;
378   unsigned sn= ((32 - countleadbits(n)) + 1) / 2;
379   unsigned size = sizeof(pstr_t) + (1<<(sn * 2)) + 1;
380   if (stk[sn].empty())
381      p = (pstr_t *) palloc_array(char, size);
382   else
383   {
384      //printf("%u %u\n", sn, (unsigned) stk[sn].count());
385      p = stk[sn].pop();
386   }
387
388   //  str_t *p = (str_t *) _mm_malloc(size, 8);
389   p->init(n);
390   return p;
391}
392template<typename F>
393void pstring_t<F>::resetmem()
394{
395   if (stk != NULL)
396   {
397      for (unsigned i=0; i<=16; i++)
398      {
399         for (; stk[i].count() > 0; )
400            pfree_array(stk[i].pop());
401      }
402      pfree_array(stk);
403      stk = NULL;
404   }
405}
406
407
408#else
409template<typename F>
410void pstring_t<F>::sfree(pstr_t *s)
411{
412   s->m_ref_count--;
413   if (s->m_ref_count == 0 && s != &m_zero)
414   {
415314      pfree_array(((char *)s));
416315      //_mm_free(((char *)s));
417316   }
r249051r249052
432331{
433332   // Release the 0 string
434333}
435#endif
436334
437
438335// ----------------------------------------------------------------------------------------
439336// pstring ...
440337// ----------------------------------------------------------------------------------------
r249051r249052
703600
704601template struct pstring_t<pu8_traits>;
705602template struct pstring_t<putf8_traits>;
603
trunk/src/emu/netlist/plib/pstring.h
r249051r249052
2222   struct pstr_t
2323   {
2424      //str_t() : m_ref_count(1), m_len(0) { m_str[0] = 0; }
25      pstr_t(const unsigned alen)
25      pstr_t(const int alen)
2626      {
2727         init(alen);
2828      }
29      void init(const unsigned alen)
29      void init(const int alen)
3030      {
3131            m_ref_count = 1;
3232            m_len = alen;
3333            m_str[0] = 0;
3434      }
3535      char *str() { return &m_str[0]; }
36      unsigned len() const  { return m_len; }
36      int len() const  { return m_len; }
3737      int m_ref_count;
3838   private:
39      unsigned m_len;
39      int m_len;
4040      char m_str[1];
4141   };
4242
r249051r249052
241241         return 2;
242242      else if (c < 0x10000)
243243         return 3;
244      else /* U+10000 U+1FFFFF */
244      else /* U+10000   U+1FFFFF */
245245         return 4; /* no checks */
246246   }
247247   static code_t code(const mem_t *p)
r249051r249052
276276         m[1] = 0x80 | ((c>>6) & 0x3f);
277277         m[2] = 0x80 | (c & 0x3f);
278278      }
279      else /* U+10000 U+1FFFFF */
279      else /* U+10000   U+1FFFFF */
280280      {
281281         m[0] = 0xF0 | (c >> 18);
282282         m[1] = 0x80 | ((c>>12) & 0x3f);
r249051r249052
548548class pfmt_writer_t
549549{
550550public:
551   pfmt_writer_t() : m_enabled(true) { }
551   pfmt_writer_t()  { }
552552   virtual ~pfmt_writer_t() { }
553553
554554   ATTR_COLD void operator ()(const char *fmt) const
555555   {
556      if (build_enabled && m_enabled) vdowrite(fmt);
556      if (build_enabled) vdowrite(fmt);
557557   }
558558
559559   template<typename T1>
560560   ATTR_COLD void operator ()(const char *fmt, const T1 &v1) const
561561   {
562      if (build_enabled && m_enabled) vdowrite(pfmt(fmt)(v1));
562      if (build_enabled) vdowrite(pfmt(fmt)(v1));
563563   }
564564
565565   template<typename T1, typename T2>
566566   ATTR_COLD void operator ()(const char *fmt, const T1 &v1, const T2 &v2) const
567567   {
568      if (build_enabled && m_enabled) vdowrite(pfmt(fmt)(v1)(v2));
568      if (build_enabled) vdowrite(pfmt(fmt)(v1)(v2));
569569   }
570570
571571   template<typename T1, typename T2, typename T3>
572572   ATTR_COLD void operator ()(const char *fmt, const T1 &v1, const T2 &v2, const T3 &v3) const
573573   {
574      if (build_enabled && m_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3));
574      if (build_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3));
575575   }
576576
577577   template<typename T1, typename T2, typename T3, typename T4>
578578   ATTR_COLD void operator ()(const char *fmt, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4) const
579579   {
580      if (build_enabled && m_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3)(v4));
580      if (build_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3)(v4));
581581   }
582582
583583   template<typename T1, typename T2, typename T3, typename T4, typename T5>
584584   ATTR_COLD void operator ()(const char *fmt, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5) const
585585   {
586      if (build_enabled && m_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3)(v4)(v5));
586      if (build_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3)(v4)(v5));
587587   }
588588
589   void set_enabled(const bool v)
590   {
591      m_enabled = v;
592   }
593
594   bool is_enabled() const { return m_enabled; }
595
596589protected:
597590   virtual void vdowrite(const pstring &ls) const {}
598591
599private:
600   bool m_enabled;
601
602592};
603593
604594template <plog_level L, bool build_enabled = true>
r249051r249052
632622
633623   plog_base(plog_dispatch_intf *proxy)
634624   : debug(proxy),
635      info(proxy),
636      verbose(proxy),
637      warning(proxy),
638      error(proxy),
639      fatal(proxy)
625     info(proxy),
626     verbose(proxy),
627     warning(proxy),
628     error(proxy),
629      fatal(proxy)
640630   {}
641631   virtual ~plog_base() {};
642632
trunk/src/emu/netlist/prg/nltool.c
r249051r249052
3030
3131#include <ctime>
3232
33#define osd_ticks_t clock_t
33#define osd_ticks_t clock_t
3434
3535inline osd_ticks_t osd_ticks_per_second() { return CLOCKS_PER_SEC; }
3636
r249051r249052
9898public:
9999   tool_options_t() :
100100      poptions(),
101      opt_ttr ("t", "time_to_run", 1.0,   "time to run the emulation (seconds)", this),
101      opt_ttr ("t", "time_to_run", 1.0,    "time to run the emulation (seconds)", this),
102102      opt_name("n", "name",        "",      "netlist in file to run; default is first one", this),
103103      opt_logs("l", "logs",        "",      "colon separated list of terminals to log", this),
104104      opt_file("f", "file",        "-",     "file to process (default is stdin)", this),
105105      opt_type("y", "type",        "spice", "spice:eagle", "type of file to be converted: spice,eagle", this),
106      opt_cmd ("c", "cmd",        "run",   "run|convert|listdevices", this),
106      opt_cmd ("c", "cmd",      "run",   "run|convert|listdevices", this),
107107      opt_inp( "i", "input",       "",      "input file to process (default is none)", this),
108108      opt_verb("v", "verbose",              "be verbose - this produces lots of output", this),
109109      opt_quiet("q", "quiet",               "be quiet - no warnings", this),
r249051r249052
113113   poption_double opt_ttr;
114114   poption_str    opt_name;
115115   poption_str    opt_logs;
116   poption_str    opt_file;
116   poption_str      opt_file;
117117   poption_str_limit opt_type;
118118   poption_str    opt_cmd;
119119   poption_str    opt_inp;
trunk/src/emu/netlist/prg/nlwav.c
r249051r249052
4949public:
5050   wav_t(postream &strm, unsigned sr) : m_f(strm)
5151   {
52//      m_f = strm;
52//      m_f = strm;
5353      initialize(sr);
5454      m_f.write(&m_fh, sizeof(m_fh));
5555      m_f.write(&m_fmt, sizeof(m_fmt));
trunk/src/emu/netlist/solver/nld_ms_direct.h
r249051r249052
488488   // ii=-1
489489
490490   //for (int i=0; i < kN; i++)
491   //  x[i] = m_RHS[i];
491   //   x[i] = m_RHS[i];
492492
493493   for (int i=0; i < kN; i++)
494494   {
trunk/src/emu/netlist/solver/nld_ms_direct_lu.h
r249051r249052
429429template <unsigned m_N, unsigned _storage_N>
430430ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_solve()
431431{
432
432433   const unsigned kN = N();
433434
434435   ATTR_UNUSED int imax;
r249051r249052
500501      indx[j]=imax;
501502#endif
502503      //if (m_A[j][j] == 0.0)
503      //  m_A[j][j] = 1e-20;
504      //   m_A[j][j] = 1e-20;
504505      double dum = 1.0 / A(j,j);
505506      for (int i = j+1; i < kN; i++)
506507         A(i,j) *= dum;
r249051r249052
520521   // ii=-1
521522
522523   //for (int i=0; i < kN; i++)
523   //  x[i] = m_RHS[i];
524   //   x[i] = m_RHS[i];
524525
525526   for (int i=0; i < kN; i++)
526527   {
trunk/src/emu/netlist/solver/nld_solver.h
r249051r249052
135135   ATTR_COLD int get_net_idx(net_t *net);
136136
137137   inline eSolverType type() const { return m_type; }
138   plog_base<NL_DEBUG> &log() { return netlist().log(); }
138   const plog_base<NL_DEBUG> &log() const { return netlist().log(); }
139139
140140   virtual void log_stats();
141141
trunk/src/emu/screen.h
r249051r249052
287287   INT32               m_last_partial_scan;        // scanline of last partial update
288288   bitmap_argb32       m_screen_overlay_bitmap;    // screen overlay bitmap
289289   UINT32              m_unique_id;                // unique id for this screen_device
290   rgb_t               m_color;                    // render color
291   UINT8               m_brightness;               // global brightness
290   rgb_t            m_color;               // render color
291   UINT8            m_brightness;            // global brightness
292292
293293   // screen timing
294294   attoseconds_t       m_frame_period;             // attoseconds per frame
trunk/src/emu/sound/c352.c
r249051r249052
1313    Supports 8-bit linear and 8-bit muLaw samples
1414    Output: digital, 16 bit, 4 channels
1515    Output sample rate is the input clock / (288 * 2).
16   
17    superctr: The clock divider appears to be configurable for each system.
18    Below is a list of the divider values followed by the systems that use it.
19   
20    * 228: System 11.
21    * 288: System 22, Super 22, NB-1/2, ND-1, FL.
22    * 296: System 23, Super 23.
23    * 332: System 12.
2416 */
2517
2618#include "emu.h"
r249051r249052
476468
477469void c352_device::device_start()
478470{
479   int i;
471   int i, divider;
480472   double x_max = 32752.0;
481473   double y_max = 127.0;
482474   double u = 10.0;
r249051r249052
484476   // find our direct access
485477   m_direct = &space().direct();
486478
487   m_sample_rate_base = clock() / m_divider;
479   switch(m_divider)
480   {
481      case C352_DIVIDER_228:
482         divider=228;
483         break;
484      case C352_DIVIDER_288:
485      default:
486         divider=288;
487         break;
488      case C352_DIVIDER_332:
489         divider=332;
490         break;
491   }
488492
493   m_sample_rate_base = clock() / divider;
494
489495   m_stream = machine().sound().stream_alloc(*this, 0, 4, m_sample_rate_base);
490496
491497   // generate mulaw table for mulaw format samples
trunk/src/emu/sound/c352.h
r249051r249052
66#define __C352_H__
77
88//**************************************************************************
9//  CONSTANTS
10//**************************************************************************
11
12enum
13{
14   C352_DIVIDER_228 = 0,
15   C352_DIVIDER_288 = 1,
16   C352_DIVIDER_332 = 2
17};
18
19//**************************************************************************
920//  INTERFACE CONFIGURATION MACROS
1021//**************************************************************************
1122
trunk/src/emu/sound/rf5c400.c
r249051r249052
413413         case 0x08:      // relative to env attack (channel no)
414414         case 0x09:      // relative to env attack (0x0c00/ 0x1c00)
415415
416         case 0x11:      // ? counter for 0x13?
416         case 0x11:      // ? counter for 0x13?
417417         {
418418            break;
419419         }
420         case 0x13:      // ? bujutsu writes sample data here
420         case 0x13:      // ? bujutsu writes sample data here
421421         {
422422            break;
423423         }
424424
425         case 0x14:      // ? related to 0x11/0x13 ?
425         case 0x14:      // ? related to 0x11/0x13 ?
426426            break;
427427
428428         case 0x21:      // reverb(character).w
trunk/src/emu/sound/tms5110.c
r249051r249052
1414
1515     Todo:
1616        - implement CS
17        - implement missing commands
1718        - TMS5110_CMD_TEST_TALK is only partially implemented
1819
1920     TMS5100:
r249051r249052
211212{
212213   save_item(NAME(m_variant));
213214
215   save_item(NAME(m_fifo));
216   save_item(NAME(m_fifo_head));
217   save_item(NAME(m_fifo_tail));
218   save_item(NAME(m_fifo_count));
219
214220   save_item(NAME(m_PDC));
215221   save_item(NAME(m_CTL_pins));
216222   save_item(NAME(m_SPEN));
r249051r249052
234240   save_item(NAME(m_old_frame_energy_idx));
235241   save_item(NAME(m_old_frame_pitch_idx));
236242   save_item(NAME(m_old_frame_k_idx));
237   save_item(NAME(m_old_zpar));
238   save_item(NAME(m_old_uv_zpar));
239243#endif
240244   save_item(NAME(m_current_energy));
241245   save_item(NAME(m_current_pitch));
r249051r249052
305309}
306310#endif
307311
312
308313/******************************************************************************************
309314
310     extract_bits -- extract a specific number of bits from the VSM
315     FIFO_data_write -- handle bit data write to the TMS5110 (as a result of toggling M0 pin)
311316
312317******************************************************************************************/
318void tms5110_device::FIFO_data_write(int data)
319{
320   /* add this bit to the FIFO */
321   if (m_fifo_count < FIFO_SIZE)
322   {
323      m_fifo[m_fifo_tail] = (data&1); /* set bit to 1 or 0 */
313324
325      m_fifo_tail = (m_fifo_tail + 1) % FIFO_SIZE;
326      m_fifo_count++;
327
328      if (DEBUG_5110) logerror("Added bit to FIFO (size=%2d)\n", m_fifo_count);
329   }
330   else
331   {
332      if (DEBUG_5110) logerror("Ran out of room in the FIFO!\n");
333   }
334}
335
336/******************************************************************************************
337
338     extract_bits -- extract a specific number of bits from the FIFO
339
340******************************************************************************************/
341
314342int tms5110_device::extract_bits(int count)
315343{
316344   int val = 0;
317   if (DEBUG_5110) logerror("requesting %d bits", count);
318   for (int i = 0; i < count; i++)
345   if (DEBUG_5110) logerror("requesting %d bits from fifo: ", count);
346   while (count--)
319347   {
320      val = (val<<1) | new_int_read();
321      if (DEBUG_5110) logerror("bit read: %d\n", val&1);
348      val = (val << 1) | (m_fifo[m_fifo_head] & 1);
349      m_fifo_count--;
350      m_fifo_head = (m_fifo_head + 1) % FIFO_SIZE;
322351   }
323352   if (DEBUG_5110) logerror("returning: %02x\n", val);
324353   return val;
325354}
326355
356void tms5110_device::request_bits(int no)
357{
358   for (int i = 0; i < no; i++)
359   {
360      UINT8 data = new_int_read();
361      if (DEBUG_5110) logerror("bit added to fifo: %d\n", data);
362      FIFO_data_write(data);
363   }
364}
327365
328366void tms5110_device::perform_dummy_read()
329367{
r249051r249052
350388   int i, bitout;
351389   INT32 this_sample;
352390
391   /* if we're not speaking, fill with nothingness */
392   if (!m_TALKD)
393      goto empty;
394
353395   /* loop until the buffer is full or we've stopped speaking */
354   while (size > 0)
396   while ((size > 0) && m_TALKD)
355397   {
356      if(m_TALKD) // speaking
398      /* if it is the appropriate time to update the old energy/pitch indices,
399       * i.e. when IP=7, PC=12, T=17, subcycle=2, do so. Since IP=7 PC=12 T=17
400       * is JUST BEFORE the transition to IP=0 PC=0 T=0 sybcycle=(0 or 1),
401       * which happens 4 T-cycles later), we change on the latter.
402       * The indices are updated here ~12 PCs before the new frame is applied.
403       */
404      /** TODO: the patents 4331836, 4335277, and 4419540 disagree about the timing of this **/
405      if ((m_IP == 0) && (m_PC == 0) && (m_subcycle < 2))
357406      {
358         /* if we're ready for a new frame to be applied, i.e. when IP=0, PC=12, Sub=1
359          * (In reality, the frame was really loaded incrementally during the entire IP=0
360          * PC=x time period, but it doesn't affect anything until IP=0 PC=12 happens)
361          */
362         if ((m_IP == 0) && (m_PC == 12) && (m_subcycle == 1))
363         {
364            // HACK for regression testing, be sure to comment out before release!
365            //m_RNG = 0x1234;
366            // end HACK
407         m_OLDE = (m_new_frame_energy_idx == 0);
408         m_OLDP = (m_new_frame_pitch_idx == 0);
409      }
367410
411      /* if we're ready for a new frame to be applied, i.e. when IP=0, PC=12, Sub=1
412       * (In reality, the frame was really loaded incrementally during the entire IP=0
413       * PC=x time period, but it doesn't affect anything until IP=0 PC=12 happens)
414       */
415      if ((m_IP == 0) && (m_PC == 12) && (m_subcycle == 1))
416      {
417         // HACK for regression testing, be sure to comment out before release!
418         //m_RNG = 0x1234;
419         // end HACK
420
368421#ifdef PERFECT_INTERPOLATION_HACK
369            /* remember previous frame energy, pitch, and coefficients */
370            m_old_frame_energy_idx = m_new_frame_energy_idx;
371            m_old_frame_pitch_idx = m_new_frame_pitch_idx;
372            for (i = 0; i < m_coeff->num_k; i++)
373               m_old_frame_k_idx[i] = m_new_frame_k_idx[i];
422         /* remember previous frame energy, pitch, and coefficients */
423         m_old_frame_energy_idx = m_new_frame_energy_idx;
424         m_old_frame_pitch_idx = m_new_frame_pitch_idx;
425         for (i = 0; i < m_coeff->num_k; i++)
426            m_old_frame_k_idx[i] = m_new_frame_k_idx[i];
374427#endif
375428
376            /* Parse a new frame into the new_target_energy, new_target_pitch and new_target_k[] */
377            parse_frame();
378
379            // if the new frame is unvoiced (or silenced via ZPAR), be sure to zero out the k5-k10 parameters
380            // NOTE: this is probably the bug the tms5100/tmc0280 has, pre-rev D, I think.
381            // GUESS: Pre-rev D versions start zeroing k5-k10 immediately upon new frame load regardless of interpolation inhibit
382            // I.e. ZPAR = /TALKD || (PC>5&&P=0)
383            // GUESS: D and later versions only start or stop zeroing k5-k10 at the IP7->IP0 transition AFTER the frame
384            // I.e. ZPAR = /TALKD || (PC>5&&OLDP)
385#ifdef PERFECT_INTERPOLATION_HACK
386            m_old_uv_zpar = m_uv_zpar;
387            m_old_zpar = m_zpar; // unset old zpar on new frame
429         /* Parse a new frame into the new_target_energy, new_target_pitch and new_target_k[] */
430         parse_frame();
431#ifdef DEBUG_PARSE_FRAME_DUMP
432         fprintf(stderr,"\n");
388433#endif
389            m_zpar = 0;
390            //m_uv_zpar = (OLD_FRAME_UNVOICED_FLAG||m_zpar); // GUESS: fixed version in tmc0280d/tms5100a/cd280x/tms5110
391            m_uv_zpar = (NEW_FRAME_UNVOICED_FLAG||m_zpar); // GUESS: buggy version in tmc0280/tms5100
434         /* if the new frame is unvoiced (or silenced via ZPAR), be sure to zero out the k5-k10 parameters */
435         m_uv_zpar = NEW_FRAME_UNVOICED_FLAG | m_zpar;
392436
393            /* if the new frame is a stop frame, unset both TALK and SPEN (via TCON). TALKD remains active while the energy is ramping to 0. */
394            if (NEW_FRAME_STOP_FLAG == 1)
395            {
396               m_TALK = m_SPEN = 0;
397            }
437         /* if the new frame is a stop frame, unset both TALK and SPEN. TALKD remains active while the energy is ramping to 0. */
438         if (NEW_FRAME_STOP_FLAG == 1)
439         {
440            m_TALK = m_SPEN = 0;
441         }
398442
399            /* in all cases where interpolation would be inhibited, set the inhibit flag; otherwise clear it.
400               Interpolation inhibit cases:
401             * Old frame was voiced, new is unvoiced
402             * Old frame was silence/zero energy, new has nonzero energy
403             * Old frame was unvoiced, new is voiced (note this is the case on the patent but may not be correct on the real final chip)
404             */
405            if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1))
406               || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0)) /* this line needs further investigation, starwars tie fighters may sound better without it */
407               || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0)) )
408               m_inhibit = 1;
409            else // normal frame, normal interpolation
410               m_inhibit = 0;
443         /* in all cases where interpolation would be inhibited, set the inhibit flag; otherwise clear it.
444            Interpolation inhibit cases:
445          * Old frame was voiced, new is unvoiced
446          * Old frame was silence/zero energy, new has nonzero energy
447          * Old frame was unvoiced, new is voiced (note this is the case on the patent but may not be correct on the real final chip)
448          */
449         if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1))
450            || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0)) /* this line needs further investigation, starwars tie fighters may sound better without it */
451            || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0)) )
452            m_inhibit = 1;
453         else // normal frame, normal interpolation
454            m_inhibit = 0;
411455
412456#ifdef DEBUG_GENERATION
413            /* Debug info for current parsed frame */
414            fprintf(stderr, "OLDE: %d; OLDP: %d; ", m_OLDE, m_OLDP);
415            fprintf(stderr,"Processing new frame: ");
416            if (m_inhibit == 0)
417               fprintf(stderr, "Normal Frame\n");
418            else
419               fprintf(stderr,"Interpolation Inhibited\n");
420            fprintf(stderr,"*** current Energy, Pitch and Ks =      %04d,   %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d\n",m_current_energy, m_current_pitch, m_current_k[0], m_current_k[1], m_current_k[2], m_current_k[3], m_current_k[4], m_current_k[5], m_current_k[6], m_current_k[7], m_current_k[8], m_current_k[9]);
421            fprintf(stderr,"*** target Energy(idx), Pitch, and Ks = %04d(%x),%04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d\n",
422               (m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar)),
423               m_new_frame_energy_idx,
424               (m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar)),
425               (m_coeff->ktable[0][m_new_frame_k_idx[0]] * (1-m_zpar)),
426               (m_coeff->ktable[1][m_new_frame_k_idx[1]] * (1-m_zpar)),
427               (m_coeff->ktable[2][m_new_frame_k_idx[2]] * (1-m_zpar)),
428               (m_coeff->ktable[3][m_new_frame_k_idx[3]] * (1-m_zpar)),
429               (m_coeff->ktable[4][m_new_frame_k_idx[4]] * (1-m_uv_zpar)),
430               (m_coeff->ktable[5][m_new_frame_k_idx[5]] * (1-m_uv_zpar)),
431               (m_coeff->ktable[6][m_new_frame_k_idx[6]] * (1-m_uv_zpar)),
432               (m_coeff->ktable[7][m_new_frame_k_idx[7]] * (1-m_uv_zpar)),
433               (m_coeff->ktable[8][m_new_frame_k_idx[8]] * (1-m_uv_zpar)),
434               (m_coeff->ktable[9][m_new_frame_k_idx[9]] * (1-m_uv_zpar)) );
457         /* Debug info for current parsed frame */
458         fprintf(stderr, "OLDE: %d; OLDP: %d; ", m_OLDE, m_OLDP);
459         fprintf(stderr,"Processing frame: ");
460         if (m_inhibit == 0)
461            fprintf(stderr, "Normal Frame\n");
462         else
463            fprintf(stderr,"Interpolation Inhibited\n");
464         fprintf(stderr,"*** current Energy, Pitch and Ks =      %04d,   %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d\n",m_current_energy, m_current_pitch, m_current_k[0], m_current_k[1], m_current_k[2], m_current_k[3], m_current_k[4], m_current_k[5], m_current_k[6], m_current_k[7], m_current_k[8], m_current_k[9]);
465         fprintf(stderr,"*** target Energy(idx), Pitch, and Ks = %04d(%x),%04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d\n",
466            (m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar)),
467            m_new_frame_energy_idx,
468            (m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar)),
469            (m_coeff->ktable[0][m_new_frame_k_idx[0]] * (1-m_zpar)),
470            (m_coeff->ktable[1][m_new_frame_k_idx[1]] * (1-m_zpar)),
471            (m_coeff->ktable[2][m_new_frame_k_idx[2]] * (1-m_zpar)),
472            (m_coeff->ktable[3][m_new_frame_k_idx[3]] * (1-m_zpar)),
473            (m_coeff->ktable[4][m_new_frame_k_idx[4]] * (1-m_uv_zpar)),
474            (m_coeff->ktable[5][m_new_frame_k_idx[5]] * (1-m_uv_zpar)),
475            (m_coeff->ktable[6][m_new_frame_k_idx[6]] * (1-m_uv_zpar)),
476            (m_coeff->ktable[7][m_new_frame_k_idx[7]] * (1-m_uv_zpar)),
477            (m_coeff->ktable[8][m_new_frame_k_idx[8]] * (1-m_uv_zpar)),
478            (m_coeff->ktable[9][m_new_frame_k_idx[9]] * (1-m_uv_zpar)) );
435479#endif
436480
481      }
482      else // Not a new frame, just interpolate the existing frame.
483      {
484         int inhibit_state = ((m_inhibit==1)&&(m_IP != 0)); // disable inhibit when reaching the last interp period, but don't overwrite the m_inhibit value
485#ifdef PERFECT_INTERPOLATION_HACK
486         int samples_per_frame = m_subc_reload?175:266; // either (13 A cycles + 12 B cycles) * 7 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 7 interps for SPKSLOW
487         //int samples_per_frame = m_subc_reload?200:304; // either (13 A cycles + 12 B cycles) * 8 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 8 interps for SPKSLOW
488         int current_sample = (m_subcycle - m_subc_reload)+(m_PC*(3-m_subc_reload))+((m_subc_reload?25:38)*((m_IP-1)&7));
489         //fprintf(stderr, "CS: %03d", current_sample);
490         // reset the current energy, pitch, etc to what it was at frame start
491         m_current_energy = (m_coeff->energytable[m_old_frame_energy_idx] * (1-m_zpar));
492         m_current_pitch = (m_coeff->pitchtable[m_old_frame_pitch_idx] * (1-m_old_zpar));
493         for (i = 0; i < 4; i++)
494            m_current_k[i] = (m_coeff->ktable[i][m_old_frame_k_idx[i]] * (1-m_old_zpar));
495         for (i = 4; i < m_coeff->num_k; i++)
496            m_current_k[i] = (m_coeff->ktable[i][m_old_frame_k_idx[i]] * (1-m_uv_zpar));
497         // now adjust each value to be exactly correct for each of the samples per frame
498         if (m_IP != 0) // if we're still interpolating...
499         {
500            m_current_energy += ((((m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar)) - m_current_energy)*(1-inhibit_state))*current_sample)/samples_per_frame;
501            m_current_pitch += ((((m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar)) - m_current_pitch)*(1-inhibit_state))*current_sample)/samples_per_frame;
502            for (i = 0; i < m_coeff->num_k; i++)
503               m_current_k[i] += ((((m_coeff->ktable[i][m_new_frame_k_idx[i]] * (1-((i<4)?m_zpar:m_uv_zpar))) - m_current_k[i])*(1-inhibit_state))*current_sample)/samples_per_frame;
437504         }
438         else // Not a new frame, just interpolate the existing frame.
505         else // we're done, play this frame for 1/8 frame.
439506         {
440            int inhibit_state = ((m_inhibit==1)&&(m_IP != 0)); // disable inhibit when reaching the last interp period, but don't overwrite the m_inhibit value
441#ifdef PERFECT_INTERPOLATION_HACK
442            int samples_per_frame = m_subc_reload?175:266; // either (13 A cycles + 12 B cycles) * 7 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 7 interps for SPKSLOW
443            //int samples_per_frame = m_subc_reload?200:304; // either (13 A cycles + 12 B cycles) * 8 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 8 interps for SPKSLOW
444            int current_sample = (m_subcycle - m_subc_reload)+(m_PC*(3-m_subc_reload))+((m_subc_reload?25:38)*((m_IP-1)&7));
445            //fprintf(stderr, "CS: %03d", current_sample);
446            // reset the current energy, pitch, etc to what it was at frame start
447            m_current_energy = (m_coeff->energytable[m_old_frame_energy_idx] * (1-m_old_zpar));
448            m_current_pitch = (m_coeff->pitchtable[m_old_frame_pitch_idx] * (1-m_old_zpar));
507            m_current_energy = (m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar));
508            m_current_pitch = (m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar));
449509            for (i = 0; i < m_coeff->num_k; i++)
450               m_current_k[i] = (m_coeff->ktable[i][m_old_frame_k_idx[i]] * (1-((i<4)?m_old_zpar:m_old_uv_zpar)));
451            // now adjust each value to be exactly correct for each of the samples per frame
452            if (m_IP != 0) // if we're still interpolating...
453            {
454               m_current_energy = (m_current_energy + (((m_coeff->energytable[m_new_frame_energy_idx] - m_current_energy)*(1-inhibit_state))*current_sample)/samples_per_frame)*(1-m_zpar);
455               m_current_pitch = (m_current_pitch + (((m_coeff->pitchtable[m_new_frame_pitch_idx] - m_current_pitch)*(1-inhibit_state))*current_sample)/samples_per_frame)*(1-m_zpar);
456               for (i = 0; i < m_coeff->num_k; i++)
457                  m_current_k[i] = (m_current_k[i] + (((m_coeff->ktable[i][m_new_frame_k_idx[i]] - m_current_k[i])*(1-inhibit_state))*current_sample)/samples_per_frame)*(1-((i<4)?m_zpar:m_uv_zpar));
458            }
459            else // we're done, play this frame for 1/8 frame.
460            {
461               m_current_energy = (m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar));
462               m_current_pitch = (m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar));
463               for (i = 0; i < m_coeff->num_k; i++)
464                  m_current_k[i] = (m_coeff->ktable[i][m_new_frame_k_idx[i]] * (1-((i<4)?m_zpar:m_uv_zpar)));
465            }
510               m_current_k[i] = (m_coeff->ktable[i][m_new_frame_k_idx[i]] * (1-((i<4)?m_zpar:m_uv_zpar)));
511         }
466512#else
467            //Updates to parameters only happen on subcycle '2' (B cycle) of PCs.
468            if (m_subcycle == 2)
513         //Updates to parameters only happen on subcycle '2' (B cycle) of PCs.
514         if (m_subcycle == 2)
515         {
516            switch(m_PC)
469517            {
470               switch(m_PC)
471               {
472                  case 0: /* PC = 0, B cycle, write updated energy */
473                  m_current_energy = (m_current_energy + (((m_coeff->energytable[m_new_frame_energy_idx] - m_current_energy)*(1-inhibit_state)) INTERP_SHIFT))*(1-m_zpar);
474                  break;
475                  case 1: /* PC = 1, B cycle, write updated pitch */
476                  m_current_pitch = (m_current_pitch + (((m_coeff->pitchtable[m_new_frame_pitch_idx] - m_current_pitch)*(1-inhibit_state)) INTERP_SHIFT))*(1-m_zpar);
477                  break;
478                  case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11:
479                  /* PC = 2 through 11, B cycle, write updated K1 through K10 */
480                  m_current_k[m_PC-2] = (m_current_k[m_PC-2] + (((m_coeff->ktable[m_PC-2][m_new_frame_k_idx[m_PC-2]] - m_current_k[m_PC-2])*(1-inhibit_state)) INTERP_SHIFT))*(((m_PC-2)>4)?(1-m_uv_zpar):(1-m_zpar));
481                  break;
482                  case 12: /* PC = 12 */
483                  /* we should NEVER reach this point, PC=12 doesn't have a subcycle 2 */
484                  break;
485               }
518               case 0: /* PC = 0, B cycle, write updated energy */
519               m_current_energy += ((((m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar)) - m_current_energy)*(1-inhibit_state)) INTERP_SHIFT);
520               break;
521               case 1: /* PC = 1, B cycle, write updated pitch */
522               m_current_pitch += ((((m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar)) - m_current_pitch)*(1-inhibit_state)) INTERP_SHIFT);
523               break;
524               case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11:
525               /* PC = 2 through 11, B cycle, write updated K1 through K10 */
526               m_current_k[m_PC-2] += ((((m_coeff->ktable[m_PC-2][m_new_frame_k_idx[m_PC-2]] * (1-(((m_PC-2)<4)?m_zpar:m_uv_zpar))) - m_current_k[m_PC-2])*(1-inhibit_state)) INTERP_SHIFT);
527               break;
528               case 12: /* PC = 12, do nothing */
529               break;
486530            }
531         }
487532#endif
488         }
533      }
489534
490         // calculate the output
491         if (OLD_FRAME_UNVOICED_FLAG == 1)
492         {
493            // generate unvoiced samples here
494            if (m_RNG & 1)
495               m_excitation_data = ~0x3F; /* according to the patent it is (either + or -) half of the maximum value in the chirp table, so either 01000000(0x40) or 11000000(0xC0)*/
496            else
497               m_excitation_data = 0x40;
498         }
499         else /* (OLD_FRAME_UNVOICED_FLAG == 0) */
500         {
501            // generate voiced samples here
502            /* US patent 4331836 Figure 14B shows, and logic would hold, that a pitch based chirp
503             * function has a chirp/peak and then a long chain of zeroes.
504             * The last entry of the chirp rom is at address 0b110011 (51d), the 52nd sample,
505             * and if the address reaches that point the ADDRESS incrementer is
506             * disabled, forcing all samples beyond 51d to be == 51d
507             */
508            if (m_pitch_count >= 51)
509               m_excitation_data = (INT8)m_coeff->chirptable[51];
510            else /*m_pitch_count < 51*/
511               m_excitation_data = (INT8)m_coeff->chirptable[m_pitch_count];
512         }
535      // calculate the output
536      if (OLD_FRAME_UNVOICED_FLAG == 1)
537      {
538         // generate unvoiced samples here
539         if (m_RNG & 1)
540            m_excitation_data = ~0x3F; /* according to the patent it is (either + or -) half of the maximum value in the chirp table, so either 01000000(0x40) or 11000000(0xC0)*/
541         else
542            m_excitation_data = 0x40;
543      }
544      else /* (OLD_FRAME_UNVOICED_FLAG == 0) */
545      {
546         // generate voiced samples here
547         /* US patent 4331836 Figure 14B shows, and logic would hold, that a pitch based chirp
548          * function has a chirp/peak and then a long chain of zeroes.
549          * The last entry of the chirp rom is at address 0b110011 (51d), the 52nd sample,
550          * and if the address reaches that point the ADDRESS incrementer is
551          * disabled, forcing all samples beyond 51d to be == 51d
552          */
553         if (m_pitch_count >= 51)
554            m_excitation_data = (INT8)m_coeff->chirptable[51];
555         else /*m_pitch_count < 51*/
556            m_excitation_data = (INT8)m_coeff->chirptable[m_pitch_count];
557      }
513558
514         // Update LFSR *20* times every sample (once per T cycle), like patent shows
515         for (i=0; i<20; i++)
516         {
517            bitout = ((m_RNG >> 12) & 1) ^
518                  ((m_RNG >>  3) & 1) ^
519                  ((m_RNG >>  2) & 1) ^
520                  ((m_RNG >>  0) & 1);
521            m_RNG <<= 1;
522            m_RNG |= bitout;
523         }
524         this_sample = lattice_filter(); /* execute lattice filter */
559      // Update LFSR *20* times every sample (once per T cycle), like patent shows
560   for (i=0; i<20; i++)
561   {
562      bitout = ((m_RNG >> 12) & 1) ^
563            ((m_RNG >>  3) & 1) ^
564            ((m_RNG >>  2) & 1) ^
565            ((m_RNG >>  0) & 1);
566      m_RNG <<= 1;
567      m_RNG |= bitout;
568   }
569      this_sample = lattice_filter(); /* execute lattice filter */
525570#ifdef DEBUG_GENERATION_VERBOSE
526         //fprintf(stderr,"C:%01d; ",m_subcycle);
527         fprintf(stderr,"IP:%01d PC:%02d X:%04d E:%03d P:%03d Pc:%03d ",m_IP, m_PC, m_excitation_data, m_current_energy, m_current_pitch, m_pitch_count);
528         //fprintf(stderr,"X:%04d E:%03d P:%03d Pc:%03d ", m_excitation_data, m_current_energy, m_current_pitch, m_pitch_count);
529         for (i=0; i<10; i++)
530            fprintf(stderr,"K%d:%04d ", i+1, m_current_k[i]);
531         fprintf(stderr,"Out:%06d ", this_sample);
532//#ifdef PERFECT_INTERPOLATION_HACK
533//         fprintf(stderr,"%d%d%d%d",m_old_zpar,m_zpar,m_old_uv_zpar,m_uv_zpar);
534//#else
535//         fprintf(stderr,"x%dx%d",m_zpar,m_uv_zpar);
536//#endif
537         fprintf(stderr,"\n");
571      //fprintf(stderr,"C:%01d; ",m_subcycle);
572      fprintf(stderr,"IP:%01d PC:%02d X:%04d E:%03d P:%03d Pc:%03d ",m_IP, m_PC, m_excitation_data, m_current_energy, m_current_pitch, m_pitch_count);
573      //fprintf(stderr,"X:%04d E:%03d P:%03d Pc:%03d ", m_excitation_data, m_current_energy, m_current_pitch, m_pitch_count);
574      for (i=0; i<10; i++)
575         fprintf(stderr,"K%d:%04d ", i+1, m_current_k[i]);
576      fprintf(stderr,"Out:%06d", this_sample);
577      fprintf(stderr,"\n");
538578#endif
539         /* next, force result to 14 bits (since its possible that the addition at the final (k1) stage of the lattice overflowed) */
540         while (this_sample > 16383) this_sample -= 32768;
541         while (this_sample < -16384) this_sample += 32768;
542         if (m_digital_select == 0) // analog SPK pin output is only 8 bits, with clipping
543            buffer[buf_count] = clip_analog(this_sample);
544         else // digital I/O pin output is 12 bits
545         {
579      /* next, force result to 14 bits (since its possible that the addition at the final (k1) stage of the lattice overflowed) */
580      while (this_sample > 16383) this_sample -= 32768;
581      while (this_sample < -16384) this_sample += 32768;
582      if (m_digital_select == 0) // analog SPK pin output is only 8 bits, with clipping
583         buffer[buf_count] = clip_analog(this_sample);
584      else // digital I/O pin output is 12 bits
585      {
546586#ifdef ALLOW_4_LSB
547            // input:  ssss ssss ssss ssss ssnn nnnn nnnn nnnn
548            // N taps:                       ^                 = 0x2000;
549            // output: ssss ssss ssss ssss snnn nnnn nnnn nnnN
550            buffer[buf_count] = (this_sample<<1)|((this_sample&0x2000)>>13);
587         // input:  ssss ssss ssss ssss ssnn nnnn nnnn nnnn
588         // N taps:                       ^                 = 0x2000;
589         // output: ssss ssss ssss ssss snnn nnnn nnnn nnnN
590         buffer[buf_count] = (this_sample<<1)|((this_sample&0x2000)>>13);
551591#else
552            this_sample &= ~0xF;
553            // input:  ssss ssss ssss ssss ssnn nnnn nnnn 0000
554            // N taps:                       ^^ ^^^            = 0x3E00;
555            // output: ssss ssss ssss ssss snnn nnnn nnnN NNNN
556            buffer[buf_count] = (this_sample<<1)|((this_sample&0x3E00)>>9);
592         this_sample &= ~0xF;
593         // input:  ssss ssss ssss ssss ssnn nnnn nnnn 0000
594         // N taps:                       ^^ ^^^            = 0x3E00;
595         // output: ssss ssss ssss ssss snnn nnnn nnnN NNNN
596         buffer[buf_count] = (this_sample<<1)|((this_sample&0x3E00)>>9);
557597#endif
558         }
559         // Update all counts
598      }
599      // Update all counts
560600
561         m_subcycle++;
562         if ((m_subcycle == 2) && (m_PC == 12)) // RESETF3
601      m_subcycle++;
602      if ((m_subcycle == 2) && (m_PC == 12)) // RESETF3
603      {
604         /* Circuit 412 in the patent acts a reset, resetting the pitch counter to 0
605          * if INHIBIT was true during the most recent frame transition.
606          * The exact time this occurs is betwen IP=7, PC=12 sub=0, T=t12
607          * and m_IP = 0, PC=0 sub=0, T=t12, a period of exactly 20 cycles,
608          * which overlaps the time OLDE and OLDP are updated at IP=7 PC=12 T17
609          * (and hence INHIBIT itself 2 t-cycles later). We do it here because it is
610          * convenient and should make no difference in output.
611          */
612         if ((m_IP == 7)&&(m_inhibit==1)) m_pitch_zero = 1;
613         if ((m_IP == 0)&&(m_pitch_zero==1)) m_pitch_zero = 0;
614#ifdef PERFECT_INTERPOLATION_HACK
615         m_old_zpar = m_zpar;
616#endif
617         m_zpar = 0; /* this gets effectively reset by resetf3, same signal which resets m_PC to 0 */
618         if (m_IP == 7) // RESETL4
563619         {
564            /* Circuit 412 in the patent acts a reset, resetting the pitch counter to 0
565             * if INHIBIT was true during the most recent frame transition.
566             * The exact time this occurs is betwen IP=7, PC=12 sub=0, T=t12
567             * and m_IP = 0, PC=0 sub=0, T=t12, a period of exactly 20 cycles,
568             * which overlaps the time OLDE and OLDP are updated at IP=7 PC=12 T17
569             * (and hence INHIBIT itself 2 t-cycles later). We do it here because it is
570             * convenient and should make no difference in output.
571             */
572            if ((m_IP == 7)&&(m_inhibit==1)) m_pitch_zero = 1;
573            if ((m_IP == 0)&&(m_pitch_zero==1)) m_pitch_zero = 0;
574            if (m_IP == 7) // RESETL4
575            {
576               // Latch OLDE and OLDP
577               OLD_FRAME_SILENCE_FLAG = NEW_FRAME_SILENCE_FLAG; // m_OLDE
578               OLD_FRAME_UNVOICED_FLAG = NEW_FRAME_UNVOICED_FLAG; // m_OLDP
579               /* if TALK was clear last frame, halt speech now, since TALKD (latched from TALK on new frame) just went inactive. */
620            /* if TALK was clear last frame, halt speech now, since TALKD (latched from TALK on new frame) just went inactive. */
580621#ifdef DEBUG_GENERATION
581               if (m_TALK == 0)
582                  fprintf(stderr,"tms5110_process: processing frame: TALKD = 0 caused by stop frame or buffer empty, halting speech.\n");
622            if (m_TALK == 0)
623               fprintf(stderr,"tms5110_process: processing frame: TALKD = 0 caused by stop frame or buffer empty, halting speech.\n");
583624#endif
584               m_TALKD = m_TALK; // TALKD is latched from TALK
585               m_TALK = m_SPEN; // TALK is latched from SPEN
586            }
587            m_subcycle = m_subc_reload;
588            m_PC = 0;
589            m_IP++;
590            m_IP&=0x7;
625            m_TALKD = m_TALK; // TALKD is latched from TALK
626            m_TALK = m_SPEN; // TALK is latched from SPEN
591627         }
592         else if (m_subcycle == 3)
593         {
594            m_subcycle = m_subc_reload;
595            m_PC++;
596         }
597         m_pitch_count++;
598         if ((m_pitch_count >= m_current_pitch)||(m_pitch_zero == 1)) m_pitch_count = 0;
599         m_pitch_count &= 0x1FF;
628         m_subcycle = m_subc_reload;
629         m_PC = 0;
630         m_IP++;
631         m_IP&=0x7;
600632      }
601      else // m_TALKD == 0
633      else if (m_subcycle == 3)
602634      {
603         m_subcycle++;
604         if ((m_subcycle == 2) && (m_PC == 12)) // RESETF3
635         m_subcycle = m_subc_reload;
636         m_PC++;
637      }
638      m_pitch_count++;
639      if ((m_pitch_count >= m_current_pitch)||(m_pitch_zero == 1)) m_pitch_count = 0;
640      m_pitch_count &= 0x1FF;
641      buf_count++;
642      size--;
643   }
644
645empty:
646
647   while (size > 0)
648   {
649      m_subcycle++;
650      if ((m_subcycle == 2) && (m_PC == 12)) // RESETF3
651      {
652         if (m_IP == 7) // RESETL4
605653         {
606            if (m_IP == 7) // RESETL4
607            {
608               m_TALKD = m_TALK; // TALKD is latched from TALK
609               m_TALK = m_SPEN; // TALK is latched from SPEN
610            }
611            m_subcycle = m_subc_reload;
612            m_PC = 0;
613            m_IP++;
614            m_IP&=0x7;
654            m_TALKD = m_TALK; // TALKD is latched from TALK
655            m_TALK = m_SPEN; // TALK is latched from SPEN
615656         }
616         else if (m_subcycle == 3)
617         {
618            m_subcycle = m_subc_reload;
619            m_PC++;
620         }
621         buffer[buf_count] = -1; /* should be just -1; actual chip outputs -1 every idle sample; (cf note in data sheet, p 10, table 4) */
657         m_subcycle = m_subc_reload;
658         m_PC = 0;
659         m_IP++;
660         m_IP&=0x7;
622661      }
623   buf_count++;
624   size--;
662      else if (m_subcycle == 3)
663      {
664         m_subcycle = m_subc_reload;
665         m_PC++;
666      }
667      buffer[buf_count] = -1; /* should be just -1; actual chip outputs -1 every idle sample; (cf note in data sheet, p 10, table 4) */
668      buf_count++;
669      size--;
625670   }
626671}
627672
r249051r249052
853898               m_SPEN = 1; /* start immediately */
854899               /* clear out variables before speaking */
855900               m_zpar = 1; // zero all the parameters
856               m_uv_zpar = 1; // zero k4-k10 as well
857               m_OLDE = 1; // 'silence/zpar' frames are zero energy
858               m_OLDP = 1; // 'silence/zpar' frames are zero pitch
859#ifdef PERFECT_INTERPOLATION_HACK
860               m_old_zpar = 1; // zero all the old parameters
861               m_old_uv_zpar = 1; // zero old k4-k10 as well
862#endif
863901               m_subc_reload = 0; // SPKSLOW means this is 0
902               m_subcycle = m_subc_reload;
903               m_PC = 0;
904               m_IP = 0;
864905               break;
865906
866907            case TMS5110_CMD_READ_BIT:
r249051r249052
874915#ifdef DEBUG_COMMAND_DUMP
875916                  fprintf(stderr,"actually reading a bit now\n");
876917#endif
918                  request_bits(1);
877919                  m_CTL_buffer >>= 1;
878920                  m_CTL_buffer |= (extract_bits(1)<<3);
879921                  m_CTL_buffer &= 0xF;
r249051r249052
888930               m_SPEN = 1; /* start immediately */
889931               /* clear out variables before speaking */
890932               m_zpar = 1; // zero all the parameters
891               m_uv_zpar = 1; // zero k4-k10 as well
892               m_OLDE = 1; // 'silence/zpar' frames are zero energy
893               m_OLDP = 1; // 'silence/zpar' frames are zero pitch
894#ifdef PERFECT_INTERPOLATION_HACK
895               m_old_zpar = 1; // zero all the old parameters
896               m_old_uv_zpar = 1; // zero old k4-k10 as well
897#endif
898933               m_subc_reload = 1; // SPEAK means this is 1
934               m_subcycle = m_subc_reload;
935               m_PC = 0;
936               m_IP = 0;
899937               break;
900938
901939            case TMS5110_CMD_READ_BRANCH:
r249051r249052
940978
941979void tms5110_device::parse_frame()
942980{
943   int i, rep_flag;
981   int bits, i, rep_flag;
982   /** TODO: get rid of bits handling here and move into extract_bits (as in tms5220.c) **/
983   /* count the total number of bits available */
984   bits = m_fifo_count;
944985
986   /* attempt to extract the energy index */
987   bits -= m_coeff->energy_bits;
988   if (bits < 0)
989   {
990      request_bits( -bits ); /* toggle M0 to receive needed bits */
991      bits = 0;
992   }
945993   // attempt to extract the energy index
946994   m_new_frame_energy_idx = extract_bits(m_coeff->energy_bits);
947995#ifdef DEBUG_PARSE_FRAME_DUMP
r249051r249052
949997   fprintf(stderr," ");
950998#endif
951999
1000   /* if the energy index is 0 or 15, we're done
1001
1002   if ((indx == 0) || (indx == 15))
1003   {
1004      if (DEBUG_5110) logerror("  (4-bit energy=%d frame)\n",m_new_energy);
1005
1006   // clear the k's
1007      if (indx == 0)
1008      {
1009         for (i = 0; i < m_coeff->num_k; i++)
1010            m_new_k[i] = 0;
1011      }
1012
1013      // clear fifo if stop frame encountered
1014      if (indx == 15)
1015      {
1016         if (DEBUG_5110) logerror("  (4-bit energy=%d STOP frame)\n",m_new_energy);
1017         m_fifo_head = m_fifo_tail = m_fifo_count = 0;
1018      }
1019      return;
1020   }*/
9521021   // if the energy index is 0 or 15, we're done
9531022   if ((m_new_frame_energy_idx == 0) || (m_new_frame_energy_idx == 15))
9541023      return;
9551024
1025
1026   /* attempt to extract the repeat flag */
1027   bits -= 1;
1028   if (bits < 0)
1029   {
1030      request_bits( -bits ); /* toggle M0 to receive needed bits */
1031      bits = 0;
1032   }
9561033   rep_flag = extract_bits(1);
9571034#ifdef DEBUG_PARSE_FRAME_DUMP
9581035   printbits(rep_flag, 1);
9591036   fprintf(stderr," ");
9601037#endif
9611038
1039   /* attempt to extract the pitch */
1040   bits -= m_coeff->pitch_bits;
1041   if (bits < 0)
1042   {
1043      request_bits( -bits ); /* toggle M0 to receive needed bits */
1044      bits = 0;
1045   }
9621046   m_new_frame_pitch_idx = extract_bits(m_coeff->pitch_bits);
9631047#ifdef DEBUG_PARSE_FRAME_DUMP
9641048   printbits(m_new_frame_pitch_idx,m_coeff->pitch_bits);
r249051r249052
9711055   // extract first 4 K coefficients
9721056   for (i = 0; i < 4; i++)
9731057   {
1058      /* attempt to extract 4 K's */
1059      bits -= m_coeff->kbits[i];
1060      if (bits < 0)
1061      {
1062         request_bits( -bits ); /* toggle M0 to receive needed bits */
1063         bits = 0;
1064      }
9741065      m_new_frame_k_idx[i] = extract_bits(m_coeff->kbits[i]);
9751066#ifdef DEBUG_PARSE_FRAME_DUMP
9761067      printbits(m_new_frame_k_idx[i],m_coeff->kbits[i]);
r249051r249052
9881079   // If we got here, we need the remaining 6 K's
9891080   for (i = 4; i < m_coeff->num_k; i++)
9901081   {
1082      bits -= m_coeff->kbits[i];
1083      if (bits < 0)
1084      {
1085         request_bits( -bits ); /* toggle M0 to receive needed bits */
1086         bits = 0;
1087      }
9911088      m_new_frame_k_idx[i] = extract_bits(m_coeff->kbits[i]);
9921089#ifdef DEBUG_PARSE_FRAME_DUMP
9931090      printbits(m_new_frame_k_idx[i],m_coeff->kbits[i]);
9941091      fprintf(stderr," ");
9951092#endif
9961093   }
997#ifdef DEBUG_PARSE_FRAME_DUMP
998         fprintf(stderr,"\n");
999#endif
10001094#ifdef VERBOSE
1095   if (m_speak_external)
1096      logerror("Parsed a frame successfully in FIFO - %d bits remaining\n", (m_fifo_count*8)-(m_fifo_bits_taken));
1097   else
10011098      logerror("Parsed a frame successfully in ROM\n");
10021099#endif
10031100   return;
r249051r249052
11411238void tms5110_device::device_reset()
11421239{
11431240   m_digital_select = FORCE_DIGITAL; // assume analog output
1241   /* initialize the FIFO */
1242   memset(m_fifo, 0, sizeof(m_fifo));
1243   m_fifo_head = m_fifo_tail = m_fifo_count = 0;
11441244
11451245   /* initialize the chip state */
11461246   m_SPEN = m_TALK = m_TALKD = 0;
r249051r249052
11531253#ifdef PERFECT_INTERPOLATION_HACK
11541254   m_old_frame_energy_idx = m_old_frame_pitch_idx = 0;
11551255   memset(m_old_frame_k_idx, 0, sizeof(m_old_frame_k_idx));
1156   m_old_zpar = m_old_uv_zpar = 0;
1256   m_old_zpar = 0;
11571257#endif
11581258   m_new_frame_energy_idx = m_current_energy = m_previous_energy = 0;
11591259   m_new_frame_pitch_idx = m_current_pitch = 0;
r249051r249052
12901390}
12911391
12921392
1393
12931394/******************************************************************************
12941395
1396     tms5110_ready_r -- return the not ready status from the sound chip
1397
1398******************************************************************************/
1399
1400int tms5110_device::ready_r()
1401{
1402   /* bring up to date first */
1403   m_stream->update();
1404   return (m_fifo_count < FIFO_SIZE-1);
1405}
1406
1407
1408
1409/******************************************************************************
1410
12951411     tms5110_update -- update the sound chip so that it is in sync with CPU execution
12961412
12971413******************************************************************************/
trunk/src/emu/sound/tms5110.h
r249051r249052
77
88#include "emu.h"
99
10/* HACK: if defined, uses impossibly perfect 'straight line' interpolation */
11#undef PERFECT_INTERPOLATION_HACK
10#define FIFO_SIZE               64 // TODO: technically the tms51xx chips don't have a fifo at all
1211
1312/* TMS5110 commands */
1413                              /* CTL8  CTL4  CTL2  CTL1  |   PDC's  */
r249051r249052
1615#define TMS5110_CMD_RESET        (0) /*    0     0     0     x  |     1    */
1716#define TMS5110_CMD_LOAD_ADDRESS (2) /*    0     0     1     x  |     2    */
1817#define TMS5110_CMD_OUTPUT       (4) /*    0     1     0     x  |     3    */
19#define TMS5110_CMD_SPKSLOW      (6) /*    0     1     1     x  |     1    | Note: this command is undocumented on the datasheets, it only appears on the patents. It might not actually work properly on some of the real chips as manufactured. Acts the same as CMD_SPEAK, but makes the interpolator take three A cycles whereever it would normally only take one, effectively making speech of any given word take twice as long as normal. */
18#define TMS5110_CMD_SPKSLOW      (6) /*    0     1     1     x  |     1    | Note: this command is undocumented on the datasheets, it only appears on the patents. It might not actually work properly on some of the real chips as manufactured. Acts the same as CMD_SPEAK, but makes the interpolator take two A cycles whereever it would normally only take one, effectively making speech of any given word take about twice as long as normal. */
2019#define TMS5110_CMD_READ_BIT     (8) /*    1     0     0     x  |     1    */
2120#define TMS5110_CMD_SPEAK       (10) /*    1     0     1     x  |     1    */
2221#define TMS5110_CMD_READ_BRANCH (12) /*    1     1     0     x  |     1    */
r249051r249052
6564    */
6665   DECLARE_READ8_MEMBER( romclk_hack_r );
6766
67   int ready_r();
6868   void set_frequency(int frequency);
6969
7070   int _speech_rom_read_bit();
r249051r249052
9393   void new_int_write_addr(UINT8 addr);
9494   UINT8 new_int_read();
9595   void register_for_save_states();
96   void FIFO_data_write(int data);
9697   int extract_bits(int count);
98   void request_bits(int no);
9799   void perform_dummy_read();
98100   INT32 lattice_filter();
99101   void process(INT16 *buffer, unsigned int size);
r249051r249052
107109   /* coefficient tables */
108110   const struct tms5100_coeffs *m_coeff;
109111
112   /* these contain data that describes the 4 bit "FIFO" */
113   UINT8 m_fifo[FIFO_SIZE];
114   UINT8 m_fifo_head;
115   UINT8 m_fifo_tail;
116   UINT8 m_fifo_count;
117
110118   /* these contain global status bits */
111119   UINT8 m_PDC;
112120   UINT8 m_CTL_pins;
r249051r249052
154162   UINT8 m_old_frame_pitch_idx;
155163   UINT8 m_old_frame_k_idx[10];
156164   UINT8 m_old_zpar;
157   UINT8 m_old_uv_zpar;
158165
159166   INT32 m_current_energy;
160167   INT32 m_current_pitch;
trunk/src/emu/sound/tms5220.c
r249051r249052
271271 * or clip logic, even though the real hardware doesn't do this, partially verified by decap */
272272#undef ALLOW_4_LSB
273273
274/* forces m_TALK active instantly whenever m_SPEN would be activated, causing speech delay to be reduced by up to one frame time */
275/* for some reason, this hack makes victory behave better, though it does not match the patent */
276#define FAST_START_HACK 1
277274
278
279275/* *****configuration of chip connection stuff***** */
280276/* must be defined; if 0, output the waveform as if it was tapped on the speaker pin as usual, if 1, output the waveform as if it was tapped on the i/o pin (volume is much lower in the latter case) */
281277#define FORCE_DIGITAL 0
r249051r249052
365361   save_item(NAME(m_fifo_count));
366362   save_item(NAME(m_fifo_bits_taken));
367363
368   save_item(NAME(m_previous_TALK_STATUS));
369   save_item(NAME(m_SPEN));
370   save_item(NAME(m_DDIS));
371   save_item(NAME(m_TALK));
372   save_item(NAME(m_TALKD));
364   save_item(NAME(m_speaking_now));
365   save_item(NAME(m_speak_external));
366   save_item(NAME(m_talk_status));
373367   save_item(NAME(m_buffer_low));
374368   save_item(NAME(m_buffer_empty));
375369   save_item(NAME(m_irq_pin));
r249051r249052
390384   save_item(NAME(m_current_pitch));
391385   save_item(NAME(m_current_k));
392386
387   save_item(NAME(m_target_energy));
388   save_item(NAME(m_target_pitch));
389   save_item(NAME(m_target_k));
390
393391   save_item(NAME(m_previous_energy));
394392
395393   save_item(NAME(m_subcycle));
r249051r249052
397395   save_item(NAME(m_PC));
398396   save_item(NAME(m_IP));
399397   save_item(NAME(m_inhibit));
400   save_item(NAME(m_uv_zpar));
401   save_item(NAME(m_zpar));
402   save_item(NAME(m_pitch_zero));
403398   save_item(NAME(m_c_variant_rate));
404399   save_item(NAME(m_pitch_count));
405400
r249051r249052
470465
471466void tms5220_device::data_write(int data)
472467{
473   int old_buffer_low = m_buffer_low;
474468#ifdef DEBUG_DUMP_INPUT_DATA
475469   fprintf(stdout, "%c",data);
476470#endif
477   if (m_DDIS) // If we're in speak external mode
471   if (m_speak_external) // If we're in speak external mode
478472   {
479473      // add this byte to the FIFO
480474      if (m_fifo_count < FIFO_SIZE)
r249051r249052
483477         m_fifo_tail = (m_fifo_tail + 1) % FIFO_SIZE;
484478         m_fifo_count++;
485479#ifdef DEBUG_FIFO
486         fprintf(stderr,"data_write: Added byte to FIFO (current count=%2d)\n", m_fifo_count);
480         logerror("data_write: Added byte to FIFO (current count=%2d)\n", m_fifo_count);
487481#endif
488482         update_fifo_status_and_ints();
489         // if we just unset buffer low with that last write, and SPEN *was* zero (see circuit 251, sheet 12)
490         if ((m_SPEN == 0) && ((old_buffer_low == 1) && (m_buffer_low == 0))) // MUST HAVE EDGE DETECT
483         if ((m_talk_status == 0) && (m_buffer_low == 0)) // we just unset buffer low with that last write, and talk status *was* zero...
491484         {
492            int i;
485         int i;
493486#ifdef DEBUG_FIFO
494            fprintf(stderr,"data_write triggered SPEN to go active!\n");
487         logerror("data_write triggered talk status to go active!\n");
495488#endif
496            // ...then we now have enough bytes to start talking; set zpar and clear out the new frame parameters (it will become old frame just before the first call to parse_frame() )
497            m_zpar = 1;
498            m_uv_zpar = 1; // zero k4-k10 as well
499            m_OLDE = 1; // 'silence/zpar' frames are zero energy
500            m_OLDP = 1; // 'silence/zpar' frames are zero pitch
501#ifdef PERFECT_INTERPOLATION_HACK
502            m_old_zpar = 1; // zero all the old parameters
503            m_old_uv_zpar = 1; // zero old k4-k10 as well
504#endif
505            m_SPEN = 1;
506#ifdef FAST_START_HACK
507            m_TALK = 1;
508#endif
489            // ...then we now have enough bytes to start talking; clear out the new frame parameters (it will become old frame just before the first call to parse_frame() )
490            // TODO: the 3 lines below (and others) are needed for victory to not fail its selftest due to a sample ending too late, may require additional investigation
491            m_subcycle = m_subc_reload;
492            m_PC = 0;
493            m_IP = reload_table[m_c_variant_rate&0x3]; // is this correct? should this be always 7 instead, so that the new frame is loaded quickly?
509494            m_new_frame_energy_idx = 0;
510495            m_new_frame_pitch_idx = 0;
511496            for (i = 0; i < 4; i++)
r249051r249052
514499               m_new_frame_k_idx[i] = 0xF;
515500            for (i = 7; i < m_coeff->num_k; i++)
516501               m_new_frame_k_idx[i] = 0x7;
517
502            m_talk_status = m_speaking_now = 1;
518503         }
519504      }
520505      else
521506      {
522507#ifdef DEBUG_FIFO
523         fprintf(stderr,"data_write: Ran out of room in the tms52xx FIFO! this should never happen!\n");
508         logerror("data_write: Ran out of room in the tms52xx FIFO! this should never happen!\n");
524509         // at this point, /READY should remain HIGH/inactive until the fifo has at least one byte open in it.
525510#endif
526511      }
527512
528513
529514   }
530   else //(! m_DDIS)
515   else //(! m_speak_external)
531516      // R Nabet : we parse commands at once.  It is necessary for such commands as read.
532517      process_command(data);
533518}
r249051r249052
575560      m_buffer_low = 0;
576561
577562   /* BE is set if neither byte 15 nor 14 of the fifo are in use; this
578   translates to having fifo_count equal to exactly 0
579   */
563   translates to having fifo_count equal to exactly 0 */
580564   if (m_fifo_count == 0)
581565   {
582566      // generate an interrupt if necessary; if /BE was inactive and is now active, set int.
583567      if (!m_buffer_empty)
584568         set_interrupt_state(1);
585569      m_buffer_empty = 1;
586      m_TALK = m_SPEN = 0; // /BE being active clears the TALK(TCON) status which in turn clears SPEN
587570   }
588571   else
589572      m_buffer_empty = 0;
590573
591   // generate an interrupt if /TS was active, and is now inactive.
592   // also, in this case, regardless if DDIS was set, unset it.
593   if (m_previous_TALK_STATUS == 1 && (TALK_STATUS == 0))
574   /* TS is talk status and is set elsewhere in the fifo parser and in
575   the SPEAK command handler; however, if /BE is true during speak external
576   mode, it is immediately unset here. */
577   if ((m_speak_external == 1) && (m_buffer_empty == 1))
594578   {
595#ifdef VERBOSE
596      fprintf(stderr,"Talk status WAS 1, is now 0, unsetting DDIS and firing an interrupt!\n");
597#endif
598      set_interrupt_state(1);
599      m_DDIS = 0;
579      // generate an interrupt: /TS was active, and is now inactive.
580      if (m_talk_status == 1)
581      {
582         m_talk_status = m_speak_external = 0;
583         set_interrupt_state(1);
584      }
600585   }
601   m_previous_TALK_STATUS = TALK_STATUS;
602
586   /* Note that TS being unset will also generate an interrupt when a STOP
587   frame is encountered; this is handled in the sample generator code and not here */
603588}
604589
605590/**********************************************************************************************
r249051r249052
612597{
613598   int val = 0;
614599
615   if (m_DDIS)
600   if (m_speak_external)
616601   {
617602      // extract from FIFO
618603      while (count--)
r249051r249052
658643      /* clear the interrupt pin on status read */
659644      set_interrupt_state(0);
660645#ifdef DEBUG_PIN_READS
661      fprintf(stderr,"Status read: TS=%d BL=%d BE=%d\n", TALK_STATUS, m_buffer_low, m_buffer_empty);
646      logerror("Status read: TS=%d BL=%d BE=%d\n", m_talk_status, m_buffer_low, m_buffer_empty);
662647#endif
663648
664      return (TALK_STATUS << 7) | (m_buffer_low << 6) | (m_buffer_empty << 5);
649      return (m_talk_status << 7) | (m_buffer_low << 6) | (m_buffer_empty << 5);
665650   }
666651}
667652
r249051r249052
675660int tms5220_device::ready_read()
676661{
677662#ifdef DEBUG_PIN_READS
678   fprintf(stderr,"ready_read: ready pin read, io_ready is %d, fifo count is %d, DDIS(speak external) is %d\n", m_io_ready, m_fifo_count, m_DDIS);
663   logerror("ready_read: ready pin read, io_ready is %d, fifo count is %d\n", m_io_ready, m_fifo_count);
679664#endif
680   return ((m_fifo_count < FIFO_SIZE)||(!m_DDIS)) && m_io_ready;
665   return ((m_fifo_count < FIFO_SIZE)||(!m_speak_external)) && m_io_ready;
681666}
682667
683668
r249051r249052
733718int tms5220_device::int_read()
734719{
735720#ifdef DEBUG_PIN_READS
736   fprintf(stderr,"int_read: irq pin read, state is %d\n", m_irq_pin);
721   logerror("int_read: irq pin read, state is %d\n", m_irq_pin);
737722#endif
738723   return m_irq_pin;
739724}
r249051r249052
748733void tms5220_device::process(INT16 *buffer, unsigned int size)
749734{
750735   int buf_count=0;
751   int i, bitout;
736   int i, bitout, zpar;
752737   INT32 this_sample;
753738
754#ifdef VERBOSE
755   fprintf(stderr,"process called with size of %d; IP=%d, PC=%d, subcycle=%d, m_SPEN=%d, m_TALK=%d, m_TALKD=%d\n", size, m_IP, m_PC, m_subcycle, m_SPEN, m_TALK, m_TALKD);
756#endif
739   /* the following gotos are probably safe to remove */
740   /* if we're empty and still not speaking, fill with nothingness */
741   if (!m_speaking_now)
742      goto empty;
757743
744   /* if speak external is set, but talk status is not (yet) set,
745   wait for buffer low to clear */
746   if (!m_talk_status && m_speak_external && m_buffer_low)
747      goto empty;
748
758749   /* loop until the buffer is full or we've stopped speaking */
759   while (size > 0)
750   while ((size > 0) && m_speaking_now)
760751   {
761      if(m_TALKD) // speaking
752      /* if it is the appropriate time to update the old energy/pitch indices,
753       * i.e. when IP=7, PC=12, T=17, subcycle=2, do so. Since IP=7 PC=12 T=17
754       * is JUST BEFORE the transition to IP=0 PC=0 T=0 sybcycle=(0 or 1),
755       * which happens 4 T-cycles later), we change on the latter.
756       * The indices are updated here ~12 PCs before the new frame is applied.
757       */
758      /** TODO: the patents 4331836, 4335277, and 4419540 disagree about the timing of this **/
759      if ((m_IP == 0) && (m_PC == 0) && (m_subcycle < 2))
762760      {
763         /* if we're ready for a new frame to be applied, i.e. when IP=0, PC=12, Sub=1
764         * (In reality, the frame was really loaded incrementally during the entire IP=0
765         * PC=x time period, but it doesn't affect anything until IP=0 PC=12 happens)
766         */
767         if ((m_IP == 0) && (m_PC == 12) && (m_subcycle == 1))
768         {
769            // HACK for regression testing, be sure to comment out before release!
770            //m_RNG = 0x1234;
771            // end HACK
761         m_OLDE = (m_new_frame_energy_idx == 0);
762         m_OLDP = (m_new_frame_pitch_idx == 0);
763      }
772764
773            /* appropriately override the interp count if needed; this will be incremented after the frame parse! */
774            m_IP = reload_table[m_c_variant_rate&0x3];
765      /* if we're ready for a new frame to be applied, i.e. when IP=0, PC=12, Sub=1
766       * (In reality, the frame was really loaded incrementally during the entire IP=0
767       * PC=x time period, but it doesn't affect anything until IP=0 PC=12 happens)
768       */
769      if ((m_IP == 0) && (m_PC == 12) && (m_subcycle == 1))
770      {
771         // HACK for regression testing, be sure to comment out before release!
772         //m_RNG = 0x1234;
773         // end HACK
775774
775         /* appropriately override the interp count if needed; this will be incremented after the frame parse! */
776         m_IP = reload_table[m_c_variant_rate&0x3];
777
776778#ifdef PERFECT_INTERPOLATION_HACK
777            /* remember previous frame energy, pitch, and coefficients */
778            m_old_frame_energy_idx = m_new_frame_energy_idx;
779            m_old_frame_pitch_idx = m_new_frame_pitch_idx;
780            for (i = 0; i < m_coeff->num_k; i++)
781               m_old_frame_k_idx[i] = m_new_frame_k_idx[i];
779         /* remember previous frame energy, pitch, and coefficients */
780         m_old_frame_energy_idx = m_new_frame_energy_idx;
781         m_old_frame_pitch_idx = m_new_frame_pitch_idx;
782         for (i = 0; i < m_coeff->num_k; i++)
783            m_old_frame_k_idx[i] = m_new_frame_k_idx[i];
782784#endif
783785
784            /* Parse a new frame into the new_target_energy, new_target_pitch and new_target_k[] */
785            parse_frame();
786         /* if the talk status was clear last frame, halt speech now. */
787         if (m_talk_status == 0)
788         {
789#ifdef DEBUG_GENERATION
790            fprintf(stderr,"tms5220_process: processing frame: talk status = 0 caused by stop frame or buffer empty, halting speech.\n");
791#endif
792            if (m_speaking_now == 1) // we're done, set all coeffs to idle state but keep going for a bit...
793            {
794               /**TODO: should index clearing be done here, or elsewhere? **/
795               m_new_frame_energy_idx = 0;
796               m_new_frame_pitch_idx = 0;
797               for (i = 0; i < 4; i++)
798                  m_new_frame_k_idx[i] = 0;
799               for (i = 4; i < 7; i++)
800                  m_new_frame_k_idx[i] = 0xF;
801               for (i = 7; i < m_coeff->num_k; i++)
802                  m_new_frame_k_idx[i] = 0x7;
803               m_speaking_now = 2; // wait 8 extra interp periods before shutting down so we can interpolate everything to zero state
804            }
805            else // m_speaking_now == 2 // now we're really done.
806            {
807               m_speaking_now = 0; // finally halt speech
808               goto empty;
809            }
810         }
786811
787            // if the new frame is unvoiced (or silenced via ZPAR), be sure to zero out the k5-k10 parameters
788            // NOTE: this is probably the bug the tms5100/tmc0280 has, pre-rev D, I think.
789            // GUESS: Pre-rev D versions start zeroing k5-k10 immediately upon new frame load regardless of interpolation inhibit
790            // I.e. ZPAR = /TALKD || (PC>5&&P=0)
791            // GUESS: D and later versions only start or stop zeroing k5-k10 at the IP7->IP0 transition AFTER the frame
792            // I.e. ZPAR = /TALKD || (PC>5&&OLDP)
793#ifdef PERFECT_INTERPOLATION_HACK
794            m_old_uv_zpar = m_uv_zpar;
795            m_old_zpar = m_zpar; // unset old zpar on new frame
812
813         /* Parse a new frame into the new_target_energy, new_target_pitch and new_target_k[],
814          * but only if we're not just about to end speech */
815         if (m_speaking_now == 1) parse_frame();
816#ifdef DEBUG_PARSE_FRAME_DUMP
817         fprintf(stderr,"\n");
796818#endif
797            m_zpar = 0;
798            //m_uv_zpar = (OLD_FRAME_UNVOICED_FLAG||m_zpar); // GUESS: fixed version in tmc0280d/tms5100a/cd280x/tms5110
799            m_uv_zpar = (NEW_FRAME_UNVOICED_FLAG||m_zpar); // GUESS: buggy version in tmc0280/tms5100
800819
801            /* if the new frame is a stop frame, unset both TALK and SPEN (via TCON). TALKD remains active while the energy is ramping to 0. */
802            if (NEW_FRAME_STOP_FLAG == 1)
820         /* if the new frame is a stop frame, set an interrupt and set talk status to 0 */
821         /** TODO: investigate this later! **/
822         if (NEW_FRAME_STOP_FLAG == 1)
803823            {
804               m_TALK = m_SPEN = 0;
824               m_talk_status = m_speak_external = 0;
825               set_interrupt_state(1);
826               update_fifo_status_and_ints();
805827            }
806828
807            /* in all cases where interpolation would be inhibited, set the inhibit flag; otherwise clear it.
808            Interpolation inhibit cases:
809            * Old frame was voiced, new is unvoiced
810            * Old frame was silence/zero energy, new has nonzero energy
811            * Old frame was unvoiced, new is voiced
812            * Old frame was unvoiced, new frame is silence/zero energy (unique to tms52xx)
813            */
814            if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1))
815               || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0))
816               || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0))
817               || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 1)) )
818               m_inhibit = 1;
819            else // normal frame, normal interpolation
820               m_inhibit = 0;
829         /* in all cases where interpolation would be inhibited, set the inhibit flag; otherwise clear it.
830            Interpolation inhibit cases:
831          * Old frame was voiced, new is unvoiced
832          * Old frame was silence/zero energy, new has nonzero energy
833          * Old frame was unvoiced, new is voiced
834          * Old frame was unvoiced, new frame is silence/zero energy (unique to tms52xx)
835          */
836         if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1))
837            || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0))
838            || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0))
839            || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 1)) )
840            m_inhibit = 1;
841         else // normal frame, normal interpolation
842            m_inhibit = 0;
821843
844         /* load new frame targets from tables, using parsed indices */
845         m_target_energy = m_coeff->energytable[m_new_frame_energy_idx];
846         m_target_pitch = m_coeff->pitchtable[m_new_frame_pitch_idx];
847         zpar = NEW_FRAME_UNVOICED_FLAG; // find out if parameters k5-k10 should be zeroed
848         for (i = 0; i < 4; i++)
849            m_target_k[i] = m_coeff->ktable[i][m_new_frame_k_idx[i]];
850         for (i = 4; i < m_coeff->num_k; i++)
851            m_target_k[i] = (m_coeff->ktable[i][m_new_frame_k_idx[i]] * (1-zpar));
852
822853#ifdef DEBUG_GENERATION
823            /* Debug info for current parsed frame */
824            fprintf(stderr, "OLDE: %d; OLDP: %d; ", m_OLDE, m_OLDP);
825            fprintf(stderr,"Processing new frame: ");
826            if (m_inhibit == 0)
827               fprintf(stderr, "Normal Frame\n");
828            else
829               fprintf(stderr,"Interpolation Inhibited\n");
830            fprintf(stderr,"*** current Energy, Pitch and Ks =      %04d,   %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d\n",m_current_energy, m_current_pitch, m_current_k[0], m_current_k[1], m_current_k[2], m_current_k[3], m_current_k[4], m_current_k[5], m_current_k[6], m_current_k[7], m_current_k[8], m_current_k[9]);
831            fprintf(stderr,"*** target Energy(idx), Pitch, and Ks = %04d(%x),%04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d\n",
832               (m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar)),
833               m_new_frame_energy_idx,
834               (m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar)),
835               (m_coeff->ktable[0][m_new_frame_k_idx[0]] * (1-m_zpar)),
836               (m_coeff->ktable[1][m_new_frame_k_idx[1]] * (1-m_zpar)),
837               (m_coeff->ktable[2][m_new_frame_k_idx[2]] * (1-m_zpar)),
838               (m_coeff->ktable[3][m_new_frame_k_idx[3]] * (1-m_zpar)),
839               (m_coeff->ktable[4][m_new_frame_k_idx[4]] * (1-m_uv_zpar)),
840               (m_coeff->ktable[5][m_new_frame_k_idx[5]] * (1-m_uv_zpar)),
841               (m_coeff->ktable[6][m_new_frame_k_idx[6]] * (1-m_uv_zpar)),
842               (m_coeff->ktable[7][m_new_frame_k_idx[7]] * (1-m_uv_zpar)),
843               (m_coeff->ktable[8][m_new_frame_k_idx[8]] * (1-m_uv_zpar)),
844               (m_coeff->ktable[9][m_new_frame_k_idx[9]] * (1-m_uv_zpar)) );
854         /* Debug info for current parsed frame */
855         fprintf(stderr, "OLDE: %d; OLDP: %d; ", m_OLDE, m_OLDP);
856         fprintf(stderr,"Processing frame: ");
857         if (m_inhibit == 0)
858            fprintf(stderr, "Normal Frame\n");
859         else
860            fprintf(stderr,"Interpolation Inhibited\n");
861         fprintf(stderr,"*** current Energy, Pitch and Ks =      %04d,   %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d\n",m_current_energy, m_current_pitch, m_current_k[0], m_current_k[1], m_current_k[2], m_current_k[3], m_current_k[4], m_current_k[5], m_current_k[6], m_current_k[7], m_current_k[8], m_current_k[9]);
862         fprintf(stderr,"*** target Energy(idx), Pitch, and Ks = %04d(%x),%04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d\n",m_target_energy, m_new_frame_energy_idx, m_target_pitch, m_target_k[0], m_target_k[1], m_target_k[2], m_target_k[3], m_target_k[4], m_target_k[5], m_target_k[6], m_target_k[7], m_target_k[8], m_target_k[9]);
845863#endif
846864
847         }
848         else // Not a new frame, just interpolate the existing frame.
865         /* if TS is now 0, ramp the energy down to 0. Is this really correct to hardware? */
866         if (m_talk_status == 0)
849867         {
850            int inhibit_state = ((m_inhibit==1)&&(m_IP != 0)); // disable inhibit when reaching the last interp period, but don't overwrite the m_inhibit value
851#ifdef PERFECT_INTERPOLATION_HACK
852            int samples_per_frame = m_subc_reload?175:266; // either (13 A cycles + 12 B cycles) * 7 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 7 interps for SPKSLOW
853            //int samples_per_frame = m_subc_reload?200:304; // either (13 A cycles + 12 B cycles) * 8 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 8 interps for SPKSLOW
854            int current_sample = (m_subcycle - m_subc_reload)+(m_PC*(3-m_subc_reload))+((m_subc_reload?25:38)*((m_IP-1)&7));
855            //fprintf(stderr, "CS: %03d", current_sample);
856            // reset the current energy, pitch, etc to what it was at frame start
857            m_current_energy = (m_coeff->energytable[m_old_frame_energy_idx] * (1-m_old_zpar));
858            m_current_pitch = (m_coeff->pitchtable[m_old_frame_pitch_idx] * (1-m_old_zpar));
859            for (i = 0; i < m_coeff->num_k; i++)
860               m_current_k[i] = (m_coeff->ktable[i][m_old_frame_k_idx[i]] * (1-((i<4)?m_old_zpar:m_old_uv_zpar)));
861            // now adjust each value to be exactly correct for each of the samples per frame
862            if (m_IP != 0) // if we're still interpolating...
863            {
864               m_current_energy = (m_current_energy + (((m_coeff->energytable[m_new_frame_energy_idx] - m_current_energy)*(1-inhibit_state))*current_sample)/samples_per_frame)*(1-m_zpar);
865               m_current_pitch = (m_current_pitch + (((m_coeff->pitchtable[m_new_frame_pitch_idx] - m_current_pitch)*(1-inhibit_state))*current_sample)/samples_per_frame)*(1-m_zpar);
866               for (i = 0; i < m_coeff->num_k; i++)
867                  m_current_k[i] = (m_current_k[i] + (((m_coeff->ktable[i][m_new_frame_k_idx[i]] - m_current_k[i])*(1-inhibit_state))*current_sample)/samples_per_frame)*(1-((i<4)?m_zpar:m_uv_zpar));
868            }
869            else // we're done, play this frame for 1/8 frame.
870            {
871               m_current_energy = (m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar));
872               m_current_pitch = (m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar));
873               for (i = 0; i < m_coeff->num_k; i++)
874                  m_current_k[i] = (m_coeff->ktable[i][m_new_frame_k_idx[i]] * (1-((i<4)?m_zpar:m_uv_zpar)));
875            }
876#else
877            //Updates to parameters only happen on subcycle '2' (B cycle) of PCs.
878            if (m_subcycle == 2)
879            {
880               switch(m_PC)
881               {
882                  case 0: /* PC = 0, B cycle, write updated energy */
883                  m_current_energy = (m_current_energy + (((m_coeff->energytable[m_new_frame_energy_idx] - m_current_energy)*(1-inhibit_state)) INTERP_SHIFT))*(1-m_zpar);
884                  break;
885                  case 1: /* PC = 1, B cycle, write updated pitch */
886                  m_current_pitch = (m_current_pitch + (((m_coeff->pitchtable[m_new_frame_pitch_idx] - m_current_pitch)*(1-inhibit_state)) INTERP_SHIFT))*(1-m_zpar);
887                  break;
888                  case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11:
889                  /* PC = 2 through 11, B cycle, write updated K1 through K10 */
890                  m_current_k[m_PC-2] = (m_current_k[m_PC-2] + (((m_coeff->ktable[m_PC-2][m_new_frame_k_idx[m_PC-2]] - m_current_k[m_PC-2])*(1-inhibit_state)) INTERP_SHIFT))*(((m_PC-2)>4)?(1-m_uv_zpar):(1-m_zpar));
891                  break;
892                  case 12: /* PC = 12 */
893                  /* we should NEVER reach this point, PC=12 doesn't have a subcycle 2 */
894                  break;
895               }
896            }
868#ifdef DEBUG_GENERATION
869            fprintf(stderr,"Talk status is 0, forcing target energy to 0\n");
897870#endif
871            m_target_energy = 0;
898872         }
873      }
874      else // Not a new frame, just interpolate the existing frame.
875      {
876         int inhibit_state = ((m_inhibit==1)&&(m_IP != 0)); // disable inhibit when reaching the last interp period, but don't overwrite the m_inhibit value
877#ifdef PERFECT_INTERPOLATION_HACK
878         int samples_per_frame = m_subc_reload?175:266; // either (13 A cycles + 12 B cycles) * 7 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 7 interps for SPKSLOW
879         //int samples_per_frame = m_subc_reload?200:304; // either (13 A cycles + 12 B cycles) * 8 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 8 interps for SPKSLOW
880         int current_sample = (m_subcycle - m_subc_reload)+(m_PC*(3-m_subc_reload))+((m_subc_reload?25:38)*((m_IP-1)&7));
899881
900         // calculate the output
901         if (OLD_FRAME_UNVOICED_FLAG == 1)
882         zpar = OLD_FRAME_UNVOICED_FLAG;
883         //fprintf(stderr, "CS: %03d", current_sample);
884         // reset the current energy, pitch, etc to what it was at frame start
885         m_current_energy = m_coeff->energytable[m_old_frame_energy_idx];
886         m_current_pitch = m_coeff->pitchtable[m_old_frame_pitch_idx];
887         for (i = 0; i < 4; i++)
888            m_current_k[i] = m_coeff->ktable[i][m_old_frame_k_idx[i]];
889         for (i = 4; i < m_coeff->num_k; i++)
890            m_current_k[i] = (m_coeff->ktable[i][m_old_frame_k_idx[i]] * (1-zpar));
891         // now adjust each value to be exactly correct for each of the samples per frame
892         if (m_IP != 0) // if we're still interpolating...
902893         {
903            // generate unvoiced samples here
904            if (m_RNG & 1)
905               m_excitation_data = ~0x3F; /* according to the patent it is (either + or -) half of the maximum value in the chirp table, so either 01000000(0x40) or 11000000(0xC0)*/
906            else
907               m_excitation_data = 0x40;
894            m_current_energy += (((m_target_energy - m_current_energy)*(1-inhibit_state))*current_sample)/samples_per_frame;
895            m_current_pitch += (((m_target_pitch - m_current_pitch)*(1-inhibit_state))*current_sample)/samples_per_frame;
896            for (i = 0; i < m_coeff->num_k; i++)
897               m_current_k[i] += (((m_target_k[i] - m_current_k[i])*(1-inhibit_state))*current_sample)/samples_per_frame;
908898         }
909         else /* (OLD_FRAME_UNVOICED_FLAG == 0) */
899         else // we're done, play this frame for 1/8 frame.
910900         {
911            // generate voiced samples here
912            /* US patent 4331836 Figure 14B shows, and logic would hold, that a pitch based chirp
913            * function has a chirp/peak and then a long chain of zeroes.
914            * The last entry of the chirp rom is at address 0b110011 (51d), the 52nd sample,
915            * and if the address reaches that point the ADDRESS incrementer is
916            * disabled, forcing all samples beyond 51d to be == 51d
917            */
918            if (m_pitch_count >= 51)
919               m_excitation_data = (INT8)m_coeff->chirptable[51];
920            else /*m_pitch_count < 51*/
921               m_excitation_data = (INT8)m_coeff->chirptable[m_pitch_count];
901            m_current_energy = m_target_energy;
902            m_current_pitch = m_target_pitch;
903            for (i = 0; i < m_coeff->num_k; i++)
904               m_current_k[i] = m_target_k[i];
922905         }
923
924         // Update LFSR *20* times every sample (once per T cycle), like patent shows
925         for (i=0; i<20; i++)
906#else
907         //Updates to parameters only happen on subcycle '2' (B cycle) of PCs.
908         if (m_subcycle == 2)
926909         {
927            bitout = ((m_RNG >> 12) & 1) ^
928                  ((m_RNG >>  3) & 1) ^
929                  ((m_RNG >>  2) & 1) ^
930                  ((m_RNG >>  0) & 1);
931            m_RNG <<= 1;
932            m_RNG |= bitout;
910            switch(m_PC)
911            {
912               case 0: /* PC = 0, B cycle, write updated energy */
913               m_current_energy += (((m_target_energy - m_current_energy)*(1-inhibit_state)) INTERP_SHIFT);
914               break;
915               case 1: /* PC = 1, B cycle, write updated pitch */
916               m_current_pitch += (((m_target_pitch - m_current_pitch)*(1-inhibit_state)) INTERP_SHIFT);
917               break;
918               case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11:
919               /* PC = 2 through 11, B cycle, write updated K1 through K10 */
920               m_current_k[m_PC-2] += (((m_target_k[m_PC-2] - m_current_k[m_PC-2])*(1-inhibit_state)) INTERP_SHIFT);
921               break;
922               case 12: /* PC = 12, do nothing */
923               break;
924            }
933925         }
934         this_sample = lattice_filter(); /* execute lattice filter */
926#endif
927      }
928
929      // calculate the output
930      if (OLD_FRAME_UNVOICED_FLAG == 1)
931      {
932         // generate unvoiced samples here
933         if (m_RNG & 1)
934            m_excitation_data = ~0x3F; /* according to the patent it is (either + or -) half of the maximum value in the chirp table, so either 01000000(0x40) or 11000000(0xC0)*/
935         else
936            m_excitation_data = 0x40;
937      }
938      else /* (OLD_FRAME_UNVOICED_FLAG == 0) */
939      {
940         // generate voiced samples here
941         /* US patent 4331836 Figure 14B shows, and logic would hold, that a pitch based chirp
942          * function has a chirp/peak and then a long chain of zeroes.
943          * The last entry of the chirp rom is at address 0b110011 (51d), the 52nd sample,
944          * and if the address reaches that point the ADDRESS incrementer is
945          * disabled, forcing all samples beyond 51d to be == 51d
946          */
947         if (m_pitch_count >= 51)
948            m_excitation_data = (INT8)m_coeff->chirptable[51];
949         else /*m_pitch_count < 51*/
950            m_excitation_data = (INT8)m_coeff->chirptable[m_pitch_count];
951      }
952
953      // Update LFSR *20* times every sample (once per T cycle), like patent shows
954   for (i=0; i<20; i++)
955   {
956      bitout = ((m_RNG >> 12) & 1) ^
957            ((m_RNG >>  3) & 1) ^
958            ((m_RNG >>  2) & 1) ^
959            ((m_RNG >>  0) & 1);
960      m_RNG <<= 1;
961      m_RNG |= bitout;
962   }
963      this_sample = lattice_filter(); /* execute lattice filter */
935964#ifdef DEBUG_GENERATION_VERBOSE
936         //fprintf(stderr,"C:%01d; ",m_subcycle);
937         fprintf(stderr,"IP:%01d PC:%02d X:%04d E:%03d P:%03d Pc:%03d ",m_IP, m_PC, m_excitation_data, m_current_energy, m_current_pitch, m_pitch_count);
938         //fprintf(stderr,"X:%04d E:%03d P:%03d Pc:%03d ", m_excitation_data, m_current_energy, m_current_pitch, m_pitch_count);
939         for (i=0; i<10; i++)
940            fprintf(stderr,"K%d:%04d ", i+1, m_current_k[i]);
941         fprintf(stderr,"Out:%06d ", this_sample);
942//#ifdef PERFECT_INTERPOLATION_HACK
943//         fprintf(stderr,"%d%d%d%d",m_old_zpar,m_zpar,m_old_uv_zpar,m_uv_zpar);
944//#else
945//         fprintf(stderr,"x%dx%d",m_zpar,m_uv_zpar);
946//#endif
947         fprintf(stderr,"\n");
965      //fprintf(stderr,"C:%01d; ",m_subcycle);
966      fprintf(stderr,"IP:%01d PC:%02d X:%04d E:%03d P:%03d Pc:%03d ",m_IP, m_PC, m_excitation_data, m_current_energy, m_current_pitch, m_pitch_count);
967      //fprintf(stderr,"X:%04d E:%03d P:%03d Pc:%03d ", m_excitation_data, m_current_energy, m_current_pitch, m_pitch_count);
968      for (i=0; i<10; i++)
969         fprintf(stderr,"K%d:%04d ", i+1, m_current_k[i]);
970      fprintf(stderr,"Out:%06d", this_sample);
971      fprintf(stderr,"\n");
948972#endif
949         /* next, force result to 14 bits (since its possible that the addition at the final (k1) stage of the lattice overflowed) */
950         while (this_sample > 16383) this_sample -= 32768;
951         while (this_sample < -16384) this_sample += 32768;
952         if (m_digital_select == 0) // analog SPK pin output is only 8 bits, with clipping
953            buffer[buf_count] = clip_analog(this_sample);
954         else // digital I/O pin output is 12 bits
955         {
973      /* next, force result to 14 bits (since its possible that the addition at the final (k1) stage of the lattice overflowed) */
974      while (this_sample > 16383) this_sample -= 32768;
975      while (this_sample < -16384) this_sample += 32768;
976      if (m_digital_select == 0) // analog SPK pin output is only 8 bits, with clipping
977         buffer[buf_count] = clip_analog(this_sample);
978      else // digital I/O pin output is 12 bits
979      {
956980#ifdef ALLOW_4_LSB
957            // input:  ssss ssss ssss ssss ssnn nnnn nnnn nnnn
958            // N taps:                       ^                 = 0x2000;
959            // output: ssss ssss ssss ssss snnn nnnn nnnn nnnN
960            buffer[buf_count] = (this_sample<<1)|((this_sample&0x2000)>>13);
981         // input:  ssss ssss ssss ssss ssnn nnnn nnnn nnnn
982         // N taps:                       ^                 = 0x2000;
983         // output: ssss ssss ssss ssss snnn nnnn nnnn nnnN
984         buffer[buf_count] = (this_sample<<1)|((this_sample&0x2000)>>13);
961985#else
962            this_sample &= ~0xF;
963            // input:  ssss ssss ssss ssss ssnn nnnn nnnn 0000
964            // N taps:                       ^^ ^^^            = 0x3E00;
965            // output: ssss ssss ssss ssss snnn nnnn nnnN NNNN
966            buffer[buf_count] = (this_sample<<1)|((this_sample&0x3E00)>>9);
986         this_sample &= ~0xF;
987         // input:  ssss ssss ssss ssss ssnn nnnn nnnn 0000
988         // N taps:                       ^^ ^^^            = 0x3E00;
989         // output: ssss ssss ssss ssss snnn nnnn nnnN NNNN
990         buffer[buf_count] = (this_sample<<1)|((this_sample&0x3E00)>>9);
967991#endif
968         }
969         // Update all counts
992      }
993      // Update all counts
970994
971         m_subcycle++;
972         if ((m_subcycle == 2) && (m_PC == 12)) // RESETF3
973         {
974            /* Circuit 412 in the patent acts a reset, resetting the pitch counter to 0
975            * if INHIBIT was true during the most recent frame transition.
976            * The exact time this occurs is betwen IP=7, PC=12 sub=0, T=t12
977            * and m_IP = 0, PC=0 sub=0, T=t12, a period of exactly 20 cycles,
978            * which overlaps the time OLDE and OLDP are updated at IP=7 PC=12 T17
979            * (and hence INHIBIT itself 2 t-cycles later). We do it here because it is
980            * convenient and should make no difference in output.
981            */
982            if ((m_IP == 7)&&(m_inhibit==1)) m_pitch_zero = 1;
983            if ((m_IP == 0)&&(m_pitch_zero==1)) m_pitch_zero = 0;
984            if (m_IP == 7) // RESETL4
985            {
986               // Latch OLDE and OLDP
987               OLD_FRAME_SILENCE_FLAG = NEW_FRAME_SILENCE_FLAG; // m_OLDE
988               OLD_FRAME_UNVOICED_FLAG = NEW_FRAME_UNVOICED_FLAG; // m_OLDP
989               /* if TALK was clear last frame, halt speech now, since TALKD (latched from TALK on new frame) just went inactive. */
990#ifdef DEBUG_GENERATION
991               fprintf(stderr,"RESETL4, about to update status: IP=%d, PC=%d, subcycle=%d, m_SPEN=%d, m_TALK=%d, m_TALKD=%d\n", m_IP, m_PC, m_subcycle, m_SPEN, m_TALK, m_TALKD);
992#endif
993#ifdef DEBUG_GENERATION
994               if (m_TALK == 0)
995                  fprintf(stderr,"tms5220_process: processing frame: TALKD = 0 caused by stop frame or buffer empty, halting speech.\n");
996#endif
997               m_TALKD = m_TALK; // TALKD is latched from TALK
998               update_fifo_status_and_ints(); // to trigger an interrupt if TALK_STATUS is now inactive
999               m_TALK = m_SPEN; // TALK is latched from SPEN
1000#ifdef DEBUG_GENERATION
1001               fprintf(stderr,"RESETL4, status updated: IP=%d, PC=%d, subcycle=%d, m_SPEN=%d, m_TALK=%d, m_TALKD=%d\n", m_IP, m_PC, m_subcycle, m_SPEN, m_TALK, m_TALKD);
1002#endif
1003            }
1004            m_subcycle = m_subc_reload;
1005            m_PC = 0;
1006            m_IP++;
1007            m_IP&=0x7;
1008         }
1009         else if (m_subcycle == 3)
1010         {
1011            m_subcycle = m_subc_reload;
1012            m_PC++;
1013         }
1014         m_pitch_count++;
1015         if ((m_pitch_count >= m_current_pitch)||(m_pitch_zero == 1)) m_pitch_count = 0;
1016         m_pitch_count &= 0x1FF;
995      m_subcycle++;
996      if ((m_subcycle == 2) && (m_PC == 12))
997      {
998         /* Circuit 412 in the patent acts a reset, resetting the pitch counter to 0
999          * if INHIBIT was true during the most recent frame transition.
1000          * The exact time this occurs is betwen IP=7, PC=12 sub=0, T=t12
1001          * and m_IP = 0, PC=0 sub=0, T=t12, a period of exactly 20 cycles,
1002          * which overlaps the time OLDE and OLDP are updated at IP=7 PC=12 T17
1003          * (and hence INHIBIT itself 2 t-cycles later). We do it here because it is
1004          * convenient and should make no difference in output.
1005          */
1006         if ((m_IP == 7)&&(m_inhibit==1)) m_pitch_count = 0;
1007         m_subcycle = m_subc_reload;
1008         m_PC = 0;
1009         m_IP++;
1010         m_IP&=0x7;
10171011      }
1018      else // m_TALKD == 0
1012      else if (m_subcycle == 3)
10191013      {
1020         m_subcycle++;
1021         if ((m_subcycle == 2) && (m_PC == 12)) // RESETF3
1022         {
1023            if (m_IP == 7) // RESETL4
1024            {
1025               m_TALKD = m_TALK; // TALKD is latched from TALK
1026               m_TALK = m_SPEN; // TALK is latched from SPEN
1027            }
1028            m_subcycle = m_subc_reload;
1029            m_PC = 0;
1030            m_IP++;
1031            m_IP&=0x7;
1032         }
1033         else if (m_subcycle == 3)
1034         {
1035            m_subcycle = m_subc_reload;
1036            m_PC++;
1037         }
1038         buffer[buf_count] = -1; /* should be just -1; actual chip outputs -1 every idle sample; (cf note in data sheet, p 10, table 4) */
1014         m_subcycle = m_subc_reload;
1015         m_PC++;
10391016      }
1040   buf_count++;
1041   size--;
1017      m_pitch_count++;
1018      if (m_pitch_count >= m_current_pitch) m_pitch_count = 0;
1019      m_pitch_count &= 0x1FF;
1020      buf_count++;
1021      size--;
10421022   }
1023
1024empty:
1025
1026   while (size > 0)
1027   {
1028      m_subcycle++;
1029      if ((m_subcycle == 2) && (m_PC == 12))
1030      {
1031         m_subcycle = m_subc_reload;
1032         m_PC = 0;
1033         m_IP++;
1034         m_IP&=0x7;
1035      }
1036      else if (m_subcycle == 3)
1037      {
1038         m_subcycle = m_subc_reload;
1039         m_PC++;
1040      }
1041      buffer[buf_count] = -1; /* should be just -1; actual chip outputs -1 every idle sample; (cf note in data sheet, p 10, table 4) */
1042      buf_count++;
1043      size--;
1044   }
10431045}
10441046
10451047/**********************************************************************************************
r249051r249052
11801182
11811183void tms5220_device::process_command(unsigned char cmd)
11821184{
1183   int i;
11841185#ifdef DEBUG_COMMAND_DUMP
11851186      fprintf(stderr,"process_command called with parameter %02X\n",cmd);
11861187#endif
r249051r249052
11881189      switch (cmd & 0x70)
11891190      {
11901191      case 0x10 : /* read byte */
1191         if (TALK_STATUS == 0) /* TALKST must be clear for RDBY */
1192         if (m_talk_status == 0) /* TALKST must be clear for RDBY */
11921193         {
11931194            if (m_schedule_dummy_read)
11941195            {
r249051r249052
12101211      break;
12111212
12121213      case 0x30 : /* read and branch */
1213         if (TALK_STATUS == 0) /* TALKST must be clear for RB */
1214         if (m_talk_status == 0) /* TALKST must be clear for RB */
12141215         {
12151216#ifdef VERBOSE
1216            fprintf(stderr,"read and branch command received\n");
1217            logerror("read and branch command received\n");
12171218#endif
12181219            m_RDB_flag = FALSE;
12191220            if (m_speechrom)
r249051r249052
12221223         break;
12231224
12241225      case 0x40 : /* load address */
1225         if (TALK_STATUS == 0) /* TALKST must be clear for LA */
1226         if (m_talk_status == 0) /* TALKST must be clear for LA */
12261227         {
12271228            /* tms5220 data sheet says that if we load only one 4-bit nibble, it won't work.
12281229               This code does not care about this. */
r249051r249052
12391240            if (m_speechrom)
12401241               m_speechrom->read(1);
12411242         }
1242         m_SPEN = 1;
1243#ifdef FAST_START_HACK
1244         m_TALK = 1;
1245#endif
1246         m_DDIS = 0;
1247         m_zpar = 1; // zero all the parameters
1248         m_uv_zpar = 1; // zero k4-k10 as well
1249         m_OLDE = 1; // 'silence/zpar' frames are zero energy
1250         m_OLDP = 1; // 'silence/zpar' frames are zero pitch
1251#ifdef PERFECT_INTERPOLATION_HACK
1252         m_old_zpar = 1; // zero all the old parameters
1253         m_old_uv_zpar = 1; // zero old k4-k10 as well
1254#endif
1255         // following is semi-hack but matches idle state observed on chip
1243         m_speaking_now = 1;
1244         m_speak_external = 0;
1245         m_talk_status = 1;  /* start immediately */
1246         /* clear out variables before speaking */
1247         // TODO: similar to the victory case described above, but for VSM speech
1248         m_subcycle = m_subc_reload;
1249         m_PC = 0;
1250         m_IP = reload_table[m_c_variant_rate&0x3];
12561251         m_new_frame_energy_idx = 0;
12571252         m_new_frame_pitch_idx = 0;
1253         int i;
12581254         for (i = 0; i < 4; i++)
12591255            m_new_frame_k_idx[i] = 0;
12601256         for (i = 4; i < 7; i++)
r249051r249052
12641260         break;
12651261
12661262      case 0x60 : /* speak external */
1267         // SPKEXT going active activates SPKEE which clears the fifo
1263         //SPKEXT going active activates SPKEE which clears the fifo
12681264         m_fifo_head = m_fifo_tail = m_fifo_count = m_fifo_bits_taken = 0;
1269         // SPEN is enabled when the fifo passes half full (falling edge of BL signal)
1270         m_DDIS = 1;
1271         m_zpar = 1; // zero all the parameters
1272         m_uv_zpar = 1; // zero k4-k10 as well
1273         m_OLDE = 1; // 'silence/zpar' frames are zero energy
1274         m_OLDP = 1; // 'silence/zpar' frames are zero pitch
1275#ifdef PERFECT_INTERPOLATION_HACK
1276         m_old_zpar = 1; // zero all the old parameters
1277         m_old_uv_zpar = 1; // zero old k4-k10 as well
1278#endif
1279         // following is semi-hack but matches idle state observed on chip
1280         m_new_frame_energy_idx = 0;
1281         m_new_frame_pitch_idx = 0;
1282         for (i = 0; i < 4; i++)
1283            m_new_frame_k_idx[i] = 0;
1284         for (i = 4; i < 7; i++)
1285            m_new_frame_k_idx[i] = 0xF;
1286         for (i = 7; i < m_coeff->num_k; i++)
1287            m_new_frame_k_idx[i] = 0x7;
1265         m_speak_external = 1;
12881266         m_RDB_flag = FALSE;
12891267         break;
12901268
r249051r249052
13301308   m_IP = reload_table[m_c_variant_rate&0x3];
13311309
13321310   update_fifo_status_and_ints();
1333   if (m_DDIS && m_buffer_empty) goto ranout;
1311   if (!m_talk_status) goto ranout;
13341312
13351313   // attempt to extract the energy index
13361314   m_new_frame_energy_idx = extract_bits(m_coeff->energy_bits);
r249051r249052
13391317   fprintf(stderr," ");
13401318#endif
13411319   update_fifo_status_and_ints();
1342   if (m_DDIS && m_buffer_empty) goto ranout;
1320   if (!m_talk_status) goto ranout;
13431321   // if the energy index is 0 or 15, we're done
13441322   if ((m_new_frame_energy_idx == 0) || (m_new_frame_energy_idx == 15))
13451323      return;
r249051r249052
13591337   fprintf(stderr," ");
13601338#endif
13611339   update_fifo_status_and_ints();
1362   if (m_DDIS && m_buffer_empty) goto ranout;
1340   if (!m_talk_status) goto ranout;
13631341   // if this is a repeat frame, just do nothing, it will reuse the old coefficients
13641342   if (rep_flag)
13651343      return;
r249051r249052
13731351      fprintf(stderr," ");
13741352#endif
13751353      update_fifo_status_and_ints();
1376      if (m_DDIS && m_buffer_empty) goto ranout;
1354      if (!m_talk_status) goto ranout;
13771355   }
13781356
13791357   // if the pitch index was zero, we only need 4 K's...
r249051r249052
13921370      fprintf(stderr," ");
13931371#endif
13941372      update_fifo_status_and_ints();
1395      if (m_DDIS && m_buffer_empty) goto ranout;
1373      if (!m_talk_status) goto ranout;
13961374   }
1397#ifdef DEBUG_PARSE_FRAME_DUMP
1398         fprintf(stderr,"\n");
1399#endif
14001375#ifdef VERBOSE
1401   if (m_DDIS)
1402      fprintf(stderr,"Parsed a frame successfully in FIFO - %d bits remaining\n", (m_fifo_count*8)-(m_fifo_bits_taken));
1376   if (m_speak_external)
1377      logerror("Parsed a frame successfully in FIFO - %d bits remaining\n", (m_fifo_count*8)-(m_fifo_bits_taken));
14031378   else
1404      fprintf(stderr,"Parsed a frame successfully in ROM\n");
1379      logerror("Parsed a frame successfully in ROM\n");
14051380#endif
14061381   return;
14071382
14081383   ranout:
14091384#ifdef DEBUG_FRAME_ERRORS
1410   fprintf(stderr,"Ran out of bits on a parse!\n");
1385   logerror("Ran out of bits on a parse!\n");
14111386#endif
14121387   return;
14131388}
r249051r249052
14221397{
14231398   if (!TMS5220_IS_52xx) return; // bail out if not a 52xx chip, since there's no int pin
14241399#ifdef DEBUG_PIN_READS
1425   fprintf(stderr,"irq pin set to state %d\n", state);
1400   logerror("irq pin set to state %d\n", state);
14261401#endif
14271402   if (!m_irq_handler.isnull() && state != m_irq_pin)
14281403      m_irq_handler(!state);
r249051r249052
14391414{
14401415   int state = ready_read();
14411416#ifdef DEBUG_PIN_READS
1442   fprintf(stderr,"ready pin set to state %d\n", state);
1417   logerror("ready pin set to state %d\n", state);
14431418#endif
14441419   if (!m_readyq_handler.isnull() && state != m_ready_pin)
14451420      m_readyq_handler(!state);
r249051r249052
15391514
15401515   /* initialize the chip state */
15411516   /* Note that we do not actually clear IRQ on start-up : IRQ is even raised if m_buffer_empty or m_buffer_low are 0 */
1542   m_SPEN = m_DDIS = m_TALK = m_TALKD = m_previous_TALK_STATUS = m_irq_pin = m_ready_pin = 0;
1517   m_speaking_now = m_speak_external = m_talk_status = m_irq_pin = m_ready_pin = 0;
15431518   set_interrupt_state(0);
15441519   update_ready_state();
15451520   m_buffer_empty = m_buffer_low = 1;
r249051r249052
15501525#ifdef PERFECT_INTERPOLATION_HACK
15511526   m_old_frame_energy_idx = m_old_frame_pitch_idx = 0;
15521527   memset(m_old_frame_k_idx, 0, sizeof(m_old_frame_k_idx));
1553   m_old_zpar = 0;
15541528#endif
1555   m_new_frame_energy_idx = m_current_energy =  m_previous_energy = 0;
1556   m_new_frame_pitch_idx = m_current_pitch = 0;
1557   m_zpar = m_uv_zpar = 0;
1529   m_new_frame_energy_idx = m_current_energy = m_target_energy = m_previous_energy = 0;
1530   m_new_frame_pitch_idx = m_current_pitch = m_target_pitch = 0;
15581531   memset(m_new_frame_k_idx, 0, sizeof(m_new_frame_k_idx));
15591532   memset(m_current_k, 0, sizeof(m_current_k));
1533   memset(m_target_k, 0, sizeof(m_target_k));
15601534
15611535   /* initialize the sample generators */
15621536   m_inhibit = 1;
r249051r249052
16001574            /* Write */
16011575            /* bring up to date first */
16021576#ifdef DEBUG_IO_READY
1603            fprintf(stderr,"Serviced write: %02x\n", m_write_latch);
1577            logerror("Serviced write: %02x\n", m_write_latch);
16041578            //fprintf(stderr, "Processed write data: %02X\n", m_write_latch);
16051579#endif
16061580            m_stream->update();
r249051r249052
16361610   m_true_timing = 1;
16371611   state &= 0x01;
16381612#ifdef DEBUG_RS_WS
1639   fprintf(stderr,"/RS written with data: %d\n", state);
1613   logerror("/RS written with data: %d\n", state);
16401614#endif
16411615   new_val = (m_rs_ws & 0x01) | (state<<1);
16421616   if (new_val != m_rs_ws)
r249051r249052
16491623#ifdef DEBUG_RS_WS
16501624         else
16511625            /* illegal */
1652            fprintf(stderr,"tms5220_rs_w: illegal\n");
1626            logerror("tms5220_rs_w: illegal\n");
16531627#endif
16541628         return;
16551629      }
r249051r249052
16671641      {
16681642         /* high to low - schedule ready cycle */
16691643#ifdef DEBUG_RS_WS
1670         fprintf(stderr,"Scheduling ready cycle for /RS...\n");
1644         logerror("Scheduling ready cycle for /RS...\n");
16711645#endif
16721646         /* upon /RS being activated, /READY goes inactive after 100 nsec from data sheet, through 3 asynchronous gates on patent. This is effectively within one clock, so we immediately set io_ready to 0 and activate the callback. */
16731647         m_io_ready = 0;
r249051r249052
16881662   m_true_timing = 1;
16891663   state &= 0x01;
16901664#ifdef DEBUG_RS_WS
1691   fprintf(stderr,"/WS written with data: %d\n", state);
1665   logerror("/WS written with data: %d\n", state);
16921666#endif
16931667   new_val = (m_rs_ws & 0x02) | (state<<0);
16941668   if (new_val != m_rs_ws)
r249051r249052
17011675#ifdef DEBUG_RS_WS
17021676         else
17031677            /* illegal */
1704            fprintf(stderr,"tms5220_ws_w: illegal\n");
1678            logerror("tms5220_ws_w: illegal\n");
17051679#endif
17061680         return;
17071681      }
r249051r249052
17191693      {
17201694         /* high to low - schedule ready cycle */
17211695#ifdef DEBUG_RS_WS
1722         fprintf(stderr,"Scheduling ready cycle for /WS...\n");
1696         logerror("Scheduling ready cycle for /WS...\n");
17231697#endif
17241698         /* upon /WS being activated, /READY goes inactive after 100 nsec from data sheet, through 3 asynchronous gates on patent. This is effectively within one clock, so we immediately set io_ready to 0 and activate the callback. */
17251699         m_io_ready = 0;
r249051r249052
17521726   if (space.debugger_access()) return;
17531727
17541728#ifdef DEBUG_RS_WS
1755   fprintf(stderr,"tms5220_data_w: data %02x\n", data);
1729   logerror("tms5220_data_w: data %02x\n", data);
17561730#endif
17571731   if (!m_true_timing)
17581732   {
r249051r249052
17651739      /* actually in a write ? */
17661740#ifdef DEBUG_RS_WS
17671741      if (!(m_rs_ws == 0x02))
1768         fprintf(stderr,"tms5220_data_w: data written outside ws, status: %02x!\n", m_rs_ws);
1742         logerror("tms5220_data_w: data written outside ws, status: %02x!\n", m_rs_ws);
17691743#endif
17701744      m_write_latch = data;
17711745   }
r249051r249052
17971771         return m_read_latch;
17981772#ifdef DEBUG_RS_WS
17991773      else
1800         fprintf(stderr,"tms5220_status_r: data read outside rs!\n");
1774         logerror("tms5220_status_r: data read outside rs!\n");
18011775#endif
18021776      return 0xff;
18031777   }
trunk/src/emu/sound/tms5220.h
r249051r249052
105105
106106
107107   /* these contain global status bits */
108   UINT8 m_previous_TALK_STATUS;      /* this is the OLD value of TALK_STATUS (i.e. previous value of m_SPEN|m_TALKD), needed for generating interrupts on a falling TALK_STATUS edge */
109   UINT8 m_SPEN;             /* set on speak(or speak external and BL falling edge) command, cleared on stop command, reset command, or buffer out */
110   UINT8 m_DDIS;             /* If 1, DDIS is 1, i.e. Speak External command in progress, writes go to FIFO. */
111   UINT8 m_TALK;             /* set on SPEN & RESETL4(pc12->pc0 transition), cleared on stop command or reset command */
112#define TALK_STATUS (m_SPEN|m_TALKD)
113   UINT8 m_TALKD;            /* TALK(TCON) value, latched every RESETL4 */
108   UINT8 m_speaking_now;     /* True only if actual speech is being generated right now. Is set when a speak vsm command happens OR when speak external happens and buffer low becomes nontrue; Is cleared when speech halts after the last stop frame or the last frame after talk status is otherwise cleared.*/
109   UINT8 m_speak_external;   /* If 1, DDIS is 1, i.e. Speak External command in progress, writes go to FIFO. */
110   UINT8 m_talk_status;      /* If 1, TS status bit is 1, i.e. speak or speak external is in progress and we have not encountered a stop frame yet; talk_status differs from speaking_now in that speaking_now is set as soon as a speak or speak external command is started; talk_status does NOT go active until after 8 bytes are written to the fifo on a speak external command, otherwise the two are the same. TS is cleared by 3 things: 1. when a STOP command has just been processed as a new frame in the speech stream; 2. if the fifo runs out in speak external mode; 3. on power-up/during a reset command; When it gets cleared, speak_external is also cleared, an interrupt is generated, and speaking_now will be cleared when the next frame starts. */
114111   UINT8 m_buffer_low;       /* If 1, FIFO has less than 8 bytes in it */
115112   UINT8 m_buffer_empty;     /* If 1, FIFO is empty */
116113   UINT8 m_irq_pin;          /* state of the IRQ pin (output) */
r249051r249052
135132   INT16 m_current_energy;
136133   INT16 m_current_pitch;
137134   INT16 m_current_k[10];
135
136   INT16 m_target_energy;
137   INT16 m_target_pitch;
138   INT16 m_target_k[10];
138139#else
139140   UINT8 m_old_frame_energy_idx;
140141   UINT8 m_old_frame_pitch_idx;
141142   UINT8 m_old_frame_k_idx[10];
142   UINT8 m_old_zpar;
143   UINT8 m_old_uv_zpar;
144143
145144   INT32 m_current_energy;
146145   INT32 m_current_pitch;
147146   INT32 m_current_k[10];
147
148   INT32 m_target_energy;
149   INT32 m_target_pitch;
150   INT32 m_target_k[10];
148151#endif
149152
150153   UINT16 m_previous_energy; /* needed for lattice filter to match patent */
r249051r249052
152155   UINT8 m_subcycle;         /* contains the current subcycle for a given PC: 0 is A' (only used on SPKSLOW mode on 51xx), 1 is A, 2 is B */
153156   UINT8 m_subc_reload;      /* contains 1 for normal speech, 0 when SPKSLOW is active */
154157   UINT8 m_PC;               /* current parameter counter (what param is being interpolated), ranges from 0 to 12 */
155   /* NOTE: the interpolation period counts 1,2,3,4,5,6,7,0 for divide by 8,8,8,4,4,2,2,1 */
158   /* TODO/NOTE: the current interpolation period, counts 1,2,3,4,5,6,7,0 for divide by 8,8,8,4,4,2,2,1 */
156159   UINT8 m_IP;               /* the current interpolation period */
157160   UINT8 m_inhibit;          /* If 1, interpolation is inhibited until the DIV1 period */
158   UINT8 m_uv_zpar;          /* If 1, zero k5 thru k10 coefficients */
159   UINT8 m_zpar;             /* If 1, zero ALL parameters. */
160   UINT8 m_pitch_zero;       /* circuit 412; pitch is forced to zero under certain circumstances */
161161   UINT8 m_c_variant_rate;    /* only relevant for tms5220C's multi frame rate feature; is the actual 4 bit value written on a 0x2* or 0x0* command */
162162   UINT16 m_pitch_count;     /* pitch counter; provides chirp rom address */
163163
164164   INT32 m_u[11];
165165   INT32 m_x[10];
166166
167   UINT16 m_RNG;             /* the random noise generator configuration is: 1 + x + x^3 + x^4 + x^13 TODO: no it isn't */
167   UINT16 m_RNG;             /* the random noise generator configuration is: 1 + x + x^3 + x^4 + x^13 */
168168   INT16 m_excitation_data;
169169
170170   /* R Nabet : These have been added to emulate speech Roms */
trunk/src/mame/arcade.lst
r249051r249052
336336mimonkey        // (c) 1982 Universal Video Games (US Copyright Office info - http://cocatalog.loc.gov)
337337mimonsco        // (c) 1982 bootleg
338338mimonscr        // (c) 1982 bootleg
339mimonscra       // (c) 1982 bootleg
339mimonscra      // (c) 1982 bootleg
340340scobra          // GX316 (c) 1981 Konami
341341scobras         // GX316 (c) 1981 Stern
342342scobrase        // GX316 (c) 1981 Sega
r249051r249052
30403040avengers        //  2/1987 (c) 1987 (US)
30413041avengers2       //  2/1987 (c) 1987 (US)
30423042buraiken        //  2/1987 (c) 1987 (Japan)
3043buraikenb       //  2/1987 (c) 1987 (Japan)
3043buraikenb      //  2/1987 (c) 1987 (Japan)
30443044bionicc         //  3/1987 (c) 1987 (Euro)
30453045bionicc1        //  3/1987 (c) 1987 (US)
30463046bionicc2        //  3/1987 (c) 1987 (US)
r249051r249052
35143514sfa3            // 04/09/1998 (c) 1998 (USA)
35153515sfa3u           // 04/09/1998 (c) 1998 (USA)
35163516sfa3ur1         // 29/06/1998 (c) 1998 (USA)
3517sfa3us          // 16/06/1998 (c) 1998 (USA)
3517sfa3us         // 16/06/1998 (c) 1998 (USA)
35183518sfa3h           // 04/09/1998 (c) 1998 (Hispanic)
35193519sfa3hr1         // 29/06/1998 (c) 1998 (Hispanic)
35203520sfa3b           // 29/06/1998 (c) 1998 (Brazil)
r249051r249052
38453845soulclbrub      // 1998.?? Soul Calibur (US, SOC13/VER.B)
38463846soulclbrjb      // 1998.?? Soul Calibur (Japan, SOC11/VER.B)
38473847soulclbrja      // 1998.?? Soul Calibur (Japan, SOC11/VER.A2)
3848technodr        // 1998.07 Techno Drive
3848technodr      // 1998.07 Techno Drive
38493849mdhorse         // 1998.11 Derby Quiz My Dream Horse (Japan, MDH1/VER.A2)
38503850            // 1998.12 Attack Pla Rail
38513851tenkomor        // 1998.?? Tenkomori Shooting (Asia, TKM2/VER.A1)
r249051r249052
82208220nbajamte3       // (c) 1994 Midway
82218221nbajamten       // (c) 1995 Midway
82228222revx            // (c) 1994 Midway
8223revxp5          // (c) 1994 Midway
82248223mk3             // (c) 1994 Midway
82258224mk3r20          // (c) 1994 Midway
82268225mk3r10          // (c) 1994 Midway
r249051r249052
95369535spcforce        // (c) 1980 Venture Line
95379536spcforc2        // bootleg
95389537meteor          // (c) 1981 Venture Line
9539meteors         // (c) 1981 Amusement World
9538meteors         // (c) 1981 Amusement World
95409539looping         // (c) 1982 Video Games GmbH
95419540loopingv        // (c) 1982 Video Games GmbH (Venture Line license)
95429541loopingva       // (c) 1982 Video Games GmbH (Venture Line license)
r249051r249052
3218532184alinvade
3218632185
3218732186joystand   // 1997 Yuvo
32188chexx83    // 1983 ICE
32189faceoffh   // 1983 SoftLogic / Entertainment Enterprises
32187faceoffh   // 1993 SoftLogic / Entertainment Enterprises
trunk/src/mame/audio/targ.c
r249051r249052
3636void exidy_state::adjust_sample(UINT8 freq)
3737{
3838   m_tone_freq = freq;
39
39   
4040   if (!m_samples->playing(3))
4141   {
4242      m_samples->set_volume(3, 0);
4343      m_samples->start_raw(3, sine_wave, 32, 1000, true);
4444   }
45
45   
4646   if ((m_tone_freq == 0xff) || (m_tone_freq == 0x00))
4747      m_samples->set_volume(3, 0);
4848   else
trunk/src/mame/drivers/ajax.c
r249051r249052
182182   MCFG_SCREEN_ADD("screen", RASTER)
183183   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240)
184184//  6MHz dotclock is more realistic, however needs drawing updates. replace when ready
185//  MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
185//   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
186186   MCFG_SCREEN_UPDATE_DRIVER(ajax_state, screen_update_ajax)
187187   MCFG_SCREEN_PALETTE("palette")
188188
trunk/src/mame/drivers/aliens.c
r249051r249052
209209   MCFG_SCREEN_ADD("screen", RASTER)
210210   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240) // measured 59.17
211211//  6MHz dotclock is more realistic, however needs drawing updates. replace when ready
212//  MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
212//   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
213213   MCFG_SCREEN_UPDATE_DRIVER(aliens_state, screen_update_aliens)
214214   MCFG_SCREEN_PALETTE("palette")
215215
trunk/src/mame/drivers/blockhl.c
r249051r249052
77    Original driver by Nicola Salmoria
88
99    Notes:
10        - To advance to the next screen in service mode, press P1 and P2 start
11          simultaneously
10      - To advance to the next screen in service mode, press P1 and P2 start
11        simultaneously
1212
13    Todo:
14        - How is the sound irq cleared (currently using HOLD_LINE)?
15        - Do bit 2 and 7 of the bankswitch port have any meaning?
16        - Verify raw screen parameters
13   Todo:
14      - How is the sound irq cleared (currently using HOLD_LINE)?
15      - Do bit 2 and 7 of the bankswitch port have any meaning?
16      - Verify raw screen parameters
1717
1818*******************************************************************************/
1919
r249051r249052
285285   MCFG_SCREEN_ADD("screen", RASTER)
286286   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240)
287287//  6MHz dotclock is more realistic, however needs drawing updates. replace when ready
288//  MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
288//   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
289289   MCFG_SCREEN_UPDATE_DRIVER(blockhl_state, screen_update_blockhl)
290290   MCFG_SCREEN_PALETTE("palette")
291291
r249051r249052
318318//**************************************************************************
319319
320320ROM_START( blockhl )
321   ROM_REGION( 0x10000, "maincpu", 0 ) // code + banked roms
321   ROM_REGION( 0x10000, "maincpu", 0 )   // code + banked roms
322322   ROM_LOAD( "973l02.e21", 0x00000, 0x10000, CRC(e14f849a) SHA1(d44cf178cc98998b72ed32c6e20b6ebdf1f97579) )
323323
324   ROM_REGION( 0x08000, "audiocpu", 0 )    // 32k for the sound CPU
324   ROM_REGION( 0x08000, "audiocpu", 0 )   // 32k for the sound CPU
325325   ROM_LOAD( "973d01.g6",  0x00000, 0x08000, CRC(eeee9d92) SHA1(6c6c324b1f6f4fba0aa12e0d1fc5dbab133ef669) )
326326
327   ROM_REGION( 0x20000, "k052109", 0 ) // tiles
327   ROM_REGION( 0x20000, "k052109", 0 )   // tiles
328328   ROM_LOAD32_BYTE( "973f07.k15", 0x00000, 0x08000, CRC(1a8cd9b4) SHA1(7cb7944d24ac51fa6b610542d9dec68697cacf0f) )
329329   ROM_LOAD32_BYTE( "973f08.k18", 0x00001, 0x08000, CRC(952b51a6) SHA1(017575738d444b688b137cad5611638d53be84f2) )
330330   ROM_LOAD32_BYTE( "973f09.k20", 0x00002, 0x08000, CRC(77841594) SHA1(e1bfdc5bb598d865868d578ef7faba8078becd7a) )
331331   ROM_LOAD32_BYTE( "973f10.k23", 0x00003, 0x08000, CRC(09039fab) SHA1(a9dea17aacf4484d21ef3b16470263447b51b6b5) )
332332
333   ROM_REGION( 0x20000, "k051960", 0 ) // sprites
333   ROM_REGION( 0x20000, "k051960", 0 )   // sprites
334334   ROM_LOAD32_BYTE( "973f06.k12", 0x00000, 0x08000, CRC(51acfdb6) SHA1(94d243f341b490684f5297d95d4835bd522ece35) )
335335   ROM_LOAD32_BYTE( "973f05.k9",  0x00001, 0x08000, CRC(4cfea298) SHA1(4772b5b99f5fd8174d8884bd84173512e1edabf4) )
336336   ROM_LOAD32_BYTE( "973f04.k7",  0x00002, 0x08000, CRC(69ca41bd) SHA1(9b0b1c888efd2f2d5525f14778e18fb4a7353eb6) )
337337   ROM_LOAD32_BYTE( "973f03.k4",  0x00003, 0x08000, CRC(21e98472) SHA1(8c697d369a1f57be0825c33b4e9107ce1b02a130) )
338338
339   ROM_REGION( 0x0100, "priority", 0 ) // priority encoder (not used)
339   ROM_REGION( 0x0100, "priority", 0 )   // priority encoder (not used)
340340   ROM_LOAD( "973a11.h10", 0x0000, 0x0100, CRC(46d28fe9) SHA1(9d0811a928c8907785ef483bfbee5445506b3ec8) )
341341ROM_END
342342
343343ROM_START( quarth )
344   ROM_REGION( 0x10000, "maincpu", 0 ) // code + banked roms
344   ROM_REGION( 0x10000, "maincpu", 0 )   // code + banked roms
345345   ROM_LOAD( "973j02.e21", 0x00000, 0x10000, CRC(27a90118) SHA1(51309385b93db29b9277d14252166c4ea1746303) )
346346
347   ROM_REGION( 0x08000, "audiocpu", 0 )    // 32k for the sound CPU
347   ROM_REGION( 0x08000, "audiocpu", 0 )   // 32k for the sound CPU
348348   ROM_LOAD( "973d01.g6",  0x00000, 0x08000, CRC(eeee9d92) SHA1(6c6c324b1f6f4fba0aa12e0d1fc5dbab133ef669) )
349349
350   ROM_REGION( 0x20000, "k052109", 0 ) // tiles
350   ROM_REGION( 0x20000, "k052109", 0 )   // tiles
351351   ROM_LOAD32_BYTE( "973e07.k15", 0x00000, 0x08000, CRC(0bd6b0f8) SHA1(6c59cf637354fe2df424eaa89feb9c1bc1f66a92) )
352352   ROM_LOAD32_BYTE( "973e08.k18", 0x00001, 0x08000, CRC(104d0d5f) SHA1(595698911513113d01e5b565f5b073d1bd033d3f) )
353353   ROM_LOAD32_BYTE( "973e09.k20", 0x00002, 0x08000, CRC(bd3a6f24) SHA1(eb45db3a6a52bb2b25df8c2dace877e59b4130a6) )
354354   ROM_LOAD32_BYTE( "973e10.k23", 0x00003, 0x08000, CRC(cf5e4b86) SHA1(43348753894c1763b26dbfc70245dac92048db8f) )
355355
356   ROM_REGION( 0x20000, "k051960", 0 ) // sprites
356   ROM_REGION( 0x20000, "k051960", 0 )   // sprites
357357   ROM_LOAD32_BYTE( "973e06.k12", 0x00000, 0x08000, CRC(0d58af85) SHA1(2efd661d614fb305a14cfe1aa4fb17714f215d4f) )
358358   ROM_LOAD32_BYTE( "973e05.k9",  0x00001, 0x08000, CRC(15d822cb) SHA1(70ecad5e0a461df0da6e6eb23f43a7b643297f0d) )
359359   ROM_LOAD32_BYTE( "973e04.k7",  0x00002, 0x08000, CRC(d70f4a2c) SHA1(25f835a17bacf2b8debb2eb8a3cff90cab3f402a) )
360360   ROM_LOAD32_BYTE( "973e03.k4",  0x00003, 0x08000, CRC(2c5a4b4b) SHA1(e2991dd78b9cd96cf93ebd6de0d4e060d346ab9c) )
361361
362   ROM_REGION( 0x0100, "priority", 0 ) // priority encoder (not used)
362   ROM_REGION( 0x0100, "priority", 0 )   // priority encoder (not used)
363363   ROM_LOAD( "973a11.h10", 0x0000, 0x0100, CRC(46d28fe9) SHA1(9d0811a928c8907785ef483bfbee5445506b3ec8) )
364364ROM_END
365365
trunk/src/mame/drivers/chexx.c
r249051r249052
1// license:BSD-3-Clause
2// copyright-holders:Luca Elia
3/***************************************************************************
4
5Electro-mechanical bubble hockey games:
6
7- Chexx (1983 version) by ICE
8  http://www.pinrepair.com/arcade/chexx.htm
9
10- Face-Off, an illegal? copy of Chexx
11  http://valker.us/gameroom/SegaFaceOff.htm
12  https://casetext.com/case/innovative-concepts-in-ent-v-entertainment-enter
13
14(Some sources indicate these may have been copied from a earlier Sega game called Face-Off)
15
16***************************************************************************/
17
18#include "emu.h"
19#include "cpu/m6502/m6502.h"
20#include "sound/ay8910.h"
21#include "sound/digitalk.h"
22#include "machine/6522via.h"
23#include "chexx.lh"
24
25#define MAIN_CLOCK XTAL_4MHz
26
27class chexx_state : public driver_device
28{
29public:
30   chexx_state(const machine_config &mconfig, device_type type, const char *tag)
31      : driver_device(mconfig, type, tag),
32         m_maincpu(*this, "maincpu"),
33         m_via(*this, "via6522"),
34         m_digitalker(*this, "digitalker"),
35         m_aysnd(*this, "aysnd")
36   {
37   }
38
39   // devices
40   required_device<cpu_device> m_maincpu;
41   required_device<via6522_device> m_via;
42   required_device<digitalker_device> m_digitalker;
43   optional_device<ay8910_device> m_aysnd; // only faceoffh
44
45   // vars
46   UINT8  m_port_a, m_port_b;
47   UINT8  m_bank;
48   UINT32 m_shift;
49   UINT8  m_lamp;
50   UINT8  m_ay_cmd, m_ay_data;
51
52   // callbacks
53   TIMER_DEVICE_CALLBACK_MEMBER(update);
54
55   // handlers
56   DECLARE_READ8_MEMBER(via_a_in);
57   DECLARE_READ8_MEMBER(via_b_in);
58
59   DECLARE_WRITE8_MEMBER(via_a_out);
60   DECLARE_WRITE8_MEMBER(via_b_out);
61
62   DECLARE_WRITE_LINE_MEMBER(via_ca2_out);
63   DECLARE_WRITE_LINE_MEMBER(via_cb1_out);
64   DECLARE_WRITE_LINE_MEMBER(via_cb2_out);
65   DECLARE_WRITE_LINE_MEMBER(via_irq_out);
66
67   DECLARE_READ8_MEMBER(input_r);
68
69   DECLARE_WRITE8_MEMBER(ay_w);
70   DECLARE_WRITE8_MEMBER(lamp_w);
71
72   // digitalker
73   void digitalker_set_bank(UINT8 bank);
74
75   // driver_device overrides
76   virtual void machine_start();
77   virtual void machine_reset();
78};
79
80
81// VIA
82
83READ8_MEMBER(chexx_state::via_a_in)
84{
85   UINT8 ret = 0;
86   logerror("%s: VIA read A: %02X\n", machine().describe_context(), ret);
87   return ret;
88}
89READ8_MEMBER(chexx_state::via_b_in)
90{
91   UINT8 ret = 0;
92   logerror("%s: VIA read B: %02X\n", machine().describe_context(), ret);
93   return ret;
94}
95
96WRITE8_MEMBER(chexx_state::via_a_out)
97{
98   m_port_a = data;    // multiplexer
99
100   m_digitalker->digitalker_data_w(space, 0, data, 0);
101
102//  logerror("%s: VIA write A = %02X\n", machine().describe_context(), data);
103}
104WRITE8_MEMBER(chexx_state::via_b_out)
105{
106   m_port_b = data;
107
108   digitalker_set_bank(data & 3);
109   m_digitalker->set_output_gain(0, BIT(data,2) ? 1.0f : 0.0f); // bit 2 controls the Digitalker output
110   coin_counter_w(machine(), 0, BIT(~data,3));
111   // bit 4 is EJECT
112   // bit 7 is related to speaker out
113
114//  logerror("%s: VIA write B = %02X\n", machine().describe_context(), data);
115}
116
117WRITE_LINE_MEMBER(chexx_state::via_ca2_out)
118{
119   m_digitalker->digitalker_0_cms_w(CLEAR_LINE);
120   m_digitalker->digitalker_0_cs_w(CLEAR_LINE);
121   m_digitalker->digitalker_0_wr_w(state ? ASSERT_LINE : CLEAR_LINE);
122
123//  logerror("%s: VIA write CA2 = %02X\n", machine().describe_context(), state);
124}
125WRITE_LINE_MEMBER(chexx_state::via_cb1_out)
126{
127//  logerror("%s: VIA write CB1 = %02X\n", machine().describe_context(), state);
128}
129WRITE_LINE_MEMBER(chexx_state::via_cb2_out)
130{
131   m_shift = ((m_shift << 1) & 0xffffff) | state;
132
133   // 7segs (score)
134   static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511
135
136   output_set_digit_value(0, patterns[(m_shift >> (16+4)) & 0xf]);
137   output_set_digit_value(1, patterns[(m_shift >> (16+0)) & 0xf]);
138
139   output_set_digit_value(2, patterns[(m_shift >>  (8+4)) & 0xf]);
140   output_set_digit_value(3, patterns[(m_shift >>  (8+0)) & 0xf]);
141
142   // Leds (period being played)
143   output_set_led_value(0, BIT(m_shift,2));
144   output_set_led_value(1, BIT(m_shift,1));
145   output_set_led_value(2, BIT(m_shift,0));
146
147//  logerror("%s: VIA write CB2 = %02X\n", machine().describe_context(), state);
148}
149WRITE_LINE_MEMBER(chexx_state::via_irq_out)
150{
151   m_maincpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
152//  logerror("%s: VIA write IRQ = %02X\n", machine().describe_context(), state);
153}
154
155READ8_MEMBER(chexx_state::input_r)
156{
157   UINT8 ret = ioport("DSW")->read();          // bits 0-3
158   UINT8 inp = ioport("INPUT")->read();        // bit 7 (multiplexed)
159
160   for (int i = 0; i < 8; ++i)
161      if ( ((~m_port_a) & (1 << i)) && ((~inp) & (1 << i)) )
162         ret &= 0x7f;
163
164   return ret;
165}
166
167// Chexx Memory Map
168
169static ADDRESS_MAP_START( chexx83_map, AS_PROGRAM, 8, chexx_state )
170   AM_RANGE(0x0000, 0x007f) AM_RAM AM_MIRROR(0x100) // 6810 - 128 x 8 static RAM
171   AM_RANGE(0x4000, 0x400f) AM_DEVREADWRITE("via6522", via6522_device, read, write)
172   AM_RANGE(0x8000, 0x8000) AM_READ(input_r)
173   AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION("maincpu", 0)
174ADDRESS_MAP_END
175
176// Face-Off Memory Map
177
178WRITE8_MEMBER(chexx_state::lamp_w)
179{
180   m_lamp = data;
181   output_set_lamp_value(0, BIT(m_lamp,0));
182   output_set_lamp_value(1, BIT(m_lamp,1));
183}
184
185WRITE8_MEMBER(chexx_state::ay_w)
186{
187   if (offset)
188   {
189      m_ay_data = data;
190      return;
191   }
192
193   if (m_ay_cmd == 0x00 && data == 0x03)
194   {
195      m_aysnd->address_w(space, offset, m_ay_data, mem_mask);
196//      logerror("%s: AY addr = %02X\n", machine().describe_context(), m_ay_data);
197   }
198   else if (m_ay_cmd == 0x00 && data == 0x02)
199   {
200      m_aysnd->data_w(space, offset, m_ay_data, mem_mask);
201//      logerror("%s: AY data = %02X\n", machine().describe_context(), m_ay_data);
202   }
203   m_ay_cmd = data;
204}
205
206static ADDRESS_MAP_START( faceoffh_map, AS_PROGRAM, 8, chexx_state )
207   AM_RANGE(0x0000, 0x007f) AM_RAM AM_MIRROR(0x100) // M58725P - 2KB
208   AM_RANGE(0x4000, 0x400f) AM_DEVREADWRITE("via6522", via6522_device, read, write)
209   AM_RANGE(0x8000, 0x8000) AM_READ(input_r)
210   AM_RANGE(0xa000, 0xa001) AM_WRITE(ay_w)
211   AM_RANGE(0xc000, 0xc000) AM_WRITE(lamp_w)
212   AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("maincpu", 0)
213ADDRESS_MAP_END
214
215// Inputs
216
217static INPUT_PORTS_START( chexx83 )
218   PORT_START("COIN")
219   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1   ) PORT_IMPULSE(1) // play anthem
220   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2   ) PORT_IMPULSE(1) // play anthem
221
222   PORT_START("INPUT")
223   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1  ) PORT_NAME("P1 Goal Sensor")
224   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2  ) PORT_NAME("P2 Goal Sensor")
225   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3  ) PORT_NAME("Puck Near Goal Sensors") // play "ohh" sample
226   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Boo Button")  // stop anthem, play "boo" sample, eject puck
227   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Boo Button")  // stop anthem, play "boo" sample, eject puck
228   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Puck Eject Ready Sensor")
229   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
230   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
231
232   PORT_START("DSW")
233   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2")
234   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
235   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
236   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
237   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
238   PORT_DIPNAME( 0x0c, 0x00, "Game Duration (mins)" ) PORT_DIPLOCATION("SW1:3,4")
239   PORT_DIPSETTING(    0x00, "2" ) // 40
240   PORT_DIPSETTING(    0x04, "3" ) // 60
241   PORT_DIPSETTING(    0x08, "4" ) // 80
242   PORT_DIPSETTING(    0x0c, "5" ) // 100
243   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )
244   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) // multiplexed inputs
245INPUT_PORTS_END
246
247// Machine
248
249void chexx_state::machine_start()
250{
251}
252
253void chexx_state::digitalker_set_bank(UINT8 bank)
254{
255   if (m_bank != bank)
256   {
257      UINT8 *src = memregion("samples")->base();
258      UINT8 *dst = memregion("digitalker")->base();
259
260      memcpy(dst, src + bank * 0x4000, 0x4000);
261
262      m_bank = bank;
263   }
264}
265
266void chexx_state::machine_reset()
267{
268   m_bank = -1;
269   digitalker_set_bank(0);
270}
271
272TIMER_DEVICE_CALLBACK_MEMBER(chexx_state::update)
273{
274   // NMI on coin-in
275   UINT8 coin = (~ioport("COIN")->read()) & 0x03;
276   m_maincpu->set_input_line(INPUT_LINE_NMI, coin ? ASSERT_LINE : CLEAR_LINE);
277
278   // VIA CA1 connected to Digitalker INTR line
279   m_via->write_ca1(m_digitalker->digitalker_0_intr_r());
280
281#if 0
282   // Play the digitalker samples (it's not hooked up correctly yet)
283   static UINT8 sample = 0, bank = 0;
284
285   if (machine().input().code_pressed_once(KEYCODE_Q))
286      --bank;
287   if (machine().input().code_pressed_once(KEYCODE_W))
288      ++bank;
289   bank %= 3;
290   digitalker_set_bank(bank);
291
292   if (machine().input().code_pressed_once(KEYCODE_A))
293      --sample;
294   if (machine().input().code_pressed_once(KEYCODE_S))
295      ++sample;
296
297   if (machine().input().code_pressed_once(KEYCODE_Z))
298   {
299      m_digitalker->digitalker_0_cms_w(CLEAR_LINE);
300      m_digitalker->digitalker_0_cs_w(CLEAR_LINE);
301
302      address_space &space = m_maincpu->space(AS_PROGRAM);
303      m_digitalker->digitalker_data_w(space, 0, sample, 0);
304
305      m_digitalker->digitalker_0_wr_w(ASSERT_LINE);
306      m_digitalker->digitalker_0_wr_w(CLEAR_LINE);
307      m_digitalker->digitalker_0_wr_w(ASSERT_LINE);
308   }
309#endif
310}
311
312static MACHINE_CONFIG_START( chexx83, chexx_state )
313
314   // basic machine hardware
315   MCFG_CPU_ADD("maincpu", M6502, MAIN_CLOCK/2)
316   MCFG_CPU_PROGRAM_MAP(chexx83_map)
317   MCFG_TIMER_DRIVER_ADD_PERIODIC("update", chexx_state, update, attotime::from_hz(60))
318
319   // via
320   MCFG_DEVICE_ADD("via6522", VIA6522, MAIN_CLOCK/4)
321
322   MCFG_VIA6522_READPA_HANDLER(READ8(chexx_state, via_a_in))
323   MCFG_VIA6522_READPB_HANDLER(READ8(chexx_state, via_b_in))
324
325   MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(chexx_state, via_a_out))
326   MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(chexx_state, via_b_out))
327
328   MCFG_VIA6522_CA2_HANDLER(WRITELINE(chexx_state, via_ca2_out))
329   MCFG_VIA6522_CB1_HANDLER(WRITELINE(chexx_state, via_cb1_out))
330   MCFG_VIA6522_CB2_HANDLER(WRITELINE(chexx_state, via_cb2_out))
331   MCFG_VIA6522_IRQ_HANDLER(WRITELINE(chexx_state, via_irq_out))
332
333   // Layout
334   MCFG_DEFAULT_LAYOUT(layout_chexx)
335
336   // sound hardware
337   MCFG_SPEAKER_STANDARD_MONO("mono")
338   MCFG_DIGITALKER_ADD("digitalker", MAIN_CLOCK)
339   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
340MACHINE_CONFIG_END
341
342static MACHINE_CONFIG_DERIVED( faceoffh, chexx83 )
343   MCFG_CPU_MODIFY("maincpu")
344   MCFG_CPU_PROGRAM_MAP(faceoffh_map)
345
346   MCFG_SOUND_ADD("aysnd", AY8910, MAIN_CLOCK/2)
347   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
348MACHINE_CONFIG_END
349
350// ROMs
351
352/***************************************************************************
353
354Chexx Hockey (1983 version 1.1)
355
356The "long and skinny" Moog CPU board used a 6502 for the processor,
357a 6522 for the PIA, a 6810 static RAM, eight 52164 64k bit sound ROM chips,
358a 40 pin 54104 sound chip, and a single 2716 CPU EPROM
359
360***************************************************************************/
361
362ROM_START( chexx83 )
363   ROM_REGION( 0x0800, "maincpu", 0 )
364   ROM_LOAD( "chexx83.u4", 0x0000, 0x0800, CRC(a34abac1) SHA1(75a31670eb6d1b62ba984f0bac7c6e6067f6ae87) )
365
366   ROM_REGION( 0x4000, "digitalker", ROMREGION_ERASE00 )
367   // bank switched (from samples region)
368
369   ROM_REGION( 0x10000, "samples", ROMREGION_ERASE00 )
370   ROM_LOAD( "chexx83.u12", 0x0000, 0x2000, NO_DUMP )
371   ROM_LOAD( "chexx83.u13", 0x2000, 0x2000, NO_DUMP )
372   ROM_LOAD( "chexx83.u14", 0x4000, 0x2000, NO_DUMP )
373   ROM_LOAD( "chexx83.u15", 0x6000, 0x2000, NO_DUMP )
374   ROM_LOAD( "chexx83.u16", 0x8000, 0x2000, NO_DUMP )
375   ROM_LOAD( "chexx83.u17", 0xa000, 0x2000, NO_DUMP )
376   ROM_LOAD( "chexx83.u18", 0xc000, 0x2000, NO_DUMP )
377   ROM_LOAD( "chexx83.u19", 0xe000, 0x2000, NO_DUMP )
378ROM_END
379
380/***************************************************************************
381
382Face-Off PCB?
383
384Entertainment Enterprises Ltd. 1983 (sticker)
385Serial No. 025402 (sticker)
386MADE IN JAPAN (etched)
387
388CPU:     R6502P
389RAM:     M58725P (2KB)
390I/O:     R6522P (VIA)
391Samples: Digitalker (MM54104)
392Music:   AY-3-8910
393Misc:    XTAL 4MHz, DSW4, 42-pin connector
394
395***************************************************************************/
396
397ROM_START( faceoffh )
398   ROM_REGION( 0x1000, "maincpu", 0 )
399   // "Copyright (c) 1983  SoftLogic JAPAN"
400   ROM_LOAD( "1.5d", 0x0000, 0x1000, CRC(6ab050be) SHA1(ebecae855e22e9c3c46bdee51f84fd5352bf191a) )
401
402   ROM_REGION( 0x4000, "digitalker", ROMREGION_ERASE00 )
403   // bank switched (from samples region)
404
405   ROM_REGION( 0x10000, "samples", 0 )
406   ROM_LOAD( "9.2a", 0x0000, 0x2000, CRC(059b3725) SHA1(5837bee1ef34ce19a3101b851ca55029776e4b3e) )    // digitalker header
407   ROM_LOAD( "8.2b", 0x2000, 0x2000, CRC(679da4e1) SHA1(01a5b9dd132c1b0de97c153d7de226f5bf357338) )
408
409   ROM_LOAD( "7.2c", 0x4000, 0x2000, CRC(f8461b33) SHA1(717a8842e0ce9ba94dd59504a324bede4844e389) )    // digitalker header
410   ROM_LOAD( "6.2d", 0x6000, 0x2000, CRC(156c91e0) SHA1(6017d4b5609b214a6e66dcd76493a7d1442c04d4) )
411
412   ROM_LOAD( "5.3a", 0x8000, 0x2000, CRC(19904604) SHA1(633c211a9a822cdf597a6f3c221ae9c8d6482e82) )    // digitalker header
413   ROM_LOAD( "4.3b", 0xa000, 0x2000, CRC(c3386d51) SHA1(7882e88db55ba914be81075e4b2d76e246c34d3b) )
414
415   ROM_FILL(         0xc000, 0x2000, 0xff ) // unpopulated
416   ROM_FILL(         0xe000, 0x2000, 0xff ) // unpopulated
417ROM_END
418
419GAME( 1983, chexx83,  0,       chexx83,  chexx83, driver_device, 0, ROT270, "ICE",                                                 "Chexx (EM Bubble Hockey, 1983 1.1)", MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_NO_SOUND )
420GAME( 1983, faceoffh, chexx83, faceoffh, chexx83, driver_device, 0, ROT270, "SoftLogic (Entertainment Enterprises, Ltd. license)", "Face-Off (EM Bubble Hockey)",        MACHINE_NOT_WORKING | MACHINE_MECHANICAL | MACHINE_IMPERFECT_SOUND )
trunk/src/mame/drivers/chqflag.c
r249051r249052
306306   MCFG_SCREEN_ADD("screen", RASTER)
307307   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 96, 400, 256, 16, 240) // measured Vsync 59.17hz Hsync 15.13 / 15.19khz
308308//  6MHz dotclock is more realistic, however needs drawing updates. replace when ready
309//  MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
309//   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
310310   MCFG_SCREEN_UPDATE_DRIVER(chqflag_state, screen_update_chqflag)
311311   MCFG_SCREEN_PALETTE("palette")
312312
trunk/src/mame/drivers/cobra.c
r249051r249052
15811581      {
15821582         // install HD patches for bujutsu
15831583         if (strcmp(space.machine().system().name, "bujutsu") == 0)
1584         {
1584         {           
15851585            UINT32 *main_ram = (UINT32*)(UINT64*)m_main_ram;
15861586            UINT32 *sub_ram = (UINT32*)m_sub_ram;
15871587            UINT32 *gfx_ram = (UINT32*)(UINT64*)m_gfx_ram0;
15881588
1589            main_ram[(0x0005ac^4) / 4] = 0x60000000;        // skip IRQ fail
1590            main_ram[(0x001ec4^4) / 4] = 0x60000000;        // waiting for IRQ?
1591            main_ram[(0x001f00^4) / 4] = 0x60000000;        // waiting for IRQ?
1589            main_ram[(0x0005ac^4) / 4] = 0x60000000;      // skip IRQ fail
1590            main_ram[(0x001ec4^4) / 4] = 0x60000000;      // waiting for IRQ?
1591            main_ram[(0x001f00^4) / 4] = 0x60000000;      // waiting for IRQ?
1592           
1593            sub_ram[0x568 / 4] = 0x60000000;            // skip IRQ fail
15921594
1593            sub_ram[0x568 / 4] = 0x60000000;                // skip IRQ fail
1594
1595            gfx_ram[(0x38632c^4) / 4] = 0x38600000;     // skip check_one_scene()
1595            gfx_ram[(0x38632c^4) / 4] = 0x38600000;      // skip check_one_scene()
15961596         }
15971597      }
15981598
trunk/src/mame/drivers/crimfght.c
r249051r249052
302302   MCFG_SCREEN_ADD("screen", RASTER)
303303   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 96, 416, 256, 16, 240) // measured 59.17
304304//  6MHz dotclock is more realistic, however needs drawing updates. replace when ready
305//  MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
305//   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
306306   MCFG_SCREEN_UPDATE_DRIVER(crimfght_state, screen_update_crimfght)
307307   MCFG_SCREEN_PALETTE("palette")
308308
trunk/src/mame/drivers/deco32.c
r249051r249052
20362036   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.35)
20372037MACHINE_CONFIG_END
20382038
2039static MACHINE_CONFIG_DERIVED( fghthistz, fghthsta )
2039static MACHINE_CONFIG_DERIVED( fghthistz, fghthsta )
20402040   MCFG_DEVICE_REMOVE("audiocpu")
20412041
20422042   MCFG_CPU_ADD("audiocpu", Z80, 32220000/9)
trunk/src/mame/drivers/faceoffh.c
r0r249052
1// license:BSD-3-Clause
2// copyright-holders:Luca Elia
3/***************************************************************************
4
5Sound board for an unknown game. Most probably a bubble hockey EM game
6titled "Face-Off", an illegal? copy of Chexx Hockey by ICE. See here:
7
8http://valker.us/gameroom/SegaFaceOff.htm
9https://casetext.com/case/innovative-concepts-in-ent-v-entertainment-enter
10http://www.pinrepair.com/arcade/chexx.htm
11
12"Copyright (c) 1983  SoftLogic JAPAN" in the program rom.
13
14The same PCB, with serial 025707, is allegedly for "Vampire" (prototype).
15
16PCB:
17
18Entertainment Enterprises Ltd. 1983 (sticker)
19Serial No. 025402 (sticker)
20MADE IN JAPAN (etched)
21
22CPU:    R6502P
23RAM:    M58725P (2KB)
24I/O:    R6522P (VIA)
25Speech: Digitalker
26Sound:  AY-3-8910
27Misc:   XTAL 4MHz, DSW4, 42-pin connector
28
29***************************************************************************/
30
31#include "emu.h"
32#include "cpu/m6502/m6502.h"
33#include "sound/ay8910.h"
34#include "sound/digitalk.h"
35#include "machine/6522via.h"
36
37#define MAIN_CLOCK XTAL_4MHz
38
39class faceoffh_state : public driver_device
40{
41public:
42   faceoffh_state(const machine_config &mconfig, device_type type, const char *tag)
43      : driver_device(mconfig, type, tag),
44         m_audiocpu(*this, "audiocpu"),
45         m_digitalker(*this, "digitalker"),
46         m_aysnd(*this, "aysnd")
47   {
48   }
49
50   // devices
51   required_device<cpu_device> m_audiocpu;
52   required_device<digitalker_device> m_digitalker;
53   required_device<ay8910_device> m_aysnd;
54
55   // vars
56   UINT8  m_ay_cmd, m_ay_data;
57   UINT8  m_port_a, m_port_b;
58   UINT8  m_coin;
59   UINT8  m_bank;
60   UINT32 m_shift;
61
62   // screen updates
63   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
64
65   // handlers
66   DECLARE_READ8_MEMBER(via_a_in);
67   DECLARE_READ8_MEMBER(via_b_in);
68
69   DECLARE_WRITE8_MEMBER(via_a_out);
70   DECLARE_WRITE8_MEMBER(via_b_out);
71
72   DECLARE_WRITE_LINE_MEMBER(via_ca2_out);
73   DECLARE_WRITE_LINE_MEMBER(via_cb1_out);
74   DECLARE_WRITE_LINE_MEMBER(via_cb2_out);
75   DECLARE_WRITE_LINE_MEMBER(via_irq_out);
76
77   DECLARE_WRITE8_MEMBER(faceoffh_ay_w);
78   DECLARE_READ8_MEMBER(faceoffh_coin_r);
79   DECLARE_WRITE8_MEMBER(faceoffh_coin_w);
80
81   // digitalker
82   void digitalker_set_bank(UINT8 bank);
83
84   // driver_device overrides
85   virtual void machine_start();
86   virtual void machine_reset();
87
88   virtual void video_start();
89};
90
91
92// VIA
93
94READ8_MEMBER(faceoffh_state::via_a_in)
95{
96   UINT8 ret = 0;
97   logerror("%s: VIA read A: %02X\n", machine().describe_context(), ret);
98   return ret;
99}
100READ8_MEMBER(faceoffh_state::via_b_in)
101{
102   UINT8 ret = 0;
103   logerror("%s: VIA read B: %02X\n", machine().describe_context(), ret);
104   return ret;
105}
106
107WRITE8_MEMBER(faceoffh_state::via_a_out)
108{
109   m_port_a = data;   // multiplexer
110//   logerror("%s: VIA write A = %02X\n", machine().describe_context(), data);
111}
112WRITE8_MEMBER(faceoffh_state::via_b_out)
113{
114   m_port_b = data;
115//   logerror("%s: VIA write B = %02X\n", machine().describe_context(), data);
116}
117
118WRITE_LINE_MEMBER(faceoffh_state::via_ca2_out)
119{
120//   logerror("%s: VIA write CA2 = %02X\n", machine().describe_context(), state);
121}
122WRITE_LINE_MEMBER(faceoffh_state::via_cb1_out)
123{
124//   logerror("%s: VIA write CB1 = %02X\n", machine().describe_context(), state);
125}
126WRITE_LINE_MEMBER(faceoffh_state::via_cb2_out)
127{
128   m_shift = ((m_shift << 1) & 0xffffff) | state;
129//   logerror("%s: VIA write CB2 = %02X\n", machine().describe_context(), state);
130}
131WRITE_LINE_MEMBER(faceoffh_state::via_irq_out)
132{
133   m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
134//   logerror("%s: VIA write IRQ = %02X\n", machine().describe_context(), state);
135}
136
137// Video
138
139void faceoffh_state::video_start()
140{
141}
142
143UINT32 faceoffh_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
144{
145   // NMI on coin-in?
146   UINT8 coin = (~ioport("INPUTS")->read()) & 0x03;
147   m_audiocpu->set_input_line(INPUT_LINE_NMI, coin ? ASSERT_LINE : CLEAR_LINE);
148
149   // Play the digitalker samples (it's not hooked up yet)
150   static UINT8 sample = 0, bank = 0;
151
152   if (screen.machine().input().code_pressed_once(KEYCODE_Q))
153      --bank;
154   if (screen.machine().input().code_pressed_once(KEYCODE_W))
155      ++bank;
156   bank %= 3;
157   digitalker_set_bank(bank);
158
159   if (screen.machine().input().code_pressed_once(KEYCODE_A))
160      --sample;
161   if (screen.machine().input().code_pressed_once(KEYCODE_S))
162      ++sample;
163
164   if (screen.machine().input().code_pressed_once(KEYCODE_Z))
165   {
166      m_digitalker->digitalker_0_cms_w(CLEAR_LINE);
167      m_digitalker->digitalker_0_cs_w(CLEAR_LINE);
168
169      address_space &space = m_audiocpu->space(AS_PROGRAM);
170      m_digitalker->digitalker_data_w(space, 0, sample, 0xff);
171
172      m_digitalker->digitalker_0_wr_w(ASSERT_LINE);
173      m_digitalker->digitalker_0_wr_w(CLEAR_LINE);
174      m_digitalker->digitalker_0_wr_w(ASSERT_LINE);
175   }   
176
177   popmessage("COIN: %02X VIAB: %02X\nCOUNT: %02X %02X LEDS: %02X\nSAMPLE: %02X (B%X)",
178            m_coin, m_port_b,
179            (m_shift >> 16) & 0xff, (m_shift >> 8) & 0xff, (m_shift >> 0) & 0xff,   // 2 x 7-seg, 3 leds
180            sample, bank
181   );
182   return 0;
183}
184
185// Sound
186
187#if 0
188READ8_MEMBER(scramble_state::faceoffh_digitalker_intr_r)
189{
190   return m_digitalker->digitalker_0_intr_r();
191}
192
193WRITE8_MEMBER(scramble_state::faceoffh_digitalker_control_w)
194{
195   m_digitalker->digitalker_0_cs_w (data & 1 ? ASSERT_LINE : CLEAR_LINE);
196   m_digitalker->digitalker_0_cms_w(data & 2 ? ASSERT_LINE : CLEAR_LINE);
197   m_digitalker->digitalker_0_wr_w (data & 4 ? ASSERT_LINE : CLEAR_LINE);
198}
199#endif
200
201WRITE8_MEMBER(faceoffh_state::faceoffh_ay_w)
202{
203   if (offset)
204   {
205      m_ay_data = data;
206      return;
207   }
208
209   if (m_ay_cmd == 0x00 && data == 0x03)
210   {
211      m_aysnd->address_w(space, offset, m_ay_data, mem_mask);
212//      logerror("%s: AY addr = %02X\n", machine().describe_context(), m_ay_data);
213   }
214   else if (m_ay_cmd == 0x00 && data == 0x02)
215   {
216      m_aysnd->data_w(space, offset, m_ay_data, mem_mask);
217//      logerror("%s: AY data = %02X\n", machine().describe_context(), m_ay_data);
218   }
219   m_ay_cmd = data;
220}
221
222// Memory Map
223
224READ8_MEMBER(faceoffh_state::faceoffh_coin_r)
225{
226   UINT8 ret = ioport("DSW")->read();         // bits 0-3
227   UINT8 inp = ioport("INPUTS")->read();      // bit 7 (multiplexed)
228
229   for (int i = 0; i < 8; ++i)
230      if ( ((~m_port_a) & (1 << i)) && ((~inp) & (1 << i)) )
231         ret &= 0x7f;
232
233   return ret;
234}
235
236WRITE8_MEMBER(faceoffh_state::faceoffh_coin_w)
237{
238   m_coin = data;
239//   coin_counter_w(machine(), 0, data & 0x01);
240//   coin_counter_w(machine(), 1, data & 0x02);
241   coin_lockout_w(machine(), 0, data & 0x01);
242   coin_lockout_w(machine(), 1, data & 0x02);
243}
244
245//M58725P - 2KB
246static ADDRESS_MAP_START( faceoffh_map, AS_PROGRAM, 8, faceoffh_state )
247   AM_RANGE(0x0000, 0x00ff) AM_RAM
248   AM_RANGE(0x0100, 0x01ff) AM_RAM
249
250   AM_RANGE(0x4000, 0x400f) AM_DEVREADWRITE("via6522", via6522_device, read, write)
251
252   AM_RANGE(0x8000, 0x8000) AM_READ(faceoffh_coin_r)
253
254   AM_RANGE(0xa000, 0xa001) AM_WRITE(faceoffh_ay_w)
255
256   AM_RANGE(0xc000, 0xc000) AM_WRITE(faceoffh_coin_w)
257
258   AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("audiocpu", 0)
259ADDRESS_MAP_END
260
261// Inputs
262
263static INPUT_PORTS_START( faceoffh )
264   PORT_START("INPUTS")
265   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1   ) PORT_IMPULSE(1) // coin 1 (start music)
266   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2   ) PORT_IMPULSE(1) // coin 2 (start music)
267   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3   ) // ?
268   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) // (stop music)
269   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) // (stop music)
270   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) // ?
271   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON4 )
272   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 )
273
274   PORT_START("DSW")
275   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2")
276   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
277   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
278   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
279   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
280   PORT_DIPNAME( 0x0c, 0x00, "Game Duration (mins)" ) PORT_DIPLOCATION("SW1:3,4")
281   PORT_DIPSETTING(    0x00, "2" ) // 40
282   PORT_DIPSETTING(    0x04, "3" ) // 60
283   PORT_DIPSETTING(    0x08, "4" ) // 80
284   PORT_DIPSETTING(    0x0c, "5" ) // 100
285   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )
286   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) // multiplexed inputs
287INPUT_PORTS_END
288
289// Machine
290
291void faceoffh_state::machine_start()
292{
293}
294
295void faceoffh_state::digitalker_set_bank(UINT8 bank)
296{
297   if (m_bank != bank)
298   {
299      UINT8 *src = memregion("samples")->base();
300      UINT8 *dst = memregion("digitalker")->base();
301
302      memcpy(dst, src + bank * 0x4000, 0x4000);
303
304      m_bank = bank;
305   }
306}
307
308void faceoffh_state::machine_reset()
309{
310   m_bank = -1;
311   digitalker_set_bank(0);
312}
313
314static MACHINE_CONFIG_START( faceoffh, faceoffh_state )
315
316   // basic machine hardware
317   MCFG_CPU_ADD("audiocpu", M6502, MAIN_CLOCK/2)
318   MCFG_CPU_PROGRAM_MAP(faceoffh_map)
319//   MCFG_CPU_VBLANK_INT_DRIVER("screen", faceoffh_state, irq0_line_hold)
320//   MCFG_CPU_VBLANK_INT_DRIVER("screen", faceoffh_state, nmi_line_pulse)
321
322   // via
323   MCFG_DEVICE_ADD("via6522", VIA6522, MAIN_CLOCK/4)
324
325   MCFG_VIA6522_READPA_HANDLER(READ8(faceoffh_state,via_a_in))
326   MCFG_VIA6522_READPB_HANDLER(READ8(faceoffh_state,via_b_in))
327
328   MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(faceoffh_state, via_a_out))
329   MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(faceoffh_state, via_b_out))
330
331   MCFG_VIA6522_CA2_HANDLER(WRITELINE(faceoffh_state, via_ca2_out))
332   MCFG_VIA6522_CB1_HANDLER(WRITELINE(faceoffh_state, via_cb1_out))
333   MCFG_VIA6522_CB2_HANDLER(WRITELINE(faceoffh_state, via_cb2_out))
334   MCFG_VIA6522_IRQ_HANDLER(WRITELINE(faceoffh_state, via_irq_out)/*DEVWRITELINE("audiocpu", m6502_device, write_irq4)*/)
335
336   // video hardware
337   MCFG_SCREEN_ADD("screen", RASTER)
338   MCFG_SCREEN_REFRESH_RATE(60)
339   MCFG_SCREEN_UPDATE_DRIVER(faceoffh_state, screen_update)
340   MCFG_SCREEN_SIZE(256, 256)
341   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
342   MCFG_SCREEN_PALETTE("palette")
343
344   MCFG_PALETTE_ADD("palette", 16)
345
346   // sound hardware
347   MCFG_SPEAKER_STANDARD_MONO("mono")
348   MCFG_SOUND_ADD("aysnd", AY8910, MAIN_CLOCK/2)
349   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
350
351   MCFG_DIGITALKER_ADD("digitalker", MAIN_CLOCK)
352   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
353MACHINE_CONFIG_END
354
355// ROMs
356
357ROM_START( faceoffh )
358   ROM_REGION( 0x1000, "audiocpu", 0 )
359   ROM_LOAD( "1.5d", 0x0000, 0x1000, CRC(6ab050be) SHA1(ebecae855e22e9c3c46bdee51f84fd5352bf191a) )
360
361   ROM_REGION( 0x4000, "digitalker", ROMREGION_ERASE00 )
362   // bank switched (from samples region)
363
364   ROM_REGION( 0xc000, "samples", 0 )
365   ROM_LOAD( "9.2a", 0x0000, 0x2000, CRC(059b3725) SHA1(5837bee1ef34ce19a3101b851ca55029776e4b3e) )   // digitalker header
366   ROM_LOAD( "8.2b", 0x2000, 0x2000, CRC(679da4e1) SHA1(01a5b9dd132c1b0de97c153d7de226f5bf357338) )
367
368   ROM_LOAD( "7.2c", 0x4000, 0x2000, CRC(f8461b33) SHA1(717a8842e0ce9ba94dd59504a324bede4844e389) )   // digitalker header
369   ROM_LOAD( "6.2d", 0x6000, 0x2000, CRC(156c91e0) SHA1(6017d4b5609b214a6e66dcd76493a7d1442c04d4) )
370
371   ROM_LOAD( "5.3a", 0x8000, 0x2000, CRC(19904604) SHA1(633c211a9a822cdf597a6f3c221ae9c8d6482e82) )   // digitalker header
372   ROM_LOAD( "4.3b", 0xa000, 0x2000, CRC(c3386d51) SHA1(7882e88db55ba914be81075e4b2d76e246c34d3b) )
373ROM_END
374
375GAME( 1983, faceoffh, 0, faceoffh, faceoffh, driver_device, 0, ROT270, "SoftLogic (Entertainment Enterprises, Ltd. license)", "Face-Off (EM Bubble Hockey)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_IMPERFECT_SOUND )
trunk/src/mame/drivers/fcrash.c
r249051r249052
29582958
29592959GAME( 1992, sf2b,      sf2,      sf2b,      sf2mdt,   cps_state, sf2b,     ROT0,   "bootleg", "Street Fighter II: The World Warrior (bootleg)",  MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) //910204 - based on World version
29602960
2961GAME( 1992, sf2m9,     sf2ce,    sf2m1,     sf2,      cps_state, sf2m1,    ROT0,   "bootleg", "Street Fighter II': Champion Edition (M9, bootleg)",  MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // 920313 ETC
2961GAME( 1992, sf2m9,     sf2ce,    sf2m1,     sf2,      cps_state, dinopic,  ROT0,   "bootleg", "Street Fighter II': Champion Edition (M9, bootleg)",  MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // 920313 ETC
29622962
29632963GAME( 1993, slampic,   slammast, slampic,   slammast, cps_state, dinopic,  ROT0,   "bootleg", "Saturday Night Slam Masters (bootleg with PIC16c57)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // 930713 ETC
29642964
trunk/src/mame/drivers/firebeat.c
r249051r249052
10641064   AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("spu_ata", ata_interface_device, read_cs0, write_cs0)
10651065   AM_RANGE(0x340000, 0x34000f) AM_DEVREADWRITE("spu_ata", ata_interface_device, read_cs1, write_cs1)
10661066   AM_RANGE(0x400000, 0x400fff) AM_DEVREADWRITE("rf5c400", rf5c400_device, rf5c400_r, rf5c400_w)
1067   AM_RANGE(0x800000, 0x83ffff) AM_RAM         // SDRAM
1068   AM_RANGE(0xfc0000, 0xffffff) AM_RAM         // SDRAM
1067   AM_RANGE(0x800000, 0x83ffff) AM_RAM         // SDRAM
1068   AM_RANGE(0xfc0000, 0xffffff) AM_RAM         // SDRAM
10691069ADDRESS_MAP_END
10701070
10711071/*****************************************************************************/
trunk/src/mame/drivers/groundfx.c
r249051r249052
245245   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(1)
246246
247247   PORT_START("AN1")   /* IN 3, accel */
248   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(1)
248   PORT_BIT( 0xff, 0xff, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(1)
249249
250250   PORT_START("AN2")   /* IN 4, sound volume */
251251   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2)
trunk/src/mame/drivers/gunsmoke.c
r249051r249052
538538   ROM_LOAD( "gsr_03a.9n",  0x00000, 0x8000, CRC(2f6e6ad7) SHA1(e9e4a367c240a35a1ba2eeaec9458996f7926f16) ) /* Code 0000-7fff */
539539   ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) /* Paged code */
540540   ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) /* Paged code */
541
541   
542542   ROM_REGION( 0x10000, "audiocpu", 0 )
543543   ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) )
544544
trunk/src/mame/drivers/joystand.c
r249051r249052
338338   m_bg2_tmap->set_scrolly(0, m_scroll[1]);
339339
340340   draw_bg15_tilemap();
341
341     
342342   bitmap.fill(m_palette->black_pen(), cliprect);
343   if (layers_ctrl & 4)    copybitmap_trans(bitmap, m_bg15_bitmap[0], 0, 0, 1, 0, cliprect, BG15_TRANSPARENT);
344   if (layers_ctrl & 8)    copybitmap_trans(bitmap, m_bg15_bitmap[1], 0, 0, 0, 0, cliprect, BG15_TRANSPARENT);
345   if (layers_ctrl & 1)    m_bg1_tmap->draw(screen, bitmap, cliprect, 0, 0);
346   if (layers_ctrl & 2)    m_bg2_tmap->draw(screen, bitmap, cliprect, 0, 0);
343   if (layers_ctrl & 4)   copybitmap_trans(bitmap, m_bg15_bitmap[0], 0, 0, 1, 0, cliprect, BG15_TRANSPARENT);
344   if (layers_ctrl & 8)   copybitmap_trans(bitmap, m_bg15_bitmap[1], 0, 0, 0, 0, cliprect, BG15_TRANSPARENT);
345   if (layers_ctrl & 1)   m_bg1_tmap->draw(screen, bitmap, cliprect, 0, 0);
346   if (layers_ctrl & 2)   m_bg2_tmap->draw(screen, bitmap, cliprect, 0, 0);
347347
348348   popmessage("S0: %04X S1: %04X EN: %04X OUT: %04X", m_scroll[0], m_scroll[1], m_enable[0], m_outputs[0]);
349349   return 0;
r249051r249052
394394   COMBINE_DATA(&m_outputs[0]);
395395   if (ACCESSING_BITS_8_15)
396396   {
397      coin_counter_w(machine(), 0,            BIT(data, 0)); // coin counter 1
398      coin_counter_w(machine(), 1,            BIT(data, 1)); // coin counter 2
397      coin_counter_w(machine(), 0,         BIT(data, 0)); // coin counter 1
398      coin_counter_w(machine(), 1,         BIT(data, 1)); // coin counter 2
399399
400      output_set_value("blocker",             BIT(data, 2));
401      output_set_value("error_lamp",          BIT(data, 3)); // counter error
402      output_set_value("photo_lamp",          BIT(data, 4)); // during photo
400      output_set_value("blocker",            BIT(data, 2));
401      output_set_value("error_lamp",         BIT(data, 3)); // counter error
402      output_set_value("photo_lamp",         BIT(data, 4)); // during photo
403403   }
404404   if (ACCESSING_BITS_8_15)
405405   {
406      output_set_value("ok_button_led",       BIT(data, 8));
407      output_set_value("cancel_button_led",   BIT(data, 9));
406      output_set_value("ok_button_led",      BIT(data, 8));
407      output_set_value("cancel_button_led",   BIT(data, 9));
408408   }
409409}
410410
r249051r249052
449449   AM_RANGE(0x200010, 0x200011) AM_READ_PORT("IN0") // r/w
450450   AM_RANGE(0x200012, 0x200013) AM_RAM_WRITE(outputs_w) AM_SHARE("outputs") // r/w
451451   AM_RANGE(0x200014, 0x200015) AM_READWRITE(fpga_r, oki_bank_w) // r/w
452//  AM_RANGE(0x200016, 0x200017) // write $9190 at boot
452//   AM_RANGE(0x200016, 0x200017) // write $9190 at boot
453453
454454   AM_RANGE(0x400000, 0x47ffff) AM_RAM_WRITE(bg15_0_w) AM_SHARE("bg15_0_ram") // r5g5b5 200x200 pixel-based
455455   AM_RANGE(0x480000, 0x4fffff) AM_RAM // more rgb layers? (writes at offset 0)
r249051r249052
464464   AM_RANGE(0x60c00c, 0x60c00d) AM_RAM AM_SHARE("enable") // write
465465
466466   AM_RANGE(0x800000, 0xdfffff) AM_READWRITE(cart_r, cart_w) // r/w (cart flash)
467//  AM_RANGE(0xe00080, 0xe00081) // write (bit 0 = cart? bit 1 = ? bit 3 = ?)
467//   AM_RANGE(0xe00080, 0xe00081) // write (bit 0 = cart? bit 1 = ? bit 3 = ?)
468468   AM_RANGE(0xe00000, 0xe00001) AM_READ(e00000_r) // copy slot
469469   AM_RANGE(0xe00020, 0xe00021) AM_READ(e00020_r) // master slot
470470
r249051r249052
478478   // Cart status:
479479   // mask 0x1000 -> cart flash addressing (0 = sequential, 1 = interleaved even/odd)
480480   // mask 0x6000 == 0 -> cart present?
481   // mask 0x8000 -> cart ready?
481   // mask 0x8000 -> cart ready?
482482
483483   PORT_START("MASTER")
484484   PORT_CONFNAME( 0x1000, 0x1000, "Master Flash Addressing" )
r249051r249052
559559
560560void joystand_state::machine_start()
561561{
562   m_cart_flash[0]  = m_cart_u11;      m_cart_flash[1]  = m_cart_u5;
563   m_cart_flash[2]  = m_cart_u12;      m_cart_flash[3]  = m_cart_u6;
564   m_cart_flash[4]  = m_cart_u9;       m_cart_flash[5]  = m_cart_u3;
565   m_cart_flash[6]  = m_cart_u10;      m_cart_flash[7]  = m_cart_u4;
566   m_cart_flash[8]  = m_cart_u7;       m_cart_flash[9]  = m_cart_u1;
567   m_cart_flash[10] = m_cart_u8;       m_cart_flash[11] = m_cart_u2;
562   m_cart_flash[0]  = m_cart_u11;      m_cart_flash[1]  = m_cart_u5;
563   m_cart_flash[2]  = m_cart_u12;      m_cart_flash[3]  = m_cart_u6;
564   m_cart_flash[4]  = m_cart_u9;      m_cart_flash[5]  = m_cart_u3;
565   m_cart_flash[6]  = m_cart_u10;      m_cart_flash[7]  = m_cart_u4;
566   m_cart_flash[8]  = m_cart_u7;      m_cart_flash[9]  = m_cart_u1;
567   m_cart_flash[10] = m_cart_u8;      m_cart_flash[11] = m_cart_u2;
568568}
569569
570570void joystand_state::machine_reset()
trunk/src/mame/drivers/kaneko16.c
r249051r249052
363694  Great 1000 Miles Rally     Z09AF-005   TBSOP01 MCU protection (EEPROM handling etc.)
3737    Bonk's Adventure           Z09AF-003   TBSOP01 MCU protection (EEPROM handling, 68k code snippet, data)
3838    Blood Warrior              Z09AF-005   TBSOP01 MCU protection (EEPROM handling etc.)
39    Pack'n Bang Bang           BW-002      (prototype)
39   Pack'n Bang Bang           BW-002      (prototype)
404095  Great 1000 Miles Rally 2   M201F00138  TBSOP02 MCU protection (EEPROM handling etc.)
4141----------------------------------------------------------------------------------------
4242
r249051r249052
15051505   PORT_DIPSETTING(    0x20, DEF_STR( 1C_5C ) )
15061506   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
15071507
1508   PORT_START("DSW2")
1508   PORT_START("DSW2") 
15091509   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
15101510   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
15111511   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
trunk/src/mame/drivers/konendev.c
r249051r249052
8484
8585   if (ACCESSING_BITS_24_31)
8686   {
87      r |= 0x11000000;        // MCU2 version
87      r |= 0x11000000;      // MCU2 version
8888   }
8989   if (ACCESSING_BITS_16_23)
9090   {
r249051r249052
9292   }
9393   if (ACCESSING_BITS_8_15)
9494   {
95      r &= ~0x4000;       // MCU2 presence
96      r &= ~0x2000;       // IFU2 presence
97      r &= ~0x1000;       // FMU2 presence
95      r &= ~0x4000;      // MCU2 presence
96      r &= ~0x2000;      // IFU2 presence
97      r &= ~0x1000;      // FMU2 presence   
9898   }
9999   if (ACCESSING_BITS_0_7)
100100   {
101      r |= 0x40;          // logic door
102      r |= 0x04;          // battery 1 status
103      r |= 0x10;          // battery 2 status
101      r |= 0x40;         // logic door
102      r |= 0x04;         // battery 1 status
103      r |= 0x10;         // battery 2 status
104104   }
105105
106106   return r;
r249051r249052
112112
113113   if (ACCESSING_BITS_0_7)
114114   {
115      r |= 0x11;          // IFU2 version
115      r |= 0x11;         // IFU2 version
116116   }
117117
118118   return r;
r249051r249052
151151   AM_RANGE(0x78800004, 0x78800007) AM_READ(unk_78800004_r)
152152   AM_RANGE(0x78a00000, 0x78a0001f) AM_READ(unk_78a00000_r)
153153   AM_RANGE(0x78e00000, 0x78e00003) AM_READ(unk_78e00000_r)
154//  AM_RANGE(0x78000000, 0x78000003) AM_READNOP
155//  AM_RANGE(0x78100000, 0x7810001b) AM_RAM
156//  AM_RANGE(0x78a00014, 0x78a00017) AM_WRITENOP
154//   AM_RANGE(0x78000000, 0x78000003) AM_READNOP
155//   AM_RANGE(0x78100000, 0x7810001b) AM_RAM
156//   AM_RANGE(0x78a00014, 0x78a00017) AM_WRITENOP
157157   AM_RANGE(0x79000000, 0x79000003) AM_DEVWRITE("gcu", k057714_device, fifo_w)
158158   AM_RANGE(0x79800000, 0x798000ff) AM_DEVREADWRITE("gcu", k057714_device, read, write)
159159   AM_RANGE(0x7a000000, 0x7a01ffff) AM_RAM AM_SHARE("nvram0")
r249051r249052
218218   ROM_LOAD( "enl5r211.fmu.bin", 0x0000, 0x1800000, CRC(592c3c7f) SHA1(119b3c6223d656981c399c399d7edccfdbb50dc7) )
219219
220220   ROM_REGION32_BE( 0x100, "eeprom", 0 )
221   ROM_LOAD( "93c56.u98", 0x00, 0x100, CRC(b2521a6a) SHA1(f44711545bee7e9c772a3dc23b79f0ea8059ec50) )          // empty eeprom with Konami header
221   ROM_LOAD( "93c56.u98", 0x00, 0x100, CRC(b2521a6a) SHA1(f44711545bee7e9c772a3dc23b79f0ea8059ec50) )         // empty eeprom with Konami header
222222ROM_END
223223
224224
r249051r249052
348348   ROM_REGION32_BE( 0x1800000, "flash", ROMREGION_ERASE00 )
349349
350350   ROM_REGION32_BE( 0x100, "eeprom", 0 )
351   ROM_LOAD( "93c56.u98", 0x00, 0x100, CRC(b2521a6a) SHA1(f44711545bee7e9c772a3dc23b79f0ea8059ec50) )          // empty eeprom with Konami header
351   ROM_LOAD( "93c56.u98", 0x00, 0x100, CRC(b2521a6a) SHA1(f44711545bee7e9c772a3dc23b79f0ea8059ec50) )         // empty eeprom with Konami header
352352ROM_END
353353
354354DRIVER_INIT_MEMBER(konendev_state,konendev)
r249051r249052
358358DRIVER_INIT_MEMBER(konendev_state,enchlamp)
359359{
360360   UINT32 *rom = (UINT32*)memregion("program")->base();
361   rom[0x24/4] = 0x00002743;       // patch flash checksum for now
361   rom[0x24/4] = 0x00002743;      // patch flash checksum for now
362362
363   rom[0] = 0xd43eb930;                // new checksum for program rom
363   rom[0] = 0xd43eb930;            // new checksum for program rom
364364}
365365
366366// has a flash dump?
trunk/src/mame/drivers/lethalj.c
r249051r249052
681681
682682ROM_START( lethalj )
683683   ROM_REGION16_LE( 0x100000, "user1", 0 )     /* 34010 code */
684   ROM_LOAD16_BYTE( "lethal_vc8_2.3.vc8",  0x000000, 0x080000, CRC(8d568e1d) SHA1(e4dd3794789f9ccd7be8374978a3336f2b79136f) ) /* Labeled as LETHAL VC8 2.3, also found labeled as VC-8 */
685   ROM_LOAD16_BYTE( "lethal_vc9_2.3.vc9",  0x000001, 0x080000, CRC(8f22add4) SHA1(e773d3ae9cf512810fc266e784d21ed115c8830c) ) /* Labeled as LETHAL VC9 2.3, also found labeled as VC-9 */
684   ROM_LOAD16_BYTE( "vc8",  0x000000, 0x080000, CRC(8d568e1d) SHA1(e4dd3794789f9ccd7be8374978a3336f2b79136f) )
685   ROM_LOAD16_BYTE( "vc9",  0x000001, 0x080000, CRC(8f22add4) SHA1(e773d3ae9cf512810fc266e784d21ed115c8830c) )
686686
687687   ROM_REGION16_LE( 0x600000, "gfx1", 0 )          /* graphics data */
688   ROM_LOAD16_BYTE( "gr1.gr1",             0x000000, 0x100000, CRC(27f7b244) SHA1(628b29c066e217e1fe54553ea3ed98f86735e262) ) /* These had non specific GRx labels, also found labeled as GR-x */
689   ROM_LOAD16_BYTE( "gr2.gr2",             0x000001, 0x100000, CRC(1f25d3ab) SHA1(bdb8a3c546cdee9a5630c47b9c5079a956e8a093) )
690   ROM_LOAD16_BYTE( "gr4.gr4",             0x200000, 0x100000, CRC(c5838b4c) SHA1(9ad03d0f316eb31fdf0ca6f65c02a27d3406d072) )
691   ROM_LOAD16_BYTE( "gr3.gr3",             0x200001, 0x100000, CRC(ba9fa057) SHA1(db6f11a8964870f04f94fef6f1b1a58168a942ad) )
692   ROM_LOAD16_BYTE( "lethal_gr6_2.3.gr6",  0x400000, 0x100000, CRC(51c99b85) SHA1(9a23bf21a73d2884b49c64a8f42c288534c79dc5) ) /* Labeled as LETHAL GR6 2.3, also found labeled as GR-6 */
693   ROM_LOAD16_BYTE( "lethal_gr5_2.3.gr5",  0x400001, 0x100000, CRC(80dda9b5) SHA1(d8a79cad112bc7d9e4ba31a950e4807581f3bf46) ) /* Labeled as LETHAL GR5 2.3, also found labeled as GR-5 */
688   ROM_LOAD16_BYTE( "gr1",  0x000000, 0x100000, CRC(27f7b244) SHA1(628b29c066e217e1fe54553ea3ed98f86735e262) )
689   ROM_LOAD16_BYTE( "gr2",  0x000001, 0x100000, CRC(1f25d3ab) SHA1(bdb8a3c546cdee9a5630c47b9c5079a956e8a093) )
690   ROM_LOAD16_BYTE( "gr4",  0x200000, 0x100000, CRC(c5838b4c) SHA1(9ad03d0f316eb31fdf0ca6f65c02a27d3406d072) )
691   ROM_LOAD16_BYTE( "gr3",  0x200001, 0x100000, CRC(ba9fa057) SHA1(db6f11a8964870f04f94fef6f1b1a58168a942ad) )
692   ROM_LOAD16_BYTE( "gr6",  0x400000, 0x100000, CRC(51c99b85) SHA1(9a23bf21a73d2884b49c64a8f42c288534c79dc5) )
693   ROM_LOAD16_BYTE( "gr5",  0x400001, 0x100000, CRC(80dda9b5) SHA1(d8a79cad112bc7d9e4ba31a950e4807581f3bf46) )
694694
695695   ROM_REGION( 0x40000, "oki1", 0 )                /* sound data */
696696   ROM_LOAD( "sound1.u20", 0x00000, 0x40000, CRC(7d93ca66) SHA1(9e1dc0efa5d0f770c7e1f10de56fbf5620dea437) )
r249051r249052
10071007 *
10081008 *************************************/
10091009
1010GAME( 1996, lethalj,   0,        lethalj,  lethalj,   driver_device, 0,        ROT0,  "The Game Room", "Lethal Justice (Version 2.3)", 0 )
1010GAME( 1996, lethalj,   0,        lethalj,  lethalj,   driver_device, 0,        ROT0,  "The Game Room", "Lethal Justice", 0 )
10111011GAME( 1996, franticf,  0,        gameroom, franticf,  driver_device, 0,        ROT0,  "The Game Room", "Frantic Fred", MACHINE_NOT_WORKING )
10121012GAME( 1997, eggventr,  0,        gameroom, eggventr,  driver_device, 0,        ROT0,  "The Game Room", "Egg Venture (Release 10)", 0 )
10131013GAME( 1997, eggventr8, eggventr, gameroom, eggventr,  driver_device, 0,        ROT0,  "The Game Room", "Egg Venture (Release 8)", 0 )
trunk/src/mame/drivers/megasys1.c
r249051r249052
35913591
35923592Bootleg version of Saint Dragon. Two PCBs connected by two flat cables.
35933593Sound section can host two oki chips (and roms) but only one is populated.
3594No ASICs just logic chips.
3594No ASICs just logic chips.
35953595
35963596- ROMs A-19 and A-20 are fitted 'piggy backed' with one pin
35973597  from A-20 bent out and wired to a nearby TTL.
trunk/src/mame/drivers/midxunit.c
r249051r249052
345345   ROM_LOAD( "a-17721.u955", 0x200, 0x117, CRC(033fe902) SHA1(6efb4e519ed3c9d49fff046a679762b506b3a75b) )
346346ROM_END
347347
348ROM_START( revxp5 )
349   ROM_REGION16_LE( 0x1000000, "dcs", ROMREGION_ERASEFF )  /* sound data */
350   ROM_LOAD16_BYTE( "revx_snd.2", 0x000000, 0x80000, CRC(4ed9e803) SHA1(ba50f1beb9f2a2cf5110897209b5e9a2951ff165) )
351   ROM_LOAD16_BYTE( "revx_snd.3", 0x200000, 0x80000, CRC(af8f253b) SHA1(25a0000cab177378070f7a6e3c7378fe87fad63e) )
352   ROM_LOAD16_BYTE( "revx_snd.4", 0x400000, 0x80000, CRC(3ccce59c) SHA1(e81a31d64c64e7b1d25f178c53da3d68453c203c) )
353   ROM_LOAD16_BYTE( "revx_snd.5", 0x600000, 0x80000, CRC(a0438006) SHA1(560d216d21cb8073dbee0fd20ebe589932a9144e) )
354   ROM_LOAD16_BYTE( "revx_snd.6", 0x800000, 0x80000, CRC(b7b34f60) SHA1(3b9682c6a00fa3bdb47e69d8e8ceccc244ee55b5) )
355   ROM_LOAD16_BYTE( "revx_snd.7", 0xa00000, 0x80000, CRC(6795fd88) SHA1(7c3790730a8b99b63112c851318b1c7e4989e5e0) )
356   ROM_LOAD16_BYTE( "revx_snd.8", 0xc00000, 0x80000, CRC(793a7eb5) SHA1(4b1f81b68f95cedf1b356ef362d1eb37acc74b16) )
357   ROM_LOAD16_BYTE( "revx_snd.9", 0xe00000, 0x80000, CRC(14ddbea1) SHA1(8dba9dc5529ea77c4312ea61f825bf9062ffc6c3) )
358348
359   ROM_REGION16_LE( 0x200000, "maincpu", 0 )   /* 34020 code */
360   ROM_LOAD32_BYTE( "revx_p5.51",  0x00000, 0x80000, CRC(f3877eee) SHA1(7a4fdce36edddd35308c107c992ce626a2c9eb8c) )
361   ROM_LOAD32_BYTE( "revx_p5.52",  0x00001, 0x80000, CRC(199a54d8) SHA1(45319437e11176d4926c00c95c372098203a32a3) )
362   ROM_LOAD32_BYTE( "revx_p5.53",  0x00002, 0x80000, CRC(fcfcf72a) SHA1(b471afb416e3d348b046b0b40f497d27b0afa470) )
363   ROM_LOAD32_BYTE( "revx_p5.54",  0x00003, 0x80000, CRC(fd684c31) SHA1(db3453792e4d9fc375297d030f0b3f9cc3cad925) )
364349
365   ROM_REGION( 0x2000, "pic", 0 )
366   ROM_LOAD( "revx_16c57.bin", 0x0000000, 0x2000, CRC(eb8a8649) SHA1(a1e1d0b7a5e9802e8f889eb7e719259656dc8133) )
367
368   ROM_REGION( 0x1000000, "gfxrom", 0 )
369   ROM_LOAD32_BYTE( "revx.120", 0x0000000, 0x80000, CRC(523af1f0) SHA1(a67c0fd757e860fc1c1236945952a295b4d5df5a) )
370   ROM_LOAD32_BYTE( "revx.121", 0x0000001, 0x80000, CRC(78201d93) SHA1(fb0b8f887eec433f7624f387d7fb6f633ea30d7c) )
371   ROM_LOAD32_BYTE( "revx.122", 0x0000002, 0x80000, CRC(2cf36144) SHA1(22ed0eefa2c7c836811fac5f717c3f38254eabc2) )
372   ROM_LOAD32_BYTE( "revx.123", 0x0000003, 0x80000, CRC(6912e1fb) SHA1(416f0de711d80e9182ede524c568c5095b1bec61) )
373
374   ROM_LOAD32_BYTE( "revx.110", 0x0200000, 0x80000, CRC(e3f7f0af) SHA1(5877d9f488b0f4362a9482007c3ff7f4589a036f) )
375   ROM_LOAD32_BYTE( "revx.111", 0x0200001, 0x80000, CRC(49fe1a69) SHA1(9ae54b461f0524c034fbcb6fcd3fd5ccb5d7265a) )
376   ROM_LOAD32_BYTE( "revx.112", 0x0200002, 0x80000, CRC(7e3ba175) SHA1(dd2fe90988b544f67dbe6151282fd80d49631388) )
377   ROM_LOAD32_BYTE( "revx.113", 0x0200003, 0x80000, CRC(c0817583) SHA1(2f866e5888e212b245984344950d0e1fb8957a73) )
378
379   ROM_LOAD32_BYTE( "revx.101", 0x0400000, 0x80000, CRC(5a08272a) SHA1(17da3c9d71114f5fdbf50281a942be3da3b6f564) )
380   ROM_LOAD32_BYTE( "revx.102", 0x0400001, 0x80000, CRC(11d567d2) SHA1(7ebe6fd39a0335e1fdda150d2dc86c3eaab17b2e) )
381   ROM_LOAD32_BYTE( "revx.103", 0x0400002, 0x80000, CRC(d338e63b) SHA1(0a038217542667b3a01ecbcad824ee18c084f293) )
382   ROM_LOAD32_BYTE( "revx.104", 0x0400003, 0x80000, CRC(f7b701ee) SHA1(0fc5886e5857326bee7272d5d482a878cbcea83c) )
383
384   ROM_LOAD32_BYTE( "revx.91",  0x0600000, 0x80000, CRC(52a63713) SHA1(dcc0ff3596bd5d273a8d4fd33b0b9b9d588d8354) )
385   ROM_LOAD32_BYTE( "revx.92",  0x0600001, 0x80000, CRC(fae3621b) SHA1(715d41ea789c0c724baa5bd90f6f0f06b9cb1c64) )
386   ROM_LOAD32_BYTE( "revx.93",  0x0600002, 0x80000, CRC(7065cf95) SHA1(6c5888da099e51c4b1c592721c5027c899cf52e3) )
387   ROM_LOAD32_BYTE( "revx.94",  0x0600003, 0x80000, CRC(600d5b98) SHA1(6aef98c91f87390c0759fe71a272a3ccadd71066) )
388
389   ROM_LOAD32_BYTE( "revx.81",  0x0800000, 0x80000, CRC(729eacb1) SHA1(d130162ae22b99c84abfbe014c4e23e20afb757f) )
390   ROM_LOAD32_BYTE( "revx.82",  0x0800001, 0x80000, CRC(19acb904) SHA1(516059b516bc5b1669c9eb085e0cdcdee520dff0) )
391   ROM_LOAD32_BYTE( "revx.83",  0x0800002, 0x80000, CRC(0e223456) SHA1(1eedbd667f4a214533d1c22ca5312ecf2d4a3ab4) )
392   ROM_LOAD32_BYTE( "revx.84",  0x0800003, 0x80000, CRC(d3de0192) SHA1(2d22c5bac07a7411f326691167c7c70eba4b371f) )
393
394   ROM_LOAD32_BYTE( "revx.71",  0x0a00000, 0x80000, CRC(2b29fddb) SHA1(57b71e5c18b56bf58216e690fdefa6d30d88d34a) )
395   ROM_LOAD32_BYTE( "revx.72",  0x0a00001, 0x80000, CRC(2680281b) SHA1(d1ae0701d20166a00d8733d9d12246c140a5fb96) )
396   ROM_LOAD32_BYTE( "revx.73",  0x0a00002, 0x80000, CRC(420bde4d) SHA1(0f010cdeddb59631a5420dddfc142c50c2a1e65a) )
397   ROM_LOAD32_BYTE( "revx.74",  0x0a00003, 0x80000, CRC(26627410) SHA1(a612121554549afff5c8e8c54774ca7b0220eda8) )
398
399   ROM_LOAD32_BYTE( "revx.63",  0x0c00000, 0x80000, CRC(3066e3f3) SHA1(25548923db111bd6c6cff44bfb63cb9eb2ef0b53) )
400   ROM_LOAD32_BYTE( "revx.64",  0x0c00001, 0x80000, CRC(c33f5309) SHA1(6bb333f563ea66c4c862ffd5fb91fb5e1b919fe8) )
401   ROM_LOAD32_BYTE( "revx.65",  0x0c00002, 0x80000, CRC(6eee3e71) SHA1(0ef22732e0e2bb5207559decd43f90d1e338ad7b) )
402   ROM_LOAD32_BYTE( "revx.66",  0x0c00003, 0x80000, CRC(b43d6fff) SHA1(87584e7aeea9d52a43023d40c359591ff6342e84) )
403   
404   ROM_LOAD32_BYTE( "revx_p5.51",  0xe00000, 0x80000, CRC(f3877eee) SHA1(7a4fdce36edddd35308c107c992ce626a2c9eb8c) )
405   ROM_LOAD32_BYTE( "revx_p5.52",  0xe00001, 0x80000, CRC(199a54d8) SHA1(45319437e11176d4926c00c95c372098203a32a3) )
406   ROM_LOAD32_BYTE( "revx_p5.53",  0xe00002, 0x80000, CRC(fcfcf72a) SHA1(b471afb416e3d348b046b0b40f497d27b0afa470) )
407   ROM_LOAD32_BYTE( "revx_p5.54",  0xe00003, 0x80000, CRC(fd684c31) SHA1(db3453792e4d9fc375297d030f0b3f9cc3cad925) )
408
409   ROM_REGION( 0x400, "plds", 0 )
410   ROM_LOAD( "a-17722.u1",   0x000, 0x117, CRC(054de7a3) SHA1(bb7abaec50ed704c03b44d5d54296898f7c80d38) )
411   ROM_LOAD( "a-17721.u955", 0x200, 0x117, CRC(033fe902) SHA1(6efb4e519ed3c9d49fff046a679762b506b3a75b) )
412ROM_END
413
414
415
416350/*************************************
417351 *
418352 *  Game drivers
419353 *
420354 *************************************/
421355
422GAME( 1994, revx,     0,    midxunit, revx, midxunit_state, revx, ROT0, "Midway",   "Revolution X (rev 1.0 6/16/94)", MACHINE_SUPPORTS_SAVE )
423GAME( 1994, revxp5,   revx, midxunit, revx, midxunit_state, revx, ROT0, "Midway",   "Revolution X (prototype, rev 5.0 5/23/94)", MACHINE_SUPPORTS_SAVE )
356GAME( 1994, revx,   0,         midxunit, revx, midxunit_state, revx, ROT0, "Midway",   "Revolution X (Rev. 1.0 6/16/94)", MACHINE_SUPPORTS_SAVE )
trunk/src/mame/drivers/minivadr.c
r249051r249052
3131       Z80  - Clock 4MHz [24/6]
3232       6116 - 2Kbx8 SRAM
3333 D26_01.IC7 - 27C64 8Kbx8 EPROM
34
34       
3535***************************************************************************/
3636
3737#include "emu.h"
trunk/src/mame/drivers/namcofl.c
r249051r249052
610610   MCFG_VIDEO_START_OVERRIDE(namcofl_state,namcofl)
611611
612612   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
613   MCFG_C352_ADD("c352", 48384000/2, 288)
613   MCFG_C352_ADD("c352", 48384000/2, C352_DIVIDER_288)
614614   MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
615615   MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
616616   MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
trunk/src/mame/drivers/namconb1.c
r249051r249052
11261126   MCFG_VIDEO_START_OVERRIDE(namconb1_state,namconb1)
11271127
11281128   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
1129   MCFG_C352_ADD("c352", MASTER_CLOCK/2, 288)
1129   MCFG_C352_ADD("c352", MASTER_CLOCK/2, C352_DIVIDER_288)
11301130   MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
11311131   MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
11321132   MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
r249051r249052
11631163   MCFG_VIDEO_START_OVERRIDE(namconb1_state,namconb2)
11641164
11651165   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
1166   MCFG_C352_ADD("c352", MASTER_CLOCK/2, 288)
1166   MCFG_C352_ADD("c352", MASTER_CLOCK/2, C352_DIVIDER_288)
11671167   MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
11681168   MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
11691169   MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
trunk/src/mame/drivers/namcond1.c
r249051r249052
307307   /* sound hardware */
308308   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
309309
310   MCFG_C352_ADD("c352", XTAL_49_152MHz/2, 288)
310   MCFG_C352_ADD("c352", XTAL_49_152MHz/2, C352_DIVIDER_288)
311311   MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
312312   MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
313313   MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
trunk/src/mame/drivers/namcos10.c
r249051r249052
474474READ16_MEMBER(namcos10_state::i2c_clock_r)
475475{
476476   UINT16 res = i2c_dev_clock & i2c_host_clock & 1;
477   //  logerror("i2c_clock_r %d (%x)\n", res, space.device().safe_pc());
477   //   logerror("i2c_clock_r %d (%x)\n", res, space.device().safe_pc());
478478   return res;
479479}
480480
r249051r249052
482482WRITE16_MEMBER(namcos10_state::i2c_clock_w)
483483{
484484   COMBINE_DATA(&i2c_host_clock);
485   //  logerror("i2c_clock_w %d (%x)\n", data, space.device().safe_pc());
485   //   logerror("i2c_clock_w %d (%x)\n", data, space.device().safe_pc());
486486   i2c_update();
487487}
488488
489489READ16_MEMBER(namcos10_state::i2c_data_r)
490490{
491491   UINT16 res = i2c_dev_data & i2c_host_data & 1;
492   //  logerror("i2c_data_r %d (%x)\n", res, space.device().safe_pc());
492   //   logerror("i2c_data_r %d (%x)\n", res, space.device().safe_pc());
493493   return res;
494494}
495495
r249051r249052
497497WRITE16_MEMBER(namcos10_state::i2c_data_w)
498498{
499499   COMBINE_DATA(&i2c_host_data);
500   //  logerror("i2c_data_w %d (%x)\n", data, space.device().safe_pc());
500   //   logerror("i2c_data_w %d (%x)\n", data, space.device().safe_pc());
501501   i2c_update();
502502}
503503
r249051r249052
524524         i2cp_mode = I2CP_IDLE;
525525      } else if(clock && !i2c_prev_clock) {
526526         i2c_byte |= (data << i2c_bit);
527         //          logerror("i2c_byte = %02x (%d)\n", i2c_byte, i2c_bit);
527         //         logerror("i2c_byte = %02x (%d)\n", i2c_byte, i2c_bit);
528528         i2c_bit--;
529529         if(i2c_bit < 0) {
530530            i2cp_mode = I2CP_RECIEVE_ACK_1;
r249051r249052
536536      break;
537537   case I2CP_RECIEVE_ACK_1:
538538      if(clock && !i2c_prev_clock) {
539         //          logerror("i2c ack on\n");
539         //         logerror("i2c ack on\n");
540540         i2cp_mode = I2CP_RECIEVE_ACK_0;
541541      }
542542      break;
543543   case I2CP_RECIEVE_ACK_0:
544544      if(!clock && i2c_prev_clock) {
545         //          logerror("i2c ack off\n");
545         //         logerror("i2c ack off\n");
546546         i2c_dev_data = 1;
547547         data = i2c_host_data & 1;
548548         i2c_byte = 0;
r249051r249052
574574   printf("crypto_switch_w: %04x\n", data);
575575   if (decrypter == 0)
576576      return;
577
577   
578578   if (BIT(data, 15) != 0)
579579      decrypter->activate(data & 0xf);
580580   else
r249051r249052
628628
629629   //  logerror("read %08x = %04x\n", nand_address*2, data);
630630   // printf("read %08x = %04x\n", nand_address*2, data);
631     
631632
632
633633/*  printf( "data<-%08x (%08x)\n", data, nand_address ); */
634634   nand_address++;
635635
636636   if (decrypter == 0)
637637      return data;
638
638   
639639   if (decrypter->is_active())
640640      return decrypter->decrypt(data);
641641   else
trunk/src/mame/drivers/namcos11.c
r249051r249052
571571
572572   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
573573
574   MCFG_C352_ADD("c352", 20013200, 228)
574   MCFG_C352_ADD("c352", 20013200, C352_DIVIDER_228)
575575   MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
576576   MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
577577   MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
trunk/src/mame/drivers/namcos12.c
r249051r249052
16221622   /* sound hardware */
16231623   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
16241624
1625   MCFG_C352_ADD("c352", 29168000, 332)
1625   MCFG_C352_ADD("c352", 29168000, C352_DIVIDER_332)
16261626   MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
16271627   MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
16281628   MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
r249051r249052
18781878   PORT_BIT( 0x7eff, IP_ACTIVE_LOW, IPT_UNKNOWN )
18791879
18801880   PORT_START("IN23")
1881   PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_COIN1 ) // coin switch
1881   PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_COIN1 )   // coin switch
18821882   PORT_BIT(0xf7ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
18831883
18841884   PORT_START("SERVICE")
r249051r249052
30003000GAME( 1998, ehrgeizja, ehrgeiz,  coh700,   namcos12, namcos12_state, namcos12, ROT0, "Square / Namco",  "Ehrgeiz (Japan, EG1/VER.A)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) /* KC021 */
30013001GAME( 1998, mdhorse,   0,        coh700,   namcos12, namcos12_state, namcos12, ROT0, "MOSS / Namco",    "Derby Quiz My Dream Horse (Japan, MDH1/VER.A2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) /* KC035 */
30023002GAME( 1998, sws98,     0,        coh700,   namcos12, namcos12_state, namcos12, ROT0, "Namco",           "Super World Stadium '98 (Japan, SS81/VER.A)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) /* KC0?? */
3003GAME( 1998, technodr,  0,        technodr, technodr, namcos12_state, namcos12, ROT0, "Namco",           "Techno Drive (Japan, TD2/VER.B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) /* KC056 */
3003GAME( 1998, technodr,  0,        technodr, technodr, namcos12_state, namcos12, ROT0, "Namco",         "Techno Drive (Japan, TD2/VER.B)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) /* KC056 */
30043004GAME( 1998, tenkomor,  0,        coh700,   namcos12, namcos12_state, namcos12, ROT90,"Namco",           "Tenkomori Shooting (Asia, TKM2/VER.A1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) /* KC036 */
30053005GAME( 1998, tenkomorja,tenkomor, coh700,   namcos12, namcos12_state, namcos12, ROT90,"Namco",           "Tenkomori Shooting (Japan, TKM1/VER.A1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) /* KC036 */
30063006GAME( 1998, fgtlayer,  0,        coh700,   namcos12, namcos12_state, namcos12, ROT0, "Arika / Namco",   "Fighting Layer (Japan, FTL1/VER.A)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) /* KC037 */
trunk/src/mame/drivers/namcos22.c
r249051r249052
37813781   /* sound hardware */
37823782   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
37833783
3784   MCFG_C352_ADD("c352", SS22_MASTER_CLOCK/2, 288)
3784   MCFG_C352_ADD("c352", SS22_MASTER_CLOCK/2, C352_DIVIDER_288)
37853785   MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
37863786   MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
37873787   MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
r249051r249052
38303830   /* sound hardware */
38313831   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
38323832
3833   MCFG_C352_ADD("c352", SS22_MASTER_CLOCK/2, 288)
3833   MCFG_C352_ADD("c352", SS22_MASTER_CLOCK/2, C352_DIVIDER_288)
38343834   MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
38353835   MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
38363836   MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
trunk/src/mame/drivers/namcos23.c
r249051r249052
12471247#define JVSCLOCK    (XTAL_14_7456MHz)
12481248#define H8CLOCK     (16737350)      /* from 2061 */
12491249#define BUSCLOCK    (16737350*2)    /* 33MHz CPU bus clock / input */
1250#define C352CLOCK   (25992000)  /* measured at 25.992MHz from 2061 pin 9  */
1251#define C352DIV      (296)
1250#define C352CLOCK   (25992000)  /* measured at 25.992MHz from 2061 pin 9 (System 12 uses a divider of 332) */
12521251#define VSYNC1      (59.8824)
12531252#define VSYNC2      (59.915)
12541253#define HSYNC       (16666150)
r249051r249052
33213320   /* sound hardware */
33223321   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
33233322
3324   MCFG_C352_ADD("c352", C352CLOCK, C352DIV)
3323   MCFG_C352_ADD("c352", C352CLOCK, C352_DIVIDER_332)
33253324   MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
33263325   MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
33273326   MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
r249051r249052
33903389   /* sound hardware */
33913390   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
33923391
3393   MCFG_C352_ADD("c352", C352CLOCK, C352DIV)
3392   MCFG_C352_ADD("c352", C352CLOCK, C352_DIVIDER_332)
33943393   MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
33953394   MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
33963395   MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
r249051r249052
34703469   /* sound hardware */
34713470   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
34723471
3473   MCFG_C352_ADD("c352", C352CLOCK, C352DIV)
3472   MCFG_C352_ADD("c352", C352CLOCK, C352_DIVIDER_332)
34743473   MCFG_SOUND_ROUTE(0, "rspeaker", 1.00)
34753474   MCFG_SOUND_ROUTE(1, "lspeaker", 1.00)
34763475   MCFG_SOUND_ROUTE(2, "rspeaker", 1.00)
trunk/src/mame/drivers/naomi.c
r249051r249052
10011001|--------------------|
10021002Notes:
10031003      This is the I/O board used in Dynamic Golf, Out Trigger, Shootout Pool,
1004      Shootout Pool Prize, Kick'4'Cash, Crackin' DJ 1&2
1004      Shootout Pool Prize, Kick'4'Cash, Crackin' DJ 1&2
10051005      for the trackballs and other rotary type game controls.
10061006      It must be daisy-chained to the normal I/O board with a USB cable.
10071007
r249051r249052
50915091   NAOMI_BIOS
50925092   NAOMI_DEFAULT_EEPROM
50935093
5094      ROM_REGION( 0x10000, "io_board", 0)
5094        ROM_REGION( 0x10000, "io_board", 0)
50955095   ROM_LOAD("epr-22084.ic3", 0x0000, 0x10000, CRC(18cf58bb) SHA1(1494f8215231929e41bbe2a133658d01882fbb0f) )
50965096
50975097   ROM_REGION( 0xa000000, "rom_board", ROMREGION_ERASEFF)
trunk/src/mame/drivers/norautp.c
r249051r249052
34373437*/
34383438
34393439ROM_START( pkii_dm )
3440   ROM_REGION( 0x10000, "maincpu", 0 ) // no stack, call's RET go to PC=0
3441   ROM_LOAD( "12.u12", 0x0000, 0x1000, CRC(048e70d8) SHA1(f0eb16ba68455638de2ce68f51f305a13d0df287) )
3442   ROM_LOAD( "13.u18", 0x1000, 0x1000, CRC(06cf6789) SHA1(587d883c399348b518e3be4d1dc2581824055328) )
3440    ROM_REGION( 0x10000, "maincpu", 0 ) // no stack, call's RET go to PC=0
3441    ROM_LOAD( "12.u12", 0x0000, 0x1000, CRC(048e70d8) SHA1(f0eb16ba68455638de2ce68f51f305a13d0df287) )
3442    ROM_LOAD( "13.u18", 0x1000, 0x1000, CRC(06cf6789) SHA1(587d883c399348b518e3be4d1dc2581824055328) )
34433443
3444   ROM_REGION( 0x1000,  "gfx", 0 )
3445   ROM_FILL(                 0x0000, 0x0800, 0xff )
3446   ROM_LOAD( "cgw-f506.u31", 0x0800, 0x0800, CRC(412fc492) SHA1(094ea0ffd0c22274cfe164f07c009ffe022331fd) )
3444    ROM_REGION( 0x1000,  "gfx", 0 )
3445    ROM_FILL(                 0x0000, 0x0800, 0xff )
3446    ROM_LOAD( "cgw-f506.u31", 0x0800, 0x0800, CRC(412fc492) SHA1(094ea0ffd0c22274cfe164f07c009ffe022331fd) )
34473447
3448   ROM_REGION( 0x0200,  "proms", 0 )
3449   ROM_LOAD( "63s141n.u51",  0x0000, 0x0100, CRC(88302127) SHA1(aed1273974917673405f1234ab64e6f8b3856c34) )
3448    ROM_REGION( 0x0200,  "proms", 0 )
3449    ROM_LOAD( "63s141n.u51",  0x0000, 0x0100, CRC(88302127) SHA1(aed1273974917673405f1234ab64e6f8b3856c34) )
34503450ROM_END
34513451
34523452
trunk/src/mame/drivers/pacman.c
r249051r249052
69136913GAME( 1981, maketrax, crush,    pacmanp,  maketrax, pacman_state,  maketrax, ROT270, "Alpha Denshi Co. / Kural (Williams license)", "Make Trax (US set 1)", MACHINE_SUPPORTS_SAVE )
69146914GAME( 1981, maketrxb, crush,    pacmanp,  maketrax, pacman_state,  maketrax, ROT270, "Alpha Denshi Co. / Kural (Williams license)", "Make Trax (US set 2)", MACHINE_SUPPORTS_SAVE )
69156915GAME( 1981, korosuke, crush,    pacmanp,  korosuke, pacman_state,  korosuke, ROT90,  "Alpha Denshi Co. / Kural Electric, Ltd.", "Korosuke Roller (Japan)", MACHINE_SUPPORTS_SAVE )
6916GAME( 1981, crushrlf, crush,    pacman,   maketrax, driver_device, 0,        ROT90,  "bootleg", "Crush Roller (Famaresa PCB)", MACHINE_SUPPORTS_SAVE )
6916GAME( 1981, crushrlf, crush,    pacman,   maketrax, driver_device, 0,        ROT90,  "bootleg", "Crush Roller (Famaresa PCB)", MACHINE_SUPPORTS_SAVE )
69176917GAME( 1981, crushbl,  crush,    pacman,   maketrax, driver_device, 0,        ROT90,  "bootleg", "Crush Roller (bootleg set 1)", MACHINE_SUPPORTS_SAVE )
69186918GAME( 1981, crushbl2, crush,    pacmanp,  mbrush,   pacman_state,  maketrax, ROT90,  "bootleg", "Crush Roller (bootleg set 2)", MACHINE_SUPPORTS_SAVE )
69196919GAME( 1981, crushbl3, crush,    pacmanp,  mbrush,   pacman_state,  maketrax, ROT90,  "bootleg", "Crush Roller (bootleg set 3)", MACHINE_SUPPORTS_SAVE )
trunk/src/mame/drivers/quantum.c
r249051r249052
334334   /* AVG PROM */
335335   ROM_REGION( 0x100, "user1", 0 )
336336   ROM_LOAD( "136002-125.6h",   0x0000, 0x0100, BAD_DUMP CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) )
337
338   ROM_REGION( 0x200, "plds", 0 )
339   ROM_LOAD( "137290-001.1b",   0x0000, 0x0117, CRC(938a4598) SHA1(e5b6ddb1b4bb5546d3a0da5d00ce7c57a9e8e769) ) // GAL16V8
340337ROM_END
341338
342339
r249051r249052
355352   /* AVG PROM */
356353   ROM_REGION( 0x100, "user1", 0 )
357354   ROM_LOAD( "136002-125.6h",   0x0000, 0x0100, BAD_DUMP CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) )
358
359   ROM_REGION( 0x200, "plds", 0 )
360   ROM_LOAD( "137290-001.1b",   0x0000, 0x0117, CRC(938a4598) SHA1(e5b6ddb1b4bb5546d3a0da5d00ce7c57a9e8e769) ) // GAL16V8
361355ROM_END
362356
363357
r249051r249052
376370   /* AVG PROM */
377371   ROM_REGION( 0x100, "user1", 0 )
378372   ROM_LOAD( "136002-125.6h",   0x0000, 0x0100, BAD_DUMP CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) )
379
380   ROM_REGION( 0x200, "plds", 0 )
381   ROM_LOAD( "137290-001.1b",   0x0000, 0x0117, CRC(938a4598) SHA1(e5b6ddb1b4bb5546d3a0da5d00ce7c57a9e8e769) ) // GAL16V8
382373ROM_END
383374
384375
trunk/src/mame/drivers/rollext.c
r249051r249052
11// license:BSD-3-Clause
22// copyright-holders:Ville Linde
33/*
4    Rolling Extreme
5    Gaelco, 1999
4   Rolling Extreme
5   Gaelco, 1999
66
7    PCB Layout
8    ----------
7   PCB Layout
8   ----------
99
1010    REF.991015
1111      |--------------------------------------------------|
r249051r249052
3939
4040/*
4141
42    MP Interrupts:
42   MP Interrupts:
4343
44        External Interrupt 1:       0x4003ef78
45        External Interrupt 2:       -
46        External Interrupt 3:       0x40041d30
47        Memory Fault:               0x40043ae8
44      External Interrupt 1:      0x4003ef78
45      External Interrupt 2:      -
46      External Interrupt 3:      0x40041d30
47      Memory Fault:            0x40043ae8
4848
49    PP0 Interrupts:
50        Task:                       0x400010a0 / 0x400001a0
49   PP0 Interrupts:
50      Task:                  0x400010a0 / 0x400001a0
5151
52    PP1 Interrupts:
53        Task:                       0x4004c6e8
52   PP1 Interrupts:
53      Task:                  0x4004c6e8
5454
5555
56    Memory locations:
56   Memory locations:
5757
58        [0x00000084] PP0 busy flag?
59        [0x00000090] PP0 fifo write pointer?
60        [0x00000094] PP0 fifo read pointer?
61        [0x00000320] 2000000-TCOUNT in XINT3 handler
62        [0x01010668] copied from (word)0xb0000004 in XINT3 handler
58      [0x00000084] PP0 busy flag?
59      [0x00000090] PP0 fifo write pointer?
60      [0x00000094] PP0 fifo read pointer?
61      [0x00000320] 2000000-TCOUNT in XINT3 handler
62      [0x01010668] copied from (word)0xb0000004 in XINT3 handler
6363
6464
65    Texture ROM decode:
65   Texture ROM decode:
6666
67      {ic45}     {ic47}     {ic58}     {ic60}
68    [2,0][0,0] [2,1][0,1] [3,0][1,0] [3,1][1,1]
67      {ic45}     {ic47}     {ic58}     {ic60}
68   [2,0][0,0] [2,1][0,1] [3,0][1,0] [3,1][1,1]
6969
7070*/
7171
r249051r249052
231231         y[j] = (int)((u2f(iy) / 2.0f) + 192.0f);
232232      }
233233
234
234     
235235      draw_line(bitmap, cliprect, x[0], y[0], x[1], y[1]);
236236      draw_line(bitmap, cliprect, x[1], y[1], x[2], y[2]);
237237      draw_line(bitmap, cliprect, x[3], y[3], x[2], y[2]);
238238      draw_line(bitmap, cliprect, x[0], y[0], x[3], y[3]);
239
239     
240240   }
241241
242242   m_disp_ram[0xffffc/4] = 0;
r249051r249052
250250{
251251   switch (offset)
252252   {
253      case 0:         // ??
253      case 0:         // ??
254254      {
255255         UINT32 data = 0x20200;
256256
r249051r249052
276276{
277277   switch (offset)
278278   {
279      case 0:     // ??
279      case 0:      // ??
280280         return 0xffff;
281      case 1:     // ??
281      case 1:      // ??
282282         return 0;
283283   }
284284
r249051r249052
290290static ADDRESS_MAP_START(memmap, AS_PROGRAM, 32, rollext_state)
291291   AM_RANGE(0x40000000, 0x40ffffff) AM_RAM AM_SHARE("main_ram")
292292   AM_RANGE(0x60000000, 0x600fffff) AM_RAM AM_SHARE("disp_ram")
293   AM_RANGE(0x80000000, 0x8000ffff) AM_RAM AM_SHARE("palette_ram")
294   AM_RANGE(0x90000000, 0x9007ffff) AM_RAM AM_SHARE("texture_mask")
293   AM_RANGE(0x80000000, 0x8000ffff) AM_RAM   AM_SHARE("palette_ram")
294   AM_RANGE(0x90000000, 0x9007ffff) AM_RAM   AM_SHARE("texture_mask")
295295   AM_RANGE(0xa0000000, 0xa00000ff) AM_READWRITE(a0000000_r, a0000000_w)
296296   AM_RANGE(0xb0000000, 0xb0000007) AM_READ(b0000000_r)
297297   AM_RANGE(0xc0000000, 0xc03fffff) AM_ROM AM_REGION("rom1", 0)
r249051r249052
355355   ROM_REGION32_BE(0x400000, "rom1", 0)
356356   ROM_LOAD32_DWORD("roe.ic38", 0x000000, 0x400000, CRC(d9bcfb7c) SHA1(eda9870881732d4dc7cdacb65c6d40af3451dc9d))
357357
358   ROM_REGION32_BE(0x2000000, "texture", 0)            // Texture ROMs
358   ROM_REGION32_BE(0x2000000, "texture", 0)         // Texture ROMs
359359   ROM_LOAD32_BYTE("roe.ic45", 0x000000, 0x800000, CRC(0f7fe365) SHA1(ed50fd2b76840eac6ce394a0c748109f615b775a))
360360   ROM_LOAD32_BYTE("roe.ic47", 0x000001, 0x800000, CRC(44d7ccee) SHA1(2fec682396e4cca704bd1237016acec0e7b4b428))
361361   ROM_LOAD32_BYTE("roe.ic58", 0x000002, 0x800000, CRC(67ad4561) SHA1(56f41b4ebd827fec49902f377c5ed054c02d9e6c))
r249051r249052
363363ROM_END
364364
365365
366GAME( 1999, rollext, 0, rollext, rollext, rollext_state, rollext, ROT0, "Gaelco", "ROLLing eX.tre.me", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
366GAME( 1999, rollext, 0, rollext, rollext, rollext_state, rollext, ROT0, "Gaelco", "ROLLing eX.tre.me", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
No newline at end of file
trunk/src/mame/drivers/royalmah.c
r249051r249052
36123612   ROM_LOAD( "s2.bin", 0x14000, 0x4000, CRC(fed42e7c) SHA1(31136dff07bd1883dc2d107823ba83a34abf003d) )
36133613
36143614   ROM_REGION( 0x0020, "proms", 0 )
3615   ROM_LOAD( "18s030n.6k", 0x0000, 0x0020, CRC(c074c0f0) SHA1(b62519d1496ea366b0ea8ed657bd758ce93875ec) )
3615   ROM_LOAD( "18s030n.6k", 0x0000, 0x0020, NO_DUMP )
36163616ROM_END
36173617
36183618ROM_START( janputer )
r249051r249052
49104910GAME( 1981?, openmj,   royalmj,  royalmah, royalmah, driver_device,  0,        ROT0,   "Sapporo Mechanic",           "Open Mahjong [BET] (Japan)",            0 )
49114911GAME( 1982,  royalmah, royalmj,  royalmah, royalmah, driver_device,  0,        ROT0,   "bootleg",                    "Royal Mahjong (Falcon bootleg, v1.01)", 0 )
49124912GAME( 1983,  janyoup2, royalmj,  ippatsu,  janyoup2, driver_device,  0,        ROT0,   "Cosmo Denshi",               "Janyou Part II (ver 7.03, July 1 1983)",0 )
4913GAME( 1985,  tahjong,  royalmj,  tahjong,  tahjong,  driver_device,  0,        ROT0,   "Bally Pond / Nasco",         "Tahjong Yakitori (ver. 2-1)",           0 ) // 1985 Jun. 17
4913GAME( 1985,  tahjong,  royalmj,  tahjong,  tahjong,  driver_device,  0,        ROT0,   "Bally Pond / Nasco",         "Tahjong Yakitori (ver. 2-1)",           MACHINE_WRONG_COLORS ) // 1985 Jun. 17
49144914GAME( 1981,  janputer, 0,        royalmah, royalmah, driver_device,  0,        ROT0,   "bootleg (Public Software Ltd. / Mes)", "New Double Bet Mahjong (bootleg of Janputer)", 0 ) // the original Janputer (Sanritsu) is not yet dumped
49154915GAME( 1984,  janoh,    0,        royalmah, royalmah, driver_device,  0,        ROT0,   "Toaplan",                    "Jan Oh (set 1)",                        MACHINE_NOT_WORKING )
49164916GAME( 1984,  janoha,   janoh,    janoh,    royalmah, driver_device,  0,        ROT0,   "Toaplan",                    "Jan Oh (set 2)",                        MACHINE_NOT_WORKING ) // this one is complete?
trunk/src/mame/drivers/seattle.c
r249051r249052
27562756   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code Version L1.2 (10/8/96) */
27572757   ROM_LOAD( "wg3dh_12.u32", 0x000000, 0x80000, CRC(15e4cea2) SHA1(72c0db7dc53ce645ba27a5311b5ce803ad39f131) )
27582758
2759   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2759   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
27602760
27612761   DISK_REGION( "ide:0:hdd:image" )    /* Hard Drive Version 1.3 (Guts 10/15/96, Main 10/15/96) */
27622762   DISK_IMAGE( "wg3dh", 0, SHA1(4fc6f25d7f043d9bcf8743aa8df1d9be3cbc375b) )
r249051r249052
27702770   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code Version 1.0ce 7/2/97 */
27712771   ROM_LOAD( "mace10ce.u32", 0x000000, 0x80000, CRC(7a50b37e) SHA1(33788835f84a9443566c80bee9f20a1691490c6d) )
27722772
2773   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2773   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
27742774
27752775   DISK_REGION( "ide:0:hdd:image" )    /* Hard Drive Version 1.0B 6/10/97 (Guts 7/2/97, Main 7/2/97) */
27762776   DISK_IMAGE( "mace", 0, SHA1(96ec8d3ff5dd894e21aa81403bcdbeba44bb97ea) )
r249051r249052
27842784   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code Version ??? 5/7/97 */
27852785   ROM_LOAD( "maceboot.u32", 0x000000, 0x80000, CRC(effe3ebc) SHA1(7af3ca3580d6276ffa7ab8b4c57274e15ee6bcbb) )
27862786
2787   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2787   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
27882788
27892789   DISK_REGION( "ide:0:hdd:image" )    /* Hard Drive Version 1.0a (Guts 6/9/97, Main 5/12/97) */
27902790   DISK_IMAGE( "macea", 0, BAD_DUMP SHA1(9bd4a60627915d71932cab24f89c48ea21f4c1cb) )
r249051r249052
27982798   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code Version L1.0 */
27992799   ROM_LOAD( "hdboot.u32", 0x000000, 0x80000, CRC(39a35f1b) SHA1(c46d83448399205d38e6e41dd56abbc362254254) )
28002800
2801   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2801   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
28022802
28032803   ROM_REGION32_LE( 0x200000, "cageboot", 0 )  /* TMS320C31 boot ROM  Version L1.0 */
28042804   ROM_LOAD32_BYTE( "sndboot.u69", 0x000000, 0x080000, CRC(7e52cdc7) SHA1(f735063e19d2ca672cef6d761a2a47df272e8c59) )
r249051r249052
28182818   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code */
28192819   ROM_LOAD( "boot.bin",   0x000000, 0x080000, CRC(0555b3cf) SHA1(a48abd6d06a26f4f9b6c52d8c0af6095b6be57fd) )
28202820
2821   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2821   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
28222822
28232823   ROM_REGION32_LE( 0x200000, "cageboot", 0 )  /* TMS320C31 boot ROM */
28242824   ROM_LOAD32_BYTE( "audboot.bin",    0x000000, 0x080000, CRC(c70c060d) SHA1(dd014bd13efdf5adc5450836bd4650351abefc46) )
r249051r249052
28382838   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code Version 1.2 (2/18/98) */
28392839   ROM_LOAD( "caspd1_2.u32", 0x000000, 0x80000, CRC(0a235e4e) SHA1(b352f10fad786260b58bd344b5002b6ea7aaf76d) )
28402840
2841   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2841   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
28422842
28432843   DISK_REGION( "ide:0:hdd:image" )    /* Release version 2.1a (4/17/98) (Guts 1.25 4/17/98, Main 4/17/98) */
28442844   DISK_IMAGE( "calspeed", 0, SHA1(08d411c591d4b8bbdd6437ea80d01c4cec8516f8) )
r249051r249052
28512851   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code Version 1.2 (2/18/98) */
28522852   ROM_LOAD( "caspd1_2.u32", 0x000000, 0x80000, CRC(0a235e4e) SHA1(b352f10fad786260b58bd344b5002b6ea7aaf76d) )
28532853
2854   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2854   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
28552855
28562856   DISK_REGION( "ide:0:hdd:image" )    /* Release version 1.0r8a (4/10/98) (Guts 4/10/98, Main 4/10/98) */
28572857   DISK_IMAGE( "cs_10r8a", 0, SHA1(ba4e7589740e0647938c81c5082bb71d8826bad4) )
r249051r249052
28642864   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code Version 1.2 (2/18/98) */
28652865   ROM_LOAD( "caspd1_2.u32", 0x000000, 0x80000, CRC(0a235e4e) SHA1(b352f10fad786260b58bd344b5002b6ea7aaf76d) )
28662866
2867   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2867   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
28682868
28692869   DISK_REGION( "ide:0:hdd:image" )    /* Release version 1.0r7a (3/4/98) (Guts 3/3/98, Main 1/19/98) */
28702870   DISK_IMAGE( "calspeda", 0, SHA1(6b1c3a7530195ef7309b06a651b01c8b3ece92c6) )
r249051r249052
28812881   ROM_REGION32_LE( 0x80000, "user1", 0 )
28822882   ROM_LOAD( "vtrxboot.bin", 0x000000, 0x80000, CRC(ee487a6c) SHA1(fb9efda85047cf615f24f7276a9af9fd542f3354) )
28832883
2884   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2884   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
28852885
28862886   DISK_REGION( "ide:0:hdd:image" )
28872887   DISK_IMAGE( "vaportrx", 0, SHA1(fe53ca7643d2ed2745086abb7f2243c69678cab1) )
r249051r249052
28952895   ROM_REGION32_LE( 0x80000, "user1", 0 )
28962896   ROM_LOAD( "vtrxboot.bin", 0x000000, 0x80000, CRC(ee487a6c) SHA1(fb9efda85047cf615f24f7276a9af9fd542f3354) )
28972897
2898   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2898   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
28992899
29002900   DISK_REGION( "ide:0:hdd:image" ) /* Guts: Apr 10 1998 11:03:14  Main: Apr 10 1998 11:27:44 */
29012901   DISK_IMAGE( "vaportrp", 0, SHA1(6c86637c442ebd6994eee8c0ae0dce343c35dbe9) )
r249051r249052
29092909   ROM_REGION16_LE( 0x10000, "dcs", 0 )    /* ADSP-2115 data Version 1.02 */
29102910   ROM_LOAD16_BYTE( "sound102.u95", 0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
29112911
2912   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2912   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
29132913
29142914   ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Seattle System Boot ROM Version 0.1i Apr 14 1997  14:52:53 */
29152915   ROM_LOAD( "biofreak.u32", 0x000000, 0x80000, CRC(cefa00bb) SHA1(7e171610ede1e8a448fb8d175f9cb9e7d549de28) )
r249051r249052
29232923   ROM_REGION16_LE( 0x10000, "dcs", 0 )    /* ADSP-2115 data Version 1.02 */
29242924   ROM_LOAD16_BYTE( "sound102.u95", 0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
29252925
2926   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2926   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
29272927
29282928   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code Version 1.2 */
29292929   ROM_LOAD( "blitz1_2.u32", 0x000000, 0x80000, CRC(38dbecf5) SHA1(7dd5a5b3baf83a7f8f877ff4cd3f5e8b5201b36f) )
r249051r249052
29372937   ROM_REGION16_LE( 0x10000, "dcs", 0 )    /* ADSP-2115 data Version 1.02 */
29382938   ROM_LOAD16_BYTE( "sound102.u95", 0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
29392939
2940   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2940   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
29412941
29422942   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code Version 1.1 */
29432943   ROM_LOAD( "blitz1_1.u32", 0x000000, 0x80000, CRC(8163ce02) SHA1(89b432d8879052f6c5534ee49599f667f50a010f) )
r249051r249052
29512951   ROM_REGION16_LE( 0x10000, "dcs", 0 )    /* ADSP-2115 data Version 1.02 */
29522952   ROM_LOAD16_BYTE( "sound102.u95", 0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
29532953
2954   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2954   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
29552955
29562956   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code Version 1.0 */
29572957   ROM_LOAD( "bltz9910.u32", 0x000000, 0x80000, CRC(777119b2) SHA1(40d255181c2f3a787919c339e83593fd506779a5) )
r249051r249052
29702970   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF ) // to use this rom run with -bios up130 and go into TEST mode to update.
29712971   ROM_SYSTEM_BIOS( 0, "noupdate",       "No Update Rom" )
29722972   ROM_SYSTEM_BIOS( 1, "up130",       "Update to 1.30" )
2973   ROMX_LOAD( "rev.-1.3.u33", 0x000000, 0x100000, CRC(0a0fde5a) SHA1(1edb671c66819f634a9f1daa35331a99b2bda01a), ROM_BIOS(2) )
2973   ROMX_LOAD( "rev.-1.3.u33", 0x000000, 0x100000, CRC(0a0fde5a) SHA1(1edb671c66819f634a9f1daa35331a99b2bda01a), ROM_BIOS(2) )   
29742974
29752975   DISK_REGION( "ide:0:hdd:image" )    /* Hard Drive Version 1.30 */
29762976   DISK_IMAGE( "blitz99a", 0, SHA1(43f834727ce01d7a63b482fc28cbf292477fc6f2) )
r249051r249052
29812981   ROM_REGION16_LE( 0x10000, "dcs", 0 )    /* ADSP-2115 data Version 1.02 */
29822982   ROM_LOAD16_BYTE( "sound102.u95", 0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
29832983
2984   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2984   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
29852985
29862986   ROM_REGION32_LE( 0x80000, "user1", 0 )  /* Boot Code Version 1.4 */
29872987   ROM_LOAD( "bltz2k14.u32", 0x000000, 0x80000, CRC(ac4f0051) SHA1(b8125c17370db7bfd9b783230b4ef3d5b22a2025) )
r249051r249052
29952995   ROM_REGION16_LE( 0x10000, "dcs", 0 )    /* ADSP-2115 data Version 1.02 */
29962996   ROM_LOAD16_BYTE( "sound102.u95", 0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
29972997
2998   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
2998   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
29992999
30003000   ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Rom Version 1.9 */
30013001   ROM_LOAD( "carnevil1_9.u32", 0x000000, 0x80000, CRC(82c07f2e) SHA1(fa51c58022ce251c53bad12fc6ffadb35adb8162) )
r249051r249052
30093009   ROM_REGION16_LE( 0x10000, "dcs", 0 )    /* ADSP-2115 data Version 1.02 */
30103010   ROM_LOAD16_BYTE( "sound102.u95", 0x000000, 0x8000, CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
30113011
3012   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
3012   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
30133013
30143014   ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Rom Version 1.9 */
30153015   ROM_LOAD( "carnevil1_9.u32", 0x000000, 0x80000, CRC(82c07f2e) SHA1(fa51c58022ce251c53bad12fc6ffadb35adb8162) )
r249051r249052
30233023   ROM_REGION16_LE( 0x10000, "dcs", 0 )    /* ADSP-2115 data Version 1.02 */
30243024   ROM_LOAD16_BYTE( "seattle.snd", 0x000000, 0x8000, BAD_DUMP CRC(bec7d3ae) SHA1(db80aa4a645804a4574b07b9f34dec6b6b64190d) )
30253025
3026   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
3026   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
30273027
30283028   ROM_REGION32_LE( 0x80000, "user1", 0 ) /* Boot Rom Version 9. */
30293029   ROM_LOAD( "hyprdrve.u32", 0x000000, 0x80000, CRC(3e18cb80) SHA1(b18cc4253090ee1d65d72a7ec0c426ed08c4f238) )
trunk/src/mame/drivers/simpsons.c
r249051r249052
346346   MCFG_SCREEN_ADD("screen", RASTER)
347347   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240)
348348//  6MHz dotclock is more realistic, however needs drawing updates. replace when ready
349//  MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
349//   MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
350350   MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
351351   MCFG_SCREEN_UPDATE_DRIVER(simpsons_state, screen_update_simpsons)
352352   MCFG_SCREEN_PALETTE("palette")
trunk/src/mame/drivers/spcforce.c
r249051r249052
272272
273273INTERRUPT_GEN_MEMBER(spcforce_state::vblank_irq)
274274{
275
275276   if(m_irq_mask)
276277      device.execute().set_input_line(3, HOLD_LINE);
277278}
trunk/src/mame/drivers/thedealr.c
r249051r249052
1010    P0-040A PCB:
1111
1212    R65C02P2 x 2
13    X0-009 (Intel 8742 MCU)
13    X0-009 (Intel 8742 MCU?)
1414
1515    X1-001
1616    X1-002
r249051r249052
110110
111111/***************************************************************************
112112
113    IOX (i8742 MCU) Simulation
113    IOX (i8742 MCU?) Simulation
114114
115115***************************************************************************/
116116
r249051r249052
574574   ROM_REGION( 0x10000, "subcpu", 0 )
575575   ROM_LOAD( "xb3_002", 0x00000, 0x10000, CRC(53a37fa4) SHA1(2adfea2dd08f298cda885bc72606d03f8af886a0) )
576576
577   // To do: hook up
578   ROM_REGION( 0x0800, "iocpu", 0 )
579   ROM_LOAD( "x0-009",  0x0000, 0x0800, CRC(e8b86d5a) SHA1(ad12e8f4411c30cd691792c6b0b3429db786d8b5) )
580
581577   ROM_REGION( 0x100000, "gfx1", 0 )
582578   ROM_LOAD( "xb0-002-w45.u42", 0x00000, 0x80000, CRC(41ec6a57) SHA1(d3f0508d5f4054fd2b0ee5227325a95fd1272aad) )
583579   ROM_LOAD( "xb0-001-w44.u41", 0x80000, 0x80000, CRC(bdaca555) SHA1(5ae1dc1514993fd804a101182735d5fb6815f720) )
trunk/src/mame/drivers/toaplan2.c
r249051r249052
18971897   PORT_CONFSETTING(       0x0040, DEF_STR( Hong_Kong ) )
18981898   PORT_CONFSETTING(       0x0050, DEF_STR( Taiwan ) )
18991899   PORT_CONFSETTING(       0x0060, DEF_STR( Southeast_Asia ) )
1900   PORT_CONFSETTING(       0x0070, DEF_STR( Unused ) )
1901   PORT_CONFSETTING(       0x0080, DEF_STR( Japan ) ) // no Taito license
1900    PORT_CONFSETTING(       0x0070, DEF_STR( Unused ) )
1901    PORT_CONFSETTING(       0x0080, DEF_STR( Japan ) ) // no Taito license
19021902   PORT_CONFSETTING(       0x0090, DEF_STR( Unused ) )
19031903   PORT_CONFSETTING(       0x00a0, DEF_STR( Unused ) )
1904   PORT_CONFSETTING(       0x00b0, DEF_STR( Korea ) )
1905   PORT_CONFSETTING(       0x00c0, DEF_STR( Hong_Kong ))
1906   PORT_CONFSETTING(       0x00d0, DEF_STR( Taiwan ))
1907   PORT_CONFSETTING(       0x00e0, DEF_STR( Southeast_Asia ))
1908   PORT_CONFSETTING(       0x00f0, DEF_STR( Unused ) )
1904    PORT_CONFSETTING(       0x00b0, DEF_STR( Korea ) )
1905    PORT_CONFSETTING(       0x00c0, DEF_STR( Hong_Kong ))
1906    PORT_CONFSETTING(       0x00d0, DEF_STR( Taiwan ))
1907    PORT_CONFSETTING(       0x00e0, DEF_STR( Southeast_Asia ))
1908    PORT_CONFSETTING(       0x00f0, DEF_STR( Unused ) )
19091909INPUT_PORTS_END
19101910
19111911static INPUT_PORTS_START( kbash2 )
trunk/src/mame/drivers/vegas.c
r249051r249052
24542454 *
24552455 *************************************/
24562456
2457   // there is a socket next to the main bios roms for updates, this is what the update region is.
2457 // there is a socket next to the main bios roms for updates, this is what the update region is.
24582458
24592459
24602460ROM_START( gauntleg )
r249051r249052
24752475   ROM_REGION32_LE( 0x80000, "user1", 0 )
24762476   ROM_LOAD( "legend13.bin", 0x000000, 0x80000, CRC(34674c5f) SHA1(92ec1779f3ab32944cbd953b6e1889503a57794b) ) //  EPROM Boot code. Version: Sep 25 1998 18:34:43 / 1.3 Sep 25 1998 18:33:45
24772477   ROM_LOAD( "legend14.bin", 0x000000, 0x80000, CRC(66869402) SHA1(bf470e0b9198b80f8baf8b9432a7e1df8c7d18ca) ) //  EPROM Boot code. Version: Oct 30 1998 17:48:21 / 1.4 Oct 30 1998 17:44:29
2478
2478   
24792479   ROM_REGION32_LE( 0x100000, "update", ROMREGION_ERASEFF )
24802480   ROM_SYSTEM_BIOS( 0, "noupdate",       "No Update Rom" )
24812481
24822482   ROM_SYSTEM_BIOS( 1, "up16_1",       "Disk Update 1.2 to 1.6 Step 1 of 3" )
2483   ROMX_LOAD("12to16.1.bin", 0x000000, 0x100000, CRC(253c6bf2) SHA1(5e129576afe2bc4c638242e010735655d269a747), ROM_BIOS(2))
2483   ROMX_LOAD("12to16.1.bin", 0x000000, 0x100000, CRC(253c6bf2) SHA1(5e129576afe2bc4c638242e010735655d269a747), ROM_BIOS(2))   
24842484   ROM_SYSTEM_BIOS( 2, "up16_2",       "Disk Update 1.2 to 1.6 Step 2 of 3" )
2485   ROMX_LOAD("12to16.2.bin", 0x000000, 0x100000, CRC(15b1fe78) SHA1(532c4937b55befcc3a8cb25b0282d63e206fba47), ROM_BIOS(3))
2485   ROMX_LOAD("12to16.2.bin", 0x000000, 0x100000, CRC(15b1fe78) SHA1(532c4937b55befcc3a8cb25b0282d63e206fba47), ROM_BIOS(3))   
24862486   ROM_SYSTEM_BIOS( 3, "up16_3",       "Disk Update 1.2 to 1.6 Step 3 of 3" )
2487   ROMX_LOAD("12to16.3.bin", 0x000000, 0x100000, CRC(1027e54f) SHA1(a841f5cc5b022ddfaf70c97a64d1582f0a2ca70e), ROM_BIOS(4))
2487   ROMX_LOAD("12to16.3.bin", 0x000000, 0x100000, CRC(1027e54f) SHA1(a841f5cc5b022ddfaf70c97a64d1582f0a2ca70e), ROM_BIOS(4))   
24882488
24892489
24902490
trunk/src/mame/drivers/xyonix.c
r249051r249052
274274/* GAME drivers **************************************************************/
275275
276276GAME( 1989, xyonix, 0, xyonix, xyonix, driver_device, 0, ROT0, "Philko", "Xyonix", MACHINE_SUPPORTS_SAVE )
277   
trunk/src/mame/drivers/zaccaria.c
r249051r249052
506506   MCFG_CPU_ADD("maincpu", Z80,XTAL_18_432MHz/6)   /* verified on pcb */
507507   MCFG_CPU_PROGRAM_MAP(main_map)
508508   MCFG_CPU_VBLANK_INT_DRIVER("screen", zaccaria_state,  vblank_irq)
509//   MCFG_QUANTUM_TIME(attotime::from_hz(1000000))
509   MCFG_QUANTUM_TIME(attotime::from_hz(1000000))
510510
511511   MCFG_CPU_ADD("audiocpu", M6802,XTAL_3_579545MHz) /* verified on pcb */
512512   MCFG_CPU_PROGRAM_MAP(sound_map_1)
513513   MCFG_CPU_PERIODIC_INT_DRIVER(zaccaria_state, cb1_toggle, (double)XTAL_3_579545MHz/4096)
514//   MCFG_QUANTUM_TIME(attotime::from_hz(1000000))
514   MCFG_QUANTUM_TIME(attotime::from_hz(1000000))
515515
516516   MCFG_CPU_ADD("audio2", M6802,XTAL_3_579545MHz) /* verified on pcb */
517517   MCFG_CPU_PROGRAM_MAP(sound_map_2)
518//   MCFG_QUANTUM_TIME(attotime::from_hz(1000000))
518   MCFG_QUANTUM_TIME(attotime::from_hz(1000000))
519519
520520   MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
521521   MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
trunk/src/mame/includes/chihiro.h
r249051r249052
185185      memset(pfifo, 0, sizeof(pfifo));
186186      memset(pcrtc, 0, sizeof(pcrtc));
187187      memset(pmc, 0, sizeof(pmc));
188      memset(pgraph, 0, sizeof(pgraph));
189188      memset(ramin, 0, sizeof(ramin));
190189      computedilated();
191190      objectdata = &(object_data_alloc());
r249051r249052
195194      enabled_vertex_attributes = 0;
196195      indexesleft_count = 0;
197196      vertex_pipeline = 4;
198      color_mask = 0xffffffff;
199197      alpha_test_enabled = false;
200198      alpha_reference = 0;
201199      alpha_func = nv2a_renderer::ALWAYS;
r249051r249052
240238   }
241239   DECLARE_READ32_MEMBER(geforce_r);
242240   DECLARE_WRITE32_MEMBER(geforce_w);
243   void vblank_callback(screen_device &screen, bool state);
241   bool vblank_callback(screen_device &screen, bool state);
244242   UINT32 screen_update_callback(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
245   bool update_interrupts();
246   void set_interrupt_device(pic8259_device *device);
247243
248244   void render_texture_simple(INT32 scanline, const extent_t &extent, const nvidia_object_data &extradata, int threadid);
249245   void render_color(INT32 scanline, const extent_t &extent, const nvidia_object_data &extradata, int threadid);
r249051r249052
307303   UINT32 pfifo[0x2000 / 4];
308304   UINT32 pcrtc[0x1000 / 4];
309305   UINT32 pmc[0x1000 / 4];
310   UINT32 pgraph[0x2000 / 4];
311306   UINT32 ramin[0x100000 / 4];
312307   UINT32 dma_offset[2];
313308   UINT32 dma_size[2];
314309   UINT8 *basemempointer;
315   pic8259_device *interruptdevice;
316310   rectangle limits_rendertarget;
317311   UINT32 pitch_rendertarget;
318312   UINT32 pitch_depthbuffer;
r249051r249052
447441      int used;
448442      osd_lock *lock;
449443   } combiner;
450   UINT32 color_mask;
451444   bool alpha_test_enabled;
452445   int alpha_func;
453446   int alpha_reference;
trunk/src/mame/includes/gaelco2.h
r249051r249052
107107   DECLARE_WRITE16_MEMBER(wrally2_adc_cs);
108108   DECLARE_CUSTOM_INPUT_MEMBER(wrally2_analog_bit_r);
109109};
110
trunk/src/mame/includes/hng64.h
r249051r249052
125125      m_com_ram(*this, "com_ram"),
126126      m_gfxdecode(*this, "gfxdecode"),
127127      m_screen(*this, "screen"),
128      m_palette(*this, "palette") { }
128      m_palette(*this, "palette")   { }
129129
130130   required_device<mips3_device> m_maincpu;
131131   required_device<v53a_device> m_audiocpu;
trunk/src/mame/includes/rocnrope.h
r249051r249052
2727
2828   tilemap_t *m_bg_tilemap;
2929   UINT8 m_irq_mask;
30
30   
3131   DECLARE_WRITE8_MEMBER(rocnrope_interrupt_vector_w);
3232   DECLARE_WRITE8_MEMBER(irq_mask_w);
3333   DECLARE_WRITE8_MEMBER(rocnrope_videoram_w);
trunk/src/mame/includes/xbox.h
r249051r249052
318318
319319ADDRESS_MAP_EXTERN(xbox_base_map, 32);
320320ADDRESS_MAP_EXTERN(xbox_base_map_io, 32);
321MACHINE_CONFIG_EXTERN(xbox_base);
321MACHINE_CONFIG_EXTERN(xbox_base);
No newline at end of file
trunk/src/mame/layout/aquastge.lay
r249051r249052
11<?xml version="1.0"?>
22<mamelayout version="2">
3
3   
44   <!-- exact ratio unknown, could be wider -->
55   <view name="Dual Wide Screens">
66      <screen index="0">
trunk/src/mame/layout/chexx.lay
r249051r249052
1<?xml version="1.0"?>
2<mamelayout version="2">
3
4   <!-- 7segs -->
5   <element name="digit">
6      <led7seg>
7         <color red="1.0" green="0.0" blue="0.0"/>
8   </led7seg>
9   </element>
10
11   <!-- Led -->
12   <element name="led" defstate="0">
13   <rect>
14      <bounds x="0" y="0" width="1.5" height="1.0"/>
15      <color red="1.0" green="0.96" blue="0.94"/>
16   </rect>
17   <rect state="0">
18      <bounds x="0.05" y="0.05" width="1.4" height="0.9"/>
19      <color red="0.5" green="0.0" blue="0.0"/>
20   </rect>
21   <rect state="1">
22      <bounds x="0.05" y="0.05" width="1.4" height="0.9"/>
23      <color red="1.0" green="0.0" blue="0.0"/>
24   </rect>
25   </element>
26
27   <!-- Lamp -->
28   <element name="lamp" defstate="0">
29   <disk state="0">
30      <color red="0.2" green="0.0" blue="0.0"/>
31   </disk>
32   <disk state="1">
33      <color red="1.0" green="0.0" blue="0.0"/>
34   </disk>
35   </element>
36
37   <view name="Score Board (No Artwork)">
38   <!-- P1 score -->
39   <backdrop name="digit0" element="digit">
40         <bounds x="0" y="0" width="1" height="2"/>
41      </backdrop>
42   <backdrop name="digit1" element="digit">
43      <bounds x="1" y="0" width="1" height="2"/>
44   </backdrop>
45
46   <!-- P1 goal lamp -->
47   <backdrop name="lamp0" element="lamp">
48      <bounds x="0.75" y="-0.5" width="0.5" height="0.5"/>
49   </backdrop>
50
51   <!-- Period being played -->
52   <backdrop name="led0" element="led">
53      <bounds x="3.0" y="-0.33" width="0.5" height="0.33"/>
54   </backdrop>
55   <backdrop name="led1" element="led">
56      <bounds x="3.5" y="-0.33" width="0.5" height="0.33"/>
57   </backdrop>
58   <backdrop name="led2" element="led">
59      <bounds x="4.0" y="-0.33" width="0.5" height="0.33"/>
60   </backdrop>
61
62   <!-- P2 score -->
63   <backdrop name="digit2" element="digit">
64      <bounds x="5.5" y="0" width="1" height="2"/>
65   </backdrop>
66   <backdrop name="digit3" element="digit">
67      <bounds x="6.5" y="0" width="1" height="2"/>
68   </backdrop>
69
70   <!-- P2 goal lamp -->
71   <backdrop name="lamp1" element="lamp">
72      <bounds x="6.25" y="-0.5" width="0.5" height="0.5"/>
73   </backdrop>
74   </view>
75</mamelayout>
trunk/src/mame/machine/dc-ctrl.c
r249051r249052
119119      port[i] = ioport(port_tag[i]);
120120   }
121121}
122
trunk/src/mame/machine/iteagle_fpga.c
r249051r249052
146146      m_fpga_regs[offset] = (m_fpga_regs[offset]&0xFFFFFF00) | ((val1 + m_seq_rem1 + m_seq_rem2) & 0xff);
147147   }
148148      if (0 && LOG_FPGA)
149      logerror("%s:fpga update_sequence In: %02X Seq: %06X Out: %02X other %02X%02X%02X\n", machine().describe_context(),
149      logerror("%s:fpga update_sequence In: %02X Seq: %06X Out: %02X other %02X%02X%02X\n", machine().describe_context(),
150150         data, m_seq, m_fpga_regs[offset]&0xff, m_seq_rem2, m_seq_rem1, val1);
151151}
152152
r249051r249052
731731{
732732   UINT32 result = m_ide->read_cs0(space, offset, mem_mask);
733733   if (offset==0x4/4 && ACCESSING_BITS_24_31) {
734      if (m_irq_num!=-1 &&    m_irq_status==1) {
734      if (m_irq_num!=-1 &&    m_irq_status==1) {
735735         m_irq_status = 0;
736736         m_cpu->set_input_line(m_irq_num, CLEAR_LINE);
737737         if (LOG_IDE)
r249051r249052
746746{
747747   m_ide->write_cs0(space, offset, data, mem_mask);
748748   if (offset==0x4/4 && ACCESSING_BITS_24_31) {
749      if (m_irq_num!=-1 &&    m_irq_status==1) {
749      if (m_irq_num!=-1 &&    m_irq_status==1) {
750750         m_irq_status = 0;
751751         m_cpu->set_input_line(m_irq_num, CLEAR_LINE);
752752         if (LOG_IDE)
r249051r249052
783783{
784784   UINT32 result = m_ide2->read_cs0(space, offset, mem_mask);
785785   if (offset==0x4/4 && ACCESSING_BITS_24_31) {
786      if (m_irq_num!=-1 &&    m_irq_status==1) {
786      if (m_irq_num!=-1 &&    m_irq_status==1) {
787787         m_irq_status = 0;
788788         m_cpu->set_input_line(m_irq_num, CLEAR_LINE);
789789         if (LOG_IDE_CTRL)
r249051r249052
798798{
799799   m_ide2->write_cs0(space, offset, data, mem_mask);
800800   if (offset==0x4/4 && ACCESSING_BITS_24_31) {
801      if (m_irq_num!=-1 &&    m_irq_status==1) {
801      if (m_irq_num!=-1 &&    m_irq_status==1) {
802802         m_irq_status = 0;
803803         m_cpu->set_input_line(m_irq_num, CLEAR_LINE);
804804         if (LOG_IDE_CTRL)
trunk/src/mame/machine/ns10crypt.c
r249051r249052
88
99The decryption used by type-2 System10 PCBs (MEM-N) acts on 16-bit words and is
1010designed to operate in a serial way: once the decryption is triggered, every
11word is XORed with a mask calculated over data taken from the previous words
11word is XORed with a mask calculated over data taken from the previous words
1212(both encrypted and decrypted). Type-1 PCBs seem to use a similar
1313scheme, probably involving the word address too and a bitswap, but his relation
1414to what is described here needs further investigation.
r249051r249052
1717game (8E), and it's always stored spanning an integer number of NAND blocks
1818(the K9F2808U0B is organized in blocks of 16 KiB, each containing 32 pages of
19190x200 bytes). Usually the first part of the encrypted data is stored at about the end
20of the ROM, with all the blocks in that area processed in reverse order (first the
20of the ROM, with all the blocks in that area processed in reverse order (first the
2121one nearest the end, then the second nearest, etc); the second part goes immediately
22after it from a logic perspective, but it's, usually, physically located at the area
22after it from a logic perspective, but it's, usually, physically located at the area
2323starting at 0x28000 in the ROM. However, in at least a couple of games, there are
2424out-of-order blocks (details below). Games, after
2525some bootup code has been executed, will copy the encrypted content from
2626the NANDs to RAM, moment at which the decryption is triggered. Physical locations
27of the encrypted programs in the first NAND, together with the RAM region where
27of the encrypted programs in the first NAND, together with the RAM region where
2828they are loaded, are summarized in the following table ( ' indicating processing
2929in reverse order of the constituting blocks) :
3030
r249051r249052
4444
4545Both knpuzzle & gjspace present a NAND block which is out of order with respect
4646to the normal layout; besides, that block is physically located immediately before
47the end-of-ROM region, in what maybe is an attempt to hinder the
47the end-of-ROM region, in what maybe is an attempt to hinder the
4848recognition/reconstruction of the encrypted data.
4949
5050Most games do a single decryption run, so the process is only initialized once;
5151however, at least three of them (gamshara, mrdrilrg & panikuru) do reinitialize the
52internal state of the decrypted several times. As of 2015-08-19, only gamshara shows signs
52internal state of the decrypted several times. As of 2015-08-19, only gamshara shows signs
5353of doing it by writing to the triggering register; how the others two are triggering the
5454reinitializations is still unclear. gamshara does a reinitialization every 5 NAND blocks
5555(16 times in total); mrdrilrg does the second one after 0x38000 bytes and then subsequent
r249051r249052
6060calculated by using linear equations over GF(2) taking as input data the bits from
6161previously processed words; however, one nonlinear calculation is performed
6262per word processed, and that calculation typically affect just one bit (the only
63known exception is mrdrilrg, where the same nonlinear terms are
64affecting two of them). Till now, all the formulae seem to depend only on the
63known exception is mrdrilrg, where the same nonlinear terms are
64affecting two of them). Till now, all the formulae seem to depend only on the
6565previous 3 words, and the first mask after a (re-)initialization is always zero, so
66chances are the mask bits are calculated one word in advance, having access to the
66chances are the mask bits are calculated one word in advance, having access to the
6767current encrypted and decrypted words plus two further words in each sequence, maybe stored
6868in 32 bits registers. All the nonlinear terms reverse-engineered till now are of the form
6969A x B, where A and B are linear formulae; thus, as everything else in the schema involves
r249051r249052
104104A) The linear relations are creating lots of identities involving the bits
105105from the sequence; they could be exploited to simplify the equations (but
106106only when the implementation be stable, to avoid duplicating work).
107B) It's possible that some of those calculations are being stored and then
107B) It's possible that some of those calculations are being stored and then
108108used as another input bits for subsequent masks. Determining that (supposed)
109109bits and factoring out them would simplify the expressions, in case they
110110really exist.
r249051r249052
123123
124124// this could perfectly be part of the per-game logic; by now, only gamshara seems to use it, so we keep it global
125125const int ns10_decrypter_device::initSbox[16] = {0,12,13,6,2,4,9,8,11,1,7,15,10,5,14,3};
126
126
127127ns10_decrypter_device::ns10_decrypter_device(device_type type, const ns10_crypto_logic &logic, const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
128128   : device_t(mconfig, type, "Namco System 10 Decrypter", tag, owner, clock, "ns10_crypto", __FILE__)
129129   , _active(false)
r249051r249052
155155   _previous_cipherwords  ^= cipherword;
156156   _previous_plainwords  <<= 16;
157157   _previous_plainwords   ^= plainword;
158
158   
159159   _mask = 0;
160160   for (int j = 15; j >= 0; --j)
161161   {
r249051r249052
220220// static UINT16 panikuru_nonlinear_calc(UINT64 previous_cipherwords, UINT64 previous_plainwords, const gf2_reducer& reducer)
221221// {
222222   // return ((reducer.gf2_reduce(0x0000000088300281ull & previous_cipherwords) ^ reducer.gf2_reduce(0x0000000004600281ull & previous_plainwords))
223         // & (reducer.gf2_reduce(0x0000a13140090000ull & previous_cipherwords) ^ reducer.gf2_reduce(0x0000806240090000ull & previous_plainwords))) << 2;
223         // & (reducer.gf2_reduce(0x0000a13140090000ull & previous_cipherwords) ^ reducer.gf2_reduce(0x0000806240090000ull & previous_plainwords))) << 2;
224224// }
225225
226226static UINT16 chocovdr_nonlinear_calc(UINT64 previous_cipherwords, UINT64 previous_plainwords, const gf2_reducer& reducer)
trunk/src/mame/machine/ns10crypt.h
r249051r249052
1616class ns10_decrypter_device : public device_t
1717{
1818public:
19   // this encodes the decryption logic, which varies per game
19   // this encodes the decryption logic, which varies per game
2020   // and is probably hard-coded into the CPLD
2121   struct ns10_crypto_logic
2222   {
trunk/src/mame/machine/pgmcrypt.c
r249051r249052
15261526   }
15271527}
15281528
1529static const UINT8 fruitpar_tab[0x100] = {
1530   0xe9, 0x0b, 0x95, 0x7e, 0x0d, 0x7d, 0x5c, 0x1e, 0x81, 0x0e, 0xa6, 0xd4, 0x8e, 0x90, 0xd8, 0x54,
1531   0x27, 0x65, 0x51, 0x08, 0x1c, 0xa0, 0x3b, 0x51, 0x83, 0x60, 0x93, 0x02, 0x64, 0x69, 0x77, 0x1a,
1532   0xa4, 0x03, 0xb0, 0xc2, 0x34, 0x18, 0x80, 0x87, 0x7a, 0x88, 0xad, 0xd9, 0xff, 0xd0, 0xce, 0xc4,
1533   0x5b, 0xdc, 0xd5, 0xed, 0x5e, 0x29, 0xdd, 0xcf, 0x80, 0x1f, 0x36, 0x38, 0x8b, 0xae, 0xae, 0xfe,
1534   0x87, 0x27, 0x22, 0x07, 0xe6, 0x5d, 0x46, 0x79, 0xf1, 0xfc, 0xb1, 0x3d, 0x72, 0x29, 0x2c, 0xba,
1535   0xa3, 0x5b, 0x3c, 0xcf, 0x57, 0x79, 0xed, 0x12, 0x67, 0x34, 0xe1, 0x48, 0x5f, 0xa7, 0x9a, 0x24,
1536   0x6a, 0x2e, 0x04, 0x44, 0x7b, 0x84, 0x46, 0x6a, 0xbd, 0x20, 0xca, 0xf7, 0x3e, 0xd1, 0x8b, 0xad,
1537   0xd7, 0x98, 0x9e, 0xa6, 0x5e, 0xc6, 0x04, 0x90, 0x0f, 0x57, 0xae, 0x2b, 0x38, 0x8d, 0xd2, 0x0c,
1538   0x25, 0xd1, 0x6d, 0x73, 0x4b, 0xc6, 0x19, 0xd3, 0xb8, 0xae, 0x11, 0x01, 0xba, 0x02, 0x82, 0x17,
1539   0xcf, 0x4d, 0x14, 0x6a, 0xcd, 0x4a, 0xb9, 0xc1, 0x52, 0x3e, 0xb5, 0xd8, 0x6f, 0x98, 0xee, 0x16,
1540   0x90, 0xc6, 0x76, 0x8a, 0xaf, 0x5a, 0x56, 0x2b, 0xb9, 0x5e, 0x9e, 0x51, 0x40, 0xf4, 0xaa, 0x6e,
1541   0x63, 0x32, 0xb6, 0x12, 0xfb, 0x3c, 0xa5, 0x1f, 0x07, 0xa3, 0x0d, 0x49, 0x5a, 0xfe, 0x88, 0xd1,
1542   0x83, 0xc7, 0x37, 0x82, 0xfd, 0x78, 0x97, 0xec, 0x98, 0xe6, 0x88, 0xe0, 0x27, 0xde, 0x9a, 0x2c,
1543   0x6b, 0xfd, 0x9b, 0x98, 0x40, 0xd5, 0x5f, 0x20, 0x06, 0x3e, 0xcf, 0x74, 0x52, 0xf9, 0x35, 0xae,
1544   0xd6, 0x8c, 0xc7, 0x53, 0x8e, 0x59, 0x71, 0x8c, 0x2d, 0x00, 0xe7, 0xa5, 0xc7, 0xf8, 0xeb, 0xc7,
1545   0xbf, 0x68, 0xdc, 0xf2, 0xf4, 0x4c, 0x80, 0x3e, 0x27, 0xc5, 0x13, 0x52, 0xb0, 0xc0, 0x90, 0x2d
1546};
1547
15481529void fruitpar_decrypt(running_machine &machine)
15491530{
1550   int i;
1551   UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
1552
1553   int rom_size = 0x80000;
1554
1555   // not 100% verified
1556   for(i=0; i<rom_size/2; i++)
1557   {
1558      UINT16 x = src[i];
1559
1560      IGS27_CRYPT1
1561//      IGS27_CRYPT2
1562//      IGS27_CRYPT3
1563      IGS27_CRYPT4_ALT
1564      IGS27_CRYPT5
1565      IGS27_CRYPT6_ALT
1566      IGS27_CRYPT7
1567      IGS27_CRYPT8
1568
1569      x ^= fruitpar_tab[(i>> 1) & 0xff] << 8;
1570
1571      src[i] = x;
1572   }
1531// TODO
15731532}
trunk/src/mame/machine/xbox.c
r249051r249052
465465
466466void xbox_base_state::vblank_callback(screen_device &screen, bool state)
467467{
468   nvidia_nv2a->vblank_callback(screen, state);
468   if (nvidia_nv2a->vblank_callback(screen, state))
469      xbox_base_devs.pic8259_1->ir3_w(1); // IRQ 3
470   else
471      xbox_base_devs.pic8259_1->ir3_w(0); // IRQ 3
469472}
470473
471474UINT32 xbox_base_state::screen_update_callback(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
r249051r249052
14571460   if (machine().debug_flags & DEBUG_FLAG_ENABLED)
14581461      debug_console_register_command(machine(), "xbox", CMDFLAG_NONE, 0, 1, 4, xbox_debug_commands);
14591462   memset(&ohcist, 0, sizeof(ohcist));
1460   // PIC challenge handshake data
1461   pic16lc_buffer[0x1c] = 0x0c;
1462   pic16lc_buffer[0x1d] = 0x0d;
1463   pic16lc_buffer[0x1e] = 0x0e;
1464   pic16lc_buffer[0x1f] = 0x0f;
14651463#ifdef USB_ENABLED
14661464   ohcist.hc_regs[HcRevision] = 0x10;
14671465   ohcist.hc_regs[HcFmInterval] = 0x2edf;
r249051r249052
14851483   save_item(NAME(smbusst.rw));
14861484   save_item(NAME(smbusst.words));
14871485   save_item(NAME(pic16lc_buffer));
1488   nvidia_nv2a->set_interrupt_device(xbox_base_devs.pic8259_1);
14891486   nvidia_nv2a->start(&m_maincpu->space());
14901487   nvidia_nv2a->savestate_items();
14911488}
trunk/src/mame/mess.lst
r249051r249052
999932xe
10010032xj
10110132x_scd   // 1994 Sega Sega CD (USA w/32X addon)
102segapm    // 1996 Sega Picture Magic (32x type hardware)
102segapm     // 1996 Sega Picture Magic (32x type hardware)
103103
104104saturnjp  // 1994 Sega Saturn (Japan)
105105saturn  // 1995 Sega Saturn (USA)
r249051r249052
13411341canonv20f
13421342canonv20g
13431343canonv20s
1344canons80
13441345mx10
13451346mx101
13461347mx15
r249051r249052
23072308
23082309a5105
23092310attache
2311attachef
23102312bcs3
23112313bcs3a
23122314bcs3b
r249051r249052
27292731tvgame
27302732aussieby
27312733hp_ipc
2734
trunk/src/mame/video/bottom9.c
r249051r249052
3434   *priority = 0;
3535   if ( *color & 0x10) *priority |= GFX_PMASK_1;
3636   if (~*color & 0x20) *priority |= GFX_PMASK_2;
37
37   
3838   *color = sprite_colorbase + (*color & 0x0f);
3939}
4040
trunk/src/mame/video/chihiro.c
r249051r249052
33#include "emu.h"
44#include "video/poly.h"
55#include "bitmap.h"
6#include "machine/pic8259.h"
76#include "includes/chihiro.h"
87
98//#define LOG_NV2A
r249051r249052
946945UINT32 nv2a_renderer::geforce_object_offset(UINT32 handle)
947946{
948947   UINT32 h = ((((handle >> 11) ^ handle) >> 11) ^ handle) & 0x7ff;
949   UINT32 o = (pfifo[0x210 / 4] & 0x1ff) << 8; // 0x1ff is not certain
948   UINT32 o = (pfifo[0x210 / 4] & 0x1f) << 8; // or 12 ?
950949   UINT32 e = o + h * 8; // at 0xfd000000+0x00700000
951950   UINT32 w;
952951
953   if (ramin[e / 4] != handle) {
954      // this should never happen
955      for (UINT32 aa = o / 4; aa < (sizeof(ramin) / 4); aa = aa + 2) {
956         if (ramin[aa] == handle) {
957            e = aa * 4;
958         }
959      }
960   }
952   if (ramin[e / 4] != handle)
953      e = 0;
961954   w = ramin[e / 4 + 1];
962   return (w & 0xffff) * 0x10; // 0xffff is not certain
955   return (w & 0xffff) * 0x10;
963956}
964957
965958void nv2a_renderer::geforce_read_dma_object(UINT32 handle, UINT32 &offset, UINT32 &size)
r249051r249052
12531246      addr = rendertarget + (dilated0[dilate_rendertarget][x] + dilated1[dilate_rendertarget][y]);
12541247   else // type_rendertarget == LINEAR*/
12551248      addr = rendertarget + (pitch_rendertarget / 4)*y + x;
1256   fbcolor = 0;
1257   if (color_mask != 0)
1258      fbcolor = *addr;
1249   fbcolor = *addr;
12591250   daddr=depthbuffer + (pitch_depthbuffer / 4)*y + x;
12601251   deptsten = *daddr;
12611252   c[3] = color >> 24;
r249051r249052
17811772            break;
17821773      }
17831774   }
1784   if (color_mask != 0) {
1785      UINT32 fbcolor_tmp;
1786
1787      fbcolor_tmp = (c[3] << 24) | (c[2] << 16) | (c[1] << 8) | c[0];
1788      *addr = (fbcolor & ~color_mask) | (fbcolor_tmp & color_mask);
1789   }
1775   fbcolor = (c[3] << 24) | (c[2] << 16) | (c[1] << 8) | c[0];
1776   *addr = fbcolor;
17901777   if (depth_write_enabled)
17911778      dep = depth;
17921779   deptsten = (dep << 8) | sten;
r249051r249052
22462233   maddress = method * 4;
22472234   data = space.read_dword(address);
22482235   channel[chanel][subchannel].object.method[method] = data;
2249#ifdef LOG_NV2A
2250   printf("A:%08X MTHD:%08X D:%08X\n\r",address,maddress,data);
2251#endif
22522236   if (maddress == 0x17fc) {
22532237      indexesleft_count = 0;
22542238      indexesleft_first = 0;
r249051r249052
22862270         }
22872271         wait();
22882272      }
2289      else if (type == nv2a_renderer::TRIANGLE_FAN) {
2290         vertex_nv vert[3];
2291         vertex_t xy[3];
2292
2293         read_vertices_0x1810(space, vert, offset, 2);
2294         convert_vertices_poly(vert, xy, 2);
2295         count = count - 2;
2296         offset = offset + 2;
2297         for (n = 0; n <= count; n++) {
2298            read_vertices_0x1810(space, vert + (((n + 1) & 1) + 1), offset + n, 1);
2299            convert_vertices_poly(vert + (((n + 1) & 1) + 1), xy + (((n + 1) & 1) + 1), 1);
2300            render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[0], xy[(~(n + 1) & 1) + 1], xy[((n + 1) & 1) + 1]);
2301         }
2302         wait();
2303      }
23042273      else if (type == nv2a_renderer::TRIANGLE_STRIP) {
23052274         vertex_nv vert[4];
23062275         vertex_t xy[4];
r249051r249052
23422311      // each dword after 1800 contains two 16 bit index values to select the vartices
23432312      // each dword after 1808 contains a 32 bit index value to select the vartices
23442313      type = channel[chanel][subchannel].object.method[0x17fc / 4];
2314#ifdef LOG_NV2A
2315      printf("vertex %d %d %d\n\r", type, offset, count);
2316#endif
23452317      if (type == nv2a_renderer::QUADS) {
23462318         while (1) {
23472319            vertex_nv vert[4];
r249051r249052
23602332            render_polygon<4>(limits_rendertarget, renderspans, 4 + 4 * 2, xy); // 4 rgba, 4 texture units 2 uv
23612333         }
23622334      }
2363      else if (type == nv2a_renderer::TRIANGLE_FAN) {
2364         if ((countlen * mult + indexesleft_count) >= 3) {
2365            vertex_nv vert[3];
2366            vertex_t xy[3];
2367            int c, count;
2368
2369            if (mult == 1)
2370               c = read_vertices_0x1808(space, vert, address, 2);
2371            else
2372               c = read_vertices_0x1800(space, vert, address, 2);
2373            convert_vertices_poly(vert, xy, 2);
2374            address = address + c * 4;
2375            countlen = countlen - c;
2376            count = countlen * mult + indexesleft_count;
2377            for (n = 1; n <= count; n++) {
2378               if (mult == 1)
2379                  c = read_vertices_0x1808(space, vert + ((n & 1) + 1), address, 1);
2380               else
2381                  c = read_vertices_0x1800(space, vert + ((n & 1) + 1), address, 1);
2382
2383               convert_vertices_poly(vert + ((n & 1) + 1), xy + ((n & 1) + 1), 1);
2384               address = address + c * 4;
2385               countlen = countlen - c;
2386               render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[0], xy[(~n & 1) + 1], xy[(n & 1) + 1]);
2387            }
2388            wait();
2389         }
2390      }
23912335      else if (type == nv2a_renderer::TRIANGLES) {
23922336         while (1) {
23932337            vertex_nv vert[3];
r249051r249052
25022446         }
25032447         wait();
25042448      }
2505      else if (type == nv2a_renderer::TRIANGLES) {
2506         while (countlen > 0) {
2507            vertex_nv vert[3];
2508            vertex_t xy[3];
2509            int c;
2510
2511            c = read_vertices_0x1818(space, vert, address, 3);
2512            convert_vertices_poly(vert, xy, 3);
2513            countlen = countlen - c;
2514            if (countlen < 0) {
2515               logerror("Method 0x1818 missing %d words to draw a complete primitive\n", -countlen);
2516               countlen = 0;
2517               break;
2518            }
2519            address = address + c * 3;
2520            render_triangle(limits_rendertarget, renderspans, 4 + 4 * 2, xy[0], xy[1], xy[2]); // 4 rgba, 4 texture units 2 uv
2521         }
2522      }
25232449      else if (type == nv2a_renderer::TRIANGLE_STRIP) {
25242450         vertex_nv vert[4];
25252451         vertex_t xy[4];
r249051r249052
26872613         // clear colors
26882614         UINT32 color = channel[chanel][subchannel].object.method[0x1d90 / 4];
26892615         bm.fill(color);
2690#ifdef LOG_NV2A
2691         printf("clearscreen\n\r");
2692#endif
2616         //printf("clearscreen\n\r");
26932617      }
26942618      if ((data & 0x03) == 3) {
26952619         bitmap_rgb32 bm(depthbuffer, (limits_rendertarget.right() + 1) * m, (limits_rendertarget.bottom() + 1) * m, pitch_rendertarget / 4); // why *2 ?
r249051r249052
27252649      dilate_rendertarget = dilatechose[(log2width_rendertarget << 4) + log2height_rendertarget];
27262650   }
27272651   if (maddress == 0x020c) {
2652      // line size ?
27282653      pitch_rendertarget=data & 0xffff;
27292654      pitch_depthbuffer=(data >> 16) & 0xffff;
2730#ifdef LOG_NV2A
2731      printf("Pitch color %04X zbuffer %04X\n\r",pitch_rendertarget,pitch_depthbuffer);
2732#endif
2655      //printf("Pitch color %04X zbuffer %04X\n\r",pitch_rendertarget,pitch_depthbuffer);
27332656      countlen--;
27342657   }
27352658   if (maddress == 0x0100) {
2736      countlen--;
2737      if (data != 0) {
2738         pgraph[0x704 / 4] = 0x100;
2739         pgraph[0x708 / 4] = data;
2740         pgraph[0x100 / 4] |= 1;
2741         pgraph[0x108 / 4] |= 1;
2742         if (update_interrupts() == true)
2743            interruptdevice->ir3_w(1); // IRQ 3
2744         else
2745            interruptdevice->ir3_w(0); // IRQ 3
2746         return 2;
2659      // just temporarily
2660      if ((data & 0x1f) == 1) {
2661         data = data >> 5;
2662         data = data & 0x0ffffff0;
2663         displayedtarget = (UINT32 *)direct_access_ptr(data);
27472664      }
2748      else
2749         return 0;
27502665   }
27512666   if (maddress == 0x0130) {
27522667      countlen--;
r249051r249052
27552670      else
27562671         return 0;
27572672   }
2758   if (maddress == 0x1d8c) {
2759      countlen--;
2760      // it is used to specify the clear value for the depth buffer (zbuffer)
2761      // but also as a parameter for interrupt routines
2762      pgraph[0x1a88 / 4] = data;
2763   }
2764   if (maddress == 0x1d90) {
2765      countlen--;
2766      // it is used to specify the clear value for the color buffer
2767      // but also as a parameter for interrupt routines
2768      pgraph[0x186c / 4] = data;
2769   }
27702673   if (maddress == 0x0210) {
27712674      // framebuffer offset ?
27722675      rendertarget = (UINT32 *)direct_access_ptr(data);
2773#ifdef LOG_NV2A
2774      printf("Render target at %08X\n\r", data);
2775#endif
2676      //printf("Render target at %08X\n\r",data);
27762677      countlen--;
27772678   }
27782679   if (maddress == 0x0214) {
27792680      // zbuffer offset ?
27802681      depthbuffer = (UINT32 *)direct_access_ptr(data);
2781#ifdef LOG_NV2A
2782      printf("Depth buffer at %08X\n\r",data);
2783#endif
2682      //printf("Depth buffer at %08X\n\r",data);
27842683      if ((data == 0) || (data > 0x7ffffffc))
27852684         depth_write_enabled = false;
27862685      else if (channel[chanel][subchannel].object.method[0x035c / 4] != 0)
r249051r249052
28102709   if (maddress == 0x0354) {
28112710      depth_function = data;
28122711   }
2813   if (maddress == 0x0358) {
2814      //color_mask = data;
2815      if (data & 0x000000ff)
2816         data |= 0x000000ff;
2817      if (data & 0x0000ff00)
2818         data |= 0x0000ff00;
2819      if (data & 0x00ff0000)
2820         data |= 0x00ff0000;
2821      if (data & 0xff000000)
2822         data |= 0xff000000;
2823      color_mask = data;
2824   }
28252712   if (maddress == 0x035c) {
28262713      UINT32 g = channel[chanel][subchannel].object.method[0x0214 / 4];
28272714      depth_write_enabled = data != 0;
r249051r249052
37613648   combiner.function_Aop3 = MAX(MIN((combiner.function_Aop3 + biasa) * scalea, 1.0f), -1.0f);
37623649}
37633650
3764void nv2a_renderer::vblank_callback(screen_device &screen, bool state)
3651bool nv2a_renderer::vblank_callback(screen_device &screen, bool state)
37653652{
3766#ifdef LOG_NV2A
3767   printf("vblank_callback\n\r");
3768#endif
3769   if ((state == true) && (puller_waiting == 1)) {
3770      puller_waiting = 0;
3771      puller_timer_work(NULL, 0);
3772   }
3773   if (state == true) {
3653   //printf("vblank_callback\n\r");
3654   if (state == true)
37743655      pcrtc[0x100 / 4] |= 1;
3775      pcrtc[0x808 / 4] |= 0x10000;
3776   }
3777   else {
3778      pcrtc[0x100 / 4] &= ~1;
3779      pcrtc[0x808 / 4] &= ~0x10000;
3780   }
3781   if (update_interrupts() == true)
3782      interruptdevice->ir3_w(1); // IRQ 3
37833656   else
3784      interruptdevice->ir3_w(0); // IRQ 3
3785}
3786
3787bool nv2a_renderer::update_interrupts()
3788{
3657      pcrtc[0x100 / 4] &= ~1;
37893658   if (pcrtc[0x100 / 4] & pcrtc[0x140 / 4])
37903659      pmc[0x100 / 4] |= 0x1000000;
37913660   else
37923661      pmc[0x100 / 4] &= ~0x1000000;
3793   if (pgraph[0x100 / 4] & pgraph[0x140 / 4])
3794      pmc[0x100 / 4] |= 0x1000;
3795   else
3796      pmc[0x100 / 4] &= ~0x1000;
3797   if (((pmc[0x100 / 4] & 0x7fffffff) && (pmc[0x140 / 4] & 1)) || ((pmc[0x100 / 4] & 0x80000000) && (pmc[0x140 / 4] & 2))) {
3662   if ((state == true) && (puller_waiting == 1)) {
3663      puller_waiting = 0;
3664      puller_timer_work(NULL, 0);
3665   }
3666   if ((pmc[0x100 / 4] != 0) && (pmc[0x140 / 4] != 0)) {
37983667      // send interrupt
37993668      return true;
38003669   }
r249051r249052
38233692   int countlen;
38243693   int ret;
38253694   address_space *space = puller_space;
3826#ifdef LOG_NV2A
3827   UINT32 subch;
3828#endif
38293695
38303696   chanel = puller_channel;
38313697   subchannel = puller_subchannel;
r249051r249052
38823748            }
38833749            if (ret != 0) {
38843750               puller_timer->enable(false);
3885               puller_waiting = ret;
3751               puller_waiting = 1;
38863752               return;
38873753            }
38883754         }
r249051r249052
39813847      //logerror("NV_2A: read PRAMIN[%06X] value %08X\n",offset*4-0x00700000,ret);
39823848   }
39833849   else if ((offset >= 0x00400000 / 4) && (offset < 0x00402000 / 4)) {
3984      ret = pgraph[offset - 0x00400000 / 4];
39853850      //logerror("NV_2A: read PGRAPH[%06X] value %08X\n",offset*4-0x00400000,ret);
39863851   }
39873852   else if ((offset >= 0x00600000 / 4) && (offset < 0x00601000 / 4)) {
r249051r249052
40053870      //logerror("NV_2A: read channel[%02X,%d,%04X]=%08X\n",chanel,subchannel,suboffset*4,ret);
40063871      return ret;
40073872   }
3873   else
3874   {
3875      /* nothing */
3876   }
40083877   //logerror("NV_2A: read at %08X mask %08X value %08X\n",0xfd000000+offset*4,mem_mask,ret);
40093878   return ret;
40103879}
40113880
40123881WRITE32_MEMBER(nv2a_renderer::geforce_w)
40133882{
4014   UINT32 old;
4015   bool update_int;
4016
4017   update_int = false;
40183883   if ((offset >= 0x00101000 / 4) && (offset < 0x00102000 / 4)) {
40193884      //logerror("NV_2A: write STRAPS[%06X] mask %08X value %08X\n",offset*4-0x00101000,mem_mask,data);
40203885   }
r249051r249052
40333898      //logerror("NV_2A: write PRAMIN[%06X]=%08X\n",offset*4-0x00700000,data & mem_mask);
40343899   }
40353900   else if ((offset >= 0x00400000 / 4) && (offset < 0x00402000 / 4)) {
4036      int e = offset - 0x00400000 / 4;
4037      if (e >= (sizeof(pgraph) / sizeof(UINT32)))
4038         return;
4039      old = pgraph[e];
4040      COMBINE_DATA(pgraph + e);
4041      if (e == 0x100 / 4) {
4042         pgraph[e] = old & ~data;
4043         if (data & 1)
4044            pgraph[0x108 / 4] = 0;
4045         update_int = true;
4046      }
4047      if (e == 0x140 / 4)
4048         update_int = true;
4049      if (e == 0x720 / 4) {
4050         if ((data & 1) && (puller_waiting == 2)) {
4051            puller_waiting = 0;
4052            puller_timer->enable();
4053            puller_timer->adjust(attotime::zero);
4054         }
4055      }
4056      if ((e >= 0x900 / 4) && (e < 0xa00 / 4))
4057         pgraph[e] = 0;
40583901      //logerror("NV_2A: write PGRAPH[%06X]=%08X\n",offset*4-0x00400000,data & mem_mask);
40593902   }
40603903   else if ((offset >= 0x00600000 / 4) && (offset < 0x00601000 / 4)) {
40613904      int e = offset - 0x00600000 / 4;
40623905      if (e >= (sizeof(pcrtc) / sizeof(UINT32)))
40633906         return;
4064      old = pcrtc[e];
40653907      COMBINE_DATA(pcrtc + e);
4066      if (e == 0x100 / 4) {
4067         pcrtc[e] = old & ~data;
4068         update_int = true;
4069      }
4070      if (e == 0x140 / 4)
4071         update_int = true;
40723908      if (e == 0x800 / 4) {
4073         displayedtarget = (UINT32 *)direct_access_ptr(pcrtc[e]);
4074#ifdef LOG_NV2A
4075         printf("crtc buffer %08X\n\r", data);
4076#endif
3909         displayedtarget = (UINT32 *)direct_access_ptr(data);
3910         //printf("crtc buffer %08X\n\r", data);
40773911      }
40783912      //logerror("NV_2A: write PCRTC[%06X]=%08X\n",offset*4-0x00600000,data & mem_mask);
40793913   }
r249051r249052
40883922      // 32 channels size 0x10000 each, 8 subchannels per channel size 0x2000 each
40893923      int chanel, subchannel, suboffset;
40903924      //int method, count, handle, objclass;
3925#ifdef LOG_NV2A
3926      int subch;
3927#endif
40913928
40923929      suboffset = offset - 0x00800000 / 4;
40933930      chanel = (suboffset >> (16 - 2)) & 31;
r249051r249052
41223959   }
41233960   //else
41243961   //      logerror("NV_2A: write at %08X mask %08X value %08X\n",0xfd000000+offset*4,mem_mask,data);
4125   if (update_int == true) {
4126      if (update_interrupts() == true)
4127         interruptdevice->ir3_w(1); // IRQ 3
4128      else
4129         interruptdevice->ir3_w(0); // IRQ 3
4130   }
41313962}
41323963
41333964void nv2a_renderer::savestate_items()
r249051r249052
41403971   puller_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nv2a_renderer::puller_timer_work), this), (void *)"NV2A Puller Timer");
41413972   puller_timer->enable(false);
41423973}
4143
4144void nv2a_renderer::set_interrupt_device(pic8259_device *device)
4145{
4146   interruptdevice = device;
4147}
trunk/src/mame/video/k052109.h
r249051r249052
2020   devcb = &k052109_device::set_irq_handler(*device, DEVCB_##_devcb);
2121
2222
23class k052109_device : public device_t, public device_gfx_interface
23class k052109_device : public device_t,   public device_gfx_interface
2424{
2525   static const gfx_layout charlayout;
2626   static const gfx_layout charlayout_ram;
trunk/src/mame/video/k057714.c
r249051r249052
116116      case 0x18:      // ?
117117         break;
118118
119      case 0x1c:      // set to 1 on "media bus" access
119      case 0x1c:      // set to 1 on "media bus" access
120120         if ((data >> 16) == 1)
121121         {
122122            m_ext_fifo_count = 0;
r249051r249052
278278{
279279   if (ACCESSING_BITS_16_31)
280280   {
281      if (m_ext_fifo_count != 0)      // first access is a dummy write
281      if (m_ext_fifo_count != 0)      // first access is a dummy write
282282      {
283283         int count = m_ext_fifo_count - 1;
284284         UINT32 addr = (((m_ext_fifo_addr >> 10) + m_ext_fifo_line) * 1024) + count;
trunk/src/mame/video/macrossp.c
r249051r249052
238238      if(pri <= 1) primask |= GFX_PMASK_2;
239239      if(pri <= 2) primask |= GFX_PMASK_4;
240240      if(pri <= 3) primask |= GFX_PMASK_8;
241
241           
242242      switch (source[0] & 0x0000c000)
243243      {
244244         case 0x00008000:
r249051r249052
265265      if(flipy) {
266266         yoffst = (high * yzoom * 16);
267267         ymin = high;
268         ymax = -1;
268         ymax = -1;   
269269         yinc = -1;
270270      }
271
271     
272272      int xmin = 0;
273273      int xmax = wide+1;
274274      int xinc = 1;
r249051r249052
288288         {
289289            int fudged_xzoom = xzoom<<8;
290290            int fudged_yzoom = yzoom<<8;
291
291           
292292            /* cover seams as don't know exactly how many pixels on target will cover, and can't specify fractional offsets to start */
293293            if(xzoom < 0x100) fudged_xzoom += 0x600;
294294            if(yzoom < 0x100) fudged_yzoom += 0x600;
295
295               
296296            gfx->prio_zoom_alpha(bitmap,cliprect,tileno+loopno,col,
297                              flipx,flipy,xpos+(xoffset>>8),ypos+(yoffset>>8),
298                              fudged_xzoom,fudged_yzoom,
299                              screen.priority(),primask,0,alpha);
297                            flipx,flipy,xpos+(xoffset>>8),ypos+(yoffset>>8),
298                            fudged_xzoom,fudged_yzoom,
299                            screen.priority(),primask,0,alpha);
300300
301301            xoffset += ((xzoom*16) * xinc);
302302            loopno++;
r249051r249052
357357      starty -= (240/2) * (incy - 0x10000);
358358
359359// previous logic, which gives mostly comparable results, vr[1] is now unused
360//      startx = (vr[1] & 0x0000ffff) << 16;
361//      starty = (vr[1] & 0xffff0000) >> 0;
362//      startx -= (368/2) * incx;
363//      starty -= (240/2) * incy;
360//      startx = (vr[1] & 0x0000ffff) << 16;
361//      starty = (vr[1] & 0xffff0000) >> 0;
362//      startx -= (368/2) * incx;
363//      starty -= (240/2) * incy;
364364
365365      tm->draw_roz(screen, bitmap, cliprect,
366366            startx,starty,incx,0,0,incy,
r249051r249052
415415      if(lay_debug && !machine().input().code_pressed(lay_keys[pri]))
416416         continue;
417417#endif
418
418   
419419      if(!backgrounds)
420420         continue;
421
421     
422422      for (int y=0; y<240; y++) {
423423         clip.min_y = clip.max_y = y;
424
424         
425425         /* quizmoon map requires that layer 2 be drawn over layer 3 when same pri */
426426         for(int layer = 2; layer >= 0; layer--) {
427427            if(layerpri[layer] == pri) {
r249051r249052
439439
440440   if(sprites) draw_sprites(screen, bitmap, cliprect);
441441
442
442   
443443#if 0
444444popmessage  ("scra - %08x %08x %08x\nscrb - %08x %08x %08x\nscrc - %08x %08x %08x",
445445m_scra_videoregs[0]&0xffffffff, // yyyyxxxx
trunk/src/mame/video/midzeus.c
r249051r249052
2727#define WAVERAM1_WIDTH      512
2828#define WAVERAM1_HEIGHT     512
2929
30#define BLEND_OPAQUE1       0x00000000
31#define BLEND_OPAQUE2       0x4b23cb00
32#define BLEND_OPAQUE3       0x4b23dd00
33#define BLEND_OPAQUE4       0x00004800
34#define BLEND_OPAQUE5       0xdd23dd00
35#define BLEND_ADD1          0x40b68800
36#define BLEND_ADD2          0xc9b78800
37#define BLEND_MUL1          0x4093c800
30#define BLEND_OPAQUE1      0x00000000
31#define BLEND_OPAQUE2      0x4b23cb00
32#define BLEND_OPAQUE3      0x4b23dd00
33#define BLEND_OPAQUE4      0x00004800
34#define BLEND_OPAQUE5      0xdd23dd00
35#define BLEND_ADD1         0x40b68800
36#define BLEND_ADD2         0xc9b78800
37#define BLEND_MUL1         0x4093c800
3838
3939
4040/*************************************
r249051r249052
4545
4646struct mz_poly_extra_data
4747{
48   const void *    palbase;
49   const void *    texbase;
50   UINT16          solidcolor;
51   UINT16          voffset;
52   INT16           zoffset;
53   UINT16          transcolor;
54   UINT16          texwidth;
55   UINT16          color;
56   UINT32          alpha;
57   UINT32          ctrl_word;
58   bool            blend_enable;
59   bool            depth_test_enable;
60   bool            depth_write_enable;
61   UINT32          blend;
62   UINT8           (*get_texel)(const void *, int, int, int);
48   const void *   palbase;
49   const void *   texbase;
50   UINT16         solidcolor;
51   UINT16         voffset;
52   INT16         zoffset;
53   UINT16         transcolor;
54   UINT16         texwidth;
55   UINT16         color;
56   UINT32         alpha;
57   UINT32         ctrl_word;
58   bool         blend_enable;
59   bool         depth_test_enable;
60   bool         depth_write_enable;
61   UINT32         blend;
62   UINT8         (*get_texel)(const void *, int, int, int);
6363};
6464
6565
r249051r249052
11801180      {
11811181         logerror("\t\t(%f,%f,%f) UV:(%02X,%02X) UV_SCALE:(%02X,%02X) (%03X,%03X,%03X) dot=%08X\n",
11821182               (double) vert[i].x * (1.0 / 65536.0), (double) vert[i].y * (1.0 / 65536.0), (double) vert[i].p[0] * (1.0 / 65536.0),
1183               (iuvz >> 16) & 0xff, (iuvz >> 24) & 0xff,
1183               (iuvz >> 16) & 0xff, (iuvz >> 24) & 0xff,
11841184               (int)(vert[i].p[1] / 256.0f), (int)(vert[i].p[2] / 256.0f),
11851185               (databuffer[10 + i] >> 20) & 0x3ff, (databuffer[10 + i] >> 10) & 0x3ff, (databuffer[10 + i] >> 0) & 0x3ff,
11861186               0);
trunk/src/mess/drivers/apple2.c
r249051r249052
377377         if (m_video->m_mix)
378378         {
379379            m_video->hgr_update(screen, bitmap, cliprect, 0, 159);
380            if (!strcmp(machine().system().name, "ivelultr"))
380            if (!strcmp(machine().system().name, "ivelultr"))
381381            {
382382               m_video->text_update_ultr(screen, bitmap, cliprect, 160, 191);
383383            }
r249051r249052
396396         if (m_video->m_mix)
397397         {
398398            m_video->lores_update(screen, bitmap, cliprect, 0, 159);
399            if (!strcmp(machine().system().name, "ivelultr"))
399            if (!strcmp(machine().system().name, "ivelultr"))
400400            {
401401               m_video->text_update_ultr(screen, bitmap, cliprect, 160, 191);
402402            }
r249051r249052
413413   }
414414   else
415415   {
416      if (!strcmp(machine().system().name, "ivelultr"))
416      if (!strcmp(machine().system().name, "ivelultr"))
417417      {
418418         m_video->text_update_ultr(screen, bitmap, cliprect, 0, 191);
419419      }
trunk/src/mess/drivers/attache.c
r249051r249052
988988   ROM_FILL(0x0000,0x10000,0x00)
989989
990990   ROM_REGION(0x1000, "boot", 0)
991   ROM_SYSTEM_BIOS(0, "u252revg", "Boot Rev.G")
992   ROMX_LOAD("u252revg.bin", 0x0000, 0x1000, CRC(113136b7) SHA1(845afd9ed2fd2b28c39921d8f2ba99e5295e0330), ROM_BIOS(1))
993   ROM_SYSTEM_BIOS(1, "u252revf", "Boot Rev.F")
994   ROMX_LOAD("u252revf.bin", 0x0000, 0x1000, CRC(b49eb3b2) SHA1(5b1b348301b2f76b1f250ba68bb8733fc15d18c2), ROM_BIOS(2))
991   ROM_LOAD("u252revg.bin",  0x0000, 0x1000, CRC(113136b7) SHA1(845afd9ed2fd2b28c39921d8f2ba99e5295e0330) )
995992
996993   ROM_REGION(0x1000, "video", 0)
997994   ROM_LOAD("u416vid.bin",  0x0000, 0x1000, CRC(e376ec59) SHA1(7b9e9db575e77ce2f479eb9ae913528e4f0d125d) )
r249051r249052
10061003   ROM_LOAD("u630.bin",  0x0000, 0x0100, CRC(f7a5c821) SHA1(fea07d9ac7e4e5f4f72aa7b2159deaedbd662ead) )
10071004ROM_END
10081005
1006ROM_START( attachef )
1007   ROM_REGION(0x10000, "maincpu", 0)
1008   ROM_FILL(0x0000,0x10000,0x00)
1009
1010   ROM_REGION(0x1000, "boot", 0)
1011   ROM_LOAD("u252revf.bin",  0x0000, 0x1000, CRC(b49eb3b2) SHA1(5b1b348301b2f76b1f250ba68bb8733fc15d18c2) )
1012
1013   ROM_REGION(0x1000, "video", 0)
1014   ROM_LOAD("u416vid.bin",  0x0000, 0x1000, CRC(e376ec59) SHA1(7b9e9db575e77ce2f479eb9ae913528e4f0d125d) )
1015
1016   ROM_REGION(0x100, "attr", 0)
1017   ROM_LOAD("u413.bin",  0x0000, 0x0100, CRC(5b60e622) SHA1(43450c747db1394466eabe5c26a61bf75a4f3b52) )
1018
1019   ROM_REGION(0x200, "iosel", 0)
1020   ROM_LOAD("u110.bin",  0x0000, 0x0200, CRC(70dd255a) SHA1(36dcce07a2c14eefc069433459c422341bd47efb) )
1021
1022   ROM_REGION(0x100, "floppy", 0)
1023   ROM_LOAD("u630.bin",  0x0000, 0x0100, CRC(f7a5c821) SHA1(fea07d9ac7e4e5f4f72aa7b2159deaedbd662ead) )
1024ROM_END
1025
10091026/*    YEAR  NAME    PARENT  COMPAT      MACHINE     INPUT    DEVICE            INIT    COMPANY      FULLNAME     FLAGS */
1010COMP( 1982, attache, 0,      0,         attache,    attache, driver_device,    0,      "Otrona",   "Attach\xC3\xA9",    MACHINE_IMPERFECT_GRAPHICS|MACHINE_NOT_WORKING)
1027COMP( 1982, attache, 0,      0,         attache,    attache, driver_device,    0,      "Otrona",   "Attache (boot rev G)",    MACHINE_IMPERFECT_GRAPHICS|MACHINE_NOT_WORKING)
1028COMP( 1982, attachef,attache,0,         attache,    attache, driver_device,    0,      "Otrona",   "Attache (boot rev F)",    MACHINE_IMPERFECT_GRAPHICS|MACHINE_NOT_WORKING)
trunk/src/mess/drivers/canon_s80.c
r0r249052
1// license:GPL2+
2// copyright-holders:FelipeSanches
3/*
4 * canon_s80.c
5 *
6 *    CANON S-80 electronic typewriter
7 *
8 * skeleton driver by:
9 *    Felipe Correa da Silva Sanches <juca@members.fsf.org>
10 *
11 * known issues:
12 *  - memory-map is uncertain
13 *  - maincpu clock is guessed
14 *  - still need to hookup the Hitachi HD44780 LCD Controller
15 *  - still lacks description of the keyboard inputs
16 *  - as well as a "paper" device to plot the output of the dot matrix print head
17 */
18
19#include "emu.h"
20#include "cpu/m6800/m6800.h"
21//#include "video/hd44780.h"
22
23class canons80_state : public driver_device
24{
25public:
26   canons80_state(const machine_config &mconfig, device_type type, const char *tag)
27         : driver_device(mconfig, type, tag)
28         { }
29
30   DECLARE_DRIVER_INIT(canons80);
31};
32
33
34static ADDRESS_MAP_START(canons80_map, AS_PROGRAM, 8, canons80_state )
35    AM_RANGE(0x0000, 0x7fff) AM_RAM
36    AM_RANGE(0x8000, 0xffff) AM_ROM
37ADDRESS_MAP_END
38
39static MACHINE_CONFIG_START( canons80, canons80_state )
40   /* basic machine hardware */
41   MCFG_CPU_ADD("maincpu", HD6301, 5000000) /* hd63a01xop 5 MHz guessed: TODO: check on PCB */
42   MCFG_CPU_PROGRAM_MAP(canons80_map)
43MACHINE_CONFIG_END
44
45DRIVER_INIT_MEMBER(canons80_state, canons80)
46{}
47
48ROM_START( canons80 )
49   ROM_REGION( 0x10000, "maincpu", 0 ) /* 6800 code */
50   ROM_LOAD( "canon_8735kx_nh4-0029_064.ic6", 0x8000, 0x8000, CRC(b6cd2ff7) SHA1(e47a136300c826e480fac1be7fc090523078a2a6) )
51ROM_END
52
53/*    YEAR  NAME      PARENT  COMPAT   MACHINE  INPUT  INIT                      COMPANY  FULLNAME                            FLAGS */
54COMP( 1988, canons80,      0,      0, canons80,     0, canons80_state, canons80, "Canon", "Canon S-80 electronic typewriter", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
trunk/src/mess/drivers/force68k.c
r249051r249052
1// license:BSD-3-Clause
1// license:BSD-3-Clause
22// copyright-holders:Joakim Larsson Edstr??m
33/***************************************************************************
4 *
5 *  Force SYS68K CPU-1/CPU-6 VME SBC drivers, initially based on the 68ksbc.c
6 *
7 *  13/06/2015
8 *
9 * The info found on the links below is for a later revisions of the board I have
10 * but it is somewhat compatible so I got the system ROM up and running in terminal.
11 * My CPU-1 board has proms from 1983 and the PCB has no rev markings so probably
12 * the original or a very early design. The board real estate differs from the later
13 * CPU-1:s I found pictures of but has the same main chips and functions.
14 *
15 * http://bitsavers.trailing-edge.com/pdf/forceComputers/1988_Force_VMEbus_Products.pdf
16 * http://www.artisantg.com/info/P_wUovN.pdf
17 *
18 * Some info from those documents:
19 *
20 * Address Map
21 * ----------------------------------------------------------
22 * Address Range     Description
23 * ----------------------------------------------------------
24 * 000 000 - 000 007 Initialisation vectors from system EPROM
25 * 000 008 - 01F FFF Dynamic RAM on CPU-1 B
26 * 000 008 - 07F FFF Dynamic RAM on CPU-1 D
27 * 080 008 - 09F FFF SYSTEM EPROM Area
28 * OAO 000 - OBF FFF USER EPROMArea
29 * 0C0 041 - 0C0 043 ACIA (P3) Host
30 * 0C0 080 - 0C0 082 ACIA (P4) Terminal
31 * 0C0 101 - 0C0 103 ACIA (P5) Remote device (eg serial printer)
32 * 0C0 401 - 0C0 42F RTC
33 * OEO 001 - 0E0 035 PI/T (eg centronics printer)
34 * OEO 200 - 0E0 2FF FPU
35 * OEO 300 - 0E0 300 Reset Off
36 * OEO 380 - 0E0 380 Reset On
37 * 100 000 - FEF FFF VMEbus addresses (A24)
38 * FFO 000 - FFF FFF VMEbus Short I/O (A16)
39 * ----------------------------------------------------------
40 *
41 * Interrupt sources
42 * ----------------------------------------------------------
43 * Description                  Device  Lvl  IRQ    VME board
44 *                           /Board      Vector  Address
45 * ----------------------------------------------------------
46 * On board Sources
47 * ABORT                        Switch  7    31
48 * Real Time Clock (RTC)        58167A  6    30
49 * Parallel/Timer (PI/T)        68230   5    29
50 * Terminal ACIA                6850    4    28
51 * Remote ACIA                  6850    3    27
52 * Host ACIA                    6850    2    26
53 * ACFAIL, SYSFAIL              VME     5    29
54 * Off board Sources (other VME boards)
55 * 6 Port Serial I/O board      SIO     4    64-75  0xb00000
56 * 8 Port Serial I/O board      ISIO    4    76-83  0x960000
57 * Disk Controller              WFC     3    119    0xb01000
58 * SCSI Controller              ISCSI   4    119    0xa00000
59 * Slot 1 Controller Board      ASCU    7    31     0xb02000
60 * ----------------------------------------------------------
61 *
62 *  TODO:
63 *  - Finish 3 x ACIA6850, host and remote interface left, terminal works
64 *  - Finish 1 x 68230 Motorola, Parallel Interface / Timer as required by ROM
65 *    - Configure PIT to the Centronics device printer interface as
66 *      supported by ROM (DONE)
67 *  - Add 1 x Abort Switch
68 *  - Add 1 x Reset Switch
69 *  - Add 1 x Halt LED
70 *  - Add a jumper field device as supported by PCB
71 *  - Add configurable serial connector between ACIA:s and
72 *    - Real terminal emulator, ie rs232 "socket"
73 *    - Debug console
74 *  - Add VME bus driver
75 *
76 ****************************************************************************/
774
5    Force SYS68K CPU-1/CPU-6 VME SBC drivers, initially based on the 68ksbc.c
6
7    13/06/2015
8
9 The info found on the links below is for a later revisions of the board I have
10 but I hope it is somewhat compatible so I can get it up and running at least.
11 My CPU-1 board has proms from 1983 and no rev markings so probably the original.
12
13 http://bitsavers.trailing-edge.com/pdf/forceComputers/1988_Force_VMEbus_Products.pdf
14 http://www.artisantg.com/info/P_wUovN.pdf
15
16 Some info from those documents:
17
18Address Map
19----------------------------------------------------------
20Address Range     Description
21----------------------------------------------------------
22000 000 - 000 007 Initialisation vectors from system EPROM
23000 008 - 01F FFF Dynamic RAM on CPU-1 B
24000 008 - 07F FFF Dynamic RAM on CPU-1 D
25080 008 - 09F FFF SYSTEM EPROM Area
26OAO 000 - OBF FFF USER EPROMArea
270C0 041 - 0C0 043 ACIA (P3) Host
280C0 080 - 0C0 082 ACIA (P4) Terminal
290C0 101 - 0C0 103 ACIA (P5) Remote device (eg serial printer)
300C0 401 - 0C0 42F RTC
31OEO 001 - 0E0 035 PI/T (eg centronics printer)
32OEO 200 - 0E0 2FF FPU
33OEO 300 - 0E0 300 Reset Off
34OEO 380 - 0E0 380 Reset On
35100 000 - FEF FFF VMEbus addresses (A24)
36FFO 000 - FFF FFF VMEbus Short I/O (A16)
37----------------------------------------------------------
38
39Interrupt sources
40----------------------------------------------------------
41Description                  Device  Lvl  IRQ    VME board
42                             /Board      Vector  Address
43----------------------------------------------------------
44On board Sources
45 ABORT                        Switch  7    31
46 Real Time Clock (RTC)        58167A  6    30
47 Parallel/Timer (PI/T)        68230   5    29
48 Terminal ACIA                6850    4    28
49 Remote ACIA                  6850    3    27
50 Host ACIA                    6850    2    26
51 ACFAIL, SYSFAIL              VME     5    29
52Off board Sources (other VME boards)
53 6 Port Serial I/O board      SIO     4    64-75  0xb00000
54 8 Port Serial I/O board      ISIO    4    76-83  0x960000
55 Disk Controller              WFC     3    119    0xb01000
56 SCSI Controller              ISCSI   4    119    0xa00000
57 Slot 1 Controller Board      ASCU    7    31     0xb02000
58----------------------------------------------------------
59
6010. The VMEbus
61---------------
62The implemented VMEbus Interface includes 24 address, 16 data,
636 address modifier and the asynchronous control signals.
64A single level bus arbiter is provided to build multi master
65systems. In addition to the bus arbiter, a separate slave bus
66arbitration allows selection of the arbitration level (0-3).
67
68The address modifier range .,Short 110 Access?? can be selected
69via a jumper for variable system generation. The 7 interrupt
70request levels of the VMEbus are fully supported from the
71SYS68K1CPU-1 B/D. For multi-processing, each IRQ signal can be
72enabled/disabled via a jumper field.
73
74Additionally, the SYS68K1CPU-1 B/D supports the ACFAIL, SYSRESET,
75SYSFAIL and SYSCLK signal (16 MHz).
76
77
78    TODO:
79    - Finish 2 x ACIA6850, host and remote interface left, terminal works
80    - Finish 1 x 68230 Motorola, Parallel Interface / Timer
81      - Connect Port B to a Centronics printer interface
82    - Add 1 x Abort Switch
83    - Add configurable serial connector between ACIA:s and
84      - Real terminal emulator, ie rs232 "socket"
85      - Debug console
86    - Add VME bus driver
87
88****************************************************************************/
89
7890#include "emu.h"
7991#include "bus/rs232/rs232.h"
8092#include "cpu/m68000/m68000.h"
r249051r249052
8294#include "machine/68230pit.h"
8395#include "machine/6850acia.h"
8496#include "machine/clock.h"
85#include "bus/centronics/ctronics.h"
86#include "bus/generic/slot.h"
87#include "bus/generic/carts.h"
8897
89#define LOG(x) x
90
9198#define BAUDGEN_CLOCK XTAL_1_8432MHz
9299/*
93 * The baudrate on the Force68k CPU-1 to CPU-6 is generated by a
94 * Motorola 14411 bitrate generator, the CPU-6 documents matches the circuits
95 * that I could find on the CPU-1 board. Here how I calculated the clock for
96 * the factory settings. No need to add selectors until terminal.c supports
97 * configurable baudrates. Fortunality CPU-1 was shipped with 9600N8!
98 *
99 * From the documents:
100 *
101 * 3 RS232C interfaces, strap selectable baud rate from 110-9600 or 600-19200 baud
102 *
103 * Default Jumper Settings of B7:
104 * --------------------------------
105 * GND           10 - 11 RSA input on 14411
106 * F1 on 14411    1 - 20 Baud selector of the terminal port
107 * F1 on 14411    3 - 18 Baud selector of the host port
108 * F1 on 14411    5 - 16 Baud selector of the remote port
109 *
110 * The RSB input on the 14411 is kept high always so RSA=0, RSB=1 and a 1.8432MHz crystal
111 * generates 153600 on the F1 output pin which by default strapping is connected to all
112 * three 6850 acias on the board. These can be strapped separatelly to speedup downloads.
113 *
114 * The selectable outputs from 14411, F1-F16:
115 * X16 RSA=0,RSB=1: 153600, 115200, 76800, 57600, 38400, 28800, 19200, 9600, 4800, 3200, 2153.3, 1758.8, 1200, 921600, 1843000
116 * X64 RSA=1,RSB=1: 614400, 460800, 307200, 230400, 153600, 115200, 76800, 57600, 38400, 28800, 19200, 9600, 4800, 921600, 1843000
117 *
118 * However, the datasheet says baudrate is strapable for 110-9600 but the output is 153600
119 * so the system rom MUST setup the acia to divide by 16 to generate the correct baudrate.
120 *
121 */
100 The baudrate on the Force68k CPU-1 to CPU-6 is generated by a
101 Motorola 14411 bitrate generator, the CPU-6 documents matches the circuits
102 that I could find on the CPU-1 board. Here how I calculated the clock for
103 the factory settings. No need to add selectors until terminal.c supports
104 configurable baudrates. Fortunality CPU-1 was shipped with 9600N8!
105
106 From the documents:
107
108  3 RS232C interfaces, strap selectable baud rate from 110-9600 or 600-19200 baud
109
110  Default Jumper Settings of B7:
111  --------------------------------
112  GND           10 - 11 RSA input on 14411
113  F1 on 14411    1 - 20 Baud selector of the terminal port
114  F1 on 14411    3 - 18 Baud selector of the host port
115  F1 on 14411    5 - 16 Baud selector of the remote port
116
117 The RSB input on the 14411 is kept high always so RSA=0, RSB=1 and a 1.8432MHz crystal
118 generates 153600 on the F1 output pin which by default strapping is connected to all
119 three 6850 acias on the board. These can be strapped separatelly to speedup downloads.
120
121 The selectable outputs from 14411, F1-F16:
122 X16 RSA=0,RSB=1: 153600, 115200, 76800, 57600, 38400, 28800, 19200, 9600, 4800, 3200, 2153.3, 1758.8, 1200, 921600, 1843000
123 X64 RSA=1,RSB=1: 614400, 460800, 307200, 230400, 153600, 115200, 76800, 57600, 38400, 28800, 19200, 9600, 4800, 921600, 1843000
124
125 However, the datasheet says baudrate is strapable for 110-9600 but the output is 153600
126 so the system rom MUST setup the acia to divide by 16 to generate the correct baudrate.
127
128*/
122129#define ACIA_CLOCK (BAUDGEN_CLOCK / 12)
123130
124131class force68k_state : public driver_device
125132{
126133public:
127force68k_state(const machine_config &mconfig, device_type type, const char *tag) :
128        driver_device (mconfig, type, tag),
129        m_maincpu (*this, "maincpu"),
130        m_rtc (*this, "rtc"),
131        m_pit (*this, "pit"),
132        m_aciahost (*this, "aciahost"),
133        m_aciaterm (*this, "aciaterm"),
134        m_aciaremt (*this, "aciaremt"),
135        m_centronics (*this, "centronics")
136        , m_centronics_ack (0)
137        , m_centronics_busy (0)
138        , m_centronics_perror (0)
139        , m_centronics_select (0)
140        ,m_cart(*this, "exp_rom1")
141{
142}
134   force68k_state(const machine_config &mconfig, device_type type, const char *tag) :
135      driver_device(mconfig, type, tag),
136         //      m_rtc(*this, "rtc")
137         m_maincpu(*this, "maincpu"),
138         m_rtc(*this, "rtc"),
139         m_pit(*this, "pit"),
140         m_aciahost(*this, "aciahost"),
141         m_aciaterm(*this, "aciaterm"),
142         m_aciaremt(*this, "aciaremt")
143   {
144   }
143145
144DECLARE_READ16_MEMBER (bootvect_r);
145DECLARE_READ16_MEMBER (vme_a24_r);
146DECLARE_WRITE16_MEMBER (vme_a24_w);
147DECLARE_READ16_MEMBER (vme_a16_r);
148DECLARE_WRITE16_MEMBER (vme_a16_w);
149virtual void machine_start ();
150// clocks
151DECLARE_WRITE_LINE_MEMBER (write_aciahost_clock);
152DECLARE_WRITE_LINE_MEMBER (write_aciaterm_clock);
153DECLARE_WRITE_LINE_MEMBER (write_aciaremt_clock);
154// centronics printer interface
155DECLARE_WRITE_LINE_MEMBER (centronics_ack_w);
156DECLARE_WRITE_LINE_MEMBER (centronics_busy_w);
157DECLARE_WRITE_LINE_MEMBER (centronics_perror_w);
158DECLARE_WRITE_LINE_MEMBER (centronics_select_w);
159// User EPROM/SRAM slot(s)
160int force68k_load_cart(device_image_interface &image, generic_slot_device *slot);
161DECLARE_DEVICE_IMAGE_LOAD_MEMBER (exp1_load) { return force68k_load_cart(image, m_cart); }
162DECLARE_READ16_MEMBER (read16_rom);
146   DECLARE_READ16_MEMBER(bootvect_r);
147   virtual void machine_start();
148   DECLARE_WRITE_LINE_MEMBER(write_aciahost_clock);
149   DECLARE_WRITE_LINE_MEMBER(write_aciaterm_clock);
150   DECLARE_WRITE_LINE_MEMBER(write_aciaremt_clock);
163151
164protected:
165
166152private:
167required_device<cpu_device> m_maincpu;
168required_device<mm58167_device> m_rtc;
169required_device<pit68230_device> m_pit;
170required_device<acia6850_device> m_aciahost;
171required_device<acia6850_device> m_aciaterm;
172required_device<acia6850_device> m_aciaremt;
173optional_device<centronics_device> m_centronics;
153   required_device<cpu_device> m_maincpu;
154   required_device<mm58167_device> m_rtc;
155   required_device<pit68230_device> m_pit;
156   required_device<acia6850_device> m_aciahost;
157   required_device<acia6850_device> m_aciaterm;
158   required_device<acia6850_device> m_aciaremt;
174159
175INT32 m_centronics_ack;
176INT32 m_centronics_busy;
177INT32 m_centronics_perror;
178INT32 m_centronics_select;
179
180// Pointer to System ROMs needed by bootvect_r
181UINT16  *m_sysrom;
182UINT16  *m_usrrom;
183
184required_device<generic_slot_device> m_cart;
185
160   // Pointer to System ROMs needed by bootvect_r
161   UINT16  *m_sysrom;
186162};
187163
188static ADDRESS_MAP_START (force68k_mem, AS_PROGRAM, 16, force68k_state)
189ADDRESS_MAP_UNMAP_HIGH
190AM_RANGE (0x000000, 0x000007) AM_ROM AM_READ (bootvect_r)       /* Vectors mapped from System EPROM */
191AM_RANGE (0x000008, 0x01ffff) AM_RAM /* DRAM CPU-1B */
192//AM_RANGE (0x020000, 0x07ffff) AM_RAM /* Additional DRAM CPU-1D */
193AM_RANGE (0x080000, 0x083fff) AM_ROM /* System EPROM Area 16Kb DEBUGGER supplied as default on CPU-1B/D     */
194AM_RANGE (0x084000, 0x09ffff) AM_ROM /* System EPROM Area 112Kb additional space for System ROM     */
195//AM_RANGE (0x0a0000, 0x0bffff) AM_ROM /* User EPROM/SRAM Area, max 128Kb mapped by a cartslot  */
196AM_RANGE (0x0c0040, 0x0c0041) AM_DEVREADWRITE8 ("aciahost", acia6850_device, status_r, control_w, 0x00ff)
197AM_RANGE (0x0c0042, 0x0c0043) AM_DEVREADWRITE8 ("aciahost", acia6850_device, data_r, data_w, 0x00ff)
198AM_RANGE (0x0c0080, 0x0c0081) AM_DEVREADWRITE8 ("aciaterm", acia6850_device, status_r, control_w, 0xff00)
199AM_RANGE (0x0c0082, 0x0c0083) AM_DEVREADWRITE8 ("aciaterm", acia6850_device, data_r, data_w, 0xff00)
200AM_RANGE (0x0c0100, 0x0c0101) AM_DEVREADWRITE8 ("aciaremt", acia6850_device, status_r, control_w, 0x00ff)
201AM_RANGE (0x0c0102, 0x0c0103) AM_DEVREADWRITE8 ("aciaremt", acia6850_device, data_r, data_w, 0x00ff)
202AM_RANGE (0x0c0400, 0x0c042f) AM_DEVREADWRITE8 ("rtc", mm58167_device, read, write, 0x00ff)
203AM_RANGE (0x0e0000, 0x0e0035) AM_DEVREADWRITE8 ("pit", pit68230_device, read, write, 0x00ff)
164static ADDRESS_MAP_START(force68k_mem, AS_PROGRAM, 16, force68k_state)
165      ADDRESS_MAP_UNMAP_HIGH
166      AM_RANGE(0x000000, 0x000007) AM_ROM AM_READ(bootvect_r) /* Vectors mapped from System EPROM */
167      AM_RANGE(0x000008, 0x01ffff) AM_RAM /* DRAM */
168      AM_RANGE(0x080000, 0x09ffff) AM_ROM /* System EPROM Area */
169//  AM_RANGE(0x0a0000, 0x0bffff) AM_ROM /* User EPROM Area   */
170   AM_RANGE(0x0c0040, 0x0c0041) AM_DEVREADWRITE8("aciahost", acia6850_device, status_r, control_w, 0x00ff)
171   AM_RANGE(0x0c0042, 0x0c0043) AM_DEVREADWRITE8("aciahost", acia6850_device, data_r, data_w, 0x00ff)
172   AM_RANGE(0x0c0080, 0x0c0081) AM_DEVREADWRITE8("aciaterm", acia6850_device, status_r, control_w, 0xff00)
173   AM_RANGE(0x0c0082, 0x0c0083) AM_DEVREADWRITE8("aciaterm", acia6850_device, data_r, data_w, 0xff00)
174   AM_RANGE(0x0c0100, 0x0c0101) AM_DEVREADWRITE8("aciaremt", acia6850_device, status_r, control_w, 0x00ff)
175   AM_RANGE(0x0c0102, 0x0c0103) AM_DEVREADWRITE8("aciaremt", acia6850_device, data_r, data_w, 0x00ff)
176      AM_RANGE(0x0c0400, 0x0c042f) AM_DEVREADWRITE8("rtc", mm58167_device, read, write, 0x00ff)
177      AM_RANGE(0x0e0000, 0x0e0035) AM_DEVREADWRITE8("pit", pit68230_device, data_r, data_w, 0x00ff)
204178//      AM_RANGE(0x0e0200, 0x0e0380) AM_READWRITE(fpu_r, fpu_w) /* optional FPCP 68881 FPU interface */
205AM_RANGE(0x100000, 0xfeffff)  AM_READWRITE(vme_a24_r, vme_a24_w) /* VMEbus Rev B addresses (24 bits) */
206AM_RANGE(0xff0000, 0xffffff)  AM_READWRITE(vme_a16_r, vme_a16_w) /* VMEbus Rev B addresses (16 bits) */
179//      AM_RANGE(0x100000, 0xfeffff) /* VMEbus Rev B addresses (24 bits) */
180//      AM_RANGE(0xff0000, 0xffffff) /* VMEbus Rev B addresses (16 bits) */
207181ADDRESS_MAP_END
208182
209183/* Input ports */
210static INPUT_PORTS_START (force68k)
184static INPUT_PORTS_START( force68k )
211185INPUT_PORTS_END
212186
213/*
214 *  Centronics support
215 *
216 *  The system ROMs has support for a parallel printer interface but the signals are just routed to row A
217 *  of the VME P2 connector so no on board Centronics connector is available but assumed to be added on a
218 *  separate I/O board. After some detective work I found that the ROM works as follows:
219 *
220 *  The 'PA' (Printer Attach) command issues a <cr> on Port A and sends a strobe on H2 it then loops over
221 *  the select signal, bit 0 on Port B, and the ack signal on HS1, both to be non zero. The support is really
222 *  flawed as the strobe signal goes high instead of low ( this might assume an inverting driver on the
223 *  P2 board ) and the busy signal is not checked at all. Or I might have assumed it all wrong, but it now
224 *  works with the generic centronics printer driver. Need the printer board documentation to improve further.
225 *
226 *  When the 'PA' command is successful everything printed to screen is mirrored on the printer. Use the
227 *  'NOPA' command to stop mirroring. I had no printer ROMs so could not test it with a "real" printer.
228 *
229 *  Force CPU-1 init sequence for MC68230 PIT
230 *  -----------------------------------------
231 *  0801E6 0E0000 W 00 -> PGCR  Mode 0 (uni8), H34 dis, H12 dis, H1234 HZ
232 *  0801E6 0E0002 W 00 -> PSRR  PC4, PC5, H1S>H2S>H3S>H4S
233 *  0801E6 0E0004 W FF -> PADDR Port A all Outputs
234 *  0801E6 0E0006 W 00 -> PBDDR Port B all Inputs
235 *  0801EA 0E000C W 60 -> PACR  Port A Mode 01, pin def, dbfr H1 data rec, H2 status/int, H2 output neg, H2S clrd
236 *  0801F0 0E000E W A0 -> PBCR  Port B mode 1x, H4 output neg, H4S clrd, H3 int dis, H3 edg input, H3S set by assrt edg
237 *  0801F6 0E0000 W 30 -> PGCR  H34 enable, H12enable
238 *  0801FC 0E000E W A8 -> PBCR  +H4 asserted
239 *  08020A 0E000E W A0 -> PBCR  +H4 negated
240 *
241 *  Upon PA (Printer Attach) command enabling the Centronics printer mode
242 *  ---------------------------------------------------------------------
243 *  081DB4 0E0011 W D0 -> PADR  Data to Port A
244 *  081DB8 0E000D W 68 -> PACR  H2 output asserted Centronics Strobe
245 *  081DC0 0E000D W 60 -> PACR  H2 output negated
246 *  081DD0 0E0013 R 00 <- PBDR  Port B polled for 01 (data) & 03 (mask)
247 *
248 */
249
250/* Centronics ACK handler
251 * The centronics ack signal is expected by the ROM to arrive at H1 input line
252 */
253WRITE_LINE_MEMBER (force68k_state::centronics_ack_w)
187void force68k_state::machine_start()
254188{
255//      LOG (logerror ("centronics_ack_w(%d) %lld\n", state, m_maincpu->total_cycles ()));
256        m_centronics_ack = state;
257        m_pit->h1_set (state);
189   m_sysrom = (UINT16*)(memregion("maincpu")->base() + 0x080000);
258190}
259191
260/* Centronics BUSY handler
261 * The centronics busy signal is not used by the ROM driver afaik
262 */
263WRITE_LINE_MEMBER (force68k_state::centronics_busy_w){
264//      LOG (logerror ("centronics_busy_w(%d) %lld\n", state, m_maincpu->total_cycles ()));
265        m_centronics_busy = state;
192READ16_MEMBER(force68k_state::bootvect_r)
193{
194      return m_sysrom[offset];
266195}
267196
268/* Centronics PERROR handler
269 * The centronics perror signal is not used by the ROM driver afaik
270 */
271WRITE_LINE_MEMBER (force68k_state::centronics_perror_w){
272//      LOG (logerror ("centronics_perror_w(%d) %lld\n", state, m_maincpu->total_cycles ()));
273        m_centronics_perror = state;
197WRITE_LINE_MEMBER(force68k_state::write_aciahost_clock)
198{
199      m_aciahost->write_txc(state);
200   m_aciahost->write_rxc(state);
274201}
275202
276/* Centronics SELECT handler
277 * The centronics select signal is expected by the ROM on Port B bit 0
278 */
279WRITE_LINE_MEMBER (force68k_state::centronics_select_w){
280//      LOG (logerror ("centronics_select_w(%d) %lld\n", state, m_maincpu->total_cycles ()));
281        m_centronics_select = state;
282        m_pit->portb_setbit (0, state);
283}
284
285/* Start it up */
286void force68k_state::machine_start ()
203WRITE_LINE_MEMBER(force68k_state::write_aciaterm_clock)
287204{
288        LOG (logerror ("machine_start\n"));
289
290        save_item (NAME (m_centronics_busy));
291        save_item (NAME (m_centronics_ack));
292        save_item (NAME (m_centronics_select));
293        save_item (NAME (m_centronics_perror));
294
295        /* Setup pointer to bootvector in ROM for bootvector handler bootvect_r */
296        m_sysrom = (UINT16*)(memregion ("maincpu")->base () + 0x080000);
297
298        /* Map user ROM/RAM socket(s) */
299        if (m_cart->exists())
300        {
301                m_usrrom = (UINT16*)m_cart->get_rom_base();
302#if 0 // This should be the correct way but produces odd and even bytes swapped
303                m_maincpu->space(AS_PROGRAM).install_read_handler(0xa0000, 0xbffff, read16_delegate(FUNC(generic_slot_device::read16_rom), (generic_slot_device*)m_cart));
304#else // So we installs a custom very ineffecient handler for now until we understand hwp to solve the problem better
305                m_maincpu->space(AS_PROGRAM).install_read_handler(0xa0000, 0xbffff, read16_delegate(FUNC(force68k_state::read16_rom), this));
306#endif
307        }
205      m_aciaterm->write_txc(state);
206   m_aciaterm->write_rxc(state);
308207}
309208
310/* A very ineffecient User cart emulation of two 8 bit sockets (odd and even) */
311READ16_MEMBER (force68k_state::read16_rom){
312  offset = offset % m_cart->common_get_size("rom"); // Don't read outside buffer...
313  return ((m_usrrom [offset] << 8) & 0xff00) | ((m_usrrom [offset] >> 8) & 0x00ff);
314}
315
316/* Boot vector handler, the PCB hardwires the first 8 bytes from 0x80000 to 0x0 */
317READ16_MEMBER (force68k_state::bootvect_r){
318        return m_sysrom [offset];
319}
320
321/* 10. The VMEbus (text from board documentation)
322 * ---------------
323 * The implemented VMEbus Interface includes 24 address, 16 data,
324 * 6 address modifier and the asynchronous control signals.
325 * A single level bus arbiter is provided to build multi master
326 * systems. In addition to the bus arbiter, a separate slave bus
327 * arbitration allows selection of the arbitration level (0-3).
328 *
329 * The address modifier range .,Short 110 Access« can be selected
330 * via a jumper for variable system generation. The 7 interrupt
331 * request levels of the VMEbus are fully supported from the
332 * SYS68K1CPU-1 B/D. For multi-processing, each IRQ signal can be
333 * enabled/disabled via a jumper field.
334 *
335 * Additionally, the SYS68K1CPU-1 B/D supports the ACFAIL, SYSRESET,
336 * SYSFAIL and SYSCLK signal (16 MHz).
337 */
338
339/* Dummy VME access methods until the VME bus device is ready for use */
340READ16_MEMBER (force68k_state::vme_a24_r){
341        LOG (logerror ("vme_a24_r\n"));
342        return (UINT16) 0;
343}
344
345WRITE16_MEMBER (force68k_state::vme_a24_w){
346        LOG (logerror ("vme_a24_w\n"));
347}
348
349READ16_MEMBER (force68k_state::vme_a16_r){
350        LOG (logerror ("vme_16_r\n"));
351        return (UINT16) 0;
352}
353
354WRITE16_MEMBER (force68k_state::vme_a16_w){
355        LOG (logerror ("vme_a16_w\n"));
356}
357
358/*
359 * Serial port clock sources can all be driven by different outputs of the 14411
360 */
361WRITE_LINE_MEMBER (force68k_state::write_aciahost_clock){
362        m_aciahost->write_txc (state);
363        m_aciahost->write_rxc (state);
364}
365
366WRITE_LINE_MEMBER (force68k_state::write_aciaterm_clock){
367        m_aciaterm->write_txc (state);
368        m_aciaterm->write_rxc (state);
369}
370
371WRITE_LINE_MEMBER (force68k_state::write_aciaremt_clock){
372        m_aciaremt->write_txc (state);
373        m_aciaremt->write_rxc (state);
374}
375
376/*
377 * 4. The USER Area (Text from the board manual)
378  The USER area contains two 28 pin sockets with JEDEC compatible pin out.
379   To allow the usage of static RAM's, the access to the USER area is byte
380   oriented. Table 3. lists the usable device types.
381
382   Bits   Bytes    EPROM SRAM
383   --------------------------
384   2Kx16   4 Kbyte 2716  6116
385   4Kx16   8 Kbyte 2732
386   8Kx16  16 Kbyte 2764  6264
387   16Kx16 32 Kbyte 27128
388   32Kx16 64 Kbyte 27256
389   --------------------------
390*/
391// Implementation of static 2 x 64K EPROM in sockets J10/J11 as 16 bit wide cartridge for easier
392// software handling. TODO: make configurable according to table above.
393static MACHINE_CONFIG_FRAGMENT( fccpu1_eprom_sockets )
394        MCFG_GENERIC_CARTSLOT_ADD("exp_rom1", generic_plain_slot, "fccpu1_cart")
395        MCFG_GENERIC_EXTENSIONS("bin,rom")
396        MCFG_GENERIC_WIDTH(GENERIC_ROM16_WIDTH)
397        MCFG_GENERIC_ENDIAN(ENDIANNESS_BIG)
398        MCFG_GENERIC_LOAD(force68k_state, exp1_load)
399//      MCFG_SOFTWARE_LIST_ADD("cart_list", "fccpu1_cart")
400MACHINE_CONFIG_END
401
402/***************************
403   Rom loading functions
404****************************/
405int force68k_state::force68k_load_cart(device_image_interface &image, generic_slot_device *slot)
209WRITE_LINE_MEMBER(force68k_state::write_aciaremt_clock)
406210{
407        UINT32 size = slot->common_get_size("rom");
408
409        if (size > 0x20000) // Max 128Kb
410        {
411                LOG( printf("Cartridge size exceeding max size (128Kb): %d\n", size) );
412                image.seterror(IMAGE_ERROR_UNSPECIFIED, "Cartridge size exceeding max size (128Kb)");
413                return IMAGE_INIT_FAIL;
414        }
415
416        slot->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_BIG);
417        slot->common_load_rom(slot->get_rom_base(), size, "rom");
418       
419        return IMAGE_INIT_PASS;
211      m_aciaremt->write_txc(state);
212   m_aciaremt->write_rxc(state);
420213}
421214
422/*
423 * Machine configuration
424 */
425static MACHINE_CONFIG_START (fccpu1, force68k_state)
426/* basic machine hardware */
427MCFG_CPU_ADD ("maincpu", M68000, XTAL_16MHz / 2)
428MCFG_CPU_PROGRAM_MAP (force68k_mem)
215static MACHINE_CONFIG_START( fccpu1, force68k_state )
216   /* basic machine hardware */
217   MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz / 2)
218   MCFG_CPU_PROGRAM_MAP(force68k_mem)
429219
430/* P3/Host Port config 
431 * LO command causes ROM monitor to expect S-records on HOST port by default
432 * Implementation through nullmodem currently does not support handshakes so
433 * the ROM momitor is over-run while checking for checksums etc if used with
434 * UI mount <file> feature.
435 */
436MCFG_DEVICE_ADD ("aciahost", ACIA6850, 0)
220      /* P3/Host Port config */
221   MCFG_DEVICE_ADD("aciahost", ACIA6850, 0)
222      MCFG_DEVICE_ADD("aciahost_clock", CLOCK, ACIA_CLOCK)
223   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciahost_clock))
437224
438MCFG_ACIA6850_TXD_HANDLER (DEVWRITELINE ("rs232host", rs232_port_device, write_txd))
439MCFG_ACIA6850_RTS_HANDLER (DEVWRITELINE ("rs232host", rs232_port_device, write_rts))
225      /* P4/Terminal Port config */
226   MCFG_DEVICE_ADD("aciaterm", ACIA6850, 0)
440227
441MCFG_RS232_PORT_ADD ("rs232host", default_rs232_devices, "null_modem")
442MCFG_RS232_RXD_HANDLER (DEVWRITELINE ("aciahost", acia6850_device, write_rxd))
443MCFG_RS232_CTS_HANDLER (DEVWRITELINE ("aciahost", acia6850_device, write_cts))
228   MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232trm", rs232_port_device, write_txd))
229   MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232trm", rs232_port_device, write_rts))
444230
445MCFG_DEVICE_ADD ("aciahost_clock", CLOCK, ACIA_CLOCK)
446MCFG_CLOCK_SIGNAL_HANDLER (WRITELINE (force68k_state, write_aciahost_clock))
231   MCFG_RS232_PORT_ADD("rs232trm", default_rs232_devices, "terminal")
232   MCFG_RS232_RXD_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_rxd))
233   MCFG_RS232_CTS_HANDLER(DEVWRITELINE("aciaterm", acia6850_device, write_cts))
447234
448/* P4/Terminal Port config */
449MCFG_DEVICE_ADD ("aciaterm", ACIA6850, 0)
235      MCFG_DEVICE_ADD("aciaterm_clock", CLOCK, ACIA_CLOCK)
236   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock))
450237
451MCFG_ACIA6850_TXD_HANDLER (DEVWRITELINE ("rs232trm", rs232_port_device, write_txd))
452MCFG_ACIA6850_RTS_HANDLER (DEVWRITELINE ("rs232trm", rs232_port_device, write_rts))
238      /* P5/Remote Port config */
239   MCFG_DEVICE_ADD("aciaremt", ACIA6850, 0)
453240
454MCFG_RS232_PORT_ADD ("rs232trm", default_rs232_devices, "terminal")
455MCFG_RS232_RXD_HANDLER (DEVWRITELINE ("aciaterm", acia6850_device, write_rxd))
456MCFG_RS232_CTS_HANDLER (DEVWRITELINE ("aciaterm", acia6850_device, write_cts))
241#define PRINTER 0
242#if PRINTER
243   MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232rmt", rs232_port_device, write_txd))
244   MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232rmt", rs232_port_device, write_rts))
457245
458MCFG_DEVICE_ADD ("aciaterm_clock", CLOCK, ACIA_CLOCK)
459MCFG_CLOCK_SIGNAL_HANDLER (WRITELINE (force68k_state, write_aciaterm_clock))
246   MCFG_RS232_PORT_ADD("rs232rmt", default_rs232_devices, "printer")
247   MCFG_RS232_RXD_HANDLER(DEVWRITELINE("aciaremt", acia6850_device, write_rxd))
248   MCFG_RS232_CTS_HANDLER(DEVWRITELINE("aciaremt", acia6850_device, write_cts))
249#endif
460250
461/* P5/Remote Port config */
462MCFG_DEVICE_ADD ("aciaremt", ACIA6850, 0)
251      MCFG_DEVICE_ADD("aciaremt_clock", CLOCK, ACIA_CLOCK)
252   MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(force68k_state, write_aciaterm_clock))
463253
464MCFG_DEVICE_ADD ("aciaremt_clock", CLOCK, ACIA_CLOCK)
465MCFG_CLOCK_SIGNAL_HANDLER (WRITELINE (force68k_state, write_aciaterm_clock))
254   /* RTC Real Time Clock device */
255   MCFG_DEVICE_ADD("rtc", MM58167, XTAL_32_768kHz)
466256
467/* RTC Real Time Clock device */
468MCFG_DEVICE_ADD ("rtc", MM58167, XTAL_32_768kHz)
257   /* PIT Parallel Interface and Timer device, assuming strapped for on board clock */
258   MCFG_DEVICE_ADD("pit", PIT68230, XTAL_16MHz / 2)
469259
470/* PIT Parallel Interface and Timer device, assuming strapped for on board clock */
471MCFG_DEVICE_ADD ("pit", PIT68230, XTAL_16MHz / 2)
472MCFG_PIT68230_PA_OUTPUT_CALLBACK (DEVWRITE8 ("cent_data_out", output_latch_device, write))
473MCFG_PIT68230_H2_CALLBACK (DEVWRITELINE ("centronics", centronics_device, write_strobe))
260MACHINE_CONFIG_END
474261
475// centronics
476MCFG_CENTRONICS_ADD ("centronics", centronics_devices, "printer")
477MCFG_CENTRONICS_ACK_HANDLER (WRITELINE (force68k_state, centronics_ack_w))
478MCFG_CENTRONICS_BUSY_HANDLER (WRITELINE (force68k_state, centronics_busy_w))
479MCFG_CENTRONICS_PERROR_HANDLER (WRITELINE (force68k_state, centronics_perror_w))
480MCFG_CENTRONICS_SELECT_HANDLER (WRITELINE (force68k_state, centronics_select_w))
481MCFG_CENTRONICS_OUTPUT_LATCH_ADD ("cent_data_out", "centronics")
262#if 0
482263
483// EPROM sockets
484MCFG_FRAGMENT_ADD(fccpu1_eprom_sockets)
264static MACHINE_CONFIG_START( fccpu6, force68k_state )
265   MCFG_CPU_ADD("maincpu", M68000, XTAL_8MHz)  /* Jumper B10 Mode B */
266   MCFG_CPU_PROGRAM_MAP(force68k_mem)
485267MACHINE_CONFIG_END
486268
487#if 0 /*
488       * CPU-6 family is device and adressmap compatible with CPU-1 but with additions
489       * such as an optional 68881 FPU
490       */
491static MACHINE_CONFIG_START (fccpu6, force68k_state)
492MCFG_CPU_ADD ("maincpu", M68000, XTAL_8MHz)         /* Jumper B10 Mode B */
493MCFG_CPU_PROGRAM_MAP (force68k_mem)
269static MACHINE_CONFIG_START( fccpu6a, force68k_state )
270   MCFG_CPU_ADD("maincpu", M68000, XTAL_12_5MHz) /* Jumper B10 Mode A */
271   MCFG_CPU_PROGRAM_MAP(force68k_mem)
494272MACHINE_CONFIG_END
495273
496static MACHINE_CONFIG_START (fccpu6a, force68k_state)
497MCFG_CPU_ADD ("maincpu", M68000, XTAL_12_5MHz)        /* Jumper B10 Mode A */
498MCFG_CPU_PROGRAM_MAP (force68k_mem)
274static MACHINE_CONFIG_START( fccpu6v, force68k_state )
275   MCFG_CPU_ADD("maincpu", M68010, XTAL_8MHz)  /* Jumper B10 Mode B */
276   MCFG_CPU_PROGRAM_MAP(force68k_mem)
499277MACHINE_CONFIG_END
500278
501static MACHINE_CONFIG_START (fccpu6v, force68k_state)
502MCFG_CPU_ADD ("maincpu", M68010, XTAL_8MHz)         /* Jumper B10 Mode B */
503MCFG_CPU_PROGRAM_MAP (force68k_mem)
279static MACHINE_CONFIG_START( fccpu6va, force68k_state )
280   MCFG_CPU_ADD("maincpu", M68010, XTAL_12_5MHz) /* Jumper B10 Mode A */
281   MCFG_CPU_PROGRAM_MAP(force68k_mem)
504282MACHINE_CONFIG_END
505283
506static MACHINE_CONFIG_START (fccpu6va, force68k_state)
507MCFG_CPU_ADD ("maincpu", M68010, XTAL_12_5MHz)        /* Jumper B10 Mode A */
508MCFG_CPU_PROGRAM_MAP (force68k_mem)
284static MACHINE_CONFIG_START( fccpu6vb, force68k_state )
285   MCFG_CPU_ADD("maincpu", M68010, XTAL_12_5MHz) /* Jumper B10 Mode A */
286   MCFG_CPU_PROGRAM_MAP(force68k_mem)
509287MACHINE_CONFIG_END
510
511static MACHINE_CONFIG_START (fccpu6vb, force68k_state)
512MCFG_CPU_ADD ("maincpu", M68010, XTAL_12_5MHz)        /* Jumper B10 Mode A */
513MCFG_CPU_PROGRAM_MAP (force68k_mem)
514MACHINE_CONFIG_END
515288#endif
516289
517290/* ROM definitions */
518ROM_START (fccpu1)
519ROM_REGION (0x1000000, "maincpu", 0)
291ROM_START( fccpu1 )
292   ROM_REGION(0x1000000, "maincpu", 0)
520293
521ROM_LOAD16_BYTE ("fccpu1V1.0L.j8.bin", 0x080001, 0x2000, CRC (3ac6f08f) SHA1 (502f6547b508d8732bd68bbbb2402d8c30fefc3b))
522ROM_LOAD16_BYTE ("fccpu1V1.0L.j9.bin", 0x080000, 0x2000, CRC (035315fb) SHA1 (90dc44d9c25d28428233e6846da6edce2d69e440))
523
524/*
525 * System ROM terminal commands
526 *
527 * COMMAND SUMMARY DESCRIPTION (From CPU-1B datasheet, ROMs were dumped
528 * from a CPU-1 board so some features might be missing or different)
529 * ---------------------------------------------------------------------------
530 * BF <address1> <address2> <data> <CR>        Block Fill memory - from addr1 through addr2 with data
531 * BM <address1> <address2> <address 3> <CR>   Block Move  - move from addr1 through addr2to addr3
532 * BR [<address> [; <count>] ... ] <CR>        Set/display Breakpoint
533 * BS <address1> <address2> <data> <CR>        Block Search - search addr1 through addr2 for data
534 * BT <address1> <address2> <CR>               Block Test of memory
535 * DC <expression> <CR>                        Data Conversion
536 * DF <CR>                                     Display Formatted registers
537 * DU [n] <address1> <address2>[<string>] <CR> Dump memory to object file
538 * GO or G [<address] <CR>                     Execute program.
539 * GD [<address] <CR>                          Go Direct
540 * GT <address> <CR>                           Exec prog: temporary breakpoint
541 * HE<CR>                                      Help; display monitor commands
542 * LO [n] [;<options] <CR>                     Load Object file
543 * MD <address> [<count>] <CR>                 Memory Display
544 * MM or M <address> [<data<][;<options>] <CR> Memory Modify
545 * MS <address> <data1 > <data2> < ... <CR>    Memory Set - starting at addr with data 1. data 2 ...
546 * NOBR [<address> ... ] <CR>                  Remove Breakpoint
547 * NOPA <CR>                                   Printer Detach (Centronics on PIT/P2)
548 * OF <CR>                                     Offset
549 * PA <CR>                                     Printer Attach (Centronics on PIT/P2)
550 * PF[n] <CR>                                  Set/display Port Format
551 * RM <CR>                                     Register Modify
552 * TM [<exit character>] <CR>                  Transparent Mode
553 * TR OR T [<count] <CR>                       Trace
554 * TT <address> <CR>                           Trace: temporary breakpoint
555 * VE [n] [<string] <CR>                       Verify memory/object file
556 * ----------------------------------------------------------------------------
557 * .AO - .A7 [<expression] <CR>                Display/set address register
558 * .00 - .07 [<expression] <CR>                Display/set data register
559 * .RO - .R6 [<expression] <CR>                Display/set offset register
560 * .PC [<expression] <CR>                      Display/set program counter
561 * .SR [<expression] <CR>                      Display/set status register
562 * .SS [<expression] <CR>                      Display/set supervisor stack
563 * .US [<expression] <CR>                      Display/set user stack
564 * ----------------------------------------------------------------------------
565 * MD <address> [<count>]; DI <CR>             Disassemble memory location
566 * MM <address>; DI <CR>                       Disassemble/Assemble memory location
567 * ----------------------------------------------------------------------------
568 * Undocumented commands found in ROM table at address 0x80308
569 * .*                                          No WHAT message displayed, no action seen.
570 */
294      ROM_LOAD16_BYTE( "fccpu1V1.0L.j8.bin", 0x080001, 0x2000, CRC(3ac6f08f) SHA1(502f6547b508d8732bd68bbbb2402d8c30fefc3b) )
295      ROM_LOAD16_BYTE( "fccpu1V1.0L.j9.bin", 0x080000, 0x2000, CRC(035315fb) SHA1(90dc44d9c25d28428233e6846da6edce2d69e440) )
296/* COMMAND SUMMARY DESCRIPTION (From CPU-1B datasheet, ROMs were dumped
297   from a CPU-1 board so some features might be missing or different)
298---------------------------------------------------------------------------
299   BF <address1> <address2> <data> <CR>        Block Fill memory - from addr1 through addr2 with data
300   BM <address1> <address2> <address 3> <CR>   Block Move  - move from addr1 through addr2to addr3
301   BR [<address> [; <count>] ... ] <CR>        Set/display Breakpoint
302   BS <address1> <address2> <data> <CR>        Block Search - search addr1 through addr2 for data
303   BT <address1> <address2> <CR>               Block Test of memory
304   DC <expression> <CR>                        Data Conversion
305   DF <CR>                                     Display Formatted registers
306   DU [n] <address1> <address2>[<string>] <CR> Dump memory to object file
307   GO [<address] <CR>                          Execute program
308   GD [<address] <CR>                          Go Direct
309   GT <address> <CR>                           Exec prog: temporary breakpoint
310   HE<CR>                                      Help; display monitor commands
311   LO [n] [;<options] <CR>                     Load Object file
312   MD <address> [<count?? <CR>                  Memory Display
313   MM <address> [<data?? [;<options?? <CR>       Memory Modify
314   MS <address> <data1 > <data2> < ... <CR>    Memory Set - starting at addr with data 1. data 2 ...
315   NOBR [<address> ... ] <CR>                  Remove Breakpoint
316   NOPA <CR>                                   Printer Detach (Centronics on PIT/P2)
317   OF <CR>                                     Offset
318   PA <CR>                                     Printer Attach (Centronics on PIT/P2)
319   PF[n] <CR>                                  Set/display Port Format
320   RM <CR>                                     Register Modify
321   TM [<exit character?? <CR>                   Transparent Mode
322   TR [<count] <CR>                            Trace
323   TT <address> <CR>                           Trace: temporary breakpoint
324   VE [n] [<string] <CR>                       Verify memory/object file
325----------------------------------------------------------------------------
326  .AO - .A7 [<expression] <CR>                 Display/set address register
327  .00 - .07 [<expression] <CR>                 Display/set data register
328  .RO - .R6 [<expression] <CR>                 Display/set offset register
329  .PC [<expression] <CR>                       Display/set program counter
330  .SR [<expression] <CR>                       Display/set status register
331  .SS [<expression] <CR>                       Display/set supervisor stack
332  .US [<expression] <CR>                       Display/set user stack
333----------------------------------------------------------------------------
334   MD <address> [<count>]; D1 <CR>             Disassemble memory location
335   MM <address>; DI <CR>                       Disassemble/Assemble memory location
336----------------------------------------------------------------------------
337*/
571338ROM_END
572339
573/*
574 * CPU-6 ROMs were generally based om VMEPROM which contained the PDOS RTOS from Eyring Research.
575 * I don't have these but if anyone can dump them and send to me I can verify that they work as expected.
576 */
577340#if 0
578ROM_START (fccpu6)
579ROM_REGION (0x1000000, "maincpu", 0)
341ROM_START( fccpu6 )
342   ROM_REGION(0x1000000, "maincpu", 0)
580343ROM_END
581344
582ROM_START (fccpu6a)
583ROM_REGION (0x1000000, "maincpu", 0)
345ROM_START( fccpu6a )
346   ROM_REGION(0x1000000, "maincpu", 0)
584347ROM_END
585348
586ROM_START (fccpu6v)
587ROM_REGION (0x1000000, "maincpu", 0)
349ROM_START( fccpu6v )
350   ROM_REGION(0x1000000, "maincpu", 0)
588351ROM_END
589352
590ROM_START (fccpu6va)
591ROM_REGION (0x1000000, "maincpu", 0)
353ROM_START( fccpu6va )
354   ROM_REGION(0x1000000, "maincpu", 0)
592355ROM_END
593356
594ROM_START (fccpu6vb)
595ROM_REGION (0x1000000, "maincpu", 0)
357ROM_START( fccpu6vb )
358   ROM_REGION(0x1000000, "maincpu", 0)
596359ROM_END
597360#endif
598361
trunk/src/mess/drivers/hh_hmcs40.c
r249051r249052
17181718  * PCB label Kaken Corp. PT-460
17191719  * Hitachi QFP HD38820A88 MCU(main), HD38820A89(audio)
17201720  * cyan/red VFD display
1721
1721 
17221722  This is a memory game, the difference is instead of pictures, the player
17231723  needs to match sound effects. It has an extra MCU for sound. The case is
17241724  shaped like a glossy black pyramid. Star Trek fans will recognize it as
r249051r249052
17581758{
17591759   // D7: sound reset (to audiocpu reset line)
17601760   m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
1761
1761   
17621762   // D9: sound start (to audiocpu INT0)
17631763   m_audiocpu->set_input_line(0, (data & 0x200) ? ASSERT_LINE : CLEAR_LINE);
1764
1764   
17651765   // D10,D15: input mux
17661766   m_inp_mux = (data >> 10 & 1) | (data >> 14 & 2);
1767
1767   
17681768   // D0-D5: vfd matrix grid
17691769   m_grid = data & 0x3f;
17701770   display_matrix(12, 6, m_plate, m_grid);
r249051r249052
17951795{
17961796   // D0: speaker out
17971797   m_speaker->level_w(data & 1);
1798
1798   
17991799   // D1: sound ack (to maincpu INT0)
18001800   m_maincpu->set_input_line(0, (data & 2) ? ASSERT_LINE : CLEAR_LINE);
18011801}
trunk/src/mess/drivers/hh_tms1k.c
r249051r249052
235235      }
236236
237237   memcpy(m_display_cache, active_state, sizeof(m_display_cache));
238
238   
239239   // output optional power led
240240   if (m_power_led != m_power_on)
241241   {
trunk/src/mess/drivers/hh_ucom4.c
r249051r249052
969969  Castle Toy Tactix
970970  * NEC uCOM-43 MCU, labeled D557LC 512
971971  * 16 LEDs behind buttons
972
972 
973973  Tactix is similar to Merlin, for 1 or 2 players. In 2-player mode, simply
974974  don't press the Comp Turn button. The four included minigames are:
975975  1: Capture (reversi)
r249051r249052
11941194  known releases:
11951195  - USA: Electronic Football (aka Pro-Bowl Football)
11961196  - Japan: American Football
1197
1197 
11981198  note: MAME external artwork is not needed for this game
11991199
12001200***************************************************************************/
trunk/src/mess/drivers/hp64k.c
r249051r249052
216216
217217      DECLARE_READ16_MEMBER(hp64k_usart_r);
218218      DECLARE_WRITE16_MEMBER(hp64k_usart_w);
219            DECLARE_WRITE_LINE_MEMBER(hp64k_rxrdy_w);
220            DECLARE_WRITE_LINE_MEMBER(hp64k_txrdy_w);
221            DECLARE_WRITE_LINE_MEMBER(hp64k_txd_w);
222            DECLARE_WRITE_LINE_MEMBER(hp64k_dtr_w);
223            DECLARE_WRITE_LINE_MEMBER(hp64k_rts_w);
219                DECLARE_WRITE_LINE_MEMBER(hp64k_rxrdy_w);
220                DECLARE_WRITE_LINE_MEMBER(hp64k_txrdy_w);
221                DECLARE_WRITE_LINE_MEMBER(hp64k_txd_w);
222                DECLARE_WRITE_LINE_MEMBER(hp64k_dtr_w);
223                DECLARE_WRITE_LINE_MEMBER(hp64k_rts_w);
224224      DECLARE_WRITE16_MEMBER(hp64k_loopback_w);
225            void hp64k_update_loopback(void);
226            DECLARE_WRITE_LINE_MEMBER(hp64k_rs232_rxd_w);
227            DECLARE_WRITE_LINE_MEMBER(hp64k_rs232_dcd_w);
228            DECLARE_WRITE_LINE_MEMBER(hp64k_rs232_cts_w);
229
225                void hp64k_update_loopback(void);
226                DECLARE_WRITE_LINE_MEMBER(hp64k_rs232_rxd_w);
227                DECLARE_WRITE_LINE_MEMBER(hp64k_rs232_dcd_w);
228                DECLARE_WRITE_LINE_MEMBER(hp64k_rs232_cts_w);
229               
230230      DECLARE_WRITE16_MEMBER(hp64k_beep_w);
231231      TIMER_DEVICE_CALLBACK_MEMBER(hp64k_beeper_off);
232232
233            DECLARE_WRITE_LINE_MEMBER(hp64k_baud_clk_w);
233                DECLARE_WRITE_LINE_MEMBER(hp64k_baud_clk_w);
234234private:
235235      required_device<hp_5061_3011_cpu_device> m_cpu;
236236      required_device<i8275_device> m_crtc;
r249051r249052
248248      required_ioport m_rs232_sw;
249249      required_device<beep_device> m_beeper;
250250      required_device<timer_device> m_beep_timer;
251            required_device<clock_device> m_baud_rate;
252            required_ioport m_s5_sw;
253            required_device<i8251_device> m_uart;
254            required_device<rs232_port_device> m_rs232;
251                required_device<clock_device> m_baud_rate;
252                required_ioport m_s5_sw;
253                required_device<i8251_device> m_uart;
254                required_device<rs232_port_device> m_rs232;
255255
256256      // Character generator
257257      const UINT8 *m_chargen;
r249051r249052
302302      floppy_state_t m_floppy_if_state;
303303      floppy_image_device *m_current_floppy;
304304
305            // RS232 I/F
306            bool m_16x_clk;
307            bool m_baud_clk;
308            UINT8 m_16x_div;
309            bool m_loopback;
310            bool m_txd_state;
311            bool m_dtr_state;
312            bool m_rts_state;
305                // RS232 I/F
306                bool m_16x_clk;
307                bool m_baud_clk;
308                UINT8 m_16x_div;
309                bool m_loopback;
310                bool m_txd_state;
311                bool m_dtr_state;
312                bool m_rts_state;
313313};
314314
315315static ADDRESS_MAP_START(cpu_mem_map , AS_PROGRAM , 16 , hp64k_state)
r249051r249052
329329      // PA = 4, IC = [0..3]
330330      // Floppy I/F
331331      AM_RANGE(HP_MAKE_IOADDR(4 , 0) , HP_MAKE_IOADDR(4 , 3))   AM_READWRITE(hp64k_flp_r , hp64k_flp_w)
332            // PA = 5, IC = [0..3]
333            // Write to USART
334            AM_RANGE(HP_MAKE_IOADDR(5 , 0) , HP_MAKE_IOADDR(5 , 3))   AM_WRITE(hp64k_usart_w)
332                // PA = 5, IC = [0..3]
333                // Write to USART
334                AM_RANGE(HP_MAKE_IOADDR(5 , 0) , HP_MAKE_IOADDR(5 , 3))   AM_WRITE(hp64k_usart_w)
335335      // PA = 6, IC = [0..3]
336336      // Read from USART
337337      AM_RANGE(HP_MAKE_IOADDR(6 , 0) , HP_MAKE_IOADDR(6 , 3))   AM_READ(hp64k_usart_r)
338338      // PA = 7, IC = 2
339339      // Rear-panel switches and loopback relay control
340      AM_RANGE(HP_MAKE_IOADDR(7 , 2) , HP_MAKE_IOADDR(7 , 2))   AM_READWRITE(hp64k_rear_sw_r , hp64k_loopback_w)
340      AM_RANGE(HP_MAKE_IOADDR(7 , 2) , HP_MAKE_IOADDR(7 , 2))     AM_READWRITE(hp64k_rear_sw_r , hp64k_loopback_w)
341341      // PA = 9, IC = [0..3]
342342      // Beeper control & interrupt status read
343343      AM_RANGE(HP_MAKE_IOADDR(9 , 0) , HP_MAKE_IOADDR(9 , 3))   AM_WRITE(hp64k_beep_w)
r249051r249052
366366      m_rear_panel_sw(*this , "rear_sw"),
367367      m_rs232_sw(*this , "rs232_sw"),
368368      m_beeper(*this , "beeper"),
369            m_beep_timer(*this , "beep_timer"),
370            m_baud_rate(*this , "baud_rate"),
371            m_s5_sw(*this , "s5_sw"),
372            m_uart(*this , "uart"),
373            m_rs232(*this , "rs232")
369                m_beep_timer(*this , "beep_timer"),
370                m_baud_rate(*this , "baud_rate"),
371                m_s5_sw(*this , "s5_sw"),
372                m_uart(*this , "uart"),
373                m_rs232(*this , "rs232")
374374{
375375}
376376
r249051r249052
387387
388388// Divisors of K1135 baud rate generator
389389static unsigned baud_rate_divisors[] = {
390         6336,
391         4224,
392         2880,
393         2355,
394         2112,
395         1056,
396         528,
397         264,
398         176,
399         158,
400         132,
401         88,
402         66,
403         44,
404         33,
405         16
390           6336,
391           4224,
392           2880,
393           2355,
394           2112,
395           1056,
396           528,
397           264,
398           176,
399           158,
400           132,
401           88,
402           66,
403           44,
404           33,
405           16
406406};
407407
408408void hp64k_state::machine_reset()
r249051r249052
428428      m_floppy0_wpt = false;
429429      m_floppy1_wpt = false;
430430      m_beeper->set_state(0);
431            m_baud_rate->set_unscaled_clock(BAUD_RATE_GEN_CLOCK / baud_rate_divisors[ (m_s5_sw->read() >> 1) & 0xf ]);
432            m_16x_clk = (m_rs232_sw->read() & 0x02) != 0;
433            m_loopback = false;
434            m_txd_state = true;
435            m_dtr_state = true;
436            m_rts_state = true;
437
431                m_baud_rate->set_unscaled_clock(BAUD_RATE_GEN_CLOCK / baud_rate_divisors[ (m_s5_sw->read() >> 1) & 0xf ]);
432                m_16x_clk = (m_rs232_sw->read() & 0x02) != 0;
433                m_loopback = false;
434                m_txd_state = true;
435                m_dtr_state = true;
436                m_rts_state = true;
437               
438438}
439439
440440UINT8 hp64k_state::hp64k_crtc_filter(UINT8 data)
r249051r249052
958958
959959READ16_MEMBER(hp64k_state::hp64k_usart_r)
960960{
961            UINT16 tmp;
961                UINT16 tmp;
962962
963            if ((offset & 1) == 0) {
964                        tmp = m_uart->status_r(space , 0);
965            } else {
966                        tmp = m_uart->data_r(space , 0);
967            }
968
963                if ((offset & 1) == 0) {
964                                tmp = m_uart->status_r(space , 0);
965                } else {
966                                tmp = m_uart->data_r(space , 0);
967                }
968               
969969      // bit 8 == bit 7 rear panel switches (modem/terminal) ???
970970
971            tmp |= (m_rs232_sw->read() << 8);
971                tmp |= (m_rs232_sw->read() << 8);
972972
973            if (BIT(m_rear_panel_sw->read() , 7)) {
974                        BIT_SET(tmp , 8);
975            }
976
973                if (BIT(m_rear_panel_sw->read() , 7)) {
974                                BIT_SET(tmp , 8);
975                }
976               
977977      return tmp;
978978}
979979
980980WRITE16_MEMBER(hp64k_state::hp64k_usart_w)
981981{
982            if ((offset & 1) == 0) {
983                        m_uart->control_w(space , 0 , (UINT8)(data & 0xff));
984            } else {
985                        m_uart->data_w(space , 0 , (UINT8)(data & 0xff));
986            }
982                if ((offset & 1) == 0) {
983                                m_uart->control_w(space , 0 , (UINT8)(data & 0xff));
984                } else {
985                                m_uart->data_w(space , 0 , (UINT8)(data & 0xff));
986                }
987987}
988988
989989WRITE_LINE_MEMBER(hp64k_state::hp64k_rxrdy_w)
990990{
991            if (state) {
992                        BIT_SET(m_irl_pending , 6);
993            } else {
994                        BIT_CLR(m_irl_pending , 6);
995            }
991                if (state) {
992                                BIT_SET(m_irl_pending , 6);
993                } else {
994                                BIT_CLR(m_irl_pending , 6);
995                }
996996
997            hp64k_update_irl();
997                hp64k_update_irl();
998998}
999999
10001000WRITE_LINE_MEMBER(hp64k_state::hp64k_txrdy_w)
10011001{
1002            if (state) {
1003                        BIT_SET(m_irl_pending , 5);
1004            } else {
1005                        BIT_CLR(m_irl_pending , 5);
1006            }
1002                if (state) {
1003                                BIT_SET(m_irl_pending , 5);
1004                } else {
1005                                BIT_CLR(m_irl_pending , 5);
1006                }
10071007
1008            hp64k_update_irl();
1008                hp64k_update_irl();
10091009}
10101010
10111011WRITE_LINE_MEMBER(hp64k_state::hp64k_txd_w)
10121012{
1013            m_txd_state = state;
1014            if (m_loopback) {
1015                        m_uart->write_rxd(state);
1016            }
1017            m_rs232->write_txd(state);
1013                m_txd_state = state;
1014                if (m_loopback) {
1015                                m_uart->write_rxd(state);
1016                }
1017                m_rs232->write_txd(state);
10181018}
10191019
10201020WRITE_LINE_MEMBER(hp64k_state::hp64k_dtr_w)
10211021{
1022            m_dtr_state = state;
1023            if (m_loopback) {
1024                        m_uart->write_dsr(state);
1025            }
1026            m_rs232->write_dtr(state);
1022                m_dtr_state = state;
1023                if (m_loopback) {
1024                                m_uart->write_dsr(state);
1025                }
1026                m_rs232->write_dtr(state);
10271027}
10281028
10291029WRITE_LINE_MEMBER(hp64k_state::hp64k_rts_w)
10301030{
1031            if (BIT(m_s5_sw->read() , 0)) {
1032                        // Full duplex, RTS/ = 0
1033                        state = 0;
1034            }
1035            m_rts_state = state;
1036            if (m_loopback) {
1037                        m_uart->write_cts(state);
1038            }
1039            m_rs232->write_rts(state);
1031                if (BIT(m_s5_sw->read() , 0)) {
1032                                // Full duplex, RTS/ = 0
1033                                state = 0;
1034                }
1035                m_rts_state = state;
1036                if (m_loopback) {
1037                                m_uart->write_cts(state);
1038                }
1039                m_rs232->write_rts(state);
10401040}
10411041
10421042WRITE16_MEMBER(hp64k_state::hp64k_loopback_w)
10431043{
1044            m_loopback = BIT(data , 11);
1045            hp64k_update_loopback();
1044                m_loopback = BIT(data , 11);
1045                hp64k_update_loopback();
10461046}
10471047
10481048void hp64k_state::hp64k_update_loopback(void)
10491049{
1050            if (m_loopback) {
1051                        m_uart->write_rxd(m_txd_state);
1052                        m_uart->write_dsr(m_dtr_state);
1053                        m_uart->write_cts(m_rts_state);
1054            } else {
1055                        m_uart->write_rxd(m_rs232->rxd_r());
1056                        m_uart->write_dsr(m_rs232->dcd_r());
1057                        m_uart->write_cts(m_rs232->cts_r());
1058            }
1050                if (m_loopback) {
1051                                m_uart->write_rxd(m_txd_state);
1052                                m_uart->write_dsr(m_dtr_state);
1053                                m_uart->write_cts(m_rts_state);
1054                } else {
1055                                m_uart->write_rxd(m_rs232->rxd_r());
1056                                m_uart->write_dsr(m_rs232->dcd_r());
1057                                m_uart->write_cts(m_rs232->cts_r());
1058                }
10591059}
10601060
10611061WRITE_LINE_MEMBER(hp64k_state::hp64k_rs232_rxd_w)
10621062{
1063            if (!m_loopback) {
1064                        m_uart->write_rxd(state);
1065            }
1063                if (!m_loopback) {
1064                                m_uart->write_rxd(state);
1065                }
10661066}
10671067
10681068WRITE_LINE_MEMBER(hp64k_state::hp64k_rs232_dcd_w)
10691069{
1070            if (!m_loopback) {
1071                        m_uart->write_dsr(state);
1072            }
1070                if (!m_loopback) {
1071                                m_uart->write_dsr(state);
1072                }
10731073}
10741074
10751075WRITE_LINE_MEMBER(hp64k_state::hp64k_rs232_cts_w)
10761076{
1077            if (!m_loopback) {
1078                        m_uart->write_cts(state);
1079            }
1077                if (!m_loopback) {
1078                                m_uart->write_cts(state);
1079                }
10801080}
10811081
10821082WRITE16_MEMBER(hp64k_state::hp64k_beep_w)
r249051r249052
10951095
10961096WRITE_LINE_MEMBER(hp64k_state::hp64k_baud_clk_w)
10971097{
1098            if (!m_16x_clk) {
1099                  if (state && !m_baud_clk) {
1100                              m_16x_div++;
1101                  }
1102                  m_baud_clk = !!state;
1103                        state = BIT(m_16x_div , 3);
1104            }
1105            m_uart->write_txc(state);
1106            m_uart->write_rxc(state);
1098                if (!m_16x_clk) {
1099                      if (state && !m_baud_clk) {
1100                                      m_16x_div++;
1101                      }
1102                      m_baud_clk = !!state;
1103                                state = BIT(m_16x_div , 3);
1104                }
1105                m_uart->write_txc(state);
1106                m_uart->write_rxc(state);
11071107}
11081108
11091109static INPUT_PORTS_START(hp64k)
r249051r249052
13211321                  PORT_DIPSETTING(0x00 , "1x")
13221322                  PORT_DIPSETTING(0x02 , "16x")
13231323
1324                        PORT_START("s5_sw")
1325                        PORT_DIPNAME(0x01 , 0x00 , "Duplex")
1326                        PORT_DIPLOCATION("S5 IO:!1")
1327                        PORT_DIPSETTING(0x00 , "Half duplex")
1328                        PORT_DIPSETTING(0x01 , "Full duplex")
1329                        PORT_DIPNAME(0x1e , 0x00 , "Baud rate")
1330                        PORT_DIPLOCATION("S5 IO:!5,!4,!3,!2")
1331                        PORT_DIPSETTING(0x00 , "50")
1332                        PORT_DIPSETTING(0x02 , "75")
1333                        PORT_DIPSETTING(0x04 , "110")
1334                        PORT_DIPSETTING(0x06 , "134.5")
1335                        PORT_DIPSETTING(0x08 , "150")
1336                        PORT_DIPSETTING(0x0a , "300")
1337                        PORT_DIPSETTING(0x0c , "600")
1338                        PORT_DIPSETTING(0x0e , "1200")
1339                        PORT_DIPSETTING(0x10 , "1800")
1340                        PORT_DIPSETTING(0x12 , "2000")
1341                        PORT_DIPSETTING(0x14 , "2400")
1342                        PORT_DIPSETTING(0x16 , "3600")
1343                        PORT_DIPSETTING(0x18 , "4800")
1344                        PORT_DIPSETTING(0x1a , "7200")
1345                        PORT_DIPSETTING(0x1c , "9600")
1346                        PORT_DIPSETTING(0x1e , "19200")
1324                                PORT_START("s5_sw")
1325                                PORT_DIPNAME(0x01 , 0x00 , "Duplex")
1326                                PORT_DIPLOCATION("S5 IO:!1")
1327                                PORT_DIPSETTING(0x00 , "Half duplex")
1328                                PORT_DIPSETTING(0x01 , "Full duplex")
1329                                PORT_DIPNAME(0x1e , 0x00 , "Baud rate")
1330                                PORT_DIPLOCATION("S5 IO:!5,!4,!3,!2")
1331                                PORT_DIPSETTING(0x00 , "50")
1332                                PORT_DIPSETTING(0x02 , "75")
1333                                PORT_DIPSETTING(0x04 , "110")
1334                                PORT_DIPSETTING(0x06 , "134.5")
1335                                PORT_DIPSETTING(0x08 , "150")
1336                                PORT_DIPSETTING(0x0a , "300")
1337                                PORT_DIPSETTING(0x0c , "600")
1338                                PORT_DIPSETTING(0x0e , "1200")
1339                                PORT_DIPSETTING(0x10 , "1800")
1340                                PORT_DIPSETTING(0x12 , "2000")
1341                                PORT_DIPSETTING(0x14 , "2400")
1342                                PORT_DIPSETTING(0x16 , "3600")
1343                                PORT_DIPSETTING(0x18 , "4800")
1344                                PORT_DIPSETTING(0x1a , "7200")
1345                                PORT_DIPSETTING(0x1c , "9600")
1346                                PORT_DIPSETTING(0x1e , "19200")
13471347
13481348INPUT_PORTS_END
13491349
r249051r249052
13661366
13671367            // Clock = 25 MHz / 9 * (112/114)
13681368            MCFG_DEVICE_ADD("crtc" , I8275 , 2729045)
1369                        MCFG_VIDEO_SET_SCREEN("screen")
1369                                MCFG_VIDEO_SET_SCREEN("screen")
13701370            MCFG_I8275_CHARACTER_WIDTH(9)
13711371            MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(hp64k_state , crtc_display_pixels)
13721372            MCFG_I8275_DRQ_CALLBACK(WRITELINE(hp64k_state , hp64k_crtc_drq_w))
r249051r249052
13751375            MCFG_SCREEN_ADD("screen" , RASTER)
13761376            MCFG_SCREEN_UPDATE_DEVICE("crtc" , i8275_device , screen_update)
13771377            MCFG_SCREEN_REFRESH_RATE(60)
1378                        MCFG_SCREEN_SIZE(720 , 390)
1378                                MCFG_SCREEN_SIZE(720 , 390)
13791379            MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette")
13801380
1381                  MCFG_FD1791_ADD("fdc" , XTAL_4MHz / 4)
1381                      MCFG_FD1791_ADD("fdc" , XTAL_4MHz / 4)
13821382                  MCFG_WD_FDC_FORCE_READY
13831383                  MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(hp64k_state , hp64k_flp_intrq_w))
13841384                  MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(hp64k_state , hp64k_flp_drq_w))
r249051r249052
14101410
14111411                  MCFG_TIMER_DRIVER_ADD("beep_timer" , hp64k_state , hp64k_beeper_off);
14121412
1413                        MCFG_DEVICE_ADD("baud_rate" , CLOCK , 0)
1414                        MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(hp64k_state , hp64k_baud_clk_w));
1413                                MCFG_DEVICE_ADD("baud_rate" , CLOCK , 0)
1414                                MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(hp64k_state , hp64k_baud_clk_w));
14151415
1416                        MCFG_DEVICE_ADD("uart" , I8251 , 0)
1417                        MCFG_I8251_RXRDY_HANDLER(WRITELINE(hp64k_state , hp64k_rxrdy_w));
1418                        MCFG_I8251_TXRDY_HANDLER(WRITELINE(hp64k_state , hp64k_txrdy_w));
1419                        MCFG_I8251_TXD_HANDLER(WRITELINE(hp64k_state , hp64k_txd_w));
1420                        MCFG_I8251_DTR_HANDLER(WRITELINE(hp64k_state , hp64k_dtr_w));
1421                        MCFG_I8251_RTS_HANDLER(WRITELINE(hp64k_state , hp64k_rts_w));
1416                                MCFG_DEVICE_ADD("uart" , I8251 , 0)
1417                                MCFG_I8251_RXRDY_HANDLER(WRITELINE(hp64k_state , hp64k_rxrdy_w));
1418                                MCFG_I8251_TXRDY_HANDLER(WRITELINE(hp64k_state , hp64k_txrdy_w));
1419                                MCFG_I8251_TXD_HANDLER(WRITELINE(hp64k_state , hp64k_txd_w));
1420                                MCFG_I8251_DTR_HANDLER(WRITELINE(hp64k_state , hp64k_dtr_w));
1421                                MCFG_I8251_RTS_HANDLER(WRITELINE(hp64k_state , hp64k_rts_w));
14221422
1423                        MCFG_RS232_PORT_ADD("rs232" , default_rs232_devices , NULL)
1424                        MCFG_RS232_RXD_HANDLER(WRITELINE(hp64k_state , hp64k_rs232_rxd_w))
1425                        MCFG_RS232_DCD_HANDLER(WRITELINE(hp64k_state , hp64k_rs232_dcd_w))
1426                        MCFG_RS232_CTS_HANDLER(WRITELINE(hp64k_state , hp64k_rs232_cts_w))
1427
1423                                MCFG_RS232_PORT_ADD("rs232" , default_rs232_devices , NULL)
1424                                MCFG_RS232_RXD_HANDLER(WRITELINE(hp64k_state , hp64k_rs232_rxd_w))
1425                                MCFG_RS232_DCD_HANDLER(WRITELINE(hp64k_state , hp64k_rs232_dcd_w))
1426                                MCFG_RS232_CTS_HANDLER(WRITELINE(hp64k_state , hp64k_rs232_cts_w))
1427                               
14281428MACHINE_CONFIG_END
14291429
14301430ROM_START(hp64k)
trunk/src/mess/drivers/hp_ipc.c
r249051r249052
356356
357357
358358COMP(1985, hp_ipc, 0, 0, hp_ipc, hp_ipc, driver_device, 0, "HP", "Integral Personal Computer", MACHINE_IS_SKELETON)
359
trunk/src/mess/drivers/mc1000.c
r249051r249052
378378  +---------*---*---o V+
379379  |         |   |
380380 +-+        |   |
381 | |390K    |   |
381 | |309K    |   |
382382 | |R17     |8  |4
383383 +-+      +-------+
384384  |      7|       |3
r249051r249052
390390 | |   |  |  555  |
391391 +-+   |  |       |
392392  |    | 6|       |5
393  *----*--|       |---+
393  *----*?-|       |---+
394394  |       |       |   |
395395 ---C30   +-------+  ---C29
396 ---10n       |1     ---10n
396 ---103       |1     ---103
397397 _|_         _|_     _|_
398398 ///         ///     ///
399399
400400 Calculated properties:
401401
402402 * 99.74489795918367 Duty Cycle Percentage
403 * 367.3469387755102 Frequency in Hertz
403 * 368.1126130105722 Frequency in Hertz
404404 * 0.00000693 Seconds Low
405 * 0.00270963 Seconds High
405 * 0.0027096299999999998 Seconds High
406406
407407 */
408408
409#define MC1000_NE555_FREQ       (367) /* Hz */
409#define MC1000_NE555_FREQ       (368) /* Hz */
410410#define MC1000_NE555_DUTY_CYCLE (99.745) /* % */
411411
412412TIMER_DEVICE_CALLBACK_MEMBER(mc1000_state::ne555_tick)
trunk/src/mess/drivers/ngen.c
r249051r249052
744744MC6845_UPDATE_ROW( ngen_state::crtc_update_row )
745745{
746746   UINT16 addr = ma;
747
747   
748748   for(int x=0;x<bitmap.width();x+=9)
749749   {
750750      UINT8 ch = m_vram.read16(addr++) & 0xff;
r249051r249052
893893
894894static ADDRESS_MAP_START( ngen386_io, AS_IO, 32, ngen_state )
895895   AM_RANGE(0x0000, 0x0003) AM_READWRITE16(xbus_r, xbus_w, 0x0000ffff)
896//  AM_RANGE(0xf800, 0xfeff) AM_READWRITE16(peripheral_r, peripheral_w,0xffffffff)
896//   AM_RANGE(0xf800, 0xfeff) AM_READWRITE16(peripheral_r, peripheral_w,0xffffffff)
897897   AM_RANGE(0xfd08, 0xfd0b) AM_READWRITE16(b38_crtc_r, b38_crtc_w,0xffffffff)
898898   AM_RANGE(0xfd0c, 0xfd0f) AM_READWRITE16(b38_keyboard_r, b38_keyboard_w,0xffffffff)
899899ADDRESS_MAP_END
trunk/src/mess/drivers/tispeak.c
r249051r249052
99  These devices, mostly edu-toys, are based around an MCU(TMS0270/TMS1100),
1010  TMS51xx speech, and VSM ROM(s). Newer devices, such as Speak & Music,
1111  are based around the TMP50C40 and belong in another driver, probably.
12
12 
1313  note: except for tntell, MAME external artwork is not required. But it
1414  is objectively a large improvement.
1515
r249051r249052
430430void tispeak_state::init_cartridge()
431431{
432432   m_overlay = 0;
433
433   
434434   if (m_cart != NULL && m_cart->exists())
435435   {
436436      std::string region_tag;
r249051r249052
558558{
559559   // R10: CD2802 PDC pin
560560   m_tms5100->pdc_w(data >> 10);
561
561   
562562   // R9: power-off request, on falling edge
563563   if ((m_r >> 9 & 1) && !(data >> 9 & 1))
564564      snspell_power_off();
r249051r249052
578578{
579579   // multiplexed inputs (and K2 from on-button)
580580   UINT8 k = m_inp_matrix[9]->read() | read_inputs(9);
581
581   
582582   // K4: CD2802 CTL1
583583   if (m_tms5100->ctl_r(space, 0) & 1)
584584      k |= 4;
r249051r249052
586586   // K8: overlay code from R5,O4-O7
587587   if (((m_r >> 1 & 0x10) | (m_o >> 4 & 0xf)) & m_overlay)
588588      k |= 8;
589
589   
590590   return k;
591591}
592592
r249051r249052
596596   // which one is active(if any). If it matches with the internal ROM or
597597   // external module, the game continues.
598598   // 00 for none, 1F for diagnostics, see comment section above for a list
599
599   
600600   // try to get overlay code from artwork file(in decimal), otherwise pick the
601601   // one that was selected in machine configuration
602602   m_overlay = output_get_value("overlay_code") & 0x1f;
603603   if (m_overlay == 0)
604604      m_overlay = m_inp_matrix[10]->read();
605
605   
606606   for (int i = 0; i < 5; i++)
607607      output_set_indexed_value("ol", i+1, m_overlay >> i & 1);
608608}
r249051r249052
12521252   ROM_LOAD( "tms1100_cd8012_micro.pla", 0, 867, CRC(46d936c8) SHA1(b0aad486a90a5dec7fd2fb07caa503be771f91c8) )
12531253   ROM_REGION( 365, "maincpu:opla", 0 )
12541254   ROM_LOAD( "tms1100_cd8012_output.pla", 0, 365, CRC(5ada9306) SHA1(a4140118dd535af45a691832530d55cd86a23510) )
1255
1255   
12561256   ROM_REGION( 0x8000, "tms6100", ROMREGION_ERASEFF ) // 4000-7fff = space reserved for cartridge
12571257   ROM_LOAD( "cd2610.vsm", 0x0000, 0x1000, CRC(6db34e5a) SHA1(10fa5db20fdcba68034058e7194f35c90b9844e6) )
12581258ROM_END
r249051r249052
12651265   ROM_LOAD( "tms1100_cd8012_micro.pla", 0, 867, CRC(46d936c8) SHA1(b0aad486a90a5dec7fd2fb07caa503be771f91c8) )
12661266   ROM_REGION( 365, "maincpu:opla", 0 )
12671267   ROM_LOAD( "tms1100_cd8012_output.pla", 0, 365, CRC(5ada9306) SHA1(a4140118dd535af45a691832530d55cd86a23510) )
1268
1268   
12691269   ROM_REGION( 0x8000, "tms6100", ROMREGION_ERASEFF ) // 4000-7fff = space reserved for cartridge
12701270   ROM_LOAD( "cd62170.vsm", 0x0000, 0x4000, CRC(6dc9d072) SHA1(9d2c9ff57c4f8fe69768666ffa41fcac649279ef) )
12711271ROM_END
r249051r249052
12781278   ROM_LOAD( "tms1100_cd8012_micro.pla", 0, 867, CRC(46d936c8) SHA1(b0aad486a90a5dec7fd2fb07caa503be771f91c8) )
12791279   ROM_REGION( 365, "maincpu:opla", 0 )
12801280   ROM_LOAD( "tms1100_cd8012_output.pla", 0, 365, CRC(5ada9306) SHA1(a4140118dd535af45a691832530d55cd86a23510) )
1281
1281   
12821282   ROM_REGION( 0x8000, "tms6100", ROMREGION_ERASEFF ) // 4000-7fff = space reserved for cartridge
12831283   ROM_LOAD( "cd62171.vsm", 0x0000, 0x4000, CRC(cc26f7d1) SHA1(2b03e37b3bf3cbeca36980acfc45246dac706b83) )
12841284ROM_END
trunk/src/mess/drivers/x68k.c
r249051r249052
814814   {
815815   case 0x00:
816816      m_sysport.contrast = data & 0x0f;  // often used for screen fades / blanking
817      m_screen->set_brightness(m_sysport.contrast * 0x11);
817      // TODO: implement a decent, not slow, brightness control
818818      break;
819819   case 0x01:
820820      m_sysport.monitor = data & 0x08;
trunk/src/mess/drivers/xbox.c
r249051r249052
130130}
131131
132132/*static const struct {
133    const char *game_name;
134    struct {
135        UINT32 address;
136        UINT8 write_byte;
137    } modify[16];
133   const char *game_name;
134   struct {
135      UINT32 address;
136      UINT8 write_byte;
137   } modify[16];
138138} hacks[] = { { "chihiro",{ { 0x6a79f, 0x01 },{ 0x6a7a0, 0x00 },{ 0x6b575, 0x00 },{ 0x6b576, 0x00 },{ 0x6b5af, 0x75 },{ 0x6b78a, 0x75 },{ 0x6b7ca, 0x00 },{ 0x6b7b8, 0x00 },{ 0x8f5b2, 0x75 },{ 0x79a9e, 0x74 },{ 0x79b80, 0x74 },{ 0x79b97, 0x74 },{ 0, 0 } } },
139139{ "outr2",{ { 0x12e4cf, 0x01 },{ 0x12e4d0, 0x00 },{ 0x4793e, 0x01 },{ 0x4793f, 0x00 },{ 0x47aa3, 0x01 },{ 0x47aa4, 0x00 },{ 0x14f2b6, 0x84 },{ 0x14f2d1, 0x75 },{ 0x8732f, 0x7d },{ 0x87384, 0x7d },{ 0x87388, 0xeb },{ 0, 0 } } } };*/
140140
r249051r249052
150150      p = -1;
151151   if (p >= 0) {
152152      /*for (int a = 0; a < 16; a++) {
153          if (hacks[p].modify[a].address == 0)
154              break;
155          m_maincpu->space(0).write_byte(hacks[p].modify[a].address, hacks[p].modify[a].write_byte);
153         if (hacks[p].modify[a].address == 0)
154            break;
155         m_maincpu->space(0).write_byte(hacks[p].modify[a].address, hacks[p].modify[a].write_byte);
156156      }*/
157157   }
158158   usbhack_counter++;
r249051r249052
164164   xbox_devs.ide = machine().device<bus_master_ide_controller_device>("ide");
165165   usbhack_index = -1;
166166   /*for (int a = 1; a < 2; a++)
167       if (strcmp(machine().basename(), hacks[a].game_name) == 0) {
168           usbhack_index = a;
169           break;
170       }*/
167      if (strcmp(machine().basename(), hacks[a].game_name) == 0) {
168         usbhack_index = a;
169         break;
170      }*/
171171   usbhack_counter = 0;
172172   // savestates
173173   save_item(NAME(usbhack_counter));
trunk/src/mess/includes/aussiebyte.h
r249051r249052
124124   required_device<speaker_sound_device> m_speaker;
125125   required_device<votrax_sc01_device> m_votrax;
126126};
127
trunk/src/mess/includes/thomson.h
r249051r249052
390390   optional_memory_bank m_rambank;
391391   required_memory_bank m_flopbank;
392392   required_memory_bank m_basebank;
393   required_memory_bank m_syslobank;
393   required_memory_bank m_syslobank;     
394394   optional_memory_bank m_syshibank;
395395   optional_memory_bank m_datalobank;
396396   optional_memory_bank m_datahibank;
trunk/src/mess/layout/fccpu1.lay
r249051r249052
1<?xml version="1.0"?>
2<!-- fccpu1.lay -->
3<!-- 2015-07-27: Initial version.  [JLE] -->
4<mamelayout version="2">
5    <element name="front">
6            <image file="front.png" />
7    </element>
8    <view name="Force Computers SYS68K/CPU-1">
9        <screen index="0">
10            <bounds left="100" top="0" right="640" bottom="480" /> 
11        </screen>
12   <bezel name="frontpanel" element="front">
13     <bounds x="0" y="0" width="36" height="480" />
14   </bezel>
15    </view>
16</mamelayout>
17
trunk/src/mess/machine/coco.c
r249051r249052
705705    */
706706   if ((status & SOUNDMUX_ENABLE) != 0)
707707   {
708      m_analog_audio_level = dac_sound + cassette_sound + cart_sound;
708       m_analog_audio_level = dac_sound + cassette_sound + cart_sound;
709709   }
710710
711711   m_dac->write_unsigned8(single_bit_sound + m_analog_audio_level);
trunk/src/mess/video/aussiebyte.c
r249051r249052
7070MC6845_ON_UPDATE_ADDR_CHANGED( aussiebyte_state::crtc_update_addr )
7171{
7272/* not sure what goes in here - parameters passed are device, address, strobe */
73//  m_video_address = address;// & 0x7ff;
73//   m_video_address = address;// & 0x7ff;
7474}
7575
7676WRITE8_MEMBER( aussiebyte_state::address_w )
r249051r249052
147147         gfx = m_p_chargen[((ac_chr & 0x7f)<<4) | ac_ra];
148148         break;
149149   }
150
150   
151151   if (BIT(ac_attr, 3) & (ac_ra == 11)) // underline
152152      gfx = 0xff;
153153   if (BIT(ac_attr, 2) & ((ac_ra == 5) | (ac_ra == 6))) // strike-through
r249051r249052
194194      *p++ = palette[BIT(gfx, 0)];
195195   }
196196}
197
trunk/src/osd/modules/debugger/win/debugviewinfo.c
r249051r249052
1515
1616#include "strconv.h"
1717
18#include "winutil.h"
1918
20
2119// debugger view styles
2220#define DEBUG_VIEW_STYLE    WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
2321#define DEBUG_VIEW_STYLE_EX 0
r249051r249052
5048
5149   // create the child view
5250   m_wnd = CreateWindowEx(DEBUG_VIEW_STYLE_EX, TEXT("MAMEDebugView"), NULL, DEBUG_VIEW_STYLE,
53          0, 0, 100, 100, parent, NULL, GetModuleHandleUni(), this);
51         0, 0, 100, 100, parent, NULL, GetModuleHandle(NULL), this);
5452   if (m_wnd == NULL)
5553      goto cleanup;
5654
5755   // create the scroll bars
5856   m_hscroll = CreateWindowEx(HSCROLL_STYLE_EX, TEXT("SCROLLBAR"), NULL, HSCROLL_STYLE,
59         0, 0, 100, CW_USEDEFAULT, m_wnd, NULL, GetModuleHandleUni(), this);
57         0, 0, 100, CW_USEDEFAULT, m_wnd, NULL, GetModuleHandle(NULL), this);
6058   m_vscroll = CreateWindowEx(VSCROLL_STYLE_EX, TEXT("SCROLLBAR"), NULL, VSCROLL_STYLE,
61         0, 0, CW_USEDEFAULT, 100, m_wnd, NULL, GetModuleHandleUni(), this);
59         0, 0, CW_USEDEFAULT, 100, m_wnd, NULL, GetModuleHandle(NULL), this);
6260   if ((m_hscroll == NULL) || (m_vscroll == NULL))
6361      goto cleanup;
6462
r249051r249052
256254{
257255   // create a combo box
258256   HWND const result = CreateWindowEx(COMBO_BOX_STYLE_EX, TEXT("COMBOBOX"), NULL, COMBO_BOX_STYLE,
259         0, 0, 100, 1000, parent, NULL, GetModuleHandleUni(), NULL);
257         0, 0, 100, 1000, parent, NULL, GetModuleHandle(NULL), NULL);
260258   SetWindowLongPtr(result, GWLP_USERDATA, userdata);
261259   SendMessage(result, WM_SETFONT, (WPARAM)metrics().debug_font(), (LPARAM)FALSE);
262260
r249051r249052
791789
792790      // initialize the description of the window class
793791      wc.lpszClassName    = TEXT("MAMEDebugView");
794      wc.hInstance        = GetModuleHandleUni();
792      wc.hInstance        = GetModuleHandle(NULL);
795793      wc.lpfnWndProc      = &debugview_info::static_view_proc;
796794      wc.hCursor          = LoadCursor(NULL, IDC_ARROW);
797795      wc.hIcon            = LoadIcon(wc.hInstance, MAKEINTRESOURCE(2));
r249051r249052
800798      wc.style            = 0;
801799      wc.cbClsExtra       = 0;
802800      wc.cbWndExtra       = 0;
803     
804      UnregisterClass(wc.lpszClassName, wc.hInstance);
805801
806802      // register the class; fail if we can't
807803      if (!RegisterClass(&wc))
trunk/src/osd/modules/debugger/win/debugwininfo.c
r249051r249052
1717#include "window.h"
1818#include "winutf8.h"
1919
20#include "winutil.h"
2120
22
2321bool debugwin_info::s_window_class_registered = false;
2422
2523
r249051r249052
3836   register_window_class();
3937
4038   m_wnd = win_create_window_ex_utf8(DEBUG_WINDOW_STYLE_EX, "MAMEDebugWindow", title, DEBUG_WINDOW_STYLE,
41         0, 0, 100, 100, win_window_list->m_hwnd, create_standard_menubar(), GetModuleHandleUni(), this);
39         0, 0, 100, 100, win_window_list->m_hwnd, create_standard_menubar(), GetModuleHandle(NULL), this);
4240   if (m_wnd == NULL)
4341      return;
4442
r249051r249052
582580
583581      // initialize the description of the window class
584582      wc.lpszClassName    = TEXT("MAMEDebugWindow");
585      wc.hInstance        = GetModuleHandleUni();
583      wc.hInstance        = GetModuleHandle(NULL);
586584      wc.lpfnWndProc      = &debugwin_info::static_window_proc;
587585      wc.hCursor          = LoadCursor(NULL, IDC_ARROW);
588586      wc.hIcon            = LoadIcon(wc.hInstance, MAKEINTRESOURCE(2));
r249051r249052
591589      wc.style            = 0;
592590      wc.cbClsExtra       = 0;
593591      wc.cbWndExtra       = 0;
594     
595      UnregisterClass(wc.lpszClassName, wc.hInstance);
596592
597593      // register the class; fail if we can't
598594      if (!RegisterClass(&wc))
trunk/src/osd/modules/debugger/win/editwininfo.c
r249051r249052
1313
1414#include "strconv.h"
1515
16#include "winutil.h"
1716
18
1917// edit box styles
2018#define EDIT_BOX_STYLE      WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL
2119#define EDIT_BOX_STYLE_EX   0
r249051r249052
3432
3533   // create an edit box and override its key handling
3634   m_editwnd = CreateWindowEx(EDIT_BOX_STYLE_EX, TEXT("EDIT"), NULL, EDIT_BOX_STYLE,
37         0, 0, 100, 100, window(), NULL, GetModuleHandleUni(), NULL);
35         0, 0, 100, 100, window(), NULL, GetModuleHandle(NULL), NULL);
3836   m_original_editproc = (WNDPROC)(FPTR)GetWindowLongPtr(m_editwnd, GWLP_WNDPROC);
3937   SetWindowLongPtr(m_editwnd, GWLP_USERDATA, (LONG_PTR)this);
4038   SetWindowLongPtr(m_editwnd, GWLP_WNDPROC, (LONG_PTR)&editwin_info::static_edit_proc);
trunk/src/osd/windows/input.c
r249051r249052
3838#include "strconv.h"
3939#include "config.h"
4040
41#include "winutil.h"
42
4341//============================================================
4442//  PARAMETERS
4543//============================================================
r249051r249052
11191117   int didevtype_joystick = DI8DEVCLASS_GAMECTRL;
11201118
11211119   dinput_version = DIRECTINPUT_VERSION;
1122   result = DirectInput8Create(GetModuleHandleUni(), dinput_version, IID_IDirectInput8, (void **)&dinput, NULL);
1120   result = DirectInput8Create(GetModuleHandle(NULL), dinput_version, IID_IDirectInput8, (void **)&dinput, NULL);
11231121   if (result != DI_OK)
11241122   {
11251123      dinput_version = 0;
r249051r249052
11321130
11331131   // first attempt to initialize DirectInput at the current version
11341132   dinput_version = DIRECTINPUT_VERSION;
1135   result = DirectInputCreate(GetModuleHandleUni(), dinput_version, &dinput, NULL);
1133   result = DirectInputCreate(GetModuleHandle(NULL), dinput_version, &dinput, NULL);
11361134   if (result != DI_OK)
11371135   {
11381136      // if that fails, try version 5
11391137      dinput_version = 0x0500;
1140      result = DirectInputCreate(GetModuleHandleUni(), dinput_version, &dinput, NULL);
1138      result = DirectInputCreate(GetModuleHandle(NULL), dinput_version, &dinput, NULL);
11411139      if (result != DI_OK)
11421140      {
11431141         // if that fails, try version 3
11441142         dinput_version = 0x0300;
1145         result = DirectInputCreate(GetModuleHandleUni(), dinput_version, &dinput, NULL);
1143         result = DirectInputCreate(GetModuleHandle(NULL), dinput_version, &dinput, NULL);
11461144         if (result != DI_OK)
11471145         {
11481146            dinput_version = 0;
trunk/src/osd/windows/output.c
r249051r249052
1717// MAMEOS headers
1818#include "output.h"
1919
20#include "winutil.h"
2120
2221
23
2422//============================================================
2523//  CONSTANTS
2624//============================================================
r249051r249052
103101                  1, 1,
104102                  NULL,
105103                  NULL,
106                  GetModuleHandleUni(),
104                  GetModuleHandle(NULL),
107105                  NULL);
108106   assert(output_hwnd != NULL);
109107
r249051r249052
169167
170168      // initialize the description of the window class
171169      wc.lpszClassName    = OUTPUT_WINDOW_CLASS;
172      wc.hInstance        = GetModuleHandleUni();
170      wc.hInstance        = GetModuleHandle(NULL);
173171      wc.lpfnWndProc      = output_window_proc;
174     
175      UnregisterClass(wc.lpszClassName, wc.hInstance);
176172
177173      // register the class; fail if we can't
178174      if (!RegisterClass(&wc))
trunk/src/osd/windows/window.c
r249051r249052
3535#include "config.h"
3636#include "winutf8.h"
3737
38#include "winutil.h"
39
4038extern int drawnone_init(running_machine &machine, osd_draw_callbacks *callbacks);
4139extern int drawgdi_init(running_machine &machine, osd_draw_callbacks *callbacks);
4240extern int drawdd_init(running_machine &machine, osd_draw_callbacks *callbacks);
r249051r249052
887885
888886      // initialize the description of the window class
889887      wc.lpszClassName    = TEXT("MAME");
890      wc.hInstance        = GetModuleHandleUni();
888      wc.hInstance        = GetModuleHandle(NULL);
891889      wc.lpfnWndProc      = winwindow_video_window_proc_ui;
892890      wc.hCursor          = LoadCursor(NULL, IDC_ARROW);
893891      wc.hIcon            = LoadIcon(wc.hInstance, MAKEINTRESOURCE(2));
894     
895      UnregisterClass(wc.lpszClassName, wc.hInstance);
896892
897893      // register the class; fail if we can't
898894      if (!RegisterClass(&wc))
r249051r249052
11951191                  monitorbounds.left() + 100, monitorbounds.top() + 100,
11961192                  NULL,//(win_window_list != NULL) ? win_window_list->m_hwnd : NULL,
11971193                  menu,
1198                  GetModuleHandleUni(),
1194                  GetModuleHandle(NULL),
11991195                  NULL);
12001196   if (m_hwnd == NULL)
12011197      return 1;
trunk/src/osd/windows/winmain.c
r249051r249052
13211321   dynamic_bind<PIMAGE_NT_HEADERS (WINAPI *)(PVOID)> image_nt_header(TEXT("dbghelp.dll"), "ImageNtHeader");
13221322
13231323   // start with the image base
1324   PVOID base = reinterpret_cast<PVOID>(GetModuleHandleUni());
1324   PVOID base = reinterpret_cast<PVOID>(GetModuleHandle(NULL));
13251325   assert(base != NULL);
13261326
13271327   // make sure we have the functions we need
trunk/src/osd/windows/winutil.c
r249051r249052
9292      is_first_time = FALSE;
9393
9494      // get the current module
95      module = GetModuleHandleUni();
95      module = GetModuleHandle(NULL);
9696      if (!module)
9797         return FALSE;
9898      image_ptr = (BYTE*) module;
r249051r249052
122122   }
123123   return is_gui_frontend;
124124}
125
126//-------------------------------------------------
127//  Universal way to get module handle
128//-------------------------------------------------
129
130HMODULE WINAPI GetModuleHandleUni()
131{
132   MEMORY_BASIC_INFORMATION mbi;
133   VirtualQuery((LPCVOID)GetModuleHandleUni, &mbi, sizeof(mbi));
134   return (HMODULE)mbi.AllocationBase;
135}
trunk/src/osd/windows/winutil.h
r249051r249052
1515file_error win_error_to_file_error(DWORD error);
1616osd_dir_entry_type win_attributes_to_entry_type(DWORD attributes);
1717BOOL win_is_gui_application(void);
18HMODULE WINAPI GetModuleHandleUni();
1918
2019#endif // __WINUTIL__
trunk/src/version.c
r249051r249052
88
99***************************************************************************/
1010
11#define BARE_BUILD_VERSION "0.165"
11#define BARE_BUILD_VERSION "0.164"
1212
1313extern const char bare_build_version[];
1414extern const char build_version[];


Previous 199869 Revisions Next


© 1997-2024 The MAME Team