mirror of
https://github.com/freitz85/AppleIISd.git
synced 2024-12-17 14:29:48 +00:00
Flasher project added
This commit is contained in:
parent
5b721c3e61
commit
781d283c3c
@ -5,6 +5,8 @@ VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppleIISd", "Firmware\AppleIISd.vcxproj", "{9EA7EC3D-1771-420F-932F-231A35ED1200}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Flasher", "Software\Flasher.vcxproj", "{B2CF2E9D-62A7-4A68-9477-9B15A8707E78}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
@ -15,6 +17,10 @@ Global
|
||||
{9EA7EC3D-1771-420F-932F-231A35ED1200}.Debug|x86.Build.0 = Debug|Win32
|
||||
{9EA7EC3D-1771-420F-932F-231A35ED1200}.Release|x86.ActiveCfg = Release|Win32
|
||||
{9EA7EC3D-1771-420F-932F-231A35ED1200}.Release|x86.Build.0 = Release|Win32
|
||||
{B2CF2E9D-62A7-4A68-9477-9B15A8707E78}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{B2CF2E9D-62A7-4A68-9477-9B15A8707E78}.Debug|x86.Build.0 = Debug|Win32
|
||||
{B2CF2E9D-62A7-4A68-9477-9B15A8707E78}.Release|x86.ActiveCfg = Release|Win32
|
||||
{B2CF2E9D-62A7-4A68-9477-9B15A8707E78}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
97
Software/Flasher.vcxproj
Normal file
97
Software/Flasher.vcxproj
Normal file
@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Flasher.bin.map" />
|
||||
<None Include="makefile" />
|
||||
<None Include="Makefile.options" />
|
||||
<None Include="obj\Flasher.lst" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\Flasher.c" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B2CF2E9D-62A7-4A68-9477-9B15A8707E78}</ProjectGuid>
|
||||
<Keyword>MakeFileProj</Keyword>
|
||||
<ProjectName>Flasher</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<NMakeOutput>
|
||||
</NMakeOutput>
|
||||
<NMakePreprocessorDefinitions>__APPLE2__;__APPLE2ENH__;__fastcall__=__fastcall;_MSC_VER=0;__attribute__</NMakePreprocessorDefinitions>
|
||||
<ExecutablePath>$(PATH);C:\cc65\bin</ExecutablePath>
|
||||
<IncludePath>C:\cc65\include</IncludePath>
|
||||
<LibraryPath>C:\cc65\lib</LibraryPath>
|
||||
<LibraryWPath />
|
||||
<ExcludePath />
|
||||
<NMakeBuildCommandLine>$(MAKE_HOME)\make OPTIONS=mapfile,listing</NMakeBuildCommandLine>
|
||||
<SourcePath>$(ProjectDir)\src</SourcePath>
|
||||
<NMakeReBuildCommandLine>$(MAKE_HOME)\make clean
|
||||
$(MAKE_HOME)\make OPTIONS=mapfile,listing</NMakeReBuildCommandLine>
|
||||
<OutDir>$(SolutionDir)\</OutDir>
|
||||
<NMakeCleanCommandLine>$(MAKE_HOME)\make clean</NMakeCleanCommandLine>
|
||||
<ReferencePath />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<NMakeOutput>
|
||||
</NMakeOutput>
|
||||
<NMakePreprocessorDefinitions>
|
||||
</NMakePreprocessorDefinitions>
|
||||
<NMakeBuildCommandLine>del /S /Q "$(ProjectDir)makefile.options
|
||||
$(MAKE_HOME)\make -C "$(ProjectDir)\" PROGRAM="$(ProjectDir)$(Configuration)\$(ProjectName)"
|
||||
rmdir /S /Q "$(ProjectDir)obj\Win32"
|
||||
rmdir /S /Q "$(SolutionDir)Release"</NMakeBuildCommandLine>
|
||||
<NMakeReBuildCommandLine>del /S /Q "$(ProjectDir)makefile.options
|
||||
$(MAKE_HOME)\make clean -C "$(ProjectDir)\" PROGRAM="$(ProjectDir)$(Configuration)\$(ProjectName)"
|
||||
$(MAKE_HOME)\make -C "$(ProjectDir)\" PROGRAM="$(ProjectDir)$(Configuration)\$(ProjectName)"
|
||||
rmdir /S /Q "$(ProjectDir)obj\Win32"
|
||||
rmdir /S /Q "$(SolutionDir)Release"
|
||||
</NMakeReBuildCommandLine>
|
||||
<NMakeCleanCommandLine>del /S /Q "$(ProjectDir)makefile.options
|
||||
$(MAKE_HOME)\make clean -C "$(ProjectDir)\" PROGRAM="$(ProjectDir)$(Configuration)\$(ProjectName)"
|
||||
rmdir /S /Q "$(ProjectDir)obj\Win32"
|
||||
rmdir /S /Q "$(SolutionDir)Release"</NMakeCleanCommandLine>
|
||||
<ExecutablePath>$(PATH);C:\cc65\bin</ExecutablePath>
|
||||
<IncludePath>$(VC_IncludePath);C:\cc65\include</IncludePath>
|
||||
<ReferencePath />
|
||||
<LibraryPath>C:\cc65\lib</LibraryPath>
|
||||
<ExcludePath />
|
||||
<LibraryWPath />
|
||||
<OutDir>$(SolutionDir)$\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
12
Software/Flasher.vcxproj.filters
Normal file
12
Software/Flasher.vcxproj.filters
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<None Include="makefile" />
|
||||
<None Include="Makefile.options" />
|
||||
<None Include="Flasher.bin.map" />
|
||||
<None Include="obj\Flasher.lst" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\Flasher.c" />
|
||||
</ItemGroup>
|
||||
</Project>
|
346
Software/makefile
Normal file
346
Software/makefile
Normal file
@ -0,0 +1,346 @@
|
||||
###############################################################################
|
||||
### Generic Makefile for cc65 projects - full version with abstract options ###
|
||||
### V1.3.0(w) 2010 - 2013 Oliver Schmidt & Patryk "Silver Dream !" ?ogiewa ###
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
### In order to override defaults - values can be assigned to the variables ###
|
||||
###############################################################################
|
||||
|
||||
# Space or comma separated list of cc65 supported target platforms to build for.
|
||||
# Default: c64 (lowercase!)
|
||||
TARGETS := apple2enh
|
||||
|
||||
# Name of the final, single-file executable.
|
||||
# Default: name of the current dir with target name appended
|
||||
PROGRAM := Flasher
|
||||
|
||||
# Path(s) to additional libraries required for linking the program
|
||||
# Use only if you don't want to place copies of the libraries in SRCDIR
|
||||
# Default: none
|
||||
LIBS :=
|
||||
|
||||
# Custom linker configuration file
|
||||
# Use only if you don't want to place it in SRCDIR
|
||||
# Default: none
|
||||
CONFIG :=
|
||||
|
||||
# Additional C compiler flags and options.
|
||||
# Default: none
|
||||
CFLAGS =
|
||||
|
||||
# Additional assembler flags and options.
|
||||
# Default: none
|
||||
ASFLAGS =
|
||||
|
||||
# Additional linker flags and options.
|
||||
# Default: none
|
||||
LDFLAGS =
|
||||
|
||||
# Path to the directory containing C and ASM sources.
|
||||
# Default: src
|
||||
SRCDIR :=
|
||||
|
||||
# Path to the directory where object files are to be stored (inside respective target subdirectories).
|
||||
# Default: obj
|
||||
OBJDIR :=
|
||||
|
||||
# Command used to run the emulator.
|
||||
# Default: depending on target platform. For default (c64) target: x64 -kernal kernal -VICIIdsize -autoload
|
||||
EMUCMD :=
|
||||
|
||||
# Optional commands used before starting the emulation process, and after finishing it.
|
||||
# Default: none
|
||||
# Examples
|
||||
#PREEMUCMD := osascript -e "tell application \"System Events\" to set isRunning to (name of processes) contains \"X11.bin\"" -e "if isRunning is true then tell application \"X11\" to activate"
|
||||
#PREEMUCMD := osascript -e "tell application \"X11\" to activate"
|
||||
#POSTEMUCMD := osascript -e "tell application \"System Events\" to tell process \"X11\" to set visible to false"
|
||||
#POSTEMUCMD := osascript -e "tell application \"Terminal\" to activate"
|
||||
PREEMUCMD :=
|
||||
POSTEMUCMD :=
|
||||
|
||||
# On Windows machines VICE emulators may not be available in the PATH by default.
|
||||
# In such case, please set the variable below to point to directory containing
|
||||
# VICE emulators.
|
||||
#VICE_HOME := "C:\Program Files\WinVICE-2.2-x86\"
|
||||
VICE_HOME :=
|
||||
|
||||
# Options state file name. You should not need to change this, but for those
|
||||
# rare cases when you feel you really need to name it differently - here you are
|
||||
STATEFILE := Makefile.options
|
||||
|
||||
###################################################################################
|
||||
#### DO NOT EDIT BELOW THIS LINE, UNLESS YOU REALLY KNOW WHAT YOU ARE DOING! ####
|
||||
###################################################################################
|
||||
|
||||
###################################################################################
|
||||
### Mapping abstract options to the actual compiler, assembler and linker flags ###
|
||||
### Predefined compiler, assembler and linker flags, used with abstract options ###
|
||||
### valid for 2.14.x. Consult the documentation of your cc65 version before use ###
|
||||
###################################################################################
|
||||
|
||||
# Compiler flags used to tell the compiler to optimise for SPEED
|
||||
define _optspeed_
|
||||
CFLAGS += -Oris
|
||||
endef
|
||||
|
||||
# Compiler flags used to tell the compiler to optimise for SIZE
|
||||
define _optsize_
|
||||
CFLAGS += -Or
|
||||
endef
|
||||
|
||||
# Compiler and assembler flags for generating listings
|
||||
define _listing_
|
||||
CFLAGS += --listing $$(@:.o=.lst) -T
|
||||
ASFLAGS += --listing $$(@:.o=.lst)
|
||||
REMOVES += $(addsuffix .lst,$(basename $(OBJECTS)))
|
||||
endef
|
||||
|
||||
# Linker flags for generating map file
|
||||
define _mapfile_
|
||||
LDFLAGS += --mapfile $$@.map
|
||||
REMOVES += $(PROGRAM).map
|
||||
endef
|
||||
|
||||
# Linker flags for generating VICE label file
|
||||
define _labelfile_
|
||||
LDFLAGS += -Ln $$@.lbl
|
||||
REMOVES += $(PROGRAM).lbl
|
||||
endef
|
||||
|
||||
# Linker flags for generating a debug file
|
||||
define _debugfile_
|
||||
LDFLAGS += -Wl --dbgfile,$$@.dbg
|
||||
REMOVES += $(PROGRAM).dbg
|
||||
endef
|
||||
|
||||
###############################################################################
|
||||
### Defaults to be used if nothing defined in the editable sections above ###
|
||||
###############################################################################
|
||||
|
||||
# Presume the C64 target like the cl65 compile & link utility does.
|
||||
# Set TARGETS to override.
|
||||
ifeq ($(TARGETS),)
|
||||
TARGETS := c64
|
||||
endif
|
||||
|
||||
# Presume we're in a project directory so name the program like the current
|
||||
# directory. Set PROGRAM to override.
|
||||
ifeq ($(PROGRAM),)
|
||||
PROGRAM := $(notdir $(CURDIR))
|
||||
endif
|
||||
|
||||
# Presume the C and asm source files to be located in the subdirectory 'src'.
|
||||
# Set SRCDIR to override.
|
||||
ifeq ($(SRCDIR),)
|
||||
SRCDIR := src
|
||||
endif
|
||||
|
||||
# Presume the object and dependency files to be located in the subdirectory
|
||||
# 'obj' (which will be created). Set OBJDIR to override.
|
||||
ifeq ($(OBJDIR),)
|
||||
OBJDIR := obj
|
||||
endif
|
||||
TARGETOBJDIR := $(OBJDIR)
|
||||
|
||||
# On Windows it is mandatory to have CC65_HOME set. So do not unnecessarily
|
||||
# rely on cl65 being added to the PATH in this scenario.
|
||||
ifdef CC65_HOME
|
||||
CC := $(CC65_HOME)/bin/cl65
|
||||
else
|
||||
CC := cl65
|
||||
endif
|
||||
|
||||
# Default emulator commands and options for particular targets.
|
||||
# Set EMUCMD to override.
|
||||
c64_EMUCMD := $(VICE_HOME)x64 -kernal kernal -VICIIdsize -autoload
|
||||
c128_EMUCMD := $(VICE_HOME)x128 -kernal kernal -VICIIdsize -autoload
|
||||
vic20_EMUCMD := $(VICE_HOME)xvic -kernal kernal -VICdsize -autoload
|
||||
pet_EMUCMD := $(VICE_HOME)xpet -Crtcdsize -autoload
|
||||
plus4_EMUCMD := $(VICE_HOME)xplus4 -TEDdsize -autoload
|
||||
# So far there is no x16 emulator in VICE (why??) so we have to use xplus4 with -memsize option
|
||||
c16_EMUCMD := $(VICE_HOME)xplus4 -ramsize 16 -TEDdsize -autoload
|
||||
cbm510_EMUCMD := $(VICE_HOME)xcbm2 -model 510 -VICIIdsize -autoload
|
||||
cbm610_EMUCMD := $(VICE_HOME)xcbm2 -model 610 -Crtcdsize -autoload
|
||||
atari_EMUCMD := atari800 -windowed -xl -pal -nopatchall -run
|
||||
|
||||
ifeq ($(EMUCMD),)
|
||||
EMUCMD = $($(CC65TARGET)_EMUCMD)
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
### The magic begins ###
|
||||
###############################################################################
|
||||
|
||||
# The "Native Win32" GNU Make contains quite some workarounds to get along with
|
||||
# cmd.exe as shell. However it does not provide means to determine that it does
|
||||
# actually activate those workarounds. Especially $(SHELL) does NOT contain the
|
||||
# value 'cmd.exe'. So the usual way to determine if cmd.exe is being used is to
|
||||
# execute the command 'echo' without any parameters. Only cmd.exe will return a
|
||||
# non-empty string - saying 'ECHO is on/off'.
|
||||
#
|
||||
# Many "Native Win32" programs accept '/' as directory delimiter just fine. How-
|
||||
# ever the internal commands of cmd.exe generally require '\' to be used.
|
||||
#
|
||||
# cmd.exe has an internal command 'mkdir' that doesn't understand nor require a
|
||||
# '-p' to create parent directories as needed.
|
||||
#
|
||||
# cmd.exe has an internal command 'del' that reports a syntax error if executed
|
||||
# without any file so make sure to call it only if there's an actual argument.
|
||||
ifeq ($(shell echo),)
|
||||
MKDIR = mkdir -p $1
|
||||
RMDIR = rmdir $1
|
||||
RMFILES = $(RM) $1
|
||||
else
|
||||
MKDIR = mkdir $(subst /,\,$1)
|
||||
RMDIR = rmdir $(subst /,\,$1)
|
||||
RMFILES = $(if $1,del /f $(subst /,\,$1))
|
||||
endif
|
||||
COMMA := ,
|
||||
SPACE := $(N/A) $(N/A)
|
||||
define NEWLINE
|
||||
|
||||
|
||||
endef
|
||||
# Note: Do not remove any of the two empty lines above !
|
||||
|
||||
TARGETLIST := $(subst $(COMMA),$(SPACE),$(TARGETS))
|
||||
|
||||
ifeq ($(words $(TARGETLIST)),1)
|
||||
|
||||
# Set PROGRAM to something like 'myprog.c64'.
|
||||
override PROGRAM := $(PROGRAM).bin
|
||||
|
||||
# Set SOURCES to something like 'src/foo.c src/bar.s'.
|
||||
# Use of assembler files with names ending differently than .s is deprecated!
|
||||
SOURCES := $(wildcard $(SRCDIR)/*.c)
|
||||
SOURCES += $(wildcard $(SRCDIR)/*.s)
|
||||
SOURCES += $(wildcard $(SRCDIR)/*.asm)
|
||||
SOURCES += $(wildcard $(SRCDIR)/*.a65)
|
||||
|
||||
# Add to SOURCES something like 'src/c64/me.c src/c64/too.s'.
|
||||
# Use of assembler files with names ending differently than .s is deprecated!
|
||||
SOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.c)
|
||||
SOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.s)
|
||||
SOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.asm)
|
||||
SOURCES += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.a65)
|
||||
|
||||
# Set OBJECTS to something like 'obj/c64/foo.o obj/c64/bar.o'.
|
||||
OBJECTS := $(addsuffix .o,$(basename $(addprefix $(TARGETOBJDIR)/,$(notdir $(SOURCES)))))
|
||||
|
||||
# Set DEPENDS to something like 'obj/c64/foo.d obj/c64/bar.d'.
|
||||
DEPENDS := $(OBJECTS:.o=.d)
|
||||
|
||||
# Add to LIBS something like 'src/foo.lib src/c64/bar.lib'.
|
||||
LIBS += $(wildcard $(SRCDIR)/*.lib)
|
||||
LIBS += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.lib)
|
||||
|
||||
# Add to CONFIG something like 'src/c64/bar.cfg src/foo.cfg'.
|
||||
CONFIG += $(wildcard $(SRCDIR)/$(TARGETLIST)/*.cfg)
|
||||
CONFIG += $(wildcard $(SRCDIR)/*.cfg)
|
||||
|
||||
# Select CONFIG file to use. Target specific configs have higher priority.
|
||||
ifneq ($(word 2,$(CONFIG)),)
|
||||
CONFIG := $(firstword $(CONFIG))
|
||||
$(info Using config file $(CONFIG) for linking)
|
||||
endif
|
||||
|
||||
.SUFFIXES:
|
||||
.PHONY: all test clean zap love
|
||||
|
||||
all: $(PROGRAM)
|
||||
|
||||
-include $(DEPENDS)
|
||||
-include $(STATEFILE)
|
||||
|
||||
# If OPTIONS are given on the command line then save them to STATEFILE
|
||||
# if (and only if) they have actually changed. But if OPTIONS are not
|
||||
# given on the command line then load them from STATEFILE. Have object
|
||||
# files depend on STATEFILE only if it actually exists.
|
||||
ifeq ($(origin OPTIONS),command line)
|
||||
ifneq ($(OPTIONS),$(_OPTIONS_))
|
||||
ifeq ($(OPTIONS),)
|
||||
$(info Removing OPTIONS)
|
||||
$(shell $(RM) $(STATEFILE))
|
||||
$(eval $(STATEFILE):)
|
||||
else
|
||||
$(info Saving OPTIONS=$(OPTIONS))
|
||||
$(shell echo _OPTIONS_=$(OPTIONS) > $(STATEFILE))
|
||||
endif
|
||||
$(eval $(OBJECTS): $(STATEFILE))
|
||||
endif
|
||||
else
|
||||
ifeq ($(origin _OPTIONS_),file)
|
||||
$(info Using saved OPTIONS=$(_OPTIONS_))
|
||||
OPTIONS = $(_OPTIONS_)
|
||||
$(eval $(OBJECTS): $(STATEFILE))
|
||||
endif
|
||||
endif
|
||||
|
||||
# Transform the abstract OPTIONS to the actual cc65 options.
|
||||
$(foreach o,$(subst $(COMMA),$(SPACE),$(OPTIONS)),$(eval $(_$o_)))
|
||||
|
||||
# Strip potential variant suffix from the actual cc65 target.
|
||||
CC65TARGET := $(firstword $(subst .,$(SPACE),$(TARGETLIST)))
|
||||
|
||||
# The remaining targets.
|
||||
$(TARGETOBJDIR):
|
||||
$(call MKDIR,$@)
|
||||
|
||||
vpath %.c $(SRCDIR)/$(TARGETLIST) $(SRCDIR)
|
||||
|
||||
$(TARGETOBJDIR)/%.o: %.c | $(TARGETOBJDIR)
|
||||
$(CC) -t $(CC65TARGET) -c --create-dep $(@:.o=.d) $(CFLAGS) -o $@ $<
|
||||
|
||||
vpath %.s $(SRCDIR)/$(TARGETLIST) $(SRCDIR)
|
||||
|
||||
$(TARGETOBJDIR)/%.o: %.s | $(TARGETOBJDIR)
|
||||
$(CC) -t $(CC65TARGET) -c --create-dep $(@:.o=.d) $(ASFLAGS) -o $@ $<
|
||||
|
||||
vpath %.asm $(SRCDIR)/$(TARGETLIST) $(SRCDIR)
|
||||
|
||||
$(TARGETOBJDIR)/%.o: %.asm | $(TARGETOBJDIR)
|
||||
$(CC) -t $(CC65TARGET) -c --create-dep $(@:.o=.d) $(ASFLAGS) -o $@ $<
|
||||
|
||||
vpath %.a65 $(SRCDIR)/$(TARGETLIST) $(SRCDIR)
|
||||
|
||||
$(TARGETOBJDIR)/%.o: %.a65 | $(TARGETOBJDIR)
|
||||
$(CC) -t $(CC65TARGET) -c --create-dep $(@:.o=.d) $(ASFLAGS) -o $@ $<
|
||||
|
||||
$(PROGRAM): $(CONFIG) $(OBJECTS) $(LIBS)
|
||||
$(CC) -t $(CC65TARGET) $(LDFLAGS) -o $@ $(patsubst %.cfg,-C %.cfg,$^)
|
||||
|
||||
test: $(PROGRAM)
|
||||
$(PREEMUCMD)
|
||||
$(EMUCMD) $<
|
||||
$(POSTEMUCMD)
|
||||
|
||||
clean:
|
||||
$(call RMFILES,$(OBJECTS))
|
||||
$(call RMFILES,$(DEPENDS))
|
||||
$(call RMFILES,$(REMOVES))
|
||||
$(call RMFILES,$(PROGRAM))
|
||||
|
||||
else # $(words $(TARGETLIST)),1
|
||||
|
||||
all test clean:
|
||||
$(foreach t,$(TARGETLIST),$(MAKE) TARGETS=$t $@$(NEWLINE))
|
||||
|
||||
endif # $(words $(TARGETLIST)),1
|
||||
|
||||
OBJDIRLIST := $(wildcard $(OBJDIR)/*)
|
||||
|
||||
zap:
|
||||
$(foreach o,$(OBJDIRLIST),-$(call RMFILES,$o/*.o $o/*.d $o/*.lst)$(NEWLINE))
|
||||
$(foreach o,$(OBJDIRLIST),-$(call RMDIR,$o)$(NEWLINE))
|
||||
-$(call RMDIR,$(OBJDIR))
|
||||
-$(call RMFILES,$(basename $(PROGRAM)).* $(STATEFILE))
|
||||
|
||||
love:
|
||||
@echo "Not war, eh?"
|
||||
|
||||
###################################################################
|
||||
### Place your additional targets in the additional Makefiles ###
|
||||
### in the same directory - their names have to end with ".mk"! ###
|
||||
###################################################################
|
||||
-include *.mk
|
59
Software/src/Flasher.c
Normal file
59
Software/src/Flasher.c
Normal file
@ -0,0 +1,59 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <conio.h>
|
||||
#include <apple2enh.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
// Binary can't be larger than 2k
|
||||
char buffer[2048];
|
||||
char* pBuf = buffer;
|
||||
FILE* pFile;
|
||||
size_t fileSize;
|
||||
char slotNum;
|
||||
|
||||
videomode(VIDEOMODE_80COL);
|
||||
cprintf("AppleIISd firmware flasher\r");
|
||||
cprintf("(c) 2019 Florian Reitz\r\r");
|
||||
|
||||
// ask for slot
|
||||
cursor(1); // enable blinking cursor
|
||||
cprintf("Slot number (1-7): ");
|
||||
slotNum = cgetc();
|
||||
cursor(0); // disable blinking cursor
|
||||
|
||||
// check if slot is valid
|
||||
if((slotNum < 1) || (slotNum > 7))
|
||||
{
|
||||
cprintf("Invalid slot number!");
|
||||
return 1; // failure
|
||||
}
|
||||
|
||||
// open file
|
||||
pFile = fopen("AppleIISd.bin", "rb");
|
||||
if(pFile)
|
||||
{
|
||||
// read buffer
|
||||
fileSize = fread(buffer, sizeof(buffer), 1, pFile);
|
||||
|
||||
// enable write
|
||||
|
||||
// clear 0xCFFF
|
||||
*((char*)0xCFFF) = 0;
|
||||
|
||||
// write to SLOTROM
|
||||
|
||||
// write to EXTROM
|
||||
|
||||
// disable write
|
||||
}
|
||||
else
|
||||
{
|
||||
cprintf("Can't open binary file: %d\r", errno);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0; // success
|
||||
}
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
MODULE AddressDecoder_old
|
@ -1,275 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<drawing version="7">
|
||||
<attr value="xc9500xl" name="DeviceFamilyName">
|
||||
<trait delete="all:0" />
|
||||
<trait editname="all:0" />
|
||||
<trait edittrait="all:0" />
|
||||
</attr>
|
||||
<netlist>
|
||||
<signal name="A10" />
|
||||
<signal name="A9" />
|
||||
<signal name="A8" />
|
||||
<signal name="XLXN_10" />
|
||||
<signal name="CLK" />
|
||||
<signal name="XLXN_14" />
|
||||
<signal name="B10" />
|
||||
<signal name="B9" />
|
||||
<signal name="B8" />
|
||||
<signal name="NIO_SEL" />
|
||||
<signal name="NIO_STB" />
|
||||
<signal name="XLXN_38" />
|
||||
<signal name="XLXN_46" />
|
||||
<signal name="XLXN_47" />
|
||||
<signal name="NDEV_SEL" />
|
||||
<signal name="NOE" />
|
||||
<signal name="XLXN_53" />
|
||||
<signal name="RNW" />
|
||||
<signal name="XLXN_55" />
|
||||
<port polarity="Input" name="A10" />
|
||||
<port polarity="Input" name="A9" />
|
||||
<port polarity="Input" name="A8" />
|
||||
<port polarity="Input" name="CLK" />
|
||||
<port polarity="Output" name="B10" />
|
||||
<port polarity="Output" name="B9" />
|
||||
<port polarity="Output" name="B8" />
|
||||
<port polarity="Input" name="NIO_SEL" />
|
||||
<port polarity="Input" name="NIO_STB" />
|
||||
<port polarity="Input" name="NDEV_SEL" />
|
||||
<port polarity="Output" name="NOE" />
|
||||
<port polarity="Input" name="RNW" />
|
||||
<blockdef name="fdrs">
|
||||
<timestamp>2001-3-9T11:23:0</timestamp>
|
||||
<line x2="64" y1="-128" y2="-128" x1="0" />
|
||||
<line x2="64" y1="-256" y2="-256" x1="0" />
|
||||
<line x2="320" y1="-256" y2="-256" x1="384" />
|
||||
<line x2="64" y1="-32" y2="-32" x1="0" />
|
||||
<line x2="64" y1="-352" y2="-352" x1="0" />
|
||||
<rect width="256" x="64" y="-320" height="256" />
|
||||
<line x2="192" y1="-64" y2="-32" x1="192" />
|
||||
<line x2="64" y1="-32" y2="-32" x1="192" />
|
||||
<line x2="80" y1="-112" y2="-128" x1="64" />
|
||||
<line x2="64" y1="-128" y2="-144" x1="80" />
|
||||
<line x2="192" y1="-320" y2="-352" x1="192" />
|
||||
<line x2="64" y1="-352" y2="-352" x1="192" />
|
||||
</blockdef>
|
||||
<blockdef name="inv">
|
||||
<timestamp>2001-3-9T11:23:50</timestamp>
|
||||
<line x2="64" y1="-32" y2="-32" x1="0" />
|
||||
<line x2="160" y1="-32" y2="-32" x1="224" />
|
||||
<line x2="128" y1="-64" y2="-32" x1="64" />
|
||||
<line x2="64" y1="-32" y2="0" x1="128" />
|
||||
<line x2="64" y1="0" y2="-64" x1="64" />
|
||||
<circle r="16" cx="144" cy="-32" />
|
||||
</blockdef>
|
||||
<blockdef name="vcc">
|
||||
<timestamp>2001-3-9T11:23:11</timestamp>
|
||||
<line x2="32" y1="-64" y2="-64" x1="96" />
|
||||
<line x2="64" y1="0" y2="-32" x1="64" />
|
||||
<line x2="64" y1="-32" y2="-64" x1="64" />
|
||||
</blockdef>
|
||||
<blockdef name="and2">
|
||||
<timestamp>2001-5-11T10:41:37</timestamp>
|
||||
<line x2="64" y1="-64" y2="-64" x1="0" />
|
||||
<line x2="64" y1="-128" y2="-128" x1="0" />
|
||||
<line x2="192" y1="-96" y2="-96" x1="256" />
|
||||
<arc ex="144" ey="-144" sx="144" sy="-48" r="48" cx="144" cy="-96" />
|
||||
<line x2="64" y1="-48" y2="-48" x1="144" />
|
||||
<line x2="144" y1="-144" y2="-144" x1="64" />
|
||||
<line x2="64" y1="-48" y2="-144" x1="64" />
|
||||
</blockdef>
|
||||
<blockdef name="and4">
|
||||
<timestamp>2001-5-11T10:43:14</timestamp>
|
||||
<line x2="64" y1="-112" y2="-112" x1="144" />
|
||||
<arc ex="144" ey="-208" sx="144" sy="-112" r="48" cx="144" cy="-160" />
|
||||
<line x2="144" y1="-208" y2="-208" x1="64" />
|
||||
<line x2="64" y1="-64" y2="-256" x1="64" />
|
||||
<line x2="192" y1="-160" y2="-160" x1="256" />
|
||||
<line x2="64" y1="-256" y2="-256" x1="0" />
|
||||
<line x2="64" y1="-192" y2="-192" x1="0" />
|
||||
<line x2="64" y1="-128" y2="-128" x1="0" />
|
||||
<line x2="64" y1="-64" y2="-64" x1="0" />
|
||||
</blockdef>
|
||||
<blockdef name="nand2">
|
||||
<timestamp>2001-3-9T11:23:50</timestamp>
|
||||
<line x2="64" y1="-64" y2="-64" x1="0" />
|
||||
<line x2="64" y1="-128" y2="-128" x1="0" />
|
||||
<line x2="216" y1="-96" y2="-96" x1="256" />
|
||||
<circle r="12" cx="204" cy="-96" />
|
||||
<line x2="64" y1="-48" y2="-144" x1="64" />
|
||||
<line x2="144" y1="-144" y2="-144" x1="64" />
|
||||
<line x2="64" y1="-48" y2="-48" x1="144" />
|
||||
<arc ex="144" ey="-144" sx="144" sy="-48" r="48" cx="144" cy="-96" />
|
||||
</blockdef>
|
||||
<blockdef name="or2">
|
||||
<timestamp>2000-1-1T10:10:10</timestamp>
|
||||
<line x2="64" y1="-64" y2="-64" x1="0" />
|
||||
<line x2="64" y1="-128" y2="-128" x1="0" />
|
||||
<line x2="192" y1="-96" y2="-96" x1="256" />
|
||||
<arc ex="192" ey="-96" sx="112" sy="-48" r="88" cx="116" cy="-136" />
|
||||
<arc ex="48" ey="-144" sx="48" sy="-48" r="56" cx="16" cy="-96" />
|
||||
<line x2="48" y1="-144" y2="-144" x1="112" />
|
||||
<arc ex="112" ey="-144" sx="192" sy="-96" r="88" cx="116" cy="-56" />
|
||||
<line x2="48" y1="-48" y2="-48" x1="112" />
|
||||
</blockdef>
|
||||
<block symbolname="fdrs" name="XLXI_16">
|
||||
<blockpin signalname="CLK" name="C" />
|
||||
<blockpin signalname="XLXN_14" name="D" />
|
||||
<blockpin signalname="XLXN_10" name="R" />
|
||||
<blockpin signalname="XLXN_46" name="S" />
|
||||
<blockpin signalname="XLXN_47" name="Q" />
|
||||
</block>
|
||||
<block symbolname="vcc" name="XLXI_17">
|
||||
<blockpin signalname="XLXN_14" name="P" />
|
||||
</block>
|
||||
<block symbolname="and2" name="XLXI_18">
|
||||
<blockpin signalname="A10" name="I0" />
|
||||
<blockpin signalname="XLXN_38" name="I1" />
|
||||
<blockpin signalname="B10" name="O" />
|
||||
</block>
|
||||
<block symbolname="and2" name="XLXI_19">
|
||||
<blockpin signalname="A9" name="I0" />
|
||||
<blockpin signalname="XLXN_38" name="I1" />
|
||||
<blockpin signalname="B9" name="O" />
|
||||
</block>
|
||||
<block symbolname="and2" name="XLXI_20">
|
||||
<blockpin signalname="A8" name="I0" />
|
||||
<blockpin signalname="XLXN_38" name="I1" />
|
||||
<blockpin signalname="B8" name="O" />
|
||||
</block>
|
||||
<block symbolname="inv" name="XLXI_22">
|
||||
<blockpin signalname="NIO_SEL" name="I" />
|
||||
<blockpin signalname="XLXN_46" name="O" />
|
||||
</block>
|
||||
<block symbolname="and4" name="XLXI_30">
|
||||
<blockpin signalname="A8" name="I0" />
|
||||
<blockpin signalname="A9" name="I1" />
|
||||
<blockpin signalname="A10" name="I2" />
|
||||
<blockpin signalname="XLXN_38" name="I3" />
|
||||
<blockpin signalname="XLXN_10" name="O" />
|
||||
</block>
|
||||
<block symbolname="inv" name="XLXI_31">
|
||||
<blockpin signalname="NIO_STB" name="I" />
|
||||
<blockpin signalname="XLXN_38" name="O" />
|
||||
</block>
|
||||
<block symbolname="nand2" name="XLXI_32">
|
||||
<blockpin signalname="XLXN_47" name="I0" />
|
||||
<blockpin signalname="NDEV_SEL" name="I1" />
|
||||
<blockpin signalname="XLXN_55" name="O" />
|
||||
</block>
|
||||
<block symbolname="inv" name="XLXI_33">
|
||||
<blockpin signalname="RNW" name="I" />
|
||||
<blockpin signalname="XLXN_53" name="O" />
|
||||
</block>
|
||||
<block symbolname="or2" name="XLXI_34">
|
||||
<blockpin signalname="XLXN_55" name="I0" />
|
||||
<blockpin signalname="XLXN_53" name="I1" />
|
||||
<blockpin signalname="NOE" name="O" />
|
||||
</block>
|
||||
</netlist>
|
||||
<sheet sheetnum="1" width="3520" height="2720">
|
||||
<branch name="A10">
|
||||
<wire x2="592" y1="704" y2="704" x1="320" />
|
||||
<wire x2="704" y1="704" y2="704" x1="592" />
|
||||
<wire x2="592" y1="704" y2="992" x1="592" />
|
||||
<wire x2="1088" y1="992" y2="992" x1="592" />
|
||||
</branch>
|
||||
<branch name="A9">
|
||||
<wire x2="528" y1="768" y2="768" x1="320" />
|
||||
<wire x2="704" y1="768" y2="768" x1="528" />
|
||||
<wire x2="528" y1="768" y2="1136" x1="528" />
|
||||
<wire x2="1088" y1="1136" y2="1136" x1="528" />
|
||||
</branch>
|
||||
<branch name="A8">
|
||||
<wire x2="464" y1="832" y2="832" x1="320" />
|
||||
<wire x2="704" y1="832" y2="832" x1="464" />
|
||||
<wire x2="464" y1="832" y2="1280" x1="464" />
|
||||
<wire x2="1088" y1="1280" y2="1280" x1="464" />
|
||||
</branch>
|
||||
<iomarker fontsize="28" x="320" y="704" name="A10" orien="R180" />
|
||||
<iomarker fontsize="28" x="320" y="768" name="A9" orien="R180" />
|
||||
<iomarker fontsize="28" x="320" y="832" name="A8" orien="R180" />
|
||||
<branch name="CLK">
|
||||
<wire x2="912" y1="576" y2="576" x1="320" />
|
||||
<wire x2="912" y1="576" y2="640" x1="912" />
|
||||
<wire x2="992" y1="640" y2="640" x1="912" />
|
||||
</branch>
|
||||
<branch name="B10">
|
||||
<wire x2="1664" y1="960" y2="960" x1="1344" />
|
||||
</branch>
|
||||
<branch name="B9">
|
||||
<wire x2="1664" y1="1104" y2="1104" x1="1344" />
|
||||
</branch>
|
||||
<branch name="B8">
|
||||
<wire x2="1664" y1="1248" y2="1248" x1="1344" />
|
||||
</branch>
|
||||
<branch name="NIO_SEL">
|
||||
<wire x2="352" y1="368" y2="368" x1="320" />
|
||||
</branch>
|
||||
<branch name="NIO_STB">
|
||||
<wire x2="336" y1="640" y2="640" x1="320" />
|
||||
</branch>
|
||||
<iomarker fontsize="28" x="320" y="368" name="NIO_SEL" orien="R180" />
|
||||
<iomarker fontsize="28" x="320" y="640" name="NIO_STB" orien="R180" />
|
||||
<instance x="336" y="672" name="XLXI_31" orien="R0" />
|
||||
<branch name="XLXN_38">
|
||||
<wire x2="672" y1="640" y2="640" x1="560" />
|
||||
<wire x2="704" y1="640" y2="640" x1="672" />
|
||||
<wire x2="672" y1="640" y2="928" x1="672" />
|
||||
<wire x2="1088" y1="928" y2="928" x1="672" />
|
||||
<wire x2="672" y1="928" y2="1072" x1="672" />
|
||||
<wire x2="1088" y1="1072" y2="1072" x1="672" />
|
||||
<wire x2="672" y1="1072" y2="1216" x1="672" />
|
||||
<wire x2="1088" y1="1216" y2="1216" x1="672" />
|
||||
</branch>
|
||||
<instance x="704" y="896" name="XLXI_30" orien="R0" />
|
||||
<branch name="XLXN_10">
|
||||
<wire x2="992" y1="736" y2="736" x1="960" />
|
||||
</branch>
|
||||
<branch name="XLXN_14">
|
||||
<wire x2="848" y1="496" y2="512" x1="848" />
|
||||
<wire x2="992" y1="512" y2="512" x1="848" />
|
||||
</branch>
|
||||
<iomarker fontsize="28" x="320" y="576" name="CLK" orien="R180" />
|
||||
<instance x="784" y="496" name="XLXI_17" orien="R0" />
|
||||
<instance x="352" y="400" name="XLXI_22" orien="R0" />
|
||||
<branch name="XLXN_46">
|
||||
<wire x2="992" y1="368" y2="368" x1="576" />
|
||||
<wire x2="992" y1="368" y2="416" x1="992" />
|
||||
</branch>
|
||||
<instance x="992" y="768" name="XLXI_16" orien="R0" />
|
||||
<instance x="1088" y="1056" name="XLXI_18" orien="R0" />
|
||||
<instance x="1088" y="1200" name="XLXI_19" orien="R0" />
|
||||
<instance x="1088" y="1344" name="XLXI_20" orien="R0" />
|
||||
<iomarker fontsize="28" x="1664" y="960" name="B10" orien="R0" />
|
||||
<iomarker fontsize="28" x="1664" y="1104" name="B9" orien="R0" />
|
||||
<iomarker fontsize="28" x="1664" y="1248" name="B8" orien="R0" />
|
||||
<instance x="1424" y="432" name="XLXI_32" orien="R0" />
|
||||
<branch name="XLXN_47">
|
||||
<wire x2="1392" y1="512" y2="512" x1="1376" />
|
||||
<wire x2="1424" y1="368" y2="368" x1="1392" />
|
||||
<wire x2="1392" y1="368" y2="512" x1="1392" />
|
||||
</branch>
|
||||
<branch name="NDEV_SEL">
|
||||
<wire x2="1424" y1="304" y2="304" x1="320" />
|
||||
</branch>
|
||||
<iomarker fontsize="28" x="320" y="304" name="NDEV_SEL" orien="R180" />
|
||||
<instance x="352" y="272" name="XLXI_33" orien="R0" />
|
||||
<branch name="NOE">
|
||||
<wire x2="2016" y1="272" y2="272" x1="2000" />
|
||||
</branch>
|
||||
<branch name="XLXN_53">
|
||||
<wire x2="1744" y1="240" y2="240" x1="576" />
|
||||
</branch>
|
||||
<branch name="RNW">
|
||||
<wire x2="352" y1="240" y2="240" x1="320" />
|
||||
</branch>
|
||||
<iomarker fontsize="28" x="320" y="240" name="RNW" orien="R180" />
|
||||
<instance x="1744" y="368" name="XLXI_34" orien="R0" />
|
||||
<branch name="XLXN_55">
|
||||
<wire x2="1696" y1="336" y2="336" x1="1680" />
|
||||
<wire x2="1744" y1="304" y2="304" x1="1696" />
|
||||
<wire x2="1696" y1="304" y2="336" x1="1696" />
|
||||
</branch>
|
||||
<iomarker fontsize="28" x="2016" y="272" name="NOE" orien="R0" />
|
||||
</sheet>
|
||||
</drawing>
|
@ -1,172 +0,0 @@
|
||||
--------------------------------------------------------------------------------
|
||||
-- Company:
|
||||
-- Engineer:
|
||||
--
|
||||
-- Create Date: 23:42:22 10/10/2017
|
||||
-- Design Name:
|
||||
-- Module Name: C:/Git/AppleIISd/VHDL/AddressDecoder_Test.vhd
|
||||
-- Project Name: AppleIISd
|
||||
-- Target Device:
|
||||
-- Tool versions:
|
||||
-- Description:
|
||||
--
|
||||
-- VHDL Test Bench Created by ISE for module: AddressDecoder
|
||||
--
|
||||
-- Dependencies:
|
||||
--
|
||||
-- Revision:
|
||||
-- Revision 0.01 - File Created
|
||||
-- Additional Comments:
|
||||
--
|
||||
-- Notes:
|
||||
-- This testbench has been automatically generated using types std_logic and
|
||||
-- std_logic_vector for the ports of the unit under test. Xilinx recommends
|
||||
-- that these types always be used for the top-level I/O of a design in order
|
||||
-- to guarantee that the testbench will bind correctly to the post-implementation
|
||||
-- simulation model.
|
||||
--------------------------------------------------------------------------------
|
||||
LIBRARY ieee;
|
||||
USE ieee.std_logic_1164.ALL;
|
||||
|
||||
-- Uncomment the following library declaration if using
|
||||
-- arithmetic functions with Signed or Unsigned values
|
||||
--USE ieee.numeric_std.ALL;
|
||||
|
||||
ENTITY AddressDecoder_old_Test IS
|
||||
END AddressDecoder_old_Test;
|
||||
|
||||
ARCHITECTURE behavior OF AddressDecoder_old_Test IS
|
||||
|
||||
-- Component Declaration for the Unit Under Test (UUT)
|
||||
|
||||
COMPONENT AddressDecoder_old
|
||||
PORT(
|
||||
A8 : IN std_logic;
|
||||
A9 : IN std_logic;
|
||||
A10 : IN std_logic;
|
||||
B8 : OUT std_logic;
|
||||
B9 : OUT std_logic;
|
||||
B10 : OUT std_logic;
|
||||
RNW : IN std_logic;
|
||||
CLK : IN std_logic;
|
||||
NDEV_SEL : IN std_logic;
|
||||
NIO_SEL : IN std_logic;
|
||||
NIO_STB : IN std_logic;
|
||||
NOE : OUT std_logic
|
||||
);
|
||||
END COMPONENT;
|
||||
|
||||
|
||||
--Inputs
|
||||
signal A : std_logic_vector(10 downto 8) := "101";
|
||||
signal RNW : std_logic := '1';
|
||||
signal NDEV_SEL : std_logic := '1';
|
||||
signal NIO_SEL : std_logic := '1';
|
||||
signal NIO_STB : std_logic := '1';
|
||||
signal NRESET : std_logic := '1';
|
||||
signal CLK : std_logic := '0';
|
||||
signal PHI0 : std_logic := '1';
|
||||
|
||||
--Outputs
|
||||
signal B : std_logic_vector(10 downto 8);
|
||||
signal DATA_EN : std_logic;
|
||||
signal NG : std_logic;
|
||||
signal NOE : std_logic;
|
||||
|
||||
-- Clock period definitions
|
||||
constant CLK_period : time := 142 ns;
|
||||
|
||||
BEGIN
|
||||
|
||||
-- Instantiate the Unit Under Test (UUT)
|
||||
uut: AddressDecoder_old PORT MAP (
|
||||
A8 => A(8),
|
||||
A9 => A(9),
|
||||
A10 => A(10),
|
||||
B8 => B(8),
|
||||
B9 => B(9),
|
||||
B10 => B(10),
|
||||
RNW => RNW,
|
||||
CLK => CLK,
|
||||
NDEV_SEL => NDEV_SEL,
|
||||
NIO_SEL => NIO_SEL,
|
||||
NIO_STB => NIO_STB,
|
||||
NOE => NOE
|
||||
);
|
||||
|
||||
-- Clock process definitions
|
||||
CLK_process :process
|
||||
begin
|
||||
CLK <= '0';
|
||||
wait for CLK_period/2;
|
||||
CLK <= '1';
|
||||
wait for CLK_period/2;
|
||||
end process;
|
||||
|
||||
PHI0_process :process(CLK)
|
||||
variable counter : integer range 0 to 7;
|
||||
begin
|
||||
if rising_edge(CLK) or falling_edge(CLK) then
|
||||
counter := counter + 1;
|
||||
if counter = 7 then
|
||||
PHI0 <= not PHI0;
|
||||
counter := 0;
|
||||
end if;
|
||||
end if;
|
||||
end process;
|
||||
|
||||
-- Stimulus process
|
||||
stim_proc: process
|
||||
begin
|
||||
-- hold reset state.
|
||||
wait for CLK_period * 10;
|
||||
NRESET <= '0';
|
||||
wait for CLK_period * 20;
|
||||
NRESET <= '1';
|
||||
wait for CLK_period * 10;
|
||||
|
||||
-- insert stimulus here
|
||||
-- CPLD access
|
||||
wait until rising_edge(PHI0);
|
||||
NDEV_SEL <= '0';
|
||||
wait until falling_edge(PHI0);
|
||||
NDEV_SEL <= '1';
|
||||
wait until rising_edge(PHI0);
|
||||
wait until rising_edge(PHI0);
|
||||
-- CnXX access
|
||||
NIO_SEL <= '0';
|
||||
wait until falling_edge(PHI0);
|
||||
NIO_SEL <= '1';
|
||||
wait until rising_edge(PHI0);
|
||||
wait until rising_edge(PHI0);
|
||||
-- C8xx access, selected
|
||||
NIO_STB <= '0';
|
||||
wait until falling_edge(PHI0);
|
||||
NIO_STB <= '1';
|
||||
wait until rising_edge(PHI0);
|
||||
wait until rising_edge(PHI0);
|
||||
-- CPLD access
|
||||
NDEV_SEL <= '0';
|
||||
wait until falling_edge(PHI0);
|
||||
NDEV_SEL <= '1';
|
||||
wait until rising_edge(PHI0);
|
||||
wait until rising_edge(PHI0);
|
||||
-- CFFF access
|
||||
A <= "111";
|
||||
NIO_STB <= '0';
|
||||
wait until falling_edge(PHI0);
|
||||
A <= "000";
|
||||
NIO_STB <= '1';
|
||||
wait until rising_edge(PHI0);
|
||||
wait until rising_edge(PHI0);
|
||||
-- C8xx access, unselected
|
||||
NIO_STB <= '0';
|
||||
wait until falling_edge(PHI0);
|
||||
NIO_STB <= '1';
|
||||
wait until rising_edge(PHI0);
|
||||
wait until rising_edge(PHI0);
|
||||
|
||||
wait;
|
||||
end process;
|
||||
|
||||
END;
|
Loading…
Reference in New Issue
Block a user