diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..11224a9 --- /dev/null +++ b/Makefile @@ -0,0 +1,647 @@ +# Hey Emacs, this is a -*- makefile -*- +#---------------------------------------------------------------------------- +# WinAVR Makefile Template written by Eric B. Weddington, J?rg Wunsch, et al. +# +# Released to the Public Domain +# +# Additional material for this makefile was written by: +# Peter Fleury +# Tim Henigan +# Colin O'Flynn +# Reiner Patommel +# Markus Pfaff +# Sander Pool +# Frederik Rouleau +# Carlos Lamas +# +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device, using avrdude. +# Please customize the avrdude settings below first! +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + + +# MCU name +MCU = atmega328p + + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# Typical values are: +# F_CPU = 1000000 +# F_CPU = 1843200 +# F_CPU = 2000000 +# F_CPU = 3686400 +# F_CPU = 4000000 +# F_CPU = 7372800 +# F_CPU = 8000000 +# F_CPU = 11059200 +# F_CPU = 14745600 +# F_CPU = 16000000 +# F_CPU = 18432000 +# F_CPU = 20000000 +F_CPU = 27000000 + + +# Output format. (can be srec, ihex, binary) +FORMAT = ihex + + +# Target file name (without extension). +TARGET = sdisk2 + + +# Object files directory +# To put object files in current directory, use a dot (.), do NOT make +# this an empty or blank macro! +OBJDIR = . + + +# List C source files here. (C dependencies are automatically generated.) +SRC = $(TARGET).c + + +# List C++ source files here. (C dependencies are automatically generated.) +CPPSRC = + + +# List Assembler source files here. +# Make them always end in a capital .S. Files ending in a lowercase .s +# will not be considered source files but generated files (assembler +# output from the compiler), and will be deleted upon "make clean"! +# Even though the DOS/Win* filesystem matches both .s and .S the same, +# it will preserve the spelling of the filenames, and gcc itself does +# care about how the name is spelled on its command-line. +ASRC = sub.S + + +# Optimization level, can be [0, 1, 2, 3, s]. +# 0 = turn off optimization. s = optimize for size. +# (Note: 3 is not always the best optimization level. See avr-libc FAQ.) +OPT = 3 + + +# Debugging format. +# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs. +# AVR Studio 4.10 requires dwarf-2. +# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run. +DEBUG = dwarf-2 + + +# List any extra directories to look for include files here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRAINCDIRS = + + +# Compiler flag to set the C Standard level. +# c89 = "ANSI" C +# gnu89 = c89 plus GCC extensions +# c99 = ISO C99 standard (not yet fully implemented) +# gnu99 = c99 plus GCC extensions +CSTANDARD = -std=gnu99 + + +# Place -D or -U options here for C sources +CDEFS = -DF_CPU=$(F_CPU)UL + + +# Place -D or -U options here for ASM sources +ADEFS = -DF_CPU=$(F_CPU) + + +# Place -D or -U options here for C++ sources +CPPDEFS = -DF_CPU=$(F_CPU)UL +#CPPDEFS += -D__STDC_LIMIT_MACROS +#CPPDEFS += -D__STDC_CONSTANT_MACROS + + + +#---------------- Compiler Options C ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CFLAGS = -g$(DEBUG) +CFLAGS += $(CDEFS) +CFLAGS += -O$(OPT) +CFLAGS += -funsigned-char +CFLAGS += -funsigned-bitfields +CFLAGS += -fpack-struct +CFLAGS += -fshort-enums +CFLAGS += -Wall +CFLAGS += -Wstrict-prototypes +#CFLAGS += -mshort-calls +#CFLAGS += -fno-unit-at-a-time +#CFLAGS += -Wundef +#CFLAGS += -Wunreachable-code +#CFLAGS += -Wsign-compare +CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) +CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +CFLAGS += $(CSTANDARD) + + +#---------------- Compiler Options C++ ---------------- +# -g*: generate debugging information +# -O*: optimization level +# -f...: tuning, see GCC manual and avr-libc documentation +# -Wall...: warning level +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns...: create assembler listing +CPPFLAGS = -g$(DEBUG) +CPPFLAGS += $(CPPDEFS) +CPPFLAGS += -O$(OPT) +CPPFLAGS += -funsigned-char +CPPFLAGS += -funsigned-bitfields +CPPFLAGS += -fpack-struct +CPPFLAGS += -fshort-enums +CPPFLAGS += -fno-exceptions +CPPFLAGS += -Wall +CPPFLAGS += -Wundef +#CPPFLAGS += -mshort-calls +#CPPFLAGS += -fno-unit-at-a-time +#CPPFLAGS += -Wstrict-prototypes +#CPPFLAGS += -Wunreachable-code +#CPPFLAGS += -Wsign-compare +CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst) +CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) +#CPPFLAGS += $(CSTANDARD) + + +#---------------- Assembler Options ---------------- +# -Wa,...: tell GCC to pass this to the assembler. +# -adhlns: create listing +# -gstabs: have the assembler create line number information; note that +# for use in COFF files, additional information about filenames +# and function names needs to be present in the assembler source +# files -- see avr-libc docs [FIXME: not yet described there] +# -listing-cont-lines: Sets the maximum number of continuation lines of hex +# dump that will be displayed for a given single line of source input. +ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100 + + +#---------------- Library Options ---------------- +# Minimalistic printf version +PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min + +# Floating point printf version (requires MATH_LIB = -lm below) +PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt + +# If this is left blank, then it will use the Standard printf version. +PRINTF_LIB = +#PRINTF_LIB = $(PRINTF_LIB_MIN) +#PRINTF_LIB = $(PRINTF_LIB_FLOAT) + + +# Minimalistic scanf version +SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min + +# Floating point + %[ scanf version (requires MATH_LIB = -lm below) +SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt + +# If this is left blank, then it will use the Standard scanf version. +SCANF_LIB = +#SCANF_LIB = $(SCANF_LIB_MIN) +#SCANF_LIB = $(SCANF_LIB_FLOAT) + + +MATH_LIB = -lm + + +# List any extra directories to look for libraries here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRALIBDIRS = + + + +#---------------- External Memory Options ---------------- + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# used for variables (.data/.bss) and heap (malloc()). +#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# only used for heap (malloc()). +#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff + +EXTMEMOPTS = + + + +#---------------- Linker Options ---------------- +# -Wl,...: tell GCC to pass this to linker. +# -Map: create map file +# --cref: add cross reference to map file +LDFLAGS = -Wl,-Map=$(TARGET).map,--cref +LDFLAGS += $(EXTMEMOPTS) +LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS)) +LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) +#LDFLAGS += -T linker_script.x + + + +#---------------- Programming Options (avrdude) ---------------- + +# Programming hardware +# Type: avrdude -c ? +# to get a full listing. +# +AVRDUDE_PROGRAMMER = stk500v2 + +# com1 = serial port. Use lpt1 to connect to parallel port. +AVRDUDE_PORT = com1 # programmer connected to serial device + +AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex +#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep + + +# Uncomment the following if you want avrdude's erase cycle counter. +# Note that this counter needs to be initialized first using -Yn, +# see avrdude manual. +#AVRDUDE_ERASE_COUNTER = -y + +# Uncomment the following if you do /not/ wish a verification to be +# performed after programming the device. +#AVRDUDE_NO_VERIFY = -V + +# Increase verbosity level. Please use this when submitting bug +# reports about avrdude. See +# to submit bug reports. +#AVRDUDE_VERBOSE = -v -v + +AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) +AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) +AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) +AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) + + + +#---------------- Debugging Options ---------------- + +# For simulavr only - target MCU frequency. +DEBUG_MFREQ = $(F_CPU) + +# Set the DEBUG_UI to either gdb or insight. +# DEBUG_UI = gdb +DEBUG_UI = insight + +# Set the debugging back-end to either avarice, simulavr. +DEBUG_BACKEND = avarice +#DEBUG_BACKEND = simulavr + +# GDB Init Filename. +GDBINIT_FILE = __avr_gdbinit + +# When using avarice settings for the JTAG +JTAG_DEV = /dev/com1 + +# Debugging port used to communicate between GDB / avarice / simulavr. +DEBUG_PORT = 4242 + +# Debugging host used to communicate between GDB / avarice / simulavr, normally +# just set to localhost unless doing some sort of crazy debugging when +# avarice is running on a different computer. +DEBUG_HOST = localhost + + + +#============================================================================ + + +# Define programs and commands. +SHELL = sh +CC = avr-gcc +OBJCOPY = avr-objcopy +OBJDUMP = avr-objdump +SIZE = avr-size +AR = avr-ar rcs +NM = avr-nm +AVRDUDE = avrdude +REMOVE = rm -f +REMOVEDIR = rm -rf +COPY = cp +WINSHELL = cmd + + +# Define Messages +# English +MSG_ERRORS_NONE = Errors: none +MSG_BEGIN = -------- begin -------- +MSG_END = -------- end -------- +MSG_SIZE_BEFORE = Size before: +MSG_SIZE_AFTER = Size after: +MSG_COFF = Converting to AVR COFF: +MSG_EXTENDED_COFF = Converting to AVR Extended COFF: +MSG_FLASH = Creating load file for Flash: +MSG_EEPROM = Creating load file for EEPROM: +MSG_EXTENDED_LISTING = Creating Extended Listing: +MSG_SYMBOL_TABLE = Creating Symbol Table: +MSG_LINKING = Linking: +MSG_COMPILING = Compiling C: +MSG_COMPILING_CPP = Compiling C++: +MSG_ASSEMBLING = Assembling: +MSG_CLEANING = Cleaning project: +MSG_CREATING_LIBRARY = Creating library: + + + + +# Define all object files. +OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o) + +# Define all listing files. +LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst) + + +# Compiler flags to generate dependency files. +GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d + + +# Combine all necessary flags and optional flags. +# Add target processor to flags. +ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) +ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) +ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) + + + + + +# Default target. +all: begin gccversion sizebefore build sizeafter end + +# Change the build target to build a HEX file or a library. +build: elf hex eep lss sym +#build: lib + + +elf: $(TARGET).elf +hex: $(TARGET).hex +eep: $(TARGET).eep +lss: $(TARGET).lss +sym: $(TARGET).sym +LIBNAME=lib$(TARGET).a +lib: $(LIBNAME) + + + +# Eye candy. +# AVR Studio 3.x does not check make's exit code but relies on +# the following magic strings to be generated by the compile job. +begin: + @echo + @echo $(MSG_BEGIN) + +end: + @echo $(MSG_END) + @echo + + +# Display size of file. +HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex +ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf + +sizebefore: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \ + 2>/dev/null; echo; fi + +sizeafter: + @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \ + 2>/dev/null; echo; fi + + + +# Display compiler version information. +gccversion : + @$(CC) --version + + + +# Program the device. +program: $(TARGET).hex $(TARGET).eep + $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) + + +# Generate avr-gdb config/init file which does the following: +# define the reset signal, load the target file, connect to target, and set +# a breakpoint at main(). +gdb-config: + @$(REMOVE) $(GDBINIT_FILE) + @echo define reset >> $(GDBINIT_FILE) + @echo SIGNAL SIGHUP >> $(GDBINIT_FILE) + @echo end >> $(GDBINIT_FILE) + @echo file $(TARGET).elf >> $(GDBINIT_FILE) + @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE) +ifeq ($(DEBUG_BACKEND),simulavr) + @echo load >> $(GDBINIT_FILE) +endif + @echo break main >> $(GDBINIT_FILE) + +debug: gdb-config $(TARGET).elf +ifeq ($(DEBUG_BACKEND), avarice) + @echo Starting AVaRICE - Press enter when "waiting to connect" message displays. + @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \ + $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT) + @$(WINSHELL) /c pause + +else + @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \ + $(DEBUG_MFREQ) --port $(DEBUG_PORT) +endif + @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE) + + + + +# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. +COFFCONVERT = $(OBJCOPY) --debugging +COFFCONVERT += --change-section-address .data-0x800000 +COFFCONVERT += --change-section-address .bss-0x800000 +COFFCONVERT += --change-section-address .noinit-0x800000 +COFFCONVERT += --change-section-address .eeprom-0x810000 + + + +coff: $(TARGET).elf + @echo + @echo $(MSG_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-avr $< $(TARGET).cof + + +extcoff: $(TARGET).elf + @echo + @echo $(MSG_EXTENDED_COFF) $(TARGET).cof + $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof + + + +# Create final output files (.hex, .eep) from ELF output file. +%.hex: %.elf + @echo + @echo $(MSG_FLASH) $@ + $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock $< $@ + +%.eep: %.elf + @echo + @echo $(MSG_EEPROM) $@ + -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ + --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0 + +# Create extended listing file from ELF output file. +%.lss: %.elf + @echo + @echo $(MSG_EXTENDED_LISTING) $@ + $(OBJDUMP) -h -S -z $< > $@ + +# Create a symbol table from ELF output file. +%.sym: %.elf + @echo + @echo $(MSG_SYMBOL_TABLE) $@ + $(NM) -n $< > $@ + + + +# Create library from object files. +.SECONDARY : $(TARGET).a +.PRECIOUS : $(OBJ) +%.a: $(OBJ) + @echo + @echo $(MSG_CREATING_LIBRARY) $@ + $(AR) $@ $(OBJ) + + +# Link: create ELF output file from object files. +.SECONDARY : $(TARGET).elf +.PRECIOUS : $(OBJ) +%.elf: $(OBJ) + @echo + @echo $(MSG_LINKING) $@ + $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS) + + +# Compile: create object files from C source files. +$(OBJDIR)/%.o : %.c + @echo + @echo $(MSG_COMPILING) $< + $(CC) -c $(ALL_CFLAGS) $< -o $@ + + +# Compile: create object files from C++ source files. +$(OBJDIR)/%.o : %.cpp + @echo + @echo $(MSG_COMPILING_CPP) $< + $(CC) -c $(ALL_CPPFLAGS) $< -o $@ + + +# Compile: create assembler files from C source files. +%.s : %.c + $(CC) -S $(ALL_CFLAGS) $< -o $@ + + +# Compile: create assembler files from C++ source files. +%.s : %.cpp + $(CC) -S $(ALL_CPPFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. +$(OBJDIR)/%.o : %.S + @echo + @echo $(MSG_ASSEMBLING) $< + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + +# Create preprocessed source for use in sending a bug report. +%.i : %.c + $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@ + + +# Target: clean project. +clean: begin clean_list end + +clean_list : + @echo + @echo $(MSG_CLEANING) + $(REMOVE) $(TARGET).hex + $(REMOVE) $(TARGET).eep + $(REMOVE) $(TARGET).cof + $(REMOVE) $(TARGET).elf + $(REMOVE) $(TARGET).map + $(REMOVE) $(TARGET).sym + $(REMOVE) $(TARGET).lss + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o) + $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst) + $(REMOVE) $(SRC:.c=.s) + $(REMOVE) $(SRC:.c=.d) + $(REMOVE) $(SRC:.c=.i) + $(REMOVEDIR) .dep + + +# Create object files directory +$(shell mkdir $(OBJDIR) 2>/dev/null) + + +# Include the dependency files. +-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) + + +# Listing of phony targets. +.PHONY : all begin finish end sizebefore sizeafter gccversion \ +build elf hex eep lss sym coff extcoff \ +clean clean_list program debug gdb-config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SDISK2SCH.PNG b/SDISK2SCH.PNG new file mode 100644 index 0000000..c7431f2 Binary files /dev/null and b/SDISK2SCH.PNG differ diff --git a/gpl.txt b/gpl.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/gpl.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/sdisk2.c b/sdisk2.c new file mode 100644 index 0000000..478fa78 --- /dev/null +++ b/sdisk2.c @@ -0,0 +1,1143 @@ +/*------------------------------------------------------ + + DISK II Emulator Farmware (1 of 2) for ATMEGA328P + + original: 2009.11.16 by Koichi Nishida + version 1.3 2011. 1.28 by Koichi Nishida + +------------------------------------------------------*/ + +/* +if the crystal on your SDISK II is 25 MHz, +I recommend you to replace it with 27 MHz, +or ask Nishida Radio. +see also sub.S +*/ + +/* +hardware information: + +use ATMEGA328P AVR. +connect 27MHz (overclock...) crystal to the AVR. +supply 3.3V power. + +fuse setting : LOW 11011110 +connection: + + D0: DO (SD card) + D1: CS (SD card) + D2: WRITE REQUEST (APPLE II disk IF, pull up with 10K ohm) + D3: EJECT SWITCH (LOW if SD card is inserted) + D4: DI (SD card) + D5: CLK (SD card) + D6-D7: NC + B0: PHASE-0 (APPLE II disk IF) + B1: PHASE-1 (APPLE II disk IF) + B2: PHASE-2 (APPLE II disk IF) + B3: PHASE-3 (APPLE II disk IF) + B4: LED (through 330 ohm) + B5: NC + B6-B7: connect to the crystal + C0: DRIVE ENABLE (APPLE II disk IF) + C1: READ PULSE (APPLE II disk IF through 74HC125 3state) + C2: WRITE (APPLE II disk IF) + C3: WRITE PROTECT (APPLE II disk IF through 74HC125 3state) + C4-C6: NC + + Note that the enable input of the 3state buffer 74HC125, + should be connected with DRIVE ENABLE. +*/ + +/* +This is a part of the firmware for DISK II emulator by Nishida Radio. + +Copyright (C) 2011 Koichi NISHIDA +email to Koichi NISHIDA: tulip-house@msf.biglobe.ne.jp + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include +#include + +#define WAIT 1 +#define BUF_NUM 5 +#define FAT_DSK_ELEMS 18 +#define FAT_NIC_ELEMS 35 +#define nop() __asm__ __volatile__ ("nop") + +// C prototypes + +// cancel read +void cancelRead(void); +// write a byte data to the SD card +void writeByteSlow(unsigned char c); +void writeByteFast(unsigned char c); +// read data from the SD card +unsigned char readByteSlow(void); +unsigned char readByteFast(void); +// wait until finish a command +void waitFinish(void); +// issue SD card command slowly without getting response +void cmd_(unsigned char cmd, unsigned long adr); +// issue SD card command fast and wait normal response +void cmdFast(unsigned char cmd, unsigned long adr); +// get command response slowly from the SD card +unsigned char getRespSlow(void); +// get command response fast from the SD card +unsigned char getRespFast(void); +// issue command 17 and get ready for reading +void cmd17Fast(unsigned long adr); +// find a file extension +int findExt(char *str, unsigned char *protect, unsigned char *name); +// prepare the FAT table on memory +void prepareFat(int i, unsigned short *fat, unsigned short len, + unsigned char fatNum, unsigned char fatElemNum); +// memory copy +void memcp(unsigned char *dst, unsigned char *src, const unsigned short len); +// duplicate FAT for FAT16 +void duplicateFat(void); +// write to the SD cart one by one +void writeSD(unsigned long adr, unsigned char *data, unsigned short len); +// create a NIC image file +int createNic(unsigned char *name); +// translate a NIC image into a DSK image +void nic2Dsk(void); +// translate a DSK image into a NIC image +void dsk2Nic(void); +// initialization called from check_eject +void init(void); +// called when the SD card is inserted or removed +void check_eject(void); +// write data back to a NIC image +void writeBack(void); +void writeBackSub(void); +void writeBackSub2(unsigned char bn, unsigned char sc, unsigned char track); +// buffer clear +void buffClear(void); + +// assembler functions +void wait5(unsigned short time); + +// SD card information +unsigned long bpbAddr, rootAddr; +unsigned long fatAddr; // the beginning of FAT +unsigned short fileFatTop; +unsigned char sectorsPerCluster, sectorsPerCluster2; // sectors per cluster +unsigned short sectorsPerFat; +unsigned long userAddr; // the beginning of user data +// unsigned short fatDsk[FAT_DSK_ELEMS];// use writeData instead +unsigned short fatNic[FAT_NIC_ELEMS]; +unsigned char prevFatNumDsk, prevFatNumNic; +unsigned short nicDir, dskDir; + +// DISK II status +unsigned char ph_track; // 0 - 139 +unsigned char sector; // 0 - 15 +unsigned short bitbyte; // 0 - (8*512-1) +unsigned char prepare; +unsigned char readPulse; +unsigned char inited; +unsigned char magState; +unsigned char protect; +unsigned char formatting; +const unsigned char volume = 0xfe; + +// write data buffer +unsigned char writeData[BUF_NUM][350]; +unsigned char sectors[BUF_NUM], tracks[BUF_NUM]; +unsigned char buffNum; +unsigned char *writePtr; + +// a table for head stepper moter movement +PROGMEM prog_uchar stepper_table[4] = {0x0f,0xed,0x03,0x21}; + +// encode / decode table for a nib image +PROGMEM prog_uchar encTable[] = { + 0x96,0x97,0x9A,0x9B,0x9D,0x9E,0x9F,0xA6, + 0xA7,0xAB,0xAC,0xAD,0xAE,0xAF,0xB2,0xB3, + 0xB4,0xB5,0xB6,0xB7,0xB9,0xBA,0xBB,0xBC, + 0xBD,0xBE,0xBF,0xCB,0xCD,0xCE,0xCF,0xD3, + 0xD6,0xD7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE, + 0xDF,0xE5,0xE6,0xE7,0xE9,0xEA,0xEB,0xEC, + 0xED,0xEE,0xEF,0xF2,0xF3,0xF4,0xF5,0xF6, + 0xF7,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF +}; +PROGMEM prog_uchar decTable[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x02,0x03,0x00,0x04,0x05,0x06, + 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x08,0x00,0x00,0x00,0x09,0x0a,0x0b,0x0c,0x0d, + 0x00,0x00,0x0e,0x0f,0x10,0x11,0x12,0x13,0x00,0x14,0x15,0x16,0x17,0x18,0x19,0x1a, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1b,0x00,0x1c,0x1d,0x1e, + 0x00,0x00,0x00,0x1f,0x00,0x00,0x20,0x21,0x00,0x22,0x23,0x24,0x25,0x26,0x27,0x28, + 0x00,0x00,0x00,0x00,0x00,0x29,0x2a,0x2b,0x00,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32, + 0x00,0x00,0x33,0x34,0x35,0x36,0x37,0x38,0x00,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f +}; + +// a table for translating logical sectors into physical sectors +PROGMEM prog_uchar physicalSector[] = { + 0,13,11,9,7,5,3,1,14,12,10,8,6,4,2,15}; + +// for bit flip +PROGMEM prog_uchar FlipBit[] = { 0, 2, 1, 3 }; +PROGMEM prog_uchar FlipBit1[] = { 0, 2, 1, 3 }; +PROGMEM prog_uchar FlipBit2[] = { 0, 8, 4, 12 }; +PROGMEM prog_uchar FlipBit3[] = { 0, 32, 16, 48 }; + +// buffer clear +void buffClear(void) +{ + unsigned char i; + unsigned short j; + + for (i=0; i>= 1) { + if (c&d) { + PORTD = 0b00010000; + wait5(WAIT); + PORTD = 0b00110000; + } else { + PORTD = 0b00000000; + wait5(WAIT); + PORTD = 0b00100000; + } + wait5(WAIT); + } + PORTD = 0b00000000; +} +void writeByteFast(unsigned char c) +{ + unsigned char d; + for (d = 0b10000000; d; d >>= 1) { + if (c&d) { + PORTD = 0b00010000; + PORTD = 0b00110000; + } else { + PORTD = 0b00000000; + PORTD = 0b00100000; + } + } + PORTD = 0b00000000; +} + +// read data from the SD card +unsigned char readByteSlow(void) +{ + unsigned char c = 0; + volatile unsigned char i; + + PORTD = 0b00010000; + wait5(WAIT); + for (i = 0; i != 8; i++) { + PORTD = 0b00110000; + wait5(WAIT); + c = ((c<<1) | (PIND&1)); + PORTD = 0b00010000; + wait5(WAIT); + } + return c; +} + +unsigned char readByteFast(void) +{ + unsigned char c = 0; + volatile unsigned char i; + + PORTD = 0b00010000; + for (i = 0; i != 8; i++) { + PORTD = 0b00110000; + c = ((c<<1) | (PIND&1)); + PORTD = 0b00010000; + } + return c; +} +// wait until data is written to the SD card +void waitFinish(void) +{ + unsigned char ch; + do { + ch = readByteFast(); + if (bit_is_set(PIND,3)) return; + } while (ch != 0xff); +} + +// issue a SD card command slowly without getting response +void cmd_(unsigned char cmd, unsigned long adr) +{ + writeByteSlow(0xff); + writeByteSlow(0x40+cmd); + writeByteSlow(adr>>24); + writeByteSlow((adr>>16)&0xff); + writeByteSlow((adr>>8)&0xff); + writeByteSlow(adr&0xff); + writeByteSlow(0x95); + writeByteSlow(0xff); +} + +// issue a SD card command and wait normal response +void cmdFast(unsigned char cmd, unsigned long adr) +{ + unsigned char res; + do { + writeByteFast(0xff); + writeByteFast(0x40+cmd); + writeByteFast(adr>>24); + writeByteFast((adr>>16)&0xff); + writeByteFast((adr>>8)&0xff); + writeByteFast(adr&0xff); + writeByteFast(0x95); + writeByteFast(0xff); + } while (((res=getRespFast())!=0) && (res!=0xff)); +} + +// get a command response slowly from the SD card +unsigned char getRespSlow(void) +{ + unsigned char ch; + do { + ch = readByteSlow(); + if (bit_is_set(PIND,3)) return 0xff; + } while ((ch&0x80) != 0); + return ch; +} + +// get a command response fast from the SD card +unsigned char getRespFast(void) +{ + unsigned char ch; + do { + ch = readByteFast(); + if (bit_is_set(PIND,3)) return 0xff; + } while ((ch&0x80) != 0); + return ch; +} + +// issue command 17 and get ready for reading +void cmd17Fast(unsigned long adr) +{ + unsigned char ch; + + cmdFast(17, adr); + do { + ch = readByteFast(); + if (bit_is_set(PIND,3)) return; + } while (ch != 0xfe); +} + +// find a file extension +int findExt(char *str, unsigned char *protect, unsigned char *name) +{ + short i; + unsigned max_file = 512; + unsigned short max_time = 0, max_date = 0; + + // find NIC extension + for (i=0; i!=512; i++) { + unsigned char ext[3], d; + unsigned char time[2], date[2]; + + if (bit_is_set(PIND,3)) return 512; + // check first char + cmdFast(16, 1); + cmd17Fast(rootAddr+i*32); + d = readByteFast(); + readByteFast(); readByteFast(); // discard CRC bytes + if ((d==0x00)||(d==0x05)||(d==0x2e)||(d==0xe5)) continue; + if (!(((d>='A')&&(d<='Z'))||((d>='0')&&(d<='9')))) continue; + cmd17Fast(rootAddr+i*32+11); + d = readByteFast(); + readByteFast(); readByteFast(); // discard CRC bytes + if (d&0x1e) continue; + if (d==0xf) continue; + // check extension + cmdFast(16, 4); + cmd17Fast(rootAddr+i*32+8); + ext[0] = readByteFast(); ext[1] = readByteFast(); ext[2] = readByteFast(); + if (protect) *protect = ((readByteFast()&1)<<3); else readByteFast(); + readByteFast(); readByteFast(); // discard CRC bytes + + + // check time stamp + cmdFast(16, 4); + cmd17Fast(rootAddr+i*32+22); + time[0] = readByteFast(); time[1] = readByteFast(); + date[0] = readByteFast(); date[1] = readByteFast(); + readByteFast(); readByteFast(); // discard CRC bytes + if ((ext[0]==str[0])&&(ext[1]==str[1])&&(ext[2]==str[2])) { + unsigned short tm = *(unsigned short *)time; + unsigned short dt = *(unsigned short *)date; + + if ((dt>max_date)||((dt==max_date)&&(tm>=max_time))) { + max_time = tm; + max_date = dt; + max_file = i; + } + } + } + if ((max_file != 512) && (name != 0)) { + unsigned char j; + cmdFast(16, 8); + cmd17Fast(rootAddr+max_file*32); + for (j=0; j<8; j++) name[j] = readByteFast(); + readByteFast(); readByteFast(); + } + return max_file; + // if 512 then not found... +} + +// prepare a FAT table on memory +void prepareFat(int i, unsigned short *fat, unsigned short len, + unsigned char fatNum, unsigned char fatElemNum) +{ + unsigned short ft; + unsigned char fn; + + if (bit_is_set(PIND,3)) return; + cmdFast(16, (unsigned long)2); + cmd17Fast(rootAddr+i*32+26); + ft = readByteFast(); + ft += (unsigned short)readByteFast()*0x100; + readByteFast(); readByteFast(); // discard CRC bytes + if (0==fatNum) fat[0] = ft; + for (i=0; i0xfff6)||(fn>fatNum)) break; + } + cmdFast(16, (unsigned long)512); +} + +// memory copy +void memcp(unsigned char *dst, unsigned char *src, unsigned short len) +{ + unsigned short i; + + for (i=0; i>sectorsPerCluster2)); ft++) { + cmdFast(16, 2); + cmd17Fast(fatAddr+ft*2); + d = readByteFast(); + d += (unsigned short)readByteFast()*0x100; + readByteFast(); readByteFast(); // discard CRC bytes + if (d==0) { + clusterNum++; + writeSD(adr, (unsigned char *)&ft, 2); + adr = fatAddr+ft*2; + } + } + writeSD(adr, last, 2); + duplicateFat(); + return 1; +} + +// translate a DSK image into a NIC image +void dsk2Nic(void) +{ + unsigned char trk, logic_sector; + + unsigned short i; + unsigned char *dst = (&writeData[0][0]+512); + unsigned short *fatDsk = (unsigned short *)(&writeData[0][0]+1024); + + PORTB |= 0b00010000; + + prevFatNumNic = prevFatNumDsk = 0xff; + + for (i=0; i<0x16; i++) dst[i]=0xff; + + // sync header + dst[0x16]=0x03; + dst[0x17]=0xfc; + dst[0x18]=0xff; + dst[0x19]=0x3f; + dst[0x1a]=0xcf; + dst[0x1b]=0xf3; + dst[0x1c]=0xfc; + dst[0x1d]=0xff; + dst[0x1e]=0x3f; + dst[0x1f]=0xcf; + dst[0x20]=0xf3; + dst[0x21]=0xfc; + + // address header + dst[0x22]=0xd5; + dst[0x23]=0xaa; + dst[0x24]=0x96; + dst[0x2d]=0xde; + dst[0x2e]=0xaa; + dst[0x2f]=0xeb; + + // sync header + for (i=0x30; i<0x35; i++) dst[i]=0xff; + + // data + dst[0x35]=0xd5; + dst[0x36]=0xaa; + dst[0x37]=0xad; + dst[0x18f]= 0xde; + dst[0x190]=0xaa; + dst[0x191]=0xeb; + for (i=0x192; i<0x1a0; i++) dst[i]=0xff; + for (i=0x1a0; i<0x200; i++) dst[i]=0x00; + + cmdFast(16, (unsigned long)512); + for (trk = 0; trk < 35; trk++) { + PORTB ^= 0b00010000; + for (logic_sector = 0; logic_sector < 16; logic_sector++) { + unsigned char *src; + unsigned short ph_sector = (unsigned short)pgm_read_byte_near(physicalSector+logic_sector); + + if (bit_is_set(PIND,3)) return; + + if ((logic_sector&1)==0) { + unsigned short long_sector = (unsigned short)trk*8+(logic_sector/2); + unsigned short long_cluster = long_sector>>sectorsPerCluster2; + unsigned char fatNum = long_cluster/FAT_DSK_ELEMS; + unsigned short ft; + + if (fatNum != prevFatNumDsk) { + prevFatNumDsk = fatNum; + prepareFat(dskDir, fatDsk, + (280+sectorsPerCluster-1)>>sectorsPerCluster2, fatNum, FAT_DSK_ELEMS); + } + ft = fatDsk[long_cluster%FAT_DSK_ELEMS]; + cmd17Fast((unsigned long)userAddr+(((unsigned long)(ft-2)<>1)|0xaa); + dst[0x26]=(volume|0xaa); + dst[0x27]=((trk>>1)|0xaa); + dst[0x28]=(trk|0xaa); + dst[0x29]=((ph_sector>>1)|0xaa); + dst[0x2a]=(ph_sector|0xaa); + c = (volume^trk^ph_sector); + dst[0x2b]=((c>>1)|0xaa); + dst[0x2c]=(c|0xaa); + for (i = 0; i < 86; i++) { + x = (pgm_read_byte_near(FlipBit1+(src[i]&3)) | + pgm_read_byte_near(FlipBit2+(src[i+86]&3)) | + ((i<=83)?pgm_read_byte_near(FlipBit3+(src[i+172]&3)):0)); + dst[i+0x38] = pgm_read_byte_near(encTable+(x^ox)); + ox = x; + } + for (i = 0; i < 256; i++) { + x = (src[i] >> 2); + dst[i+0x8e] = pgm_read_byte_near(encTable+(x^ox)); + ox = x; + } + dst[0x18e]=pgm_read_byte_near(encTable+ox); + } + { + unsigned char c, d; + unsigned short long_sector = (unsigned short)trk*16+ph_sector; + unsigned short long_cluster = long_sector>>sectorsPerCluster2; + unsigned char fatNum = long_cluster/FAT_NIC_ELEMS; + unsigned short ft; + + if (fatNum != prevFatNumNic) { + prevFatNumNic = fatNum; + prepareFat(nicDir, fatNic, + (560+sectorsPerCluster-1)>>sectorsPerCluster2, fatNum, FAT_NIC_ELEMS); + } + ft = fatNic[long_cluster%FAT_NIC_ELEMS]; + + PORTD = 0b00000010; + PORTD = 0b00000000; + + cmdFast(24, userAddr+(((unsigned long)(ft-2)<>= 1) { + if (c&d) { + PORTD = D1; + PORTD = D2; + } else { + PORTD = D3; + PORTD = D4; + } + } + } + PORTD = 0b00000000; + writeByteFast(0xff); + writeByteFast(0xff); + readByteFast(); + waitFinish(); + + PORTD = 0b00000010; + PORTD = 0b00000000; + } + } + } + buffClear(); + PORTB &= 0b11101111; +} + +// initialization called from check_eject +void init(void) +{ + unsigned char ch; + unsigned short i; + char str[5]; + unsigned char filebase[8]; + + inited = 0; + PORTB = 0b00110000; // LED on + + // initialize the SD card + PORTD = 0b00000010; + for (i = 0; i != 200; i++) { + PORTD = 0b00110010; + wait5(WAIT); + PORTD = 0b00010010; + wait5(WAIT); + } // input 200 clock + PORTD = 0b000000000; + + cmd_(0, 0); // command 0 + do { + if (bit_is_set(PIND,3)) return; + ch = readByteSlow(); + } while (ch != 0x01); + + PORTD = 0b00000010; + while (1) { + if (bit_is_set(PIND,3)) return; + PORTD = 0b00000000; + cmd_(55, 0); // command 55 + ch = getRespSlow(); + if (ch == 0xff) return; + if (ch & 0xfe) continue; + // if (ch == 0x00) break; + PORTD = 0b00000010; + PORTD = 0b00000000; + cmd_(41, 0); // command 41 + if (!(ch=getRespSlow())) break; + if (ch == 0xff) return; + PORTD = 0b00000010; + } + + // BPB address + cmdFast(16,5); + cmd17Fast(54); + for (i=0; i<5; i++) str[i] = readByteFast(); + readByteFast(); readByteFast(); // discard CRC + if ((str[0]=='F')&&(str[1]=='A')&&(str[2]=='T')&& + (str[3]=='1')&&(str[4]=='6')) { + bpbAddr = 0; + } else { + cmdFast(16, 4); + cmd17Fast((unsigned long)0x1c6); + bpbAddr = readByteFast(); + bpbAddr += (unsigned long)readByteFast()*0x100; + bpbAddr += (unsigned long)readByteFast()*0x10000; + bpbAddr += (unsigned long)readByteFast()*0x1000000; + bpbAddr *= 512; + readByteFast(); readByteFast(); // discard CRC bytes + } + if (bit_is_set(PIND,3)) return; + + // sectorsPerCluster and reservedSectors + { + unsigned short reservedSectors; + volatile unsigned char k; + cmdFast(16, 3); + cmd17Fast(bpbAddr+0xd); + sectorsPerCluster = k = readByteFast(); + sectorsPerCluster2 = 0; + while (k != 1) { + sectorsPerCluster2++; + k >>= 1; + } + reservedSectors = readByteFast(); + reservedSectors += (unsigned short)readByteFast()*0x100; + readByteFast(); readByteFast(); // discard CRC bytes + // sectorsPerCluster = 0x40 at 2GB, 0x10 at 512MB + // reservedSectors = 2 at 2GB + fatAddr = bpbAddr + (unsigned long)512*reservedSectors; + } + if (bit_is_set(PIND,3)) return; + + { + // sectorsPerFat and rootAddr + cmdFast(16, 2); + cmd17Fast(bpbAddr+0x16); + sectorsPerFat = readByteFast(); + sectorsPerFat += (unsigned short)readByteFast()*0x100; + readByteFast(); readByteFast(); // discard CRC bytes + // sectorsPerFat = at 512MB, 0xEF at 2GB + rootAddr = fatAddr + ((unsigned long)sectorsPerFat*2*512); + userAddr = rootAddr+(unsigned long)512*32; + } + if (bit_is_set(PIND,3)) return; + + // find "NIC" extension + nicDir = findExt("NIC", &protect, (unsigned char *)0); + if (nicDir == 512) { // create NIC file if not exists + // find "DSK" extension + dskDir = findExt("DSK", (unsigned char *)0, filebase); + if (dskDir == 512) return; + if (!createNic(filebase)) return; + nicDir = findExt("NIC", &protect, (unsigned char *)0); + if (nicDir == 512) return; + // convert DSK image to NIC image + dsk2Nic(); + } + if (bit_is_set(PIND,3)) return; + + prevFatNumNic = 0xff; + prevFatNumDsk = 0xff; + bitbyte = 0; + readPulse = 0; + magState = 0; + prepare = 1; + ph_track = 0; + sector = 0; + buffNum = 0; + formatting = 0; + writePtr = &(writeData[buffNum][0]); + cmdFast(16, (unsigned long)512); + buffClear(); + inited = 1; +} + +// called when the card is inserted or removed +void check_eject(void) +{ + unsigned long i; + + if (bit_is_set(PIND,3)) { + // added 2010/5/28 + for (i=0; i!=0x50000;i++) + if (bit_is_clear(PIND,3)) return; + TIMSK0 &= ~(1<>4); + stp = (PINB & 0b00001111); + if (stp != oldStp) { + oldStp = stp; + unsigned char ofs = + ((stp==0b00001000)?2: + ((stp==0b00000100)?4: + ((stp==0b00000010)?6: + ((stp==0b00000001)?0:0xff)))); + if (ofs != 0xff) { + ofs = ((ofs+ph_track)&7); + unsigned char bt = pgm_read_byte_near(stepper_table + (ofs>>1)); + oldStp = stp; + if (ofs&1) bt &= 0x0f; else bt >>= 4; + ph_track += ((bt & 0x08) ? (0xf8 | bt) : bt); + if (ph_track > 196) ph_track = 0; + if (ph_track > 139) ph_track = 139; + } + } + if (inited && prepare) { + cli(); + sector = ((sector+1)&0xf); + { + unsigned char trk = (ph_track>>2); + unsigned short long_sector = (unsigned short)trk*16+sector; + unsigned short long_cluster = long_sector>>sectorsPerCluster2; + unsigned char fatNum = long_cluster/FAT_NIC_ELEMS; + unsigned short ft; + + if (fatNum != prevFatNumNic) { + prevFatNumNic = fatNum; + prepareFat(nicDir, fatNic, (560+sectorsPerCluster-1)>>sectorsPerCluster2, fatNum, FAT_NIC_ELEMS); + } + ft = fatNic[long_cluster%FAT_NIC_ELEMS]; + + if (((sectors[0]==sector)&&(tracks[0]==trk)) || + ((sectors[1]==sector)&&(tracks[1]==trk)) || + ((sectors[2]==sector)&&(tracks[2]==trk)) || + ((sectors[3]==sector)&&(tracks[3]==trk)) || + ((sectors[4]==sector)&&(tracks[4]==trk))) + writeBackSub(); + cmd17Fast(userAddr+(((unsigned long)(ft-2)<>sectorsPerCluster2; + unsigned char fatNum = long_cluster/FAT_NIC_ELEMS; + unsigned short ft; + + if (bit_is_set(PIND,3)) return; + + if (fatNum != prevFatNumNic) { + prevFatNumNic = fatNum; + prepareFat(nicDir, fatNic, + (560+sectorsPerCluster-1)>>sectorsPerCluster2, fatNum, FAT_NIC_ELEMS); + } + ft = fatNic[long_cluster%FAT_NIC_ELEMS]; + + PORTD = 0b00000010; + PORTD = 0b00000000; + + cmdFast(24, (unsigned long)userAddr+(((unsigned long)(ft-2)<>1)|0xaa); + writeByteFast(volume|0xaa); + writeByteFast((track>>1)|0xaa); + writeByteFast(track|0xaa); + writeByteFast((sc>>1)|0xaa); + writeByteFast(sc|0xaa); + c = (volume^track^sc); + writeByteFast((c>>1)|0xaa); + writeByteFast(c|0xaa); + writeByteFast(0xde); + writeByteFast(0xAA); + writeByteFast(0xeb); + + // sync header + writeByteFast(0xff); + writeByteFast(0xff); + writeByteFast(0xff); + writeByteFast(0xff); + writeByteFast(0xff); + + // data + for (i = 0; i < 349; i++) { + c = writeData[bn][i]; + for (d = 0b10000000; d; d >>= 1) { + if (c&d) { + PORTD = 0b00010000; + PORTD = 0b00110000; + } else { + PORTD = 0b00000000; + PORTD = 0b00100000; + } + } + } + PORTD = 0b00000000; + for (i = 0; i < 14*8; i++) { + PORTD = 0b00010000; + PORTD = 0b00110000; + } + PORTD = 0b00000000; + for (i = 0; i < 96*8; i++) { + PORTD = 0b00000000; + PORTD = 0b00100000; + } + PORTD = 0b00000000; + writeByteFast(0xff); + writeByteFast(0xff); + readByteFast(); + waitFinish(); + + PORTD = 0b00000010; + PORTD = 0b00000000; +} + +void writeBackSub(void) +{ + unsigned char i, j; + + if (bit_is_set(PIND,3)) return; + for (j=0; j>2); + sector=((((sector==0xf)||(sector==0xd))?(sector+2):(sector+1))&0xf); + if (buffNum == (BUF_NUM-1)) { + // cancel reading + cancelRead(); + writeBackSub(); + prepare = 1; + } else { + buffNum++; + writePtr = &(writeData[buffNum][0]); + } + } else { + sector = sec; + formatting = 0; + if (sec == 0xf) { + // cancel reading + cancelRead(); + prepare = 1; + } + } + } if (writeData[buffNum][2]==0x96) { + sec = (((writeData[buffNum][7]&0x55)<<1) | (writeData[buffNum][8]&0x55)); + formatting = 1; + } +} \ No newline at end of file diff --git a/sdisk2.hex b/sdisk2.hex new file mode 100644 index 0000000..e78d32d --- /dev/null +++ b/sdisk2.hex @@ -0,0 +1,1296 @@ +:100000000C94E6000C94E0270C9403010C9403017B +:100010000C9403010C9403010C9403010C94030150 +:100020000C9403010C9403010C9403010C94030140 +:100030000C9403010C9403010C9403010C94030130 +:100040000C9496270C9403010C9403010C94030167 +:100050000C9403010C9403010C9403010C94030110 +:100060000C9403010C9403010FED032196979A9BC6 +:100070009D9E9FA6A7ABACADAEAFB2B3B4B5B6B7BD +:10008000B9BABBBCBDBEBFCBCDCECFD3D6D7D9DAE4 +:10009000DBDCDDDEDFE5E6E7E9EAEBECEDEEEFF2F7 +:1000A000F3F4F5F6F7F9FAFBFCFDFEFF00000000A3 +:1000B0000000000000000000000000000000000040 +:1000C0000000000000000000000000000000000030 +:1000D0000000000000000000000000000000000020 +:1000E0000000000000000000000000000000000010 +:1000F0000000000000000000000000000000000000 +:1001000000000000000000000000000000000000EF +:1001100000000000000000000000000000000000DF +:1001200000000000000000000000000000000000CF +:1001300000000000000000000000000000000000BF +:10014000000000010000020300040506000000009A +:1001500000000708000000090A0B0C0D00000E0F3C +:1001600010111213001415161718191A00000000A8 +:10017000000000000000001B001C1D1E0000001FEE +:10018000000020210022232425262728000000002B +:1001900000292A2B002C2D2E2F3031320000333431 +:1001A0003536373800393A3B3C3D3E3F000D0B09B0 +:1001B000070503010E0C0A080604020F00020103E2 +:1001C000000201030008040C0020103011241FBE9F +:1001D000CFEFD8E0DEBFCDBF11E0A0E0B1E0E8EDA9 +:1001E000F0E502C005900D92AC30B107D9F718E0E8 +:1001F000ACE0B1E001C01D92AE35B107E1F70E945D +:100200005B250C946A280C94000020E030E04EE559 +:1002100051E0249FF001259FF00D349FF00D112433 +:10022000E45EFE4F80E090E01192019661E08E3531 +:100230009607D1F72F5F3F4F2530310551F78FEFEC +:100240008093160180930F01809317018093100112 +:1002500080931801809311018093190180931201FA +:1002600080931A018093130108952091F40730912F +:10027000F5074CE02039340798F480E18BB990E31E +:100280004B990EC09BB98BB92F5F3F4F40E1203196 +:100290003407B0F380E99CE09093F5078093F4076E +:1002A0000895982F87FD29C01BB880E28BB996FD71 +:1002B0002AC01BB880E28BB995FD2BC01BB880E229 +:1002C0008BB994FD2CC01BB880E28BB993FD2DC077 +:1002D0001BB880E28BB992FD2EC01BB880E28BB9AF +:1002E00091FD2FC01BB880E28BB990FF30C080E138 +:1002F0008BB980E38BB91BB8089580E18BB980E39B +:100300008BB996FFD6CF80E18BB980E38BB995FF8F +:10031000D5CF80E18BB980E38BB994FFD4CF80E156 +:100320008BB980E38BB993FFD3CF80E18BB980E3A6 +:100330008BB992FFD2CF80E18BB980E38BB991FF6B +:10034000D1CF80E18BB980E38BB990FDD0CF1BB8C2 +:1003500080E28BB91BB80895DF93CF930F92CDB78E +:10036000DEB780E18BB9198289818830A1F090E0F5 +:1003700030E320E13BB989B1990F8170982B2BB9FB +:1003800089818F5F898389818830A1F7892F0F90B8 +:10039000CF91DF91089590E0F9CFCF93DF93EC01F7 +:1003A0004115510579F020E030E0FE01E20FF31F26 +:1003B000DB01A20FB31F8C9180832F5F3F4F241767 +:1003C000350798F3DF91CF910895FF920F931F9314 +:1003D000DF93CF930F92CDB7DEB780E18BB981E089 +:1003E00090E00E94862719828981883001F110E00F +:1003F00080E3F82E00E1FBB881E090E00E948627C0 +:1004000089B1110F8170182B0BB981E090E00E9427 +:10041000862789818F5F89838981883061F7812F61 +:100420000F90CF91DF911F910F91FF90089510E0F1 +:10043000F6CF1F93182F87FD6AC01BB881E090E0AC +:100440000E94862780E28BB981E090E00E94862797 +:1004500016FD6BC01BB881E090E00E94862780E209 +:100460008BB981E090E00E94862715FD6CC01BB817 +:1004700081E090E00E94862780E28BB981E090E0E5 +:100480000E94862714FD6DC01BB881E090E00E9499 +:10049000862780E28BB981E090E00E94862713FDD9 +:1004A0006EC01BB881E090E00E94862780E28BB985 +:1004B00081E090E00E94862712FD6FC01BB881E0AA +:1004C00090E00E94862780E28BB981E090E00E9454 +:1004D000862711FD70C01BB881E090E00E9486273E +:1004E00080E28BB981E090E00E94862710FF71C006 +:1004F00080E18BB981E090E00E94862780E38BB990 +:1005000081E090E00E9486271BB81F91089580E14A +:100510008BB981E090E00E94862780E38BB981E06F +:1005200090E00E94862716FF95CF80E18BB981E08D +:1005300090E00E94862780E38BB981E090E00E94E2 +:10054000862715FF94CF80E18BB981E090E00E946F +:10055000862780E38BB981E090E00E94862714FF14 +:1005600093CF80E18BB981E090E00E94862780E301 +:100570008BB981E090E00E94862713FF92CF80E143 +:100580008BB981E090E00E94862780E38BB981E0FF +:1005900090E00E94862712FF91CF80E18BB981E025 +:1005A00090E00E94862780E38BB981E090E00E9472 +:1005B000862711FF90CF80E18BB981E090E00E9407 +:1005C000862780E38BB981E090E00E94862710FDAA +:1005D0008FCF1BB881E090E00E94862780E28BB924 +:1005E00081E090E00E9486271BB81F910895FF923A +:1005F0000F931F93DF93CF930F92CDB7DEB700E138 +:1006000090E3F92E0BB981E090E00E9486271982D1 +:100610008981883009F110E0FBB881E090E00E9408 +:10062000862789B1110F8170182B0BB981E090E0FA +:100630000E94862789818F5F89838981883061F74D +:10064000812F4B990DC017FDDDCF0F90CF91DF911A +:100650001F910F91FF90089510E080E04B9BF3CF26 +:100660008FEF0F90CF91DF911F910F91FF90089521 +:10067000AF92BF92CF92DF92FF920F931F93F82E0B +:100680005A016B0100E10BB981E090E00E948627DE +:1006900010E31BB981E090E00E9486270BB981E04E +:1006A00090E00E9486271BB981E090E00E94862797 +:1006B0000BB981E090E00E9486271BB981E090E0B1 +:1006C0000E9486270BB981E090E00E9486271BB923 +:1006D00081E090E00E9486270BB981E090E00E94C3 +:1006E00086271BB981E090E00E9486270BB981E044 +:1006F00090E00E9486271BB981E090E00E94862747 +:100700000BB981E090E00E9486271BB981E090E060 +:100710000E9486270BB981E090E00E9486271BB9D2 +:1007200081E090E00E9486271BB880E4F80EF7FC79 +:10073000CDC21BB881E090E00E94862780E28BB991 +:1007400081E090E00E948627F6FCCCC21BB881E0D5 +:1007500090E00E94862780E28BB981E090E00E94C1 +:100760008627F5FCCDC21BB881E090E00E94862769 +:1007700080E28BB981E090E00E948627F4FCCEC233 +:100780001BB881E090E00E94862780E28BB981E06F +:1007900090E00E948627F3FCCFC21BB881E090E076 +:1007A0000E94862780E28BB981E090E00E94862734 +:1007B000F2FCD0C21BB881E090E00E94862780E264 +:1007C0008BB981E090E00E948627F1FCD1C21BB872 +:1007D00081E090E00E94862780E28BB981E090E082 +:1007E0000E948627F0FED2C280E18BB981E090E0C2 +:1007F0000E94862780E38BB981E090E00E948627E3 +:100800001BB88D2D9927AA27BB27182F87FDD9C381 +:100810001BB881E090E00E94862780E28BB981E0DE +:1008200090E00E94862716FDC3C31BB881E090E0CC +:100830000E94862780E28BB981E090E00E948627A3 +:1008400015FDADC31BB881E090E00E94862780E2D1 +:100850008BB981E090E00E94862714FD97C31BB8F6 +:1008600081E090E00E94862780E28BB981E090E0F1 +:100870000E94862713FD81C31BB881E090E00E948F +:10088000862780E28BB981E090E00E94862712FDE6 +:100890006BC31BB881E090E00E94862780E28BB991 +:1008A00081E090E00E94862711FD55C31BB881E0CE +:1008B00090E00E94862780E28BB981E090E00E9460 +:1008C000862710FF40C380E18BB981E090E00E9451 +:1008D000862780E38BB981E090E00E9486271BB8D1 +:1008E000C601AA27BB27182F87FD24C31BB881E0A8 +:1008F00090E00E94862780E28BB981E090E00E9420 +:10090000862716FD0EC31BB881E090E00E94862763 +:1009100080E28BB981E090E00E94862715FDF8C245 +:100920001BB881E090E00E94862780E28BB981E0CD +:1009300090E00E94862714FDE2C21BB881E090E09F +:100940000E94862780E28BB981E090E00E94862792 +:1009500013FDCCC21BB881E090E00E94862780E2A4 +:100960008BB981E090E00E94862712FDB6C21BB8C9 +:1009700081E090E00E94862780E28BB981E090E0E0 +:100980000E94862711FDA0C21BB881E090E00E9462 +:10099000862780E28BB981E090E00E94862710FFD5 +:1009A0008BC280E18BB981E090E00E94862780E3D2 +:1009B0008BB981E090E00E9486271BB8BB27AD2D44 +:1009C0009C2D8B2D182F87FD6EC21BB881E090E007 +:1009D0000E94862780E28BB981E090E00E94862702 +:1009E00016FD58C21BB881E090E00E94862780E285 +:1009F0008BB981E090E00E94862715FD42C21BB8AA +:100A000081E090E00E94862780E28BB981E090E04F +:100A10000E94862714FD2CC21BB881E090E00E9442 +:100A2000862780E28BB981E090E00E94862713FD43 +:100A300016C21BB881E090E00E94862780E28BB945 +:100A400081E090E00E94862712FD00C21BB881E081 +:100A500090E00E94862780E28BB981E090E00E94BE +:100A6000862711FDEAC11BB881E090E00E9486272D +:100A700080E28BB981E090E00E94862710FFD5C10B +:100A800080E18BB981E090E00E94862780E38BB9FA +:100A900081E090E00E9486271BB81A2DA7FCBCC1FC +:100AA0001BB881E090E00E94862780E28BB981E04C +:100AB00090E00E94862716FDA6C11BB881E090E059 +:100AC0000E94862780E28BB981E090E00E94862711 +:100AD00015FD90C11BB881E090E00E94862780E25E +:100AE0008BB981E090E00E94862714FD7AC11BB883 +:100AF00081E090E00E94862780E28BB981E090E05F +:100B00000E94862713FD64C11BB881E090E00E941B +:100B1000862780E28BB981E090E00E94862712FD53 +:100B20004EC11BB881E090E00E94862780E28BB91D +:100B300081E090E00E94862711FD38C11BB881E05A +:100B400090E00E94862780E28BB981E090E00E94CD +:100B5000862710FF23C180E18BB981E090E00E94DD +:100B6000862780E38BB981E090E00E9486271BB83E +:100B700010E11BB981E090E00E94862700E30BB9E9 +:100B800081E090E00E9486271BB881E090E00E94FF +:100B9000862720E2F22EFBB881E090E00E948627B3 +:100BA0001BB881E090E00E948627FBB881E090E0CE +:100BB0000E9486271BB981E090E00E9486270BB92E +:100BC00081E090E00E9486271BB881E090E00E94BF +:100BD0008627FBB881E090E00E9486271BB981E060 +:100BE00090E00E9486270BB981E090E00E94862762 +:100BF0001BB881E090E00E948627FBB881E090E07E +:100C00000E9486271BB981E090E00E9486270BB9DD +:100C100081E090E00E9486271BB81BB981E090E03C +:100C20000E9486270BB981E090E00E9486271BB9BD +:100C300081E090E00E9486270BB981E090E00E945D +:100C400086271BB981E090E00E9486270BB981E0DE +:100C500090E00E9486271BB981E090E00E948627E1 +:100C60000BB981E090E00E9486271BB981E090E0FB +:100C70000E9486270BB981E090E00E9486271BB96D +:100C800081E090E00E9486270BB981E090E00E940D +:100C900086271BB981E090E00E9486270BB981E08E +:100CA00090E00E9486271BB981E090E00E94862791 +:100CB0000BB981E090E00E9486271BB81F910F912D +:100CC000FF90DF90CF90BF90AF9008950BB981E077 +:100CD00090E00E9486271BB981E090E00E94862761 +:100CE000F6FE34CD80E18BB981E090E00E9486274A +:100CF00080E38BB981E090E00E948627F5FE33CD3A +:100D000080E18BB981E090E00E94862780E38BB977 +:100D100081E090E00E948627F4FE32CD80E18BB91D +:100D200081E090E00E94862780E38BB981E090E02B +:100D30000E948627F3FE31CD80E18BB981E090E0FF +:100D40000E94862780E38BB981E090E00E9486278D +:100D5000F2FE30CD80E18BB981E090E00E948627E1 +:100D600080E38BB981E090E00E948627F1FE2FCDD1 +:100D700080E18BB981E090E00E94862780E38BB907 +:100D800081E090E00E948627F0FC2ECD1BB881E028 +:100D900090E00E94862780E28BB92ECD1BB881E0BF +:100DA00090E00E94862780E28BB9DDCE80E18BB98E +:100DB00081E090E00E94862780E38BB9C6CE80E177 +:100DC0008BB981E090E00E94862780E38BB9B0CE9A +:100DD00080E18BB981E090E00E94862780E38BB9A7 +:100DE0009ACE80E18BB981E090E00E94862780E373 +:100DF0008BB984CE80E18BB981E090E00E94862798 +:100E000080E38BB96ECE80E18BB981E090E00E94E7 +:100E1000862780E38BB958CE80E18BB981E090E0E2 +:100E20000E94862780E38BB942CE1BB881E090E018 +:100E30000E94862780E28BB92BCE80E18BB981E0BE +:100E400090E00E94862780E38BB914CE80E18BB9B5 +:100E500081E090E00E94862780E38BB9FECD80E19F +:100E60008BB981E090E00E94862780E38BB9E8CDC2 +:100E700080E18BB981E090E00E94862780E38BB906 +:100E8000D2CD80E18BB981E090E00E94862780E39B +:100E90008BB9BCCD80E18BB981E090E00E948627C0 +:100EA00080E38BB9A6CD80E18BB981E090E00E9410 +:100EB000862780E38BB990CD1BB881E090E00E943B +:100EC000862780E28BB975CD80E18BB981E090E017 +:100ED0000E94862780E38BB95ECD80E18BB981E0EB +:100EE00090E00E94862780E38BB948CD80E18BB9E2 +:100EF00081E090E00E94862780E38BB932CD80E1CB +:100F00008BB981E090E00E94862780E38BB91CCDED +:100F100080E18BB981E090E00E94862780E38BB965 +:100F200006CD80E18BB981E090E00E94862780E3C6 +:100F30008BB9F0CC80E18BB981E090E00E948627EC +:100F400080E38BB9DACC1BB881E090E00E94862761 +:100F500080E28BB9C0CC80E18BB981E090E00E9447 +:100F6000862780E38BB9A9CC80E18BB981E090E042 +:100F70000E94862780E38BB993CC80E18BB981E016 +:100F800090E00E94862780E38BB97DCC80E18BB90D +:100F900081E090E00E94862780E38BB967CC80E1F6 +:100FA0008BB981E090E00E94862780E38BB951CC19 +:100FB00080E18BB981E090E00E94862780E38BB9C5 +:100FC0003BCC80E18BB981E090E00E94862780E3F2 +:100FD0008BB925CCDF93CF930F92CDB7DEB720E14D +:100FE00030E32BB9198289818830A9F090E03BB9B0 +:100FF00089B1990F8170982B2BB989818F5F898373 +:1010000089818830A1F74B9902C09F3F51F70F901B +:10101000CF91DF91089590E0F6CFDF93CF930F92B9 +:10102000CDB7DEB720E130E32BB919828981883052 +:10103000B1F090E03BB989B1990F8170982B2BB931 +:1010400089818F5F898389818830A1F7892F4B99A6 +:101050000AC097FDE9CF0F90CF91DF91089590E0FE +:1010600080E04B9BF6CF8FEF0F90CF91DF910895EB +:101070002F923F924F925F926F927F928F929F92A8 +:10108000AF92BF92CF92DF92EF92FF920F931F9396 +:10109000DF93CF93CDB7DEB762970FB6F894DEBF7C +:1010A0000FBECDBF805C072F1127222733276B018E +:1010B000EE24FF24852E962EA72EBB2490E8282F01 +:1010C00020782887282F20742A8B282F20722D879C +:1010D000282F20712E8328E0522E582214E0A12EB2 +:1010E000A822B2E0EB2EE822182F1170802F807812 +:1010F0008F83202F2074298B802F80728C87202F44 +:1011000020712C83A8E06A2E6022F4E0BF2EB0226A +:10111000E2E0FE2EF02201708C2D80788D832C2D44 +:101120002074288B8C2D80728B872C2D20712A8324 +:1011300078E0772E7C2064E0D62EDC20BC2DB270C7 +:10114000FC2DF170882D80788B83282D20742F87BB +:10115000882D80728A8750E1252E282038E0932E32 +:10116000982024E0C22EC820A82DA270E82DE1709E +:1011700080E8382E3422242F20742E87842F80720A +:10118000898770E1472E442268E0862E8422742FDE +:101190007470642F6270417020E130E350E203C04C +:1011A0002BB93BB996959923D9F71BB88885882325 +:1011B00009F0ABC11BB85BB98A89882309F0A2C1C9 +:1011C0001BB85BB98D85882309F099C11BB85BB941 +:1011D0008E81882309F090C11BB85BB9552009F0B6 +:1011E00088C11BB85BB9AA2009F080C11BB85BB9E4 +:1011F000EE2009F078C11BB85BB9112309F470C166 +:101200002BB93BB91BB88F81882309F066C11BB885 +:101210005BB98989882309F05DC11BB85BB98C85EE +:10122000882309F054C11BB85BB98C81882309F06D +:101230004BC11BB85BB9662009F043C11BB85BB951 +:10124000BB2009F03BC11BB85BB9FF2009F033C1DB +:101250001BB85BB9002309F42BC12BB93BB91BB8F0 +:101260008D81882309F021C11BB85BB98889882347 +:1012700009F018C11BB85BB98B85882309F00FC131 +:101280001BB85BB98A81882309F006C11BB85BB91A +:10129000772009F0FEC01BB85BB9DD2009F0F6C06D +:1012A0001BB85BB9BB2309F0EEC01BB85BB9FF23C9 +:1012B00009F4E6C02BB93BB91BB88B81882309F030 +:1012C000DCC01BB85BB98F85882309F0D3C01BB87D +:1012D0005BB98A85882309F0CAC01BB85BB9222094 +:1012E00009F0C2C01BB85BB9992009F0BAC01BB89D +:1012F0005BB9CC2009F0B2C01BB85BB9AA2309F0D6 +:10130000AAC01BB85BB9EE2309F4A2C02BB93BB944 +:101310001BB8332009F099C01BB85BB98E858823B0 +:1013200009F090C01BB85BB98985882309F087C094 +:101330001BB85BB9442009F07FC01BB85BB988209B +:1013400009F077C01BB85BB9772309F06FC01BB8F1 +:101350005BB9662309F067C01BB85BB9442309F485 +:101360005FC02BB93BB91BB82BB93BB91BB85BB9F4 +:101370001BB85BB92BB93BB91BB85BB92BB93BB9EF +:101380001BB85BB92BB93BB91BB82BB93BB92BB90F +:101390003BB92BB93BB92BB93BB92BB93BB92BB9ED +:1013A0003BB92BB93BB92BB93BB91BB82BB9198247 +:1013B00089818830C1F090E03BB989B1990F817083 +:1013C000982B2BB989818F5F898389818830A1F718 +:1013D000892F4B990CC097FDE9CF882341F08F3FAF +:1013E00031F090E8DDCE90E080E04B9BF4CF629648 +:1013F0000FB6F894DEBF0FBECDBFCF91DF911F9126 +:101400000F91FF90EF90DF90CF90BF90AF909F90A3 +:101410008F907F906F905F904F903F902F900895A6 +:101420001BB85BB9A0CF2BB93BB998CF2BB93BB94F +:1014300090CF2BB93BB988CF2BB93BB980CF2BB913 +:101440003BB978CF2BB93BB96FCF2BB93BB966CF3E +:101450001BB85BB95DCF2BB93BB955CF2BB93BB9A5 +:101460004DCF2BB93BB945CF2BB93BB93DCF2BB9AC +:101470003BB935CF2BB93BB92CCF2BB93BB923CFD7 +:101480001BB85BB919CF2BB93BB911CF2BB93BB9FD +:1014900009CF2BB93BB901CF2BB93BB9F9CE2BB949 +:1014A0003BB9F0CE2BB93BB9E7CE2BB93BB9DECE79 +:1014B0001BB85BB9D4CE2BB93BB9CCCE2BB93BB959 +:1014C000C4CE2BB93BB9BCCE2BB93BB9B4CE2BB9EA +:1014D0003BB9ABCE2BB93BB9A2CE2BB93BB999CE18 +:1014E0001BB85BB98FCE2BB93BB987CE2BB93BB9B3 +:1014F0007FCE2BB93BB977CE2BB93BB96FCE2BB989 +:101500003BB966CE2BB93BB95DCE2BB93BB954CEB6 +:10151000DF93CF930F92CDB7DEB7AB01BC0181E172 +:101520000E94380820E130E32BB919828981883084 +:10153000A9F090E03BB989B1990F8170982B2BB934 +:1015400089818F5F898389818830A1F74B9902C097 +:101550009E3F51F70F90CF91DF91089590E0F6CF25 +:101560004F925F926F927F928F929F92AF92BF92B3 +:10157000CF92DF92EF92FF920F931F93DF93CF935F +:101580000F92CDB7DEB76090FF0770900008809093 +:101590000108909002084B9B12C00F90CF91DF91F1 +:1015A0001F910F91FF90EF90DF90CF90BF90AF9081 +:1015B0009F908F907F906F905F904F90089580E103 +:1015C00040E052E060E070E00E9438088091F60749 +:1015D0009091F707892B09F34424552410E100E387 +:1015E0002CE1A22E23E0B22E92E0C92E80E2D82E6A +:1015F00081E1B401A3010E9438081BB919828981D5 +:10160000883009F437C190E00BB989B1990F817026 +:10161000982B1BB989818F5F898389818830A1F7D5 +:101620004B9902C09E3F49F7BCE1EB2EB1E0FB2E87 +:10163000F7011BB919828981883009F411C190E042 +:101640000BB989B1990F8170982B1BB989818F5F74 +:10165000898389818830A1F7919383E0EC31F80781 +:1016600041F71BB919828981883049F00BB989B1DA +:101670001BB989818F5F898389818830B9F71BB94C +:1016800019828981883049F00BB989B11BB98981E8 +:101690008F5F898389818830B9F7CBB81BB84091B7 +:1016A000F6075091F70760E070E0A9E0440F551F7E +:1016B000661F771FAA95D1F7460D571D681D791D26 +:1016C00088E10E9438081BB90BB91BB90BB91BB9CB +:1016D0000BB91BB90BB91BB90BB91BB90BB91BB9AA +:1016E0000BB91BB90BB91BB81BB90BB91BB90BB99B +:1016F0001BB90BB91BB90BB91BB90BB91BB90BB98A +:101700001BB90BB91BB8DBB81BB825C01BB8DBB8BD +:1017100086FD29C01BB8DBB885FD29C01BB8DBB826 +:1017200084FD29C01BB8DBB883FD29C01BB8DBB81A +:1017300082FD29C01BB8DBB881FD29C01BB8DBB80E +:1017400080FF29C01BB90BB91BB80894E11CF11C20 +:10175000AE14BF0449F1D7018C9187FFD7CF1BB9D5 +:101760000BB986FFD7CF1BB90BB985FFD7CF1BB9F4 +:101770000BB984FFD7CF1BB90BB983FFD7CF1BB9E8 +:101780000BB982FFD7CF1BB90BB981FFD7CF1BB9DC +:101790000BB980FDD7CF1BB8DBB81BB80894E11C90 +:1017A000F11CAE14BF04B9F61BB90BB91BB90BB9C8 +:1017B0001BB90BB91BB90BB91BB90BB91BB90BB9C9 +:1017C0001BB90BB91BB90BB91BB81BB90BB91BB9AA +:1017D0000BB91BB90BB91BB90BB91BB90BB91BB9A9 +:1017E0000BB91BB90BB91BB90BB91BB81BB91982C3 +:1017F0008981883049F00BB989B11BB989818F5F24 +:10180000898389818830B9F71BB919828981883029 +:1018100079F190E00BB989B1990F8170982B1BB9C0 +:1018200089818F5F898389818830A1F74B9902C0B4 +:101830009F3F51F7CBB81BB80894411C511C8091B5 +:10184000F6079091F7074816590608F0A6CE80E0F3 +:1018500092E0A0E0B0E0680E791E8A1E9B1EC8CE02 +:1018600090E0919383E0EC31F80709F0E2CEF9CEF5 +:1018700090E0DCCF90E0D4CE2F923F924F925F92D7 +:101880007F928F929F92AF92BF92CF92DF92EF9210 +:10189000FF920F931F93DF93CF93CDB7DEB72D97B2 +:1018A0000FB6F894DEBF0FBECDBF998788877B87C0 +:1018B0006A875D874C87AA24BB2480E092E09F83DF +:1018C0008E832224332444245524CC24DD24760121 +:1018D00010E100E34B9989C280E141E050E060E013 +:1018E00070E00E94380840910D0850910E086091F8 +:1018F0000F08709110084C0D5D1D6E1D7F1D81E15C +:101900000E9438081BB919828981883009F467C29E +:1019100090E00BB989B1990F8170982B1BB989811F +:101920008F5F898389818830A1F74B9902C09E3FE0 +:1019300049F71BB919828981883009F452C290E0B5 +:101940000BB989B1990F8170982B1BB989818F5F71 +:10195000898389818830A1F71BB9198289818830F0 +:1019600049F00BB989B11BB989818F5F898389815E +:101970008830B9F71BB919828981883049F00BB9D1 +:1019800089B11BB989818F5F898389818830B9F7D3 +:10199000992309F4BFC1953009F4BCC19E3209F402 +:1019A000B9C1953E09F4B6C1892F81548A3120F01E +:1019B00090539A3008F0AEC140910D0850910E0836 +:1019C00060910F0870911008455F5F4F6F4F7F4F18 +:1019D0004C0D5D1D6E1D7F1D81E10E9438081BB9F5 +:1019E00019828981883009F4FEC190E00BB989B170 +:1019F000990F8170982B1BB989818F5F89838981A9 +:101A00008830A1F74B9902C09E3F49F71BB9198254 +:101A10008981883009F409C290E00BB989B1990F26 +:101A20008170982B1BB989818F5F89838981883068 +:101A3000A1F71BB919828981883049F00BB989B1A6 +:101A40001BB989818F5F898389818830B9F71BB978 +:101A500019828981883049F00BB989B11BB9898114 +:101A60008F5F898389818830B9F7892F8E7109F05A +:101A700051C19F3009F44EC180E144E050E060E084 +:101A800070E00E94380840910D0850910E08609156 +:101A90000F0870911008485F5F4F6F4F7F4F4C0DDC +:101AA0005D1D6E1D7F1D81E10E9438081BB91982E2 +:101AB0008981883009F4BBC190E00BB989B1990FD5 +:101AC0008170982B1BB989818F5F898389818830C8 +:101AD000A1F74B9902C09E3F49F71BB91982898132 +:101AE000883009F4B0C177240BB989B1770C8170C3 +:101AF000782A1BB989818F5F898389818830A1F712 +:101B00001BB919828981883009F497C188240BB9DF +:101B100089B1880C8170882A1BB989818F5F89837C +:101B200089818830A1F71BB919828981883009F42D +:101B300086C199240BB989B1990C8170982A1BB977 +:101B400089818F5F898389818830A1F7AA85BB85C8 +:101B5000AB2B09F465C11BB919828981883009F45E +:101B600070C190E00BB989B1990F8170982B1BB9A6 +:101B700089818F5F898389818830A1F7892F81705E +:101B8000880F880F880FEA85FB8580831BB919822F +:101B90008981883049F00BB989B11BB989818F5F80 +:101BA000898389818830B9F71BB919828981883086 +:101BB00049F00BB989B11BB989818F5F898389810C +:101BC0008830B9F780E144E050E060E070E00E94C6 +:101BD000380840910D0850910E0860910F087091DF +:101BE00010084A5E5F4F6F4F7F4F4C0D5D1D6E1D9D +:101BF0007F1D81E10E9438081BB9198289818830D4 +:101C000009F411C190E00BB989B1990F8170982B3B +:101C10001BB989818F5F898389818830A1F74B99AE +:101C200002C09E3F49F71BB919828981883009F4A7 +:101C300002C190E00BB989B1990F8170982B1BB943 +:101C400089818F5F898389818830A1F79A831BB945 +:101C500019828981883009F415C190E00BB989B1E6 +:101C6000990F8170982B1BB989818F5F8983898136 +:101C70008830A1F79B831BB919828981883009F4C8 +:101C8000FFC090E00BB989B1990F8170982B1BB9F7 +:101C900089818F5F898389818830A1F79C831BB9F3 +:101CA00019828981883009F4E9C090E00BB989B1C3 +:101CB000990F8170982B1BB989818F5F89838981E6 +:101CC0008830A1F79D831BB919828981883049F03A +:101CD0000BB989B11BB989818F5F8983898188306C +:101CE000B9F71BB919828981883049F00BB989B1DC +:101CF0001BB989818F5F898389818830B9F7A8856D +:101D0000B9858C91871531F411968C9111978815AE +:101D100009F49BC00894A11CB11C80E290E0A0E0F3 +:101D2000B0E0C80ED91EEA1EFB1E90E0A91692E094 +:101D3000B90609F0CFCDAE81BF81A050B24009F401 +:101D40004BC08C859D85892B09F446C080E148E015 +:101D500050E060E070E00E9438086E817F81660F7D +:101D6000771F62957295707F7627607F762780E077 +:101D700090E020910D0830910E0840910F0850918D +:101D80001008620F731F841F951F0E94880A20E0AD +:101D900030E040E150E34BB919828981883009F481 +:101DA00048C090E05BB989B1990F8170982B4BB90D +:101DB00089818F5F898389818830A1F7EC85FD85D2 +:101DC000E20FF31F90832F5F3F4F2830310519F743 +:101DD0000E94AC010E94AC016E817F8108C090E03E +:101DE000A4CD90E0B9CD90E00DCE60E072E0CB01E3 +:101DF0002D960FB6F894DEBF0FBECDBFCF91DF9109 +:101E00001F910F91FF90EF90DF90CF90BF90AF9018 +:101E10009F908F907F905F904F903F902F9008956C +:101E20000E94AC01B3CE90E0FACE90E002CE90E0FA +:101E300050CE90E0C3CF90E009CF882474CE99248F +:101E400085CE80E0A0CE77245BCE12968C9189154A +:101E500009F060CF2A813B818C819D81481659060B +:101E600040F08415950509F055CF2215330508F487 +:101E700051CFBF82AE8219012C014CCF90E022CF0E +:101E800090E00CCF90E0F6CE5F926F927F928F92AF +:101E90009F92AF92BF92CF92DF92EF92FF920F93F9 +:101EA0001F93DF93CF930F92CDB7DEB77C013B0139 +:101EB0004A01A22E502E4B9B11C00F90CF91DF9163 +:101EC0001F910F91FF90EF90DF90CF90BF90AF9058 +:101ED0009F908F907F906F905F90089580E142E097 +:101EE00050E060E070E00E94380840910D08509189 +:101EF0000E0860910F0870911008465E5F4F6F4F9B +:101F00007F4FEE0CFF1CE294F294F0EFFF22FE24D0 +:101F1000EF22FE24C701AA2797FDA095BA2F480FEC +:101F2000591F6A1F7B1F81E10E94380820E130E3BE +:101F30002BB919828981883009F41AC190E03BB924 +:101F400089B1990F8170982B2BB989818F5F898313 +:101F500089818830A1F74B9902C09E3F49F780E103 +:101F60008BB919828981883009F407C190E020E398 +:101F700030E12BB989B1990F8170982B3BB98981D8 +:101F80008F5F898389818830A1F7692F70E080E1B4 +:101F90008BB919828981883009F4ECC090E020E384 +:101FA00030E12BB989B1990F8170982B3BB98981A8 +:101FB0008F5F898389818830A1F7592F40E09A018A +:101FC000260F371F80E18BB919828981883059F03B +:101FD00040E390E14BB989B19BB989818F5F8983D7 +:101FE00089818830B9F780E18BB91982898188307D +:101FF00059F040E390E14BB989B19BB989818F5F7A +:10200000898389818830B9F7AA2009F4ADC0CC242E +:10201000DD2410E100E3C814D90408F088C0089456 +:10202000C11CD11CC601652D70E00E945728B62E38 +:10203000A90160E070E0440F551F661F771F809173 +:10204000FF0790910008A0910108B0910208480F85 +:10205000591F6A1F7B1F81E10E9438081BB9198232 +:102060008981883009F46BC090E00BB989B1990F70 +:102070008170982B1BB989818F5F89838981883012 +:10208000A1F74B9902C09E3F49F71BB9198289817C +:10209000883009F466C090E00BB989B1990F81705E +:1020A000982B1BB989818F5F898389818830A1F73B +:1020B000492F50E01BB919828981883009F44EC03C +:1020C00090E00BB989B1990F8170982B1BB9898168 +:1020D0008F5F898389818830A1F7F92EEE249701DB +:1020E000240F351F1BB919828981883049F00BB93B +:1020F00089B11BB989818F5F898389818830B9F75C +:102100001BB919828981883049F00BB989B11BB993 +:1021100089818F5F898389818830B9F7BA1489F002 +:10212000FFEF273F3F0718F4AB1408F074CF80E1AE +:1021300040E052E060E070E00E943808BECE90E0DF +:10214000A0CFC601652D70E00E945728FC01EE0F5C +:10215000FF1FE60DF71D31832083E2CFEE24FF241D +:10216000BECF40E050E0A6CFF301318320834FCFB4 +:1021700090E0F1CE40E050E022CF60E070E007CF89 +:10218000AF92BF92CF92DF92EF92FF920F931F9385 +:10219000DF93CF930F92CDB7DEB7182FB62EA42EB4 +:1021A000309114014B99EDC3E42EFF24E294F29494 +:1021B00000EFF022FE24E022FE24E60EF11C67016F +:1021C000032E02C0D694C7940A94E2F7C60163E2D4 +:1021D00070E00E944328262F8091F807681709F0C5 +:1021E000DCC382E08BB91BB8C60163E270E00E94D9 +:1021F0004328FC01EE0FFF1FED5EF74F4081518138 +:102200004250504060E070E004C0440F551F661F0C +:10221000771F3A95D2F78091030890E00197E82262 +:10222000F922C701A0E0B0E0480F591F6A1F7B1FC9 +:10223000A9E0440F551F661F771FAA95D1F780911B +:10224000FB079091FC07A091FD07B091FE07480F96 +:10225000591F6A1F7B1F88E10E94380880E18BB9F3 +:1022600090E39BB98BB99BB98BB99BB98BB99BB9DF +:102270008BB99BB98BB99BB98BB99BB98BB99BB9FE +:102280001BB88BB99BB98BB99BB98BB99BB98BB96F +:102290009BB98BB99BB98BB99BB98BB99BB91BB84F +:1022A00080E28BB91BB880E090E030E120E340E1B0 +:1022B0003BB950E32BB90196803B9105C1F71BB8A0 +:1022C0001BB880E28BB91BB88BB91BB88BB91BB894 +:1022D0008BB91BB88BB91BB88BB94BB95BB94BB970 +:1022E0005BB91BB84BB95BB94BB95BB94BB95BB9BF +:1022F0004BB95BB94BB95BB94BB95BB91BB88BB97F +:102300001BB88BB91BB84BB95BB94BB95BB94BB9AF +:102310005BB94BB95BB94BB95BB94BB95BB94BB95D +:102320005BB94BB95BB91BB81BB88BB91BB88BB980 +:102330004BB95BB94BB95BB94BB95BB94BB95BB93D +:102340004BB95BB94BB95BB91BB84BB95BB94BB96E +:102350005BB91BB88BB91BB88BB94BB95BB94BB91F +:102360005BB94BB95BB94BB95BB91BB84BB95BB93E +:102370004BB95BB94BB95BB94BB95BB91BB88BB9FE +:102380001BB88BB94BB95BB94BB95BB91BB84BB92F +:102390005BB94BB95BB94BB95BB94BB95BB94BB9DD +:1023A0005BB94BB95BB91BB88BB91BB88BB91BB800 +:1023B0004BB95BB94BB95BB94BB95BB94BB95BB9BD +:1023C0004BB95BB94BB95BB94BB95BB94BB95BB9AD +:1023D0001BB81BB88BB91BB88BB94BB95BB94BB9E0 +:1023E0005BB94BB95BB94BB95BB94BB95BB94BB98D +:1023F0005BB91BB84BB95BB94BB95BB91BB88BB9AF +:102400001BB88BB94BB95BB94BB95BB94BB95BB96D +:102410004BB95BB91BB84BB95BB94BB95BB94BB99D +:102420005BB94BB95BB91BB88BB91BB88BB94BB94E +:102430005BB94BB95BB91BB84BB95BB94BB95BB96D +:102440004BB95BB94BB95BB94BB95BB94BB95BB92C +:102450001BB88BB91BB88BB91BB84BB95BB94BB95F +:102460005BB91BB88BB94BB95BB91BB88BB94BB90E +:102470005BB91BB88BB94BB95BB91BB84BB95BB92E +:102480001BB88BB94BB95BB91BB88BB94BB95BB9EE +:102490001BB88BB94BB95BB91BB88BB91BB84BB91F +:1024A0005BB91BB88BB91BB88BB94BB95BB91BB8FF +:1024B0008BB94BB95BB94BB95BB91BB88BB91BB8BE +:1024C0004BB95BB94BB95BB94BB95BB94BB95BB9AC +:1024D0004BB95BB94BB95BB94BB95BB94BB95BB99C +:1024E0001BB84BB95BB94BB95BB94BB95BB94BB9CD +:1024F0005BB94BB95BB94BB95BB94BB95BB91BB8AD +:102500008BB91BB89A2D96959A6A4BB95BB996FD13 +:102510005CC21BB88BB920E12BB980E38BB994FD69 +:102520008AC21BB880E28BB920E12BB980E38BB95A +:1025300092FD7EC21BB880E28BB920E12BB980E30B +:102540008BB990FD72C21BB880E28BB91BB89A2D73 +:102550009A6A20E12BB980E38BB996FD71C21BB852 +:1025600080E28BB920E12BB980E38BB994FD5AC28C +:102570001BB880E28BB920E12BB980E38BB992FDC7 +:102580004EC21BB880E28BB920E12BB980E38BB936 +:1025900090FD42C21BB880E28BB91BB89B2D96956B +:1025A0009A6A20E12BB980E38BB996FD55C21BB81E +:1025B00080E28BB920E12BB980E38BB994FD29C26D +:1025C0001BB880E28BB920E12BB980E38BB992FD77 +:1025D0001DC21BB880E28BB920E12BB980E38BB917 +:1025E00090FD11C21BB880E28BB91BB89B2D9A6A73 +:1025F00020E12BB980E38BB996FD2BC21BB880E29A +:102600008BB920E12BB980E38BB994FDF9C11BB8DC +:1026100080E28BB920E12BB980E38BB992FDEDC14B +:102620001BB880E28BB920E12BB980E38BB990FD18 +:10263000E1C11BB880E28BB91BB82EEF2B252A25F0 +:10264000922F96959A6A30E13BB980E38BB996FD5B +:10265000FDC11BB880E28BB930E13BB980E38BB997 +:1026600094FDC5C11BB880E28BB930E13BB980E372 +:102670008BB992FDB9C11BB880E28BB930E13BB98F +:1026800080E38BB990FDADC11BB880E28BB91BB85C +:10269000922F9A6A20E12BB980E38BB996FDD3C1C2 +:1026A0001BB880E28BB920E12BB980E38BB994FD94 +:1026B00095C11BB880E28BB920E12BB980E38BB9BF +:1026C00092FD89C11BB880E28BB920E12BB980E370 +:1026D0008BB990FD7DC11BB880E28BB91BB880E13E +:1026E0008BB990E39BB98BB99BB91BB820E22BB98E +:1026F0008BB99BB98BB99BB98BB99BB98BB99BB97A +:102700001BB82BB91BB88BB99BB91BB82BB98BB9AC +:102710009BB91BB82BB98BB99BB91BB82BB98BB91B +:102720009BB91BB82BB91BB88BB99BB98BB99BB99B +:102730008BB99BB91BB82BB98BB99BB91BB82BB9FB +:102740008BB99BB98BB99BB91BB88BB99BB98BB9AA +:102750009BB98BB99BB98BB99BB98BB99BB98BB919 +:102760009BB98BB99BB98BB99BB91BB88BB99BB97A +:102770008BB99BB98BB99BB98BB99BB98BB99BB9F9 +:102780008BB99BB98BB99BB98BB99BB91BB88BB96A +:102790009BB98BB99BB98BB99BB98BB99BB98BB9D9 +:1027A0009BB98BB99BB98BB99BB98BB99BB91BB83A +:1027B0008BB99BB98BB99BB98BB99BB98BB99BB9B9 +:1027C0008BB99BB98BB99BB98BB99BB98BB99BB9A9 +:1027D0001BB88BB99BB98BB99BB98BB99BB98BB91A +:1027E0009BB98BB99BB98BB99BB98BB99BB98BB989 +:1027F0009BB91BB8212F30E08EE591E0289FF001B6 +:10280000299FF00D389FF00D1124E45EFE4F20E06B +:1028100030E050E140E390E225C01BB89BB986FD53 +:1028200028C01BB89BB985FD28C01BB89BB984FD87 +:1028300028C01BB89BB983FD28C01BB89BB982FD7B +:1028400028C01BB89BB981FD28C01BB89BB980FF6D +:1028500028C05BB94BB92F5F3F4F319681E02D35D2 +:10286000380741F1808187FFD8CF5BB94BB986FF2C +:10287000D8CF5BB94BB985FFD8CF5BB94BB984FFD3 +:10288000D8CF5BB94BB983FFD8CF5BB94BB982FFC7 +:10289000D8CF5BB94BB981FFD8CF5BB94BB980FDBD +:1028A000D8CF1BB89BB92F5F3F4F319681E02D35B4 +:1028B0003807C1F61BB880E090E030E120E33BB977 +:1028C0002BB9019680379105D1F71BB880E090E0D5 +:1028D00020E21BB82BB9019633E080309307C9F78B +:1028E0001BB880E18BB990E39BB98BB99BB98BB9CD +:1028F0009BB98BB99BB98BB99BB98BB99BB98BB978 +:102900009BB98BB99BB91BB88BB99BB98BB99BB9D8 +:102910008BB99BB98BB99BB98BB99BB98BB99BB957 +:102920008BB99BB98BB99BB91BB88BB919828981BB +:10293000883059F020E390E12BB989B19BB98981A6 +:102940008F5F898389818830B9F720E130E32BB923 +:1029500019828981883009F471C090E03BB989B14E +:10296000990F8170982B2BB989818F5F8983898119 +:102970008830A1F74B9902C09F3F49F782E08BB99D +:102980001BB80F90CF91DF911F910F91FF90EF90A7 +:10299000DF90CF90BF90AF9008956093F80740917B +:1029A000030850E0415D5D4F02C0559547953A954B +:1029B000E2F7809105089091060863E178E003E270 +:1029C0000E94440F309114010CCC4BB95BB9A3CDDC +:1029D0002BB98BB983CE2BB98BB977CE2BB98BB9E9 +:1029E0006BCE3BB98BB953CE3BB98BB947CE3BB914 +:1029F0008BB93BCE2BB98BB91FCE2BB98BB913CE6C +:102A00002BB98BB907CE2BB98BB9EFCD2BB98BB9BD +:102A1000E3CD2BB98BB9D7CD2BB98BB9BECD2BB9A3 +:102A20008BB9B2CD2BB98BB9A6CD2BB98BB98ECDC5 +:102A30002BB98BB982CD2BB98BB976CD90E09ACFDB +:102A40002BB98BB98FCD2BB98BB92DCE3BB98BB9A7 +:102A500003CE2BB98BB9D5CD2BB98BB9ABCD4B9957 +:102A600014C060910F016F3F89F4809110018F3F76 +:102A700091F4809111018F3F71F4809112018F3F89 +:102A800051F4809113018F3F31F4089580E040911B +:102A900016010E94C0108FEF80930F0180931601E2 +:102AA00010921E01609110016F3F29F081E040916A +:102AB00017010E94C0108FEF8093100180931701BF +:102AC00010927C02609111016F3F29F082E04091E9 +:102AD00018010E94C0108FEF80931101809318019C +:102AE0001092DA03609112016F3F29F083E0409168 +:102AF00019010E94C0108FEF809312018093190179 +:102B000010923805609113016F3F29F084E04091E5 +:102B10001A010E94C0108FEF8093130180931A0155 +:102B200010929606109215018CE191E09093120894 +:102B30008093110808954B9925C040911501A42F49 +:102B4000B0E08FEA90E0A89FF001A99FF00DB89F38 +:102B5000F00D1124EE0FFF1FE25EFE4F80818D3AD3 +:102B600061F150E08FEA90E0489FF001499FF00D3D +:102B7000589FF00D1124EE0FFF1FE25EFE4F808183 +:102B8000863909F008958EE591E0489FF001499F4C +:102B9000F00D589FF00D1124E45EFE4F878190E008 +:102BA00085759070880F991F20852575282B209397 +:102BB0000C0181E080931B01089580911B01882303 +:102BC00071F59091F907FD01E15FFE4F9083AA5ED8 +:102BD000BE4F80910B08869586958C939F3081F12E +:102BE0009D3071F1892F8F5F8F708093F90744308A +:102BF00059F14F5F40931501242F30E08EE591E0AD +:102C0000BC01269FC001279F900D369F900D112477 +:102C1000845E9E4F9093120880931108A2CF8091FA +:102C20000C018093F90710921B018F3009F099CFA6 +:102C30000E94350181E080930C084091150191CFED +:102C4000892F8E5F8F70D1CF0E9435010E942F1582 +:102C500081E080930C084091150183CF2F923F9221 +:102C60004F925F926F927F928F929F92AF92BF929C +:102C7000CF92DF92EF92FF920F931F93DF93CF9348 +:102C80000F92CDB7DEB72B013C011A0169014B9BB6 +:102C900014C00F90CF91DF911F910F91FF90EF9093 +:102CA000DF90CF90BF90AF909F908F907F906F906C +:102CB0005F904F903F902F90089580E140E052E068 +:102CC00060E070E00E943808812C7EEF972E7FEF45 +:102CD000A72E7FEFB72E84209520A620B72081E174 +:102CE000B501A4010E94380820E130E32BB9198214 +:102CF0008981883009F443C190E03BB989B1990FCB +:102D00008170982B2BB989818F5F89838981883065 +:102D1000A1F74B9902C09E3F49F70CE111E0F80181 +:102D200020E130E32BB919828981883009F41AC176 +:102D300090E03BB989B1990F8170982B2BB98981AB +:102D40008F5F898389818830A1F791936CE1E62EAA +:102D500063E0F62EEE15FF0529F780E18BB91982A5 +:102D60008981883059F020E390E12BB989B19BB972 +:102D700089818F5F898389818830B9F780E18BB938 +:102D800019828981883059F020E390E12BB989B10B +:102D90009BB989818F5F898389818830B9F7B201B6 +:102DA0007170645E7E4FC114D10479F020E030E090 +:102DB000FB01E20FF31FD101A20FB31F8C9180839F +:102DC0002F5F3F4F2C153D0598F382E08BB91BB860 +:102DD00088E1B501A4010E94380880E18BB990E335 +:102DE0009BB98BB99BB98BB99BB98BB99BB98BB983 +:102DF0009BB98BB99BB98BB99BB98BB99BB91BB8E4 +:102E00008BB99BB98BB99BB98BB99BB98BB99BB962 +:102E10008BB99BB98BB99BB98BB99BB91BB880E2B5 +:102E20008BB91BB830E120E390E224C01BB89BB9FA +:102E300086FD28C01BB89BB985FD28C01BB89BB96F +:102E400084FD28C01BB89BB983FD28C01BB89BB963 +:102E500082FD28C01BB89BB981FD28C01BB89BB957 +:102E600080FF28C03BB92BB91BB80F5F1F4FE0167E +:102E7000F10641F1F801808187FFD8CF3BB92BB92A +:102E800086FFD8CF3BB92BB985FFD8CF3BB92BB93B +:102E900084FFD8CF3BB92BB983FFD8CF3BB92BB92F +:102EA00082FFD8CF3BB92BB981FFD8CF3BB92BB923 +:102EB00080FDD8CF1BB89BB91BB80F5F1F4FE01622 +:102EC000F106C1F680E18BB990E39BB98BB99BB950 +:102ED0008BB99BB98BB99BB98BB99BB98BB99BB992 +:102EE0008BB99BB98BB99BB91BB88BB99BB98BB903 +:102EF0009BB98BB99BB98BB99BB98BB99BB98BB972 +:102F00009BB98BB99BB98BB99BB91BB88BB919828B +:102F10008981883059F020E390E12BB989B19BB9C0 +:102F200089818F5F898389818830B9F720E130E317 +:102F30002BB919828981883001F190E03BB989B1C0 +:102F4000990F8170982B2BB989818F5F8983898133 +:102F50008830A1F74B9902C09F3F51F782E08BB9AF +:102F60001BB897CE90E091936CE1E62E63E0F62ECD +:102F7000EE15FF0509F0D6CEF0CE90E0EBCF90E055 +:102F8000C8CE6F927F928F929F92AF92BF92CF9254 +:102F9000DF92EF92FF920F931F93DF93CF93CDB702 +:102FA000DEB7A5970FB6F894DEBF0FBECDBFDC012C +:102FB0004B990CC116E0612E712C6C0E7D1EF30135 +:102FC000CE0186961192E817F907E1F78C918E836E +:102FD00011968C9111978F8312968C9112978887F6 +:102FE00013968C911397898714968C9114978A87DE +:102FF00015968C9115978B8716968C9116978C87C2 +:1030000017968C918D878EE48E8789E48F8783E471 +:10301000888B80E090E6A4E0B0E0F301848F958F88 +:10302000A68FB78F88249924AA24BB24650110E1B8 +:1030300000E380E141E050E060E070E00E94380889 +:1030400040910D0850910E0860910F087091100882 +:103050004A0D5B1D6C1D7D1D81E10E9438081BB966 +:1030600019828981883009F4CBC090E00BB989B10D +:10307000990F8170982B1BB989818F5F8983898112 +:103080008830A1F74B9902C09E3F49F71BB91982BE +:103090008981883009F4B8C0FF240BB989B1FF0CCD +:1030A0008170F82A1BB989818F5F89838981883073 +:1030B000A1F71BB919828981883049F00BB989B110 +:1030C0001BB989818F5F898389818830B9F71BB9E2 +:1030D00019828981883049F00BB989B11BB989817E +:1030E0008F5F898389818830B9F740910D085091AD +:1030F0000E0860910F0870911008455F5F4F6F4F89 +:103100007F4F4A0D5B1D6C1D7D1D81E10E943808BB +:103110001BB919828981883009F470C090E00BB91D +:1031200089B1990F8170982B1BB989818F5F898331 +:1031300089818830A1F74B9902C09E3F49F71BB99E +:1031400019828981883009F45DC090E00BB989B19A +:10315000990F8170982B1BB989818F5F8983898131 +:103160008830A1F71BB919828981883049F00BB9E1 +:1031700089B11BB989818F5F898389818830B9F7CB +:103180001BB919828981883049F00BB989B11BB903 +:1031900089818F5F898389818830B9F7F5EEFF16C1 +:1031A00011F0FF2011F49F3089F50894811C911CC7 +:1031B00080E290E0A0E0B0E0A80EB91ECA1EDB1EBF +:1031C00090E0891692E0990609F033CF20E030E0D4 +:1031D000C901A5960FB6F894DEBF0FBECDBFCF9143 +:1031E000DF911F910F91FF90EF90DF90CF90BF90F4 +:1031F000AF909F908F907F906F90089590E09BCFBD +:1032000090E040CF90E0AECFFF2453CF60910D0807 +:1032100070910E0880910F08909110086A0D7B1D27 +:103220008C1D9D1DA30120E230E00E942E166090AF +:103230000D0870900E0880900F08909010088AE199 +:1032400090E0A0E0B0E0680E791E8A1E9B1E6A0C1A +:103250007B1C8C1C9D1C82E090E0A0E0B0E08A8387 +:103260009B83AC83BD838091030890E0815D9D4F7B +:103270000090140102C0959587950A94E2F7892B76 +:1032800009F4A4C0AA24BB2410E100E3A2E0EA2EC2 +:10329000F12CEC0EFD1E80E142E050E060E070E0B9 +:1032A0000E9438084A815B816C817D81440F551FE3 +:1032B000661F771F8091FF0790910008A091010879 +:1032C000B0910208480F591F6A1F7B1F81E10E94BD +:1032D00038081BB919828981883009F484C090E0CC +:1032E0000BB989B1990F8170982B1BB989818F5FB8 +:1032F000898389818830A1F74B9902C09E3F49F7A5 +:103300001BB919828981883009F493C090E00BB908 +:1033100089B1990F8170982B1BB989818F5F89833F +:1033200089818830A1F7292F30E01BB91982898162 +:10333000883009F47BC090E00BB989B1990F817096 +:10334000982B1BB989818F5F898389818830A1F788 +:10335000D92ECC241BB919828981883049F00BB948 +:1033600089B11BB989818F5F898389818830B9F7D9 +:103370001BB919828981883049F00BB989B11BB911 +:1033800089818F5F898389818830B9F72C0D3D1D34 +:10339000232B59F12A813B814C815D812F5F3F4F67 +:1033A0004F4F5F4F2A833B834C835D83809103089B +:1033B00090E0815D9D4F0090140102C09595879526 +:1033C0000A94E2F7A816B90608F465CFC401B30160 +:1033D00049E051E022E030E00E942E160E94B00A3F +:1033E00021E030E0F5CE90E087CF0894A11CB11C1D +:1033F000C401B301A70122E030E00E942E162A8109 +:103400003B814C815D8139014A01660C771C881C27 +:10341000991C8091FF0790910008A0910108B0913C +:103420000208680E791E8A1E9B1EB8CFCC24DD24AC +:1034300091CF20E030E079CF2F923F924F925F9270 +:103440006F927F928F929F92AF92BF92CF92DF92B4 +:10345000EF92FF920F931F93DF93CF93CDB7DEB719 +:103460002B970FB6F894DEBF0FBECDBFBCE14B2E3D +:10347000B3E05B2E2C9A8FEF809304088093F807BB +:1034800048865986F2015FEF519383E0E233F807F3 +:10349000D9F783E0809332038CEF8093330350930A +:1034A00034033FE3309335032FEC2093360393EF3F +:1034B00090933703809338035093390330933A0342 +:1034C00020933B0390933C0380933D0345ED409351 +:1034D0003E039AEA90933F0386E9809340033EEDD2 +:1034E0003093490390934A032BEE20934B03509360 +:1034F0004C0350934D0350934E0350934F035093FE +:10350000500340935103909352038DEA80935303E9 +:103510003093AB049093AC042093AD045093AE046D +:103520005093AF045093B0045093B1045093B2043D +:103530005093B3045093B4045093B5045093B6041D +:103540005093B7045093B8045093B9045093BA04FD +:103550005093BB04ECEBF4E01192ACE1AA2EA5E091 +:10356000BA2EEA15FB05C1F780E140E052E060E0C9 +:1035700070E00E9438081C821B821A82E0E1FE2E55 +:1035800070E3E72E60E2962E85B18F2585B9AC8178 +:10359000A695AA6AAF83EA81FB81EE0FFF1FFE8327 +:1035A000ED8322243324FC81FA6AFA878C819EEF12 +:1035B00089278B87822DF101E455FE4F84904B992A +:1035C000AEC020FCCDC08695CA80DB80C80ED11C61 +:1035D000309114013601032E02C0769467940A9448 +:1035E000E2F7C30162E170E00E944328262F809138 +:1035F0000408681709F052C2C30162E170E00E943A +:103600004328FC01EE0FFF1FE45EFA4F4081518119 +:103610004250504060E070E004C0440F551F661FE8 +:10362000771F3A95D2F78091030890E00197C8225E +:10363000D922C601A0E0B0E0480F591F6A1F7B1FC6 +:1036400039E0440F551F661F771F3A95D1F78091D7 +:10365000FB079091FC07A091FD07B091FE07480F72 +:10366000591F6A1F7B1F81E10E943808FBB819822D +:103670008981883009F42AC290E0EBB889B1990FAA +:103680008170982BFBB889818F5F8983898188300D +:10369000A1F74B9902C09E3F49F7ECE1F1E04B994D +:1036A0003EC0FBB819828981883009F451C090E08E +:1036B000EBB889B1990F8170982BFBB889818F5F26 +:1036C000898389818830A1F79193A3E0EC31FA07CF +:1036D00031F70E94AC010E94AC010CE111E042C044 +:1036E00090E04B9903C09F3F09F0ACC182E08BB9D9 +:1036F0001BB80894211C311C90E12916310409F0F3 +:1037000059CFAC81AF5FAC83EA81FB813896FB83F4 +:10371000EA83A33209F038CF0E9405012C982B963A +:103720000FB6F894DEBF0FBECDBFCF91DF911F91D2 +:103730000F91FF90EF90DF90CF90BF90AF909F9050 +:103740008F907F906F905F904F903F902F90089553 +:1037500090E09193A3E0EC31FA0709F0A0CFB9CF44 +:103760000CE112E0C82CDD248FEFF20185A39EEF5F +:1037700096A3AF81A7A3BA85B0A7C60196958795F2 +:103780008A6A81A7882D8A6A82A79B859825892FB6 +:1037900086958A6A83A79A6A94A7980140E050E0C8 +:1037A00060E015C090E0872B892B6827E62FF0E0BA +:1037B000E459FF4FE491DA01AC5ABC4FEC934F5FF0 +:1037C0005F4F2F5F3F4F682F4635510521F1D901DB +:1037D000EC91F0E0E370F070E054FE4F74912A5ADF +:1037E0003F4FD901EC9126553040F0E0E370F07086 +:1037F000EC53FE4F849144355105A0F624553F4FBC +:10380000D901EC912C5A3040F0E0E370F070E853AD +:10381000FE4F9491C8CF982F20E030E0F801E20FDE +:10382000F31F8081869586959827E92FF0E0E4596B +:10383000FF4FE491D901A655BC4FEC932F5F3F4F4A +:10384000982FB1E020303B0749F7E82FF0E0E4592A +:10385000FF4FE491E093AA04ED81FE81CE0EDF1EBE +:10386000309114013601032E02C0769467940A94B5 +:10387000E2F7C30163E270E00E944328262F8091A3 +:10388000F807681709F0F2C0F2E0FBB91BB8C301F2 +:1038900063E270E00E944328FC01EE0FFF1FED5E23 +:1038A000F74F408151814250504060E070E004C0C9 +:1038B000440F551F661F771F3A95D2F78091030872 +:1038C00090E00197C822D922C601A0E0B0E0480FDD +:1038D000591F6A1F7B1F09E0440F551F661F771F82 +:1038E0000A95D1F78091FB079091FC07A091FD0705 +:1038F000B091FE07480F591F6A1F7B1F88E10E9485 +:103900003808FBB8EBB8FBB8EBB8FBB8EBB8FBB8C2 +:10391000EBB8FBB8EBB8FBB8EBB8FBB8EBB8FBB84F +:10392000EBB81BB8FBB8EBB8FBB8EBB8FBB8EBB81F +:10393000FBB8EBB8FBB8EBB8FBB8EBB8FBB8EBB82F +:103940001BB89BB81BB828853985C901FC0122C06A +:103950001BB89BB886FD27C01BB89BB885FD27C048 +:103960001BB89BB884FD27C01BB89BB883FD27C03C +:103970001BB89BB882FD27C01BB89BB881FD27C030 +:103980001BB89BB880FF27C0FBB8EBB83196AE16CA +:10399000BF0639F14B99C3CE808187FFD9CFFBB8E1 +:1039A000EBB886FFD9CFFBB8EBB885FFD9CFFBB812 +:1039B000EBB884FFD9CFFBB8EBB883FFD9CFFBB806 +:1039C000EBB882FFD9CFFBB8EBB881FFD9CFFBB8FA +:1039D000EBB880FDD9CF1BB89BB83196AE16BF06A9 +:1039E000C9F61BB8FBB8EBB8FBB8EBB8FBB8EBB843 +:1039F000FBB8EBB8FBB8EBB8FBB8EBB8FBB8EBB86F +:103A0000FBB8EBB81BB8FBB8EBB8FBB8EBB8FBB82E +:103A1000EBB8FBB8EBB8FBB8EBB8FBB8EBB8FBB84E +:103A2000EBB8FBB8EBB81BB8FBB8198289818830BA +:103A300049F0EBB889B1FBB889818F5F89838981AF +:103A40008830B9F7FBB819828981883009F448CEEB +:103A500090E0EBB889B1990F8170982BFBB8898100 +:103A60008F5F898389818830A1F73BCE6093F80707 +:103A70004091030850E0415D5D4F02C05595479568 +:103A80003A95E2F7809105089091060863E178E0A5 +:103A900003E20E94440F30911401F6CE60930408B3 +:103AA0004091030850E0495E5E4F02C0559547952E +:103AB0003A95E2F78091F2079091F3076CE175E097 +:103AC00002E10E94440F3091140196CD90E0E1CDC7 +:103AD000CF92DF92EF92FF920F931F93DF93CF93DA +:103AE000CDB7DEB72E970FB6F894DEBF0FBECDBFB1 +:103AF00010925B0880E385B982E08BB900E010E0AA +:103B0000B2E3EB2EA2E1FA2EEBB881E090E00E9446 +:103B10008627FBB881E090E00E9486270F5F1F4F49 +:103B2000083C110589F71BB880E040E050E060E0F8 +:103B300070E00E94380300E1F0E3FF2E4B9992C53C +:103B40000BB981E090E00E94862719828981883034 +:103B5000A9F310E0FBB881E090E00E94862789B1CC +:103B6000110F8170182B0BB981E090E00E9486271D +:103B700089818F5F89838981883061F71130F1F6FF +:103B800082E08BB900E1E0E3FE2E70E2E72E62E016 +:103B9000D62E4B9967C51BB80BB981E090E00E9407 +:103BA0008627FBB881E090E00E9486270BB981E070 +:103BB00090E00E948627FBB881E090E00E94862773 +:103BC0000BB981E090E00E948627FBB881E090E08D +:103BD0000E9486270BB981E090E00E948627FBB8FF +:103BE00081E090E00E9486270BB981E090E00E947E +:103BF0008627FBB881E090E00E9486270BB981E020 +:103C000090E00E948627FBB881E090E00E94862722 +:103C10000BB981E090E00E948627FBB881E090E03C +:103C20000E9486270BB981E090E00E948627FBB8AE +:103C300081E090E00E9486271BB81BB881E090E0ED +:103C40000E948627EBB881E090E00E9486270BB99E +:103C500081E090E00E948627FBB881E090E00E941E +:103C600086270BB981E090E00E948627FBB881E0AF +:103C700090E00E9486270BB981E090E00E948627A1 +:103C8000FBB881E090E00E9486271BB881E090E0BD +:103C90000E948627EBB881E090E00E9486270BB94E +:103CA00081E090E00E948627FBB881E090E00E94CE +:103CB00086270BB981E090E00E948627FBB881E05F +:103CC00090E00E9486270BB981E090E00E94862751 +:103CD000FBB881E090E00E9486271BB81BB881E00A +:103CE00090E00E948627EBB881E090E00E94862752 +:103CF0001BB881E090E00E948627EBB881E090E05D +:103D00000E9486271BB881E090E00E948627EBB8CE +:103D100081E090E00E9486271BB881E090E00E943D +:103D20008627EBB881E090E00E9486271BB881E0EF +:103D300090E00E948627EBB881E090E00E94862701 +:103D40001BB881E090E00E948627EBB881E090E00C +:103D50000E9486271BB881E090E00E948627EBB87E +:103D600081E090E00E9486271BB881E090E00E94ED +:103D70008627EBB881E090E00E9486271BB81BB82D +:103D800081E090E00E948627EBB881E090E00E94FD +:103D900086271BB881E090E00E948627EBB881E07F +:103DA00090E00E9486271BB881E090E00E94862761 +:103DB000EBB881E090E00E9486271BB881E090E09C +:103DC0000E948627EBB881E090E00E9486271BB80E +:103DD00081E090E00E948627EBB881E090E00E94AD +:103DE00086271BB881E090E00E948627EBB881E02F +:103DF00090E00E9486271BB881E090E00E94862711 +:103E0000EBB881E090E00E9486271BB881E090E04B +:103E10000E948627EBB881E090E00E9486271BB8BD +:103E20001BB881E090E00E948627EBB881E090E02B +:103E30000E9486271BB881E090E00E948627EBB89D +:103E400081E090E00E9486271BB881E090E00E940C +:103E50008627EBB881E090E00E9486271BB881E0BE +:103E600090E00E948627EBB881E090E00E948627D0 +:103E70001BB881E090E00E948627EBB881E090E0DB +:103E80000E9486271BB881E090E00E948627EBB84D +:103E900081E090E00E9486271BB881E090E00E94BC +:103EA0008627EBB881E090E00E9486271BB881E06E +:103EB00090E00E948627EBB881E090E00E94862780 +:103EC0001BB81BB881E090E00E948627EBB881E028 +:103ED00090E00E9486271BB881E090E00E94862730 +:103EE000EBB881E090E00E9486271BB881E090E06B +:103EF0000E948627EBB881E090E00E9486271BB8DD +:103F000081E090E00E948627EBB881E090E00E947B +:103F100086271BB881E090E00E948627EBB881E0FD +:103F200090E00E9486271BB881E090E00E948627DF +:103F3000EBB881E090E00E9486271BB881E090E01A +:103F40000E948627EBB881E090E00E9486271BB88C +:103F500081E090E00E948627EBB881E090E00E942B +:103F600086271BB80BB981E090E00E948627FBB83A +:103F700081E090E00E9486271BB881E090E00E94DB +:103F80008627EBB881E090E00E9486271BB881E08D +:103F900090E00E948627EBB881E090E00E9486279F +:103FA0000BB981E090E00E948627FBB881E090E0A9 +:103FB0000E9486271BB881E090E00E948627EBB81C +:103FC00081E090E00E9486270BB981E090E00E949A +:103FD0008627FBB881E090E00E9486271BB881E02D +:103FE00090E00E948627EBB881E090E00E9486274F +:103FF0000BB981E090E00E948627FBB881E090E059 +:104000000E9486271BB80BB981E090E00E948627AA +:10401000FBB881E090E00E9486270BB981E090E038 +:104020000E948627FBB881E090E00E9486270BB9AA +:1040300081E090E00E948627FBB881E090E00E943A +:1040400086270BB981E090E00E948627FBB881E0CB +:1040500090E00E9486270BB981E090E00E948627BD +:10406000FBB881E090E00E9486270BB981E090E0E8 +:104070000E948627FBB881E090E00E9486270BB95A +:1040800081E090E00E948627FBB881E090E00E94EA +:1040900086270BB981E090E00E948627FBB881E07B +:1040A00090E00E9486271BB80BB981E090E00E9447 +:1040B000862719828981883009F4E3C210E0FBB8B1 +:1040C00081E090E00E94862789B1110F8170182B42 +:1040D0000BB981E090E00E94862789818F5F8983F8 +:1040E0008981883061F7812F4B99BCC217FDDCCFE5 +:1040F0008F3F09F4B7C28E7F09F04BCDDBB81BB8F8 +:104100000BB981E090E00E948627FBB881E090E047 +:104110000E9486270BB981E090E00E948627FBB8B9 +:1041200081E090E00E9486270BB981E090E00E9438 +:104130008627FBB881E090E00E9486270BB981E0DA +:1041400090E00E948627FBB881E090E00E948627DD +:104150000BB981E090E00E948627FBB881E090E0F7 +:104160000E9486270BB981E090E00E948627FBB869 +:1041700081E090E00E9486270BB981E090E00E94E8 +:104180008627FBB881E090E00E9486270BB981E08A +:1041900090E00E948627FBB881E090E00E9486278D +:1041A0001BB81BB881E090E00E948627EBB881E045 +:1041B00090E00E9486270BB981E090E00E9486275C +:1041C000FBB881E090E00E9486270BB981E090E087 +:1041D0000E948627FBB881E090E00E9486271BB8EA +:1041E00081E090E00E948627EBB881E090E00E9499 +:1041F00086270BB981E090E00E948627FBB881E01A +:1042000090E00E9486271BB881E090E00E948627FC +:10421000EBB881E090E00E9486271BB881E090E037 +:104220000E948627EBB881E090E00E9486270BB9B8 +:1042300081E090E00E948627FBB881E090E00E9438 +:1042400086271BB81BB881E090E00E948627EBB858 +:1042500081E090E00E9486271BB881E090E00E94F8 +:104260008627EBB881E090E00E9486271BB881E0AA +:1042700090E00E948627EBB881E090E00E948627BC +:104280001BB881E090E00E948627EBB881E090E0C7 +:104290000E9486271BB881E090E00E948627EBB839 +:1042A00081E090E00E9486271BB881E090E00E94A8 +:1042B0008627EBB881E090E00E9486271BB881E05A +:1042C00090E00E948627EBB881E090E00E9486276C +:1042D0001BB881E090E00E948627EBB881E090E077 +:1042E0000E9486271BB81BB881E090E00E948627B9 +:1042F000EBB881E090E00E9486271BB881E090E057 +:104300000E948627EBB881E090E00E9486271BB8C8 +:1043100081E090E00E948627EBB881E090E00E9467 +:1043200086271BB881E090E00E948627EBB881E0E9 +:1043300090E00E9486271BB881E090E00E948627CB +:10434000EBB881E090E00E9486271BB881E090E006 +:104350000E948627EBB881E090E00E9486271BB878 +:1043600081E090E00E948627EBB881E090E00E9417 +:1043700086271BB881E090E00E948627EBB881E099 +:1043800090E00E9486271BB81BB881E090E00E9455 +:104390008627EBB881E090E00E9486271BB881E079 +:1043A00090E00E948627EBB881E090E00E9486278B +:1043B0001BB881E090E00E948627EBB881E090E096 +:1043C0000E9486271BB881E090E00E948627EBB808 +:1043D00081E090E00E9486271BB881E090E00E9477 +:1043E0008627EBB881E090E00E9486271BB881E029 +:1043F00090E00E948627EBB881E090E00E9486273B +:104400001BB881E090E00E948627EBB881E090E045 +:104410000E9486271BB881E090E00E948627EBB8B7 +:1044200081E090E00E9486271BB81BB881E090E0F5 +:104430000E948627EBB881E090E00E9486271BB897 +:1044400081E090E00E948627EBB881E090E00E9436 +:1044500086271BB881E090E00E948627EBB881E0B8 +:1044600090E00E9486271BB881E090E00E9486279A +:10447000EBB881E090E00E9486271BB881E090E0D5 +:104480000E948627EBB881E090E00E9486271BB847 +:1044900081E090E00E948627EBB881E090E00E94E6 +:1044A00086271BB881E090E00E948627EBB881E068 +:1044B00090E00E9486271BB881E090E00E9486274A +:1044C000EBB881E090E00E9486271BB80BB981E031 +:1044D00090E00E948627FBB881E090E00E9486274A +:1044E0001BB881E090E00E948627EBB881E090E065 +:1044F0000E9486271BB881E090E00E948627EBB8D7 +:1045000081E090E00E9486270BB981E090E00E9454 +:104510008627FBB881E090E00E9486271BB881E0E7 +:1045200090E00E948627EBB881E090E00E94862709 +:104530000BB981E090E00E948627FBB881E090E013 +:104540000E9486271BB881E090E00E948627EBB886 +:1045500081E090E00E9486270BB981E090E00E9404 +:104560008627FBB881E090E00E9486271BB80BB934 +:1045700081E090E00E948627FBB881E090E00E94F5 +:1045800086270BB981E090E00E948627FBB881E086 +:1045900090E00E9486270BB981E090E00E94862778 +:1045A000FBB881E090E00E9486270BB981E090E0A3 +:1045B0000E948627FBB881E090E00E9486270BB915 +:1045C00081E090E00E948627FBB881E090E00E94A5 +:1045D00086270BB981E090E00E948627FBB881E036 +:1045E00090E00E9486270BB981E090E00E94862728 +:1045F000FBB881E090E00E9486270BB981E090E053 +:104600000E948627FBB881E090E00E9486271BB8B5 +:104610000BB981E090E00E94862719828981883059 +:1046200099F110E0FBB881E090E00E94862789B103 +:10463000110F8170182B0BB981E090E00E94862742 +:1046400089818F5F89838981883061F7812F4B99B8 +:1046500009C017FDDDCF8823D1F08F3F19F0DBB8FB +:104660004B9B99CA2E960FB6F894DEBF0FBECDBFF6 +:10467000CF91DF911F910F91FF90EF90DF90CF903E +:10468000089510E080E030CD10E080E0E0CF80E1E0 +:1046900045E050E060E070E00E94380866E370E0BA +:1046A00080E090E00E94880AFE01329657E0C52E15 +:1046B000D12CCC0EDD1E20E130E32BB9198289818B +:1046C000883009F47FC190E03BB989B1990F8170BE +:1046D000982B2BB989818F5F898389818830A1F7D5 +:1046E0009193EC15FD0549F70E94AC010E94AC01C5 +:1046F0008A81863421F48B81813409F465C180E19B +:1047000044E050E060E070E00E94380866EC71E040 +:1047100080E090E00E94880A0E94AC0190E0A0E056 +:10472000B0E08093070890930808A0930908B0931D +:104730000A080E94AC0190E0A0E0B0E0BA2FA92FD7 +:10474000982F882720910708309108084091090880 +:1047500050910A08280F391F4A1F5B1F2093070832 +:10476000309308084093090850930A080E94AC014E +:1047700090E0A0E0B0E0DC019927882720910708AD +:10478000309108084091090850910A08280F391FF4 +:104790004A1F5B1F209307083093080840930908BD +:1047A00050930A080E94AC01809107089091080874 +:1047B000A0910908B0910A0829E0880F991FAA1F43 +:1047C000BB1F2A95D1F78093070890930808A09300 +:1047D0000908B0930A080E94AC010E94AC014B99F1 +:1047E00041CF80E143E050E060E070E00E94380893 +:1047F00060910708709108088091090890910A0853 +:10480000635F7F4F8F4F9F4F0E94880A0E94AC01C9 +:1048100089838981809303081092140189818130F2 +:1048200051F090E09F5F89818695898389818130ED +:10483000C9F7909314010E94AC01082F10E00E9468 +:10484000AC01F82E0E94AC010E94AC019F2D80E0CB +:10485000800F911FA0E0B0E009E0880F991FAA1F08 +:10486000BB1F0A95D1F720910708309108084091A5 +:10487000090850910A08820F931FA41FB51F809347 +:10488000FF0790930008A0930108B09302084B998A +:10489000E9CE80E142E050E060E070E00E9438083C +:1048A00060910708709108088091090890910A08A2 +:1048B0006A5E7F4F8F4F9F4F0E94880A0E94AC0113 +:1048C0008093F6071092F7070E94AC01382F20E082 +:1048D0008091F6079091F707820F931F9093F70747 +:1048E0008093F6070E94AC010E94AC018091F6070C +:1048F0009091F707A0E0B0E01AE0880F991FAA1F77 +:10490000BB1F1A95D1F72091FF0730910008409105 +:10491000010850910208820F931FA41FB51F8093B6 +:104920000D0890930E08A0930F08B09310088050C4 +:10493000904CAF4FBF4F8093FB079093FC07A09321 +:10494000FD07B093FE074B998DCE80E091E069E5BD +:1049500078E040E050E00E943C0C9C0190930608F7 +:10496000809305082050324009F443C04B997ACE19 +:104970008FEF8093F807809304081092F507109248 +:10498000F40710925A081092FA0711E010930C08DD +:1049900010920B081092F9071092150110921B014A +:1049A0008CE191E0909312088093110880E140E03F +:1049B00052E060E070E00E9438080E940501109308 +:1049C0005B0850CE90E08CCE8C81843509F097CE78 +:1049D0008D81813309F093CE8E81863309F08FCE9D +:1049E00010920708109208081092090810920A08FD +:1049F000F6CE84E091E060E070E0A6010E943C0CFD +:104A00009C019093F3078093F2072050324009F401 +:104A100029CEC6010E94C117892B09F423CE80E05C +:104A200091E069E578E040E050E00E943C0C9C0198 +:104A300090930608809305082050324009F412CE66 +:104A40000E941C1A93CF4B9B0CC080E090E0A5E025 +:104A5000B0E004C00197A109B10999F04B99FACFD0 +:104A6000089580915B088823D9F780E090E0A5E065 +:104A7000B0E004C00197A109B10971F04B9BFACFD6 +:104A8000089580916E008E7F80936E00E89810925A +:104A90005B0810920C080895F8940E94681D80919C +:104AA0005B08882331F080916E00816080936E00F6 +:104AB000E89A789408955F926F927F928F929F9276 +:104AC000AF92BF92CF92DF92EF92FF920F931F931C +:104AD000DF93CF930F92CDB7DEB780E184B98AE040 +:104AE00087B982E38AB980E385B982E088B91BB8C7 +:104AF0001092F90710925B0810925A081092590808 +:104B00001092F5071092F4071092FA0791E0909333 +:104B10000C0810920B081092150110921B015CE119 +:104B2000652E51E0752E709212086092110817BC24 +:104B300014BC95BD85BF8093690040E3A42E30E18D +:104B4000B32E88248A942BE8522E90E2992E4B9B08 +:104B500018C08FEF9FEFA4E0B0E00CC00197A1094F +:104B6000B1098F3F2FEF92072FEFA2072FEFB20768 +:104B700009F41CC14B99F2CF309B1BC095B84B99DF +:104B8000E8CF80915B088823B9F78FEF9FEFA4E00F +:104B9000B0E00CC00197A109B1098F3F2FEF920738 +:104BA0002FEFA2072FEFB20709F411C14B9BF2CFF1 +:104BB000E3CFA5B893B19F7090930E0180910D0142 +:104BC000981771F090930D01983009F4CAC0943091 +:104BD00009F4F7C0923009F4F8C0913009F48EC19D +:104BE00080915B08882309F4B2CF80910C08882358 +:104BF00009F4ADCFF8943091F9073F5F3F703093DF +:104C0000F90710910B0816951695E12EFF24E294F2 +:104C1000F29480EFF822FE24E822FE24E30EF11C39 +:104C2000E091140167010E2E02C0D694C7940A9435 +:104C3000E2F7C60163E270E00E944328262F8091CC +:104C4000F8076817B9F06093F8074091030850E03F +:104C5000415D5D4F02C055954795EA95E2F7809119 +:104C600005089091060863E178E003E20E94440F92 +:104C70003091F907C60163E270E00E944328FC010D +:104C8000EE0FFF1FED5EF74FC080D18060910F01E6 +:104C9000631709F4ABC080911001381709F40AC1F9 +:104CA00080911101381709F40FC180911201381752 +:104CB00009F414C180911301381709F419C18EEF5A +:104CC0009FEFC80ED91EA60160E070E000901401AD +:104CD00004C0440F551F661F771F0A94D2F78091B6 +:104CE000030890E00197E822F922C701A0E0B0E0B4 +:104CF000480F591F6A1F7B1F19E0440F551F661F7D +:104D0000771F1A95D1F78091FB079091FC07A0912E +:104D1000FD07B091FE07480F591F6A1F7B1F81E1F5 +:104D20000E943808BBB819828981883009F44BC0C9 +:104D300090E0ABB889B1990F8170982BBBB889818D +:104D40008F5F898389818830A1F74B9902C09E3F8C +:104D500049F71092F5071092F40710920C08789416 +:104D6000F6CE82E030910B08830F8770E82FE6952E +:104D7000F0E0E859FF4F249190930D0180FF0CC0A3 +:104D8000822F8F7083FD886F830F80930B08853C83 +:104D900038F010920B0824CF822F82958F70F2CFBB +:104DA0008C3808F41DCF50920B081ACF80916E00FA +:104DB0008E7F80936E00E89810925B0810920C082A +:104DC000DBCE84E0CFCF90E0C0CF86E0CBCFF894AD +:104DD0000E94681D80915B08882331F080916E00ED +:104DE000816080936E00E89A7894C6CE8091160117 +:104DF000811709F050CF4B9962CF6F3F09F080C007 +:104E0000809110018F3F69F4809111018F3F49F427 +:104E1000809112018F3F29F4809113018F3F09F493 +:104E20004ECF80920F018092160110921E01609168 +:104E300010016F3F29F081E0409117010E94C010DE +:104E4000809210018092170110927C0260911101F2 +:104E50006F3F29F082E0409118010E94C0108092BB +:104E60001101809218011092DA03609112016F3FD4 +:104E700029F083E0409119010E94C0108092120134 +:104E80008092190110923805609113016F3F29F04B +:104E900084E040911A010E94C01080921301809218 +:104EA0001A011092960610921501709212086092E3 +:104EB000110805CF80911701811709F49CCF8091CB +:104EC0001101381709F0F1CE80911801811709F40A +:104ED00092CF80911201381709F0ECCE8091190120 +:104EE000811709F488CF80911301381709F0E7CEB4 +:104EF00080911A01811709F0E2CE7DCF80E032CF98 +:104F000080E0409116010E94C0108BCF28E1000084 +:104F10002A95E9F70197D1F70895000000000000F5 +:104F2000000000000000000000000895AF93AFB73C +:104F3000AF93BF932F93A0915A0820915908A22BA9 +:104F4000A8B9AAEAA6BD20E0E8DFA0915908A8B94F +:104F5000B0910C08BB2341F020935A082F91BF91C8 +:104F6000AF91AFBFAF911895A0E3ABB9A9B1A17054 +:104F7000AA0F2A2FA0E1ABB9A091F407B091F507D1 +:104F80001196A093F407B093F507A03989F4BC30CB +:104F900079F4A1E0A0930C08CF93C0E7A8E0B0E3B8 +:104FA000BBB9B0E1BBB9AA95D1F7CA95B9F7CF9112 +:104FB00020935A082F91BF91AF91AFBFAF91189531 +:104FC0002F932FB72F9330995AC03F933091FA0700 +:104FD00026B124702327E1F326B124702093FA0729 +:104FE00028E02A95F1F700004F935F936F937F932A +:104FF0008F93EF93FF9360E0E0911108F091120816 +:105000003DE541E00DC05091FA0776B17470752707 +:10501000E1F376B174707093FA077EE07A95F1F758 +:1050200027E081E079B17470D1F400007EE17A95D7 +:10503000F1F776B174705091FA077093FA077527FB +:1050400076957695880F872B2A9561F7853D09F42B +:1050500061E06030C1F2819331504040A1F69F93EE +:10506000AF93BF930E949B15BF91AF919F91FF910A +:10507000EF918F917F916F915F914F913F912F9120 +:105080002FBF2F911895AA1BBB1B51E107C0AA1F68 +:10509000BB1FA617B70710F0A61BB70B881F991FD9 +:1050A0005A95A9F780959095BC01CD01089597FB7D +:1050B000092E07260AD077FD04D0E5DF06D00020B0 +:1050C0001AF4709561957F4F0895F6F79095819544 +:0850D0009F4F0895F894FFCFF3 +:0C50D8004E49430044534B00FEFFFF0014 +:00000001FF diff --git a/sdisk2.pnproj b/sdisk2.pnproj new file mode 100644 index 0000000..5e3af9c --- /dev/null +++ b/sdisk2.pnproj @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sub.S b/sub.S new file mode 100644 index 0000000..e276f2e --- /dev/null +++ b/sub.S @@ -0,0 +1,280 @@ +/*------------------------------------------------------ + + DISK II Emulator Farmware (1 of 2) for ATMEGA328P + + 2009.11.16 by Koichi Nishida + +------------------------------------------------------*/ + +/* +This is a part of the firmware for DISK II emulator by Nishida Radio. + +Copyright (C) 2009 Koichi NISHIDA +email to Koichi NISHIDA: tulip-house@msf.biglobe.ne.jp + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* +if the crystal on your SDISK II is 25 MHz, +I recommend you to replace it with 27 MHz, +or ask Nishida Radio. +if you don't want to replace it, change the following to +.equ CRYSTAL, 25 +*/ + +.equ CRYSTAL, 27 + +.equ PINB, 0x03 +.equ DDRB, 0x04 +.equ PORTB, 0x05 +.equ PINC, 0x06 +.equ DDRC, 0x07 +.equ PORTC, 0x08 +.equ PIND, 0x09 +.equ DDRD, 0x0a +.equ PORTD, 0x0b +.equ SREG, 0x3f +.equ TCNT0, 0x26 + +.global __vector_1 +.global __vector_16 +.global wait5 + +.global readPulse +.global bitByte +.global sector +.global prepare +.global writeData +.global writeBack +.global writePtr + +.func wait5 +wait5: + ldi r18,24 +wait51: + nop + dec r18 + brne wait51 + sbiw r24,1 + brne wait5 + ret +.endfunc + +.func wait1 +wait1: + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 + nop ; 1 +.if CRYSTAL==25 + nop ; 1 +.endif + ret ; 4 +.endfunc + +.func __vector_16 +__vector_16: + push r26 + in r26, SREG + push r26 + push r27 + push r18 + lds r26,readPulse + lds r18,protect + or r26,r18 + out PORTC,r26 +.if CRYSTAL==27 + ldi r26,170 ; 1 +.else + ldi r26,180 ; 1 +.endif + out TCNT0,r26 ; 1 + ldi r18,0 ; 1 + rcall wait1 ; 11 + lds r26,protect ; 2 + out PORTC,r26 + lds r27,prepare + and r27,r27 + breq NOT_PREPARE + sts readPulse,r18 + pop r18 + pop r27 + pop r26 + out SREG,r26 + pop r26 + reti +NOT_PREPARE: + ldi r26,0b00110000 ; 1 + out PORTD,r26 ; 1 + in r26,PIND ; 1 + andi r26,1 ; 1 + lsl r26 ; 1 + mov r18,r26 ; 1 + ldi r26,0b00010000 ; 1 + out PORTD,r26 ; 1 + lds r26,bitbyte + lds r27,(bitbyte+1) + adiw r26,1 + sts bitbyte,r26 + sts (bitbyte+1),r27 + cpi r26,((402*8)%256) + brne LBL1 + cpi r27,((402*8)/256) + brne LBL1 + ; set prepare flag + ldi r26,1 + sts prepare,r26 + ; discard 112 byte (including CRC 2 byte) + push r28 + ldi r28,112 +DSC_LP2: + ldi r26,8 +DSC_LP1: + ldi r27,0b00110000 ; 1 + out PORTD,r27 ; 1 + ldi r27,0b00010000 ; 1 + out PORTD,r27 + dec r26 + brne DSC_LP1 + dec r28 + brne DSC_LP2 + pop r28 +LBL1: + sts readPulse,r18 + pop r18 + pop r27 + pop r26 + out SREG,r26 + pop r26 + reti +.endfunc + +.func __vector_1 +__vector_1: + push r18 ; 1 + in r18, SREG ; 1 + push r18 ; 1 + sbic PINC,0 + rjmp NOT_ENABLE + push r19 ; 2 + lds r19,magState; 2 +WLP8: + ; wait start bit 1 + in r18,PINC ; 1 + andi r18,4 ; 1 + eor r18,r19 ; 1 + breq WLP8 ; 2/1 + in r18,PINC ; 1 + andi r18,4 ; 1 + sts magState,r18; 2 + ldi r18, 8 ; 1 +WLP9: + dec r18 ; 1 + brne WLP9 ; 2 + nop ; 1 + push r20 ; 2 + push r21 ; 2 + push r22 ; 2 + push r23 ; 2 + push r24 ; 2 + push r30 ; 2 + push r31 ; 2 + ldi r22,0 ; 1 start storing + lds r30,(writePtr) + lds r31,(writePtr+1) + ldi r19,lo8(349) ;1 + ldi r20,hi8(349) ;1 + rjmp ENTR ; 2 +WLP2: + lds r21,magState; 2 +WLP6: + ; wait start bit 1 + in r23,PINC ; 1 + andi r23,4 ; 1 + eor r23,r21 ; 1 + breq WLP6 ; 2/1 + in r23,PINC ; 1 + andi r23,4 ; 1 + sts magState,r23; 2 + ldi r23, 14 ; 1 +WLP7: + dec r23 ; 1 + brne WLP7 ; 2 +ENTR: + ldi r18,7 ; 1 + ldi r24,1 ; 1 +WLP1: + in r23,PIND ; 1 + andi r23,4 ; 1 + brne WRITE_END ; 1 + nop ; 1 +.if CRYSTAL==27 + ldi r23, 30 ; 1 +.else + nop + ldi r23,27 ; 1 +.endif +WLP3: + dec r23 ; 1 + brne WLP3 ; 2 +WLP5: + in r23,PINC ; 1 + andi r23,4 ; 1 + lds r21,magState; 2 + sts magState,r23; 2 + eor r23,r21 ; 1 + lsr r23 ; 1 + lsr r23 ; 1 + lsl r24 ; 1 + or r24,r23 ; 1 + dec r18 ; 1 + brne WLP1 ; 2/1 + cpi r24,0xD5 ; 1 + brne NOT_START ; 2/1 + ldi r22,1 ; 1 +NOT_START: + cpi r22,0 ; 1 + breq WLP2 ; 1 + st Z+,r24 ; 2 + subi r19,1 ; 1 + sbci r20,0 ; 1 + brne WLP2 ; 2/1 +WRITE_END: + + push r25 + push r26 + push r27 + call writeBack + pop r27 + pop r26 + pop r25 + pop r31 + pop r30 + pop r24 + pop r23 + pop r22 + pop r21 + pop r20 + pop r19 +NOT_ENABLE: + pop r18 + out SREG,r18 + pop r18 + reti +.endfunc +