mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
Merge branch 'master' of https://github.com/mamedev/mame
This commit is contained in:
commit
e22211e311
2
3rdparty/genie/src/actions/make/make_cpp.lua
vendored
2
3rdparty/genie/src/actions/make/make_cpp.lua
vendored
@ -86,7 +86,7 @@
|
||||
end
|
||||
|
||||
-- target build rule
|
||||
_p('$(TARGET): $(OBJDIRS) $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')
|
||||
_p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')
|
||||
|
||||
if prj.kind == "StaticLib" then
|
||||
if prj.msgarchiving then
|
||||
|
24
3rdparty/genie/src/host/scripts.c
vendored
24
3rdparty/genie/src/host/scripts.c
vendored
@ -180,18 +180,18 @@ const char* builtin_scripts[] = {
|
||||
|
||||
/* actions/make/make_cpp.lua */
|
||||
"premake.make.cpp = { }\npremake.make.override = { }\nlocal cpp = premake.make.cpp\nlocal make = premake.make\nfunction premake.make_cpp(prj)\nlocal cc = premake.gettool(prj)\nlocal platforms = premake.filterplatforms(prj.solution, cc.platforms, \"Native\")\npremake.gmake_cpp_header(prj, cc, platforms)\nfor _, platform in ipairs(platforms) do\nfor cfg in premake.eachconfig(prj, platform) do\npremake.gmake_cpp_config(prj, cfg, cc)\nend\nend\nlocal objdirs = {}\nlocal additionalobjdirs = {}\nfor _, file in ipairs(prj.files) do\nif path.iscppfile(file) then\nobjdirs[_MAKE.esc(path.getdirectory(path.trimdots(file)))] = 1\nend\nend\nfor _, custombuildtask in ipairs(prj.custombuildtask or {}) do\nfor _, buildtask in ipairs(custombuildtask or {}) do\nadditionalobjdirs[_MAKE.esc(path.getdirectory(path.getrelative(prj.location,buildtask[2])))] = 1\nend\nend\n_p('OBJDIRS := \\\\')\n_p('\\t$(OBJDIR) \\\\')\nfor dir, _ in pairs(objdirs) do\n_p('\\t$(OBJDIR)/%s \\\\', dir)\nend\nfor dir, _ in pairs(additionalobjdirs) do\n_p"
|
||||
"('\\t%s \\\\', dir)\nend\n_p('')\n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1$(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(OBJDIRS) $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. p"
|
||||
"rj.msgarchiving)\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)' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\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(\"Ma"
|
||||
"cOSX\") 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.contains(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 ipai"
|
||||
"rs(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 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(' 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.sh"
|
||||
"ortname))\ncpp.platformtools(cfg, cc)\n_p(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"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 pr"
|
||||
"e-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-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), \" \"))\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.getlibdirf"
|
||||
"lags(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.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 testname = 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$(SILENT) $(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]))\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",
|
||||
"('\\t%s \\\\', dir)\nend\n_p('')\n_p('RESOURCES := \\\\')\nfor _, file in ipairs(prj.files) do\nif path.isresourcefile(file) then\n_p('\\t$(OBJDIR)/%s.res \\\\', _MAKE.esc(path.getbasename(file)))\nend\nend\n_p('')\n_p('.PHONY: clean prebuild prelink')\n_p('')\nif os.is(\"MacOSX\") and prj.kind == \"WindowedApp\" then\n_p('all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))Info.plist')\nelse\n_p('all: $(TARGETDIR) $(OBJDIRS) prebuild prelink $(TARGET)')\nend\n_p('\\t@:')\n_p('')\nif (prj.kind == \"StaticLib\" and prj.options.ArchiveSplit) then\n_p('define max_args')\n_p('\\t$(eval _args:=)')\n_p('\\t$(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))')\n_p('\\t$(if $(_args),$1$(_args))')\n_p('endef')\n_p('')\n_p('define EOL')\n_p('')\n_p('')\n_p('endef')\n_p('')\nend\n_p('$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)')\nif prj.kind == \"StaticLib\" then\nif prj.msgarchiving then\n_p('\\t@echo ' .. prj.msgarchi"
|
||||
"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)' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\nelse\n_p('\\t$(call RM,$(TARGET))')\n_p('\\t@$(call max_args,$(LINKCMD),'.. prj.archivesplit_size ..',$(OBJECTS))' .. (os.is(\"MacOSX\") and \" 2>&1 > /dev/null | sed -e '/.o) has no symbols$$/d'\" or \"\"))\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.contains(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(buildtas"
|
||||
"k[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 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(' SILE"
|
||||
"NT = @')\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(' 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))\nc"
|
||||
"pp.platformtools(cfg, cc)\n_p(' ' .. (table.contains(premake.make.override,\"OBJDIR\") and \"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 comm"
|
||||
"ands')\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-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_IN"
|
||||
"CLUDE += -include %s'\n,premake.esc(table.concat(cfg.forcedincludes, \";\")))\nend\n_p(' ALL_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), c"
|
||||
"c.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.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.included"
|
||||
"irs) 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.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.msgcompi"
|
||||
"le)\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\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]))\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",
|
||||
|
||||
/* actions/make/make_csharp.lua */
|
||||
"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"
|
||||
|
@ -23,7 +23,7 @@ SLOT_INTERFACE_END
|
||||
//-------------------------------------------------
|
||||
|
||||
ROM_START( cpc_ddi1 )
|
||||
ROM_REGION( 0x4000, "exp_rom", 0 )
|
||||
ROM_REGION( 0x4000, "disc_rom", 0 )
|
||||
ROM_LOAD("cpcados.rom", 0x0000, 0x4000, CRC(1fe22ecd) SHA1(39102c8e9cb55fcc0b9b62098780ed4a3cb6a4bb))
|
||||
ROM_END
|
||||
|
||||
@ -80,6 +80,7 @@ void cpc_ddi1_device::device_start()
|
||||
|
||||
space.install_write_handler(0xfa7e,0xfa7f,0,0,write8_delegate(FUNC(cpc_ddi1_device::motor_w),this));
|
||||
space.install_readwrite_handler(0xfb7e,0xfb7f,0,0,read8_delegate(FUNC(cpc_ddi1_device::fdc_r),this),write8_delegate(FUNC(cpc_ddi1_device::fdc_w),this));
|
||||
space.install_write_handler(0xdf00,0xdfff,0,0,write8_delegate(FUNC(cpc_ddi1_device::rombank_w),this));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -88,6 +89,7 @@ void cpc_ddi1_device::device_start()
|
||||
|
||||
void cpc_ddi1_device::device_reset()
|
||||
{
|
||||
m_rom_active = false;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(cpc_ddi1_device::motor_w)
|
||||
@ -137,3 +139,22 @@ READ8_MEMBER(cpc_ddi1_device::fdc_r)
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(cpc_ddi1_device::rombank_w)
|
||||
{
|
||||
if(data == 0x07)
|
||||
m_rom_active = true;
|
||||
else
|
||||
m_rom_active = false;
|
||||
m_slot->rom_select(space,0,data);
|
||||
}
|
||||
|
||||
void cpc_ddi1_device::set_mapping()
|
||||
{
|
||||
if(m_rom_active)
|
||||
{
|
||||
UINT8* ROM = memregion("disc_rom")->base();
|
||||
membank(":bank7")->set_base(ROM);
|
||||
membank(":bank8")->set_base(ROM+0x2000);
|
||||
}
|
||||
}
|
||||
|
@ -25,10 +25,12 @@ public:
|
||||
// optional information overrides
|
||||
virtual const rom_entry *device_rom_region() const;
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
virtual void set_mapping();
|
||||
|
||||
DECLARE_WRITE8_MEMBER(motor_w);
|
||||
DECLARE_WRITE8_MEMBER(fdc_w);
|
||||
DECLARE_READ8_MEMBER(fdc_r);
|
||||
DECLARE_WRITE8_MEMBER(rombank_w);
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
@ -39,6 +41,8 @@ private:
|
||||
|
||||
required_device<upd765_family_device> m_fdc;
|
||||
required_device<floppy_connector> m_connector;
|
||||
|
||||
bool m_rom_active;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
|
@ -49,6 +49,8 @@ const rom_entry *tiki100_8088_t::device_rom_region() const
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( i8088_mem, AS_PROGRAM, 8, tiki100_8088_t )
|
||||
AM_RANGE(0x00000, 0xbffff) AM_RAM
|
||||
AM_RANGE(0xc0000, 0xcffff) AM_DEVREADWRITE(":" TIKI100_BUS_TAG, tiki100_bus_t, exin_mrq_r, exin_mrq_w)
|
||||
AM_RANGE(0xff000, 0xfffff) AM_ROM AM_REGION(I8088_TAG, 0)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -158,7 +160,7 @@ void tiki100_8088_t::iorq_w(address_space &space, offs_t offset, UINT8 data)
|
||||
|
||||
READ8_MEMBER( tiki100_8088_t::read )
|
||||
{
|
||||
return m_data;
|
||||
return m_busak << 4 | m_data;
|
||||
}
|
||||
|
||||
|
||||
@ -169,4 +171,6 @@ READ8_MEMBER( tiki100_8088_t::read )
|
||||
WRITE8_MEMBER( tiki100_8088_t::write )
|
||||
{
|
||||
m_data = data & 0x0f;
|
||||
|
||||
m_bus->busrq_w(BIT(data, 4));
|
||||
}
|
||||
|
@ -28,7 +28,8 @@ const device_type TIKI100_BUS_SLOT = &device_creator<tiki100_bus_slot_t>;
|
||||
|
||||
tiki100_bus_slot_t::tiki100_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, TIKI100_BUS_SLOT, "TIKI-100 expansion bus slot", tag, owner, clock, "tiki100bus_slot", __FILE__),
|
||||
device_slot_interface(mconfig, *this)
|
||||
device_slot_interface(mconfig, *this),
|
||||
device_z80daisy_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
@ -41,7 +42,11 @@ void tiki100_bus_slot_t::device_start()
|
||||
{
|
||||
m_bus = machine().device<tiki100_bus_t>(TIKI100_BUS_TAG);
|
||||
device_tiki100bus_card_interface *dev = dynamic_cast<device_tiki100bus_card_interface *>(get_card_device());
|
||||
if (dev) m_bus->add_card(dev);
|
||||
if (dev)
|
||||
{
|
||||
m_bus->add_card(dev);
|
||||
m_card = dev;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +57,10 @@ void tiki100_bus_slot_t::device_start()
|
||||
tiki100_bus_t::tiki100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, TIKI100_BUS, "TIKI-100 expansion bus", tag, owner, clock, "tiki100bus", __FILE__),
|
||||
m_irq_cb(*this),
|
||||
m_nmi_cb(*this)
|
||||
m_nmi_cb(*this),
|
||||
m_busrq_cb(*this),
|
||||
m_in_mrq_cb(*this),
|
||||
m_out_mrq_cb(*this)
|
||||
{
|
||||
}
|
||||
|
||||
@ -66,6 +74,9 @@ void tiki100_bus_t::device_start()
|
||||
// resolve callbacks
|
||||
m_irq_cb.resolve_safe();
|
||||
m_nmi_cb.resolve_safe();
|
||||
m_busrq_cb.resolve_safe();
|
||||
m_in_mrq_cb.resolve();
|
||||
m_out_mrq_cb.resolve();
|
||||
}
|
||||
|
||||
|
||||
@ -149,6 +160,22 @@ WRITE8_MEMBER( tiki100_bus_t::iorq_w )
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// busak_w - bus acknowledge write
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE_LINE_MEMBER( tiki100_bus_t::busak_w )
|
||||
{
|
||||
device_tiki100bus_card_interface *entry = m_device_list.first();
|
||||
|
||||
while (entry)
|
||||
{
|
||||
entry->busak_w(state);
|
||||
entry = entry->next();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE TIKI-100 BUS CARD INTERFACE
|
||||
@ -159,7 +186,8 @@ WRITE8_MEMBER( tiki100_bus_t::iorq_w )
|
||||
//-------------------------------------------------
|
||||
|
||||
device_tiki100bus_card_interface::device_tiki100bus_card_interface(const machine_config &mconfig, device_t &device) :
|
||||
device_slot_card_interface(mconfig, device)
|
||||
device_slot_card_interface(mconfig, device),
|
||||
m_busak(CLEAR_LINE)
|
||||
{
|
||||
m_slot = dynamic_cast<tiki100_bus_slot_t *>(device.owner());
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
#define __TIKI100_BUS__
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80daisy.h"
|
||||
|
||||
|
||||
|
||||
@ -44,6 +45,15 @@
|
||||
#define MCFG_TIKI100_BUS_NMI_CALLBACK(_write) \
|
||||
devcb = &tiki100_bus_t::set_nmi_wr_callback(*device, DEVCB_##_write);
|
||||
|
||||
#define MCFG_TIKI100_BUS_BUSRQ_CALLBACK(_write) \
|
||||
devcb = &tiki100_bus_t::set_busrq_wr_callback(*device, DEVCB_##_write);
|
||||
|
||||
#define MCFG_TIKI100_BUS_IN_MREQ_CALLBACK(_read) \
|
||||
devcb = &tiki100_bus_t::set_mrq_rd_callback(*device, DEVCB_##_read);
|
||||
|
||||
#define MCFG_TIKI100_BUS_OUT_MREQ_CALLBACK(_write) \
|
||||
devcb = &tiki100_bus_t::set_mrq_wr_callback(*device, DEVCB_##_write);
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
@ -53,74 +63,11 @@
|
||||
// ======================> tiki100_bus_slot_t
|
||||
|
||||
class tiki100_bus_t;
|
||||
|
||||
class tiki100_bus_slot_t : public device_t,
|
||||
public device_slot_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
tiki100_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
private:
|
||||
// configuration
|
||||
tiki100_bus_t *m_bus;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type TIKI100_BUS_SLOT;
|
||||
|
||||
|
||||
class device_tiki100bus_card_interface;
|
||||
|
||||
|
||||
// ======================> tiki100_bus_t
|
||||
|
||||
class tiki100_bus_t : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
tiki100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
~tiki100_bus_t() { m_device_list.detach_all(); }
|
||||
|
||||
template<class _Object> static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_irq_cb.set_callback(object); }
|
||||
template<class _Object> static devcb_base &set_nmi_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_nmi_cb.set_callback(object); }
|
||||
|
||||
void add_card(device_tiki100bus_card_interface *card);
|
||||
|
||||
// computer interface
|
||||
UINT8 mrq_r(address_space &space, offs_t offset, UINT8 data, bool &mdis);
|
||||
DECLARE_WRITE8_MEMBER( mrq_w );
|
||||
|
||||
UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data);
|
||||
DECLARE_WRITE8_MEMBER( iorq_w );
|
||||
|
||||
// peripheral interface
|
||||
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_cb(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_cb(state); }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
private:
|
||||
devcb_write_line m_irq_cb;
|
||||
devcb_write_line m_nmi_cb;
|
||||
|
||||
simple_list<device_tiki100bus_card_interface> m_device_list;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type TIKI100_BUS;
|
||||
class tiki100_bus_slot_t;
|
||||
|
||||
|
||||
// ======================> device_tiki100bus_card_interface
|
||||
|
||||
// class representing interface-specific live tiki100bus card
|
||||
class device_tiki100bus_card_interface : public device_slot_card_interface
|
||||
{
|
||||
friend class tiki100_bus_t;
|
||||
@ -140,13 +87,105 @@ public:
|
||||
virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data) { return data; };
|
||||
virtual void iorq_w(address_space &space, offs_t offset, UINT8 data) { };
|
||||
|
||||
virtual void busak_w(int state) { m_busak = state; };
|
||||
|
||||
// Z80 daisy chain
|
||||
virtual int z80daisy_irq_state() { return 0; }
|
||||
virtual int z80daisy_irq_ack() { return 0; }
|
||||
virtual void z80daisy_irq_reti() { }
|
||||
|
||||
tiki100_bus_t *m_bus;
|
||||
tiki100_bus_slot_t *m_slot;
|
||||
int m_busak;
|
||||
|
||||
device_tiki100bus_card_interface *m_next;
|
||||
};
|
||||
|
||||
|
||||
// ======================> tiki100_bus_slot_t
|
||||
|
||||
class tiki100_bus_slot_t : public device_t,
|
||||
public device_slot_interface,
|
||||
public device_z80daisy_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
tiki100_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
protected:
|
||||
// device_z80daisy_interface overrides
|
||||
virtual int z80daisy_irq_state() { return get_card_device() ? m_card->z80daisy_irq_state() : 0; }
|
||||
virtual int z80daisy_irq_ack() { return get_card_device() ? m_card->z80daisy_irq_ack() : 0; }
|
||||
virtual void z80daisy_irq_reti() { if (get_card_device()) m_card->z80daisy_irq_reti(); }
|
||||
|
||||
private:
|
||||
// configuration
|
||||
tiki100_bus_t *m_bus;
|
||||
device_tiki100bus_card_interface *m_card;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type TIKI100_BUS_SLOT;
|
||||
|
||||
|
||||
// ======================> tiki100_bus_t
|
||||
|
||||
class tiki100_bus_t : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
tiki100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
~tiki100_bus_t() { m_device_list.detach_all(); }
|
||||
|
||||
template<class _Object> static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_irq_cb.set_callback(object); }
|
||||
template<class _Object> static devcb_base &set_nmi_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_nmi_cb.set_callback(object); }
|
||||
template<class _Object> static devcb_base &set_busrq_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_busrq_cb.set_callback(object); }
|
||||
template<class _Object> static devcb_base &set_mrq_rd_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_in_mrq_cb.set_callback(object); }
|
||||
template<class _Object> static devcb_base &set_mrq_wr_callback(device_t &device, _Object object) { return downcast<tiki100_bus_t &>(device).m_out_mrq_cb.set_callback(object); }
|
||||
|
||||
void add_card(device_tiki100bus_card_interface *card);
|
||||
|
||||
// computer interface
|
||||
UINT8 mrq_r(address_space &space, offs_t offset, UINT8 data, bool &mdis);
|
||||
DECLARE_WRITE8_MEMBER( mrq_w );
|
||||
|
||||
UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data);
|
||||
DECLARE_WRITE8_MEMBER( iorq_w );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( busak_w );
|
||||
|
||||
// peripheral interface
|
||||
DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_irq_cb(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_cb(state); }
|
||||
DECLARE_WRITE_LINE_MEMBER( busrq_w ) { m_busrq_cb(state); }
|
||||
DECLARE_READ8_MEMBER( exin_mrq_r ) { return m_in_mrq_cb(offset); }
|
||||
DECLARE_WRITE8_MEMBER( exin_mrq_w ) { m_out_mrq_cb(offset, data); }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
private:
|
||||
devcb_write_line m_irq_cb;
|
||||
devcb_write_line m_nmi_cb;
|
||||
devcb_write_line m_busrq_cb;
|
||||
devcb_read8 m_in_mrq_cb;
|
||||
devcb_write8 m_out_mrq_cb;
|
||||
|
||||
simple_list<device_tiki100bus_card_interface> m_device_list;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type TIKI100_BUS;
|
||||
|
||||
|
||||
|
||||
|
||||
SLOT_INTERFACE_EXTERN( tiki100_cards );
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@ Stuff that doesn't make sense:
|
||||
------------------------------
|
||||
1. To access the screen, it waits for IRQ presumably from sync pulse. It sets INT
|
||||
mode 0 which means a page-zero jump, but doesn't write anything to the zero-page ram.
|
||||
That's why I added a RETI at 0008 and set the vector to there. A bit later it writes
|
||||
That's why I added a RETI at 0038 and set the vector to there. A bit later it writes
|
||||
a jump at 0000. Then it sets the interrupting device to the fdc (not sure how yet),
|
||||
then proceeds to overwrite all of page-zero with the disk contents. This of course
|
||||
kills the jump it just wrote, and my RETI. So it runs into the weeds at high speed.
|
||||
@ -198,6 +198,17 @@ SLOT_INTERFACE_END
|
||||
|
||||
/* Input ports */
|
||||
static INPUT_PORTS_START( amust )
|
||||
PORT_START("P9")
|
||||
// bits 6,7 not used?
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // code @ FB83
|
||||
PORT_DIPNAME( 0x10, 0x10, "Boot to Monitor" ) // code @ F895
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x0f, 0x01, "Unknown" ) // code @ FC99
|
||||
PORT_DIPSETTING( 0x01, "1" )
|
||||
PORT_DIPSETTING( 0x02, "2" )
|
||||
PORT_DIPSETTING( 0x04, "3" )
|
||||
PORT_DIPSETTING( 0x08, "4" )
|
||||
INPUT_PORTS_END
|
||||
|
||||
READ8_MEMBER( amust_state::port00_r )
|
||||
@ -215,7 +226,7 @@ READ8_MEMBER( amust_state::port01_r )
|
||||
// bodgy
|
||||
INTERRUPT_GEN_MEMBER( amust_state::irq_vs )
|
||||
{
|
||||
m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xcf);
|
||||
m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xff);
|
||||
}
|
||||
|
||||
READ8_MEMBER( amust_state::port04_r )
|
||||
@ -268,7 +279,7 @@ d7 -
|
||||
READ8_MEMBER( amust_state::port09_r )
|
||||
{
|
||||
printf("%s\n",machine().describe_context());
|
||||
return 0xff;
|
||||
return ioport("P9")->read();
|
||||
}
|
||||
|
||||
READ8_MEMBER( amust_state::port0a_r )
|
||||
@ -360,8 +371,8 @@ MACHINE_RESET_MEMBER( amust_state, amust )
|
||||
membank("bankw0")->set_entry(0); // always write to ram
|
||||
m_beep->set_frequency(800);
|
||||
address_space &space = m_maincpu->space(AS_PROGRAM);
|
||||
space.write_byte(8, 0xed);
|
||||
space.write_byte(9, 0x4d);
|
||||
space.write_byte(0x38, 0xed);
|
||||
space.write_byte(0x39, 0x4d);
|
||||
m_port04 = 0;
|
||||
m_port06 = 0;
|
||||
m_port08 = 0;
|
||||
|
@ -64,6 +64,10 @@
|
||||
|
||||
48k and 96k are basically the same machine. 128k is different.
|
||||
|
||||
This computer is weird, because it allows reads and writes from multiple banks
|
||||
at the same time. We can write to multiple banks, but we must limit ourselves
|
||||
to reading from the lowest bank selected.
|
||||
|
||||
Notes:
|
||||
- The screen doesn't scroll. This is normal.
|
||||
- Variable names are case-sensitive.
|
||||
@ -77,15 +81,25 @@
|
||||
- Cassette tapes made on 128k are a different speed to 48k tapes. To load a 128k
|
||||
tape on a 48k system, enter TAPE 3 before loading. (2,3,4,5 all seem to work).
|
||||
- When loading, there's no wildcard; you must specify the name.
|
||||
- INT should be activated by the MC6845 CURS pin (inverted), or by holding down
|
||||
the BREAK key. However, the rom leaves interrupts disabled, so none of this works.
|
||||
|
||||
To Do:
|
||||
- Need disk-based software (only ones found are LDF format)
|
||||
- finish memory banking
|
||||
- how is alt-green bank selected on 48k?
|
||||
- port 80 on 48k
|
||||
- disk
|
||||
- disk (only partially done due to no schematic)
|
||||
- printer
|
||||
- joysticks
|
||||
- find out the mc6845 clock frequency
|
||||
- UART type COM8017
|
||||
Bugs:
|
||||
- YNXVADERS: Top row of invaders is missing and can't be killed, but they
|
||||
continue to fire at you. This makes the game unwinnable.
|
||||
Game bugs (reproducible in Jynx):
|
||||
- 3D Monster Craze: When attacked, garbage on screen
|
||||
- 3D Monster Craze: When you find the key, the game freezes
|
||||
- LogiChess: unable to enter an acceptable move
|
||||
- Power Blaster: Bad Tape
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
@ -96,6 +110,7 @@
|
||||
#include "imagedev/cassette.h"
|
||||
#include "sound/wave.h"
|
||||
#include "formats/camplynx_cas.h"
|
||||
#include "machine/wd_fdc.h"
|
||||
|
||||
class camplynx_state : public driver_device
|
||||
{
|
||||
@ -107,18 +122,30 @@ public:
|
||||
, m_cass(*this, "cassette")
|
||||
//, m_printer(*this, "centronics")
|
||||
, m_crtc(*this, "crtc")
|
||||
//, m_fdc(*this, "fdc")
|
||||
, m_dac(*this, "dac")
|
||||
, m_fdc(*this, "fdc")
|
||||
, m_floppy0(*this, "fdc:0")
|
||||
, m_floppy1(*this, "fdc:1")
|
||||
{ }
|
||||
|
||||
// 48k
|
||||
DECLARE_WRITE8_MEMBER(bank1_w);
|
||||
DECLARE_WRITE8_MEMBER(bank2_w);
|
||||
DECLARE_WRITE8_MEMBER(bank3_w);
|
||||
DECLARE_WRITE8_MEMBER(bank4_w);
|
||||
DECLARE_WRITE8_MEMBER(bank5_w);
|
||||
DECLARE_WRITE8_MEMBER(bank6_w);
|
||||
DECLARE_WRITE8_MEMBER(bank7_w);
|
||||
DECLARE_WRITE8_MEMBER(bank8_w);
|
||||
DECLARE_WRITE8_MEMBER(port7f_w); // banking 48k
|
||||
DECLARE_READ8_MEMBER(port80_r); // cassin for 48k
|
||||
DECLARE_WRITE8_MEMBER(port80_w); // control port 48k
|
||||
DECLARE_WRITE8_MEMBER(port84_w); // dac port 48k
|
||||
DECLARE_WRITE8_MEMBER(lynx48k_bank_w); // banking 48k
|
||||
DECLARE_MACHINE_RESET(lynx48k);
|
||||
DECLARE_DRIVER_INIT(lynx48k);
|
||||
MC6845_UPDATE_ROW(lynx48k_update_row);
|
||||
// 128k
|
||||
DECLARE_WRITE8_MEMBER(port58_w); // drive select etc
|
||||
DECLARE_WRITE8_MEMBER(lynx128k_port80_w); // control port 128k
|
||||
DECLARE_READ8_MEMBER(lynx128k_port82_r); // cassin for 128k
|
||||
DECLARE_WRITE8_MEMBER(lynx128k_port84_w); // dac port 128k
|
||||
@ -129,31 +156,140 @@ public:
|
||||
// common
|
||||
required_device<palette_device> m_palette;
|
||||
private:
|
||||
UINT8 m_port58;
|
||||
UINT8 m_port7f;
|
||||
UINT8 m_port80;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
UINT8 m_wbyte;
|
||||
UINT8 *m_p_ram;
|
||||
required_device<z80_device> m_maincpu;
|
||||
required_device<cassette_image_device> m_cass;
|
||||
//required_device<> m_printer;
|
||||
required_device<mc6845_device> m_crtc;
|
||||
//optional_device<> m_fdc;
|
||||
required_device<dac_device> m_dac;
|
||||
optional_device<fd1793_t> m_fdc;
|
||||
optional_device<floppy_connector> m_floppy0;
|
||||
optional_device<floppy_connector> m_floppy1;
|
||||
};
|
||||
|
||||
/* These bankswitch handlers are very incomplete, just enough to get the
|
||||
computer working. Also, as it happens 6 times for every scanline
|
||||
of every character, it causes a huge slowdown. */
|
||||
|
||||
WRITE8_MEMBER( camplynx_state::lynx48k_bank_w )
|
||||
WRITE8_MEMBER( camplynx_state::port7f_w )
|
||||
{
|
||||
if (!data)
|
||||
membank("bank1")->set_entry(0);
|
||||
else
|
||||
if (data & 2)
|
||||
membank("bank1")->set_entry(1);
|
||||
else
|
||||
if (data & 4)
|
||||
membank("bank1")->set_entry(2);
|
||||
else
|
||||
logerror("%04X: Cannot understand bankswitch command %X\n",m_maincpu->pc(), data);
|
||||
/*
|
||||
d0 = write to bank 1
|
||||
d1 = write to bank 2
|
||||
d2 = write to bank 3
|
||||
d3 = write to bank 4
|
||||
d4 = read from bank 0 - roms
|
||||
d5 = read from bank 1 - user ram
|
||||
d6 = read from banks 2 and 3 - videoram
|
||||
d7 = read from bank 4 */
|
||||
|
||||
m_port7f = data;
|
||||
data ^= 0x31; // make all lines active high
|
||||
//printf("%s:%X\n", machine().describe_context(), data);
|
||||
// do writes
|
||||
m_wbyte = (data & 0x0f) | ((m_port80 & 0x0c) << 3);
|
||||
// do reads
|
||||
UINT8 rbyte = (data & 0x70) | (m_port80 & 0x0c);
|
||||
switch (rbyte)
|
||||
{
|
||||
case 0x00:
|
||||
case 0x04:
|
||||
case 0x08:
|
||||
case 0x0c:
|
||||
case 0x10:
|
||||
case 0x14:
|
||||
case 0x18:
|
||||
case 0x1c:
|
||||
membank("bankr1")->set_entry(0);
|
||||
membank("bankr2")->set_entry(1);
|
||||
membank("bankr3")->set_entry(2);
|
||||
membank("bankr4")->set_entry(3);
|
||||
membank("bankr5")->set_entry(0);
|
||||
membank("bankr6")->set_entry(1);
|
||||
membank("bankr7")->set_entry(2);
|
||||
membank("bankr8")->set_entry(3);
|
||||
break;
|
||||
case 0x20:
|
||||
case 0x24:
|
||||
case 0x28:
|
||||
case 0x2c:
|
||||
membank("bankr1")->set_entry(8);
|
||||
membank("bankr2")->set_entry(9);
|
||||
membank("bankr3")->set_entry(10);
|
||||
membank("bankr4")->set_entry(11);
|
||||
membank("bankr5")->set_entry(12);
|
||||
membank("bankr6")->set_entry(13);
|
||||
membank("bankr7")->set_entry(14);
|
||||
membank("bankr8")->set_entry(15);
|
||||
break;
|
||||
case 0x30:
|
||||
case 0x34:
|
||||
case 0x38:
|
||||
case 0x3c:
|
||||
membank("bankr1")->set_entry(0);
|
||||
membank("bankr2")->set_entry(1);
|
||||
membank("bankr3")->set_entry(2);
|
||||
membank("bankr4")->set_entry(11);
|
||||
membank("bankr5")->set_entry(12);
|
||||
membank("bankr6")->set_entry(13);
|
||||
membank("bankr7")->set_entry(14);
|
||||
membank("bankr8")->set_entry(BIT(m_port58, 4) ? 15 : 7);
|
||||
break;
|
||||
case 0x44:
|
||||
case 0x64:
|
||||
membank("bankr1")->set_entry(24);
|
||||
membank("bankr2")->set_entry(25);
|
||||
membank("bankr3")->set_entry(26);
|
||||
membank("bankr4")->set_entry(27);
|
||||
membank("bankr5")->set_entry(28);
|
||||
membank("bankr6")->set_entry(28);
|
||||
membank("bankr7")->set_entry(30);
|
||||
membank("bankr8")->set_entry(30);
|
||||
break;
|
||||
case 0x40:
|
||||
case 0x60:
|
||||
case 0x48:
|
||||
case 0x68:
|
||||
case 0x4c:
|
||||
case 0x6c:
|
||||
membank("bankr1")->set_entry(16);
|
||||
membank("bankr2")->set_entry(17);
|
||||
membank("bankr3")->set_entry(18);
|
||||
membank("bankr4")->set_entry(19);
|
||||
membank("bankr5")->set_entry(20);
|
||||
membank("bankr6")->set_entry(20);
|
||||
membank("bankr7")->set_entry(22);
|
||||
membank("bankr8")->set_entry(22);
|
||||
break;
|
||||
case 0x54:
|
||||
case 0x74:
|
||||
membank("bankr1")->set_entry(0);
|
||||
membank("bankr2")->set_entry(1);
|
||||
membank("bankr3")->set_entry(2);
|
||||
membank("bankr4")->set_entry(27);
|
||||
membank("bankr5")->set_entry(28);
|
||||
membank("bankr6")->set_entry(28);
|
||||
membank("bankr7")->set_entry(30);
|
||||
membank("bankr8")->set_entry(30);
|
||||
break;
|
||||
case 0x50:
|
||||
case 0x70:
|
||||
case 0x58:
|
||||
case 0x78:
|
||||
case 0x5c:
|
||||
case 0x7c:
|
||||
membank("bankr1")->set_entry(0);
|
||||
membank("bankr2")->set_entry(1);
|
||||
membank("bankr3")->set_entry(2);
|
||||
membank("bankr4")->set_entry(19);
|
||||
membank("bankr5")->set_entry(20);
|
||||
membank("bankr6")->set_entry(20);
|
||||
membank("bankr7")->set_entry(22);
|
||||
membank("bankr8")->set_entry(22);
|
||||
break;
|
||||
default:
|
||||
printf("Banking code %X not handled\n", rbyte);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( camplynx_state::lynx128k_bank_w )
|
||||
@ -222,53 +358,65 @@ WRITE8_MEMBER( camplynx_state::lynx128k_bank_w )
|
||||
|
||||
static ADDRESS_MAP_START( lynx48k_mem, AS_PROGRAM, 8, camplynx_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000,0x5fff) AM_ROM
|
||||
AM_RANGE(0x6000,0x7fff) AM_RAM
|
||||
AM_RANGE(0x8000,0xffff) AM_RAMBANK("bank1")
|
||||
AM_RANGE(0x0000,0x1fff) AM_READ_BANK("bankr1") AM_WRITE(bank1_w)
|
||||
AM_RANGE(0x2000,0x3fff) AM_READ_BANK("bankr2") AM_WRITE(bank2_w)
|
||||
AM_RANGE(0x4000,0x5fff) AM_READ_BANK("bankr3") AM_WRITE(bank3_w)
|
||||
AM_RANGE(0x6000,0x7fff) AM_READ_BANK("bankr4") AM_WRITE(bank4_w)
|
||||
AM_RANGE(0x8000,0x9fff) AM_READ_BANK("bankr5") AM_WRITE(bank5_w)
|
||||
AM_RANGE(0xa000,0xbfff) AM_READ_BANK("bankr6") AM_WRITE(bank6_w)
|
||||
AM_RANGE(0xc000,0xdfff) AM_READ_BANK("bankr7") AM_WRITE(bank7_w)
|
||||
AM_RANGE(0xe000,0xffff) AM_READ_BANK("bankr8") AM_WRITE(bank8_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( lynx128k_mem, AS_PROGRAM, 8, camplynx_state )
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( lynx48k_io , AS_IO, 8, camplynx_state )
|
||||
static ADDRESS_MAP_START( lynx48k_io, AS_IO, 8, camplynx_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x007f,0x007f) AM_MIRROR(0xff00) AM_WRITE(lynx48k_bank_w)
|
||||
AM_RANGE(0x007f,0x007f) AM_MIRROR(0xff80) AM_WRITE(port7f_w)
|
||||
AM_RANGE(0x0080,0x0080) AM_MIRROR(0xff00) AM_WRITE(port80_w)
|
||||
AM_RANGE(0x0080,0x0080) AM_READ(port80_r)
|
||||
AM_RANGE(0x0180,0x0180) AM_READ_PORT("LINE1")
|
||||
AM_RANGE(0x0280,0x0280) AM_READ_PORT("LINE2")
|
||||
AM_RANGE(0x0380,0x0380) AM_READ_PORT("LINE3")
|
||||
AM_RANGE(0x0480,0x0480) AM_READ_PORT("LINE4")
|
||||
AM_RANGE(0x0580,0x0580) AM_READ_PORT("LINE5")
|
||||
AM_RANGE(0x0680,0x0680) AM_READ_PORT("LINE6")
|
||||
AM_RANGE(0x0780,0x0780) AM_READ_PORT("LINE7")
|
||||
AM_RANGE(0x0880,0x0880) AM_READ_PORT("LINE8")
|
||||
AM_RANGE(0x0980,0x0980) AM_READ_PORT("LINE9")
|
||||
AM_RANGE(0x0080,0x0080) AM_MIRROR(0xf000) AM_READ(port80_r)
|
||||
AM_RANGE(0x0180,0x0180) AM_MIRROR(0xf000) AM_READ_PORT("LINE1")
|
||||
AM_RANGE(0x0280,0x0280) AM_MIRROR(0xf000) AM_READ_PORT("LINE2")
|
||||
AM_RANGE(0x0380,0x0380) AM_MIRROR(0xf000) AM_READ_PORT("LINE3")
|
||||
AM_RANGE(0x0480,0x0480) AM_MIRROR(0xf000) AM_READ_PORT("LINE4")
|
||||
AM_RANGE(0x0580,0x0580) AM_MIRROR(0xf000) AM_READ_PORT("LINE5")
|
||||
AM_RANGE(0x0680,0x0680) AM_MIRROR(0xf000) AM_READ_PORT("LINE6")
|
||||
AM_RANGE(0x0780,0x0780) AM_MIRROR(0xf000) AM_READ_PORT("LINE7")
|
||||
AM_RANGE(0x0880,0x0880) AM_MIRROR(0xf000) AM_READ_PORT("LINE8")
|
||||
AM_RANGE(0x0980,0x0980) AM_MIRROR(0xf000) AM_READ_PORT("LINE9")
|
||||
AM_RANGE(0x0084,0x0084) AM_MIRROR(0xff00) AM_WRITE(port84_w)
|
||||
AM_RANGE(0x0086,0x0086) AM_MIRROR(0xff00) AM_DEVREADWRITE("crtc", mc6845_device, status_r, address_w)
|
||||
AM_RANGE(0x0087,0x0087) AM_MIRROR(0xff00) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( lynx128k_io , AS_IO, 8, camplynx_state )
|
||||
static ADDRESS_MAP_START( lynx96k_io, AS_IO, 8, camplynx_state )
|
||||
AM_IMPORT_FROM(lynx48k_io)
|
||||
AM_RANGE(0x0050,0x0053) AM_MIRROR(0xff80) AM_DEVREAD("fdc", fd1793_t, read)
|
||||
AM_RANGE(0x0054,0x0057) AM_MIRROR(0xff80) AM_DEVWRITE("fdc", fd1793_t, write)
|
||||
AM_RANGE(0x0058,0x0058) AM_MIRROR(0xff80) AM_WRITE(port58_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( lynx128k_io, AS_IO, 8, camplynx_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
// AM_RANGE(0x0050,0x0053) AM_MIRROR(0xff80) AM_READ(wd179x_r) // uses a 1793
|
||||
// AM_RANGE(0x0054,0x0057) AM_MIRROR(0xff80) AM_WRITE(wd179x_w)
|
||||
// AM_RANGE(0x0058,0x0058) AM_MIRROR(0xff80) AM_WRITE(lynx128k_disk_w)
|
||||
AM_RANGE(0x0050,0x0053) AM_MIRROR(0xff80) AM_DEVREAD("fdc", fd1793_t, read)
|
||||
AM_RANGE(0x0054,0x0057) AM_MIRROR(0xff80) AM_DEVWRITE("fdc", fd1793_t, write)
|
||||
AM_RANGE(0x0058,0x0058) AM_MIRROR(0xff80) AM_WRITE(port58_w)
|
||||
// AM_RANGE(0x007a,0x007b) AM_MIRROR(0xff80) AM_READ(lynx128k_joysticks_r)
|
||||
// AM_RANGE(0x007c,0x007c) AM_MIRROR(0xff80) AM_READ(lynx128k_printer_r)
|
||||
// AM_RANGE(0x007d,0x007d) AM_MIRROR(0xff80) AM_WRITE(lynx128k_printer_init_w) // this is rw
|
||||
// AM_RANGE(0x007e,0x007e) AM_MIRROR(0xff80) AM_WRITE(lynx128k_printer_w)
|
||||
AM_RANGE(0x0080,0x0080) AM_MIRROR(0xff00) AM_WRITE(lynx128k_port80_w)
|
||||
AM_RANGE(0x0080,0x0080) AM_READ_PORT("LINE0")
|
||||
AM_RANGE(0x0180,0x0180) AM_READ_PORT("LINE1")
|
||||
AM_RANGE(0x0280,0x0280) AM_READ_PORT("LINE2")
|
||||
AM_RANGE(0x0380,0x0380) AM_READ_PORT("LINE3")
|
||||
AM_RANGE(0x0480,0x0480) AM_READ_PORT("LINE4")
|
||||
AM_RANGE(0x0580,0x0580) AM_READ_PORT("LINE5")
|
||||
AM_RANGE(0x0680,0x0680) AM_READ_PORT("LINE6")
|
||||
AM_RANGE(0x0780,0x0780) AM_READ_PORT("LINE7")
|
||||
AM_RANGE(0x0880,0x0880) AM_READ_PORT("LINE8")
|
||||
AM_RANGE(0x0980,0x0980) AM_READ_PORT("LINE9")
|
||||
AM_RANGE(0x0080,0x0080) AM_MIRROR(0xf000) AM_READ_PORT("LINE0")
|
||||
AM_RANGE(0x0180,0x0180) AM_MIRROR(0xf000) AM_READ_PORT("LINE1")
|
||||
AM_RANGE(0x0280,0x0280) AM_MIRROR(0xf000) AM_READ_PORT("LINE2")
|
||||
AM_RANGE(0x0380,0x0380) AM_MIRROR(0xf000) AM_READ_PORT("LINE3")
|
||||
AM_RANGE(0x0480,0x0480) AM_MIRROR(0xf000) AM_READ_PORT("LINE4")
|
||||
AM_RANGE(0x0580,0x0580) AM_MIRROR(0xf000) AM_READ_PORT("LINE5")
|
||||
AM_RANGE(0x0680,0x0680) AM_MIRROR(0xf000) AM_READ_PORT("LINE6")
|
||||
AM_RANGE(0x0780,0x0780) AM_MIRROR(0xf000) AM_READ_PORT("LINE7")
|
||||
AM_RANGE(0x0880,0x0880) AM_MIRROR(0xf000) AM_READ_PORT("LINE8")
|
||||
AM_RANGE(0x0980,0x0980) AM_MIRROR(0xf000) AM_READ_PORT("LINE9")
|
||||
AM_RANGE(0x0082,0x0082) AM_MIRROR(0xff00) AM_READWRITE(lynx128k_port82_r,lynx128k_bank_w) // read=serial buffer
|
||||
AM_RANGE(0x0084,0x0084) AM_MIRROR(0xff00) AM_WRITE(lynx128k_port84_w)
|
||||
AM_RANGE(0x0086,0x0086) AM_MIRROR(0xff00) AM_DEVREADWRITE("crtc", mc6845_device, status_r, address_w)
|
||||
@ -355,6 +503,86 @@ static INPUT_PORTS_START( lynx48k )
|
||||
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
|
||||
INPUT_PORTS_END
|
||||
|
||||
WRITE8_MEMBER( camplynx_state::bank1_w )
|
||||
{
|
||||
if BIT(m_wbyte, 0)
|
||||
m_p_ram[offset+0x10000] = data;
|
||||
if ((m_wbyte & 0x22) == 0x02)
|
||||
m_p_ram[offset+0x20000] = data;
|
||||
if ((m_wbyte & 0x44) == 0x04)
|
||||
m_p_ram[offset+0x30000] = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( camplynx_state::bank2_w )
|
||||
{
|
||||
if BIT(m_wbyte, 0)
|
||||
m_p_ram[offset+0x12000] = data;
|
||||
if ((m_wbyte & 0x22) == 0x02)
|
||||
m_p_ram[offset+0x22000] = data;
|
||||
if ((m_wbyte & 0x44) == 0x04)
|
||||
m_p_ram[offset+0x32000] = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( camplynx_state::bank3_w )
|
||||
{
|
||||
if BIT(m_wbyte, 0)
|
||||
m_p_ram[offset+0x14000] = data;
|
||||
if ((m_wbyte & 0x22) == 0x02)
|
||||
m_p_ram[offset+0x24000] = data;
|
||||
if ((m_wbyte & 0x44) == 0x04)
|
||||
m_p_ram[offset+0x34000] = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( camplynx_state::bank4_w )
|
||||
{
|
||||
if BIT(m_wbyte, 0)
|
||||
m_p_ram[offset+0x16000] = data;
|
||||
if ((m_wbyte & 0x22) == 0x02)
|
||||
m_p_ram[offset+0x26000] = data;
|
||||
if ((m_wbyte & 0x44) == 0x04)
|
||||
m_p_ram[offset+0x36000] = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( camplynx_state::bank5_w )
|
||||
{
|
||||
if BIT(m_wbyte, 0)
|
||||
m_p_ram[offset+0x18000] = data;
|
||||
if ((m_wbyte & 0x22) == 0x02)
|
||||
m_p_ram[offset+0x28000] = data;
|
||||
if ((m_wbyte & 0x44) == 0x04)
|
||||
m_p_ram[offset+0x38000] = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( camplynx_state::bank6_w )
|
||||
{
|
||||
if BIT(m_wbyte, 0)
|
||||
m_p_ram[offset+0x1a000] = data;
|
||||
if ((m_wbyte & 0x22) == 0x02)
|
||||
m_p_ram[offset+0x28000] = data;
|
||||
if ((m_wbyte & 0x44) == 0x04)
|
||||
m_p_ram[offset+0x38000] = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( camplynx_state::bank7_w )
|
||||
{
|
||||
if BIT(m_wbyte, 0)
|
||||
m_p_ram[offset+0x1c000] = data;
|
||||
if ((m_wbyte & 0x22) == 0x02)
|
||||
m_p_ram[offset+0x2c000] = data;
|
||||
if ((m_wbyte & 0x44) == 0x04)
|
||||
m_p_ram[offset+0x3c000] = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( camplynx_state::bank8_w )
|
||||
{
|
||||
if BIT(m_wbyte, 0)
|
||||
m_p_ram[offset+0x1e000] = data;
|
||||
if ((m_wbyte & 0x22) == 0x02)
|
||||
m_p_ram[offset+0x2c000] = data;
|
||||
if ((m_wbyte & 0x44) == 0x04)
|
||||
m_p_ram[offset+0x3c000] = data;
|
||||
}
|
||||
|
||||
READ8_MEMBER( camplynx_state::port80_r )
|
||||
{
|
||||
UINT8 data = ioport("LINE0")->read();
|
||||
@ -373,6 +601,7 @@ WRITE8_MEMBER( camplynx_state::port80_w )
|
||||
{
|
||||
m_port80 = data;
|
||||
m_cass->change_state( BIT(data, 1) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
|
||||
port7f_w(space, 0, m_port7f);
|
||||
}
|
||||
|
||||
/* DAC port. If writing cassette, output goes to tape as a sine wave, otherwise it goes to speaker.
|
||||
@ -435,7 +664,16 @@ WRITE8_MEMBER( camplynx_state::lynx128k_port84_w )
|
||||
m_dac->write_unsigned8(space, 0, data);
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(camplynx_state,lynx128k)
|
||||
MACHINE_RESET_MEMBER(camplynx_state, lynx48k)
|
||||
{
|
||||
address_space &mem = m_maincpu->space(AS_PROGRAM);
|
||||
port7f_w( mem, 0, 0 );
|
||||
m_port58 = 0;
|
||||
m_port80 = 0;
|
||||
m_maincpu->reset();
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(camplynx_state, lynx128k)
|
||||
{
|
||||
address_space &mem = m_maincpu->space(AS_PROGRAM);
|
||||
mem.install_read_bank (0x0000, 0x1fff, "bank1");
|
||||
@ -465,16 +703,21 @@ WRITE8_MEMBER( camplynx_state::lynx128k_irq )
|
||||
|
||||
MC6845_UPDATE_ROW( camplynx_state::lynx48k_update_row )
|
||||
{
|
||||
UINT8 *RAM = machine().root_device().memregion("maincpu")->base();
|
||||
UINT8 r,g,b,x;
|
||||
UINT32 *p = &bitmap.pix32(y);
|
||||
UINT16 mem = ((ma << 2) + (ra << 5)) & 0x3fff;
|
||||
UINT8 r=0,g=0,b=0,x;
|
||||
UINT32 green_bank, *p = &bitmap.pix32(y);
|
||||
UINT16 mem = ((ma << 2) + (ra << 5)) & 0x1fff;
|
||||
|
||||
// determine green bank
|
||||
if BIT(m_port80, 4)
|
||||
green_bank = 0x38000+mem; // alt green
|
||||
else
|
||||
green_bank = 0x3c000+mem; // normal green
|
||||
|
||||
for (x = 0; x < x_count; x++)
|
||||
{
|
||||
r = RAM[0x14000+mem+x];
|
||||
g = RAM[0x1c000+mem+x];
|
||||
b = RAM[0x10000+mem+x];
|
||||
r = m_p_ram[0x2c000+mem+x];
|
||||
b = m_p_ram[0x28000+mem+x];
|
||||
g = m_p_ram[green_bank+x];
|
||||
|
||||
*p++ = m_palette->pen_color((BIT(b, 7) << 2) | (BIT(g, 7) << 1) | (BIT(r, 7)));
|
||||
*p++ = m_palette->pen_color((BIT(b, 6) << 2) | (BIT(g, 6) << 1) | (BIT(r, 6)));
|
||||
@ -516,13 +759,53 @@ MC6845_UPDATE_ROW( camplynx_state::lynx128k_update_row )
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( camplynx_state::port58_w )
|
||||
{
|
||||
/*
|
||||
d0,d1 = drive select
|
||||
d2 = side
|
||||
d3 = motor
|
||||
d4 = eprom
|
||||
d5 = not used
|
||||
d6 = no precomp
|
||||
d7 = 125ns or 250ns */
|
||||
|
||||
if (BIT(m_port58, 4) ^ BIT(data, 4))
|
||||
{
|
||||
m_port58 = data;
|
||||
port7f_w(space, 0, m_port7f);
|
||||
}
|
||||
m_fdc->dden_w(BIT(data, 7));
|
||||
|
||||
floppy_image_device *floppy = NULL;
|
||||
if ((data & 3) == 0) floppy = m_floppy0->get_device();
|
||||
else
|
||||
if ((data & 3) == 1) floppy = m_floppy1->get_device();
|
||||
|
||||
m_fdc->set_floppy(floppy);
|
||||
|
||||
if (floppy)
|
||||
floppy->ss_w(BIT(data, 2));
|
||||
|
||||
m_floppy0->get_device()->mon_w(BIT(data, 3));
|
||||
m_floppy1->get_device()->mon_w(BIT(data, 3));
|
||||
}
|
||||
|
||||
|
||||
static SLOT_INTERFACE_START( camplynx_floppies )
|
||||
SLOT_INTERFACE( "drive0", FLOPPY_525_QD )
|
||||
SLOT_INTERFACE( "drive1", FLOPPY_525_QD )
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
static MACHINE_CONFIG_START( lynx48k, camplynx_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", Z80, XTAL_4MHz)
|
||||
MCFG_CPU_ADD("maincpu", Z80, XTAL_24MHz / 6)
|
||||
MCFG_CPU_PROGRAM_MAP(lynx48k_mem)
|
||||
MCFG_CPU_IO_MAP(lynx48k_io)
|
||||
|
||||
MCFG_MACHINE_RESET_OVERRIDE(camplynx_state, lynx48k)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(50)
|
||||
@ -538,13 +821,14 @@ static MACHINE_CONFIG_START( lynx48k, camplynx_state )
|
||||
MCFG_SOUND_ADD("dac", DAC, 0)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.5)
|
||||
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.02)
|
||||
|
||||
/* devices */
|
||||
MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12MHz / 8 /*? dot clock divided by dots per char */)
|
||||
MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12MHz / 8 )
|
||||
MCFG_MC6845_SHOW_BORDER_AREA(false)
|
||||
MCFG_MC6845_CHAR_WIDTH(8)
|
||||
MCFG_MC6845_UPDATE_ROW_CB(camplynx_state, lynx48k_update_row)
|
||||
MCFG_MC6845_OUT_CUR_CB(DEVWRITELINE("maincpu", z80_device, irq_line))
|
||||
|
||||
MCFG_CASSETTE_ADD("cassette")
|
||||
MCFG_CASSETTE_FORMATS(lynx48k_cassette_formats)
|
||||
@ -552,10 +836,25 @@ static MACHINE_CONFIG_START( lynx48k, camplynx_state )
|
||||
//MCFG_CASSETTE_INTERFACE("camplynx_cass")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( lynx96k, lynx48k )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_MODIFY("maincpu")
|
||||
MCFG_CPU_IO_MAP(lynx96k_io)
|
||||
|
||||
// floppy-disk
|
||||
MCFG_FD1793_ADD("fdc", XTAL_24MHz / 24) // no idea what crystal, no schematic of fdc found
|
||||
//MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(camplynx_state, fdc_intrq_w))
|
||||
//MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(camplynx_state, fdc_drq_w))
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:0", camplynx_floppies, "drive0", floppy_image_device::default_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_SOUND(true)
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:1", camplynx_floppies, "drive1", floppy_image_device::default_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_SOUND(true)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_START( lynx128k, camplynx_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", Z80, XTAL_6MHz)
|
||||
MCFG_CPU_ADD("maincpu", Z80, XTAL_24MHz / 4)
|
||||
MCFG_CPU_PROGRAM_MAP(lynx128k_mem)
|
||||
MCFG_CPU_IO_MAP(lynx128k_io)
|
||||
|
||||
@ -576,31 +875,47 @@ static MACHINE_CONFIG_START( lynx128k, camplynx_state )
|
||||
MCFG_SOUND_ADD("dac", DAC, 0)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.5)
|
||||
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.02)
|
||||
|
||||
/* devices */
|
||||
MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12MHz / 8 /*? dot clock divided by dots per char */)
|
||||
MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12MHz / 8 )
|
||||
MCFG_MC6845_SHOW_BORDER_AREA(false)
|
||||
MCFG_MC6845_CHAR_WIDTH(8)
|
||||
MCFG_MC6845_UPDATE_ROW_CB(camplynx_state, lynx128k_update_row)
|
||||
MCFG_MC6845_OUT_HSYNC_CB(WRITE8(camplynx_state, lynx128k_irq))
|
||||
MCFG_MC6845_OUT_CUR_CB(DEVWRITELINE("maincpu", z80_device, irq_line))
|
||||
|
||||
MCFG_CASSETTE_ADD("cassette")
|
||||
MCFG_CASSETTE_FORMATS(lynx128k_cassette_formats)
|
||||
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_DISABLED)
|
||||
//MCFG_CASSETTE_INTERFACE("camplynx_cass")
|
||||
|
||||
MCFG_FD1793_ADD("fdc", XTAL_24MHz / 24) // no idea what crystal, no schematic of fdc found
|
||||
//MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(camplynx_state, fdc_intrq_w))
|
||||
//MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(camplynx_state, fdc_drq_w))
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:0", camplynx_floppies, "drive0", floppy_image_device::default_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_SOUND(true)
|
||||
MCFG_FLOPPY_DRIVE_ADD("fdc:1", camplynx_floppies, "drive1", floppy_image_device::default_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_SOUND(true)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
DRIVER_INIT_MEMBER(camplynx_state,lynx48k)
|
||||
DRIVER_INIT_MEMBER(camplynx_state, lynx48k)
|
||||
{
|
||||
UINT8 *RAM = memregion("maincpu")->base();
|
||||
membank("bank1")->configure_entries(0, 3, &RAM[0x8000], 0x8000);
|
||||
m_p_ram = memregion("maincpu")->base();
|
||||
membank("bankr1")->configure_entries(0, 32, &m_p_ram[0], 0x2000);
|
||||
membank("bankr2")->configure_entries(0, 32, &m_p_ram[0], 0x2000);
|
||||
membank("bankr3")->configure_entries(0, 32, &m_p_ram[0], 0x2000);
|
||||
membank("bankr4")->configure_entries(0, 32, &m_p_ram[0], 0x2000);
|
||||
membank("bankr5")->configure_entries(0, 32, &m_p_ram[0], 0x2000);
|
||||
membank("bankr6")->configure_entries(0, 32, &m_p_ram[0], 0x2000);
|
||||
membank("bankr7")->configure_entries(0, 32, &m_p_ram[0], 0x2000);
|
||||
membank("bankr8")->configure_entries(0, 32, &m_p_ram[0], 0x2000);
|
||||
}
|
||||
|
||||
|
||||
/* ROM definition */
|
||||
ROM_START( lynx48k )
|
||||
ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF )
|
||||
ROM_REGION( 0x40000, "maincpu", ROMREGION_ERASE00 )
|
||||
ROM_FILL( 0x4000, 0xc000, 0xff )
|
||||
ROM_SYSTEM_BIOS(0, "1", "Set1")
|
||||
ROMX_LOAD( "lynx48-1.rom", 0x0000, 0x2000, CRC(56feec44) SHA1(7ded5184561168e159a30fa8e9d3fde5e52aa91a), ROM_BIOS(1) )
|
||||
ROMX_LOAD( "lynx48-2.rom", 0x2000, 0x2000, CRC(d894562e) SHA1(c08a78ecb4eb05baa4c52488fce3648cd2688744), ROM_BIOS(1) )
|
||||
@ -610,7 +925,7 @@ ROM_START( lynx48k )
|
||||
ROM_END
|
||||
|
||||
ROM_START( lynx96k )
|
||||
ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASEFF )
|
||||
ROM_REGION( 0x40000, "maincpu", ROMREGION_ERASEFF )
|
||||
ROM_LOAD( "lynx9646.rom", 0x0000, 0x2000, CRC(f86c5514) SHA1(77a4af7557382003d697d08f364839e2dc28f063) )
|
||||
ROM_LOAD( "lynx9645.rom", 0x2000, 0x2000, CRC(f596b9a3) SHA1(3fca46bd68422d34c6cd801dd904507e52bd8846) )
|
||||
ROM_LOAD( "lynx9644.rom", 0x4000, 0x1000, CRC(4b96b0de) SHA1(c372a8d26399b9b45e615b674d61ccda76491b8b) )
|
||||
@ -627,7 +942,7 @@ ROM_END
|
||||
|
||||
|
||||
/* Driver */
|
||||
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
|
||||
COMP( 1983, lynx48k, 0, 0, lynx48k, lynx48k, camplynx_state, lynx48k, "Camputers", "Lynx 48k", MACHINE_NOT_WORKING)
|
||||
COMP( 1983, lynx96k, lynx48k, 0, lynx48k, lynx48k, camplynx_state, lynx48k, "Camputers", "Lynx 96k", MACHINE_NOT_WORKING)
|
||||
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
|
||||
COMP( 1983, lynx48k, 0, 0, lynx48k, lynx48k, camplynx_state, lynx48k, "Camputers", "Lynx 48k", 0 )
|
||||
COMP( 1983, lynx96k, lynx48k, 0, lynx96k, lynx48k, camplynx_state, lynx48k, "Camputers", "Lynx 96k", MACHINE_NOT_WORKING)
|
||||
COMP( 1983, lynx128k, lynx48k, 0, lynx128k, lynx48k, driver_device, 0, "Camputers", "Lynx 128k", MACHINE_NOT_WORKING)
|
||||
|
@ -10,7 +10,7 @@
|
||||
TV Tennis (1973) #427
|
||||
Olympic TV Hockey (1973) #429
|
||||
Olympic TV Football (1973) #429-A
|
||||
TV Goalee (1974) #414
|
||||
TV Goalee (1974) #434
|
||||
TV Pingame (1975) #451
|
||||
Super Flipper (1975) #458
|
||||
Demolition Derby (1976) #466
|
||||
|
@ -19,6 +19,11 @@ S Substitute memory locations
|
||||
X Examine registers
|
||||
|
||||
Please note this rom set boots into BASIC, not monitor.
|
||||
All commands must be in upper case.
|
||||
To correct a mistake, use DEL not Backspace. It will print a \ to indicate
|
||||
a removed character.
|
||||
|
||||
No known manual or schematic of the video board.
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
@ -124,6 +129,15 @@ WRITE_LINE_MEMBER( sdk80_state::usart_clock_tick )
|
||||
}
|
||||
}
|
||||
|
||||
static DEVICE_INPUT_DEFAULTS_START( terminal ) // set up terminal to default to 4800
|
||||
DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_4800 )
|
||||
DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_4800 )
|
||||
DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 )
|
||||
DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 )
|
||||
DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE )
|
||||
DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 )
|
||||
DEVICE_INPUT_DEFAULTS_END
|
||||
|
||||
static MACHINE_CONFIG_START( sdk80, sdk80_state )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", I8080A, XTAL_18_432MHz/9)
|
||||
@ -135,9 +149,10 @@ static MACHINE_CONFIG_START( sdk80, sdk80_state )
|
||||
MCFG_I8251_DTR_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr))
|
||||
MCFG_I8251_RTS_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts))
|
||||
|
||||
MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "null_modem")
|
||||
MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "terminal")
|
||||
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_rxd))
|
||||
MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_dsr))
|
||||
MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal)
|
||||
|
||||
MCFG_DEVICE_ADD("usart_clock", CLOCK, XTAL_18_432MHz/60)
|
||||
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(sdk80_state, usart_clock_tick))
|
||||
@ -180,8 +195,6 @@ static MACHINE_CONFIG_START( sdk80, sdk80_state )
|
||||
// MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key
|
||||
// MCFG_I8279_IN_CTRL_CB(VCC)
|
||||
|
||||
//MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0)
|
||||
//MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(sdk80_state, kbd_put))
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/* ROM definition */
|
||||
|
@ -2226,7 +2226,9 @@ static ADDRESS_MAP_START( blockcarb_map, AS_PROGRAM, 16, seta_state )
|
||||
AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1
|
||||
AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2
|
||||
AM_RANGE(0x500004, 0x500005) AM_READ_PORT("COINS") // Coins
|
||||
// AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, word_r, word_w) // Sound - not on this bootleg
|
||||
AM_RANGE(0x500008, 0x500009) AM_DEVWRITE8("oki", okim6295_device, write, 0x00ff)
|
||||
//AM_RANGE(0x50000c, 0x50000d) // ??
|
||||
AM_RANGE(0xa00000, 0xa03fff) AM_NOP // Sound - not on this bootleg
|
||||
AM_RANGE(0xb00000, 0xb003ff) AM_RAM AM_SHARE("paletteram") // Palette
|
||||
AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spritecode_r16, spritecode_w16) // Sprites Code + X + Attr
|
||||
/**/AM_RANGE(0xd00000, 0xd00001) AM_RAM // ? 0x4000
|
||||
@ -8148,9 +8150,8 @@ MACHINE_CONFIG_END
|
||||
static ADDRESS_MAP_START( blockcarb_sound_map, AS_PROGRAM, 8, seta_state )
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xdfff) AM_ROM
|
||||
AM_RANGE(0xe800, 0xe800) AM_READ(wiggie_soundlatch_r)
|
||||
AM_RANGE(0xf800, 0xffff) AM_RAM
|
||||
AM_RANGE(0xd000, 0xdfff) AM_RAM
|
||||
//AM_RANGE(0xf001, 0xf001) ??
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( blockcarb_sound_portmap, AS_IO, 8, seta_state )
|
||||
@ -11656,7 +11657,7 @@ GAME( 1992, blandia, 0, blandia, blandia, seta_state, blandia, ROT
|
||||
GAME( 1992, blandiap, blandia, blandiap, blandia, driver_device, 0, ROT0, "Allumer", "Blandia (prototype)", MACHINE_IMPERFECT_GRAPHICS )
|
||||
|
||||
GAME( 1992, blockcar, 0, blockcar, blockcar, driver_device, 0, ROT90, "Visco", "Block Carnival / Thunder & Lightning 2" , 0) // Title: DSW
|
||||
GAME( 1992, blockcarb,blockcar, blockcarb,blockcar, driver_device, 0, ROT90, "bootleg", "Block Carnival / Thunder & Lightning 2 (bootleg)", MACHINE_NO_SOUND)
|
||||
GAME( 1992, blockcarb,blockcar, blockcarb,blockcar, driver_device, 0, ROT90, "bootleg", "Block Carnival / Thunder & Lightning 2 (bootleg)", MACHINE_IMPERFECT_SOUND)
|
||||
|
||||
GAME( 1992, qzkklogy, 0, drgnunit, qzkklogy, driver_device, 0, ROT0, "Tecmo", "Quiz Kokology", 0 )
|
||||
|
||||
|
@ -651,16 +651,24 @@ static const z80_daisy_config tiki100_daisy_chain[] =
|
||||
{ Z80CTC_TAG },
|
||||
{ Z80DART_TAG },
|
||||
{ Z80PIO_TAG },
|
||||
{ "slot1" },
|
||||
{ "slot2" },
|
||||
{ "slot3" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER( tiki100_state::tape_tick )
|
||||
{
|
||||
m_pio->port_b_write((m_cassette->input() > 0.0) << 7);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( tiki100_state::busrq_w )
|
||||
{
|
||||
// since our Z80 has no support for BUSACK, we assume it is granted immediately
|
||||
m_maincpu->set_input_line(Z80_INPUT_LINE_BUSRQ, state);
|
||||
m_exp->busak_w(state);
|
||||
}
|
||||
|
||||
/* Machine Start */
|
||||
|
||||
void tiki100_state::machine_start()
|
||||
@ -706,8 +714,11 @@ static MACHINE_CONFIG_START( tiki100, tiki100_state )
|
||||
MCFG_PALETTE_ADD("palette", 16)
|
||||
|
||||
MCFG_TIKI100_BUS_ADD()
|
||||
//MCFG_TIKI100_BUS_IRQ_CALLBACK()
|
||||
//MCFG_TIKI100_BUS_NMI_CALLBACK()
|
||||
MCFG_TIKI100_BUS_IRQ_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
|
||||
MCFG_TIKI100_BUS_NMI_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_NMI))
|
||||
MCFG_TIKI100_BUS_BUSRQ_CALLBACK(WRITELINE(tiki100_state, busrq_w))
|
||||
MCFG_TIKI100_BUS_IN_MREQ_CALLBACK(READ8(tiki100_state, mrq_r))
|
||||
MCFG_TIKI100_BUS_OUT_MREQ_CALLBACK(WRITE8(tiki100_state, mrq_w))
|
||||
MCFG_TIKI100_BUS_SLOT_ADD("slot1", "8088")
|
||||
MCFG_TIKI100_BUS_SLOT_ADD("slot2", "hdc")
|
||||
MCFG_TIKI100_BUS_SLOT_ADD("slot3", NULL)
|
||||
|
@ -138,6 +138,8 @@ public:
|
||||
DECLARE_WRITE_LINE_MEMBER(write_centronics_busy);
|
||||
DECLARE_WRITE_LINE_MEMBER(write_centronics_perror);
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( busrq_w );
|
||||
|
||||
enum
|
||||
{
|
||||
ROM0 = 0x01,
|
||||
|
@ -1972,7 +1972,7 @@ WRITE8_MEMBER(amstrad_state::rom_select)
|
||||
exp_port = temp_dev->subdevice<cpc_expansion_slot_device>("exp");
|
||||
}
|
||||
|
||||
amstrad_setUpperRom();
|
||||
amstrad_rethinkMemory();
|
||||
}
|
||||
|
||||
/* Offset handler for write */
|
||||
|
Loading…
Reference in New Issue
Block a user